mobileboost-cli 0.1.3 → 0.2.0

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 (45) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/index-B9xOUxIH.js +492 -0
  3. package/.output/public/assets/{main-BOWxdROu.js → main-Dc24NDnw.js} +1 -1
  4. package/.output/server/chunks/_/{_tanstack-start-manifest_v-CUvi9Zok.mjs → _tanstack-start-manifest_v-DWF0_Gj8.mjs} +1 -1
  5. package/.output/server/chunks/_/actions-AXnOoTLJ.mjs +1 -0
  6. package/.output/server/chunks/_/agent-CUyzfc4e.mjs +1 -0
  7. package/.output/server/chunks/_/ai-client-waGeh-P8.mjs +1 -0
  8. package/.output/server/chunks/_/{appium-BbkeYpmk.mjs → appium-C-D6h2jM.mjs} +1 -1
  9. package/.output/server/chunks/_/appium-client-Dxm_q6FS.mjs +1 -0
  10. package/.output/server/chunks/_/cache-CtBF0d8x.mjs +1 -0
  11. package/.output/server/chunks/_/client-CM5hUS2d.mjs +1 -0
  12. package/.output/server/chunks/_/constants-Dh9o88yr.mjs +1 -0
  13. package/.output/server/chunks/_/describe-BfbyupMJ.mjs +1 -0
  14. package/.output/server/chunks/_/device-CWFVkH1s.mjs +1 -0
  15. package/.output/server/chunks/_/files-hj9HVaKT.mjs +1 -0
  16. package/.output/server/chunks/_/hierarchy-D3NdBpb6.mjs +1 -0
  17. package/.output/server/chunks/_/hierarchy-helpers-BaGN7WBn.mjs +3 -0
  18. package/.output/server/chunks/_/index-CLteVPoM.mjs +474 -0
  19. package/.output/server/chunks/_/{router-Bufjq1jN.mjs → router-CnslKYM2.mjs} +1 -1
  20. package/.output/server/chunks/_/{screenshot-BD59si87.mjs → screenshot-Csbvymnl.mjs} +1 -1
  21. package/.output/server/chunks/_/server.mjs +3 -3
  22. package/.output/server/chunks/_/step-D2WQqd4J.mjs +1 -0
  23. package/.output/server/chunks/_/stores-03HL60eP.mjs +1 -0
  24. package/.output/server/index.mjs +6 -6
  25. package/.output/server/package.json +8 -0
  26. package/dist/cli.js +3 -2
  27. package/dist/cli.js.map +1 -1
  28. package/dist/commands/studio.js +29 -18
  29. package/dist/commands/studio.js.map +1 -1
  30. package/package.json +5 -3
  31. package/.output/public/assets/index-Bu1akwRM.js +0 -437
  32. package/.output/server/chunks/_/actions-2SMY1JO3.mjs +0 -1
  33. package/.output/server/chunks/_/agent-CeaBVldB.mjs +0 -1
  34. package/.output/server/chunks/_/ai-client-BtI1TeHN.mjs +0 -1
  35. package/.output/server/chunks/_/appium-client-D-NjeB35.mjs +0 -1
  36. package/.output/server/chunks/_/cache-D_LOBxSY.mjs +0 -1
  37. package/.output/server/chunks/_/client-DG3m9828.mjs +0 -1
  38. package/.output/server/chunks/_/describe-NXd8kuzS.mjs +0 -1
  39. package/.output/server/chunks/_/device-8ONaG49P.mjs +0 -1
  40. package/.output/server/chunks/_/files-CIdgnUJn.mjs +0 -1
  41. package/.output/server/chunks/_/hierarchy-Q35yGKlr.mjs +0 -1
  42. package/.output/server/chunks/_/hierarchy-helpers-DF8QSYE6.mjs +0 -1
  43. package/.output/server/chunks/_/index-Cz7u2rY_.mjs +0 -419
  44. package/.output/server/chunks/_/step-CEQtT3SD.mjs +0 -1
  45. package/.output/server/chunks/_/stores-C1dCcTeV.mjs +0 -1
@@ -48,4 +48,4 @@ const theme = ${JSON.stringify(a,null,2)};
48
48
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
49
49
  theme.transitions = createTransitions(theme.transitions || {});
50
50
 
51
- export default theme;`}function m0(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const PA=e=>{if(!Number.isNaN(+e))return+e;const a=e.match(/\d*\.?\d+/g);if(!a)return 0;let i=0;for(let s=0;s<a.length;s+=1)i+=+a[s];return i};function KA(e){Object.assign(e,{alpha(a,i){const s=this||e;return s.colorSpace?`oklch(from ${a} l c h / ${typeof i=="string"?`calc(${i})`:i})`:s.vars?`rgba(${a.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof i=="string"?`calc(${i})`:i})`:Kv(a,PA(i))},lighten(a,i){const s=this||e;return s.colorSpace?`color-mix(in ${s.colorSpace}, ${a}, #fff ${m0(i)})`:su(a,i)},darken(a,i){const s=this||e;return s.colorSpace?`color-mix(in ${s.colorSpace}, ${a}, #000 ${m0(i)})`:lu(a,i)}})}function gd(e={},...a){const{breakpoints:i,mixins:s={},spacing:o,palette:f={},transitions:d={},typography:h={},shape:m,colorSpace:y,...v}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(pr(20));const g=Zd({...f,colorSpace:y}),S=Qv(e);let E=nn(S,{mixins:NA(S.breakpoints,s),palette:g,shadows:kA.slice(),typography:nS(g,h),transitions:YA(d),zIndex:{...VA}});return E=nn(E,v),E=a.reduce((R,_)=>nn(R,_),E),E.unstable_sxConfig={...$l,...v?.unstable_sxConfig},E.unstable_sx=function(_){return Pl({sx:_,theme:this})},E.toRuntimeSource=aS,KA(E),E}function XA(e){let a;return e<1?a=5.11916*e**2:a=4.5*Math.log(e+1)+2,Math.round(a*10)/1e3}const FA=[...Array(25)].map((e,a)=>{if(a===0)return"none";const i=XA(a);return`linear-gradient(rgba(255 255 255 / ${i}), rgba(255 255 255 / ${i}))`});function rS(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function iS(e){return e==="dark"?FA:[]}function ZA(e){const{palette:a={mode:"light"},opacity:i,overlays:s,colorSpace:o,...f}=e,d=Zd({...a,colorSpace:o});return{palette:d,opacity:{...rS(d.mode),...i},overlays:s||iS(d.mode),...f}}function JA(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const IA=e=>[...[...Array(25)].map((a,i)=>`--${e?`${e}-`:""}overlays-${i}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],WA=e=>(a,i)=>{const s=e.rootSelector||":root",o=e.colorSchemeSelector;let f=o;if(o==="class"&&(f=".%s"),o==="data"&&(f="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(f=`[${o}="%s"]`),e.defaultColorScheme===a){if(a==="dark"){const d={};return IA(e.cssVarPrefix).forEach(h=>{d[h]=i[h],delete i[h]}),f==="media"?{[s]:i,"@media (prefers-color-scheme: dark)":{[s]:d}}:f?{[f.replace("%s",a)]:d,[`${s}, ${f.replace("%s",a)}`]:i}:{[s]:{...i,...d}}}if(f&&f!=="media")return`${s}, ${f.replace("%s",String(a))}`}else if(a){if(f==="media")return{[`@media (prefers-color-scheme: ${String(a)})`]:{[s]:i}};if(f)return f.replace("%s",String(a))}return s};function tw(e,a){a.forEach(i=>{e[i]||(e[i]={})})}function P(e,a,i){!e[a]&&i&&(e[a]=i)}function bl(e){return typeof e!="string"||!e.startsWith("hsl")?e:Pv(e)}function ea(e,a){`${a}Channel`in e||(e[`${a}Channel`]=Sl(bl(e[a])))}function ew(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const zn=e=>{try{return e()}catch{}},nw=(e="mui")=>_A(e);function Zf(e,a,i,s,o){if(!i)return;i=i===!0?{}:i;const f=o==="dark"?"dark":"light";if(!s){a[o]=ZA({...i,palette:{mode:f,...i?.palette},colorSpace:e});return}const{palette:d,...h}=gd({...s,palette:{mode:f,...i?.palette},colorSpace:e});return a[o]={...i,palette:d,opacity:{...rS(f),...i?.opacity},overlays:i?.overlays||iS(f)},h}function aw(e={},...a){const{colorSchemes:i={light:!0},defaultColorScheme:s,disableCssColorScheme:o=!1,cssVarPrefix:f="mui",nativeColor:d=!1,shouldSkipGeneratingVar:h=JA,colorSchemeSelector:m=i.light&&i.dark?"media":void 0,rootSelector:y=":root",...v}=e,g=Object.keys(i)[0],S=s||(i.light&&g!=="light"?"light":g),E=nw(f),{[S]:R,light:_,dark:A,...z}=i,G={...z};let Q=R;if((S==="dark"&&!("dark"in i)||S==="light"&&!("light"in i))&&(Q=!0),!Q)throw new Error(pr(21,S));let k;d&&(k="oklch");const j=Zf(k,G,Q,v,S);_&&!G.light&&Zf(k,G,_,void 0,"light"),A&&!G.dark&&Zf(k,G,A,void 0,"dark");let L={defaultColorScheme:S,...j,cssVarPrefix:f,colorSchemeSelector:m,rootSelector:y,getCssVar:E,colorSchemes:G,font:{...LA(j.typography),...j.font},spacing:ew(v.spacing)};Object.keys(L.colorSchemes).forEach(at=>{const C=L.colorSchemes[at].palette,it=ct=>{const U=ct.split("-"),tt=U[1],ot=U[2];return E(ct,C[tt][ot])};C.mode==="light"&&(P(C.common,"background","#fff"),P(C.common,"onBackground","#000")),C.mode==="dark"&&(P(C.common,"background","#000"),P(C.common,"onBackground","#fff"));function W(ct,U,tt){if(k){let ot;return ct===lr&&(ot=`transparent ${((1-tt)*100).toFixed(0)}%`),ct===Ut&&(ot=`#000 ${(tt*100).toFixed(0)}%`),ct===Ht&&(ot=`#fff ${(tt*100).toFixed(0)}%`),`color-mix(in ${k}, ${U}, ${ot})`}return ct(U,tt)}if(tw(C,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),C.mode==="light"){P(C.Alert,"errorColor",W(Ut,C.error.light,.6)),P(C.Alert,"infoColor",W(Ut,C.info.light,.6)),P(C.Alert,"successColor",W(Ut,C.success.light,.6)),P(C.Alert,"warningColor",W(Ut,C.warning.light,.6)),P(C.Alert,"errorFilledBg",it("palette-error-main")),P(C.Alert,"infoFilledBg",it("palette-info-main")),P(C.Alert,"successFilledBg",it("palette-success-main")),P(C.Alert,"warningFilledBg",it("palette-warning-main")),P(C.Alert,"errorFilledColor",zn(()=>C.getContrastText(C.error.main))),P(C.Alert,"infoFilledColor",zn(()=>C.getContrastText(C.info.main))),P(C.Alert,"successFilledColor",zn(()=>C.getContrastText(C.success.main))),P(C.Alert,"warningFilledColor",zn(()=>C.getContrastText(C.warning.main))),P(C.Alert,"errorStandardBg",W(Ht,C.error.light,.9)),P(C.Alert,"infoStandardBg",W(Ht,C.info.light,.9)),P(C.Alert,"successStandardBg",W(Ht,C.success.light,.9)),P(C.Alert,"warningStandardBg",W(Ht,C.warning.light,.9)),P(C.Alert,"errorIconColor",it("palette-error-main")),P(C.Alert,"infoIconColor",it("palette-info-main")),P(C.Alert,"successIconColor",it("palette-success-main")),P(C.Alert,"warningIconColor",it("palette-warning-main")),P(C.AppBar,"defaultBg",it("palette-grey-100")),P(C.Avatar,"defaultBg",it("palette-grey-400")),P(C.Button,"inheritContainedBg",it("palette-grey-300")),P(C.Button,"inheritContainedHoverBg",it("palette-grey-A100")),P(C.Chip,"defaultBorder",it("palette-grey-400")),P(C.Chip,"defaultAvatarColor",it("palette-grey-700")),P(C.Chip,"defaultIconColor",it("palette-grey-700")),P(C.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),P(C.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),P(C.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),P(C.LinearProgress,"primaryBg",W(Ht,C.primary.main,.62)),P(C.LinearProgress,"secondaryBg",W(Ht,C.secondary.main,.62)),P(C.LinearProgress,"errorBg",W(Ht,C.error.main,.62)),P(C.LinearProgress,"infoBg",W(Ht,C.info.main,.62)),P(C.LinearProgress,"successBg",W(Ht,C.success.main,.62)),P(C.LinearProgress,"warningBg",W(Ht,C.warning.main,.62)),P(C.Skeleton,"bg",k?W(lr,C.text.primary,.11):`rgba(${it("palette-text-primaryChannel")} / 0.11)`),P(C.Slider,"primaryTrack",W(Ht,C.primary.main,.62)),P(C.Slider,"secondaryTrack",W(Ht,C.secondary.main,.62)),P(C.Slider,"errorTrack",W(Ht,C.error.main,.62)),P(C.Slider,"infoTrack",W(Ht,C.info.main,.62)),P(C.Slider,"successTrack",W(Ht,C.success.main,.62)),P(C.Slider,"warningTrack",W(Ht,C.warning.main,.62));const ct=k?W(Ut,C.background.default,.6825):vo(C.background.default,.8);P(C.SnackbarContent,"bg",ct),P(C.SnackbarContent,"color",zn(()=>k?pd.text.primary:C.getContrastText(ct))),P(C.SpeedDialAction,"fabHoverBg",vo(C.background.paper,.15)),P(C.StepConnector,"border",it("palette-grey-400")),P(C.StepContent,"border",it("palette-grey-400")),P(C.Switch,"defaultColor",it("palette-common-white")),P(C.Switch,"defaultDisabledColor",it("palette-grey-100")),P(C.Switch,"primaryDisabledColor",W(Ht,C.primary.main,.62)),P(C.Switch,"secondaryDisabledColor",W(Ht,C.secondary.main,.62)),P(C.Switch,"errorDisabledColor",W(Ht,C.error.main,.62)),P(C.Switch,"infoDisabledColor",W(Ht,C.info.main,.62)),P(C.Switch,"successDisabledColor",W(Ht,C.success.main,.62)),P(C.Switch,"warningDisabledColor",W(Ht,C.warning.main,.62)),P(C.TableCell,"border",W(Ht,W(lr,C.divider,1),.88)),P(C.Tooltip,"bg",W(lr,C.grey[700],.92))}if(C.mode==="dark"){P(C.Alert,"errorColor",W(Ht,C.error.light,.6)),P(C.Alert,"infoColor",W(Ht,C.info.light,.6)),P(C.Alert,"successColor",W(Ht,C.success.light,.6)),P(C.Alert,"warningColor",W(Ht,C.warning.light,.6)),P(C.Alert,"errorFilledBg",it("palette-error-dark")),P(C.Alert,"infoFilledBg",it("palette-info-dark")),P(C.Alert,"successFilledBg",it("palette-success-dark")),P(C.Alert,"warningFilledBg",it("palette-warning-dark")),P(C.Alert,"errorFilledColor",zn(()=>C.getContrastText(C.error.dark))),P(C.Alert,"infoFilledColor",zn(()=>C.getContrastText(C.info.dark))),P(C.Alert,"successFilledColor",zn(()=>C.getContrastText(C.success.dark))),P(C.Alert,"warningFilledColor",zn(()=>C.getContrastText(C.warning.dark))),P(C.Alert,"errorStandardBg",W(Ut,C.error.light,.9)),P(C.Alert,"infoStandardBg",W(Ut,C.info.light,.9)),P(C.Alert,"successStandardBg",W(Ut,C.success.light,.9)),P(C.Alert,"warningStandardBg",W(Ut,C.warning.light,.9)),P(C.Alert,"errorIconColor",it("palette-error-main")),P(C.Alert,"infoIconColor",it("palette-info-main")),P(C.Alert,"successIconColor",it("palette-success-main")),P(C.Alert,"warningIconColor",it("palette-warning-main")),P(C.AppBar,"defaultBg",it("palette-grey-900")),P(C.AppBar,"darkBg",it("palette-background-paper")),P(C.AppBar,"darkColor",it("palette-text-primary")),P(C.Avatar,"defaultBg",it("palette-grey-600")),P(C.Button,"inheritContainedBg",it("palette-grey-800")),P(C.Button,"inheritContainedHoverBg",it("palette-grey-700")),P(C.Chip,"defaultBorder",it("palette-grey-700")),P(C.Chip,"defaultAvatarColor",it("palette-grey-300")),P(C.Chip,"defaultIconColor",it("palette-grey-300")),P(C.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),P(C.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),P(C.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),P(C.LinearProgress,"primaryBg",W(Ut,C.primary.main,.5)),P(C.LinearProgress,"secondaryBg",W(Ut,C.secondary.main,.5)),P(C.LinearProgress,"errorBg",W(Ut,C.error.main,.5)),P(C.LinearProgress,"infoBg",W(Ut,C.info.main,.5)),P(C.LinearProgress,"successBg",W(Ut,C.success.main,.5)),P(C.LinearProgress,"warningBg",W(Ut,C.warning.main,.5)),P(C.Skeleton,"bg",k?W(lr,C.text.primary,.13):`rgba(${it("palette-text-primaryChannel")} / 0.13)`),P(C.Slider,"primaryTrack",W(Ut,C.primary.main,.5)),P(C.Slider,"secondaryTrack",W(Ut,C.secondary.main,.5)),P(C.Slider,"errorTrack",W(Ut,C.error.main,.5)),P(C.Slider,"infoTrack",W(Ut,C.info.main,.5)),P(C.Slider,"successTrack",W(Ut,C.success.main,.5)),P(C.Slider,"warningTrack",W(Ut,C.warning.main,.5));const ct=k?W(Ht,C.background.default,.985):vo(C.background.default,.98);P(C.SnackbarContent,"bg",ct),P(C.SnackbarContent,"color",zn(()=>k?tS.text.primary:C.getContrastText(ct))),P(C.SpeedDialAction,"fabHoverBg",vo(C.background.paper,.15)),P(C.StepConnector,"border",it("palette-grey-600")),P(C.StepContent,"border",it("palette-grey-600")),P(C.Switch,"defaultColor",it("palette-grey-300")),P(C.Switch,"defaultDisabledColor",it("palette-grey-600")),P(C.Switch,"primaryDisabledColor",W(Ut,C.primary.main,.55)),P(C.Switch,"secondaryDisabledColor",W(Ut,C.secondary.main,.55)),P(C.Switch,"errorDisabledColor",W(Ut,C.error.main,.55)),P(C.Switch,"infoDisabledColor",W(Ut,C.info.main,.55)),P(C.Switch,"successDisabledColor",W(Ut,C.success.main,.55)),P(C.Switch,"warningDisabledColor",W(Ut,C.warning.main,.55)),P(C.TableCell,"border",W(Ut,W(lr,C.divider,1),.68)),P(C.Tooltip,"bg",W(lr,C.grey[700],.92))}ea(C.background,"default"),ea(C.background,"paper"),ea(C.common,"background"),ea(C.common,"onBackground"),ea(C,"divider"),Object.keys(C).forEach(ct=>{const U=C[ct];ct!=="tonalOffset"&&U&&typeof U=="object"&&(U.main&&P(C[ct],"mainChannel",Sl(bl(U.main))),U.light&&P(C[ct],"lightChannel",Sl(bl(U.light))),U.dark&&P(C[ct],"darkChannel",Sl(bl(U.dark))),U.contrastText&&P(C[ct],"contrastTextChannel",Sl(bl(U.contrastText))),ct==="text"&&(ea(C[ct],"primary"),ea(C[ct],"secondary")),ct==="action"&&(U.active&&ea(C[ct],"active"),U.selected&&ea(C[ct],"selected")))})}),L=a.reduce((at,C)=>nn(at,C),L);const Y={prefix:f,disableCssColorScheme:o,shouldSkipGeneratingVar:h,getSelector:WA(L),enableContrastVars:d},{vars:F,generateThemeVars:I,generateStyleSheets:nt}=EA(L,Y);return L.vars=F,Object.entries(L.colorSchemes[L.defaultColorScheme]).forEach(([at,C])=>{L[at]=C}),L.generateThemeVars=I,L.generateStyleSheets=nt,L.generateSpacing=function(){return Gv(v.spacing,Yd(this))},L.getColorSchemeSelector=xA(m),L.spacing=L.generateSpacing(),L.shouldSkipGeneratingVar=h,L.unstable_sxConfig={...$l,...v?.unstable_sxConfig},L.unstable_sx=function(C){return Pl({sx:C,theme:this})},L.toRuntimeSource=aS,L}function y0(e,a,i){e.colorSchemes&&i&&(e.colorSchemes[a]={...i!==!0&&i,palette:Zd({...i===!0?{}:i.palette,mode:a})})}function Jd(e={},...a){const{palette:i,cssVariables:s=!1,colorSchemes:o=i?void 0:{light:!0},defaultColorScheme:f=i?.mode,...d}=e,h=f||"light",m=o?.[h],y={...o,...i?{[h]:{...typeof m!="boolean"&&m,palette:i}}:void 0};if(s===!1){if(!("colorSchemes"in e))return gd(e,...a);let v=i;"palette"in e||y[h]&&(y[h]!==!0?v=y[h].palette:h==="dark"&&(v={mode:"dark"}));const g=gd({...e,palette:v},...a);return g.defaultColorScheme=h,g.colorSchemes=y,g.palette.mode==="light"&&(g.colorSchemes.light={...y.light!==!0&&y.light,palette:g.palette},y0(g,"dark",y.dark)),g.palette.mode==="dark"&&(g.colorSchemes.dark={...y.dark!==!0&&y.dark,palette:g.palette},y0(g,"light",y.light)),g}return!i&&!("light"in y)&&h==="light"&&(y.light=!0),aw({...d,colorSchemes:y,defaultColorScheme:h,...typeof s!="boolean"&&s},...a)}const rw=Jd();function iw({theme:e,...a}){const i=dr in e?e[dr]:void 0;return K.jsx(Jv,{...a,themeId:i?dr:void 0,theme:i||e})}const So={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:lw}=bA({themeId:dr,theme:()=>Jd({cssVariables:!0}),colorSchemeStorageKey:So.colorSchemeStorageKey,modeStorageKey:So.modeStorageKey,defaultColorScheme:{light:So.defaultLightColorScheme,dark:So.defaultDarkColorScheme},resolveTheme:e=>{const a={...e,typography:nS(e.palette,e.typography)};return a.unstable_sx=function(s){return Pl({sx:s,theme:this})},a}}),sw=lw;function ow({theme:e,...a}){const i=J.useMemo(()=>{if(typeof e=="function")return e;const s=dr in e?e[dr]:e;return"colorSchemes"in s?null:"vars"in s?e:{...e,vars:null}},[e]);return i?K.jsx(iw,{theme:i,...a}):K.jsx(sw,{theme:e,...a})}function uw(e){return K.jsx(Yv,{...e,defaultTheme:rw,themeId:dr})}function lS(e){return function(i){return K.jsx(uw,{styles:typeof e=="function"?s=>e({theme:s,...i}):e})}}function Vw(){return XR}function cw(e){return oA(e)}const vd=typeof lS({})=="function",fw=(e,a)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...a&&!e.vars&&{colorScheme:e.palette.mode}}),dw=e=>({color:(e.vars||e).palette.text.primary,...e.typography.body1,backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),sS=(e,a=!1)=>{const i={};a&&e.colorSchemes&&typeof e.getColorSchemeSelector=="function"&&Object.entries(e.colorSchemes).forEach(([f,d])=>{const h=e.getColorSchemeSelector(f);h.startsWith("@")?i[h]={":root":{colorScheme:d.palette?.mode}}:i[h.replace(/\s*&/,"")]={colorScheme:d.palette?.mode}});let s={html:fw(e,a),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...dw(e),"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}},...i};const o=e.components?.MuiCssBaseline?.styleOverrides;return o&&(s=[s,o]),s},Ao="mui-ecs",hw=e=>{const a=sS(e,!1),i=Array.isArray(a)?a[0]:a;return!e.vars&&i&&(i.html[`:root:has(${Ao})`]={colorScheme:e.palette.mode}),e.colorSchemes&&Object.entries(e.colorSchemes).forEach(([s,o])=>{const f=e.getColorSchemeSelector(s);f.startsWith("@")?i[f]={[`:root:not(:has(.${Ao}))`]:{colorScheme:o.palette?.mode}}:i[f.replace(/\s*&/,"")]={[`&:not(:has(.${Ao}))`]:{colorScheme:o.palette?.mode}}}),a},mw=lS(vd?({theme:e,enableColorScheme:a})=>sS(e,a):({theme:e})=>hw(e));function yw(e){const a=cw({props:e,name:"MuiCssBaseline"}),{children:i,enableColorScheme:s=!1}=a;return K.jsxs(J.Fragment,{children:[vd&&K.jsx(mw,{enableColorScheme:s}),!vd&&!s&&K.jsx("span",{className:Ao,style:{display:"none"}}),i]})}const pw="/assets/index-DcK8FECE.css",gw=Jd({typography:{fontFamily:"'Roboto Variable', sans-serif"}}),oS=DT()({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"Mobileboost CLI"}],links:[{rel:"stylesheet",href:pw}]}),shellComponent:vw});function vw(){return K.jsx(bw,{children:K.jsx(fv,{})})}function Sw({children:e}){const a=Mv({key:"css"});return K.jsx(zx,{value:a,children:K.jsxs(ow,{theme:gw,children:[K.jsx(yw,{}),e]})})}function bw({children:e}){return K.jsxs("html",{children:[K.jsx("head",{children:K.jsx(ZT,{})}),K.jsxs("body",{children:[K.jsx(Sw,{children:e}),K.jsx(IT,{})]})]})}const _w="modulepreload",Cw=function(e){return"/"+e},p0={},Tw=function(a,i,s){let o=Promise.resolve();if(i&&i.length>0){let m=function(y){return Promise.all(y.map(v=>Promise.resolve(v).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=d?.nonce||d?.getAttribute("nonce");o=m(i.map(y=>{if(y=Cw(y),y in p0)return;p0[y]=!0;const v=y.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${g}`))return;const S=document.createElement("link");if(S.rel=v?"stylesheet":_w,v||(S.as="script"),S.crossOrigin="",S.href=y,h&&S.setAttribute("nonce",h),document.head.appendChild(S),v)return new Promise((E,R)=>{S.addEventListener("load",E),S.addEventListener("error",()=>R(new Error(`Unable to preload CSS for ${y}`)))})}))}function f(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return o.then(d=>{for(const h of d||[])h.status==="rejected"&&f(h.reason);return a().catch(f)})},Ew=()=>Tw(()=>import("./index-Bu1akwRM.js"),[]),xw=nd("/")({component:BT(Ew,"component")}),Rw=xw.update({id:"/",path:"/",getParentRoute:()=>oS}),Aw={IndexRoute:Rw},ww=oS._addFileChildren(Aw);function Ow({error:e}){const a=ge(),i=Tn({strict:!1,select:s=>s.id===ke});return console.error(e),K.jsxs("div",{className:"min-w-0 flex-1 p-4 flex flex-col items-center justify-center gap-6",children:[K.jsx(kl,{error:e}),K.jsxs("div",{className:"flex gap-2 items-center flex-wrap",children:[K.jsx("button",{onClick:()=>{a.invalidate()},className:"px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold",children:"Try Again"}),i?K.jsx(Ml,{to:"/",className:"px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold",children:"Home"}):K.jsx(Ml,{to:"/",className:"px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold",onClick:s=>{s.preventDefault(),window.history.back()},children:"Go Back"})]})]})}function Mw({children:e}){return K.jsxs("div",{className:"space-y-2 p-2",children:[K.jsx("div",{className:"text-gray-600 dark:text-gray-400",children:e||K.jsx("p",{children:"The page you are looking for does not exist."})}),K.jsxs("p",{className:"flex items-center gap-2 flex-wrap",children:[K.jsx("button",{onClick:()=>window.history.back(),className:"bg-emerald-500 text-white px-2 py-1 rounded-sm uppercase font-black text-sm",children:"Go back"}),K.jsx(Ml,{to:"/",className:"bg-cyan-600 text-white px-2 py-1 rounded-sm uppercase font-black text-sm",children:"Start Over"})]})]})}function zw(){const e=new QE,a=VT({routeTree:ww,context:{queryClient:e},defaultPreload:"intent",defaultErrorComponent:Ow,defaultNotFoundComponent:()=>K.jsx(Mw,{})});return PE({router:a,queryClient:e}),a}async function Dw(){const e=await zw();let a;return a=[],window.__TSS_START_OPTIONS__={serializationAdapters:a},a.push(cE),e.options.serializationAdapters&&a.push(...e.options.serializationAdapters),e.update({basepath:"",serializationAdapters:a}),e.state.matches.length||await tE(e),e}let Jf;function Lw(){return Jf||(Jf=Dw()),K.jsx(sT,{promise:Jf,children:e=>K.jsx(KT,{router:e})})}J.startTransition(()=>{B1.hydrateRoot(document,K.jsx(J.StrictMode,{children:K.jsx(Lw,{})}))});export{qe as $,Qw as A,na as B,rw as C,cw as D,kv as E,$v as F,Nw as G,GA as H,Kv as I,XA as J,qw as K,Ux as L,fA as M,Vw as N,ov as O,Yw as P,lS as Q,yi as R,Ko as S,dr as T,pr as U,Jd as V,md as W,nn as X,tA as Y,Ul as Z,fd as _,ld as a,q1 as a0,hd as a1,jw as a2,rE as a3,tn as a4,Ge as a5,uE as a6,vT as a7,yE as b,id as c,jE as d,bE as e,pv as f,Me as g,zl as h,Xo as i,kE as j,J as k,Hw as l,Gw as m,Oe as n,Pl as o,EE as p,PR as q,gE as r,Uw as s,pE as t,kw as u,XR as v,K as w,FR as x,Kx as y,Qv as z};
51
+ export default theme;`}function m0(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const PA=e=>{if(!Number.isNaN(+e))return+e;const a=e.match(/\d*\.?\d+/g);if(!a)return 0;let i=0;for(let s=0;s<a.length;s+=1)i+=+a[s];return i};function KA(e){Object.assign(e,{alpha(a,i){const s=this||e;return s.colorSpace?`oklch(from ${a} l c h / ${typeof i=="string"?`calc(${i})`:i})`:s.vars?`rgba(${a.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof i=="string"?`calc(${i})`:i})`:Kv(a,PA(i))},lighten(a,i){const s=this||e;return s.colorSpace?`color-mix(in ${s.colorSpace}, ${a}, #fff ${m0(i)})`:su(a,i)},darken(a,i){const s=this||e;return s.colorSpace?`color-mix(in ${s.colorSpace}, ${a}, #000 ${m0(i)})`:lu(a,i)}})}function gd(e={},...a){const{breakpoints:i,mixins:s={},spacing:o,palette:f={},transitions:d={},typography:h={},shape:m,colorSpace:y,...v}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(pr(20));const g=Zd({...f,colorSpace:y}),S=Qv(e);let E=nn(S,{mixins:NA(S.breakpoints,s),palette:g,shadows:kA.slice(),typography:nS(g,h),transitions:YA(d),zIndex:{...VA}});return E=nn(E,v),E=a.reduce((R,_)=>nn(R,_),E),E.unstable_sxConfig={...$l,...v?.unstable_sxConfig},E.unstable_sx=function(_){return Pl({sx:_,theme:this})},E.toRuntimeSource=aS,KA(E),E}function XA(e){let a;return e<1?a=5.11916*e**2:a=4.5*Math.log(e+1)+2,Math.round(a*10)/1e3}const FA=[...Array(25)].map((e,a)=>{if(a===0)return"none";const i=XA(a);return`linear-gradient(rgba(255 255 255 / ${i}), rgba(255 255 255 / ${i}))`});function rS(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function iS(e){return e==="dark"?FA:[]}function ZA(e){const{palette:a={mode:"light"},opacity:i,overlays:s,colorSpace:o,...f}=e,d=Zd({...a,colorSpace:o});return{palette:d,opacity:{...rS(d.mode),...i},overlays:s||iS(d.mode),...f}}function JA(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const IA=e=>[...[...Array(25)].map((a,i)=>`--${e?`${e}-`:""}overlays-${i}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],WA=e=>(a,i)=>{const s=e.rootSelector||":root",o=e.colorSchemeSelector;let f=o;if(o==="class"&&(f=".%s"),o==="data"&&(f="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(f=`[${o}="%s"]`),e.defaultColorScheme===a){if(a==="dark"){const d={};return IA(e.cssVarPrefix).forEach(h=>{d[h]=i[h],delete i[h]}),f==="media"?{[s]:i,"@media (prefers-color-scheme: dark)":{[s]:d}}:f?{[f.replace("%s",a)]:d,[`${s}, ${f.replace("%s",a)}`]:i}:{[s]:{...i,...d}}}if(f&&f!=="media")return`${s}, ${f.replace("%s",String(a))}`}else if(a){if(f==="media")return{[`@media (prefers-color-scheme: ${String(a)})`]:{[s]:i}};if(f)return f.replace("%s",String(a))}return s};function tw(e,a){a.forEach(i=>{e[i]||(e[i]={})})}function P(e,a,i){!e[a]&&i&&(e[a]=i)}function bl(e){return typeof e!="string"||!e.startsWith("hsl")?e:Pv(e)}function ea(e,a){`${a}Channel`in e||(e[`${a}Channel`]=Sl(bl(e[a])))}function ew(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const zn=e=>{try{return e()}catch{}},nw=(e="mui")=>_A(e);function Zf(e,a,i,s,o){if(!i)return;i=i===!0?{}:i;const f=o==="dark"?"dark":"light";if(!s){a[o]=ZA({...i,palette:{mode:f,...i?.palette},colorSpace:e});return}const{palette:d,...h}=gd({...s,palette:{mode:f,...i?.palette},colorSpace:e});return a[o]={...i,palette:d,opacity:{...rS(f),...i?.opacity},overlays:i?.overlays||iS(f)},h}function aw(e={},...a){const{colorSchemes:i={light:!0},defaultColorScheme:s,disableCssColorScheme:o=!1,cssVarPrefix:f="mui",nativeColor:d=!1,shouldSkipGeneratingVar:h=JA,colorSchemeSelector:m=i.light&&i.dark?"media":void 0,rootSelector:y=":root",...v}=e,g=Object.keys(i)[0],S=s||(i.light&&g!=="light"?"light":g),E=nw(f),{[S]:R,light:_,dark:A,...z}=i,G={...z};let Q=R;if((S==="dark"&&!("dark"in i)||S==="light"&&!("light"in i))&&(Q=!0),!Q)throw new Error(pr(21,S));let k;d&&(k="oklch");const j=Zf(k,G,Q,v,S);_&&!G.light&&Zf(k,G,_,void 0,"light"),A&&!G.dark&&Zf(k,G,A,void 0,"dark");let L={defaultColorScheme:S,...j,cssVarPrefix:f,colorSchemeSelector:m,rootSelector:y,getCssVar:E,colorSchemes:G,font:{...LA(j.typography),...j.font},spacing:ew(v.spacing)};Object.keys(L.colorSchemes).forEach(at=>{const C=L.colorSchemes[at].palette,it=ct=>{const U=ct.split("-"),tt=U[1],ot=U[2];return E(ct,C[tt][ot])};C.mode==="light"&&(P(C.common,"background","#fff"),P(C.common,"onBackground","#000")),C.mode==="dark"&&(P(C.common,"background","#000"),P(C.common,"onBackground","#fff"));function W(ct,U,tt){if(k){let ot;return ct===lr&&(ot=`transparent ${((1-tt)*100).toFixed(0)}%`),ct===Ut&&(ot=`#000 ${(tt*100).toFixed(0)}%`),ct===Ht&&(ot=`#fff ${(tt*100).toFixed(0)}%`),`color-mix(in ${k}, ${U}, ${ot})`}return ct(U,tt)}if(tw(C,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),C.mode==="light"){P(C.Alert,"errorColor",W(Ut,C.error.light,.6)),P(C.Alert,"infoColor",W(Ut,C.info.light,.6)),P(C.Alert,"successColor",W(Ut,C.success.light,.6)),P(C.Alert,"warningColor",W(Ut,C.warning.light,.6)),P(C.Alert,"errorFilledBg",it("palette-error-main")),P(C.Alert,"infoFilledBg",it("palette-info-main")),P(C.Alert,"successFilledBg",it("palette-success-main")),P(C.Alert,"warningFilledBg",it("palette-warning-main")),P(C.Alert,"errorFilledColor",zn(()=>C.getContrastText(C.error.main))),P(C.Alert,"infoFilledColor",zn(()=>C.getContrastText(C.info.main))),P(C.Alert,"successFilledColor",zn(()=>C.getContrastText(C.success.main))),P(C.Alert,"warningFilledColor",zn(()=>C.getContrastText(C.warning.main))),P(C.Alert,"errorStandardBg",W(Ht,C.error.light,.9)),P(C.Alert,"infoStandardBg",W(Ht,C.info.light,.9)),P(C.Alert,"successStandardBg",W(Ht,C.success.light,.9)),P(C.Alert,"warningStandardBg",W(Ht,C.warning.light,.9)),P(C.Alert,"errorIconColor",it("palette-error-main")),P(C.Alert,"infoIconColor",it("palette-info-main")),P(C.Alert,"successIconColor",it("palette-success-main")),P(C.Alert,"warningIconColor",it("palette-warning-main")),P(C.AppBar,"defaultBg",it("palette-grey-100")),P(C.Avatar,"defaultBg",it("palette-grey-400")),P(C.Button,"inheritContainedBg",it("palette-grey-300")),P(C.Button,"inheritContainedHoverBg",it("palette-grey-A100")),P(C.Chip,"defaultBorder",it("palette-grey-400")),P(C.Chip,"defaultAvatarColor",it("palette-grey-700")),P(C.Chip,"defaultIconColor",it("palette-grey-700")),P(C.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),P(C.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),P(C.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),P(C.LinearProgress,"primaryBg",W(Ht,C.primary.main,.62)),P(C.LinearProgress,"secondaryBg",W(Ht,C.secondary.main,.62)),P(C.LinearProgress,"errorBg",W(Ht,C.error.main,.62)),P(C.LinearProgress,"infoBg",W(Ht,C.info.main,.62)),P(C.LinearProgress,"successBg",W(Ht,C.success.main,.62)),P(C.LinearProgress,"warningBg",W(Ht,C.warning.main,.62)),P(C.Skeleton,"bg",k?W(lr,C.text.primary,.11):`rgba(${it("palette-text-primaryChannel")} / 0.11)`),P(C.Slider,"primaryTrack",W(Ht,C.primary.main,.62)),P(C.Slider,"secondaryTrack",W(Ht,C.secondary.main,.62)),P(C.Slider,"errorTrack",W(Ht,C.error.main,.62)),P(C.Slider,"infoTrack",W(Ht,C.info.main,.62)),P(C.Slider,"successTrack",W(Ht,C.success.main,.62)),P(C.Slider,"warningTrack",W(Ht,C.warning.main,.62));const ct=k?W(Ut,C.background.default,.6825):vo(C.background.default,.8);P(C.SnackbarContent,"bg",ct),P(C.SnackbarContent,"color",zn(()=>k?pd.text.primary:C.getContrastText(ct))),P(C.SpeedDialAction,"fabHoverBg",vo(C.background.paper,.15)),P(C.StepConnector,"border",it("palette-grey-400")),P(C.StepContent,"border",it("palette-grey-400")),P(C.Switch,"defaultColor",it("palette-common-white")),P(C.Switch,"defaultDisabledColor",it("palette-grey-100")),P(C.Switch,"primaryDisabledColor",W(Ht,C.primary.main,.62)),P(C.Switch,"secondaryDisabledColor",W(Ht,C.secondary.main,.62)),P(C.Switch,"errorDisabledColor",W(Ht,C.error.main,.62)),P(C.Switch,"infoDisabledColor",W(Ht,C.info.main,.62)),P(C.Switch,"successDisabledColor",W(Ht,C.success.main,.62)),P(C.Switch,"warningDisabledColor",W(Ht,C.warning.main,.62)),P(C.TableCell,"border",W(Ht,W(lr,C.divider,1),.88)),P(C.Tooltip,"bg",W(lr,C.grey[700],.92))}if(C.mode==="dark"){P(C.Alert,"errorColor",W(Ht,C.error.light,.6)),P(C.Alert,"infoColor",W(Ht,C.info.light,.6)),P(C.Alert,"successColor",W(Ht,C.success.light,.6)),P(C.Alert,"warningColor",W(Ht,C.warning.light,.6)),P(C.Alert,"errorFilledBg",it("palette-error-dark")),P(C.Alert,"infoFilledBg",it("palette-info-dark")),P(C.Alert,"successFilledBg",it("palette-success-dark")),P(C.Alert,"warningFilledBg",it("palette-warning-dark")),P(C.Alert,"errorFilledColor",zn(()=>C.getContrastText(C.error.dark))),P(C.Alert,"infoFilledColor",zn(()=>C.getContrastText(C.info.dark))),P(C.Alert,"successFilledColor",zn(()=>C.getContrastText(C.success.dark))),P(C.Alert,"warningFilledColor",zn(()=>C.getContrastText(C.warning.dark))),P(C.Alert,"errorStandardBg",W(Ut,C.error.light,.9)),P(C.Alert,"infoStandardBg",W(Ut,C.info.light,.9)),P(C.Alert,"successStandardBg",W(Ut,C.success.light,.9)),P(C.Alert,"warningStandardBg",W(Ut,C.warning.light,.9)),P(C.Alert,"errorIconColor",it("palette-error-main")),P(C.Alert,"infoIconColor",it("palette-info-main")),P(C.Alert,"successIconColor",it("palette-success-main")),P(C.Alert,"warningIconColor",it("palette-warning-main")),P(C.AppBar,"defaultBg",it("palette-grey-900")),P(C.AppBar,"darkBg",it("palette-background-paper")),P(C.AppBar,"darkColor",it("palette-text-primary")),P(C.Avatar,"defaultBg",it("palette-grey-600")),P(C.Button,"inheritContainedBg",it("palette-grey-800")),P(C.Button,"inheritContainedHoverBg",it("palette-grey-700")),P(C.Chip,"defaultBorder",it("palette-grey-700")),P(C.Chip,"defaultAvatarColor",it("palette-grey-300")),P(C.Chip,"defaultIconColor",it("palette-grey-300")),P(C.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),P(C.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),P(C.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),P(C.LinearProgress,"primaryBg",W(Ut,C.primary.main,.5)),P(C.LinearProgress,"secondaryBg",W(Ut,C.secondary.main,.5)),P(C.LinearProgress,"errorBg",W(Ut,C.error.main,.5)),P(C.LinearProgress,"infoBg",W(Ut,C.info.main,.5)),P(C.LinearProgress,"successBg",W(Ut,C.success.main,.5)),P(C.LinearProgress,"warningBg",W(Ut,C.warning.main,.5)),P(C.Skeleton,"bg",k?W(lr,C.text.primary,.13):`rgba(${it("palette-text-primaryChannel")} / 0.13)`),P(C.Slider,"primaryTrack",W(Ut,C.primary.main,.5)),P(C.Slider,"secondaryTrack",W(Ut,C.secondary.main,.5)),P(C.Slider,"errorTrack",W(Ut,C.error.main,.5)),P(C.Slider,"infoTrack",W(Ut,C.info.main,.5)),P(C.Slider,"successTrack",W(Ut,C.success.main,.5)),P(C.Slider,"warningTrack",W(Ut,C.warning.main,.5));const ct=k?W(Ht,C.background.default,.985):vo(C.background.default,.98);P(C.SnackbarContent,"bg",ct),P(C.SnackbarContent,"color",zn(()=>k?tS.text.primary:C.getContrastText(ct))),P(C.SpeedDialAction,"fabHoverBg",vo(C.background.paper,.15)),P(C.StepConnector,"border",it("palette-grey-600")),P(C.StepContent,"border",it("palette-grey-600")),P(C.Switch,"defaultColor",it("palette-grey-300")),P(C.Switch,"defaultDisabledColor",it("palette-grey-600")),P(C.Switch,"primaryDisabledColor",W(Ut,C.primary.main,.55)),P(C.Switch,"secondaryDisabledColor",W(Ut,C.secondary.main,.55)),P(C.Switch,"errorDisabledColor",W(Ut,C.error.main,.55)),P(C.Switch,"infoDisabledColor",W(Ut,C.info.main,.55)),P(C.Switch,"successDisabledColor",W(Ut,C.success.main,.55)),P(C.Switch,"warningDisabledColor",W(Ut,C.warning.main,.55)),P(C.TableCell,"border",W(Ut,W(lr,C.divider,1),.68)),P(C.Tooltip,"bg",W(lr,C.grey[700],.92))}ea(C.background,"default"),ea(C.background,"paper"),ea(C.common,"background"),ea(C.common,"onBackground"),ea(C,"divider"),Object.keys(C).forEach(ct=>{const U=C[ct];ct!=="tonalOffset"&&U&&typeof U=="object"&&(U.main&&P(C[ct],"mainChannel",Sl(bl(U.main))),U.light&&P(C[ct],"lightChannel",Sl(bl(U.light))),U.dark&&P(C[ct],"darkChannel",Sl(bl(U.dark))),U.contrastText&&P(C[ct],"contrastTextChannel",Sl(bl(U.contrastText))),ct==="text"&&(ea(C[ct],"primary"),ea(C[ct],"secondary")),ct==="action"&&(U.active&&ea(C[ct],"active"),U.selected&&ea(C[ct],"selected")))})}),L=a.reduce((at,C)=>nn(at,C),L);const Y={prefix:f,disableCssColorScheme:o,shouldSkipGeneratingVar:h,getSelector:WA(L),enableContrastVars:d},{vars:F,generateThemeVars:I,generateStyleSheets:nt}=EA(L,Y);return L.vars=F,Object.entries(L.colorSchemes[L.defaultColorScheme]).forEach(([at,C])=>{L[at]=C}),L.generateThemeVars=I,L.generateStyleSheets=nt,L.generateSpacing=function(){return Gv(v.spacing,Yd(this))},L.getColorSchemeSelector=xA(m),L.spacing=L.generateSpacing(),L.shouldSkipGeneratingVar=h,L.unstable_sxConfig={...$l,...v?.unstable_sxConfig},L.unstable_sx=function(C){return Pl({sx:C,theme:this})},L.toRuntimeSource=aS,L}function y0(e,a,i){e.colorSchemes&&i&&(e.colorSchemes[a]={...i!==!0&&i,palette:Zd({...i===!0?{}:i.palette,mode:a})})}function Jd(e={},...a){const{palette:i,cssVariables:s=!1,colorSchemes:o=i?void 0:{light:!0},defaultColorScheme:f=i?.mode,...d}=e,h=f||"light",m=o?.[h],y={...o,...i?{[h]:{...typeof m!="boolean"&&m,palette:i}}:void 0};if(s===!1){if(!("colorSchemes"in e))return gd(e,...a);let v=i;"palette"in e||y[h]&&(y[h]!==!0?v=y[h].palette:h==="dark"&&(v={mode:"dark"}));const g=gd({...e,palette:v},...a);return g.defaultColorScheme=h,g.colorSchemes=y,g.palette.mode==="light"&&(g.colorSchemes.light={...y.light!==!0&&y.light,palette:g.palette},y0(g,"dark",y.dark)),g.palette.mode==="dark"&&(g.colorSchemes.dark={...y.dark!==!0&&y.dark,palette:g.palette},y0(g,"light",y.light)),g}return!i&&!("light"in y)&&h==="light"&&(y.light=!0),aw({...d,colorSchemes:y,defaultColorScheme:h,...typeof s!="boolean"&&s},...a)}const rw=Jd();function iw({theme:e,...a}){const i=dr in e?e[dr]:void 0;return K.jsx(Jv,{...a,themeId:i?dr:void 0,theme:i||e})}const So={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:lw}=bA({themeId:dr,theme:()=>Jd({cssVariables:!0}),colorSchemeStorageKey:So.colorSchemeStorageKey,modeStorageKey:So.modeStorageKey,defaultColorScheme:{light:So.defaultLightColorScheme,dark:So.defaultDarkColorScheme},resolveTheme:e=>{const a={...e,typography:nS(e.palette,e.typography)};return a.unstable_sx=function(s){return Pl({sx:s,theme:this})},a}}),sw=lw;function ow({theme:e,...a}){const i=J.useMemo(()=>{if(typeof e=="function")return e;const s=dr in e?e[dr]:e;return"colorSchemes"in s?null:"vars"in s?e:{...e,vars:null}},[e]);return i?K.jsx(iw,{theme:i,...a}):K.jsx(sw,{theme:e,...a})}function uw(e){return K.jsx(Yv,{...e,defaultTheme:rw,themeId:dr})}function lS(e){return function(i){return K.jsx(uw,{styles:typeof e=="function"?s=>e({theme:s,...i}):e})}}function Vw(){return XR}function cw(e){return oA(e)}const vd=typeof lS({})=="function",fw=(e,a)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...a&&!e.vars&&{colorScheme:e.palette.mode}}),dw=e=>({color:(e.vars||e).palette.text.primary,...e.typography.body1,backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),sS=(e,a=!1)=>{const i={};a&&e.colorSchemes&&typeof e.getColorSchemeSelector=="function"&&Object.entries(e.colorSchemes).forEach(([f,d])=>{const h=e.getColorSchemeSelector(f);h.startsWith("@")?i[h]={":root":{colorScheme:d.palette?.mode}}:i[h.replace(/\s*&/,"")]={colorScheme:d.palette?.mode}});let s={html:fw(e,a),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...dw(e),"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}},...i};const o=e.components?.MuiCssBaseline?.styleOverrides;return o&&(s=[s,o]),s},Ao="mui-ecs",hw=e=>{const a=sS(e,!1),i=Array.isArray(a)?a[0]:a;return!e.vars&&i&&(i.html[`:root:has(${Ao})`]={colorScheme:e.palette.mode}),e.colorSchemes&&Object.entries(e.colorSchemes).forEach(([s,o])=>{const f=e.getColorSchemeSelector(s);f.startsWith("@")?i[f]={[`:root:not(:has(.${Ao}))`]:{colorScheme:o.palette?.mode}}:i[f.replace(/\s*&/,"")]={[`&:not(:has(.${Ao}))`]:{colorScheme:o.palette?.mode}}}),a},mw=lS(vd?({theme:e,enableColorScheme:a})=>sS(e,a):({theme:e})=>hw(e));function yw(e){const a=cw({props:e,name:"MuiCssBaseline"}),{children:i,enableColorScheme:s=!1}=a;return K.jsxs(J.Fragment,{children:[vd&&K.jsx(mw,{enableColorScheme:s}),!vd&&!s&&K.jsx("span",{className:Ao,style:{display:"none"}}),i]})}const pw="/assets/index-DcK8FECE.css",gw=Jd({typography:{fontFamily:"'Roboto Variable', sans-serif"}}),oS=DT()({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"Mobileboost CLI"}],links:[{rel:"stylesheet",href:pw}]}),shellComponent:vw});function vw(){return K.jsx(bw,{children:K.jsx(fv,{})})}function Sw({children:e}){const a=Mv({key:"css"});return K.jsx(zx,{value:a,children:K.jsxs(ow,{theme:gw,children:[K.jsx(yw,{}),e]})})}function bw({children:e}){return K.jsxs("html",{children:[K.jsx("head",{children:K.jsx(ZT,{})}),K.jsxs("body",{children:[K.jsx(Sw,{children:e}),K.jsx(IT,{})]})]})}const _w="modulepreload",Cw=function(e){return"/"+e},p0={},Tw=function(a,i,s){let o=Promise.resolve();if(i&&i.length>0){let m=function(y){return Promise.all(y.map(v=>Promise.resolve(v).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=d?.nonce||d?.getAttribute("nonce");o=m(i.map(y=>{if(y=Cw(y),y in p0)return;p0[y]=!0;const v=y.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${g}`))return;const S=document.createElement("link");if(S.rel=v?"stylesheet":_w,v||(S.as="script"),S.crossOrigin="",S.href=y,h&&S.setAttribute("nonce",h),document.head.appendChild(S),v)return new Promise((E,R)=>{S.addEventListener("load",E),S.addEventListener("error",()=>R(new Error(`Unable to preload CSS for ${y}`)))})}))}function f(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return o.then(d=>{for(const h of d||[])h.status==="rejected"&&f(h.reason);return a().catch(f)})},Ew=()=>Tw(()=>import("./index-B9xOUxIH.js"),[]),xw=nd("/")({component:BT(Ew,"component")}),Rw=xw.update({id:"/",path:"/",getParentRoute:()=>oS}),Aw={IndexRoute:Rw},ww=oS._addFileChildren(Aw);function Ow({error:e}){const a=ge(),i=Tn({strict:!1,select:s=>s.id===ke});return console.error(e),K.jsxs("div",{className:"min-w-0 flex-1 p-4 flex flex-col items-center justify-center gap-6",children:[K.jsx(kl,{error:e}),K.jsxs("div",{className:"flex gap-2 items-center flex-wrap",children:[K.jsx("button",{onClick:()=>{a.invalidate()},className:"px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold",children:"Try Again"}),i?K.jsx(Ml,{to:"/",className:"px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold",children:"Home"}):K.jsx(Ml,{to:"/",className:"px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold",onClick:s=>{s.preventDefault(),window.history.back()},children:"Go Back"})]})]})}function Mw({children:e}){return K.jsxs("div",{className:"space-y-2 p-2",children:[K.jsx("div",{className:"text-gray-600 dark:text-gray-400",children:e||K.jsx("p",{children:"The page you are looking for does not exist."})}),K.jsxs("p",{className:"flex items-center gap-2 flex-wrap",children:[K.jsx("button",{onClick:()=>window.history.back(),className:"bg-emerald-500 text-white px-2 py-1 rounded-sm uppercase font-black text-sm",children:"Go back"}),K.jsx(Ml,{to:"/",className:"bg-cyan-600 text-white px-2 py-1 rounded-sm uppercase font-black text-sm",children:"Start Over"})]})]})}function zw(){const e=new QE,a=VT({routeTree:ww,context:{queryClient:e},defaultPreload:"intent",defaultErrorComponent:Ow,defaultNotFoundComponent:()=>K.jsx(Mw,{})});return PE({router:a,queryClient:e}),a}async function Dw(){const e=await zw();let a;return a=[],window.__TSS_START_OPTIONS__={serializationAdapters:a},a.push(cE),e.options.serializationAdapters&&a.push(...e.options.serializationAdapters),e.update({basepath:"",serializationAdapters:a}),e.state.matches.length||await tE(e),e}let Jf;function Lw(){return Jf||(Jf=Dw()),K.jsx(sT,{promise:Jf,children:e=>K.jsx(KT,{router:e})})}J.startTransition(()=>{B1.hydrateRoot(document,K.jsx(J.StrictMode,{children:K.jsx(Lw,{})}))});export{qe as $,Qw as A,na as B,rw as C,cw as D,kv as E,$v as F,Nw as G,GA as H,Kv as I,XA as J,qw as K,Ux as L,fA as M,Vw as N,ov as O,Yw as P,lS as Q,yi as R,Ko as S,dr as T,pr as U,Jd as V,md as W,nn as X,tA as Y,Ul as Z,fd as _,ld as a,q1 as a0,hd as a1,jw as a2,rE as a3,tn as a4,Ge as a5,uE as a6,vT as a7,yE as b,id as c,jE as d,bE as e,pv as f,Me as g,zl as h,Xo as i,kE as j,J as k,Hw as l,Gw as m,Oe as n,Pl as o,EE as p,PR as q,gE as r,Uw as s,pE as t,kw as u,XR as v,K as w,FR as x,Kx as y,Qv as z};
@@ -1 +1 @@
1
- const s=()=>({routes:{__root__:{filePath:"/Users/ricpar11/Documents/mobileboost/mobileboost-cli/src/app/routes/__root.tsx",children:["/"],preloads:["/assets/main-BOWxdROu.js"],assets:[]},"/":{filePath:"/Users/ricpar11/Documents/mobileboost/mobileboost-cli/src/app/routes/index.tsx",assets:[],preloads:["/assets/index-Bu1akwRM.js"]}},clientEntry:"/assets/main-BOWxdROu.js"});export{s as tsrStartManifest};
1
+ const s=()=>({routes:{__root__:{filePath:"/Users/ricpar11/Documents/mobileboost/mobileboost-cli/src/app/routes/__root.tsx",children:["/"],preloads:["/assets/main-Dc24NDnw.js"],assets:[]},"/":{filePath:"/Users/ricpar11/Documents/mobileboost/mobileboost-cli/src/app/routes/index.tsx",assets:[],preloads:["/assets/index-B9xOUxIH.js"]}},clientEntry:"/assets/main-Dc24NDnw.js"});export{s as tsrStartManifest};
@@ -0,0 +1 @@
1
+ import{c as a,a as t}from"./server.mjs";import{x as p,r as f,u,l as S,S as _,d as b,b as h}from"./device-CWFVkH1s.mjs";import{performDeepLink as $,performScroll as l,getPageSource as g,performSwipe as x,performTap as y,performType as P,performZoom as v}from"./appium-client-Dxm_q6FS.mjs";import{V as w,N as F,X as T}from"./hierarchy-helpers-BaGN7WBn.mjs";import"@tanstack/history";import"@tanstack/router-core/ssr/client";import"@tanstack/router-core";import"node:async_hooks";import"@tanstack/router-core/ssr/server";import"../../index.mjs";import"node:http";import"node:stream";import"node:https";import"node:http2";import"node:fs";import"node:url";import"node:path";import"tiny-invariant";import"seroval";import"react/jsx-runtime";import"@tanstack/react-router/ssr/server";import"@tanstack/react-router";import"zod";import"./step-D2WQqd4J.mjs";import"webdriverio";import"xml2js";import"linkedom";const V=a("605c05774def700303f9889c0f8a28fed026e0b5c36a1563cff2835ee01d26b1",(e,r)=>O.__executeServer(e,r)),O=t({method:"POST"}).inputValidator(_).handler(V,async({data:e})=>(console.log(`Performing tap at ${e.x}, ${e.y}`),await y(e),{success:!0})),k=a("07e23aa87e88d53c6c9e3d8e88de788d27d7b10930150bc4fd510d4447aaf3de",(e,r)=>L.__executeServer(e,r)),L=t({method:"POST"}).inputValidator(b).handler(k,async({data:e})=>(console.log(`Performing type: "${e.text}"`),await P(e),{success:!0})),z=a("5c526b678a7596f28beca76784df0ac58acd292627c5770c0c8029e38e4681ec",(e,r)=>I.__executeServer(e,r)),I=t({method:"POST"}).inputValidator(f).handler(z,async({data:e})=>(console.log(`Performing scroll: ${e.direction}`),await l(e),{success:!0})),N=a("2b4a002699960d578addbcf4dd83fedcec62444d7da4bf7c2359be991ed6207e",(e,r)=>A.__executeServer(e,r)),A=t({method:"POST"}).inputValidator(S).handler(N,async({data:e})=>(console.log(`Performing swipe: ${e.x1},${e.y1} -> ${e.x2},${e.y2}`),await x(e),{success:!0})),D=a("10b616f4aacf11bb275166e4ae03f441f1d7c9a68a670dfadb03b74e1d012900",(e,r)=>U.__executeServer(e,r)),U=t({method:"POST"}).inputValidator(u).handler(D,async({data:e})=>{console.log(`Performing scroll until: text="${e.text}", id="${e.elementId}", dir=${e.direction}`);for(let r=0;r<(e.maxScrolls??15);r++){console.log(`Scroll Until Loop: ${r+1}/${e.maxScrolls}`);const m=await g(),d=await w(m);let i=d.hierarchy?.node?.[0];const n=d.hierarchy?.node;if(n){const c=n.find(s=>s.$&&s.$.package!=="com.android.systemui");c&&(i=c)}let o=!1;if(e.elementId&&F(i,e.elementId)&&(o=!0),!o&&e.text&&T(i,e.text)&&(o=!0),o)return console.log("Target found!"),{success:!0,scrolls:r};r<(e.maxScrolls??15)-1&&(await l({direction:e.direction}),await new Promise(c=>setTimeout(c,1e3)))}return console.log("Target NOT found after max scrolls"),{success:!1}}),Z=a("c23cd3196f54848abd64a8b8d4660d7826a70cf44169d7bf29fc82e74a2cf612",(e,r)=>B.__executeServer(e,r)),B=t({method:"POST"}).inputValidator(h).handler(Z,async({data:e})=>(console.log(`Performing zoom: ${e.direction}`),await v(e),{success:!0})),C=a("566ee4344553ab6300f847f5de346e037f92d986cb824ba1c313346e62345fbe",(e,r)=>E.__executeServer(e,r)),E=t({method:"POST"}).inputValidator(p).handler(C,async({data:e})=>(console.log(`Performing deep link: "${e.url}"`),await $(e.url),{success:!0}));export{C as deepLinkFn_createServerFn_handler,z as scrollFn_createServerFn_handler,D as scrollUntilFn_createServerFn_handler,N as swipeFn_createServerFn_handler,V as tapFn_createServerFn_handler,k as typeFn_createServerFn_handler,Z as zoomFn_createServerFn_handler};
@@ -0,0 +1 @@
1
+ import{c as o,a as i}from"./server.mjs";import{F as m,W as p}from"./ai-client-waGeh-P8.mjs";import"@tanstack/history";import"@tanstack/router-core/ssr/client";import"@tanstack/router-core";import"node:async_hooks";import"@tanstack/router-core/ssr/server";import"../../index.mjs";import"node:http";import"node:stream";import"node:https";import"node:http2";import"node:fs";import"node:url";import"node:path";import"tiny-invariant";import"seroval";import"react/jsx-runtime";import"@tanstack/react-router/ssr/server";import"@tanstack/react-router";import"zod";import"sharp";import"./constants-Dh9o88yr.mjs";const e=o("5918013064f9b88efb265b30a770275d6c9d52bf42318f451bab8a47bc850917",(t,r)=>a.__executeServer(t,r)),a=i({method:"POST"}).inputValidator(m).handler(e,async({data:t})=>await p(t));export{e as executeAgentStepFn_createServerFn_handler};
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import C from"node:fs";import v from"node:path";import $ from"sharp";import{R as r}from"./constants-Dh9o88yr.mjs";const N=e.object({fullImage:e.string(),croppedImage:e.string(),targetImage:e.string(),type:e.enum(["interaction","assert","tap"]).optional()}),P=e.object({base64_screenshot:e.string(),instruction:e.string(),action_history:e.array(e.any()).optional(),executionId:e.string().optional(),elementId:e.string().optional(),uiHierarchy:e.array(e.any()).optional()});function j(){const t=v.join(process.cwd(),"mobileboost.config.json");if(!C.existsSync(t))throw new Error('mobileboost.config.json not found. Run "mobileboost init" first.');const s=C.readFileSync(t,"utf-8");return JSON.parse(s)}function x(t){return t.replace(/^data:image\/\w+;base64,/,"")}async function F(t){const{fullImage:s,croppedImage:g,targetImage:u,type:f}=t,o=j().apiKey;if(!o)throw new Error("apiKey not configured in mobileboost.config.json");const c=f==="assert"?"assert":"interaction",l={org_id:o,full_image:x(s),cropped_image:x(g),target_image:x(u),type:c},n=await fetch("https://api.mobileboost.io/cli/describe_interaction",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!n.ok){const d=await n.text();throw new Error(`Describe interaction failed: ${n.status} ${d}`)}const i=await n.json();return i.description||i.assertion_description||JSON.stringify(i)}async function H(t){const s="https://api.mobileboost.io/call_lambda",g=j().apiKey;if(!g)throw new Error("apiKey not configured in mobileboost.config.json");const u=Buffer.from(t.base64_screenshot,"base64"),f=await $(u).metadata(),o=f.width??1080,c=f.height??1920,l=Math.round(o/r),n=await $(u).resize({width:l,withoutEnlargement:!0}).toBuffer(),i=await $(n).metadata(),d=i.width??l,h=i.height??c*(l/o),I=r,O=r;console.log(`[AI Client] Resized screenshot: ${o}x${c} -> ${d}x${h} (Scale: ${I.toFixed(2)})`);const S={lambda_flow:"get_next_step",current_date:new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),base64_screenshot:n.toString("base64"),getUI_elements:[],uiHierarchy:t.uiHierarchy??[],test_task_string:JSON.stringify([{id:"step-1",text:`1. ${t.instruction}`,plainText:t.instruction}]),image_width:d,image_height:h,action_history:t.action_history??[],orgKey:g,template_images:{},model_provider:"vellum",model_version:"claude-agent",fallbackModel:"claude-agent",utilize_fullTextAnnotation:!1,enableSortingOCR:!0,enableActionHistoryCut:!0,removeOverlappingText:!1,currentAndPreviousScreenMatch:!1,popupDetectionEnabled:!0,ocrProvider:"gcp",modelResponseDoubleCheckEnabled:!1,modelResponseDoubleCheckModel:"claude-3-5-sonnet-20240620"};console.log(`[AI Client] Sending payload with dimensions: ${d}x${h} (Original: ${o}x${c})`),console.log("[AI Client] Payload:",{payload:S});const a=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":"230948209348203948203948203948"},body:JSON.stringify(S)});if(!a.ok){const m=await a.text();throw console.error(`[AI Client] Backend error (${a.status}):`,m),new Error(`AI Backend Error: ${a.status} ${a.statusText}`)}const p=await a.json();console.log("[AI Client] Raw response from backend:",JSON.stringify(p,null,2)),console.log(`[AI Client] Applying scale factors: X=${I.toFixed(4)}, Y=${O.toFixed(4)}`);const k=m=>m.match(/([xy])=(\d+)/)?m.replace(/([xy])=(\d+)/g,(A,y,b)=>{const w=parseInt(b,10),_=Math.round(w*r);return`${y}=${_}`}):m.replace(/(^|;)(\d+);(\d+)(;|$)/,(A,y,b,w,_)=>{const E=parseInt(b,10),T=parseInt(w,10),z=Math.round(E*r),R=Math.round(T*r);return`${y}${z};${R}${_}`});return p.appetizeCommands&&(p.appetizeCommands=p.appetizeCommands.map(k)),p}export{P as F,F as K,N as P,H as W};
@@ -1 +1 @@
1
- import{c as a,a as o}from"./server.mjs";import{ensureAppiumSession as m}from"./appium-client-D-NjeB35.mjs";import{e as i}from"./device-8ONaG49P.mjs";import"@tanstack/history";import"@tanstack/router-core/ssr/client";import"@tanstack/router-core";import"node:async_hooks";import"@tanstack/router-core/ssr/server";import"../../index.mjs";import"node:http";import"node:stream";import"node:https";import"node:http2";import"node:fs";import"node:url";import"node:path";import"tiny-invariant";import"seroval";import"react/jsx-runtime";import"@tanstack/react-router/ssr/server";import"@tanstack/react-router";import"webdriverio";import"zod";import"./step-CEQtT3SD.mjs";const d=a("eea1073a910f7f023004366aafcef05a8c47a3a1a4a09721f71a2efe311ee70f",(r,e)=>c.__executeServer(r,e)),c=o({method:"POST"}).handler(d,async r=>{const{platform:e="android",deviceId:t}=i.parse(r.data);return await m(e,t),{success:!0}}),n=a("6dbdc2968dc27a948c345034d1e55082b86918953b61da020ea8dd5836c79db3",(r,e)=>s.__executeServer(r,e)),s=o({method:"GET"}).handler(n,async r=>{const{platform:e="android",deviceId:t}=i.parse(r.data),{isAppiumConnected:p}=await import("./appium-client-D-NjeB35.mjs");return{connected:p(e,t)}});export{n as getAppiumStatusFn_createServerFn_handler,d as startAppiumFn_createServerFn_handler};
1
+ import{c as a,a as o}from"./server.mjs";import{ensureAppiumSession as m}from"./appium-client-Dxm_q6FS.mjs";import{a as i}from"./device-CWFVkH1s.mjs";import"@tanstack/history";import"@tanstack/router-core/ssr/client";import"@tanstack/router-core";import"node:async_hooks";import"@tanstack/router-core/ssr/server";import"../../index.mjs";import"node:http";import"node:stream";import"node:https";import"node:http2";import"node:fs";import"node:url";import"node:path";import"tiny-invariant";import"seroval";import"react/jsx-runtime";import"@tanstack/react-router/ssr/server";import"@tanstack/react-router";import"webdriverio";import"zod";import"./step-D2WQqd4J.mjs";const d=a("eea1073a910f7f023004366aafcef05a8c47a3a1a4a09721f71a2efe311ee70f",(r,e)=>c.__executeServer(r,e)),c=o({method:"POST"}).handler(d,async r=>{const{platform:e="android",deviceId:t}=i.parse(r.data);return await m(e,t),{success:!0}}),n=a("6dbdc2968dc27a948c345034d1e55082b86918953b61da020ea8dd5836c79db3",(r,e)=>s.__executeServer(r,e)),s=o({method:"GET"}).handler(n,async r=>{const{platform:e="android",deviceId:t}=i.parse(r.data),{isAppiumConnected:p}=await import("./appium-client-Dxm_q6FS.mjs");return{connected:p(e,t)}});export{n as getAppiumStatusFn_createServerFn_handler,d as startAppiumFn_createServerFn_handler};
@@ -0,0 +1 @@
1
+ import{remote as g}from"webdriverio";let a=null;function x(e,t){return!(!a||a.platform!==e||t&&a.deviceId!==t)}function M(){return a?.platform??null}function I(){return a?.windowSize}async function m(){if(a){console.log("Invalidating current Appium session...");try{await a.client.deleteSession()}catch{}a=null}}async function $(){if(!a)return!1;try{const e=await a.client.getWindowRect();return typeof e.width=="number"&&typeof e.height=="number"}catch{return!1}}async function S(e=a?.platform??"android",t){const i=t??a?.deviceId;if(a&&a.platform===e&&(!i||a.deviceId===i)){if(await $())return a.client;console.log("Session expired or invalid, creating new session..."),await m()}a&&(console.log("Switching session from",a.platform,"to",e),await m()),console.log(`Initializing Appium session for ${e} ${i?`(${i})`:""}...`);const o={platformName:"Android","appium:automationName":"UiAutomator2","appium:ensureWebviewsHavePages":!0,"appium:nativeWebScreenshot":!0,"appium:newCommandTimeout":3600,...i?{"appium:udid":i}:{}},s={platformName:"iOS","appium:automationName":"XCUITest","appium:newCommandTimeout":3600,...i?{"appium:udid":i}:{}};try{const n=await g({protocol:"http",hostname:"127.0.0.1",port:4723,path:"/",capabilities:e==="ios"?s:o}),c=await n.getWindowRect();return a={client:n,platform:e,deviceId:i,windowSize:{width:c.width,height:c.height}},console.log("Appium session initialized"),n}catch(n){throw console.error("Failed to initialize Appium session:",n),n}}function f(e){const t=[],i=o=>{if(!o)return;const s=typeof o=="string"?o:JSON.stringify(o);t.push(s)};return i(e?.message),i(e?.cause?.message),i(e?.body?.value?.message),i(e?.body?.value?.error),i(e?.stack),t.filter(Boolean).join(" | ")}function w(e){const t=f(e).toLowerCase(),i=e?.statusCode||e?.status,o=(e?.body?.value?.error||"").toLowerCase();return i===404||o==="invalid session id"||o==="no such session"||t.includes("404")||t.includes("session not found")||t.includes("no such session")||t.includes("invalid session id")||t.includes("a session is either terminated or not started")||t.includes("instrumentation process is not running")||t.includes("ended")||t.includes("closed")||t.includes("connection refused")||t.includes("econnrefused")||t.includes("econnreset")||t.includes("socket hang up")||t.includes("does not exist")||t.includes("timeout")}async function u(e,t,i,o){const s=i??a?.platform??"android",n=o??a?.deviceId,c=async(r=3)=>{let p;for(let d=0;d<r;d++)try{const l=await S(s,n);if(!l.sessionId)throw new Error("No active sessionId after ensureAppiumSession");return l}catch(l){p=l;const h=Math.min(2e3,250*Math.pow(2,d));d<r-1&&(console.warn(`[${t}] Failed to create/verify session (attempt ${d+1}/${r}). Retrying in ${h}ms...`),await new Promise(y=>setTimeout(y,h)))}throw p};try{const r=await c();if(!r.sessionId)throw new Error("Session appears invalid (missing sessionId)");return await e(r)}catch(r){if(w(r)){console.warn(`[${t}] Session error detected: "${f(r)}". Invalidating and retrying...`),await m();const p=await c(4);try{return await e(p)}catch(d){throw w(d)&&console.error(`[${t}] Action failed again after session refresh: ${f(d)}`),d}}throw r}}async function b(e){await u(async t=>{let i=Math.round(e.x),o=Math.round(e.y);const s=e.platform??"android";if(console.log(`[Tap] Platform: ${s}, Input: ${i},${o}, Screen: ${e.screenWidth}x${e.screenHeight}`),s==="ios"){const n=a?.windowSize;if(console.log(`[Tap] Window Size: ${n?.width}x${n?.height}`),e.screenWidth&&n?.width){const c=e.screenWidth/n.width,r=e.screenHeight?e.screenHeight/n.height:c;console.log(`[Tap] Calculated Scale: X=${c.toFixed(2)}, Y=${r.toFixed(2)}`),i=Math.round(i/c),o=Math.round(o/r),console.log(`[iOS] Scaling tap: ${e.x},${e.y} (px) -> ${i},${o} (pt)`)}else console.warn("[Tap] Missing screenWidth or windowSize, skipping scale calculation."),n&&(i>n.width||o>n.height)&&(i=Math.round(i/3),o=Math.round(o/3),console.log(`[iOS] Scaling tap (heuristic 3x): ${e.x},${e.y} -> ${i},${o}`))}await t.performActions([{type:"pointer",id:"finger1",parameters:{pointerType:"touch"},actions:[{type:"pointerMove",duration:0,x:i,y:o},{type:"pointerDown",button:0},{type:"pause",duration:100},{type:"pointerUp",button:0}]}])},"performTap",e.platform,e.deviceId)}async function T(e){await u(async t=>{await t.keys(e.text.split(""))},"performType",e.platform,e.deviceId)}async function A(e){await u(async t=>{let i=540,o=1500,s=540,n=500;e.direction==="up"&&(o=500,n=1500),await t.performActions([{type:"pointer",id:"finger1",parameters:{pointerType:"touch"},actions:[{type:"pointerMove",duration:0,x:i,y:o},{type:"pointerDown",button:0},{type:"pause",duration:100},{type:"pointerMove",duration:500,x:s,y:n},{type:"pointerUp",button:0}]}])},"performScroll",e.platform,e.deviceId)}async function z(e){await u(async t=>{await t.performActions([{type:"pointer",id:"finger1",parameters:{pointerType:"touch"},actions:[{type:"pointerMove",duration:0,x:Math.round(e.x1),y:Math.round(e.y1)},{type:"pointerDown",button:0},{type:"pause",duration:100},{type:"pointerMove",duration:e.duration??500,x:Math.round(e.x2),y:Math.round(e.y2)},{type:"pointerUp",button:0}]}])},"performSwipe",e.platform,e.deviceId)}async function W(e){await u(async t=>{await t.execute("mobile: deepLink",{url:e.url})},"performDeepLink",e.platform,e.deviceId)}async function C(){return await u(async e=>await e.getPageSource(),"getPageSource")}async function k(e){await u(async t=>{const{width:i,height:o}=a?.windowSize||await t.getWindowRect(),s=Math.floor(i/2),n=Math.floor(o/2),c=Math.floor(i*.2),r=Math.floor(o*.2),p={left:s-c,top:n-r,width:c*2,height:r*2,percent:1,speed:1500};console.log(`[Zoom] dir=${e.direction} center=(${s},${n}) area=(${p.left},${p.top}) ${p.width}x${p.height}`),e.direction==="in"?await t.executeScript("mobile: pinchOpenGesture",[{...p,percent:.5,speed:800}]):await t.executeScript("mobile: pinchCloseGesture",[p])},"performZoom",e.platform,e.deviceId)}export{S as ensureAppiumSession,I as getDeviceSize,C as getPageSource,M as getPlatform,x as isAppiumConnected,W as performDeepLink,A as performScroll,z as performSwipe,b as performTap,T as performType,k as performZoom};
@@ -0,0 +1 @@
1
+ import{z as t}from"zod";const n=t.object({screenshot:t.string(),commands:t.array(t.string())}),e=t.object({stepNumber:t.number(),stepDescription:t.string(),filepath:t.string().optional(),executionData:t.array(n),platform:t.string().optional(),screenResolution:t.object({width:t.number(),height:t.number()}).optional()}),i=t.object({stepNumber:t.number(),stepDescription:t.string(),filepath:t.string().optional(),screenshot:t.string(),platform:t.string().optional(),highest_used_index:t.number().nullable().optional(),screenResolution:t.object({width:t.number(),height:t.number()}).optional()}),r=t.object({found:t.boolean(),interactionCoordinates:t.object({x:t.number(),y:t.number(),action:t.string().optional()}).nullable().optional(),cacheCommands:t.array(t.string()).optional(),cacheIndex:t.number().optional(),timings:t.any().optional()});export{i as a,r as i,e as o};
@@ -0,0 +1 @@
1
+ import{c as b,a as y}from"./server.mjs";import w from"node:fs";import M from"node:path";import P from"node:crypto";import l from"sharp";import{a as E,i as F,o as v}from"./cache-CtBF0d8x.mjs";import{R as h}from"./constants-Dh9o88yr.mjs";import"@tanstack/history";import"@tanstack/router-core/ssr/client";import"@tanstack/router-core";import"node:async_hooks";import"@tanstack/router-core/ssr/server";import"../../index.mjs";import"node:http";import"node:stream";import"node:https";import"node:http2";import"node:url";import"tiny-invariant";import"seroval";import"react/jsx-runtime";import"@tanstack/react-router/ssr/server";import"@tanstack/react-router";import"zod";const $="https://cache.mobileboost.io";function x(){const e=M.join(process.cwd(),"mobileboost.config.json");if(!w.existsSync(e))throw new Error("mobileboost.config.json not found");const t=w.readFileSync(e,"utf-8");return JSON.parse(t)}function _(e,t,c,r,n,a){const o=a?`${a.width}x${a.height}`:"",i=`${e}${t||""}${c}${r}${n||""}${o}`;return P.createHash("sha256").update(i).digest("hex")}function S(e,t){return e.match(/([xy])=(\d+)/)?e.replace(/([xy])=(\d+)/g,(c,r,n)=>{const a=parseInt(n,10);let o;return t==="multiply"?o=Math.round(a*h):o=Math.round(a/h),`${r}=${o}`}):e.replace(/(^|;)(\d+);(\d+)(;|$)/,(c,r,n,a,o)=>{const i=parseInt(n,10),s=parseInt(a,10);let d,p;return t==="multiply"?(d=Math.round(i*h),p=Math.round(s*h)):(d=Math.round(i/h),p=Math.round(s/h)),`${r}${d};${p}${o}`})}const B=b("fcbe7e11d05240fa28a1dd79ec8c395f6c03682edbaeb19f469bd78d6399cdde",(e,t)=>O.__executeServer(e,t)),O=y({method:"POST"}).inputValidator(e=>v.parse(e)).handler(B,async({data:e})=>{try{const t=x().apiKey;if(!t)throw new Error("API Key missing");const c=_(t,e.filepath,e.stepNumber,e.stepDescription,e.platform,e.screenResolution),r=await Promise.all(e.executionData.map(async i=>{const s=Buffer.from(i.screenshot.replace(/^data:image\/\w+;base64,/,""),"base64"),d=(await l(s).metadata()).width??1080,p=Math.round(d/h),u=await l(s).resize({width:p,withoutEnlargement:!0}).toBuffer(),f=i.commands.map(g=>S(g,"divide"));return{screenshot:u.toString("base64"),commands:f}})),n=JSON.stringify(r),a=(n.length/(1024*1024)).toFixed(2);console.log(`[Cache Client] Populating cache with payload size: ~${a} MB (Hash: ${c})`);const o=await fetch(`${$}/populate-cache?hash=${c}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n});return o.ok?{success:!0}:(console.error("Failed to populate cache:",await o.text()),{success:!1})}catch(t){return console.error("Error populating cache:",t),{success:!1,error:String(t)}}}),T=b("7d2aacaab26ab11cdc66f03a4ed01b8b38186abf16ab1f9306801ea7769aaa2a",(e,t)=>z.__executeServer(e,t)),z=y({method:"POST"}).inputValidator(e=>E.parse(e)).handler(T,async({data:e})=>{try{const t=x().apiKey;if(!t)throw new Error("API Key missing");const c=_(t,e.filepath,e.stepNumber,e.stepDescription,e.platform,e.screenResolution),r=Buffer.from(e.screenshot.replace(/^data:image\/\w+;base64,/,""),"base64"),n=(await l(r).metadata()).width??1080,a=Math.round(n/h),o=await l(r).resize({width:a,withoutEnlargement:!0}).toBuffer(),i=await l(o).metadata();console.log(i.width,i.height);const s=new FormData;s.append("hash",c);const d=new Blob([new Uint8Array(o)],{type:"image/png"}),p=(d.size/(1024*1024)).toFixed(2);console.log(`[Cache Client] Executing from cache with screenshot size: ${p} MB`),s.append("screenshot",d,"screenshot.png"),e.highest_used_index!==void 0&&e.highest_used_index!==null&&(console.log(`[Cache Client] Sending highest_used_index: ${e.highest_used_index} (Type: ${typeof e.highest_used_index})`),s.append("highest_used_index",String(e.highest_used_index)));const u=await fetch(`${$}/execute-from-cache`,{method:"POST",body:s});if(!u.ok){const m=await u.text();return console.warn("Cache lookup failed:",m),{found:!1}}const f=await u.json(),g=F.safeParse(f);if(g.success){const m={...g.data};return m.found&&m.cacheCommands&&(m.cacheCommands=m.cacheCommands.map(C=>S(C,"multiply"))),m}return console.error("Invalid cache response:",f),{found:!1}}catch(t){return console.error("Error executing from cache:",t),{found:!1,error:String(t)}}});export{T as executeFromCacheMutation_createServerFn_handler,B as populateCacheMutation_createServerFn_handler};
@@ -0,0 +1 @@
1
+ const o=4;export{o as R};
@@ -0,0 +1 @@
1
+ import{c as o,a as i}from"./server.mjs";import{P as p,K as m}from"./ai-client-waGeh-P8.mjs";import"@tanstack/history";import"@tanstack/router-core/ssr/client";import"@tanstack/router-core";import"node:async_hooks";import"@tanstack/router-core/ssr/server";import"../../index.mjs";import"node:http";import"node:stream";import"node:https";import"node:http2";import"node:fs";import"node:url";import"node:path";import"tiny-invariant";import"seroval";import"react/jsx-runtime";import"@tanstack/react-router/ssr/server";import"@tanstack/react-router";import"zod";import"sharp";import"./constants-Dh9o88yr.mjs";const e=o("f8084cb106c8126bb2deaeef7c98992d9ff9475ad3dc85c6ced04f08c3962b6e",(r,t)=>a.__executeServer(r,t)),a=i({method:"POST"}).inputValidator(p).handler(e,async({data:r})=>({description:await m(r)}));export{e as describeInteractionFn_createServerFn_handler};
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import{r as t,c as n,m as o,o as d,t as r,a as p,s as m}from"./step-D2WQqd4J.mjs";const a=e.object({platform:e.enum(["android","ios"]).optional().default("android"),deviceId:e.string().optional()}),u=d.extend(a.shape),x=r.extend(a.shape),b=n.extend(a.shape),h=e.object({x1:e.number(),y1:e.number(),x2:e.number(),y2:e.number(),duration:e.number().optional().default(500)}).extend(a.shape),l=p.extend(a.shape),c=o.extend(a.shape),f=t.extend(a.shape);m.extend(a.shape);e.object({mode:e.enum(["adb","appium"])});export{u as S,a,l as b,x as d,h as l,b as r,c as u,f as x};
@@ -0,0 +1 @@
1
+ import{c,a as s}from"./server.mjs";import o from"node:path";import{readFile as w}from"node:fs/promises";import n from"fs-extra";import{z as r}from"zod";import u from"dotenv";import{B as b}from"./stores-03HL60eP.mjs";import"@tanstack/history";import"@tanstack/router-core/ssr/client";import"@tanstack/router-core";import"node:async_hooks";import"@tanstack/router-core/ssr/server";import"../../index.mjs";import"node:http";import"node:stream";import"node:https";import"node:http2";import"node:fs";import"node:url";import"tiny-invariant";import"seroval";import"react/jsx-runtime";import"@tanstack/react-router/ssr/server";import"@tanstack/react-router";import"@tanstack/react-store";import"./step-D2WQqd4J.mjs";async function h(){const e=o.join(process.cwd(),"mobileboost.config.json");let t="./tests";if(await n.pathExists(e))try{const a=await n.readJSON(e);a.testDir&&(t=a.testDir)}catch(a){console.error("Error reading config, using default testDir",a)}return o.resolve(process.cwd(),t)}async function f(e){const t=await h(),a=o.resolve(t,e);if(!a.startsWith(t))throw new Error("Invalid path: must be within test directory");return a}r.object({name:r.string(),type:r.enum(["file","directory"]),path:r.string()});const v=c("00fb1fe03e9689cf8c179ba0d5cadc5eeaa6879def224ac38037d70a1a51300d",(e,t)=>y.__executeServer(e,t)),y=s({method:"GET"}).handler(v,async()=>{const e=await h();await n.ensureDir(e);async function t(a){let i=[];const p=await n.readdir(a,{withFileTypes:!0});for(const d of p){const l=o.join(a,d.name),m=o.relative(e,l);d.isDirectory()?(i.push({name:d.name,type:"directory",path:m}),i=i.concat(await t(l))):i.push({name:d.name,type:"file",path:m})}return i}return{files:await t(e)}}),_=r.record(r.string(),r.string()).optional().default({});r.object({testDir:r.string(),driver:r.string(),port:r.number(),apiKey:r.string(),variables:_});const F=c("54b0d7153f4ee4f963b29e7c835e76cedaaf345527fdc912c49030ea79353b5e",(e,t)=>S.__executeServer(e,t)),S=s({method:"GET"}).handler(F,async()=>{let e={};const t=o.join(process.cwd(),"mobileboost.config.json"),a=o.join(process.cwd(),".env");if(await n.pathExists(t))try{e={...(await n.readJSON(t)).variables}}catch{}if(await n.pathExists(a))try{const i=await w(a,"utf-8"),p=u.parse(i);e={...e,...p}}catch{}return e}),g=r.object({name:r.string(),type:r.enum(["file","directory"]),parentPath:r.string().optional()}),j=c("ac7bf7f1d727949cd28713a8f36bb77e7bd8fc0e48854ed8cb1ee93ce80fb6d0",(e,t)=>P.__executeServer(e,t)),P=s({method:"POST"}).inputValidator(g).handler(j,async({data:e})=>{const t=await h(),a=e.parentPath?o.join(t,e.parentPath):t;if(!o.resolve(a).startsWith(t))throw new Error("Invalid parent path");const i=o.join(a,e.name);if(e.type==="directory")await n.ensureDir(i);else{if(await n.pathExists(i))throw new Error("File already exists");await n.writeJSON(i,[],{spaces:2})}return{success:!0}}),x=r.object({path:r.string()}),E=c("b41e844ce533c224e7c720e69d821468deffcbf208fc008a7f5af83cb0596b15",(e,t)=>O.__executeServer(e,t)),O=s({method:"POST"}).inputValidator(x).handler(E,async({data:e})=>{const t=await f(e.path);try{return{content:await n.readJSON(t),path:e.path}}catch(a){throw console.error("Failed to read file",a),new Error("Failed to read file or invalid format")}}),D=r.object({path:r.string(),content:b}),T=c("1b2a0d276d9ce90b2a1d72134c1bf95b9f6b7b049a8f415e8f0da3e6fc5ce4ae",(e,t)=>V.__executeServer(e,t)),V=s({method:"POST"}).inputValidator(r.unknown()).handler(T,async({data:e})=>{const t=D.parse(e),a=await f(t.path);return await n.writeJSON(a,t.content,{spaces:2}),{success:!0}}),J=r.object({oldPath:r.string(),newPath:r.string()}),N=c("098d52adf25ea567d43facba347871f887828c6ab804021bbfa0f2759209c0c6",(e,t)=>I.__executeServer(e,t)),I=s({method:"POST"}).inputValidator(J).handler(N,async({data:e})=>{const t=await f(e.oldPath),a=await h(),i=o.resolve(a,e.newPath);if(!i.startsWith(a))throw new Error("Invalid new path");return await n.rename(t,i),{success:!0}}),W=r.object({sourcePath:r.string(),targetPath:r.string()}),k=c("efbbc22c41cf491631b07076417c9ec65d5ac71debfcc00b5a7e0d368772104f",(e,t)=>G.__executeServer(e,t)),G=s({method:"POST"}).inputValidator(W).handler(k,async({data:e})=>{const t=await f(e.sourcePath),a=await h(),i=o.resolve(a,e.targetPath);if(!i.startsWith(a))throw new Error("Invalid target path");await n.ensureDir(i);const p=o.basename(t),d=o.join(i,p);return await n.move(t,d,{overwrite:!1}),{success:!0}});export{j as createFileFn_createServerFn_handler,v as fetchFilesFn_createServerFn_handler,F as fetchVariablesFn_createServerFn_handler,k as moveFileFn_createServerFn_handler,E as readFileFn_createServerFn_handler,N as renameFileFn_createServerFn_handler,T as saveFileFn_createServerFn_handler};
@@ -0,0 +1 @@
1
+ import{c as d,a as m}from"./server.mjs";import{s as f,n as u}from"./step-D2WQqd4J.mjs";import{getPageSource as s,getDeviceSize as p,getPlatform as g}from"./appium-client-Dxm_q6FS.mjs";import{V as c,H as I,N as h,K as $,L as _,q as b,Y as x,_ as y,z as S,j as D}from"./hierarchy-helpers-BaGN7WBn.mjs";import"@tanstack/history";import"@tanstack/router-core/ssr/client";import"@tanstack/router-core";import"node:async_hooks";import"@tanstack/router-core/ssr/server";import"../../index.mjs";import"node:http";import"node:stream";import"node:https";import"node:http2";import"node:fs";import"node:url";import"node:path";import"tiny-invariant";import"seroval";import"react/jsx-runtime";import"@tanstack/react-router/ssr/server";import"@tanstack/react-router";import"zod";import"webdriverio";import"xml2js";import"linkedom";const F=d("1ed4d2aa14be99e8c5a81eefbece63cea629a89f75862c60f9ff19c4d4dc67c5",(e,t)=>v.__executeServer(e,t)),v=m().handler(F,async()=>{const e=await s(),t=g(),r=p(),n=t==="ios"?D(e):x(e),o=y({elements:n,deviceDimensions:r,allowNonClickableItems:!0,ignoredElements:[]}),i=S({items:o});return{...r,elements:i}}),w=d("05faf0772038a170c70083fd8de4a8b77a40e4ec46e0bbf6878670f02621b5df",(e,t)=>E.__executeServer(e,t)),E=m({method:"POST"}).inputValidator(u).handler(w,async({data:e})=>{console.log(`Getting element ID at ${e.x}, ${e.y}`);const t=await s(),r=(await c(t))?.hierarchy?.node?.[0];if(!r)return console.log("No root node found in hierarchy"),{elementId:""};const n=_(r,e.x,e.y);if(!n)return console.log("No element found at coordinates"),{elementId:""};if(n.$&&n.$["resource-id"]?.trim()){let o=n.$["resource-id"];const i=b(r,n,o);return i>=0?(o=`${o}[${i}]`,console.log(`Found duplicate IDs, using indexed ID: ${o}`)):console.log("Found unique element ID:",o),{elementId:o}}return console.log("Element found but has no resource-id"),{elementId:""}}),P=d("9bcbf5303827d2a25f347c2054b0121655a82322fa07108653f43246875348f7",(e,t)=>V.__executeServer(e,t)),V=m({method:"POST"}).inputValidator(f).handler(P,async({data:e})=>{console.log(`Looking for element with ID: ${e.elementId}`);const t=await s(),r=(await c(t))?.hierarchy?.node?.[0];if(!r)return{found:!1};let n=e.elementId,o=null;const i=e.elementId.match(/^(.+)\[(\d+)\]$/);i&&(n=i[1],o=parseInt(i[2]),console.log(`Parsed indexed ID: base="${n}", index=${o}`));let a=null;if(o!==null){const l=I(r,n);o<l.length&&(a=l[o],console.log(`Found element at index ${o}`))}else a=h(r,e.elementId);if(a){const l=$(a);if(l)return console.log(`Found element at center: ${l.x}, ${l.y}`),{found:!0,x:l.x,y:l.y}}return console.log("Element not found or no bounds"),{found:!1}});export{P as findElementByIdFn_createServerFn_handler,w as getElementIdFn_createServerFn_handler,F as getVisibleElements_createServerFn_handler};
@@ -0,0 +1,3 @@
1
+ import L from"xml2js";import{DOMParser as F}from"linkedom";async function j(e){return new Promise((n,u)=>{L.parseString(e,(o,i)=>{o?u(o):n(i)})})}function C(e){if(!e)return null;const n=e.match(/\[(\d+),(\d+)\]\[(\d+),(\d+)\]/);return n?{x1:parseInt(n[1]),y1:parseInt(n[2]),x2:parseInt(n[3]),y2:parseInt(n[4])}:null}function X(e,n,u){if(!e)return null;if(e.$&&e.$.bounds){const i=C(e.$.bounds);if(i&&(n<i.x1||n>i.x2||u<i.y1||u>i.y2))return null}let o=null;if(e.node)for(const i of e.node){const l=X(i,n,u);l&&(o=l)}return o??e}function N(e,n){if(!e)return null;if(e.$&&e.$["resource-id"]===n)return e;if(e.node)for(const u of e.node){const o=N(u,n);if(o)return o}return null}function K(e,n){if(!e)return null;const u=e.$?.text??"",o=e.$?.["content-desc"]??"";if(u&&u.toLowerCase().includes(n.toLowerCase())||o&&o.toLowerCase().includes(n.toLowerCase()))return e;if(e.node)for(const i of e.node){const l=K(i,n);if(l)return l}return null}function q(e,n){const u=[];function o(i){if(i&&(i.$&&i.$["resource-id"]===n&&u.push(i),i.node))for(const l of i.node)o(l)}return o(e),u}function z(e,n,u){const o=q(e,u);return o.length<=1?-1:o.indexOf(n)}function H(e){if(!e.$||!e.$.bounds)return null;const n=C(e.$.bounds);return n?{x:Math.round((n.x1+n.x2)/2),y:Math.round((n.y1+n.y2)/2)}:null}const R=e=>{const n=e.replace(/\\"/g,'"').replace(/\\n/g,`
2
+ `),u=t=>{try{const r=parseFloat(t.getAttribute("x")??"0"),s=parseFloat(t.getAttribute("y")??"0"),a=parseFloat(t.getAttribute("width")??"0"),c=parseFloat(t.getAttribute("height")??"0");return{x:r,y:s,width:a,height:c}}catch(r){console.error("Error parsing bounds:",r);return}},o=t=>{const r=t.getAttribute("type")??"",s=t.getAttribute("name")??"",a=t.getAttribute("label")??"";return{text:t.getAttribute("value")??"","resource-id":s,"content-desc":a,hintText:"",accessibilityText:a,visible:t.getAttribute("visible")==="true",index:t.getAttribute("index")??"0",type:r}},i=new F().parseFromString(n,"text/xml"),l=i.querySelector("parsererror");if(l!=null)return console.error("XML parsing error:",l),[];const g=i.querySelector("XCUIElementTypeApplication");if(g==null)return console.error("No application element found in XML"),[];const f=(t,r=0,s=[],a=!1)=>{const c=u(t),h=o(t),d=t.getAttribute("type")??"",b=t.getAttribute("name")??"",x=t.getAttribute("accessible")==="true",w=t.getAttribute("enabled")==="true",p=t.getAttribute("index")??"0",y=Array.from(t.children).filter(I=>I.nodeType===1&&I.nodeName.startsWith("XCUIElementType")&&!["AXFrame"].includes(I.nodeName)),m=h.type==="XCUIElementTypeKeyboard",A=y.map(I=>f(I,r+1,[...s,p],a||m)),P=b.length>0&&(b.includes("button")||d.includes("Button")||d.includes("Control")),M=d.includes("TextField")||d.includes("SearchField")||d.includes("TextInput"),T=x&&w||P||d.includes("Button")||M,k={attributes:h,clickable:T,enabled:t.getAttribute("enabled")==="true",focused:t.getAttribute("focused")==="true",checked:t.getAttribute("checked")==="true",selected:t.getAttribute("selected")==="true",bounds:c,drawingOrderPath:[...s,p],isKeyboardElement:a,isKeyboardParent:m};return A.length>0&&(k.children=A),k};return E(f(g),[])},V=e=>{const n=e.replace(/\\"/g,'"').replace(/\\n/g,`
3
+ `),u=r=>{try{const s=r.match(/\[(\d+),(\d+)\]\[(\d+),(\d+)\]/);if(s==null)return;const[a,c,h,d,b]=s.map(Number);return{x:c,y:h,width:d-c,height:b-h}}catch(s){console.error("Error parsing bounds:",s);return}},o=r=>({text:r.getAttribute("text")??"","resource-id":r.getAttribute("resource-id")??"","content-desc":r.getAttribute("content-desc")??"",hintText:"",hint:r.getAttribute("hint")??"",accessibilityText:r.getAttribute("content-desc")??"",visible:r.getAttribute("displayed")==="true",index:r.getAttribute("index")??"0",class:r.getAttribute("class")??"",package:r.getAttribute("package")??""}),i=(r,s=[],a=[],c=0)=>{const h=r.getAttribute("bounds"),d=h?u(h):void 0;d||console.warn(`Element with missing/invalid bounds: ${r.getAttribute("class")??"unknown"} with resource-id: ${r.getAttribute("resource-id")??"none"}`);const b=o(r),x=r.getAttribute("drawing-order")??"0",w=r.getAttribute("index")??"0",p=[...a,w],y=parseInt(x)*1e3+c,m=[...s,y.toString()],A=Array.from(r.children).filter(M=>M.nodeType===1).map((M,T)=>i(M,m,p,T)),P={attributes:b,clickable:r.getAttribute("clickable")==="true",enabled:r.getAttribute("enabled")==="true",focused:r.getAttribute("focused")==="true",checked:r.getAttribute("checked")==="true",selected:r.getAttribute("selected")==="true",bounds:d,drawingOrderPath:m,indexPath:p,drawingOrder:y};return A.length>0&&(P.children=A),P},l=new F().parseFromString(n,"text/xml"),g=l.querySelector("parsererror");if(g!=null)return console.error("XML parsing error:",g),[];const f=l.querySelector("hierarchy");if(f==null)return console.error("No hierarchy element found in XML"),[];const t=i(f);return E(t,[])},E=(e,n,u)=>{u?.clickable&&!e.clickable&&(e.clickable=!0),((u?.isFixed??!1)||(e.attributes?.type?.includes("NavigationBar")??!1))&&(e.isFixed=!0),e.children!=null&&e.children.forEach(l=>{E(l,n,e)});const{children:o,...i}=e;return n.push(i),n},Y=({elements:e,deviceDimensions:n,allowNonClickableItems:u=!1,allowFullScreenItems:o=!1,shouldIncludeKeyboardParentElement:i=!1,ignoredElements:l})=>{const g=n?.width??0,f=n?.height??0;return e.filter(t=>{const r=t.clickable??!1,s=t.attributes?.visible!==!1,a=t.attributes?.text!==""?t.attributes?.text:void 0,c=t.attributes?.accessibilityText??t.attributes?.["content-desc"]??t.attributes?.accessibilityLabel,h=t.attributes?.["resource-id"]??t.attributes?.accessibilityIdentifier;if(l.includes(h))return!1;const d=[a,c,h].some(v=>v!=null&&v.trim()?.length>0),b=t.bounds?.x??0,x=t.bounds?.width??0,w=b+x,p=Math.max(0,b),y=Math.min(g,w),m=Math.max(0,y-p),A=t.bounds?.y??0,P=t.bounds?.height??0,M=A+P,T=Math.max(0,A),k=Math.min(f,M),I=Math.max(0,k-T),O=m>0&&I>0,S=t.bounds?.height===n?.height&&t.bounds?.width===n?.width;return(o||!S)&&(u||r)&&s&&(d||i&&t.isKeyboardParent)&&O}).map(t=>{const r=t.bounds?.x??0,s=t.bounds?.width??0,a=r+s,c=Math.max(0,r),h=Math.min(g,a),d=Math.max(0,h-c),b=t.bounds?.y??0,x=t.bounds?.height??0,w=b+x,p=Math.max(0,b),y=Math.min(f,w),m=Math.max(0,y-p);return{...t,bounds:{x:c,y:p,width:d,height:m}}})},_=({items:e,allItems:n})=>e.filter(u=>u.isFixed?!0:!B({targetElement:u,allElements:n??e,occlusionThreshold:.6})),B=({targetElement:e,allElements:n,occlusionThreshold:u=1})=>{const{x:o,y:i,width:l,height:g}=e.bounds,f=l*g;return n.find(t=>{if(t.bounds==null||t===e||$({potentialChild:e,potentialParent:t})||$({potentialChild:t,potentialParent:e})||!(D(t,e)>0||t.isFixed))return!1;const r=Math.max(o,t.bounds.x),s=Math.max(i,t.bounds.y),a=Math.min(o+l,t.bounds.x+t.bounds.width),c=Math.min(i+g,t.bounds.y+t.bounds.height);if(a<=r||c<=s)return!1;const h=a-r,d=c-s,b=h*d/f,x=b>=u;return x&&console.log("coverageRatio",b),x})??null},$=({potentialChild:e,potentialParent:n})=>{const u=e.drawingOrderPath??e.indexPath??[],o=n.drawingOrderPath??n.indexPath??[];return u.length<=o.length?!1:o.every((i,l)=>i===u[l])},D=(e,n)=>{if(!e.bounds&&!n.bounds)return 0;if(!e.bounds)return-1;if(!n.bounds)return 1;const u=e.drawingOrderPath??e.indexPath??[],o=n.drawingOrderPath??n.indexPath??[];for(let i=0;i<Math.min(u.length,o.length);i++){const l=parseInt(u[i]),g=parseInt(o[i]);if(l!==g)return l-g}return u.length!==o.length?u.length-o.length:n.bounds.width*n.bounds.height-e.bounds.width*e.bounds.height};export{q as H,H as K,X as L,N,j as V,K as X,V as Y,Y as _,R as j,z as q,_ as z};