@testmuai/kane-cli 0.4.9 → 0.4.10
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/{ChromeProfilePicker-BOTCHMXH.js → ChromeProfilePicker-EFEVOCWS.js} +1 -1
- package/dist/{CliFeedbackPrompt-BV4VVYOY.js → CliFeedbackPrompt-PPGJMKHQ.js} +1 -1
- package/dist/{CliUploadProgress-Y4H43W5T.js → CliUploadProgress-3GGOTLPQ.js} +1 -1
- package/dist/{ConfigView-JPBD47MS.js → ConfigView-Y7E4Q647.js} +1 -1
- package/dist/FolderPicker-LI5JKG2S.js +2 -0
- package/dist/{HelpView-ZZYE2TKZ.js → HelpView-KHQYGSD2.js} +1 -1
- package/dist/{InfoBox-3ZLQZGUE.js → InfoBox-BQ2QOIUP.js} +1 -1
- package/dist/{LinksBox-UYMOQGSW.js → LinksBox-DX6BJAX5.js} +1 -1
- package/dist/{ProfilesView-YUMYSOZ4.js → ProfilesView-X35WWM4L.js} +1 -1
- package/dist/{ProjectPicker-CJVGBY42.js → ProjectPicker-Y4A4UVHA.js} +1 -1
- package/dist/{SaveSessionPrompt-DFVUWTOK.js → SaveSessionPrompt-IS6HZSF4.js} +1 -1
- package/dist/SingleShotApp-RO25ZX2E.js +2 -0
- package/dist/{SummaryBox-3VIRYWQA.js → SummaryBox-47MHU37V.js} +1 -1
- package/dist/TestMdRunView-OXVWHOV3.js +2 -0
- package/dist/{WhoamiView-GMM4V7ZV.js → WhoamiView-KVIQCGRC.js} +1 -1
- package/dist/{changelog-FNJ4P2IF.js → changelog-S4ZLEQLC.js} +1 -1
- package/dist/{chunk-QMAHNXS6.js → chunk-53O3GMZR.js} +1 -1
- package/dist/{chunk-JHSSBES2.js → chunk-6ATKQYAL.js} +1 -1
- package/dist/{chunk-UVBE3JJV.js → chunk-7GOX44H7.js} +1 -1
- package/dist/{chunk-FTMJTGT4.js → chunk-AKLIPQVR.js} +1 -1
- package/dist/{chunk-QW5G7TX3.js → chunk-AT45XB6X.js} +2 -2
- package/dist/{chunk-7N5H4KTV.js → chunk-BQACGLXW.js} +1 -1
- package/dist/{chunk-MUZCEGJD.js → chunk-DMG5QABA.js} +1 -1
- package/dist/{chunk-IO3PBDKN.js → chunk-EQC7WE2O.js} +1 -1
- package/dist/{chunk-42WWGBRK.js → chunk-FKAXPYV7.js} +1 -1
- package/dist/{chunk-DKGNV3VP.js → chunk-G2GQ67DP.js} +1 -1
- package/dist/{chunk-6PBX7QI7.js → chunk-G3PWEKD7.js} +2 -2
- package/dist/{chunk-WKJY6TRR.js → chunk-GF44B552.js} +1 -1
- package/dist/{chunk-CLRWPXDJ.js → chunk-GSKA5DKJ.js} +1 -1
- package/dist/{chunk-JBOXYLDH.js → chunk-HPZREZKG.js} +1 -1
- package/dist/{chunk-VSJAOEBB.js → chunk-HUAOH2JK.js} +1 -1
- package/dist/{chunk-RJFHOZG6.js → chunk-IGZPQQFP.js} +1 -1
- package/dist/{chunk-YK63DTUC.js → chunk-IS62CNJW.js} +2 -2
- package/dist/{chunk-GBTPZGJB.js → chunk-IT66S24L.js} +1 -1
- package/dist/{chunk-FN6ZRV4C.js → chunk-JKLKZCJS.js} +1 -1
- package/dist/{chunk-7NTOV5DV.js → chunk-KJLOYIWT.js} +1 -1
- package/dist/{chunk-HPJP7NES.js → chunk-KKIFXAJY.js} +1 -1
- package/dist/chunk-LRKWPAGK.js +2 -0
- package/dist/{chunk-DXJ5FL25.js → chunk-NAAPNSZD.js} +1 -1
- package/dist/{chunk-AH36DUIX.js → chunk-NUGGT2XH.js} +1 -1
- package/dist/{chunk-WEPNJVBA.js → chunk-OHT5RY5E.js} +1 -1
- package/dist/{chunk-JQXARCVE.js → chunk-QC73LMAN.js} +1 -1
- package/dist/{chunk-UJDIXFEE.js → chunk-QSXYNJOW.js} +1 -1
- package/dist/{chunk-LZUTY7XS.js → chunk-RB2YKN77.js} +1 -1
- package/dist/{chunk-HYOST7EA.js → chunk-RQZCGHG7.js} +1 -1
- package/dist/{chunk-JO3QZB6D.js → chunk-SQOIKS77.js} +2 -2
- package/dist/{chunk-XA7UFTB7.js → chunk-UAYCLUUZ.js} +3 -3
- package/dist/{chunk-CY4HAOSP.js → chunk-UBN6J3ZA.js} +1 -1
- package/dist/{chunk-KLVCLGHX.js → chunk-VLWWDXBN.js} +1 -1
- package/dist/{chunk-SEU6OXMD.js → chunk-XCOU6AYD.js} +1 -1
- package/dist/{chunk-LJDFBQFR.js → chunk-XCYCX4TU.js} +1 -1
- package/dist/{chunk-2J3VB6DW.js → chunk-YAOWO2GE.js} +1 -1
- package/dist/{generate-headless-ZRRQT56R.js → generate-headless-ODYT3HT7.js} +2 -2
- package/dist/index.js +8 -8
- package/dist/{list-commands-M3JL6XBB.js → list-commands-PNYMVI6X.js} +1 -1
- package/dist/login-flow-FIYH6K4A.js +2 -0
- package/dist/{persist-recorded-session-3I4KMEXA.js → persist-recorded-session-OJPXI4HP.js} +1 -1
- package/dist/{recording-banner-P6EKDS2Y.js → recording-banner-3XTXU2VL.js} +1 -1
- package/dist/{require-project-folder-SEMMD3EG.js → require-project-folder-CFX6U6BZ.js} +1 -1
- package/dist/{run-test-md-PXG4RFDI.js → run-test-md-YWKVMQDJ.js} +3 -3
- package/dist/{skill-installer-SU52XOIT.js → skill-installer-GYYMVNE4.js} +1 -1
- package/dist/tcg-generate-KLY7QZY2.js +2 -0
- package/dist/testmd-actions-OUY5BOAV.js +2 -0
- package/dist/token-refresh-QCHKMPCM.js +2 -0
- package/dist/{validate-basic-EKSOPOMF.js → validate-basic-4YMRWYLS.js} +1 -1
- package/dist/{version-check-4K4JHG7B.js → version-check-GU2LS6NM.js} +1 -1
- package/package.json +6 -6
- package/dist/FolderPicker-M4RFRBYV.js +0 -2
- package/dist/SingleShotApp-IOEEYVGJ.js +0 -2
- package/dist/TestMdRunView-MRSDDMSF.js +0 -2
- package/dist/chunk-3UCNDPTN.js +0 -2
- package/dist/login-flow-DOAIDKIV.js +0 -2
- package/dist/tcg-generate-5T6S2E7L.js +0 -2
- package/dist/testmd-actions-N7VS4FS6.js +0 -2
- package/dist/token-refresh-LSHPT46T.js +0 -2
|
@@ -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-KJLOYIWT.js";import"./chunk-IT66S24L.js";import"./chunk-LRKWPAGK.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{c as ChromeProfilePicker,b as formatChromeProfileLine,a as listChromeProfiles};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as r}from"./chunk-
|
|
2
|
+
import{a as r}from"./chunk-EQC7WE2O.js";import"./chunk-IT66S24L.js";import"./chunk-LRKWPAGK.js";import"./chunk-HCBYKLMW.js";import{c as e}from"./chunk-C44QQJR4.js";import{a as i}from"./chunk-6YGTRKDT.js";import{e as m}from"./chunk-UR6MHSHU.js";var t=m(i(),1);async function d(){return new Promise(o=>{let c=e(t.default.createElement(r,{onSubmit:n=>{c.unmount(),o(n)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{d as renderFeedbackPrompt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as P,b as g,c as f}from"./chunk-
|
|
2
|
+
import{a as P,b as g,c as f}from"./chunk-RQZCGHG7.js";import"./chunk-DMG5QABA.js";import"./chunk-LRKWPAGK.js";import{a as c}from"./chunk-HCBYKLMW.js";import{c as d}from"./chunk-C44QQJR4.js";import{a as h}from"./chunk-6YGTRKDT.js";import{e as p}from"./chunk-UR6MHSHU.js";var e=p(h(),1);var m=p(c(),1);function w({pipeline:t,buildShareUrl:r,onDone:o}){let[n,i]=(0,e.useState)(P()),[S,l]=(0,e.useState)("uploading"),[U,R]=(0,e.useState)(),[C,E]=(0,e.useState)();return(0,e.useEffect)(()=>{let x=t.config.onProgress;t.config.onProgress=(s,u,a)=>{x(s,u,a),i(y=>g(y,s,u,a))},t.execute().then(s=>{s.success?(R(r?.(s)),l("success")):(E(s.error),l("failed")),setTimeout(()=>o(s),1500)})},[]),(0,m.jsx)(f,{steps:n,status:S,testUrl:U,error:C})}async function O(t,r){return new Promise(o=>{let n=d(e.default.createElement(w,{pipeline:t,buildShareUrl:r,onDone:i=>{n.unmount(),o(i)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{O as renderUploadProgress};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as p,b as l,c as n}from"./chunk-
|
|
2
|
+
import{a as p,b as l,c as n}from"./chunk-QSXYNJOW.js";import{x as o}from"./chunk-LRKWPAGK.js";import{a as g}from"./chunk-HCBYKLMW.js";import{a,j as c}from"./chunk-C44QQJR4.js";import{a as R}from"./chunk-6YGTRKDT.js";import{e as t}from"./chunk-UR6MHSHU.js";var b=t(R(),1);var e=t(g(),1);function A({model:d,authLabel:v,profile:x,env:w,defaultUrl:u,projectId:r,projectName:s,folderId:i,folderName:f,windowSize:B,chromeProfile:C}){let h=r?s?`${s} (${r})`:r:"(none)",D=i?f?`${f} (${i})`:i:"(none)",{exit:m}=c();return(0,b.useEffect)(()=>{let P=setTimeout(()=>m(),50);return()=>clearTimeout(P)},[m]),(0,e.jsx)(a,{flexDirection:"column",children:(0,e.jsx)(p,{title:"Configuration",children:(0,e.jsxs)(a,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(n,{label:"Auth"}),(0,e.jsx)(l,{label:" method",value:v}),(0,e.jsx)(l,{label:" profile",value:x}),(0,e.jsx)(l,{label:" env",value:w}),(0,e.jsx)(n,{label:"Defaults"}),(0,e.jsx)(l,{label:" url",value:u??"(none)",valueColor:u?o.orange:o.dim}),(0,e.jsx)(l,{label:" model",value:d}),(0,e.jsx)(l,{label:" window",value:B}),(0,e.jsx)(l,{label:" project",value:h}),(0,e.jsx)(l,{label:" folder",value:D}),(0,e.jsx)(n,{label:"Paths"}),(0,e.jsx)(l,{label:" chrome",value:C,valueColor:o.dim})]})})})}export{A as ConfigView};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b}from"./chunk-VLWWDXBN.js";import"./chunk-YCCUBQY4.js";import"./chunk-YAOWO2GE.js";import"./chunk-LPUQ4HWQ.js";import"./chunk-NLCCBXXV.js";import"./chunk-KKIFXAJY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-IT66S24L.js";import"./chunk-LRKWPAGK.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 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as f,b as i,x as t}from"./chunk-
|
|
2
|
+
import{a as f,b as i,x as t}from"./chunk-LRKWPAGK.js";import{a as T}from"./chunk-HCBYKLMW.js";import{a as n,b as o,j as p,k as x}from"./chunk-C44QQJR4.js";import{a as b}from"./chunk-6YGTRKDT.js";import{e as h}from"./chunk-UR6MHSHU.js";var w=h(b(),1);var e=h(T(),1),S="https://www.testmuai.com/support/docs/kane-cli-introduction",v="https://github.com/LambdaTest/kane-cli/issues";function k(){let{exit:l}=p(),{stdout:r}=x(),c=r?.columns??80;return(0,w.useEffect)(()=>{let m=setTimeout(()=>l(),50);return()=>clearTimeout(m)},[l]),(0,e.jsxs)(n,{flexDirection:"column",children:[(0,e.jsxs)(n,{paddingX:1,paddingTop:1,flexDirection:"column",children:[(0,e.jsx)(o,{color:t.orange,bold:!0,children:i}),(0,e.jsxs)(n,{children:[(0,e.jsx)(o,{color:t.dim,children:"Browser automation powered by AI "}),(0,e.jsxs)(o,{color:t.muted,children:[" v",f]})]})]}),(0,e.jsx)(o,{children:" "}),(0,e.jsxs)(d,{title:"USAGE",children:[(0,e.jsx)(g,{cmd:`${i}`,desc:"Single-shot prompt (no args, TTY)"}),(0,e.jsx)(g,{cmd:`${i} --tui`,desc:"Full interactive TUI",highlight:!0}),(0,e.jsx)(g,{cmd:`${i} run "<objective>"`,desc:"Inline objective"}),(0,e.jsx)(g,{cmd:`${i} testmd run <path>.md`,desc:"Replay a saved *_test.md file"})]}),(0,e.jsxs)(d,{title:"HELP",children:[(0,e.jsx)(g,{cmd:`${i} --help`,desc:"Show this help (long form)"}),(0,e.jsx)(g,{cmd:`${i} -h`,desc:"Show this help (short form)"}),(0,e.jsx)(g,{cmd:`${i} help`,desc:"Show this help (subcommand form)"}),(0,e.jsxs)(n,{marginLeft:2,marginTop:0,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dim,children:["These are the only supported help invocations. Anything else (e.g. ",(0,e.jsx)(o,{color:t.orange,children:"-help"}),") is an unknown flag."]}),(0,e.jsxs)(o,{color:t.dim,children:["Terminal tab-completion is a shell feature; ",i," does not ship shell-completion scripts, so any flag your shell suggests is a generic guess \u2014 not from ",i,"."]})]})]}),(0,e.jsxs)(d,{title:"COMMANDS",children:[(0,e.jsx)(a,{cmd:"run",args:"<objective>",desc:"Run an objective (inline string)",highlight:!0}),(0,e.jsx)(a,{cmd:"testmd",args:"run|list|status|delete|export",desc:"Manage *_test.md files"}),(0,e.jsx)(a,{cmd:"login",desc:"Auth setup (interactive, --oauth, or --username)"}),(0,e.jsx)(a,{cmd:"logout",desc:"Revoke tokens + delete profile"}),(0,e.jsx)(a,{cmd:"whoami",desc:"Show authenticated identity"}),(0,e.jsx)(a,{cmd:"config",args:"show|set-mode|set-assertion-mode|\u2026",desc:"Chrome, run & generate settings"}),(0,e.jsx)(a,{cmd:"profiles",args:"list|switch|delete",desc:"Manage auth profiles"}),(0,e.jsx)(a,{cmd:"changelog",args:"[--all]",desc:"Show recent release notes"})]}),(0,e.jsxs)(d,{title:"TESTMD ACTIONS",children:[(0,e.jsx)(a,{cmd:"testmd run",args:"<path>",desc:"Replay a saved *_test.md file",highlight:!0}),(0,e.jsx)(a,{cmd:"testmd list",desc:"List *_test.md files in cwd (recursive)"}),(0,e.jsx)(a,{cmd:"testmd status",args:"<path>",desc:"Print local meta.json for a test"}),(0,e.jsx)(a,{cmd:"testmd delete",args:"<path>",desc:"Remove output-<stem>/ and the source file"}),(0,e.jsx)(a,{cmd:"testmd export",args:"<path> --language <py|js>",desc:"Generate standalone Playwright code"})]}),(0,e.jsxs)(d,{title:"RUN FLAGS",children:[(0,e.jsx)(s,{long:"--max-steps",arg:"<n>",desc:"Max agent steps (default: 30)"}),(0,e.jsx)(s,{long:"--timeout",arg:"<sec>",desc:"Kill run after N seconds"}),(0,e.jsx)(s,{long:"--headless",desc:"No visible browser window"}),(0,e.jsx)(s,{long:"--mode",arg:"<action|testing>",desc:"Run mode (default: testing)"}),(0,e.jsx)(s,{long:"--name",arg:"<name>",desc:"Persist session under this name"}),(0,e.jsx)(s,{long:"--variables",arg:"<json>",desc:"Inline variables as JSON"}),(0,e.jsx)(s,{long:"--variables-file",arg:"<path>",desc:"Load variables from file"}),(0,e.jsx)(s,{long:"--session-context",arg:"<json>",desc:"Prior runs context JSON"}),(0,e.jsx)(s,{long:"--global-context",arg:"<file>",desc:"Override global context markdown"}),(0,e.jsx)(s,{long:"--local-context",arg:"<file>",desc:"Override local context markdown"}),(0,e.jsx)(s,{long:"--ws-endpoint",arg:"<url>",desc:"Remote browser (LambdaTest)"}),(0,e.jsx)(s,{long:"--cdp-endpoint",arg:"<url>",desc:"Connect to existing Chrome CDP"}),(0,e.jsx)(s,{long:"--task-skills",desc:"Domain-specific task skills (experimental)"}),(0,e.jsx)(s,{long:"--code-export",desc:"Generate code export after upload"}),(0,e.jsx)(s,{long:"--code-language",arg:"<lang>",desc:"Code export language: python | javascript"}),(0,e.jsx)(s,{long:"--skip-code-validation",desc:"Skip post-codegen validation"}),(0,e.jsx)(s,{long:"--username",arg:"<user>",desc:"Basic auth (skip OAuth)"}),(0,e.jsx)(s,{long:"--access-key",arg:"<key>",desc:"Basic auth access key"}),(0,e.jsx)(s,{long:"--env",arg:"<name>",desc:"Environment (prod or stage)"}),(0,e.jsx)(s,{long:"--agent",desc:"NDJSON output (no UI)",highlight:!0})]}),(0,e.jsxs)(d,{title:"EXAMPLES",children:[(0,e.jsx)(u,{label:"Inline objective",cmd:`${i} run "Search for laptop"`}),(0,e.jsx)(u,{label:"Replay a saved test",cmd:`${i} testmd run smoke_test.md`}),(0,e.jsx)(u,{label:"Variables",cmd:`${i} run "Login as {{user}}" --variables '{"user":{"value":"alice"}}'`}),(0,e.jsx)(u,{label:"Agent mode (NDJSON)",cmd:`${i} run "Add to cart" --agent | jq .status`})]}),(0,e.jsx)(d,{title:"TEST FILES",children:(0,e.jsxs)(n,{marginLeft:2,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dim,children:[(0,e.jsx)(o,{color:t.orange,children:"*_test.md"})," \u2014 markdown test files with YAML frontmatter and ",(0,e.jsx)(o,{color:t.orange,children:"## "}),"step headings."]}),(0,e.jsxs)(o,{color:t.dim,children:["Run with ",(0,e.jsxs)(o,{color:t.orange,children:[i," testmd run path/to/foo_test.md"]}),". (`.md` paths are not accepted by `",i," run`.)"]}),(0,e.jsxs)(o,{color:t.dim,children:["Sessions you run in TUI auto-save to ",(0,e.jsx)(o,{color:t.orange,children:"<cwd>/.testmuai/tests/<name>_test.md"})," (testing mode prompts on exit)."]})]})}),(0,e.jsxs)(n,{flexDirection:"column",marginTop:0,paddingX:1,children:[(0,e.jsx)(o,{color:t.muted,children:"\u2500".repeat(Math.min(c-2,70))}),(0,e.jsxs)(n,{gap:3,children:[(0,e.jsxs)(n,{children:[(0,e.jsx)(o,{color:t.dim,children:"Docs "}),(0,e.jsx)(o,{color:t.orange,underline:!0,children:S})]}),(0,e.jsxs)(n,{children:[(0,e.jsx)(o,{color:t.dim,children:"Bugs "}),(0,e.jsx)(o,{color:t.orange,underline:!0,children:v})]})]})]}),(0,e.jsx)(o,{children:" "})]})}function d({title:l,children:r}){return(0,e.jsxs)(n,{flexDirection:"column",marginBottom:1,children:[(0,e.jsx)(n,{marginLeft:1,children:(0,e.jsx)(o,{bold:!0,color:t.dim,children:l})}),r]})}function g({cmd:l,desc:r,highlight:c}){return(0,e.jsxs)(n,{marginLeft:2,children:[(0,e.jsxs)(n,{width:40,children:[(0,e.jsx)(o,{color:t.dim,children:"$ "}),(0,e.jsx)(o,{color:c?t.orange:t.orange,children:l})]}),(0,e.jsx)(o,{color:t.dim,children:r})]})}function a({cmd:l,args:r,desc:c,highlight:m}){return(0,e.jsxs)(n,{marginLeft:2,children:[(0,e.jsx)(n,{width:16,children:(0,e.jsx)(o,{color:m?t.orange:t.green,bold:!0,children:l})}),(0,e.jsx)(n,{width:32,children:r?(0,e.jsx)(o,{color:t.dim,children:r}):null}),(0,e.jsx)(o,{color:t.dim,children:c})]})}function s({long:l,arg:r,desc:c,highlight:m}){return(0,e.jsxs)(n,{marginLeft:2,children:[(0,e.jsxs)(n,{width:30,children:[(0,e.jsx)(o,{color:m?t.orange:t.orange,children:l}),r&&(0,e.jsxs)(o,{color:t.dim,children:[" ",r]})]}),(0,e.jsx)(o,{color:t.dim,children:c})]})}function u({label:l,cmd:r}){return(0,e.jsxs)(n,{marginLeft:2,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dim,children:["# ",l]}),(0,e.jsxs)(o,{color:t.orange,children:["$ ",r]})]})}export{k as HelpView};
|
|
@@ -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-6ATKQYAL.js";import"./chunk-QSXYNJOW.js";import"./chunk-LRKWPAGK.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as InfoBox};
|
|
@@ -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-GSKA5DKJ.js";import"./chunk-LRKWPAGK.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as LinksBox};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-GF44B552.js";import"./chunk-IT66S24L.js";import"./chunk-LRKWPAGK.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProfilesView,a as formatProfileLine};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-OHT5RY5E.js";import"./chunk-YCCUBQY4.js";import"./chunk-YAOWO2GE.js";import"./chunk-LPUQ4HWQ.js";import"./chunk-NLCCBXXV.js";import"./chunk-KKIFXAJY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-IT66S24L.js";import"./chunk-LRKWPAGK.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProjectPicker,a as formatProjectLine};
|
|
@@ -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-NUGGT2XH.js";import"./chunk-S3DAAAE5.js";import"./chunk-6ATKQYAL.js";import"./chunk-QSXYNJOW.js";import"./chunk-LRKWPAGK.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as SaveSessionPrompt,b as defaultSessionTimestamp,c as renderSavePrompt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-HPZREZKG.js";import"./chunk-G2GQ67DP.js";import"./chunk-NAAPNSZD.js";import"./chunk-L5LI2JF4.js";import"./chunk-53O3GMZR.js";import"./chunk-FPFOW6BS.js";import"./chunk-WAOCHXJ5.js";import"./chunk-OHT5RY5E.js";import"./chunk-VLWWDXBN.js";import"./chunk-YCCUBQY4.js";import"./chunk-YAOWO2GE.js";import"./chunk-LOIRZFV3.js";import"./chunk-LPUQ4HWQ.js";import"./chunk-NLCCBXXV.js";import"./chunk-VE3SUJMA.js";import"./chunk-RB2YKN77.js";import"./chunk-IGZPQQFP.js";import"./chunk-KKIFXAJY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-IT66S24L.js";import"./chunk-LRKWPAGK.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as SingleShotApp};
|
|
@@ -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-UBN6J3ZA.js";import"./chunk-6ATKQYAL.js";import"./chunk-QSXYNJOW.js";import"./chunk-LRKWPAGK.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{d as AutoExitSummaryBox,c as SummaryBox,b as buildSummaryEvent,a as buildSummaryRendered};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{h as a}from"./chunk-XCOU6AYD.js";import"./chunk-BQACGLXW.js";import"./chunk-DMG5QABA.js";import"./chunk-LOIRZFV3.js";import"./chunk-KKIFXAJY.js";import"./chunk-6ATKQYAL.js";import"./chunk-QSXYNJOW.js";import"./chunk-C6S4IEBC.js";import"./chunk-LRKWPAGK.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as TestMdRunView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as b,b as r}from"./chunk-
|
|
2
|
+
import{a as b,b as r}from"./chunk-QSXYNJOW.js";import{x as o}from"./chunk-LRKWPAGK.js";import{a as p}from"./chunk-HCBYKLMW.js";import{a as i,b as l,j as s}from"./chunk-C44QQJR4.js";import{a as T}from"./chunk-6YGTRKDT.js";import{e as a}from"./chunk-UR6MHSHU.js";var f=a(T(),1);var e=a(p(),1);function V({profile:g,env:v,authenticated:n,authMethod:h,username:c,tokenStatus:t,expiresAt:d,serverStatus:u,detail:m}){let{exit:x}=s();return(0,f.useEffect)(()=>{let B=setTimeout(()=>x(),50);return()=>clearTimeout(B)},[x]),(0,e.jsx)(i,{flexDirection:"column",children:(0,e.jsx)(b,{title:"Identity",variant:n?"success":"warning",children:(0,e.jsxs)(i,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(i,{children:u==="rejected"?(0,e.jsx)(l,{color:o.red,bold:!0,children:"\u2717 Not authenticated"}):u==="unreachable"?(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Couldn't verify"}):n?(0,e.jsx)(l,{color:o.green,bold:!0,children:"\u2713 Authenticated"}):(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Not logged in"})}),(0,e.jsxs)(i,{flexDirection:"column",marginTop:1,children:[(0,e.jsx)(r,{label:"Profile",value:g}),(0,e.jsx)(r,{label:"Environment",value:v}),(0,e.jsx)(r,{label:"Method",value:h}),c&&(0,e.jsx)(r,{label:"User",value:c}),t&&(0,e.jsx)(r,{label:"Token",value:t,valueColor:t==="valid"?o.green:t==="expired"?o.red:o.dim}),d&&(0,e.jsx)(r,{label:"Expires",value:d}),m&&(0,e.jsx)(r,{label:"Detail",value:m})]})]})})})}export{V as WhoamiView};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as l}from"./chunk-RZ4F3BHX.js";import{c as i,f as c}from"./chunk-
|
|
2
|
+
import{a as l}from"./chunk-RZ4F3BHX.js";import{c as i,f as c}from"./chunk-LRKWPAGK.js";import"./chunk-UR6MHSHU.js";import{readFileSync as u,writeFileSync as g,mkdirSync as d}from"fs";import{join as f}from"path";var h=f(i,"changelog-cache.json"),p=3600*1e3;function y(){try{let e=JSON.parse(u(h,"utf-8"));if(Date.now()-e.cachedAt<p)return e}catch{}return null}function m(e){try{d(i,{recursive:!0}),g(h,JSON.stringify({entries:e,cachedAt:Date.now()}))}catch{}}async function A(e){try{let t=y();if(t){let r=t.entries;return e?.all?r:r.slice(0,5)}let n=new AbortController,o=setTimeout(()=>n.abort(),5e3),a=await l(`${c}?per_page=30`,{headers:{Accept:"application/vnd.github+json"},signal:n.signal});if(clearTimeout(o),!a.ok)return[];let s=(await a.json()).map(r=>({version:r.tag_name.replace(/^v/,""),date:r.published_at?r.published_at.slice(0,10):"",body:r.body??""}));return m(s),e?.all?s:s.slice(0,5)}catch{return[]}}function v(e){if(e.length===0)return"Could not fetch changelog. Visit https://github.com/LambdaTest/kane-cli/releases";let t=["kane-cli Changelog","\u2500".repeat(40),""];for(let n of e){if(t.push(`v${n.version} (${n.date})`),n.body){let o=n.body.split(`
|
|
3
3
|
`).filter(a=>a.trim());for(let a of o)t.push(` ${a}`)}t.push("")}return t.join(`
|
|
4
4
|
`)}export{A as fetchChangelog,v as formatChangelog};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as a,j as l}from"./chunk-
|
|
2
|
+
import{d as a,j as l}from"./chunk-LRKWPAGK.js";import{readFileSync as g,writeFileSync as o,mkdirSync as i,existsSync as p}from"fs";import{dirname as s}from"path";var n={window_size:{width:1920,height:1080},chrome_profile_path:"",default_url:l,model:"v16-alpha",project_id:null,project_name:null,folder_id:null,folder_name:null,mode:"testing",assertion_mode:"visual",network_ws:!1,network_sse:!1,code_export:{enabled:!0,language:"python",skip_validation:!0},generate:{scenario_limit:2,per_scenario_limit:3,memory_enabled:!1},last_seen_version:"",hints_enabled:!0},c=class{constructor(r=a){this.path=r}exists(){return p(this.path)}load(){try{let r=g(this.path,"utf-8"),e=JSON.parse(r);return{...n,...e,code_export:{...n.code_export,...e.code_export??{}},generate:{...n.generate,...e.generate??{}}}}catch{return{...n,code_export:{...n.code_export},generate:{...n.generate}}}}set(r,e){try{let t=this.load();t[r]=e,i(s(this.path),{recursive:!0}),o(this.path,JSON.stringify(t,null,2)+`
|
|
3
3
|
`)}catch(t){let d=t instanceof Error?t.message:String(t);process.stderr.write(`[config] Failed to save config: ${d}
|
|
4
4
|
`)}}save(r){try{let t={...this.load(),...r};i(s(this.path),{recursive:!0}),o(this.path,JSON.stringify(t,null,2)+`
|
|
5
5
|
`)}catch(e){let t=e instanceof Error?e.message:String(e);process.stderr.write(`[config] Failed to save config: ${t}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as u,b as x}from"./chunk-
|
|
2
|
+
import{a as u,b as x}from"./chunk-QSXYNJOW.js";import{x as m}from"./chunk-LRKWPAGK.js";import{a as f}from"./chunk-HCBYKLMW.js";import{a as r,b as i}from"./chunk-C44QQJR4.js";import{e as n}from"./chunk-UR6MHSHU.js";var e=n(f(),1);function C({title:B,titleColor:c,borderColor:d,variant:p,rows:s,footer:t,labelWidth:l=14,marginBottom:b=1}){return(0,e.jsxs)(u,{title:B,titleColor:c,borderColor:d,variant:p,marginBottom:b,children:[s.map((o,a)=>typeof o.value=="string"?(0,e.jsx)(x,{label:o.label,value:o.value,valueColor:o.valueColor,labelWidth:l},`${o.label}-${a}`):(0,e.jsxs)(r,{children:[(0,e.jsx)(r,{width:l,children:(0,e.jsx)(i,{color:m.dim,children:o.label})}),o.value]},`${o.label}-${a}`)),t&&(0,e.jsx)(r,{marginTop:1,children:t})]})}export{C as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as D}from"./chunk-
|
|
2
|
+
import{a as D}from"./chunk-RB2YKN77.js";import{a as A}from"./chunk-IGZPQQFP.js";import{p as S,q as C,r as P,s as U,t as N}from"./chunk-LRKWPAGK.js";import{createServer as Oe}from"http";import{randomBytes as He}from"crypto";import{URL as $e}from"url";import Z from"process";import{Buffer as ee}from"buffer";import re from"path";import{fileURLToPath as ke}from"url";import{promisify as Le}from"util";import te from"child_process";import Me,{constants as Ie}from"fs/promises";import Y from"process";import G,{constants as me}from"fs/promises";import j from"process";import le from"os";import L from"fs";import se from"fs";import z from"fs";var E;function ie(){try{return z.statSync("/.dockerenv"),!0}catch{return!1}}function ae(){try{return z.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function B(){return E===void 0&&(E=ie()||ae()),E}var k,ce=()=>{try{return se.statSync("/run/.containerenv"),!0}catch{return!1}};function u(){return k===void 0&&(k=ce()||B()),k}var K=()=>{if(j.platform!=="linux")return!1;if(le.release().toLowerCase().includes("microsoft"))return!u();try{if(L.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!u()}catch{}return L.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||L.existsSync("/run/WSL")?!u():!1},d=j.env.__IS_WSL_TEST__?K:K();var de=(()=>{let e="/mnt/",r;return async function(){if(r)return r;let t="/etc/wsl.conf",n=!1;try{await G.access(t,me.F_OK),n=!0}catch{}if(!n)return e;let o=await G.readFile(t,{encoding:"utf8"}),i=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(o);return i?(r=i.groups.mountPoint.trim(),r=r.endsWith("/")?r:`${r}/`,r):e}})(),fe=async()=>`${await de()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,M=async()=>d?fe():`${Y.env.SYSTEMROOT||Y.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;function f(e,r,t){let n=o=>Object.defineProperty(e,r,{value:o,enumerable:!0,writable:!0});return Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get(){let o=t();return n(o),o},set(o){n(o)}}),e}import{promisify as Pe}from"util";import O from"process";import{execFile as Ae}from"child_process";import{promisify as pe}from"util";import ue from"process";import{execFile as ge}from"child_process";var he=pe(ge);async function I(){if(ue.platform!=="darwin")throw new Error("macOS only");let{stdout:e}=await he("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),t=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??"com.apple.Safari";return t==="com.apple.safari"?"com.apple.Safari":t}import we from"process";import{promisify as xe}from"util";import{execFile as ye,execFileSync as cr}from"child_process";var ve=xe(ye);async function X(e,{humanReadableOutput:r=!0,signal:t}={}){if(we.platform!=="darwin")throw new Error("macOS only");let n=r?[]:["-ss"],o={};t&&(o.signal=t);let{stdout:i}=await ve("osascript",["-e",e,n],o);return i.trim()}async function T(e){return X(`tell application "Finder" to set app_path to application file id "${e}" as string
|
|
3
3
|
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as be}from"util";import{execFile as Se}from"child_process";var Ce=be(Se),y={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},ur=new Map(Object.entries(y)),F=class extends Error{};async function _(e=Ce){let{stdout:r}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),t=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(r);if(!t)throw new F(`Cannot find Windows browser in stdout: ${JSON.stringify(r)}`);let{id:n}=t.groups,o=n.lastIndexOf("."),i=n.lastIndexOf("-"),c=o===-1?void 0:n.slice(0,o),a=i===-1?void 0:n.slice(0,i);return y[n]??y[c]??y[a]??{name:n,id:n}}var Ee=Pe(Ae),Be=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,r=>r.toUpperCase());async function H(){if(O.platform==="darwin"){let e=await I();return{name:await T(e),id:e}}if(O.platform==="linux"){let{stdout:e}=await Ee("xdg-mime",["query","default","x-scheme-handler/http"]),r=e.trim();return{name:Be(r.replace(/.desktop$/,"").replace("-"," ")),id:r}}if(O.platform==="win32")return _();throw new Error("Only macOS, Linux, and Windows are supported")}var Te=Le(te.execFile),$=re.dirname(ke(import.meta.url)),q=re.join($,"xdg-open"),{platform:w,arch:V}=Z;async function Fe(){let e=await M(),r=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,t=ee.from(r,"utf16le").toString("base64"),{stdout:n}=await Te(e,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",t],{encoding:"utf8"}),o=n.trim(),i={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return i[o]?{id:i[o]}:{}}var J=async(e,r)=>{let t;for(let n of e)try{return await r(n)}catch(o){t=o}throw t},v=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return J(e.app,a=>v({...e,app:a}));let{name:r,arguments:t=[]}=e.app??{};if(t=[...t],Array.isArray(r))return J(r,a=>v({...e,app:{name:a,arguments:t}}));if(r==="browser"||r==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},l={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},s=d?await Fe():await H();if(s.id in a){let m=a[s.id];return r==="browserPrivate"&&t.push(l[m]),v({...e,app:{name:g[m],arguments:t}})}throw new Error(`${s.name} is not supported as a default browser`)}let n,o=[],i={};if(w==="darwin")n="open",e.wait&&o.push("--wait-apps"),e.background&&o.push("--background"),e.newInstance&&o.push("--new"),r&&o.push("-a",r);else if(w==="win32"||d&&!u()&&!r){n=await M(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),d||(i.windowsVerbatimArguments=!0);let a=["Start"];e.wait&&a.push("-Wait"),r?(a.push(`"\`"${r}\`""`),e.target&&t.push(e.target)):e.target&&a.push(`"${e.target}"`),t.length>0&&(t=t.map(l=>`"\`"${l}\`""`),a.push("-ArgumentList",t.join(","))),e.target=ee.from(a.join(" "),"utf16le").toString("base64")}else{if(r)n=r;else{let a=!$||$==="/",l=!1;try{await Me.access(q,Ie.X_OK),l=!0}catch{}n=Z.versions.electron??(w==="android"||a||!l)?"xdg-open":q}t.length>0&&o.push(...t),e.wait||(i.stdio="ignore",i.detached=!0)}w==="darwin"&&t.length>0&&o.push("--args",...t),e.target&&o.push(e.target);let c=te.spawn(n,o,i);return e.wait?new Promise((a,l)=>{c.once("error",l),c.once("close",s=>{if(!e.allowNonzeroExitCode&&s>0){l(new Error(`Exited with code ${s}`));return}a(c)})}):(c.unref(),c)},_e=(e,r)=>{if(typeof e!="string")throw new TypeError("Expected a `target`");return v({...r,target:e})};function Q(e){if(typeof e=="string"||Array.isArray(e))return e;let{[V]:r}=e;if(!r)throw new Error(`${V} is not supported`);return r}function b({[w]:e},{wsl:r}){if(r&&d)return Q(r);if(!e)throw new Error(`${w} is not supported`);return Q(e)}var g={};f(g,"chrome",()=>b({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));f(g,"brave",()=>b({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));f(g,"firefox",()=>b({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));f(g,"edge",()=>b({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));f(g,"browser",()=>"browser");f(g,"browserPrivate",()=>"browserPrivate");var oe=_e;var ne=class{profile;environment;creds;oauth;constructor(r="default",t="prod",n){this.profile=r,this.environment=t,this.creds=n??new D,this.oauth=new A(t)}async login(){let{server:r,port:t}=await this.startCallbackServer(),n=N(t);try{let o=this.creds.loadClient(this.profile,this.environment),i=o?.redirect_uris;(!o||!i?.includes(n))&&(o=await this.oauth.registerClient(n),this.creds.saveClient(this.profile,this.environment,o));let c=o.client_id,[a,l]=A.generatePkce(),s=He(32).toString("hex"),m=this.oauth.buildAuthorizationUrl(c,l,s,n),p=await this.waitForCallback(r,t,m,s);if(!p)throw new Error("Login cancelled or timed out");let h=await this.oauth.exchangeCode(p,c,a,n),x={access_token:h.access_token,refresh_token:h.refresh_token,expires_at:Math.floor(Date.now()/1e3)+h.expires_in,scope:h.scope??"*"};return this.creds.saveCredentials(this.profile,this.environment,x),this.creds.setActiveProfile(this.profile),x}catch(o){throw r.close(),o}}startCallbackServer(){return new Promise((r,t)=>{let n=C,o=()=>{let i=Oe();i.on("error",c=>{c.code==="EADDRINUSE"&&n<P?(n++,o()):t(new Error(`Failed to start callback server: ${c.message}. Ports ${C}-${P} are all in use.`))}),i.listen(n,S,()=>{r({server:i,port:n})})};o()})}waitForCallback(r,t,n,o){return new Promise(i=>{let c=!1,a=setTimeout(()=>l(null),12e4),l=s=>{c||(c=!0,clearTimeout(a),r.close(),i(s))};r.on("request",(s,m)=>{let p=new $e(s.url??"/",`http://${S}:${t}`);if(p.pathname!==U){m.writeHead(404),m.end();return}let h=p.searchParams.get("state"),x=p.searchParams.get("code");if(p.searchParams.get("error")){m.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),m.end(R({state:"error",title:"Login failed",message:"We couldn't complete the sign-in. You can close this tab and try again from your terminal."})),l(null);return}if(h!==o){m.writeHead(400,{"Content-Type":"text/html; charset=utf-8"}),m.end(R({state:"error",title:"Invalid state",message:"The sign-in response didn't match this session. Please return to your terminal and try again."})),l(null);return}m.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),m.end(R({state:"success",title:"You're signed in",message:"Head back to your terminal \u2014 KaneAI is ready when you are.",autoClose:!0})),l(x)}),oe(n).catch(s=>{let m=s instanceof Error?s.message:String(s);process.stderr.write(`[auth] Could not open browser: ${m}
|
|
4
4
|
Please open this URL manually: ${n}
|
|
5
5
|
`)})})}};function R(e){let r=e.state==="success",t=r?"#22c55e":"#ef4444",n=r?"rgba(34, 197, 94, 0.12)":"rgba(239, 68, 68, 0.12)",o=r?'<svg viewBox="0 0 24 24" width="36" height="36" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7"/></svg>':'<svg viewBox="0 0 24 24" width="36" height="36" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg>',i=e.autoClose?"<script>setTimeout(function(){try{window.close();}catch(e){}}, 1500);</script>":"";return`<!doctype html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as f}from"./chunk-FPFOW6BS.js";import{a as h}from"./chunk-
|
|
2
|
+
import{a as f}from"./chunk-FPFOW6BS.js";import{a as h}from"./chunk-JKLKZCJS.js";import{a as d}from"./chunk-KKIFXAJY.js";var o=class extends Error{constructor(a,l){super(a);this.code=l;this.name="AuthError"}};async function k(c){let{creds:i,env:a,usernameFlag:l,accessKeyFlag:g,log:t}=c,e=null,u=null;if(l&&g)e={username:l,access_key:g},t("info","AUTH_RESOLVE_FLAGS","Auth resolved via CLI flags",{username:l});else{let r=i.resolveAuth();r?.method==="basic"&&(e={username:r.username,access_key:r.access_key},t("info","AUTH_RESOLVE_CONFIG","Auth resolved via config",{username:r.username}))}if(!e){let{credentials:r,profile:E}=i.getActiveCredentials();if(!r)throw new o("Not authenticated \u2014 no credentials found","not_authenticated");if(u=r.access_token,r.expires_at-Date.now()/1e3<300)try{let n=await h({creds:i,profile:E,env:a,credentials:r});n&&(u=n.accessToken,t("info","AUTH_TOKEN_REFRESHED","OAuth token refreshed"))}catch(n){let m=n instanceof Error?n.message:String(n);throw t("error","TOKEN_REFRESH_FAILED","Token refresh failed",{error:m}),new o(`Token refresh failed: ${m}`,"refresh_failed")}}let b=d(a),v=async()=>u,y=e?{username:e.username,access_key:e.access_key}:null,p=new f(b.controllerBaseUrl,v,y,t),s=await p.resolve();return s&&!e&&(e={username:s.username,access_key:s.access_key},t("info","AUTH_RESOLVE_CONTROLLER","Auth resolved via controller",{username:s.username})),{basicAuth:e,token:u,resolver:p,resolvedCreds:s}}export{o as a,k as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Se,b as nr}from"./chunk-C5UNZ6ZY.js";import{a as ar}from"./chunk-BH6EP2LD.js";import{c as or}from"./chunk-S3DAAAE5.js";import{b as sr,c as ut,d as dt,e as ve,f as mt,g as ir}from"./chunk-PUU7A26K.js";import{a as Ue,b as se,c as tr,e as le,f as lt,i as rr,j as ct}from"./chunk-AH4AXJML.js";import{b as ue}from"./chunk-
|
|
2
|
+
import{a as Se,b as nr}from"./chunk-C5UNZ6ZY.js";import{a as ar}from"./chunk-BH6EP2LD.js";import{c as or}from"./chunk-S3DAAAE5.js";import{b as sr,c as ut,d as dt,e as ve,f as mt,g as ir}from"./chunk-PUU7A26K.js";import{a as Ue,b as se,c as tr,e as le,f as lt,i as rr,j as ct}from"./chunk-AH4AXJML.js";import{b as ue}from"./chunk-NAAPNSZD.js";import{a as Xt}from"./chunk-WAOCHXJ5.js";import{a as er,b as at}from"./chunk-BQACGLXW.js";import{a as Wt,b as ot,c as it,d as je,e as Jt,f as Qt}from"./chunk-LOIRZFV3.js";import{f as Yt,g as Zt}from"./chunk-XCYCX4TU.js";import{a as zt}from"./chunk-LPUQ4HWQ.js";import{a as De,b as Gt}from"./chunk-NLCCBXXV.js";import{a as W}from"./chunk-KKIFXAJY.js";import{a as D}from"./chunk-RZ4F3BHX.js";import{a as Ht}from"./chunk-E47GFYXA.js";import{a as Kt,c as rt,i as qt,j as Le,k as st,l as nt}from"./chunk-LRKWPAGK.js";import{join as qe,basename as En}from"path";import{existsSync as ds,readFileSync as An}from"fs";import{existsSync as ft}from"fs";import{join as Fe,basename as lr}from"path";function cr(e,t){if(!t||!ft(t))return e.steps.map(()=>({kind:"author",reason:"no-result-md"}));let r=dt(t),s=[],n=new Set,o=new Map;function a(i){let l=ve(i),h=Fe(l,"Result.md");if(o.has(h))return o.get(h);let f=ft(h)?dt(h):null;return o.set(h,f),f}function u(i){for(let l=1;l<i.trace.length;l++){let f=i.trace[l-1].file===e.rootPath?r:a(i.trace.slice(0,l));if(!f)return{kind:"author",reason:"no-result-md"};let w=i.trace[l-1].stepIndex,g=f.steps[w-1];if(!g)return{kind:"author",reason:"no-result-md"};if(g.kind!=="import")return{kind:"author",reason:"structure-mismatch"};let I=lr(g.importPath),S=lr(i.trace[l].file);if(I!==S)return{kind:"author",reason:"structure-mismatch"};if(g.status!=="passed")return{kind:"author",reason:"recorded-failed"}}return null}for(let i of e.steps){let l=i.trace[i.trace.length-1].file,h=i.trace[i.trace.length-1].stepIndex,f=n.has(l);for(let S=0;S<i.trace.length-1&&!f;S++)n.has(i.trace[S].file)&&(f=!0);if(f){s.push({kind:"author",reason:"downstream-of-divergence"});continue}let w=u(i);if(w){s.push(w);for(let S=0;S<i.trace.length;S++)n.add(i.trace[S].file);continue}let g=l===e.rootPath?r:a(i.trace),I=Es(i,g,h);if(s.push(I),I.kind==="author"){n.add(l);for(let S=0;S<i.trace.length-1;S++)n.add(i.trace[S].file)}}return s}function Es(e,t,r){if(!t)return{kind:"author",reason:"no-result-md"};let s=t.steps[r-1];if(!s)return{kind:"author",reason:"no-result-md"};if(s.kind!=="objective")return{kind:"author",reason:"structure-mismatch"};if(s.status!=="passed")return{kind:"author",reason:"recorded-failed"};let n=sr(e);if(n!==s.md5)return{kind:"author",reason:"md5-mismatch"};let o=e.trace.length===1?rr(e.trace[0].file,r,n.slice(0,8)):Fe(ve(e.trace),".internal","steps",`${r}-${n.slice(0,8)}`),a=Fe(o,"flows","0","actions.ndjson");return ft(a)?{kind:"replay",recordingDir:o}:{kind:"author",reason:"missing-recording"}}function ur(e){return e.some(t=>t.kind==="author")}function Me(e){for(let t=0;t<e.length;t++)if(e[t].kind==="author")return t;return e.length}function dr(e){return Fe(e.recordingDir,"flows","0","actions.ndjson")}function mr(e,t){if(process.env.KANE_REPLAY_TRACE==="1")for(let r=0;r<e.steps.length;r++){let s=e.steps[r],n=t[r],o=" ".repeat(s.trace.length-1),a=`step ${s.flatIndex}`;n.kind==="replay"?process.stderr.write(`[replay-trace] ${o}${a}: REPLAY (would skip; v1 always authors)
|
|
3
3
|
`):process.stderr.write(`[replay-trace] ${o}${a}: AUTHOR (${n.reason})
|
|
4
4
|
`)}}function de(e){process.env.KANE_REPLAY_TRACE==="1"&&process.stderr.write(e)}function fr(e,t){let r=e===0?"(none)":`0..${e-1}`,s=e>=t?"(none)":`${e}..${t-1}`;de(`[replay-trace] phase: replay ${r}, author ${s}
|
|
5
5
|
`)}function pr(e,t){de(`[replay-trace] step ${e}: REPLAY ${t==="ok"?"OK":"FAILED"}
|
|
@@ -45,7 +45,7 @@ import{a as Se,b as nr}from"./chunk-C5UNZ6ZY.js";import{a as ar}from"./chunk-BH6
|
|
|
45
45
|
`),!1;let m=c.sessionId,v=o.onLockConflict??i.rootGlobal.on_lock_conflict??"readonly",y=await fs({tmsBaseUrl:w.tmsBaseUrl,testId:p.testId,fromCommitId:p.fromCommitId,newCommitId:m,basicAuth:d,onLockConflict:v});return y==="ok"?(_=!0,p.newCommitId=m,c.log("info","MID_RUN_LOCK_ACQUIRED","Mid-run lock acquired",{test_id:p.testId}),a&&t.onLockState({phase:"acquired",scope:"mid_run"}),vt({baseUrl:ze(w.tmsBaseUrl),testId:p.testId,auth:We(d),lifecycle:r}),!0):(c.log("error","MID_RUN_LOCK_CONFLICT","Mid-run lock acquisition failed",{reason:y}),a&&t.onLockState({phase:"conflict",scope:"mid_run",reason:y}),process.stderr.write(`error: mid-run lock acquisition failed (${y})
|
|
46
46
|
`),!1)};if(a){let d=o.author===!0;d&&(pt(),c.log("info","FORCE_AUTHOR_RUN","--author flag set; walker bypassed"));let{authorBoundary:m,cancelledInPhase:v,shrinkCount:y}=await yr({decisions:p.decisions,forceAuthor:d,hasRetry:o.retry===!0||o.retryCount!==void 0,maxShrinks:o.retryCount!==void 0?parseInt(o.retryCount,10):Se.maxShrinks,runReplayPhase:Rs,session:c,accumulator:te,acquireLockIfNeeded:$t});if(N=y>0,y>0&&(c.log("info","RETRY_TRIGGERED","Retry loop triggered",{shrink_count:y,final_author_boundary:m}),t.onRetryAttempt({shrink_count:y,final_author_boundary:m,complete_reauthor:m===0})),m===0&&y>0&&c.log("info","COMPLETE_REAUTHOR_TRIGGERED","Complete reauthor fallback",{shrink_count:y}),!v&&m>=0)for(let b=m;b<i.steps.length;b++){let R=i.steps[b];if(!te.shouldRunFlatStep(R))continue;Nt(b),L=!0;let C=c.nextRunIndex();ne=C,await Ze(he(oe.raw,R.config.variables,R.objective).raw);let A=Mt(b,C),J=Date.now(),z=null,U=null,K=null,B=!1,Y=0;try{let E=at(A,{environment:f,assertionMode:Lt});r.register("runner",()=>{it()&&(P=!0);try{E.cancel()}catch{}}),F?.setRunActive(!0);try{for await(let T of E.events){if(t.onAgentEvent(T),T.type==="bifurcation"){let x=T.count??T.flows?.length??0;(T.is_single_flow??x<=1)||(K=T.flows??null,B=!0,Y=0)}else if(T.type==="run_start"&&B)Y++;else if(T.type==="step_event"&&T.event==="reasoning")F?.setStepText(T.detail);else if(T.type==="step_end"&&(T.status==="passed"&&F?.setStepComplete(),be)){let x=B?Math.max(0,Y-1):0;be(T.index,x,T.child_id)}if(T.type==="run_end"){z=T;break}if(T.type==="error"){U=T.message??"runner error";break}}try{E.cancel()}catch{}}finally{F?.setRunActive(!1),r.cleanup("runner","Step complete")}}catch(E){U=E.message}let Z=Math.round((Date.now()-J)/1e3),O=et(b,C,z,K,U,Z);if(c.recordStepRun({testmdStepIndex:i.steps[b].flatIndex,runIndex:C,totalRunDirs:z?.total_runs??1}),!O||P)break}}else{let{effectiveDecisions:d}=await import("./effective-decisions-DRM3JSR4.js"),{decideRetry:m}=await import("./replay-policy-6USQBT3E.js"),v=o.retry===!0||o.retryCount!==void 0,y=o.retryCount!==void 0?parseInt(o.retryCount,10):Se.maxShrinks,b=o.author===!0;b&&(pt(),c.log("info","FORCE_AUTHOR_RUN","--author flag set; walker bypassed"));let R=b?0:Me(p.decisions),C=0,A=null,J=p.decisions.filter(B=>B.kind==="replay").length,z=p.decisions.length-J,U=[];o.push&&U.push("--push"),v&&U.push("--retry"),o.retryCount!==void 0&&U.push(`--retry-count=${o.retryCount}`),b&&U.push("--author");let K={source:s,steps:{total:p.decisions.length,replay:J,author:z},model:I,viewport:{width:$.window_size.width,height:$.window_size.height},chrome:Q.cdpEndpoint??Q.wsEndpoint??"managed",session:c.sessionName??"ephemeral",variables:{count:Object.keys(H.raw).length,secrets:Object.values(H.raw).filter(B=>B.secret).length,names:Object.keys(H.raw)},flags:U,mode:h.mode??"testing"};for(;;){let B=c.snapshot(),Y=te.snapshot(),Z=d(p.decisions,R,b);if(C>=1){let x=R===0?`\u21BB Complete re-author \u2014 retry budget exhausted (${C}/${y})`:`\u21BB Retry ${C}/${y} \u2014 replay 0..${R-1}, author ${R}..${p.decisions.length-1}
|
|
47
47
|
reason: replay miss at step ${(A??0)+1}`;process.stderr.write(x+`
|
|
48
|
-
`)}let O=C>=1&&R>0&&A!==null?{startIdx:0,endIdx:A,count:A}:void 0;F?.setRunActive(!0);let E=await jn({decisions:Z,resolved:i,session:c,accumulator:te,tuiConfig:$,globalConfig:K,buildStepConfigAt:Mt,buildReplayConfig:x=>{let X=p.decisions[x];if(X.kind!=="replay")throw new Error("expected replay decision at index "+x);let re=i.steps[x];return ht({step:re,decision:X,chrome:Q,auth:l,sessionId:c.sessionId,runIndex:c.nextRunIndex(),sessionDir:c.sessionDir,windowSize:{width:$.window_size.width,height:$.window_size.height},forceNavigateUrl:x===0?ye??void 0:void 0,sessionContext:c.getContext(),variables:Pn(oe.raw,re.config.variables,re.objective)})},onAnyAuthorStep:()=>{L=!0},onCancel:()=>{V=!0},topBannerModel:I,topBannerAuth:`${S.getActiveProfile()??"no profile"}/${f}`,spawnOpts:{environment:f,mode:h.mode??"testing",assertionMode:Lt,log:(x,X,re,tt)=>c.log(x,X,re,tt)},priorAttemptRollup:O,pushStepLevelDelta:(x,X)=>Ze(he(oe.raw,x,X).raw),onSequencerStepEnd:(x,X,re,tt)=>{let Is=Math.round((Date.now()-tt)/1e3),Cs=x.hadError?x.reason??"runner error":null,ks=et(X,re,x.runEnd,x.bifurcationFlows??null,Cs,Is);return c.recordStepRun({testmdStepIndex:i.steps[X].flatIndex,runIndex:re,totalRunDirs:x.runEnd?.total_runs??x.bifurcationFlows?.length??1}),ks},screenshotDispatcher:be,onReasoning:x=>F?.setStepText(x),onStepComplete:()=>F?.setStepComplete(),onSpawnStart:x=>{ne=x},host:t});if(F?.setRunActive(!1),E.cancelled){r.cleanup("marker-overlay","user cancelled run"),r.cleanup("chrome","user cancelled run");break}if(E.failedAt===null)break;let T=m({failedAt:E.failedAt,shrinkCount:C,hasRetry:v,maxShrinks:y});if(T.kind==="fail"||!_&&!await $t())break;c.rollback(B),te.rollback(Y),T.kind==="complete-reauthor"?R=0:R=T.newAuthorBoundary,C++,N=!0,c.log("info","RETRY_TRIGGERED","Retry loop triggered (TTY)",{shrink_count:C,failed_at:A}),R===0&&c.log("info","COMPLETE_REAUTHOR_TRIGGERED","Complete reauthor fallback (TTY)",{shrink_count:C}),A=E.failedAt}}let M=te.finalize(),ie=Math.round((Date.now()-vs)/1e3),ws={session:c,resolvedAuth:l,chromeResult:Q,chromeInstance:xe??null,testId:c.testId??null,preparedVariables:H,variableIds:Pe,globalContext:jt,localContext:Ut,tuiConfig:$,env:f,localMode:!!o.local},ae=await es(ws,{performUpload:async()=>{if(!l.basicAuth)return null;let d=W(f),m=(L||o.push===!0)&&!V,v=(_||p.isFirstRun)&&!V&&M.overallStatus==="passed",y=ge&&(_||p.isFirstRun);c.log("info","PIPELINE_GATE_STATE","Derived gate state (finalize)",{phase:"finalize",shouldUploadArtifacts:ge,shouldUploadPipeline:y,shouldReplaceLocalOutput:m,shouldCommit:v,lockHeld:_,anyAuthorStepRan:L,cancelled:V,overallStatus:M.overallStatus});let b=os({session:c,env:f,auth:l,variables:H,variableIds:Pe,projectId:G,folderId:Ae,totalSteps:M.outcomes.length,totalDuration:ie,screenshotExtMap:Ee?.getExtMap(),codeExport:as({codeExport:o.codeExport,codeLanguage:o.codeLanguage,skipCodeValidation:o.skipCodeValidation},$.code_export),onProgress:()=>{},log:(C,A,J,z)=>c.log(C,A,J,z),shouldUploadArtifacts:y,shouldReplaceLocalOutput:m,shouldCommit:v,isFirstRun:p.isFirstRun,resolvedTest:i,sourcePath:s,stepRunRecords:c.getStepRunRecords(),outcomes:M.outcomes,overallStatus:M.overallStatus,fromCommitId:p.fromCommitId,startedISO:Xe,durationS:ie,tmsIds:{testId:p.testId??c.testId??void 0,testcaseId:p.testcaseId??c.testcaseId??void 0,projectId:G??void 0,folderId:Ae??void 0,orgId:c.orgId??void 0,sessionName:c.sessionName??Ue(s)},tmsBaseUrl:w.tmsBaseUrl,testId:p.testId??void 0,newCommitId:p.newCommitId??void 0,basicAuth:l.basicAuth??void 0,decisions:p.decisions,wantsPush:o.push===!0,retryTriggered:N,forceAuthor:o.author===!0});p.newCommitId!=null&&(b.skipTmsFinalize=!0);let R=new ar(b);return a?await R.execute():await t.runUpload(R,C=>{if(C.testcaseId&&C.shareId&&G)return wt(d.testManagerUiUrl,G,C.testcaseId,C.shareId)})},runCleanup:()=>{r.cleanup("chrome","test.md run complete")},log:(d,m,v,y)=>c.log(d,m,v,y)},{overallStatus:M.overallStatus,outcomes:M.outcomes,sourcePath:s,title:i.rootTitle,rootSteps:i.rootSteps,startedISO:Xe,durationS:ie,localMode:!!o.local,skipLocalWrites:!0});await Ln(s,p,c,M.outcomes,M.overallStatus,Xe,ie,ae.uploadResult,$,o,{resolvedAuth:l,tmsBaseUrl:w.tmsBaseUrl},_,V);let Bt=W(f),Te=ae.uploadResult?.testcaseId,Oe=Te&&ae.uploadResult?.shareId&&G?wt(Bt.testManagerUiUrl,G,Te,ae.uploadResult.shareId):void 0,Vt={overallStatus:M.overallStatus,durationS:ie,decisions:p.decisions,outcomes:M.outcomes,cancelled:V,retryTriggered:N,lockHeld:_,anyAuthorStepRan:L,isFirstRun:p.isFirstRun,wantsPush:o.push===!0,uploadResult:ae.uploadResult,shouldUploadArtifacts:ge,shouldReplaceLocalOutput:L&&!V,shouldCommit:(_||p.isFirstRun)&&!V&&M.overallStatus==="passed",shareUrl:Oe},{buildSummaryEvent:_s}=await import("./SummaryBox-
|
|
48
|
+
`)}let O=C>=1&&R>0&&A!==null?{startIdx:0,endIdx:A,count:A}:void 0;F?.setRunActive(!0);let E=await jn({decisions:Z,resolved:i,session:c,accumulator:te,tuiConfig:$,globalConfig:K,buildStepConfigAt:Mt,buildReplayConfig:x=>{let X=p.decisions[x];if(X.kind!=="replay")throw new Error("expected replay decision at index "+x);let re=i.steps[x];return ht({step:re,decision:X,chrome:Q,auth:l,sessionId:c.sessionId,runIndex:c.nextRunIndex(),sessionDir:c.sessionDir,windowSize:{width:$.window_size.width,height:$.window_size.height},forceNavigateUrl:x===0?ye??void 0:void 0,sessionContext:c.getContext(),variables:Pn(oe.raw,re.config.variables,re.objective)})},onAnyAuthorStep:()=>{L=!0},onCancel:()=>{V=!0},topBannerModel:I,topBannerAuth:`${S.getActiveProfile()??"no profile"}/${f}`,spawnOpts:{environment:f,mode:h.mode??"testing",assertionMode:Lt,log:(x,X,re,tt)=>c.log(x,X,re,tt)},priorAttemptRollup:O,pushStepLevelDelta:(x,X)=>Ze(he(oe.raw,x,X).raw),onSequencerStepEnd:(x,X,re,tt)=>{let Is=Math.round((Date.now()-tt)/1e3),Cs=x.hadError?x.reason??"runner error":null,ks=et(X,re,x.runEnd,x.bifurcationFlows??null,Cs,Is);return c.recordStepRun({testmdStepIndex:i.steps[X].flatIndex,runIndex:re,totalRunDirs:x.runEnd?.total_runs??x.bifurcationFlows?.length??1}),ks},screenshotDispatcher:be,onReasoning:x=>F?.setStepText(x),onStepComplete:()=>F?.setStepComplete(),onSpawnStart:x=>{ne=x},host:t});if(F?.setRunActive(!1),E.cancelled){r.cleanup("marker-overlay","user cancelled run"),r.cleanup("chrome","user cancelled run");break}if(E.failedAt===null)break;let T=m({failedAt:E.failedAt,shrinkCount:C,hasRetry:v,maxShrinks:y});if(T.kind==="fail"||!_&&!await $t())break;c.rollback(B),te.rollback(Y),T.kind==="complete-reauthor"?R=0:R=T.newAuthorBoundary,C++,N=!0,c.log("info","RETRY_TRIGGERED","Retry loop triggered (TTY)",{shrink_count:C,failed_at:A}),R===0&&c.log("info","COMPLETE_REAUTHOR_TRIGGERED","Complete reauthor fallback (TTY)",{shrink_count:C}),A=E.failedAt}}let M=te.finalize(),ie=Math.round((Date.now()-vs)/1e3),ws={session:c,resolvedAuth:l,chromeResult:Q,chromeInstance:xe??null,testId:c.testId??null,preparedVariables:H,variableIds:Pe,globalContext:jt,localContext:Ut,tuiConfig:$,env:f,localMode:!!o.local},ae=await es(ws,{performUpload:async()=>{if(!l.basicAuth)return null;let d=W(f),m=(L||o.push===!0)&&!V,v=(_||p.isFirstRun)&&!V&&M.overallStatus==="passed",y=ge&&(_||p.isFirstRun);c.log("info","PIPELINE_GATE_STATE","Derived gate state (finalize)",{phase:"finalize",shouldUploadArtifacts:ge,shouldUploadPipeline:y,shouldReplaceLocalOutput:m,shouldCommit:v,lockHeld:_,anyAuthorStepRan:L,cancelled:V,overallStatus:M.overallStatus});let b=os({session:c,env:f,auth:l,variables:H,variableIds:Pe,projectId:G,folderId:Ae,totalSteps:M.outcomes.length,totalDuration:ie,screenshotExtMap:Ee?.getExtMap(),codeExport:as({codeExport:o.codeExport,codeLanguage:o.codeLanguage,skipCodeValidation:o.skipCodeValidation},$.code_export),onProgress:()=>{},log:(C,A,J,z)=>c.log(C,A,J,z),shouldUploadArtifacts:y,shouldReplaceLocalOutput:m,shouldCommit:v,isFirstRun:p.isFirstRun,resolvedTest:i,sourcePath:s,stepRunRecords:c.getStepRunRecords(),outcomes:M.outcomes,overallStatus:M.overallStatus,fromCommitId:p.fromCommitId,startedISO:Xe,durationS:ie,tmsIds:{testId:p.testId??c.testId??void 0,testcaseId:p.testcaseId??c.testcaseId??void 0,projectId:G??void 0,folderId:Ae??void 0,orgId:c.orgId??void 0,sessionName:c.sessionName??Ue(s)},tmsBaseUrl:w.tmsBaseUrl,testId:p.testId??void 0,newCommitId:p.newCommitId??void 0,basicAuth:l.basicAuth??void 0,decisions:p.decisions,wantsPush:o.push===!0,retryTriggered:N,forceAuthor:o.author===!0});p.newCommitId!=null&&(b.skipTmsFinalize=!0);let R=new ar(b);return a?await R.execute():await t.runUpload(R,C=>{if(C.testcaseId&&C.shareId&&G)return wt(d.testManagerUiUrl,G,C.testcaseId,C.shareId)})},runCleanup:()=>{r.cleanup("chrome","test.md run complete")},log:(d,m,v,y)=>c.log(d,m,v,y)},{overallStatus:M.overallStatus,outcomes:M.outcomes,sourcePath:s,title:i.rootTitle,rootSteps:i.rootSteps,startedISO:Xe,durationS:ie,localMode:!!o.local,skipLocalWrites:!0});await Ln(s,p,c,M.outcomes,M.overallStatus,Xe,ie,ae.uploadResult,$,o,{resolvedAuth:l,tmsBaseUrl:w.tmsBaseUrl},_,V);let Bt=W(f),Te=ae.uploadResult?.testcaseId,Oe=Te&&ae.uploadResult?.shareId&&G?wt(Bt.testManagerUiUrl,G,Te,ae.uploadResult.shareId):void 0,Vt={overallStatus:M.overallStatus,durationS:ie,decisions:p.decisions,outcomes:M.outcomes,cancelled:V,retryTriggered:N,lockHeld:_,anyAuthorStepRan:L,isFirstRun:p.isFirstRun,wantsPush:o.push===!0,uploadResult:ae.uploadResult,shouldUploadArtifacts:ge,shouldReplaceLocalOutput:L&&!V,shouldCommit:(_||p.isFirstRun)&&!V&&M.overallStatus==="passed",shareUrl:Oe},{buildSummaryEvent:_s}=await import("./SummaryBox-47MHU37V.js");if(a?t.onAgentEvent(_s(Vt)):await t.onSummary(Vt),!a){let d=Te&&G?Fr(Bt.testManagerUiUrl,G,Te):void 0;await t.onLinks({recordedTestPath:s,outputDir:se(s),shareableLink:Oe,testCaseLink:d,codeExportDir:ae.uploadResult?.codeExportDir})}return t.onAgentEvent({type:"test_md_done",overall_status:M.overallStatus,duration_s:ie,session_id:c.sessionId,...Oe?{share_url:Oe}:{}}),{overallStatus:M.overallStatus,exitCode:M.overallStatus==="passed"?0:1,outputDir:se(s),durationS:ie,uploadResult:ae.uploadResult}}function xn(e,t){let r={...e,...t},s=Object.keys(r).length>0?ue(r,""):{variables:{},objective:"",keyMap:{}};return{raw:r,auteur:s.variables,auteurObjective:"",secretEntries:Object.entries(r).filter(([,n])=>n.secret),nonSecretEntries:Object.entries(r).filter(([,n])=>!n.secret)}}function he(e,t,r){let s={...e,...t??{}};if(Object.keys(s).length===0)return{raw:s,variables:{},objective:r};let n=ue(s,r);return{raw:s,variables:Qr(n.variables,n.objective),objective:n.objective}}function Pn(e,t,r){let s=he(e,t,r).variables;return Object.keys(s).length>0?s:void 0}function ms(e,t){let r=new Set(Ge),s={...e};for(let[n,o]of Object.entries(t))r.has(n)||n!=="variables"&&o!==void 0&&e[n]===void 0&&(s[n]=o);return s}function Tn(e,t){return e.length<=t?e:e.slice(0,t-1)+"\u2026"}async function On(e,t,r,s,n,o){let a=tr(e),u=cr(t,ds(a)?a:null);mr(t,u);let i=le(e),l=ds(i)?JSON.parse(An(i,"utf8")):null,h=l?.testcase_id,f=l?.test_id,w=l?.commit_id,g=r.push===!0,I=r.retry===!0||r.retryCount!==void 0,S=r.author===!0;g&&!h&&process.stderr.write(`[--push] no meta.json yet \u2014 flag is a no-op on first run
|
|
49
49
|
`),S&&(h=void 0,f=void 0,w=void 0);let k=s.resolvedAuth.basicAuth;if(!k){let N=await s.resolvedAuth.resolver.resolve(!0);N?.username&&N?.access_key&&(k={username:N.username,access_key:N.access_key},s.resolvedAuth.basicAuth=k)}let c=!!k,P=!r.local&&c&&f!=null&&w!=null&&h!=null,p=P&&(ur(u)||g);if(g&&!P)return process.stderr.write(`error: --push requires authenticated credentials for the lock API. Run 'kane-cli login' (OAuth) or pass --username/--access-key inline.
|
|
50
50
|
`),{resolved:t,decisions:u,testId:f,testcaseId:h,fromCommitId:w,newCommitId:null,isFirstRun:!1,hasAuth:c,canLock:P,lockAcquired:!1,abort:{exitCode:2}};if(I&&!P)return process.stderr.write(`error: --retry requires authenticated credentials for the lock API. Run 'kane-cli login' (OAuth) or pass --username/--access-key inline.
|
|
51
51
|
`),{resolved:t,decisions:u,testId:f,testcaseId:h,fromCommitId:w,newCommitId:null,isFirstRun:!1,hasAuth:c,canLock:P,lockAcquired:!1,abort:{exitCode:2}};if(S&&!c)return process.stderr.write(`error: --author requires authenticated credentials for the TMS API. Run 'kane-cli login' (OAuth) or pass --username/--access-key inline.
|
|
@@ -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-KKIFXAJY.js";import{spawn as N,execSync as O}from"child_process";import{existsSync as v}from"fs";import{resolve as t,dirname as T}from"path";import{fileURLToPath as b}from"url";import{createInterface as A}from"readline";async function*E(s){let e=A({input:s,crlfDelay:1/0});for await(let c of e){let r=c.trim();if(r)try{let d=JSON.parse(r);d&&typeof d.type=="string"&&(yield d)}catch{}}}function S(s){return s==="action"?{set:{V16_AGENT_ENABLE_ALL_BLOCKERS:"true",V16_AGENT_SKIP_CP_FINAL:"true",V16_BIFURCATION_PHASES:"1"},unset:["V16_NETWORK_WS","V16_NETWORK_SSE"]}:{set:{V16_BIFURCATION_PHASES:"1"},unset:["V16_AGENT_ENABLE_ALL_BLOCKERS","V16_AGENT_SKIP_CP_FINAL","V16_NETWORK_WS","V16_NETWORK_SSE"]}}function R(s){return s==="dom"?{set:{V16_AGENT_ENABLE_TEXTUAL_VISUAL:"true"},unset:[]}:{set:{},unset:["V16_AGENT_ENABLE_TEXTUAL_VISUAL"]}}var a=T(b(import.meta.url));function C(){for(let s of["python3","python"])try{return O(`${s} --version`,{stdio:"ignore"}),s}catch{}return null}function h(){let e=process.platform==="win32"?"v16-runner.exe":"v16-runner",c={"darwin-arm64":["@testmuai/kane-cli-darwin-arm64","@lambdatestincprivate/kane-cli-darwin-arm64"],"darwin-x64":["@testmuai/kane-cli-darwin-x64","@lambdatestincprivate/kane-cli-darwin-x64"],"linux-x64":["@testmuai/kane-cli-linux-x64","@lambdatestincprivate/kane-cli-linux-x64"],"linux-arm64":["@testmuai/kane-cli-linux-arm64","@lambdatestincprivate/kane-cli-linux-arm64"],"win32-x64":["@testmuai/kane-cli-win-x64","@lambdatestincprivate/kane-cli-win-x64"]},r=`${process.platform}-${process.arch}`,d=c[r];if(d)for(let n of d){let l=[t(a,"..","node_modules",n,"bin",e),t(a,"..","..","node_modules",n,"bin",e),t(a,"..","..","..","node_modules",n,"bin",e),t(a,"..","..","..","..","node_modules",n,"bin",e)];for(let o of l)if(v(o))return{cmd:o,args:[]}}let m=[t(a,"bin",e),t(a,"..","bin",e),t(a,"..","..","..","..","v16-runner","dist",e),t(a,"..","..","..","v16-runner","dist",e),t(process.cwd(),"v16-runner","dist",e),t(process.cwd(),"..","v16-runner","dist",e)];for(let n of m)if(v(n))return{cmd:n,args:[]};let p=[t(a,"..","..","v16-runner"),t(a,"..","..","..","..","v16-runner"),t(a,"..","..","..","v16-runner"),t(process.cwd(),"v16-runner"),t(process.cwd(),"..","v16-runner")];for(let n of p)if(v(t(n,"main.py"))){for(let o of[t(n,".venv","bin","python"),t(n,"..","browser-agent",".venv","bin","python")])if(v(o))return{cmd:o,args:["main.py"],cwd:n};let l=C();if(l)return{cmd:l,args:["main.py"],cwd:n}}return null}function W(s,e){let c=h();if(!c)throw new Error("v16-runner not found. Build the binary with `cd v16-runner && python build.py` or ensure Python is available.");let r={...process.env};e?.environment&&(r.TESTMUAI_ENV=e.environment),r.TESTMUAI_SOURCE="kane-cli",process.platform==="win32"&&(r.PYTHONIOENCODING="utf-8");let d=g(e?.environment);r.V16_SERVER_API_HOST=d.v16ServerHost,r.ATMS_URL=d.tmsBaseUrl.replace(/\/api\/?$/,""),s.username&&s.access_key&&(r.LT_USERNAME=s.username,r.LT_ACCESS_KEY=s.access_key),s.session_id&&(r.TESTMUAI_SESSION_ID=s.session_id);let m=S(e?.mode??"testing");Object.assign(r,m.set);for(let i of m.unset)delete r[i];let p=R(e?.assertionMode??"visual");Object.assign(r,p.set);for(let i of p.unset)delete r[i];let n=N(c.cmd,c.args,{stdio:["pipe","pipe","pipe"],env:r,cwd:c.cwd});n.stdin.on("error",()=>{}),n.stdin.write(JSON.stringify(s)+`
|
|
3
3
|
`);let l=1e5,o="";n.stderr.on("data",i=>{o+=i.toString(),o.length>l&&(o=o.slice(-l))}),n.on("error",i=>{e?.log?.("error","RUNNER_SPAWN_ERROR","Runner spawn error",{error:i.message})});let _=null,f=null,x=new Promise(i=>{n.on("close",(u,y)=>{_=u,f=y?String(y):null,e?.log?.("info","RUNNER_EXIT","Runner exited",{code:u,signal:f??"none"}),i({code:u,signal:f})})}),w=E(n.stdout);return{child:n,events:w,sendUserResponse(i){let u=JSON.stringify({type:"user_response",answer:i});try{n.stdin.write(u+`
|
|
4
4
|
`)}catch{}},sendCancel(i){let u=JSON.stringify({type:"cancel",reason:i});try{n.stdin.write(u+`
|
|
5
5
|
`)}catch{}},cancel(){n.kill("SIGTERM")},get stderr(){return o},get exitCode(){return _},get exitSignal(){return f},exited:x}}export{h as a,W as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{x as a}from"./chunk-
|
|
2
|
+
import{x as a}from"./chunk-LRKWPAGK.js";import{a as c}from"./chunk-HCBYKLMW.js";import{b as u}from"./chunk-C44QQJR4.js";import{a as l}from"./chunk-6YGTRKDT.js";import{e as n}from"./chunk-UR6MHSHU.js";var s=n(l(),1);var o=n(l(),1);function f(r,e){let t=(0,o.useRef)(r);t.current=r,(0,o.useEffect)(()=>{if(e===null)return;let i=setInterval(()=>t.current(),e);return()=>clearInterval(i)},[e])}var p=n(c(),1),m=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function I({active:r=!0}){let[e,t]=(0,s.useState)(0);return f(()=>{t(i=>(i+1)%m.length)},r?80:null),(0,p.jsx)(u,{color:a.orange,children:r?m[e]:"\u25CF"})}export{f as a,I as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as m}from"./chunk-
|
|
2
|
+
import{a as m}from"./chunk-IT66S24L.js";import{x as t}from"./chunk-LRKWPAGK.js";import{a as p}from"./chunk-HCBYKLMW.js";import{a,b as r,i as u}from"./chunk-C44QQJR4.js";import{a as b}from"./chunk-6YGTRKDT.js";import{e as n}from"./chunk-UR6MHSHU.js";var c=n(b(),1);var e=n(p(),1);function R({onSubmit:l}){let[o,f]=(0,c.useState)(0),s=(0,c.useRef)(!1);return u((x,i)=>{s.current||(i.leftArrow||i.rightArrow?f(d=>d===0?1:0):i.return?(s.current=!0,l(o===0?"positive":"negative")):i.escape&&(s.current=!0,l(null)))}),(0,e.jsxs)(a,{flexDirection:"column",marginTop:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(r,{color:t.secondary,children:"Rate this session: "}),(0,e.jsx)(r,{color:o===0?t.orange:t.dim,children:o===0?"[ \u{1F44D} ]":" \u{1F44D} "}),(0,e.jsx)(r,{children:" "}),(0,e.jsx)(r,{color:o===1?t.orange:t.dim,children:o===1?"[ \u{1F44E} ]":" \u{1F44E} "})]}),(0,e.jsx)(m,{bindings:[{keys:"\u2190/\u2192",label:"select"},{keys:"\u21B5",label:"submit"}],escBackLabel:"skip"})]})}export{R as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as l}from"./chunk-
|
|
2
|
+
import{b as l}from"./chunk-HUAOH2JK.js";import{a as f}from"./chunk-RB2YKN77.js";import{a as m}from"./chunk-KKIFXAJY.js";import{a as p}from"./chunk-RZ4F3BHX.js";import{a as c,c as s,h as a,w as u}from"./chunk-LRKWPAGK.js";var v="/public/skills/kane-cli";function C(){try{let n=new f().getDefaultEnv();if(n in u)return n}catch{}return"prod"}function k(){return`${m(C()).controllerBaseUrl}${v}`}import{readFileSync as S,writeFileSync as E,mkdirSync as g}from"fs";import{join as d}from"path";var h=d(s,"skill-check.json"),y=3600*1e3;function V(){try{let n=JSON.parse(S(h,"utf-8"));if(Date.now()-n.checkedAt<y)return n}catch{}return null}function A(n){try{g(s,{recursive:!0}),E(h,JSON.stringify({map:n,checkedAt:Date.now()}))}catch{}}function I(){for(let{dir:n}of a)try{let t=S(d(n,"VERSION"),"utf-8").trim();if(t)return t}catch{}return null}function M(n,t){let i=Object.keys(n.versions??{});if(i.length===0)return null;let o=i.slice().sort((r,e)=>l(r,e));for(let r of o){let e=n.versions[r]?.kaneCliMinVersion;if(!e||l(t,e)<=0)return r}return null}async function U(){try{let n=V()?.map;if(!n){let o=new AbortController,r=setTimeout(()=>o.abort(),5e3),e=await p(k(),{headers:{Accept:"application/json"},signal:o.signal});if(clearTimeout(r),!e.ok)return null;n=await e.json(),A(n)}let t=M(n,c);if(!t)return null;let i=I();return i===null?{current:null,latestCompatible:t}:l(i,t)>0?{current:i,latestCompatible:t}:null}catch{return null}}export{k as a,M as b,U as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as $e}from"./chunk-
|
|
2
|
+
import{a as $e}from"./chunk-53O3GMZR.js";import{a as Fe}from"./chunk-FPFOW6BS.js";import{a as ke}from"./chunk-YCCUBQY4.js";import{a as Ke}from"./chunk-VE3SUJMA.js";import{a as Ue}from"./chunk-IGZPQQFP.js";import{a as Oe}from"./chunk-KKIFXAJY.js";import{a as de}from"./chunk-IT66S24L.js";import{c as Re,x as u}from"./chunk-LRKWPAGK.js";import{a as Z}from"./chunk-HCBYKLMW.js";import{a as x,b as f,h as Le,i as be,k as De}from"./chunk-C44QQJR4.js";import{a as xe}from"./chunk-6YGTRKDT.js";import{e as O}from"./chunk-UR6MHSHU.js";var Ne=O(xe(),1);import{readFileSync as et,writeFileSync as tt,mkdirSync as nt}from"fs";import{dirname as rt,join as We}from"path";var ot=We(Re,"command-history.json"),yt=We(Re,"generate-history.json"),it=200,_e=class{entries;filePath;max;constructor(t=ot,e=it){this.filePath=t,this.max=e,this.entries=this._load()}push(t){this.entries.length>0&&this.entries[this.entries.length-1]===t||(this.entries.push(t),this.entries.length>this.max&&(this.entries=this.entries.slice(this.entries.length-this.max)),this._save())}getAll(){return[...this.entries]}search(t){let e=t.toLowerCase(),i=[];for(let l=this.entries.length-1;l>=0;l--)this.entries[l].toLowerCase().includes(e)&&i.push(this.entries[l]);return i}_load(){try{let t=et(this.filePath,"utf-8"),e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}_save(){try{nt(rt(this.filePath),{recursive:!0}),tt(this.filePath,JSON.stringify(this.entries)+`
|
|
3
3
|
`)}catch{}}};function At(r){let t=(0,Ne.useRef)(null);return t.current||(t.current=new _e(r)),t.current}var L=O(xe(),1);var Ie=O(xe(),1);var X=O(Z(),1);function He({history:r,onSelect:t,onClose:e}){let[i,l]=(0,Ie.useState)(""),[a,g]=(0,Ie.useState)(0),v=i?r.search(i).slice(0,8):[];return be((T,d)=>{if(d.escape){e();return}if(d.return){v.length>0&&v[a]?t(v[a]):e();return}if(d.upArrow){g(w=>Math.max(0,w-1));return}if(d.downArrow){g(w=>Math.min(v.length-1,w+1));return}if(d.backspace||d.delete){l(w=>w.slice(0,-1)),g(0);return}T&&!d.ctrl&&!d.meta&&(l(w=>w+T),g(0))}),(0,X.jsxs)(x,{flexDirection:"column",marginLeft:2,borderStyle:"single",paddingX:1,children:[(0,X.jsx)(f,{color:u.muted,bold:!0,children:"reverse search"}),(0,X.jsxs)(x,{gap:1,children:[(0,X.jsx)(f,{color:u.dim,children:"search:"}),(0,X.jsx)(f,{children:i}),(0,X.jsx)(f,{color:u.orange,children:"\u2588"})]}),v.length>0&&(0,X.jsx)(f,{children:" "}),v.map((T,d)=>(0,X.jsx)(x,{marginLeft:2,children:(0,X.jsxs)(f,{color:d===a?u.orange:u.dim,bold:d===a,children:[d===a?"\u25B8 ":" ",T]})},`${d}-${T}`))]})}var ce=O(Z(),1);function Ge({commands:r,selectedIndex:t}){return r.length===0?null:(0,ce.jsx)(x,{flexDirection:"column",marginBottom:0,children:r.map((e,i)=>{let l=i===t;return(0,ce.jsxs)(x,{children:[(0,ce.jsx)(f,{color:l?u.orange:u.dim,children:l?"\u276F ":" "}),(0,ce.jsxs)(f,{color:l?u.orange:void 0,bold:l,children:["/",e.name]}),e.args&&(0,ce.jsxs)(f,{color:u.dim,children:[" ",e.args]}),(0,ce.jsxs)(f,{color:u.dim,children:[" ",e.description]})]},e.name)})})}var Ye=O(xe(),1);var H=O(Z(),1),qe={scenario:"Scenarios",case:"Test Cases",file:"Files"};function Ve(r){let t={scenario:0,case:0,file:0};for(let e of r)t[e.kind]++;return["scenario","case","file"].filter(e=>t[e]>0).map(e=>`${t[e]} ${qe[e]}`).join(" \xB7 ")}var Ee=7;function je({items:r,selectedIndex:t,accent:e=u.orange}){let i=r.length;if(i===0)return null;let l=Math.floor(Ee/2),a=i<=Ee?0:Math.max(0,Math.min(t-l,i-Ee)),g=Math.min(i,a+Ee),v=a,T=i-g;return(0,H.jsxs)(x,{flexDirection:"column",marginBottom:0,children:[v>0&&(0,H.jsx)(x,{children:(0,H.jsx)(f,{color:u.dim,children:` \u22EF ${v} above \u2014 ${Ve(r.slice(0,a))}`})}),r.slice(a,g).map((d,w)=>{let K=a+w,D=K===t,C=w===0||r[K-1].kind!==d.kind;return(0,H.jsxs)(Ye.default.Fragment,{children:[C&&(0,H.jsx)(x,{children:(0,H.jsx)(f,{color:u.dim,children:qe[d.kind]})}),(0,H.jsxs)(x,{children:[(0,H.jsx)(f,{color:D?e:u.dim,children:D?"\u276F ":" "}),(0,H.jsx)(f,{color:D?e:void 0,bold:D,children:d.label})]})]},`${d.kind}:${d.value}:${K}`)}),T>0&&(0,H.jsx)(x,{children:(0,H.jsx)(f,{color:u.dim,children:` \u22EF ${T} more \u2014 ${Ve(r.slice(g))}`})})]})}var ye=O(xe(),1);var st=27,lt=127,at=11;function ct(r){return r>=64&&r<=126}function ut(r,t){r===at&&t({killToEnd:!0,ctrl:!0,raw:String.fromCharCode(r)})}function ft(r,t){r===lt&&t({backspace:!0,meta:!0,raw:"\x1B\x7F"})}function dt(r,t){let e=r.map(l=>String.fromCharCode(l)).join(""),i=/^\[1;([0-9]+)([A-D])$/.exec(e);if(i){let l=parseInt(i[1],10),a=i[2],g={raw:"\x1B"+e};if(l===2)g.shift=!0;else if(l===3)g.meta=!0;else if(l===5)g.ctrl=!0;else return;a==="A"?g.arrowUp=!0:a==="B"?g.arrowDown=!0:a==="C"?g.arrowRight=!0:a==="D"&&(g.arrowLeft=!0),t(g);return}if(e==="[H"||e==="[1~"||e==="[7~"){t({home:!0,raw:"\x1B"+e});return}if(e==="[F"||e==="[4~"||e==="[8~"){t({end:!0,raw:"\x1B"+e});return}if(e==="[3;5~"){t({delete:!0,ctrl:!0,raw:"\x1B"+e});return}if(e==="[3;3~"){t({delete:!0,meta:!0,raw:"\x1B"+e});return}}function mt(r,t){r===72?t({home:!0,raw:"\x1BO"+String.fromCharCode(r)}):r===70&&t({end:!0,raw:"\x1BO"+String.fromCharCode(r)})}function ht(){let r="IDLE",t=[];function e(){r="IDLE",t=[]}return{feed(i,l){for(let a of i)r==="IDLE"?a===st?(r="ESC",t=[]):ut(a,l):r==="ESC"?a===91?(r="CSI",t=[]):a===79?(r="SS3",t=[]):(ft(a,l),e()):r==="CSI"?(t.push(a),ct(a)&&(dt([91,...t],l),e())):r==="SS3"&&(mt(a,l),e())},flushIdle(i){r==="ESC"&&t.length===0&&i({raw:"\x1B"}),e()}}}function ze(r,t={}){let e=(0,ye.useRef)(r);e.current=r;let{stdin:i}=Le();(0,ye.useEffect)(()=>{if(t.isActive===!1||!i)return;let l=ht(),a=null,g=v=>{a&&(clearTimeout(a),a=null);let T=Buffer.isBuffer(v)?v:Buffer.from(v,"binary");l.feed(T,d=>e.current(d)),a=setTimeout(()=>{l.flushIdle(d=>e.current(d)),a=null},50)};return i.on("data",g),()=>{i.removeListener("data",g),a&&clearTimeout(a)}},[t.isActive,i])}var E=O(Z(),1);function gt(r,t){let e=t-1;for(;e>=0&&r[e]!=="@"&&r[e]!==" "&&r[e]!==`
|
|
4
4
|
`;)e--;return e<0||r[e]!=="@"||e>0&&r[e-1]!==" "&&r[e-1]!==`
|
|
5
5
|
`?null:{at:e,query:r.slice(e+1,t).join("")}}var Pe=10;function pt(r){return r.replace(/\x1b?\[200~/g,"").replace(/\x1b?\[201~/g,"").replace(/\r\n/g,`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as k}from"./chunk-FPFOW6BS.js";import{g as a}from"./chunk-LOIRZFV3.js";import{a as m}from"./chunk-LPUQ4HWQ.js";import{a as h}from"./chunk-
|
|
2
|
+
import{a as k}from"./chunk-FPFOW6BS.js";import{g as a}from"./chunk-LOIRZFV3.js";import{a as m}from"./chunk-LPUQ4HWQ.js";import{a as h}from"./chunk-RB2YKN77.js";import{a as y}from"./chunk-KKIFXAJY.js";var $=10,u=200,N=1e4,S=1e6;function T(t,e,r="streaming"){let n=r==="full-fetch"?S:N,o=$,i=0;if(t!==void 0){let s=Number(t);if(!Number.isInteger(s)||s<1||s>u)return{error:`--limit must be an integer in [1, ${u}] (got "${t}")`};o=s}if(e!==void 0){let s=Number(e);if(!Number.isInteger(s)||s<0||s>n)return{error:`--offset must be an integer in [0, ${n}] (got "${e}")`};i=s}return{limit:o,offset:i}}function C(t,e){if(!e)return t;let r=e.toLowerCase();return t.filter(n=>n.name.toLowerCase().includes(r))}function j(t,{limit:e,offset:r}){let n=t.slice(r,r+e),o=t.length>r+e;return{slice:n,hasMore:o}}function v(t,e,r=n=>process.stdout.write(`${n}
|
|
3
3
|
`)){for(let n of t)r(JSON.stringify(n));r(JSON.stringify({_meta:"page",limit:e.limit,offset:e.offset,returned:t.length,has_more:e.has_more}))}function b(t,e,r=n=>process.stdout.write(`${n}
|
|
4
|
-
`)){if(t.length===0){r("(no results)");return}let n=Math.max(2,...t.map(s=>s.id.length)),o=`${"ID".padEnd(n)} NAME`;r(o),r(`${"-".repeat(n)} ----`);for(let s of t)r(`${s.id.padEnd(n)} ${s.name}`);r("");let i=e.offset+t.length;if(e.hasMore){let s=e.totalIsLowerBound?`${e.total}+`:`${e.total}`;r(`${i} of ${s} \u2014 next: --offset ${e.offset+e.limit}`)}else r(`${t.length} shown (${e.total} total)`)}async function B(t,e,r){if(r.username&&r.accessKey)return{ok:!0,creds:{username:r.username,access_key:r.accessKey}};let n=new h,o=n.loadBasicAuth(t,e);if(o)return{ok:!0,creds:{username:o.username,access_key:o.access_key}};let i=n.loadCredentials(t,e);if(!i)return{ok:!1,reason:"no_credentials"};let s=i.access_token;try{let{refreshOAuthToken:d}=await import("./token-refresh-
|
|
4
|
+
`)){if(t.length===0){r("(no results)");return}let n=Math.max(2,...t.map(s=>s.id.length)),o=`${"ID".padEnd(n)} NAME`;r(o),r(`${"-".repeat(n)} ----`);for(let s of t)r(`${s.id.padEnd(n)} ${s.name}`);r("");let i=e.offset+t.length;if(e.hasMore){let s=e.totalIsLowerBound?`${e.total}+`:`${e.total}`;r(`${i} of ${s} \u2014 next: --offset ${e.offset+e.limit}`)}else r(`${t.length} shown (${e.total} total)`)}async function B(t,e,r){if(r.username&&r.accessKey)return{ok:!0,creds:{username:r.username,access_key:r.accessKey}};let n=new h,o=n.loadBasicAuth(t,e);if(o)return{ok:!0,creds:{username:o.username,access_key:o.access_key}};let i=n.loadCredentials(t,e);if(!i)return{ok:!1,reason:"no_credentials"};let s=i.access_token;try{let{refreshOAuthToken:d}=await import("./token-refresh-QCHKMPCM.js"),w=await d({creds:n,profile:t,env:e,credentials:i});w&&(s=w.accessToken)}catch(d){return{ok:!1,reason:"refresh_failed",detail:d instanceof Error?d.message:String(d)}}let c=y(e),f=await new k(c.controllerBaseUrl,async()=>s,null).resolve();return f?{ok:!0,creds:{username:f.username,access_key:f.access_key}}:{ok:!1,reason:"exchange_failed"}}function E(t,e,r){switch(r.reason){case"no_credentials":return{message:`error: no credentials for profile "${t}" [${e}]. Run \`kane-cli login\` or pass --username/--access-key.
|
|
5
5
|
`,exitCode:2};case"refresh_failed":return{message:`error: OAuth token refresh failed for profile "${t}" [${e}]${r.detail?`: ${r.detail}`:""}. Run \`kane-cli login\` to re-auth.
|
|
6
6
|
`,exitCode:2};case"exchange_failed":return{message:`error: TMS credential exchange failed for profile "${t}" [${e}]. Token may be revoked \u2014 try \`kane-cli login\`; if the problem persists, TMS may be down.
|
|
7
7
|
`,exitCode:2}}}function O(t){return{id:t.project_id,name:t.name}}function M(t){return{id:t.id,name:t.name}}async function P(t,e,r,n){let o=r+n+1,i=[],s=!0;for await(let c of t.listProjectsStream({name:e})){if(i.push(...c.projects),c.done){s=!0;break}if(i.length>=o){s=!1;break}}return{items:i,doneStreaming:s}}function g(t){return!!t.agent||!process.stdin.isTTY||!process.stdout.isTTY}function _(t,e=r=>process.stdout.write(`${r}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as h}from"./chunk-
|
|
2
|
+
import{a as h}from"./chunk-IT66S24L.js";import{x as l}from"./chunk-LRKWPAGK.js";import{a as A}from"./chunk-HCBYKLMW.js";import{a as c,b as f,i as P}from"./chunk-C44QQJR4.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as x}from"./chunk-UR6MHSHU.js";var L=x(B(),1);var n=x(A(),1);function S(r,d,s,u,m){let p=s==="basic"&&u?`basic (${u})`:s,i=20,a=`${r} [${d}]`,g="\xB7".repeat(Math.max(2,i-a.length+3));return{label:`${a} ${g} ${p}`,profile:r,env:d,isActive:m}}function M({creds:r,onSwitch:d,onCancel:s}){let u=r.listProfiles(),m=r.getActiveProfile(),p=r.getDefaultEnv(),i=u.map(e=>{let o=r.loadBasicAuth(e.profile,e.env),t=r.loadCredentials(e.profile,e.env)!==null,v=o?"basic":t?"oauth":"none",b=o?o.username:null,w=e.profile===m&&e.env===p;return S(e.profile,e.env,v,b,w)}),[a,g]=(0,L.useState)(()=>{let e=i.findIndex(o=>o.isActive);return e>=0?e:0});return P((e,o)=>{if(o.escape){s();return}if(o.upArrow){g(t=>Math.max(0,t-1));return}if(o.downArrow){g(t=>Math.min(i.length-1,t+1));return}if(o.return&&i[a]){let t=i[a];t.isActive||d(t.profile,t.env),s();return}}),i.length===0?(0,n.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:l.orange,paddingX:2,paddingY:1,children:[(0,n.jsx)(f,{color:l.orange,bold:!0,children:"Profiles"}),(0,n.jsx)(c,{marginTop:1,children:(0,n.jsx)(f,{color:l.dim,children:"No profiles \u2014 use Login to create one"})}),(0,n.jsx)(h,{bindings:[],escBackLabel:"back"})]}):(0,n.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:l.orange,paddingX:2,paddingY:1,children:[(0,n.jsx)(f,{color:l.orange,bold:!0,children:"Profiles"}),(0,n.jsx)(c,{flexDirection:"column",marginTop:1,children:i.map((e,o)=>{let t=o===a,v=t?"\u276F ":" ",b=e.isActive?l.green:t?l.orange:void 0;return(0,n.jsxs)(f,{color:b,children:[v,e.label,e.isActive?" \u25CF active":""]},`${e.profile}-${e.env}`)})}),(0,n.jsx)(h,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"switch"}],escBackLabel:"back"})]})}export{S as a,M as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{x as m}from"./chunk-
|
|
2
|
+
import{x as m}from"./chunk-LRKWPAGK.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a as u,b as a,j as g}from"./chunk-C44QQJR4.js";import{a as b}from"./chunk-6YGTRKDT.js";import{e as f}from"./chunk-UR6MHSHU.js";var T=f(b(),1);function k(i,n){if(!n)return i;let l=i.trim()||n;return`\x1B]8;;${n}\x07${l}\x1B]8;;\x07`}var r=f(x(),1);function $({shareableLink:i,testCaseLink:n,codeExportDir:l,recordedTestPath:s,outputDir:o,autoExit:p=!0}){let{exit:c}=g();(0,T.useEffect)(()=>{if(!p)return;let t=setTimeout(()=>c(),100);return()=>clearTimeout(t)},[c,p]);let e=[];return s&&e.push({label:"Test",url:s,linkUrl:`file://${s}`}),o&&e.push({label:"Output",url:o,linkUrl:`file://${o}`}),i&&e.push({label:"ShareLink",url:i}),n&&e.push({label:"TestCase",url:n}),l&&!o&&e.push({label:"CodeExport",url:l,linkUrl:`file://${l}`}),e.length===0?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)(u,{flexDirection:"column",marginTop:1,marginLeft:1,children:e.map(t=>(0,r.jsxs)(u,{flexDirection:"column",marginBottom:1,children:[(0,r.jsxs)(a,{color:m.orange,children:[t.label,":"]}),(0,r.jsx)(a,{color:m.dim,children:k(t.url,t.linkUrl??t.url)})]},t.label))})}export{$ as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as K,c as V,d as z,e as ee,f as te}from"./chunk-
|
|
2
|
+
import{b as K,c as V,d as z,e as ee,f as te}from"./chunk-G2GQ67DP.js";import{c as J}from"./chunk-NAAPNSZD.js";import{a as Q}from"./chunk-53O3GMZR.js";import{a as Z}from"./chunk-FPFOW6BS.js";import{b as H}from"./chunk-OHT5RY5E.js";import{b as W}from"./chunk-VLWWDXBN.js";import{g as E}from"./chunk-LOIRZFV3.js";import{a as O}from"./chunk-LPUQ4HWQ.js";import{a as k,b as A,d as Y}from"./chunk-VE3SUJMA.js";import{a as q}from"./chunk-RB2YKN77.js";import{a as _}from"./chunk-KKIFXAJY.js";import{a as G}from"./chunk-HCBYKLMW.js";import{a as c,b as u,i as I,j as X}from"./chunk-C44QQJR4.js";import{a as ue}from"./chunk-6YGTRKDT.js";import{e as F}from"./chunk-UR6MHSHU.js";var i=F(ue(),1);var r=F(G(),1);function _e({resultRef:h,mode:d="singleshot",loginCompleteRef:f}){let{exit:m}=X(),C=(0,i.useRef)(new q),S=(0,i.useRef)(new Q),v=(0,i.useRef)(new J),t=C.current,l=S.current,$=v.current,ne=K(),[P,g]=(0,i.useState)(d==="login"?"login":"gate"),[L,re]=(0,i.useState)(null),[de,R]=(0,i.useState)(null),[ge,T]=(0,i.useState)(null),[N,oe]=(0,i.useState)(null),[U,B]=(0,i.useState)([]),x=(0,i.useCallback)((e,n,s,o)=>$.log(e,n,s,o),[$]),pe=(0,i.useCallback)((e,n)=>{e?k(t,l,e,n):l.save({project_id:null,project_name:null,folder_id:null,folder_name:null})},[t,l]),y=(0,i.useCallback)(()=>{d==="login"?(f&&(f.current=!0),m()):g("input")},[d,m,f]),D=(0,i.useCallback)((e,n)=>{let s=k(t,l,e,n);if(d==="login"){g("ensure-project");return}Y(s)?y():s.projectId?g("ensure-folder"):g("ensure-project")},[t,l,y,d]);I((e,n)=>{n.ctrl&&e==="c"&&E(0,"Ctrl+C exit")});let M=(0,i.useRef)(!1);i.default.useEffect(()=>{M.current||(M.current=!0,d!=="login"&&te(t,x).then(e=>{re(e),e.status==="authenticated"?D(e.result.profile,e.result.env):e.status==="needs_pick"?g("pick"):(R(e.profile??null),T(e.env??null),g("login"))}).catch(e=>{oe(`Auth check failed: ${e instanceof Error?e.message:String(e)}`)}))},[t,x]);let ie=(0,i.useCallback)(e=>{h.current={objective:e},m()},[h,m]),se=(0,i.useCallback)(async(e,n)=>{t.setActiveProfile(e),t.setDefaultEnv(n),(await ee(t,e,n,x)).status==="authenticated"?D(e,n):(R(e),T(n),g("login"))},[t,x,D]),w=(0,i.useCallback)(()=>{let e=t.getActiveProfile(),n=t.getDefaultEnv();if(!e)return null;let s=_(n),o=t.loadBasicAuth(e,n);return new Z(s.controllerBaseUrl,async()=>t.loadCredentials(e,n)?.access_token??null,o,x)},[t,x]),le=(0,i.useCallback)(async()=>{let e=w();if(!e)return null;let n=e.cached??await e.resolve();if(!n)return null;let s=_(t.getDefaultEnv()),o=new O(s.tmsBaseUrl,n.username,n.access_key);try{let p=(await o.listProjects()).find(b=>b.name==="KaneAI Generated");if(p)return{id:p.project_id,name:p.name};let j=await o.createProject("KaneAI Generated");return{id:j.id,name:j.name}}catch{return null}},[w,t]),ae=(0,i.useCallback)(async e=>{let n=w();if(!n)return null;let s=n.cached??await n.resolve();if(!s)return null;let o=_(t.getDefaultEnv()),a=new O(o.tmsBaseUrl,s.username,s.access_key);try{let j=(await a.listFolders(e)).find(ce=>ce.name==="Untitled");if(j)return{id:j.id,name:j.name};let b=await a.createFolder(e,"Untitled");return{id:b.id,name:b.name}}catch{return null}},[w,t]);if(P==="gate")return(0,r.jsx)(c,{paddingX:1,children:(0,r.jsx)(u,{color:"yellow",children:"Checking authentication..."})});if(N)return(0,r.jsxs)(c,{flexDirection:"column",paddingX:1,children:[(0,r.jsx)(u,{color:"red",children:N}),(0,r.jsx)(u,{color:"gray",children:"Press Ctrl+C to exit."})]});if(P==="pick"&&L?.status==="needs_pick")return(0,r.jsx)(fe,{profiles:L.profiles,onSelect:se});if(P==="login")return(0,r.jsx)(z,{devMode:process.env.KANE_DEV_MODE==="1",profiles:t.listProfiles(),onBasicLogin:async(e,n,s,o)=>{let{validateBasicAuth:a}=await import("./validate-basic-4YMRWYLS.js");await a(n,s,o),t.saveBasicAuth(e,n,{username:s,access_key:o}),t.setActiveProfile(e),t.setDefaultEnv(n)},onOAuthLogin:async(e,n)=>{let{LoginFlow:s}=await import("./login-flow-FIYH6K4A.js");t.setDefaultEnv(n),t.setActiveProfile(e),await new s(e,n,t).login()},onComplete:(e,n)=>{R(e),T(n),t.setActiveProfile(e),t.setDefaultEnv(n),D(e,n)},onCancel:()=>{E(0,"Login cancelled")}});if(P==="ensure-project"){let e=t.getActiveProfile()??"default",n=t.getDefaultEnv(),s=()=>{if(d==="login"){g("ensure-folder");return}k(t,l,e,n).folderId?y():g("ensure-folder")};return(0,r.jsxs)(c,{flexDirection:"column",children:[(0,r.jsx)(c,{paddingX:1,marginBottom:1,children:(0,r.jsx)(u,{color:"yellow",children:"Project & folder are required to save tests \xB7 Esc to use defaults \xB7 Ctrl+C to exit"})}),(0,r.jsx)(H,{resolver:w(),currentProjectId:l.load().project_id,env:n,onSelect:(o,a)=>{A(t,l,e,n,{projectId:o,projectName:a}),B(p=>[...p,`\u2713 Project: ${a} (${o})`]),s()},onCancel:async()=>{let o=await le();o&&(A(t,l,e,n,{projectId:o.id,projectName:o.name}),B(a=>[...a,`\u2713 Default project: ${o.name} (${o.id})`]),s())}})]})}if(P==="ensure-folder"){let e=t.getActiveProfile()??"default",n=t.getDefaultEnv(),s=t.loadProfileConfig(e,n);return(0,r.jsxs)(c,{flexDirection:"column",children:[(0,r.jsx)(c,{paddingX:1,marginBottom:1,children:(0,r.jsx)(u,{color:"yellow",children:"Project & folder are required to save tests \xB7 Esc to use defaults \xB7 Ctrl+C to exit"})}),(0,r.jsx)(W,{resolver:w(),projectId:s?.project_id??"",currentFolderId:l.load().folder_id,env:n,onSelect:(o,a)=>{A(t,l,e,n,{folderId:o,folderName:a}),B(p=>[...p,`\u2713 Folder: ${a} (${o})`]),y()},onCancel:async()=>{if(!s?.project_id)return;let o=await ae(s.project_id);o&&(A(t,l,e,n,{folderId:o.id,folderName:o.name}),B(a=>[...a,`\u2713 Default folder: ${o.name} (${o.id})`]),y())}})]})}return P==="input"?(0,r.jsxs)(c,{flexDirection:"column",children:[U.length>0&&(0,r.jsx)(c,{flexDirection:"column",paddingX:1,marginBottom:1,children:U.map((e,n)=>(0,r.jsx)(u,{color:"green",children:e},n))}),(0,r.jsx)(V,{onSubmit:ie,onEscape:()=>E(0,"User pressed Escape"),history:ne,placeholder:"Type an objective..."})]}):(0,r.jsx)(r.Fragment,{})}function fe({profiles:h,onSelect:d}){let[f,m]=(0,i.useState)(0),[C,S]=(0,i.useState)(!1);return I((v,t)=>{if(!C){if(t.escape){E(0,"Profile picker cancelled");return}if(t.upArrow&&f>0&&m(l=>l-1),t.downArrow&&f<h.length-1&&m(l=>l+1),t.return){S(!0);let l=h[f];d(l.profile,l.env).catch(()=>S(!1))}}}),(0,r.jsxs)(c,{flexDirection:"column",paddingX:1,children:[(0,r.jsx)(u,{color:"#ff9500",bold:!0,children:"Select a profile:"}),(0,r.jsx)(c,{marginTop:1,flexDirection:"column",children:h.map((v,t)=>(0,r.jsxs)(u,{children:[t===f?"\u276F ":" ",(0,r.jsx)(u,{color:t===f?"#ff9500":"white",bold:t===f,children:v.profile}),(0,r.jsxs)(u,{color:"gray",children:[" [",v.env,"]"]})]},`${v.profile}-${v.env}`))}),C&&(0,r.jsx)(c,{marginTop:1,children:(0,r.jsx)(u,{color:"yellow",children:"Validating credentials..."})})]})}export{_e as a};
|
|
@@ -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,c,e as o}from"./chunk-
|
|
2
|
+
import{a as l}from"./chunk-RZ4F3BHX.js";import{a,c,e as o}from"./chunk-LRKWPAGK.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,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as c}from"./chunk-
|
|
2
|
+
import{a as c}from"./chunk-KKIFXAJY.js";import{a as n}from"./chunk-RZ4F3BHX.js";import{u as s,v as a}from"./chunk-LRKWPAGK.js";import{createHash as h,randomBytes as g}from"crypto";var l=class{authBaseUrl;consentUrl;constructor(t="prod"){let e=c(t);this.authBaseUrl=e.authBaseUrl,this.consentUrl=e.consentUrl}static generatePkce(){let t=g(96).toString("base64url").slice(0,128),e=h("sha256").update(t).digest("base64url");return[t,e]}buildAuthorizationUrl(t,e,r,o){let i=new URLSearchParams({response_type:"code",client_id:t,redirect_uri:o,scope:a,code_challenge:e,code_challenge_method:"S256",state:r});return`${this.consentUrl}/oauth2?${i.toString()}`}async registerClient(t){let e=await n(`${this.authBaseUrl}/oauth2/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:s,redirect_uris:[t],grant_types:["authorization_code"],response_types:["code"],client_type:"public",application_type:"native"})});if(!e.ok)throw new Error(`DCR failed: ${e.status} ${await e.text()}`);return e.json()}async exchangeCode(t,e,r,o){let i=await n(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:t,redirect_uri:o,client_id:e,code_verifier:r})});if(!i.ok)throw new Error(`Token exchange failed: ${i.status}`);return i.json()}async refreshToken(t,e){let r=await n(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:t,client_id:e})});if(!r.ok)throw new Error(`Token refresh failed: ${r.status}`);return r.json()}async revokeToken(t,e,r="access_token"){await n(`${this.authBaseUrl}/oauth2/revoke`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,token_type_hint:r,client_id:e})})}async validateToken(t){let e=new AbortController,r=setTimeout(()=>e.abort(),1e4);try{let o=await n(`${this.authBaseUrl}/api/user`,{headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},signal:e.signal});return clearTimeout(r),o.ok}catch{return clearTimeout(r),!1}}};export{l as a};
|