@comate/zulu 1.2.1-beta.2 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/comate-engine/assets/skills/auto-commit-comate/SKILL.md +260 -0
- package/comate-engine/assets/skills/auto-commit-comate/references/data_structures.md +189 -0
- package/comate-engine/assets/skills/auto-commit-comate/references/new_version_instruction.md +209 -0
- package/comate-engine/assets/skills/auto-commit-comate/references/old_version_instruction.md +208 -0
- package/comate-engine/assets/skills/auto-commit-comate/scripts/git_diff_cli.py +196 -0
- package/comate-engine/assets/skills/{smart-commit → auto-commit-comate}/scripts/git_utils.py +20 -10
- package/comate-engine/assets/skills/{smart-commit → auto-commit-comate}/scripts/icafe/client.py +69 -40
- package/comate-engine/assets/skills/{smart-commit → auto-commit-comate}/scripts/icafe/farseer.py +8 -9
- package/comate-engine/assets/skills/{smart-commit → auto-commit-comate}/scripts/icafe/matching.py +65 -9
- package/comate-engine/assets/skills/auto-commit-comate/scripts/match_card_cli.py +37 -0
- package/comate-engine/assets/skills/cnap-comate/SKILL.md +157 -0
- package/comate-engine/assets/skills/cnap-comate/references/cases.md +198 -0
- package/comate-engine/assets/skills/cnap-comate/references/deploy-troubleshoot.md +15 -0
- package/comate-engine/assets/skills/cnap-comate/references/install.md +43 -0
- package/comate-engine/assets/skills/cnap-comate/references/kubectl.md +55 -0
- package/comate-engine/assets/skills/cnap-comate/references/login.md +125 -0
- package/comate-engine/assets/skills/cnap-comate/references/oncall.md +24 -0
- package/comate-engine/assets/skills/cnap-comate/scripts/install_cnap_cli.sh +36 -0
- package/comate-engine/assets/skills/code-security/SKILL.md +176 -0
- package/comate-engine/assets/skills/code-security/references/credential_hosting.md +102 -0
- package/comate-engine/assets/skills/code-security/references/vul_repair_sensitive.md +219 -0
- package/comate-engine/assets/skills/code-security/scripts/build_repair_info.py +0 -0
- package/comate-engine/assets/skills/code-security/scripts/credential_hosting.py +99 -0
- package/comate-engine/assets/skills/code-security/scripts/credential_poll.py +350 -0
- package/comate-engine/assets/skills/code-security/scripts/http_client.py +173 -0
- package/comate-engine/assets/skills/code-security/scripts/parse_scan_result.py +301 -0
- package/comate-engine/assets/skills/code-security/scripts/repair_vulnerability.py +261 -0
- package/comate-engine/assets/skills/code-security/scripts/report_chat.py +198 -0
- package/comate-engine/assets/skills/code-security/scripts/scan_vulnerability.py +316 -0
- package/comate-engine/assets/skills/code-security-comate/SKILL.md +219 -0
- package/comate-engine/assets/skills/code-security-comate/references/credential_hosting.md +102 -0
- package/comate-engine/assets/skills/code-security-comate/references/vul_repair-go_sql_injection.md +399 -0
- package/comate-engine/assets/skills/code-security-comate/references/vul_repair-java_sql_injection.md +591 -0
- package/comate-engine/assets/skills/code-security-comate/references/vul_repair-php_sql_injection.md +318 -0
- package/comate-engine/assets/skills/code-security-comate/references/vul_repair-python_sql_injection.md +198 -0
- package/comate-engine/assets/skills/code-security-comate/references/vul_repair_sensitive.md +219 -0
- package/comate-engine/assets/skills/code-security-comate/scripts/credential_hosting.py +87 -0
- package/comate-engine/assets/skills/code-security-comate/scripts/credential_poll.py +345 -0
- package/comate-engine/assets/skills/code-security-comate/scripts/http_client.py +173 -0
- package/comate-engine/assets/skills/code-security-comate/scripts/parse_scan_result.py +392 -0
- package/comate-engine/assets/skills/code-security-comate/scripts/repair_vulnerability.py +245 -0
- package/comate-engine/assets/skills/code-security-comate/scripts/report_chat.py +145 -0
- package/comate-engine/assets/skills/code-security-comate/scripts/scan_vulnerability.py +444 -0
- package/comate-engine/assets/skills/code-security-comate/scripts/utils.py +153 -0
- package/comate-engine/assets/skills/comate-docs-comate/SKILL.md +148 -0
- package/comate-engine/assets/skills/comate-docs-comate/references/doc-map-extended.md +78 -0
- package/comate-engine/assets/skills/comate-docs-comate/references/models-and-billing.md +51 -0
- package/comate-engine/assets/skills/comate-docs-comate/references/product-overview.md +73 -0
- package/comate-engine/assets/skills/comate-docs-comate/references/query_content.md +83 -0
- package/comate-engine/assets/skills/comate-docs-comate/references/query_repo.md +57 -0
- package/comate-engine/assets/skills/comate-docs-comate/scripts/ku_operator.py +1575 -0
- package/comate-engine/assets/skills/create-image-comate/SKILL.md +278 -0
- package/comate-engine/assets/skills/create-skill-comate/SKILL.md +308 -217
- package/comate-engine/assets/skills/create-skill-comate/agents/analyzer.md +274 -0
- package/comate-engine/assets/skills/create-skill-comate/agents/comparator.md +202 -0
- package/comate-engine/assets/skills/create-skill-comate/agents/grader.md +223 -0
- package/comate-engine/assets/skills/create-skill-comate/assets/eval_review.html +146 -0
- package/comate-engine/assets/skills/create-skill-comate/eval-viewer/generate_review.py +489 -0
- package/comate-engine/assets/skills/create-skill-comate/eval-viewer/viewer.html +1325 -0
- package/comate-engine/assets/skills/create-skill-comate/references/schemas.md +430 -0
- package/comate-engine/assets/skills/create-skill-comate/scripts/__init__.py +0 -0
- package/comate-engine/assets/skills/create-skill-comate/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
- package/comate-engine/assets/skills/create-skill-comate/scripts/__pycache__/aggregate_benchmark.cpython-311.pyc +0 -0
- package/comate-engine/assets/skills/create-skill-comate/scripts/aggregate_benchmark.py +412 -0
- package/comate-engine/assets/skills/create-skill-comate/scripts/generate_report.py +334 -0
- package/comate-engine/assets/skills/create-skill-comate/scripts/package_skill.py +140 -0
- package/comate-engine/assets/skills/create-skill-comate/scripts/utils.py +53 -0
- package/comate-engine/assets/skills/find-skills-comate/SKILL.md +15 -12
- package/comate-engine/assets/skills/find-skills-comate/scripts/fetch_skills.py +32 -3
- package/comate-engine/assets/skills/get-ugate-token-comate/SKILL.md +159 -0
- package/comate-engine/assets/skills/get-ugate-token-comate/getUgateToken.py +150 -0
- package/comate-engine/assets/skills/icafe-comate/SKILL.md +240 -0
- package/comate-engine/assets/skills/icafe-comate/references/ai-workflows.md +233 -0
- package/comate-engine/assets/skills/icafe-comate/references/commands.md +1147 -0
- package/comate-engine/assets/skills/icafe-comate/references/error-handling.md +164 -0
- package/comate-engine/assets/skills/icafe-comate/references/git-auto-bindcard-workflow.md +201 -0
- package/comate-engine/assets/skills/icafe-comate/references/git-bindcard-workflow.md +327 -0
- package/comate-engine/assets/skills/icafe-comate/references/iql-syntax.md +327 -0
- package/comate-engine/assets/skills/icafe-comate/references/platform-concepts.md +317 -0
- package/comate-engine/assets/skills/icafe-comate/references/smart-create-workflow.md +171 -0
- package/comate-engine/assets/skills/icafe-comate/references/smart-find-workflow.md +127 -0
- package/comate-engine/assets/skills/icafe-comate/references/smart-update-workflow.md +118 -0
- package/comate-engine/assets/skills/icode-comate/SKILL.md +366 -0
- package/comate-engine/assets/skills/icode-comate/references/api/add_reviewers.md +44 -0
- package/comate-engine/assets/skills/icode-comate/references/api/build_fetch_command.md +89 -0
- package/comate-engine/assets/skills/icode-comate/references/api/check_repo_permission.md +89 -0
- package/comate-engine/assets/skills/icode-comate/references/api/create_branch.md +79 -0
- package/comate-engine/assets/skills/icode-comate/references/api/create_draft_comment.md +109 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_ai_cr_result.md +190 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_ai_review.md +97 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_diff_content.md +92 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_diff_file.md +88 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_machine_check.md +73 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_my_reviews.md +115 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_person_commit.md +89 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_person_repo.md +63 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_repo_branch.md +62 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_repo_config.md +91 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_repo_members.md +118 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_repo_reviews.md +91 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_review_comments.md +87 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_review_info.md +81 -0
- package/comate-engine/assets/skills/icode-comate/references/api/get_submit_settings.md +105 -0
- package/comate-engine/assets/skills/icode-comate/references/api/icode-api.md +86 -0
- package/comate-engine/assets/skills/icode-comate/references/api/publish_comments.md +72 -0
- package/comate-engine/assets/skills/icode-comate/references/api/set_review_score.md +58 -0
- package/comate-engine/assets/skills/icode-comate/references/api/start_ai_review.md +77 -0
- package/comate-engine/assets/skills/icode-comate/references/api/submit_review.md +50 -0
- package/comate-engine/assets/skills/icode-comate/references/api/trigger_ai_cr.md +63 -0
- package/comate-engine/assets/skills/icode-comate/references/feature/add-reviewer.md +92 -0
- package/comate-engine/assets/skills/icode-comate/references/feature/fix-machine-check.md +144 -0
- package/comate-engine/assets/skills/icode-comate/references/feature/merge-cr.md +100 -0
- package/comate-engine/assets/skills/icode-comate/references/feature/ssh-setup.md +106 -0
- package/comate-engine/assets/skills/icode-comate/references/feature/submit-acr.md +135 -0
- package/comate-engine/assets/skills/icode-comate/references/feature/submit-cr.md +123 -0
- package/comate-engine/assets/skills/icode-comate/references/git/clone.md +67 -0
- package/comate-engine/assets/skills/icode-comate/references/git/icode-git.md +68 -0
- package/comate-engine/assets/skills/icode-comate/references/git/push.md +64 -0
- package/comate-engine/assets/skills/icode-comate/references/git/push_cr.md +103 -0
- package/comate-engine/assets/skills/icode-comate/references/install.md +144 -0
- package/comate-engine/assets/skills/icode-comate/references/login.md +111 -0
- package/comate-engine/assets/skills/icode-comate/scripts/add-reviewer.sh +154 -0
- package/comate-engine/assets/skills/icode-comate/scripts/common.sh +145 -0
- package/comate-engine/assets/skills/icode-comate/scripts/fix-machine-check.sh +131 -0
- package/comate-engine/assets/skills/icode-comate/scripts/merge-cr.sh +105 -0
- package/comate-engine/assets/skills/icode-comate/scripts/ssh-setup.sh +159 -0
- package/comate-engine/assets/skills/icode-comate/scripts/submit-acr.sh +236 -0
- package/comate-engine/assets/skills/icode-comate/scripts/submit-cr.sh +104 -0
- package/comate-engine/assets/skills/icode-comate/scripts/test-preflight.sh +89 -0
- package/comate-engine/assets/skills/ku-operator-comate/SKILL.md +121 -0
- package/comate-engine/assets/skills/ku-operator-comate/examples.md +190 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/add_member.md +49 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/change_scope.md +38 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/copy_doc.md +50 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/create_doc.md +61 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/delete_doc.md +31 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/edit_content.md +568 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/move_doc.md +45 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/query_comment.md +79 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/query_content.md +83 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/query_flowchart.md +84 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/query_permission.md +38 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/query_recent_view.md +67 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/query_repo.md +57 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/query_user_info.md +37 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/update_member.md +41 -0
- package/comate-engine/assets/skills/ku-operator-comate/references/upload_attachment.md +52 -0
- package/comate-engine/assets/skills/ku-operator-comate/scripts/ku_operator.py +1575 -0
- package/comate-engine/node_modules/better-sqlite3/node_modules/.bin/prebuild-install +2 -2
- package/comate-engine/node_modules/tree-sitter-bash/node_modules/.bin/node-gyp-build +2 -2
- package/comate-engine/node_modules/tree-sitter-bash/node_modules/.bin/node-gyp-build-optional +2 -2
- package/comate-engine/node_modules/tree-sitter-bash/node_modules/.bin/node-gyp-build-test +2 -2
- package/comate-engine/package.json +2 -0
- package/comate-engine/server.js +170 -46
- package/dist/bundle/index.js +8 -8
- package/package.json +1 -1
- package/comate-engine/assets/skills/figma2code-comate/codeConnect.md +0 -37
- package/comate-engine/assets/skills/figma2code-comate/designToken.md +0 -3
- package/comate-engine/assets/skills/figma2code-comate/f2cMcp.md +0 -59
- package/comate-engine/assets/skills/smart-commit/SKILL.md +0 -646
- package/comate-engine/node_modules/@comate/plugin-host/dist/index-AZIho4HV.js +0 -1
- package/comate-engine/node_modules/@comate/plugin-host/dist/user-BIpzRUfb.js +0 -44
- package/comate-engine/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- /package/comate-engine/assets/skills/{smart-commit → auto-commit-comate}/references/issue_type_mapping.json +0 -0
- /package/comate-engine/assets/skills/{smart-commit → auto-commit-comate}/references/query_reference.md +0 -0
- /package/comate-engine/assets/skills/{smart-commit → auto-commit-comate}/scripts/compat.py +0 -0
- /package/comate-engine/assets/skills/{smart-commit → auto-commit-comate}/scripts/create_card_cli.py +0 -0
- /package/comate-engine/assets/skills/{smart-commit → auto-commit-comate}/scripts/icafe/__init__.py +0 -0
- /package/comate-engine/assets/skills/{smart-commit → auto-commit-comate}/scripts/logger.py +0 -0
- /package/comate-engine/assets/skills/{smart-commit → auto-commit-comate}/scripts/recognize_card_cli.py +0 -0
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
# edit-content — 编辑文档正文
|
|
2
|
+
|
|
3
|
+
通过 JSON 操作列表编辑文档正文内容。支持追加、插入、替换、删除等操作。
|
|
4
|
+
|
|
5
|
+
## CLI 用法
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
python3 scripts/ku_operator.py edit-content --doc-id <文档ID> --operations-file <JSON文件> [--publish]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 参数表
|
|
12
|
+
|
|
13
|
+
| 参数 | 必填 | 说明 |
|
|
14
|
+
|------|------|------|
|
|
15
|
+
| `--doc-id` | 是 | 文档 ID |
|
|
16
|
+
| `--operations-file` | 是 | JSON 文件路径,包含编辑操作列表(数组格式) |
|
|
17
|
+
| `--publish` | 否 | 编辑后同步发布。不传则仅在编辑态产生变更,预览态不可见 |
|
|
18
|
+
|
|
19
|
+
## 核心概念
|
|
20
|
+
|
|
21
|
+
### operations 数组
|
|
22
|
+
|
|
23
|
+
operations 是一个操作列表,每个操作依次执行:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
[
|
|
27
|
+
{ "mode": "...", "blockId": "...", "json": [...], "position": 1 },
|
|
28
|
+
{ "mode": "...", "blockId": "...", "json": [...] }
|
|
29
|
+
]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### mode — 操作模式
|
|
33
|
+
|
|
34
|
+
| mode | 功能 | blockId 是否必填 | 说明 |
|
|
35
|
+
|------|------|-----------------|------|
|
|
36
|
+
| `sibling` | 插入节点 | 否 | 不传 blockId 时追加到文档末尾;传 blockId 时在目标节点前后插入(由 position 决定) |
|
|
37
|
+
| `delete` | 删除节点 | **是** | 删除 blockId 指定的节点。json 字段传空数组 `[]` |
|
|
38
|
+
|
|
39
|
+
### position — 插入位置(仅 sibling 模式)
|
|
40
|
+
|
|
41
|
+
| 值 | 含义 |
|
|
42
|
+
|----|------|
|
|
43
|
+
| `-1` | 在目标节点**上方**插入 |
|
|
44
|
+
| `1` | 在目标节点**下方**插入(默认) |
|
|
45
|
+
| 不传 | 如果也不传 blockId,则追加到文档末尾 |
|
|
46
|
+
|
|
47
|
+
### blockId — 如何获取
|
|
48
|
+
|
|
49
|
+
通过 `query-content` 命令获取文档的原始 JSON 结构(非 Markdown),每个内容块都有 `blockId` 字段,格式为 `docyg-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`。
|
|
50
|
+
|
|
51
|
+
**重要**:要获取 blockId,需要直接查看 queryContent API 返回的原始 JSON 中的 content 数组,而不是 jsonToMd 转换后的 Markdown。
|
|
52
|
+
|
|
53
|
+
### json — 编辑器节点格式
|
|
54
|
+
|
|
55
|
+
json 字段是一个节点数组,每个节点代表一个文档内容块。所有节点都需要 `type` 和 `children` 字段。
|
|
56
|
+
|
|
57
|
+
## Agent 常用节点类型速查
|
|
58
|
+
|
|
59
|
+
### 段落(paragraph)
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"type": "paragraph",
|
|
64
|
+
"children": [{"text": "普通文本内容"}]
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
带样式的文本:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"type": "paragraph",
|
|
73
|
+
"children": [
|
|
74
|
+
{"text": "普通文本"},
|
|
75
|
+
{"text": "加粗", "bold": true},
|
|
76
|
+
{"text": "斜体", "italic": true},
|
|
77
|
+
{"text": "删除线", "del": true},
|
|
78
|
+
{"text": "下划线", "underline": true},
|
|
79
|
+
{"text": "红色文字", "font-color": "#E61300"},
|
|
80
|
+
{"text": "高亮背景", "bg-color": "#51C56F"}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 标题(heading)
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"type": "heading",
|
|
90
|
+
"level": 2,
|
|
91
|
+
"children": [{"text": "二级标题"}]
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
level 取值 1-6,对应 H1-H6。
|
|
96
|
+
|
|
97
|
+
### 无序列表(unordered-list-item)
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"type": "unordered-list-item",
|
|
102
|
+
"depth": 0,
|
|
103
|
+
"children": [{"text": "列表项"}]
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
depth 控制缩进层级:0=一级, 1=二级, 2=三级。
|
|
108
|
+
|
|
109
|
+
### 有序列表(ordered-list-item)
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"type": "ordered-list-item",
|
|
114
|
+
"depth": 0,
|
|
115
|
+
"index": 1,
|
|
116
|
+
"initialNumber": 1,
|
|
117
|
+
"children": [{"text": "第一项"}]
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
注意:`initialNumber` 只需在同层级列表的第一个元素中指定。
|
|
122
|
+
|
|
123
|
+
### 待办列表(todo-list-item)
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"type": "todo-list-item",
|
|
128
|
+
"depth": 0,
|
|
129
|
+
"checked": false,
|
|
130
|
+
"children": [{"text": "待办事项"}]
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 代码块(block-code)
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"type": "block-code",
|
|
139
|
+
"language": "python",
|
|
140
|
+
"autowrap": true,
|
|
141
|
+
"children": [
|
|
142
|
+
{"type": "block-code-line", "children": [{"text": "def hello():"}]},
|
|
143
|
+
{"type": "block-code-line", "children": [{"text": " print('hello')"}]}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
每一行代码是一个 `block-code-line` 子节点。
|
|
149
|
+
|
|
150
|
+
### 表格(table)
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"type": "table",
|
|
155
|
+
"data": {"headless": true, "width": [150, 150, 150]},
|
|
156
|
+
"children": [
|
|
157
|
+
{
|
|
158
|
+
"type": "table-row",
|
|
159
|
+
"children": [
|
|
160
|
+
{
|
|
161
|
+
"type": "table-cell",
|
|
162
|
+
"data": {"rowspan": 1, "colspan": 1},
|
|
163
|
+
"children": [
|
|
164
|
+
{"type": "paragraph", "children": [{"text": "单元格1"}]}
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"type": "table-cell",
|
|
169
|
+
"data": {"rowspan": 1, "colspan": 1},
|
|
170
|
+
"children": [
|
|
171
|
+
{"type": "paragraph", "children": [{"text": "单元格2"}]}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"type": "table-cell",
|
|
176
|
+
"data": {"rowspan": 1, "colspan": 1},
|
|
177
|
+
"children": [
|
|
178
|
+
{"type": "paragraph", "children": [{"text": "单元格3"}]}
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
`data.width` 数组长度 = 列数。`headless: true` 表示无表头样式。
|
|
188
|
+
|
|
189
|
+
### 引用块(blockquote)
|
|
190
|
+
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"type": "blockquote",
|
|
194
|
+
"children": [
|
|
195
|
+
{"type": "paragraph", "children": [{"text": "引用内容"}]}
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### 高亮信息块(callout)
|
|
201
|
+
|
|
202
|
+
```json
|
|
203
|
+
{
|
|
204
|
+
"type": "callout",
|
|
205
|
+
"theme": "info",
|
|
206
|
+
"children": [
|
|
207
|
+
{"type": "paragraph", "children": [{"text": "提示信息"}]}
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
theme 可选值:`info` / `warning` / `success` / `error`
|
|
213
|
+
|
|
214
|
+
### 分割线(hr)
|
|
215
|
+
|
|
216
|
+
```json
|
|
217
|
+
{
|
|
218
|
+
"type": "hr",
|
|
219
|
+
"children": [{"text": ""}]
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### 超链接(内嵌在段落 children 中)
|
|
224
|
+
|
|
225
|
+
```json
|
|
226
|
+
{
|
|
227
|
+
"type": "paragraph",
|
|
228
|
+
"children": [
|
|
229
|
+
{"text": "请访问 "},
|
|
230
|
+
{
|
|
231
|
+
"type": "link",
|
|
232
|
+
"href": "https://baidu.com",
|
|
233
|
+
"title": "百度",
|
|
234
|
+
"children": [{"text": "百度"}]
|
|
235
|
+
},
|
|
236
|
+
{"text": " 了解更多"}
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## 使用示例
|
|
242
|
+
|
|
243
|
+
### 1. 追加内容到文档末尾(最常用)
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
cat > /tmp/ops.json << 'EOF'
|
|
247
|
+
[
|
|
248
|
+
{
|
|
249
|
+
"mode": "sibling",
|
|
250
|
+
"json": [
|
|
251
|
+
{"type": "heading", "level": 2, "children": [{"text": "新章节"}]},
|
|
252
|
+
{"type": "paragraph", "children": [{"text": "这是新增的内容。"}]},
|
|
253
|
+
{
|
|
254
|
+
"type": "unordered-list-item", "depth": 0,
|
|
255
|
+
"children": [{"text": "要点一"}]
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"type": "unordered-list-item", "depth": 0,
|
|
259
|
+
"children": [{"text": "要点二"}]
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
EOF
|
|
265
|
+
|
|
266
|
+
python3 scripts/ku_operator.py edit-content \
|
|
267
|
+
--doc-id D5JiZRULjdEJHR \
|
|
268
|
+
--operations-file /tmp/ops.json \
|
|
269
|
+
--publish
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### 2. 在指定位置插入内容
|
|
273
|
+
|
|
274
|
+
先通过 queryContent 获取目标节点的 blockId,然后在其下方插入:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
cat > /tmp/ops.json << 'EOF'
|
|
278
|
+
[
|
|
279
|
+
{
|
|
280
|
+
"mode": "sibling",
|
|
281
|
+
"blockId": "docyg-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
|
282
|
+
"position": 1,
|
|
283
|
+
"json": [
|
|
284
|
+
{"type": "paragraph", "children": [{"text": "插入到目标节点下方的内容"}]}
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
EOF
|
|
289
|
+
|
|
290
|
+
python3 scripts/ku_operator.py edit-content \
|
|
291
|
+
--doc-id D5JiZRULjdEJHR \
|
|
292
|
+
--operations-file /tmp/ops.json \
|
|
293
|
+
--publish
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### 3. 删除指定节点
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
cat > /tmp/ops.json << 'EOF'
|
|
300
|
+
[
|
|
301
|
+
{
|
|
302
|
+
"mode": "delete",
|
|
303
|
+
"blockId": "docyg-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
|
304
|
+
"json": []
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
EOF
|
|
308
|
+
|
|
309
|
+
python3 scripts/ku_operator.py edit-content \
|
|
310
|
+
--doc-id D5JiZRULjdEJHR \
|
|
311
|
+
--operations-file /tmp/ops.json \
|
|
312
|
+
--publish
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### 4. 替换内容(先删后插)
|
|
316
|
+
|
|
317
|
+
编辑器没有原生的「替换」模式,需通过组合操作实现:先在目标节点上方插入新内容,再删除旧节点。
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
cat > /tmp/ops.json << 'EOF'
|
|
321
|
+
[
|
|
322
|
+
{
|
|
323
|
+
"mode": "sibling",
|
|
324
|
+
"blockId": "docyg-旧节点ID",
|
|
325
|
+
"position": -1,
|
|
326
|
+
"json": [
|
|
327
|
+
{"type": "paragraph", "children": [{"text": "替换后的新内容"}]}
|
|
328
|
+
]
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"mode": "delete",
|
|
332
|
+
"blockId": "docyg-旧节点ID",
|
|
333
|
+
"json": []
|
|
334
|
+
}
|
|
335
|
+
]
|
|
336
|
+
EOF
|
|
337
|
+
|
|
338
|
+
python3 scripts/ku_operator.py edit-content \
|
|
339
|
+
--doc-id D5JiZRULjdEJHR \
|
|
340
|
+
--operations-file /tmp/ops.json \
|
|
341
|
+
--publish
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### 5. 批量操作(一次请求多个操作)
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
cat > /tmp/ops.json << 'EOF'
|
|
348
|
+
[
|
|
349
|
+
{
|
|
350
|
+
"mode": "sibling",
|
|
351
|
+
"json": [
|
|
352
|
+
{"type": "heading", "level": 2, "children": [{"text": "测试结果"}]},
|
|
353
|
+
{
|
|
354
|
+
"type": "table",
|
|
355
|
+
"data": {"headless": true, "width": [100, 200, 100]},
|
|
356
|
+
"children": [
|
|
357
|
+
{
|
|
358
|
+
"type": "table-row",
|
|
359
|
+
"children": [
|
|
360
|
+
{"type": "table-cell", "data": {"rowspan": 1, "colspan": 1}, "children": [{"type": "paragraph", "children": [{"text": "用例"}]}]},
|
|
361
|
+
{"type": "table-cell", "data": {"rowspan": 1, "colspan": 1}, "children": [{"type": "paragraph", "children": [{"text": "描述"}]}]},
|
|
362
|
+
{"type": "table-cell", "data": {"rowspan": 1, "colspan": 1}, "children": [{"type": "paragraph", "children": [{"text": "状态"}]}]}
|
|
363
|
+
]
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"type": "table-row",
|
|
367
|
+
"children": [
|
|
368
|
+
{"type": "table-cell", "data": {"rowspan": 1, "colspan": 1}, "children": [{"type": "paragraph", "children": [{"text": "TC-001"}]}]},
|
|
369
|
+
{"type": "table-cell", "data": {"rowspan": 1, "colspan": 1}, "children": [{"type": "paragraph", "children": [{"text": "登录功能"}]}]},
|
|
370
|
+
{"type": "table-cell", "data": {"rowspan": 1, "colspan": 1}, "children": [{"type": "paragraph", "children": [{"text": "通过", "font-color": "#00B341"}]}]}
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
]
|
|
374
|
+
}
|
|
375
|
+
]
|
|
376
|
+
}
|
|
377
|
+
]
|
|
378
|
+
EOF
|
|
379
|
+
|
|
380
|
+
python3 scripts/ku_operator.py edit-content \
|
|
381
|
+
--doc-id D5JiZRULjdEJHR \
|
|
382
|
+
--operations-file /tmp/ops.json \
|
|
383
|
+
--publish
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
## 输出说明
|
|
387
|
+
|
|
388
|
+
返回 JSON,成功时包含每个操作的结果:
|
|
389
|
+
|
|
390
|
+
```json
|
|
391
|
+
{
|
|
392
|
+
"returnCode": 200,
|
|
393
|
+
"result": {
|
|
394
|
+
"docGuid": "D5JiZRULjdEJHR",
|
|
395
|
+
"success": true,
|
|
396
|
+
"operations": [
|
|
397
|
+
{"success": true},
|
|
398
|
+
{"success": true}
|
|
399
|
+
]
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
## 注意事项
|
|
405
|
+
|
|
406
|
+
- **必须传 `--publish`**:不传 `--publish` 时编辑仅在编辑态可见,预览态/只读态看不到变更
|
|
407
|
+
- **operations 中的操作按顺序执行**:前面操作可能影响后续操作(如删除节点后其 blockId 失效)
|
|
408
|
+
- **替换操作**:没有原生 replace mode,用「sibling 插入 + delete 删除」组合实现
|
|
409
|
+
- **大内容拆分**:如果内容非常多,建议拆分为多次调用,避免网关超时(504)
|
|
410
|
+
- **json 中的 blockId 可省略**:新插入的节点不需要提供 blockId,编辑器会自动生成
|
|
411
|
+
|
|
412
|
+
## 表格编辑指南
|
|
413
|
+
|
|
414
|
+
### 表格是原子性 block
|
|
415
|
+
|
|
416
|
+
表格在编辑器中是一个完整的 block,**不支持**单独增删行/列。要修改表格内容,必须**替换整个表格 block**。
|
|
417
|
+
|
|
418
|
+
### 替换表格的正确做法(重要)
|
|
419
|
+
|
|
420
|
+
替换表格时,**必须拆成两次独立的 API 调用**。将 delete 和 sibling 放在同一个 operations 数组中会导致 API 返回 success 但表格无实际变化(静默失败)。
|
|
421
|
+
|
|
422
|
+
**正确步骤:**
|
|
423
|
+
|
|
424
|
+
**第 1 步:删除旧表格**
|
|
425
|
+
|
|
426
|
+
```bash
|
|
427
|
+
cat > /tmp/delete_table.json << 'EOF'
|
|
428
|
+
[
|
|
429
|
+
{
|
|
430
|
+
"mode": "delete",
|
|
431
|
+
"blockId": "docyg-旧表格的blockId",
|
|
432
|
+
"json": []
|
|
433
|
+
}
|
|
434
|
+
]
|
|
435
|
+
EOF
|
|
436
|
+
|
|
437
|
+
python3 scripts/ku_operator.py edit-content \
|
|
438
|
+
--doc-id <文档ID> \
|
|
439
|
+
--operations-file /tmp/delete_table.json \
|
|
440
|
+
--publish
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
**第 2 步:插入新表格**
|
|
444
|
+
|
|
445
|
+
在旧表格的**相邻 block** 下方插入新表格(使用 position: 1):
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
cat > /tmp/insert_table.json << 'EOF'
|
|
449
|
+
[
|
|
450
|
+
{
|
|
451
|
+
"mode": "sibling",
|
|
452
|
+
"blockId": "docyg-旧表格前一个block的blockId",
|
|
453
|
+
"position": 1,
|
|
454
|
+
"json": [
|
|
455
|
+
{
|
|
456
|
+
"type": "table",
|
|
457
|
+
"data": {"headless": true, "width": [150, 150, 150]},
|
|
458
|
+
"children": [
|
|
459
|
+
{
|
|
460
|
+
"type": "table-row",
|
|
461
|
+
"children": [
|
|
462
|
+
{"type": "table-cell", "data": {"rowspan": 1, "colspan": 1}, "children": [{"type": "paragraph", "children": [{"text": "列1"}]}]},
|
|
463
|
+
{"type": "table-cell", "data": {"rowspan": 1, "colspan": 1}, "children": [{"type": "paragraph", "children": [{"text": "列2"}]}]},
|
|
464
|
+
{"type": "table-cell", "data": {"rowspan": 1, "colspan": 1}, "children": [{"type": "paragraph", "children": [{"text": "列3"}]}]}
|
|
465
|
+
]
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"type": "table-row",
|
|
469
|
+
"children": [
|
|
470
|
+
{"type": "table-cell", "data": {"rowspan": 1, "colspan": 1}, "children": [{"type": "paragraph", "children": [{"text": "数据1"}]}]},
|
|
471
|
+
{"type": "table-cell", "data": {"rowspan": 1, "colspan": 1}, "children": [{"type": "paragraph", "children": [{"text": "数据2"}]}]},
|
|
472
|
+
{"type": "table-cell", "data": {"rowspan": 1, "colspan": 1}, "children": [{"type": "paragraph", "children": [{"text": "数据3"}]}]}
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
]
|
|
476
|
+
}
|
|
477
|
+
]
|
|
478
|
+
}
|
|
479
|
+
]
|
|
480
|
+
EOF
|
|
481
|
+
|
|
482
|
+
python3 scripts/ku_operator.py edit-content \
|
|
483
|
+
--doc-id <文档ID> \
|
|
484
|
+
--operations-file /tmp/insert_table.json \
|
|
485
|
+
--publish
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### 获取 blockId 的方法
|
|
489
|
+
|
|
490
|
+
使用 `query-content --raw-json` 获取文档原始 JSON 结构,其中每个 block 都包含 `blockId` 字段:
|
|
491
|
+
|
|
492
|
+
```bash
|
|
493
|
+
python3 scripts/ku_operator.py query-content --doc-id <文档ID> --raw-json
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
输出中找到目标表格的 `blockId`(格式如 `docyg-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`),以及其前一个 block 的 `blockId`(用于第 2 步定位插入位置)。
|
|
497
|
+
|
|
498
|
+
### 表格 JSON 结构模板
|
|
499
|
+
|
|
500
|
+
```json
|
|
501
|
+
{
|
|
502
|
+
"type": "table",
|
|
503
|
+
"data": {
|
|
504
|
+
"headless": true,
|
|
505
|
+
"width": [150, 200, 150]
|
|
506
|
+
},
|
|
507
|
+
"children": [
|
|
508
|
+
{
|
|
509
|
+
"type": "table-row",
|
|
510
|
+
"children": [
|
|
511
|
+
{
|
|
512
|
+
"type": "table-cell",
|
|
513
|
+
"data": {"rowspan": 1, "colspan": 1},
|
|
514
|
+
"children": [
|
|
515
|
+
{"type": "paragraph", "children": [{"text": "表头1"}]}
|
|
516
|
+
]
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"type": "table-cell",
|
|
520
|
+
"data": {"rowspan": 1, "colspan": 1},
|
|
521
|
+
"children": [
|
|
522
|
+
{"type": "paragraph", "children": [{"text": "表头2"}]}
|
|
523
|
+
]
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
"type": "table-cell",
|
|
527
|
+
"data": {"rowspan": 1, "colspan": 1},
|
|
528
|
+
"children": [
|
|
529
|
+
{"type": "paragraph", "children": [{"text": "表头3"}]}
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
]
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"type": "table-row",
|
|
536
|
+
"children": [
|
|
537
|
+
{
|
|
538
|
+
"type": "table-cell",
|
|
539
|
+
"data": {"rowspan": 1, "colspan": 1},
|
|
540
|
+
"children": [
|
|
541
|
+
{"type": "paragraph", "children": [{"text": "值1"}]}
|
|
542
|
+
]
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"type": "table-cell",
|
|
546
|
+
"data": {"rowspan": 1, "colspan": 1},
|
|
547
|
+
"children": [
|
|
548
|
+
{"type": "paragraph", "children": [{"text": "值2"}]}
|
|
549
|
+
]
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
"type": "table-cell",
|
|
553
|
+
"data": {"rowspan": 1, "colspan": 1},
|
|
554
|
+
"children": [
|
|
555
|
+
{"type": "paragraph", "children": [{"text": "值3"}]}
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
]
|
|
559
|
+
}
|
|
560
|
+
]
|
|
561
|
+
}
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
**关键字段说明:**
|
|
565
|
+
- `data.width`:数组长度 = 列数,每个值为列宽(像素)
|
|
566
|
+
- `data.headless`:`true` 表示无表头样式区分
|
|
567
|
+
- 每个 `table-cell` 内的 `children` 必须包含至少一个 `paragraph` 节点
|
|
568
|
+
- `rowspan` / `colspan` 用于合并单元格
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# move-doc — 移动文档
|
|
2
|
+
|
|
3
|
+
移动文档到目标知识库的指定位置。
|
|
4
|
+
|
|
5
|
+
## CLI 用法
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
python3 scripts/ku_operator.py move-doc --doc-id <文档ID> --to-repo-guid <目标知识库ID>
|
|
9
|
+
python3 scripts/ku_operator.py move-doc --doc-id <文档ID> --to-repo-guid <目标知识库ID> --to-parent-guid <目标父目录ID>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 参数表
|
|
13
|
+
|
|
14
|
+
| 参数 | 必填 | 说明 |
|
|
15
|
+
|------|------|------|
|
|
16
|
+
| `--doc-id` | 是 | 要移动的文档 ID |
|
|
17
|
+
| `--to-repo-guid` | 是 | 目标知识库 ID |
|
|
18
|
+
| `--to-parent-guid` | 否 | 目标父目录 ID,不传则移动到根目录 |
|
|
19
|
+
|
|
20
|
+
## 输出说明
|
|
21
|
+
|
|
22
|
+
返回 JSON 格式结果,关键字段:
|
|
23
|
+
- `docGuid` — 被移动文档的 ID
|
|
24
|
+
- 操作成功时返回 JSON 中不包含 `error` 字段
|
|
25
|
+
|
|
26
|
+
> 操作者用户名自动从环境变量 `COMATE_USERNAME` 读取,无需手动传入。
|
|
27
|
+
|
|
28
|
+
## 使用示例
|
|
29
|
+
|
|
30
|
+
### 移动到知识库根目录
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
python3 scripts/ku_operator.py move-doc \
|
|
34
|
+
--doc-id ABC123 \
|
|
35
|
+
--to-repo-guid B8wSneaLSC
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 移动到指定目录下
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
python3 scripts/ku_operator.py move-doc \
|
|
42
|
+
--doc-id ABC123 \
|
|
43
|
+
--to-repo-guid B8wSneaLSC \
|
|
44
|
+
--to-parent-guid XYZ789
|
|
45
|
+
```
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# query-comment — 查询文档评论
|
|
2
|
+
|
|
3
|
+
查询指定文档的评论信息。默认同时查询底部评论和划线评论,输出格式化文本。
|
|
4
|
+
|
|
5
|
+
## CLI 用法
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
python3 scripts/ku_operator.py query-comment --doc-id <文档ID> [--type all|bottom|side] [--page N] [--page-size N] [--raw-json]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 参数表
|
|
12
|
+
|
|
13
|
+
| 参数 | 必填 | 说明 |
|
|
14
|
+
|------|------|------|
|
|
15
|
+
| `--doc-id` | 是 | 文档 ID |
|
|
16
|
+
| `--type` | 否 | 评论类型:`all`=全部(默认), `bottom`=底部评论, `side`=划线评论 |
|
|
17
|
+
| `--page` | 否 | 页码,默认 1 |
|
|
18
|
+
| `--page-size` | 否 | 每页条数,默认 100 |
|
|
19
|
+
| `--raw-json` | 否 | 输出原始 JSON(不做格式化) |
|
|
20
|
+
|
|
21
|
+
## 输出说明
|
|
22
|
+
|
|
23
|
+
默认输出格式化文本,包含评论摘要和分区展示:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
文档 D5JiZRULjdEJHR 评论(底部 2 条,划线 1 条)
|
|
27
|
+
|
|
28
|
+
## 底部评论(2 条)
|
|
29
|
+
|
|
30
|
+
1. 王哲 (wangzhe12) · 2026-03-20 10:00
|
|
31
|
+
这是一条评论
|
|
32
|
+
|
|
33
|
+
2. 张三 (zhangsan) · 2026-03-20 11:00
|
|
34
|
+
这是另一条评论
|
|
35
|
+
└─ 李四 (lisi) · 2026-03-20 11:05
|
|
36
|
+
这是一条回复
|
|
37
|
+
|
|
38
|
+
## 划线评论(1 条)
|
|
39
|
+
|
|
40
|
+
1. 王哲 (wangzhe12) · 2026-03-20 12:00
|
|
41
|
+
引用: "被标注的文字"
|
|
42
|
+
└─ 张三 (zhangsan) · 2026-03-20 12:05
|
|
43
|
+
针对标注的回复
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
传 `--raw-json` 时输出原始 API 响应 JSON。
|
|
47
|
+
|
|
48
|
+
## 使用示例
|
|
49
|
+
|
|
50
|
+
### 查询全部评论(默认)
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
python3 scripts/ku_operator.py query-comment \
|
|
54
|
+
--doc-id D5JiZRULjdEJHR
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 只查底部评论
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
python3 scripts/ku_operator.py query-comment \
|
|
61
|
+
--doc-id D5JiZRULjdEJHR \
|
|
62
|
+
--type bottom
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 只查划线评论
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
python3 scripts/ku_operator.py query-comment \
|
|
69
|
+
--doc-id D5JiZRULjdEJHR \
|
|
70
|
+
--type side
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 输出原始 JSON
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
python3 scripts/ku_operator.py query-comment \
|
|
77
|
+
--doc-id D5JiZRULjdEJHR \
|
|
78
|
+
--raw-json
|
|
79
|
+
```
|