Skip to content

Commit 8906108

Browse files
committed
refactor(knowledge): migrate high-risk commands to runtime confirmation
1 parent 00bcee3 commit 8906108

29 files changed

Lines changed: 250 additions & 346 deletions

docs/knowledge/chunk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ bl knowledge chunk delete --index-id <id> --chunk-id <id> [flags]
213213
| ----------------- | ------ | ---- | ------------------------------------------------ |
214214
| `--index-id <id>` | string || 知识库 ID |
215215
| `--chunk-id <id>` | array || Chunk ID(可重复,每批最多 10 个,超出自动分批) |
216-
| `--yes` | switch || 跳过确认提示 |
216+
| `--yes` | switch || 显式确认执行高风险操作 |
217217

218218
**输出**
219219

docs/knowledge/collection-category.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ bl knowledge category delete --category-id <id> [flags]
232232

233233
**参数**
234234

235-
| 参数 | 类型 | 必填 | 说明 |
236-
| -------------------- | ------ | ---- | ------------ |
237-
| `--category-id <id>` | string || 分类 ID |
238-
| `--yes` | switch || 跳过确认提示 |
235+
| 参数 | 类型 | 必填 | 说明 |
236+
| -------------------- | ------ | ---- | ---------------------- |
237+
| `--category-id <id>` | string || 分类 ID |
238+
| `--yes` | switch || 显式确认执行高风险操作 |
239239

240240
**输出**
241241

docs/knowledge/file.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ bl knowledge file delete --file-id <id> [flags]
120120

121121
**参数**
122122

123-
| 参数 | 类型 | 必填 | 说明 |
124-
| ---------------- | ------ | ---- | --------------- |
125-
| `--file-id <id>` | string || 数据中心文件 ID |
126-
| `--yes` | switch || 跳过确认提示 |
123+
| 参数 | 类型 | 必填 | 说明 |
124+
| ---------------- | ------ | ---- | ---------------------- |
125+
| `--file-id <id>` | string || 数据中心文件 ID |
126+
| `--yes` | switch || 显式确认执行高风险操作 |
127127

128128
**输出**
129129

docs/knowledge/kb.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ bl knowledge delete --index-id <id> [flags]
254254

255255
**参数**
256256

257-
| 参数 | 类型 | 必填 | 说明 |
258-
| ----------------- | ------ | ---- | ------------ |
259-
| `--index-id <id>` | string || 知识库 ID |
260-
| `--yes` | switch || 跳过确认提示 |
257+
| 参数 | 类型 | 必填 | 说明 |
258+
| ----------------- | ------ | ---- | ---------------------- |
259+
| `--index-id <id>` | string || 知识库 ID |
260+
| `--yes` | switch || 显式确认执行高风险操作 |
261261

262262
**输出**
263263

@@ -275,7 +275,7 @@ json 模式:返回 API 原始响应。
275275

276276
- **不可逆操作**:知识库及所有索引内容被永久删除。
277277
- 数据中心中的源文件不受影响,仅删除知识库索引。
278-
- 不带 `--yes` 时,CLI 会先查询知识库名称和文档数量作为确认摘要
278+
- 不带 `--yes` 时,runtime 会在调用知识库业务 API、执行删除前返回确认请求
279279

280280
**示例**
281281

docs/knowledge/knowledge-cli-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135

136136
### 危险操作确认
137137

138-
涉及删除的命令(`kb delete``doc delete``chunk delete``file delete``category delete``service delete``service deploy`在执行前会弹出二次确认提示。使用 `--yes` 可跳过确认,适用于自动化脚本
138+
涉及删除的命令(`kb delete``doc delete``chunk delete``file delete``category delete``service delete``service deploy`属于高风险操作。未带 `--yes` 时 CLI 不会执行,也不会弹出交互式 Y/N,而是返回 exit code 7 和 `requires_confirmation`;确认后在原命令中添加 `--yes` 重新执行
139139

140140
### Dry-run 模式
141141

docs/knowledge/service.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,11 @@ bl knowledge service deploy --agent-id <id> [flags]
270270

271271
**参数**
272272

273-
| 参数 | 类型 | 必填 | 说明 |
274-
| ----------------------- | ------ | ---- | ---------------- |
275-
| `--agent-id <id>` | string || 服务(agent)ID |
276-
| `--version-desc <text>` | string || 新版本的描述说明 |
277-
| `--yes` | switch || 跳过确认提示 |
273+
| 参数 | 类型 | 必填 | 说明 |
274+
| ----------------------- | ------ | ---- | ---------------------- |
275+
| `--agent-id <id>` | string || 服务(agent)ID |
276+
| `--version-desc <text>` | string || 新版本的描述说明 |
277+
| `--yes` | switch || 显式确认执行高风险操作 |
278278

279279
**输出**
280280

@@ -319,10 +319,10 @@ bl knowledge service delete --agent-id <id> [flags]
319319

320320
**参数**
321321

322-
| 参数 | 类型 | 必填 | 说明 |
323-
| ----------------- | ------ | ---- | --------------- |
324-
| `--agent-id <id>` | string || 服务(agent)ID |
325-
| `--yes` | switch || 跳过确认提示 |
322+
| 参数 | 类型 | 必填 | 说明 |
323+
| ----------------- | ------ | ---- | ---------------------- |
324+
| `--agent-id <id>` | string || 服务(agent)ID |
325+
| `--yes` | switch || 显式确认执行高风险操作 |
326326

327327
**输出**
328328

docs/kscli/chunk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ kscli chunk delete --index-id <id> --chunk-id <id> [flags]
213213
| ----------------- | ------ | ---- | ------------------------------------------------ |
214214
| `--index-id <id>` | string || 知识库 ID |
215215
| `--chunk-id <id>` | array || Chunk ID(可重复,每批最多 10 个,超出自动分批) |
216-
| `--yes` | switch || 跳过确认提示 |
216+
| `--yes` | switch || 显式确认执行高风险操作 |
217217

218218
**输出**
219219

docs/kscli/collection-category.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ kscli category delete --category-id <id> [flags]
232232

233233
**参数**
234234

235-
| 参数 | 类型 | 必填 | 说明 |
236-
| -------------------- | ------ | ---- | ------------ |
237-
| `--category-id <id>` | string || 分类 ID |
238-
| `--yes` | switch || 跳过确认提示 |
235+
| 参数 | 类型 | 必填 | 说明 |
236+
| -------------------- | ------ | ---- | ---------------------- |
237+
| `--category-id <id>` | string || 分类 ID |
238+
| `--yes` | switch || 显式确认执行高风险操作 |
239239

240240
**输出**
241241

docs/kscli/file.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ kscli file delete --file-id <id> [flags]
120120

121121
**参数**
122122

123-
| 参数 | 类型 | 必填 | 说明 |
124-
| ---------------- | ------ | ---- | --------------- |
125-
| `--file-id <id>` | string || 数据中心文件 ID |
126-
| `--yes` | switch || 跳过确认提示 |
123+
| 参数 | 类型 | 必填 | 说明 |
124+
| ---------------- | ------ | ---- | ---------------------- |
125+
| `--file-id <id>` | string || 数据中心文件 ID |
126+
| `--yes` | switch || 显式确认执行高风险操作 |
127127

128128
**输出**
129129

docs/kscli/kb.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ kscli kb delete --index-id <id> [flags]
254254

255255
**参数**
256256

257-
| 参数 | 类型 | 必填 | 说明 |
258-
| ----------------- | ------ | ---- | ------------ |
259-
| `--index-id <id>` | string || 知识库 ID |
260-
| `--yes` | switch || 跳过确认提示 |
257+
| 参数 | 类型 | 必填 | 说明 |
258+
| ----------------- | ------ | ---- | ---------------------- |
259+
| `--index-id <id>` | string || 知识库 ID |
260+
| `--yes` | switch || 显式确认执行高风险操作 |
261261

262262
**输出**
263263

@@ -275,7 +275,7 @@ json 模式:返回 API 原始响应。
275275

276276
- **不可逆操作**:知识库及所有索引内容被永久删除。
277277
- 数据中心中的源文件不受影响,仅删除知识库索引。
278-
- 不带 `--yes` 时,CLI 会先查询知识库名称和文档数量作为确认摘要
278+
- 不带 `--yes` 时,runtime 会在调用知识库业务 API、执行删除前返回确认请求
279279

280280
**示例**
281281

0 commit comments

Comments
 (0)