From a13fe36aa6af4b74b3e21c3af23d3c57b4f5d304 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 13 Jul 2025 09:15:54 +0800 Subject: [PATCH] Update dependencies in go.mod and go.sum to latest versions for improved stability and performance --- audit/README.md | 1 + kb/README.md | 1 + mcp/README.md | 1 + openapi/README.md | 9 + openapi/agent/agent.go | 1 + openapi/audit/audit.go | 3 + openapi/job/job.go | 1 + openapi/kb/kb.go | 1 + openapi/oauth/oauth.go | 1 + yao/models/assistant.mod.yao | 224 +++++++++++++++++++++++++ yao/models/attachment.mod.yao | 202 ++++++++++++++++++++++ yao/models/audit.mod.yao | 307 ++++++++++++++++++++++++++++++++++ yao/models/chat.mod.yao | 85 ++++++++++ yao/models/config.mod.yao | 92 ++++++++++ yao/models/history.mod.yao | 162 ++++++++++++++++++ yao/models/kb.mod.yao | 152 +++++++++++++++++ yao/models/mcp.mod.yao | 134 +++++++++++++++ 17 files changed, 1377 insertions(+) create mode 100644 audit/README.md create mode 100644 kb/README.md create mode 100644 mcp/README.md create mode 100644 openapi/README.md create mode 100644 openapi/agent/agent.go create mode 100644 openapi/audit/audit.go create mode 100644 openapi/job/job.go create mode 100644 openapi/kb/kb.go create mode 100644 openapi/oauth/oauth.go create mode 100644 yao/models/assistant.mod.yao create mode 100644 yao/models/attachment.mod.yao create mode 100644 yao/models/audit.mod.yao create mode 100644 yao/models/chat.mod.yao create mode 100644 yao/models/config.mod.yao create mode 100644 yao/models/history.mod.yao create mode 100644 yao/models/kb.mod.yao create mode 100644 yao/models/mcp.mod.yao diff --git a/audit/README.md b/audit/README.md new file mode 100644 index 00000000..7366301b --- /dev/null +++ b/audit/README.md @@ -0,0 +1 @@ +# Audit Log diff --git a/kb/README.md b/kb/README.md new file mode 100644 index 00000000..8dc96371 --- /dev/null +++ b/kb/README.md @@ -0,0 +1 @@ +# Knowledge Base diff --git a/mcp/README.md b/mcp/README.md new file mode 100644 index 00000000..9f07bf89 --- /dev/null +++ b/mcp/README.md @@ -0,0 +1 @@ +# MCP Client diff --git a/openapi/README.md b/openapi/README.md new file mode 100644 index 00000000..0c3e62ff --- /dev/null +++ b/openapi/README.md @@ -0,0 +1,9 @@ +# Yao OpenAPI + +## OAuth + +## Agent + +## Knowledge Base + +## Audit Log diff --git a/openapi/agent/agent.go b/openapi/agent/agent.go new file mode 100644 index 00000000..48831554 --- /dev/null +++ b/openapi/agent/agent.go @@ -0,0 +1 @@ +package agent diff --git a/openapi/audit/audit.go b/openapi/audit/audit.go new file mode 100644 index 00000000..1d5ce8bc --- /dev/null +++ b/openapi/audit/audit.go @@ -0,0 +1,3 @@ +package audit + +// Audit Log diff --git a/openapi/job/job.go b/openapi/job/job.go new file mode 100644 index 00000000..8d7765aa --- /dev/null +++ b/openapi/job/job.go @@ -0,0 +1 @@ +package job diff --git a/openapi/kb/kb.go b/openapi/kb/kb.go new file mode 100644 index 00000000..b310b909 --- /dev/null +++ b/openapi/kb/kb.go @@ -0,0 +1 @@ +package kb diff --git a/openapi/oauth/oauth.go b/openapi/oauth/oauth.go new file mode 100644 index 00000000..c90af7b3 --- /dev/null +++ b/openapi/oauth/oauth.go @@ -0,0 +1 @@ +package oauth diff --git a/yao/models/assistant.mod.yao b/yao/models/assistant.mod.yao new file mode 100644 index 00000000..1022aee7 --- /dev/null +++ b/yao/models/assistant.mod.yao @@ -0,0 +1,224 @@ +{ + "name": "assistant", + "label": "Assistant", + "description": "Assistant table for storing AI assistant configurations and metadata", + "table": { + "name": "assistant", + "comment": "Assistant table" + }, + "columns": [ + { + "name": "id", + "type": "ID", + "label": "Assistant ID", + "comment": "Unique assistant identifier" + }, + { + "name": "assistant_id", + "type": "string", + "label": "Assistant ID", + "comment": "Assistant identifier", + "length": 200, + "nullable": false, + "unique": true, + "index": true + }, + { + "name": "type", + "type": "string", + "label": "Type", + "comment": "Assistant type", + "length": 200, + "default": "assistant", + "index": true + }, + { + "name": "name", + "type": "string", + "label": "Name", + "comment": "Assistant name", + "length": 200, + "nullable": true + }, + { + "name": "avatar", + "type": "string", + "label": "Avatar", + "comment": "Assistant avatar URL", + "length": 200, + "nullable": true + }, + { + "name": "connector", + "type": "string", + "label": "Connector", + "comment": "Assistant connector", + "length": 200, + "nullable": false + }, + { + "name": "description", + "type": "string", + "label": "Description", + "comment": "Assistant description", + "length": 600, + "nullable": true, + "index": true + }, + { + "name": "path", + "type": "string", + "label": "Path", + "comment": "Assistant storage path", + "length": 200, + "nullable": true + }, + { + "name": "sort", + "type": "integer", + "label": "Sort", + "comment": "Assistant sort order", + "default": 9999, + "index": true + }, + { + "name": "built_in", + "type": "boolean", + "label": "Built In", + "comment": "Whether this is a built-in assistant", + "default": false, + "index": true + }, + { + "name": "placeholder", + "type": "json", + "label": "Placeholder", + "comment": "Assistant placeholder", + "nullable": true + }, + { + "name": "options", + "type": "json", + "label": "Options", + "comment": "Assistant options", + "nullable": true + }, + { + "name": "prompts", + "type": "json", + "label": "Prompts", + "comment": "Assistant prompts", + "nullable": true + }, + { + "name": "workflow", + "type": "json", + "label": "Workflow", + "comment": "Assistant workflow", + "nullable": true + }, + { + "name": "knowledge", + "type": "json", + "label": "Knowledge", + "comment": "Assistant knowledge", + "nullable": true + }, + { + "name": "tools", + "type": "json", + "label": "Tools", + "comment": "Assistant tools", + "nullable": true + }, + { + "name": "tags", + "type": "json", + "label": "Tags", + "comment": "Assistant tags", + "nullable": true + }, + { + "name": "readonly", + "type": "boolean", + "label": "Readonly", + "comment": "Assistant readonly status", + "default": false, + "index": true + }, + { + "name": "permissions", + "type": "json", + "label": "Permissions", + "comment": "Assistant permissions", + "nullable": true + }, + { + "name": "locales", + "type": "json", + "label": "Locales", + "comment": "Assistant i18n locales", + "nullable": true + }, + { + "name": "automated", + "type": "boolean", + "label": "Automated", + "comment": "Assistant automated status", + "default": true, + "index": true + }, + { + "name": "mentionable", + "type": "boolean", + "label": "Mentionable", + "comment": "Whether this assistant can appear in @ mention list", + "default": true, + "index": true + } + ], + "relations": {}, + "indexes": [ + { + "name": "idx_assistant_id", + "columns": ["assistant_id"], + "type": "unique" + }, + { + "name": "idx_type", + "columns": ["type"], + "type": "index" + }, + { + "name": "idx_description", + "columns": ["description"], + "type": "index" + }, + { + "name": "idx_sort", + "columns": ["sort"], + "type": "index" + }, + { + "name": "idx_built_in", + "columns": ["built_in"], + "type": "index" + }, + { + "name": "idx_readonly", + "columns": ["readonly"], + "type": "index" + }, + { + "name": "idx_automated", + "columns": ["automated"], + "type": "index" + }, + { + "name": "idx_mentionable", + "columns": ["mentionable"], + "type": "index" + } + ], + "option": { "timestamps": true, "soft_deletes": false } +} diff --git a/yao/models/attachment.mod.yao b/yao/models/attachment.mod.yao new file mode 100644 index 00000000..e11adcf6 --- /dev/null +++ b/yao/models/attachment.mod.yao @@ -0,0 +1,202 @@ +{ + "name": "attachment", + "label": "Attachment", + "description": "Attachment table for storing file attachments with metadata and access control", + "table": { + "name": "attachment", + "comment": "Attachment table" + }, + "columns": [ + { + "name": "id", + "type": "ID", + "label": "Attachment ID", + "comment": "Unique attachment identifier" + }, + { + "name": "file_id", + "type": "string", + "label": "File ID", + "comment": "File identifier", + "length": 255, + "nullable": false, + "unique": true, + "index": true + }, + { + "name": "uid", + "type": "string", + "label": "User ID", + "comment": "User identifier", + "length": 255, + "nullable": false, + "index": true + }, + { + "name": "guest", + "type": "boolean", + "label": "Guest", + "comment": "Whether uploaded by guest user", + "default": false, + "index": true + }, + { + "name": "manager", + "type": "string", + "label": "Manager", + "comment": "File manager type", + "length": 200, + "nullable": false, + "index": true + }, + { + "name": "content_type", + "type": "string", + "label": "Content Type", + "comment": "File content type", + "length": 200, + "nullable": false, + "index": true + }, + { + "name": "name", + "type": "string", + "label": "Name", + "comment": "File name", + "length": 500, + "nullable": false, + "index": true + }, + { + "name": "public", + "type": "boolean", + "label": "Public", + "comment": "Whether file is public", + "default": false, + "index": true + }, + { + "name": "scope", + "type": "json", + "label": "Scope", + "comment": "File access scope", + "nullable": true + }, + { + "name": "gzip", + "type": "boolean", + "label": "Gzip", + "comment": "Whether file is gzipped", + "default": false, + "index": true + }, + { + "name": "bytes", + "type": "bigInteger", + "label": "Bytes", + "comment": "File size in bytes", + "nullable": false, + "index": true + }, + { + "name": "collection_id", + "type": "string", + "label": "Collection ID", + "comment": "Knowledge collection identifier", + "length": 200, + "nullable": true, + "index": true + }, + { + "name": "status", + "type": "enum", + "label": "Status", + "comment": "File processing status", + "option": [ + "uploading", + "uploaded", + "indexing", + "indexed", + "upload_failed", + "index_failed" + ], + "default": "uploading", + "index": true + }, + { + "name": "progress", + "type": "string", + "label": "Progress", + "comment": "Processing progress information", + "length": 200, + "nullable": true + }, + { + "name": "error", + "type": "string", + "label": "Error", + "comment": "Error information", + "length": 600, + "nullable": true + } + ], + "relations": {}, + "indexes": [ + { + "name": "idx_file_id", + "columns": ["file_id"], + "type": "unique" + }, + { + "name": "idx_uid", + "columns": ["uid"], + "type": "index" + }, + { + "name": "idx_guest", + "columns": ["guest"], + "type": "index" + }, + { + "name": "idx_manager", + "columns": ["manager"], + "type": "index" + }, + { + "name": "idx_content_type", + "columns": ["content_type"], + "type": "index" + }, + { + "name": "idx_name", + "columns": ["name"], + "type": "index" + }, + { + "name": "idx_public", + "columns": ["public"], + "type": "index" + }, + { + "name": "idx_gzip", + "columns": ["gzip"], + "type": "index" + }, + { + "name": "idx_bytes", + "columns": ["bytes"], + "type": "index" + }, + { + "name": "idx_collection_id", + "columns": ["collection_id"], + "type": "index" + }, + { + "name": "idx_status", + "columns": ["status"], + "type": "index" + } + ], + "option": { "timestamps": true, "soft_deletes": false } +} diff --git a/yao/models/audit.mod.yao b/yao/models/audit.mod.yao new file mode 100644 index 00000000..73e7788d --- /dev/null +++ b/yao/models/audit.mod.yao @@ -0,0 +1,307 @@ +{ + "name": "audit", + "label": "Audit Log", + "description": "Audit log table for storing system operation audit records", + "table": { + "name": "audit_log", + "comment": "Audit log table" + }, + "columns": [ + { + "name": "id", + "type": "ID", + "label": "Audit ID", + "comment": "Unique audit record identifier" + }, + { + "name": "event_id", + "type": "string", + "label": "Event ID", + "comment": "Unique event identifier for correlation", + "length": 100, + "nullable": true, + "index": true + }, + { + "name": "operation", + "type": "string", + "label": "Operation", + "comment": "Operation name (login, delete, modify, etc.)", + "length": 100, + "nullable": false, + "index": true + }, + { + "name": "category", + "type": "string", + "label": "Category", + "comment": "Audit category (authentication, authorization, data, system)", + "length": 50, + "nullable": true, + "index": true + }, + { + "name": "severity", + "type": "enum", + "label": "Severity", + "comment": "Event severity level", + "option": ["low", "medium", "high", "critical"], + "default": "medium", + "index": true + }, + { + "name": "user_id", + "type": "string", + "label": "User ID", + "comment": "User or service account identifier", + "length": 255, + "nullable": false, + "index": true + }, + { + "name": "user_name", + "type": "string", + "label": "User Name", + "comment": "User display name", + "length": 200, + "nullable": true + }, + { + "name": "session_id", + "type": "string", + "label": "Session ID", + "comment": "Session identifier", + "length": 255, + "nullable": true, + "index": true + }, + { + "name": "client_ip", + "type": "string", + "label": "Client IP", + "comment": "Client IP address", + "length": 45, + "nullable": true, + "index": true + }, + { + "name": "user_agent", + "type": "string", + "label": "User Agent", + "comment": "Client user agent information", + "length": 500, + "nullable": true + }, + { + "name": "target_resource", + "type": "string", + "label": "Target Resource", + "comment": "Target resource being operated on", + "length": 500, + "nullable": true, + "index": true + }, + { + "name": "resource_type", + "type": "string", + "label": "Resource Type", + "comment": "Type of resource (file, table, config, etc.)", + "length": 100, + "nullable": true, + "index": true + }, + { + "name": "source", + "type": "string", + "label": "Source", + "comment": "Operation source (UI, API, CLI, system)", + "length": 100, + "nullable": true, + "index": true + }, + { + "name": "application", + "type": "string", + "label": "Application", + "comment": "Application or service name", + "length": 100, + "nullable": true, + "index": true + }, + { + "name": "hostname", + "type": "string", + "label": "Hostname", + "comment": "Hostname of the operation source", + "length": 255, + "nullable": true + }, + { + "name": "success", + "type": "boolean", + "label": "Success", + "comment": "Whether the operation was successful", + "nullable": false, + "index": true + }, + { + "name": "exit_code", + "type": "integer", + "label": "Exit Code", + "comment": "System call return code", + "nullable": true + }, + { + "name": "response_time", + "type": "integer", + "label": "Response Time", + "comment": "Operation response time in milliseconds", + "nullable": true + }, + { + "name": "request_id", + "type": "string", + "label": "Request ID", + "comment": "HTTP request identifier", + "length": 100, + "nullable": true, + "index": true + }, + { + "name": "trace_id", + "type": "string", + "label": "Trace ID", + "comment": "Distributed tracing identifier", + "length": 100, + "nullable": true, + "index": true + }, + { + "name": "data_before", + "type": "json", + "label": "Data Before", + "comment": "Data state before operation", + "nullable": true + }, + { + "name": "data_after", + "type": "json", + "label": "Data After", + "comment": "Data state after operation", + "nullable": true + }, + { + "name": "details", + "type": "json", + "label": "Details", + "comment": "Additional operation details and parameters", + "nullable": true + }, + { + "name": "error_message", + "type": "text", + "label": "Error Message", + "comment": "Error message if operation failed", + "nullable": true + }, + { + "name": "tags", + "type": "json", + "label": "Tags", + "comment": "Additional tags for categorization", + "nullable": true + } + ], + "relations": {}, + "indexes": [ + { + "name": "idx_event_id", + "columns": ["event_id"], + "type": "index" + }, + { + "name": "idx_operation", + "columns": ["operation"], + "type": "index" + }, + { + "name": "idx_category", + "columns": ["category"], + "type": "index" + }, + { + "name": "idx_severity", + "columns": ["severity"], + "type": "index" + }, + { + "name": "idx_user_id", + "columns": ["user_id"], + "type": "index" + }, + { + "name": "idx_session_id", + "columns": ["session_id"], + "type": "index" + }, + { + "name": "idx_client_ip", + "columns": ["client_ip"], + "type": "index" + }, + { + "name": "idx_target_resource", + "columns": ["target_resource"], + "type": "index" + }, + { + "name": "idx_resource_type", + "columns": ["resource_type"], + "type": "index" + }, + { + "name": "idx_source", + "columns": ["source"], + "type": "index" + }, + { + "name": "idx_application", + "columns": ["application"], + "type": "index" + }, + { + "name": "idx_success", + "columns": ["success"], + "type": "index" + }, + { + "name": "idx_request_id", + "columns": ["request_id"], + "type": "index" + }, + { + "name": "idx_trace_id", + "columns": ["trace_id"], + "type": "index" + }, + { + "name": "idx_user_operation", + "columns": ["user_id", "operation"], + "type": "index" + }, + { + "name": "idx_resource_operation", + "columns": ["target_resource", "operation"], + "type": "index" + }, + { + "name": "idx_time_user", + "columns": ["created_at", "user_id"], + "type": "index" + } + ], + "option": { + "timestamps": true, + "soft_deletes": false + } +} diff --git a/yao/models/chat.mod.yao b/yao/models/chat.mod.yao new file mode 100644 index 00000000..d23212e8 --- /dev/null +++ b/yao/models/chat.mod.yao @@ -0,0 +1,85 @@ +{ + "name": "chat", + "label": "Chat", + "description": "Chat table for storing chat metadata and information", + "table": { + "name": "chat", + "comment": "Chat table" + }, + "columns": [ + { + "name": "id", + "type": "ID", + "label": "Chat ID", + "comment": "Unique chat identifier" + }, + { + "name": "chat_id", + "type": "string", + "label": "Chat ID", + "comment": "Chat identifier", + "length": 200, + "nullable": false, + "unique": true, + "index": true + }, + { + "name": "title", + "type": "string", + "label": "Title", + "comment": "Chat title", + "length": 200, + "nullable": true + }, + { + "name": "assistant_id", + "type": "string", + "label": "Assistant ID", + "comment": "Assistant identifier", + "length": 200, + "nullable": true, + "index": true + }, + { + "name": "sid", + "type": "string", + "label": "Session ID", + "comment": "Session identifier", + "length": 255, + "nullable": false, + "index": true + }, + { + "name": "silent", + "type": "boolean", + "label": "Silent Mode", + "comment": "Whether this is a silent chat", + "default": false, + "index": true + } + ], + "relations": {}, + "indexes": [ + { + "name": "idx_chat_id", + "columns": ["chat_id"], + "type": "unique" + }, + { + "name": "idx_assistant_id", + "columns": ["assistant_id"], + "type": "index" + }, + { + "name": "idx_sid", + "columns": ["sid"], + "type": "index" + }, + { + "name": "idx_silent", + "columns": ["silent"], + "type": "index" + } + ], + "option": { "timestamps": true, "soft_deletes": false } +} diff --git a/yao/models/config.mod.yao b/yao/models/config.mod.yao new file mode 100644 index 00000000..248a7d68 --- /dev/null +++ b/yao/models/config.mod.yao @@ -0,0 +1,92 @@ +{ + "name": "config", + "label": "Configuration", + "description": "Configuration table for storing system settings and parameters", + "table": { + "name": "config", + "comment": "Configuration table" + }, + "columns": [ + { + "name": "id", + "type": "ID", + "label": "Config ID", + "comment": "Unique configuration identifier" + }, + { + "name": "key", + "type": "string", + "label": "Key", + "comment": "Configuration key", + "length": 255, + "nullable": false, + "unique": true, + "index": true + }, + { + "name": "value", + "type": "json", + "label": "Value", + "comment": "Configuration value", + "nullable": true + }, + { + "name": "description", + "type": "string", + "label": "Description", + "comment": "Configuration description", + "length": 500, + "nullable": true + }, + { + "name": "category", + "type": "string", + "label": "Category", + "comment": "Configuration category", + "length": 100, + "nullable": true, + "index": true + }, + { + "name": "type", + "type": "string", + "label": "Type", + "comment": "Configuration value type", + "length": 50, + "nullable": true, + "index": true + }, + { + "name": "readonly", + "type": "boolean", + "label": "Readonly", + "comment": "Whether configuration is readonly", + "default": false, + "index": true + } + ], + "relations": {}, + "indexes": [ + { + "name": "idx_key", + "columns": ["key"], + "type": "unique" + }, + { + "name": "idx_category", + "columns": ["category"], + "type": "index" + }, + { + "name": "idx_type", + "columns": ["type"], + "type": "index" + }, + { + "name": "idx_readonly", + "columns": ["readonly"], + "type": "index" + } + ], + "option": { "timestamps": true, "soft_deletes": false } +} diff --git a/yao/models/history.mod.yao b/yao/models/history.mod.yao new file mode 100644 index 00000000..dc36ab28 --- /dev/null +++ b/yao/models/history.mod.yao @@ -0,0 +1,162 @@ +{ + "name": "history", + "label": "Chat History", + "description": "Chat history table for storing detailed chat message information", + "table": { + "name": "history", + "comment": "Chat history table" + }, + "columns": [ + { + "name": "id", + "type": "ID", + "label": "Record ID", + "comment": "Unique record identifier" + }, + { + "name": "sid", + "type": "string", + "label": "Session ID", + "comment": "Session identifier", + "length": 255, + "nullable": false, + "index": true + }, + { + "name": "cid", + "type": "string", + "label": "Chat ID", + "comment": "Chat identifier", + "length": 200, + "nullable": true, + "index": true + }, + { + "name": "uid", + "type": "string", + "label": "User ID", + "comment": "User identifier", + "length": 255, + "nullable": true, + "index": true + }, + { + "name": "role", + "type": "string", + "label": "Role", + "comment": "Message role (user/assistant/system)", + "length": 200, + "nullable": true, + "index": true + }, + { + "name": "name", + "type": "string", + "label": "Role Name", + "comment": "Role display name", + "length": 200, + "nullable": true + }, + { + "name": "content", + "type": "text", + "label": "Message Content", + "comment": "Text content of the message", + "nullable": true + }, + { + "name": "context", + "type": "json", + "label": "Context", + "comment": "Message context data", + "nullable": true + }, + { + "name": "assistant_id", + "type": "string", + "label": "Assistant ID", + "comment": "Assistant identifier", + "length": 200, + "nullable": true, + "index": true + }, + { + "name": "assistant_name", + "type": "string", + "label": "Assistant Name", + "comment": "Assistant display name", + "length": 200, + "nullable": true + }, + { + "name": "assistant_avatar", + "type": "string", + "label": "Assistant Avatar", + "comment": "Assistant avatar URL", + "length": 200, + "nullable": true + }, + { + "name": "mentions", + "type": "json", + "label": "Mentions", + "comment": "Mention information in the message", + "nullable": true + }, + { + "name": "silent", + "type": "boolean", + "label": "Silent Mode", + "comment": "Whether this is a silent message", + "default": false, + "index": true + }, + { + "name": "expired_at", + "type": "timestamp", + "label": "Expired At", + "comment": "Record expiration time", + "nullable": true, + "index": true + } + ], + "relations": {}, + "indexes": [ + { + "name": "idx_sid", + "columns": ["sid"], + "type": "index" + }, + { + "name": "idx_cid", + "columns": ["cid"], + "type": "index" + }, + { + "name": "idx_uid", + "columns": ["uid"], + "type": "index" + }, + { + "name": "idx_role", + "columns": ["role"], + "type": "index" + }, + { + "name": "idx_assistant_id", + "columns": ["assistant_id"], + "type": "index" + }, + { + "name": "idx_silent", + "columns": ["silent"], + "type": "index" + }, + { + "name": "idx_expired_at", + "columns": ["expired_at"], + "type": "index" + } + ], + "option": { "timestamps": true, "soft_deletes": false } +} diff --git a/yao/models/kb.mod.yao b/yao/models/kb.mod.yao new file mode 100644 index 00000000..0d466a1c --- /dev/null +++ b/yao/models/kb.mod.yao @@ -0,0 +1,152 @@ +{ + "name": "knowledge", + "label": "Knowledge", + "description": "Knowledge table for storing knowledge collections for AI assistants", + "table": { + "name": "knowledge", + "comment": "Knowledge table" + }, + "columns": [ + { + "name": "id", + "type": "ID", + "label": "Knowledge ID", + "comment": "Unique knowledge identifier" + }, + { + "name": "collection_id", + "type": "string", + "label": "Collection ID", + "comment": "Knowledge collection identifier", + "length": 200, + "nullable": false, + "unique": true, + "index": true + }, + { + "name": "name", + "type": "string", + "label": "Name", + "comment": "Knowledge collection name", + "length": 200, + "nullable": false, + "index": true + }, + { + "name": "description", + "type": "string", + "label": "Description", + "comment": "Knowledge collection description", + "length": 600, + "nullable": true, + "index": true + }, + { + "name": "uid", + "type": "string", + "label": "User ID", + "comment": "User identifier", + "length": 255, + "nullable": false, + "index": true + }, + { + "name": "public", + "type": "boolean", + "label": "Public", + "comment": "Whether knowledge is public", + "default": false, + "index": true + }, + { + "name": "scope", + "type": "json", + "label": "Scope", + "comment": "Knowledge access scope", + "nullable": true + }, + { + "name": "readonly", + "type": "boolean", + "label": "Readonly", + "comment": "Whether knowledge is readonly", + "default": false, + "index": true + }, + { + "name": "option", + "type": "json", + "label": "Option", + "comment": "Knowledge options", + "nullable": true + }, + { + "name": "system", + "type": "boolean", + "label": "System", + "comment": "Whether this is a system knowledge", + "default": false, + "index": true + }, + { + "name": "sort", + "type": "integer", + "label": "Sort", + "comment": "Knowledge sort order", + "default": 9999, + "index": true + }, + { + "name": "cover", + "type": "string", + "label": "Cover", + "comment": "Knowledge cover image URL", + "length": 500, + "nullable": true + } + ], + "relations": {}, + "indexes": [ + { + "name": "idx_collection_id", + "columns": ["collection_id"], + "type": "unique" + }, + { + "name": "idx_name", + "columns": ["name"], + "type": "index" + }, + { + "name": "idx_description", + "columns": ["description"], + "type": "index" + }, + { + "name": "idx_uid", + "columns": ["uid"], + "type": "index" + }, + { + "name": "idx_public", + "columns": ["public"], + "type": "index" + }, + { + "name": "idx_readonly", + "columns": ["readonly"], + "type": "index" + }, + { + "name": "idx_system", + "columns": ["system"], + "type": "index" + }, + { + "name": "idx_sort", + "columns": ["sort"], + "type": "index" + } + ], + "option": { "timestamps": true, "soft_deletes": false } +} diff --git a/yao/models/mcp.mod.yao b/yao/models/mcp.mod.yao new file mode 100644 index 00000000..19dd0728 --- /dev/null +++ b/yao/models/mcp.mod.yao @@ -0,0 +1,134 @@ +{ + "name": "mcp", + "label": "MCP", + "description": "MCP table for storing MCP client configuration", + "table": { + "name": "mcp", + "comment": "MCP table" + }, + "columns": [ + { + "name": "id", + "type": "ID", + "label": "ID", + "comment": "Unique identifier" + }, + { + "name": "mcp_id", + "type": "string", + "label": "MCP ID", + "comment": "MCP client identifier", + "length": 200, + "nullable": false, + "unique": true, + "index": true + }, + { + "name": "name", + "type": "string", + "label": "Name", + "comment": "MCP client name", + "length": 200, + "nullable": false, + "index": true + }, + { + "name": "description", + "type": "text", + "label": "Description", + "comment": "MCP client description", + "nullable": true + }, + { + "name": "dsl", + "type": "json", + "label": "DSL", + "comment": "MCP client DSL configuration in JSON format", + "nullable": true + }, + { + "name": "readonly", + "type": "boolean", + "label": "Readonly", + "comment": "MCP client readonly status", + "default": false, + "index": true + }, + { + "name": "built_in", + "type": "boolean", + "label": "Built In", + "comment": "Whether this is a built-in MCP client", + "default": false, + "index": true + }, + { + "name": "creator_id", + "type": "string", + "label": "Creator ID", + "comment": "Creator user ID", + "length": 255, + "nullable": true, + "index": true + }, + { + "name": "creator_name", + "type": "string", + "label": "Creator Name", + "comment": "Creator user name", + "length": 200, + "nullable": true + }, + { + "name": "updater_id", + "type": "string", + "label": "Updater ID", + "comment": "Last updater user ID", + "length": 255, + "nullable": true, + "index": true + }, + { + "name": "updater_name", + "type": "string", + "label": "Updater Name", + "comment": "Last updater user name", + "length": 200, + "nullable": true + } + ], + "relations": {}, + "indexes": [ + { + "name": "idx_mcp_id", + "columns": ["mcp_id"], + "type": "unique" + }, + { + "name": "idx_name", + "columns": ["name"], + "type": "index" + }, + { + "name": "idx_readonly", + "columns": ["readonly"], + "type": "index" + }, + { + "name": "idx_built_in", + "columns": ["built_in"], + "type": "index" + }, + { + "name": "idx_creator_id", + "columns": ["creator_id"], + "type": "index" + }, + { + "name": "idx_updater_id", + "columns": ["updater_id"], + "type": "index" + } + ], + "option": { "timestamps": true, "soft_deletes": false } +}