Merge remote-tracking branch 'origin/master' into ji

# Conflicts:
#	frontend-web/src/components/workspace/agents/agent-gallery.tsx
#	frontend-web/src/components/workspace/settings/skill-settings-page.tsx
This commit is contained in:
吉鑫升 committed 2026-05-15 16:27:56 +08:00
commit afc517b3a7
13 files changed
+504 -372

No files matched your search

+7 -4
View File
@@ -177,10 +177,10 @@ export const enUS: Translations = {
// Agents
agents: {
title: "Agents",
title: "Experts",
description:
"Create and manage custom agents with specialized prompts and capabilities.",
newAgent: "New Agent",
"Create and manage custom experts with specialized prompts and capabilities.",
newAgent: "New Expert",
emptyTitle: "No custom agents yet",
emptyDescription:
"Create your first custom agent with a specialized system prompt.",
@@ -456,7 +456,7 @@ export const enUS: Translations = {
badgeSourceAgentTitle: "Auto-generated by an agent during a conversation",
badgeSourceUpload: "Uploaded",
badgeSourceUploadTitle: "Manually uploaded or edited by a user",
tabAll: "All",
tabAll: "Square",
tabMine: "Mine",
entryStale: "Stale {count}",
entryArchived: "Archived {count}",
@@ -666,5 +666,8 @@ export const enUS: Translations = {
markAllRead: "Mark all read",
empty: "No notifications",
deleteAria: "Delete notification",
settingsAria: "Notification settings",
backAria: "Back",
settingsTitle: "Notification settings",
},
};
@@ -7,6 +7,9 @@ export interface NotificationsTranslations {
markAllRead: string;
empty: string;
deleteAria: string;
settingsAria: string;
backAria: string;
settingsTitle: string;
}
export interface Translations {
+28 -25
View File
@@ -1,4 +1,4 @@
import {
import {
CompassIcon,
GraduationCapIcon,
ImageIcon,
@@ -89,7 +89,7 @@ export const zhCN: Translations = {
reasoningModeDescription: "思考后再行动,在时间与准确性之间取得平衡",
proMode: "专业问答",
proModeDescription: "思考、计划再执行,获得更精准的结果,可能需要更多时间",
ultraMode: "多智能体问答",
ultraMode: "多专家问答",
ultraModeDescription:
"继承自专业问答模式,可调用子代理分工协作,适合复杂多步骤任务,能力最强",
reasoningEffort: "推理深度",
@@ -165,47 +165,47 @@ export const zhCN: Translations = {
chats: "对话",
recentChats: "最近的对话",
demoChats: "演示对话",
agents: "智能体",
agents: "专家",
users: "用户管理",
},
// Agents
agents: {
title: "智能体",
description: "创建和管理具有专属 Prompt 与能力的自定义智能体。",
newAgent: "新建智能体",
emptyTitle: "还没有自定义智能体",
emptyDescription: "创建你的第一个自定义智能体,设置专属系统提示词。",
title: "专家",
description: "创建和管理具有专属 Prompt 与能力的自定义专家。",
newAgent: "新建专家",
emptyTitle: "还没有自定义专家",
emptyDescription: "创建你的第一个自定义专家,设置专属系统提示词。",
chat: "对话",
delete: "删除",
deleteConfirm: "确定要删除该智能体吗?此操作不可撤销。",
deleteSuccess: "智能体已删除",
deleteConfirm: "确定要删除该专家吗?此操作不可撤销。",
deleteSuccess: "专家已删除",
newChat: "新对话",
createPageTitle: "设计你的智能体",
createPageSubtitle: "描述你想要的智能体,我来帮你通过对话创建。",
nameStepTitle: "给新智能体起个名字",
createPageTitle: "设计你的专家",
createPageSubtitle: "描述你想要的专家,我来帮你通过对话创建。",
nameStepTitle: "给新专家起个名字",
nameStepHint:
"只允许字母、数字和连字符,存储时自动转为小写(例如 code-reviewer)",
nameStepPlaceholder: "例如 code-reviewer",
nameStepContinue: "继续",
nameStepInvalidError: "名称无效,只允许字母、数字和连字符",
nameStepAlreadyExistsError: "已存在同名智能体",
nameStepAlreadyExistsError: "已存在同名专家",
nameStepNetworkError: "网络请求失败,请检查网络或后端连接",
nameStepCheckError: "无法验证名称可用性,请稍后重试",
nameStepBootstrapMessage:
"新智能体的名称是 {name},现在开始为它生成 **SOUL**。",
save: "保存智能体",
saving: "正在保存智能体...",
"新专家的名称是 {name},现在开始为它生成 **SOUL**。",
save: "保存专家",
saving: "正在保存专家...",
saveRequested:
"已提交保存请求,CM 助手 正在根据当前对话生成并保存初版智能体。",
"已提交保存请求,CM 助手 正在根据当前对话生成并保存初版专家。",
saveHint:
"你可以在右上角的菜单里随时保存这个智能体,就算目前还只是初稿也可以。",
"你可以在右上角的菜单里随时保存这个专家,就算目前还只是初稿也可以。",
saveCommandMessage:
"请现在根据我们目前已经讨论的全部内容保存这个自定义智能体。这就是我明确的保存确认。如果仍有少量细节缺失,请根据上下文做出合理假设,生成一份简洁的英文初始 SOUL.md,并直接调用 setup_agent,不要再向我索要额外确认。",
"请现在根据我们目前已经讨论的全部内容保存这个自定义专家。这就是我明确的保存确认。如果仍有少量细节缺失,请根据上下文做出合理假设,生成一份简洁的英文初始 SOUL.md,并直接调用 setup_agent,不要再向我索要额外确认。",
agentCreatedPendingRefresh:
"智能体已创建,但 CM 助手 暂时还无法读取到它。请稍后刷新当前页面。",
"专家已创建,但 CM 助手 暂时还无法读取到它。请稍后刷新当前页面。",
more: "更多操作",
agentCreated: "智能体已创建!",
agentCreated: "专家已创建!",
startChatting: "开始对话",
backToGallery: "返回 Gallery",
},
@@ -437,7 +437,7 @@ export const zhCN: Translations = {
badgeSourceAgentTitle: "在对话中由 Agent 自动生成",
badgeSourceUpload: "用户上传",
badgeSourceUploadTitle: "由用户手动上传或编辑",
tabAll: "全部",
tabAll: "广场",
tabMine: "我的",
entryStale: "过时 {count}",
entryArchived: "归档 {count}",
@@ -583,12 +583,12 @@ export const zhCN: Translations = {
adminUsers: {
title: "用户管理",
description: "查看所有注册用户及其关联的技能和智能体数量。",
description: "查看所有注册用户及其关联的技能和专家数量。",
email: "邮箱",
role: "角色",
userId: "用户 ID",
skillCount: "技能数",
agentCount: "智能体数",
agentCount: "专家数",
roleAdmin: "管理员",
roleUser: "普通用户",
empty: "暂无用户",
@@ -635,5 +635,8 @@ export const zhCN: Translations = {
markAllRead: "全部已读",
empty: "暂无通知",
deleteAria: "删除通知",
settingsAria: "通知设置",
backAria: "返回",
settingsTitle: "通知设置",
},
};
+18
View File
@@ -185,6 +185,24 @@ export async function setSkillPinned(
return response.json() as Promise<Skill>;
}
export interface SkillContentResponse {
name: string;
category: string;
content: string;
}
export async function getSkillContent(
skillName: string,
): Promise<SkillContentResponse> {
const response = await apiFetch(
`${getBackendBaseURL()}/api/skills/${encodeURIComponent(skillName)}/content`,
);
if (!response.ok) {
throw await parseDetailedError(response, "Failed to load skill content");
}
return response.json() as Promise<SkillContentResponse>;
}
export async function deleteCustomSkill(skillName: string): Promise<void> {
const response = await apiFetch(
`${getBackendBaseURL()}/api/skills/custom/${encodeURIComponent(skillName)}`,
+9
View File
@@ -8,6 +8,7 @@ import {
import {
deleteCustomSkill,
enableSkill,
getSkillContent,
installSkillUpload,
setSkillPinned,
setSkillPublished,
@@ -29,6 +30,14 @@ export function useSkills(params: { search?: string; tagId?: string | null } = {
return { skills: data ?? [], isLoading, error };
}
export function useSkillContent(skillName: string | null) {
return useQuery({
queryKey: ["skill-content", skillName],
queryFn: () => getSkillContent(skillName!),
enabled: !!skillName,
});
}
export function useEnableSkill() {
const queryClient = useQueryClient();
return useMutation({