fix: surrender;perf: llm response (#6190)

* feat: workflow route to detail

* llm response

* fix: surrender

* fix: surrender

* fix: surrender

* fix: test
This commit is contained in:
Archer
2026-01-05 20:53:18 +08:00
committed by GitHub
parent 88ed97bc9d
commit f00adcb02d
22 changed files with 389 additions and 136 deletions

View File

@@ -44,3 +44,10 @@ export function splitCombineToolId(id: string) {
}
return { source, pluginId: id };
}
export const getToolRawId = (id: string) => {
const toolId = splitCombineToolId(id).pluginId;
// 兼容 toolset
return toolId.split('/')[0];
};

View File

@@ -0,0 +1,30 @@
import { ObjectIdSchema } from '../../../../common/type/mongo';
import { z } from 'zod';
/* Get App Permission */
export const GetAppPermissionQuerySchema = z.object({
appId: ObjectIdSchema.meta({
example: '68ad85a7463006c963799a05',
description: '应用 ID'
})
});
export type GetAppPermissionQueryType = z.infer<typeof GetAppPermissionQuerySchema>;
export const GetAppPermissionResponseSchema = z.object({
hasReadPer: z.boolean().meta({
description: '是否有读权限'
}),
hasWritePer: z.boolean().meta({
description: '是否有写权限'
}),
hasManagePer: z.boolean().meta({
description: '是否有管理权限'
}),
hasReadChatLogPer: z.boolean().meta({
description: '是否有读取对话日志权限'
}),
isOwner: z.boolean().meta({
description: '是否为所有者'
})
});
export type GetAppPermissionResponseType = z.infer<typeof GetAppPermissionResponseSchema>;

View File

@@ -0,0 +1,26 @@
import type { OpenAPIPath } from '../../../type';
import { TagsMap } from '../../../tag';
import { GetAppPermissionQuerySchema, GetAppPermissionResponseSchema } from './api';
export const AppCommonPath: OpenAPIPath = {
'/core/app/getPermission': {
get: {
summary: '获取应用权限',
description: '根据应用 ID 获取当前用户对该应用的权限信息',
tags: [TagsMap.appCommon],
requestParams: {
query: GetAppPermissionQuerySchema
},
responses: {
200: {
description: '成功获取应用权限',
content: {
'application/json': {
schema: GetAppPermissionResponseSchema
}
}
}
}
}
}
};

View File

@@ -1,8 +1,10 @@
import type { OpenAPIPath } from '../../type';
import { AppLogPath } from './log';
import { PublishChannelPath } from './publishChannel';
import { AppCommonPath } from './common';
export const AppPath: OpenAPIPath = {
...AppLogPath,
...PublishChannelPath
...PublishChannelPath,
...AppCommonPath
};

View File

@@ -24,7 +24,7 @@ export const openAPIDocument = createDocument({
'x-tagGroups': [
{
name: 'Agent 应用',
tags: [TagsMap.appLog, TagsMap.publishChannel]
tags: [TagsMap.appCommon, TagsMap.appLog, TagsMap.publishChannel]
},
{
name: '对话管理',

View File

@@ -2,6 +2,8 @@ export const TagsMap = {
/* Core */
// Agent - log
appLog: 'Agent 日志',
// Agent - common
appCommon: 'Agent 管理',
// Chat - home
chatPage: '对话页',