fix: localize agnet create run sheet

This commit is contained in:
gongzhiyong
2026-05-28 18:43:08 +08:00
parent 72cbf43dec
commit 587746db90
3 changed files with 49 additions and 23 deletions
+1 -1
View File
@@ -1 +1 @@
1.4.13
1.4.14
@@ -106,31 +106,31 @@ const CREDENTIAL_RESOURCE_TYPES = new Set<ResourceType>([
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({
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value='low'>low</SelectItem>
<SelectItem value='medium'>medium</SelectItem>
<SelectItem value='high'>high</SelectItem>
<SelectItem value='low'>
{formatRiskLevel('low', t)}
</SelectItem>
<SelectItem value='medium'>
{formatRiskLevel('medium', t)}
</SelectItem>
<SelectItem value='high'>
{formatRiskLevel('high', t)}
</SelectItem>
</SelectContent>
</Select>
</div>
@@ -796,8 +816,12 @@ export function CreateAgnetDeploymentSheet({
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value='agile'>agile</SelectItem>
<SelectItem value='waterfall'>waterfall</SelectItem>
<SelectItem value='agile'>
{formatSubMode('agile', t)}
</SelectItem>
<SelectItem value='waterfall'>
{formatSubMode('waterfall', t)}
</SelectItem>
</SelectContent>
</Select>
</div>
@@ -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)}
</span>
<span className='text-primary ring-primary/20 ml-2 inline-flex items-center rounded-full bg-[color-mix(in_oklch,var(--primary)_10%,transparent)] px-2 py-0.5 font-mono text-[10px] ring-1 ring-inset'>
sub_mode: {subMode}
{t('Sub mode')}: {formatSubMode(subMode, t)}
</span>
</p>
<p className='text-muted-foreground mt-2 text-xs leading-relaxed'>
+3 -1
View File
@@ -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": "快照",