@superinterface/server 1.0.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/README.md +36 -0
- package/eslint.config.mjs +31 -0
- package/next.config.ts +7 -0
- package/package.json +176 -0
- package/prisma/Account.prisma +18 -0
- package/prisma/ApiKey.prisma +13 -0
- package/prisma/Assistant.prisma +32 -0
- package/prisma/AssistantHandler.prisma +12 -0
- package/prisma/Avatar.prisma +10 -0
- package/prisma/ClientToolHandler.prisma +13 -0
- package/prisma/CodeInterpreterTool.prisma +7 -0
- package/prisma/ComputerUseTool.prisma +12 -0
- package/prisma/CreateTaskHandler.prisma +10 -0
- package/prisma/DeleteTaskHandler.prisma +10 -0
- package/prisma/FileSearchTool.prisma +9 -0
- package/prisma/FirecrawlHandler.prisma +13 -0
- package/prisma/Function.prisma +13 -0
- package/prisma/Handler.prisma +19 -0
- package/prisma/HttpTransport.prisma +12 -0
- package/prisma/IconAvatar.prisma +8 -0
- package/prisma/ImageAvatar.prisma +8 -0
- package/prisma/ImageGenerationTool.prisma +11 -0
- package/prisma/InitialMessage.prisma +17 -0
- package/prisma/Invitation.prisma +15 -0
- package/prisma/ListTasksHandler.prisma +10 -0
- package/prisma/Log.prisma +21 -0
- package/prisma/McpServer.prisma +14 -0
- package/prisma/Message.prisma +30 -0
- package/prisma/ModelProvider.prisma +15 -0
- package/prisma/Organization.prisma +10 -0
- package/prisma/OrganizationApiKey.prisma +12 -0
- package/prisma/OrganizationInvitation.prisma +15 -0
- package/prisma/OrganizationUserRole.prisma +14 -0
- package/prisma/ReplicateHandler.prisma +14 -0
- package/prisma/RequestHandler.prisma +15 -0
- package/prisma/Run.prisma +36 -0
- package/prisma/RunStep.prisma +30 -0
- package/prisma/Session.prisma +7 -0
- package/prisma/SseTransport.prisma +12 -0
- package/prisma/StdioTransport.prisma +11 -0
- package/prisma/Task.prisma +15 -0
- package/prisma/Thread.prisma +20 -0
- package/prisma/Tool.prisma +13 -0
- package/prisma/UpdateTaskHandler.prisma +10 -0
- package/prisma/User.prisma +16 -0
- package/prisma/UserRole.prisma +14 -0
- package/prisma/VerificationToken.prisma +7 -0
- package/prisma/WebSearchTool.prisma +7 -0
- package/prisma/Workspace.prisma +14 -0
- package/prisma/enums/ApiKeyType.prisma +4 -0
- package/prisma/enums/AvatarType.prisma +5 -0
- package/prisma/enums/ClientToolHandlerType.prisma +3 -0
- package/prisma/enums/ComputerUseToolEnvironment.prisma +6 -0
- package/prisma/enums/FirecrawlHandlerType.prisma +6 -0
- package/prisma/enums/HandlerType.prisma +11 -0
- package/prisma/enums/IconAvatarName.prisma +14 -0
- package/prisma/enums/ImageGenerationToolOutputFormat.prisma +5 -0
- package/prisma/enums/ImageGenerationToolQuality.prisma +6 -0
- package/prisma/enums/ImageGenerationToolSize.prisma +6 -0
- package/prisma/enums/LogLevel.prisma +5 -0
- package/prisma/enums/LogRequestMethod.prisma +7 -0
- package/prisma/enums/LogRequestRoute.prisma +6 -0
- package/prisma/enums/MessageRole.prisma +4 -0
- package/prisma/enums/MessageStatus.prisma +5 -0
- package/prisma/enums/MethodType.prisma +7 -0
- package/prisma/enums/ModelProviderType.prisma +13 -0
- package/prisma/enums/OrganizationUserRoleType.prisma +3 -0
- package/prisma/enums/ReplicateHandlerType.prisma +3 -0
- package/prisma/enums/RunStatus.prisma +10 -0
- package/prisma/enums/RunStepStatus.prisma +7 -0
- package/prisma/enums/RunStepType.prisma +4 -0
- package/prisma/enums/StorageProviderType.prisma +7 -0
- package/prisma/enums/ToolType.prisma +7 -0
- package/prisma/enums/TransportType.prisma +5 -0
- package/prisma/enums/TruncationType.prisma +5 -0
- package/prisma/enums/UserRoleType.prisma +3 -0
- package/prisma/migrations/20251006235143_initial_setup/migration.sql +986 -0
- package/prisma/migrations/20251007163926_add_truncation_type/migration.sql +6 -0
- package/prisma/migrations/20251007190703_add_organizations/migration.sql +97 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/schema.prisma +13 -0
- package/prisma.config.ts +6 -0
- package/scripts/cli.ts +84 -0
- package/scripts/commands/organizations/api-keys/create.ts +159 -0
- package/scripts/commands/organizations/create.ts +82 -0
- package/scripts/utils/env.ts +31 -0
- package/scripts/utils/errors.ts +6 -0
- package/src/app/api/api-keys/[apiKeyId]/route.ts +178 -0
- package/src/app/api/api-keys/route.ts +147 -0
- package/src/app/api/assistants/[assistantId]/functions/[functionId]/route.ts +245 -0
- package/src/app/api/assistants/[assistantId]/functions/route.ts +157 -0
- package/src/app/api/assistants/[assistantId]/initial-messages/route.ts +127 -0
- package/src/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.ts +243 -0
- package/src/app/api/assistants/[assistantId]/mcp-servers/route.ts +163 -0
- package/src/app/api/assistants/[assistantId]/route.ts +336 -0
- package/src/app/api/assistants/route.ts +196 -0
- package/src/app/api/files/[fileId]/contents/route.ts +145 -0
- package/src/app/api/files/route.ts +117 -0
- package/src/app/api/messages/lib/getWorkspaceId.ts +12 -0
- package/src/app/api/messages/lib/initialMessagesResponse.ts +90 -0
- package/src/app/api/messages/lib/serializeThread.ts +22 -0
- package/src/app/api/messages/route.ts +710 -0
- package/src/app/api/providers/[modelProviderId]/assistants/route.ts +68 -0
- package/src/app/api/providers/[modelProviderId]/models/route.ts +68 -0
- package/src/app/api/providers/[modelProviderId]/route.ts +202 -0
- package/src/app/api/providers/route.ts +105 -0
- package/src/app/api/tasks/[taskId]/route.ts +213 -0
- package/src/app/api/tasks/callback/route.ts +280 -0
- package/src/app/api/tasks/route.ts +121 -0
- package/src/app/api/threads/runs/submit-client-tool-outputs/route.ts +54 -0
- package/src/app/api/workspaces/[workspaceId]/route.ts +137 -0
- package/src/app/api/workspaces/route.ts +139 -0
- package/src/app/layout.tsx +9 -0
- package/src/app/page.tsx +3 -0
- package/src/lib/apiKeys/formatApiKeyName.ts +13 -0
- package/src/lib/apiKeys/getApiKey.ts +25 -0
- package/src/lib/apiKeys/serializeApiKey.ts +11 -0
- package/src/lib/apiKeys/workspaceAccessWhere.ts +21 -0
- package/src/lib/assistants/assistantClientAdapter/buildGetOpenaiAssistant.ts +96 -0
- package/src/lib/assistants/assistantClientAdapter/index.ts +165 -0
- package/src/lib/assistants/formatName.ts +9 -0
- package/src/lib/assistants/serializeApiAssistant.ts +40 -0
- package/src/lib/assistants/serializeAssistant.ts +31 -0
- package/src/lib/assistants/storageAssistantId.ts +29 -0
- package/src/lib/avatars/defaultAvatar.ts +15 -0
- package/src/lib/avatars/serializeAvatar.ts +26 -0
- package/src/lib/cache/cacheHeaders.ts +5 -0
- package/src/lib/computerCalls/handleComputerCall/index.ts +173 -0
- package/src/lib/errors/index.ts +10 -0
- package/src/lib/errors/serializeError.ts +11 -0
- package/src/lib/functions/createFunction.ts +32 -0
- package/src/lib/functions/functionSchema.ts +201 -0
- package/src/lib/functions/handleFunction/getFunction.ts +43 -0
- package/src/lib/functions/handleFunction/handleAssistant.ts +399 -0
- package/src/lib/functions/handleFunction/handleClientTool.ts +127 -0
- package/src/lib/functions/handleFunction/handleFirecrawl.ts +212 -0
- package/src/lib/functions/handleFunction/handleReplicate.ts +109 -0
- package/src/lib/functions/handleFunction/handleRequest.ts +272 -0
- package/src/lib/functions/handleFunction/index.ts +474 -0
- package/src/lib/functions/handleFunction/tasks/handleCreateTask.ts +58 -0
- package/src/lib/functions/handleFunction/tasks/handleDeleteTask.ts +62 -0
- package/src/lib/functions/handleFunction/tasks/handleListTasks.ts +53 -0
- package/src/lib/functions/handleFunction/tasks/handleUpdateTask.ts +70 -0
- package/src/lib/functions/interpolateFunctionValue.ts +26 -0
- package/src/lib/functions/serializeApiFunction.ts +32 -0
- package/src/lib/functions/updateFunction.ts +42 -0
- package/src/lib/handlers/handlerPrismaInput.tsx +141 -0
- package/src/lib/handlers/serializeApiHandler.ts +94 -0
- package/src/lib/iconAvatars/serializeIconAvatar.ts +9 -0
- package/src/lib/imageAvatars/serializeImageAvatar.ts +9 -0
- package/src/lib/initialMessages/schema.ts +11 -0
- package/src/lib/initialMessages/serializeApiInitialMessage.ts +15 -0
- package/src/lib/initialMessages/updateInitialMessages.ts +33 -0
- package/src/lib/logs/createLog.ts +17 -0
- package/src/lib/mcpServers/closeMcpConnection.ts +16 -0
- package/src/lib/mcpServers/connectMcpServer.ts +117 -0
- package/src/lib/mcpServers/getToolCallMcpServer.ts +62 -0
- package/src/lib/mcpServers/headers.ts +113 -0
- package/src/lib/mcpServers/mcpServerSchema.ts +77 -0
- package/src/lib/mcpServers/serializeApiMcpServer.ts +51 -0
- package/src/lib/mcpServers/url.ts +98 -0
- package/src/lib/messages/content.ts +60 -0
- package/src/lib/messages/textContent.ts +13 -0
- package/src/lib/metadata/serializeMetadata.ts +34 -0
- package/src/lib/misc/isJSON.ts +9 -0
- package/src/lib/misc/merge/customizer.ts +8 -0
- package/src/lib/misc/merge/index.ts +6 -0
- package/src/lib/modelProviders/buildAzureOpenaiClientAdapter.ts +33 -0
- package/src/lib/modelProviders/buildOpenaiClient.ts +14 -0
- package/src/lib/modelProviders/buildOpenaiClientAdapter.ts +30 -0
- package/src/lib/modelProviders/clientAdapter.ts +121 -0
- package/src/lib/modelProviders/isModelProviderValid.ts +23 -0
- package/src/lib/modelProviders/modelProviderConfigs.ts +221 -0
- package/src/lib/modelProviders/serializeModelProvider.ts +19 -0
- package/src/lib/models/getModels.ts +27 -0
- package/src/lib/models/serializeApiModel.ts +5 -0
- package/src/lib/openai/getOpenaiAssistants.ts +30 -0
- package/src/lib/organizationApiKeys/getOrganizationApiKey.ts +23 -0
- package/src/lib/prisma/index.ts +29 -0
- package/src/lib/redis/index.ts +3 -0
- package/src/lib/runs/createRunOpts.ts +80 -0
- package/src/lib/storageProviders/getStorageProviderAssistants.ts +19 -0
- package/src/lib/storageProviders/getStorageProviderType.ts +21 -0
- package/src/lib/storageProviders/isOpenaiAssistantsStorageProvider.ts +8 -0
- package/src/lib/storageProviders/isResponsesStorageProvider.ts +8 -0
- package/src/lib/storageProviders/openaiAssistantsStorageProviderTypes.ts +6 -0
- package/src/lib/storageProviders/responsesStorageProviderTypes.ts +6 -0
- package/src/lib/storageProviders/serializeApiStorageProviderAssistant.ts +14 -0
- package/src/lib/tasks/cancelScheduledTask.ts +13 -0
- package/src/lib/tasks/getNextOccurrence.ts +77 -0
- package/src/lib/tasks/getTaskToolKey.ts +49 -0
- package/src/lib/tasks/parseTaskToolArgs.ts +101 -0
- package/src/lib/tasks/scheduleSchema.ts +34 -0
- package/src/lib/tasks/scheduleTask.ts +37 -0
- package/src/lib/tasks/schemas.ts +25 -0
- package/src/lib/tasks/serializeTask.ts +14 -0
- package/src/lib/tasks/validateSchedule.ts +23 -0
- package/src/lib/themes/defaultTheme.ts +7 -0
- package/src/lib/themes/serializeAccentColor.ts +9 -0
- package/src/lib/themes/serializeTheme/index.ts +25 -0
- package/src/lib/themes/serializeTheme/serializeScaling.ts +14 -0
- package/src/lib/threads/createThread/index.ts +185 -0
- package/src/lib/threads/createThread/initialMessages.ts +36 -0
- package/src/lib/threads/managedOpenaiThreadId.ts +72 -0
- package/src/lib/threads/storageThreadId.ts +49 -0
- package/src/lib/threads/validThreadId.ts +10 -0
- package/src/lib/toolCalls/handleToolCall.ts +121 -0
- package/src/lib/toolCalls/messagesToOutput.ts +8 -0
- package/src/lib/toolCalls/streamOutput.ts +106 -0
- package/src/lib/tools/tools/index.ts +316 -0
- package/src/lib/upstash/qstash.ts +5 -0
- package/src/lib/upstash/upstashWorkflowClient.ts +5 -0
- package/src/lib/workspaces/serializeApiWorkspace.ts +12 -0
- package/src/types/index.ts +133 -0
- package/tsconfig.build.json +13 -0
- package/tsconfig.json +27 -0
- package/types/prisma.d.ts +4 -0
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
|
|
2
|
+
|
|
3
|
+
## Getting Started
|
|
4
|
+
|
|
5
|
+
First, run the development server:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run dev
|
|
9
|
+
# or
|
|
10
|
+
yarn dev
|
|
11
|
+
# or
|
|
12
|
+
pnpm dev
|
|
13
|
+
# or
|
|
14
|
+
bun dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
18
|
+
|
|
19
|
+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
|
20
|
+
|
|
21
|
+
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
|
22
|
+
|
|
23
|
+
## Learn More
|
|
24
|
+
|
|
25
|
+
To learn more about Next.js, take a look at the following resources:
|
|
26
|
+
|
|
27
|
+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
|
28
|
+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
29
|
+
|
|
30
|
+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
|
31
|
+
|
|
32
|
+
## Deploy on Vercel
|
|
33
|
+
|
|
34
|
+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
|
35
|
+
|
|
36
|
+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { dirname } from 'path'
|
|
2
|
+
import { fileURLToPath } from 'url'
|
|
3
|
+
import { FlatCompat } from '@eslint/eslintrc'
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
6
|
+
const __dirname = dirname(__filename)
|
|
7
|
+
|
|
8
|
+
const compat = new FlatCompat({
|
|
9
|
+
baseDirectory: __dirname,
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
const eslintConfig = [
|
|
13
|
+
...compat.extends('next/core-web-vitals', 'next/typescript'),
|
|
14
|
+
{
|
|
15
|
+
ignores: [
|
|
16
|
+
'node_modules/**',
|
|
17
|
+
'.next/**',
|
|
18
|
+
'out/**',
|
|
19
|
+
'build/**',
|
|
20
|
+
'next-env.d.ts',
|
|
21
|
+
'dist/**',
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
rules: {
|
|
26
|
+
'@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
export default eslintConfig
|
package/next.config.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@superinterface/server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"exports": {
|
|
5
|
+
"./prisma/enums/*": "./prisma/enums/*",
|
|
6
|
+
"./prisma/*": "./prisma/*",
|
|
7
|
+
"./next/api/assistants/*": {
|
|
8
|
+
"types": "./dist/app/api/assistants/*.d.ts",
|
|
9
|
+
"import": "./dist/app/api/assistants/*.js",
|
|
10
|
+
"default": "./dist/app/api/assistants/*.js"
|
|
11
|
+
},
|
|
12
|
+
"./next/api/assistants/[assistantId]/*": {
|
|
13
|
+
"types": "./dist/app/api/assistants/[assistantId]/*.d.ts",
|
|
14
|
+
"import": "./dist/app/api/assistants/[assistantId]/*.js",
|
|
15
|
+
"default": "./dist/app/api/assistants/[assistantId]/*.js"
|
|
16
|
+
},
|
|
17
|
+
"./next/api/assistants/[assistantId]/initial-messages/*": {
|
|
18
|
+
"types": "./dist/app/api/assistants/[assistantId]/initial-messages/*.d.ts",
|
|
19
|
+
"import": "./dist/app/api/assistants/[assistantId]/initial-messages/*.js",
|
|
20
|
+
"default": "./dist/app/api/assistants/[assistantId]/initial-messages/*.js"
|
|
21
|
+
},
|
|
22
|
+
"./next/api/assistants/[assistantId]/functions/*": {
|
|
23
|
+
"types": "./dist/app/api/assistants/[assistantId]/functions/*.d.ts",
|
|
24
|
+
"import": "./dist/app/api/assistants/[assistantId]/functions/*.js",
|
|
25
|
+
"default": "./dist/app/api/assistants/[assistantId]/functions/*.js"
|
|
26
|
+
},
|
|
27
|
+
"./next/api/assistants/[assistantId]/functions/[functionId]/*": {
|
|
28
|
+
"types": "./dist/app/api/assistants/[assistantId]/functions/[functionId]/*.d.ts",
|
|
29
|
+
"import": "./dist/app/api/assistants/[assistantId]/functions/[functionId]/*.js",
|
|
30
|
+
"default": "./dist/app/api/assistants/[assistantId]/functions/[functionId]/*.js"
|
|
31
|
+
},
|
|
32
|
+
"./next/api/assistants/[assistantId]/mcp-servers/*": {
|
|
33
|
+
"types": "./dist/app/api/assistants/[assistantId]/mcp-servers/*.d.ts",
|
|
34
|
+
"import": "./dist/app/api/assistants/[assistantId]/mcp-servers/*.js",
|
|
35
|
+
"default": "./dist/app/api/assistants/[assistantId]/mcp-servers/*.js"
|
|
36
|
+
},
|
|
37
|
+
"./next/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/*": {
|
|
38
|
+
"types": "./dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/*.d.ts",
|
|
39
|
+
"import": "./dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/*.js",
|
|
40
|
+
"default": "./dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/*.js"
|
|
41
|
+
},
|
|
42
|
+
"./next/api/files/*": {
|
|
43
|
+
"types": "./dist/app/api/files/*.d.ts",
|
|
44
|
+
"import": "./dist/app/api/files/*.js",
|
|
45
|
+
"default": "./dist/app/api/files/*.js"
|
|
46
|
+
},
|
|
47
|
+
"./next/api/files/[fileId]/contents*": {
|
|
48
|
+
"types": "./dist/app/api/files/[fileId]/contents/*.d.ts",
|
|
49
|
+
"import": "./dist/app/api/files/[fileId]/contents/*.js",
|
|
50
|
+
"default": "./dist/app/api/files/[fileId]/contents/*.js"
|
|
51
|
+
},
|
|
52
|
+
"./next/api/messages/*": {
|
|
53
|
+
"types": "./dist/app/api/messages/*.d.ts",
|
|
54
|
+
"import": "./dist/app/api/messages/*.js",
|
|
55
|
+
"default": "./dist/app/api/messages/*.js"
|
|
56
|
+
},
|
|
57
|
+
"./next/api/api-keys/*": {
|
|
58
|
+
"types": "./dist/app/api/api-keys/*.d.ts",
|
|
59
|
+
"import": "./dist/app/api/api-keys/*.js",
|
|
60
|
+
"default": "./dist/app/api/api-keys/*.js"
|
|
61
|
+
},
|
|
62
|
+
"./next/api/api-keys/[apiKeyId]/*": {
|
|
63
|
+
"types": "./dist/app/api/api-keys/[apiKeyId]/*.d.ts",
|
|
64
|
+
"import": "./dist/app/api/api-keys/[apiKeyId]/*.js",
|
|
65
|
+
"default": "./dist/app/api/api-keys/[apiKeyId]/*.js"
|
|
66
|
+
},
|
|
67
|
+
"./next/api/providers/*": {
|
|
68
|
+
"types": "./dist/app/api/providers/*.d.ts",
|
|
69
|
+
"import": "./dist/app/api/providers/*.js",
|
|
70
|
+
"default": "./dist/app/api/providers/*.js"
|
|
71
|
+
},
|
|
72
|
+
"./next/api/providers/[modelProviderId]/*": {
|
|
73
|
+
"types": "./dist/app/api/providers/[modelProviderId]/*.d.ts",
|
|
74
|
+
"import": "./dist/app/api/providers/[modelProviderId]/*.js",
|
|
75
|
+
"default": "./dist/app/api/providers/[modelProviderId]/*.js"
|
|
76
|
+
},
|
|
77
|
+
"./next/api/providers/[modelProviderId]/models/*": {
|
|
78
|
+
"types": "./dist/app/api/providers/[modelProviderId]/models/*.d.ts",
|
|
79
|
+
"import": "./dist/app/api/providers/[modelProviderId]/models/*.js",
|
|
80
|
+
"default": "./dist/app/api/providers/[modelProviderId]/models/*.js"
|
|
81
|
+
},
|
|
82
|
+
"./next/api/providers/[modelProviderId]/assistants/*": {
|
|
83
|
+
"types": "./dist/app/api/providers/[modelProviderId]/assistants/*.d.ts",
|
|
84
|
+
"import": "./dist/app/api/providers/[modelProviderId]/assistants/*.js",
|
|
85
|
+
"default": "./dist/app/api/providers/[modelProviderId]/assistants/*.js"
|
|
86
|
+
},
|
|
87
|
+
"./next/api/tasks/*": {
|
|
88
|
+
"types": "./dist/app/api/tasks/*.d.ts",
|
|
89
|
+
"import": "./dist/app/api/tasks/*.js",
|
|
90
|
+
"default": "./dist/app/api/tasks/*.js"
|
|
91
|
+
},
|
|
92
|
+
"./next/api/tasks/[taskId]/*": {
|
|
93
|
+
"types": "./dist/app/api/tasks/[taskId]/*.d.ts",
|
|
94
|
+
"import": "./dist/app/api/tasks/[taskId]/*.js",
|
|
95
|
+
"default": "./dist/app/api/tasks/[taskId]/*.js"
|
|
96
|
+
},
|
|
97
|
+
"./next/api/tasks/callback/*": {
|
|
98
|
+
"types": "./dist/app/api/tasks/callback/*.d.ts",
|
|
99
|
+
"import": "./dist/app/api/tasks/callback/*.js",
|
|
100
|
+
"default": "./dist/app/api/tasks/callback/*.js"
|
|
101
|
+
},
|
|
102
|
+
"./next/api/threads/runs/submit-client-tool-outputs/*": {
|
|
103
|
+
"types": "./dist/app/api/threads/runs/submit-client-tool-outputs/*.d.ts",
|
|
104
|
+
"import": "./dist/app/api/threads/runs/submit-client-tool-outputs/*.js",
|
|
105
|
+
"default": "./dist/app/api/threads/runs/submit-client-tool-outputs/*.js"
|
|
106
|
+
},
|
|
107
|
+
"./next/api/workspaces/*": {
|
|
108
|
+
"types": "./dist/app/api/workspaces/*.d.ts",
|
|
109
|
+
"import": "./dist/app/api/workspaces/*.js",
|
|
110
|
+
"default": "./dist/app/api/workspaces/*.js"
|
|
111
|
+
},
|
|
112
|
+
"./next/api/workspaces/[workspaceId]/*": {
|
|
113
|
+
"types": "./dist/app/api/workspaces/[workspaceId]/*.d.ts",
|
|
114
|
+
"import": "./dist/app/api/workspaces/[workspaceId]/*.js",
|
|
115
|
+
"default": "./dist/app/api/workspaces/[workspaceId]/*.js"
|
|
116
|
+
},
|
|
117
|
+
"./lib/assistants/serializeApiAssistant": {
|
|
118
|
+
"types": "./dist/lib/assistants/serializeApiAssistant.d.ts",
|
|
119
|
+
"import": "./dist/lib/assistants/serializeApiAssistant.js",
|
|
120
|
+
"default": "./dist/lib/assistants/serializeApiAssistant.js"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"scripts": {
|
|
124
|
+
"dev": "next dev --turbopack",
|
|
125
|
+
"build": "npm run build:lib && next build --turbopack",
|
|
126
|
+
"build:lib": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
127
|
+
"start": "next start",
|
|
128
|
+
"prisma:migrate": "npx prisma migrate dev",
|
|
129
|
+
"lint": "eslint",
|
|
130
|
+
"cli": "tsx scripts/cli.ts"
|
|
131
|
+
},
|
|
132
|
+
"dependencies": {
|
|
133
|
+
"@anthropic-ai/sdk": "^0.65.0",
|
|
134
|
+
"@mendable/firecrawl-js": "^1.22.0",
|
|
135
|
+
"@mistralai/mistralai": "^1.10.0",
|
|
136
|
+
"@modelcontextprotocol/sdk": "^1.19.1",
|
|
137
|
+
"@prisma/adapter-neon": "^6.16.3",
|
|
138
|
+
"@prisma/client": "^6.16.3",
|
|
139
|
+
"@superinterface/react": "^5.2.2",
|
|
140
|
+
"@upstash/qstash": "^2.8.3",
|
|
141
|
+
"@upstash/redis": "^1.35.5",
|
|
142
|
+
"@upstash/workflow": "^0.2.20",
|
|
143
|
+
"@vercel/functions": "^3.1.1",
|
|
144
|
+
"dayjs": "^1.11.18",
|
|
145
|
+
"groq-sdk": "^0.33.0",
|
|
146
|
+
"p-iteration": "^1.1.8",
|
|
147
|
+
"prisma-json-types-generator": "^3.6.2",
|
|
148
|
+
"replicate": "^1.2.0",
|
|
149
|
+
"supercompat": "^3.8.0",
|
|
150
|
+
"uuid": "^13.0.0"
|
|
151
|
+
},
|
|
152
|
+
"peerDependencies": {
|
|
153
|
+
"next": "15.5.4",
|
|
154
|
+
"react": "19.1.1",
|
|
155
|
+
"react-dom": "19.1.1"
|
|
156
|
+
},
|
|
157
|
+
"devDependencies": {
|
|
158
|
+
"@eslint/eslintrc": "^3",
|
|
159
|
+
"@types/node": "^20",
|
|
160
|
+
"@types/react": "^19",
|
|
161
|
+
"@types/react-dom": "^19",
|
|
162
|
+
"eslint": "^9",
|
|
163
|
+
"eslint-config-next": "15.5.4",
|
|
164
|
+
"next": "15.5.4",
|
|
165
|
+
"prisma": "^6.16.3",
|
|
166
|
+
"react": "19.1.1",
|
|
167
|
+
"react-dom": "19.1.1",
|
|
168
|
+
"tsc-alias": "^1.8.12",
|
|
169
|
+
"typescript": "^5",
|
|
170
|
+
"@clack/prompts": "^0.11.0",
|
|
171
|
+
"dotenv": "^16.4.5",
|
|
172
|
+
"tsx": "^4.11.0",
|
|
173
|
+
"zod": "^3.23.8",
|
|
174
|
+
"commander": "^14.0.1"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
model Account {
|
|
2
|
+
id String @id @default(cuid())
|
|
3
|
+
userId String
|
|
4
|
+
type String
|
|
5
|
+
provider String
|
|
6
|
+
providerAccountId String
|
|
7
|
+
refresh_token String? @db.Text
|
|
8
|
+
access_token String? @db.Text
|
|
9
|
+
expires_at Int?
|
|
10
|
+
token_type String?
|
|
11
|
+
scope String?
|
|
12
|
+
id_token String? @db.Text
|
|
13
|
+
session_state String?
|
|
14
|
+
|
|
15
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
16
|
+
|
|
17
|
+
@@unique([provider, providerAccountId])
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
model ApiKey {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
type ApiKeyType @default(PUBLIC)
|
|
4
|
+
name String @default("")
|
|
5
|
+
value String @default(dbgenerated("gen_random_uuid()")) @unique @db.Uuid
|
|
6
|
+
workspaceId String @db.Uuid
|
|
7
|
+
workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
|
8
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
9
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
10
|
+
|
|
11
|
+
@@index([value])
|
|
12
|
+
@@index([workspaceId])
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
model Assistant {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
name String @default("")
|
|
4
|
+
instructions String @default("")
|
|
5
|
+
description String @default("")
|
|
6
|
+
workspaceId String @db.Uuid
|
|
7
|
+
workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
|
8
|
+
modelSlug String
|
|
9
|
+
modelProviderId String @db.Uuid
|
|
10
|
+
modelProvider ModelProvider @relation(fields: [modelProviderId], references: [id])
|
|
11
|
+
storageProviderType StorageProviderType @default(OPENAI)
|
|
12
|
+
openaiAssistantId String?
|
|
13
|
+
openaiAssistantFileSearchEnabled Boolean @default(false)
|
|
14
|
+
openaiAssistantCodeInterpreterEnabled Boolean @default(false)
|
|
15
|
+
avatar Avatar?
|
|
16
|
+
threads Thread[]
|
|
17
|
+
runs Run[]
|
|
18
|
+
runSteps RunStep[]
|
|
19
|
+
messages Message[]
|
|
20
|
+
initialMessages InitialMessage[]
|
|
21
|
+
functions Function[]
|
|
22
|
+
mcpServers McpServer[]
|
|
23
|
+
assistantHandlers AssistantHandler[]
|
|
24
|
+
logs Log[]
|
|
25
|
+
tools Tool[]
|
|
26
|
+
truncationType TruncationType @default(AUTO)
|
|
27
|
+
truncationLastMessagesCount Int?
|
|
28
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
29
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
30
|
+
|
|
31
|
+
@@index([workspaceId])
|
|
32
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
model AssistantHandler {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
assistantId String @db.Uuid
|
|
4
|
+
assistant Assistant @relation(fields: [assistantId], references: [id], onDelete: Restrict)
|
|
5
|
+
handlerId String @db.Uuid @unique
|
|
6
|
+
handler Handler @relation(fields: [handlerId], references: [id], onDelete: Cascade)
|
|
7
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
8
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
9
|
+
|
|
10
|
+
@@index([handlerId])
|
|
11
|
+
@@index([assistantId])
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
model Avatar {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
type AvatarType
|
|
4
|
+
iconAvatar IconAvatar?
|
|
5
|
+
imageAvatar ImageAvatar?
|
|
6
|
+
assistantId String @db.Uuid @unique
|
|
7
|
+
assistant Assistant @relation(fields: [assistantId], references: [id], onDelete: Cascade)
|
|
8
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
9
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
model ClientToolHandler {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
type ClientToolHandlerType @default(FUNCTION)
|
|
4
|
+
name String
|
|
5
|
+
/// [ClientToolHandlerArguments]
|
|
6
|
+
arguments Json
|
|
7
|
+
handlerId String @db.Uuid @unique
|
|
8
|
+
handler Handler @relation(fields: [handlerId], references: [id], onDelete: Cascade)
|
|
9
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
10
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
11
|
+
|
|
12
|
+
@@index([handlerId])
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
model CodeInterpreterTool {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
toolId String @db.Uuid @unique
|
|
4
|
+
tool Tool @relation(fields: [toolId], references: [id], onDelete: Cascade)
|
|
5
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
6
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
model ComputerUseTool {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
displayHeight Int @default(720)
|
|
4
|
+
displayWidth Int @default(1280)
|
|
5
|
+
environment ComputerUseToolEnvironment @default(LINUX)
|
|
6
|
+
mcpServerId String? @db.Uuid @unique
|
|
7
|
+
mcpServer McpServer? @relation(fields: [mcpServerId], references: [id], onDelete: Cascade)
|
|
8
|
+
toolId String @db.Uuid @unique
|
|
9
|
+
tool Tool @relation(fields: [toolId], references: [id], onDelete: Cascade)
|
|
10
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
11
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
model CreateTaskHandler {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
keyTemplate String @default("")
|
|
4
|
+
handlerId String @db.Uuid @unique
|
|
5
|
+
handler Handler @relation(fields: [handlerId], references: [id], onDelete: Cascade)
|
|
6
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
7
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
8
|
+
|
|
9
|
+
@@index([handlerId])
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
model DeleteTaskHandler {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
keyTemplate String @default("")
|
|
4
|
+
handlerId String @db.Uuid @unique
|
|
5
|
+
handler Handler @relation(fields: [handlerId], references: [id], onDelete: Cascade)
|
|
6
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
7
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
8
|
+
|
|
9
|
+
@@index([handlerId])
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
model FileSearchTool {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
vectorStoreIds String[] @default([])
|
|
4
|
+
maxNumResults Int @default(20)
|
|
5
|
+
toolId String @db.Uuid @unique
|
|
6
|
+
tool Tool @relation(fields: [toolId], references: [id], onDelete: Cascade)
|
|
7
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
8
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
model FirecrawlHandler {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
type FirecrawlHandlerType
|
|
4
|
+
apiKey String
|
|
5
|
+
/// [FirecrawlHandlerBody]
|
|
6
|
+
body Json
|
|
7
|
+
handlerId String @db.Uuid @unique
|
|
8
|
+
handler Handler @relation(fields: [handlerId], references: [id], onDelete: Cascade)
|
|
9
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
10
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
11
|
+
|
|
12
|
+
@@index([handlerId])
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
model Function {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
/// [OpenapiSpec]
|
|
4
|
+
openapiSpec Json
|
|
5
|
+
assistantId String @db.Uuid
|
|
6
|
+
assistant Assistant @relation(fields: [assistantId], references: [id], onDelete: Cascade)
|
|
7
|
+
handler Handler?
|
|
8
|
+
importOpenApiSchema String?
|
|
9
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
10
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
11
|
+
|
|
12
|
+
@@index([assistantId])
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
model Handler {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
type HandlerType
|
|
4
|
+
requestHandler RequestHandler?
|
|
5
|
+
firecrawlHandler FirecrawlHandler?
|
|
6
|
+
assistantHandler AssistantHandler?
|
|
7
|
+
replicateHandler ReplicateHandler?
|
|
8
|
+
clientToolHandler ClientToolHandler?
|
|
9
|
+
createTaskHandler CreateTaskHandler?
|
|
10
|
+
listTasksHandler ListTasksHandler?
|
|
11
|
+
updateTaskHandler UpdateTaskHandler?
|
|
12
|
+
deleteTaskHandler DeleteTaskHandler?
|
|
13
|
+
functionId String @db.Uuid @unique
|
|
14
|
+
function Function @relation(fields: [functionId], references: [id], onDelete: Cascade)
|
|
15
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
16
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
17
|
+
|
|
18
|
+
@@index([functionId])
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
model HttpTransport {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
mcpServerId String @db.Uuid @unique
|
|
4
|
+
mcpServer McpServer @relation(fields: [mcpServerId], references: [id], onDelete: Cascade)
|
|
5
|
+
url String
|
|
6
|
+
/// [HttpTransportHeaders]
|
|
7
|
+
headers Json @default("{}")
|
|
8
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
9
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
10
|
+
|
|
11
|
+
@@index([mcpServerId])
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
model IconAvatar {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
name IconAvatarName
|
|
4
|
+
avatarId String @db.Uuid @unique
|
|
5
|
+
avatar Avatar @relation(fields: [avatarId], references: [id], onDelete: Cascade)
|
|
6
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
7
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
model ImageAvatar {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
url String
|
|
4
|
+
avatarId String @db.Uuid @unique
|
|
5
|
+
avatar Avatar @relation(fields: [avatarId], references: [id], onDelete: Cascade)
|
|
6
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
7
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
model ImageGenerationTool {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
outputFormat ImageGenerationToolOutputFormat @default(PNG)
|
|
4
|
+
partialImages Int @default(0)
|
|
5
|
+
quality ImageGenerationToolQuality @default(AUTO)
|
|
6
|
+
size ImageGenerationToolSize @default(AUTO)
|
|
7
|
+
toolId String @db.Uuid @unique
|
|
8
|
+
tool Tool @relation(fields: [toolId], references: [id], onDelete: Cascade)
|
|
9
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
10
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
model InitialMessage {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
assistantId String? @db.Uuid
|
|
4
|
+
assistant Assistant? @relation(fields: [assistantId], references: [id], onDelete: Cascade)
|
|
5
|
+
role MessageRole
|
|
6
|
+
orderNumber Int
|
|
7
|
+
content String
|
|
8
|
+
/// [MessageAttachment]
|
|
9
|
+
attachments Json[] @default([])
|
|
10
|
+
/// [MessageMetadata]
|
|
11
|
+
metadata Json?
|
|
12
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
13
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
14
|
+
|
|
15
|
+
@@index([assistantId])
|
|
16
|
+
@@index([orderNumber])
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
model Invitation {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
email String
|
|
4
|
+
roleType UserRoleType @default(ADMIN)
|
|
5
|
+
createdByUserId String
|
|
6
|
+
createdByUser User @relation(fields: [createdByUserId], references: [id], onDelete: Cascade)
|
|
7
|
+
workspaceId String @db.Uuid
|
|
8
|
+
workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
|
9
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
10
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
11
|
+
|
|
12
|
+
@@index([createdByUserId])
|
|
13
|
+
@@index([workspaceId])
|
|
14
|
+
@@unique([workspaceId, email])
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
model ListTasksHandler {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
keyTemplate String @default("")
|
|
4
|
+
handlerId String @db.Uuid @unique
|
|
5
|
+
handler Handler @relation(fields: [handlerId], references: [id], onDelete: Cascade)
|
|
6
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
7
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
8
|
+
|
|
9
|
+
@@index([handlerId])
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
model Log {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
level LogLevel
|
|
4
|
+
requestMethod LogRequestMethod
|
|
5
|
+
requestRoute LogRequestRoute
|
|
6
|
+
status Int
|
|
7
|
+
message String
|
|
8
|
+
workspaceId String? @db.Uuid
|
|
9
|
+
workspace Workspace? @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
|
10
|
+
assistantId String? @db.Uuid
|
|
11
|
+
assistant Assistant? @relation(fields: [assistantId], references: [id], onDelete: Cascade)
|
|
12
|
+
threadId String? @db.Uuid
|
|
13
|
+
thread Thread? @relation(fields: [threadId], references: [id], onDelete: Cascade)
|
|
14
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
15
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
16
|
+
|
|
17
|
+
@@index([workspaceId])
|
|
18
|
+
@@index([assistantId])
|
|
19
|
+
@@index([threadId])
|
|
20
|
+
@@index([createdAt(sort: Desc)])
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
model McpServer {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
transportType TransportType @default(STDIO)
|
|
4
|
+
assistantId String @db.Uuid
|
|
5
|
+
assistant Assistant @relation(fields: [assistantId], references: [id], onDelete: Cascade)
|
|
6
|
+
computerUseTool ComputerUseTool?
|
|
7
|
+
stdioTransport StdioTransport?
|
|
8
|
+
sseTransport SseTransport?
|
|
9
|
+
httpTransport HttpTransport?
|
|
10
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
11
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
12
|
+
|
|
13
|
+
@@index([assistantId])
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
model Message {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
threadId String @db.Uuid
|
|
4
|
+
thread Thread @relation(fields: [threadId], references: [id], onDelete: Cascade)
|
|
5
|
+
role MessageRole
|
|
6
|
+
/// [MessageContent]
|
|
7
|
+
content Json
|
|
8
|
+
status MessageStatus @default(COMPLETED)
|
|
9
|
+
assistantId String? @db.Uuid
|
|
10
|
+
assistant Assistant? @relation(fields: [assistantId], references: [id], onDelete: Cascade)
|
|
11
|
+
runId String? @db.Uuid
|
|
12
|
+
run Run? @relation(fields: [runId], references: [id], onDelete: Cascade)
|
|
13
|
+
completedAt DateTime? @db.Timestamptz(6)
|
|
14
|
+
incompleteAt DateTime? @db.Timestamptz(6)
|
|
15
|
+
/// [IncompleteDetails]
|
|
16
|
+
incompleteDetails Json?
|
|
17
|
+
/// [MessageAttachment]
|
|
18
|
+
attachments Json[] @default([])
|
|
19
|
+
/// [MessageMetadata]
|
|
20
|
+
metadata Json?
|
|
21
|
+
/// [MessageToolCalls]
|
|
22
|
+
toolCalls Json?
|
|
23
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
24
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
25
|
+
|
|
26
|
+
@@index([threadId])
|
|
27
|
+
@@index([assistantId])
|
|
28
|
+
@@index([createdAt(sort: Desc)])
|
|
29
|
+
@@index([runId])
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
model ModelProvider {
|
|
2
|
+
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
3
|
+
type ModelProviderType
|
|
4
|
+
name String @default("")
|
|
5
|
+
apiKey String
|
|
6
|
+
endpoint String?
|
|
7
|
+
apiVersion String?
|
|
8
|
+
assistants Assistant[]
|
|
9
|
+
workspaceId String @db.Uuid
|
|
10
|
+
workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
|
11
|
+
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
|
12
|
+
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
|
13
|
+
|
|
14
|
+
@@index([workspaceId])
|
|
15
|
+
}
|