@superinterface/server 1.5.0 → 1.6.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 (58) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/cache/.previewinfo +1 -1
  4. package/.next/cache/.rscinfo +1 -1
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/eslint/.cache_btwyo7 +1 -1
  7. package/.next/fallback-build-manifest.json +2 -2
  8. package/.next/prerender-manifest.json +3 -3
  9. package/.next/server/app/_not-found.html +1 -1
  10. package/.next/server/app/_not-found.rsc +1 -1
  11. package/.next/server/app/index.html +1 -1
  12. package/.next/server/app/index.rsc +1 -1
  13. package/.next/server/chunks/[root-of-the-server]__4e536bc0._.js +1 -1
  14. package/.next/server/chunks/[root-of-the-server]__4e536bc0._.js.map +1 -1
  15. package/.next/server/chunks/[root-of-the-server]__bcdbc64b._.js +1 -1
  16. package/.next/server/chunks/[root-of-the-server]__bcdbc64b._.js.map +1 -1
  17. package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_828c7f3d.js +1 -1
  18. package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_828c7f3d.js.map +1 -1
  19. package/.next/server/chunks/supercorp_superinterface_bebd2c96._.js.map +1 -1
  20. package/.next/server/chunks/supercorp_superinterface_c6d586ec._.js +1 -1
  21. package/.next/server/chunks/supercorp_superinterface_c6d586ec._.js.map +1 -1
  22. package/.next/server/chunks/supercorp_superinterface_d30ea151._.js +1 -1
  23. package/.next/server/chunks/supercorp_superinterface_d30ea151._.js.map +1 -1
  24. package/.next/server/pages/404.html +1 -1
  25. package/.next/server/pages/500.html +1 -1
  26. package/.next/server/server-reference-manifest.js +1 -1
  27. package/.next/server/server-reference-manifest.json +1 -1
  28. package/.next/trace +1 -1
  29. package/dist/app/api/assistants/[assistantId]/buildRoute.d.ts +7 -1
  30. package/dist/app/api/assistants/[assistantId]/buildRoute.d.ts.map +1 -1
  31. package/dist/app/api/assistants/[assistantId]/buildRoute.js +6 -4
  32. package/dist/app/api/assistants/[assistantId]/route.d.ts +7 -1
  33. package/dist/app/api/assistants/[assistantId]/route.d.ts.map +1 -1
  34. package/dist/app/api/assistants/buildRoute.d.ts +22 -4
  35. package/dist/app/api/assistants/buildRoute.d.ts.map +1 -1
  36. package/dist/app/api/assistants/buildRoute.js +6 -4
  37. package/dist/app/api/assistants/route.d.ts +4 -0
  38. package/dist/app/api/assistants/route.d.ts.map +1 -1
  39. package/dist/lib/assistants/assistantClientAdapter/index.d.ts.map +1 -1
  40. package/dist/lib/assistants/serializeApiAssistant.d.ts +2 -0
  41. package/dist/lib/assistants/serializeApiAssistant.d.ts.map +1 -1
  42. package/dist/lib/assistants/serializeApiAssistant.js +2 -0
  43. package/dist/lib/computerCalls/handleComputerCall/index.d.ts +8 -8
  44. package/dist/lib/computerCalls/handleComputerCall/index.d.ts.map +1 -1
  45. package/dist/lib/computerCalls/handleComputerCall/index.js +23 -11
  46. package/dist/lib/functions/handleFunction/index.d.ts.map +1 -1
  47. package/dist/lib/functions/handleFunction/index.js +20 -1
  48. package/dist/lib/mcpServers/getToolCallMcpServer.d.ts +1 -0
  49. package/dist/lib/mcpServers/getToolCallMcpServer.d.ts.map +1 -1
  50. package/dist/lib/mcpServers/getToolCallMcpServer.js +37 -18
  51. package/dist/lib/threads/managedOpenaiThreadId.d.ts.map +1 -1
  52. package/dist/lib/threads/managedOpenaiThreadId.js +1 -2
  53. package/dist/lib/threads/storageThreadId.d.ts.map +1 -1
  54. package/dist/lib/threads/storageThreadId.js +1 -2
  55. package/package.json +1 -1
  56. /package/.next/static/{shpAFERugM2nbzUksiKem → UBq-QQGk_XvgTNFv4eLnz}/_buildManifest.js +0 -0
  57. /package/.next/static/{shpAFERugM2nbzUksiKem → UBq-QQGk_XvgTNFv4eLnz}/_clientMiddlewareManifest.json +0 -0
  58. /package/.next/static/{shpAFERugM2nbzUksiKem → UBq-QQGk_XvgTNFv4eLnz}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[49100,e=>{"use strict";e.s(["handler",()=>M,"patchFetch",()=>q,"routeModule",()=>j,"serverHooks",()=>D,"workAsyncStorage",()=>H,"workUnitAsyncStorage",()=>L],49100);var t=e.i(78243),a=e.i(43877),s=e.i(77767),r=e.i(92562),o=e.i(66256),i=e.i(5270),n=e.i(90231),d=e.i(82677),l=e.i(51081),p=e.i(89822),u=e.i(9124),c=e.i(39147),v=e.i(40568),R=e.i(87188),h=e.i(93695);e.i(57132);var g=e.i(80739);e.s(["DELETE",()=>k,"GET",()=>U,"OPTIONS",()=>O,"PATCH",()=>b],38792);var A=e.i(24493),E=e.i(49493),m=e.i(29173),w=e.i(30611),y=e.i(9949),I=e.i(75247);let f={SCALING_90:"90%",SCALING_95:"95%",SCALING_100:"100%",SCALING_105:"105%",SCALING_110:"110%"};var C=e.i(74044),N=e.i(62666);let T={accentColor:"BLUE",grayColor:"GRAY",appearance:"LIGHT",radius:"MEDIUM",scaling:"SCALING_100"};var P=e.i(40899),x=e.i(11053),S=e.i(13669),_=e.i(88122);let U=(({prisma:e})=>async(t,a)=>{let{assistantId:s}=await a.params,r=(await (0,x.headers)()).get("authorization");if(r){let t=await (0,_.getApiKey)({authorization:r,type:m.ApiKeyType.PRIVATE,prisma:e});if(!t)return E.NextResponse.json({error:"Invalid api key"},{status:400});let a=await e.assistant.findUnique({where:{id:s,workspaceId:t.workspaceId},include:{tools:!0,avatar:{include:{imageAvatar:!0,iconAvatar:!0}}}});return a?E.NextResponse.json({assistant:(0,P.serializeApiAssistant)({assistant:a})},{headers:w.cacheHeaders}):E.NextResponse.json({error:"No assistant found"},{status:400})}let o=await (0,y.workspaceAccessWhere)({publicApiKey:t.nextUrl.searchParams.get("publicApiKey"),prisma:e});if(!o)return E.NextResponse.json({error:"Invalid api key"},{status:400});if(!s)return E.NextResponse.json({error:"No assistant id found"},{status:400});let i=await e.assistant.findFirst({where:{id:s,workspace:o},include:{avatar:{include:{imageAvatar:!0,iconAvatar:!0}}}});return i?E.NextResponse.json({assistant:(({assistant:e})=>({id:e.id,name:(({name:e})=>(0,I.isEmpty)(e)?"Untitled assistant":e??"Untitled assistant")({name:e.name}),description:e.description,theme:(({theme:e})=>({accentColor:(({accentColor:e})=>e.toLowerCase())({accentColor:e.accentColor}),grayColor:e.grayColor.toLowerCase(),appearance:e.appearance.toLowerCase(),radius:e.radius.toLowerCase(),scaling:(({scaling:e})=>f[e])({scaling:e.scaling}),panelBackground:"solid"}))({theme:T}),avatar:(0,C.serializeAvatar)({avatar:e.avatar??N.defaultAvatar})}))({assistant:i})},{headers:w.cacheHeaders}):E.NextResponse.json({error:"No assistant found"},{status:400})})({prisma:A.prisma}),b=(({prisma:e})=>async(t,a)=>{let{assistantId:s}=await a.params,r=(await (0,x.headers)()).get("authorization");if(!r)return E.NextResponse.json({error:"No authorization header found"},{status:400});let o=await (0,_.getApiKey)({authorization:r,type:m.ApiKeyType.PRIVATE,prisma:e});if(!o)return E.NextResponse.json({error:"Invalid api key"},{status:400});let i=S.z.object({storageProviderType:S.z.nativeEnum(m.StorageProviderType).optional(),storageProviderAssistantId:S.z.string().nullable().optional(),modelProviderId:S.z.string().optional(),model:S.z.string().optional(),name:S.z.string().optional(),description:S.z.string().optional(),instructions:S.z.string().optional(),codeInterpreterEnabled:S.z.boolean().optional(),fileSearchEnabled:S.z.boolean().optional()}).superRefine((e,t)=>{e.storageProviderType&&(e.storageProviderType===m.StorageProviderType.SUPERINTERFACE_CLOUD&&e.storageProviderAssistantId&&t.addIssue({code:S.z.ZodIssueCode.custom,message:"storageProviderAssistantId should not be provided for SUPERINTERFACE_CLOUD",path:["storageProviderAssistantId"]}),e.storageProviderType===m.StorageProviderType.SUPERINTERFACE_CLOUD||e.storageProviderAssistantId||t.addIssue({code:S.z.ZodIssueCode.custom,message:"storageProviderAssistantId is required for this storage provider",path:["storageProviderAssistantId"]}))}).safeParse(await t.json());if(!i.success)return E.NextResponse.json({error:"Invalid body: "+i.error.message},{status:400});let{storageProviderType:n,storageProviderAssistantId:d,modelProviderId:l,model:p,name:u,description:c,instructions:v,codeInterpreterEnabled:R,fileSearchEnabled:h}=i.data,g=await e.assistant.findUnique({where:{id:s,workspaceId:o.workspaceId},select:{storageProviderType:!0}});if(!g)return E.NextResponse.json({error:"No assistant found"},{status:400});let A=n??g.storageProviderType,y={...void 0!==n&&{storageProviderType:n},...void 0!==d&&(A===m.StorageProviderType.AZURE_AGENTS?{azureAgentsAgentId:d,openaiAssistantId:null,azureResponsesAgentName:null}:A===m.StorageProviderType.AZURE_RESPONSES?{azureResponsesAgentName:d,openaiAssistantId:null,azureAgentsAgentId:null}:{openaiAssistantId:d,azureAgentsAgentId:null,azureResponsesAgentName:null}),...void 0!==l&&{modelProvider:{connect:{id:l}}},...void 0!==p&&{modelSlug:p},...void 0!==u&&{name:u},...void 0!==c&&{description:c},...void 0!==v&&{instructions:v},tools:{create:[...!0===R?[{type:m.ToolType.CODE_INTERPRETER,codeInterpreterTool:{create:{}}}]:[],...!0===h?[{type:m.ToolType.FILE_SEARCH,fileSearchTool:{create:{}}}]:[]],deleteMany:[...!1===R?[{assistantId:s,type:m.ToolType.CODE_INTERPRETER}]:[],...!1===h?[{assistantId:s,type:m.ToolType.FILE_SEARCH}]:[]]}},I=await e.assistant.update({where:{id:s,workspaceId:o.workspaceId},data:y,include:{tools:!0,avatar:{include:{imageAvatar:!0,iconAvatar:!0}}}});return E.NextResponse.json({assistant:(0,P.serializeApiAssistant)({assistant:I})},{headers:w.cacheHeaders})})({prisma:A.prisma}),k=(({prisma:e})=>async(t,a)=>{let{assistantId:s}=await a.params,r=(await (0,x.headers)()).get("authorization");if(!r)return E.NextResponse.json({error:"No authorization header found"},{status:400});let o=await (0,_.getApiKey)({authorization:r,type:m.ApiKeyType.PRIVATE,prisma:e});if(!o)return E.NextResponse.json({error:"Invalid api key"},{status:400});let i=await e.assistant.findFirst({where:{id:s,workspaceId:o.workspaceId},include:{tools:!0,avatar:{include:{imageAvatar:!0,iconAvatar:!0}}}});return i?(await e.assistant.delete({where:{id:i.id}}),E.NextResponse.json({assistant:(0,P.serializeApiAssistant)({assistant:i})},{headers:w.cacheHeaders})):E.NextResponse.json({error:"No assistant found"},{status:400})})({prisma:A.prisma}),O=()=>E.NextResponse.json({},{headers:w.cacheHeaders});var z=e.i(38792);let j=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/assistants/[assistantId]/route",pathname:"/api/assistants/[assistantId]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/supercorp/superinterface/packages/server/src/app/api/assistants/[assistantId]/route.ts",nextConfigOutput:"",userland:z}),{workAsyncStorage:H,workUnitAsyncStorage:L,serverHooks:D}=j;function q(){return(0,s.patchFetch)({workAsyncStorage:H,workUnitAsyncStorage:L})}async function M(e,t,s){var A;let E="/api/assistants/[assistantId]/route";E=E.replace(/\/index$/,"")||"/";let m=await j.prepare(e,t,{srcPage:E,multiZoneDraftMode:!1});if(!m)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:w,params:y,nextConfig:I,isDraftMode:f,prerenderManifest:C,routerServerContext:N,isOnDemandRevalidate:T,revalidateOnlyGenerated:P,resolvedPathname:x}=m,S=(0,i.normalizeAppPath)(E),_=!!(C.dynamicRoutes[S]||C.routes[x]);if(_&&!f){let e=!!C.routes[x],t=C.dynamicRoutes[S];if(t&&!1===t.fallback&&!e)throw new h.NoFallbackError}let U=null;!_||j.isDev||f||(U="/index"===(U=x)?"/":U);let b=!0===j.isDev||!_,k=_&&!b,O=e.method||"GET",z=(0,o.getTracer)(),H=z.getActiveScopeSpan(),L={params:y,prerenderManifest:C,renderOpts:{experimental:{cacheComponents:!!I.experimental.cacheComponents,authInterrupts:!!I.experimental.authInterrupts},supportsDynamicResponse:b,incrementalCache:(0,r.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:null==(A=I.experimental)?void 0:A.cacheLife,isRevalidate:k,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,s)=>j.onRequestError(e,t,s,N)},sharedContext:{buildId:w}},D=new n.NodeNextRequest(e),q=new n.NodeNextResponse(t),M=d.NextRequestAdapter.fromNodeNextRequest(D,(0,d.signalFromNodeResponse)(t));try{let i=async a=>j.handle(M,L).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let s=z.getRootSpanAttributes();if(!s)return;if(s.get("next.span_type")!==l.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${s.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=s.get("next.route");if(r){let e=`${O} ${r}`;a.setAttributes({"next.route":r,"http.route":r,"next.span_name":e}),a.updateName(e)}else a.updateName(`${O} ${e.url}`)}),n=async o=>{var n,d;let l=async({previousCacheEntry:a})=>{try{if(!(0,r.getRequestMeta)(e,"minimalMode")&&T&&P&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await i(o);e.fetchMetrics=L.renderOpts.fetchMetrics;let d=L.renderOpts.pendingWaitUntil;d&&s.waitUntil&&(s.waitUntil(d),d=void 0);let l=L.renderOpts.collectedTags;if(!_)return await (0,u.sendResponse)(D,q,n,L.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,c.toNodeOutgoingHttpHeaders)(n.headers);l&&(t[R.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==L.renderOpts.collectedRevalidate&&!(L.renderOpts.collectedRevalidate>=R.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,s=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=R.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:s}}}}catch(t){throw(null==a?void 0:a.isStale)&&await j.onRequestError(e,t,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isRevalidate:k,isOnDemandRevalidate:T})},N),t}},h=await j.handleResponse({req:e,nextConfig:I,cacheKey:U,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:P,responseGenerator:l,waitUntil:s.waitUntil});if(!_)return null;if((null==h||null==(n=h.value)?void 0:n.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==h||null==(d=h.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,r.getRequestMeta)(e,"minimalMode")||t.setHeader("x-nextjs-cache",T?"REVALIDATED":h.isMiss?"MISS":h.isStale?"STALE":"HIT"),f&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let A=(0,c.fromNodeOutgoingHttpHeaders)(h.value.headers);return(0,r.getRequestMeta)(e,"minimalMode")&&_||A.delete(R.NEXT_CACHE_TAGS_HEADER),!h.cacheControl||t.getHeader("Cache-Control")||A.get("Cache-Control")||A.set("Cache-Control",(0,v.getCacheControlHeader)(h.cacheControl)),await (0,u.sendResponse)(D,q,new Response(h.value.body,{headers:A,status:h.value.status||200})),null};H?await n(H):await z.withPropagatedContext(e.headers,()=>z.trace(l.BaseServerSpan.handleRequest,{spanName:`${O} ${e.url}`,kind:o.SpanKind.SERVER,attributes:{"http.method":O,"http.target":e.url}},n))}catch(t){if(t instanceof h.NoFallbackError||await j.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isRevalidate:k,isOnDemandRevalidate:T})}),_)throw t;return await (0,u.sendResponse)(D,q,new Response(null,{status:500})),null}}}];
1
+ module.exports=[49100,e=>{"use strict";e.s(["handler",()=>q,"patchFetch",()=>M,"routeModule",()=>j,"serverHooks",()=>D,"workAsyncStorage",()=>H,"workUnitAsyncStorage",()=>L],49100);var t=e.i(78243),a=e.i(43877),s=e.i(77767),r=e.i(92562),o=e.i(66256),n=e.i(5270),i=e.i(90231),d=e.i(82677),l=e.i(51081),p=e.i(89822),u=e.i(9124),c=e.i(39147),v=e.i(40568),R=e.i(87188),h=e.i(93695);e.i(57132);var g=e.i(80739);e.s(["DELETE",()=>z,"GET",()=>b,"OPTIONS",()=>k,"PATCH",()=>U],38792);var A=e.i(24493),E=e.i(49493),m=e.i(29173),y=e.i(30611),w=e.i(9949),I=e.i(75247);let f={SCALING_90:"90%",SCALING_95:"95%",SCALING_100:"100%",SCALING_105:"105%",SCALING_110:"110%"};var C=e.i(74044),T=e.i(62666);let N={accentColor:"BLUE",grayColor:"GRAY",appearance:"LIGHT",radius:"MEDIUM",scaling:"SCALING_100"};var P=e.i(40899),x=e.i(11053),S=e.i(13669),_=e.i(88122);let b=(({prisma:e})=>async(t,a)=>{let{assistantId:s}=await a.params,r=(await (0,x.headers)()).get("authorization");if(r){let t=await (0,_.getApiKey)({authorization:r,type:m.ApiKeyType.PRIVATE,prisma:e});if(!t)return E.NextResponse.json({error:"Invalid api key"},{status:400});let a=await e.assistant.findUnique({where:{id:s,workspaceId:t.workspaceId},include:{tools:!0,avatar:{include:{imageAvatar:!0,iconAvatar:!0}}}});return a?E.NextResponse.json({assistant:(0,P.serializeApiAssistant)({assistant:a})},{headers:y.cacheHeaders}):E.NextResponse.json({error:"No assistant found"},{status:400})}let o=await (0,w.workspaceAccessWhere)({publicApiKey:t.nextUrl.searchParams.get("publicApiKey"),prisma:e});if(!o)return E.NextResponse.json({error:"Invalid api key"},{status:400});if(!s)return E.NextResponse.json({error:"No assistant id found"},{status:400});let n=await e.assistant.findFirst({where:{id:s,workspace:o},include:{avatar:{include:{imageAvatar:!0,iconAvatar:!0}}}});return n?E.NextResponse.json({assistant:(({assistant:e})=>({id:e.id,name:(({name:e})=>(0,I.isEmpty)(e)?"Untitled assistant":e??"Untitled assistant")({name:e.name}),description:e.description,theme:(({theme:e})=>({accentColor:(({accentColor:e})=>e.toLowerCase())({accentColor:e.accentColor}),grayColor:e.grayColor.toLowerCase(),appearance:e.appearance.toLowerCase(),radius:e.radius.toLowerCase(),scaling:(({scaling:e})=>f[e])({scaling:e.scaling}),panelBackground:"solid"}))({theme:N}),avatar:(0,C.serializeAvatar)({avatar:e.avatar??T.defaultAvatar})}))({assistant:n})},{headers:y.cacheHeaders}):E.NextResponse.json({error:"No assistant found"},{status:400})})({prisma:A.prisma}),U=(({prisma:e})=>async(t,a)=>{let{assistantId:s}=await a.params,r=(await (0,x.headers)()).get("authorization");if(!r)return E.NextResponse.json({error:"No authorization header found"},{status:400});let o=await (0,_.getApiKey)({authorization:r,type:m.ApiKeyType.PRIVATE,prisma:e});if(!o)return E.NextResponse.json({error:"Invalid api key"},{status:400});let n=S.z.object({storageProviderType:S.z.nativeEnum(m.StorageProviderType).optional(),storageProviderAssistantId:S.z.string().nullable().optional(),modelProviderId:S.z.string().optional(),model:S.z.string().optional(),name:S.z.string().optional(),description:S.z.string().optional(),instructions:S.z.string().optional(),codeInterpreterEnabled:S.z.boolean().optional(),fileSearchEnabled:S.z.boolean().optional(),truncationType:S.z.nativeEnum(m.TruncationType).optional(),truncationLastMessagesCount:S.z.number().int().nullable().optional()}).superRefine((e,t)=>{e.storageProviderType&&(e.storageProviderType===m.StorageProviderType.SUPERINTERFACE_CLOUD&&e.storageProviderAssistantId&&t.addIssue({code:S.z.ZodIssueCode.custom,message:"storageProviderAssistantId should not be provided for SUPERINTERFACE_CLOUD",path:["storageProviderAssistantId"]}),e.storageProviderType===m.StorageProviderType.SUPERINTERFACE_CLOUD||e.storageProviderAssistantId||t.addIssue({code:S.z.ZodIssueCode.custom,message:"storageProviderAssistantId is required for this storage provider",path:["storageProviderAssistantId"]}))}).safeParse(await t.json());if(!n.success)return E.NextResponse.json({error:"Invalid body: "+n.error.message},{status:400});let{storageProviderType:i,storageProviderAssistantId:d,modelProviderId:l,model:p,name:u,description:c,instructions:v,codeInterpreterEnabled:R,fileSearchEnabled:h,truncationType:g,truncationLastMessagesCount:A}=n.data,w=await e.assistant.findUnique({where:{id:s,workspaceId:o.workspaceId},select:{storageProviderType:!0}});if(!w)return E.NextResponse.json({error:"No assistant found"},{status:400});let I=i??w.storageProviderType,f={...void 0!==i&&{storageProviderType:i},...void 0!==d&&(I===m.StorageProviderType.AZURE_AGENTS?{azureAgentsAgentId:d,openaiAssistantId:null,azureResponsesAgentName:null}:I===m.StorageProviderType.AZURE_RESPONSES?{azureResponsesAgentName:d,openaiAssistantId:null,azureAgentsAgentId:null}:{openaiAssistantId:d,azureAgentsAgentId:null,azureResponsesAgentName:null}),...void 0!==l&&{modelProvider:{connect:{id:l}}},...void 0!==p&&{modelSlug:p},...void 0!==u&&{name:u},...void 0!==c&&{description:c},...void 0!==v&&{instructions:v},...void 0!==g&&{truncationType:g},...void 0!==A&&{truncationLastMessagesCount:A},tools:{create:[...!0===R?[{type:m.ToolType.CODE_INTERPRETER,codeInterpreterTool:{create:{}}}]:[],...!0===h?[{type:m.ToolType.FILE_SEARCH,fileSearchTool:{create:{}}}]:[]],deleteMany:[...!1===R?[{assistantId:s,type:m.ToolType.CODE_INTERPRETER}]:[],...!1===h?[{assistantId:s,type:m.ToolType.FILE_SEARCH}]:[]]}},C=await e.assistant.update({where:{id:s,workspaceId:o.workspaceId},data:f,include:{tools:!0,avatar:{include:{imageAvatar:!0,iconAvatar:!0}}}});return E.NextResponse.json({assistant:(0,P.serializeApiAssistant)({assistant:C})},{headers:y.cacheHeaders})})({prisma:A.prisma}),z=(({prisma:e})=>async(t,a)=>{let{assistantId:s}=await a.params,r=(await (0,x.headers)()).get("authorization");if(!r)return E.NextResponse.json({error:"No authorization header found"},{status:400});let o=await (0,_.getApiKey)({authorization:r,type:m.ApiKeyType.PRIVATE,prisma:e});if(!o)return E.NextResponse.json({error:"Invalid api key"},{status:400});let n=await e.assistant.findFirst({where:{id:s,workspaceId:o.workspaceId},include:{tools:!0,avatar:{include:{imageAvatar:!0,iconAvatar:!0}}}});return n?(await e.assistant.delete({where:{id:n.id}}),E.NextResponse.json({assistant:(0,P.serializeApiAssistant)({assistant:n})},{headers:y.cacheHeaders})):E.NextResponse.json({error:"No assistant found"},{status:400})})({prisma:A.prisma}),k=()=>E.NextResponse.json({},{headers:y.cacheHeaders});var O=e.i(38792);let j=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/assistants/[assistantId]/route",pathname:"/api/assistants/[assistantId]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/supercorp/superinterface/packages/server/src/app/api/assistants/[assistantId]/route.ts",nextConfigOutput:"",userland:O}),{workAsyncStorage:H,workUnitAsyncStorage:L,serverHooks:D}=j;function M(){return(0,s.patchFetch)({workAsyncStorage:H,workUnitAsyncStorage:L})}async function q(e,t,s){var A;let E="/api/assistants/[assistantId]/route";E=E.replace(/\/index$/,"")||"/";let m=await j.prepare(e,t,{srcPage:E,multiZoneDraftMode:!1});if(!m)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:y,params:w,nextConfig:I,isDraftMode:f,prerenderManifest:C,routerServerContext:T,isOnDemandRevalidate:N,revalidateOnlyGenerated:P,resolvedPathname:x}=m,S=(0,n.normalizeAppPath)(E),_=!!(C.dynamicRoutes[S]||C.routes[x]);if(_&&!f){let e=!!C.routes[x],t=C.dynamicRoutes[S];if(t&&!1===t.fallback&&!e)throw new h.NoFallbackError}let b=null;!_||j.isDev||f||(b="/index"===(b=x)?"/":b);let U=!0===j.isDev||!_,z=_&&!U,k=e.method||"GET",O=(0,o.getTracer)(),H=O.getActiveScopeSpan(),L={params:w,prerenderManifest:C,renderOpts:{experimental:{cacheComponents:!!I.experimental.cacheComponents,authInterrupts:!!I.experimental.authInterrupts},supportsDynamicResponse:U,incrementalCache:(0,r.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:null==(A=I.experimental)?void 0:A.cacheLife,isRevalidate:z,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,s)=>j.onRequestError(e,t,s,T)},sharedContext:{buildId:y}},D=new i.NodeNextRequest(e),M=new i.NodeNextResponse(t),q=d.NextRequestAdapter.fromNodeNextRequest(D,(0,d.signalFromNodeResponse)(t));try{let n=async a=>j.handle(q,L).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let s=O.getRootSpanAttributes();if(!s)return;if(s.get("next.span_type")!==l.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${s.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=s.get("next.route");if(r){let e=`${k} ${r}`;a.setAttributes({"next.route":r,"http.route":r,"next.span_name":e}),a.updateName(e)}else a.updateName(`${k} ${e.url}`)}),i=async o=>{var i,d;let l=async({previousCacheEntry:a})=>{try{if(!(0,r.getRequestMeta)(e,"minimalMode")&&N&&P&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await n(o);e.fetchMetrics=L.renderOpts.fetchMetrics;let d=L.renderOpts.pendingWaitUntil;d&&s.waitUntil&&(s.waitUntil(d),d=void 0);let l=L.renderOpts.collectedTags;if(!_)return await (0,u.sendResponse)(D,M,i,L.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,c.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[R.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==L.renderOpts.collectedRevalidate&&!(L.renderOpts.collectedRevalidate>=R.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,s=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=R.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:s}}}}catch(t){throw(null==a?void 0:a.isStale)&&await j.onRequestError(e,t,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isRevalidate:z,isOnDemandRevalidate:N})},T),t}},h=await j.handleResponse({req:e,nextConfig:I,cacheKey:b,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:P,responseGenerator:l,waitUntil:s.waitUntil});if(!_)return null;if((null==h||null==(i=h.value)?void 0:i.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==h||null==(d=h.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,r.getRequestMeta)(e,"minimalMode")||t.setHeader("x-nextjs-cache",N?"REVALIDATED":h.isMiss?"MISS":h.isStale?"STALE":"HIT"),f&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let A=(0,c.fromNodeOutgoingHttpHeaders)(h.value.headers);return(0,r.getRequestMeta)(e,"minimalMode")&&_||A.delete(R.NEXT_CACHE_TAGS_HEADER),!h.cacheControl||t.getHeader("Cache-Control")||A.get("Cache-Control")||A.set("Cache-Control",(0,v.getCacheControlHeader)(h.cacheControl)),await (0,u.sendResponse)(D,M,new Response(h.value.body,{headers:A,status:h.value.status||200})),null};H?await i(H):await O.withPropagatedContext(e.headers,()=>O.trace(l.BaseServerSpan.handleRequest,{spanName:`${k} ${e.url}`,kind:o.SpanKind.SERVER,attributes:{"http.method":k,"http.target":e.url}},i))}catch(t){if(t instanceof h.NoFallbackError||await j.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isRevalidate:z,isOnDemandRevalidate:N})}),_)throw t;return await (0,u.sendResponse)(D,M,new Response(null,{status:500})),null}}}];
2
2
 
3
3
  //# sourceMappingURL=c4f00_next_dist_esm_build_templates_app-route_828c7f3d.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["turbopack:///[project]/supercorp/superinterface/packages/server/src/app/api/assistants/[assistantId]/route.ts","turbopack:///[project]/supercorp/superinterface/packages/server/src/app/api/assistants/[assistantId]/buildRoute.ts","turbopack:///[project]/supercorp/superinterface/packages/server/src/lib/assistants/formatName.ts","turbopack:///[project]/supercorp/superinterface/node_modules/next/dist/esm/build/templates/app-route.js","turbopack:///[project]/supercorp/superinterface/packages/server/src/lib/themes/defaultTheme.ts","turbopack:///[project]/supercorp/superinterface/packages/server/src/lib/themes/serializeTheme/serializeScaling.ts","turbopack:///[project]/supercorp/superinterface/packages/server/src/lib/themes/serializeAccentColor.ts","turbopack:///[project]/supercorp/superinterface/packages/server/src/lib/assistants/serializeAssistant.ts","turbopack:///[project]/supercorp/superinterface/packages/server/src/lib/themes/serializeTheme/index.ts"],"sourcesContent":["import { prisma } from '@/lib/prisma'\nimport { buildDELETE, buildGET, buildOPTIONS, buildPATCH } from './buildRoute'\n\nexport const GET = buildGET({ prisma })\n\nexport const PATCH = buildPATCH({ prisma })\n\nexport const DELETE = buildDELETE({ prisma })\n\nexport const OPTIONS = buildOPTIONS()\n","import { type NextRequest, NextResponse } from 'next/server'\nimport {\n StorageProviderType,\n Prisma,\n ApiKeyType,\n ToolType,\n type PrismaClient,\n} from '@prisma/client'\nimport { cacheHeaders } from '@/lib/cache/cacheHeaders'\nimport { workspaceAccessWhere as getWorkspaceAccessWhere } from '@/lib/apiKeys/workspaceAccessWhere'\nimport { serializeAssistant } from '@/lib/assistants/serializeAssistant'\nimport { serializeApiAssistant } from '@/lib/assistants/serializeApiAssistant'\nimport { headers } from 'next/headers'\nimport { z } from 'zod'\nimport { getApiKey } from '@/lib/apiKeys/getApiKey'\n\ntype RouteProps = {\n params: Promise<{\n assistantId: string\n }>\n}\n\nexport const buildGET =\n ({ prisma }: { prisma: PrismaClient }) =>\n async (request: NextRequest, props: RouteProps) => {\n const params = await props.params\n\n const { assistantId } = params\n\n const headersList = await headers()\n const authorization = headersList.get('authorization')\n\n if (authorization) {\n const privateApiKey = await getApiKey({\n authorization,\n type: ApiKeyType.PRIVATE,\n prisma,\n })\n\n if (!privateApiKey) {\n return NextResponse.json({ error: 'Invalid api key' }, { status: 400 })\n }\n\n const assistant = await prisma.assistant.findUnique({\n where: {\n id: assistantId,\n workspaceId: privateApiKey.workspaceId,\n },\n include: {\n tools: true,\n avatar: {\n include: {\n imageAvatar: true,\n iconAvatar: true,\n },\n },\n },\n })\n\n if (!assistant) {\n return NextResponse.json(\n { error: 'No assistant found' },\n { status: 400 },\n )\n }\n\n return NextResponse.json(\n {\n assistant: serializeApiAssistant({ assistant }),\n },\n { headers: cacheHeaders },\n )\n }\n\n const workspaceAccessWhere = await getWorkspaceAccessWhere({\n publicApiKey: request.nextUrl.searchParams.get('publicApiKey'),\n prisma,\n })\n\n if (!workspaceAccessWhere) {\n return NextResponse.json({ error: 'Invalid api key' }, { status: 400 })\n }\n\n if (!assistantId) {\n return NextResponse.json(\n { error: 'No assistant id found' },\n { status: 400 },\n )\n }\n\n const assistant = await prisma.assistant.findFirst({\n where: {\n id: assistantId,\n workspace: workspaceAccessWhere,\n },\n include: {\n avatar: {\n include: {\n imageAvatar: true,\n iconAvatar: true,\n },\n },\n },\n })\n\n if (!assistant) {\n return NextResponse.json({ error: 'No assistant found' }, { status: 400 })\n }\n\n return NextResponse.json(\n {\n assistant: serializeAssistant({ assistant }),\n },\n { headers: cacheHeaders },\n )\n }\n\nexport const buildPATCH =\n ({ prisma }: { prisma: PrismaClient }) =>\n async (request: NextRequest, props: RouteProps) => {\n const params = await props.params\n\n const { assistantId } = params\n\n const headersList = await headers()\n const authorization = headersList.get('authorization')\n if (!authorization) {\n return NextResponse.json(\n { error: 'No authorization header found' },\n { status: 400 },\n )\n }\n\n const privateApiKey = await getApiKey({\n authorization,\n type: ApiKeyType.PRIVATE,\n prisma,\n })\n\n if (!privateApiKey) {\n return NextResponse.json({ error: 'Invalid api key' }, { status: 400 })\n }\n\n const updateSchema = z\n .object({\n storageProviderType: z.nativeEnum(StorageProviderType).optional(),\n storageProviderAssistantId: z.string().nullable().optional(),\n modelProviderId: z.string().optional(),\n model: z.string().optional(),\n name: z.string().optional(),\n description: z.string().optional(),\n instructions: z.string().optional(),\n codeInterpreterEnabled: z.boolean().optional(),\n fileSearchEnabled: z.boolean().optional(),\n })\n .superRefine((data, ctx) => {\n if (!data.storageProviderType) return\n\n if (\n data.storageProviderType ===\n StorageProviderType.SUPERINTERFACE_CLOUD &&\n data.storageProviderAssistantId\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n 'storageProviderAssistantId should not be provided for SUPERINTERFACE_CLOUD',\n path: ['storageProviderAssistantId'],\n })\n }\n\n if (\n data.storageProviderType !==\n StorageProviderType.SUPERINTERFACE_CLOUD &&\n !data.storageProviderAssistantId\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n 'storageProviderAssistantId is required for this storage provider',\n path: ['storageProviderAssistantId'],\n })\n }\n })\n\n const parseResult = updateSchema.safeParse(await request.json())\n\n if (!parseResult.success) {\n return NextResponse.json(\n {\n error: 'Invalid body: ' + parseResult.error.message,\n },\n { status: 400 },\n )\n }\n\n const {\n storageProviderType,\n storageProviderAssistantId,\n modelProviderId,\n model,\n name,\n description,\n instructions,\n codeInterpreterEnabled,\n fileSearchEnabled,\n } = parseResult.data\n\n // Fetch existing assistant to determine storage provider type if not provided in update\n const existingAssistant = await prisma.assistant.findUnique({\n where: {\n id: assistantId,\n workspaceId: privateApiKey.workspaceId,\n },\n select: {\n storageProviderType: true,\n },\n })\n\n if (!existingAssistant) {\n return NextResponse.json({ error: 'No assistant found' }, { status: 400 })\n }\n\n const effectiveStorageProviderType =\n storageProviderType ?? existingAssistant.storageProviderType\n\n const data: Prisma.AssistantUpdateInput = {\n ...(storageProviderType !== undefined && { storageProviderType }),\n ...(storageProviderAssistantId !== undefined &&\n (effectiveStorageProviderType === StorageProviderType.AZURE_AGENTS\n ? {\n azureAgentsAgentId: storageProviderAssistantId,\n openaiAssistantId: null,\n azureResponsesAgentName: null,\n }\n : effectiveStorageProviderType === StorageProviderType.AZURE_RESPONSES\n ? {\n azureResponsesAgentName: storageProviderAssistantId,\n openaiAssistantId: null,\n azureAgentsAgentId: null,\n }\n : {\n openaiAssistantId: storageProviderAssistantId,\n azureAgentsAgentId: null,\n azureResponsesAgentName: null,\n })),\n ...(modelProviderId !== undefined && {\n modelProvider: { connect: { id: modelProviderId } },\n }),\n ...(model !== undefined && { modelSlug: model }),\n ...(name !== undefined && { name }),\n ...(description !== undefined && { description }),\n ...(instructions !== undefined && { instructions }),\n tools: {\n create: [\n ...(codeInterpreterEnabled === true\n ? [\n {\n type: ToolType.CODE_INTERPRETER,\n codeInterpreterTool: { create: {} },\n },\n ]\n : []),\n ...(fileSearchEnabled === true\n ? [{ type: ToolType.FILE_SEARCH, fileSearchTool: { create: {} } }]\n : []),\n ],\n deleteMany: [\n ...(codeInterpreterEnabled === false\n ? [{ assistantId, type: ToolType.CODE_INTERPRETER }]\n : []),\n ...(fileSearchEnabled === false\n ? [{ assistantId, type: ToolType.FILE_SEARCH }]\n : []),\n ],\n },\n }\n\n const assistant = await prisma.assistant.update({\n where: {\n id: assistantId,\n workspaceId: privateApiKey.workspaceId,\n },\n data,\n include: {\n tools: true,\n avatar: {\n include: {\n imageAvatar: true,\n iconAvatar: true,\n },\n },\n },\n })\n\n return NextResponse.json(\n {\n assistant: serializeApiAssistant({ assistant }),\n },\n { headers: cacheHeaders },\n )\n }\n\nexport const buildDELETE =\n ({ prisma }: { prisma: PrismaClient }) =>\n async (_request: NextRequest, props: RouteProps) => {\n const params = await props.params\n\n const { assistantId } = params\n\n const headersList = await headers()\n const authorization = headersList.get('authorization')\n if (!authorization) {\n return NextResponse.json(\n { error: 'No authorization header found' },\n { status: 400 },\n )\n }\n\n const privateApiKey = await getApiKey({\n authorization,\n type: ApiKeyType.PRIVATE,\n prisma,\n })\n\n if (!privateApiKey) {\n return NextResponse.json({ error: 'Invalid api key' }, { status: 400 })\n }\n const assistant = await prisma.assistant.findFirst({\n where: {\n id: assistantId,\n workspaceId: privateApiKey.workspaceId,\n },\n include: {\n tools: true,\n avatar: {\n include: {\n imageAvatar: true,\n iconAvatar: true,\n },\n },\n },\n })\n\n if (!assistant) {\n return NextResponse.json({ error: 'No assistant found' }, { status: 400 })\n }\n\n await prisma.assistant.delete({\n where: {\n id: assistant.id,\n },\n })\n\n return NextResponse.json(\n {\n assistant: serializeApiAssistant({ assistant }),\n },\n { headers: cacheHeaders },\n )\n }\n\nexport const buildOPTIONS = () => () =>\n NextResponse.json(\n {},\n {\n headers: cacheHeaders,\n },\n )\n","import { isEmpty } from 'radash'\n\nexport const formatName = ({ name }: { name: string | undefined | null }) => {\n if (isEmpty(name)) {\n return 'Untitled assistant'\n }\n\n return name ?? 'Untitled assistant'\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/assistants/[assistantId]/route\",\n pathname: \"/api/assistants/[assistantId]\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/supercorp/superinterface/packages/server/src/app/api/assistants/[assistantId]/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n var _nextConfig_experimental;\n let srcPage = \"/api/assistants/[assistantId]/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isRevalidate = isIsr && !supportsDynamicResponse;\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n cacheComponents: Boolean(nextConfig.experimental.cacheComponents),\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife,\n isRevalidate,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${req.url}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isRevalidate,\n isOnDemandRevalidate\n })\n }, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!getRequestMeta(req, 'minimalMode')) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(getRequestMeta(req, 'minimalMode') && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${req.url}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isRevalidate,\n isOnDemandRevalidate\n })\n });\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","export const defaultTheme = {\n accentColor: 'BLUE',\n grayColor: 'GRAY',\n appearance: 'LIGHT',\n radius: 'MEDIUM',\n scaling: 'SCALING_100',\n}\n","import type { themePropDefs } from '@radix-ui/themes/props'\n\nconst scalingMap = {\n SCALING_90: '90%',\n SCALING_95: '95%',\n SCALING_100: '100%',\n SCALING_105: '105%',\n SCALING_110: '110%',\n} as const\n\nexport const serializeScaling = ({ scaling }: { scaling: string }) =>\n scalingMap[\n scaling as keyof typeof scalingMap\n ] as (typeof themePropDefs.scaling.values)[number]\n","import type { themePropDefs } from '@radix-ui/themes/props'\n\nexport const serializeAccentColor = ({\n accentColor,\n}: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n accentColor: any\n}) =>\n accentColor.toLowerCase() as (typeof themePropDefs.accentColor.values)[number]\n","import { Prisma } from '@prisma/client'\nimport { formatName } from '@/lib/assistants/formatName'\nimport { serializeTheme } from '@/lib/themes/serializeTheme'\nimport { serializeAvatar } from '@/lib/avatars/serializeAvatar'\nimport { defaultAvatar } from '@/lib/avatars/defaultAvatar'\nimport { defaultTheme } from '@/lib/themes/defaultTheme'\n\nexport const serializeAssistant = ({\n assistant,\n}: {\n assistant: Prisma.AssistantGetPayload<{\n include: {\n avatar: {\n include: {\n iconAvatar: true\n imageAvatar: true\n }\n }\n }\n }>\n}) => ({\n id: assistant.id,\n name: formatName({ name: assistant.name }),\n description: assistant.description,\n theme: serializeTheme({\n theme: defaultTheme,\n }),\n avatar: serializeAvatar({\n avatar: assistant.avatar ?? defaultAvatar,\n }),\n})\n","import { themePropDefs } from '@radix-ui/themes/props'\nimport { serializeAccentColor } from '@/lib/themes/serializeAccentColor'\nimport { serializeScaling } from './serializeScaling'\n\ntype Args = {\n theme: {\n accentColor: string\n grayColor: string\n appearance: string\n radius: string\n scaling: string\n }\n}\n\nexport const serializeTheme = ({ theme }: Args) => ({\n accentColor: serializeAccentColor({ accentColor: theme.accentColor }),\n grayColor:\n theme.grayColor.toLowerCase() as (typeof themePropDefs.grayColor.values)[number],\n appearance:\n theme.appearance.toLowerCase() as (typeof themePropDefs.appearance.values)[number],\n radius:\n theme.radius.toLowerCase() as (typeof themePropDefs.radius.values)[number],\n scaling: serializeScaling({ scaling: theme.scaling }),\n panelBackground: 'solid' as const,\n})\n"],"names":[],"mappings":"qLGAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,CAAA,CAAA,OAAA,IAAA,EAAA,EAAA,CAAA,CAAA,6EHfA,IAAA,EAAA,EAAA,CAAA,CAAA,OCAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAOA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MCTA,EAAA,EAAA,CAAA,CAAA,OGEA,IAAM,EAAa,CACjB,WAAY,MACZ,WAAY,MACZ,YAAa,OACb,YAAa,OACb,YAAa,MACf,EELA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OHJO,IAAM,EAAe,CAC1B,YAAa,OACb,UAAW,OACX,WAAY,QACZ,OAAQ,SACR,QAAS,aACX,EHKA,IAAA,EAAA,EAAA,CAAA,CAA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AC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAI,GAAG,CAAA,CAAE,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,GAEf,CAAE,MAAO,EAAK,CAcV,GAbI,AAAE,CAAD,YAAgB,EAAA,eAAe,EAChC,CADmC,KAC7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,cAClC,uBACA,CACJ,EACJ,GAIA,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[3]}
1
+ {"version":3,"sources":["turbopack:///[project]/supercorp/superinterface/node_modules/next/dist/esm/build/templates/app-route.js","turbopack:///[project]/supercorp/superinterface/packages/server/src/app/api/assistants/[assistantId]/route.ts","turbopack:///[project]/supercorp/superinterface/packages/server/src/app/api/assistants/[assistantId]/buildRoute.ts","turbopack:///[project]/supercorp/superinterface/packages/server/src/lib/assistants/formatName.ts","turbopack:///[project]/supercorp/superinterface/packages/server/src/lib/themes/defaultTheme.ts","turbopack:///[project]/supercorp/superinterface/packages/server/src/lib/themes/serializeTheme/serializeScaling.ts","turbopack:///[project]/supercorp/superinterface/packages/server/src/lib/themes/serializeAccentColor.ts","turbopack:///[project]/supercorp/superinterface/packages/server/src/lib/assistants/serializeAssistant.ts","turbopack:///[project]/supercorp/superinterface/packages/server/src/lib/themes/serializeTheme/index.ts"],"sourcesContent":["import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/assistants/[assistantId]/route\",\n pathname: \"/api/assistants/[assistantId]\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/supercorp/superinterface/packages/server/src/app/api/assistants/[assistantId]/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n var _nextConfig_experimental;\n let srcPage = \"/api/assistants/[assistantId]/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isRevalidate = isIsr && !supportsDynamicResponse;\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n cacheComponents: Boolean(nextConfig.experimental.cacheComponents),\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife,\n isRevalidate,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${req.url}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isRevalidate,\n isOnDemandRevalidate\n })\n }, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!getRequestMeta(req, 'minimalMode')) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(getRequestMeta(req, 'minimalMode') && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${req.url}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isRevalidate,\n isOnDemandRevalidate\n })\n });\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","import { prisma } from '@/lib/prisma'\nimport { buildDELETE, buildGET, buildOPTIONS, buildPATCH } from './buildRoute'\n\nexport const GET = buildGET({ prisma })\n\nexport const PATCH = buildPATCH({ prisma })\n\nexport const DELETE = buildDELETE({ prisma })\n\nexport const OPTIONS = buildOPTIONS()\n","import { type NextRequest, NextResponse } from 'next/server'\nimport {\n StorageProviderType,\n TruncationType,\n Prisma,\n ApiKeyType,\n ToolType,\n type PrismaClient,\n} from '@prisma/client'\nimport { cacheHeaders } from '@/lib/cache/cacheHeaders'\nimport { workspaceAccessWhere as getWorkspaceAccessWhere } from '@/lib/apiKeys/workspaceAccessWhere'\nimport { serializeAssistant } from '@/lib/assistants/serializeAssistant'\nimport { serializeApiAssistant } from '@/lib/assistants/serializeApiAssistant'\nimport { headers } from 'next/headers'\nimport { z } from 'zod'\nimport { getApiKey } from '@/lib/apiKeys/getApiKey'\n\ntype RouteProps = {\n params: Promise<{\n assistantId: string\n }>\n}\n\nexport const buildGET =\n ({ prisma }: { prisma: PrismaClient }) =>\n async (request: NextRequest, props: RouteProps) => {\n const params = await props.params\n\n const { assistantId } = params\n\n const headersList = await headers()\n const authorization = headersList.get('authorization')\n\n if (authorization) {\n const privateApiKey = await getApiKey({\n authorization,\n type: ApiKeyType.PRIVATE,\n prisma,\n })\n\n if (!privateApiKey) {\n return NextResponse.json({ error: 'Invalid api key' }, { status: 400 })\n }\n\n const assistant = await prisma.assistant.findUnique({\n where: {\n id: assistantId,\n workspaceId: privateApiKey.workspaceId,\n },\n include: {\n tools: true,\n avatar: {\n include: {\n imageAvatar: true,\n iconAvatar: true,\n },\n },\n },\n })\n\n if (!assistant) {\n return NextResponse.json(\n { error: 'No assistant found' },\n { status: 400 },\n )\n }\n\n return NextResponse.json(\n {\n assistant: serializeApiAssistant({ assistant }),\n },\n { headers: cacheHeaders },\n )\n }\n\n const workspaceAccessWhere = await getWorkspaceAccessWhere({\n publicApiKey: request.nextUrl.searchParams.get('publicApiKey'),\n prisma,\n })\n\n if (!workspaceAccessWhere) {\n return NextResponse.json({ error: 'Invalid api key' }, { status: 400 })\n }\n\n if (!assistantId) {\n return NextResponse.json(\n { error: 'No assistant id found' },\n { status: 400 },\n )\n }\n\n const assistant = await prisma.assistant.findFirst({\n where: {\n id: assistantId,\n workspace: workspaceAccessWhere,\n },\n include: {\n avatar: {\n include: {\n imageAvatar: true,\n iconAvatar: true,\n },\n },\n },\n })\n\n if (!assistant) {\n return NextResponse.json({ error: 'No assistant found' }, { status: 400 })\n }\n\n return NextResponse.json(\n {\n assistant: serializeAssistant({ assistant }),\n },\n { headers: cacheHeaders },\n )\n }\n\nexport const buildPATCH =\n ({ prisma }: { prisma: PrismaClient }) =>\n async (request: NextRequest, props: RouteProps) => {\n const params = await props.params\n\n const { assistantId } = params\n\n const headersList = await headers()\n const authorization = headersList.get('authorization')\n if (!authorization) {\n return NextResponse.json(\n { error: 'No authorization header found' },\n { status: 400 },\n )\n }\n\n const privateApiKey = await getApiKey({\n authorization,\n type: ApiKeyType.PRIVATE,\n prisma,\n })\n\n if (!privateApiKey) {\n return NextResponse.json({ error: 'Invalid api key' }, { status: 400 })\n }\n\n const updateSchema = z\n .object({\n storageProviderType: z.nativeEnum(StorageProviderType).optional(),\n storageProviderAssistantId: z.string().nullable().optional(),\n modelProviderId: z.string().optional(),\n model: z.string().optional(),\n name: z.string().optional(),\n description: z.string().optional(),\n instructions: z.string().optional(),\n codeInterpreterEnabled: z.boolean().optional(),\n fileSearchEnabled: z.boolean().optional(),\n truncationType: z.nativeEnum(TruncationType).optional(),\n truncationLastMessagesCount: z.number().int().nullable().optional(),\n })\n .superRefine((data, ctx) => {\n if (!data.storageProviderType) return\n\n if (\n data.storageProviderType ===\n StorageProviderType.SUPERINTERFACE_CLOUD &&\n data.storageProviderAssistantId\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n 'storageProviderAssistantId should not be provided for SUPERINTERFACE_CLOUD',\n path: ['storageProviderAssistantId'],\n })\n }\n\n if (\n data.storageProviderType !==\n StorageProviderType.SUPERINTERFACE_CLOUD &&\n !data.storageProviderAssistantId\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n 'storageProviderAssistantId is required for this storage provider',\n path: ['storageProviderAssistantId'],\n })\n }\n })\n\n const parseResult = updateSchema.safeParse(await request.json())\n\n if (!parseResult.success) {\n return NextResponse.json(\n {\n error: 'Invalid body: ' + parseResult.error.message,\n },\n { status: 400 },\n )\n }\n\n const {\n storageProviderType,\n storageProviderAssistantId,\n modelProviderId,\n model,\n name,\n description,\n instructions,\n codeInterpreterEnabled,\n fileSearchEnabled,\n truncationType,\n truncationLastMessagesCount,\n } = parseResult.data\n\n // Fetch existing assistant to determine storage provider type if not provided in update\n const existingAssistant = await prisma.assistant.findUnique({\n where: {\n id: assistantId,\n workspaceId: privateApiKey.workspaceId,\n },\n select: {\n storageProviderType: true,\n },\n })\n\n if (!existingAssistant) {\n return NextResponse.json({ error: 'No assistant found' }, { status: 400 })\n }\n\n const effectiveStorageProviderType =\n storageProviderType ?? existingAssistant.storageProviderType\n\n const data: Prisma.AssistantUpdateInput = {\n ...(storageProviderType !== undefined && { storageProviderType }),\n ...(storageProviderAssistantId !== undefined &&\n (effectiveStorageProviderType === StorageProviderType.AZURE_AGENTS\n ? {\n azureAgentsAgentId: storageProviderAssistantId,\n openaiAssistantId: null,\n azureResponsesAgentName: null,\n }\n : effectiveStorageProviderType === StorageProviderType.AZURE_RESPONSES\n ? {\n azureResponsesAgentName: storageProviderAssistantId,\n openaiAssistantId: null,\n azureAgentsAgentId: null,\n }\n : {\n openaiAssistantId: storageProviderAssistantId,\n azureAgentsAgentId: null,\n azureResponsesAgentName: null,\n })),\n ...(modelProviderId !== undefined && {\n modelProvider: { connect: { id: modelProviderId } },\n }),\n ...(model !== undefined && { modelSlug: model }),\n ...(name !== undefined && { name }),\n ...(description !== undefined && { description }),\n ...(instructions !== undefined && { instructions }),\n ...(truncationType !== undefined && { truncationType }),\n ...(truncationLastMessagesCount !== undefined && { truncationLastMessagesCount }),\n tools: {\n create: [\n ...(codeInterpreterEnabled === true\n ? [\n {\n type: ToolType.CODE_INTERPRETER,\n codeInterpreterTool: { create: {} },\n },\n ]\n : []),\n ...(fileSearchEnabled === true\n ? [{ type: ToolType.FILE_SEARCH, fileSearchTool: { create: {} } }]\n : []),\n ],\n deleteMany: [\n ...(codeInterpreterEnabled === false\n ? [{ assistantId, type: ToolType.CODE_INTERPRETER }]\n : []),\n ...(fileSearchEnabled === false\n ? [{ assistantId, type: ToolType.FILE_SEARCH }]\n : []),\n ],\n },\n }\n\n const assistant = await prisma.assistant.update({\n where: {\n id: assistantId,\n workspaceId: privateApiKey.workspaceId,\n },\n data,\n include: {\n tools: true,\n avatar: {\n include: {\n imageAvatar: true,\n iconAvatar: true,\n },\n },\n },\n })\n\n return NextResponse.json(\n {\n assistant: serializeApiAssistant({ assistant }),\n },\n { headers: cacheHeaders },\n )\n }\n\nexport const buildDELETE =\n ({ prisma }: { prisma: PrismaClient }) =>\n async (_request: NextRequest, props: RouteProps) => {\n const params = await props.params\n\n const { assistantId } = params\n\n const headersList = await headers()\n const authorization = headersList.get('authorization')\n if (!authorization) {\n return NextResponse.json(\n { error: 'No authorization header found' },\n { status: 400 },\n )\n }\n\n const privateApiKey = await getApiKey({\n authorization,\n type: ApiKeyType.PRIVATE,\n prisma,\n })\n\n if (!privateApiKey) {\n return NextResponse.json({ error: 'Invalid api key' }, { status: 400 })\n }\n const assistant = await prisma.assistant.findFirst({\n where: {\n id: assistantId,\n workspaceId: privateApiKey.workspaceId,\n },\n include: {\n tools: true,\n avatar: {\n include: {\n imageAvatar: true,\n iconAvatar: true,\n },\n },\n },\n })\n\n if (!assistant) {\n return NextResponse.json({ error: 'No assistant found' }, { status: 400 })\n }\n\n await prisma.assistant.delete({\n where: {\n id: assistant.id,\n },\n })\n\n return NextResponse.json(\n {\n assistant: serializeApiAssistant({ assistant }),\n },\n { headers: cacheHeaders },\n )\n }\n\nexport const buildOPTIONS = () => () =>\n NextResponse.json(\n {},\n {\n headers: cacheHeaders,\n },\n )\n","import { isEmpty } from 'radash'\n\nexport const formatName = ({ name }: { name: string | undefined | null }) => {\n if (isEmpty(name)) {\n return 'Untitled assistant'\n }\n\n return name ?? 'Untitled assistant'\n}\n","export const defaultTheme = {\n accentColor: 'BLUE',\n grayColor: 'GRAY',\n appearance: 'LIGHT',\n radius: 'MEDIUM',\n scaling: 'SCALING_100',\n}\n","import type { themePropDefs } from '@radix-ui/themes/props'\n\nconst scalingMap = {\n SCALING_90: '90%',\n SCALING_95: '95%',\n SCALING_100: '100%',\n SCALING_105: '105%',\n SCALING_110: '110%',\n} as const\n\nexport const serializeScaling = ({ scaling }: { scaling: string }) =>\n scalingMap[\n scaling as keyof typeof scalingMap\n ] as (typeof themePropDefs.scaling.values)[number]\n","import type { themePropDefs } from '@radix-ui/themes/props'\n\nexport const serializeAccentColor = ({\n accentColor,\n}: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n accentColor: any\n}) =>\n accentColor.toLowerCase() as (typeof themePropDefs.accentColor.values)[number]\n","import { Prisma } from '@prisma/client'\nimport { formatName } from '@/lib/assistants/formatName'\nimport { serializeTheme } from '@/lib/themes/serializeTheme'\nimport { serializeAvatar } from '@/lib/avatars/serializeAvatar'\nimport { defaultAvatar } from '@/lib/avatars/defaultAvatar'\nimport { defaultTheme } from '@/lib/themes/defaultTheme'\n\nexport const serializeAssistant = ({\n assistant,\n}: {\n assistant: Prisma.AssistantGetPayload<{\n include: {\n avatar: {\n include: {\n iconAvatar: true\n imageAvatar: true\n }\n }\n }\n }>\n}) => ({\n id: assistant.id,\n name: formatName({ name: assistant.name }),\n description: assistant.description,\n theme: serializeTheme({\n theme: defaultTheme,\n }),\n avatar: serializeAvatar({\n avatar: assistant.avatar ?? defaultAvatar,\n }),\n})\n","import { themePropDefs } from '@radix-ui/themes/props'\nimport { serializeAccentColor } from '@/lib/themes/serializeAccentColor'\nimport { serializeScaling } from './serializeScaling'\n\ntype Args = {\n theme: {\n accentColor: string\n grayColor: string\n appearance: string\n radius: string\n scaling: string\n }\n}\n\nexport const serializeTheme = ({ theme }: Args) => ({\n accentColor: serializeAccentColor({ accentColor: theme.accentColor }),\n grayColor:\n theme.grayColor.toLowerCase() as (typeof themePropDefs.grayColor.values)[number],\n appearance:\n theme.appearance.toLowerCase() as (typeof themePropDefs.appearance.values)[number],\n radius:\n theme.radius.toLowerCase() as (typeof themePropDefs.radius.values)[number],\n scaling: serializeScaling({ scaling: theme.scaling }),\n panelBackground: 'solid' as const,\n})\n"],"names":[],"mappings":"qLAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CA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