@testmuai/kane-cli 0.2.11 → 0.3.1

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.
Files changed (83) hide show
  1. package/dist/{ChromeProfilePicker-YIDCOJVA.js → ChromeProfilePicker-HGRJNQDM.js} +1 -1
  2. package/dist/{CliFeedbackPrompt-T5LVDBVG.js → CliFeedbackPrompt-JXEPBJ63.js} +1 -1
  3. package/dist/CliUploadProgress-L5VJUXUC.js +2 -0
  4. package/dist/ConfigView-LOEAT3HQ.js +2 -0
  5. package/dist/FolderPicker-I6JTRNAU.js +2 -0
  6. package/dist/HelpView-UEUKYHFR.js +2 -0
  7. package/dist/InfoBox-MK7EEGCH.js +2 -0
  8. package/dist/{LinksBox-M72NCTRJ.js → LinksBox-RSWQWL6G.js} +1 -1
  9. package/dist/{ProfilesView-6MW5P6M4.js → ProfilesView-KCOMTDR5.js} +1 -1
  10. package/dist/ProjectPicker-AX6H5MX3.js +2 -0
  11. package/dist/SaveSessionPrompt-RGL3LAEB.js +2 -0
  12. package/dist/SingleShotApp-YTFAGVZD.js +2 -0
  13. package/dist/SummaryBox-5YPKUIHB.js +2 -0
  14. package/dist/TestMdRunView-QS7IUANM.js +2 -0
  15. package/dist/{WhoamiView-ZKNSYOLI.js → WhoamiView-GL3HZQ4Q.js} +1 -1
  16. package/dist/{changelog-TWE6QJ5S.js → changelog-CLQ7HCB3.js} +1 -1
  17. package/dist/{chunk-HHNLJWO5.js → chunk-34DK2AUH.js} +1 -1
  18. package/dist/chunk-3ELBJPHQ.js +2 -0
  19. package/dist/chunk-3MSXQU2C.js +2 -0
  20. package/dist/chunk-3QD3LA72.js +2 -0
  21. package/dist/chunk-BM4COXQU.js +53 -0
  22. package/dist/{chunk-55EYPGTJ.js → chunk-BQKDPI6L.js} +1 -1
  23. package/dist/{chunk-J3ZXTHAH.js → chunk-BR2S57O2.js} +1 -1
  24. package/dist/chunk-C5UNZ6ZY.js +2 -0
  25. package/dist/chunk-DUR6AFYA.js +5 -0
  26. package/dist/chunk-F6HEB4PA.js +2 -0
  27. package/dist/chunk-FFO5XXKV.js +4 -0
  28. package/dist/chunk-G7VF5SDK.js +10 -0
  29. package/dist/chunk-GTFULP6B.js +13 -0
  30. package/dist/{chunk-XQL5WHKR.js → chunk-HJ3CHMEM.js} +1 -1
  31. package/dist/{chunk-CKMDFVL6.js → chunk-K7MSPKEM.js} +1 -1
  32. package/dist/{chunk-C4KI7FLV.js → chunk-KULEBWMB.js} +1 -1
  33. package/dist/chunk-KVDOQY2Q.js +8 -0
  34. package/dist/{chunk-D3YS6JDD.js → chunk-L2HVRWIT.js} +8 -8
  35. package/dist/{chunk-Z3JYUFJ4.js → chunk-L4GAZTAQ.js} +1 -1
  36. package/dist/chunk-L4OZRHUT.js +5 -0
  37. package/dist/chunk-MDBXYXSC.js +2 -0
  38. package/dist/{chunk-Y4AOKSSQ.js → chunk-MEB2KLWF.js} +1 -1
  39. package/dist/chunk-NOH6RERF.js +6 -0
  40. package/dist/chunk-NZSHFIZX.js +3 -0
  41. package/dist/{chunk-TMTSY6CU.js → chunk-QO6VFDI4.js} +1 -1
  42. package/dist/chunk-RXMOIIQD.js +2 -0
  43. package/dist/chunk-S3DAAAE5.js +2 -0
  44. package/dist/chunk-SLA75N5B.js +2 -0
  45. package/dist/chunk-THNGNS36.js +2 -0
  46. package/dist/{chunk-2O7RIXHD.js → chunk-TK7ZJ7YX.js} +1 -1
  47. package/dist/chunk-VE3SUJMA.js +2 -0
  48. package/dist/chunk-VUBZQUP4.js +2 -0
  49. package/dist/chunk-WAFO4MT4.js +20 -0
  50. package/dist/chunk-XMK4GYI7.js +2 -0
  51. package/dist/chunk-XP5SMOND.js +2 -0
  52. package/dist/chunk-YCCUBQY4.js +2 -0
  53. package/dist/chunk-ZLQ7YLXO.js +2 -0
  54. package/dist/chunk-ZX3PMRMO.js +2 -0
  55. package/dist/effective-decisions-DRM3JSR4.js +2 -0
  56. package/dist/index.js +37 -46
  57. package/dist/{logging-JWPN5HMJ.js → logging-GG23EW5G.js} +1 -1
  58. package/dist/{login-flow-WXMKYI5G.js → login-flow-ZUZUZIXD.js} +1 -1
  59. package/dist/name-validator-5YGJXLZ7.js +2 -0
  60. package/dist/persist-recorded-session-ZXKA4H7E.js +5 -0
  61. package/dist/pipeline-BVH3R7YP.js +2 -0
  62. package/dist/profile-sync-DTTRRIVP.js +2 -0
  63. package/dist/recording-banner-IDLY2FM6.js +3 -0
  64. package/dist/replay-policy-6USQBT3E.js +2 -0
  65. package/dist/run-test-md-UPAR3DQY.js +54 -0
  66. package/dist/testmd-actions-YYFFNNIH.js +20 -0
  67. package/dist/{validate-basic-RV5TSUKJ.js → validate-basic-27BIMJ2F.js} +1 -1
  68. package/dist/{version-check-FOMPCS47.js → version-check-6DXFF6IN.js} +1 -1
  69. package/package.json +5 -5
  70. package/dist/CliUploadProgress-YJW7DHBT.js +0 -2
  71. package/dist/ConfigView-5L75H3A6.js +0 -2
  72. package/dist/FolderPicker-LEE4Y5JF.js +0 -2
  73. package/dist/HelpView-SIIWVMWF.js +0 -2
  74. package/dist/ProjectPicker-57G2ILEN.js +0 -2
  75. package/dist/SingleShotApp-UD4M2CZC.js +0 -2
  76. package/dist/chunk-7ONI2K3S.js +0 -2
  77. package/dist/chunk-ID77BNBM.js +0 -2
  78. package/dist/chunk-IQYKSZAW.js +0 -20
  79. package/dist/chunk-LBW6EFWN.js +0 -2
  80. package/dist/chunk-M5TQDTQN.js +0 -2
  81. package/dist/chunk-NDMXYUJM.js +0 -2
  82. package/dist/chunk-Y3MXIITZ.js +0 -2
  83. package/dist/pipeline-6DGALO2W.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-Y4AOKSSQ.js";import"./chunk-XQL5WHKR.js";import"./chunk-HCBYKLMW.js";import"./chunk-7ONI2K3S.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{c as ChromeProfilePicker,b as formatChromeProfileLine,a as listChromeProfiles};
2
+ import{a,b,c}from"./chunk-MEB2KLWF.js";import"./chunk-HJ3CHMEM.js";import"./chunk-HCBYKLMW.js";import"./chunk-3ELBJPHQ.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-Z3JYUFJ4.js";import"./chunk-XQL5WHKR.js";import"./chunk-HCBYKLMW.js";import"./chunk-7ONI2K3S.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};
2
+ import{a as r}from"./chunk-L4GAZTAQ.js";import"./chunk-HJ3CHMEM.js";import"./chunk-HCBYKLMW.js";import"./chunk-3ELBJPHQ.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};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as P,b as g,c as f}from"./chunk-VUBZQUP4.js";import"./chunk-RXMOIIQD.js";import{a as c}from"./chunk-HCBYKLMW.js";import"./chunk-3ELBJPHQ.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};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as d,b as l,c as r}from"./chunk-34DK2AUH.js";import{a as m}from"./chunk-HCBYKLMW.js";import{t as o}from"./chunk-3ELBJPHQ.js";import{a as t,j as u}from"./chunk-C44QQJR4.js";import{a as C}from"./chunk-6YGTRKDT.js";import{e as n}from"./chunk-UR6MHSHU.js";var f=n(C(),1);var e=n(m(),1);function D({model:c,authLabel:s,profile:g,env:p,defaultUrl:i,projectId:b,folderId:v,windowSize:x,chromeProfile:w}){let{exit:a}=u();return(0,f.useEffect)(()=>{let B=setTimeout(()=>a(),50);return()=>clearTimeout(B)},[a]),(0,e.jsx)(t,{flexDirection:"column",children:(0,e.jsx)(d,{title:"Configuration",children:(0,e.jsxs)(t,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(r,{label:"Auth"}),(0,e.jsx)(l,{label:" method",value:s}),(0,e.jsx)(l,{label:" profile",value:g}),(0,e.jsx)(l,{label:" env",value:p}),(0,e.jsx)(r,{label:"Defaults"}),(0,e.jsx)(l,{label:" url",value:i??"(none)",valueColor:i?o.cyan:o.dimmed}),(0,e.jsx)(l,{label:" model",value:c}),(0,e.jsx)(l,{label:" window",value:x}),(0,e.jsx)(l,{label:" project",value:b??"(none)"}),(0,e.jsx)(l,{label:" folder",value:v??"(none)"}),(0,e.jsx)(r,{label:"Paths"}),(0,e.jsx)(l,{label:" chrome",value:w,valueColor:o.dimmed})]})})})}export{D as ConfigView};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-3QD3LA72.js";import"./chunk-YCCUBQY4.js";import"./chunk-THNGNS36.js";import"./chunk-TK7ZJ7YX.js";import"./chunk-HJ3CHMEM.js";import"./chunk-HCBYKLMW.js";import"./chunk-3ELBJPHQ.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-YUUZDFT7.js";import"./chunk-DXKKUGFG.js";import"./chunk-UR6MHSHU.js";export{b as FolderPicker,a as formatFolderLine};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as T}from"./chunk-HCBYKLMW.js";import{a as f,b as l,t}from"./chunk-3ELBJPHQ.js";import{a as n,b as o,j as h,k as p}from"./chunk-C44QQJR4.js";import{a as w}from"./chunk-6YGTRKDT.js";import{e as x}from"./chunk-UR6MHSHU.js";var b=x(w(),1);var e=x(T(),1),B="https://www.testmuai.com/support/docs/kane-cli-introduction",S="https://github.com/LambdaTest/kane-cli/issues";function L(){let{exit:c}=h(),{stdout:r}=p(),a=r?.columns??80;return(0,b.useEffect)(()=>{let d=setTimeout(()=>c(),50);return()=>clearTimeout(d)},[c]),(0,e.jsxs)(n,{flexDirection:"column",children:[(0,e.jsxs)(n,{paddingX:1,paddingTop:1,flexDirection:"column",children:[(0,e.jsx)(o,{color:t.purple,bold:!0,children:l}),(0,e.jsxs)(n,{children:[(0,e.jsx)(o,{color:t.dimmed,children:"Browser automation powered by AI "}),(0,e.jsxs)(o,{color:t.muted,children:[" v",f]})]})]}),(0,e.jsx)(o,{children:" "}),(0,e.jsxs)(m,{title:"USAGE",children:[(0,e.jsx)(g,{cmd:`${l}`,desc:"Single-shot prompt (no args, TTY)"}),(0,e.jsx)(g,{cmd:`${l} --tui`,desc:"Full interactive TUI",highlight:!0}),(0,e.jsx)(g,{cmd:`${l} run "<objective>"`,desc:"Inline objective"}),(0,e.jsx)(g,{cmd:`${l} run path/to/test.md`,desc:"Replay a saved test"})]}),(0,e.jsxs)(m,{title:"COMMANDS",children:[(0,e.jsx)(s,{cmd:"run",args:"<objective | path.md>",desc:"Run an objective or *_test.md file",highlight:!0}),(0,e.jsx)(s,{cmd:"login",desc:"Auth setup (interactive, --oauth, or --username)"}),(0,e.jsx)(s,{cmd:"logout",desc:"Revoke tokens + delete profile"}),(0,e.jsx)(s,{cmd:"whoami",desc:"Show authenticated identity"}),(0,e.jsx)(s,{cmd:"config",args:"show|set-\u2026|reset",desc:"Manage configuration"}),(0,e.jsx)(s,{cmd:"profiles",args:"list|switch|delete",desc:"Manage auth profiles"})]}),(0,e.jsxs)(m,{title:"RUN FLAGS",children:[(0,e.jsx)(i,{long:"--max-steps",arg:"<n>",desc:"Max agent steps (default: 30)"}),(0,e.jsx)(i,{long:"--timeout",arg:"<sec>",desc:"Kill run after N seconds"}),(0,e.jsx)(i,{long:"--headless",desc:"No visible browser window"}),(0,e.jsx)(i,{long:"--variables",arg:"<json>",desc:"Inline variables as JSON"}),(0,e.jsx)(i,{long:"--variables-file",arg:"<path>",desc:"Load variables from file"}),(0,e.jsx)(i,{long:"--ws-endpoint",arg:"<url>",desc:"Remote browser (LambdaTest)"}),(0,e.jsx)(i,{long:"--cdp-endpoint",arg:"<url>",desc:"Connect to existing Chrome CDP"}),(0,e.jsx)(i,{long:"--cft",desc:"Use Playwright Chromium instead of managed Chrome"}),(0,e.jsx)(i,{long:"--global-context",arg:"<file>",desc:"Override global context markdown"}),(0,e.jsx)(i,{long:"--local-context",arg:"<file>",desc:"Override local context markdown"}),(0,e.jsx)(i,{long:"--username",arg:"<user>",desc:"Basic auth (skip OAuth)"}),(0,e.jsx)(i,{long:"--access-key",arg:"<key>",desc:"Basic auth access key"}),(0,e.jsx)(i,{long:"--env",arg:"<name>",desc:"Environment (prod or stage)"}),(0,e.jsx)(i,{long:"--agent",desc:"NDJSON output (no UI)",highlight:!0})]}),(0,e.jsxs)(m,{title:"EXAMPLES",children:[(0,e.jsx)(u,{label:"Search",cmd:`${l} run "Search for laptop"`}),(0,e.jsx)(u,{label:"Replay a saved test",cmd:`${l} run smoke_test.md`}),(0,e.jsx)(u,{label:"Variables",cmd:`${l} run "Login as {{user}}" --variables '{"user":{"value":"alice"}}'`}),(0,e.jsx)(u,{label:"Agent",cmd:`${l} run "Add to cart" --agent | jq .status`})]}),(0,e.jsx)(m,{title:"TEST FILES",children:(0,e.jsxs)(n,{marginLeft:2,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dimmed,children:[(0,e.jsx)(o,{color:t.cyan,children:"*_test.md"})," \u2014 markdown test files with YAML frontmatter and ",(0,e.jsx)(o,{color:t.cyan,children:"## "}),"step headings."]}),(0,e.jsxs)(o,{color:t.dimmed,children:["Run with ",(0,e.jsxs)(o,{color:t.cyan,children:[l," run path/to/foo_test.md"]}),"."]}),(0,e.jsxs)(o,{color:t.dimmed,children:["Sessions you run in TUI auto-save to ",(0,e.jsx)(o,{color:t.cyan,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(a-2,70))}),(0,e.jsxs)(n,{gap:3,children:[(0,e.jsxs)(n,{children:[(0,e.jsx)(o,{color:t.dimmed,children:"Docs "}),(0,e.jsx)(o,{color:t.cyan,underline:!0,children:B})]}),(0,e.jsxs)(n,{children:[(0,e.jsx)(o,{color:t.dimmed,children:"Bugs "}),(0,e.jsx)(o,{color:t.cyan,underline:!0,children:S})]})]})]}),(0,e.jsx)(o,{children:" "})]})}function m({title:c,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.dimmed,children:c})}),r]})}function g({cmd:c,desc:r,highlight:a}){return(0,e.jsxs)(n,{marginLeft:2,children:[(0,e.jsxs)(n,{width:36,children:[(0,e.jsx)(o,{color:t.dimmed,children:"$ "}),(0,e.jsx)(o,{color:a?t.purple:t.cyan,children:c})]}),(0,e.jsx)(o,{color:t.dimmed,children:r})]})}function s({cmd:c,args:r,desc:a,highlight:d}){return(0,e.jsxs)(n,{marginLeft:2,children:[(0,e.jsx)(n,{width:12,children:(0,e.jsx)(o,{color:d?t.purple:t.green,bold:!0,children:c})}),(0,e.jsx)(n,{width:28,children:r?(0,e.jsx)(o,{color:t.dimmed,children:r}):null}),(0,e.jsx)(o,{color:t.dimmed,children:a})]})}function i({long:c,arg:r,desc:a,highlight:d}){return(0,e.jsxs)(n,{marginLeft:2,children:[(0,e.jsxs)(n,{width:26,children:[(0,e.jsx)(o,{color:d?t.purple:t.cyan,children:c}),r&&(0,e.jsxs)(o,{color:t.dimmed,children:[" ",r]})]}),(0,e.jsx)(o,{color:t.dimmed,children:a})]})}function u({label:c,cmd:r}){return(0,e.jsxs)(n,{marginLeft:2,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dimmed,children:["# ",c]}),(0,e.jsxs)(o,{color:t.cyan,children:["$ ",r]})]})}export{L as HelpView};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a}from"./chunk-ZX3PMRMO.js";import"./chunk-34DK2AUH.js";import"./chunk-HCBYKLMW.js";import"./chunk-3ELBJPHQ.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-NDMXYUJM.js";import"./chunk-HCBYKLMW.js";import"./chunk-7ONI2K3S.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as LinksBox};
2
+ import{a}from"./chunk-XP5SMOND.js";import"./chunk-HCBYKLMW.js";import"./chunk-3ELBJPHQ.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-TMTSY6CU.js";import"./chunk-XQL5WHKR.js";import"./chunk-HCBYKLMW.js";import"./chunk-7ONI2K3S.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProfilesView,a as formatProfileLine};
2
+ import{a,b}from"./chunk-QO6VFDI4.js";import"./chunk-HJ3CHMEM.js";import"./chunk-HCBYKLMW.js";import"./chunk-3ELBJPHQ.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProfilesView,a as formatProfileLine};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-ZLQ7YLXO.js";import"./chunk-YCCUBQY4.js";import"./chunk-THNGNS36.js";import"./chunk-TK7ZJ7YX.js";import"./chunk-HJ3CHMEM.js";import"./chunk-HCBYKLMW.js";import"./chunk-3ELBJPHQ.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-YUUZDFT7.js";import"./chunk-DXKKUGFG.js";import"./chunk-UR6MHSHU.js";export{b as ProjectPicker,a as formatProjectLine};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b,c}from"./chunk-XMK4GYI7.js";import"./chunk-S3DAAAE5.js";import"./chunk-ZX3PMRMO.js";import"./chunk-34DK2AUH.js";import"./chunk-HCBYKLMW.js";import"./chunk-3ELBJPHQ.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{f as a}from"./chunk-NZSHFIZX.js";import"./chunk-BM4COXQU.js";import"./chunk-G7VF5SDK.js";import"./chunk-KVDOQY2Q.js";import"./chunk-ZLQ7YLXO.js";import"./chunk-3QD3LA72.js";import"./chunk-YCCUBQY4.js";import"./chunk-THNGNS36.js";import"./chunk-VE3SUJMA.js";import"./chunk-K7MSPKEM.js";import"./chunk-TK7ZJ7YX.js";import"./chunk-PWGEMRBD.js";import"./chunk-L5Y2GUO6.js";import"./chunk-HJ3CHMEM.js";import"./chunk-HCBYKLMW.js";import"./chunk-3ELBJPHQ.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-YUUZDFT7.js";import"./chunk-DXKKUGFG.js";import"./chunk-UR6MHSHU.js";export{a as SingleShotApp};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as S}from"./chunk-ZX3PMRMO.js";import"./chunk-34DK2AUH.js";import{a as R}from"./chunk-HCBYKLMW.js";import{t as o}from"./chunk-3ELBJPHQ.js";import{a as b,b as c,j as x}from"./chunk-C44QQJR4.js";import{a as w}from"./chunk-6YGTRKDT.js";import{e as y}from"./chunk-UR6MHSHU.js";var T=y(w(),1);var i=y(R(),1);function L(e){let t=e.decisions.filter(l=>l.kind==="replay").length,s=e.decisions.filter(l=>l.kind==="author").length,d=e.outcomes.filter(l=>l.status==="passed").length,p=e.outcomes.filter(l=>l.status==="failed").length,f=e.outcomes.filter(l=>l.status==="skipped").length,a=o.green,n;e.cancelled||e.overallStatus==="interrupted"?(a=o.yellow,n="CANCELLED"):e.overallStatus==="failed"?(a=o.red,n="FAILED"):n="PASSED";let r=`${n} \xB7 ${e.durationS}s \xB7 ${e.outcomes.length} steps (${d} passed, ${p} failed, ${f} skipped)`,k=`${t} replay \xB7 ${s} author`,C=e.retryTriggered,v="yes \u2014 run recovered after a replay miss",u,g=o.dimmed;if(e.cancelled)u="\u2013 not committed (cancellation)";else if(e.overallStatus==="failed")u="\u2013 not committed (run failed)",g=o.red;else if(!e.shouldCommit)e.isFirstRun?u="\u2013 not committed (first run skipped commit)":e.lockHeld?u="\u2013 not committed":u="\u2013 not committed (readonly fallback / no lock)";else{let l=e.uploadResult?.testcaseId;u=l?`\u2713 pushed (testcase=${l})`:"\u2713 pushed",g=o.green}let _=e.shouldReplaceLocalOutput?"output dir replaced":e.anyAuthorStepRan?"untouched (cancellation or no replace)":"untouched (replay-only)",m,h=o.dimmed;return e.shouldUploadArtifacts?e.uploadResult?.success?(m="\u2713 TMS",h=o.green):e.uploadResult?(m=`\u2717 failed${e.uploadResult.error?`: ${e.uploadResult.error}`:""}`,h=o.red):m="\u2013 not run":m="\u2013 skipped (--local or no auth)",{resultLine:{color:a,text:r},breakdown:k,showRetries:C,retriesText:v,commitText:u,commitColor:g,artifactsText:_,uploadText:m,uploadColor:h}}function O(e){let t=e.decisions.filter(r=>r.kind==="replay").length,s=e.decisions.filter(r=>r.kind==="author").length,d=e.outcomes.filter(r=>r.status==="passed").length,p=e.outcomes.filter(r=>r.status==="failed").length,f=e.outcomes.filter(r=>r.status==="skipped").length,a,n=!1;return e.cancelled?a="cancellation":e.overallStatus==="failed"?a="run_failed":e.shouldCommit&&e.uploadResult?.testcaseId?(a="ok",n=!0):!e.shouldCommit&&!e.lockHeld&&!e.isFirstRun?a="readonly_fallback":a="not_committed",{type:"test_md_summary",overall_status:e.overallStatus,duration_s:e.durationS,steps:{total:e.outcomes.length,passed:d,failed:p,skipped:f,replay_decisions:t,author_decisions:s},retries:{triggered:e.retryTriggered},commit:{committed:n,reason:a,...e.uploadResult?.testcaseId?{testcase_id:e.uploadResult.testcaseId}:{}},artifacts:{replaced:e.shouldReplaceLocalOutput},upload:{performed:e.shouldUploadArtifacts,...e.uploadResult?{succeeded:!!e.uploadResult.success}:{}},cancelled:e.cancelled}}function A({data:e}){let t=L(e),s=[{label:"result",value:(0,i.jsx)(c,{color:t.resultLine.color,bold:!0,children:t.resultLine.text})},{label:"breakdown",value:(0,i.jsx)(c,{color:o.dimmed,children:t.breakdown})}];return t.showRetries&&s.push({label:"retries",value:(0,i.jsx)(c,{color:o.yellow,children:t.retriesText})}),s.push({label:"commit",value:(0,i.jsx)(c,{color:t.commitColor,children:t.commitText})}),s.push({label:"artifacts",value:(0,i.jsx)(c,{color:o.dimmed,children:t.artifactsText})}),s.push({label:"upload",value:(0,i.jsx)(c,{color:t.uploadColor,children:t.uploadText})}),(0,i.jsx)(S,{title:"Run summary",titleColor:"#ff9500",rows:s})}function I({data:e}){let{exit:t}=x();return(0,T.useEffect)(()=>{let s=setTimeout(()=>t(),50);return()=>clearTimeout(s)},[t]),(0,i.jsx)(b,{flexDirection:"column",children:(0,i.jsx)(A,{data:e})})}export{I as AutoExitSummaryBox,A as SummaryBox,O as buildSummaryEvent,L as buildSummaryRendered};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as $,b as j,c as L,d as N,e as T,f as _,g as F}from"./chunk-L4OZRHUT.js";import"./chunk-RXMOIIQD.js";import"./chunk-DUR6AFYA.js";import"./chunk-G7VF5SDK.js";import"./chunk-TK7ZJ7YX.js";import{a as A}from"./chunk-ZX3PMRMO.js";import"./chunk-34DK2AUH.js";import{a as I}from"./chunk-HCBYKLMW.js";import{t as p}from"./chunk-3ELBJPHQ.js";import{a as R,b as l,d as P,i as k,j as D}from"./chunk-C44QQJR4.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as C}from"./chunk-UR6MHSHU.js";var a=C(B(),1);var i=C(B(),1);function U(e){let r=N(e.screenshotDispatcher,e.stepLogger,e.onReasoning,e.onStepComplete),[h,f]=(0,i.useState)(0),[y,c]=(0,i.useState)("idle"),d=(0,i.useRef)("idle"),S=(0,i.useRef)(0),w=(0,i.useRef)(!1),x=(0,i.useRef)(null),v=(0,i.useRef)(null),g=(0,i.useCallback)(u=>{d.current=u,c(u)},[]),m=(0,i.useCallback)(async u=>{let n=await e.getNextConfig(u);if(!n){g("done"),e.onAllComplete?.();return}let o=u?S.current+1:0;S.current=o,f(o),e.onStepStart?.(n,o),x.current=null,v.current=null,g("running"),await r.startRun(n,e.spawnOpts)},[r,e,g]);(0,i.useEffect)(()=>{w.current||(w.current=!0,m(null))},[]),(0,i.useEffect)(()=>{if(!r.lastRunEnd||r.lastRunEnd===x.current||d.current!=="running")return;x.current=r.lastRunEnd,d.current="transitioning",c("transitioning");let u=r.lastRunEnd,n=T(r.steps),o=r.bifurcationInfo,s={status:u.status==="passed"?"passed":"failed",duration_s:u.duration??0,reason:u.reason,runEnd:u,hadError:!1,stepsPassed:n.passed,stepsFailed:n.failed,stepsTotal:n.total,bifurcationFlows:o&&!o.isSingleFlow?o.flows:null};if(!(e.onStepEnd?.(s,S.current)??!0)){g("done"),e.onAllComplete?.();return}m(s)},[r.lastRunEnd]),(0,i.useEffect)(()=>{if(!r.runError||r.runError===v.current||r.lastRunEnd||d.current!=="running")return;v.current=r.runError,d.current="transitioning",c("transitioning");let u=T(r.steps),n={status:"failed",duration_s:0,reason:r.runError,runEnd:null,hadError:!0,stepsPassed:u.passed,stepsFailed:u.failed,stepsTotal:u.total,bifurcationFlows:null};if(!(e.onStepEnd?.(n,S.current)??!0)){g("done"),e.onAllComplete?.();return}m(n)},[r.runError,r.lastRunEnd]);let O=(0,i.useCallback)(()=>{r.cancelRun()},[r]);return{runner:r,currentStepIndex:h,phase:y,cancel:O}}var b=C(I(),1);function G({runner:e,runKey:r,onStepCommit:h}){let f=L({isRunning:e.isRunning,bifurcationInfo:e.bifurcationInfo,steps:e.steps,cmInitCounts:e.cmInitCounts,replayInfo:e.replayInfo});return(0,b.jsxs)(b.Fragment,{children:[f&&(0,b.jsx)(j,{label:f.label,hasBifurcation:f.hasBifurcation}),e.isRunning&&e.steps.length>0&&(0,b.jsx)($,{steps:e.steps,bifurcated:!!e.bifurcationInfo&&!e.bifurcationInfo.isSingleFlow,flows:e.bifurcationInfo?.flows,cmInitCounts:e.cmInitCounts,maxSteps:e.maxSteps,onStepCommit:h},`run-${r}`)]})}var t=C(I(),1);function le(e){let{exit:r}=D(),h=(0,a.useRef)(0),[f,y]=(0,a.useState)([{id:"top-banner",content:(0,t.jsx)(R,{flexDirection:"column",marginBottom:1,children:(0,t.jsxs)(R,{borderStyle:"round",borderColor:"#dc4e08",paddingX:2,children:[(0,t.jsx)(l,{color:"#ff9500",bold:!0,children:"KaneAI CLI"}),(0,t.jsx)(l,{color:p.dimmed,children:" \u2502 "}),(0,t.jsx)(l,{color:p.cyan,children:e.topBanner.model}),(0,t.jsx)(l,{color:p.dimmed,children:" \u2502 "}),(0,t.jsx)(l,{color:p.dimmed,children:e.topBanner.auth})]})})},{id:"global-config",content:(0,t.jsx)(W,{data:e.globalConfig})},...e.priorAttemptRollup?[{id:"prior-rollup",content:(0,t.jsx)(l,{color:p.dimmed,children:` \u21B3 replayed ${e.priorAttemptRollup.startIdx}..${e.priorAttemptRollup.endIdx-1} (${e.priorAttemptRollup.count} steps, from prior attempt)`})}]:[]]),c=(0,a.useCallback)(n=>{let o=`s-${++h.current}`;y(s=>[...s,{id:o,content:n}])},[]),d=(0,a.useRef)(null),S=(0,a.useCallback)(async n=>{let o=await e.getNextStep(n);return o?(d.current=o,o.config):(d.current=null,null)},[e]),w=(0,a.useCallback)((n,o)=>{let s=d.current;if(!s)return;let E=s.mode==="replay"?"cyan":"#dc4e08",M=s.modeReason?` (${s.modeReason})`:"",q=s.perStepOverrides?Object.entries(s.perStepOverrides):[];c((0,t.jsxs)(R,{flexDirection:"column",marginBottom:0,children:[(0,t.jsxs)(l,{children:[(0,t.jsxs)(l,{color:p.dimmed,children:[s.banner.stepLabel," "]}),(0,t.jsxs)(l,{color:E,children:["[",s.mode,"]"]}),(0,t.jsx)(l,{color:p.dimmed,children:M})]}),(0,t.jsx)(l,{color:p.dimmed,children:s.banner.objective}),q.length>0&&(0,t.jsxs)(l,{color:p.dimmed,children:["overrides: ",q.map(([V,K])=>`${V}=${K}`).join(", ")]})]}))},[c]),x=(0,a.useRef)(0),v=(0,a.useRef)(!1),g=(0,a.useCallback)((n,o)=>(n.hadError?c((0,t.jsx)(F,{message:n.reason??"Runner error",code:"RUNNER_ERROR"})):c((0,t.jsx)(R,{flexDirection:"column",marginBottom:1,children:(0,t.jsx)(_,{status:n.status,summary:n.runEnd?.summary??"",duration:n.runEnd?.duration??0,steps:n.stepsTotal,stepsPassed:n.stepsPassed,stepsFailed:n.stepsFailed,reason:n.runEnd?.reason,creditsConsumed:n.runEnd?.credits_consumed})})),e.onStepEnd?.(n,o)??!0),[c,e]),m=U({getNextConfig:S,onStepStart:w,onStepEnd:g,onAllComplete:()=>{e.onAllComplete(),setImmediate(()=>r())},screenshotDispatcher:e.screenshotDispatcher,stepLogger:e.stepLogger,onReasoning:e.onReasoning,onStepComplete:e.onStepComplete,spawnOpts:e.spawnOpts}),O=250,u=5e3;return k((n,o)=>{if(o.ctrl&&n==="c"){let s=Date.now(),E=s-x.current;if(E<O)return;v.current&&E<u?(m.cancel(),e.onCancel?.(),setImmediate(()=>r())):(v.current=!0,c((0,t.jsx)(l,{color:"yellow",children:"press Ctrl+C again to cancel run"}))),x.current=s}}),(0,t.jsxs)(R,{flexDirection:"column",children:[(0,t.jsx)(P,{items:f,children:n=>(0,t.jsx)(R,{children:n.content},n.id)}),m.phase!=="done"&&(0,t.jsx)(G,{runner:m.runner,runKey:m.currentStepIndex,onStepCommit:c})]})}function W({data:e}){return(0,t.jsx)(A,{title:"test.md run",titleColor:"#ff9500",borderColor:p.dimmed,rows:[{label:"source",value:e.source},{label:"steps",value:`${e.steps.total} (${e.steps.replay} replay, ${e.steps.author} author per walker)`},{label:"model",value:e.model},{label:"viewport",value:`${e.viewport.width} x ${e.viewport.height}`},{label:"chrome",value:e.chrome},{label:"session",value:e.session},{label:"variables",value:`${e.variables.count} (${e.variables.secrets} secret)`},{label:"flags",value:e.flags.length>0?e.flags.join(" "):"(none)"}]})}export{le as TestMdRunView};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as s,b as o}from"./chunk-HHNLJWO5.js";import{a as x}from"./chunk-HCBYKLMW.js";import{t as i}from"./chunk-7ONI2K3S.js";import{a as r,b as n,j as u}from"./chunk-C44QQJR4.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as t}from"./chunk-UR6MHSHU.js";var p=t(B(),1);var e=t(x(),1);function R({profile:f,env:g,authenticated:a,authMethod:v,username:m,tokenStatus:l,expiresAt:c}){let{exit:d}=u();return(0,p.useEffect)(()=>{let b=setTimeout(()=>d(),50);return()=>clearTimeout(b)},[d]),(0,e.jsx)(r,{flexDirection:"column",children:(0,e.jsx)(s,{title:"Identity",variant:a?"success":"warning",children:(0,e.jsxs)(r,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(r,{children:a?(0,e.jsx)(n,{color:i.green,bold:!0,children:"\u2713 Authenticated"}):(0,e.jsx)(n,{color:i.yellow,bold:!0,children:"\u26A0 Not logged in"})}),(0,e.jsxs)(r,{flexDirection:"column",marginTop:1,children:[(0,e.jsx)(o,{label:"Profile",value:f}),(0,e.jsx)(o,{label:"Environment",value:g}),(0,e.jsx)(o,{label:"Method",value:v}),m&&(0,e.jsx)(o,{label:"User",value:m}),l&&(0,e.jsx)(o,{label:"Token",value:l,valueColor:l==="valid"?i.green:l==="expired"?i.red:i.dimmed}),c&&(0,e.jsx)(o,{label:"Expires",value:c})]})]})})})}export{R as WhoamiView};
2
+ import{a as s,b as o}from"./chunk-34DK2AUH.js";import{a as x}from"./chunk-HCBYKLMW.js";import{t as i}from"./chunk-3ELBJPHQ.js";import{a as r,b as n,j as u}from"./chunk-C44QQJR4.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as t}from"./chunk-UR6MHSHU.js";var p=t(B(),1);var e=t(x(),1);function R({profile:f,env:g,authenticated:a,authMethod:v,username:m,tokenStatus:l,expiresAt:c}){let{exit:d}=u();return(0,p.useEffect)(()=>{let b=setTimeout(()=>d(),50);return()=>clearTimeout(b)},[d]),(0,e.jsx)(r,{flexDirection:"column",children:(0,e.jsx)(s,{title:"Identity",variant:a?"success":"warning",children:(0,e.jsxs)(r,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(r,{children:a?(0,e.jsx)(n,{color:i.green,bold:!0,children:"\u2713 Authenticated"}):(0,e.jsx)(n,{color:i.yellow,bold:!0,children:"\u26A0 Not logged in"})}),(0,e.jsxs)(r,{flexDirection:"column",marginTop:1,children:[(0,e.jsx)(o,{label:"Profile",value:f}),(0,e.jsx)(o,{label:"Environment",value:g}),(0,e.jsx)(o,{label:"Method",value:v}),m&&(0,e.jsx)(o,{label:"User",value:m}),l&&(0,e.jsx)(o,{label:"Token",value:l,valueColor:l==="valid"?i.green:l==="expired"?i.red:i.dimmed}),c&&(0,e.jsx)(o,{label:"Expires",value:c})]})]})})})}export{R as WhoamiView};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as i,f as c}from"./chunk-7ONI2K3S.js";import"./chunk-UR6MHSHU.js";import{readFileSync as h,writeFileSync as g,mkdirSync as u}from"fs";import{join as d}from"path";var l=d(i,"changelog-cache.json"),f=3600*1e3;function p(){try{let e=JSON.parse(h(l,"utf-8"));if(Date.now()-e.cachedAt<f)return e}catch{}return null}function y(e){try{u(i,{recursive:!0}),g(l,JSON.stringify({entries:e,cachedAt:Date.now()}))}catch{}}async function E(e){try{let t=p();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 fetch(`${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 y(s),e?.all?s:s.slice(0,5)}catch{return[]}}function A(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(`
2
+ import{c as i,f as c}from"./chunk-3ELBJPHQ.js";import"./chunk-UR6MHSHU.js";import{readFileSync as h,writeFileSync as g,mkdirSync as u}from"fs";import{join as d}from"path";var l=d(i,"changelog-cache.json"),f=3600*1e3;function p(){try{let e=JSON.parse(h(l,"utf-8"));if(Date.now()-e.cachedAt<f)return e}catch{}return null}function y(e){try{u(i,{recursive:!0}),g(l,JSON.stringify({entries:e,cachedAt:Date.now()}))}catch{}}async function E(e){try{let t=p();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 fetch(`${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 y(s),e?.all?s:s.slice(0,5)}catch{return[]}}function A(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{E as fetchChangelog,A as formatChangelog};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as m}from"./chunk-HCBYKLMW.js";import{t as o}from"./chunk-7ONI2K3S.js";import{a as r,b as i}from"./chunk-C44QQJR4.js";import{e as a}from"./chunk-UR6MHSHU.js";var e=a(m(),1),u={default:o.muted,error:o.red,success:o.green,info:o.purple,warning:o.yellow};function T({title:t,titleColor:l,borderColor:d,variant:n="default",children:c,width:s,paddingX:x=2,paddingY:g=0,marginBottom:p=0}){let f=d??u[n],B=l??(n==="default"?o.purple:u[n]);return(0,e.jsxs)(r,{flexDirection:"column",marginBottom:p,children:[t&&(0,e.jsx)(r,{marginBottom:0,children:(0,e.jsxs)(i,{color:B,bold:!0,children:[" ",t]})}),(0,e.jsx)(r,{borderStyle:"round",borderColor:f,flexDirection:"column",paddingX:x,paddingY:g,width:s,children:c})]})}function h({label:t,value:l,labelColor:d=o.dimmed,valueColor:n,labelWidth:c=14}){return(0,e.jsxs)(r,{children:[(0,e.jsx)(r,{width:c,children:(0,e.jsx)(i,{color:d,children:t})}),(0,e.jsx)(i,{color:n,children:l})]})}function C({label:t}){return(0,e.jsx)(r,{marginTop:1,marginBottom:0,children:(0,e.jsx)(i,{bold:!0,children:t})})}export{T as a,h as b,C as c};
2
+ import{a as m}from"./chunk-HCBYKLMW.js";import{t as o}from"./chunk-3ELBJPHQ.js";import{a as r,b as i}from"./chunk-C44QQJR4.js";import{e as a}from"./chunk-UR6MHSHU.js";var e=a(m(),1),u={default:o.muted,error:o.red,success:o.green,info:o.purple,warning:o.yellow};function T({title:t,titleColor:l,borderColor:d,variant:n="default",children:c,width:s,paddingX:x=2,paddingY:g=0,marginBottom:p=0}){let f=d??u[n],B=l??(n==="default"?o.purple:u[n]);return(0,e.jsxs)(r,{flexDirection:"column",marginBottom:p,children:[t&&(0,e.jsx)(r,{marginBottom:0,children:(0,e.jsxs)(i,{color:B,bold:!0,children:[" ",t]})}),(0,e.jsx)(r,{borderStyle:"round",borderColor:f,flexDirection:"column",paddingX:x,paddingY:g,width:s,children:c})]})}function h({label:t,value:l,labelColor:d=o.dimmed,valueColor:n,labelWidth:c=14}){return(0,e.jsxs)(r,{children:[(0,e.jsx)(r,{width:c,children:(0,e.jsx)(i,{color:d,children:t})}),(0,e.jsx)(i,{color:n,children:l})]})}function C({label:t}){return(0,e.jsx)(r,{marginTop:1,marginBottom:0,children:(0,e.jsx)(i,{bold:!0,children:t})})}export{T as a,h as b,C as c};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{homedir as s}from"os";import{join as t}from"path";var c="0.3.1",l="kane-cli",e=t(s(),".testmuai","kaneai"),m=t(e,"profiles"),i=t(e,"tui-config.json"),d="https://registry.npmjs.org/@testmuai/kane-cli",h="https://api.github.com/repos/LambdaTest/kane-cli/releases",f="https://dd-proxy.lambdatest.com/intake/kane-cli",u="https://kaneai-playground.lambdatest.io",_=9222,b=9230,U=t(e,"chrome-profiles"),r="127.0.0.1",x=18392,g=18400,o="/callback";function A(a){return`http://${r}:${a}${o}`}var R="KANE CLI",L="*",C={prod:{authBaseUrl:"https://auth.lambdatest.com",consentUrl:"https://accounts.lambdatest.com",controllerBaseUrl:"https://kaneai-api.lambdatest.com/v16-controller/v1",tmsBaseUrl:"https://test-manager-api.lambdatest.com/api",secretsBaseUrl:"https://api-hyperexecute.lambdatest.com",testManagerUiUrl:"https://test-manager.lambdatest.com",shareApiBaseUrl:"https://api.lambdatest.com",v16ServerHost:"https://kaneai-api.lambdatest.com/v16-server"},stage:{authBaseUrl:"https://stage-auth.lambdatestinternal.com",consentUrl:"https://stage-accounts.lambdatestinternal.com",controllerBaseUrl:"https://auteur-stage-automind.lambdatestinternal.com/v16-controller/v1",tmsBaseUrl:"https://stage-test-manager-api.lambdatestinternal.com/api",secretsBaseUrl:"https://api-stage-hyperexecute.lambdatestinternal.com",testManagerUiUrl:"https://stage-test-manager.lambdatestinternal.com",shareApiBaseUrl:"https://stage-api.lambdatestinternal.com",v16ServerHost:"https://auteur-stage-automind.lambdatestinternal.com/v16-server"}},E={base:"#ffffff",primary:"#ff9500",secondary:"#888888",accent:"#ffffff",dim:"#666666",ambient:"#444444",statusPass:"#4ade80",statusFail:"#ef4444",purple:"#ff9500",cyan:"#ff9500",yellow:"#ff9500",green:"#4ade80",greenDim:"#666666",red:"#ef4444",redDim:"#666666",dimmed:"#666666",muted:"#444444"};export{c as a,l as b,e as c,i as d,d as e,h as f,f as g,u as h,_ as i,b as j,U as k,r as l,x as m,g as n,o,A as p,R as q,L as r,C as s,E as t};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{join as n,relative as e}from"path";function i(t){let r=e(process.cwd(),t);return r.startsWith("..")||r===""?t:`./${r}`}function o(t=process.cwd()){return`Tests \u2192 ${i(n(t,".testmuai","tests"))}`}export{i as a,o as b};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as A}from"./chunk-YCCUBQY4.js";import{a as _}from"./chunk-THNGNS36.js";import{a as B}from"./chunk-TK7ZJ7YX.js";import{a as R}from"./chunk-HJ3CHMEM.js";import{a as P}from"./chunk-HCBYKLMW.js";import{t as c}from"./chunk-3ELBJPHQ.js";import{a as u,b as l}from"./chunk-C44QQJR4.js";import{a as J}from"./chunk-6YGTRKDT.js";import{a as k}from"./chunk-YUUZDFT7.js";import{e as L}from"./chunk-UR6MHSHU.js";var t=L(J(),1);var e=L(P(),1);function X(n,s,y,m){return{id:n,label:`${s} (${n}) \xB7 ${y} tests`,isActive:n===m}}function W({resolver:n,projectId:s,currentFolderId:y,env:m,onSelect:x,onCancel:w}){let[I,M]=(0,t.useState)([]),[$,d]=(0,t.useState)(!0),[O,g]=(0,t.useState)(!1),[U,N]=(0,t.useState)(null),[p,b]=(0,t.useState)("list"),[S,v]=(0,t.useState)(""),[E,f]=(0,t.useState)(null),h=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(!n){N("Login first to browse folders"),d(!1);return}let o=new AbortController;return d(!0),g(!0),(async()=>{try{let r=n.cached??await n.resolve();if(!r){N("Login first to browse folders"),d(!1),g(!1);return}let a=B(m),T=new k(a.tmsBaseUrl,r.username,r.access_key),F=(async function*(){if(o.signal.aborted)return;let i=await T.listFolders(s);yield{page:1,folders:i,totalLoaded:i.length,done:!0}})();for await(let i of F){if(d(!1),i.totalLoaded===0){h.current=!0,b("naming"),g(!1);return}M(i.folders.map(C=>X(C.id,C.name,C.test_cases_count,y))),i.done&&g(!1)}}catch(r){if(r?.name==="AbortError")return;N(r instanceof Error?r.message:String(r)),d(!1),g(!1)}})(),()=>o.abort()},[n,s,y,m]);let D=(0,t.useCallback)(o=>{let r=o.trim();if(!r){f("Name cannot be empty");return}if(!s){f("No project selected \u2014 pick a project first");return}f(null),b("creating"),(async()=>{try{if(!n)throw new Error("Not authenticated");let a=n.cached??await n.resolve();if(!a)throw new Error("Not authenticated");let T=B(m),i=await new k(T.tmsBaseUrl,a.username,a.access_key).createFolder(s,r);x(i.id,i.name)}catch(a){f(a instanceof Error?a.message:String(a)),b("naming")}})()},[n,s,m,x]),H=(0,t.useCallback)(()=>{v(""),f(null),h.current?w():b("list")},[w]);return p==="naming"||p==="creating"?(0,e.jsxs)(u,{flexDirection:"column",borderStyle:"round",borderColor:c.primary,paddingX:2,paddingY:1,children:[(0,e.jsx)(l,{color:c.primary,bold:!0,children:"Create new folder"}),h.current&&(0,e.jsx)(u,{marginTop:1,children:(0,e.jsx)(l,{color:c.dim,children:"No folders yet \u2014 let's create one."})}),(0,e.jsxs)(u,{marginTop:1,children:[(0,e.jsx)(l,{color:c.dim,children:"Name: "}),p==="naming"?(0,e.jsx)(A,{value:S,onChange:o=>{v(o),E&&f(null)},onSubmit:D,onCancel:H}):(0,e.jsx)(l,{children:S})]}),E&&(0,e.jsx)(u,{marginTop:1,children:(0,e.jsx)(l,{color:c.red,children:E})}),p==="creating"&&(0,e.jsx)(u,{marginTop:1,children:(0,e.jsx)(l,{color:c.dim,children:"Creating..."})}),p==="naming"&&(0,e.jsx)(R,{bindings:[{keys:"\u21B5",label:"create"}],escBackLabel:h.current?"cancel":"back"})]}):(0,e.jsx)(_,{title:"Folders",items:I,loading:$,loadingMore:O,preserveSelectionById:!0,error:U,itemNoun:"folders",onTab:()=>{h.current=!1,b("naming")},extraHint:"tab to create new",onSelect:o=>{let r=o.label.split(" (")[0];x(o.id,r)},onCancel:w})}export{X as a,W as b};
@@ -0,0 +1,53 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{c as ce}from"./chunk-3ELBJPHQ.js";import{randomUUID as Oi}from"crypto";import{mkdirSync as Ti,writeFileSync as ze,appendFileSync as Ni,existsSync as Je}from"fs";import{join as U}from"path";import{writeFileSync as wi,mkdirSync as Ci,existsSync as Ei}from"fs";import{join as se,relative as Ii}from"path";function Ce(e){return typeof e>"u"||e===null}function nn(e){return typeof e=="object"&&e!==null}function rn(e){return Array.isArray(e)?e:Ce(e)?[]:[e]}function on(e,n){var r,o,i,t;if(n)for(t=Object.keys(n),r=0,o=t.length;r<o;r+=1)i=t[r],e[i]=n[i];return e}function ln(e,n){var r="",o;for(o=0;o<n;o+=1)r+=e;return r}function tn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var un=Ce,sn=nn,cn=rn,an=ln,fn=tn,pn=on,A={isNothing:un,isObject:sn,toArray:cn,repeat:an,isNegativeZero:fn,extend:pn};function Ee(e,n){var r="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(r+=`
3
+
4
+ `+e.mark.snippet),o+" "+r):o}function j(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=Ee(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}j.prototype=Object.create(Error.prototype);j.prototype.constructor=j;j.prototype.toString=function(n){return this.name+": "+Ee(this,n)};var b=j;function Q(e,n,r,o,i){var t="",l="",u=Math.floor(i/2)-1;return o-n>u&&(t=" ... ",n=o-u+t.length),r-o>u&&(l=" ...",r=o+u-l.length),{str:t+e.slice(n,r).replace(/\t/g,"\u2192")+l,pos:o-n+t.length}}function X(e,n){return A.repeat(" ",n-e.length)+e}function dn(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var r=/\r?\n|\r|\0/g,o=[0],i=[],t,l=-1;t=r.exec(e.buffer);)i.push(t.index),o.push(t.index+t[0].length),e.position<=t.index&&l<0&&(l=o.length-2);l<0&&(l=o.length-1);var u="",s,c,f=Math.min(e.line+n.linesAfter,i.length).toString().length,a=n.maxLength-(n.indent+f+3);for(s=1;s<=n.linesBefore&&!(l-s<0);s++)c=Q(e.buffer,o[l-s],i[l-s],e.position-(o[l]-o[l-s]),a),u=A.repeat(" ",n.indent)+X((e.line-s+1).toString(),f)+" | "+c.str+`
5
+ `+u;for(c=Q(e.buffer,o[l],i[l],e.position,a),u+=A.repeat(" ",n.indent)+X((e.line+1).toString(),f)+" | "+c.str+`
6
+ `,u+=A.repeat("-",n.indent+f+3+c.pos)+`^
7
+ `,s=1;s<=n.linesAfter&&!(l+s>=i.length);s++)c=Q(e.buffer,o[l+s],i[l+s],e.position-(o[l]-o[l+s]),a),u+=A.repeat(" ",n.indent)+X((e.line+s+1).toString(),f)+" | "+c.str+`
8
+ `;return u.replace(/\n$/,"")}var hn=dn,gn=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],mn=["scalar","sequence","mapping"];function xn(e){var n={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(o){n[String(o)]=r})}),n}function vn(e,n){if(n=n||{},Object.keys(n).forEach(function(r){if(gn.indexOf(r)===-1)throw new b('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(r){return r},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=xn(n.styleAliases||null),mn.indexOf(this.kind)===-1)throw new b('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var y=vn;function ae(e,n){var r=[];return e[n].forEach(function(o){var i=r.length;r.forEach(function(t,l){t.tag===o.tag&&t.kind===o.kind&&t.multi===o.multi&&(i=l)}),r[i]=o}),r}function _n(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,r;function o(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(n=0,r=arguments.length;n<r;n+=1)arguments[n].forEach(o);return e}function z(e){return this.extend(e)}z.prototype.extend=function(n){var r=[],o=[];if(n instanceof y)o.push(n);else if(Array.isArray(n))o=o.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(r=r.concat(n.implicit)),n.explicit&&(o=o.concat(n.explicit));else throw new b("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(t){if(!(t instanceof y))throw new b("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&t.loadKind!=="scalar")throw new b("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new b("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),o.forEach(function(t){if(!(t instanceof y))throw new b("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(z.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(o),i.compiledImplicit=ae(i,"implicit"),i.compiledExplicit=ae(i,"explicit"),i.compiledTypeMap=_n(i.compiledImplicit,i.compiledExplicit),i};var An=z,yn=new y("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Sn=new y("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),bn=new y("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),wn=new An({explicit:[yn,Sn,bn]});function Cn(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function En(){return null}function In(e){return e===null}var Fn=new y("tag:yaml.org,2002:null",{kind:"scalar",resolve:Cn,construct:En,predicate:In,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Rn(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function Ln(e){return e==="true"||e==="True"||e==="TRUE"}function On(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Tn=new y("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Rn,construct:Ln,predicate:On,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Nn(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function kn(e){return 48<=e&&e<=55}function Dn(e){return 48<=e&&e<=57}function Mn(e){if(e===null)return!1;var n=e.length,r=0,o=!1,i;if(!n)return!1;if(i=e[r],(i==="-"||i==="+")&&(i=e[++r]),i==="0"){if(r+1===n)return!0;if(i=e[++r],i==="b"){for(r++;r<n;r++)if(i=e[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;o=!0}return o&&i!=="_"}if(i==="x"){for(r++;r<n;r++)if(i=e[r],i!=="_"){if(!Nn(e.charCodeAt(r)))return!1;o=!0}return o&&i!=="_"}if(i==="o"){for(r++;r<n;r++)if(i=e[r],i!=="_"){if(!kn(e.charCodeAt(r)))return!1;o=!0}return o&&i!=="_"}}if(i==="_")return!1;for(;r<n;r++)if(i=e[r],i!=="_"){if(!Dn(e.charCodeAt(r)))return!1;o=!0}return!(!o||i==="_")}function jn(e){var n=e,r=1,o;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),o=n[0],(o==="-"||o==="+")&&(o==="-"&&(r=-1),n=n.slice(1),o=n[0]),n==="0")return 0;if(o==="0"){if(n[1]==="b")return r*parseInt(n.slice(2),2);if(n[1]==="x")return r*parseInt(n.slice(2),16);if(n[1]==="o")return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)}function Pn(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!A.isNegativeZero(e)}var Bn=new y("tag:yaml.org,2002:int",{kind:"scalar",resolve:Mn,construct:jn,predicate:Pn,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Yn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Un(e){return!(e===null||!Yn.test(e)||e[e.length-1]==="_")}function Hn(e){var n,r;return n=e.replace(/_/g,"").toLowerCase(),r=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:r*parseFloat(n,10)}var $n=/^[-+]?[0-9]+e/;function Gn(e,n){var r;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(A.isNegativeZero(e))return"-0.0";return r=e.toString(10),$n.test(r)?r.replace("e",".e"):r}function Kn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||A.isNegativeZero(e))}var qn=new y("tag:yaml.org,2002:float",{kind:"scalar",resolve:Un,construct:Hn,predicate:Kn,represent:Gn,defaultStyle:"lowercase"}),Wn=wn.extend({implicit:[Fn,Tn,Bn,qn]}),Vn=Wn,Ie=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Fe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Qn(e){return e===null?!1:Ie.exec(e)!==null||Fe.exec(e)!==null}function Xn(e){var n,r,o,i,t,l,u,s=0,c=null,f,a,d;if(n=Ie.exec(e),n===null&&(n=Fe.exec(e)),n===null)throw new Error("Date resolve error");if(r=+n[1],o=+n[2]-1,i=+n[3],!n[4])return new Date(Date.UTC(r,o,i));if(t=+n[4],l=+n[5],u=+n[6],n[7]){for(s=n[7].slice(0,3);s.length<3;)s+="0";s=+s}return n[9]&&(f=+n[10],a=+(n[11]||0),c=(f*60+a)*6e4,n[9]==="-"&&(c=-c)),d=new Date(Date.UTC(r,o,i,t,l,u,s)),c&&d.setTime(d.getTime()-c),d}function Zn(e){return e.toISOString()}var zn=new y("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Qn,construct:Xn,instanceOf:Date,represent:Zn});function Jn(e){return e==="<<"||e===null}var er=new y("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Jn}),ie=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
9
+ \r`;function nr(e){if(e===null)return!1;var n,r,o=0,i=e.length,t=ie;for(r=0;r<i;r++)if(n=t.indexOf(e.charAt(r)),!(n>64)){if(n<0)return!1;o+=6}return o%8===0}function rr(e){var n,r,o=e.replace(/[\r\n=]/g,""),i=o.length,t=ie,l=0,u=[];for(n=0;n<i;n++)n%4===0&&n&&(u.push(l>>16&255),u.push(l>>8&255),u.push(l&255)),l=l<<6|t.indexOf(o.charAt(n));return r=i%4*6,r===0?(u.push(l>>16&255),u.push(l>>8&255),u.push(l&255)):r===18?(u.push(l>>10&255),u.push(l>>2&255)):r===12&&u.push(l>>4&255),new Uint8Array(u)}function ir(e){var n="",r=0,o,i,t=e.length,l=ie;for(o=0;o<t;o++)o%3===0&&o&&(n+=l[r>>18&63],n+=l[r>>12&63],n+=l[r>>6&63],n+=l[r&63]),r=(r<<8)+e[o];return i=t%3,i===0?(n+=l[r>>18&63],n+=l[r>>12&63],n+=l[r>>6&63],n+=l[r&63]):i===2?(n+=l[r>>10&63],n+=l[r>>4&63],n+=l[r<<2&63],n+=l[64]):i===1&&(n+=l[r>>2&63],n+=l[r<<4&63],n+=l[64],n+=l[64]),n}function or(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var lr=new y("tag:yaml.org,2002:binary",{kind:"scalar",resolve:nr,construct:rr,predicate:or,represent:ir}),tr=Object.prototype.hasOwnProperty,ur=Object.prototype.toString;function sr(e){if(e===null)return!0;var n=[],r,o,i,t,l,u=e;for(r=0,o=u.length;r<o;r+=1){if(i=u[r],l=!1,ur.call(i)!=="[object Object]")return!1;for(t in i)if(tr.call(i,t))if(!l)l=!0;else return!1;if(!l)return!1;if(n.indexOf(t)===-1)n.push(t);else return!1}return!0}function cr(e){return e!==null?e:[]}var ar=new y("tag:yaml.org,2002:omap",{kind:"sequence",resolve:sr,construct:cr}),fr=Object.prototype.toString;function pr(e){if(e===null)return!0;var n,r,o,i,t,l=e;for(t=new Array(l.length),n=0,r=l.length;n<r;n+=1){if(o=l[n],fr.call(o)!=="[object Object]"||(i=Object.keys(o),i.length!==1))return!1;t[n]=[i[0],o[i[0]]]}return!0}function dr(e){if(e===null)return[];var n,r,o,i,t,l=e;for(t=new Array(l.length),n=0,r=l.length;n<r;n+=1)o=l[n],i=Object.keys(o),t[n]=[i[0],o[i[0]]];return t}var hr=new y("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:pr,construct:dr}),gr=Object.prototype.hasOwnProperty;function mr(e){if(e===null)return!0;var n,r=e;for(n in r)if(gr.call(r,n)&&r[n]!==null)return!1;return!0}function xr(e){return e!==null?e:{}}var vr=new y("tag:yaml.org,2002:set",{kind:"mapping",resolve:mr,construct:xr}),Re=Vn.extend({implicit:[zn,er],explicit:[lr,ar,hr,vr]}),R=Object.prototype.hasOwnProperty,H=1,Le=2,Oe=3,$=4,Z=1,_r=2,fe=3,Ar=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,yr=/[\x85\u2028\u2029]/,Sr=/[,\[\]\{\}]/,Te=/^(?:!|!!|![a-z\-]+!)$/i,Ne=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function pe(e){return Object.prototype.toString.call(e)}function E(e){return e===10||e===13}function O(e){return e===9||e===32}function w(e){return e===9||e===32||e===10||e===13}function N(e){return e===44||e===91||e===93||e===123||e===125}function br(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function wr(e){return e===120?2:e===117?4:e===85?8:0}function Cr(e){return 48<=e&&e<=57?e-48:-1}function de(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
10
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Er(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function ke(e,n,r){n==="__proto__"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[n]=r}var De=new Array(256),Me=new Array(256);for(L=0;L<256;L++)De[L]=de(L)?1:0,Me[L]=de(L);var L;function Ir(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||Re,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function je(e,n){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=hn(r),new b(n,r)}function p(e,n){throw je(e,n)}function G(e,n){e.onWarning&&e.onWarning.call(null,je(e,n))}var he={YAML:function(n,r,o){var i,t,l;n.version!==null&&p(n,"duplication of %YAML directive"),o.length!==1&&p(n,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),i===null&&p(n,"ill-formed argument of the YAML directive"),t=parseInt(i[1],10),l=parseInt(i[2],10),t!==1&&p(n,"unacceptable YAML version of the document"),n.version=o[0],n.checkLineBreaks=l<2,l!==1&&l!==2&&G(n,"unsupported YAML version of the document")},TAG:function(n,r,o){var i,t;o.length!==2&&p(n,"TAG directive accepts exactly two arguments"),i=o[0],t=o[1],Te.test(i)||p(n,"ill-formed tag handle (first argument) of the TAG directive"),R.call(n.tagMap,i)&&p(n,'there is a previously declared suffix for "'+i+'" tag handle'),Ne.test(t)||p(n,"ill-formed tag prefix (second argument) of the TAG directive");try{t=decodeURIComponent(t)}catch{p(n,"tag prefix is malformed: "+t)}n.tagMap[i]=t}};function F(e,n,r,o){var i,t,l,u;if(n<r){if(u=e.input.slice(n,r),o)for(i=0,t=u.length;i<t;i+=1)l=u.charCodeAt(i),l===9||32<=l&&l<=1114111||p(e,"expected valid JSON character");else Ar.test(u)&&p(e,"the stream contains non-printable characters");e.result+=u}}function ge(e,n,r,o){var i,t,l,u;for(A.isObject(r)||p(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(r),l=0,u=i.length;l<u;l+=1)t=i[l],R.call(n,t)||(ke(n,t,r[t]),o[t]=!0)}function k(e,n,r,o,i,t,l,u,s){var c,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,f=i.length;c<f;c+=1)Array.isArray(i[c])&&p(e,"nested arrays are not supported inside keys"),typeof i=="object"&&pe(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&pe(i)==="[object Object]"&&(i="[object Object]"),i=String(i),n===null&&(n={}),o==="tag:yaml.org,2002:merge")if(Array.isArray(t))for(c=0,f=t.length;c<f;c+=1)ge(e,n,t[c],r);else ge(e,n,t,r);else!e.json&&!R.call(r,i)&&R.call(n,i)&&(e.line=l||e.line,e.lineStart=u||e.lineStart,e.position=s||e.position,p(e,"duplicated mapping key")),ke(n,i,t),delete r[i];return n}function oe(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):p(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function _(e,n,r){for(var o=0,i=e.input.charCodeAt(e.position);i!==0;){for(;O(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(n&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(E(i))for(oe(e),i=e.input.charCodeAt(e.position),o++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return r!==-1&&o!==0&&e.lineIndent<r&&G(e,"deficient indentation"),o}function W(e){var n=e.position,r;return r=e.input.charCodeAt(n),!!((r===45||r===46)&&r===e.input.charCodeAt(n+1)&&r===e.input.charCodeAt(n+2)&&(n+=3,r=e.input.charCodeAt(n),r===0||w(r)))}function le(e,n){n===1?e.result+=" ":n>1&&(e.result+=A.repeat(`
11
+ `,n-1))}function Fr(e,n,r){var o,i,t,l,u,s,c,f,a=e.kind,d=e.result,h;if(h=e.input.charCodeAt(e.position),w(h)||N(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(i=e.input.charCodeAt(e.position+1),w(i)||r&&N(i)))return!1;for(e.kind="scalar",e.result="",t=l=e.position,u=!1;h!==0;){if(h===58){if(i=e.input.charCodeAt(e.position+1),w(i)||r&&N(i))break}else if(h===35){if(o=e.input.charCodeAt(e.position-1),w(o))break}else{if(e.position===e.lineStart&&W(e)||r&&N(h))break;if(E(h))if(s=e.line,c=e.lineStart,f=e.lineIndent,_(e,!1,-1),e.lineIndent>=n){u=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=l,e.line=s,e.lineStart=c,e.lineIndent=f;break}}u&&(F(e,t,l,!1),le(e,e.line-s),t=l=e.position,u=!1),O(h)||(l=e.position+1),h=e.input.charCodeAt(++e.position)}return F(e,t,l,!1),e.result?!0:(e.kind=a,e.result=d,!1)}function Rr(e,n){var r,o,i;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,o=i=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(F(e,o,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)o=e.position,e.position++,i=e.position;else return!0;else E(r)?(F(e,o,i,!0),le(e,_(e,!1,n)),o=i=e.position):e.position===e.lineStart&&W(e)?p(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);p(e,"unexpected end of the stream within a single quoted scalar")}function Lr(e,n){var r,o,i,t,l,u;if(u=e.input.charCodeAt(e.position),u!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;(u=e.input.charCodeAt(e.position))!==0;){if(u===34)return F(e,r,e.position,!0),e.position++,!0;if(u===92){if(F(e,r,e.position,!0),u=e.input.charCodeAt(++e.position),E(u))_(e,!1,n);else if(u<256&&De[u])e.result+=Me[u],e.position++;else if((l=wr(u))>0){for(i=l,t=0;i>0;i--)u=e.input.charCodeAt(++e.position),(l=br(u))>=0?t=(t<<4)+l:p(e,"expected hexadecimal character");e.result+=Er(t),e.position++}else p(e,"unknown escape sequence");r=o=e.position}else E(u)?(F(e,r,o,!0),le(e,_(e,!1,n)),r=o=e.position):e.position===e.lineStart&&W(e)?p(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}p(e,"unexpected end of the stream within a double quoted scalar")}function Or(e,n){var r=!0,o,i,t,l=e.tag,u,s=e.anchor,c,f,a,d,h,g=Object.create(null),x,v,C,m;if(m=e.input.charCodeAt(e.position),m===91)f=93,h=!1,u=[];else if(m===123)f=125,h=!0,u={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),m=e.input.charCodeAt(++e.position);m!==0;){if(_(e,!0,n),m=e.input.charCodeAt(e.position),m===f)return e.position++,e.tag=l,e.anchor=s,e.kind=h?"mapping":"sequence",e.result=u,!0;r?m===44&&p(e,"expected the node content, but found ','"):p(e,"missed comma between flow collection entries"),v=x=C=null,a=d=!1,m===63&&(c=e.input.charCodeAt(e.position+1),w(c)&&(a=d=!0,e.position++,_(e,!0,n))),o=e.line,i=e.lineStart,t=e.position,D(e,n,H,!1,!0),v=e.tag,x=e.result,_(e,!0,n),m=e.input.charCodeAt(e.position),(d||e.line===o)&&m===58&&(a=!0,m=e.input.charCodeAt(++e.position),_(e,!0,n),D(e,n,H,!1,!0),C=e.result),h?k(e,u,g,v,x,C,o,i,t):a?u.push(k(e,null,g,v,x,C,o,i,t)):u.push(x),_(e,!0,n),m=e.input.charCodeAt(e.position),m===44?(r=!0,m=e.input.charCodeAt(++e.position)):r=!1}p(e,"unexpected end of the stream within a flow collection")}function Tr(e,n){var r,o,i=Z,t=!1,l=!1,u=n,s=0,c=!1,f,a;if(a=e.input.charCodeAt(e.position),a===124)o=!1;else if(a===62)o=!0;else return!1;for(e.kind="scalar",e.result="";a!==0;)if(a=e.input.charCodeAt(++e.position),a===43||a===45)Z===i?i=a===43?fe:_r:p(e,"repeat of a chomping mode identifier");else if((f=Cr(a))>=0)f===0?p(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?p(e,"repeat of an indentation width identifier"):(u=n+f-1,l=!0);else break;if(O(a)){do a=e.input.charCodeAt(++e.position);while(O(a));if(a===35)do a=e.input.charCodeAt(++e.position);while(!E(a)&&a!==0)}for(;a!==0;){for(oe(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!l||e.lineIndent<u)&&a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>u&&(u=e.lineIndent),E(a)){s++;continue}if(e.lineIndent<u){i===fe?e.result+=A.repeat(`
12
+ `,t?1+s:s):i===Z&&t&&(e.result+=`
13
+ `);break}for(o?O(a)?(c=!0,e.result+=A.repeat(`
14
+ `,t?1+s:s)):c?(c=!1,e.result+=A.repeat(`
15
+ `,s+1)):s===0?t&&(e.result+=" "):e.result+=A.repeat(`
16
+ `,s):e.result+=A.repeat(`
17
+ `,t?1+s:s),t=!0,l=!0,s=0,r=e.position;!E(a)&&a!==0;)a=e.input.charCodeAt(++e.position);F(e,r,e.position,!1)}return!0}function me(e,n){var r,o=e.tag,i=e.anchor,t=[],l,u=!1,s;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=t),s=e.input.charCodeAt(e.position);s!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,p(e,"tab characters must not be used in indentation")),!(s!==45||(l=e.input.charCodeAt(e.position+1),!w(l))));){if(u=!0,e.position++,_(e,!0,-1)&&e.lineIndent<=n){t.push(null),s=e.input.charCodeAt(e.position);continue}if(r=e.line,D(e,n,Oe,!1,!0),t.push(e.result),_(e,!0,-1),s=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>n)&&s!==0)p(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return u?(e.tag=o,e.anchor=i,e.kind="sequence",e.result=t,!0):!1}function Nr(e,n,r){var o,i,t,l,u,s,c=e.tag,f=e.anchor,a={},d=Object.create(null),h=null,g=null,x=null,v=!1,C=!1,m;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),m=e.input.charCodeAt(e.position);m!==0;){if(!v&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,p(e,"tab characters must not be used in indentation")),o=e.input.charCodeAt(e.position+1),t=e.line,(m===63||m===58)&&w(o))m===63?(v&&(k(e,a,d,h,g,null,l,u,s),h=g=x=null),C=!0,v=!0,i=!0):v?(v=!1,i=!0):p(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,m=o;else{if(l=e.line,u=e.lineStart,s=e.position,!D(e,r,Le,!1,!0))break;if(e.line===t){for(m=e.input.charCodeAt(e.position);O(m);)m=e.input.charCodeAt(++e.position);if(m===58)m=e.input.charCodeAt(++e.position),w(m)||p(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(k(e,a,d,h,g,null,l,u,s),h=g=x=null),C=!0,v=!1,i=!1,h=e.tag,g=e.result;else if(C)p(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=f,!0}else if(C)p(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=f,!0}if((e.line===t||e.lineIndent>n)&&(v&&(l=e.line,u=e.lineStart,s=e.position),D(e,n,$,!0,i)&&(v?g=e.result:x=e.result),v||(k(e,a,d,h,g,x,l,u,s),h=g=x=null),_(e,!0,-1),m=e.input.charCodeAt(e.position)),(e.line===t||e.lineIndent>n)&&m!==0)p(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return v&&k(e,a,d,h,g,null,l,u,s),C&&(e.tag=c,e.anchor=f,e.kind="mapping",e.result=a),C}function kr(e){var n,r=!1,o=!1,i,t,l;if(l=e.input.charCodeAt(e.position),l!==33)return!1;if(e.tag!==null&&p(e,"duplication of a tag property"),l=e.input.charCodeAt(++e.position),l===60?(r=!0,l=e.input.charCodeAt(++e.position)):l===33?(o=!0,i="!!",l=e.input.charCodeAt(++e.position)):i="!",n=e.position,r){do l=e.input.charCodeAt(++e.position);while(l!==0&&l!==62);e.position<e.length?(t=e.input.slice(n,e.position),l=e.input.charCodeAt(++e.position)):p(e,"unexpected end of the stream within a verbatim tag")}else{for(;l!==0&&!w(l);)l===33&&(o?p(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(n-1,e.position+1),Te.test(i)||p(e,"named tag handle cannot contain such characters"),o=!0,n=e.position+1)),l=e.input.charCodeAt(++e.position);t=e.input.slice(n,e.position),Sr.test(t)&&p(e,"tag suffix cannot contain flow indicator characters")}t&&!Ne.test(t)&&p(e,"tag name cannot contain such characters: "+t);try{t=decodeURIComponent(t)}catch{p(e,"tag name is malformed: "+t)}return r?e.tag=t:R.call(e.tagMap,i)?e.tag=e.tagMap[i]+t:i==="!"?e.tag="!"+t:i==="!!"?e.tag="tag:yaml.org,2002:"+t:p(e,'undeclared tag handle "'+i+'"'),!0}function Dr(e){var n,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&p(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),n=e.position;r!==0&&!w(r)&&!N(r);)r=e.input.charCodeAt(++e.position);return e.position===n&&p(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function Mr(e){var n,r,o;if(o=e.input.charCodeAt(e.position),o!==42)return!1;for(o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!w(o)&&!N(o);)o=e.input.charCodeAt(++e.position);return e.position===n&&p(e,"name of an alias node must contain at least one character"),r=e.input.slice(n,e.position),R.call(e.anchorMap,r)||p(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],_(e,!0,-1),!0}function D(e,n,r,o,i){var t,l,u,s=1,c=!1,f=!1,a,d,h,g,x,v;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,t=l=u=$===r||Oe===r,o&&_(e,!0,-1)&&(c=!0,e.lineIndent>n?s=1:e.lineIndent===n?s=0:e.lineIndent<n&&(s=-1)),s===1)for(;kr(e)||Dr(e);)_(e,!0,-1)?(c=!0,u=t,e.lineIndent>n?s=1:e.lineIndent===n?s=0:e.lineIndent<n&&(s=-1)):u=!1;if(u&&(u=c||i),(s===1||$===r)&&(H===r||Le===r?x=n:x=n+1,v=e.position-e.lineStart,s===1?u&&(me(e,v)||Nr(e,v,x))||Or(e,x)?f=!0:(l&&Tr(e,x)||Rr(e,x)||Lr(e,x)?f=!0:Mr(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&p(e,"alias node should not have any properties")):Fr(e,x,H===r)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):s===0&&(f=u&&me(e,v))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&p(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),a=0,d=e.implicitTypes.length;a<d;a+=1)if(g=e.implicitTypes[a],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(R.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,h=e.typeMap.multi[e.kind||"fallback"],a=0,d=h.length;a<d;a+=1)if(e.tag.slice(0,h[a].tag.length)===h[a].tag){g=h[a];break}g||p(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&p(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):p(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function jr(e){var n=e.position,r,o,i,t=!1,l;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(l=e.input.charCodeAt(e.position))!==0&&(_(e,!0,-1),l=e.input.charCodeAt(e.position),!(e.lineIndent>0||l!==37));){for(t=!0,l=e.input.charCodeAt(++e.position),r=e.position;l!==0&&!w(l);)l=e.input.charCodeAt(++e.position);for(o=e.input.slice(r,e.position),i=[],o.length<1&&p(e,"directive name must not be less than one character in length");l!==0;){for(;O(l);)l=e.input.charCodeAt(++e.position);if(l===35){do l=e.input.charCodeAt(++e.position);while(l!==0&&!E(l));break}if(E(l))break;for(r=e.position;l!==0&&!w(l);)l=e.input.charCodeAt(++e.position);i.push(e.input.slice(r,e.position))}l!==0&&oe(e),R.call(he,o)?he[o](e,o,i):G(e,'unknown document directive "'+o+'"')}if(_(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,_(e,!0,-1)):t&&p(e,"directives end mark is expected"),D(e,e.lineIndent-1,$,!1,!0),_(e,!0,-1),e.checkLineBreaks&&yr.test(e.input.slice(n,e.position))&&G(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&W(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,_(e,!0,-1));return}if(e.position<e.length-1)p(e,"end of the stream or a document separator is expected");else return}function Pe(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
18
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Ir(e,n),o=e.indexOf("\0");for(o!==-1&&(r.position=o,p(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)jr(r);return r.documents}function Pr(e,n,r){n!==null&&typeof n=="object"&&typeof r>"u"&&(r=n,n=null);var o=Pe(e,r);if(typeof n!="function")return o;for(var i=0,t=o.length;i<t;i+=1)n(o[i])}function Br(e,n){var r=Pe(e,n);if(r.length!==0){if(r.length===1)return r[0];throw new b("expected a single document in the stream, but found more")}}var Yr=Pr,Ur=Br,Be={loadAll:Yr,load:Ur},Ye=Object.prototype.toString,Ue=Object.prototype.hasOwnProperty,te=65279,Hr=9,P=10,$r=13,Gr=32,Kr=33,qr=34,J=35,Wr=37,Vr=38,Qr=39,Xr=42,He=44,Zr=45,K=58,zr=61,Jr=62,ei=63,ni=64,$e=91,Ge=93,ri=96,Ke=123,ii=124,qe=125,S={};S[0]="\\0";S[7]="\\a";S[8]="\\b";S[9]="\\t";S[10]="\\n";S[11]="\\v";S[12]="\\f";S[13]="\\r";S[27]="\\e";S[34]='\\"';S[92]="\\\\";S[133]="\\N";S[160]="\\_";S[8232]="\\L";S[8233]="\\P";var oi=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],li=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ti(e,n){var r,o,i,t,l,u,s;if(n===null)return{};for(r={},o=Object.keys(n),i=0,t=o.length;i<t;i+=1)l=o[i],u=String(n[l]),l.slice(0,2)==="!!"&&(l="tag:yaml.org,2002:"+l.slice(2)),s=e.compiledTypeMap.fallback[l],s&&Ue.call(s.styleAliases,u)&&(u=s.styleAliases[u]),r[l]=u;return r}function ui(e){var n,r,o;if(n=e.toString(16).toUpperCase(),e<=255)r="x",o=2;else if(e<=65535)r="u",o=4;else if(e<=4294967295)r="U",o=8;else throw new b("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+A.repeat("0",o-n.length)+n}var si=1,B=2;function ci(e){this.schema=e.schema||Re,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=A.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ti(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?B:si,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function xe(e,n){for(var r=A.repeat(" ",n),o=0,i=-1,t="",l,u=e.length;o<u;)i=e.indexOf(`
19
+ `,o),i===-1?(l=e.slice(o),o=u):(l=e.slice(o,i+1),o=i+1),l.length&&l!==`
20
+ `&&(t+=r),t+=l;return t}function ee(e,n){return`
21
+ `+A.repeat(" ",e.indent*n)}function ai(e,n){var r,o,i;for(r=0,o=e.implicitTypes.length;r<o;r+=1)if(i=e.implicitTypes[r],i.resolve(n))return!0;return!1}function q(e){return e===Gr||e===Hr}function Y(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==te||65536<=e&&e<=1114111}function ve(e){return Y(e)&&e!==te&&e!==$r&&e!==P}function _e(e,n,r){var o=ve(e),i=o&&!q(e);return(r?o:o&&e!==He&&e!==$e&&e!==Ge&&e!==Ke&&e!==qe)&&e!==J&&!(n===K&&!i)||ve(n)&&!q(n)&&e===J||n===K&&i}function fi(e){return Y(e)&&e!==te&&!q(e)&&e!==Zr&&e!==ei&&e!==K&&e!==He&&e!==$e&&e!==Ge&&e!==Ke&&e!==qe&&e!==J&&e!==Vr&&e!==Xr&&e!==Kr&&e!==ii&&e!==zr&&e!==Jr&&e!==Qr&&e!==qr&&e!==Wr&&e!==ni&&e!==ri}function pi(e){return!q(e)&&e!==K}function M(e,n){var r=e.charCodeAt(n),o;return r>=55296&&r<=56319&&n+1<e.length&&(o=e.charCodeAt(n+1),o>=56320&&o<=57343)?(r-55296)*1024+o-56320+65536:r}function We(e){var n=/^\n* /;return n.test(e)}var Ve=1,ne=2,Qe=3,Xe=4,T=5;function di(e,n,r,o,i,t,l,u){var s,c=0,f=null,a=!1,d=!1,h=o!==-1,g=-1,x=fi(M(e,0))&&pi(M(e,e.length-1));if(n||l)for(s=0;s<e.length;c>=65536?s+=2:s++){if(c=M(e,s),!Y(c))return T;x=x&&_e(c,f,u),f=c}else{for(s=0;s<e.length;c>=65536?s+=2:s++){if(c=M(e,s),c===P)a=!0,h&&(d=d||s-g-1>o&&e[g+1]!==" ",g=s);else if(!Y(c))return T;x=x&&_e(c,f,u),f=c}d=d||h&&s-g-1>o&&e[g+1]!==" "}return!a&&!d?x&&!l&&!i(e)?Ve:t===B?T:ne:r>9&&We(e)?T:l?t===B?T:ne:d?Xe:Qe}function hi(e,n,r,o,i){e.dump=(function(){if(n.length===0)return e.quotingType===B?'""':"''";if(!e.noCompatMode&&(oi.indexOf(n)!==-1||li.test(n)))return e.quotingType===B?'"'+n+'"':"'"+n+"'";var t=e.indent*Math.max(1,r),l=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-t),u=o||e.flowLevel>-1&&r>=e.flowLevel;function s(c){return ai(e,c)}switch(di(n,u,e.indent,l,s,e.quotingType,e.forceQuotes&&!o,i)){case Ve:return n;case ne:return"'"+n.replace(/'/g,"''")+"'";case Qe:return"|"+Ae(n,e.indent)+ye(xe(n,t));case Xe:return">"+Ae(n,e.indent)+ye(xe(gi(n,l),t));case T:return'"'+mi(n)+'"';default:throw new b("impossible error: invalid scalar style")}})()}function Ae(e,n){var r=We(e)?String(n):"",o=e[e.length-1]===`
22
+ `,i=o&&(e[e.length-2]===`
23
+ `||e===`
24
+ `),t=i?"+":o?"":"-";return r+t+`
25
+ `}function ye(e){return e[e.length-1]===`
26
+ `?e.slice(0,-1):e}function gi(e,n){for(var r=/(\n+)([^\n]*)/g,o=(function(){var c=e.indexOf(`
27
+ `);return c=c!==-1?c:e.length,r.lastIndex=c,Se(e.slice(0,c),n)})(),i=e[0]===`
28
+ `||e[0]===" ",t,l;l=r.exec(e);){var u=l[1],s=l[2];t=s[0]===" ",o+=u+(!i&&!t&&s!==""?`
29
+ `:"")+Se(s,n),i=t}return o}function Se(e,n){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,o,i=0,t,l=0,u=0,s="";o=r.exec(e);)u=o.index,u-i>n&&(t=l>i?l:u,s+=`
30
+ `+e.slice(i,t),i=t+1),l=u;return s+=`
31
+ `,e.length-i>n&&l>i?s+=e.slice(i,l)+`
32
+ `+e.slice(l+1):s+=e.slice(i),s.slice(1)}function mi(e){for(var n="",r=0,o,i=0;i<e.length;r>=65536?i+=2:i++)r=M(e,i),o=S[r],!o&&Y(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=o||ui(r);return n}function xi(e,n,r){var o="",i=e.tag,t,l,u;for(t=0,l=r.length;t<l;t+=1)u=r[t],e.replacer&&(u=e.replacer.call(r,String(t),u)),(I(e,n,u,!1,!1)||typeof u>"u"&&I(e,n,null,!1,!1))&&(o!==""&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=i,e.dump="["+o+"]"}function be(e,n,r,o){var i="",t=e.tag,l,u,s;for(l=0,u=r.length;l<u;l+=1)s=r[l],e.replacer&&(s=e.replacer.call(r,String(l),s)),(I(e,n+1,s,!0,!0,!1,!0)||typeof s>"u"&&I(e,n+1,null,!0,!0,!1,!0))&&((!o||i!=="")&&(i+=ee(e,n)),e.dump&&P===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=t,e.dump=i||"[]"}function vi(e,n,r){var o="",i=e.tag,t=Object.keys(r),l,u,s,c,f;for(l=0,u=t.length;l<u;l+=1)f="",o!==""&&(f+=", "),e.condenseFlow&&(f+='"'),s=t[l],c=r[s],e.replacer&&(c=e.replacer.call(r,s,c)),I(e,n,s,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),I(e,n,c,!1,!1)&&(f+=e.dump,o+=f));e.tag=i,e.dump="{"+o+"}"}function _i(e,n,r,o){var i="",t=e.tag,l=Object.keys(r),u,s,c,f,a,d;if(e.sortKeys===!0)l.sort();else if(typeof e.sortKeys=="function")l.sort(e.sortKeys);else if(e.sortKeys)throw new b("sortKeys must be a boolean or a function");for(u=0,s=l.length;u<s;u+=1)d="",(!o||i!=="")&&(d+=ee(e,n)),c=l[u],f=r[c],e.replacer&&(f=e.replacer.call(r,c,f)),I(e,n+1,c,!0,!0,!0)&&(a=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,a&&(e.dump&&P===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,a&&(d+=ee(e,n)),I(e,n+1,f,!0,a)&&(e.dump&&P===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=t,e.dump=i||"{}"}function we(e,n,r){var o,i,t,l,u,s;for(i=r?e.explicitTypes:e.implicitTypes,t=0,l=i.length;t<l;t+=1)if(u=i[t],(u.instanceOf||u.predicate)&&(!u.instanceOf||typeof n=="object"&&n instanceof u.instanceOf)&&(!u.predicate||u.predicate(n))){if(r?u.multi&&u.representName?e.tag=u.representName(n):e.tag=u.tag:e.tag="?",u.represent){if(s=e.styleMap[u.tag]||u.defaultStyle,Ye.call(u.represent)==="[object Function]")o=u.represent(n,s);else if(Ue.call(u.represent,s))o=u.represent[s](n,s);else throw new b("!<"+u.tag+'> tag resolver accepts not "'+s+'" style');e.dump=o}return!0}return!1}function I(e,n,r,o,i,t,l){e.tag=null,e.dump=r,we(e,r,!1)||we(e,r,!0);var u=Ye.call(e.dump),s=o,c;o&&(o=e.flowLevel<0||e.flowLevel>n);var f=u==="[object Object]"||u==="[object Array]",a,d;if(f&&(a=e.duplicates.indexOf(r),d=a!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&n>0)&&(i=!1),d&&e.usedDuplicates[a])e.dump="*ref_"+a;else{if(f&&d&&!e.usedDuplicates[a]&&(e.usedDuplicates[a]=!0),u==="[object Object]")o&&Object.keys(e.dump).length!==0?(_i(e,n,e.dump,i),d&&(e.dump="&ref_"+a+e.dump)):(vi(e,n,e.dump),d&&(e.dump="&ref_"+a+" "+e.dump));else if(u==="[object Array]")o&&e.dump.length!==0?(e.noArrayIndent&&!l&&n>0?be(e,n-1,e.dump,i):be(e,n,e.dump,i),d&&(e.dump="&ref_"+a+e.dump)):(xi(e,n,e.dump),d&&(e.dump="&ref_"+a+" "+e.dump));else if(u==="[object String]")e.tag!=="?"&&hi(e,e.dump,n,t,s);else{if(u==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new b("unacceptable kind of an object to dump "+u)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function Ai(e,n){var r=[],o=[],i,t;for(re(e,r,o),i=0,t=o.length;i<t;i+=1)n.duplicates.push(r[o[i]]);n.usedDuplicates=new Array(t)}function re(e,n,r){var o,i,t;if(e!==null&&typeof e=="object")if(i=n.indexOf(e),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(n.push(e),Array.isArray(e))for(i=0,t=e.length;i<t;i+=1)re(e[i],n,r);else for(o=Object.keys(e),i=0,t=o.length;i<t;i+=1)re(e[o[i]],n,r)}function yi(e,n){n=n||{};var r=new ci(n);r.noRefs||Ai(e,r);var o=e;return r.replacer&&(o=r.replacer.call({"":o},"",o)),I(r,0,o,!0,!0)?r.dump+`
33
+ `:""}var Si=yi,bi={dump:Si};function ue(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var Di=Be.load,Mi=Be.loadAll,Ze=bi.dump;var ji=ue("safeLoad","load"),Pi=ue("safeLoadAll","loadAll"),Bi=ue("safeDump","dump");var Fi=new Set(["username","access_key","oauth","profile","project_id","folder_id"]),Ri=new Set(["model","env"]),V=class{constructor(n){this.opts=n}objectives=[];flushed=!1;lastWrittenPath=null;lastCollisionSuffixed=!1;appendObjective(n){this.objectives.push(n)}flush(){if(this.flushed||(this.flushed=!0,this.objectives.length===0))return;let n=this.opts.getName();if(!n)return;let r=se(this.opts.cwd,".testmuai","tests");try{Ci(r,{recursive:!0})}catch(c){process.stderr.write(`
34
+ \u26A0 Failed to create ${Ii(this.opts.cwd,r)}/
35
+ ${c.message}
36
+ Your test recording was NOT saved.
37
+
38
+ `);return}let o=se(r,`${n}_test.md`),i=2,t=!1;for(;Ei(o);)o=se(r,`${n}-${i}_test.md`),i++,t=!0;let l=Li(this.opts.getResolvedGlobal()),u=Ze(l).trimEnd(),s=[];s.push("---"),u&&s.push(u),s.push("---",""),s.push(`# Session: ${n}`,""),this.objectives.forEach((c,f)=>{s.push(`## Step ${f+1}`,c,"")});try{wi(o,s.join(`
39
+ `),"utf8")}catch(c){process.stderr.write(`
40
+ \u26A0 Failed to save your test recording.
41
+ ${c.message}
42
+ Path: ${o}
43
+
44
+ `);return}this.lastWrittenPath=o,this.lastCollisionSuffixed=t}};function Li(e){let n={};for(let[r,o]of Object.entries(e))Fi.has(r)||Ri.has(r)||(n[r]=o);return n}var ki=U(ce,"sessions"),en=class{sessionId;sessionDir;runs=[];_flows=[];_nextIndex=0;_started=!1;_testId=null;_testcaseId=null;_projectId=null;_orgId=null;_uploadStatus="pending";_uploadAttempts=0;_uploadError=null;_firstObjective=null;_firstUrl=null;_auteurVariables={};_screenshotSas=null;_model="";_environment="";_profile=null;_startedAt="";_remoteLogger=null;_earlyLogBuffer=[];_recorder=null;_resolvedGlobal={};_sessionName=null;_recordingEnabled=!0;_stepRunRecords=[];constructor(){this.sessionId=Oi(),this.sessionDir=U(ki,this.sessionId)}setResolvedGlobal(n){this._resolvedGlobal={...this._resolvedGlobal,...n}}setSessionName(n){this._sessionName=n}get sessionName(){return this._sessionName}setRecordingEnabled(n){this._recordingEnabled=n}get recorder(){return this._recorder}flushRecorder(){try{this._recorder?.flush()}catch(n){process.stderr.write(`[recorder] flush failed: ${n.message}
45
+ `)}}start(n){if(!this._started){this._started=!0,this._model=n.model,this._environment=n.environment,this._profile=n.profile,this._startedAt=new Date().toISOString();try{Ti(this.sessionDir,{recursive:!0}),this._recorder=new V({cwd:process.cwd(),getResolvedGlobal:()=>this._resolvedGlobal,getName:()=>this._sessionName});let r={session_id:this.sessionId,started_at:this._startedAt,model:n.model,environment:n.environment,profile:n.profile,objectives:[],runs:[],status:"in_progress"};ze(U(this.sessionDir,"session.json"),JSON.stringify(r,null,2)+`
46
+ `)}catch{}this._log(`SESSION START session_id=${this.sessionId}`),this._log(`CONFIG model=${n.model} env=${n.environment} profile=${n.profile}`),this._earlyLogBuffer.push({level:"info",event:"SESSION_START",message:"Session started",context:{session_id:this.sessionId}},{level:"info",event:"CONFIG",message:"Session config",context:{model:n.model,environment:n.environment,profile:n.profile}})}}setRemoteLogger(n){this._remoteLogger=n;for(let r of this._earlyLogBuffer)n.log(r.level,r.event,r.message,r.context);this._earlyLogBuffer=[]}get hasRemoteLogger(){return this._remoteLogger!==null}setAuteurVariables(n){Object.assign(this._auteurVariables,n)}get auteurVariables(){return this._auteurVariables}setScreenshotSas(n){this._screenshotSas=n}get screenshotSas(){return this._screenshotSas}get screenshotBaseUrl(){return this._screenshotSas?`${this._screenshotSas.base_url}/${this._screenshotSas.container}`:""}get startedAt(){return this._startedAt||new Date().toISOString()}log(n,r,o,i){if(r===void 0){this._log(n);let u=n.indexOf(" "),s=u>0?n.slice(0,u):n,c=u>0?n.slice(u+1):"",f=/fail|error/i.test(n)?"error":"info";this._remoteLogger?.log(f,s,c||n);return}let t=n,l=o;this._log(`${r} ${l}`),this._remoteLogger?.log(t,r,l,i)}logStep(n,r,o){this._log(`${n} ${r}`);let i=this._nextIndex>0?this._nextIndex-1:0;this._remoteLogger?.logStep(i,n,r,o)}logCommand(n){this._log(`COMMAND ${n}`)}logRunStart(n,r,o){this._log(`RUN ${n} START objective="${r.slice(0,100)}" url=${o}`),this._remoteLogger?.setRunIndex(n),this._remoteLogger?.log("info","RUN_START",`Run ${n} started`,{run_index:n,objective:r,url:o})}logRunEnd(n,r,o,i){let t=(o??0).toFixed(1),l=(i??"").slice(0,100);this._log(`RUN ${n} END status=${r} duration=${t}s summary="${l}"`),this._remoteLogger?.log("info","RUN_END",`Run ${n} ended`,{run_index:n,status:r,duration:o??0,summary:i??""}),r!=="failed"&&r!=="error"&&this._remoteLogger?.discardSteps(n)}escalateRun(n){this._remoteLogger?.escalate(n)}logChromeLaunch(n,r){this._log(`CHROME LAUNCH port=${n} endpoint=${r}`),this._remoteLogger?.log("info","CHROME_LAUNCH","Chrome launched",{port:n,cdp_endpoint:r})}async finish(n="complete"){this._log(`SESSION END status=${n} total_runs=${this.runs.length}`),this._remoteLogger?.log("info","SESSION_END","Session ended",{status:n,total_runs:this.runs.length}),await this._remoteLogger?.shutdown();let r={session_id:this.sessionId,started_at:this._startedAt,ended_at:new Date().toISOString(),model:this._model,environment:this._environment,profile:this._profile,status:n,total_runs:this.runs.length,test_id:this._testId,testcase_id:this._testcaseId,commit_id:this.sessionId,project_id:this._projectId,upload_status:this._uploadStatus,upload_attempts:this._uploadAttempts,last_upload_attempt:this._uploadAttempts>0?new Date().toISOString():null,upload_error:this._uploadError,runs:this.runs.map(o=>({index:o.index,objective:o.objective,status:o.status,summary:o.summary,run_dir:o.run_dir}))};Je(this.sessionDir)&&ze(U(this.sessionDir,"session.json"),JSON.stringify(r,null,2)+`
47
+ `),this.flushRecorder(),this._recorder=null}nextRunIndex(){return this._nextIndex}addRunResult(n,r){this.runs.push(n),this._nextIndex+=r??1,this._recordingEnabled&&this._recorder?.appendObjective(n.objective)}getContext(){return{prior_runs:this.runs.map(n=>({index:n.index,objective:n.objective,summary:n.summary,status:n.status,memory:n.context.memory,variables:n.context.variables,pointer:n.context.pointer}))}}addFlow(n){let r={...n,index:this._flows.length+1};return this._flows.push(r),r}getFlows(){return[...this._flows]}getFlow(n){return this._flows.find(r=>r.index===n)}clearFlows(){this._flows=[]}recordStepRun(n){this._stepRunRecords.push(n)}getStepRunRecords(){return[...this._stepRunRecords]}snapshot(){return{runsLen:this.runs.length,nextRunIndex:this._nextIndex,stepRunRecordsLen:this._stepRunRecords.length}}rollback(n){this.runs.length=n.runsLen,this._nextIndex=n.nextRunIndex,this._stepRunRecords.length=n.stepRunRecordsLen}setTestId(n){this._testId=n}get testId(){return this._testId}setTestcaseId(n){this._testcaseId=n}get testcaseId(){return this._testcaseId}setProjectId(n){this._projectId=n}setOrgId(n){this._orgId=n}get orgId(){return this._orgId}setFirstRun(n,r){this._firstObjective||(this._firstObjective=n,this._firstUrl=r)}get firstObjective(){return this._firstObjective}get firstUrl(){return this._firstUrl}getRunDirs(){let n=[];for(let r of this.runs)r.run_dirs&&r.run_dirs.length>0?n.push(...r.run_dirs):r.run_dir&&n.push(r.run_dir);return n}getRunObjectives(){let n=[];for(let r of this.runs)r.flow_objectives&&r.flow_objectives.length>0?n.push(...r.flow_objectives):n.push(r.objective);return n}getRunMetadata(){let n=[];for(let r of this.runs)if(r.perFlowMetadata&&r.perFlowMetadata.length>0)n.push(...r.perFlowMetadata);else{let o={resultCode:r.resultCode,reasonCode:r.reasonCode,errorMessage:r.status==="failed"?r.summary??null:null,summary:r.summary,oneLiner:r.oneLiner},i=r.run_dirs?.length??1;for(let t=0;t<i;t++)n.push(o)}return n}setUploadStatus(n,r){this._uploadStatus=n,this._uploadAttempts+=1,this._uploadError=r??null}_log(n){if(!(!this._started||!Je(this.sessionDir)))try{let r=new Date().toISOString().slice(0,19).replace("T"," "),o=U(this.sessionDir,"tui.log");Ni(o,`[${r}] ${n}
48
+ `)}catch{}}};export{Di as a,en as b};
49
+ /*! Bundled license information:
50
+
51
+ js-yaml/dist/js-yaml.mjs:
52
+ (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *)
53
+ */
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as u,g as f}from"./chunk-7ONI2K3S.js";var n=class{config;buffer=[];stepBuffer=new Map;flushTimer=null;currentRunIndex=null;stopped=!1;_droppedBatches=0;_droppedEntries=0;constructor(e){this.config=e}start(){if(this.flushTimer)return;let e=this.config.flushIntervalMs??5e3;this.flushTimer=setInterval(()=>{this.flush().catch(()=>{})},e),this.flushTimer.unref&&this.flushTimer.unref()}setRunIndex(e){this.currentRunIndex=e}log(e,t,i,s={}){if(this.stopped)return;let r=this.buildEntry(e,t,i,s);this.buffer.push(r)}logStep(e,t,i,s={}){if(this.stopped)return;let r=this.buildEntry("debug",t,i,s);r.run_index=e,this.stepBuffer.has(e)||this.stepBuffer.set(e,[]),this.stepBuffer.get(e).push(r)}escalate(e){let t=this.stepBuffer.get(e);t&&t.length>0&&this.buffer.push(...t),this.stepBuffer.delete(e)}discardSteps(e){this.stepBuffer.delete(e)}async flush(){if(this.buffer.length===0)return;let e=this.buffer.splice(0),t=null;try{t=await this.config.getToken()}catch{this.buffer.unshift(...e);return}let i={"Content-Type":"application/json"};t&&(i.Authorization=`Bearer ${t}`);let s=JSON.stringify(e);for(let r=0;r<3;r++){try{let h=new AbortController,p=setTimeout(()=>h.abort(),1e4),d=await fetch(this.config.proxyUrl,{method:"POST",headers:i,body:s,signal:h.signal});if(clearTimeout(p),d.ok)return}catch{}r<2&&await new Promise(h=>setTimeout(h,1e3*Math.pow(2,r)))}this._droppedBatches++,this._droppedEntries+=e.length}get droppedBatches(){return this._droppedBatches}get droppedEntries(){return this._droppedEntries}async shutdown(){this._droppedBatches>0&&this.log("warn","LOG_DROPS",`Dropped ${this._droppedEntries} entries in ${this._droppedBatches} batches`,{dropped_batches:this._droppedBatches,dropped_entries:this._droppedEntries}),this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),await this.flush()}shutdownSync(){this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null)}get bufferSize(){return this.buffer.length}stepBufferSize(e){return this.stepBuffer.get(e)?.length??0}buildEntry(e,t,i,s){return{hostname:"kane-cli",service:"kane-cli",ddsource:"kane-cli",ddtags:`version:${this.config.device.cli_version}`,level:e,event:t,message:i,session_id:this.config.sessionId,run_index:this.currentRunIndex,identity:this.config.identity,device:this.config.device,context:s,timestamp:new Date().toISOString()}}};import{platform as l,arch as g}from"os";function v(o){let e={proxyUrl:f,sessionId:o.sessionId,identity:o.identity,device:{cli_version:u,platform:l(),arch:g()},getToken:o.getToken};return new n(e)}export{n as a,v as b};
2
+ import{a as u,g as f}from"./chunk-3ELBJPHQ.js";var n=class{config;buffer=[];stepBuffer=new Map;flushTimer=null;currentRunIndex=null;stopped=!1;_droppedBatches=0;_droppedEntries=0;constructor(e){this.config=e}start(){if(this.flushTimer)return;let e=this.config.flushIntervalMs??5e3;this.flushTimer=setInterval(()=>{this.flush().catch(()=>{})},e),this.flushTimer.unref&&this.flushTimer.unref()}setRunIndex(e){this.currentRunIndex=e}log(e,t,i,s={}){if(this.stopped)return;let r=this.buildEntry(e,t,i,s);this.buffer.push(r)}logStep(e,t,i,s={}){if(this.stopped)return;let r=this.buildEntry("debug",t,i,s);r.run_index=e,this.stepBuffer.has(e)||this.stepBuffer.set(e,[]),this.stepBuffer.get(e).push(r)}escalate(e){let t=this.stepBuffer.get(e);t&&t.length>0&&this.buffer.push(...t),this.stepBuffer.delete(e)}discardSteps(e){this.stepBuffer.delete(e)}async flush(){if(this.buffer.length===0)return;let e=this.buffer.splice(0),t=null;try{t=await this.config.getToken()}catch{this.buffer.unshift(...e);return}let i={"Content-Type":"application/json"};t&&(i.Authorization=`Bearer ${t}`);let s=JSON.stringify(e);for(let r=0;r<3;r++){try{let h=new AbortController,p=setTimeout(()=>h.abort(),1e4),d=await fetch(this.config.proxyUrl,{method:"POST",headers:i,body:s,signal:h.signal});if(clearTimeout(p),d.ok)return}catch{}r<2&&await new Promise(h=>setTimeout(h,1e3*Math.pow(2,r)))}this._droppedBatches++,this._droppedEntries+=e.length}get droppedBatches(){return this._droppedBatches}get droppedEntries(){return this._droppedEntries}async shutdown(){this._droppedBatches>0&&this.log("warn","LOG_DROPS",`Dropped ${this._droppedEntries} entries in ${this._droppedBatches} batches`,{dropped_batches:this._droppedBatches,dropped_entries:this._droppedEntries}),this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),await this.flush()}shutdownSync(){this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null)}get bufferSize(){return this.buffer.length}stepBufferSize(e){return this.stepBuffer.get(e)?.length??0}buildEntry(e,t,i,s){return{hostname:"kane-cli",service:"kane-cli",ddsource:"kane-cli",ddtags:`version:${this.config.device.cli_version}`,level:e,event:t,message:i,session_id:this.config.sessionId,run_index:this.currentRunIndex,identity:this.config.identity,device:this.config.device,context:s,timestamp:new Date().toISOString()}}};import{platform as l,arch as g}from"os";function v(o){let e={proxyUrl:f,sessionId:o.sessionId,identity:o.identity,device:{cli_version:u,platform:l(),arch:g()},getToken:o.getToken};return new n(e)}export{n as a,v as b};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as D,b as A}from"./chunk-CKMDFVL6.js";import{l as S,m as C,n as P,o as U,p as N}from"./chunk-7ONI2K3S.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
2
+ import{a as D,b as A}from"./chunk-K7MSPKEM.js";import{l as S,m as C,n as P,o as U,p as N}from"./chunk-3ELBJPHQ.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>
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ var r={maxShrinks:3};function n(e){return e.hasRetry?e.shrinkCount>=e.maxShrinks?{kind:"complete-reauthor"}:{kind:"retry",newAuthorBoundary:e.failedAt}:{kind:"fail"}}export{r as a,n as b};
@@ -0,0 +1,5 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as v}from"./chunk-TK7ZJ7YX.js";import{spawn as x,execSync as b}from"child_process";import{existsSync as g}from"fs";import{resolve as r,dirname as h}from"path";import{fileURLToPath as N}from"url";import{createInterface as _}from"readline";async function*E(t){let n=_({input:t,crlfDelay:1/0});for await(let l of n){let e=l.trim();if(e)try{let c=JSON.parse(e);c&&typeof c.type=="string"&&(yield c)}catch{}}}function w(t){return t==="action"?{set:{V16_AGENT_ENABLE_ALL_BLOCKERS:"true"},unset:[]}:{set:{},unset:["V16_AGENT_ENABLE_ALL_BLOCKERS"]}}var d=h(N(import.meta.url));function O(){for(let t of["python3","python"])try{return b(`${t} --version`,{stdio:"ignore"}),t}catch{}return null}function C(){let n=process.platform==="win32"?"v16-runner.exe":"v16-runner",l={"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"],"win32-x64":["@testmuai/kane-cli-win-x64","@lambdatestincprivate/kane-cli-win-x64"]},e=`${process.platform}-${process.arch}`,c=l[e];if(c)for(let i of c){let a=[r(d,"..","node_modules",i,"bin",n),r(d,"..","..","node_modules",i,"bin",n),r(d,"..","..","..","node_modules",i,"bin",n)];for(let u of a)if(g(u))return{cmd:u,args:[]}}let p=[r(d,"bin",n),r(d,"..","bin",n),r(d,"..","..","..","..","v16-runner","dist",n),r(d,"..","..","..","v16-runner","dist",n),r(process.cwd(),"v16-runner","dist",n),r(process.cwd(),"..","v16-runner","dist",n)];for(let i of p)if(g(i))return{cmd:i,args:[]};let s=[r(d,"..","..","..","..","v16-runner"),r(d,"..","..","..","v16-runner"),r(process.cwd(),"v16-runner"),r(process.cwd(),"..","v16-runner")];for(let i of s)if(g(r(i,"main.py"))){for(let u of[r(i,".venv","bin","python"),r(i,"..","browser-agent",".venv","bin","python")])if(g(u))return{cmd:u,args:["main.py"],cwd:i};let a=O();if(a)return{cmd:a,args:["main.py"],cwd:i}}return null}function G(t,n){let l=C();if(!l)throw new Error("v16-runner not found. Build the binary with `cd v16-runner && python build.py` or ensure Python is available.");let e={...process.env};n?.environment&&(e.TESTMUAI_ENV=n.environment),e.TESTMUAI_SOURCE="kane-cli",process.platform==="win32"&&(e.PYTHONIOENCODING="utf-8");let c=v(n?.environment);e.V16_SERVER_API_HOST=c.v16ServerHost,e.ATMS_URL=c.tmsBaseUrl.replace(/\/api\/?$/,""),t.username&&t.access_key&&(e.LT_USERNAME=t.username,e.LT_ACCESS_KEY=t.access_key),t.session_id&&(e.TESTMUAI_SESSION_ID=t.session_id);let p=w(n?.mode??"testing");Object.assign(e,p.set);for(let o of p.unset)delete e[o];let s=x(l.cmd,l.args,{stdio:["pipe","pipe","pipe"],env:e,cwd:l.cwd});s.stdin.on("error",()=>{}),s.stdin.write(JSON.stringify(t)+`
3
+ `);let i=1e5,a="";s.stderr.on("data",o=>{a+=o.toString(),a.length>i&&(a=a.slice(-i))}),s.on("error",o=>{n?.log?.("error","RUNNER_SPAWN_ERROR","Runner spawn error",{error:o.message})});let u=null,f=null,R=new Promise(o=>{s.on("close",(m,y)=>{u=m,f=y?String(y):null,n?.log?.("info","RUNNER_EXIT","Runner exited",{code:m,signal:f??"none"}),o({code:m,signal:f})})}),S=E(s.stdout);return{child:s,events:S,sendUserResponse(o){let m=JSON.stringify({type:"user_response",answer:o});try{s.stdin.write(m+`
4
+ `)}catch{}},sendCancel(o){let m=JSON.stringify({type:"cancel",reason:o});try{s.stdin.write(m+`
5
+ `)}catch{}},cancel(){s.kill("SIGTERM")},get stderr(){return a},get exitCode(){return u},get exitSignal(){return f},exited:R}}export{C as a,G as b};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{f as R,g as x}from"./chunk-G7VF5SDK.js";import{b}from"./chunk-K7MSPKEM.js";import{a as v}from"./chunk-TK7ZJ7YX.js";import{a as y}from"./chunk-PWGEMRBD.js";var m=class extends Error{constructor(t,i){super(t);this.code=i;this.name="AuthError"}};async function k(e){let r=e.credentials.expires_at,t=e.thresholdSeconds??300;if(r-Date.now()/1e3>=t)return null;let i=e.creds.loadClient(e.profile,e.env);if(!i)return null;let n=await new b(e.env).refreshToken(e.credentials.refresh_token,i.client_id),s=Math.floor(Date.now()/1e3)+n.expires_in;return e.creds.saveCredentials(e.profile,e.env,{access_token:n.access_token,refresh_token:n.refresh_token,expires_at:s,scope:n.scope}),{accessToken:n.access_token,refreshToken:n.refresh_token,expiresAt:s,scope:n.scope}}async function P(e){let{creds:r,env:t,usernameFlag:i,accessKeyFlag:c,log:n}=e,s=null,u=null;if(i&&c)s={username:i,access_key:c},n("info","AUTH_RESOLVE_FLAGS","Auth resolved via CLI flags",{username:i});else{let a=r.resolveAuth();a?.method==="basic"&&(s={username:a.username,access_key:a.access_key},n("info","AUTH_RESOLVE_CONFIG","Auth resolved via config",{username:a.username}))}if(!s){let{credentials:a,profile:C}=r.getActiveCredentials();if(!a)throw new m("Not authenticated \u2014 no credentials found","not_authenticated");if(u=a.access_token,a.expires_at-Date.now()/1e3<300)try{let p=await k({creds:r,profile:C,env:t,credentials:a});p&&(u=p.accessToken,n("info","AUTH_TOKEN_REFRESHED","OAuth token refreshed"))}catch(p){let h=p instanceof Error?p.message:String(p);throw n("error","TOKEN_REFRESH_FAILED","Token refresh failed",{error:h}),new m(`Token refresh failed: ${h}`,"refresh_failed")}}let A=v(t),E=async()=>u,S=s?{username:s.username,access_key:s.access_key}:null,g=new y(A.controllerBaseUrl,E,S,n),f=await g.resolve();return f&&!s&&(s={username:f.username,access_key:f.access_key},n("info","AUTH_RESOLVE_CONTROLLER","Auth resolved via controller",{username:f.username})),{basicAuth:s,token:u,resolver:g,resolvedCreds:f}}async function U(e){if(!e.isInteractive)return{recovered:!1};if(_(e.creds,e.config))return{recovered:!1};let{SingleShotApp:r}=await import("./SingleShotApp-YTFAGVZD.js"),{render:t}=await import("./build-JIKYOZUH.js"),i=await import("./react-QWOAB3TB.js"),c={current:null},n={current:!1},{waitUntilExit:s,unmount:u}=t(i.default.createElement(r,{resultRef:c,mode:"login",loginCompleteRef:n}),{exitOnCtrlC:!1});x(()=>u()),await s();try{process.stdin.setRawMode?.(!1)}catch{}return process.stdout.write("\x1B[?25h"),n.current?{recovered:!0}:(R(0,"Startup gate cancelled"),{recovered:!1})}function _(e,r){let t=e.getActiveProfile(),i=e.getDefaultEnv();if(!t||!!!(e.loadBasicAuth(t,i)||e.loadCredentials(t,i)))return!1;let n=r.load();return!!n.project_id&&!!n.folder_id}import{existsSync as o,renameSync as d,rmSync as l}from"fs";function H(e){let r=`${e}.staging`,t=`${e}.bak`;if(!o(r))throw new Error(`atomicReplaceDir: staging missing: ${r}`);if(process.platform==="win32"){o(e)&&l(e,{recursive:!0,force:!0}),d(r,e);return}o(e)&&(o(t)&&l(t,{recursive:!0,force:!0}),d(e,t)),d(r,e),o(t)&&l(t,{recursive:!0,force:!0})}function $(e){let r=`${e}.staging`,t=`${e}.bak`;if(process.platform==="win32"){o(r)&&(o(e)?l(r,{recursive:!0,force:!0}):d(r,e));return}if(o(t)&&!o(e)){d(t,e),o(r)&&l(r,{recursive:!0,force:!0});return}o(t)&&o(e)&&l(t,{recursive:!0,force:!0}),o(r)&&o(e)&&l(r,{recursive:!0,force:!0})}export{k as a,H as b,$ as c,m as d,P as e,U as f};
@@ -0,0 +1,4 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{c}from"./chunk-SLA75N5B.js";import{writeFileSync as g,mkdirSync as R,readFileSync as b}from"fs";import{dirname as m,basename as S}from"path";function E(s){let e=s.outPath??c(s.sourcePath);R(m(e),{recursive:!0});let t=[];t.push("---"),t.push(`test: ../${S(s.sourcePath)}`),t.push(`status: ${s.overallStatus}`),t.push(`started: ${s.startedISO}`),t.push(`duration_s: ${s.durationS}`),t.push(`session_id: ${s.sessionId}`),t.push("---",""),t.push(`# ${s.title??S(s.sourcePath)} \u2014 Result`,"");for(let a=0;a<s.rootSteps.length;a++){let i=s.rootSteps[a],r=s.outcomes.find(n=>n.rootStepIndex===a+1);if(t.push(P(i,r)),i.body.kind==="objective"&&r?.stepMd5&&t.push(`md5: ${r.stepMd5}`),r?.status==="failed"&&r.reason&&t.push(`Reason: ${r.reason}`),r?.softFailures?.length)for(let n of r.softFailures){let p=n.reason?`: ${n.reason}`:"";t.push(`\u26A0 optional sub-step ${n.subStepIndex} failed${p}`)}i.body.kind==="objective"&&r?.status!=="skipped"&&t.push(i.body.text),t.push("")}return g(e,t.join(`
3
+ `),"utf8"),e}function P(s,e){if(!e)return`## ${s.heading} (no outcome)`;let t=e.duration_s!=null?`${e.duration_s}s`:"\u2014";if(e.status==="skipped")return`## ${s.heading} \u23ED skipped`;let a=e.softFailed?" (optional)":"";if(e.refKind&&e.status==="passed"){let i=e.helperResultRelPath?` \u2192 ${e.helperResultRelPath}`:"";return`## ${s.heading} \u2713 passed (via @${e.refKind} ${e.refLabel} \u2014 ${e.inlinedCount} inlined steps, ${t}${i})`}if(e.refKind&&e.status==="failed"){let i=e.failedSubStepIndex&&e.failedSubStepIndex.length>0?` \u2014 at sub-step ${e.failedSubStepIndex.join(" \u2192 sub-step ")}`:"",r=e.helperResultRelPath?` \u2192 ${e.helperResultRelPath}`:"";return`## ${s.heading} \u2717 failed${a} (via @${e.refKind} ${e.refLabel}${i}, ${t}${r})`}return e.status==="passed"?`## ${s.heading} \u2713 passed (${t})`:`## ${s.heading} \u2717 failed${a} (${t})`}var x=/^##\s+(.+?)\s+(✓ passed|✗ failed(?:\s+\(optional\))?|⏭ skipped)(?:\s+\((.*)\))?\s*$/,k=/via\s+@\w+\s+(\S+).*?(?:→\s+(\S+))?\s*$/,v=/^md5:\s+([a-f0-9]{32})\s*$/;function K(s){let t=b(s,"utf8").split(`
4
+ `),a="passed";if(t[0]?.trim()==="---")for(let r=1;r<t.length&&t[r].trim()!=="---";r++){let n=/^status:\s+(passed|failed|interrupted)\s*$/.exec(t[r]);n&&(a=n[1])}let i=[];for(let r=0;r<t.length;r++){let n=x.exec(t[r]);if(!n)continue;let p=n[1],o=n[2],f=n[3]??"",h=o.startsWith("\u2713")?"passed":o.startsWith("\u23ED")?"skipped":"failed";if(/via\s+@/.test(f)){let l=k.exec(f),d=l?.[1]??"",u=l?.[2]??null;i.push({kind:"import",heading:p,status:h,md5:null,importPath:d,helperResultRelPath:u})}else{let l=null;for(let d=r+1;d<t.length&&!/^##\s/.test(t[d]);d++){if(t[d].trim()==="")continue;let u=v.exec(t[d]);if(u){l=u[1];break}break}i.push({kind:"objective",heading:p,status:h,md5:l})}}return{overallStatus:a,steps:i}}import{existsSync as $,mkdirSync as y,rmSync as I,cpSync as M}from"fs";function L(s,e){$(s)&&($(e)&&I(e,{recursive:!0,force:!0}),y(e,{recursive:!0}),M(s,e,{recursive:!0}))}export{E as a,K as b,L as c};
@@ -0,0 +1,10 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ var v=()=>!!process.env.KANE_DEV_MODE,o=[],a=!1,f=null,g=null,d=null,i=null;function x(e){i=e}function m(){return i}function h(){return a}function y(e,t){o=o.filter(r=>r.name!==e),o.push({name:e,fn:t})}function R(e,t){let r=o.find(n=>n.name===e);if(!r)return;o=o.filter(n=>n.name!==e);let s=!0;try{r.fn()}catch(n){s=!1,process.stderr.write(`[exit-manager] cleanup(${e}) failed: ${n instanceof Error?n.message:String(n)}
3
+ `)}t&&s&&v()&&process.stderr.write(`[exit-manager] cleanup(${e}): ${t}
4
+ `)}function l(e,t,r=!1){if(a){process.exit(f??e);return}if(a=!0,f=e,r&&i)try{i.log("error","CRASH",t),i.shutdownSync()}catch{}let s=[...o].reverse(),n=[];for(let u of s)try{u.fn(),n.push(u.name)}catch(c){process.stderr.write(`[exit-manager] cleanup(${u.name}) failed: ${c instanceof Error?c.message:String(c)}
5
+ `)}if(o=[],v()&&(process.stderr.write(`[exit-manager] shutdown(${e}): ${t}
6
+ `),n.length>0&&process.stderr.write(`[exit-manager] cleaned up: ${n.join(", ")}
7
+ `)),r&&d){try{d()}catch{}process.stderr.write(`
8
+ Kane CLI crashed unexpectedly: ${t}
9
+ `+(n.length>0?`Resources cleaned up (${n.join(", ")}).
10
+ `:"")),process.exit(e);return}if(g&&!r){g();return}process.exit(e)}function w(e){g=e}function E(e){d=e}var p=!1;function $(){p||(p=!0,process.on("SIGINT",()=>{l(130,"Received SIGINT",!0)}),process.on("SIGTERM",()=>{l(143,"Received SIGTERM",!0)}),process.on("uncaughtException",e=>{l(1,`Uncaught exception: ${e.message}`,!0)}),process.on("unhandledRejection",e=>{l(1,`Unhandled rejection: ${String(e)}`,!0)}))}export{x as a,m as b,h as c,y as d,R as e,l as f,w as g,E as h,$ as i};
@@ -0,0 +1,13 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{e as s}from"./chunk-SLA75N5B.js";import{writeFileSync as d,mkdirSync as o}from"fs";import{dirname as n}from"path";function f(e){let r=s(e.sourcePath);try{o(n(r),{recursive:!0})}catch(i){return process.stderr.write(`
3
+ \u26A0 Failed to create output directory.
4
+ ${i.message}
5
+ Path: ${n(r)}
6
+
7
+ `),r}let t={commit_id:e.commitId};e.testId!==void 0&&(t.test_id=e.testId),e.testcaseId!==void 0&&(t.testcase_id=e.testcaseId),e.projectId!==void 0&&(t.project_id=e.projectId),e.folderId!==void 0&&(t.folder_id=e.folderId),e.orgId!==void 0&&(t.org_id=e.orgId),e.sessionName!==void 0&&(t.session_name=e.sessionName);try{d(r,JSON.stringify(t,null,2)+`
8
+ `,"utf8")}catch(i){process.stderr.write(`
9
+ \u26A0 Failed to write meta.json.
10
+ ${i.message}
11
+ Path: ${r}
12
+
13
+ `)}return r}export{f as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as s}from"./chunk-HCBYKLMW.js";import{t as n}from"./chunk-7ONI2K3S.js";import{a,b as i}from"./chunk-C44QQJR4.js";import{e as r}from"./chunk-UR6MHSHU.js";var o=r(s(),1);function g({bindings:c,suppressEscBack:p=!1,escBackLabel:m="back to chat"}){let e=c.map(t=>`${t.keys} ${t.label}`);return p||e.push(`esc \xB7 ${m}`),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(i,{color:n.dim,children:e.join(" \xB7 ")})})}export{g as a};
2
+ import{a as s}from"./chunk-HCBYKLMW.js";import{t as n}from"./chunk-3ELBJPHQ.js";import{a,b as i}from"./chunk-C44QQJR4.js";import{e as r}from"./chunk-UR6MHSHU.js";var o=r(s(),1);function g({bindings:c,suppressEscBack:p=!1,escBackLabel:m="back to chat"}){let e=c.map(t=>`${t.keys} ${t.label}`);return p||e.push(`esc \xB7 ${m}`),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(i,{color:n.dim,children:e.join(" \xB7 ")})})}export{g 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-2O7RIXHD.js";import{c as h,q as g,r as u}from"./chunk-7ONI2K3S.js";import{readFileSync as a,writeFileSync as f,mkdirSync as p,readdirSync as c,unlinkSync as s,existsSync as l,chmodSync as y}from"fs";import{join as n,dirname as C}from"path";var v=class{baseDir;profilesDir;configFile;constructor(t=h){this.baseDir=t,this.profilesDir=n(t,"profiles"),this.configFile=n(t,"config.json")}readConfig(){try{return JSON.parse(a(this.configFile,"utf-8"))}catch{return{}}}writeConfig(t){p(this.baseDir,{recursive:!0,mode:448}),f(this.configFile,JSON.stringify(t,null,2)+`
2
+ import{a as d}from"./chunk-TK7ZJ7YX.js";import{c as h,q as g,r as u}from"./chunk-3ELBJPHQ.js";import{readFileSync as a,writeFileSync as f,mkdirSync as p,readdirSync as c,unlinkSync as s,existsSync as l,chmodSync as y}from"fs";import{join as n,dirname as C}from"path";var v=class{baseDir;profilesDir;configFile;constructor(t=h){this.baseDir=t,this.profilesDir=n(t,"profiles"),this.configFile=n(t,"config.json")}readConfig(){try{return JSON.parse(a(this.configFile,"utf-8"))}catch{return{}}}writeConfig(t){p(this.baseDir,{recursive:!0,mode:448}),f(this.configFile,JSON.stringify(t,null,2)+`
3
3
  `),y(this.configFile,384)}getActiveProfile(){return this.readConfig().active_profile??null}setActiveProfile(t){let r=this.readConfig();r.active_profile=t,this.writeConfig(r)}getDefaultEnv(){return this.readConfig().default_env??"prod"}setDefaultEnv(t){let r=this.readConfig();r.default_env=t,this.writeConfig(r)}credentialsPath(t,r){return n(this.profilesDir,t,r,"credentials")}clientPath(t,r){return n(this.profilesDir,t,r,"client.json")}basicAuthPath(t,r){return n(this.profilesDir,t,r,"basic-auth")}profileConfigPath(t,r){return n(this.profilesDir,t,r,"profile-config.json")}saveProfileConfig(t,r,e){let i=this.loadProfileConfig(t,r)??{};this.writeSecure(this.profileConfigPath(t,r),{...i,...e})}loadProfileConfig(t,r){try{return JSON.parse(a(this.profileConfigPath(t,r),"utf-8"))}catch{return null}}writeSecure(t,r){try{p(C(t),{recursive:!0,mode:448}),f(t,JSON.stringify(r,null,2)+`
4
4
  `),y(t,384)}catch(e){let i=e instanceof Error?e.message:String(e);process.stderr.write(`[auth] Failed to save credentials: ${i}
5
5
  `)}}saveCredentials(t,r,e){this.writeSecure(this.credentialsPath(t,r),e)}loadCredentials(t,r){try{return JSON.parse(a(this.credentialsPath(t,r),"utf-8"))}catch{return null}}saveClient(t,r,e){this.writeSecure(this.clientPath(t,r),e)}loadClient(t,r){try{return JSON.parse(a(this.clientPath(t,r),"utf-8"))}catch{return null}}getActiveCredentials(){let t=this.getActiveProfile();if(!t)return{credentials:null,profile:null,env:null};let r=this.getDefaultEnv();return{credentials:this.loadCredentials(t,r),profile:t,env:r}}saveBasicAuth(t,r,e){this.writeSecure(this.basicAuthPath(t,r),e)}loadBasicAuth(t,r){try{return JSON.parse(a(this.basicAuthPath(t,r),"utf-8"))}catch{return null}}deleteBasicAuth(t,r){try{s(this.basicAuthPath(t,r))}catch{}}resolveAuth(){let t=this.getActiveProfile();if(!t)return null;let r=this.getDefaultEnv(),e=this.loadBasicAuth(t,r);return e?{method:"basic",...e,profile:t,env:r}:this.loadCredentials(t,r)?{method:"oauth",profile:t,env:r}:null}listProfiles(){let t=[];try{for(let r of c(this.profilesDir)){let e=n(this.profilesDir,r);try{for(let i of c(e)){let o=n(e,i),P=l(n(o,"credentials")),w=l(n(o,"client.json")),k=l(n(o,"basic-auth"));(P||w||k)&&t.push({profile:r,env:i})}}catch{}}}catch{}return t}deleteProfile(t,r){try{s(this.credentialsPath(t,r))}catch{}if(this.getActiveProfile()===t){let e=this.readConfig();delete e.active_profile,this.writeConfig(e)}}deleteProfileFull(t,r){if(r){try{s(this.credentialsPath(t,r))}catch{}try{s(this.clientPath(t,r))}catch{}try{s(this.basicAuthPath(t,r))}catch{}try{s(this.profileConfigPath(t,r))}catch{}}else try{let e=n(this.profilesDir,t);for(let i of c(e)){try{s(n(e,i,"credentials"))}catch{}try{s(n(e,i,"client.json"))}catch{}try{s(n(e,i,"basic-auth"))}catch{}try{s(n(e,i,"profile-config.json"))}catch{}}}catch{}}};import{createHash as S,randomBytes as A}from"crypto";var m=class{authBaseUrl;consentUrl;constructor(t="prod"){let r=d(t);this.authBaseUrl=r.authBaseUrl,this.consentUrl=r.consentUrl}static generatePkce(){let t=A(96).toString("base64url").slice(0,128),r=S("sha256").update(t).digest("base64url");return[t,r]}buildAuthorizationUrl(t,r,e,i){let o=new URLSearchParams({response_type:"code",client_id:t,redirect_uri:i,scope:u,code_challenge:r,code_challenge_method:"S256",state:e});return`${this.consentUrl}/oauth2?${o.toString()}`}async registerClient(t){let r=await fetch(`${this.authBaseUrl}/oauth2/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:g,redirect_uris:[t],grant_types:["authorization_code"],response_types:["code"],client_type:"public",application_type:"native"})});if(!r.ok)throw new Error(`DCR failed: ${r.status} ${await r.text()}`);return r.json()}async exchangeCode(t,r,e,i){let o=await fetch(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:t,redirect_uri:i,client_id:r,code_verifier:e})});if(!o.ok)throw new Error(`Token exchange failed: ${o.status}`);return o.json()}async refreshToken(t,r){let e=await fetch(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:t,client_id:r})});if(!e.ok)throw new Error(`Token refresh failed: ${e.status}`);return e.json()}async revokeToken(t,r,e="access_token"){await fetch(`${this.authBaseUrl}/oauth2/revoke`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,token_type_hint:e,client_id:r})})}async validateToken(t){let r=new AbortController,e=setTimeout(()=>r.abort(),1e4);try{let i=await fetch(`${this.authBaseUrl}/api/user`,{headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},signal:r.signal});return clearTimeout(e),i.ok}catch{return clearTimeout(e),!1}}};export{v as a,m as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,c,e as o}from"./chunk-7ONI2K3S.js";import{readFileSync as m,writeFileSync as f,mkdirSync as d,realpathSync as h}from"fs";import{join as g}from"path";var y="npm install -g @testmuai/kane-cli@latest",C="brew upgrade lambdatest/kane/kane-cli";function N(){try{let t=process.argv[1];if(t&&h(t).includes("/Cellar/"))return C}catch{}return y}var p=g(c,"version-check.json"),b=1440*60*1e3;function S(){try{let t=JSON.parse(m(p,"utf-8"));if(Date.now()-t.checkedAt<b)return t}catch{}return null}function k(t){try{d(c,{recursive:!0}),f(p,JSON.stringify({latest:t,checkedAt:Date.now()}))}catch{}}function l(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 u(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 v(){try{let t=S();if(t)return l(a,t.latest)>0?{current:a,latest:t.latest,severity:u(a,t.latest)}:null;let r=new AbortController,i=setTimeout(()=>r.abort(),5e3),n=await fetch(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?(k(e),l(a,e)>0?{current:a,latest:e,severity:u(a,e)}:null):null}catch{return null}}export{N as a,l as b,u as c,v as d};
2
+ import{a,c,e as o}from"./chunk-3ELBJPHQ.js";import{readFileSync as m,writeFileSync as f,mkdirSync as d,realpathSync as h}from"fs";import{join as g}from"path";var y="npm install -g @testmuai/kane-cli@latest",C="brew upgrade lambdatest/kane/kane-cli";function N(){try{let t=process.argv[1];if(t&&h(t).includes("/Cellar/"))return C}catch{}return y}var p=g(c,"version-check.json"),b=1440*60*1e3;function S(){try{let t=JSON.parse(m(p,"utf-8"));if(Date.now()-t.checkedAt<b)return t}catch{}return null}function k(t){try{d(c,{recursive:!0}),f(p,JSON.stringify({latest:t,checkedAt:Date.now()}))}catch{}}function l(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 u(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 v(){try{let t=S();if(t)return l(a,t.latest)>0?{current:a,latest:t.latest,severity:u(a,t.latest)}:null;let r=new AbortController,i=setTimeout(()=>r.abort(),5e3),n=await fetch(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?(k(e),l(a,e)>0?{current:a,latest:e,severity:u(a,e)}:null):null}catch{return null}}export{N as a,l as b,u as c,v as d};
@@ -0,0 +1,8 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{d as a,h as c}from"./chunk-3ELBJPHQ.js";import{readFileSync as g,writeFileSync as n,mkdirSync as i,existsSync as p}from"fs";import{dirname as s}from"path";var o={window_size:{width:1920,height:1080},chrome_profile_path:"",default_url:c,model:"v16-alpha",project_id:null,project_name:null,folder_id:null,folder_name:null,mode:"testing",code_export:{enabled:!0,language:"python",skip_validation:!0},last_seen_version:""},l=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{...o,...e,code_export:{...o.code_export,...e.code_export??{}}}}catch{return{...o,code_export:{...o.code_export}}}}set(r,e){try{let t=this.load();t[r]=e,i(s(this.path),{recursive:!0}),n(this.path,JSON.stringify(t,null,2)+`
3
+ `)}catch(t){let d=t instanceof Error?t.message:String(t);process.stderr.write(`[config] Failed to save config: ${d}
4
+ `)}}save(r){try{let t={...this.load(),...r};i(s(this.path),{recursive:!0}),n(this.path,JSON.stringify(t,null,2)+`
5
+ `)}catch(e){let t=e instanceof Error?e.message:String(e);process.stderr.write(`[config] Failed to save config: ${t}
6
+ `)}}writeRaw(r){try{i(s(this.path),{recursive:!0}),n(this.path,JSON.stringify(r,null,2)+`
7
+ `)}catch(e){let t=e instanceof Error?e.message:String(e);process.stderr.write(`[config] Failed to save config: ${t}
8
+ `)}}};export{l as a};