mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 23:24:21 +00:00
feat: move MCP to /mcp and add teammate operations (#500)
* feat(operations): move MCP to /mcp and add search, comment, metadata, version, and upload operations - Serve the MCP server at /mcp instead of /api/mcp - Add search_assets, copy_assets, get_folder_instructions, list_comments, create_comment, resolve_comment, list_metadata_fields, update_asset_metadata, create_version_stack, list_versions, and remove_version on the agent, MCP, and CLI - Add create_file and create_version (agent, MCP) with Creation Context metadata, and complete_upload (MCP) for presigned two-step uploads - Replace the native agent create_file/create_version tools with Operation-backed ones - Route the comment-complete, metadata, copy, version stack, and AGENTS.md read REST endpoints through their Operations * docs(readme): add built-in MCP server and CLI to features list
This commit is contained in:
+11
-12
@@ -14,7 +14,12 @@ import { listChildrenRequestSchema, updateAssetOrderRequestSchema, AuditAction }
|
||||
import { searchRequestSchema } from '@shumai/dtos'
|
||||
import type { Prisma } from '@shumai/db'
|
||||
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
|
||||
import { createFolderOp, renameAssetOp, runOperation } from '@shumai/core/src/operations'
|
||||
import {
|
||||
createFolderOp,
|
||||
getFolderInstructionsOp,
|
||||
renameAssetOp,
|
||||
runOperation,
|
||||
} from '@shumai/core/src/operations'
|
||||
|
||||
type User = Prisma.UserGetPayload<Record<string, never>>
|
||||
|
||||
@@ -150,17 +155,11 @@ const route = new Hono<{ Variables: { user: User } }>()
|
||||
return c.json(result)
|
||||
})
|
||||
.get('/folders/:folderId/agentsmd', async (c) => {
|
||||
const folderId = c.req.param('folderId')
|
||||
const user = c.get('user')
|
||||
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Read,
|
||||
type: ResourceType.Asset,
|
||||
id: folderId,
|
||||
})
|
||||
|
||||
const content = await assetService.getAgentsMd(folderId)
|
||||
const { content } = await runOperation(
|
||||
getFolderInstructionsOp,
|
||||
{ userId: c.get('user').id, via: 'api' },
|
||||
{ folderId: c.req.param('folderId') },
|
||||
)
|
||||
return c.json({ content })
|
||||
})
|
||||
.patch(
|
||||
|
||||
Reference in New Issue
Block a user