@superinterface/server 1.0.22 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/eslint/.cache_btwyo7 +1 -1
  5. package/.next/fallback-build-manifest.json +2 -2
  6. package/.next/server/app/_not-found.html +1 -1
  7. package/.next/server/app/_not-found.rsc +1 -1
  8. package/.next/server/app/api/files/[fileId]/contents/route.js +3 -3
  9. package/.next/server/app/api/files/[fileId]/contents/route.js.nft.json +1 -1
  10. package/.next/server/app/api/files/route.js +3 -3
  11. package/.next/server/app/api/files/route.js.nft.json +1 -1
  12. package/.next/server/app/api/messages/route.js +6 -6
  13. package/.next/server/app/api/messages/route.js.nft.json +1 -1
  14. package/.next/server/app/api/tasks/callback/route.js +6 -7
  15. package/.next/server/app/api/tasks/callback/route.js.nft.json +1 -1
  16. package/.next/server/app/api/threads/runs/submit-client-tool-outputs/route.js +1 -1
  17. package/.next/server/app/api/threads/runs/submit-client-tool-outputs/route.js.nft.json +1 -1
  18. package/.next/server/app/index.html +1 -1
  19. package/.next/server/app/index.rsc +1 -1
  20. package/.next/server/chunks/[root-of-the-server]__0c1bc5ed._.js +1 -1
  21. package/.next/server/chunks/[root-of-the-server]__0c1bc5ed._.js.map +1 -1
  22. package/.next/server/chunks/[root-of-the-server]__228bff78._.js +2 -2
  23. package/.next/server/chunks/[root-of-the-server]__228bff78._.js.map +1 -1
  24. package/.next/server/chunks/[root-of-the-server]__25ee13bc._.js +1 -1
  25. package/.next/server/chunks/[root-of-the-server]__25ee13bc._.js.map +1 -1
  26. package/.next/server/chunks/[root-of-the-server]__2945c9e9._.js +1 -1
  27. package/.next/server/chunks/[root-of-the-server]__2945c9e9._.js.map +1 -1
  28. package/.next/server/chunks/[root-of-the-server]__29635e8e._.js +1 -1
  29. package/.next/server/chunks/[root-of-the-server]__29635e8e._.js.map +1 -1
  30. package/.next/server/chunks/[root-of-the-server]__29b43490._.js +1 -1
  31. package/.next/server/chunks/[root-of-the-server]__29b43490._.js.map +1 -1
  32. package/.next/server/chunks/[root-of-the-server]__315f084a._.js +1 -1
  33. package/.next/server/chunks/[root-of-the-server]__315f084a._.js.map +1 -1
  34. package/.next/server/chunks/[root-of-the-server]__3307123c._.js +2 -2
  35. package/.next/server/chunks/[root-of-the-server]__3307123c._.js.map +1 -1
  36. package/.next/server/chunks/[root-of-the-server]__40ab45eb._.js +3 -0
  37. package/.next/server/chunks/[root-of-the-server]__40ab45eb._.js.map +1 -0
  38. package/.next/server/chunks/[root-of-the-server]__441cee00._.js +1 -1
  39. package/.next/server/chunks/[root-of-the-server]__441cee00._.js.map +1 -1
  40. package/.next/server/chunks/[root-of-the-server]__464a4377._.js +1 -1
  41. package/.next/server/chunks/[root-of-the-server]__464a4377._.js.map +1 -1
  42. package/.next/server/chunks/[root-of-the-server]__4e536bc0._.js +1 -1
  43. package/.next/server/chunks/[root-of-the-server]__4e536bc0._.js.map +1 -1
  44. package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js +2 -2
  45. package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js.map +1 -1
  46. package/.next/server/chunks/[root-of-the-server]__583a7f1c._.js +1 -1
  47. package/.next/server/chunks/[root-of-the-server]__583a7f1c._.js.map +1 -1
  48. package/.next/server/chunks/[root-of-the-server]__5abf1160._.js +1 -1
  49. package/.next/server/chunks/[root-of-the-server]__5abf1160._.js.map +1 -1
  50. package/.next/server/chunks/[root-of-the-server]__5d09614a._.js +1 -1
  51. package/.next/server/chunks/[root-of-the-server]__5d09614a._.js.map +1 -1
  52. package/.next/server/chunks/[root-of-the-server]__62d958e7._.js +1 -1
  53. package/.next/server/chunks/[root-of-the-server]__62d958e7._.js.map +1 -1
  54. package/.next/server/chunks/[root-of-the-server]__676affb1._.js +3 -0
  55. package/.next/server/chunks/[root-of-the-server]__676affb1._.js.map +1 -0
  56. package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js +2 -2
  57. package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js.map +1 -1
  58. package/.next/server/chunks/[root-of-the-server]__72b72b9e._.js +3 -0
  59. package/.next/server/chunks/[root-of-the-server]__72b72b9e._.js.map +1 -0
  60. package/.next/server/chunks/[root-of-the-server]__83461316._.js +1 -1
  61. package/.next/server/chunks/[root-of-the-server]__83461316._.js.map +1 -1
  62. package/.next/server/chunks/[root-of-the-server]__9a611d42._.js +1 -1
  63. package/.next/server/chunks/[root-of-the-server]__9a611d42._.js.map +1 -1
  64. package/.next/server/chunks/[root-of-the-server]__a878c913._.js +3 -0
  65. package/.next/server/chunks/[root-of-the-server]__a878c913._.js.map +1 -0
  66. package/.next/server/chunks/[root-of-the-server]__b10ec83e._.js +1 -1
  67. package/.next/server/chunks/[root-of-the-server]__b10ec83e._.js.map +1 -1
  68. package/.next/server/chunks/[root-of-the-server]__c1629392._.js +1 -1
  69. package/.next/server/chunks/[root-of-the-server]__c1629392._.js.map +1 -1
  70. package/.next/server/chunks/[root-of-the-server]__dd176cb5._.js +1 -1
  71. package/.next/server/chunks/[root-of-the-server]__dd176cb5._.js.map +1 -1
  72. package/.next/server/chunks/[root-of-the-server]__e7819e95._.js +2 -2
  73. package/.next/server/chunks/[root-of-the-server]__e7819e95._.js.map +1 -1
  74. package/.next/server/chunks/[root-of-the-server]__eb816e13._.js +1 -1
  75. package/.next/server/chunks/[root-of-the-server]__eb816e13._.js.map +1 -1
  76. package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js +2 -2
  77. package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js.map +1 -1
  78. package/.next/server/chunks/[root-of-the-server]__f845ef25._.js +3 -0
  79. package/.next/server/chunks/[root-of-the-server]__f845ef25._.js.map +1 -0
  80. package/.next/server/chunks/[root-of-the-server]__ff90af03._.js +2 -2
  81. package/.next/server/chunks/[root-of-the-server]__ff90af03._.js.map +1 -1
  82. package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_cb746cf4.js +1 -1
  83. package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_cb746cf4.js.map +1 -1
  84. package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_f952d9ab.js +1 -1
  85. package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_f952d9ab.js.map +1 -1
  86. package/.next/server/chunks/supercorp_superinterface_bebd2c96._.js +3 -3
  87. package/.next/server/chunks/supercorp_superinterface_bebd2c96._.js.map +1 -1
  88. package/.next/server/functions-config-manifest.json +2 -2
  89. package/.next/server/pages/404.html +1 -1
  90. package/.next/server/pages/500.html +1 -1
  91. package/.next/trace +1 -1
  92. package/dist/app/api/api-keys/[apiKeyId]/route.d.ts +6 -51
  93. package/dist/app/api/api-keys/[apiKeyId]/route.d.ts.map +1 -1
  94. package/dist/app/api/api-keys/[apiKeyId]/route.js +10 -7
  95. package/dist/app/api/api-keys/route.d.ts +4 -26
  96. package/dist/app/api/api-keys/route.d.ts.map +1 -1
  97. package/dist/app/api/api-keys/route.js +7 -5
  98. package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.d.ts +6 -168
  99. package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.d.ts.map +1 -1
  100. package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.js +10 -7
  101. package/dist/app/api/assistants/[assistantId]/functions/route.d.ts +4 -110
  102. package/dist/app/api/assistants/[assistantId]/functions/route.d.ts.map +1 -1
  103. package/dist/app/api/assistants/[assistantId]/functions/route.js +7 -5
  104. package/dist/app/api/assistants/[assistantId]/initial-messages/route.d.ts +4 -36
  105. package/dist/app/api/assistants/[assistantId]/initial-messages/route.d.ts.map +1 -1
  106. package/dist/app/api/assistants/[assistantId]/initial-messages/route.js +7 -5
  107. package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.d.ts +6 -90
  108. package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.d.ts.map +1 -1
  109. package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.js +10 -7
  110. package/dist/app/api/assistants/[assistantId]/mcp-servers/route.d.ts +4 -58
  111. package/dist/app/api/assistants/[assistantId]/mcp-servers/route.d.ts.map +1 -1
  112. package/dist/app/api/assistants/[assistantId]/mcp-servers/route.js +7 -5
  113. package/dist/app/api/assistants/[assistantId]/route.d.ts +6 -119
  114. package/dist/app/api/assistants/[assistantId]/route.d.ts.map +1 -1
  115. package/dist/app/api/assistants/[assistantId]/route.js +10 -7
  116. package/dist/app/api/assistants/route.d.ts +4 -56
  117. package/dist/app/api/assistants/route.d.ts.map +1 -1
  118. package/dist/app/api/assistants/route.js +7 -5
  119. package/dist/app/api/files/[fileId]/contents/route.d.ts +2 -6
  120. package/dist/app/api/files/[fileId]/contents/route.d.ts.map +1 -1
  121. package/dist/app/api/files/[fileId]/contents/route.js +4 -3
  122. package/dist/app/api/files/route.d.ts +2 -8
  123. package/dist/app/api/files/route.d.ts.map +1 -1
  124. package/dist/app/api/files/route.js +4 -3
  125. package/dist/app/api/messages/lib/initialMessagesResponse.d.ts.map +1 -1
  126. package/dist/app/api/messages/lib/initialMessagesResponse.js +2 -3
  127. package/dist/app/api/messages/route.d.ts +4 -22
  128. package/dist/app/api/messages/route.d.ts.map +1 -1
  129. package/dist/app/api/messages/route.js +7 -5
  130. package/dist/app/api/providers/[modelProviderId]/assistants/route.d.ts +2 -17
  131. package/dist/app/api/providers/[modelProviderId]/assistants/route.d.ts.map +1 -1
  132. package/dist/app/api/providers/[modelProviderId]/assistants/route.js +4 -3
  133. package/dist/app/api/providers/[modelProviderId]/models/route.d.ts +2 -12
  134. package/dist/app/api/providers/[modelProviderId]/models/route.d.ts.map +1 -1
  135. package/dist/app/api/providers/[modelProviderId]/models/route.js +4 -3
  136. package/dist/app/api/providers/[modelProviderId]/route.d.ts +6 -60
  137. package/dist/app/api/providers/[modelProviderId]/route.d.ts.map +1 -1
  138. package/dist/app/api/providers/[modelProviderId]/route.js +10 -7
  139. package/dist/app/api/providers/route.d.ts +4 -32
  140. package/dist/app/api/providers/route.d.ts.map +1 -1
  141. package/dist/app/api/providers/route.js +7 -5
  142. package/dist/app/api/tasks/[taskId]/route.d.ts +6 -57
  143. package/dist/app/api/tasks/[taskId]/route.d.ts.map +1 -1
  144. package/dist/app/api/tasks/[taskId]/route.js +10 -7
  145. package/dist/app/api/tasks/callback/route.d.ts.map +1 -1
  146. package/dist/app/api/tasks/callback/route.js +5 -5
  147. package/dist/app/api/tasks/route.d.ts +4 -30
  148. package/dist/app/api/tasks/route.d.ts.map +1 -1
  149. package/dist/app/api/tasks/route.js +7 -5
  150. package/dist/app/api/threads/runs/submit-client-tool-outputs/route.d.ts +2 -6
  151. package/dist/app/api/threads/runs/submit-client-tool-outputs/route.d.ts.map +1 -1
  152. package/dist/app/api/threads/runs/submit-client-tool-outputs/route.js +6 -6
  153. package/dist/app/api/workspaces/[workspaceId]/route.d.ts +4 -30
  154. package/dist/app/api/workspaces/[workspaceId]/route.d.ts.map +1 -1
  155. package/dist/app/api/workspaces/[workspaceId]/route.js +7 -5
  156. package/dist/app/api/workspaces/route.d.ts +4 -22
  157. package/dist/app/api/workspaces/route.d.ts.map +1 -1
  158. package/dist/app/api/workspaces/route.js +7 -5
  159. package/dist/lib/functions/handleFunction/handleAssistant.d.ts.map +1 -1
  160. package/dist/lib/functions/handleFunction/handleAssistant.js +2 -3
  161. package/dist/lib/mcpServers/getToolCallMcpServer.d.ts.map +1 -1
  162. package/dist/lib/mcpServers/getToolCallMcpServer.js +5 -6
  163. package/dist/lib/prisma/index.d.ts +1 -0
  164. package/dist/lib/prisma/index.d.ts.map +1 -1
  165. package/dist/lib/prisma/index.js +12 -0
  166. package/dist/lib/tools/tools/index.d.ts.map +1 -1
  167. package/dist/lib/tools/tools/index.js +2 -3
  168. package/package.json +2 -3
  169. package/.next/server/chunks/[root-of-the-server]__19865527._.js +0 -3
  170. package/.next/server/chunks/[root-of-the-server]__19865527._.js.map +0 -1
  171. package/.next/server/chunks/[root-of-the-server]__27aadac9._.js +0 -3
  172. package/.next/server/chunks/[root-of-the-server]__27aadac9._.js.map +0 -1
  173. package/.next/server/chunks/[root-of-the-server]__3ba06f7c._.js +0 -3
  174. package/.next/server/chunks/[root-of-the-server]__3ba06f7c._.js.map +0 -1
  175. package/.next/server/chunks/[root-of-the-server]__51977f30._.js +0 -3
  176. package/.next/server/chunks/[root-of-the-server]__51977f30._.js.map +0 -1
  177. package/.next/server/chunks/[root-of-the-server]__7f9ca1e3._.js +0 -3
  178. package/.next/server/chunks/[root-of-the-server]__7f9ca1e3._.js.map +0 -1
  179. package/.next/server/chunks/[root-of-the-server]__a135e388._.js +0 -3
  180. package/.next/server/chunks/[root-of-the-server]__a135e388._.js.map +0 -1
  181. package/dist/app/messages/lib/getWorkspaceId.d.ts +0 -6
  182. package/dist/app/messages/lib/getWorkspaceId.d.ts.map +0 -1
  183. package/dist/app/messages/lib/getWorkspaceId.js +0 -3
  184. package/dist/app/messages/lib/initialMessagesResponse.d.ts +0 -26
  185. package/dist/app/messages/lib/initialMessagesResponse.d.ts.map +0 -1
  186. package/dist/app/messages/lib/initialMessagesResponse.js +0 -59
  187. package/dist/app/messages/lib/serializeThread.d.ts +0 -18
  188. package/dist/app/messages/lib/serializeThread.d.ts.map +0 -1
  189. package/dist/app/messages/lib/serializeThread.js +0 -8
  190. package/dist/app/messages/route.d.ts +0 -31
  191. package/dist/app/messages/route.d.ts.map +0 -1
  192. package/dist/app/messages/route.js +0 -585
  193. package/dist/lib/prismaClient.d.ts +0 -5
  194. package/dist/lib/prismaClient.d.ts.map +0 -1
  195. package/dist/lib/prismaClient.js +0 -4
  196. /package/.next/static/{ImVeJObVDbb-MHLkfrFb1 → X1k4ISA6YteJsnJalPLxm}/_buildManifest.js +0 -0
  197. /package/.next/static/{ImVeJObVDbb-MHLkfrFb1 → X1k4ISA6YteJsnJalPLxm}/_clientMiddlewareManifest.json +0 -0
  198. /package/.next/static/{ImVeJObVDbb-MHLkfrFb1 → X1k4ISA6YteJsnJalPLxm}/_ssgManifest.js +0 -0
@@ -2,13 +2,14 @@ import { headers } from 'next/headers';
2
2
  import { ApiKeyType } from '@prisma/client';
3
3
  import { NextResponse } from 'next/server';
4
4
  import { cacheHeaders } from '../../../../../../lib/cache/cacheHeaders';
5
- import { prisma as defaultPrisma } from '../../../../../../lib/prisma';
5
+ import { resolvePrisma } from '../../../../../../lib/prisma';
6
6
  import { getApiKey } from '../../../../../../lib/apiKeys/getApiKey';
7
7
  import { validate } from 'uuid';
8
8
  import { serializeApiFunction } from '../../../../../../lib/functions/serializeApiFunction';
9
9
  import { functionSchema } from '../../../../../../lib/functions/functionSchema';
10
10
  import { updateFunction } from '../../../../../../lib/functions/updateFunction';
11
- export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, props) => {
11
+ export const buildGET = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
12
+ const prisma = resolvePrisma(providedPrisma);
12
13
  const { assistantId, functionId } = await props.params;
13
14
  const headersList = await headers();
14
15
  const authorization = headersList.get('authorization');
@@ -60,8 +61,9 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, pr
60
61
  function: serializeApiFunction({ fn }),
61
62
  }, { headers: cacheHeaders });
62
63
  };
63
- export const GET = buildGET();
64
- export const buildPATCH = ({ prisma = defaultPrisma } = {}) => async (request, props) => {
64
+ export const GET = ((...args) => buildGET()(...args));
65
+ export const buildPATCH = ({ prisma: providedPrisma } = {}) => async (request, props) => {
66
+ const prisma = resolvePrisma(providedPrisma);
65
67
  const { assistantId, functionId } = await props.params;
66
68
  const headersList = await headers();
67
69
  const authorization = headersList.get('authorization');
@@ -126,8 +128,9 @@ export const buildPATCH = ({ prisma = defaultPrisma } = {}) => async (request, p
126
128
  function: serializeApiFunction({ fn: updatedFunction }),
127
129
  }, { headers: cacheHeaders });
128
130
  };
129
- export const PATCH = buildPATCH();
130
- export const buildDELETE = ({ prisma = defaultPrisma } = {}) => async (_request, props) => {
131
+ export const PATCH = ((...args) => buildPATCH()(...args));
132
+ export const buildDELETE = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
133
+ const prisma = resolvePrisma(providedPrisma);
131
134
  const { assistantId, functionId } = await props.params;
132
135
  const headersList = await headers();
133
136
  const authorization = headersList.get('authorization');
@@ -182,7 +185,7 @@ export const buildDELETE = ({ prisma = defaultPrisma } = {}) => async (_request,
182
185
  mcpServer: serializeApiFunction({ fn: deletedFunction }),
183
186
  }, { headers: cacheHeaders });
184
187
  };
185
- export const DELETE = buildDELETE();
188
+ export const DELETE = ((...args) => buildDELETE()(...args));
186
189
  export const OPTIONS = () => NextResponse.json({}, {
187
190
  headers: cacheHeaders,
188
191
  });
@@ -1,6 +1,6 @@
1
1
  import { type NextRequest, NextResponse } from 'next/server';
2
2
  import { type PrismaClient } from '@prisma/client';
3
- export declare const buildGET: ({ prisma }?: {
3
+ export declare const buildGET: ({ prisma: providedPrisma }?: {
4
4
  prisma?: PrismaClient;
5
5
  }) => (_request: NextRequest, props: {
6
6
  params: Promise<{
@@ -56,61 +56,8 @@ export declare const buildGET: ({ prisma }?: {
56
56
  updatedAt: string;
57
57
  }[];
58
58
  }>>;
59
- export declare const GET: (_request: NextRequest, props: {
60
- params: Promise<{
61
- assistantId: string;
62
- }>;
63
- }) => Promise<NextResponse<{
64
- error: string;
65
- }> | NextResponse<{
66
- functions: {
67
- id: string;
68
- openapiSpec: PrismaJson.OpenapiSpec;
69
- handler: {
70
- deleteTaskHandler?: {
71
- keyTemplate: string;
72
- } | undefined;
73
- updateTaskHandler?: {
74
- keyTemplate: string;
75
- } | undefined;
76
- createTaskHandler?: {
77
- keyTemplate: string;
78
- } | undefined;
79
- listTasksHandler?: {
80
- keyTemplate: string;
81
- } | undefined;
82
- assistantHandler?: {
83
- assistantId: string;
84
- } | undefined;
85
- clientToolHandler?: {
86
- type: "FUNCTION";
87
- name: string;
88
- arguments: PrismaJson.ClientToolHandlerArguments;
89
- } | undefined;
90
- replicateHandler?: {
91
- type: "RUN";
92
- apiKey: string;
93
- identifier: string;
94
- body: PrismaJson.ReplicateHandlerBody;
95
- } | undefined;
96
- firecrawlHandler?: {
97
- type: import("@prisma/client").$Enums.FirecrawlHandlerType;
98
- apiKey: string;
99
- body: PrismaJson.FirecrawlHandlerBody;
100
- } | undefined;
101
- requestHandler?: {
102
- url: string;
103
- method: import("@prisma/client").$Enums.MethodType;
104
- headers: PrismaJson.RequestHandlerHeaders;
105
- body: PrismaJson.RequestHandlerBody;
106
- } | undefined;
107
- type: import("@prisma/client").$Enums.HandlerType;
108
- };
109
- createdAt: string;
110
- updatedAt: string;
111
- }[];
112
- }>>;
113
- export declare const buildPOST: ({ prisma }?: {
59
+ export declare const GET: ReturnType<typeof buildGET>;
60
+ export declare const buildPOST: ({ prisma: providedPrisma }?: {
114
61
  prisma?: PrismaClient;
115
62
  }) => (request: NextRequest, props: {
116
63
  params: Promise<{
@@ -166,59 +113,6 @@ export declare const buildPOST: ({ prisma }?: {
166
113
  updatedAt: string;
167
114
  };
168
115
  }>>;
169
- export declare const POST: (request: NextRequest, props: {
170
- params: Promise<{
171
- assistantId: string;
172
- }>;
173
- }) => Promise<NextResponse<{
174
- error: string;
175
- }> | NextResponse<{
176
- function: {
177
- id: string;
178
- openapiSpec: PrismaJson.OpenapiSpec;
179
- handler: {
180
- deleteTaskHandler?: {
181
- keyTemplate: string;
182
- } | undefined;
183
- updateTaskHandler?: {
184
- keyTemplate: string;
185
- } | undefined;
186
- createTaskHandler?: {
187
- keyTemplate: string;
188
- } | undefined;
189
- listTasksHandler?: {
190
- keyTemplate: string;
191
- } | undefined;
192
- assistantHandler?: {
193
- assistantId: string;
194
- } | undefined;
195
- clientToolHandler?: {
196
- type: "FUNCTION";
197
- name: string;
198
- arguments: PrismaJson.ClientToolHandlerArguments;
199
- } | undefined;
200
- replicateHandler?: {
201
- type: "RUN";
202
- apiKey: string;
203
- identifier: string;
204
- body: PrismaJson.ReplicateHandlerBody;
205
- } | undefined;
206
- firecrawlHandler?: {
207
- type: import("@prisma/client").$Enums.FirecrawlHandlerType;
208
- apiKey: string;
209
- body: PrismaJson.FirecrawlHandlerBody;
210
- } | undefined;
211
- requestHandler?: {
212
- url: string;
213
- method: import("@prisma/client").$Enums.MethodType;
214
- headers: PrismaJson.RequestHandlerHeaders;
215
- body: PrismaJson.RequestHandlerBody;
216
- } | undefined;
217
- type: import("@prisma/client").$Enums.HandlerType;
218
- };
219
- createdAt: string;
220
- updatedAt: string;
221
- };
222
- }>>;
116
+ export declare const POST: ReturnType<typeof buildPOST>;
223
117
  export declare const OPTIONS: () => NextResponse<{}>;
224
118
  //# sourceMappingURL=route.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/functions/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAS9D,eAAO,MAAM,QAAQ,GAClB,aAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEF,CAAA;AAEH,eAAO,MAAM,GAAG,aAvEF,WAAW,SACd;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEwB,CAAA;AAE7B,eAAO,MAAM,SAAS,GACnB,aAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEF,CAAA;AAEH,eAAO,MAAM,IAAI,YA1EJ,WAAW,SACb;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuE0B,CAAA;AAE/B,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/functions/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAS9D,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEF,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,SAAS,GACnB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEF,CAAA;AAEH,eAAO,MAAM,IAAI,EACU,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvD,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
@@ -2,12 +2,13 @@ import { NextResponse } from 'next/server';
2
2
  import { ApiKeyType } from '@prisma/client';
3
3
  import { headers } from 'next/headers';
4
4
  import { cacheHeaders } from '../../../../../lib/cache/cacheHeaders';
5
- import { prisma as defaultPrisma } from '../../../../../lib/prisma';
5
+ import { resolvePrisma } from '../../../../../lib/prisma';
6
6
  import { getApiKey } from '../../../../../lib/apiKeys/getApiKey';
7
7
  import { serializeApiFunction } from '../../../../../lib/functions/serializeApiFunction';
8
8
  import { functionSchema } from '../../../../../lib/functions/functionSchema';
9
9
  import { createFunction } from '../../../../../lib/functions/createFunction';
10
- export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, props) => {
10
+ export const buildGET = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
11
+ const prisma = resolvePrisma(providedPrisma);
11
12
  const { assistantId } = await props.params;
12
13
  const headersList = await headers();
13
14
  const authorization = headersList.get('authorization');
@@ -59,8 +60,9 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, pr
59
60
  })),
60
61
  }, { headers: cacheHeaders });
61
62
  };
62
- export const GET = buildGET();
63
- export const buildPOST = ({ prisma = defaultPrisma } = {}) => async (request, props) => {
63
+ export const GET = ((...args) => buildGET()(...args));
64
+ export const buildPOST = ({ prisma: providedPrisma } = {}) => async (request, props) => {
65
+ const prisma = resolvePrisma(providedPrisma);
64
66
  const { assistantId } = await props.params;
65
67
  const headersList = await headers();
66
68
  const authorization = headersList.get('authorization');
@@ -114,7 +116,7 @@ export const buildPOST = ({ prisma = defaultPrisma } = {}) => async (request, pr
114
116
  function: serializeApiFunction({ fn }),
115
117
  }, { headers: cacheHeaders });
116
118
  };
117
- export const POST = buildPOST();
119
+ export const POST = ((...args) => buildPOST()(...args));
118
120
  export const OPTIONS = () => NextResponse.json({}, {
119
121
  headers: cacheHeaders,
120
122
  });
@@ -1,6 +1,6 @@
1
1
  import { type NextRequest, NextResponse } from 'next/server';
2
2
  import { type PrismaClient } from '@prisma/client';
3
- export declare const buildGET: ({ prisma }?: {
3
+ export declare const buildGET: ({ prisma: providedPrisma }?: {
4
4
  prisma?: PrismaClient;
5
5
  }) => (_request: NextRequest, props: {
6
6
  params: Promise<{
@@ -19,24 +19,8 @@ export declare const buildGET: ({ prisma }?: {
19
19
  updatedAt: string;
20
20
  }[];
21
21
  }>>;
22
- export declare const GET: (_request: NextRequest, props: {
23
- params: Promise<{
24
- assistantId: string;
25
- }>;
26
- }) => Promise<NextResponse<{
27
- error: string;
28
- }> | NextResponse<{
29
- initialMessages: {
30
- id: string;
31
- role: import("@prisma/client").$Enums.MessageRole;
32
- content: string;
33
- orderNumber: number;
34
- assistantId: string | null;
35
- createdAt: string;
36
- updatedAt: string;
37
- }[];
38
- }>>;
39
- export declare const buildPUT: ({ prisma }?: {
22
+ export declare const GET: ReturnType<typeof buildGET>;
23
+ export declare const buildPUT: ({ prisma: providedPrisma }?: {
40
24
  prisma?: PrismaClient;
41
25
  }) => (request: NextRequest, props: {
42
26
  params: Promise<{
@@ -55,22 +39,6 @@ export declare const buildPUT: ({ prisma }?: {
55
39
  updatedAt: string;
56
40
  }[];
57
41
  }>>;
58
- export declare const PUT: (request: NextRequest, props: {
59
- params: Promise<{
60
- assistantId: string;
61
- }>;
62
- }) => Promise<NextResponse<{
63
- error: string;
64
- }> | NextResponse<{
65
- initialMessages: {
66
- id: string;
67
- role: import("@prisma/client").$Enums.MessageRole;
68
- content: string;
69
- orderNumber: number;
70
- assistantId: string | null;
71
- createdAt: string;
72
- updatedAt: string;
73
- }[];
74
- }>>;
42
+ export declare const PUT: ReturnType<typeof buildPUT>;
75
43
  export declare const OPTIONS: () => NextResponse<{}>;
76
44
  //# sourceMappingURL=route.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/initial-messages/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAS9E,eAAO,MAAM,QAAQ,GAClB,aAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;GAiDF,CAAA;AAEH,eAAO,MAAM,GAAG,aAtDF,WAAW,SACd;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;GAmDwB,CAAA;AAE7B,eAAO,MAAM,QAAQ,GAClB,aAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;GAwDF,CAAA;AAEH,eAAO,MAAM,GAAG,YA7DH,WAAW,SACb;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;GA0DwB,CAAA;AAE7B,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/initial-messages/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAS9E,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;GAkDF,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;GAyDF,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
@@ -2,12 +2,13 @@ import { NextResponse } from 'next/server';
2
2
  import { ApiKeyType } from '@prisma/client';
3
3
  import { headers } from 'next/headers';
4
4
  import { cacheHeaders } from '../../../../../lib/cache/cacheHeaders';
5
- import { prisma as defaultPrisma } from '../../../../../lib/prisma';
5
+ import { resolvePrisma } from '../../../../../lib/prisma';
6
6
  import { serializeApiInitialMessage } from '../../../../../lib/initialMessages/serializeApiInitialMessage';
7
7
  import { initialMessagesSchema } from '../../../../../lib/initialMessages/schema';
8
8
  import { updateInitialMessages } from '../../../../../lib/initialMessages/updateInitialMessages';
9
9
  import { getApiKey } from '../../../../../lib/apiKeys/getApiKey';
10
- export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, props) => {
10
+ export const buildGET = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
11
+ const prisma = resolvePrisma(providedPrisma);
11
12
  const { assistantId } = await props.params;
12
13
  const headersList = await headers();
13
14
  const authorization = headersList.get('authorization');
@@ -42,8 +43,9 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, pr
42
43
  initialMessages: assistant.initialMessages.map((m) => serializeApiInitialMessage({ initialMessage: m })),
43
44
  }, { headers: cacheHeaders });
44
45
  };
45
- export const GET = buildGET();
46
- export const buildPUT = ({ prisma = defaultPrisma } = {}) => async (request, props) => {
46
+ export const GET = ((...args) => buildGET()(...args));
47
+ export const buildPUT = ({ prisma: providedPrisma } = {}) => async (request, props) => {
48
+ const prisma = resolvePrisma(providedPrisma);
47
49
  const { assistantId } = await props.params;
48
50
  const headersList = await headers();
49
51
  const authorization = headersList.get('authorization');
@@ -82,7 +84,7 @@ export const buildPUT = ({ prisma = defaultPrisma } = {}) => async (request, pro
82
84
  initialMessages: messages.map((m) => serializeApiInitialMessage({ initialMessage: m })),
83
85
  }, { headers: cacheHeaders });
84
86
  };
85
- export const PUT = buildPUT();
87
+ export const PUT = ((...args) => buildPUT()(...args));
86
88
  export const OPTIONS = () => NextResponse.json({}, {
87
89
  headers: cacheHeaders,
88
90
  });
@@ -1,6 +1,6 @@
1
1
  import { type PrismaClient } from '@prisma/client';
2
2
  import { NextResponse, type NextRequest } from 'next/server';
3
- export declare const buildGET: ({ prisma }?: {
3
+ export declare const buildGET: ({ prisma: providedPrisma }?: {
4
4
  prisma?: PrismaClient;
5
5
  }) => (_request: NextRequest, props: {
6
6
  params: Promise<{
@@ -31,36 +31,8 @@ export declare const buildGET: ({ prisma }?: {
31
31
  updatedAt: string;
32
32
  };
33
33
  }>>;
34
- export declare const GET: (_request: NextRequest, props: {
35
- params: Promise<{
36
- assistantId: string;
37
- mcpServerId: string;
38
- }>;
39
- }) => Promise<NextResponse<{
40
- error: string;
41
- }> | NextResponse<{
42
- mcpServer: {
43
- id: string;
44
- transportType: import("@prisma/client").$Enums.TransportType;
45
- sseTransport: {
46
- id: string;
47
- url: string;
48
- headers: PrismaJson.SseTransportHeaders;
49
- createdAt: string;
50
- updatedAt: string;
51
- } | null;
52
- httpTransport: {
53
- id: string;
54
- url: string;
55
- headers: PrismaJson.HttpTransportHeaders;
56
- createdAt: string;
57
- updatedAt: string;
58
- } | null;
59
- createdAt: string;
60
- updatedAt: string;
61
- };
62
- }>>;
63
- export declare const buildPATCH: ({ prisma }?: {
34
+ export declare const GET: ReturnType<typeof buildGET>;
35
+ export declare const buildPATCH: ({ prisma: providedPrisma }?: {
64
36
  prisma?: PrismaClient;
65
37
  }) => (request: NextRequest, props: {
66
38
  params: Promise<{
@@ -91,36 +63,8 @@ export declare const buildPATCH: ({ prisma }?: {
91
63
  updatedAt: string;
92
64
  };
93
65
  }>>;
94
- export declare const PATCH: (request: NextRequest, props: {
95
- params: Promise<{
96
- assistantId: string;
97
- mcpServerId: string;
98
- }>;
99
- }) => Promise<NextResponse<{
100
- error: string;
101
- }> | NextResponse<{
102
- mcpServer: {
103
- id: string;
104
- transportType: import("@prisma/client").$Enums.TransportType;
105
- sseTransport: {
106
- id: string;
107
- url: string;
108
- headers: PrismaJson.SseTransportHeaders;
109
- createdAt: string;
110
- updatedAt: string;
111
- } | null;
112
- httpTransport: {
113
- id: string;
114
- url: string;
115
- headers: PrismaJson.HttpTransportHeaders;
116
- createdAt: string;
117
- updatedAt: string;
118
- } | null;
119
- createdAt: string;
120
- updatedAt: string;
121
- };
122
- }>>;
123
- export declare const buildDELETE: ({ prisma }?: {
66
+ export declare const PATCH: ReturnType<typeof buildPATCH>;
67
+ export declare const buildDELETE: ({ prisma: providedPrisma }?: {
124
68
  prisma?: PrismaClient;
125
69
  }) => (_request: NextRequest, props: {
126
70
  params: Promise<{
@@ -151,34 +95,6 @@ export declare const buildDELETE: ({ prisma }?: {
151
95
  updatedAt: string;
152
96
  };
153
97
  }>>;
154
- export declare const DELETE: (_request: NextRequest, props: {
155
- params: Promise<{
156
- assistantId: string;
157
- mcpServerId: string;
158
- }>;
159
- }) => Promise<NextResponse<{
160
- error: string;
161
- }> | NextResponse<{
162
- mcpServer: {
163
- id: string;
164
- transportType: import("@prisma/client").$Enums.TransportType;
165
- sseTransport: {
166
- id: string;
167
- url: string;
168
- headers: PrismaJson.SseTransportHeaders;
169
- createdAt: string;
170
- updatedAt: string;
171
- } | null;
172
- httpTransport: {
173
- id: string;
174
- url: string;
175
- headers: PrismaJson.HttpTransportHeaders;
176
- createdAt: string;
177
- updatedAt: string;
178
- } | null;
179
- createdAt: string;
180
- updatedAt: string;
181
- };
182
- }>>;
98
+ export declare const DELETE: ReturnType<typeof buildDELETE>;
183
99
  export declare const OPTIONS: () => NextResponse<{}>;
184
100
  //# sourceMappingURL=route.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../src/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAQ5D,eAAO,MAAM,QAAQ,GAClB,aAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9D;;;;;;;;;;;;;;;;;;;;;;;GAgEF,CAAA;AAEH,eAAO,MAAM,GAAG,aArEF,WAAW,SACd;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9D;;;;;;;;;;;;;;;;;;;;;;;GAkEwB,CAAA;AAE7B,eAAO,MAAM,UAAU,GACpB,aAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9D;;;;;;;;;;;;;;;;;;;;;;;GAuGF,CAAA;AAEH,eAAO,MAAM,KAAK,YA5GL,WAAW,SACb;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9D;;;;;;;;;;;;;;;;;;;;;;;GAyG4B,CAAA;AAEjC,eAAO,MAAM,WAAW,GACrB,aAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9D;;;;;;;;;;;;;;;;;;;;;;;GAoEF,CAAA;AAEH,eAAO,MAAM,MAAM,aAzEL,WAAW,SACd;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9D;;;;;;;;;;;;;;;;;;;;;;;GAsE8B,CAAA;AAEnC,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../src/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAQ5D,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9D;;;;;;;;;;;;;;;;;;;;;;;GAiEF,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,UAAU,GACpB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9D;;;;;;;;;;;;;;;;;;;;;;;GAwGF,CAAA;AAEH,eAAO,MAAM,KAAK,EACU,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AAEzD,eAAO,MAAM,WAAW,GACrB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9D;;;;;;;;;;;;;;;;;;;;;;;GAqEF,CAAA;AAEH,eAAO,MAAM,MAAM,EACU,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;AAE3D,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
@@ -2,12 +2,13 @@ import { headers } from 'next/headers';
2
2
  import { ApiKeyType, TransportType } from '@prisma/client';
3
3
  import { NextResponse } from 'next/server';
4
4
  import { cacheHeaders } from '../../../../../../lib/cache/cacheHeaders';
5
- import { prisma as defaultPrisma } from '../../../../../../lib/prisma';
5
+ import { resolvePrisma } from '../../../../../../lib/prisma';
6
6
  import { getApiKey } from '../../../../../../lib/apiKeys/getApiKey';
7
7
  import { validate } from 'uuid';
8
8
  import { serializeApiMcpServer } from '../../../../../../lib/mcpServers/serializeApiMcpServer';
9
9
  import { mcpServerSchema } from '../../../../../../lib/mcpServers/mcpServerSchema';
10
- export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, props) => {
10
+ export const buildGET = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
11
+ const prisma = resolvePrisma(providedPrisma);
11
12
  const { assistantId, mcpServerId } = await props.params;
12
13
  const headersList = await headers();
13
14
  const authorization = headersList.get('authorization');
@@ -48,8 +49,9 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, pr
48
49
  mcpServer: serializeApiMcpServer({ mcpServer }),
49
50
  }, { headers: cacheHeaders });
50
51
  };
51
- export const GET = buildGET();
52
- export const buildPATCH = ({ prisma = defaultPrisma } = {}) => async (request, props) => {
52
+ export const GET = ((...args) => buildGET()(...args));
53
+ export const buildPATCH = ({ prisma: providedPrisma } = {}) => async (request, props) => {
54
+ const prisma = resolvePrisma(providedPrisma);
53
55
  const { assistantId, mcpServerId } = await props.params;
54
56
  const headersList = await headers();
55
57
  const authorization = headersList.get('authorization');
@@ -120,8 +122,9 @@ export const buildPATCH = ({ prisma = defaultPrisma } = {}) => async (request, p
120
122
  mcpServer: serializeApiMcpServer({ mcpServer: updatedMcpServer }),
121
123
  }, { headers: cacheHeaders });
122
124
  };
123
- export const PATCH = buildPATCH();
124
- export const buildDELETE = ({ prisma = defaultPrisma } = {}) => async (_request, props) => {
125
+ export const PATCH = ((...args) => buildPATCH()(...args));
126
+ export const buildDELETE = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
127
+ const prisma = resolvePrisma(providedPrisma);
125
128
  const { assistantId, mcpServerId } = await props.params;
126
129
  const headersList = await headers();
127
130
  const authorization = headersList.get('authorization');
@@ -165,7 +168,7 @@ export const buildDELETE = ({ prisma = defaultPrisma } = {}) => async (_request,
165
168
  mcpServer: serializeApiMcpServer({ mcpServer: deletedMcpServer }),
166
169
  }, { headers: cacheHeaders });
167
170
  };
168
- export const DELETE = buildDELETE();
171
+ export const DELETE = ((...args) => buildDELETE()(...args));
169
172
  export const OPTIONS = () => NextResponse.json({}, {
170
173
  headers: cacheHeaders,
171
174
  });
@@ -1,6 +1,6 @@
1
1
  import { type NextRequest, NextResponse } from 'next/server';
2
2
  import { type PrismaClient } from '@prisma/client';
3
- export declare const buildGET: ({ prisma }?: {
3
+ export declare const buildGET: ({ prisma: providedPrisma }?: {
4
4
  prisma?: PrismaClient;
5
5
  }) => (_request: NextRequest, props: {
6
6
  params: Promise<{
@@ -30,35 +30,8 @@ export declare const buildGET: ({ prisma }?: {
30
30
  updatedAt: string;
31
31
  }[];
32
32
  }>>;
33
- export declare const GET: (_request: NextRequest, props: {
34
- params: Promise<{
35
- assistantId: string;
36
- }>;
37
- }) => Promise<NextResponse<{
38
- error: string;
39
- }> | NextResponse<{
40
- mcpServers: {
41
- id: string;
42
- transportType: import("@prisma/client").$Enums.TransportType;
43
- sseTransport: {
44
- id: string;
45
- url: string;
46
- headers: PrismaJson.SseTransportHeaders;
47
- createdAt: string;
48
- updatedAt: string;
49
- } | null;
50
- httpTransport: {
51
- id: string;
52
- url: string;
53
- headers: PrismaJson.HttpTransportHeaders;
54
- createdAt: string;
55
- updatedAt: string;
56
- } | null;
57
- createdAt: string;
58
- updatedAt: string;
59
- }[];
60
- }>>;
61
- export declare const buildPOST: ({ prisma }?: {
33
+ export declare const GET: ReturnType<typeof buildGET>;
34
+ export declare const buildPOST: ({ prisma: providedPrisma }?: {
62
35
  prisma?: PrismaClient;
63
36
  }) => (request: NextRequest, props: {
64
37
  params: Promise<{
@@ -88,33 +61,6 @@ export declare const buildPOST: ({ prisma }?: {
88
61
  updatedAt: string;
89
62
  };
90
63
  }>>;
91
- export declare const POST: (request: NextRequest, props: {
92
- params: Promise<{
93
- assistantId: string;
94
- }>;
95
- }) => Promise<NextResponse<{
96
- error: string;
97
- }> | NextResponse<{
98
- mcpServer: {
99
- id: string;
100
- transportType: import("@prisma/client").$Enums.TransportType;
101
- sseTransport: {
102
- id: string;
103
- url: string;
104
- headers: PrismaJson.SseTransportHeaders;
105
- createdAt: string;
106
- updatedAt: string;
107
- } | null;
108
- httpTransport: {
109
- id: string;
110
- url: string;
111
- headers: PrismaJson.HttpTransportHeaders;
112
- createdAt: string;
113
- updatedAt: string;
114
- } | null;
115
- createdAt: string;
116
- updatedAt: string;
117
- };
118
- }>>;
64
+ export declare const POST: ReturnType<typeof buildPOST>;
119
65
  export declare const OPTIONS: () => NextResponse<{}>;
120
66
  //# sourceMappingURL=route.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/mcp-servers/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAQ7E,eAAO,MAAM,QAAQ,GAClB,aAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;GAwDF,CAAA;AAEH,eAAO,MAAM,GAAG,aA7DF,WAAW,SACd;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;GA0DwB,CAAA;AAE7B,eAAO,MAAM,SAAS,GACnB,aAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;GAqFF,CAAA;AAEH,eAAO,MAAM,IAAI,YA1FJ,WAAW,SACb;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;GAuF0B,CAAA;AAE/B,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/mcp-servers/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAQ7E,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;GAyDF,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,SAAS,GACnB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;GAsFF,CAAA;AAEH,eAAO,MAAM,IAAI,EACU,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvD,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
@@ -2,11 +2,12 @@ import { NextResponse } from 'next/server';
2
2
  import { ApiKeyType, TransportType } from '@prisma/client';
3
3
  import { headers } from 'next/headers';
4
4
  import { cacheHeaders } from '../../../../../lib/cache/cacheHeaders';
5
- import { prisma as defaultPrisma } from '../../../../../lib/prisma';
5
+ import { resolvePrisma } from '../../../../../lib/prisma';
6
6
  import { getApiKey } from '../../../../../lib/apiKeys/getApiKey';
7
7
  import { serializeApiMcpServer } from '../../../../../lib/mcpServers/serializeApiMcpServer';
8
8
  import { mcpServerSchema } from '../../../../../lib/mcpServers/mcpServerSchema';
9
- export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, props) => {
9
+ export const buildGET = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
10
+ const prisma = resolvePrisma(providedPrisma);
10
11
  const { assistantId } = await props.params;
11
12
  const headersList = await headers();
12
13
  const authorization = headersList.get('authorization');
@@ -48,8 +49,9 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, pr
48
49
  })),
49
50
  }, { headers: cacheHeaders });
50
51
  };
51
- export const GET = buildGET();
52
- export const buildPOST = ({ prisma = defaultPrisma } = {}) => async (request, props) => {
52
+ export const GET = ((...args) => buildGET()(...args));
53
+ export const buildPOST = ({ prisma: providedPrisma } = {}) => async (request, props) => {
54
+ const prisma = resolvePrisma(providedPrisma);
53
55
  const { assistantId } = await props.params;
54
56
  const headersList = await headers();
55
57
  const authorization = headersList.get('authorization');
@@ -112,7 +114,7 @@ export const buildPOST = ({ prisma = defaultPrisma } = {}) => async (request, pr
112
114
  mcpServer: serializeApiMcpServer({ mcpServer }),
113
115
  }, { headers: cacheHeaders });
114
116
  };
115
- export const POST = buildPOST();
117
+ export const POST = ((...args) => buildPOST()(...args));
116
118
  export const OPTIONS = () => NextResponse.json({}, {
117
119
  headers: cacheHeaders,
118
120
  });