@aliyunrds/ctxdb-shared 0.0.6 → 0.0.7

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/README.md CHANGED
@@ -6,7 +6,7 @@ Shared B-rule modules + memory/KB types for RDS ContextDatabase access layers.
6
6
 
7
7
  ctxdb-dev ships two access layers that both implement the same B-rules
8
8
  (B-0 wrapper strip / B-1 KB anti-injection preamble / B-2 KB content
9
- sanitize / B-3c KB-upload-turn skip) and the same memory/KB type system:
9
+ sanitize / B-3c KB-create-or-update-turn skip) and the same memory/KB type system:
10
10
 
11
11
  - **`openclaw_memory_rds_ctxdb`** — OpenClaw plugin (Mem0-mode platform / OSS)
12
12
  - **`@aliyunrds/ctxdb-qoder`** — Qoder hooks + `rds-ctxdb` CLI
@@ -21,7 +21,7 @@ This package is the single source of truth.
21
21
 
22
22
  | Module | Purpose |
23
23
  |---|---|
24
- | `kb-detection.ts` | B-3c — detect KB-upload turns by scanning assistant tool_use blocks; short-circuits autoCapture |
24
+ | `kb-detection.ts` | B-3c — detect KB create/update turns by scanning assistant tool_use blocks; short-circuits autoCapture |
25
25
  | `graph-context.ts` | Classify GraphRAG synthesis rows and normalize graph content, KB IDs, and citation semantics |
26
26
  | `external-knowledge.ts` | B-1 + B-2 — preamble + chunk sanitize; render graph synthesis and document evidence separately inside `<external-knowledge>` |
27
27
  | `filtering.ts` | B-0 — strip wrapper tags from messages before extraction; drop noise messages |
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/kb-detection.ts
2
2
  var KB_PATH_FRAGMENT = "/v1/knowledge/";
3
3
  var SHELL_TOOL_NAMES = /* @__PURE__ */ new Set(["exec", "bash", "shell", "sh"]);
4
- var CTXDB_QODER_KB_UPLOAD_RE = /\b(?:(?:rds|qoder)[-_]ctxdb|ctxdb[-_]qoder|ctxdb)\s+kb\s+upload[-_](?:text|file)\b/i;
4
+ var CTXDB_QODER_KB_UPLOAD_RE = /\b(?:(?:rds|qoder)[-_]ctxdb|ctxdb[-_]qoder|ctxdb)\s+kb\s+(?:upload|update)[-_](?:text|file)\b/i;
5
5
  var KB_PLUGIN_TOOL_NAMES = /* @__PURE__ */ new Set(["kb_upload_text", "kb_upload_file"]);
6
6
  var WRITE_METHOD_RE = /-X\s+(?:POST|PUT|DELETE|PATCH)\b/i;
7
7
  var MULTIPART_UPLOAD_RE = /-F\s+["']?(?:file|content)=@/i;
@@ -32,7 +32,7 @@ function isKnowledgeBaseUploadTurn(messages) {
32
32
  if (CTXDB_QODER_KB_UPLOAD_RE.test(command)) {
33
33
  return {
34
34
  detected: true,
35
- reason: `shell tool "${name}" invoked a ctxdb-qoder CLI kb upload command (direct KB upload via CLI)`
35
+ reason: `shell tool "${name}" invoked a ctxdb CLI KB upload/update command (direct KB write via CLI)`
36
36
  };
37
37
  }
38
38
  if (!command.includes(KB_PATH_FRAGMENT)) continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aliyunrds/ctxdb-shared",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "description": "Shared B-rule modules + memory/KB types for RDS ContextDatabase access layers (OpenClaw fork + Qoder hooks).",
6
6
  "license": "Apache-2.0",