@remnic/plugin-openclaw 9.3.612 → 9.3.613

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
@@ -2998,7 +2998,7 @@ function escapeRegExp(value) {
2998
2998
  }
2999
2999
 
3000
3000
  // src/public-artifacts.ts
3001
- import { readdir, access, stat, lstat, realpath } from "fs/promises";
3001
+ import { access, lstat, readdir, realpath, stat } from "fs/promises";
3002
3002
  import path from "path";
3003
3003
  var PUBLIC_DIRS = [
3004
3004
  { dir: "facts", kind: "fact", contentType: "markdown" },
@@ -3006,16 +3006,20 @@ var PUBLIC_DIRS = [
3006
3006
  { dir: "corrections", kind: "correction", contentType: "markdown" },
3007
3007
  { dir: "artifacts", kind: "artifact", contentType: "markdown" }
3008
3008
  ];
3009
- var PUBLIC_FILES = [
3010
- { relativePath: "profile.md", kind: "memory-root", contentType: "markdown" }
3011
- ];
3009
+ var PUBLIC_FILES = [{ relativePath: "profile.md", kind: "memory-root", contentType: "markdown" }];
3012
3010
  async function isContainedWithin(target, boundary) {
3011
+ return await resolveContainedPath(target, boundary) !== void 0;
3012
+ }
3013
+ async function resolveContainedPath(target, boundary) {
3013
3014
  try {
3014
3015
  const resolvedTarget = await realpath(target);
3015
3016
  const resolvedBoundary = await realpath(boundary);
3016
- return resolvedTarget === resolvedBoundary || resolvedTarget.startsWith(resolvedBoundary + path.sep);
3017
+ if (resolvedTarget === resolvedBoundary || resolvedTarget.startsWith(resolvedBoundary + path.sep)) {
3018
+ return resolvedTarget;
3019
+ }
3020
+ return void 0;
3017
3021
  } catch {
3018
- return false;
3022
+ return void 0;
3019
3023
  }
3020
3024
  }
3021
3025
  async function listMarkdownFilesRecursive(rootDir, boundary, ancestorRealPaths) {
@@ -3059,7 +3063,10 @@ async function listMarkdownFilesRecursive(rootDir, boundary, ancestorRealPaths)
3059
3063
  continue;
3060
3064
  }
3061
3065
  if (isFile && String(entry.name).endsWith(".md")) {
3062
- files.push(fullPath);
3066
+ const resolvedFilePath = await resolveContainedPath(fullPath, boundaryDir);
3067
+ if (resolvedFilePath !== void 0) {
3068
+ files.push(resolvedFilePath);
3069
+ }
3063
3070
  }
3064
3071
  }
3065
3072
  return files.sort((a, b) => a.localeCompare(b));
@@ -3075,6 +3082,12 @@ async function pathExists(inputPath) {
3075
3082
  async function listRemnicPublicArtifacts(params) {
3076
3083
  const { memoryDir, workspaceDir, agentIds } = params;
3077
3084
  const artifacts = [];
3085
+ let resolvedMemoryDir;
3086
+ try {
3087
+ resolvedMemoryDir = await realpath(memoryDir);
3088
+ } catch {
3089
+ return [];
3090
+ }
3078
3091
  for (const spec of PUBLIC_DIRS) {
3079
3092
  const dirPath = path.join(memoryDir, spec.dir);
3080
3093
  if (!await pathExists(dirPath)) continue;
@@ -3090,7 +3103,7 @@ async function listRemnicPublicArtifacts(params) {
3090
3103
  }
3091
3104
  const files = await listMarkdownFilesRecursive(dirPath, dirPath);
3092
3105
  for (const absolutePath of files) {
3093
- const relativePath = path.relative(memoryDir, absolutePath).replace(/\\/g, "/");
3106
+ const relativePath = path.relative(resolvedMemoryDir, absolutePath).replace(/\\/g, "/");
3094
3107
  artifacts.push({
3095
3108
  kind: spec.kind,
3096
3109
  workspaceDir,
@@ -3104,20 +3117,16 @@ async function listRemnicPublicArtifacts(params) {
3104
3117
  for (const spec of PUBLIC_FILES) {
3105
3118
  const absolutePath = path.join(memoryDir, spec.relativePath);
3106
3119
  if (!await pathExists(absolutePath)) continue;
3107
- if (!await isContainedWithin(absolutePath, memoryDir)) continue;
3120
+ const resolvedPath = await resolveContainedPath(absolutePath, memoryDir);
3121
+ if (resolvedPath === void 0) continue;
3108
3122
  try {
3109
3123
  const linkStat = await lstat(absolutePath);
3110
- if (linkStat.isSymbolicLink()) {
3111
- const resolvedPath = await realpath(absolutePath);
3112
- const expectedParent = await realpath(memoryDir);
3113
- if (path.dirname(resolvedPath) !== expectedParent) continue;
3114
- if (path.basename(resolvedPath) !== path.basename(spec.relativePath)) continue;
3115
- }
3124
+ if (linkStat.isSymbolicLink()) continue;
3116
3125
  } catch {
3117
3126
  continue;
3118
3127
  }
3119
3128
  try {
3120
- const fileStat = await stat(absolutePath);
3129
+ const fileStat = await stat(resolvedPath);
3121
3130
  if (!fileStat.isFile()) continue;
3122
3131
  } catch {
3123
3132
  continue;
@@ -3126,16 +3135,14 @@ async function listRemnicPublicArtifacts(params) {
3126
3135
  kind: spec.kind,
3127
3136
  workspaceDir,
3128
3137
  relativePath: spec.relativePath,
3129
- absolutePath,
3138
+ absolutePath: resolvedPath,
3130
3139
  agentIds: [...agentIds],
3131
3140
  contentType: spec.contentType
3132
3141
  });
3133
3142
  }
3134
3143
  const deduped = /* @__PURE__ */ new Map();
3135
3144
  for (const artifact of artifacts) {
3136
- const key = [artifact.workspaceDir, artifact.relativePath, artifact.kind].join(
3137
- String.fromCharCode(0)
3138
- );
3145
+ const key = [artifact.workspaceDir, artifact.relativePath, artifact.kind].join(String.fromCharCode(0));
3139
3146
  deduped.set(key, artifact);
3140
3147
  }
3141
3148
  return [...deduped.values()];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "openclaw-remnic",
3
3
  "name": "Remnic OpenClaw Plugin",
4
- "version": "9.3.612",
4
+ "version": "9.3.613",
5
5
  "kind": "memory",
6
6
  "description": "Local semantic memory for OpenClaw with bundled Remnic core runtime. Requires plugins.slots.memory set to this plugin id for hooks to fire.",
7
7
  "setup": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/plugin-openclaw",
3
- "version": "9.3.612",
3
+ "version": "9.3.613",
4
4
  "description": "OpenClaw adapter for Remnic memory with bundled @remnic/core runtime",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -72,7 +72,7 @@
72
72
  "dependencies": {
73
73
  "@sinclair/typebox": "^0.34.0",
74
74
  "openai": "^6.0.0",
75
- "@remnic/core": "^9.3.612"
75
+ "@remnic/core": "^9.3.613"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "openclaw": ">=2026.4.1 || 2026.4.7-1 || 2026.4.9-beta.1 || 2026.4.11-beta.1 || 2026.4.12-beta.1 || 2026.4.14-beta.1 || 2026.4.15-beta.1 || 2026.4.15-beta.2 || 2026.4.19-beta.1 || 2026.4.19-beta.2 || 2026.4.20-beta.1 || 2026.4.20-beta.2 || 2026.4.22-beta.1 || 2026.4.23-beta.1 || 2026.4.23-beta.2 || 2026.4.23-beta.3 || 2026.4.23-beta.4 || 2026.4.23-beta.5 || 2026.4.23-beta.6 || 2026.4.24-beta.1 || 2026.4.24-beta.2 || 2026.4.24-beta.3 || 2026.4.24-beta.4 || 2026.4.24-beta.5 || 2026.4.24-beta.6 || 2026.4.25-beta.1 || 2026.4.25-beta.2 || 2026.4.25-beta.3 || 2026.4.25-beta.4 || 2026.4.25-beta.5 || 2026.4.25-beta.6 || 2026.4.25-beta.7 || 2026.4.25-beta.8 || 2026.4.25-beta.9 || 2026.4.25-beta.10 || 2026.4.25-beta.11 || 2026.4.26-beta.1 || 2026.4.27-beta.1 || 2026.4.29-beta.1 || 2026.4.29-beta.2 || 2026.4.29-beta.3 || 2026.4.29-beta.4 || 2026.4.30-beta.1 || 2026.5.2-beta.1 || 2026.5.2-beta.2 || 2026.5.2-beta.3 || 2026.5.3-1 || 2026.5.3-beta.1 || 2026.5.3-beta.2 || 2026.5.3-beta.3 || 2026.5.3-beta.4 || 2026.5.4-beta.1 || 2026.5.4-beta.2 || 2026.5.4-beta.3 || 2026.5.5-beta.1 || 2026.5.5-beta.2 || 2026.5.6-beta.1 || 2026.5.7-beta.1 || 2026.5.9-beta.1 || 2026.5.10-beta.1 || 2026.5.10-beta.2 || 2026.5.10-beta.3 || 2026.5.10-beta.4 || 2026.5.10-beta.5 || 2026.5.10-beta.6 || 2026.5.12-beta.1 || 2026.5.12-beta.2 || 2026.5.12-beta.3 || 2026.5.12-beta.4 || 2026.5.12-beta.5 || 2026.5.12-beta.6 || 2026.5.12-beta.7 || 2026.5.12-beta.8 || 2026.5.14-beta.1 || 2026.5.14-beta.2 || 2026.5.16-beta.1 || 2026.5.16-beta.2 || 2026.5.16-beta.3 || 2026.5.16-beta.4 || 2026.5.16-beta.5 || 2026.5.16-beta.6 || 2026.5.16-beta.7 || 2026.5.18-beta.1 || 2026.5.19-alpha.1 || 2026.5.19-beta.1 || 2026.5.19-beta.2 || 2026.5.20-beta.1 || 2026.5.20-beta.2 || 2026.5.21-alpha.1 || 2026.5.21-beta.1 || 2026.5.22-beta.1 || 2026.5.23-alpha.1 || 2026.5.24-alpha.1 || 2026.5.24-beta.1 || 2026.5.24-beta.2 || 2026.5.25-alpha.1 || 2026.5.25-alpha.2 || 2026.5.25-beta.1 || 2026.5.26-beta.1 || 2026.5.26-beta.2 || 2026.5.27-alpha.1 || 2026.5.27-beta.1 || 2026.5.28-alpha.1 || 2026.5.28-beta.1 || 2026.5.28-beta.2 || 2026.5.28-beta.3 || 2026.5.28-beta.4 || 2026.5.29-alpha.1 || 2026.5.30-beta.1 || 2026.5.30-beta.2 || 2026.5.31-alpha.1 || 2026.5.31-beta.1 || 2026.5.31-beta.2 || 2026.5.31-beta.3 || 2026.5.31-beta.4 || 2026.6.1-alpha.1 || 2026.6.1-alpha.2 || 2026.6.1-alpha.3 || 2026.6.1-beta.1 || 2026.6.1-beta.2 || 2026.6.1-beta.3 || 2026.6.2-alpha.1 || 2026.6.2-alpha.2 || 2026.6.3-alpha.1"
@@ -82,7 +82,7 @@
82
82
  "acorn": "^8.16.0",
83
83
  "tsup": "^8.5.1",
84
84
  "typescript": "^5.9.3",
85
- "@remnic/core": "^9.3.612"
85
+ "@remnic/core": "^9.3.613"
86
86
  },
87
87
  "license": "MIT",
88
88
  "repository": {