@aliyunrds/ctxdb 1.0.8-beta.3 → 1.0.8

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.
@@ -65,7 +65,7 @@ ctxdb kb list --agent={{agent}}
65
65
  **场景**:用户问"X KB 收了哪些文档"、"X KB 里有几篇"。
66
66
 
67
67
  ```sh
68
- ctxdb kb documents-list <kb-name> --agent={{agent}}
68
+ ctxdb kb documents-list <kb-name> [--sort-by=created_at] [--sort-order=asc|desc] [--fields=name,created_at,ingest_status,size_bytes,updated_at] --agent={{agent}}
69
69
  ```
70
70
 
71
71
  返回 `documents` 数组,每项含 `name` / `id` / `size`。
@@ -145,9 +145,12 @@ init 使用 PUT,part/complete 保持原协议;网络结果不明确时不自
145
145
  |---|---|
146
146
  | `kb search` | `ctxdb kb search "<query>" --agent=<name>` |
147
147
  | `kb list` | `ctxdb kb list --agent=<name>` |
148
- | `kb documents-list` | `ctxdb kb documents-list <kb-name> --agent=<name>` |
148
+ | `kb documents-list` | `ctxdb kb documents-list <kb-name> [--sort-by=created_at] [--sort-order=asc|desc] [--fields=field1,field2] --agent=<name>` |
149
149
  | `kb document-get` | `ctxdb kb document-get <kb-name> <doc-id> --agent=<name>` |
150
150
  | `kb create` | `ctxdb kb create <kb-name> --agent=<name>` |
151
+ | `kb get` | `ctxdb kb get (--id=<kb-id> \| --name=<kb-name>) --agent=<name>` |
152
+ | `kb update` | `ctxdb kb update <kb-id> [--name=<new-name>] --agent=<name>` |
153
+ | `kb delete` | `ctxdb kb delete (--id=<kb-id> \| --name=<kb-name>) --agent=<name>` |
151
154
  | `kb upload-text` | `ctxdb kb upload-text <kb-name> <doc-name> --text="<body>" --agent=<name>` |
152
155
  | `kb upload-file` | `ctxdb kb upload-file <kb-name> <local-path> --agent=<name>` |
153
156
  | `kb update-text` | `ctxdb kb update-text <document-id> --text="<body>" --agent=<name>` |
@@ -230,10 +233,18 @@ init 使用 PUT,part/complete 保持原协议;网络结果不明确时不自
230
233
  | 参数 | 说明 |
231
234
  |------|------|
232
235
  | `--description` | 知识库描述 |
236
+ | `--graph-enabled` / `--no-graph-enabled` | 创建时显式开启或关闭知识图谱 |
237
+ | `--review-enabled` / `--no-review-enabled` | 创建时显式开启或关闭知识评审 |
238
+
239
+ ### `kb get` / `kb update` / `kb delete`
240
+
241
+ - `get` 和 `delete` 必须且只能传 `--id` 或 `--name` 之一。
242
+ - `update` 使用知识库 ID,并至少传 `--name`、`--description`、图谱开关或评审开关之一。
243
+ - 删除后用 `kb list` 回读,确认目标不存在。
233
244
 
234
245
  ### `kb list` / `kb documents-list` / `kb document-get`
235
246
 
236
- 无额外 flag(除通用参数)。
247
+ `kb documents-list` 可用 `--sort-by`、`--sort-order` 对常用文档字段排序,并用逗号分隔的 `--fields` 缩减大列表输出;其他两个命令无额外 flag(除通用参数)。
237
248
 
238
249
  ### 通用参数
239
250
 
@@ -26,9 +26,15 @@ description: contextdb 长期记忆高频操作(主动记忆 / 搜索过往 /
26
26
 
27
27
  ```sh
28
28
  ctxdb memory add "<text>" --agent={{agent}}
29
+
30
+ # 图文记忆;--image 可重复
31
+ ctxdb memory add "<text>" --image=<local-path> --agent={{agent}}
32
+
33
+ # 纯图片记忆
34
+ ctxdb memory add --image=<local-path> --agent={{agent}}
29
35
  ```
30
36
 
31
- 默认走 LLM fact-extraction(同步等结果)。想原文存(项目代号 / 精确数值)加 `--no-infer`(见 §6)。
37
+ 纯文本默认走 LLM fact-extraction;想原文存(项目代号 / 精确数值)加 `--no-infer`(见 §6)。图片会先转成文字事实,必须启用推理;服务端接收后返回 `PENDING` 和 `event_id`,命令不等待处理完成。
32
38
 
33
39
  **何时不适用**:用户没明示要记 → 不要主动调;autoCapture 已在每轮结束 hook/plugin 自动跑(见 §4)。
34
40
 
@@ -80,7 +86,7 @@ ctxdb memory delete <memory-id> --agent={{agent}}
80
86
 
81
87
  | 子命令 | minimal signature |
82
88
  |---|---|
83
- | `memory add` | `ctxdb memory add "<text>" --agent=<name>` |
89
+ | `memory add` | `ctxdb memory add ["<text>"] [--image=<local-path> ...] --agent=<name>` |
84
90
  | `memory search` | `ctxdb memory search "<query>" --agent=<name>` |
85
91
  | `memory list` | `ctxdb memory list --agent=<name>` |
86
92
  | `memory get` | `ctxdb memory get <memory-id> --agent=<name>` |
@@ -131,11 +137,12 @@ ctxdb memory delete <memory-id> --agent={{agent}}
131
137
 
132
138
  | 参数 | 说明 |
133
139
  |------|------|
140
+ | `--image=<local-path>` | 添加本地 PNG / JPEG / WebP 图片;可重复,至少提供文字或一张图片;图片记忆不能与 `--no-infer` 同用 |
134
141
  | `--no-infer` | 跳过 LLM fact-extraction,原文直存(项目代号 / 精确数值用)|
135
142
  | `--metadata=K1=V1,K2=V2` | 附加键值对元数据,逗号分隔 |
136
143
  | `--user-id=<id>` | 覆盖配置 user_id(**慎用**,见 §5 注意事项 4)|
137
144
 
138
- 服务端默认同步模式(`async_mode: false`),等 LLM 完成才返回。`event` 字段可能:`ADD` / `UPDATE` / `NONE`。
145
+ 纯文本请求保持同步模式(`async_mode: false`),`event` 字段可能是 `ADD` / `UPDATE` / `NONE`。图片请求异步处理,返回 `status: PENDING` 和 `event_id`;这只表示服务端已经接收,后续仍用 `memory search` / `memory list` 查看生成的文字事实。
139
146
 
140
147
  ### `memory search` 全部 flag
141
148
 
@@ -4,9 +4,9 @@ import {
4
4
  recordVersionCheckFailure,
5
5
  recordVersionCheckSuccess,
6
6
  releaseVersionCheckLock
7
- } from "../chunk-ULAWTBBC.js";
8
- import "../chunk-R67JELM7.js";
9
- import "../chunk-VIG4SYLU.js";
7
+ } from "../chunk-3MEBQDGU.js";
8
+ import "../chunk-5ITT5GSP.js";
9
+ import "../chunk-PI2SUS3M.js";
10
10
 
11
11
  // src/workers/version-check.ts
12
12
  import { fileURLToPath } from "url";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aliyunrds/ctxdb",
3
- "version": "1.0.8-beta.3",
3
+ "version": "1.0.8",
4
4
  "type": "module",
5
5
  "description": "Unified access layer for RDS ContextDatabase: `ctxdb` CLI (memory + KB ops), one-shot multi-agent installer, per-agent config, hooks/plugins, and SKILL.md.",
6
6
  "license": "Apache-2.0",
@@ -34,7 +34,7 @@
34
34
  "dependencies": {
35
35
  "semver": "^7.8.5",
36
36
  "yaml": "^2.9.0",
37
- "@aliyunrds/ctxdb-shared": "~0.0.7"
37
+ "@aliyunrds/ctxdb-shared": "~0.0.8"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^22.15.0",