From 8ae14842ccdd0289dce86fd37c2d1e5da877f947 Mon Sep 17 00:00:00 2001 From: yunyingk Date: Wed, 8 Apr 2026 14:48:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9AAgent=20state=20?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E8=AF=AD=E4=B9=89=E5=8F=8D=E4=BA=86=EF=BC=8C?= =?UTF-8?q?0=3D=E8=8D=89=E7=A8=BF=201=3D=E5=B7=B2=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit list/detail 两处 STATE_MAP 均将 0/1 含义对调,同步更新 README.agent.md 枚举说明。 --- src/ekb_cli/commands/agent/README.agent.md | 10 ++++------ src/ekb_cli/commands/agent/detail.py | 2 +- src/ekb_cli/commands/agent/list.py | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ekb_cli/commands/agent/README.agent.md b/src/ekb_cli/commands/agent/README.agent.md index e7746de..069cca5 100644 --- a/src/ekb_cli/commands/agent/README.agent.md +++ b/src/ekb_cli/commands/agent/README.agent.md @@ -12,13 +12,11 @@ **state(Agent 状态)** -| 值 | 含义 | 接口 | +| 值 | 含义 | 备注 | |---|---|---| -| `0` | 启用(已关联审批流) | `GET /agent/active?state=0` | -| `1` | 未启用(未关联审批流) | `GET /agent/active?state=1` 或新建默认值 | -| `2` | 已删除 | `GET /agent/active?state=2`(不可恢复) | - -> `state` 通过 `/agent/active` 接口单独变更,与 `/agent/save` 无关。 +| `0` | 草稿 | 新建默认值,未发布 | +| `1` | 已发布 | 已关联审批流并生效 | +| `2` | 已删除 | 不可恢复 | ## 四类条款语义(对应前端「AI审核决策偏好」) diff --git a/src/ekb_cli/commands/agent/detail.py b/src/ekb_cli/commands/agent/detail.py index c8fd043..78428eb 100644 --- a/src/ekb_cli/commands/agent/detail.py +++ b/src/ekb_cli/commands/agent/detail.py @@ -9,7 +9,7 @@ from rich import print as rprint from ekb_cli.api import get_client, get_agent console = Console() -STATE_MAP = {0: "[green]启用[/green]", 1: "[dim]未启用(未关联审批流)[/dim]"} +STATE_MAP = {0: "[dim]草稿[/dim]", 1: "[green]已发布[/green]"} MODE_MAP = {0: "全自动", 1: "半自动", 2: "辅助"} DESC_MAX = 24 diff --git a/src/ekb_cli/commands/agent/list.py b/src/ekb_cli/commands/agent/list.py index 5f12c21..fd83879 100644 --- a/src/ekb_cli/commands/agent/list.py +++ b/src/ekb_cli/commands/agent/list.py @@ -9,7 +9,7 @@ from ekb_cli.api import get_client from ekb_cli.api.agent import list_agents console = Console() -STATE_MAP = {0: "[green]启用[/green]", 1: "[red]禁用[/red]"} +STATE_MAP = {0: "[dim]草稿[/dim]", 1: "[green]已发布[/green]"} MODE_MAP = {0: "全自动", 1: "半自动", 2: "辅助"}