mobileboost-cli 0.1.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 (50) hide show
  1. package/.output/nitro.json +15 -0
  2. package/.output/public/assets/index-DcK8FECE.css +1 -0
  3. package/.output/public/assets/index-Deils465.js +444 -0
  4. package/.output/public/assets/main-5WzLXT-A.js +51 -0
  5. package/.output/public/assets/roboto-cyrillic-ext-wght-normal-3VVPul60.woff2 +0 -0
  6. package/.output/public/assets/roboto-cyrillic-wght-normal-B1tIhOr4.woff2 +0 -0
  7. package/.output/public/assets/roboto-greek-ext-wght-normal-DnPa8eh0.woff2 +0 -0
  8. package/.output/public/assets/roboto-greek-wght-normal-iaUSDqqS.woff2 +0 -0
  9. package/.output/public/assets/roboto-latin-ext-wght-normal-Dqr_DJ6L.woff2 +0 -0
  10. package/.output/public/assets/roboto-latin-wght-normal-CHnqiQTt.woff2 +0 -0
  11. package/.output/public/assets/roboto-math-wght-normal-CBNGtO38.woff2 +0 -0
  12. package/.output/public/assets/roboto-symbols-wght-normal-Bm5C9Z0M.woff2 +0 -0
  13. package/.output/public/assets/roboto-vietnamese-wght-normal-24ctNiOc.woff2 +0 -0
  14. package/.output/server/chunks/_/_tanstack-start-manifest_v-Chz34YFq.mjs +1 -0
  15. package/.output/server/chunks/_/actions-2SMY1JO3.mjs +1 -0
  16. package/.output/server/chunks/_/adb-CsX2v8FE.mjs +1 -0
  17. package/.output/server/chunks/_/adb-client-DwefjXbe.mjs +2 -0
  18. package/.output/server/chunks/_/agent-CeaBVldB.mjs +1 -0
  19. package/.output/server/chunks/_/ai-client-BtI1TeHN.mjs +1 -0
  20. package/.output/server/chunks/_/appium-BbkeYpmk.mjs +1 -0
  21. package/.output/server/chunks/_/appium-client-D-NjeB35.mjs +1 -0
  22. package/.output/server/chunks/_/cache-C5L90tGD.mjs +1 -0
  23. package/.output/server/chunks/_/client-CzCEo8ab.mjs +1 -0
  24. package/.output/server/chunks/_/describe-NXd8kuzS.mjs +1 -0
  25. package/.output/server/chunks/_/device-8ONaG49P.mjs +1 -0
  26. package/.output/server/chunks/_/files-CIdgnUJn.mjs +1 -0
  27. package/.output/server/chunks/_/hierarchy-Q35yGKlr.mjs +1 -0
  28. package/.output/server/chunks/_/hierarchy-helpers-DF8QSYE6.mjs +1 -0
  29. package/.output/server/chunks/_/index-BPmuBr-n.mjs +426 -0
  30. package/.output/server/chunks/_/ios-client-1xTZzFD8.mjs +1 -0
  31. package/.output/server/chunks/_/list-Dq_Nh07i.mjs +1 -0
  32. package/.output/server/chunks/_/router-vxnEMbKX.mjs +1 -0
  33. package/.output/server/chunks/_/screenshot-BD59si87.mjs +1 -0
  34. package/.output/server/chunks/_/server.mjs +3 -0
  35. package/.output/server/chunks/_/start-BClswEUm.mjs +1 -0
  36. package/.output/server/chunks/_/step-CEQtT3SD.mjs +1 -0
  37. package/.output/server/chunks/_/stores-C1dCcTeV.mjs +1 -0
  38. package/.output/server/index.mjs +7 -0
  39. package/.output/server/package.json +233 -0
  40. package/README.md +85 -0
  41. package/bin/mobileboost +2 -0
  42. package/dist/cli.js +28 -0
  43. package/dist/cli.js.map +1 -0
  44. package/dist/commands/doctor.js +77 -0
  45. package/dist/commands/doctor.js.map +1 -0
  46. package/dist/commands/init.js +44 -0
  47. package/dist/commands/init.js.map +1 -0
  48. package/dist/commands/studio.js +89 -0
  49. package/dist/commands/studio.js.map +1 -0
  50. package/package.json +101 -0
@@ -0,0 +1 @@
1
+ import{exec as r}from"node:child_process";import{promisify as a}from"node:util";const n=a(r);async function f(t="booted"){const{stdout:o}=await n(`xcrun simctl io ${t} screenshot --type=jpeg -`,{encoding:"buffer",maxBuffer:10485760});return o}async function m(){try{const{stdout:t}=await n("xcrun simctl list devices booted --json"),o=JSON.parse(t),s=[];for(const c in o.devices){const i=o.devices[c];for(const e of i)e.state==="Booted"&&s.push({name:e.name,id:e.udid,platform:"ios"})}return s}catch(t){return console.warn("Failed to list iOS devices:",t),[]}}export{m,f as u};
@@ -0,0 +1 @@
1
+ import{c as m,a as o}from"./server.mjs";import{f as e}from"./adb-client-DwefjXbe.mjs";import{m as i}from"./ios-client-1xTZzFD8.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"node:child_process";import"node:util";const p=m("33557b2fcc5cedc5814d20bca9cd9cde2e45318755de1da4d613e8fa84ee38d1",(r,t)=>a.__executeServer(r,t)),a=o({method:"GET"}).handler(p,async()=>{const[r,t]=await Promise.all([e(),i()]);return[...r,...t]});export{p as getDevicesFn_createServerFn_handler};
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{QueryClient as l}from"@tanstack/react-query";import{createRouter as s,createRootRouteWithContext as d,useRouter as p,useMatch as m,rootRouteId as u,ErrorComponent as h,Link as a,createFileRoute as f,lazyRouteComponent as x,Outlet as y,HeadContent as g,Scripts as b}from"@tanstack/react-router";import{setupRouterSsrQueryIntegration as C}from"@tanstack/react-router-ssr-query";import{CacheProvider as k}from"@emotion/react";import{ThemeProvider as w,CssBaseline as v}from"@mui/material";import R from"@emotion/cache";import{createTheme as N}from"@mui/material/styles";const F="/assets/index-DcK8FECE.css",T=N({typography:{fontFamily:"'Roboto Variable', sans-serif"}}),i=d()({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"Mobileboost CLI"}],links:[{rel:"stylesheet",href:F}]}),shellComponent:E});function E(){return e(P,{children:e(y,{})})}function I({children:t}){const o=R({key:"css"});return e(k,{value:o,children:r(w,{theme:T,children:[e(v,{}),t]})})}function P({children:t}){return r("html",{children:[e("head",{children:e(g,{})}),r("body",{children:[e(I,{children:t}),e(b,{})]})]})}const S=()=>import("./index-BPmuBr-n.mjs"),j=f("/")({component:x(S,"component")}),B=j.update({id:"/",path:"/",getParentRoute:()=>i}),D={IndexRoute:B},G=i._addFileChildren(D)._addFileTypes();function H({error:t}){const o=p(),c=m({strict:!1,select:n=>n.id===u});return console.error(t),r("div",{className:"min-w-0 flex-1 p-4 flex flex-col items-center justify-center gap-6",children:[e(h,{error:t}),r("div",{className:"flex gap-2 items-center flex-wrap",children:[e("button",{onClick:()=>{o.invalidate()},className:"px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold",children:"Try Again"}),c?e(a,{to:"/",className:"px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold",children:"Home"}):e(a,{to:"/",className:"px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold",onClick:n=>{n.preventDefault(),window.history.back()},children:"Go Back"})]})]})}function q({children:t}){return r("div",{className:"space-y-2 p-2",children:[e("div",{className:"text-gray-600 dark:text-gray-400",children:t||e("p",{children:"The page you are looking for does not exist."})}),r("p",{className:"flex items-center gap-2 flex-wrap",children:[e("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"}),e(a,{to:"/",className:"bg-cyan-600 text-white px-2 py-1 rounded-sm uppercase font-black text-sm",children:"Start Over"})]})]})}function V(){const t=new l,o=s({routeTree:G,context:{queryClient:t},defaultPreload:"intent",defaultErrorComponent:H,defaultNotFoundComponent:()=>e(q,{})});return C({router:o,queryClient:t}),o}export{V as getRouter};
@@ -0,0 +1 @@
1
+ import{c as s,a as p}from"./server.mjs";import{u as c}from"./adb-client-DwefjXbe.mjs";import{u as d}from"./ios-client-1xTZzFD8.mjs";import{e as f}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"node:child_process";import"node:util";import"zod";import"./step-CEQtT3SD.mjs";const n=s("c5aeaa72b9b3303af5d82ee2fa59e3e90ffef3c3f0fb32707cee49e78ff41066",(e,t)=>u.__executeServer(e,t)),u=p({method:"GET"}).handler(n,async e=>{const t=f.parse(e.data),{platform:a="android",deviceId:r}=t,i=async()=>({success:!0,base64:`data:image/png;base64,${(await c(r)).toString("base64")}`,format:"base64",platform:"android",deviceId:r}),m=async()=>({success:!0,base64:`data:image/jpeg;base64,${(await d(r)).toString("base64")}`,format:"base64",platform:"ios",deviceId:r});try{return a==="android"?await i():await m()}catch(o){return console.error(`Screenshot failed for ${a} ${r||""}:`,o),{success:!1,error:o.message}}});export{n as screenshotFn_createServerFn_handler};
@@ -0,0 +1,3 @@
1
+ import{createMemoryHistory as fe}from"@tanstack/history";import{mergeHeaders as X,json as A}from"@tanstack/router-core/ssr/client";import{isRedirect as $,isNotFound as j,createSerializationAdapter as he,isResolvedRedirect as pe,executeRewriteInput as le,rootRouteId as D,defaultSerovalPlugins as me,makeSerovalPlugin as ye}from"@tanstack/router-core";import{AsyncLocalStorage as Q}from"node:async_hooks";import{getOrigin as be,attachRouterServerSsrUtils as we}from"@tanstack/router-core/ssr/server";import{N as Z}from"../../index.mjs";import J from"tiny-invariant";import{fromJSON as k,toCrossJSONStream as ge,toCrossJSONAsync as Se}from"seroval";import{jsx as K}from"react/jsx-runtime";import{defineHandlerCallback as xe,renderRouterToStream as ve}from"@tanstack/react-router/ssr/server";import{RouterProvider as _e}from"@tanstack/react-router";import"node:http";import"node:stream";import"node:https";import"node:http2";import"node:fs";import"node:url";import"node:path";function ee(e){if(Array.isArray(e))return e.flatMap(u=>ee(u));if(typeof e!="string")return[];const t=[];let r=0,s,n,o,i,a;const c=()=>{for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length},p=()=>(n=e.charAt(r),n!=="="&&n!==";"&&n!==",");for(;r<e.length;){for(s=r,a=!1;c();)if(n=e.charAt(r),n===","){for(o=r,r+=1,c(),i=r;r<e.length&&p();)r+=1;r<e.length&&e.charAt(r)==="="?(a=!0,r=i,t.push(e.slice(s,o)),s=r):r=o+1}else r+=1;(!a||r>=e.length)&&t.push(e.slice(s))}return t}function te(e,t,r){for(const s of Object.getOwnPropertyNames(t)){if(s==="constructor")continue;const n=Object.getOwnPropertyDescriptor(e,s),o=Object.getOwnPropertyDescriptor(t,s);let i=!1;o.get&&(i=!0,o.get=n?.get||function(){return this[r][s]}),o.set&&(i=!0,o.set=n?.set||function(a){this[r][s]=a}),typeof o.value=="function"&&(i=!0,o.value=function(...a){return this[r][s](...a)}),i&&Object.defineProperty(e,s,o)}}const Te=(()=>{const e=globalThis.URL,t=class{#e;#r;#n;#t;#s;#o;#i;#a;constructor(s){typeof s=="string"?this.#r=s:(this.#n=s.protocol,this.#t=s.host,this.#s=s.pathname,this.#o=s.search)}get _url(){return this.#e?this.#e:(this.#e=new e(this.href),this.#r=void 0,this.#n=void 0,this.#t=void 0,this.#s=void 0,this.#o=void 0,this.#i=void 0,this.#a=void 0,this.#e)}get href(){return this.#e?this.#e.href:(this.#r||(this.#r=`${this.#n||"http:"}//${this.#t||"localhost"}${this.#s||"/"}${this.#o||""}`),this.#r)}#c(){if(!this.#a){const s=this.href,n=s.indexOf("://"),o=n===-1?-1:s.indexOf("/",n+4),i=o===-1?-1:s.indexOf("?",o);this.#a=[n,o,i]}return this.#a}get pathname(){if(this.#e)return this.#e.pathname;if(this.#s===void 0){const[,s,n]=this.#c();if(s===-1)return this._url.pathname;this.#s=this.href.slice(s,n===-1?void 0:n)}return this.#s}get search(){if(this.#e)return this.#e.search;if(this.#o===void 0){const[,s,n]=this.#c();if(s===-1)return this._url.search;const o=this.href;this.#o=n===-1||n===o.length-1?"":o.slice(n)}return this.#o}get searchParams(){return this.#e?this.#e.searchParams:(this.#i||(this.#i=new URLSearchParams(this.search)),this.#i)}get protocol(){if(this.#e)return this.#e.protocol;if(this.#n===void 0){const[s]=this.#c();if(s===-1)return this._url.protocol;const n=this.href;this.#n=n.slice(0,s+1)}return this.#n}toString(){return this.href}toJSON(){return this.href}};return te(t.prototype,e.prototype,"_url"),Object.setPrototypeOf(t.prototype,e.prototype),Object.setPrototypeOf(t,e),t})(),F=(()=>{const e=globalThis.Response,t=globalThis.process?.getBuiltinModule?.("node:http")?.STATUS_CODES||{};class r{#e;#r;#n;#t;constructor(n,o){this.#e=n,this.#r=o}get status(){return this.#t?.status||this.#r?.status||200}get statusText(){return this.#t?.statusText||this.#r?.statusText||t[this.status]||""}get headers(){if(this.#t)return this.#t.headers;if(this.#n)return this.#n;const n=this.#r?.headers;return this.#n=n instanceof Headers?n:new Headers(n)}get ok(){if(this.#t)return this.#t.ok;const n=this.status;return n>=200&&n<300}get _response(){return this.#t?this.#t:(this.#t=new e(this.#e,this.#n?{...this.#r,headers:this.#n}:this.#r),this.#r=void 0,this.#n=void 0,this.#e=void 0,this.#t)}nodeResponse(){const n=this.status,o=this.statusText;let i,a,c;this.#t?i=this.#t.body:this.#e&&(this.#e instanceof ReadableStream?i=this.#e:typeof this.#e=="string"?(i=this.#e,a="text/plain; charset=UTF-8",c=Buffer.byteLength(this.#e)):this.#e instanceof ArrayBuffer?(i=Buffer.from(this.#e),c=this.#e.byteLength):this.#e instanceof Uint8Array?(i=this.#e,c=this.#e.byteLength):this.#e instanceof DataView?(i=Buffer.from(this.#e.buffer),c=this.#e.byteLength):this.#e instanceof Blob?(i=this.#e.stream(),a=this.#e.type,c=this.#e.size):typeof this.#e.pipe=="function"?i=this.#e:i=this._response.body);const p=[],u=this.#r?.headers,b=this.#t?.headers||this.#n||(u?Array.isArray(u)?u:u?.entries?u.entries():Object.entries(u).map(([m,g])=>[m.toLowerCase(),g]):void 0);let y,x;if(b)for(const[m,g]of b){if(m==="set-cookie"){for(const T of ee(g))p.push(["set-cookie",T]);continue}p.push([m,g]),m==="content-type"?y=!0:m==="content-length"&&(x=!0)}return a&&!y&&p.push(["content-type",a]),c&&!x&&p.push(["content-length",String(c)]),this.#r=void 0,this.#n=void 0,this.#t=void 0,this.#e=void 0,{status:n,statusText:o,headers:p,body:i}}}return te(r.prototype,e.prototype,"_response"),Object.setPrototypeOf(r,e),Object.setPrototypeOf(r.prototype,e.prototype),r})();var Ee=class{app;req;url;context;static __is_event__=!0;_res;constructor(e,t,r){this.context=t||e.context||new Z,this.req=e,this.app=r;const s=e._url;this.url=s&&s instanceof URL?s:new Te(e.url)}get res(){return this._res||(this._res=new Fe),this._res}get runtime(){return this.req.runtime}waitUntil(e){this.req.waitUntil?.(e)}toString(){return`[${this.req.method}] ${this.req.url}`}toJSON(){return this.toString()}get node(){return this.req.runtime?.node}get headers(){return this.req.headers}get path(){return this.url.pathname+this.url.search}get method(){return this.req.method}},Fe=class{status;statusText;_headers;get headers(){return this._headers||(this._headers=new Headers),this._headers}};const Re=/[^\u0009\u0020-\u007E]/g;function Ne(e=""){return e.replace(Re,"")}function Oe(e,t=200){return!e||(typeof e=="string"&&(e=+e),e<100||e>599)?t:e}var H=class re extends Error{get name(){return"HTTPError"}status;statusText;headers;cause;data;body;unhandled;static isError(t){return t instanceof Error&&t?.name==="HTTPError"}static status(t,r,s){return new re({...s,statusText:r,status:t})}constructor(t,r){let s,n;typeof t=="string"?(s=t,n=r):n=t;const o=Oe(n?.status||n?.cause?.status||n?.status||n?.statusCode,500),i=Ne(n?.statusText||n?.cause?.statusText||n?.statusText||n?.statusMessage),a=s||n?.message||n?.cause?.message||n?.statusText||n?.statusMessage||["HTTPError",o,i].filter(Boolean).join(" ");super(a,{cause:n}),this.cause=n,Error.captureStackTrace?.(this,this.constructor),this.status=o,this.statusText=i||void 0;const c=n?.headers||n?.cause?.headers;this.headers=c?new Headers(c):void 0,this.unhandled=n?.unhandled??n?.cause?.unhandled??void 0,this.data=n?.data,this.body=n?.body}get statusCode(){return this.status}get statusMessage(){return this.statusText}toJSON(){const t=this.unhandled;return{status:this.status,statusText:this.statusText,unhandled:t,message:t?"HTTPError":this.message,data:t?void 0:this.data,...t?void 0:this.body}}};function Ae(e,t){if(e==null)return!0;if(t!=="object")return t==="boolean"||t==="number"||t==="string";if(typeof e.toJSON=="function"||Array.isArray(e))return!0;if(typeof e.pipe=="function"||typeof e.pipeTo=="function")return!1;if(e instanceof Z)return!0;const r=Object.getPrototypeOf(e);return r===Object.prototype||r===null}const He=Symbol.for("h3.notFound"),Pe=Symbol.for("h3.handled");function q(e,t,r={}){if(typeof e?.then=="function")return(e.catch?.(o=>o)||Promise.resolve(e)).then(o=>q(o,t,r));const s=ne(e,t,r);if(typeof s?.then=="function")return q(s,t,r);const{onResponse:n}=r;return n?Promise.resolve(n(s,t)).then(()=>s):s}function ne(e,t,r,s){if(e===Pe)return new F(null);if(e===He&&(e=new H({status:404,message:`Cannot find any route matching [${t.req.method}] ${t.url}`})),e&&e instanceof Error){const o=H.isError(e),i=o?e:new H(e);o||(i.unhandled=!0,e?.stack&&(i.stack=e.stack)),i.unhandled&&!r.silent&&console.error(i);const{onError:a}=r;return a&&!s?Promise.resolve(a(i,t)).catch(c=>c).then(c=>ne(c??e,t,r,!0)):Ie(i,r.debug)}const n=t.res._headers;if(!(e instanceof Response)){const o=Le(e,t,r),i=t.res.status;return new F(z(t.req.method,i)?null:o.body,{status:i,statusText:t.res.statusText,headers:o.headers&&n?U(o.headers,n):o.headers||n})}return n?new F(z(t.req.method,e.status)?null:e.body,{status:e.status,statusText:e.statusText,headers:U(n,e.headers)}):e}function U(e,t){const r=new Headers(e);for(const[s,n]of t)s==="set-cookie"?r.append(s,n):r.set(s,n);return r}const Ce=new Headers({"content-length":"0"}),N=new Headers({"content-type":"application/json;charset=UTF-8"});function Le(e,t,r){if(e==null)return{body:"",headers:Ce};const s=typeof e;if(s==="string")return{body:e};if(e instanceof Uint8Array)return t.res.headers.set("content-length",e.byteLength.toString()),{body:e};if(Ae(e,s))return{body:JSON.stringify(e,void 0,r.debug?2:void 0),headers:N};if(s==="bigint")return{body:e.toString(),headers:N};if(e instanceof Blob){const n={"content-type":e.type,"content-length":e.size.toString()};let o=e.name;return o&&(o=encodeURIComponent(o),n["content-disposition"]=`filename="${o}"; filename*=UTF-8''${o}`),{body:e.stream(),headers:n}}return s==="symbol"?{body:e.toString()}:s==="function"?{body:`${e.name}()`}:{body:e}}function z(e,t){return e==="HEAD"||t===100||t===101||t===102||t===204||t===205||t===304}function Ie(e,t){return new F(JSON.stringify({...e.toJSON(),stack:t&&e.stack?e.stack.split(`
2
+ `).map(r=>r.trim()):void 0},void 0,t?2:void 0),{status:e.status,statusText:e.statusText,headers:e.headers?U(N,e.headers):N})}function je(e){return K(_e,{router:e.router})}const qe=xe(({request:e,router:t,responseHeaders:r})=>ve({request:e,router:t,responseHeaders:r,children:K(je,{router:t})})),V="__TSS_CONTEXT",M=Symbol.for("TSS_SERVER_FUNCTION"),B=Symbol.for("TSS_SERVER_FUNCTION_FACTORY"),P="x-tss-serialized",Ue="x-tss-raw",se=new Q;async function Me(e,t){return se.run(e,t)}function oe(e){const t=se.getStore();if(!t&&e?.throwIfNotFound!==!1)throw new Error("No Start context found in AsyncLocalStorage. Make sure you are using the function within the server runtime.");return t}const ie=()=>oe().startOptions,$e=oe,C=(e,t)=>{const r=t||e||{};return typeof r.method>"u"&&(r.method="GET"),Object.assign(s=>{const n={...r,...s};return C(void 0,n)},{options:r,middleware:s=>{const n=[...r.middleware||[]];s.map(a=>{B in a?a.options.middleware&&n.push(...a.options.middleware):n.push(a)});const o={...r,middleware:n},i=C(void 0,o);return i[B]=!0,i},inputValidator:s=>{const n={...r,inputValidator:s};return C(void 0,n)},handler:(...s)=>{const[n,o]=s,i={...r,extractedFn:n,serverFn:o},a=[...i.middleware||[],ke(i)];return Object.assign(async c=>G(a,"client",{...n,...i,data:c?.data,headers:c?.headers,signal:c?.signal,context:{}}).then(p=>{if(p.error)throw p.error;return p.result}),{...n,__executeServer:async(c,p)=>{const u=$e(),b=u.contextAfterGlobalMiddlewares,y={...n,...c,context:{...b,...c.context},signal:p,request:u.request};return G(a,"server",y).then(x=>({result:x.result,error:x.error,context:x.sendContext}))}})}})};async function G(e,t,r){const s=ie()?.functionMiddleware||[],n=O([...s,...e]),o=async i=>{const a=n.shift();if(!a)return i;"inputValidator"in a.options&&a.options.inputValidator&&t==="server"&&(i.data=await Je(a.options.inputValidator,i.data));let c;return t==="client"?"client"in a.options&&(c=a.options.client):"server"in a.options&&(c=a.options.server),c?De(c,i,async p=>o(p).catch(u=>{if($(u)||j(u))return{...p,error:u};throw u})):o(i)};return o({...r,headers:r.headers||{},sendContext:r.sendContext||{},context:r.context||{}})}function O(e){const t=new Set,r=[],s=n=>{n.forEach(o=>{o.options.middleware&&s(o.options.middleware),t.has(o)||(t.add(o),r.push(o))})};return s(e),r}const De=async(e,t,r)=>e({...t,next:(async(s={})=>r({...t,...s,context:{...t.context,...s.context},sendContext:{...t.sendContext,...s.sendContext??{}},headers:X(t.headers,s.headers),result:s.result!==void 0?s.result:s instanceof Response?s:t.result,error:s.error??t.error}))});function Je(e,t){if(e==null)return{};if("~standard"in e){const r=e["~standard"].validate(t);if(r instanceof Promise)throw new Error("Async validation not supported");if(r.issues)throw new Error(JSON.stringify(r.issues,void 0,2));return r.value}if("parse"in e)return e.parse(t);if(typeof e=="function")return e(t);throw new Error("Invalid validator type!")}function ke(e){return{_types:void 0,options:{inputValidator:e.inputValidator,client:async({next:t,sendContext:r,...s})=>{const n={...s,context:r},o=await e.extractedFn?.(n);return t(o)},server:async({next:t,...r})=>{const s=await e.serverFn?.(r);return t({...r,result:s})}}}}function ze(){return[...ie()?.serializationAdapters?.map(ye)??[],...me]}const ae=new Q;function Ve(e){return(t,r)=>{const s=new Ee(t),n=ae.run({h3Event:s},()=>e(t,r));return q(n,s)}}function Be(){const e=ae.getStore();if(!e)throw new Error("No StartEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.");return e.h3Event}function W(){return Be()._res}async function Ge(){const{tsrStartManifest:e}=await import("./_tanstack-start-manifest_v-Chz34YFq.mjs"),t=e(),r=t.routes[D]=t.routes[D]||{};r.assets=r.assets||[];let s=`import('${t.clientEntry}')`;return r.assets.push({tag:"script",attrs:{type:"module",async:!0},children:s}),{routes:Object.fromEntries(Object.entries(t.routes).map(([n,o])=>{const i={};let a=!1;return o.preloads&&o.preloads.length>0&&(i.preloads=o.preloads,a=!0),o.assets&&o.assets.length>0&&(i.assets=o.assets,a=!0),a?[n,i]:[]}))}}const We={"00fb1fe03e9689cf8c179ba0d5cadc5eeaa6879def224ac38037d70a1a51300d":{functionName:"fetchFilesFn_createServerFn_handler",importer:()=>import("./files-CIdgnUJn.mjs")},ac7bf7f1d727949cd28713a8f36bb77e7bd8fc0e48854ed8cb1ee93ce80fb6d0:{functionName:"createFileFn_createServerFn_handler",importer:()=>import("./files-CIdgnUJn.mjs")},b41e844ce533c224e7c720e69d821468deffcbf208fc008a7f5af83cb0596b15:{functionName:"readFileFn_createServerFn_handler",importer:()=>import("./files-CIdgnUJn.mjs")},"1b2a0d276d9ce90b2a1d72134c1bf95b9f6b7b049a8f415e8f0da3e6fc5ce4ae":{functionName:"saveFileFn_createServerFn_handler",importer:()=>import("./files-CIdgnUJn.mjs")},"098d52adf25ea567d43facba347871f887828c6ab804021bbfa0f2759209c0c6":{functionName:"renameFileFn_createServerFn_handler",importer:()=>import("./files-CIdgnUJn.mjs")},efbbc22c41cf491631b07076417c9ec65d5ac71debfcc00b5a7e0d368772104f:{functionName:"moveFileFn_createServerFn_handler",importer:()=>import("./files-CIdgnUJn.mjs")},"33557b2fcc5cedc5814d20bca9cd9cde2e45318755de1da4d613e8fa84ee38d1":{functionName:"getDevicesFn_createServerFn_handler",importer:()=>import("./list-Dq_Nh07i.mjs")},"05faf0772038a170c70083fd8de4a8b77a40e4ec46e0bbf6878670f02621b5df":{functionName:"getElementIdFn_createServerFn_handler",importer:()=>import("./hierarchy-Q35yGKlr.mjs")},"9bcbf5303827d2a25f347c2054b0121655a82322fa07108653f43246875348f7":{functionName:"findElementByIdFn_createServerFn_handler",importer:()=>import("./hierarchy-Q35yGKlr.mjs")},c5aeaa72b9b3303af5d82ee2fa59e3e90ffef3c3f0fb32707cee49e78ff41066:{functionName:"screenshotFn_createServerFn_handler",importer:()=>import("./screenshot-BD59si87.mjs")},fcbe7e11d05240fa28a1dd79ec8c395f6c03682edbaeb19f469bd78d6399cdde:{functionName:"populateCacheMutation_createServerFn_handler",importer:()=>import("./client-CzCEo8ab.mjs")},"7d2aacaab26ab11cdc66f03a4ed01b8b38186abf16ab1f9306801ea7769aaa2a":{functionName:"executeFromCacheMutation_createServerFn_handler",importer:()=>import("./client-CzCEo8ab.mjs")},"5918013064f9b88efb265b30a770275d6c9d52bf42318f451bab8a47bc850917":{functionName:"executeAgentStepFn_createServerFn_handler",importer:()=>import("./agent-CeaBVldB.mjs")},"9f335634267a450fc9f34b1ab33c55da00cb1efc709604b2e3114602020075a2":{functionName:"disableAnimationsFn_createServerFn_handler",importer:()=>import("./adb-CsX2v8FE.mjs")},f8084cb106c8126bb2deaeef7c98992d9ff9475ad3dc85c6ced04f08c3962b6e:{functionName:"describeInteractionFn_createServerFn_handler",importer:()=>import("./describe-NXd8kuzS.mjs")},eea1073a910f7f023004366aafcef05a8c47a3a1a4a09721f71a2efe311ee70f:{functionName:"startAppiumFn_createServerFn_handler",importer:()=>import("./appium-BbkeYpmk.mjs")},"6dbdc2968dc27a948c345034d1e55082b86918953b61da020ea8dd5836c79db3":{functionName:"getAppiumStatusFn_createServerFn_handler",importer:()=>import("./appium-BbkeYpmk.mjs")},"605c05774def700303f9889c0f8a28fed026e0b5c36a1563cff2835ee01d26b1":{functionName:"tapFn_createServerFn_handler",importer:()=>import("./actions-2SMY1JO3.mjs")},"07e23aa87e88d53c6c9e3d8e88de788d27d7b10930150bc4fd510d4447aaf3de":{functionName:"typeFn_createServerFn_handler",importer:()=>import("./actions-2SMY1JO3.mjs")},"5c526b678a7596f28beca76784df0ac58acd292627c5770c0c8029e38e4681ec":{functionName:"scrollFn_createServerFn_handler",importer:()=>import("./actions-2SMY1JO3.mjs")},"2b4a002699960d578addbcf4dd83fedcec62444d7da4bf7c2359be991ed6207e":{functionName:"swipeFn_createServerFn_handler",importer:()=>import("./actions-2SMY1JO3.mjs")},"10b616f4aacf11bb275166e4ae03f441f1d7c9a68a670dfadb03b74e1d012900":{functionName:"scrollUntilFn_createServerFn_handler",importer:()=>import("./actions-2SMY1JO3.mjs")},"566ee4344553ab6300f847f5de346e037f92d986cb824ba1c313346e62345fbe":{functionName:"deepLinkFn_createServerFn_handler",importer:()=>import("./actions-2SMY1JO3.mjs")}};async function ce(e){const t=We[e];if(!t)throw new Error("Server function info not found for "+e);const r=await t.importer();if(!r)throw console.info("serverFnInfo",t),new Error("Server function module not resolved for "+e);const s=r[t.functionName];if(!s)throw console.info("serverFnInfo",t),console.info("fnModule",r),new Error(`Server function module export not resolved for serverFn ID: ${e}`);return s}let L;const Ye=async({request:e,context:t})=>{const r=new AbortController,s=r.signal,n=()=>r.abort();e.signal.addEventListener("abort",n),L===void 0&&(L=new RegExp("/_serverFn/([^/?#]+)"));const o=e.method,i=new URL(e.url,"http://localhost:3000"),a=i.pathname.match(L),c=a?a[1]:null,p=Object.fromEntries(i.searchParams.entries()),u="createServerFn"in p;if(typeof c!="string")throw new Error("Invalid server action param for serverFnId: "+c);const b=await ce(c),y=["multipart/form-data","application/x-www-form-urlencoded"],x=e.headers.get("Content-Type"),m=ze();function g(h){return k(h,{plugins:m})}const T=await(async()=>{try{let h=await(async()=>{if(y.some(d=>x&&x.includes(d))){J(o.toLowerCase()!=="get","GET requests with FormData payloads are not supported");const d=await e.formData(),v=d.get(V);d.delete(V);const E={context:t,data:d};if(typeof v=="string")try{const S=JSON.parse(v),_=k(S,{plugins:m});typeof _=="object"&&_&&(E.context={...t,..._})}catch{}return await b(E,s)}if(o.toLowerCase()==="get"){J(u,"expected GET request to originate from createServerFn");let d=p.payload;return d=d?g(JSON.parse(d)):{},d.context={...t,...d.context},await b(d,s)}if(o.toLowerCase()!=="post")throw new Error("expected POST method");let l;if(x?.includes("application/json")&&(l=await e.json()),u){const d=l?g(l):{};return d.context={...d.context,...t},await b(d,s)}return await b(...l)})();if(h.result instanceof Response)return h.result.headers.set(Ue,"true"),h.result;if(!u&&(h=h.result,h instanceof Response))return h;if(j(h))return Y(h);const f=W();let w;if(h!==void 0){let l=!1;const d={onParse:S=>{w=S},onDone:()=>{l=!0},onError:S=>{throw S}};if(ge(h,{refs:new Map,plugins:m,onParse(S){d.onParse(S)},onDone(){d.onDone()},onError:S=>{d.onError(S)}}),l)return new Response(w?JSON.stringify(w):void 0,{status:f?.status,statusText:f?.statusText,headers:{"Content-Type":"application/json",[P]:"true"}});const v=new TextEncoder,E=new ReadableStream({start(S){d.onParse=_=>S.enqueue(v.encode(JSON.stringify(_)+`
3
+ `)),d.onDone=()=>{try{S.close()}catch(_){S.error(_)}},d.onError=_=>S.error(_),w!==void 0&&d.onParse(w)}});return new Response(E,{status:f?.status,statusText:f?.statusText,headers:{"Content-Type":"application/x-ndjson",[P]:"true"}})}return new Response(void 0,{status:f?.status,statusText:f?.statusText})}catch(h){if(h instanceof Response)return h;if(j(h))return Y(h);console.info(),console.info("Server Fn Error!"),console.info(),console.error(h),console.info();const f=JSON.stringify(await Promise.resolve(Se(h,{refs:new Map,plugins:m}))),w=W();return new Response(f,{status:w?.status??500,statusText:w?.statusText,headers:{"Content-Type":"application/json",[P]:"true"}})}})();return e.signal.removeEventListener("abort",n),T};function Y(e){const{headers:t,...r}=e;return new Response(JSON.stringify(r),{status:404,headers:{"Content-Type":"application/json",...t||{}}})}const Xe={TSS_SHELL:"X-TSS_SHELL"},Qe=(e,t)=>Object.assign(t,{functionId:e,[M]:!0}),Ze=he({key:"$TSS/serverfn",test:e=>typeof e!="function"||!(M in e)?!1:!!e[M],toSerializable:({functionId:e})=>({functionId:e}),fromSerializable:({functionId:e})=>Qe(e,async(t,r)=>(await(await ce(e))(t??{},r)).result)});function Ke(e){return X({"Content-Type":"text/html; charset=utf-8"},...e.router.state.matches.map(t=>t.headers))}function et(e){let t=null,r=null,s=null;const n=async()=>(s===null&&(s=await import("./router-vxnEMbKX.mjs")),r===null&&(r=await import("./start-BClswEUm.mjs")),{startEntry:r,routerEntry:s});return Ve(async(o,i)=>{let a=null,c=!1;try{const p=be(o),u=new URL(o.url),b=u.href.replace(u.origin,""),y=await(await n()).startEntry.startInstance?.getOptions()||{},x=[...y.serializationAdapters||[],Ze],m={...y,serializationAdapters:x},g=async()=>{if(a)return a;a=await(await n()).routerEntry.getRouter();const w=process.env.TSS_PRERENDERING==="true";let l=process.env.TSS_SHELL==="true";w&&!l&&(l=o.headers.get(Xe.TSS_SHELL)==="true");const d=fe({initialEntries:[b]});return a.update({history:d,isShell:l,isPrerendering:w,origin:a.options.origin??p,defaultSsr:m.defaultSsr,serializationAdapters:[...m.serializationAdapters,...a.options.serializationAdapters||[]],basepath:"/"}),a},T=R(async({context:w})=>await Me({getRouter:g,startOptions:m,contextAfterGlobalMiddlewares:w,request:o},async()=>{try{return b.startsWith("/_serverFn/")?await Ye({request:o,context:i?.context}):await tt({getRouter:g,request:o,executeRouter:async({serverContext:l})=>{const d=(o.headers.get("Accept")||"*/*").split(",");if(!["*/*","text/html"].some(S=>d.some(_=>_.trim().startsWith(S))))return A({error:"Only HTML requests are supported here"},{status:500});t===null&&(t=await Ge());const v=await g();if(we({router:v,manifest:t}),v.update({additionalContext:{serverContext:l}}),await v.load(),v.state.redirect)return v.state.redirect;await v.serverSsr.dehydrate();const E=Ke({router:v});return c=!0,await e({request:o,router:v,responseHeaders:E})},context:w})}catch(l){if(l instanceof Response)return l;throw l}})),h=(y.requestMiddleware?O(y.requestMiddleware):[]).map(w=>w.options.server),f=(await ue([...h,T],{request:o,context:i?.context||{}})).response;if($(f)){if(pe(f))return o.headers.get("x-tsr-redirect")==="manual"?A({...f.options,isSerializedRedirect:!0},{headers:f.headers}):f;if(f.options.to&&typeof f.options.to=="string"&&!f.options.to.startsWith("/"))throw new Error(`Server side redirects must use absolute paths via the 'href' or 'to' options. The redirect() method's "to" property accepts an internal path only. Use the "href" property to provide an external URL. Received: ${JSON.stringify(f.options)}`);if(["params","search","hash"].some(l=>typeof f.options[l]=="function"))throw new Error(`Server side redirects must use static search, params, and hash values and do not support functional values. Received functional values for: ${Object.keys(f.options).filter(l=>typeof f.options[l]=="function").map(l=>`"${l}"`).join(", ")}`);const w=(await g()).resolveRedirect(f);return o.headers.get("x-tsr-redirect")==="manual"?A({...f.options,isSerializedRedirect:!0},{headers:f.headers}):w}return f}finally{a&&!c&&a.serverSsr?.cleanup(),a=null}})}async function tt({getRouter:e,request:t,executeRouter:r,context:s}){const n=await e();let o=new URL(t.url);o=le(n.rewrite,o);const i=o.pathname,{matchedRoutes:a,foundRoute:c,routeParams:p}=n.getMatchedRoutes(i),u=O(a.flatMap(y=>y.options.server?.middleware).filter(Boolean)).map(y=>y.options.server),b=c?.options.server;if(b&&b.handlers){const y=typeof b.handlers=="function"?b.handlers({createHandlers:g=>g}):b.handlers,x=t.method.toUpperCase(),m=y[x]??y.ANY;if(m){const g=!!c.options.component;if(typeof m=="function")u.push(R(m,g));else{const{middleware:T}=m;T&&T.length&&u.push(...O(T).map(h=>h.options.server)),m.handler&&u.push(R(m.handler,g))}}}return u.push(R(y=>r({serverContext:y.context}))),(await ue(u,{request:t,context:s,params:p,pathname:i})).response}function rt(){throw process.env.NODE_ENV==="development"?new Error("It looks like you forgot to return a response from your server route handler. If you want to defer to the app router, make sure to have a component set in this route."):new Error("Internal Server Error")}function nt(){throw process.env.NODE_ENV==="development"?new Error("You cannot defer to the app router if there is no component defined on this route."):new Error("Internal Server Error")}function R(e,t=!1){return t?e:async({next:r,...s})=>{const n=await e({...s,next:nt});return n||rt(),n}}function ue(e,t){let r=-1;const s=async n=>{r++;const o=e[r];if(!o)return n;let i;try{i=await o({...n,next:async a=>{const c=await s({...n,...a,context:{...n.context,...a?.context||{}}});return Object.assign(n,I(c))}})}catch(a){if(de(a))i={response:a};else throw a}return Object.assign(n,I(i))};return I(s(t))}function I(e){return de(e)?{response:e}:e}function de(e){return st(e)||$(e)}function st(e){return e instanceof Response}const ot=et(qe);function it(e){return{async fetch(...t){return await e.fetch(...t)}}}const Ft=it({fetch:ot});export{M as T,C as a,Qe as c,it as createServerEntry,Ft as default,ce as g};
@@ -0,0 +1 @@
1
+ const t=void 0;export{t as startInstance};
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";const n=e.object({x:e.number(),y:e.number(),screenWidth:e.number().optional(),screenHeight:e.number().optional()}),t=n,o=e.object({text:e.string()}),r=e.object({direction:e.enum(["up","down"])}),i=e.object({x1:e.number(),y1:e.number(),x2:e.number(),y2:e.number(),duration:e.number().optional().default(500)}),m=e.object({text:e.string().optional(),elementId:e.string().optional(),direction:e.enum(["up","down"]),maxScrolls:e.number().optional()}),u=e.object({url:e.string()}),b=e.object({elementId:e.string()}),l=e.object({mode:e.enum(["adb","appium"])});e.union([t,o,r,i,m,u,b,l]);e.enum(["tap","type","scroll","swipe","scrollUntil","deepLink","elementId"]);export{i as a,r as c,b as i,m,n,o,u as r,t};
@@ -0,0 +1 @@
1
+ import e from"zod";import{Store as u}from"@tanstack/react-store";import{t as o,o as g,c as b,m as x,r as y}from"./step-CEQtT3SD.mjs";const n=e.object({id:e.number(),descriptionText:e.string().optional(),optional:e.boolean().optional(),status:e.string().optional(),statusColor:e.string().optional(),statusDiv:e.custom().optional(),element:e.custom().optional(),originRef:e.object({refId:e.number(),path:e.string(),descriptionText:e.string().optional(),optional:e.boolean().optional(),overrides:e.record(e.string(),e.string()).optional()}).optional()}),i=n.extend({cropBase64:e.string().optional()}),r=i.extend(o.shape).extend({type:e.literal("tap"),elementId:e.string().optional(),timeout:e.number().optional(),useLlmOnly:e.boolean().optional()}),a=i.extend(o.shape).extend({type:e.literal("assert"),cropBase64:e.string().optional(),elementId:e.string().optional(),timeout:e.number().optional(),useLlmOnly:e.boolean().optional()}),s=n.extend(g.shape).extend({type:e.literal("type")}),l=n.extend(b.shape).extend({type:e.literal("scroll")}),p=n.extend(x.shape).extend({type:e.literal("scrollUntil")}),d=n.extend(y.shape).extend({type:e.literal("deeplink")}),c=n.extend({type:e.literal("ai"),instruction:e.string()}),m=n.extend({type:e.literal("fileRef"),path:e.string(),overrides:e.record(e.string(),e.string()).optional()}),t={statusDiv:!0,element:!0,status:!0,statusColor:!0,originRef:!0},f=e.discriminatedUnion("type",[r,a,s,l,p,d,c,m]),R=e.enum(["tap","assert","type","scroll","scrollUntil","deeplink","ai","fileRef"]),h=e.object({name:e.string(),steps:e.array(f),params:e.record(e.string(),e.string())});e.object({isRecording:e.boolean(),enableAnimations:e.boolean(),mode:e.enum(["interact","assert"]),test:h,isPlaying:e.boolean(),isDeviceConnected:e.boolean(),connectionStatus:e.string(),currentStepId:e.number().nullable(),selectedPlatform:e.enum(["android","ios"]).default("android"),selectedDeviceId:e.string().optional(),executionLog:e.array(e.object({stepId:e.number(),stepNumber:e.number(),screenshot:e.string(),cacheHit:e.boolean(),timestamp:e.number()})).default([]),currentScreenshot:e.string().nullable().default(null)});const v=e.discriminatedUnion("type",[r.omit(t),a.omit(t),s.omit(t),l.omit(t),p.omit(t),d.omit(t),c.omit(t),m.omit(t)]),D=e.object({name:e.string(),steps:e.array(v),params:e.record(e.string(),e.string())}),C=new u({isRecording:!1,enableAnimations:!0,mode:"interact",test:{name:"untitled",steps:[],params:{}},isPlaying:!1,isDeviceConnected:!1,connectionStatus:"Connecting...",currentStepId:null,selectedPlatform:"android",selectedDeviceId:void 0,executionLog:[],currentScreenshot:null});export{R as I,C as R,m as S,p as c,a as i,D as j,l,c as m,d as p,s as r,r as s,f as y};
@@ -0,0 +1,7 @@
1
+ import tt from"node:http";import{Readable as et}from"node:stream";import st from"node:https";import rt from"node:http2";import{promises as nt}from"node:fs";import{fileURLToPath as ot}from"node:url";import{dirname as it,resolve as at}from"node:path";globalThis.__nitro_main__=import.meta.url;function ht(t){let e,n;return{fetch(s){return n?n.fetch(s):(e||(e=t().then(r=>n=r.default||r)),e.then(r=>r.fetch(s)))}}}const ct={ssr:ht(()=>import("./chunks/_/server.mjs"))};globalThis.__nitro_vite_envs__=ct;const ut=(()=>{const t=globalThis.process?.env??{};return t.NO_COLOR==="1"||t.TERM==="dumb"})(),q=(t,e=39)=>n=>ut?n:`\x1B[${t}m${n}\x1B[${e}m`,ft=q(31),O=q(90);function S(t,e,n){for(const s of[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]){if(s==="constructor")continue;const r=Object.getOwnPropertyDescriptor(t,s),o=Object.getOwnPropertyDescriptor(e,s);let i=!1;o.get&&(i=!0,o.get=r?.get||function(){return this[n][s]}),o.set&&(i=!0,o.set=r?.set||function(a){this[n][s]=a}),!r?.value&&typeof o.value=="function"&&(i=!0,o.value=function(...a){return this[n][s](...a)}),i&&Object.defineProperty(t,s,o)}}const dt=(()=>{const t=globalThis.URL,e=class{#t;#e;#r;#s;#o;#n;#i;#a;constructor(s){typeof s=="string"?this.#e=s:(this.#r=s.protocol,this.#s=s.host,this.#o=s.pathname,this.#n=s.search)}static[Symbol.hasInstance](s){return s instanceof t}get _url(){return this.#t?this.#t:(this.#t=new t(this.href),this.#e=void 0,this.#r=void 0,this.#s=void 0,this.#o=void 0,this.#n=void 0,this.#i=void 0,this.#a=void 0,this.#t)}get href(){return this.#t?this.#t.href:(this.#e||(this.#e=`${this.#r||"http:"}//${this.#s||"localhost"}${this.#o||"/"}${this.#n||""}`),this.#e)}#h(){if(!this.#a){const s=this.href,r=s.indexOf("://"),o=r===-1?-1:s.indexOf("/",r+4);this.#a=[r,o,o===-1?-1:s.indexOf("?",o)]}return this.#a}get pathname(){if(this.#t)return this.#t.pathname;if(this.#o===void 0){const[,s,r]=this.#h();if(s===-1)return this._url.pathname;this.#o=this.href.slice(s,r===-1?void 0:r)}return this.#o}get search(){if(this.#t)return this.#t.search;if(this.#n===void 0){const[,s,r]=this.#h();if(s===-1)return this._url.search;const o=this.href;this.#n=r===-1||r===o.length-1?"":o.slice(r)}return this.#n}get searchParams(){return this.#t?this.#t.searchParams:(this.#i||(this.#i=new URLSearchParams(this.search)),this.#i)}get protocol(){if(this.#t)return this.#t.protocol;if(this.#r===void 0){const[s]=this.#h();if(s===-1)return this._url.protocol;this.#r=this.href.slice(0,s+1)}return this.#r}toString(){return this.href}toJSON(){return this.href}};return S(e.prototype,t.prototype,"_url"),Object.setPrototypeOf(e.prototype,t.prototype),Object.setPrototypeOf(e,t),e})();function lt(t){const e=t.port??globalThis.process?.env.PORT??3e3,n=typeof e=="number"?e:Number.parseInt(e,10);if(n<0||n>65535)throw new RangeError(`Port must be between 0 and 65535 (got "${n}").`);return{port:n,hostname:t.hostname??globalThis.process?.env.HOST}}function pt(t,e,n){if(!(!t||!e))return t.includes(":")&&(t=`[${t}]`),`http${n?"s":""}://${t}:${e}/`}function mt(t,e){if(!e||(t.silent??globalThis.process?.env?.TEST))return;const n=new URL(e),s=n.hostname==="[::]"||n.hostname==="0.0.0.0";s&&(n.hostname="localhost",e=n.href);let r="➜ Listening on:",o=s?" (all interfaces)":"";globalThis.process.stdout?.isTTY&&(r=`\x1B[32m${r}\x1B[0m`,e=`\x1B[36m${e}\x1B[0m`,o=`\x1B[2m${o}\x1B[0m`),console.log(`${r} ${e}${o}`)}function gt(t){if(!t.tls||t.protocol==="http")return;const e=L(t.tls.cert),n=L(t.tls.key);if(!e&&!n){if(t.protocol==="https")throw new TypeError("TLS `cert` and `key` must be provided for `https` protocol.");return}if(!e||!n)throw new TypeError("TLS `cert` and `key` must be provided together.");return{cert:e,key:n,passphrase:t.tls.passphrase}}function L(t){if(!t)return;if(typeof t!="string")throw new TypeError("TLS certificate and key must be strings in PEM format or file paths.");if(t.startsWith("-----BEGIN "))return t;const{readFileSync:e}=process.getBuiltinModule("node:fs");return e(t,"utf8")}function yt(){const t=new Set;return{waitUntil:e=>{typeof e?.then=="function"&&t.add(Promise.resolve(e).catch(console.error).finally(()=>{t.delete(e)}))},wait:()=>Promise.all(t)}}function bt(t){const e=t.options.fetch,n=t.options.middleware||[];return n.length===0?e:s=>D(s,e,n,0)}function D(t,e,n,s){return s===n.length?e(t):n[s](t,()=>D(t,e,n,s+1))}const wt=t=>{const e=t.options.error;e&&t.options.middleware.unshift((n,s)=>{try{const r=s();return r instanceof Promise?r.catch(o=>e(o)):r}catch(r){return e(r)}})},Tt=t=>{const e=t.options?.gracefulShutdown;if(!globalThis.process?.on||e===!1||e===void 0&&(process.env.CI||process.env.TEST))return;const n=e===!0||!e?.gracefulTimeout?Number.parseInt(process.env.SERVER_SHUTDOWN_TIMEOUT||"")||3:e.gracefulTimeout,s=e===!0||!e?.forceTimeout?Number.parseInt(process.env.SERVER_FORCE_SHUTDOWN_TIMEOUT||"")||5:e.forceTimeout;let r=!1;const o=async()=>{if(r)return;r=!0;const i=process.stderr.write.bind(process.stderr);i(O(`
2
+ Shutting down server in ${n}s...`));let a;await Promise.race([t.close().finally(()=>{clearTimeout(a),i(O(` Server closed.
3
+ `))}),new Promise(h=>{a=setTimeout(()=>(i(O(`
4
+ Force closing connections in ${s}s...`)),a=setTimeout(()=>{i(ft(`
5
+ Could not close connections in time, force exiting.`)),h()},s*1e3),t.close(!0)),n*1e3)})]),globalThis.process.exit(0)};for(const i of["SIGINT","SIGTERM"])globalThis.process.on(i,o)},St=(()=>{const t=globalThis.Response,e=globalThis.process?.getBuiltinModule?.("node:http")?.STATUS_CODES||{};class n{#t;#e;#r;#s;constructor(r,o){this.#t=r,this.#e=o}static[Symbol.hasInstance](r){return r instanceof t}get status(){return this.#s?.status||this.#e?.status||200}get statusText(){return this.#s?.statusText||this.#e?.statusText||e[this.status]||""}get headers(){if(this.#s)return this.#s.headers;if(this.#r)return this.#r;const r=this.#e?.headers;return this.#r=r instanceof Headers?r:new Headers(r)}get ok(){if(this.#s)return this.#s.ok;const r=this.status;return r>=200&&r<300}get _response(){return this.#s?this.#s:(this.#s=new t(this.#t,this.#r?{...this.#e,headers:this.#r}:this.#e),this.#e=void 0,this.#r=void 0,this.#t=void 0,this.#s)}_toNodeResponse(){const r=this.status,o=this.statusText;let i,a,h;this.#s?i=this.#s.body:this.#t&&(this.#t instanceof ReadableStream?i=this.#t:typeof this.#t=="string"?(i=this.#t,a="text/plain; charset=UTF-8",h=Buffer.byteLength(this.#t)):this.#t instanceof ArrayBuffer?(i=Buffer.from(this.#t),h=this.#t.byteLength):this.#t instanceof Uint8Array?(i=this.#t,h=this.#t.byteLength):this.#t instanceof DataView?(i=Buffer.from(this.#t.buffer),h=this.#t.byteLength):this.#t instanceof Blob?(i=this.#t.stream(),a=this.#t.type,h=this.#t.size):typeof this.#t.pipe=="function"?i=this.#t:i=this._response.body);const c=[],u=this.#e?.headers,l=this.#s?.headers||this.#r||(u?Array.isArray(u)?u:u?.entries?u.entries():Object.entries(u).map(([f,d])=>[f.toLowerCase(),d]):void 0);let p,m;if(l)for(const[f,d]of l){if(Array.isArray(d))for(const _ of d)c.push([f,_]);else c.push([f,d]);f==="content-type"?p=!0:f==="content-length"&&(m=!0)}return a&&!p&&c.push(["content-type",a]),h&&!m&&c.push(["content-length",String(h)]),this.#e=void 0,this.#r=void 0,this.#s=void 0,this.#t=void 0,{status:r,statusText:o,headers:c,body:i}}}return S(n.prototype,t.prototype,"_response"),Object.setPrototypeOf(n,t),Object.setPrototypeOf(n.prototype,t.prototype),n})();async function N(t,e){if(!e)return t.statusCode=500,x(t);if(e._toNodeResponse){const s=e._toNodeResponse();if(A(t,s.status,s.statusText,s.headers),s.body){if(s.body instanceof ReadableStream)return U(s.body,t);if(typeof s.body?.pipe=="function")return s.body.pipe(t),new Promise(r=>t.on("close",r));t.write(s.body)}return x(t)}const n=[...e.headers];return A(t,e.status,e.statusText,n),e.body?U(e.body,t):x(t)}function A(t,e,n,s){const r=globalThis.Deno?s:s.flat();t.headersSent||(t.req?.httpVersion==="2.0"?t.writeHead(e,r):t.writeHead(e,n,r))}function x(t){return new Promise(e=>t.end(e))}function U(t,e){if(e.destroyed){t.cancel();return}const n=t.getReader();function s(o){n.cancel(o).catch(()=>{}),o&&e.destroy(o)}function r({done:o,value:i}){try{o?e.end():e.write(i)?n.read().then(r,s):e.once("drain",()=>n.read().then(r,s))}catch(a){s(a instanceof Error?a:void 0)}}return e.on("close",s),e.on("error",s),n.read().then(r,s),n.closed.catch(s).finally(()=>{e.off("close",s),e.off("error",s)})}var _t=class extends dt{#t;constructor({req:t}){const e=t.url||"/";if(e[0]==="/"){const n=e.indexOf("?"),s=n===-1?e:e?.slice(0,n)||"/",r=n===-1?"":e?.slice(n)||"",o=t.headers.host||t.headers[":authority"]||`${t.socket.localFamily==="IPv6"?"["+t.socket.localAddress+"]":t.socket.localAddress}:${t.socket?.localPort||"80"}`,i=t.socket?.encrypted||t.headers["x-forwarded-proto"]==="https"||t.headers[":scheme"]==="https"?"https:":"http:";super({protocol:i,host:o,pathname:s,search:r})}else super(e);this.#t=t}get pathname(){return super.pathname}set pathname(t){this._url.pathname=t,this.#t.url=this._url.pathname+this._url.search}};const Ot=(()=>{const t=globalThis.Headers;class e{#t;#e;constructor(s){this.#t=s}static[Symbol.hasInstance](s){return s instanceof t}get _headers(){if(!this.#e){const s=new t,r=this.#t.rawHeaders,o=r.length;for(let i=0;i<o;i+=2){const a=r[i];if(a.charCodeAt(0)===58)continue;const h=r[i+1];s.append(a,h)}this.#e=s}return this.#e}get(s){if(this.#e)return this.#e.get(s);const r=this.#t.headers[s.toLowerCase()];return Array.isArray(r)?r.join(", "):r||null}has(s){return this.#e?this.#e.has(s):s.toLowerCase()in this.#t.headers}getSetCookie(){if(this.#e)return this.#e.getSetCookie();const s=this.#t.headers["set-cookie"];return Array.isArray(s)?s:s?[s]:[]}*_entries(){const s=this.#t.rawHeaders,r=s.length;for(let o=0;o<r;o+=2){const i=s[o];i.charCodeAt(0)!==58&&(yield[i.toLowerCase(),s[o+1]])}}entries(){return this.#e?this.#e.entries():this._entries()}[Symbol.iterator](){return this.entries()}}return S(e.prototype,t.prototype,"_headers"),Object.setPrototypeOf(e,t),Object.setPrototypeOf(e.prototype,t.prototype),e})(),xt=(()=>{const t=globalThis[Symbol.for("srvx.nativeRequest")]??=globalThis.Request,e=class extends t{static _srvx=!0;static[Symbol.hasInstance](r){return this===e?r instanceof t:Object.prototype.isPrototypeOf.call(this.prototype,r)}constructor(r,o){typeof r=="object"&&"_request"in r&&(r=r._request),o?.body?.getReader!==void 0&&(o.duplex??="half"),super(r,o)}};globalThis.Request._srvx||(globalThis.Request=e);class n{runtime;#t;#e;#r;#s;#o;#n;constructor(r){this.#t=r.req,this.runtime={name:"node",node:r}}static[Symbol.hasInstance](r){return r instanceof t}get ip(){return this.#t.socket?.remoteAddress}get method(){return this.#s?this.#s.method:this.#t.method||"GET"}get _url(){return this.#e||=new _t({req:this.#t})}set _url(r){this.#e=r}get url(){return this.#s?this.#s.url:this._url.href}get headers(){return this.#s?this.#s.headers:this.#o||=new Ot(this.#t)}get _abortController(){if(!this.#n){this.#n=new AbortController;const r=this.#t,o=i=>{this.#n?.abort?.(i)};r.once("error",o),r.once("end",o)}return this.#n}get signal(){return this.#s?this.#s.signal:this._abortController.signal}get body(){if(this.#s)return this.#s.body;if(this.#r===void 0){const r=this.method;this.#r=r==="GET"||r==="HEAD"?null:et.toWeb(this.#t)}return this.#r}text(){return this.#s?this.#s.text():this.#r!==void 0?this.#r?new Response(this.#r).text():Promise.resolve(""):Rt(this.#t).then(r=>r.toString())}json(){return this.#s?this.#s.json():this.text().then(r=>JSON.parse(r))}get _request(){return this.#s||(this.#s=new e(this.url,{method:this.method,headers:this.headers,body:this.body,signal:this._abortController.signal}),this.#o=void 0,this.#r=void 0),this.#s}}return S(n.prototype,t.prototype,"_request"),Object.setPrototypeOf(n.prototype,t.prototype),n})();function Rt(t){return new Promise((e,n)=>{const s=[],r=a=>{s.push(a)},o=a=>{n(a)},i=()=>{t.off("error",o),t.off("data",r),e(Buffer.concat(s))};t.on("data",r).once("end",i).once("error",o)})}function Pt(t){return new Ht(t)}var Ht=class{runtime="node";options;node;serveOptions;fetch;#t;#e;#r;constructor(t){this.options={...t,middleware:[...t.middleware||[]]};for(const a of t.plugins||[])a(this);wt(this),Tt(this);const e=this.fetch=bt(this);this.#r=yt();const n=(a,h)=>{const c=new xt({req:a,res:h});c.waitUntil=this.#r.waitUntil;const u=e(c);return u instanceof Promise?u.then(l=>N(h,l)):N(h,u)},s=gt(this.options),{port:r,hostname:o}=lt(this.options);this.serveOptions={port:r,host:o,exclusive:!this.options.reusePort,...s?{cert:s.cert,key:s.key,passphrase:s.passphrase}:{},...this.options.node};let i;if(this.#t=!!this.serveOptions.cert&&this.options.protocol!=="http",this.options.node?.http2??this.#t)if(this.#t)i=rt.createSecureServer({allowHTTP1:!0,...this.serveOptions},n);else throw new Error("node.http2 option requires tls certificate!");else this.#t?i=st.createServer(this.serveOptions,n):i=tt.createServer(this.serveOptions,n);this.node={server:i,handler:n},t.manual||this.serve()}serve(){if(this.#e)return Promise.resolve(this.#e).then(()=>this);this.#e=new Promise(t=>{this.node.server.listen(this.serveOptions,()=>{mt(this.options,this.url),t()})})}get url(){const t=this.node?.server?.address();if(t)return typeof t=="string"?t:pt(t.address,t.port,this.#t)}ready(){return Promise.resolve(this.#e).then(()=>this)}async close(t){await Promise.all([this.#r.wait(),new Promise((e,n)=>{const s=this.node?.server;if(!s)return e();t&&"closeAllConnections"in s&&s.closeAllConnections(),s.close(r=>r?n(r):e())})])}};const z=(()=>{const t=function(){};return t.prototype=Object.create(null),Object.freeze(t.prototype),t})();function M(t,e,n){for(const s of[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]){if(s==="constructor")continue;const r=Object.getOwnPropertyDescriptor(t,s),o=Object.getOwnPropertyDescriptor(e,s);let i=!1;o.get&&(i=!0,o.get=r?.get||function(){return this[n][s]}),o.set&&(i=!0,o.set=r?.set||function(a){this[n][s]=a}),!r?.value&&typeof o.value=="function"&&(i=!0,o.value=function(...a){return this[n][s](...a)}),i&&Object.defineProperty(t,s,o)}}const Et=(()=>{const t=globalThis.URL,e=class{#t;#e;#r;#s;#o;#n;#i;#a;constructor(s){typeof s=="string"?this.#e=s:(this.#r=s.protocol,this.#s=s.host,this.#o=s.pathname,this.#n=s.search)}static[Symbol.hasInstance](s){return s instanceof t}get _url(){return this.#t?this.#t:(this.#t=new t(this.href),this.#e=void 0,this.#r=void 0,this.#s=void 0,this.#o=void 0,this.#n=void 0,this.#i=void 0,this.#a=void 0,this.#t)}get href(){return this.#t?this.#t.href:(this.#e||(this.#e=`${this.#r||"http:"}//${this.#s||"localhost"}${this.#o||"/"}${this.#n||""}`),this.#e)}#h(){if(!this.#a){const s=this.href,r=s.indexOf("://"),o=r===-1?-1:s.indexOf("/",r+4);this.#a=[r,o,o===-1?-1:s.indexOf("?",o)]}return this.#a}get pathname(){if(this.#t)return this.#t.pathname;if(this.#o===void 0){const[,s,r]=this.#h();if(s===-1)return this._url.pathname;this.#o=this.href.slice(s,r===-1?void 0:r)}return this.#o}get search(){if(this.#t)return this.#t.search;if(this.#n===void 0){const[,s,r]=this.#h();if(s===-1)return this._url.search;const o=this.href;this.#n=r===-1||r===o.length-1?"":o.slice(r)}return this.#n}get searchParams(){return this.#t?this.#t.searchParams:(this.#i||(this.#i=new URLSearchParams(this.search)),this.#i)}get protocol(){if(this.#t)return this.#t.protocol;if(this.#r===void 0){const[s]=this.#h();if(s===-1)return this._url.protocol;this.#r=this.href.slice(0,s+1)}return this.#r}toString(){return this.href}toJSON(){return this.href}};return M(e.prototype,t.prototype,"_url"),Object.setPrototypeOf(e.prototype,t.prototype),Object.setPrototypeOf(e,t),e})(),b=(()=>{const t=globalThis.Response,e=globalThis.process?.getBuiltinModule?.("node:http")?.STATUS_CODES||{};class n{#t;#e;#r;#s;constructor(r,o){this.#t=r,this.#e=o}static[Symbol.hasInstance](r){return r instanceof t}get status(){return this.#s?.status||this.#e?.status||200}get statusText(){return this.#s?.statusText||this.#e?.statusText||e[this.status]||""}get headers(){if(this.#s)return this.#s.headers;if(this.#r)return this.#r;const r=this.#e?.headers;return this.#r=r instanceof Headers?r:new Headers(r)}get ok(){if(this.#s)return this.#s.ok;const r=this.status;return r>=200&&r<300}get _response(){return this.#s?this.#s:(this.#s=new t(this.#t,this.#r?{...this.#e,headers:this.#r}:this.#e),this.#e=void 0,this.#r=void 0,this.#t=void 0,this.#s)}_toNodeResponse(){const r=this.status,o=this.statusText;let i,a,h;this.#s?i=this.#s.body:this.#t&&(this.#t instanceof ReadableStream?i=this.#t:typeof this.#t=="string"?(i=this.#t,a="text/plain; charset=UTF-8",h=Buffer.byteLength(this.#t)):this.#t instanceof ArrayBuffer?(i=Buffer.from(this.#t),h=this.#t.byteLength):this.#t instanceof Uint8Array?(i=this.#t,h=this.#t.byteLength):this.#t instanceof DataView?(i=Buffer.from(this.#t.buffer),h=this.#t.byteLength):this.#t instanceof Blob?(i=this.#t.stream(),a=this.#t.type,h=this.#t.size):typeof this.#t.pipe=="function"?i=this.#t:i=this._response.body);const c=[],u=this.#e?.headers,l=this.#s?.headers||this.#r||(u?Array.isArray(u)?u:u?.entries?u.entries():Object.entries(u).map(([f,d])=>[f.toLowerCase(),d]):void 0);let p,m;if(l)for(const[f,d]of l){if(Array.isArray(d))for(const _ of d)c.push([f,_]);else c.push([f,d]);f==="content-type"?p=!0:f==="content-length"&&(m=!0)}return a&&!p&&c.push(["content-type",a]),h&&!m&&c.push(["content-length",String(h)]),this.#e=void 0,this.#r=void 0,this.#s=void 0,this.#t=void 0,{status:r,statusText:o,headers:c,body:i}}}return M(n.prototype,t.prototype,"_response"),Object.setPrototypeOf(n,t),Object.setPrototypeOf(n.prototype,t.prototype),n})(),F="h3.internal.event.",V=Symbol.for(`${F}res`),Z=Symbol.for(`${F}res.headers`);var J=class{app;req;url;context;static __is_event__=!0;constructor(t,e,n){this.context=e||t.context||new z,this.req=t,this.app=n;const s=t._url;this.url=s&&s instanceof URL?s:new Et(t.url)}get res(){return this[V]||=new vt}get runtime(){return this.req.runtime}waitUntil(t){this.req.waitUntil?.(t)}toString(){return`[${this.req.method}] ${this.req.url}`}toJSON(){return this.toString()}get node(){return this.req.runtime?.node}get headers(){return this.req.headers}get path(){return this.url.pathname+this.url.search}get method(){return this.req.method}},vt=class{status;statusText;get headers(){return this[Z]||=new Headers}};const Lt=/[^\u0009\u0020-\u007E]/g;function Nt(t=""){return t.replace(Lt,"")}function At(t,e=200){return!t||(typeof t=="string"&&(t=+t),t<100||t>599)?e:t}var g=class W extends Error{get name(){return"HTTPError"}status;statusText;headers;cause;data;body;unhandled;static isError(e){return e instanceof Error&&e?.name==="HTTPError"}static status(e,n,s){return new W({...s,statusText:n,status:e})}constructor(e,n){let s,r;typeof e=="string"?(s=e,r=n):r=e;const o=At(r?.status||r?.cause?.status||r?.status||r?.statusCode,500),i=Nt(r?.statusText||r?.cause?.statusText||r?.statusText||r?.statusMessage),a=s||r?.message||r?.cause?.message||r?.statusText||r?.statusMessage||["HTTPError",o,i].filter(Boolean).join(" ");super(a,{cause:r}),this.cause=r,Error.captureStackTrace?.(this,this.constructor),this.status=o,this.statusText=i||void 0;const h=r?.headers||r?.cause?.headers;this.headers=h?new Headers(h):void 0,this.unhandled=r?.unhandled??r?.cause?.unhandled??void 0,this.data=r?.data,this.body=r?.body}get statusCode(){return this.status}get statusMessage(){return this.statusText}toJSON(){const e=this.unhandled;return{status:this.status,statusText:this.statusText,unhandled:e,message:e?"HTTPError":this.message,data:e?void 0:this.data,...e?void 0:this.body}}};function Ut(t,e){if(t==null)return!0;if(e!=="object")return e==="boolean"||e==="number"||e==="string";if(typeof t.toJSON=="function"||Array.isArray(t))return!0;if(typeof t.pipe=="function"||typeof t.pipeTo=="function")return!1;if(t instanceof z)return!0;const n=Object.getPrototypeOf(t);return n===Object.prototype||n===null}const P=Symbol.for("h3.notFound"),jt=Symbol.for("h3.handled");function y(t,e,n={}){if(typeof t?.then=="function")return(t.catch?.(o=>o)||Promise.resolve(t)).then(o=>y(o,e,n));const s=G(t,e,n);if(typeof s?.then=="function")return y(s,e,n);const{onResponse:r}=n;return r?Promise.resolve(r(s,e)).then(()=>s):s}var It=class{#t;#e;body;constructor(t,e){this.body=t,this.#e=e}get status(){return this.#e?.status||200}get statusText(){return this.#e?.statusText||"OK"}get headers(){return this.#t||=new Headers(this.#e?.headers)}};function G(t,e,n,s){if(t===jt)return new b(null);if(t===P&&(t=new g({status:404,message:`Cannot find any route matching [${e.req.method}] ${e.url}`})),t&&t instanceof Error){const i=g.isError(t),a=i?t:new g(t);i||(a.unhandled=!0,t?.stack&&(a.stack=t.stack)),a.unhandled&&!n.silent&&console.error(a);const{onError:h}=n;return h&&!s?Promise.resolve(h(a,e)).catch(c=>c).then(c=>G(c??t,e,n,!0)):Bt(a,n.debug)}const r=e[V],o=r?.[Z];if(!(t instanceof Response)){const i=Ct(t,e,n),a=i.status||r?.status;return new b(j(e.req.method,a)?null:i.body,{status:a,statusText:i.statusText||r?.statusText,headers:i.headers&&o?w(i.headers,o):i.headers||o})}if(!o||s||!t.ok)return t;try{return w(t.headers,o,t.headers),t}catch{return new b(j(e.req.method,t.status)?null:t.body,{status:t.status,statusText:t.statusText,headers:w(t.headers,o)})}}function w(t,e,n=new Headers(t)){for(const[s,r]of e)s==="set-cookie"?n.append(s,r):n.set(s,r);return n}const $t=()=>{throw new Error("Headers are frozen")};var Q=class extends Headers{constructor(t){super(t),this.set=this.append=this.delete=$t}};const kt=new Q({"content-length":"0"}),T=new Q({"content-type":"application/json;charset=UTF-8"});function Ct(t,e,n){if(t==null)return{body:"",headers:kt};const s=typeof t;if(s==="string")return{body:t};if(t instanceof Uint8Array)return e.res.headers.set("content-length",t.byteLength.toString()),{body:t};if(t instanceof It||t?.constructor?.name==="HTTPResponse")return t;if(Ut(t,s))return{body:JSON.stringify(t,void 0,n.debug?2:void 0),headers:T};if(s==="bigint")return{body:t.toString(),headers:T};if(t instanceof Blob){const r=new Headers({"content-type":t.type,"content-length":t.size.toString()});let o=t.name;return o&&(o=encodeURIComponent(o),r.set("content-disposition",`filename="${o}"; filename*=UTF-8''${o}`)),{body:t.stream(),headers:r}}return s==="symbol"?{body:t.toString()}:s==="function"?{body:`${t.name}()`}:{body:t}}function j(t,e){return t==="HEAD"||e===100||e===101||e===102||e===204||e===205||e===304}function Bt(t,e){return new b(JSON.stringify({...t.toJSON(),stack:e&&t.stack?t.stack.split(`
6
+ `).map(n=>n.trim()):void 0},void 0,e?2:void 0),{status:t.status,statusText:t.statusText,headers:t.headers?w(T,t.headers):new Headers(T)})}function H(t,e,n,s=0){if(s===e.length)return n(t);const r=e[s];let o,i;const a=()=>(o||(o=!0,i=H(t,e,n,s+1)),i),h=r(t,a);return I(h)?a():typeof h?.then=="function"?h.then(c=>I(c)?a():c):h}function I(t){return t===void 0||t===P}function qt(t,e){if(typeof t=="string"){let n=t;return n[0]==="/"&&(n=`http://localhost${n}`),new Request(n,e)}else if(t instanceof URL)return new Request(t,e);return t}function Y(t){if(typeof t=="function")return $(t);const e=t.handler||(t.fetch?function(s){return t.fetch(s.req)}:X);return Object.assign($(t.middleware?.length?function(s){return H(s,t.middleware,e)}:e),t)}function $(t){return"fetch"in t?t:Object.assign(t,{fetch:e=>{typeof e=="string"&&(e=new URL(e,"http://_")),e instanceof URL&&(e=new Request(e));const n=new J(e);try{return Promise.resolve(y(t(n),n))}catch(s){return Promise.resolve(y(s,n))}}})}function Dt(t){let e,n;const s=()=>e?Promise.resolve(e):n??=Promise.resolve(t()).then(r=>{if(e=R(r)||R(r.default),typeof e!="function")throw new TypeError("Invalid lazy handler",{cause:{resolved:r}});return e});return Y(function(o){return e?e(o):s().then(i=>i(o))})}function R(t){if(typeof t=="function")return t;if(typeof t?.handler=="function")return t.handler;if(typeof t?.fetch=="function")return function(n){return t.fetch(n.req)}}const X=()=>P;var zt=class{config;"~middleware";"~routes"=[];constructor(t={}){this["~middleware"]=[],this.config=t,this.fetch=this.fetch.bind(this),this.handler=this.handler.bind(this)}fetch(t){return this["~request"](t)}handler(t){const e=this["~findRoute"](t);e&&(t.context.params=e.params,t.context.matchedRoute=e.data);const n=e?.data.handler||X,s=this["~getMiddleware"](t,e);return s.length>0?H(t,s,n):n(t)}"~request"(t,e){const n=new J(t,e,this);let s;try{if(this.config.onRequest){const r=this.config.onRequest(n);s=typeof r?.then=="function"?r.then(()=>this.handler(n)):this.handler(n)}else s=this.handler(n)}catch(r){s=Promise.reject(r)}return y(s,n,this.config)}"~findRoute"(t){}"~addRoute"(t){this["~routes"].push(t)}"~getMiddleware"(t,e){const n=e?.data.middleware,s=this["~middleware"];return n?[...s,...n]:s}};const Mt=(t,e)=>{const n=K(t,e);return new St(typeof n.body=="string"?n.body:JSON.stringify(n.body,null,2),n)};function K(t,e,n){const s=t.unhandled,r=t.status||500,o=e.url||new URL(e.req.url);if(r===404&&/^\/[^/]/.test("/")&&!o.pathname.startsWith("/"))return{status:302,statusText:"Found",headers:{location:`/${o.pathname.slice(1)}${o.search}`},body:"Redirecting..."};if(s&&!n?.silent){const h=[t.unhandled&&"[unhandled]"].filter(Boolean).join(" ");console.error(`[request error] ${h} [${e.req.method}] ${o}
7
+ `,t)}const i={"content-type":"application/json","x-content-type-options":"nosniff","x-frame-options":"DENY","referrer-policy":"no-referrer","content-security-policy":"script-src 'none'; frame-ancestors 'none';"};(r===404||!e.res.headers.has("cache-control"))&&(i["cache-control"]="no-cache");const a={error:!0,url:o.href,status:r,statusText:t.statusText,message:s?"Server Error":t.message,data:s?void 0:t.data};return{status:r,statusText:t.statusText,headers:i,body:a}}const Ft=[Mt];async function Vt(t,e){for(const n of Ft)try{const s=await n(t,e,{defaultHandler:K});if(s)return s}catch(s){console.error(s)}}const Zt=/%2f/gi;function Jt(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function Wt(t){return Jt(t.replace(Zt,"%252F"))}const Gt=/^\.?\//;function Qt(t="",e){return t.endsWith("/")}function Yt(t="",e){return(Qt(t)?t.slice(0,-1):t)||"/"}function Xt(t="",e){return t.endsWith("/")?t:t+"/"}function Kt(t=""){return t.startsWith("/")}function te(t=""){return Kt(t)?t:"/"+t}function ee(t){return t&&t!=="/"}function se(t,...e){let n=t||"";for(const s of e.filter(r=>ee(r)))if(n){const r=s.replace(Gt,"");n=Xt(n)+r}else n=s;return n}const re=(t=>function(n){for(const[s,r]of Object.entries(t.options||{}))n.res.headers.set(s,r)}),E={"/assets/index-DcK8FECE.css":{type:"text/css; charset=utf-8",etag:'"120d-IXkTZIZ30b9HPVr3RkIm6wzrQjU"',mtime:"2025-12-16T13:03:44.042Z",size:4621,path:"../public/assets/index-DcK8FECE.css"},"/assets/index-Deils465.js":{type:"text/javascript; charset=utf-8",etag:'"a48ce-c2Nifbj8uRNUGIzrsgLWs6m5xIc"',mtime:"2025-12-16T13:03:44.042Z",size:673998,path:"../public/assets/index-Deils465.js"},"/assets/main-5WzLXT-A.js":{type:"text/javascript; charset=utf-8",etag:'"66985-/0BQi1nkZkRrmhO/z6s20gN3xDU"',mtime:"2025-12-16T13:03:44.041Z",size:420229,path:"../public/assets/main-5WzLXT-A.js"},"/assets/roboto-cyrillic-ext-wght-normal-3VVPul60.woff2":{type:"font/woff2",etag:'"8acc-p43USNJU0dZgB+r8qSgPZHGTowE"',mtime:"2025-12-16T13:03:44.041Z",size:35532,path:"../public/assets/roboto-cyrillic-ext-wght-normal-3VVPul60.woff2"},"/assets/roboto-cyrillic-wght-normal-B1tIhOr4.woff2":{type:"font/woff2",etag:'"590c-3/YoL4BWPAntDVhPFf3A/AB4cx8"',mtime:"2025-12-16T13:03:44.041Z",size:22796,path:"../public/assets/roboto-cyrillic-wght-normal-B1tIhOr4.woff2"},"/assets/roboto-greek-ext-wght-normal-DnPa8eh0.woff2":{type:"font/woff2",etag:'"10f4-nCaESMIjcsN3gI/6aVFg3GKvX1w"',mtime:"2025-12-16T13:03:44.041Z",size:4340,path:"../public/assets/roboto-greek-ext-wght-normal-DnPa8eh0.woff2"},"/assets/roboto-greek-wght-normal-iaUSDqqS.woff2":{type:"font/woff2",etag:'"44dc-K7VDABq1du0s8KDJwRMcUBoyucE"',mtime:"2025-12-16T13:03:44.041Z",size:17628,path:"../public/assets/roboto-greek-wght-normal-iaUSDqqS.woff2"},"/assets/roboto-latin-ext-wght-normal-Dqr_DJ6L.woff2":{type:"font/woff2",etag:'"673c-l3kFukQy1ODCTg2j9yrOucBSWYc"',mtime:"2025-12-16T13:03:44.042Z",size:26428,path:"../public/assets/roboto-latin-ext-wght-normal-Dqr_DJ6L.woff2"},"/assets/roboto-latin-wght-normal-CHnqiQTt.woff2":{type:"font/woff2",etag:'"9cc0-jtHVkAPQ2+Y2BIEBe0RmUVNmX74"',mtime:"2025-12-16T13:03:44.041Z",size:40128,path:"../public/assets/roboto-latin-wght-normal-CHnqiQTt.woff2"},"/assets/roboto-math-wght-normal-CBNGtO38.woff2":{type:"font/woff2",etag:'"9ef0-mAra9vmz/nCpVJTrxA3RMVFTM2Y"',mtime:"2025-12-16T13:03:44.041Z",size:40688,path:"../public/assets/roboto-math-wght-normal-CBNGtO38.woff2"},"/assets/roboto-symbols-wght-normal-Bm5C9Z0M.woff2":{type:"font/woff2",etag:'"4fb8-Hvy+6QnOdL8Eh410hn8SoeQa56Q"',mtime:"2025-12-16T13:03:44.041Z",size:20408,path:"../public/assets/roboto-symbols-wght-normal-Bm5C9Z0M.woff2"},"/assets/roboto-vietnamese-wght-normal-24ctNiOc.woff2":{type:"font/woff2",etag:'"32f0-ZIhVt0GRHJoB0P03+ge9WVBdZVA"',mtime:"2025-12-16T13:03:44.041Z",size:13040,path:"../public/assets/roboto-vietnamese-wght-normal-24ctNiOc.woff2"}};function ne(t){const e=it(ot(globalThis.__nitro_main__));return nt.readFile(at(e,E[t].path))}const oe={};function ie(t=""){if(E[t])return!0;for(const e in oe)if(t.startsWith(e))return!0;return!1}function ae(t){return E[t]}const he=new Set(["HEAD","GET"]),ce={gzip:".gz",br:".br"},ue=Y(t=>{if(t.req.method&&!he.has(t.req.method))return;let e=Wt(te(Yt(t.url.pathname))),n;const r=[...(t.req.headers.get("accept-encoding")||"").split(",").map(h=>ce[h.trim()]).filter(Boolean).sort(),""];r.length>1&&t.res.headers.append("Vary","Accept-Encoding");for(const h of r)for(const c of[e+h,se(e,"index.html"+h)]){const u=ae(c);if(u){n=u,e=c;break}}if(!n){if(ie(e))throw t.res.headers.delete("Cache-Control"),new g({status:404});return}if(t.req.headers.get("if-none-match")===n.etag)return t.res.status=304,t.res.statusText="Not Modified","";const i=t.req.headers.get("if-modified-since"),a=new Date(n.mtime);return i&&n.mtime&&new Date(i)>=a?(t.res.status=304,t.res.statusText="Not Modified",""):(n.type&&t.res.headers.set("Content-Type",n.type),n.etag&&!t.res.headers.has("ETag")&&t.res.headers.set("ETag",n.etag),n.mtime&&!t.res.headers.has("Last-Modified")&&t.res.headers.set("Last-Modified",a.toUTCString()),n.encoding&&!t.res.headers.has("Content-Encoding")&&t.res.headers.set("Content-Encoding",n.encoding),n.size>0&&!t.res.headers.has("Content-Length")&&t.res.headers.set("Content-Length",n.size.toString()),ne(e))}),fe=(()=>{const t=[{name:"headers",route:"/assets/**",handler:re,options:{"cache-control":"public, max-age=31536000, immutable"}}];return(e,n)=>{let s=[];n.charCodeAt(n.length-1)===47&&(n=n.slice(0,-1)||"/");let r=n.split("/");return r.length-1,r[1]==="assets"&&s.unshift({data:t,params:{_:r.slice(2).join("/")}}),s}})(),de=Dt(()=>Promise.resolve().then(function(){return Re})),le=(()=>{const t={route:"/**",handler:de};return((e,n)=>({data:t,params:{_:n.slice(1)}}))})(),pe=[R(ue)].filter(Boolean);function v(){return v.__instance__??=me()}function me(){const t=ge();return globalThis.__nitro__=t,t}function ge(){const e=(o,i)=>{if(i?.event){const a=i.event.req.context?.nitro?.errors;a&&a.push({error:o,context:i})}},n=ye({onError(o,i){return Vt(o,i)}});return{fetch:o=>(o.context||={},o.context.nitro=o.context.nitro||{errors:[]},n.fetch(o)),h3:n,hooks:void 0,captureError:e}}function ye(t){const e=new zt(t);return e["~findRoute"]=n=>le(n.req.method,n.url.pathname),e["~middleware"].push(...pe),e["~getMiddleware"]=(n,s)=>{const r=n.url.pathname,o=n.req.method,i=[];{const a=be(o,r);n.context.routeRules=a?.routeRules,a?.routeRuleMiddleware.length&&i.push(...a.routeRuleMiddleware)}return i.push(...e["~middleware"]),s?.data?.middleware?.length&&i.push(...s.data.middleware),i},e}function be(t,e){const n=fe(t,e);if(!n?.length)return{routeRuleMiddleware:[]};const s={};for(const o of n)for(const i of o.data){const a=s[i.name];if(a){if(i.options===!1){delete s[i.name];continue}typeof a.options=="object"&&typeof i.options=="object"?a.options={...a.options,...i.options}:a.options=i.options,a.route=i.route,a.params={...a.params,...o.params}}else i.options!==!1&&(s[i.name]={...i,params:o.params})}const r=[];for(const o of Object.values(s))o.options===!1||!o.handler||r.push(o.handler(o));return{routeRules:s,routeRuleMiddleware:r}}function k(t,e){console.error(`[${e}]`,t),v().captureError?.(t,{tags:[e]})}function we(){process.on("unhandledRejection",t=>k(t,"unhandledRejection")),process.on("uncaughtException",t=>k(t,"uncaughtException"))}const Te=Number.parseInt(process.env.NITRO_PORT||process.env.PORT||"")||3e3,Se=process.env.NITRO_HOST||process.env.HOST,C=process.env.NITRO_SSL_CERT,B=process.env.NITRO_SSL_KEY,_e=v();Pt({port:Te,hostname:Se,tls:C&&B?{cert:C,key:B}:void 0,fetch:_e.fetch});we();const $e={};function Oe(t,e,n){const r=(globalThis.__nitro_vite_envs__||{})[t];if(!r)throw g.status(404);return Promise.resolve(r.fetch(qt(e,n)))}function xe({req:t}){return Oe("ssr",t)}const Re=Object.freeze({__proto__:null,default:xe});export{z as N,$e as default};
@@ -0,0 +1,233 @@
1
+ {
2
+ "name": "traced-node-modules",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "private": true,
6
+ "dependencies": {
7
+ "@babel/runtime": "7.28.4",
8
+ "@emotion/cache": "11.14.0",
9
+ "@emotion/hash": "0.9.2",
10
+ "@emotion/is-prop-valid": "1.4.0",
11
+ "@emotion/memoize": "0.9.0",
12
+ "@emotion/react": "11.14.0",
13
+ "@emotion/serialize": "1.3.3",
14
+ "@emotion/sheet": "1.4.0",
15
+ "@emotion/styled": "11.14.1",
16
+ "@emotion/unitless": "0.10.0",
17
+ "@emotion/use-insertion-effect-with-fallbacks": "1.2.0",
18
+ "@emotion/utils": "1.4.2",
19
+ "@emotion/weak-memoize": "0.4.0",
20
+ "@img/colour": "1.0.0",
21
+ "@img/sharp-darwin-arm64": "0.34.5",
22
+ "@img/sharp-libvips-darwin-arm64": "1.2.4",
23
+ "@mui/icons-material": "7.3.6",
24
+ "@mui/material": "7.3.6",
25
+ "@mui/private-theming": "7.3.6",
26
+ "@mui/styled-engine": "7.3.6",
27
+ "@mui/system": "7.3.6",
28
+ "@mui/utils": "7.3.6",
29
+ "@popperjs/core": "2.11.8",
30
+ "@promptbook/utils": "0.69.5",
31
+ "@puppeteer/browsers": "2.11.0",
32
+ "@tanstack/devtools-event-client": "0.3.5",
33
+ "@tanstack/form-core": "1.27.3",
34
+ "@tanstack/history": "1.140.0",
35
+ "@tanstack/pacer-lite": "0.1.1",
36
+ "@tanstack/query-core": "5.90.12",
37
+ "@tanstack/react-form": "1.27.3",
38
+ "@tanstack/react-query": "5.90.12",
39
+ "@tanstack/react-router": "1.140.1",
40
+ "@tanstack/react-router-ssr-query": "1.140.1",
41
+ "@tanstack/react-store": "0.8.0",
42
+ "@tanstack/router-core": "1.140.1",
43
+ "@tanstack/router-ssr-query-core": "1.140.1",
44
+ "@tanstack/store": "0.8.0",
45
+ "@tootallnate/quickjs-emscripten": "0.23.0",
46
+ "@wdio/config": "9.21.0",
47
+ "@wdio/logger": "9.18.0",
48
+ "@wdio/protocols": "9.16.2",
49
+ "@wdio/repl": "9.16.2",
50
+ "@wdio/types": "9.20.0",
51
+ "@wdio/utils": "9.21.0",
52
+ "@zip.js/zip.js": "2.8.11",
53
+ "abort-controller": "3.0.0",
54
+ "agent-base": "7.1.4",
55
+ "ansi-regex": "6.2.2",
56
+ "ansi-styles": "4.3.0",
57
+ "archiver": "7.0.1",
58
+ "archiver-utils": "5.0.2",
59
+ "aria-query": "5.3.2",
60
+ "ast-types": "0.13.4",
61
+ "async": "3.2.6",
62
+ "b4a": "1.7.3",
63
+ "balanced-match": "1.0.2",
64
+ "basic-ftp": "5.0.5",
65
+ "boolbase": "1.0.0",
66
+ "brace-expansion": "2.0.2",
67
+ "buffer-crc32": "1.0.0",
68
+ "chalk": "5.6.2",
69
+ "cheerio": "1.1.2",
70
+ "cheerio-select": "2.1.0",
71
+ "cliui": "8.0.1",
72
+ "clsx": "2.1.1",
73
+ "color-convert": "2.0.1",
74
+ "color-name": "1.1.4",
75
+ "compress-commons": "6.0.2",
76
+ "cookie-es": "2.0.0",
77
+ "core-util-is": "1.0.3",
78
+ "crc-32": "1.2.2",
79
+ "crc32-stream": "6.0.0",
80
+ "css-select": "5.2.2",
81
+ "css-shorthand-properties": "1.1.2",
82
+ "css-value": "0.0.1",
83
+ "css-what": "6.2.2",
84
+ "data-uri-to-buffer": "6.0.2",
85
+ "debug": "4.4.3",
86
+ "decamelize": "6.0.1",
87
+ "deepmerge-ts": "7.1.5",
88
+ "degenerator": "5.0.1",
89
+ "detect-libc": "2.1.2",
90
+ "dom-helpers": "5.2.1",
91
+ "dom-serializer": "2.0.0",
92
+ "domelementtype": "2.3.0",
93
+ "domhandler": "5.0.3",
94
+ "domutils": "3.2.2",
95
+ "edge-paths": "3.0.5",
96
+ "edgedriver": "6.2.0",
97
+ "encoding-sniffer": "0.2.1",
98
+ "end-of-stream": "1.4.5",
99
+ "entities": "4.5.0",
100
+ "escalade": "3.2.0",
101
+ "escodegen": "2.1.0",
102
+ "esprima": "4.0.1",
103
+ "estraverse": "5.3.0",
104
+ "esutils": "2.0.3",
105
+ "event-target-shim": "5.0.1",
106
+ "events-universal": "1.0.1",
107
+ "extract-zip": "2.0.1",
108
+ "fast-fifo": "1.3.2",
109
+ "fast-xml-parser": "5.3.2",
110
+ "fd-slicer": "1.1.0",
111
+ "fs-extra": "11.3.2",
112
+ "geckodriver": "6.1.0",
113
+ "get-port": "7.1.0",
114
+ "get-stream": "5.2.0",
115
+ "get-uri": "6.0.5",
116
+ "glob": "10.5.0",
117
+ "graceful-fs": "4.2.11",
118
+ "grapheme-splitter": "1.0.4",
119
+ "has-flag": "4.0.0",
120
+ "hoist-non-react-statics": "3.3.2",
121
+ "htmlfy": "0.8.1",
122
+ "htmlparser2": "10.0.0",
123
+ "http-proxy-agent": "7.0.2",
124
+ "https-proxy-agent": "7.0.6",
125
+ "iconv-lite": "0.6.3",
126
+ "immediate": "3.0.6",
127
+ "import-meta-resolve": "4.2.0",
128
+ "inherits": "2.0.4",
129
+ "ip-address": "10.1.0",
130
+ "is-plain-obj": "4.1.0",
131
+ "is-stream": "2.0.1",
132
+ "isarray": "1.0.0",
133
+ "isbot": "5.1.32",
134
+ "isexe": "3.1.1",
135
+ "jsonfile": "6.2.0",
136
+ "jszip": "3.10.1",
137
+ "lazystream": "1.0.1",
138
+ "lie": "3.3.0",
139
+ "locate-app": "2.5.0",
140
+ "lodash": "4.17.21",
141
+ "lodash.clonedeep": "4.5.0",
142
+ "lodash.zip": "4.2.0",
143
+ "loglevel": "1.9.2",
144
+ "loglevel-plugin-prefix": "0.8.4",
145
+ "lru-cache": "10.4.3",
146
+ "minimatch": "5.1.6",
147
+ "minipass": "7.1.2",
148
+ "mitt": "3.0.1",
149
+ "modern-tar": "0.7.2",
150
+ "ms": "2.1.3",
151
+ "netmask": "2.0.2",
152
+ "normalize-path": "3.0.0",
153
+ "nth-check": "2.1.1",
154
+ "object-assign": "4.1.1",
155
+ "once": "1.4.0",
156
+ "pac-proxy-agent": "7.2.0",
157
+ "pac-resolver": "7.0.1",
158
+ "pako": "1.0.11",
159
+ "parse5": "7.3.0",
160
+ "parse5-htmlparser2-tree-adapter": "7.1.0",
161
+ "parse5-parser-stream": "7.1.2",
162
+ "path-scurry": "1.11.1",
163
+ "pend": "1.2.0",
164
+ "process": "0.11.10",
165
+ "process-nextick-args": "2.0.1",
166
+ "progress": "2.0.3",
167
+ "prop-types": "15.8.1",
168
+ "proxy-agent": "6.5.0",
169
+ "proxy-from-env": "1.1.0",
170
+ "pump": "3.0.3",
171
+ "react": "19.2.1",
172
+ "react-dom": "19.2.1",
173
+ "react-is": "19.2.1",
174
+ "react-redux": "9.2.0",
175
+ "react-transition-group": "4.4.5",
176
+ "readable-stream": "2.3.8",
177
+ "readdir-glob": "1.1.3",
178
+ "redux": "5.0.1",
179
+ "ret": "0.5.0",
180
+ "rgb2hex": "0.2.5",
181
+ "safaridriver": "1.0.0",
182
+ "safe-buffer": "5.1.2",
183
+ "safe-regex2": "5.0.0",
184
+ "safer-buffer": "2.1.2",
185
+ "sax": "1.4.3",
186
+ "semver": "7.7.3",
187
+ "serialize-error": "12.0.0",
188
+ "seroval": "1.4.0",
189
+ "seroval-plugins": "1.4.0",
190
+ "setimmediate": "1.0.5",
191
+ "sharp": "0.34.5",
192
+ "smart-buffer": "4.2.0",
193
+ "socks": "2.8.7",
194
+ "socks-proxy-agent": "8.0.5",
195
+ "source-map": "0.6.1",
196
+ "spacetrim": "0.11.59",
197
+ "split2": "4.2.0",
198
+ "streamx": "2.23.0",
199
+ "string_decoder": "1.1.1",
200
+ "strip-ansi": "7.1.2",
201
+ "strnum": "2.1.1",
202
+ "stylis": "4.2.0",
203
+ "supports-color": "7.2.0",
204
+ "tar-fs": "3.1.1",
205
+ "tar-stream": "3.1.7",
206
+ "text-decoder": "1.2.3",
207
+ "tiny-invariant": "1.3.3",
208
+ "tiny-warning": "1.0.3",
209
+ "tslib": "2.8.1",
210
+ "undici": "7.16.0",
211
+ "universalify": "2.0.1",
212
+ "urlpattern-polyfill": "10.1.0",
213
+ "use-sync-external-store": "1.6.0",
214
+ "userhome": "1.0.1",
215
+ "util-deprecate": "1.0.2",
216
+ "wait-port": "1.1.0",
217
+ "webdriver": "9.21.0",
218
+ "webdriverio": "9.21.0",
219
+ "whatwg-encoding": "3.1.1",
220
+ "whatwg-mimetype": "4.0.0",
221
+ "which": "6.0.0",
222
+ "wrappy": "1.0.2",
223
+ "ws": "8.18.3",
224
+ "xml2js": "0.6.2",
225
+ "xmlbuilder": "11.0.1",
226
+ "y18n": "5.0.8",
227
+ "yargs": "17.7.2",
228
+ "yargs-parser": "21.1.1",
229
+ "yauzl": "2.10.0",
230
+ "zip-stream": "6.0.1",
231
+ "zod": "4.1.13"
232
+ }
233
+ }
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # MobileBoost CLI
2
+
3
+ MobileBoost is a CLI tool designed for agentic mobile testing. It helps setup the environment, manages configuration, and provides a "Studio" dashboard for visualising and interacting with your tests.
4
+
5
+ ## Project Structure
6
+
7
+ The project is a hybrid TypeScript CLI and Web Application.
8
+
9
+ ```
10
+ mobileboost-cli/
11
+ ├── bin/ # Executable entry point
12
+ ├── src/
13
+ │ ├── cli.ts # Main CLI entry point (Commander.js)
14
+ │ ├── commands/ # Command implementations
15
+ │ │ ├── init.ts # 'init' command
16
+ │ │ ├── doctor.ts # 'check-env' command
17
+ │ │ └── studio.ts # 'studio' command (Express + tRPC)
18
+ │ ├── server/ # tRPC Backend logic
19
+ │ │ └── router.ts # AppRouter definition
20
+ │ └── client/ # Studio Frontend (React + Vite)
21
+ │ ├── main.tsx # React entry
22
+ │ ├── App.tsx # Root component
23
+ │ └── ...
24
+ ├── dist/ # Compiled output (both CommonJS CLI and Client Assets)
25
+ └── ...
26
+ ```
27
+
28
+ ## Main Components
29
+
30
+ 1. **CLI Core**: Built with [Commander.js](https://github.com/tj/commander.js). Handles command routing and argument parsing.
31
+ 2. **Studio Frontend**: A web dashboard built with **React**, **Vite**, and **tRPC**. It communicates with the CLI backend to file system operations.
32
+ 3. **Studio Backend**: An **Express** server that runs locally when `mobileboost studio` is executed. It serves the built React assets and exposes a **tRPC** API.
33
+
34
+ ## Developer Guide
35
+
36
+ Follow these steps to run the project locally for development and testing.
37
+
38
+ ### 1. Installation
39
+
40
+ Clone the repository and install dependencies. This installs both CLI and Frontend dependencies.
41
+
42
+ ```bash
43
+ npm install
44
+ ```
45
+
46
+ ### 2. Build
47
+
48
+ The build command compiles the React Frontend (using Vite) and the TypeScript CLI code.
49
+
50
+ ```bash
51
+ npm run build
52
+ ```
53
+
54
+ *Note: You must rebuild if you make changes to either the `src/client` or `src` code.*
55
+
56
+ ### 3. Link Locally
57
+
58
+ To test the CLI commands on your machine, link the package globally.
59
+
60
+ ```bash
61
+ npm link
62
+ ```
63
+
64
+ ### 4. Running the Configured CLI
65
+
66
+ Now you can use the `mobileboost` command system-wide.
67
+
68
+ **Initialize a test project (in any directory):**
69
+ ```bash
70
+ mkdir my-mobile-project
71
+ cd my-mobile-project
72
+ mobileboost init
73
+ ```
74
+
75
+ **Run the Studio:**
76
+ ```bash
77
+ mobileboost studio
78
+ ```
79
+ This will start the server at `http://localhost:8877`.
80
+
81
+ ### 5. Development Workflow
82
+
83
+ For rapid development, you can use the dev script, but note that for the **Studio**, you generally need to re-run `npm run build` to see frontend changes reflected in the CLI command, as the CLI serves the static `dist/client` folder.
84
+
85
+ To create valid test data for the studio, you can manually add `.ts` files to the `tests/` directory created by `mobileboost init`.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import('../dist/cli.js');
package/dist/cli.js ADDED
@@ -0,0 +1,28 @@
1
+ import { Command } from 'commander';
2
+ const program = new Command();
3
+ program
4
+ .name('mobileboost')
5
+ .description('CLI for agentic mobile testing')
6
+ .version('0.1.0');
7
+ program.command('init')
8
+ .description('Initialize mobileboost config')
9
+ .action(async () => {
10
+ // Lazy load command
11
+ const { init } = await import('./commands/init.js');
12
+ await init();
13
+ });
14
+ program.command('check-env')
15
+ .alias('doctor')
16
+ .description('Check and install Appium environment')
17
+ .action(async () => {
18
+ const { doctor } = await import('./commands/doctor.js');
19
+ await doctor();
20
+ });
21
+ program.command('studio')
22
+ .description('Launch mobileboost studio')
23
+ .action(async () => {
24
+ const { studio } = await import('./commands/studio.js');
25
+ await studio();
26
+ });
27
+ program.parse(process.argv);
28
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACF,IAAI,CAAC,aAAa,CAAC;KACnB,WAAW,CAAC,gCAAgC,CAAC;KAC7C,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;KAClB,WAAW,CAAC,+BAA+B,CAAC;KAC5C,MAAM,CAAC,KAAK,IAAI,EAAE;IACf,oBAAoB;IACpB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACpD,MAAM,IAAI,EAAE,CAAC;AACjB,CAAC,CAAC,CAAC;AAEP,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;KACvB,KAAK,CAAC,QAAQ,CAAC;KACf,WAAW,CAAC,sCAAsC,CAAC;KACnD,MAAM,CAAC,KAAK,IAAI,EAAE;IACf,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC;IACxD,MAAM,MAAM,EAAE,CAAC;AACnB,CAAC,CAAC,CAAC;AAEP,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;KACpB,WAAW,CAAC,2BAA2B,CAAC;KACxC,MAAM,CAAC,KAAK,IAAI,EAAE;IACf,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC;IACxD,MAAM,MAAM,EAAE,CAAC;AACnB,CAAC,CAAC,CAAC;AAEP,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,77 @@
1
+ import chalk from 'chalk';
2
+ import execa from 'execa';
3
+ import inquirer from 'inquirer';
4
+ import ora from 'ora';
5
+ export async function doctor() {
6
+ console.log(chalk.blue('Checking MobileBoost environment...'));
7
+ const spinner = ora('Checking for Appium...').start();
8
+ try {
9
+ await execa('appium', ['--version']);
10
+ spinner.succeed(chalk.green('Appium is installed'));
11
+ }
12
+ catch (error) {
13
+ spinner.fail(chalk.red('Appium is NOT installed'));
14
+ const { install } = await inquirer.prompt([{
15
+ type: 'confirm',
16
+ name: 'install',
17
+ message: 'Would you like to install Appium globally via npm?',
18
+ default: true
19
+ }]);
20
+ if (install) {
21
+ const installSpinner = ora('Installing Appium...').start();
22
+ try {
23
+ await execa('npm', ['install', '-g', 'appium']);
24
+ installSpinner.succeed(chalk.green('Appium installed successfully!'));
25
+ }
26
+ catch (installError) {
27
+ installSpinner.fail(chalk.red('Failed to install Appium.'));
28
+ console.error(chalk.red(installError.message));
29
+ return;
30
+ }
31
+ }
32
+ else {
33
+ console.log(chalk.yellow('Skipping Appium installation. Some features may not work.'));
34
+ }
35
+ }
36
+ // Check for UIAutomator2 driver
37
+ const driverSpinner = ora('Checking for Appium UIAutomator2 driver...').start();
38
+ try {
39
+ const { stdout } = await execa('appium', ['driver', 'list', '--installed']);
40
+ if (stdout.includes('uiautomator2')) {
41
+ driverSpinner.succeed(chalk.green('UIAutomator2 driver is installed'));
42
+ }
43
+ else {
44
+ throw new Error('UIAutomator2 not found');
45
+ }
46
+ }
47
+ catch (error) {
48
+ driverSpinner.warn(chalk.yellow('UIAutomator2 driver not found'));
49
+ // Attempt install if appium is present
50
+ try {
51
+ // Double check appium exists before asking
52
+ await execa('appium', ['--version']);
53
+ const { installDriver } = await inquirer.prompt([{
54
+ type: 'confirm',
55
+ name: 'installDriver',
56
+ message: 'Would you like to install the uiautomator2 driver?',
57
+ default: true
58
+ }]);
59
+ if (installDriver) {
60
+ const installDriverSpinner = ora('Installing uiautomator2 driver...').start();
61
+ try {
62
+ await execa('appium', ['driver', 'install', 'uiautomator2']);
63
+ installDriverSpinner.succeed(chalk.green('UIAutomator2 driver installed!'));
64
+ }
65
+ catch (err) {
66
+ installDriverSpinner.fail(chalk.red('Failed to install driver'));
67
+ console.error(err.message);
68
+ }
69
+ }
70
+ }
71
+ catch {
72
+ // Appium not installed, so can't install driver
73
+ }
74
+ }
75
+ console.log(chalk.bold('\nEnvironment check complete.'));
76
+ }
77
+ //# sourceMappingURL=doctor.js.map