mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 19:04:23 +00:00
refactor(agent): remove executeAgentToolWorkflow and invoke core services directly (#362)
* refactor(agent): remove executeAgentToolWorkflow and invoke core services directly * fix(core): ensure creation atomicity, strict assetType filtering, and id-desc listing
This commit is contained in:
@@ -160,9 +160,12 @@ export const updateAssetNameRequestSchema = z.object({
|
||||
})
|
||||
export type UpdateAssetNameRequest = z.infer<typeof updateAssetNameRequestSchema>
|
||||
|
||||
export const assetTypeFilterSchema = z.enum(['file', 'folder', 'all'])
|
||||
export type AssetTypeFilter = z.infer<typeof assetTypeFilterSchema>
|
||||
|
||||
export const listChildrenRequestSchema = z.object({
|
||||
assetId: z.string().optional(),
|
||||
assetType: z.string(),
|
||||
assetType: assetTypeFilterSchema.optional().default('all'),
|
||||
projectId: z.string().optional(),
|
||||
showDeleted: z.boolean().optional(),
|
||||
prefix: z.string().optional(),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { z } from 'zod'
|
||||
import { UserType } from '@shumai/db/enums'
|
||||
import { paginationPageInfoSchema, paginationParamsSchema } from './pagination'
|
||||
import { assetTypeFilterSchema } from './asset'
|
||||
|
||||
export const createProjectRequestSchema = z.object({
|
||||
name: z.string(),
|
||||
@@ -58,7 +59,7 @@ export type ProjectUserInfo = z.infer<typeof projectUserInfoSchema>
|
||||
|
||||
export const recentlyDeletedRequestSchema = z
|
||||
.object({
|
||||
assetType: z.string(),
|
||||
assetType: assetTypeFilterSchema.optional().default('all'),
|
||||
sort: z.enum(['createdAt', 'name', 'size']).optional(),
|
||||
order: z.enum(['asc', 'desc']).optional(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user