@superinterface/server 1.5.1 → 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.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/cache/.previewinfo +1 -1
- package/.next/cache/.rscinfo +1 -1
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/eslint/.cache_btwyo7 +1 -1
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +1 -1
- package/.next/server/chunks/[root-of-the-server]__4e536bc0._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__4e536bc0._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__bcdbc64b._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__bcdbc64b._.js.map +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_828c7f3d.js +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_828c7f3d.js.map +1 -1
- package/.next/server/pages/404.html +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/trace +1 -1
- package/dist/app/api/assistants/[assistantId]/buildRoute.d.ts +6 -0
- package/dist/app/api/assistants/[assistantId]/buildRoute.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/buildRoute.js +6 -4
- package/dist/app/api/assistants/[assistantId]/route.d.ts +6 -0
- package/dist/app/api/assistants/[assistantId]/route.d.ts.map +1 -1
- package/dist/app/api/assistants/buildRoute.d.ts +22 -4
- package/dist/app/api/assistants/buildRoute.d.ts.map +1 -1
- package/dist/app/api/assistants/buildRoute.js +6 -4
- package/dist/app/api/assistants/route.d.ts +4 -0
- package/dist/app/api/assistants/route.d.ts.map +1 -1
- package/dist/lib/assistants/serializeApiAssistant.d.ts +2 -0
- package/dist/lib/assistants/serializeApiAssistant.d.ts.map +1 -1
- package/dist/lib/assistants/serializeApiAssistant.js +2 -0
- package/package.json +1 -1
- /package/.next/static/{sAHFK0SESk212SK8DFgrB → UBq-QQGk_XvgTNFv4eLnz}/_buildManifest.js +0 -0
- /package/.next/static/{sAHFK0SESk212SK8DFgrB → UBq-QQGk_XvgTNFv4eLnz}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{sAHFK0SESk212SK8DFgrB → 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,CA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,EAAD,AAAS,GAAG,CAAC,kBAAkB,AAC7F,EAAQ,GAAG,CAAC,gBAAiB,CAAA,EAAA,EAAA,qBAAA,AAAqB,EAAC,EAAW,YAAY,GAE9E,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,EAAW,KAAK,CAAC,IAAI,CAAE,SAC7E,EACA,OAAQ,EAAW,KAAK,CAAC,MAAM,EAAI,GACvC,IACO,IACX,EAGI,EACA,MAAM,EAAe,EADT,CAGZ,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,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,\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,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":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--UBq_QQGk_XvgTNFv4eLnz--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/76a8a50dbf44f000.js"/><script src="/_next/static/chunks/22375ab8b973caf2.js" async=""></script><script src="/_next/static/chunks/f1fd2298c8f33610.js" async=""></script><script src="/_next/static/chunks/turbopack-ecd75a8101638a7b.js" async=""></script><script src="/_next/static/chunks/03d938d038bc30e3.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/76a8a50dbf44f000.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[96352,[\"/_next/static/chunks/03d938d038bc30e3.js\"],\"default\"]\n3:I[17753,[\"/_next/static/chunks/03d938d038bc30e3.js\"],\"default\"]\n4:I[51035,[\"/_next/static/chunks/03d938d038bc30e3.js\"],\"OutletBoundary\"]\n6:I[33159,[\"/_next/static/chunks/03d938d038bc30e3.js\"],\"AsyncMetadataOutlet\"]\n8:I[51035,[\"/_next/static/chunks/03d938d038bc30e3.js\"],\"ViewportBoundary\"]\na:I[51035,[\"/_next/static/chunks/03d938d038bc30e3.js\"],\"MetadataBoundary\"]\nb:\"$Sreact.suspense\"\nd:I[25098,[\"/_next/static/chunks/03d938d038bc30e3.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"UBq-QQGk_XvgTNFv4eLnz\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/03d938d038bc30e3.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$L5\",[\"$\",\"$L6\",null,{\"promise\":\"$@7\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],null],[\"$\",\"$La\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$b\",null,{\"fallback\":null,\"children\":\"$Lc\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",\"$undefined\"],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n5:null\n"])</script><script>self.__next_f.push([1,"7:{\"metadata\":[],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"c:\"$7:metadata\"\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/a6dad97d9634a72d.js"></script><script src="/_next/static/chunks/22bca0be24d1dbb3.js" defer=""></script><script src="/_next/static/chunks/3afeabcaad450e6e.js" defer=""></script><script src="/_next/static/chunks/turbopack-77830c375ad53a98.js" defer=""></script><script src="/_next/static/chunks/e57ec661e9850a31.js" defer=""></script><script src="/_next/static/chunks/turbopack-cf3460fb5ef0876f.js" defer=""></script><script src="/_next/static/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/a6dad97d9634a72d.js"></script><script src="/_next/static/chunks/22bca0be24d1dbb3.js" defer=""></script><script src="/_next/static/chunks/3afeabcaad450e6e.js" defer=""></script><script src="/_next/static/chunks/turbopack-77830c375ad53a98.js" defer=""></script><script src="/_next/static/chunks/e57ec661e9850a31.js" defer=""></script><script src="/_next/static/chunks/turbopack-cf3460fb5ef0876f.js" defer=""></script><script src="/_next/static/UBq-QQGk_XvgTNFv4eLnz/_ssgManifest.js" defer=""></script><script src="/_next/static/UBq-QQGk_XvgTNFv4eLnz/_buildManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"UBq-QQGk_XvgTNFv4eLnz","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"
|
|
1
|
+
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"KFzmkFRthyRFAOCdHfwEFl6E5AsGjDJWXhy5gB+f2t0=\"\n}"
|
package/.next/trace
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"generate-buildid","duration":129,"timestamp":420208077051,"id":4,"parentId":1,"tags":{},"startTime":1767660407887,"traceId":"aca1ce3d8201a6ba"},{"name":"load-custom-routes","duration":164,"timestamp":420208077225,"id":5,"parentId":1,"tags":{},"startTime":1767660407888,"traceId":"aca1ce3d8201a6ba"},{"name":"create-dist-dir","duration":1994,"timestamp":420208168525,"id":6,"parentId":1,"tags":{},"startTime":1767660407979,"traceId":"aca1ce3d8201a6ba"},{"name":"create-pages-mapping","duration":107,"timestamp":420208247124,"id":7,"parentId":1,"tags":{},"startTime":1767660408057,"traceId":"aca1ce3d8201a6ba"},{"name":"collect-app-files","duration":2380,"timestamp":420208247250,"id":8,"parentId":1,"tags":{},"startTime":1767660408058,"traceId":"aca1ce3d8201a6ba"},{"name":"create-app-mapping","duration":759,"timestamp":420208249641,"id":9,"parentId":1,"tags":{},"startTime":1767660408060,"traceId":"aca1ce3d8201a6ba"},{"name":"create-app-layouts","duration":167,"timestamp":420208250413,"id":10,"parentId":1,"tags":{},"startTime":1767660408061,"traceId":"aca1ce3d8201a6ba"},{"name":"collect-default-files","duration":1002,"timestamp":420208251296,"id":12,"parentId":1,"tags":{},"startTime":1767660408062,"traceId":"aca1ce3d8201a6ba"},{"name":"generate-route-types","duration":12384,"timestamp":420208250847,"id":11,"parentId":1,"tags":{},"startTime":1767660408061,"traceId":"aca1ce3d8201a6ba"},{"name":"public-dir-conflict-check","duration":381,"timestamp":420208263269,"id":13,"parentId":1,"tags":{},"startTime":1767660408074,"traceId":"aca1ce3d8201a6ba"},{"name":"generate-routes-manifest","duration":1185,"timestamp":420208263730,"id":14,"parentId":1,"tags":{},"startTime":1767660408074,"traceId":"aca1ce3d8201a6ba"},{"name":"run-turbopack-compiler","duration":10159235,"timestamp":420208267313,"id":16,"parentId":1,"tags":{},"startTime":1767660408078,"traceId":"aca1ce3d8201a6ba"},{"name":"verify-and-lint","duration":1444937,"timestamp":420218444480,"id":19,"parentId":1,"tags":{},"startTime":1767660418255,"traceId":"aca1ce3d8201a6ba"},{"name":"verify-typescript-setup","duration":5477077,"timestamp":420218442369,"id":18,"parentId":1,"tags":{},"startTime":1767660418253,"traceId":"aca1ce3d8201a6ba"},{"name":"check-static-error-page","duration":2630,"timestamp":420223931829,"id":22,"parentId":21,"tags":{},"startTime":1767660423742,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":2705,"timestamp":420223952265,"id":23,"parentId":21,"tags":{"page":"/_app"},"startTime":1767660423763,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":2046,"timestamp":420223952936,"id":25,"parentId":21,"tags":{"page":"/_document"},"startTime":1767660423763,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":2118,"timestamp":420223952865,"id":24,"parentId":21,"tags":{"page":"/_error"},"startTime":1767660423763,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":302857,"timestamp":420223962384,"id":54,"parentId":41,"tags":{},"startTime":1767660423773,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":312051,"timestamp":420223953250,"id":41,"parentId":21,"tags":{"page":"/api/providers/[modelProviderId]"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":303008,"timestamp":420223962353,"id":53,"parentId":34,"tags":{},"startTime":1767660423773,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":312162,"timestamp":420223953206,"id":34,"parentId":21,"tags":{"page":"/api/assistants/[assistantId]"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":303965,"timestamp":420223962268,"id":52,"parentId":32,"tags":{},"startTime":1767660423773,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":313090,"timestamp":420223953180,"id":32,"parentId":21,"tags":{"page":"/api/assistants/[assistantId]/mcp-servers/[mcpServerId]"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":304133,"timestamp":420223962236,"id":51,"parentId":29,"tags":{},"startTime":1767660423773,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":313336,"timestamp":420223953076,"id":29,"parentId":21,"tags":{"page":"/api/assistants/[assistantId]/functions/[functionId]"},"startTime":1767660423763,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":304399,"timestamp":420223962083,"id":50,"parentId":27,"tags":{},"startTime":1767660423772,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":313451,"timestamp":420223953044,"id":27,"parentId":21,"tags":{"page":"/api/api-keys/[apiKeyId]"},"startTime":1767660423763,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":335229,"timestamp":420223962406,"id":55,"parentId":43,"tags":{},"startTime":1767660423773,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":344421,"timestamp":420223953262,"id":43,"parentId":21,"tags":{"page":"/api/tasks/[taskId]"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":339096,"timestamp":420223962515,"id":56,"parentId":35,"tags":{},"startTime":1767660423773,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":348437,"timestamp":420223953212,"id":35,"parentId":21,"tags":{"page":"/api/assistants"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":351552,"timestamp":420223963343,"id":62,"parentId":31,"tags":{},"startTime":1767660423774,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":361827,"timestamp":420223953095,"id":31,"parentId":21,"tags":{"page":"/api/assistants/[assistantId]/initial-messages"},"startTime":1767660423763,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":357000,"timestamp":420223963419,"id":64,"parentId":47,"tags":{},"startTime":1767660423774,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":367152,"timestamp":420223953294,"id":47,"parentId":21,"tags":{"page":"/api/workspaces/[workspaceId]"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":359888,"timestamp":420223964135,"id":65,"parentId":48,"tags":{},"startTime":1767660423775,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":370742,"timestamp":420223953299,"id":48,"parentId":21,"tags":{"page":"/api/workspaces"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":363531,"timestamp":420223964540,"id":66,"parentId":30,"tags":{},"startTime":1767660423775,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":375040,"timestamp":420223953083,"id":30,"parentId":21,"tags":{"page":"/api/assistants/[assistantId]/functions"},"startTime":1767660423763,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":367841,"timestamp":420223963378,"id":63,"parentId":46,"tags":{},"startTime":1767660423774,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":377975,"timestamp":420223953287,"id":46,"parentId":21,"tags":{"page":"/api/threads/runs/submit-client-tool-outputs"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":368707,"timestamp":420223964557,"id":67,"parentId":33,"tags":{},"startTime":1767660423775,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":380105,"timestamp":420223953195,"id":33,"parentId":21,"tags":{"page":"/api/assistants/[assistantId]/mcp-servers"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":377691,"timestamp":420223964585,"id":69,"parentId":42,"tags":{},"startTime":1767660423775,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":389050,"timestamp":420223953255,"id":42,"parentId":21,"tags":{"page":"/api/providers"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":394071,"timestamp":420223964560,"id":68,"parentId":45,"tags":{},"startTime":1767660423775,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":405378,"timestamp":420223953282,"id":45,"parentId":21,"tags":{"page":"/api/tasks"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":396729,"timestamp":420223964908,"id":71,"parentId":28,"tags":{},"startTime":1767660423775,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":408597,"timestamp":420223953066,"id":28,"parentId":21,"tags":{"page":"/api/api-keys"},"startTime":1767660423763,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":403834,"timestamp":420223964739,"id":70,"parentId":26,"tags":{},"startTime":1767660423775,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":415655,"timestamp":420223952954,"id":26,"parentId":21,"tags":{"page":"/_not-found"},"startTime":1767660423763,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":401939,"timestamp":420223972292,"id":73,"parentId":49,"tags":{},"startTime":1767660423783,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":420946,"timestamp":420223953305,"id":49,"parentId":21,"tags":{"page":"/"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":501453,"timestamp":420223962863,"id":59,"parentId":40,"tags":{},"startTime":1767660423773,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":511107,"timestamp":420223953245,"id":40,"parentId":21,"tags":{"page":"/api/providers/[modelProviderId]/models"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":512372,"timestamp":420223962855,"id":58,"parentId":39,"tags":{},"startTime":1767660423773,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":522017,"timestamp":420223953239,"id":39,"parentId":21,"tags":{"page":"/api/providers/[modelProviderId]/assistants"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":519175,"timestamp":420223963298,"id":61,"parentId":37,"tags":{},"startTime":1767660423774,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":529273,"timestamp":420223953226,"id":37,"parentId":21,"tags":{"page":"/api/files"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":539676,"timestamp":420223962843,"id":57,"parentId":36,"tags":{},"startTime":1767660423773,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":549326,"timestamp":420223953221,"id":36,"parentId":21,"tags":{"page":"/api/files/[fileId]/contents"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":567670,"timestamp":420223963236,"id":60,"parentId":38,"tags":{},"startTime":1767660423774,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":577703,"timestamp":420223953233,"id":38,"parentId":21,"tags":{"page":"/api/messages"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"is-page-static","duration":612263,"timestamp":420223969397,"id":72,"parentId":44,"tags":{},"startTime":1767660423780,"traceId":"aca1ce3d8201a6ba"},{"name":"check-page","duration":628420,"timestamp":420223953267,"id":44,"parentId":21,"tags":{"page":"/api/tasks/callback"},"startTime":1767660423764,"traceId":"aca1ce3d8201a6ba"},{"name":"static-check","duration":650923,"timestamp":420223930779,"id":21,"parentId":1,"tags":{},"startTime":1767660423741,"traceId":"aca1ce3d8201a6ba"},{"name":"generate-required-server-files","duration":462,"timestamp":420224582233,"id":75,"parentId":1,"tags":{},"startTime":1767660424393,"traceId":"aca1ce3d8201a6ba"},{"name":"write-routes-manifest","duration":2915,"timestamp":420224589439,"id":77,"parentId":1,"tags":{},"startTime":1767660424400,"traceId":"aca1ce3d8201a6ba"},{"name":"load-dotenv","duration":26,"timestamp":420224612548,"id":80,"parentId":79,"tags":{},"startTime":1767660424423,"traceId":"aca1ce3d8201a6ba"},{"name":"run-export-path-map","duration":302,"timestamp":420224738999,"id":81,"parentId":79,"tags":{},"startTime":1767660424549,"traceId":"aca1ce3d8201a6ba"},{"name":"next-export","duration":1250938,"timestamp":420224612007,"id":79,"parentId":1,"tags":{},"startTime":1767660424422,"traceId":"aca1ce3d8201a6ba"},{"name":"move-exported-app-not-found-","duration":52944,"timestamp":420225863990,"id":82,"parentId":78,"tags":{},"startTime":1767660425674,"traceId":"aca1ce3d8201a6ba"},{"name":"move-exported-page","duration":95201,"timestamp":420225917060,"id":83,"parentId":78,"tags":{},"startTime":1767660425727,"traceId":"aca1ce3d8201a6ba"},{"name":"static-generation","duration":1630893,"timestamp":420224606240,"id":78,"parentId":1,"tags":{},"startTime":1767660424417,"traceId":"aca1ce3d8201a6ba"},{"name":"write-routes-manifest","duration":8949,"timestamp":420226237404,"id":84,"parentId":1,"tags":{},"startTime":1767660426048,"traceId":"aca1ce3d8201a6ba"},{"name":"node-file-trace-build","duration":3479357,"timestamp":420224585106,"id":76,"parentId":1,"tags":{"isTurbotrace":"false"},"startTime":1767660424395,"traceId":"aca1ce3d8201a6ba"},{"name":"apply-include-excludes","duration":266,"timestamp":420228064477,"id":85,"parentId":1,"tags":{},"startTime":1767660427875,"traceId":"aca1ce3d8201a6ba"},{"name":"print-tree-view","duration":3145,"timestamp":420228065088,"id":86,"parentId":1,"tags":{},"startTime":1767660427875,"traceId":"aca1ce3d8201a6ba"},{"name":"telemetry-flush","duration":35,"timestamp":420228068244,"id":87,"parentId":1,"tags":{},"startTime":1767660427879,"traceId":"aca1ce3d8201a6ba"},{"name":"next-build","duration":20488741,"timestamp":420207579540,"id":1,"tags":{"buildMode":"default","isTurboBuild":"true","version":"15.5.9","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1767660407390,"traceId":"aca1ce3d8201a6ba"}]
|
|
1
|
+
[{"name":"generate-buildid","duration":114,"timestamp":283346951232,"id":4,"parentId":1,"tags":{},"startTime":1770443841786,"traceId":"c3182a08fec5cea4"},{"name":"load-custom-routes","duration":169,"timestamp":283346951392,"id":5,"parentId":1,"tags":{},"startTime":1770443841786,"traceId":"c3182a08fec5cea4"},{"name":"create-dist-dir","duration":643,"timestamp":283347144820,"id":6,"parentId":1,"tags":{},"startTime":1770443841979,"traceId":"c3182a08fec5cea4"},{"name":"create-pages-mapping","duration":210,"timestamp":283347523312,"id":7,"parentId":1,"tags":{},"startTime":1770443842358,"traceId":"c3182a08fec5cea4"},{"name":"collect-app-files","duration":15223,"timestamp":283347523554,"id":8,"parentId":1,"tags":{},"startTime":1770443842358,"traceId":"c3182a08fec5cea4"},{"name":"create-app-mapping","duration":1267,"timestamp":283347538828,"id":9,"parentId":1,"tags":{},"startTime":1770443842373,"traceId":"c3182a08fec5cea4"},{"name":"create-app-layouts","duration":201,"timestamp":283347540116,"id":10,"parentId":1,"tags":{},"startTime":1770443842375,"traceId":"c3182a08fec5cea4"},{"name":"collect-default-files","duration":32486,"timestamp":283347546229,"id":12,"parentId":1,"tags":{},"startTime":1770443842381,"traceId":"c3182a08fec5cea4"},{"name":"generate-route-types","duration":135869,"timestamp":283347540650,"id":11,"parentId":1,"tags":{},"startTime":1770443842375,"traceId":"c3182a08fec5cea4"},{"name":"public-dir-conflict-check","duration":2136,"timestamp":283347676645,"id":13,"parentId":1,"tags":{},"startTime":1770443842511,"traceId":"c3182a08fec5cea4"},{"name":"generate-routes-manifest","duration":11386,"timestamp":283347679127,"id":14,"parentId":1,"tags":{},"startTime":1770443842514,"traceId":"c3182a08fec5cea4"},{"name":"run-turbopack-compiler","duration":14333243,"timestamp":283347745564,"id":16,"parentId":1,"tags":{},"startTime":1770443842580,"traceId":"c3182a08fec5cea4"},{"name":"verify-and-lint","duration":1703712,"timestamp":283362099799,"id":19,"parentId":1,"tags":{},"startTime":1770443856934,"traceId":"c3182a08fec5cea4"},{"name":"verify-typescript-setup","duration":5855275,"timestamp":283362097115,"id":18,"parentId":1,"tags":{},"startTime":1770443856932,"traceId":"c3182a08fec5cea4"},{"name":"check-static-error-page","duration":3630,"timestamp":283367964927,"id":22,"parentId":21,"tags":{},"startTime":1770443862799,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":4600,"timestamp":283367990524,"id":23,"parentId":21,"tags":{"page":"/_app"},"startTime":1770443862825,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":4032,"timestamp":283367991106,"id":25,"parentId":21,"tags":{"page":"/_document"},"startTime":1770443862826,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":4097,"timestamp":283367991041,"id":24,"parentId":21,"tags":{"page":"/_error"},"startTime":1770443862826,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":355046,"timestamp":283368007145,"id":53,"parentId":34,"tags":{},"startTime":1770443862842,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":370116,"timestamp":283367992144,"id":34,"parentId":21,"tags":{"page":"/api/assistants/[assistantId]"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":355282,"timestamp":283368007024,"id":51,"parentId":29,"tags":{},"startTime":1770443862842,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":371074,"timestamp":283367991240,"id":29,"parentId":21,"tags":{"page":"/api/assistants/[assistantId]/functions/[functionId]"},"startTime":1770443862826,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":355599,"timestamp":283368006860,"id":50,"parentId":27,"tags":{},"startTime":1770443862841,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":371263,"timestamp":283367991205,"id":27,"parentId":21,"tags":{"page":"/api/api-keys/[apiKeyId]"},"startTime":1770443862826,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":360386,"timestamp":283368007621,"id":58,"parentId":42,"tags":{},"startTime":1770443862842,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":375843,"timestamp":283367992210,"id":42,"parentId":21,"tags":{"page":"/api/providers"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":365012,"timestamp":283368007054,"id":52,"parentId":32,"tags":{},"startTime":1770443862842,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":380489,"timestamp":283367991607,"id":32,"parentId":21,"tags":{"page":"/api/assistants/[assistantId]/mcp-servers/[mcpServerId]"},"startTime":1770443862826,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":370460,"timestamp":283368007182,"id":54,"parentId":41,"tags":{},"startTime":1770443862842,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":389480,"timestamp":283367992199,"id":41,"parentId":21,"tags":{"page":"/api/providers/[modelProviderId]"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":374361,"timestamp":283368007613,"id":57,"parentId":33,"tags":{},"startTime":1770443862842,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":389860,"timestamp":283367992129,"id":33,"parentId":21,"tags":{"page":"/api/assistants/[assistantId]/mcp-servers"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":378199,"timestamp":283368007773,"id":60,"parentId":31,"tags":{},"startTime":1770443862842,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":394731,"timestamp":283367991266,"id":31,"parentId":21,"tags":{"page":"/api/assistants/[assistantId]/initial-messages"},"startTime":1770443862826,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":395806,"timestamp":283368007203,"id":55,"parentId":43,"tags":{},"startTime":1770443862842,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":410822,"timestamp":283367992215,"id":43,"parentId":21,"tags":{"page":"/api/tasks/[taskId]"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":402786,"timestamp":283368007634,"id":59,"parentId":45,"tags":{},"startTime":1770443862842,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":418245,"timestamp":283367992229,"id":45,"parentId":21,"tags":{"page":"/api/tasks"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":406065,"timestamp":283368014488,"id":66,"parentId":28,"tags":{},"startTime":1770443862849,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":429349,"timestamp":283367991231,"id":28,"parentId":21,"tags":{"page":"/api/api-keys"},"startTime":1770443862826,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":415408,"timestamp":283368014633,"id":67,"parentId":35,"tags":{},"startTime":1770443862849,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":438001,"timestamp":283367992157,"id":35,"parentId":21,"tags":{"page":"/api/assistants"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":422945,"timestamp":283368007600,"id":56,"parentId":30,"tags":{},"startTime":1770443862842,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":439341,"timestamp":283367991248,"id":30,"parentId":21,"tags":{"page":"/api/assistants/[assistantId]/functions"},"startTime":1770443862826,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":449052,"timestamp":283368014722,"id":68,"parentId":26,"tags":{},"startTime":1770443862849,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":472688,"timestamp":283367991121,"id":26,"parentId":21,"tags":{"page":"/_not-found"},"startTime":1770443862826,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":456099,"timestamp":283368016263,"id":70,"parentId":46,"tags":{},"startTime":1770443862851,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":480150,"timestamp":283367992241,"id":46,"parentId":21,"tags":{"page":"/api/threads/runs/submit-client-tool-outputs"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":466940,"timestamp":283368016310,"id":71,"parentId":47,"tags":{},"startTime":1770443862851,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":491030,"timestamp":283367992246,"id":47,"parentId":21,"tags":{"page":"/api/workspaces/[workspaceId]"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":471446,"timestamp":283368016361,"id":72,"parentId":48,"tags":{},"startTime":1770443862851,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":495586,"timestamp":283367992254,"id":48,"parentId":21,"tags":{"page":"/api/workspaces"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":476979,"timestamp":283368017489,"id":73,"parentId":49,"tags":{},"startTime":1770443862852,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":502258,"timestamp":283367992259,"id":49,"parentId":21,"tags":{"page":"/"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":704382,"timestamp":283368007826,"id":61,"parentId":37,"tags":{},"startTime":1770443862842,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":720062,"timestamp":283367992174,"id":37,"parentId":21,"tags":{"page":"/api/files"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":703938,"timestamp":283368013537,"id":63,"parentId":39,"tags":{},"startTime":1770443862848,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":725325,"timestamp":283367992185,"id":39,"parentId":21,"tags":{"page":"/api/providers/[modelProviderId]/assistants"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":712397,"timestamp":283368013552,"id":64,"parentId":36,"tags":{},"startTime":1770443862848,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":733837,"timestamp":283367992163,"id":36,"parentId":21,"tags":{"page":"/api/files/[fileId]/contents"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":736070,"timestamp":283368013558,"id":65,"parentId":40,"tags":{},"startTime":1770443862848,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":757466,"timestamp":283367992194,"id":40,"parentId":21,"tags":{"page":"/api/providers/[modelProviderId]/models"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":754268,"timestamp":283368012789,"id":62,"parentId":38,"tags":{},"startTime":1770443862847,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":774910,"timestamp":283367992180,"id":38,"parentId":21,"tags":{"page":"/api/messages"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"is-page-static","duration":759440,"timestamp":283368016182,"id":69,"parentId":44,"tags":{},"startTime":1770443862851,"traceId":"c3182a08fec5cea4"},{"name":"check-page","duration":783433,"timestamp":283367992223,"id":44,"parentId":21,"tags":{"page":"/api/tasks/callback"},"startTime":1770443862827,"traceId":"c3182a08fec5cea4"},{"name":"static-check","duration":811940,"timestamp":283367963747,"id":21,"parentId":1,"tags":{},"startTime":1770443862798,"traceId":"c3182a08fec5cea4"},{"name":"generate-required-server-files","duration":306,"timestamp":283368776281,"id":75,"parentId":1,"tags":{},"startTime":1770443863611,"traceId":"c3182a08fec5cea4"},{"name":"write-routes-manifest","duration":1830,"timestamp":283368794854,"id":77,"parentId":1,"tags":{},"startTime":1770443863629,"traceId":"c3182a08fec5cea4"},{"name":"load-dotenv","duration":29,"timestamp":283368814698,"id":80,"parentId":79,"tags":{},"startTime":1770443863649,"traceId":"c3182a08fec5cea4"},{"name":"run-export-path-map","duration":397,"timestamp":283368998906,"id":81,"parentId":79,"tags":{},"startTime":1770443863833,"traceId":"c3182a08fec5cea4"},{"name":"next-export","duration":1265647,"timestamp":283368813663,"id":79,"parentId":1,"tags":{},"startTime":1770443863648,"traceId":"c3182a08fec5cea4"},{"name":"move-exported-app-not-found-","duration":7669,"timestamp":283370080550,"id":82,"parentId":78,"tags":{},"startTime":1770443864915,"traceId":"c3182a08fec5cea4"},{"name":"move-exported-page","duration":44988,"timestamp":283370088331,"id":83,"parentId":78,"tags":{},"startTime":1770443864923,"traceId":"c3182a08fec5cea4"},{"name":"static-generation","duration":1665188,"timestamp":283368809472,"id":78,"parentId":1,"tags":{},"startTime":1770443863644,"traceId":"c3182a08fec5cea4"},{"name":"write-routes-manifest","duration":23736,"timestamp":283370474890,"id":84,"parentId":1,"tags":{},"startTime":1770443865309,"traceId":"c3182a08fec5cea4"},{"name":"node-file-trace-build","duration":3477888,"timestamp":283368780470,"id":76,"parentId":1,"tags":{"isTurbotrace":"false"},"startTime":1770443863615,"traceId":"c3182a08fec5cea4"},{"name":"apply-include-excludes","duration":229,"timestamp":283372258371,"id":85,"parentId":1,"tags":{},"startTime":1770443867093,"traceId":"c3182a08fec5cea4"},{"name":"print-tree-view","duration":2155,"timestamp":283372258888,"id":86,"parentId":1,"tags":{},"startTime":1770443867093,"traceId":"c3182a08fec5cea4"},{"name":"telemetry-flush","duration":27,"timestamp":283372261052,"id":87,"parentId":1,"tags":{},"startTime":1770443867096,"traceId":"c3182a08fec5cea4"},{"name":"next-build","duration":26758088,"timestamp":283345502994,"id":1,"tags":{"buildMode":"default","isTurboBuild":"true","version":"15.5.9","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1770443840337,"traceId":"c3182a08fec5cea4"}]
|
|
@@ -21,6 +21,8 @@ export declare const buildGET: ({ prisma }: {
|
|
|
21
21
|
instructions: string;
|
|
22
22
|
codeInterpreterEnabled: boolean;
|
|
23
23
|
fileSearchEnabled: boolean;
|
|
24
|
+
truncationType: import("@prisma/client").$Enums.TruncationType;
|
|
25
|
+
truncationLastMessagesCount: number | null;
|
|
24
26
|
createdAt: string;
|
|
25
27
|
updatedAt: string;
|
|
26
28
|
avatar: {
|
|
@@ -73,6 +75,8 @@ export declare const buildPATCH: ({ prisma }: {
|
|
|
73
75
|
instructions: string;
|
|
74
76
|
codeInterpreterEnabled: boolean;
|
|
75
77
|
fileSearchEnabled: boolean;
|
|
78
|
+
truncationType: import("@prisma/client").$Enums.TruncationType;
|
|
79
|
+
truncationLastMessagesCount: number | null;
|
|
76
80
|
createdAt: string;
|
|
77
81
|
updatedAt: string;
|
|
78
82
|
avatar: {
|
|
@@ -102,6 +106,8 @@ export declare const buildDELETE: ({ prisma }: {
|
|
|
102
106
|
instructions: string;
|
|
103
107
|
codeInterpreterEnabled: boolean;
|
|
104
108
|
fileSearchEnabled: boolean;
|
|
109
|
+
truncationType: import("@prisma/client").$Enums.TruncationType;
|
|
110
|
+
truncationLastMessagesCount: number | null;
|
|
105
111
|
createdAt: string;
|
|
106
112
|
updatedAt: string;
|
|
107
113
|
avatar: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildRoute.d.ts","sourceRoot":"","sources":["../../../../../src/app/api/assistants/[assistantId]/buildRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,
|
|
1
|
+
{"version":3,"file":"buildRoute.d.ts","sourceRoot":"","sources":["../../../../../src/app/api/assistants/[assistantId]/buildRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAA;AASvB,KAAK,UAAU,GAAG;IAChB,MAAM,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,MAAM,CAAA;KACpB,CAAC,CAAA;CACH,CAAA;AAED,eAAO,MAAM,QAAQ,GAClB,YAAY;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,MAC9B,SAAS,WAAW,EAAE,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2F7C,CAAA;AAEH,eAAO,MAAM,UAAU,GACpB,YAAY;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,MAC9B,SAAS,WAAW,EAAE,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4L7C,CAAA;AAEH,eAAO,MAAM,WAAW,GACrB,YAAY;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,MAC9B,UAAU,WAAW,EAAE,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuD9C,CAAA;AAEH,eAAO,MAAM,YAAY,8BAMtB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server';
|
|
2
|
-
import { StorageProviderType, ApiKeyType, ToolType, } from '@prisma/client';
|
|
2
|
+
import { StorageProviderType, TruncationType, ApiKeyType, ToolType, } from '@prisma/client';
|
|
3
3
|
import { cacheHeaders } from '../../../../lib/cache/cacheHeaders';
|
|
4
4
|
import { workspaceAccessWhere as getWorkspaceAccessWhere } from '../../../../lib/apiKeys/workspaceAccessWhere';
|
|
5
5
|
import { serializeAssistant } from '../../../../lib/assistants/serializeAssistant';
|
|
@@ -101,6 +101,8 @@ export const buildPATCH = ({ prisma }) => async (request, props) => {
|
|
|
101
101
|
instructions: z.string().optional(),
|
|
102
102
|
codeInterpreterEnabled: z.boolean().optional(),
|
|
103
103
|
fileSearchEnabled: z.boolean().optional(),
|
|
104
|
+
truncationType: z.nativeEnum(TruncationType).optional(),
|
|
105
|
+
truncationLastMessagesCount: z.number().int().nullable().optional(),
|
|
104
106
|
})
|
|
105
107
|
.superRefine((data, ctx) => {
|
|
106
108
|
if (!data.storageProviderType)
|
|
@@ -130,7 +132,7 @@ export const buildPATCH = ({ prisma }) => async (request, props) => {
|
|
|
130
132
|
error: 'Invalid body: ' + parseResult.error.message,
|
|
131
133
|
}, { status: 400 });
|
|
132
134
|
}
|
|
133
|
-
const { storageProviderType, storageProviderAssistantId, modelProviderId, model, name, description, instructions, codeInterpreterEnabled, fileSearchEnabled, } = parseResult.data;
|
|
135
|
+
const { storageProviderType, storageProviderAssistantId, modelProviderId, model, name, description, instructions, codeInterpreterEnabled, fileSearchEnabled, truncationType, truncationLastMessagesCount, } = parseResult.data;
|
|
134
136
|
// Fetch existing assistant to determine storage provider type if not provided in update
|
|
135
137
|
const existingAssistant = await prisma.assistant.findUnique({
|
|
136
138
|
where: {
|
|
@@ -145,7 +147,7 @@ export const buildPATCH = ({ prisma }) => async (request, props) => {
|
|
|
145
147
|
return NextResponse.json({ error: 'No assistant found' }, { status: 400 });
|
|
146
148
|
}
|
|
147
149
|
const effectiveStorageProviderType = storageProviderType !== null && storageProviderType !== void 0 ? storageProviderType : existingAssistant.storageProviderType;
|
|
148
|
-
const data = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (storageProviderType !== undefined && { storageProviderType })), (storageProviderAssistantId !== undefined &&
|
|
150
|
+
const data = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (storageProviderType !== undefined && { storageProviderType })), (storageProviderAssistantId !== undefined &&
|
|
149
151
|
(effectiveStorageProviderType === StorageProviderType.AZURE_AGENTS
|
|
150
152
|
? {
|
|
151
153
|
azureAgentsAgentId: storageProviderAssistantId,
|
|
@@ -164,7 +166,7 @@ export const buildPATCH = ({ prisma }) => async (request, props) => {
|
|
|
164
166
|
azureResponsesAgentName: null,
|
|
165
167
|
}))), (modelProviderId !== undefined && {
|
|
166
168
|
modelProvider: { connect: { id: modelProviderId } },
|
|
167
|
-
})), (model !== undefined && { modelSlug: model })), (name !== undefined && { name })), (description !== undefined && { description })), (instructions !== undefined && { instructions })), { tools: {
|
|
169
|
+
})), (model !== undefined && { modelSlug: model })), (name !== undefined && { name })), (description !== undefined && { description })), (instructions !== undefined && { instructions })), (truncationType !== undefined && { truncationType })), (truncationLastMessagesCount !== undefined && { truncationLastMessagesCount })), { tools: {
|
|
168
170
|
create: [
|
|
169
171
|
...(codeInterpreterEnabled === true
|
|
170
172
|
? [
|
|
@@ -16,6 +16,8 @@ export declare const GET: (request: import("next/server").NextRequest, props: {
|
|
|
16
16
|
instructions: string;
|
|
17
17
|
codeInterpreterEnabled: boolean;
|
|
18
18
|
fileSearchEnabled: boolean;
|
|
19
|
+
truncationType: import("@prisma/client").$Enums.TruncationType;
|
|
20
|
+
truncationLastMessagesCount: number | null;
|
|
19
21
|
createdAt: string;
|
|
20
22
|
updatedAt: string;
|
|
21
23
|
avatar: {
|
|
@@ -70,6 +72,8 @@ export declare const PATCH: (request: import("next/server").NextRequest, props:
|
|
|
70
72
|
instructions: string;
|
|
71
73
|
codeInterpreterEnabled: boolean;
|
|
72
74
|
fileSearchEnabled: boolean;
|
|
75
|
+
truncationType: import("@prisma/client").$Enums.TruncationType;
|
|
76
|
+
truncationLastMessagesCount: number | null;
|
|
73
77
|
createdAt: string;
|
|
74
78
|
updatedAt: string;
|
|
75
79
|
avatar: {
|
|
@@ -101,6 +105,8 @@ export declare const DELETE: (_request: import("next/server").NextRequest, props
|
|
|
101
105
|
instructions: string;
|
|
102
106
|
codeInterpreterEnabled: boolean;
|
|
103
107
|
fileSearchEnabled: boolean;
|
|
108
|
+
truncationType: import("@prisma/client").$Enums.TruncationType;
|
|
109
|
+
truncationLastMessagesCount: number | null;
|
|
104
110
|
createdAt: string;
|
|
105
111
|
updatedAt: string;
|
|
106
112
|
avatar: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/app/api/assistants/[assistantId]/route.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/app/api/assistants/[assistantId]/route.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAuB,CAAA;AAEvC,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAyB,CAAA;AAE3C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA0B,CAAA;AAE7C,eAAO,MAAM,OAAO,8CAAiB,CAAA"}
|