reflex-agent 0.13.3 → 0.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +99 -99
- package/.next/app-path-routes-manifest.json +9 -9
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/agents/[agentId]/page.js +1 -1
- package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/images/[rootId]/[file]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/attachments/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/bundle.js/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-api.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/iframe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/style.css/route_client-reference-manifest.js +1 -1
- package/.next/server/app/audit/page.js +2 -2
- package/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding/page.js +2 -2
- package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js +2 -2
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js +2 -2
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/memory/page.js +1 -1
- package/.next/server/app/roots/[id]/memory/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/page.js +6 -6
- package/.next/server/app/roots/[id]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/new/page.js +4 -4
- package/.next/server/app/roots/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +4 -4
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/file/page.js +2 -2
- package/.next/server/app/share/[id]/file/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/page.js +2 -2
- package/.next/server/app/share/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page.js +2 -2
- package/.next/server/app/utilities/[scope]/[id]/page.js.nft.json +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/page.js +2 -2
- package/.next/server/app/utilities/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +9 -9
- package/.next/server/chunks/1358.js +1 -1
- package/.next/server/chunks/2678.js +3 -0
- package/.next/server/chunks/{2553.js → 2688.js} +2 -2
- package/.next/server/chunks/285.js +6 -6
- package/.next/server/chunks/3332.js +1 -1
- package/.next/server/chunks/4812.js +1 -1
- package/.next/server/chunks/491.js +1 -0
- package/.next/server/chunks/4925.js +1 -1
- package/.next/server/chunks/6238.js +1 -0
- package/.next/server/chunks/8425.js +1 -0
- package/.next/server/chunks/9098.js +1 -1
- package/.next/server/chunks/9809.js +1 -1
- package/.next/server/functions-config-manifest.json +2 -2
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/3717-339a6fc5e3b929f9.js +1 -0
- package/.next/static/chunks/4108.58294dcccaecb2f1.js +1 -0
- package/.next/static/chunks/4179-847dcd61bef8c59f.js +1 -0
- package/.next/static/chunks/4273-0b053f2035ad088d.js +1 -0
- package/.next/static/chunks/5596-93b53c14a2d5c59a.js +1 -0
- package/.next/static/chunks/{2145-c6ca18def78454d6.js → 9001-6f38a673a3868871.js} +1 -1
- package/.next/static/chunks/app/layout-5e042e4e97dcea31.js +1 -0
- package/.next/static/chunks/app/onboarding/page-97aa4ad99276380f.js +1 -0
- package/.next/static/chunks/app/page-0c090eba51732036.js +1 -0
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-292bc4cdceb6ea1d.js +1 -0
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-5e4f7b893c02c2bd.js +1 -0
- package/.next/static/chunks/app/roots/[id]/memory/page-b1fd919707f00c99.js +1 -0
- package/.next/static/chunks/app/roots/[id]/page-da97fb20eef9677c.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-932edf8ce73b23bc.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/page-7339062dee577728.js +1 -0
- package/.next/static/chunks/app/roots/new/page-c96a333c1ef53fba.js +1 -0
- package/.next/static/chunks/app/settings/page-75c61dd145bed57e.js +1 -0
- package/.next/static/chunks/app/share/[id]/{page-3c41145c5052196e.js → page-e4b74cf795d4e211.js} +1 -1
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-ea8352712b521f75.js +1 -0
- package/.next/static/chunks/app/utilities/page-b5514f6c3291e23f.js +1 -0
- package/.next/static/chunks/{webpack-e4214c40f8bbfb8a.js → webpack-a4eadc02863be5eb.js} +1 -1
- package/.next/trace +90 -90
- package/package.json +1 -1
- package/.next/server/chunks/1854.js +0 -1
- package/.next/server/chunks/5798.js +0 -3
- package/.next/server/chunks/6057.js +0 -1
- package/.next/server/chunks/6261.js +0 -1
- package/.next/static/chunks/1053-ea6a705a291aa42a.js +0 -1
- package/.next/static/chunks/2283-846ac14d7ab55b2a.js +0 -1
- package/.next/static/chunks/3798-d4d575ac69051cf9.js +0 -1
- package/.next/static/chunks/4108.2dc3c767f831f9af.js +0 -1
- package/.next/static/chunks/4243-193beeabc76bcd91.js +0 -1
- package/.next/static/chunks/app/layout-b89925fa75d66eea.js +0 -1
- package/.next/static/chunks/app/onboarding/page-9b9f74b3737805f6.js +0 -1
- package/.next/static/chunks/app/page-d46c2ac151511ae7.js +0 -1
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-8dc9ea79064a1e6e.js +0 -1
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-0345054358c099c2.js +0 -1
- package/.next/static/chunks/app/roots/[id]/memory/page-ca21167541d9d818.js +0 -1
- package/.next/static/chunks/app/roots/[id]/page-1c6b4677b911c463.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-688ef6bc97b92a38.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/page-4f1658f13b1ed62f.js +0 -1
- package/.next/static/chunks/app/roots/new/page-3c0a418feff0bf27.js +0 -1
- package/.next/static/chunks/app/settings/page-bfc3e0b4fca2b6cd.js +0 -1
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-561dd294cb2beb54.js +0 -1
- package/.next/static/chunks/app/utilities/page-5061f113002b5638.js +0 -1
- /package/.next/static/{BGlfzUnm4RdoF1cif83QI → my3C6nd2vY80TaiBNwet5}/_buildManifest.js +0 -0
- /package/.next/static/{BGlfzUnm4RdoF1cif83QI → my3C6nd2vY80TaiBNwet5}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";exports.id=
|
|
1
|
+
"use strict";exports.id=2688,exports.ids=[2688],exports.modules={16856:(a,b,c)=>{c.d(b,{Is:()=>g,L8:()=>h,ns:()=>i});var d=c(73745);c(66493);var e=c(65326),f=c(30878);async function g(a){try{if("utility"===a.kind&&(!a.utilityId||!a.utilityScope))return{ok:!1,error:"share kind=utility requires utilityId + utilityScope"};if("kb-file"===a.kind&&(!a.rootId||!a.kbRelPath))return{ok:!1,error:"share kind=kb-file requires rootId + kbRelPath"};if(("kb-tree"===a.kind||"project"===a.kind)&&!a.rootId)return{ok:!1,error:`share kind=${a.kind} requires rootId`};let b=await (0,f.cn)(a);return(0,e.revalidatePath)("/settings"),{ok:!0,share:b}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function h(){return{shares:await (0,f.Bg)()}}async function i(a){let b=await (0,f.Ru)(a);return(0,e.revalidatePath)("/settings"),{ok:b}}(0,c(63781).D)([g,h,i]),(0,d.A)(g,"40338023fcb3ec9056f1e81a812fa4f269cee69243",null),(0,d.A)(h,"000970e2ad0cde67d2e05e4d6b8516a64ab82cd96c",null),(0,d.A)(i,"40c0196e4232749f9fb0edb37dd54f6d4da10b452c",null)},30878:(a,b,c)=>{c.d(b,{BE:()=>o,Bg:()=>m,Ru:()=>q,cn:()=>p,er:()=>n});var d=c(73024),e=c(76760),f=c.n(e),g=c(77598),h=c.n(g),i=c(73652);let j=f().join((0,i._)(),"shares.json");async function k(){try{let a=await d.promises.readFile(j,"utf8"),b=JSON.parse(a);if(b&&Array.isArray(b.shares))return b}catch{}return{version:1,shares:[]}}async function l(a){await d.promises.mkdir(f().dirname(j),{recursive:!0}),await d.promises.writeFile(j,JSON.stringify(a,null,2)+"\n",{mode:384})}async function m(){return(await k()).shares}async function n(a){return(await k()).shares.find(b=>b.id===a)??null}function o(a,b){if(!a.passwordHash)return!0;if(!a.passwordSalt)return!1;let c=h().createHash("sha256").update(a.passwordSalt+":"+b).digest("hex");return h().timingSafeEqual(Buffer.from(c,"hex"),Buffer.from(a.passwordHash,"hex"))}async function p(a){let b=await k(),c={id:function(){let a="abcdefghjkmnpqrstuvwxyz23456789",b="";for(let c=0;c<12;c++)b+=a[h().randomInt(0,a.length)];return b}(),kind:a.kind,createdAt:new Date().toISOString(),...a.rootId?{rootId:a.rootId}:{},...a.utilityScope?{utilityScope:a.utilityScope}:{},...a.utilityId?{utilityId:a.utilityId}:{},...a.kbRelPath?{kbRelPath:a.kbRelPath}:{},...a.expiresAt?{expiresAt:a.expiresAt}:{},...a.label?{label:a.label}:{}};if(a.password){let{salt:b,hash:d}=function(a){let b=h().randomBytes(16).toString("hex"),c=h().createHash("sha256").update(b+":"+a).digest("hex");return{salt:b,hash:c}}(a.password);c.passwordSalt=b,c.passwordHash=d}return b.shares=[c,...b.shares],await l(b),c}async function q(a){let b=await k(),c=b.shares.length;return b.shares=b.shares.filter(b=>b.id!==a),b.shares.length!==c&&(await l(b),!0)}},42382:(a,b,c)=>{c.d(b,{E:()=>i});var d=c(64173);c(17240);var e=c(20483),f=c(91520),g=c(91344);let h=(0,e.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function i({className:a,variant:b="default",asChild:c=!1,...e}){let i=c?f.bL:"span";return(0,d.jsx)(i,{"data-slot":"badge","data-variant":b,className:(0,g.cn)(h({variant:b}),a),...e})}},47071:(a,b,c)=>{c.d(b,{p:()=>f});var d=c(64173);c(17240);var e=c(91344);function f({className:a,type:b,...c}){return(0,d.jsx)("input",{type:b,"data-slot":"input",className:(0,e.cn)("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",a),...c})}},47170:(a,b,c)=>{c.d(b,{N:()=>e});var d=c(3265);let e=(0,d.createServerReference)("005bcd722172d298deb64db825d20aa3b6dd70eb78",d.callServer,void 0,d.findSourceMapURL,"getTunnelStatusAction")},60524:(a,b,c)=>{c.d(b,{Separator:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call Separator() from the server but Separator is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/components/ui/separator.tsx","Separator")},80281:(a,b,c)=>{c.d(b,{J:()=>g});var d=c(64173);c(17240);var e=c(90044),f=c(91344);function g({className:a,...b}){return(0,d.jsx)(e.Root,{"data-slot":"label",className:(0,f.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",a),...b})}},92814:(a,b,c)=>{c.d(b,{Ng:()=>s,bt:()=>v,Zl:()=>w,Nt:()=>t,Fm:()=>u});var d=c(73745);c(66493);var e=c(65326),f=c(36017),g=c(31421),h=c(73024),i=c(76760),j=c.n(i),k=c(73652);let l="__reflex_ngrok_tunnel__";function m(){return globalThis[l]}function n(a){globalThis[l]=a}async function o(a){let b;if(!a.authtoken)return{ok:!1,error:"ngrok authtoken is required"};let c=m();if(c&&null===c.child.exitCode)return{ok:!1,error:"Tunnel already running — stop it first."};let d=(0,k._)();await h.promises.mkdir(d,{recursive:!0});let e=j().join(d,"ngrok.yml");await h.promises.writeFile(e,`version: 3
|
|
2
2
|
agent:
|
|
3
3
|
authtoken: ${a.authtoken}
|
|
4
|
-
`,{mode:384});let f=["http",String(a.port),"--config",e,"--log","stdout","--log-format","json"];a.domain&&f.push(`--domain=${a.domain}`);try{b=(0,g.spawn)("ngrok",f,{detached:!1,stdio:["ignore","pipe","pipe"]})}catch(a){return{ok:!1,error:"Failed to spawn ngrok — is the CLI installed and on PATH? "+(a instanceof Error?a.message:String(a))}}return b.on("error",a=>{console.error("[ngrok] spawn error:",a)}),b.on("exit",(a,c)=>{console.log(`[ngrok] tunnel exited code=${a} signal=${c??"-"}`);let d=m();d?.child===b&&n(void 0)}),b.stdout?.on("data",a=>{let b=a.toString().trim();b&&console.log("[ngrok]",b)}),b.stderr?.on("data",a=>{let b=a.toString().trim();b&&console.error("[ngrok!]",b)}),n({child:b,startedAt:new Date().toISOString(),port:a.port,...a.domain?{domain:a.domain}:{}}),{ok:!0}}async function p(){let a=Date.now()+6e3;for(;Date.now()<a;){try{let a=await fetch("http://127.0.0.1:4040/api/tunnels");if(a.ok){let b=await a.json(),c=b.tunnels.find(a=>"https"===a.proto),d=b.tunnels[0],e=c?.public_url??d?.public_url;if(e){let a=m();return a&&(a.publicUrl=e,n(a)),e}}}catch{}await new Promise(a=>setTimeout(a,400))}return null}async function q(){return new Promise(a=>{try{let b=(0,g.spawn)("ngrok",["version"],{stdio:["ignore","pipe","ignore"]}),c="";b.stdout?.on("data",a=>{c+=a.toString()}),b.on("close",()=>a(c.trim()||null)),b.on("error",()=>a(null))}catch{a(null)}})}async function r(a){if(!a)return{ok:!1,error:"ngrok API key not configured"};try{let b=await fetch("https://api.ngrok.com/reserved_domains",{headers:{Authorization:`Bearer ${a}`,"Ngrok-Version":"2"}});if(!b.ok)return{ok:!1,error:`ngrok API ${b.status}: ${(await b.text()).slice(0,200)}`};let c=await b.json();return{ok:!0,domains:(c.reserved_domains??[]).map(a=>({id:a.id,domain:a.domain,region:a.region}))}}catch(a){return{ok:!1,error:"ngrok API call failed: "+(a instanceof Error?a.message:String(a))}}}async function s(){let a=function(){let a=m();return a?null!==a.child.exitCode?(n(void 0),{running:!1}):{running:!0,...a.publicUrl?{publicUrl:a.publicUrl}:{},startedAt:a.startedAt,port:a.port,...a.domain?{domain:a.domain}:{}}:{running:!1}}();return{status:a,cliVersion:await q(),publicHost:process.env.REFLEX_NGROK_HOST??null}}async function t(){let a=await (0,f.M)();if(!a.ngrok.authtoken)return{ok:!1,error:"ngrok.authtoken is empty — fill it in the settings above."};let b=await o({port:a.ngrok.port,authtoken:a.ngrok.authtoken,...a.ngrok.domain?{domain:a.ngrok.domain}:{}});if(!b.ok)return b;let c=await p();if(c)try{let a=new URL(c);process.env.REFLEX_NGROK_HOST=a.host}catch{}return(0,e.revalidatePath)("/settings"),{ok:!0,publicUrl:c}}async function u(){let a=await new Promise(a=>{let b=m();if(!b)return void a(!1);let{child:c}=b,d=!1,e=b=>{d||(d=!0,n(void 0),a(b))};if(c.once("exit",()=>e(!0)),null!==c.exitCode)return void e(!0);try{c.kill("SIGTERM")}catch(a){console.error("[ngrok] SIGTERM failed:",a)}setTimeout(()=>{if(!d){try{c.kill("SIGKILL")}catch{}e(!0)}},2500)});return delete process.env.REFLEX_NGROK_HOST,(0,e.revalidatePath)("/settings"),{ok:a}}async function v(a){try{let b=await (0,f.M)(),c={...b,ngrok:{...b.ngrok,...a}};return await (0,f.D)(c),(0,e.revalidatePath)("/settings"),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function w(){return r((await (0,f.M)()).ngrok.apiKey)}(0,c(63781).D)([s,t,u,v,w]),(0,d.A)(s,"
|
|
4
|
+
`,{mode:384});let f=["http",String(a.port),"--config",e,"--log","stdout","--log-format","json"];a.domain&&f.push(`--domain=${a.domain}`);try{b=(0,g.spawn)("ngrok",f,{detached:!1,stdio:["ignore","pipe","pipe"]})}catch(a){return{ok:!1,error:"Failed to spawn ngrok — is the CLI installed and on PATH? "+(a instanceof Error?a.message:String(a))}}return b.on("error",a=>{console.error("[ngrok] spawn error:",a)}),b.on("exit",(a,c)=>{console.log(`[ngrok] tunnel exited code=${a} signal=${c??"-"}`);let d=m();d?.child===b&&n(void 0)}),b.stdout?.on("data",a=>{let b=a.toString().trim();b&&console.log("[ngrok]",b)}),b.stderr?.on("data",a=>{let b=a.toString().trim();b&&console.error("[ngrok!]",b)}),n({child:b,startedAt:new Date().toISOString(),port:a.port,...a.domain?{domain:a.domain}:{}}),{ok:!0}}async function p(){let a=Date.now()+6e3;for(;Date.now()<a;){try{let a=await fetch("http://127.0.0.1:4040/api/tunnels");if(a.ok){let b=await a.json(),c=b.tunnels.find(a=>"https"===a.proto),d=b.tunnels[0],e=c?.public_url??d?.public_url;if(e){let a=m();return a&&(a.publicUrl=e,n(a)),e}}}catch{}await new Promise(a=>setTimeout(a,400))}return null}async function q(){return new Promise(a=>{try{let b=(0,g.spawn)("ngrok",["version"],{stdio:["ignore","pipe","ignore"]}),c="";b.stdout?.on("data",a=>{c+=a.toString()}),b.on("close",()=>a(c.trim()||null)),b.on("error",()=>a(null))}catch{a(null)}})}async function r(a){if(!a)return{ok:!1,error:"ngrok API key not configured"};try{let b=await fetch("https://api.ngrok.com/reserved_domains",{headers:{Authorization:`Bearer ${a}`,"Ngrok-Version":"2"}});if(!b.ok)return{ok:!1,error:`ngrok API ${b.status}: ${(await b.text()).slice(0,200)}`};let c=await b.json();return{ok:!0,domains:(c.reserved_domains??[]).map(a=>({id:a.id,domain:a.domain,region:a.region}))}}catch(a){return{ok:!1,error:"ngrok API call failed: "+(a instanceof Error?a.message:String(a))}}}async function s(){let a=function(){let a=m();return a?null!==a.child.exitCode?(n(void 0),{running:!1}):{running:!0,...a.publicUrl?{publicUrl:a.publicUrl}:{},startedAt:a.startedAt,port:a.port,...a.domain?{domain:a.domain}:{}}:{running:!1}}();return{status:a,cliVersion:await q(),publicHost:process.env.REFLEX_NGROK_HOST??null}}async function t(){let a=await (0,f.M)();if(!a.ngrok.authtoken)return{ok:!1,error:"ngrok.authtoken is empty — fill it in the settings above."};let b=await o({port:a.ngrok.port,authtoken:a.ngrok.authtoken,...a.ngrok.domain?{domain:a.ngrok.domain}:{}});if(!b.ok)return b;let c=await p();if(c)try{let a=new URL(c);process.env.REFLEX_NGROK_HOST=a.host}catch{}return(0,e.revalidatePath)("/settings"),{ok:!0,publicUrl:c}}async function u(){let a=await new Promise(a=>{let b=m();if(!b)return void a(!1);let{child:c}=b,d=!1,e=b=>{d||(d=!0,n(void 0),a(b))};if(c.once("exit",()=>e(!0)),null!==c.exitCode)return void e(!0);try{c.kill("SIGTERM")}catch(a){console.error("[ngrok] SIGTERM failed:",a)}setTimeout(()=>{if(!d){try{c.kill("SIGKILL")}catch{}e(!0)}},2500)});return delete process.env.REFLEX_NGROK_HOST,(0,e.revalidatePath)("/settings"),{ok:a}}async function v(a){try{let b=await (0,f.M)(),c={...b,ngrok:{...b.ngrok,...a}};return await (0,f.D)(c),(0,e.revalidatePath)("/settings"),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function w(){return r((await (0,f.M)()).ngrok.apiKey)}(0,c(63781).D)([s,t,u,v,w]),(0,d.A)(s,"005bcd722172d298deb64db825d20aa3b6dd70eb78",null),(0,d.A)(t,"00f8379371768018f31fbe420bbbde8cb3dc8ea028",null),(0,d.A)(u,"009689b362ac1f300b14908bf1db6b23dae78ca5b0",null),(0,d.A)(v,"40096f73109b269d095e969f2699c4fde26afa6c0e",null),(0,d.A)(w,"0055552e6a2439fbf3ced5f631b5e69bb5edeb5b79",null)}};
|