@xdarkicex/openclaw-memory-libravdb 1.6.9 → 1.6.10

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/dist/index.js CHANGED
@@ -24949,6 +24949,7 @@ function registerMemoryCliMetadata(api) {
24949
24949
  var SESSION_KEY_NAMESPACE_PREFIX = "session-key:";
24950
24950
  var AGENT_ID_NAMESPACE_PREFIX = "agent-id:";
24951
24951
  var USER_COLLECTION_PREFIX = "user:";
24952
+ var RESERVED_NAMESPACE_PREFIXES = [SESSION_KEY_NAMESPACE_PREFIX, AGENT_ID_NAMESPACE_PREFIX, USER_COLLECTION_PREFIX];
24952
24953
  var COLLECTION_NAME_RE = /^[a-zA-Z][a-zA-Z0-9_.:@#-]{0,127}$/;
24953
24954
  function validateNamespace(name) {
24954
24955
  if (!COLLECTION_NAME_RE.test(name)) {
@@ -24960,7 +24961,16 @@ function validateNamespace(name) {
24960
24961
  }
24961
24962
  function resolveDurableNamespace(params) {
24962
24963
  const explicitUserId = firstNonEmpty(params.userId);
24963
- if (explicitUserId) return validateNamespace(explicitUserId);
24964
+ if (explicitUserId) {
24965
+ for (const prefix of RESERVED_NAMESPACE_PREFIXES) {
24966
+ if (explicitUserId.startsWith(prefix)) {
24967
+ throw new Error(
24968
+ `Invalid userId "${explicitUserId}": must not start with reserved prefix "${prefix}"`
24969
+ );
24970
+ }
24971
+ }
24972
+ return validateNamespace(explicitUserId);
24973
+ }
24964
24974
  const sessionKey = firstNonEmpty(params.sessionKey);
24965
24975
  if (sessionKey) return validateNamespace(`${SESSION_KEY_NAMESPACE_PREFIX}${sessionKey}`);
24966
24976
  const agentId = firstNonEmpty(params.agentId);
@@ -1,6 +1,9 @@
1
1
  const SESSION_KEY_NAMESPACE_PREFIX = "session-key:";
2
2
  const AGENT_ID_NAMESPACE_PREFIX = "agent-id:";
3
3
  const USER_COLLECTION_PREFIX = "user:";
4
+ /** Reserved prefixes that must not appear in an explicit userId,
5
+ * to prevent namespace collision with auto-derived namespaces. */
6
+ const RESERVED_NAMESPACE_PREFIXES = [SESSION_KEY_NAMESPACE_PREFIX, AGENT_ID_NAMESPACE_PREFIX, USER_COLLECTION_PREFIX];
4
7
  /** Valid collection names: alphanumeric, underscores, hyphens, dots, colons, at-signs, hashes.
5
8
  * Must start with a letter. Max 128 characters. */
6
9
  const COLLECTION_NAME_RE = /^[a-zA-Z][a-zA-Z0-9_.:@#-]{0,127}$/;
@@ -14,8 +17,14 @@ export function validateNamespace(name) {
14
17
  }
15
18
  export function resolveDurableNamespace(params) {
16
19
  const explicitUserId = firstNonEmpty(params.userId);
17
- if (explicitUserId)
20
+ if (explicitUserId) {
21
+ for (const prefix of RESERVED_NAMESPACE_PREFIXES) {
22
+ if (explicitUserId.startsWith(prefix)) {
23
+ throw new Error(`Invalid userId "${explicitUserId}": must not start with reserved prefix "${prefix}"`);
24
+ }
25
+ }
18
26
  return validateNamespace(explicitUserId);
27
+ }
19
28
  const sessionKey = firstNonEmpty(params.sessionKey);
20
29
  if (sessionKey)
21
30
  return validateNamespace(`${SESSION_KEY_NAMESPACE_PREFIX}${sessionKey}`);
@@ -2,7 +2,7 @@
2
2
  "id": "libravdb-memory",
3
3
  "name": "LibraVDB Memory",
4
4
  "description": "Persistent vector memory with three-tier hybrid scoring",
5
- "version": "1.6.9",
5
+ "version": "1.6.10",
6
6
  "kind": [
7
7
  "memory",
8
8
  "context-engine"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xdarkicex/openclaw-memory-libravdb",
3
- "version": "1.6.9",
3
+ "version": "1.6.10",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",