Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix: 国际化定时任务默认项目名与 Harness 扩展导入报错信息

cjh_jinduoxia0ee6ee3c7865
diff --git a/jiuwenswarm/channels/web/frontend/src/App.css b/jiuwenswarm/channels/web/frontend/src/App.css
index 7a934b3482..a1f972661d 100644
--- a/jiuwenswarm/channels/web/frontend/src/App.css
+++ b/jiuwenswarm/channels/web/frontend/src/App.css
@@ -132,7 +132,9 @@
.app-restart-modal {
position: fixed;
inset: 0;
- z-index: 60;
+ /* 需高于所有浮层(含 .icon-rail-more-panel z-index:1200、.advanced-config-panel z-index:1300、
+ 全局最高的 2000),否则模态的毛玻璃遮罩会被这些不带 backdrop-filter 的浮层盖住。 */
+ z-index: 2100;
display: flex;
align-items: center;
justify-content: center;
diff --git a/jiuwenswarm/channels/web/frontend/src/components/ChannelsPanel/index.tsx b/jiuwenswarm/channels/web/frontend/src/components/ChannelsPanel/index.tsx
index 1b164ddd73..31cbad1fbc 100644
--- a/jiuwenswarm/channels/web/frontend/src/components/ChannelsPanel/index.tsx
+++ b/jiuwenswarm/channels/web/frontend/src/components/ChannelsPanel/index.tsx
@@ -1,6 +1,7 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ChevronRight, Plus, Trash2 } from 'lucide-react';
+import i18n from '../../i18n';
import { webRequest } from '../../services/webClient';
import { AvatarPermEditor } from './AvatarPermEditor';
import { WechatQrModal } from './WechatQrModal';
@@ -420,7 +421,7 @@ function sortFeishuApps(apps: FeishuAppConfig[]): FeishuAppConfig[] {
return [...apps].sort((a, b) => a.name.localeCompare(b.name, 'zh-Hans-CN'));
}
-function normalizeFeishuAppConfig(input: unknown, fallbackName = '未命名飞书应用', isDefault = false): FeishuAppConfig {
+function normalizeFeishuAppConfig(input: unknown, fallbackName = i18n.t('channels.feishuApps.unnamedAppName'), isDefault = false): FeishuAppConfig {
const base = normalizeFeishuConfig(input);
const data = input && typeof input === 'object' ? (input as Record<string, unknown>) : {};
return {
@@ -434,11 +435,17 @@ function normalizeFeishuAppsConfig(input: unknown): FeishuAppConfig[] {
if (input && typeof input === 'object') {
const data = input as Record<string, unknown>;
if (Array.isArray(data.apps)) {
- const apps = data.apps.map((item, idx) => normalizeFeishuAppConfig(item, `飞书应用 ${idx + 1}`, idx === 0));
- return sortFeishuApps(apps.length > 0 ? apps : [normalizeFeishuAppConfig(DEFAULT_FEISHU_CONF, '默认飞书应用', true)]);
+ const apps = data.apps.map((item, idx) =>
+ normalizeFeishuAppConfig(item, i18n.t('channels.feishuApps.appNameTemplate', { index: idx + 1 }), idx === 0),
+ );
+ return sortFeishuApps(
+ apps.length > 0
+ ? apps
+ : [normalizeFeishuAppConfig(DEFAULT_FEISHU_CONF, i18n.t('channels.feishuApps.defaultAppName'), true)],
+ );
}
}
- return sortFeishuApps([normalizeFeishuAppConfig(input, '默认飞书应用', true)]);
+ return sortFeishuApps([normalizeFeishuAppConfig(input, i18n.t('channels.feishuApps.defaultAppName'), true)]);
}
function draftFromFeishuAppConfig(conf: FeishuAppConfig): FeishuAppDraft {
@@ -454,7 +461,7 @@ function buildFeishuAppConfig(draft: FeishuAppDraft): FeishuAppConfig {
return {
...DEFAULT_FEISHU_CONF,
...(payload as FeishuConfig),
- name: draft.name.trim() || '未命名飞书应用',
+ name: draft.name.trim() || i18n.t('channels.feishuApps.unnamedAppName'),
is_default: draft.is_default,
};
}
@@ -1296,7 +1303,7 @@ export function ChannelsPanel({ isConnected }: ChannelsPanelProps) {
{
...draftFromFeishuAppConfig({
...DEFAULT_FEISHU_CONF,
- name: `飞书应用 ${prev.length + 1}`,
+ name: t('channels.feishuApps.appNameTemplate', { index: prev.length + 1 }),
is_default: false,
}),
},
@@ -1328,7 +1335,9 @@ export function ChannelsPanel({ isConnected }: ChannelsPanelProps) {
setSuccess(null);
};
- const draft = feishuDraftApps[0] ?? draftFromFeishuAppConfig({ ...DEFAULT_FEISHU_CONF, name: '默认飞书应用', is_default: true });
+ const draft =
+ feishuDraftApps[0] ??
+ draftFromFeishuAppConfig({ ...DEFAULT_FEISHU_CONF, name: t('channels.feishuApps.defaultAppName'), is_default: true });
const handleFieldChange = <K extends keyof FeishuDraft>(key: K, value: FeishuDraft[K]) => {
handleFeishuAppFieldChange(0, key, value);
@@ -1788,11 +1797,30 @@ export function ChannelsPanel({ isConnected }: ChannelsPanelProps) {
);
};
+ // 旧版单飞书应用配置迁移到 apps 数组时,后端会给缺失的 name 填入固定中文种子文案
+ // (见 app_web_handlers.py 的 _FEISHU_APP_DEFAULTS/_normalize_single_feishu_to_app),
+ // 与当前 UI 语言无关。这里仅做展示层替换:未被用户改过时按当前语言显示对应译文,
+ // 不改动 app.name 的实际值,因此不会把翻译结果回写进 config.yaml。
+ // legacyDefaultAppName 只用于识别后端旧迁移逻辑写入的原始种子文案("默认应用"),
+ // 命中后统一按 defaultAppName("飞书默认应用")展示,避免出现两种"默认应用"文案。
+ const FEISHU_APP_NAME_SEED_KEYS: { detectKey: string; displayKey: string }[] = [
+ { detectKey: 'channels.feishuApps.defaultAppName', displayKey: 'channels.feishuApps.defaultAppName' },
+ { detectKey: 'channels.feishuApps.legacyDefaultAppName', displayKey: 'channels.feishuApps.defaultAppName' },
+ { detectKey: 'channels.feishuApps.unnamedAppName', displayKey: 'channels.feishuApps.unnamedAppName' },
+ ];
+
+ const getFeishuAppNameDisplayValue = (rawName: string): string => {
+ const matched = FEISHU_APP_NAME_SEED_KEYS.find((entry) =>
+ ['zh', 'en'].some((lng) => rawName === t(entry.detectKey, { lng })),
+ );
+ return matched ? t(matched.displayKey) : rawName;
+ };
+
const renderFeishuAppsEditor = () => (
<div className="space-y-3">
{feishuDraftApps.map((app, index) => {
const expanded = expandedFeishuAppIndex === index;
- const identifier = app.app_id.trim() || '未配置 app_id';
+ const identifier = app.app_id.trim() || t('channels.feishuApps.appIdNotConfigured');
return (
<div key={`feishu-app-${index}`} className="rounded-xl border border-border bg-card overflow-hidden">
<div className="flex items-center gap-3 px-4 py-3">
@@ -1800,21 +1828,21 @@ export function ChannelsPanel({ isConnected }: ChannelsPanelProps) {
type="button"
onClick={() => setExpandedFeishuAppIndex(expanded ? -1 : index)}
className="inline-flex h-7 w-7 items-center justify-center rounded-md text-text-muted hover:bg-secondary hover:text-text"
- aria-label={expanded ? '收起应用配置' : '展开应用配置'}
- title={expanded ? '收起应用配置' : '展开应用配置'}
+ aria-label={expanded ? t('channels.feishuApps.collapseConfig') : t('channels.feishuApps.expandConfig')}
+ title={expanded ? t('channels.feishuApps.collapseConfig') : t('channels.feishuApps.expandConfig')}
>
<ChevronRight className={`h-4 w-4 ${expanded ? 'rotate-90' : ''}`} />
</button>
<input
type="text"
- value={app.name}
+ value={getFeishuAppNameDisplayValue(app.name)}
onChange={(e) => handleFeishuAppFieldChange(index, 'name', e.target.value)}
className="min-w-[160px] flex-1 rounded-md border border-border bg-bg px-3 py-2 text-sm outline-none focus:border-accent"
- placeholder="应用名称"
+ placeholder={t('channels.feishuApps.appNamePlaceholder')}
/>
{app.is_default ? (
<span className="rounded-full border border-accent bg-accent-subtle px-2.5 py-1 text-xs text-accent">
- 默认
+ {t('channels.feishuApps.defaultBadge')}
</span>
) : null}
{!app.is_default ? (
@@ -1822,10 +1850,10 @@ export function ChannelsPanel({ isConnected }: ChannelsPanelProps) {
type="button"
onClick={() => handleSetDefaultFeishuApp(index)}
className="rounded-full border border-accent/50 bg-accent-subtle px-2.5 py-1 text-xs font-medium text-accent hover:border-accent hover:bg-accent/15"
- aria-label="设为默认应用"
- title="设为默认应用"
+ aria-label={t('channels.feishuApps.setDefaultAria')}
+ title={t('channels.feishuApps.setDefaultAria')}
>
- 设为默认
+ {t('channels.feishuApps.setDefault')}
</button>
) : null}
<span className="mono max-w-[220px] truncate rounded-md border border-border bg-secondary px-2.5 py-1 text-xs text-text-muted">
@@ -1843,8 +1871,8 @@ export function ChannelsPanel({ isConnected }: ChannelsPanelProps) {
onClick={() => handleDeleteFeishuApp(index)}
disabled={feishuDraftApps.length <= 1}
className="inline-flex h-8 w-8 items-center justify-center rounded-md border border-border text-text-muted hover:bg-danger-subtle hover:text-danger disabled:cursor-not-allowed disabled:opacity-40"
- aria-label="删除应用"
- title="删除应用"
+ aria-label={t('channels.feishuApps.deleteApp')}
+ title={t('channels.feishuApps.deleteApp')}
>
<Trash2 className="h-4 w-4" />
</button>
@@ -1869,7 +1897,7 @@ export function ChannelsPanel({ isConnected }: ChannelsPanelProps) {
className="flex w-full items-center justify-center gap-2 rounded-xl border border-dashed border-border px-4 py-3 text-sm text-text-muted hover:border-accent hover:bg-accent-subtle hover:text-accent"
>
<Plus className="h-4 w-4" />
- 添加应用
+ {t('channels.feishuApps.addApp')}
</button>
</div>
);
diff --git a/jiuwenswarm/channels/web/frontend/src/components/ConfigPanel/index.tsx b/jiuwenswarm/channels/web/frontend/src/components/ConfigPanel/index.tsx
index 9deab2825c..ca15493e15 100644
--- a/jiuwenswarm/channels/web/frontend/src/components/ConfigPanel/index.tsx
+++ b/jiuwenswarm/channels/web/frontend/src/components/ConfigPanel/index.tsx
@@ -2888,6 +2888,21 @@ function TeamItemSection({
return labels[field] || field;
};
+ // 内置默认 leader 的 display_name/persona 是种子文案,与当前 UI 语言无关;
+ // 未被用户改动时按当前语言展示对应译文,避免切换语言后仍显示另一语言的默认文案。
+ // 只影响展示,不改动 team.leader 里的实际值,因此不会把翻译结果回写进全局 config.yaml。
+ const LEADER_DEFAULT_TEXT_KEYS: Record<string, string> = {
+ display_name: "config.defaults.teamLeaderDisplayName",
+ persona: "config.defaults.teamLeaderPersona",
+ };
+
+ const getLeaderInputDisplayValue = (field: string, rawValue: string): string => {
+ const i18nKey = LEADER_DEFAULT_TEXT_KEYS[field];
+ if (!i18nKey) return rawValue;
+ const isUnmodifiedDefault = ["zh", "en"].some((lng) => rawValue === t(i18nKey, { lng }));
+ return isUnmodifiedDefault ? t(i18nKey) : rawValue;
+ };
+
const getMemberFieldLabel = (field: string): string => {
const labels: Record<string, string> = {
member_name: t("config.keys.teamMemberName"),
@@ -3008,7 +3023,7 @@ function TeamItemSection({
<div className="flex-1">
<input
type="text"
- value={team.leader[field] ?? ""}
+ value={getLeaderInputDisplayValue(field, team.leader[field] ?? "")}
onChange={(e) => updateLeader(field, e.target.value)}
maxLength={field === "persona" ? 2048 : 64}
className={`w-full rounded border bg-bg px-2 py-1 text-text text-xs ${field === "member_name" && memberNameError?.field === 'leader' ? "border-danger" : "border-border"}`}
diff --git a/jiuwenswarm/channels/web/frontend/src/components/CronPanel/CronTaskDrawer.tsx b/jiuwenswarm/channels/web/frontend/src/components/CronPanel/CronTaskDrawer.tsx
index 8914ffc4c5..2ffdef1e1d 100644
--- a/jiuwenswarm/channels/web/frontend/src/components/CronPanel/CronTaskDrawer.tsx
+++ b/jiuwenswarm/channels/web/frontend/src/components/CronPanel/CronTaskDrawer.tsx
@@ -11,6 +11,7 @@ import { cronExprToSchedule, isOnceScheduleExpired } from './scheduleConvert';
import { TIMEZONE_OPTIONS } from './constants';
import type { CronTaskUI, CronTemplateUI } from '../../types/cron';
import type { ProjectInfo } from '../../features/workspace/projectTypes';
+import { getProjectDisplayName } from '../../stores/workspaceStore';
// "生效周期"依赖后端 effective_from/effective_until(见 backend-requests.md 需求3),目前后端还
// 没有这个概念,选了也不下发。之前的方案是保留字段但标注"即将上线",用户后来觉得不如先整个隐藏,
@@ -93,7 +94,7 @@ export default function CronTaskDrawer({ mode, initial, projects, targetOptions,
const [form, setForm] = useState<CronTaskFormValue>(initial ?? emptyForm());
const title = mode === 'edit' ? t('cron.drawer.titleEdit') : mode === 'template' ? t('cron.drawer.titleTemplate') : t('cron.drawer.titleCreate');
- const projectOptions = projects.map((p) => ({ value: p.project_dir, label: p.name }));
+ const projectOptions = projects.map((p) => ({ value: p.project_dir, label: getProjectDisplayName(p) }));
const timezoneOptions = TIMEZONE_OPTIONS.map((tz) => ({ value: tz, label: tz }));
// 必填项缺失时,收集清单用来在"确定"按钮旁给出具体提示(而不是只让按钮变灰、不说原因)
const missingFieldLabels: string[] = [];
diff --git a/jiuwenswarm/channels/web/frontend/src/components/CronPanel/index.tsx b/jiuwenswarm/channels/web/frontend/src/components/CronPanel/index.tsx
index a8f6620a24..12cc9b900d 100644
--- a/jiuwenswarm/channels/web/frontend/src/components/CronPanel/index.tsx
+++ b/jiuwenswarm/channels/web/frontend/src/components/CronPanel/index.tsx
@@ -808,21 +808,27 @@ export default function CronPanel({ sessionId, onCreateViaChat, onSelectSession
{/* tab: 任务模板 */}
{activeTab === 'template' && (
- <div className="grid grid-cols-3 gap-4">
- {filteredTemplates.map((tpl) => (
- <button
- key={tpl.id}
- onClick={() => openTemplateDrawer(tpl)}
- className="rounded-lg border border-border bg-card p-4 text-left transition-colors hover:border-accent"
- >
- <div className="mb-2 flex items-center gap-2">
- <TemplateIcon icon={tpl.icon} />
- <span className="text-sm font-bold text-text-strong">{t(tpl.titleKey)}</span>
- </div>
- <p className="text-xs leading-relaxed text-text-muted">{t(tpl.descriptionKey)}</p>
- </button>
- ))}
- </div>
+ filteredTemplates.length > 0 ? (
+ <div className="grid grid-cols-3 gap-4">
+ {filteredTemplates.map((tpl) => (
+ <button
+ key={tpl.id}
+ onClick={() => openTemplateDrawer(tpl)}
+ className="rounded-lg border border-border bg-card p-4 text-left transition-colors hover:border-accent"
+ >
+ <div className="mb-2 flex items-center gap-2">
+ <TemplateIcon icon={tpl.icon} />
+ <span className="text-sm font-bold text-text-strong">{t(tpl.titleKey)}</span>
+ </div>
+ <p className="text-xs leading-relaxed text-text-muted">{t(tpl.descriptionKey)}</p>
+ </button>
+ ))}
+ </div>
+ ) : (
+ <div className="flex min-h-[30vh] flex-col items-center justify-center gap-2 text-text-muted">
+ <p className="text-sm">{t('cron.search.noResults')}</p>
+ </div>
+ )
)}
{/* tab: 执行历史(等 backend-requests.md #1 交付后接入真实数据,见 plan.md §5) */}
diff --git a/jiuwenswarm/channels/web/frontend/src/components/ExtensionsPanel/index.tsx b/jiuwenswarm/channels/web/frontend/src/components/ExtensionsPanel/index.tsx
index d8dd10b169..c1a2d25780 100644
--- a/jiuwenswarm/channels/web/frontend/src/components/ExtensionsPanel/index.tsx
+++ b/jiuwenswarm/channels/web/frontend/src/components/ExtensionsPanel/index.tsx
@@ -1,5 +1,6 @@
import { useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
+import type { TFunction } from 'i18next';
import { webRequest } from '../../services/webClient';
import './ExtensionsPanel.css';
@@ -11,6 +12,26 @@ interface RailExtension {
priority: number;
}
+// 后端 extensions.import 校验失败时直接抛出中文异常原文(未走 i18n,见
+// rail_manager.py:import_extension / agent_ws_server.py:_handle_extensions_import)。
+// 这里按已知文案模式做前端翻译兜底;匹配不到的未知错误原样展示(可能仍是中文原文)。
+function translateImportError(rawMessage: string, t: TFunction): string {
+ const notFound = rawMessage.match(/^文件夹不存在或不是目录: (.+)$/);
+ if (notFound) return t('extensions.errors.folderNotFound', { path: notFound[1] });
+
+ const invalidName = rawMessage.match(/^文件夹名称 '(.+)' 必须是有效的英文标识符$/);
+ if (invalidName) return t('extensions.errors.invalidFolderName', { name: invalidName[1] });
+
+ const alreadyExists = rawMessage.match(/^扩展 '(.+)' 已存在$/);
+ if (alreadyExists) return t('extensions.errors.alreadyExists', { name: alreadyExists[1] });
+
+ if (rawMessage === '缺少 folder_path 参数') return t('extensions.errors.missingFolderPath');
+ if (rawMessage === '扩展文件夹必须包含 rail.py 文件') return t('extensions.errors.missingRailFile');
+ if (rawMessage === 'rail.py 验证失败') return t('extensions.errors.railValidationFailed');
+
+ return rawMessage;
+}
+
interface ExtensionsPanelProps {
isConnected: boolean;
}
@@ -71,11 +92,12 @@ export function ExtensionsPanel({ isConnected }: ExtensionsPanelProps) {
throw new Error(t('extensions.importFailed'));
}
} catch (err) {
- setError(err instanceof Error ? err.message : String(err));
+ const rawMessage = err instanceof Error ? err.message : String(err);
+ setError(translateImportError(rawMessage, t));
} finally {
setLoading(false);
}
- }, [folderPath]);
+ }, [folderPath, t]);
const handleDelete = useCallback(
async (name: string) => {
diff --git a/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json b/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json
index b70389b4fd..872da3a152 100644
--- a/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json
+++ b/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json
@@ -681,6 +681,21 @@
"saveGeneric": "Save failed, please try again later",
"wechatNumericInvalid": "{{field}} must be a valid number between {{min}} and {{max}}",
"wechatBackoffOrder": "backoff_max_sec must not be less than backoff_base_sec"
+ },
+ "feishuApps": {
+ "defaultAppName": "Default Lark App",
+ "legacyDefaultAppName": "Default App",
+ "unnamedAppName": "Unnamed Lark App",
+ "appNameTemplate": "Lark App {{index}}",
+ "appNamePlaceholder": "App name",
+ "collapseConfig": "Collapse app configuration",
+ "expandConfig": "Expand app configuration",
+ "defaultBadge": "Default",
+ "setDefault": "Set as default",
+ "setDefaultAria": "Set as default app",
+ "appIdNotConfigured": "app_id not configured",
+ "deleteApp": "Delete app",
+ "addApp": "Add app"
}
},
"config": {
@@ -781,6 +796,10 @@
"proactiveMaxPerDay": "Daily recommendation limit",
"proactiveMaxRounds": "Max rounds per check"
},
+ "defaults": {
+ "teamLeaderDisplayName": "Team Leader",
+ "teamLeaderPersona": "Genius project management expert, skilled at task decomposition and team coordination"
+ },
"keyHelp": {
"skillCreate": "Install `skill-creator` and `teamskill-creator` before enabling",
"skillRetrievalBuildRootCategories": "Edit YAML/JSON containing tree_root_categories or root_categories directly. The page shows the default taxonomy as a reference; saving writes the config content itself, not an external file path."
@@ -1024,7 +1043,8 @@
"history": "Run History"
},
"search": {
- "placeholder": "Search"
+ "placeholder": "Search",
+ "noResults": "No matching templates found. Try a different keyword."
},
"table": {
"name": "Name",
@@ -1998,7 +2018,15 @@
"helpTitle": "Usage Guide",
"help0": "Extension folder must contain rail.py as the entry file",
"help1": "Rail extension files must inherit from DeepAgentRail or AgentRail base class",
- "help2": "Extension files are saved to ~/.jiuwenswarm/agent/workspace/extensions/ directory"
+ "help2": "Extension files are saved to ~/.jiuwenswarm/agent/workspace/extensions/ directory",
+ "errors": {
+ "missingFolderPath": "Missing folder_path parameter",
+ "folderNotFound": "Folder does not exist or is not a directory: {{path}}",
+ "invalidFolderName": "Folder name \"{{name}}\" must be a valid English identifier",
+ "alreadyExists": "Extension \"{{name}}\" already exists",
+ "missingRailFile": "Extension folder must contain a rail.py file",
+ "railValidationFailed": "rail.py validation failed"
+ }
},
"ownerScopes": {
"title": "Avatar Permission",
@@ -2083,6 +2111,7 @@
"renamePlaceholder": "Enter a new name",
"deleteProject": "Delete project",
"deleteProjectDescription": "Remove “{{projectName}}”? Unpinned conversations in this project will temporarily move to the default project.",
+ "defaultProjectName": "Default Project",
"absolutePathError": "Enter an absolute path, for example /Users/name/work/project",
"errors": {
"pathExists": "This project path already exists. Choose another directory or start a new conversation from the existing project.",
diff --git a/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json b/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json
index a66379efe3..f49623d2ba 100644
--- a/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json
+++ b/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json
@@ -681,6 +681,21 @@
"saveGeneric": "保存失败,请稍后重试",
"wechatNumericInvalid": "{{field}} 需为 {{min}}–{{max}} 之间的有效数值",
"wechatBackoffOrder": "backoff_max_sec 不得小于 backoff_base_sec"
+ },
+ "feishuApps": {
+ "defaultAppName": "飞书默认应用",
+ "legacyDefaultAppName": "默认应用",
+ "unnamedAppName": "未命名飞书应用",
+ "appNameTemplate": "飞书应用 {{index}}",
+ "appNamePlaceholder": "应用名称",
+ "collapseConfig": "收起应用配置",
+ "expandConfig": "展开应用配置",
+ "defaultBadge": "默认",
+ "setDefault": "设为默认",
+ "setDefaultAria": "设为默认应用",
+ "appIdNotConfigured": "未配置 app_id",
+ "deleteApp": "删除应用",
+ "addApp": "添加应用"
}
},
"config": {
@@ -781,6 +796,10 @@
"proactiveMaxPerDay": "每日推荐上限",
"proactiveMaxRounds": "每次检查对话轮数"
},
+ "defaults": {
+ "teamLeaderDisplayName": "团队领导",
+ "teamLeaderPersona": "天才项目管理专家,擅长任务分解和团队协调"
+ },
"keyHelp": {
"skillCreate": "建议先安装 `skill-creator` 和 `teamskill-creator`,再开启",
"skillRetrievalBuildRootCategories": "直接编辑包含 tree_root_categories 或 root_categories 的 YAML/JSON;页面会展示默认分层供参考。保存后会写入配置内容本身,而不是外部文件路径。"
@@ -1024,7 +1043,8 @@
"history": "执行历史"
},
"search": {
- "placeholder": "请输入搜索内容"
+ "placeholder": "请输入搜索内容",
+ "noResults": "未找到相关模板,可换个关键词再试。"
},
"table": {
"name": "名称",
@@ -1999,7 +2019,15 @@
"helpTitle": "使用说明",
"help0": "扩展文件夹必须包含 rail.py 作为入口文件",
"help1": "Rail 扩展文件必须继承 DeepAgentRail 或 AgentRail 基类",
- "help2": "扩展文件会被保存到 ~/.jiuwenswarm/agent/workspace/extensions/ 目录"
+ "help2": "扩展文件会被保存到 ~/.jiuwenswarm/agent/workspace/extensions/ 目录",
+ "errors": {
+ "missingFolderPath": "缺少 folder_path 参数",
+ "folderNotFound": "文件夹不存在或不是目录:{{path}}",
+ "invalidFolderName": "文件夹名称 “{{name}}” 必须是有效的英文标识符",
+ "alreadyExists": "扩展 “{{name}}” 已存在",
+ "missingRailFile": "扩展文件夹必须包含 rail.py 文件",
+ "railValidationFailed": "rail.py 验证失败"
+ }
},
"ownerScopes": {
"title": "分身权限配置",
@@ -2087,6 +2115,7 @@
"renamePlaceholder": "输入新名称",
"deleteProject": "删除项目",
"deleteProjectDescription": "确定要移除“{{projectName}}”吗?项目下未置顶会话会临时归入默认项目。",
+ "defaultProjectName": "默认项目",
"absolutePathError": "请输入绝对路径,例如 /Users/name/work/project",
"errors": {
"pathExists": "该项目路径已存在,请选择其他目录或直接从现有项目开始新对话",
diff --git a/jiuwenswarm/channels/web/frontend/src/stores/workspaceStore.ts b/jiuwenswarm/channels/web/frontend/src/stores/workspaceStore.ts
index 1f907e8b37..322427ef36 100644
--- a/jiuwenswarm/channels/web/frontend/src/stores/workspaceStore.ts
+++ b/jiuwenswarm/channels/web/frontend/src/stores/workspaceStore.ts
@@ -1,4 +1,5 @@
import { create } from 'zustand';
+import i18n from '../i18n';
import { projectRegistryClient } from '../features/workspace/projectRegistryClient';
import type { ProjectInfo, Session } from '../types';
import { useChatStore } from './chatStore';
@@ -47,6 +48,12 @@ function isDefaultProject(project: ProjectInfo): boolean {
return project.is_default || project.project_id === DEFAULT_PROJECT_ID;
}
+// 默认项目节点由后端按固定中文文案实时生成、不入库也不可重命名,
+// 因此按当前 UI 语言在展示层替换即可,不存在覆盖用户自定义名称的风险。
+export function getProjectDisplayName(project: ProjectInfo): string {
+ return isDefaultProject(project) ? i18n.t('multiSession.project.defaultProjectName') : project.name;
+}
+
function findDefaultProjectId(projects: ProjectInfo[]): string {
return projects.find(isDefaultProject)?.project_id ?? DEFAULT_PROJECT_ID;
}