mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-24 05:37:14 +00:00
* feat(mcp): add MCP server support with proxy tool and OAuth flow
Add URL-based MCP (Model Context Protocol) server support to the backend:
- DB: McpServer / AgentMcpServer / McpServerCredential models with
typed JSON columns (auth config, cached tools, stored OAuth tokens,
pending auth state) and a migration.
- Core (@shumai/core/src/mcp): DB-backed credential store, OAuth
client provider (authorization_code + client_credentials) with a
Hono-hosted redirect callback, connection lifecycle manager
(Streamable HTTP with SSE fallback, lazy connect, 401 -> needs_auth),
JSON Schema -> AgentTool parameter conversion, in-memory tool registry
with ranked search, the single 'mcp' proxy AgentTool (search /
describe / list / call / connect / status / auth-start), per-server
opt-in direct tools ({server}_{tool}), and McpService (CRUD,
discovery, OAuth, per-agent assignment via AgentMcpServer, and
permission gating on tool execution mirroring skills).
- Agent: chat agents receive the 'mcp' proxy tool (plus direct tools
for opted-in servers) built from their assigned, enabled servers.
- API: /teams/:teamId/mcp/servers CRUD, tools refresh/list, auth
start/complete/status/remove, test, permission, and the public
OAuth callback route; Admin authz via new ResourceType.McpServer;
audit logging.
- DTOs: zod schemas + types for servers, tools, auth, and per-agent
mcpServerIds.
- Tests: DB store, schema conversion, registry/search, service
integration against a real in-process MCP server (v2
@modelcontextprotocol/server), permission gating, rename
invalidation, direct tools, per-agent assignment, API route tests,
and workflow E2E (local + temporal) for proxy and direct modes.
* fix(mcp): persist OAuth discovery snapshot and stamp SEP-2352 issuer
The callback leg of the OAuth flow failed with
AuthorizationServerMismatchError ('discoveryState was not available on
the callback leg') because McpDbStore.savePendingAuth overwrote the
entire pendingAuth JSON column, clobbering the discoverySnapshot that
the provider's saveDiscoveryState() had stored inside it.
- McpDbStore.savePendingAuth now preserves an in-flight discovery
snapshot so the callback leg can satisfy the SEP-2352 authorization-
server issuer check.
- McpOauthProvider now round-trips the issuer stamp derived from the
discovery snapshot: saveClientInformation/saveTokens persist it,
clientInformation()/tokens() return it, and tokens() backfills a
missing stamp for pre-existing credentials (removes the
'stored OAuth credential has no issuer stamp' warning).
- Regression tests: savePendingAuth keeps the snapshot; the provider
stamps/round-trips the issuer on both legs.
* fix(mcp): backfill SEP-2352 issuer stamp on stale OAuth client info
clientInformation() returned stored client info without an issuer field
when it had been dynamically registered before the stamping fix, so the
SDK logged 'stored OAuth credential has no issuer stamp' on every read.
Now the stored branch backfills the issuer from the discovery snapshot
(persisting it) exactly like the tokens() backfill.
* feat(webui): add MCP server configuration and agent assignment UI (#290)
* feat(webui): add MCP server configuration and agent assignment UI
* fix(webui): auto-detect auth for unconfigured MCP servers and show connect button
* fix(mcp): auto-generate state in mcp-oauth-provider when missing in DB
* fix(mcp): persist OAuth discovery snapshot and stamp SEP-2352 issuer
The callback leg of the OAuth flow failed with
AuthorizationServerMismatchError ('discoveryState was not available on
the callback leg') because McpDbStore.savePendingAuth overwrote the
entire pendingAuth JSON column, clobbering the discoverySnapshot that
the provider's saveDiscoveryState() had stored inside it.
- McpDbStore.savePendingAuth now preserves an in-flight discovery
snapshot so the callback leg can satisfy the SEP-2352 authorization-
server issuer check.
- McpOauthProvider now round-trips the issuer stamp derived from the
discovery snapshot: saveClientInformation/saveTokens persist it,
clientInformation()/tokens() return it, and tokens() backfills a
missing stamp for pre-existing credentials (removes the
'stored OAuth credential has no issuer stamp' warning).
- Regression tests: savePendingAuth keeps the snapshot; the provider
stamps/round-trips the issuer on both legs.
* fix(mcp): backfill SEP-2352 issuer stamp on stale OAuth client info
clientInformation() returned stored client info without an issuer field
when it had been dynamically registered before the stamping fix, so the
SDK logged 'stored OAuth credential has no issuer stamp' on every read.
Now the stored branch backfills the issuer from the discovery snapshot
(persisting it) exactly like the tokens() backfill.
* fix(mcp): attach McpOauthProvider for auto-detected OAuth servers and discover tools on auth completion
* fix(webui): fix flex min-h-0 and max-h scrolling on MCP tools dialog
* fix(webui): set explicit flex height on McpToolsDialog for active scrolling
* feat(webui): make MCP server cards clickable to edit and widen server config dialog
* feat(mcp): agent-level server enablement and auto-detected server metadata (#291)
* feat(mcp): agent-level server enablement and auto-detected server metadata
- Remove the server-level `enabled` column from mcp_servers; enable/disable
now happens per-agent via the AgentMcpServer join table (mirrors skills).
- Drop the unique (teamId, name) constraint so duplicate server names are allowed.
- Add a `description` column, auto-filled from client.getServerVersion() on
connect; the server name is auto-filled from the reported title (fallback name)
with a URL-derived placeholder until first connect.
- Remove manual name input: the create dialog is URL-only, and the edit dialog
shows the auto-detected name/description read-only.
- Replace the include/exclude raw-text inputs with the tool list in the edit
dialog, managing only excludeTools; remove includeTools support and the
separate McpToolsDialog component.
- Sanitize server-reported names into safe direct-tool prefixes (spaces/punctuation
become underscores) and use the same sanitization in the proxy resolver.
* fix(mcp): give the edit-dialog tool list a definite height
The Shadcn ScrollArea viewport is h-full, which requires a definite height
on the root. Using max-h-64 left the viewport at auto height, so the root
clipped the list at 256px without engaging its own scrollbar — tools past
the cutoff were unreachable. Use a fixed h-64 container (same pattern as
move-copy-dialog) so the inner scroll area scrolls independently of the
dialog's outer scroll.
* refactor(mcp): fixed header/footer with scrollable content in server config dialog
Mirror the skill config dialog layout: the edit dialog now keeps the header
and footer fixed and scrolls only the content area (ScrollArea flex-1
min-h-0 inside an h-[85vh] flex column). The tools list no longer has its
own nested ScrollArea — it flows inside the content-level scroll, so all
tools are reachable without a nested-scroll conflict. The create dialog
stays compact (URL-only) like the skill add dialog.
Verified headlessly that max-height-based ScrollArea roots do not engage
scrolling (viewport height resolves to auto), which is why the previous
nested list clipped; the flex-based definite-height pattern scrolls.
* feat(mcp): make the endpoint URL immutable after creation
Editing a server's URL effectively points it at a different server, and the
create flow is URL-only anyway — so the edit dialog no longer allows changing
it (delete + re-add covers endpoint changes). The URL is displayed read-only
next to the auto-detected name/description, and `url` was removed from the
update DTO and service; auth/transport changes still invalidate credentials
and cached tools.
* refactor(mcp): match MCP server cards to the skill card layout
The settings list cards now share the skill card structure: row 1 is the
server name (with direct-mode/transport badges) plus the three-dot menu,
row 2 is the description (falling back to 'No description provided') with
the endpoint URL and last error as small mono lines, and row 3 holds the
connection-status badge and updated date on the left with the permission
selector and the connect button at the right end.
* fix(mcp): stop card menu clicks from opening the edit dialog
The three-dot menu is portaled, so its item clicks bubble through React's
synthetic events to the card's onClick, which opened the edit dialog before
the delete confirmation appeared. Add e.stopPropagation() to every menu
item (matching the skill card pattern).
* fix(mcp): stop Refresh Tools from submitting/closing the config dialog
The Refresh Tools button lived inside the <form> and, like all buttons
without an explicit type, defaulted to type="submit" — clicking it ran the
form submit (save + close) instead of just refreshing. Set type="button".
Also per UX: while refreshing, the button is disabled with a spinning icon,
the per-tool enable/disable switches are disabled, and the success toast is
removed — the button reverting to its idle state is the success signal
(keep the error toast for failures).
* test(mcp): provide explicit redirectUri in McpOauthProvider test helper
* fix(mcp): scope tool registry to agent-assigned servers
The MCP tool registry was a process-global singleton keyed by server id,
so a chat agent could search, describe, and even call tools belonging to
MCP servers that were not assigned to it (e.g. disabled or unassigned
servers), as long as their metadata had been discovered at some point in
the process. This mirrors the disabled-skill bug: the read path never
checked per-agent enablement.
Replace the singleton with a fresh McpToolRegistry built per
buildAgentTools call and warmed from the persisted McpServer.tools DB
cache. Because the registry only ever contains the agent's assigned
servers, unassigned/disabled servers can neither be suggested, searched,
described, nor executed. Live discovery (lazy connect / connect action)
writes into the per-agent registry via ensureConnected(serverId,
registry?).
Adds test-first coverage: suggestions, search, describe and tool-call
leaks across an unassigned same-team server, staleness after
unassignment, and direct-tools scoping.
* feat(mcp): capture and surface server instructions + server-level refresh (#293)
* feat(mcp): capture and surface server instructions
- Add McpServer.instructions column, populated from getInstructions() at
connect time (legacy initialize + modern discover results)
- Surface instructions at three levels like pi-mcp-adapter: truncated
snippet in the mcp proxy tool description, preview in server listings,
and full text via mcp({ instructions: "name" })
- Fix misleading mcp({ server, connect }) usage line to mcp({ connect })
- Share one renderServerListing helper across list and connect modes
- Expose instructions in McpServerInfo DTO and WebUI config card
- Test server supports instructions; service + API tests updated
* refactor(mcp): server-level refresh endpoint, drop agent connect mode
- Replace POST /mcp/servers/:id/tools/refresh with POST /mcp/servers/:id/refresh
returning the refreshed McpServerInfo (server-level, not tools-level)
- Add McpService.refreshServer(): force-close the connection, re-discover and
persist tools, instructions, name/description and status; used by the refresh
endpoint, Test Connection, and post-OAuth completion (replacing discoverTools)
- Remove discoverTools entirely - refreshServer is the single discovery entry
point (testServer and completeAuth route through it)
- Remove refreshTools from UpdateMcpServerRequest/PATCH (dead param)
- Remove mcp({ connect: "name" }) from the agent proxy tool: lazy tool calls
still auto-connect, so agents are unaffected
- WebUI: remove the dialog 'Refresh Tools' button and create-mode background
auto-refresh; add a server-level Refresh button at the left end of the edit
dialog footer; i18n mcp_refresh_server (+ success message)
* feat(mcp): add in-flight request tracking and idle connection cleanup (#294)
* feat(mcp): add in-flight request tracking and idle connection cleanup
* feat(mcp): add background idle cleanup timer to McpService
* feat(mcp): update default background idle cleanup check interval to 30s
* feat(webui): improve MCP server card footer, instructions, and refresh dialog freeze (#295)
* feat(webui): improve MCP server list card, instructions dialog, and refresh freeze UI
* feat(webui): refine MCP card action menu items
* docs(webui): update direct tools mode description in i18n messages
* style(webui): refine Direct Tools Mode layout in MCP server config dialog
* feat(webui): remove tool search box from MCP server config dialog
* fix(mcp): make in-flight idle tracking test deterministic
The 'tracks in-flight requests and safely prunes idle connections' test
relied on a wall-clock sleep (10ms) to guess when the tool handler had
started executing on the server. On slow/loaded CI runners the HTTP round
trip through the real MCP client/server stack can exceed that window, so
resolveSlowTool() fired the no-op placeholder, the gated handler never
completed, and callPromise hung until the 5000ms test timeout.
The handler now signals via a deferred promise when it actually starts,
and the test awaits that signal (racing it against the call promise to
surface early failures) before asserting in-flight state and releasing
the gate. Also gives the test an explicit 10s timeout.
758 lines
19 KiB
TypeScript
Generated
758 lines
19 KiB
TypeScript
Generated
|
|
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
|
/* eslint-disable */
|
|
// biome-ignore-all lint: generated file
|
|
// @ts-nocheck
|
|
/*
|
|
* WARNING: This is an internal file that is subject to change!
|
|
*
|
|
* 🛑 Under no circumstances should you import this file directly! 🛑
|
|
*
|
|
* All exports from this file are wrapped under a `Prisma` namespace object in the browser.ts file.
|
|
* While this enables partial backward compatibility, it is not part of the stable public API.
|
|
*
|
|
* If you are looking for your Models, Enums, and Input Types, please import them from the respective
|
|
* model files in the `model` directory!
|
|
*/
|
|
|
|
import * as runtime from "@prisma/client/runtime/index-browser"
|
|
|
|
export type * from '../models.ts'
|
|
export type * from './prismaNamespace.ts'
|
|
|
|
export const Decimal = runtime.Decimal
|
|
|
|
|
|
export const NullTypes = {
|
|
DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull),
|
|
JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull),
|
|
AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull),
|
|
}
|
|
/**
|
|
* Helper for filtering JSON entries that have `null` on the database (empty on the db)
|
|
*
|
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
*/
|
|
export const DbNull = runtime.DbNull
|
|
|
|
/**
|
|
* Helper for filtering JSON entries that have JSON `null` values (not empty on the db)
|
|
*
|
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
*/
|
|
export const JsonNull = runtime.JsonNull
|
|
|
|
/**
|
|
* Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull`
|
|
*
|
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
*/
|
|
export const AnyNull = runtime.AnyNull
|
|
|
|
|
|
export const ModelName = {
|
|
User: 'User',
|
|
Session: 'Session',
|
|
Account: 'Account',
|
|
Verification: 'Verification',
|
|
AuthToken: 'AuthToken',
|
|
Team: 'Team',
|
|
Sandbox: 'Sandbox',
|
|
Skill: 'Skill',
|
|
TeamMember: 'TeamMember',
|
|
Project: 'Project',
|
|
ProjectMember: 'ProjectMember',
|
|
ShareLink: 'ShareLink',
|
|
WatermarkConfig: 'WatermarkConfig',
|
|
WatermarkTemplate: 'WatermarkTemplate',
|
|
WatermarkFile: 'WatermarkFile',
|
|
Asset: 'Asset',
|
|
StorageKey: 'StorageKey',
|
|
AssetMetadataValue: 'AssetMetadataValue',
|
|
AssetComment: 'AssetComment',
|
|
AssetCommentAttachment: 'AssetCommentAttachment',
|
|
AssetEmbedding: 'AssetEmbedding',
|
|
Invite: 'Invite',
|
|
MetadataField: 'MetadataField',
|
|
Notification: 'Notification',
|
|
SystemSettings: 'SystemSettings',
|
|
Task: 'Task',
|
|
WorkflowTask: 'WorkflowTask',
|
|
Agent: 'Agent',
|
|
AgentSkill: 'AgentSkill',
|
|
McpServer: 'McpServer',
|
|
AgentMcpServer: 'AgentMcpServer',
|
|
McpServerCredential: 'McpServerCredential',
|
|
AgentSession: 'AgentSession',
|
|
AgentSessionEntry: 'AgentSessionEntry',
|
|
UserMetadata: 'UserMetadata',
|
|
Model: 'Model',
|
|
Provider: 'Provider',
|
|
Collection: 'Collection',
|
|
ApiToken: 'ApiToken',
|
|
AiUsage: 'AiUsage',
|
|
AuditLog: 'AuditLog'
|
|
} as const
|
|
|
|
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
|
|
|
|
/*
|
|
* Enums
|
|
*/
|
|
|
|
export const TransactionIsolationLevel = runtime.makeStrictEnum({
|
|
ReadUncommitted: 'ReadUncommitted',
|
|
ReadCommitted: 'ReadCommitted',
|
|
RepeatableRead: 'RepeatableRead',
|
|
Serializable: 'Serializable'
|
|
} as const)
|
|
|
|
export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel]
|
|
|
|
|
|
export const UserScalarFieldEnum = {
|
|
id: 'id',
|
|
type: 'type',
|
|
name: 'name',
|
|
email: 'email',
|
|
emailVerified: 'emailVerified',
|
|
image: 'image',
|
|
password: 'password',
|
|
agentSettings: 'agentSettings',
|
|
guestEmail: 'guestEmail',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum]
|
|
|
|
|
|
export const SessionScalarFieldEnum = {
|
|
id: 'id',
|
|
expiresAt: 'expiresAt',
|
|
token: 'token',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
ipAddress: 'ipAddress',
|
|
userAgent: 'userAgent',
|
|
userId: 'userId'
|
|
} as const
|
|
|
|
export type SessionScalarFieldEnum = (typeof SessionScalarFieldEnum)[keyof typeof SessionScalarFieldEnum]
|
|
|
|
|
|
export const AccountScalarFieldEnum = {
|
|
id: 'id',
|
|
accountId: 'accountId',
|
|
providerId: 'providerId',
|
|
userId: 'userId',
|
|
accessToken: 'accessToken',
|
|
refreshToken: 'refreshToken',
|
|
idToken: 'idToken',
|
|
accessTokenExpiresAt: 'accessTokenExpiresAt',
|
|
refreshTokenExpiresAt: 'refreshTokenExpiresAt',
|
|
scope: 'scope',
|
|
password: 'password',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type AccountScalarFieldEnum = (typeof AccountScalarFieldEnum)[keyof typeof AccountScalarFieldEnum]
|
|
|
|
|
|
export const VerificationScalarFieldEnum = {
|
|
id: 'id',
|
|
identifier: 'identifier',
|
|
value: 'value',
|
|
expiresAt: 'expiresAt',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type VerificationScalarFieldEnum = (typeof VerificationScalarFieldEnum)[keyof typeof VerificationScalarFieldEnum]
|
|
|
|
|
|
export const AuthTokenScalarFieldEnum = {
|
|
id: 'id',
|
|
accessToken: 'accessToken',
|
|
refreshToken: 'refreshToken',
|
|
accessTokenExpiresAt: 'accessTokenExpiresAt',
|
|
refreshTokenExpiresAt: 'refreshTokenExpiresAt',
|
|
userId: 'userId'
|
|
} as const
|
|
|
|
export type AuthTokenScalarFieldEnum = (typeof AuthTokenScalarFieldEnum)[keyof typeof AuthTokenScalarFieldEnum]
|
|
|
|
|
|
export const TeamScalarFieldEnum = {
|
|
id: 'id',
|
|
name: 'name',
|
|
settings: 'settings',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
rootFolderId: 'rootFolderId'
|
|
} as const
|
|
|
|
export type TeamScalarFieldEnum = (typeof TeamScalarFieldEnum)[keyof typeof TeamScalarFieldEnum]
|
|
|
|
|
|
export const SandboxScalarFieldEnum = {
|
|
id: 'id',
|
|
allowedDomains: 'allowedDomains',
|
|
pendingDomains: 'pendingDomains',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
teamId: 'teamId'
|
|
} as const
|
|
|
|
export type SandboxScalarFieldEnum = (typeof SandboxScalarFieldEnum)[keyof typeof SandboxScalarFieldEnum]
|
|
|
|
|
|
export const SkillScalarFieldEnum = {
|
|
id: 'id',
|
|
name: 'name',
|
|
description: 'description',
|
|
config: 'config',
|
|
assetId: 'assetId',
|
|
hash: 'hash',
|
|
permission: 'permission',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
teamId: 'teamId'
|
|
} as const
|
|
|
|
export type SkillScalarFieldEnum = (typeof SkillScalarFieldEnum)[keyof typeof SkillScalarFieldEnum]
|
|
|
|
|
|
export const TeamMemberScalarFieldEnum = {
|
|
id: 'id',
|
|
role: 'role',
|
|
scope: 'scope',
|
|
teamId: 'teamId',
|
|
userId: 'userId',
|
|
lastReadNotificationId: 'lastReadNotificationId'
|
|
} as const
|
|
|
|
export type TeamMemberScalarFieldEnum = (typeof TeamMemberScalarFieldEnum)[keyof typeof TeamMemberScalarFieldEnum]
|
|
|
|
|
|
export const ProjectScalarFieldEnum = {
|
|
id: 'id',
|
|
name: 'name',
|
|
coverImageKey: 'coverImageKey',
|
|
metadataOverrides: 'metadataOverrides',
|
|
enableNotification: 'enableNotification',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
teamId: 'teamId',
|
|
rootFolderId: 'rootFolderId',
|
|
shareRootId: 'shareRootId'
|
|
} as const
|
|
|
|
export type ProjectScalarFieldEnum = (typeof ProjectScalarFieldEnum)[keyof typeof ProjectScalarFieldEnum]
|
|
|
|
|
|
export const ProjectMemberScalarFieldEnum = {
|
|
id: 'id',
|
|
role: 'role',
|
|
projectId: 'projectId',
|
|
teamMemberId: 'teamMemberId'
|
|
} as const
|
|
|
|
export type ProjectMemberScalarFieldEnum = (typeof ProjectMemberScalarFieldEnum)[keyof typeof ProjectMemberScalarFieldEnum]
|
|
|
|
|
|
export const ShareLinkScalarFieldEnum = {
|
|
id: 'id',
|
|
name: 'name',
|
|
expireAt: 'expireAt',
|
|
password: 'password',
|
|
isDisabled: 'isDisabled',
|
|
allowDownload: 'allowDownload',
|
|
defaultSortOrder: 'defaultSortOrder',
|
|
viewMode: 'viewMode',
|
|
fieldVisibility: 'fieldVisibility',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
projectId: 'projectId',
|
|
rootFolderId: 'rootFolderId',
|
|
creatorId: 'creatorId',
|
|
watermarkConfigId: 'watermarkConfigId',
|
|
watermarkStatus: 'watermarkStatus'
|
|
} as const
|
|
|
|
export type ShareLinkScalarFieldEnum = (typeof ShareLinkScalarFieldEnum)[keyof typeof ShareLinkScalarFieldEnum]
|
|
|
|
|
|
export const WatermarkConfigScalarFieldEnum = {
|
|
id: 'id',
|
|
config: 'config',
|
|
hash: 'hash',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type WatermarkConfigScalarFieldEnum = (typeof WatermarkConfigScalarFieldEnum)[keyof typeof WatermarkConfigScalarFieldEnum]
|
|
|
|
|
|
export const WatermarkTemplateScalarFieldEnum = {
|
|
id: 'id',
|
|
name: 'name',
|
|
config: 'config',
|
|
teamId: 'teamId',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type WatermarkTemplateScalarFieldEnum = (typeof WatermarkTemplateScalarFieldEnum)[keyof typeof WatermarkTemplateScalarFieldEnum]
|
|
|
|
|
|
export const WatermarkFileScalarFieldEnum = {
|
|
id: 'id',
|
|
assetId: 'assetId',
|
|
watermarkConfigId: 'watermarkConfigId',
|
|
media: 'media',
|
|
status: 'status',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type WatermarkFileScalarFieldEnum = (typeof WatermarkFileScalarFieldEnum)[keyof typeof WatermarkFileScalarFieldEnum]
|
|
|
|
|
|
export const AssetScalarFieldEnum = {
|
|
id: 'id',
|
|
name: 'name',
|
|
nameNgram: 'nameNgram',
|
|
type: 'type',
|
|
mediaType: 'mediaType',
|
|
fileCount: 'fileCount',
|
|
sizeByte: 'sizeByte',
|
|
status: 'status',
|
|
transcodeTaskId: 'transcodeTaskId',
|
|
media: 'media',
|
|
autofillContext: 'autofillContext',
|
|
isDeleted: 'isDeleted',
|
|
deletedAt: 'deletedAt',
|
|
sortIndex: 'sortIndex',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
parentId: 'parentId',
|
|
targetId: 'targetId',
|
|
storageKeyId: 'storageKeyId',
|
|
creatorId: 'creatorId',
|
|
taskId: 'taskId',
|
|
projectId: 'projectId'
|
|
} as const
|
|
|
|
export type AssetScalarFieldEnum = (typeof AssetScalarFieldEnum)[keyof typeof AssetScalarFieldEnum]
|
|
|
|
|
|
export const StorageKeyScalarFieldEnum = {
|
|
id: 'id',
|
|
key: 'key',
|
|
status: 'status',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type StorageKeyScalarFieldEnum = (typeof StorageKeyScalarFieldEnum)[keyof typeof StorageKeyScalarFieldEnum]
|
|
|
|
|
|
export const AssetMetadataValueScalarFieldEnum = {
|
|
id: 'id',
|
|
assetId: 'assetId',
|
|
fieldKey: 'fieldKey',
|
|
stringValue: 'stringValue',
|
|
numberValue: 'numberValue',
|
|
booleanValue: 'booleanValue',
|
|
jsonValue: 'jsonValue',
|
|
dateValue: 'dateValue'
|
|
} as const
|
|
|
|
export type AssetMetadataValueScalarFieldEnum = (typeof AssetMetadataValueScalarFieldEnum)[keyof typeof AssetMetadataValueScalarFieldEnum]
|
|
|
|
|
|
export const AssetCommentScalarFieldEnum = {
|
|
id: 'id',
|
|
message: 'message',
|
|
annotation: 'annotation',
|
|
second: 'second',
|
|
sessionId: 'sessionId',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
assetId: 'assetId',
|
|
creatorId: 'creatorId',
|
|
isCompleted: 'isCompleted',
|
|
completionLastChangedById: 'completionLastChangedById',
|
|
replyToId: 'replyToId'
|
|
} as const
|
|
|
|
export type AssetCommentScalarFieldEnum = (typeof AssetCommentScalarFieldEnum)[keyof typeof AssetCommentScalarFieldEnum]
|
|
|
|
|
|
export const AssetCommentAttachmentScalarFieldEnum = {
|
|
id: 'id',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
commentId: 'commentId',
|
|
assetId: 'assetId'
|
|
} as const
|
|
|
|
export type AssetCommentAttachmentScalarFieldEnum = (typeof AssetCommentAttachmentScalarFieldEnum)[keyof typeof AssetCommentAttachmentScalarFieldEnum]
|
|
|
|
|
|
export const AssetEmbeddingScalarFieldEnum = {
|
|
id: 'id',
|
|
startTime: 'startTime',
|
|
endTime: 'endTime',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
assetId: 'assetId'
|
|
} as const
|
|
|
|
export type AssetEmbeddingScalarFieldEnum = (typeof AssetEmbeddingScalarFieldEnum)[keyof typeof AssetEmbeddingScalarFieldEnum]
|
|
|
|
|
|
export const InviteScalarFieldEnum = {
|
|
id: 'id',
|
|
code: 'code',
|
|
role: 'role',
|
|
used: 'used',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
teamId: 'teamId',
|
|
projectId: 'projectId',
|
|
inviterId: 'inviterId'
|
|
} as const
|
|
|
|
export type InviteScalarFieldEnum = (typeof InviteScalarFieldEnum)[keyof typeof InviteScalarFieldEnum]
|
|
|
|
|
|
export const MetadataFieldScalarFieldEnum = {
|
|
id: 'id',
|
|
key: 'key',
|
|
scope: 'scope',
|
|
config: 'config',
|
|
readOnly: 'readOnly',
|
|
aiAutofill: 'aiAutofill',
|
|
description: 'description',
|
|
teamId: 'teamId',
|
|
projectId: 'projectId'
|
|
} as const
|
|
|
|
export type MetadataFieldScalarFieldEnum = (typeof MetadataFieldScalarFieldEnum)[keyof typeof MetadataFieldScalarFieldEnum]
|
|
|
|
|
|
export const NotificationScalarFieldEnum = {
|
|
id: 'id',
|
|
type: 'type',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
teamId: 'teamId',
|
|
projectId: 'projectId',
|
|
creatorId: 'creatorId',
|
|
assetId: 'assetId',
|
|
taskId: 'taskId',
|
|
userId: 'userId'
|
|
} as const
|
|
|
|
export type NotificationScalarFieldEnum = (typeof NotificationScalarFieldEnum)[keyof typeof NotificationScalarFieldEnum]
|
|
|
|
|
|
export const SystemSettingsScalarFieldEnum = {
|
|
id: 'id',
|
|
key: 'key',
|
|
value: 'value',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type SystemSettingsScalarFieldEnum = (typeof SystemSettingsScalarFieldEnum)[keyof typeof SystemSettingsScalarFieldEnum]
|
|
|
|
|
|
export const TaskScalarFieldEnum = {
|
|
id: 'id',
|
|
type: 'type',
|
|
status: 'status',
|
|
name: 'name',
|
|
total: 'total',
|
|
uploaded: 'uploaded',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
creatorId: 'creatorId'
|
|
} as const
|
|
|
|
export type TaskScalarFieldEnum = (typeof TaskScalarFieldEnum)[keyof typeof TaskScalarFieldEnum]
|
|
|
|
|
|
export const WorkflowTaskScalarFieldEnum = {
|
|
id: 'id',
|
|
uid: 'uid',
|
|
teamId: 'teamId',
|
|
projectId: 'projectId',
|
|
assetId: 'assetId',
|
|
type: 'type',
|
|
status: 'status',
|
|
payload: 'payload',
|
|
output: 'output',
|
|
heartbeat: 'heartbeat',
|
|
inputTokens: 'inputTokens',
|
|
outputTokens: 'outputTokens',
|
|
model: 'model',
|
|
sessionId: 'sessionId',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type WorkflowTaskScalarFieldEnum = (typeof WorkflowTaskScalarFieldEnum)[keyof typeof WorkflowTaskScalarFieldEnum]
|
|
|
|
|
|
export const AgentScalarFieldEnum = {
|
|
id: 'id',
|
|
type: 'type',
|
|
enabled: 'enabled',
|
|
soul: 'soul',
|
|
providerId: 'providerId',
|
|
modelId: 'modelId',
|
|
teamId: 'teamId',
|
|
config: 'config',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type AgentScalarFieldEnum = (typeof AgentScalarFieldEnum)[keyof typeof AgentScalarFieldEnum]
|
|
|
|
|
|
export const AgentSkillScalarFieldEnum = {
|
|
id: 'id',
|
|
agentId: 'agentId',
|
|
skillId: 'skillId',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type AgentSkillScalarFieldEnum = (typeof AgentSkillScalarFieldEnum)[keyof typeof AgentSkillScalarFieldEnum]
|
|
|
|
|
|
export const McpServerScalarFieldEnum = {
|
|
id: 'id',
|
|
name: 'name',
|
|
description: 'description',
|
|
instructions: 'instructions',
|
|
url: 'url',
|
|
transport: 'transport',
|
|
authConfig: 'authConfig',
|
|
config: 'config',
|
|
permission: 'permission',
|
|
tools: 'tools',
|
|
status: 'status',
|
|
lastError: 'lastError',
|
|
lastConnectedAt: 'lastConnectedAt',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
teamId: 'teamId'
|
|
} as const
|
|
|
|
export type McpServerScalarFieldEnum = (typeof McpServerScalarFieldEnum)[keyof typeof McpServerScalarFieldEnum]
|
|
|
|
|
|
export const AgentMcpServerScalarFieldEnum = {
|
|
id: 'id',
|
|
agentId: 'agentId',
|
|
mcpServerId: 'mcpServerId',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type AgentMcpServerScalarFieldEnum = (typeof AgentMcpServerScalarFieldEnum)[keyof typeof AgentMcpServerScalarFieldEnum]
|
|
|
|
|
|
export const McpServerCredentialScalarFieldEnum = {
|
|
id: 'id',
|
|
serverId: 'serverId',
|
|
serverUrl: 'serverUrl',
|
|
tokens: 'tokens',
|
|
clientInfo: 'clientInfo',
|
|
codeVerifier: 'codeVerifier',
|
|
oauthState: 'oauthState',
|
|
pendingAuth: 'pendingAuth',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type McpServerCredentialScalarFieldEnum = (typeof McpServerCredentialScalarFieldEnum)[keyof typeof McpServerCredentialScalarFieldEnum]
|
|
|
|
|
|
export const AgentSessionScalarFieldEnum = {
|
|
id: 'id',
|
|
agentId: 'agentId',
|
|
userId: 'userId',
|
|
cwd: 'cwd',
|
|
leafId: 'leafId',
|
|
assetId: 'assetId',
|
|
userCommentId: 'userCommentId',
|
|
type: 'type',
|
|
name: 'name',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type AgentSessionScalarFieldEnum = (typeof AgentSessionScalarFieldEnum)[keyof typeof AgentSessionScalarFieldEnum]
|
|
|
|
|
|
export const AgentSessionEntryScalarFieldEnum = {
|
|
id: 'id',
|
|
sessionId: 'sessionId',
|
|
assetId: 'assetId',
|
|
type: 'type',
|
|
parentId: 'parentId',
|
|
data: 'data',
|
|
createdAt: 'createdAt'
|
|
} as const
|
|
|
|
export type AgentSessionEntryScalarFieldEnum = (typeof AgentSessionEntryScalarFieldEnum)[keyof typeof AgentSessionEntryScalarFieldEnum]
|
|
|
|
|
|
export const UserMetadataScalarFieldEnum = {
|
|
id: 'id',
|
|
key: 'key',
|
|
value: 'value',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
userId: 'userId',
|
|
teamId: 'teamId'
|
|
} as const
|
|
|
|
export type UserMetadataScalarFieldEnum = (typeof UserMetadataScalarFieldEnum)[keyof typeof UserMetadataScalarFieldEnum]
|
|
|
|
|
|
export const ModelScalarFieldEnum = {
|
|
id: 'id',
|
|
modelId: 'modelId',
|
|
name: 'name',
|
|
config: 'config',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
providerId: 'providerId'
|
|
} as const
|
|
|
|
export type ModelScalarFieldEnum = (typeof ModelScalarFieldEnum)[keyof typeof ModelScalarFieldEnum]
|
|
|
|
|
|
export const ProviderScalarFieldEnum = {
|
|
id: 'id',
|
|
name: 'name',
|
|
isBuiltin: 'isBuiltin',
|
|
config: 'config',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
teamId: 'teamId'
|
|
} as const
|
|
|
|
export type ProviderScalarFieldEnum = (typeof ProviderScalarFieldEnum)[keyof typeof ProviderScalarFieldEnum]
|
|
|
|
|
|
export const CollectionScalarFieldEnum = {
|
|
id: 'id',
|
|
name: 'name',
|
|
filter: 'filter',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt',
|
|
projectId: 'projectId',
|
|
creatorId: 'creatorId'
|
|
} as const
|
|
|
|
export type CollectionScalarFieldEnum = (typeof CollectionScalarFieldEnum)[keyof typeof CollectionScalarFieldEnum]
|
|
|
|
|
|
export const ApiTokenScalarFieldEnum = {
|
|
id: 'id',
|
|
token: 'token',
|
|
name: 'name',
|
|
userId: 'userId',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type ApiTokenScalarFieldEnum = (typeof ApiTokenScalarFieldEnum)[keyof typeof ApiTokenScalarFieldEnum]
|
|
|
|
|
|
export const AiUsageScalarFieldEnum = {
|
|
id: 'id',
|
|
teamId: 'teamId',
|
|
userId: 'userId',
|
|
periodStart: 'periodStart',
|
|
inputTokens: 'inputTokens',
|
|
outputTokens: 'outputTokens',
|
|
cacheReadTokens: 'cacheReadTokens',
|
|
totalTokens: 'totalTokens',
|
|
cost: 'cost',
|
|
createdAt: 'createdAt',
|
|
updatedAt: 'updatedAt'
|
|
} as const
|
|
|
|
export type AiUsageScalarFieldEnum = (typeof AiUsageScalarFieldEnum)[keyof typeof AiUsageScalarFieldEnum]
|
|
|
|
|
|
export const AuditLogScalarFieldEnum = {
|
|
id: 'id',
|
|
action: 'action',
|
|
teamId: 'teamId',
|
|
userId: 'userId',
|
|
projectId: 'projectId',
|
|
itemId: 'itemId',
|
|
createdAt: 'createdAt'
|
|
} as const
|
|
|
|
export type AuditLogScalarFieldEnum = (typeof AuditLogScalarFieldEnum)[keyof typeof AuditLogScalarFieldEnum]
|
|
|
|
|
|
export const SortOrder = {
|
|
asc: 'asc',
|
|
desc: 'desc'
|
|
} as const
|
|
|
|
export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]
|
|
|
|
|
|
export const NullableJsonNullValueInput = {
|
|
DbNull: DbNull,
|
|
JsonNull: JsonNull
|
|
} as const
|
|
|
|
export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput]
|
|
|
|
|
|
export const JsonNullValueInput = {
|
|
JsonNull: JsonNull
|
|
} as const
|
|
|
|
export type JsonNullValueInput = (typeof JsonNullValueInput)[keyof typeof JsonNullValueInput]
|
|
|
|
|
|
export const QueryMode = {
|
|
default: 'default',
|
|
insensitive: 'insensitive'
|
|
} as const
|
|
|
|
export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]
|
|
|
|
|
|
export const JsonNullValueFilter = {
|
|
DbNull: DbNull,
|
|
JsonNull: JsonNull,
|
|
AnyNull: AnyNull
|
|
} as const
|
|
|
|
export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter]
|
|
|
|
|
|
export const NullsOrder = {
|
|
first: 'first',
|
|
last: 'last'
|
|
} as const
|
|
|
|
export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder]
|
|
|