@xqyz/xq-cli 0.2.1 → 0.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/CHANGELOG.md +30 -0
- package/README.md +87 -3
- package/package.json +1 -1
- package/src/cli.mjs +964 -18
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,36 @@
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
### xq-cli `0.3.1` / WorkBuddy `0.10.1`
|
|
14
|
+
|
|
15
|
+
- 修复普通项目在后端 `task_status=6`(文件解析中)时被误判为多标包/EPC,导致没有调用正常大纲生成接口、任务长时间停留在解析状态的问题。
|
|
16
|
+
- 轮询 GET 请求统一增加网络重试,并识别 `stream has been aborted`、连接提前关闭等瞬时传输错误;不会因一次流中断误报生成失败。
|
|
17
|
+
- WorkBuddy 对大纲阶段的传输中断保留同一 `cid` 继续核验,禁止重复创建任务;新增回归测试覆盖该恢复路径。
|
|
18
|
+
- 本次配套版本:`@xqyz/xq-cli@0.3.1`、`@xqyz/workbuddy-plugin-xique@0.10.1`、Connector `0.10.1`。
|
|
19
|
+
|
|
20
|
+
### WorkBuddy / SkillHub(待发布)
|
|
21
|
+
|
|
22
|
+
- 修复 SkillHub 旧版 Skill 将用户明确选择的“规划”强制改为“快速”的规则冲突;规划模式现在必须传递 `--plan-mode 1`。
|
|
23
|
+
- 增加 Skill 文案回归断言,禁止再次出现“固定使用计划模式=快速”或“不得接受规划模式”。
|
|
24
|
+
- 发布清单新增 SkillHub 同步、客户本地更新和新会话验收步骤,避免 npm Plugin 与 SkillHub Skill 版本脱节。
|
|
25
|
+
|
|
26
|
+
## [0.3.0] - 2026-08-14
|
|
27
|
+
|
|
28
|
+
### xq-cli
|
|
29
|
+
|
|
30
|
+
- 新增 `xq-cli plan` 规划模式命令链,覆盖补充/修正信息、确认生成/重新生成大纲、AI 调整大纲候选、确认采用候选、生成最终目录、重新生成目录、目录查看/修改和正文续写。
|
|
31
|
+
- 补充/修正与 AI 调整结果先保存在本地任务状态,只有在用户明确确认 `plan confirm-outline` 或 `plan directory-generate` / `plan directory-regenerate` 后才会触发对应后台写入或生成请求。
|
|
32
|
+
- AI 大纲候选不再生成本地伪章节 ID;最终保存请求与前端一致,仅提交章节内容、主题、重要度和续写标记,交由后台分配节点 ID。
|
|
33
|
+
- 增加规划模式模拟 API 回归测试,覆盖意见提交、AI 候选不提前落库、候选确认和最终目录生成的顺序。
|
|
34
|
+
|
|
35
|
+
## [0.10.0] - 2026-08-14
|
|
36
|
+
|
|
37
|
+
### WorkBuddy
|
|
38
|
+
|
|
39
|
+
- 固定依赖 `@xqyz/xq-cli@0.3.0`,支持完整规划模式命令链。
|
|
40
|
+
- 更新 Skill、安装脚本、MCP Server、MCP App 和 Connector 启动参数到 `0.10.0`。
|
|
41
|
+
- 通过 32 项 WorkBuddy 功能测试和 npm 包冒烟测试;npm `latest` 已指向 `0.10.0`。
|
|
42
|
+
|
|
13
43
|
## [0.2.1] - 2026-08-11
|
|
14
44
|
|
|
15
45
|
### 安全性
|
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@ Project execution rules for agents live in [AGENTS.md](./AGENTS.md). That file d
|
|
|
7
7
|
Project maintenance documents:
|
|
8
8
|
|
|
9
9
|
- [Version changelog](./CHANGELOG.md)
|
|
10
|
+
- [Version and iteration history](./docs/VERSION-HISTORY.md)
|
|
10
11
|
- [Release process](./docs/RELEASING.md)
|
|
11
12
|
|
|
12
13
|
## Install from npm
|
|
@@ -53,7 +54,8 @@ npm install -g .\xqyz-xq-cli-0.2.0.tgz
|
|
|
53
54
|
```bash
|
|
54
55
|
xq-cli login
|
|
55
56
|
xq-cli login --name your-account --password your-password
|
|
56
|
-
xq-cli login --
|
|
57
|
+
xq-cli login --api-key xq_sk_xxx
|
|
58
|
+
xq-cli login --browser
|
|
57
59
|
xq-cli wizard
|
|
58
60
|
xq-cli wizard --file D:\bids\tender.docx
|
|
59
61
|
xq-cli init --file D:\bids\tender.docx --wait
|
|
@@ -72,9 +74,9 @@ xq-cli export --cid <cid> --interactive --out D:\output
|
|
|
72
74
|
xq-cli export --cid <cid> --out D:\output
|
|
73
75
|
```
|
|
74
76
|
|
|
75
|
-
Fresh installs default to the production API address `https://ai.bidfile.qianlima.com/api`. Use `--base-url` only when you need to target another
|
|
77
|
+
Fresh installs default to the production API address `https://ai.bidfile.qianlima.com/api`. Use `--base-url` only when you need to target another API endpoint.
|
|
76
78
|
|
|
77
|
-
`login` now defaults to browser authorization. If you explicitly pass `--name` and `--password`, the CLI falls back to password login.
|
|
79
|
+
`login` now defaults to browser authorization. If you explicitly pass `--name` and `--password`, the CLI falls back to password login. If you pass `--api-key`, it saves the API key locally and uses it for later requests.
|
|
78
80
|
|
|
79
81
|
`directory view` reads the complete generated directory tree without triggering outline, directory, or content generation. Add `--json` for the raw API structure, or `--out <file-or-directory>` to save a UTF-8 JSON document.
|
|
80
82
|
|
|
@@ -128,6 +130,39 @@ xq-cli outline update --cid <cid> --file D:\output\outline.json --yes --allow-de
|
|
|
128
130
|
|
|
129
131
|
The update command automatically calculates `updateFlag` by comparing the edited file with the latest server outline. Changes to chapter titles or themes may cause the backend to regenerate affected child directories asynchronously.
|
|
130
132
|
|
|
133
|
+
## 完整规划模式流程
|
|
134
|
+
|
|
135
|
+
规划模式不是一次命令跑到底,而是把前端的“智能解读 → 大纲 → 目录 → 正文”拆成可恢复的阶段。先用普通 `outline --plan-mode planning` 启动任务;拿到 `cid` 后,用 `plan` 子命令推进后续阶段:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# 1. 补充或修正招标文件理解(只写入本地待提交区,不会请求后台)
|
|
139
|
+
xq-cli plan status --cid <cid> --json
|
|
140
|
+
xq-cli plan feedback --cid <cid> --text "补充项目实施边界" --quote "原文片段"
|
|
141
|
+
xq-cli plan correction --cid <cid> --file D:\output\corrections.json
|
|
142
|
+
|
|
143
|
+
# 2. 用户确认后,提交意见并生成/重新生成大纲
|
|
144
|
+
xq-cli plan confirm-outline --cid <cid> --yes --wait --json
|
|
145
|
+
|
|
146
|
+
# 3. 查看大纲;需要 AI 调整时先生成候选,不会立即改后台
|
|
147
|
+
xq-cli plan outline-view --cid <cid> --json
|
|
148
|
+
xq-cli plan outline-ai-adjust --cid <cid> --prompt "拆分实施方案和质量保障" --out D:\output
|
|
149
|
+
xq-cli plan outline-ai-apply --cid <cid> --file D:\output\outline-ai-<cid>.json --yes
|
|
150
|
+
|
|
151
|
+
# 4. 用户确认候选大纲后,保存大纲并生成最终目录(不会生成正文)
|
|
152
|
+
xq-cli plan directory-generate --cid <cid> --yes --wait
|
|
153
|
+
|
|
154
|
+
# 5. 查看/编辑目录;如果需要重新生成目录,必须明确确认
|
|
155
|
+
xq-cli plan directory-view --cid <cid> --json
|
|
156
|
+
xq-cli plan directory-update --cid <cid> --file D:\output\directory.json --dry-run
|
|
157
|
+
xq-cli plan directory-regenerate --cid <cid> --yes --wait
|
|
158
|
+
|
|
159
|
+
# 6. 目录确认后才开始正文和导出
|
|
160
|
+
xq-cli plan write --cid <cid> --wait
|
|
161
|
+
xq-cli export --cid <cid> --out D:\output
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
要点:`plan status` 是恢复和重跑前的权威入口;`plan feedback` / `plan correction` 只写本地暂存,不会重复请求后台;`plan outline-ai-adjust` 会请求 AI 但只返回候选,`plan outline-ai-apply` 仍只写本地候选且不带伪造章节 ID。只有 `plan confirm-outline`、`plan directory-generate` / `plan directory-regenerate` 明确确认后才会产生后台写入或启动阶段;首次目录必须使用 `directory-generate`,已有目录覆盖才使用 `directory-regenerate`。
|
|
165
|
+
|
|
131
166
|
## Interactive menus
|
|
132
167
|
|
|
133
168
|
Use the full wizard if you want a CLI flow close to the frontend configuration panel:
|
|
@@ -155,6 +190,55 @@ xq-cli outline --cid <cid> --interactive --wait
|
|
|
155
190
|
xq-cli export --cid <cid> --interactive --out D:\output
|
|
156
191
|
```
|
|
157
192
|
|
|
193
|
+
## Agent / Codex usage
|
|
194
|
+
|
|
195
|
+
When another agent (Codex, OpenCLI, or an MCP wrapper) invokes `xq-cli`, it
|
|
196
|
+
must treat bid generation as a stateful sequence rather than a single command:
|
|
197
|
+
|
|
198
|
+
```text
|
|
199
|
+
init (source file) -> outline (confirmed config + plan mode) -> review
|
|
200
|
+
-> directory review (planning mode) -> write -> export
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
`--plan-mode` belongs on `outline`, not on `write` or `export`:
|
|
204
|
+
|
|
205
|
+
- `0` / `quick`: enter outline generation quickly; use when the user requests
|
|
206
|
+
a quick first run or explicitly chooses 快速.
|
|
207
|
+
- `1` / `planning`: enable the backend's fuller planning phase; it can take
|
|
208
|
+
longer, so use `--wait` and do not shorten the polling timeout. Use the
|
|
209
|
+
dedicated `plan` commands to collect corrections, review AI candidates,
|
|
210
|
+
generate/re-generate the directory, and stop at every confirmation gate.
|
|
211
|
+
|
|
212
|
+
The backend may report `plan_mode_phase=0..3` (`analysis`, `outline`,
|
|
213
|
+
`directory`, `content`) while polling. This is progress information, not a
|
|
214
|
+
subcommand. If the CLI returns `reference_selection_required` or
|
|
215
|
+
`supplement_required`, stop and ask the user for the required choice/input;
|
|
216
|
+
never invent it. `outline view` is read-only and safe for verification.
|
|
217
|
+
|
|
218
|
+
For planning mode, the agent must pause at three human confirmation gates:
|
|
219
|
+
|
|
220
|
+
1. collect any `plan feedback` / `plan correction`, then call
|
|
221
|
+
`plan confirm-outline` only after the user confirms generation;
|
|
222
|
+
2. show the outline. `plan outline-ai-adjust` returns an editable candidate,
|
|
223
|
+
and `plan outline-ai-apply` accepts it locally without writing the backend;
|
|
224
|
+
3. after the user confirms the final outline, call `plan directory-generate`,
|
|
225
|
+
show the directory, and wait for final directory confirmation before
|
|
226
|
+
`plan write`.
|
|
227
|
+
|
|
228
|
+
Use `plan directory-regenerate` only after an explicit request to replace the
|
|
229
|
+
existing directory. It is not a retry/status command. Fast mode has only the
|
|
230
|
+
outline confirmation gate and can then proceed to `write`.
|
|
231
|
+
|
|
232
|
+
For non-TTY or JSON automation, do not silently choose generation settings.
|
|
233
|
+
Ask for the missing configuration, print the final summary, wait for a clear
|
|
234
|
+
confirmation (`确认`, `开始`, or `就按这个跑`), then run the commands. Validate
|
|
235
|
+
enum values with `xq-cli choices outline --json` and
|
|
236
|
+
`xq-cli choices export --json` before constructing arguments. See
|
|
237
|
+
[`AGENTS.md`](./AGENTS.md) for the complete confirmation order and value map.
|
|
238
|
+
For the complete meaning of every outline/export choice, defaults, image-style
|
|
239
|
+
dependencies, EPC/multi-bid rules, margins, colors, and `--style-json`, see
|
|
240
|
+
[`docs/AGENT-PARAMETER-GUIDE.md`](./docs/AGENT-PARAMETER-GUIDE.md).
|
|
241
|
+
|
|
158
242
|
## Config choices
|
|
159
243
|
|
|
160
244
|
`xq-cli` now exposes the same major bid-book generation settings that the frontend outline/download flow uses.
|