@qoder-ai/qmind-cli 3.5.0 → 4.1.0
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 +19 -1
- package/CHANGELOG.zh-CN.md +19 -1
- package/README.md +65 -1
- package/README.zh-CN.md +65 -1
- package/bin/cli.js +1 -1
- package/dist/{bot-gateway-eajGWyYA.js → bot-gateway-B5cW3ErV.js} +1 -1
- package/dist/{imports-CebWSRju.js → imports-BZyUf1pq.js} +8 -8
- package/dist/{management-Avpo7nTn.js → management-DQVj17Hn.js} +17 -7
- package/dist/{notes-PwqGFJvk.js → notes-BRnv_Z10.js} +1 -1
- package/dist/qmind.js +2245 -119
- package/dist/{shared-DsqZroGJ.js → shared-53S5tNf6.js} +2 -0
- package/dist/{source-upload-DdZ0J4gC.js → source-upload-DlOLtECT.js} +1 -1
- package/dist/{transfers-SJE97RLg.js → transfers-cf1MXHdB.js} +7 -4
- package/dist/{wiki-branches-CNLpYYCl.js → wiki-branches-DmgHlIxc.js} +1 -1
- package/package.json +16 -13
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@ English (default) | [简体中文](CHANGELOG.zh-CN.md)
|
|
|
4
4
|
|
|
5
5
|
Published versions below describe the Global CLI/shared implementation, not historical CN releases. CN will join the shared history with the future joint release.
|
|
6
6
|
|
|
7
|
+
## 4.1.0
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 17bb94f: Add notebook discovery with summaries, single-page URL import, scheduled-task CRUD and pause/resume, bounded Source reads, directory filtering and batch deletion to `qmind-cn` and its Global counterpart. New workflows reuse Agent Core validation and confirmed/unknown mutation results. Existing notebook output retains overview and counts; deletion supports JSON/NDJSON receipts and stops on failed preflight.
|
|
12
|
+
|
|
13
|
+
Use `retrieve --unified` or `--targets` for unified single/multi-notebook retrieval with per-notebook Source filters; `--score-threshold` also works on the existing retrieval path. Use `source mkdir --derive-path` and `source mv --to/--to-root` for derived paths and validated destinations. Existing retrieval, full-content and low-level Source patch behavior remains available. Unconfirmed direct writes report `outcome_unknown` with `retryable:false`; inspect current state before another call.
|
|
14
|
+
|
|
15
|
+
## 4.0.0
|
|
16
|
+
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- c0df079: Require Node.js 22.19.0 or later. Upgrade Node.js before installing this release if you use an older runtime.
|
|
20
|
+
|
|
21
|
+
Upgrade undici to 8.12.2, commander to 15.0.0, entities to 8.1.0, eventsource-parser to 4.1.2, open to 11.0.4, p-limit to 7.3.3, picomatch to 4.0.7, and zod to 4.6.7. Preserve existing HTTP/1.1 transport behavior and proxy policies.
|
|
22
|
+
|
|
23
|
+
Explicitly select English as the Global npm README and Chinese as the CN npm README. Use Qoder CN consistently as the CN product name in both languages.
|
|
24
|
+
|
|
7
25
|
## 3.5.0
|
|
8
26
|
|
|
9
27
|
### Minor Changes
|
|
@@ -62,7 +80,7 @@ Published versions below describe the Global CLI/shared implementation, not hist
|
|
|
62
80
|
|
|
63
81
|
### Major Changes
|
|
64
82
|
|
|
65
|
-
- 28508e5: Release QMind CLI as one shared-version Global/CN cohort. Keep `@qoder-ai/qmind-cli` / `qmind` for Qoder Global and introduce `@qodercn-ai/qmind-cli` / `qmind-cn` for Qoder
|
|
83
|
+
- 28508e5: Release QMind CLI as one shared-version Global/CN cohort. Keep `@qoder-ai/qmind-cli` / `qmind` for Qoder Global and introduce `@qodercn-ai/qmind-cli` / `qmind-cn` for Qoder CN. Each distribution now has a build-time-fixed product identity and production target, isolated product/target file credentials, bilingual package documentation and changelog, and an immutable dual-distribution candidate that is published automatically after its Changeset reaches `main`. The CLI no longer reads legacy root state or OS Keyring entries; upgrade the Global package and sign in again, and install the CN package separately when it is published.
|
|
66
84
|
|
|
67
85
|
### Changes without version bumps
|
|
68
86
|
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,6 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
以下已发布版本属于 Global CLI / 共享实现,不代表 CN 曾发布过这些版本。CN 将在后续共同发行版加入同一历史。
|
|
6
6
|
|
|
7
|
+
## 4.1.0
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 17bb94f: 为 `qmind-cn` 及对应 Global CLI 增加带摘要的知识库发现、单页 URL 导入、定时任务 CRUD 与暂停/恢复、有界 Source 正文读取、目录过滤和批量删除。新 workflow 复用 Agent Core 校验及确定/未知写入结果。既有知识库输出保留 overview 和数量;删除支持 JSON/NDJSON 回执,预读失败时停止。
|
|
12
|
+
|
|
13
|
+
使用 `retrieve --unified` 或 `--targets` 进行统一单库/多库检索并按库过滤 Source;既有检索入口也支持 `--score-threshold`。使用 `source mkdir --derive-path` 和 `source mv --to/--to-root` 推导路径并校验目标。原检索、全文读取与低层 Source patch 行为继续保留。未确认的直接写入返回 `outcome_unknown` 和 `retryable:false`;再次操作前先查询当前状态。
|
|
14
|
+
|
|
15
|
+
## 4.0.0
|
|
16
|
+
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- c0df079: 要求 Node.js 22.19.0 及以上版本。使用较旧运行时的用户须先升级 Node.js,再安装此版本。
|
|
20
|
+
|
|
21
|
+
将 undici 升级至 8.12.2、commander 升级至 15.0.0、entities 升级至 8.1.0、eventsource-parser 升级至 4.1.2、open 升级至 11.0.4、p-limit 升级至 7.3.3、picomatch 升级至 4.0.7、zod 升级至 4.6.7。保留既有 HTTP/1.1 传输行为与代理策略。
|
|
22
|
+
|
|
23
|
+
显式指定 Global npm README 默认为英文、CN npm README 默认为中文,并在中英文文档中统一使用 Qoder CN 产品名称。
|
|
24
|
+
|
|
7
25
|
## 3.5.0
|
|
8
26
|
|
|
9
27
|
### Minor Changes
|
|
@@ -62,7 +80,7 @@
|
|
|
62
80
|
|
|
63
81
|
### Major Changes
|
|
64
82
|
|
|
65
|
-
- 28508e5: 将 QMind CLI 作为共享版本的 Global/CN 共同发行版发布:Qoder Global 继续使用 `@qoder-ai/qmind-cli` / `qmind`,Qoder
|
|
83
|
+
- 28508e5: 将 QMind CLI 作为共享版本的 Global/CN 共同发行版发布:Qoder Global 继续使用 `@qoder-ai/qmind-cli` / `qmind`,Qoder CN 新增 `@qodercn-ai/qmind-cli` / `qmind-cn`。每个发行版都具有构建时固定的产品身份与正式目标、按产品/目标隔离的文件凭证、中英文 package 文档与 changelog,以及一个在 Changeset 进入 `main` 后自动发布的双发行物不可变候选。CLI 不再读取旧根目录状态或 OS Keyring 项;Global 用户升级后需要重新登录,CN 包正式发布后需单独安装。
|
|
66
84
|
|
|
67
85
|
### Changes without version bumps
|
|
68
86
|
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Package: `@qoder-ai/qmind-cli` · command: `qmind`
|
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
|
-
Node.js `>=
|
|
11
|
+
Node.js `>=22.19.0` is required.
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
14
|
npm install --global @qoder-ai/qmind-cli
|
|
@@ -64,6 +64,7 @@ Do not put tokens in command arguments, repositories, or logs. Run `qmind logout
|
|
|
64
64
|
| `retrieve` | Retrieve context without invoking an LLM |
|
|
65
65
|
| `rag` | Ask questions using a knowledge base |
|
|
66
66
|
| `task` | Manage task runs |
|
|
67
|
+
| `scheduled-task` | Manage notebook schedule configurations |
|
|
67
68
|
| `upload-folder` / `sync` | Synchronize a local directory |
|
|
68
69
|
| `image` | Obtain image upload or access URLs |
|
|
69
70
|
| `version` | Print version and build information |
|
|
@@ -128,3 +129,66 @@ qmind notebook get <notebook-id> --format json
|
|
|
128
129
|
```
|
|
129
130
|
|
|
130
131
|
Both notebook collections support `--page` and `--page-size`. `--shared` cannot be combined with `--filter-client`. Shared results use the same flat `notebooks` output as the ordinary list and preserve the membership `permission`. JSON/NDJSON preserve server-provided `access` (current role, member count and action permissions); Agent output expands these fields. Table lists show role and member count, while details show action permissions. Missing permissions are not inferred and display as `unknown` in tables.
|
|
132
|
+
|
|
133
|
+
## Commands aligned with Agent tools
|
|
134
|
+
|
|
135
|
+
Core-backed workflows (`notebook discover`, `source import-url/read/delete-batch`, `mkdir --derive-path`, `mv --to/--to-root`, unified retrieval, and `scheduled-task`) return `{ ok, data/error, meta }` after entering Agent Core, with `meta.operationId` identifying the operation. `--format ndjson` emits one complete result per line; `table` and `agent` also use this JSON result. CLI validation and host/credential failures before Core keep the existing CLI error format: `{ error }` on stdout for JSON/NDJSON, or text on stderr otherwise. Command usage errors and declined confirmations go to stderr. `source list --parent` keeps the existing Source-list output. Exit codes are 0 for success, 1 for partial success/runtime failure/cancellation, and 2 for invalid arguments. A successful write does not mean Source ingestion or a scheduled run has completed.
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
# Select retrieval-eligible owned/shared notebooks; continue with nextCursor when hasMore is true
|
|
139
|
+
qmind notebook discover --relationship all --page-size 20
|
|
140
|
+
qmind notebook discover --relationship all --cursor '<nextCursor>'
|
|
141
|
+
|
|
142
|
+
# Import a single page; inspect ingestion and content with source get / source read
|
|
143
|
+
qmind source import-url --nb <notebook-id> --url https://example.com/guide
|
|
144
|
+
qmind source list --nb <notebook-id> --parent <directory-id>
|
|
145
|
+
qmind source read <source-id> --nb <notebook-id> --offset 0 --max-chars 20000
|
|
146
|
+
|
|
147
|
+
# Derive paths from the actual parent and preserve the original basename when moving
|
|
148
|
+
qmind source mkdir --nb <notebook-id> --title guides --parent <directory-id> --derive-path
|
|
149
|
+
qmind source mv <source-id> --nb <notebook-id> --to <directory-id>
|
|
150
|
+
qmind source mv <source-id> --nb <notebook-id> --to-root
|
|
151
|
+
|
|
152
|
+
# 1..100 distinct IDs; confirm interactively or explicitly pass --force
|
|
153
|
+
qmind source delete-batch <source-id-1> <source-id-2> --nb <notebook-id> --force
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
`notebook list/get` JSON/NDJSON preserve the server's overview, sourceCount and materialCount. Agent output expands summary/topics; table lists include summaries and Source counts. `discover` supports owned/shared/all and cursors, defaults to all, and lists retrieval-eligible notebooks; use `list` for the management collection. An empty page may still have `hasMore:true`; continue with the same relationship.
|
|
157
|
+
|
|
158
|
+
`source read` checks ingestion status and returns `content/contentType/truncated/nextOffset`. It still fetches the entire body before slicing, so only output size is bounded. Existing `source content` full-text/download behavior is unchanged. `source list --parent` cannot be combined with `--all`.
|
|
159
|
+
|
|
160
|
+
`mkdir --derive-path` conflicts with `--path`. `mv --to/--to-root` conflicts with the legacy parent/path/rename/status options and only moves eligible leaf documents within one notebook, preserving the basename. Existing low-level mkdir/mv patch operations remain available.
|
|
161
|
+
|
|
162
|
+
Batch deletion returns the submitted sourceIds and successCount/failureCount; sourceIds is not a list of successfully deleted IDs. Partial failure exits 1. Reconcile current state before another call; do not guess failed IDs or replay the entire batch.
|
|
163
|
+
|
|
164
|
+
## Precise and unified retrieval
|
|
165
|
+
|
|
166
|
+
Existing `retrieve --nb` defaults and output remain unchanged. Explicit `--unified` or `--targets` selects the same unified retrieval workflow used by Agent tools, including notebook identity in single-notebook chunks:
|
|
167
|
+
|
|
168
|
+
```sh
|
|
169
|
+
qmind retrieve --nb <notebook-id> --unified --score-threshold 0.6 'Deployment process'
|
|
170
|
+
qmind retrieve --targets '[{"notebookId":"nb-1","sourceIds":["source-1"]},{"notebookId":"nb-2","sourceIds":["source-2"]}]' --max-results 8 'Deployment process'
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
`--targets` conflicts with `--nb` and `--sources` and supports independent Source filters per notebook. Unified retrieval defaults to maxResults=8 (1..50), with optional topK (1..100); zero selects the workflow default. There may be at most five unique targets. Results use the envelope above: read `data.chunks/data.promptContext`. `--score-threshold` accepts 0..1 and also works on the existing retrieval path. Zero budgets on the existing path still use server defaults; scripts are not silently migrated.
|
|
174
|
+
|
|
175
|
+
## Scheduled task configuration
|
|
176
|
+
|
|
177
|
+
```sh
|
|
178
|
+
qmind scheduled-task create --nb <notebook-id> --scene source_refresh --schedule 'CRON_TZ=Asia/Shanghai 0 9 * * *'
|
|
179
|
+
qmind scheduled-task list --nb <notebook-id> --enabled true --page 1 --page-size 20
|
|
180
|
+
qmind scheduled-task update <task-id> --nb <notebook-id> --schedule 'CRON_TZ=Asia/Shanghai 0 10 * * *'
|
|
181
|
+
qmind scheduled-task pause <task-id> --nb <notebook-id>
|
|
182
|
+
qmind scheduled-task resume <task-id> --nb <notebook-id>
|
|
183
|
+
qmind scheduled-task delete <task-id> --nb <notebook-id>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
`update --enabled false/true` also pauses/resumes. Creation defaults to enabled with empty config; arbitrary prompt/config inputs are not accepted. Updates only change schedule or enabled. Scenes are compilation, condensation, lint, source_refresh and source_binding_sync; the server decides actual availability and full Cron validity. An explicit IANA timezone is required. Compilation may be retired; source_binding_sync is currently a per-notebook singleton with a minimum five-minute interval. `list` supports `--task/--scene/--enabled`, with pageSize at most 20; the backend still reads all configurations for the notebook. Oversized config is marked `configTruncated:true`.
|
|
187
|
+
|
|
188
|
+
Configuration is separate from execution: use `task list --scheduled-task <task-id>` for run history. Pausing/deleting does not cancel dispatched runs; resuming an overdue schedule may trigger a run immediately. Execution retains the original creator identity; revoking membership does not guarantee schedules stop automatically.
|
|
189
|
+
|
|
190
|
+
## Unconfirmed writes
|
|
191
|
+
|
|
192
|
+
When a new command returns `error.code=outcome_unknown` and `retryable:false`, inspect current state before deciding what to do next; do not retry automatically. Existing direct-write commands also distinguish this state in JSON/NDJSON errors and retain the original causeCode/requestId. Unknown outcomes do not prove a request reached the server; a same-name resource does not prove this call created it.
|
|
193
|
+
|
|
194
|
+
`notebook delete` and `source delete` support JSON/NDJSON success receipts. Single-Source deletion stops if preflight cannot read the Source; only explicit `--force` skips directory confirmation. Default text output remains `deleted`.
|
package/README.zh-CN.md
CHANGED
|
@@ -8,7 +8,7 @@ npm 包:`@qoder-ai/qmind-cli` · 命令:`qmind`
|
|
|
8
8
|
|
|
9
9
|
## 安装
|
|
10
10
|
|
|
11
|
-
需要 Node.js `>=
|
|
11
|
+
需要 Node.js `>=22.19.0`。
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
14
|
npm install --global @qoder-ai/qmind-cli
|
|
@@ -64,6 +64,7 @@ qmind retrieve --nb <notebook-id> --format agent "部署流程是什么?"
|
|
|
64
64
|
| `retrieve` | 检索上下文,不发起 LLM 调用 |
|
|
65
65
|
| `rag` | 基于知识库提问 |
|
|
66
66
|
| `task` | 管理任务运行 |
|
|
67
|
+
| `scheduled-task` | 管理知识库定时任务配置 |
|
|
67
68
|
| `upload-folder` / `sync` | 同步本地目录 |
|
|
68
69
|
| `image` | 获取图片上传地址或访问地址 |
|
|
69
70
|
| `version` | 查看版本和构建信息 |
|
|
@@ -128,3 +129,66 @@ qmind notebook get <notebook-id> --format json
|
|
|
128
129
|
```
|
|
129
130
|
|
|
130
131
|
普通列表和共享列表均支持 `--page`、`--page-size`;`--shared` 不可与 `--filter-client` 组合。共享列表使用与普通列表一致的扁平 `notebooks` 输出,并保留共享关系的 `permission`。JSON/NDJSON 保留服务端返回的 `access`(当前角色、成员数及各操作权限);Agent 输出展开这些字段,表格列表显示角色与成员数,详情显示操作权限。缺失的权限不进行推断,表格显示 `unknown`。
|
|
132
|
+
|
|
133
|
+
## 与 Agent 工具一致的命令
|
|
134
|
+
|
|
135
|
+
复用 Core 的 workflow(`notebook discover`、`source import-url/read/delete-batch`、`mkdir --derive-path`、`mv --to/--to-root`、统一检索和 `scheduled-task`)在进入 Agent Core 后返回 `{ ok, data/error, meta }`,其中 `meta.operationId` 标识本次操作。`--format ndjson` 每次操作输出一行完整结果;`table` 和 `agent` 也使用这个 JSON 结果。进入 Core 前的 CLI 参数校验、Host/凭据错误沿用原 CLI 错误格式:JSON/NDJSON 向 stdout 输出 `{ error }`,其他格式向 stderr 输出文本。命令用法错误和取消确认写入 stderr。`source list --parent` 保留原 Source 列表输出。成功退出 0,部分成功/运行失败/取消退出 1,参数错误退出 2。写入成功不表示 Source 已完成解析或调度任务已执行。
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
# 从可检索的自有/共享库中选库;有 hasMore 时继续使用 nextCursor
|
|
139
|
+
qmind notebook discover --relationship all --page-size 20
|
|
140
|
+
qmind notebook discover --relationship all --cursor '<nextCursor>'
|
|
141
|
+
|
|
142
|
+
# 普通单页导入;上传后用 source get / source read 查看状态和正文
|
|
143
|
+
qmind source import-url --nb <notebook-id> --url https://example.com/guide
|
|
144
|
+
qmind source list --nb <notebook-id> --parent <directory-id>
|
|
145
|
+
qmind source read <source-id> --nb <notebook-id> --offset 0 --max-chars 20000
|
|
146
|
+
|
|
147
|
+
# 按真实目录推导路径,移动时保留原始 basename
|
|
148
|
+
qmind source mkdir --nb <notebook-id> --title guides --parent <directory-id> --derive-path
|
|
149
|
+
qmind source mv <source-id> --nb <notebook-id> --to <directory-id>
|
|
150
|
+
qmind source mv <source-id> --nb <notebook-id> --to-root
|
|
151
|
+
|
|
152
|
+
# 1..100 个不同 ID;交互确认或显式 --force 后执行
|
|
153
|
+
qmind source delete-batch <source-id-1> <source-id-2> --nb <notebook-id> --force
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
`notebook list/get` 的 JSON/NDJSON 保留服务端 overview、sourceCount 和 materialCount;Agent 输出展开 summary/topics,表格列表增加摘要与 Source 数量。`discover` 支持 owned/shared/all 和游标,默认 all,只返回检索可用库;管理清单仍用 `list`。空页也可能 `hasMore:true`,不要直接判断已结束,续页须保持 relationship。
|
|
157
|
+
|
|
158
|
+
`source read` 先检查解析状态,返回 `content/contentType/truncated/nextOffset`。它仍取回全文再切片,只限制输出大小。原 `source content` 的全文输出/下载不变。`source list --parent` 不能与 `--all` 组合。
|
|
159
|
+
|
|
160
|
+
`mkdir --derive-path` 不能与 `--path` 组合;`mv --to/--to-root` 不能与旧 parent/path/rename/status 参数组合,仅移动当前库内可操作的叶子文档,保留原 basename。原来的低层 mkdir/mv patch 入口仍可使用。
|
|
161
|
+
|
|
162
|
+
批删返回提交的 sourceIds 和 successCount/failureCount,sourceIds 不是成功 ID 清单。部分失败退出 1,不能猜测失败对象或重放整批;先重新查询对账。
|
|
163
|
+
|
|
164
|
+
## 精确与统一检索
|
|
165
|
+
|
|
166
|
+
旧的 `retrieve --nb` 默认行为和输出形状保持不变。显式 `--unified` 或 `--targets` 使用与 Agent 工具一致的统一检索,单库也返回携带 Notebook 身份的 chunks:
|
|
167
|
+
|
|
168
|
+
```sh
|
|
169
|
+
qmind retrieve --nb <notebook-id> --unified --score-threshold 0.6 '部署流程'
|
|
170
|
+
qmind retrieve --targets '[{"notebookId":"nb-1","sourceIds":["source-1"]},{"notebookId":"nb-2","sourceIds":["source-2"]}]' --max-results 8 '部署流程'
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
`--targets` 不能与 `--nb` 或 `--sources` 组合,每库可独立过滤 Source。统一检索默认 maxResults=8(1..50),topK 可选(1..100),0 表示使用该 workflow 的默认值;最多五个唯一目标。结果采用上述结构化 envelope,读取 `data.chunks/data.promptContext`;`--score-threshold` 范围为 0..1,旧检索入口也支持。旧路径的零预算继续使用服务端默认值,不隐式切换旧脚本。
|
|
174
|
+
|
|
175
|
+
## 定时任务配置
|
|
176
|
+
|
|
177
|
+
```sh
|
|
178
|
+
qmind scheduled-task create --nb <notebook-id> --scene source_refresh --schedule 'CRON_TZ=Asia/Shanghai 0 9 * * *'
|
|
179
|
+
qmind scheduled-task list --nb <notebook-id> --enabled true --page 1 --page-size 20
|
|
180
|
+
qmind scheduled-task update <task-id> --nb <notebook-id> --schedule 'CRON_TZ=Asia/Shanghai 0 10 * * *'
|
|
181
|
+
qmind scheduled-task pause <task-id> --nb <notebook-id>
|
|
182
|
+
qmind scheduled-task resume <task-id> --nb <notebook-id>
|
|
183
|
+
qmind scheduled-task delete <task-id> --nb <notebook-id>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
`update --enabled false/true` 等价于暂停/恢复。创建默认启用、config 固定为空,不能提交任意 prompt/config;更新仅支持时间或 enabled。scene 为 compilation、condensation、lint、source_refresh、source_binding_sync,实际可用性和完整 Cron 语法由服务端裁决。必须显式提供 IANA 时区,不能依赖本机时区。compilation 可能已退役;source_binding_sync 当前是单库单例且间隔至少五分钟。`list` 可用 `--task/--scene/--enabled` 过滤,pageSize 最大 20;底层仍读取本库全量配置。过大的 config 会显示 `configTruncated:true`。
|
|
187
|
+
|
|
188
|
+
定时配置与执行记录分开:`task list --scheduled-task <task-id>` 查看执行记录。暂停/删除不取消已派发任务;恢复过期任务可能立即触发一次。调度沿用最初创建者身份,成员撤权不保证自动停任务。
|
|
189
|
+
|
|
190
|
+
## 写入结果不确定
|
|
191
|
+
|
|
192
|
+
新命令返回 `error.code=outcome_unknown`、`retryable:false` 时,先查询当前状态再决定后续操作,不能自动重试。旧直接写入命令在 JSON/NDJSON 错误中也区分该状态并保留原 causeCode/requestId。未知结果不证明请求已到达服务器;同名资源也不能证明是本次创建。
|
|
193
|
+
|
|
194
|
+
`notebook delete` 和 `source delete` 支持 JSON/NDJSON 成功回执。单 Source 删除的预读失败会停止,只有显式 `--force` 才跳过目录确认;原默认文本成功输出保持 `deleted`。
|
package/bin/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as nodeModule from 'node:module';
|
|
4
4
|
|
|
5
|
-
//
|
|
5
|
+
// Enable the cache before the application graph is loaded.
|
|
6
6
|
nodeModule.enableCompileCache?.();
|
|
7
7
|
|
|
8
8
|
await import('../dist/qmind.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Z as timestampSchema, a as invalidArgument, c as optionalRecord, d as pagination, h as requiredText, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, s as optionalBoolean, t as assertNonEmptyPatch, u as optionalTrimmedString } from "./shared-
|
|
1
|
+
import { Z as timestampSchema, a as invalidArgument, c as optionalRecord, d as pagination, h as requiredText, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, s as optionalBoolean, t as assertNonEmptyPatch, u as optionalTrimmedString } from "./shared-53S5tNf6.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region ../sdk/src/operations/bot-gateway-codecs.ts
|
|
4
4
|
const botTimestamp = z.preprocess((value) => typeof value === "object" && value !== null && !Array.isArray(value) && !("seconds" in value) ? {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as importProvidersSchema, T as fullSiteURLImportDiscoverySchema, _ as aliDingImportRunItemListSchema, a as invalidArgument, d as pagination, m as requiredString, n as call, nt as assertCapability, p as queryPath, tt as qmindFullSiteURLImportPageLimit, v as aliDingImportRunSchema, w as fullSiteURLImportConfirmationSchema } from "./shared-
|
|
1
|
+
import { O as importProvidersSchema, T as fullSiteURLImportDiscoverySchema, _ as aliDingImportRunItemListSchema, a as invalidArgument, d as pagination, m as requiredString, n as call, nt as assertCapability, p as queryPath, tt as qmindFullSiteURLImportPageLimit, v as aliDingImportRunSchema, w as fullSiteURLImportConfirmationSchema } from "./shared-53S5tNf6.js";
|
|
2
2
|
//#region ../sdk/src/operations/imports.ts
|
|
3
3
|
const aliDingHost = "alidocs.dingtalk.com";
|
|
4
4
|
const requestIdPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u;
|
|
@@ -68,7 +68,7 @@ function createImportOperations(context) {
|
|
|
68
68
|
idempotent: false,
|
|
69
69
|
method: "POST",
|
|
70
70
|
operation: "imports.fullSiteURL.confirm",
|
|
71
|
-
path: context.profile.
|
|
71
|
+
path: context.profile.apiPath("mind", "notebooks", notebook, "full-site-url-import", "discoveries", discovery, "confirm"),
|
|
72
72
|
schema: fullSiteURLImportConfirmationSchema
|
|
73
73
|
});
|
|
74
74
|
},
|
|
@@ -83,7 +83,7 @@ function createImportOperations(context) {
|
|
|
83
83
|
idempotent: true,
|
|
84
84
|
method: "POST",
|
|
85
85
|
operation: "imports.fullSiteURL.discover",
|
|
86
|
-
path: context.profile.
|
|
86
|
+
path: context.profile.apiPath("mind", "notebooks", notebook, "full-site-url-import", "discoveries"),
|
|
87
87
|
schema: fullSiteURLImportDiscoverySchema
|
|
88
88
|
});
|
|
89
89
|
},
|
|
@@ -97,7 +97,7 @@ function createImportOperations(context) {
|
|
|
97
97
|
idempotent: true,
|
|
98
98
|
method: "GET",
|
|
99
99
|
operation: "imports.aliDing.getRun",
|
|
100
|
-
path: context.profile.
|
|
100
|
+
path: context.profile.apiPath("mind", "notebooks", notebook, "aliding", "import-runs", run),
|
|
101
101
|
schema: aliDingImportRunSchema
|
|
102
102
|
});
|
|
103
103
|
},
|
|
@@ -106,7 +106,7 @@ function createImportOperations(context) {
|
|
|
106
106
|
const run = requiredString(runId, "runId");
|
|
107
107
|
const normalizedPage = pagination(input);
|
|
108
108
|
assertCapability(context.profile, "imports.aliDing", "imports.aliDing.listRunItems");
|
|
109
|
-
const base = context.profile.
|
|
109
|
+
const base = context.profile.apiPath("mind", "notebooks", notebook, "aliding", "import-runs", run, "items");
|
|
110
110
|
return call(context, {
|
|
111
111
|
callOptions: options,
|
|
112
112
|
capability: "imports.aliDing",
|
|
@@ -131,7 +131,7 @@ function createImportOperations(context) {
|
|
|
131
131
|
idempotent: true,
|
|
132
132
|
method: "GET",
|
|
133
133
|
operation: "imports.discover",
|
|
134
|
-
path: context.profile.
|
|
134
|
+
path: context.profile.apiPath("mind", "import-sources"),
|
|
135
135
|
schema: importProvidersSchema
|
|
136
136
|
});
|
|
137
137
|
},
|
|
@@ -146,7 +146,7 @@ function createImportOperations(context) {
|
|
|
146
146
|
idempotent: false,
|
|
147
147
|
method: "POST",
|
|
148
148
|
operation: "imports.aliDing.createKnowledgeBaseRun",
|
|
149
|
-
path: context.profile.
|
|
149
|
+
path: context.profile.apiPath("mind", "notebooks", notebook, "aliding", "knowledge-base-import-runs"),
|
|
150
150
|
schema: aliDingImportRunSchema
|
|
151
151
|
});
|
|
152
152
|
},
|
|
@@ -161,7 +161,7 @@ function createImportOperations(context) {
|
|
|
161
161
|
idempotent: false,
|
|
162
162
|
method: "POST",
|
|
163
163
|
operation: "imports.aliDing.createNodeSubtreeRun",
|
|
164
|
-
path: context.profile.
|
|
164
|
+
path: context.profile.apiPath("mind", "notebooks", notebook, "aliding", "node-subtree-import-runs"),
|
|
165
165
|
schema: aliDingImportRunSchema
|
|
166
166
|
});
|
|
167
167
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Q as voidResponseSchema, a as invalidArgument, c as optionalRecord, f as positiveInteger, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, s as optionalBoolean, t as assertNonEmptyPatch } from "./shared-
|
|
1
|
+
import { Q as voidResponseSchema, a as invalidArgument, c as optionalRecord, f as positiveInteger, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, s as optionalBoolean, t as assertNonEmptyPatch } from "./shared-53S5tNf6.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region ../sdk/src/operations/management-schemas.ts
|
|
4
4
|
const memberPermissionSchema = z.enum([
|
|
@@ -46,7 +46,7 @@ const scheduledTaskSceneSchema = z.enum([
|
|
|
46
46
|
"source_refresh",
|
|
47
47
|
"source_binding_sync"
|
|
48
48
|
]);
|
|
49
|
-
const
|
|
49
|
+
const scheduledTaskWireSchema = z.object({
|
|
50
50
|
config: z.record(z.string(), z.unknown()).default({}),
|
|
51
51
|
createdAt: z.string().default(""),
|
|
52
52
|
enabled: z.boolean().default(true),
|
|
@@ -59,6 +59,16 @@ const scheduledTaskSchema = z.object({
|
|
|
59
59
|
updatedAt: z.string().default(""),
|
|
60
60
|
userId: z.string().default("")
|
|
61
61
|
});
|
|
62
|
+
const scheduledTaskSchema = scheduledTaskWireSchema;
|
|
63
|
+
const confirmedScheduledTaskSchema = scheduledTaskWireSchema.extend({
|
|
64
|
+
config: z.record(z.string(), z.unknown()).nullish().transform((config) => config ?? {}),
|
|
65
|
+
notebookId: z.string().min(1),
|
|
66
|
+
schedule: z.string().min(1),
|
|
67
|
+
enabled: z.boolean()
|
|
68
|
+
});
|
|
69
|
+
const sashScheduledTaskDeletionSchema = z.union([z.object({}).strict(), z.undefined()]).transform(() => void 0);
|
|
70
|
+
const dashboardScheduledTaskDeletionSchema = z.union([z.object({ status: z.literal("ok") }).strict(), z.undefined()]).transform(() => void 0);
|
|
71
|
+
const sashScheduledTaskListSchema = z.object({ tasks: z.array(confirmedScheduledTaskSchema).nullable().transform((tasks) => tasks ?? []) });
|
|
62
72
|
const scheduledTaskListSchema = z.object({ tasks: z.array(scheduledTaskSchema).nullish().transform((tasks) => tasks ?? []) });
|
|
63
73
|
const compilationRunSchema = z.object({
|
|
64
74
|
compiledSourceCount: z.number().int().nonnegative().default(0),
|
|
@@ -178,7 +188,7 @@ function createManagementOperations(context) {
|
|
|
178
188
|
permission: memberPermission(input?.permission, "permission")
|
|
179
189
|
},
|
|
180
190
|
callOptions: options,
|
|
181
|
-
capability:
|
|
191
|
+
capability: "members",
|
|
182
192
|
idempotent: false,
|
|
183
193
|
method: "POST",
|
|
184
194
|
operation: "members.add",
|
|
@@ -223,7 +233,7 @@ function createManagementOperations(context) {
|
|
|
223
233
|
method: "POST",
|
|
224
234
|
operation: "scheduledTasks.create",
|
|
225
235
|
path: context.profile.apiPath("notebooks", notebook, "scheduled-tasks"),
|
|
226
|
-
schema:
|
|
236
|
+
schema: confirmedScheduledTaskSchema
|
|
227
237
|
});
|
|
228
238
|
},
|
|
229
239
|
async deleteScheduledTask(notebookId, taskId, options) {
|
|
@@ -236,7 +246,7 @@ function createManagementOperations(context) {
|
|
|
236
246
|
method: "DELETE",
|
|
237
247
|
operation: "scheduledTasks.delete",
|
|
238
248
|
path: context.profile.apiPath("notebooks", notebook, "scheduled-tasks", task),
|
|
239
|
-
schema:
|
|
249
|
+
schema: context.profile.access === "sash" ? sashScheduledTaskDeletionSchema : dashboardScheduledTaskDeletionSchema
|
|
240
250
|
});
|
|
241
251
|
},
|
|
242
252
|
async getCompilationSettings(notebookId, options) {
|
|
@@ -284,7 +294,7 @@ function createManagementOperations(context) {
|
|
|
284
294
|
method: "GET",
|
|
285
295
|
operation: "scheduledTasks.list",
|
|
286
296
|
path: context.profile.apiPath("notebooks", notebook, "scheduled-tasks"),
|
|
287
|
-
schema: scheduledTaskListSchema
|
|
297
|
+
schema: context.profile.access === "sash" ? sashScheduledTaskListSchema : scheduledTaskListSchema
|
|
288
298
|
});
|
|
289
299
|
},
|
|
290
300
|
async removeMember(notebookId, memberId, options) {
|
|
@@ -367,7 +377,7 @@ function createManagementOperations(context) {
|
|
|
367
377
|
method: "PUT",
|
|
368
378
|
operation: "scheduledTasks.update",
|
|
369
379
|
path: context.profile.apiPath("notebooks", notebook, "scheduled-tasks", task),
|
|
370
|
-
schema:
|
|
380
|
+
schema: confirmedScheduledTaskSchema
|
|
371
381
|
});
|
|
372
382
|
}
|
|
373
383
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Q as voidResponseSchema, Z as timestampSchema, c as optionalRecord, d as pagination, h as requiredText, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, t as assertNonEmptyPatch } from "./shared-
|
|
1
|
+
import { Q as voidResponseSchema, Z as timestampSchema, c as optionalRecord, d as pagination, h as requiredText, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, t as assertNonEmptyPatch } from "./shared-53S5tNf6.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region ../sdk/src/operations/note-schemas.ts
|
|
4
4
|
const noteSchema = z.object({
|