From 587746db904a73316876e4bd49ffd6c4c0f28322 Mon Sep 17 00:00:00 2001 From: gongzhiyong Date: Thu, 28 May 2026 18:43:08 +0800 Subject: [PATCH] fix: localize agnet create run sheet --- heicode/VERSION | 2 +- .../create-agnet-deployment-sheet.tsx | 66 +++++++++++++------ heicode/web/default/src/i18n/locales/zh.json | 4 +- 3 files changed, 49 insertions(+), 23 deletions(-) diff --git a/heicode/VERSION b/heicode/VERSION index acd81d7f..323afbcd 100644 --- a/heicode/VERSION +++ b/heicode/VERSION @@ -1 +1 @@ -1.4.13 +1.4.14 diff --git a/heicode/web/default/src/features/agnet-console/create-agnet-deployment-sheet.tsx b/heicode/web/default/src/features/agnet-console/create-agnet-deployment-sheet.tsx index 172b6cd3..359b7231 100644 --- a/heicode/web/default/src/features/agnet-console/create-agnet-deployment-sheet.tsx +++ b/heicode/web/default/src/features/agnet-console/create-agnet-deployment-sheet.tsx @@ -106,31 +106,31 @@ const CREDENTIAL_RESOURCE_TYPES = new Set([ const TEMPLATE_PRESETS: TemplatePreset[] = [ { id: 'new_work_mvp', - label: 'MVP delivery', - objective: 'Turn a product idea into a scoped MVP delivery run.', + label: 'MVP 交付', + objective: '把产品想法拆成有范围边界的 MVP 交付任务。', risk: 'medium', roles: [ { role_template: 'product', - goal: 'Clarify the objective and produce the work brief.', + goal: '澄清目标并产出工作简报。', default_model_id: 'agnet-model-product', }, { role_template: 'frontend', - goal: 'Build the first usable UI path from the work brief.', + goal: '根据工作简报构建第一条可用界面路径。', default_model_id: 'agnet-model-builder', }, { role_template: 'reviewer', - goal: 'Review the plan, permissions, and delivery evidence.', + goal: '检查计划、权限和交付证据。', default_model_id: 'agnet-model-reviewer', }, ], }, { id: 'new_work_fix', - label: 'Fix or improve', - objective: 'Investigate a focused issue and ship the smallest safe fix.', + label: '修复或优化', + objective: '定位一个明确问题,并交付最小安全修复。', risk: 'low', // Role keys aligned to the canonical six-role catalog from // docs/product-package §13.3.3. Previous presets used informal @@ -138,20 +138,20 @@ const TEMPLATE_PRESETS: TemplatePreset[] = [ roles: [ { role_template: 'reviewer', - goal: 'Find the root cause and define the minimum repair.', + goal: '找到根因并定义最小修复范围。', default_model_id: 'agnet-model-debugger', }, { role_template: 'backend', - goal: 'Implement and verify the scoped change.', + goal: '实现并验证限定范围内的改动。', default_model_id: 'agnet-model-builder', }, ], }, { id: 'new_work_release', - label: 'Release readiness', - objective: 'Prepare a release candidate with verification and audit trail.', + label: '发布准备', + objective: '准备带验证和审计记录的候选发布版本。', risk: 'high', // Canonical six-role catalog (§13.3.3) — "executor" was an // informal label; the closest canonical mapping is "backend" @@ -160,17 +160,17 @@ const TEMPLATE_PRESETS: TemplatePreset[] = [ roles: [ { role_template: 'backend', - goal: 'Prepare the release branch and required artifacts.', + goal: '准备发布分支和所需产物。', default_model_id: 'agnet-model-builder', }, { role_template: 'ops', - goal: 'Validate deployment boundaries and rollback readiness.', + goal: '验证部署边界和回滚准备情况。', default_model_id: 'agnet-model-ops', }, { role_template: 'reviewer', - goal: 'Confirm evidence, permissions, and known risks.', + goal: '确认交付证据、权限和已知风险。', default_model_id: 'agnet-model-reviewer', }, ], @@ -231,6 +231,20 @@ function emptyAgent( } } +function formatRiskLevel( + value: 'low' | 'medium' | 'high', + t: (key: string) => string +) { + if (value === 'low') return t('Low') + if (value === 'medium') return t('Medium') + return t('High') +} + +function formatSubMode(value: AgnetSubMode, t: (key: string) => string) { + if (value === 'agile') return t('Agile') + return t('Waterfall') +} + function buildAgent( row: AgentFormRow, index: number, @@ -780,9 +794,15 @@ export function CreateAgnetDeploymentSheet({ - low - medium - high + + {formatRiskLevel('low', t)} + + + {formatRiskLevel('medium', t)} + + + {formatRiskLevel('high', t)} + @@ -796,8 +816,12 @@ export function CreateAgnetDeploymentSheet({ - agile - waterfall + + {formatSubMode('agile', t)} + + + {formatSubMode('waterfall', t)} + @@ -1344,10 +1368,10 @@ export function CreateAgnetDeploymentSheet({ : 'bg-emerald-500/15 text-emerald-400 ring-emerald-500/30' )} > - {t('Risk level')}: {riskLevel} + {t('Risk level')}: {formatRiskLevel(riskLevel, t)} - sub_mode: {subMode} + {t('Sub mode')}: {formatSubMode(subMode, t)}

diff --git a/heicode/web/default/src/i18n/locales/zh.json b/heicode/web/default/src/i18n/locales/zh.json index 10e6d821..466abab2 100644 --- a/heicode/web/default/src/i18n/locales/zh.json +++ b/heicode/web/default/src/i18n/locales/zh.json @@ -175,7 +175,7 @@ "After enabling, the plan will be shown to users. Continue?": "启用后套餐将在用户端展示。是否继续?", "After invalidating, this subscription will be immediately deactivated. Historical records are not affected. Continue?": "作废后该订阅将立即失效,历史记录不受影响。是否继续?", "After scanning, the binding will complete automatically": "扫描后,绑定将自动完成", - "Agent": "Agent", + "Agent": "子 Agent", "Agent declarations parsed from each Agnet deployment plan.": "从各 Agnet 部署计划中解析的 Agent 声明。", "Agent declarations parsed from each deployment plan.": "从各 Agnet 部署计划中解析的 Agent 声明。", "Agent ID *": "代理 ID *", @@ -4105,6 +4105,8 @@ "Low": "低", "Agile": "敏捷", "Waterfall": "瀑布", + "Sub mode": "子模式", + "Agent": "智能体", "Handoff": "交接", "Event": "事件", "Snapshot": "快照",