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

This commit is contained in:
吉鑫升 committed 2026-05-15 16:54:56 +08:00
commit 3b951efd13
7 files changed
+44 -44

No files matched your search

@@ -358,9 +358,9 @@ function SetupAgentApprovalCard({
<div className="space-y-3"> <div className="space-y-3">
<div> <div>
<div className="text-muted-foreground text-xs font-medium"> <div className="text-muted-foreground text-xs font-medium">
创建专家审批 创建智能体审批
</div> </div>
<div className="text-sm font-medium">请确认是否写入这个专家配置。</div> <div className="text-sm font-medium">请确认是否写入这个智能体配置。</div>
</div> </div>
{approvalPayload.name ? ( {approvalPayload.name ? (
+3 -3
View File
@@ -177,10 +177,10 @@ export const enUS: Translations = {
// Agents // Agents
agents: { agents: {
title: "Experts", title: "Agents",
description: description:
"Create and manage custom experts with specialized prompts and capabilities.", "Create and manage custom agents with specialized prompts and capabilities.",
newAgent: "New Expert", newAgent: "New Agent",
emptyTitle: "No custom agents yet", emptyTitle: "No custom agents yet",
emptyDescription: emptyDescription:
"Create your first custom agent with a specialized system prompt.", "Create your first custom agent with a specialized system prompt.",
+24 -24
View File
@@ -89,7 +89,7 @@ export const zhCN: Translations = {
reasoningModeDescription: "思考后再行动,在时间与准确性之间取得平衡", reasoningModeDescription: "思考后再行动,在时间与准确性之间取得平衡",
proMode: "专业问答", proMode: "专业问答",
proModeDescription: "思考、计划再执行,获得更精准的结果,可能需要更多时间", proModeDescription: "思考、计划再执行,获得更精准的结果,可能需要更多时间",
ultraMode: "多专家问答", ultraMode: "多智能体问答",
ultraModeDescription: ultraModeDescription:
"继承自专业问答模式,可调用子代理分工协作,适合复杂多步骤任务,能力最强", "继承自专业问答模式,可调用子代理分工协作,适合复杂多步骤任务,能力最强",
reasoningEffort: "推理深度", reasoningEffort: "推理深度",
@@ -165,47 +165,47 @@ export const zhCN: Translations = {
chats: "对话", chats: "对话",
recentChats: "最近的对话", recentChats: "最近的对话",
demoChats: "演示对话", demoChats: "演示对话",
agents: "专家", agents: "智能体",
users: "用户管理", users: "用户管理",
}, },
// Agents // Agents
agents: { agents: {
title: "专家", title: "智能体",
description: "创建和管理具有专属 Prompt 与能力的自定义专家。", description: "创建和管理具有专属 Prompt 与能力的自定义智能体。",
newAgent: "新建专家", newAgent: "新建智能体",
emptyTitle: "还没有自定义专家", emptyTitle: "还没有自定义智能体",
emptyDescription: "创建你的第一个自定义专家,设置专属系统提示词。", emptyDescription: "创建你的第一个自定义智能体,设置专属系统提示词。",
chat: "对话", chat: "对话",
delete: "删除", delete: "删除",
deleteConfirm: "确定要删除该专家吗?此操作不可撤销。", deleteConfirm: "确定要删除该智能体吗?此操作不可撤销。",
deleteSuccess: "专家已删除", deleteSuccess: "智能体已删除",
newChat: "新对话", newChat: "新对话",
createPageTitle: "设计你的专家", createPageTitle: "设计你的智能体",
createPageSubtitle: "描述你想要的专家,我来帮你通过对话创建。", createPageSubtitle: "描述你想要的智能体,我来帮你通过对话创建。",
nameStepTitle: "给新专家起个名字", nameStepTitle: "给新智能体起个名字",
nameStepHint: nameStepHint:
"只允许字母、数字和连字符,存储时自动转为小写(例如 code-reviewer)", "只允许字母、数字和连字符,存储时自动转为小写(例如 code-reviewer)",
nameStepPlaceholder: "例如 code-reviewer", nameStepPlaceholder: "例如 code-reviewer",
nameStepContinue: "继续", nameStepContinue: "继续",
nameStepInvalidError: "名称无效,只允许字母、数字和连字符", nameStepInvalidError: "名称无效,只允许字母、数字和连字符",
nameStepAlreadyExistsError: "已存在同名专家", nameStepAlreadyExistsError: "已存在同名智能体",
nameStepNetworkError: "网络请求失败,请检查网络或后端连接", nameStepNetworkError: "网络请求失败,请检查网络或后端连接",
nameStepCheckError: "无法验证名称可用性,请稍后重试", nameStepCheckError: "无法验证名称可用性,请稍后重试",
nameStepBootstrapMessage: nameStepBootstrapMessage:
"新专家的名称是 {name},现在开始为它生成 **SOUL**。", "新智能体的名称是 {name},现在开始为它生成 **SOUL**。",
save: "保存专家", save: "保存智能体",
saving: "正在保存专家...", saving: "正在保存智能体...",
saveRequested: saveRequested:
"已提交保存请求,CM 助手 正在根据当前对话生成并保存初版专家。", "已提交保存请求,CM 助手 正在根据当前对话生成并保存初版智能体。",
saveHint: saveHint:
"你可以在右上角的菜单里随时保存这个专家,就算目前还只是初稿也可以。", "你可以在右上角的菜单里随时保存这个智能体,就算目前还只是初稿也可以。",
saveCommandMessage: saveCommandMessage:
"请现在根据我们目前已经讨论的全部内容保存这个自定义专家。这就是我明确的保存确认。如果仍有少量细节缺失,请根据上下文做出合理假设,生成一份简洁的英文初始 SOUL.md,并直接调用 setup_agent,不要再向我索要额外确认。", "请现在根据我们目前已经讨论的全部内容保存这个自定义智能体。这就是我明确的保存确认。如果仍有少量细节缺失,请根据上下文做出合理假设,生成一份简洁的英文初始 SOUL.md,并直接调用 setup_agent,不要再向我索要额外确认。",
agentCreatedPendingRefresh: agentCreatedPendingRefresh:
"专家已创建,但 CM 助手 暂时还无法读取到它。请稍后刷新当前页面。", "智能体已创建,但 CM 助手 暂时还无法读取到它。请稍后刷新当前页面。",
more: "更多操作", more: "更多操作",
agentCreated: "专家已创建!", agentCreated: "智能体已创建!",
startChatting: "开始对话", startChatting: "开始对话",
backToGallery: "返回 Gallery", backToGallery: "返回 Gallery",
}, },
@@ -452,7 +452,7 @@ export const zhCN: Translations = {
pinSuccess: "已钉选", pinSuccess: "已钉选",
unpinSuccess: "已取消钉选", unpinSuccess: "已取消钉选",
deleteAction: "删除技能", deleteAction: "删除技能",
deleteConfirm: "确认删除技能 “{name}”?该操作不可恢复,且会从引用它的所有专家中自动移除。", deleteConfirm: "确认删除技能 “{name}”?该操作不可恢复,且会从引用它的所有智能体中自动移除。",
deleteSuccess: "技能已删除", deleteSuccess: "技能已删除",
stateSheet: { stateSheet: {
archivedTitle: "归档的技能", archivedTitle: "归档的技能",
@@ -583,12 +583,12 @@ export const zhCN: Translations = {
adminUsers: { adminUsers: {
title: "用户管理", title: "用户管理",
description: "查看所有注册用户及其关联的技能和专家数量。", description: "查看所有注册用户及其关联的技能和智能体数量。",
email: "邮箱", email: "邮箱",
role: "角色", role: "角色",
userId: "用户 ID", userId: "用户 ID",
skillCount: "技能数", skillCount: "技能数",
agentCount: "专家数", agentCount: "智能体数",
roleAdmin: "管理员", roleAdmin: "管理员",
roleUser: "普通用户", roleUser: "普通用户",
empty: "暂无用户", empty: "暂无用户",
@@ -93,7 +93,7 @@ export function useExpertAuthBootstrap() {
useEffect(() => { useEffect(() => {
void bootstrap().catch((error) => { void bootstrap().catch((error) => {
console.error('专家中心初始化失败:', error); console.error('智能体中心初始化失败:', error);
}); });
}, [bootstrap]); }, [bootstrap]);
+1 -1
View File
@@ -54,7 +54,7 @@ export default function LoginPage() {
return ( return (
<div className="flex min-h-screen items-center justify-center bg-background px-6"> <div className="flex min-h-screen items-center justify-center bg-background px-6">
<div className="w-full max-w-lg rounded-xl border bg-card p-6 shadow-sm"> <div className="w-full max-w-lg rounded-xl border bg-card p-6 shadow-sm">
<h1 className="text-xl font-semibold">正在进入专家模式</h1> <h1 className="text-xl font-semibold">正在进入智能体模式</h1>
{status === "error" && ( {status === "error" && (
<p className="mt-4 text-sm text-red-600"> <p className="mt-4 text-sm text-red-600">
登录失败:{errorMessage || "未知错误"} 登录失败:{errorMessage || "未知错误"}
+12 -12
View File
@@ -153,7 +153,7 @@ export default function NewAgentPage() {
// the user wants the name box to stay blank while they chat, and we // the user wants the name box to stay blank while they chat, and we
// refill it later (with the model's proposed name) on setup_agent // refill it later (with the model's proposed name) on setup_agent
// approval. // approval.
name = `未命名专家-${Date.now().toString(36)}`; name = `未命名智能体-${Date.now().toString(36)}`;
} }
const modelOverride = modelInput.trim() || null; const modelOverride = modelInput.trim() || null;
@@ -226,7 +226,7 @@ export default function NewAgentPage() {
if (!saved) { if (!saved) {
return; return;
} }
toast.success(`专家「${saved.name}」已保存`); toast.success(`智能体「${saved.name}」已保存`);
}, [ensureAgent]); }, [ensureAgent]);
const handleChatSubmit = useCallback( const handleChatSubmit = useCallback(
@@ -270,7 +270,7 @@ export default function NewAgentPage() {
const handleRejectSetupAgent = useCallback( const handleRejectSetupAgent = useCallback(
async () => { async () => {
await handleChatSubmit("我暂时不批准创建这个专家配置,请继续帮我调整。"); await handleChatSubmit("我暂时不批准创建这个智能体配置,请继续帮我调整。");
}, },
[handleChatSubmit], [handleChatSubmit],
); );
@@ -300,7 +300,7 @@ export default function NewAgentPage() {
> >
<ArrowLeftIcon className="h-4 w-4" /> <ArrowLeftIcon className="h-4 w-4" />
</Button> </Button>
<h1 className="text-sm font-semibold">创建专家</h1> <h1 className="text-sm font-semibold">创建智能体</h1>
</div> </div>
{agent ? ( {agent ? (
<Button <Button
@@ -353,7 +353,7 @@ export default function NewAgentPage() {
onSubmit={({ text }) => void handleChatSubmit(text)} onSubmit={({ text }) => void handleChatSubmit(text)}
> >
<PromptInputTextarea <PromptInputTextarea
placeholder="直接告诉模型你想要什么样的专家,或回答模型的问题" placeholder="直接告诉模型你想要什么样的智能体,或回答模型的问题"
disabled={thread.isLoading} disabled={thread.isLoading}
/> />
<PromptInputFooter className="justify-end"> <PromptInputFooter className="justify-end">
@@ -366,16 +366,16 @@ export default function NewAgentPage() {
<aside className="bg-background min-h-0 overflow-y-auto"> <aside className="bg-background min-h-0 overflow-y-auto">
<div className="space-y-5 p-4"> <div className="space-y-5 p-4">
<div> <div>
<h2 className="text-sm font-semibold">专家配置</h2> <h2 className="text-sm font-semibold">智能体配置</h2>
<p className="text-muted-foreground mt-1 text-xs"> <p className="text-muted-foreground mt-1 text-xs">
这些内容会作为创建专家时的初始配置。 这些内容会作为创建智能体时的初始配置。
</p> </p>
</div> </div>
<div className="space-y-2"> <div className="space-y-2">
<label className="text-sm font-medium">名称</label> <label className="text-sm font-medium">名称</label>
<Input <Input
placeholder="例如:合同审查专家" placeholder="例如:合同审查智能体"
value={nameInput} value={nameInput}
onChange={(event) => { onChange={(event) => {
setNameInput(event.currentTarget.value); setNameInput(event.currentTarget.value);
@@ -388,7 +388,7 @@ export default function NewAgentPage() {
<div className="space-y-2"> <div className="space-y-2">
<label className="text-sm font-medium">描述</label> <label className="text-sm font-medium">描述</label>
<Textarea <Textarea
placeholder="简要说明这个专家擅长什么" placeholder="简要说明这个智能体擅长什么"
value={descriptionInput} value={descriptionInput}
onChange={(event) => onChange={(event) =>
setDescriptionInput(event.currentTarget.value) setDescriptionInput(event.currentTarget.value)
@@ -415,14 +415,14 @@ export default function NewAgentPage() {
))} ))}
</select> </select>
<p className="text-muted-foreground text-xs"> <p className="text-muted-foreground text-xs">
该专家被使用时调用的模型。 该智能体被使用时调用的模型。
</p> </p>
</div> </div>
<div className="space-y-2"> <div className="space-y-2">
<label className="text-sm font-medium">SOUL.md</label> <label className="text-sm font-medium">SOUL.md</label>
<Textarea <Textarea
placeholder="写下专家的人设、边界、工作方式和输出要求" placeholder="写下智能体的人设、边界、工作方式和输出要求"
value={soulInput} value={soulInput}
onChange={(event) => setSoulInput(event.currentTarget.value)} onChange={(event) => setSoulInput(event.currentTarget.value)}
className="min-h-48 max-h-[400px] resize-y overflow-y-auto font-mono text-xs" className="min-h-48 max-h-[400px] resize-y overflow-y-auto font-mono text-xs"
@@ -479,7 +479,7 @@ export default function NewAgentPage() {
disabled={busy || isSkillsLoading} disabled={busy || isSkillsLoading}
> >
<SaveIcon className="h-4 w-4" /> <SaveIcon className="h-4 w-4" />
{agentId ? "保存专家" : "创建专家"} {agentId ? "保存智能体" : "创建智能体"}
</Button> </Button>
</div> </div>
</aside> </aside>
@@ -72,7 +72,7 @@ class SetupAgentApprovalMiddleware(AgentMiddleware[SetupAgentApprovalMiddlewareS
approval_msg = ToolMessage( approval_msg = ToolMessage(
id=self._stable_message_id(tool_call_id, args), id=self._stable_message_id(tool_call_id, args),
content="请确认是否创建/更新这个专家配置。", content="请确认是否创建/更新这个智能体配置。",
tool_call_id=tool_call_id, tool_call_id=tool_call_id,
name="setup_agent", name="setup_agent",
additional_kwargs={"setup_agent_approval": payload}, additional_kwargs={"setup_agent_approval": payload},