"use strict";(()=>{var e={};e.id=5358,e.ids=[5358],e.modules={53524:e=>{e.exports=require("@prisma/client")},72934:e=>{e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},92048:e=>{e.exports=require("fs")},32615:e=>{e.exports=require("http")},35240:e=>{e.exports=require("https")},55315:e=>{e.exports=require("path")},68621:e=>{e.exports=require("punycode")},76162:e=>{e.exports=require("stream")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},6162:e=>{e.exports=require("worker_threads")},71568:e=>{e.exports=require("zlib")},72254:e=>{e.exports=require("node:buffer")},6005:e=>{e.exports=require("node:crypto")},87561:e=>{e.exports=require("node:fs")},84492:e=>{e.exports=require("node:stream")},72477:e=>{e.exports=require("node:stream/web")},47261:e=>{e.exports=require("node:util")},42911:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>g,patchFetch:()=>m,requestAsyncStorage:()=>l,routeModule:()=>x,serverHooks:()=>y,staticGenerationAsyncStorage:()=>q});var s={};t.r(s),t.d(s,{POST:()=>d});var o=t(49303),n=t(88716),i=t(60670),a=t(87070),u=t(95456),p=t(47611),c=t(13538);async function d(e){try{let r=e.cookies.get("session-token")?.value;if(!r)return a.NextResponse.json({error:"Unauthorized"},{status:401});let t=await (0,u.WX)(r);if(!t)return a.NextResponse.json({error:"Invalid session"},{status:401});let{query:s,context:o}=await e.json();if(!s||"string"!=typeof s)return a.NextResponse.json({error:"Query is required"},{status:400});let n=await (0,p.x1)({queryType:"scenario",query:s,context:o,userId:t.userId});return await c._.orisInteraction.create({data:{userId:t.userId,queryType:"scenario",query:s.substring(0,1e3),response:n.content.substring(0,2e3),context:o||void 0,confidence:n.confidence,tokensUsed:n.tokensUsed,latencyMs:n.latencyMs,costUsd:n.costUsd}}),a.NextResponse.json(n)}catch(e){return console.error("[ORIS Scenario] Error:",e),a.NextResponse.json({error:"Internal server error"},{status:500})}}let x=new o.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/oris/scenario/route",pathname:"/api/oris/scenario",filename:"route",bundlePath:"app/api/oris/scenario/route"},resolvedPagePath:"C:\\Users\\Sage\\.gemini\\antigravity\\playground\\Wasiyyah\\src\\app\\api\\oris\\scenario\\route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:l,staticGenerationAsyncStorage:q,serverHooks:y}=x,g="/api/oris/scenario/route";function m(){return(0,i.patchFetch)({serverHooks:y,staticGenerationAsyncStorage:q})}}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8948,8840,5972,672,6433],()=>t(42911));module.exports=s})();