@remnic/plugin-openclaw 1.0.38 → 1.0.40

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.
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  buildExtensionsBlockForConsolidation,
7
7
  runPostConsolidationMaterialize
8
- } from "./chunk-SEGEX7W4.js";
8
+ } from "./chunk-GXMAAGP2.js";
9
9
  import "./chunk-TH5FF5SC.js";
10
10
  import {
11
11
  resolveCausalTrajectoryStoreDir
@@ -21,9 +21,9 @@ import {
21
21
  FallbackLlmClient
22
22
  } from "./chunk-SWOYEQN2.js";
23
23
  import "./chunk-3A5ELHTT.js";
24
- import "./chunk-G3CZA4SD.js";
24
+ import "./chunk-SDPTCSV7.js";
25
25
  import "./chunk-QMUQV5NP.js";
26
- import "./chunk-RKR6PTPA.js";
26
+ import "./chunk-IB4WJJF7.js";
27
27
  import {
28
28
  log
29
29
  } from "./chunk-UFU5GGGA.js";
@@ -5,7 +5,7 @@ import {
5
5
  StorageManager,
6
6
  parseContinuityImprovementLoops,
7
7
  sanitizeMemoryContent
8
- } from "./chunk-G3CZA4SD.js";
8
+ } from "./chunk-SDPTCSV7.js";
9
9
  import {
10
10
  log
11
11
  } from "./chunk-UFU5GGGA.js";
@@ -293,7 +293,7 @@ var CompoundingEngine = class {
293
293
  let promotionCandidates = this.config.compoundingSemanticEnabled ? this.derivePromotionCandidates(outcomeSummary, mistakes.registry, rubrics) : [];
294
294
  if (this.config.cmcConsolidationEnabled) {
295
295
  try {
296
- const { deriveCausalPromotionCandidates, materializeAfterCausalConsolidation } = await import("./causal-consolidation-DRPM2KOE.js");
296
+ const { deriveCausalPromotionCandidates, materializeAfterCausalConsolidation } = await import("./causal-consolidation-6XK2QX6F.js");
297
297
  const causalCandidates = await deriveCausalPromotionCandidates({
298
298
  memoryDir: this.config.memoryDir,
299
299
  causalTrajectoryStoreDir: this.config.causalTrajectoryStoreDir,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-TH5FF5SC.js";
4
4
  import {
5
5
  StorageManager
6
- } from "./chunk-G3CZA4SD.js";
6
+ } from "./chunk-SDPTCSV7.js";
7
7
  import {
8
8
  log
9
9
  } from "./chunk-UFU5GGGA.js";
@@ -76,10 +76,10 @@ function filePathAad(filePath, memoryDir) {
76
76
  }
77
77
  return Buffer.from(rel, "utf8");
78
78
  }
79
- async function readMaybeEncryptedFile(filePath, key, memoryDir) {
79
+ async function readMaybeEncryptedFileBuffer(filePath, key, memoryDir) {
80
80
  const buf = await fileReader(filePath);
81
81
  if (!isEncryptedFile(buf)) {
82
- return buf.toString("utf8");
82
+ return buf;
83
83
  }
84
84
  if (key === null) {
85
85
  throw new SecureStoreLockedError(
@@ -87,8 +87,10 @@ async function readMaybeEncryptedFile(filePath, key, memoryDir) {
87
87
  );
88
88
  }
89
89
  const aad = filePathAad(filePath, memoryDir);
90
- const plain = decryptFileBody(buf, key, aad);
91
- return plain.toString("utf8");
90
+ return decryptFileBody(buf, key, aad);
91
+ }
92
+ async function readMaybeEncryptedFile(filePath, key, memoryDir) {
93
+ return (await readMaybeEncryptedFileBuffer(filePath, key, memoryDir)).toString("utf8");
92
94
  }
93
95
  async function writeMaybeEncryptedFile(filePath, content, key, options = {}, memoryDir) {
94
96
  const { mode = 384, atomic = true } = options;
@@ -308,6 +310,7 @@ export {
308
310
  encryptFileBody,
309
311
  decryptFileBody,
310
312
  filePathAad,
313
+ readMaybeEncryptedFileBuffer,
311
314
  readMaybeEncryptedFile,
312
315
  writeMaybeEncryptedFile,
313
316
  migrateMemoryDirToEncrypted,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-BZ4EYURA.js";
4
4
  import {
5
5
  StorageManager
6
- } from "./chunk-G3CZA4SD.js";
6
+ } from "./chunk-SDPTCSV7.js";
7
7
 
8
8
  // ../remnic-core/src/maintenance/memory-governance.ts
9
9
  import path from "path";
@@ -19,7 +19,7 @@ import {
19
19
  import {
20
20
  decryptMemoryDirToPlaintext,
21
21
  migrateMemoryDirToEncrypted
22
- } from "./chunk-RKR6PTPA.js";
22
+ } from "./chunk-IB4WJJF7.js";
23
23
  import {
24
24
  generateSalt
25
25
  } from "./chunk-YGGGUTG3.js";
@@ -5,8 +5,9 @@ import {
5
5
  SecureStoreLockedError,
6
6
  isEncryptedFile,
7
7
  readMaybeEncryptedFile,
8
+ readMaybeEncryptedFileBuffer,
8
9
  writeMaybeEncryptedFile
9
- } from "./chunk-RKR6PTPA.js";
10
+ } from "./chunk-IB4WJJF7.js";
10
11
  import {
11
12
  log
12
13
  } from "./chunk-UFU5GGGA.js";
@@ -2094,6 +2095,13 @@ var ContentHashIndex = class _ContentHashIndex {
2094
2095
  get size() {
2095
2096
  return this.hashes.size;
2096
2097
  }
2098
+ /** Clear all loaded hashes so the next save rewrites the index from scratch. */
2099
+ clear() {
2100
+ if (this.hashes.size > 0) {
2101
+ this.hashes.clear();
2102
+ }
2103
+ this.dirty = true;
2104
+ }
2097
2105
  /** Persist index to disk if changed. */
2098
2106
  async save() {
2099
2107
  if (!this.dirty) return;
@@ -3228,6 +3236,49 @@ var StorageManager = class _StorageManager {
3228
3236
  writeStorageSecureFile(filePath, content) {
3229
3237
  return writeMaybeEncryptedFile(filePath, content, this.resolveWriteKey(), {}, this.baseDir);
3230
3238
  }
3239
+ assertManagedStoragePath(filePath, method) {
3240
+ const resolved = path4.resolve(filePath);
3241
+ const base = path4.resolve(this.baseDir);
3242
+ const rel = path4.relative(base, resolved);
3243
+ if (rel === "" || rel === ".." || rel.startsWith(`..${path4.sep}`) || path4.isAbsolute(rel)) {
3244
+ throw new Error(`${method}: file path escapes memory dir`);
3245
+ }
3246
+ return resolved;
3247
+ }
3248
+ async readOfflineSyncFile(filePath) {
3249
+ const target = this.assertManagedStoragePath(filePath, "storage.readOfflineSyncFile");
3250
+ return readMaybeEncryptedFileBuffer(target, this._secureStoreKey, this.baseDir);
3251
+ }
3252
+ async writeOfflineSyncFile(filePath, content) {
3253
+ const target = this.assertManagedStoragePath(filePath, "storage.writeOfflineSyncFile");
3254
+ await writeMaybeEncryptedFile(target, content, this.resolveWriteKey(), {}, this.baseDir);
3255
+ await this.invalidateAfterOfflineSyncMutation(target);
3256
+ }
3257
+ async deleteOfflineSyncFile(filePath) {
3258
+ const target = this.assertManagedStoragePath(filePath, "storage.deleteOfflineSyncFile");
3259
+ await unlink(target).catch((error) => {
3260
+ if (isErrnoCode(error, "ENOENT")) return;
3261
+ throw error;
3262
+ });
3263
+ await this.invalidateAfterOfflineSyncMutation(target);
3264
+ }
3265
+ async invalidateAfterOfflineSyncMutation(filePath) {
3266
+ this.invalidateAllMemoriesCache();
3267
+ invalidateCachedEntities(this.baseDir);
3268
+ this.invalidateKnowledgeIndexCache();
3269
+ this.factHashIndexAuthoritative = false;
3270
+ await unlink(this.factHashIndexReadyPath).catch((error) => {
3271
+ if (isErrnoCode(error, "ENOENT")) return;
3272
+ throw error;
3273
+ });
3274
+ if (filePath.includes(`${path4.sep}cold${path4.sep}`)) {
3275
+ this.invalidateColdMemoriesCache();
3276
+ }
3277
+ if (filePath.includes(`${path4.sep}artifacts${path4.sep}`)) {
3278
+ this.bumpArtifactWriteVersion();
3279
+ }
3280
+ this.bumpMemoryStatusVersion();
3281
+ }
3231
3282
  createContentHashIndex() {
3232
3283
  return new ContentHashIndex(
3233
3284
  this.stateDir,
@@ -3314,6 +3365,7 @@ var StorageManager = class _StorageManager {
3314
3365
  } catch {
3315
3366
  }
3316
3367
  const factHashIndex = await this.getFactHashIndex();
3368
+ factHashIndex.clear();
3317
3369
  const existing = await this.readAllMemories();
3318
3370
  let legacyRecovered = 0;
3319
3371
  for (const memory of existing) {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  CompoundingEngine,
3
3
  defaultTierMigrationCycleBudget
4
- } from "./chunk-BLC3RQNV.js";
4
+ } from "./chunk-EPX44ITH.js";
5
5
  import "./chunk-4XDQ3KEC.js";
6
- import "./chunk-G3CZA4SD.js";
6
+ import "./chunk-SDPTCSV7.js";
7
7
  import "./chunk-QMUQV5NP.js";
8
- import "./chunk-RKR6PTPA.js";
8
+ import "./chunk-IB4WJJF7.js";
9
9
  import "./chunk-UFU5GGGA.js";
10
10
  import "./chunk-YGGGUTG3.js";
11
11
  import "./chunk-EH4AXGRO.js";
package/dist/index.js CHANGED
@@ -11,32 +11,32 @@ import "./chunk-ZS6VABML.js";
11
11
  import "./chunk-QQXJODFL.js";
12
12
  import "./chunk-BU5KJVWF.js";
13
13
  import "./chunk-LZCGPRHS.js";
14
- import "./chunk-6O3H3DPL.js";
14
+ import "./chunk-J3EKUNTG.js";
15
15
  import "./chunk-BZ4EYURA.js";
16
16
  import "./chunk-W6EEFUCJ.js";
17
17
  import "./chunk-7JOLBJJ5.js";
18
18
  import "./chunk-JC3FCKYL.js";
19
19
  import "./chunk-YJYZMLD5.js";
20
20
  import "./chunk-IO5WWY6A.js";
21
- import "./chunk-SEGEX7W4.js";
21
+ import "./chunk-GXMAAGP2.js";
22
22
  import "./chunk-TH5FF5SC.js";
23
23
  import "./chunk-3IKMUNW5.js";
24
24
  import "./chunk-3G7FAF6S.js";
25
25
  import "./chunk-25J4PXDH.js";
26
- import "./chunk-BLC3RQNV.js";
26
+ import "./chunk-EPX44ITH.js";
27
27
  import {
28
28
  external_exports
29
29
  } from "./chunk-4XDQ3KEC.js";
30
- import "./chunk-QXXEF7VI.js";
30
+ import "./chunk-Q7COZSFU.js";
31
31
  import "./chunk-MXFJXUHC.js";
32
32
  import "./chunk-JZBOXOUC.js";
33
33
  import "./chunk-6IWEAUN6.js";
34
34
  import "./chunk-SWOYEQN2.js";
35
35
  import "./chunk-3A5ELHTT.js";
36
36
  import "./chunk-5ZW5XJQ6.js";
37
- import "./chunk-G3CZA4SD.js";
37
+ import "./chunk-SDPTCSV7.js";
38
38
  import "./chunk-QMUQV5NP.js";
39
- import "./chunk-RKR6PTPA.js";
39
+ import "./chunk-IB4WJJF7.js";
40
40
  import "./chunk-UFU5GGGA.js";
41
41
  import "./chunk-YGGGUTG3.js";
42
42
  import "./chunk-NUWDSTP7.js";
@@ -5565,7 +5565,7 @@ __reExport(access_http_exports, access_http_star);
5565
5565
  import * as access_http_star from "@remnic/core/access-http";
5566
5566
 
5567
5567
  // ../../src/index.ts
5568
- import path91 from "path";
5568
+ import path92 from "path";
5569
5569
  import os7 from "os";
5570
5570
 
5571
5571
  // ../../src/opik-exporter.ts
@@ -6572,10 +6572,10 @@ import { createHash as createHash10 } from "crypto";
6572
6572
  var COMPACTION_SIGNAL_MAX_AGE_MS = 60 * 60 * 1e3;
6573
6573
 
6574
6574
  // ../remnic-core/src/access-service.ts
6575
- import { stat as stat14 } from "fs/promises";
6575
+ import { stat as stat15 } from "fs/promises";
6576
6576
  import * as nodeFs from "fs/promises";
6577
6577
  import { constants as fsConstants } from "fs";
6578
- import { createHash as createHash13 } from "crypto";
6578
+ import { createHash as createHash14 } from "crypto";
6579
6579
 
6580
6580
  // ../remnic-core/src/access-idempotency.ts
6581
6581
  import * as fsReadModule24 from "fs/promises";
@@ -6639,6 +6639,19 @@ import path47 from "path";
6639
6639
  // ../remnic-core/src/objective-state-writers.ts
6640
6640
  import crypto2 from "crypto";
6641
6641
 
6642
+ // ../remnic-core/src/offline-sync.ts
6643
+ import { createHash as createHash13, randomUUID as randomUUID5 } from "crypto";
6644
+ import * as fsReadModule27 from "fs/promises";
6645
+ const lstat6 = fsReadModule27.lstat;
6646
+ const mkdir33 = fsReadModule27.mkdir;
6647
+ const readdir19 = fsReadModule27.readdir;
6648
+ const fileReader29 = fsReadModule27["re"+"ad"+"Fi"+"le"];
6649
+ const rename5 = fsReadModule27.rename;
6650
+ const stat14 = fsReadModule27.stat;
6651
+ const unlink9 = fsReadModule27.unlink;
6652
+ const writeFile31 = fsReadModule27.writeFile;
6653
+ import path48 from "path";
6654
+
6642
6655
  // ../remnic-core/src/action-confidence.ts
6643
6656
  var ACTION_CONFIDENCE_RISK_CATEGORIES = [
6644
6657
  "low",
@@ -6661,18 +6674,18 @@ var ACTION_CONFIDENCE_RULE_KINDS = [
6661
6674
 
6662
6675
  // ../remnic-core/src/access-http.ts
6663
6676
  import { createServer } from "http";
6664
- import { randomUUID as randomUUID6, timingSafeEqual } from "crypto";
6677
+ import { randomUUID as randomUUID7, timingSafeEqual } from "crypto";
6665
6678
  import { AsyncLocalStorage } from "async_hooks";
6666
6679
  import { existsSync as existsSync4 } from "fs";
6667
- import * as fsReadModule27 from "fs/promises";
6668
- const fileReader31 = fsReadModule27["re"+"ad"+"Fi"+"le"];
6669
- import path48 from "path";
6680
+ import * as fsReadModule28 from "fs/promises";
6681
+ const fileReader32 = fsReadModule28["re"+"ad"+"Fi"+"le"];
6682
+ import path49 from "path";
6670
6683
  import { fileURLToPath as fileURLToPath3, URL as URL2 } from "url";
6671
6684
 
6672
6685
  // ../remnic-core/src/access-mcp.ts
6673
- import * as fsReadModule28 from "fs/promises";
6674
- const fileReader30 = fsReadModule28["re"+"ad"+"Fi"+"le"];
6675
- import { randomUUID as randomUUID5 } from "crypto";
6686
+ import * as fsReadModule29 from "fs/promises";
6687
+ const fileReader31 = fsReadModule29["re"+"ad"+"Fi"+"le"];
6688
+ import { randomUUID as randomUUID6 } from "crypto";
6676
6689
 
6677
6690
  // ../remnic-core/src/access-schema.ts
6678
6691
  var namespaceSchema = external_exports.string().trim().max(256).optional();
@@ -6898,6 +6911,18 @@ var capsuleImportRequestSchema = external_exports.object({
6898
6911
  var capsuleListRequestSchema = external_exports.object({
6899
6912
  namespace: namespaceSchema
6900
6913
  });
6914
+ var offlineSyncApplyRequestSchema = external_exports.object({
6915
+ namespace: namespaceSchema,
6916
+ changeset: external_exports.unknown()
6917
+ }).refine((value) => value.changeset !== void 0 && value.changeset !== null, {
6918
+ message: "changeset is required",
6919
+ path: ["changeset"]
6920
+ });
6921
+ var offlineSyncFilesRequestSchema = external_exports.object({
6922
+ namespace: namespaceSchema,
6923
+ includeTranscripts: external_exports.boolean().optional(),
6924
+ paths: external_exports.array(external_exports.string().trim().min(1, "path must be non-empty").max(4096)).max(5e3, "paths must contain 5000 or fewer entries")
6925
+ });
6901
6926
  var nullableOptional = (schema) => schema.optional().nullable().transform((value) => value ?? void 0);
6902
6927
  var actionConfidenceRuleSchema = external_exports.object({
6903
6928
  kind: external_exports.enum(ACTION_CONFIDENCE_RULE_KINDS),
@@ -7076,14 +7101,14 @@ var REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_HTML = `
7076
7101
 
7077
7102
  // ../remnic-core/src/access-http.ts
7078
7103
  function resolveDefaultAdminConsolePublicDir() {
7079
- const thisDir = path48.dirname(fileURLToPath3(import.meta.url));
7104
+ const thisDir = path49.dirname(fileURLToPath3(import.meta.url));
7080
7105
  const candidates = [
7081
7106
  // Standard: admin-console sibling to src/ (development layout)
7082
- path48.resolve(thisDir, "../admin-console/public"),
7107
+ path49.resolve(thisDir, "../admin-console/public"),
7083
7108
  // Bundled: admin-console inside dist/ alongside the bundle
7084
- path48.resolve(thisDir, "./admin-console/public"),
7109
+ path49.resolve(thisDir, "./admin-console/public"),
7085
7110
  // Package root: walk up from dist/ to the package root
7086
- path48.resolve(thisDir, "../../admin-console/public")
7111
+ path49.resolve(thisDir, "../../admin-console/public")
7087
7112
  ];
7088
7113
  return candidates.find((candidate) => existsSync4(candidate)) ?? candidates[0];
7089
7114
  }
@@ -7213,28 +7238,28 @@ var DEFAULT_MAX_BINARY_SIZE_BYTES = 50 * 1024 * 1024;
7213
7238
  // ../remnic-core/src/binary-lifecycle/backend.ts
7214
7239
  import fs3 from "fs";
7215
7240
  import fsp2 from "fs/promises";
7216
- import path49 from "path";
7241
+ import path50 from "path";
7217
7242
 
7218
7243
  // ../remnic-core/src/binary-lifecycle/scanner.ts
7219
7244
  import fsp3 from "fs/promises";
7220
- import path50 from "path";
7245
+ import path51 from "path";
7221
7246
 
7222
7247
  // ../remnic-core/src/binary-lifecycle/manifest.ts
7223
7248
  import fsp4 from "fs/promises";
7224
- import path51 from "path";
7249
+ import path52 from "path";
7225
7250
  import crypto3 from "crypto";
7226
7251
 
7227
7252
  // ../remnic-core/src/binary-lifecycle/pipeline.ts
7228
7253
  import fsp5 from "fs/promises";
7229
- import path52 from "path";
7254
+ import path53 from "path";
7230
7255
  import crypto4 from "crypto";
7231
7256
 
7232
7257
  // ../remnic-core/src/projection/index.ts
7233
7258
  import fs4 from "fs";
7234
- import path54 from "path";
7259
+ import path55 from "path";
7235
7260
 
7236
7261
  // ../remnic-core/src/utils/category-dir.ts
7237
- import path53 from "path";
7262
+ import path54 from "path";
7238
7263
  var CATEGORY_DIR_MAP = {
7239
7264
  correction: "corrections",
7240
7265
  question: "questions",
@@ -7260,211 +7285,211 @@ var ALL_CATEGORY_KEYS = [
7260
7285
 
7261
7286
  // ../remnic-core/src/onboarding/index.ts
7262
7287
  import fs5 from "fs";
7263
- import path55 from "path";
7288
+ import path56 from "path";
7264
7289
 
7265
7290
  // ../remnic-core/src/curation/index.ts
7266
7291
  import fs6 from "fs";
7267
- import path56 from "path";
7292
+ import path57 from "path";
7268
7293
  import crypto5 from "crypto";
7269
7294
 
7270
7295
  // ../remnic-core/src/dedup/index.ts
7271
7296
  import fs7 from "fs";
7272
- import path57 from "path";
7297
+ import path58 from "path";
7273
7298
  import crypto6 from "crypto";
7274
7299
 
7275
7300
  // ../remnic-core/src/review/index.ts
7276
7301
  import fs8 from "fs";
7277
- import path58 from "path";
7302
+ import path59 from "path";
7278
7303
 
7279
7304
  // ../remnic-core/src/sync/index.ts
7280
7305
  import fs9 from "fs";
7281
- import path59 from "path";
7306
+ import path60 from "path";
7282
7307
  import crypto7 from "crypto";
7283
7308
 
7284
7309
  // ../remnic-core/src/connectors/index.ts
7285
7310
  import fs12 from "fs";
7286
- import path62 from "path";
7311
+ import path63 from "path";
7287
7312
  import os5 from "os";
7288
7313
  import { createRequire as createRequire2 } from "module";
7289
7314
  import { fileURLToPath as fileURLToPath4 } from "url";
7290
7315
 
7291
7316
  // ../remnic-core/src/tokens.ts
7292
7317
  import fs10 from "fs";
7293
- import path60 from "path";
7294
- import { randomBytes as randomBytes2, randomUUID as randomUUID7 } from "crypto";
7318
+ import path61 from "path";
7319
+ import { randomBytes as randomBytes2, randomUUID as randomUUID8 } from "crypto";
7295
7320
 
7296
7321
  // ../remnic-core/src/connectors/codex-marketplace.ts
7297
7322
  import fs11 from "fs";
7298
- import path61 from "path";
7323
+ import path62 from "path";
7299
7324
 
7300
7325
  // ../remnic-core/src/spaces/index.ts
7301
7326
  import fs13 from "fs";
7302
- import path63 from "path";
7327
+ import path64 from "path";
7303
7328
  import crypto8 from "crypto";
7304
7329
 
7305
7330
  // ../remnic-core/src/memory-extension/codex-publisher.ts
7306
7331
  import fs14 from "fs";
7307
7332
  import os6 from "os";
7308
- import path64 from "path";
7333
+ import path65 from "path";
7309
7334
 
7310
7335
  // ../remnic-core/src/enrichment/audit.ts
7311
- import * as fsReadModule29 from "fs/promises";
7312
- const mkdir33 = fsReadModule29.mkdir;
7313
- const fileReader32 = fsReadModule29["re"+"ad"+"Fi"+"le"];
7314
- const appendFile5 = fsReadModule29.appendFile;
7336
+ import * as fsReadModule30 from "fs/promises";
7337
+ const mkdir34 = fsReadModule30.mkdir;
7338
+ const fileReader33 = fsReadModule30["re"+"ad"+"Fi"+"le"];
7339
+ const appendFile5 = fsReadModule30.appendFile;
7315
7340
  import { existsSync as existsSync5 } from "fs";
7316
- import path65 from "path";
7341
+ import path66 from "path";
7317
7342
 
7318
7343
  // ../remnic-core/src/cli.ts
7319
- import path89 from "path";
7320
- import * as fsReadModule30 from "fs/promises";
7321
- const access8 = fsReadModule30.access;
7322
- const fileReader46 = fsReadModule30["re"+"ad"+"Fi"+"le"];
7323
- const readdir29 = fsReadModule30.readdir;
7324
- const unlink12 = fsReadModule30.unlink;
7325
- import { createHash as createHash15 } from "crypto";
7326
-
7327
- // ../remnic-core/src/transfer/export-json.ts
7328
- import path66 from "path";
7344
+ import path90 from "path";
7329
7345
  import * as fsReadModule31 from "fs/promises";
7330
- const mkdir34 = fsReadModule31.mkdir;
7331
- const fileReader33 = fsReadModule31["re"+"ad"+"Fi"+"le"];
7346
+ const access8 = fsReadModule31.access;
7347
+ const fileReader47 = fsReadModule31["re"+"ad"+"Fi"+"le"];
7348
+ const readdir30 = fsReadModule31.readdir;
7349
+ const unlink13 = fsReadModule31.unlink;
7350
+ import { createHash as createHash16 } from "crypto";
7332
7351
 
7333
- // ../remnic-core/src/transfer/export-md.ts
7352
+ // ../remnic-core/src/transfer/export-json.ts
7334
7353
  import path67 from "path";
7335
7354
  import * as fsReadModule32 from "fs/promises";
7336
7355
  const mkdir35 = fsReadModule32.mkdir;
7337
7356
  const fileReader34 = fsReadModule32["re"+"ad"+"Fi"+"le"];
7338
- const writeFile31 = fsReadModule32.writeFile;
7339
7357
 
7340
- // ../remnic-core/src/transfer/backup.ts
7358
+ // ../remnic-core/src/transfer/export-md.ts
7341
7359
  import path68 from "path";
7342
- import { mkdir as mkdir36, readdir as readdir20, rm as rm8, unlink as unlink9, writeFile as writeFile32 } from "fs/promises";
7343
- import { gzipSync } from "zlib";
7360
+ import * as fsReadModule33 from "fs/promises";
7361
+ const mkdir36 = fsReadModule33.mkdir;
7362
+ const fileReader35 = fsReadModule33["re"+"ad"+"Fi"+"le"];
7363
+ const writeFile32 = fsReadModule33.writeFile;
7344
7364
 
7345
- // ../remnic-core/src/transfer/export-sqlite.ts
7365
+ // ../remnic-core/src/transfer/backup.ts
7346
7366
  import path69 from "path";
7367
+ import { mkdir as mkdir37, readdir as readdir21, rm as rm8, unlink as unlink10, writeFile as writeFile33 } from "fs/promises";
7368
+ import { gzipSync } from "zlib";
7347
7369
 
7348
- // ../remnic-core/src/transfer/import-json.ts
7370
+ // ../remnic-core/src/transfer/export-sqlite.ts
7349
7371
  import path70 from "path";
7350
- import { mkdir as mkdir37, writeFile as writeFile33 } from "fs/promises";
7351
7372
 
7352
- // ../remnic-core/src/transfer/import-sqlite.ts
7373
+ // ../remnic-core/src/transfer/import-json.ts
7353
7374
  import path71 from "path";
7354
7375
  import { mkdir as mkdir38, writeFile as writeFile34 } from "fs/promises";
7355
7376
 
7356
- // ../remnic-core/src/transfer/import-md.ts
7377
+ // ../remnic-core/src/transfer/import-sqlite.ts
7357
7378
  import path72 from "path";
7358
- import * as fsReadModule33 from "fs/promises";
7359
- const mkdir39 = fsReadModule33.mkdir;
7360
- const fileReader35 = fsReadModule33["re"+"ad"+"Fi"+"le"];
7361
- const writeFile35 = fsReadModule33.writeFile;
7379
+ import { mkdir as mkdir39, writeFile as writeFile35 } from "fs/promises";
7362
7380
 
7363
- // ../remnic-core/src/transfer/autodetect.ts
7381
+ // ../remnic-core/src/transfer/import-md.ts
7364
7382
  import path73 from "path";
7365
- import { stat as stat15 } from "fs/promises";
7366
-
7367
- // ../remnic-core/src/maintenance/archive-observations.ts
7368
- import path74 from "path";
7369
7383
  import * as fsReadModule34 from "fs/promises";
7370
7384
  const mkdir40 = fsReadModule34.mkdir;
7371
- const readdir21 = fsReadModule34.readdir;
7372
7385
  const fileReader36 = fsReadModule34["re"+"ad"+"Fi"+"le"];
7373
- const unlink10 = fsReadModule34.unlink;
7374
7386
  const writeFile36 = fsReadModule34.writeFile;
7375
7387
 
7376
- // ../remnic-core/src/maintenance/rebuild-memory-lifecycle-ledger.ts
7388
+ // ../remnic-core/src/transfer/autodetect.ts
7389
+ import path74 from "path";
7390
+ import { stat as stat16 } from "fs/promises";
7391
+
7392
+ // ../remnic-core/src/maintenance/archive-observations.ts
7377
7393
  import path75 from "path";
7378
- import { mkdir as mkdir41, rename as rename5, stat as stat16, writeFile as writeFile37 } from "fs/promises";
7394
+ import * as fsReadModule35 from "fs/promises";
7395
+ const mkdir41 = fsReadModule35.mkdir;
7396
+ const readdir22 = fsReadModule35.readdir;
7397
+ const fileReader37 = fsReadModule35["re"+"ad"+"Fi"+"le"];
7398
+ const unlink11 = fsReadModule35.unlink;
7399
+ const writeFile37 = fsReadModule35.writeFile;
7379
7400
 
7380
- // ../remnic-core/src/maintenance/rebuild-memory-projection.ts
7401
+ // ../remnic-core/src/maintenance/rebuild-memory-lifecycle-ledger.ts
7381
7402
  import path76 from "path";
7382
- import { mkdir as mkdir42, rename as rename6, rm as rm9, stat as stat17 } from "fs/promises";
7403
+ import { mkdir as mkdir42, rename as rename6, stat as stat17, writeFile as writeFile38 } from "fs/promises";
7404
+
7405
+ // ../remnic-core/src/maintenance/rebuild-memory-projection.ts
7406
+ import path77 from "path";
7407
+ import { mkdir as mkdir43, rename as rename7, rm as rm9, stat as stat18 } from "fs/promises";
7383
7408
 
7384
7409
  // ../remnic-core/src/maintenance/rebuild-observations.ts
7385
- import path78 from "path";
7386
- import * as fsReadModule35 from "fs/promises";
7387
- const readdir22 = fsReadModule35.readdir;
7388
- const fileReader38 = fsReadModule35["re"+"ad"+"Fi"+"le"];
7410
+ import path79 from "path";
7411
+ import * as fsReadModule36 from "fs/promises";
7412
+ const readdir23 = fsReadModule36.readdir;
7413
+ const fileReader39 = fsReadModule36["re"+"ad"+"Fi"+"le"];
7389
7414
 
7390
7415
  // ../remnic-core/src/maintenance/observation-ledger-utils.ts
7391
- import path77 from "path";
7392
- import * as fsReadModule36 from "fs/promises";
7393
- const mkdir43 = fsReadModule36.mkdir;
7394
- const fileReader37 = fsReadModule36["re"+"ad"+"Fi"+"le"];
7395
- const writeFile38 = fsReadModule36.writeFile;
7416
+ import path78 from "path";
7417
+ import * as fsReadModule37 from "fs/promises";
7418
+ const mkdir44 = fsReadModule37.mkdir;
7419
+ const fileReader38 = fsReadModule37["re"+"ad"+"Fi"+"le"];
7420
+ const writeFile39 = fsReadModule37.writeFile;
7396
7421
 
7397
7422
  // ../remnic-core/src/maintenance/migrate-observations.ts
7398
- import path79 from "path";
7399
- import * as fsReadModule37 from "fs/promises";
7400
- const readdir23 = fsReadModule37.readdir;
7401
- const fileReader39 = fsReadModule37["re"+"ad"+"Fi"+"le"];
7423
+ import path80 from "path";
7424
+ import * as fsReadModule38 from "fs/promises";
7425
+ const readdir24 = fsReadModule38.readdir;
7426
+ const fileReader40 = fsReadModule38["re"+"ad"+"Fi"+"le"];
7402
7427
 
7403
7428
  // ../remnic-core/src/namespaces/migrate.ts
7404
- import path80 from "path";
7405
- import { access as access4, mkdir as mkdir44, readdir as readdir24, rename as rename7 } from "fs/promises";
7429
+ import path81 from "path";
7430
+ import { access as access4, mkdir as mkdir45, readdir as readdir25, rename as rename8 } from "fs/promises";
7406
7431
 
7407
7432
  // ../remnic-core/src/operator-toolkit.ts
7408
- import path82 from "path";
7433
+ import path83 from "path";
7409
7434
  import { constants as fsConstants2 } from "fs";
7410
- import * as fsReadModule38 from "fs/promises";
7411
- const access6 = fsReadModule38.access;
7412
- const mkdir45 = fsReadModule38.mkdir;
7413
- const fileReader41 = fsReadModule38["re"+"ad"+"Fi"+"le"];
7414
- const readdir26 = fsReadModule38.readdir;
7415
- const stat19 = fsReadModule38.stat;
7416
- const unlink11 = fsReadModule38.unlink;
7417
- const writeFile39 = fsReadModule38.writeFile;
7435
+ import * as fsReadModule39 from "fs/promises";
7436
+ const access6 = fsReadModule39.access;
7437
+ const mkdir46 = fsReadModule39.mkdir;
7438
+ const fileReader42 = fsReadModule39["re"+"ad"+"Fi"+"le"];
7439
+ const readdir27 = fsReadModule39.readdir;
7440
+ const stat20 = fsReadModule39.stat;
7441
+ const unlink12 = fsReadModule39.unlink;
7442
+ const writeFile40 = fsReadModule39.writeFile;
7418
7443
 
7419
7444
  // ../remnic-core/src/consolidation-provenance-check.ts
7420
- import path81 from "path";
7421
- import * as fsReadModule39 from "fs/promises";
7422
- const readdir25 = fsReadModule39.readdir;
7423
- const fileReader40 = fsReadModule39["re"+"ad"+"Fi"+"le"];
7424
- const stat18 = fsReadModule39.stat;
7445
+ import path82 from "path";
7446
+ import * as fsReadModule40 from "fs/promises";
7447
+ const readdir26 = fsReadModule40.readdir;
7448
+ const fileReader41 = fsReadModule40["re"+"ad"+"Fi"+"le"];
7449
+ const stat19 = fsReadModule40.stat;
7425
7450
 
7426
7451
  // ../remnic-core/src/network/tailscale.ts
7427
- import { stat as stat20 } from "fs/promises";
7452
+ import { stat as stat21 } from "fs/promises";
7428
7453
 
7429
7454
  // ../remnic-core/src/network/webdav.ts
7430
7455
  import { createReadStream } from "fs";
7431
- import { mkdir as mkdir46, readdir as readdir27, realpath as realpath5, stat as stat21 } from "fs/promises";
7456
+ import { mkdir as mkdir47, readdir as readdir28, realpath as realpath5, stat as stat22 } from "fs/promises";
7432
7457
  import { createServer as createServer2 } from "http";
7433
7458
  import { timingSafeEqual as timingSafeEqual2 } from "crypto";
7434
- import path83 from "path";
7459
+ import path84 from "path";
7435
7460
  import { pipeline } from "stream/promises";
7436
7461
  import { URL as URL3 } from "url";
7437
7462
 
7438
7463
  // ../remnic-core/src/dashboard-runtime.ts
7439
- import { createHash as createHash14 } from "crypto";
7464
+ import { createHash as createHash15 } from "crypto";
7440
7465
  import { createServer as createServer3 } from "http";
7441
7466
  import { watch } from "fs";
7442
- import * as fsReadModule40 from "fs/promises";
7443
- const fileReader43 = fsReadModule40["re"+"ad"+"Fi"+"le"];
7444
- import path85 from "path";
7467
+ import * as fsReadModule41 from "fs/promises";
7468
+ const fileReader44 = fsReadModule41["re"+"ad"+"Fi"+"le"];
7469
+ import path86 from "path";
7445
7470
 
7446
7471
  // ../remnic-core/src/graph-dashboard-parser.ts
7447
- import path84 from "path";
7448
- import * as fsReadModule41 from "fs/promises";
7449
- const fileReader42 = fsReadModule41["re"+"ad"+"Fi"+"le"];
7472
+ import path85 from "path";
7473
+ import * as fsReadModule42 from "fs/promises";
7474
+ const fileReader43 = fsReadModule42["re"+"ad"+"Fi"+"le"];
7450
7475
 
7451
7476
  // ../remnic-core/src/compat/checks.ts
7452
- import * as fsReadModule42 from "fs/promises";
7453
- const access7 = fsReadModule42.access;
7454
- const fileReader44 = fsReadModule42["re"+"ad"+"Fi"+"le"];
7455
- import path86 from "path";
7477
+ import * as fsReadModule43 from "fs/promises";
7478
+ const access7 = fsReadModule43.access;
7479
+ const fileReader45 = fsReadModule43["re"+"ad"+"Fi"+"le"];
7480
+ import path87 from "path";
7456
7481
 
7457
7482
  // ../remnic-core/src/resume-bundles.ts
7458
- import path87 from "path";
7459
- import { mkdir as mkdir47, writeFile as writeFile40 } from "fs/promises";
7483
+ import path88 from "path";
7484
+ import { mkdir as mkdir48, writeFile as writeFile41 } from "fs/promises";
7460
7485
 
7461
7486
  // ../remnic-core/src/training-export/converter.ts
7462
- import * as fsReadModule43 from "fs/promises";
7463
- const lstat7 = fsReadModule43.lstat;
7464
- const readdir28 = fsReadModule43.readdir;
7465
- const fileReader45 = fsReadModule43["re"+"ad"+"Fi"+"le"];
7466
- const realpath6 = fsReadModule43.realpath;
7467
- import path88 from "path";
7487
+ import * as fsReadModule44 from "fs/promises";
7488
+ const lstat8 = fsReadModule44.lstat;
7489
+ const readdir29 = fsReadModule44.readdir;
7490
+ const fileReader46 = fsReadModule44["re"+"ad"+"Fi"+"le"];
7491
+ const realpath6 = fsReadModule44.realpath;
7492
+ import path89 from "path";
7468
7493
 
7469
7494
  // ../remnic-core/src/cli.ts
7470
7495
  var webDavOperationChain = Promise.resolve();
@@ -7472,13 +7497,13 @@ var dashboardOperationChain = Promise.resolve();
7472
7497
  var accessHttpOperationChain = Promise.resolve();
7473
7498
 
7474
7499
  // ../remnic-core/src/transfer/capsule-fork.ts
7475
- import * as fsReadModule44 from "fs/promises";
7476
- const lstat8 = fsReadModule44.lstat;
7477
- const mkdir48 = fsReadModule44.mkdir;
7478
- const fileReader47 = fsReadModule44["re"+"ad"+"Fi"+"le"];
7479
- const realpath7 = fsReadModule44.realpath;
7480
- const writeFile41 = fsReadModule44.writeFile;
7481
- import path90 from "path";
7500
+ import * as fsReadModule45 from "fs/promises";
7501
+ const lstat9 = fsReadModule45.lstat;
7502
+ const mkdir49 = fsReadModule45.mkdir;
7503
+ const fileReader48 = fsReadModule45["re"+"ad"+"Fi"+"le"];
7504
+ const realpath7 = fsReadModule45.realpath;
7505
+ const writeFile42 = fsReadModule45.writeFile;
7506
+ import path91 from "path";
7482
7507
 
7483
7508
  // src/openclaw-tools/shapes.ts
7484
7509
  var MemorySearchInputSchema = Type.Object({
@@ -8520,7 +8545,7 @@ function loadPluginEntryFromFile(pluginId) {
8520
8545
  try {
8521
8546
  const explicitConfigPath = (0, env_exports.readEnvVar)("OPENCLAW_CONFIG_PATH") || (0, env_exports.readEnvVar)("OPENCLAW_ENGRAM_CONFIG_PATH");
8522
8547
  const homeDir = (0, env_exports.resolveHomeDir)();
8523
- const configPath = explicitConfigPath && explicitConfigPath.length > 0 ? explicitConfigPath : path91.join(homeDir, ".openclaw", "openclaw.json");
8548
+ const configPath = explicitConfigPath && explicitConfigPath.length > 0 ? explicitConfigPath : path92.join(homeDir, ".openclaw", "openclaw.json");
8524
8549
  const content = readTextFileNow(configPath);
8525
8550
  const config = JSON.parse(content);
8526
8551
  return resolveRemnicPluginEntry2(config, pluginId);
@@ -8536,7 +8561,7 @@ function loadRawConfigFromFile() {
8536
8561
  try {
8537
8562
  const explicitConfigPath = (0, env_exports.readEnvVar)("OPENCLAW_CONFIG_PATH") || (0, env_exports.readEnvVar)("OPENCLAW_ENGRAM_CONFIG_PATH");
8538
8563
  const homeDir = (0, env_exports.resolveHomeDir)();
8539
- const configPath = explicitConfigPath && explicitConfigPath.length > 0 ? explicitConfigPath : path91.join(homeDir, ".openclaw", "openclaw.json");
8564
+ const configPath = explicitConfigPath && explicitConfigPath.length > 0 ? explicitConfigPath : path92.join(homeDir, ".openclaw", "openclaw.json");
8540
8565
  const content = readTextFileNow(configPath);
8541
8566
  const config = JSON.parse(content);
8542
8567
  return config && typeof config === "object" ? config : void 0;
@@ -8553,7 +8578,7 @@ function readPluginHooksPolicy(apiConfig, pluginId) {
8553
8578
  }
8554
8579
  async function maybeRegisterLiveConnectorCron(orchestrator) {
8555
8580
  if (!hasEnabledLiveConnectorConfig(orchestrator.config.connectors)) return;
8556
- const jobsPath = path91.join((0, env_exports.resolveHomeDir)(), ".openclaw", "cron", "jobs.json");
8581
+ const jobsPath = path92.join((0, env_exports.resolveHomeDir)(), ".openclaw", "cron", "jobs.json");
8557
8582
  try {
8558
8583
  if (!fileExistsNow(jobsPath)) {
8559
8584
  logger_exports.log.debug("live connectors cron: jobs.json not found, skipping auto-register");
@@ -8810,9 +8835,9 @@ var pluginDefinition = {
8810
8835
  citationsAutoDetect: cfg.citationsAutoDetect
8811
8836
  });
8812
8837
  globalThis[keys.ACCESS_HTTP_SERVER] = accessHttpServer;
8813
- const pluginStateDir = path91.join(cfg.memoryDir, "state", "plugins", serviceId);
8814
- const togglePrimaryPath = path91.join(pluginStateDir, "session-toggles.json");
8815
- const toggleSecondaryPath = cfg.respectBundledActiveMemoryToggle ? path91.join(cfg.memoryDir, "state", "plugins", "active-memory", "session-toggles.json") : void 0;
8838
+ const pluginStateDir = path92.join(cfg.memoryDir, "state", "plugins", serviceId);
8839
+ const togglePrimaryPath = path92.join(pluginStateDir, "session-toggles.json");
8840
+ const toggleSecondaryPath = cfg.respectBundledActiveMemoryToggle ? path92.join(cfg.memoryDir, "state", "plugins", "active-memory", "session-toggles.json") : void 0;
8816
8841
  const sessionToggleStore = createFileToggleStore(togglePrimaryPath, {
8817
8842
  secondaryReadOnlyPath: toggleSecondaryPath
8818
8843
  });
@@ -8834,11 +8859,11 @@ var pluginDefinition = {
8834
8859
  }
8835
8860
  function resolveDreamJournalPath(runtimeWorkspaceDir) {
8836
8861
  const workspaceRoot = resolveWorkspaceRoot(runtimeWorkspaceDir);
8837
- return path91.isAbsolute(cfg.dreaming.journalPath) ? cfg.dreaming.journalPath : path91.join(workspaceRoot, cfg.dreaming.journalPath);
8862
+ return path92.isAbsolute(cfg.dreaming.journalPath) ? cfg.dreaming.journalPath : path92.join(workspaceRoot, cfg.dreaming.journalPath);
8838
8863
  }
8839
8864
  function resolveHeartbeatJournalPath(runtimeWorkspaceDir) {
8840
8865
  const workspaceRoot = resolveWorkspaceRoot(runtimeWorkspaceDir);
8841
- return path91.isAbsolute(cfg.heartbeat.journalPath) ? cfg.heartbeat.journalPath : path91.join(workspaceRoot, cfg.heartbeat.journalPath);
8866
+ return path92.isAbsolute(cfg.heartbeat.journalPath) ? cfg.heartbeat.journalPath : path92.join(workspaceRoot, cfg.heartbeat.journalPath);
8842
8867
  }
8843
8868
  function queueDreamSurfaceSync(runtimeWorkspaceDir) {
8844
8869
  if (!cfg.dreaming.enabled) return Promise.resolve();
@@ -8996,7 +9021,7 @@ Keep the reflection grounded in the evidence below.
8996
9021
  timeoutMs: cfg.activeRecallTimeoutMs,
8997
9022
  cacheTtlMs: cfg.activeRecallCacheTtlMs,
8998
9023
  persistTranscripts: cfg.activeRecallPersistTranscripts,
8999
- transcriptDir: path91.isAbsolute(cfg.activeRecallTranscriptDir) ? cfg.activeRecallTranscriptDir : path91.join(pluginStateDir, cfg.activeRecallTranscriptDir),
9024
+ transcriptDir: path92.isAbsolute(cfg.activeRecallTranscriptDir) ? cfg.activeRecallTranscriptDir : path92.join(pluginStateDir, cfg.activeRecallTranscriptDir),
9000
9025
  entityGraphDepth: cfg.activeRecallEntityGraphDepth,
9001
9026
  includeCausalTrajectories: cfg.activeRecallIncludeCausalTrajectories,
9002
9027
  includeDaySummary: cfg.activeRecallIncludeDaySummary,
@@ -9872,20 +9897,20 @@ Keep the reflection grounded in the evidence below.
9872
9897
  const remnicQmdCommand = typeof orchestrator.config.qmdPath === "string" && orchestrator.config.qmdPath.trim().length > 0 ? orchestrator.config.qmdPath.trim() : "qmd";
9873
9898
  const readAllowedRoots = [
9874
9899
  orchestrator.config.memoryDir,
9875
- capabilityWorkspaceDir ? path91.join(capabilityWorkspaceDir, "memory") : void 0
9900
+ capabilityWorkspaceDir ? path92.join(capabilityWorkspaceDir, "memory") : void 0
9876
9901
  ].filter((root) => typeof root === "string" && root.length > 0);
9877
9902
  const canonicalizeRootForContainment = async (rawPath) => {
9878
- const resolved = path91.resolve(rawPath);
9903
+ const resolved = path92.resolve(rawPath);
9879
9904
  try {
9880
- return path91.normalize(await realPathLater(resolved));
9905
+ return path92.normalize(await realPathLater(resolved));
9881
9906
  } catch {
9882
- return path91.normalize(resolved);
9907
+ return path92.normalize(resolved);
9883
9908
  }
9884
9909
  };
9885
9910
  const canonicalizeForRead = async (rawPath) => {
9886
- const resolved = path91.resolve(rawPath);
9911
+ const resolved = path92.resolve(rawPath);
9887
9912
  const real = await realPathLater(resolved);
9888
- return path91.normalize(real);
9913
+ return path92.normalize(real);
9889
9914
  };
9890
9915
  const readAllowedCanonicalRootsPromise = Promise.all(
9891
9916
  readAllowedRoots.map((root) => canonicalizeRootForContainment(root))
@@ -9899,29 +9924,29 @@ Keep the reflection grounded in the evidence below.
9899
9924
  }
9900
9925
  const canonicalRoots = await readAllowedCanonicalRootsPromise;
9901
9926
  return canonicalRoots.some((root) => {
9902
- const relative = path91.relative(root, canonicalCandidatePath);
9903
- return relative === "" || !relative.startsWith("..") && !path91.isAbsolute(relative);
9927
+ const relative = path92.relative(root, canonicalCandidatePath);
9928
+ return relative === "" || !relative.startsWith("..") && !path92.isAbsolute(relative);
9904
9929
  });
9905
9930
  };
9906
9931
  const normalizeWorkspacePath = (rawPath) => {
9907
9932
  if (!rawPath || typeof rawPath !== "string") return "memory";
9908
- const resolved = path91.isAbsolute(rawPath) ? path91.resolve(rawPath) : path91.resolve(capabilityWorkspaceDir, rawPath);
9909
- const relative = path91.relative(capabilityWorkspaceDir, resolved);
9910
- return relative && !relative.startsWith("..") && !path91.isAbsolute(relative) ? relative : rawPath;
9933
+ const resolved = path92.isAbsolute(rawPath) ? path92.resolve(rawPath) : path92.resolve(capabilityWorkspaceDir, rawPath);
9934
+ const relative = path92.relative(capabilityWorkspaceDir, resolved);
9935
+ return relative && !relative.startsWith("..") && !path92.isAbsolute(relative) ? relative : rawPath;
9911
9936
  };
9912
9937
  const relativizeToMemoryRoot = (rawPath) => {
9913
9938
  if (!rawPath || typeof rawPath !== "string") return "memory";
9914
- const resolved = path91.isAbsolute(rawPath) ? path91.resolve(rawPath) : path91.resolve(capabilityWorkspaceDir, rawPath);
9939
+ const resolved = path92.isAbsolute(rawPath) ? path92.resolve(rawPath) : path92.resolve(capabilityWorkspaceDir, rawPath);
9915
9940
  for (const root of readAllowedRoots) {
9916
- const relative = path91.relative(root, resolved);
9917
- if (relative !== "" && !relative.startsWith("..") && !path91.isAbsolute(relative)) {
9941
+ const relative = path92.relative(root, resolved);
9942
+ if (relative !== "" && !relative.startsWith("..") && !path92.isAbsolute(relative)) {
9918
9943
  return relative;
9919
9944
  }
9920
9945
  }
9921
9946
  return normalizeWorkspacePath(rawPath);
9922
9947
  };
9923
9948
  const resolveReadablePath = async (requestedPath) => {
9924
- const candidateAbsolutePaths = path91.isAbsolute(requestedPath) ? [path91.resolve(requestedPath)] : readAllowedRoots.map((root) => path91.resolve(root, requestedPath));
9949
+ const candidateAbsolutePaths = path92.isAbsolute(requestedPath) ? [path92.resolve(requestedPath)] : readAllowedRoots.map((root) => path92.resolve(root, requestedPath));
9925
9950
  let canonicalPath;
9926
9951
  let lastError;
9927
9952
  for (const absolutePath of candidateAbsolutePaths) {
@@ -9939,8 +9964,8 @@ Keep the reflection grounded in the evidence below.
9939
9964
  }
9940
9965
  const canonicalRoots = await readAllowedCanonicalRootsPromise;
9941
9966
  const contained = canonicalRoots.some((root) => {
9942
- const relative = path91.relative(root, canonicalPath);
9943
- return relative === "" || !relative.startsWith("..") && !path91.isAbsolute(relative);
9967
+ const relative = path92.relative(root, canonicalPath);
9968
+ return relative === "" || !relative.startsWith("..") && !path92.isAbsolute(relative);
9944
9969
  });
9945
9970
  if (!contained) {
9946
9971
  throw new Error(`memory read outside allowed roots: ${requestedPath}`);
@@ -9972,15 +9997,15 @@ Keep the reflection grounded in the evidence below.
9972
9997
  }).map((result, index) => {
9973
9998
  const candidate = result;
9974
9999
  const rawPath = typeof candidate.path === "string" ? candidate.path : typeof candidate.id === "string" ? candidate.id : `memory-${index + 1}`;
9975
- const absolutePath = path91.isAbsolute(rawPath) ? path91.resolve(rawPath) : (() => {
10000
+ const absolutePath = path92.isAbsolute(rawPath) ? path92.resolve(rawPath) : (() => {
9976
10001
  for (const root of readAllowedRoots) {
9977
- const candidateAbs = path91.resolve(root, rawPath);
9978
- const relative = path91.relative(root, candidateAbs);
9979
- if (!relative.startsWith("..") && !path91.isAbsolute(relative)) {
10002
+ const candidateAbs = path92.resolve(root, rawPath);
10003
+ const relative = path92.relative(root, candidateAbs);
10004
+ if (!relative.startsWith("..") && !path92.isAbsolute(relative)) {
9980
10005
  return candidateAbs;
9981
10006
  }
9982
10007
  }
9983
- return path91.resolve(capabilityWorkspaceDir, rawPath);
10008
+ return path92.resolve(capabilityWorkspaceDir, rawPath);
9984
10009
  })();
9985
10010
  const normalizedPath = relativizeToMemoryRoot(rawPath);
9986
10011
  const startLine = typeof candidate.startLine === "number" && Number.isFinite(candidate.startLine) ? Math.max(1, Math.floor(candidate.startLine)) : 1;
@@ -10436,7 +10461,7 @@ Keep the reflection grounded in the evidence below.
10436
10461
  `session reset via API for ${sessionKey}, new sessionId=${result.sessionId}`
10437
10462
  );
10438
10463
  const safeSessionKey = (0, orchestrator_exports.sanitizeSessionKeyForFilename)(sessionKey);
10439
- const signalPath = path91.join(
10464
+ const signalPath = path92.join(
10440
10465
  workspaceDir,
10441
10466
  `.compaction-reset-signal-${safeSessionKey}`
10442
10467
  );
@@ -10678,7 +10703,7 @@ Keep the reflection grounded in the evidence below.
10678
10703
  }
10679
10704
  async function ensureHourlySummaryCron(api2) {
10680
10705
  const jobId = "engram-hourly-summary";
10681
- const cronFilePath = path91.join(
10706
+ const cronFilePath = path92.join(
10682
10707
  os7.homedir(),
10683
10708
  ".openclaw",
10684
10709
  "cron",
@@ -10744,32 +10769,32 @@ Keep the reflection grounded in the evidence below.
10744
10769
  };
10745
10770
  const normalizeCorpusPath = (value) => value.trim().replace(/\\/g, "/").replace(/^\.\//, "");
10746
10771
  const pathIsInside = (root, candidate) => {
10747
- const relative = path91.relative(root, candidate);
10748
- return relative === "" || !relative.startsWith("..") && !path91.isAbsolute(relative);
10772
+ const relative = path92.relative(root, candidate);
10773
+ return relative === "" || !relative.startsWith("..") && !path92.isAbsolute(relative);
10749
10774
  };
10750
10775
  const corpusPathCandidates = (rawPath, storageDir) => {
10751
10776
  const candidates = /* @__PURE__ */ new Set();
10752
10777
  const trimmed = rawPath.trim();
10753
10778
  if (!trimmed) return [];
10754
10779
  candidates.add(normalizeCorpusPath(trimmed));
10755
- if (path91.isAbsolute(trimmed)) {
10756
- const absolutePath = path91.resolve(trimmed);
10757
- const absoluteStorageDir = path91.resolve(storageDir);
10780
+ if (path92.isAbsolute(trimmed)) {
10781
+ const absolutePath = path92.resolve(trimmed);
10782
+ const absoluteStorageDir = path92.resolve(storageDir);
10758
10783
  if (pathIsInside(absoluteStorageDir, absolutePath)) {
10759
- candidates.add(normalizeCorpusPath(path91.relative(absoluteStorageDir, absolutePath)));
10784
+ candidates.add(normalizeCorpusPath(path92.relative(absoluteStorageDir, absolutePath)));
10760
10785
  }
10761
10786
  }
10762
- candidates.add(path91.basename(trimmed));
10787
+ candidates.add(path92.basename(trimmed));
10763
10788
  return [...candidates].filter((candidate) => candidate.length > 0);
10764
10789
  };
10765
10790
  const displayCorpusPath = (rawPath, storageDir) => {
10766
10791
  const trimmed = rawPath.trim();
10767
10792
  if (!trimmed) return "";
10768
- if (path91.isAbsolute(trimmed)) {
10769
- const absolutePath = path91.resolve(trimmed);
10770
- const absoluteStorageDir = path91.resolve(storageDir);
10793
+ if (path92.isAbsolute(trimmed)) {
10794
+ const absolutePath = path92.resolve(trimmed);
10795
+ const absoluteStorageDir = path92.resolve(storageDir);
10771
10796
  if (pathIsInside(absoluteStorageDir, absolutePath)) {
10772
- return normalizeCorpusPath(path91.relative(absoluteStorageDir, absolutePath));
10797
+ return normalizeCorpusPath(path92.relative(absoluteStorageDir, absolutePath));
10773
10798
  }
10774
10799
  }
10775
10800
  return normalizeCorpusPath(trimmed);
@@ -11150,7 +11175,7 @@ function extractTextContent(msg) {
11150
11175
 
11151
11176
  // src/bridge.ts
11152
11177
  import fs15 from "fs";
11153
- import path92 from "path";
11178
+ import path93 from "path";
11154
11179
  import { Worker } from "worker_threads";
11155
11180
  var DEFAULT_HOST = "127.0.0.1";
11156
11181
  var DEFAULT_PORT = 4318;
@@ -11219,11 +11244,11 @@ function readCompatEnv(primary, legacy) {
11219
11244
  function configPathCandidates() {
11220
11245
  const envPath = readCompatEnv("REMNIC_CONFIG_PATH", "ENGRAM_CONFIG_PATH");
11221
11246
  return [
11222
- ...envPath ? [path92.resolve(envPath)] : [],
11223
- path92.join(resolveHomeDir3(), ".config", "remnic", "config.json"),
11224
- path92.join(resolveHomeDir3(), ".config", "engram", "config.json"),
11225
- path92.join(process.cwd(), "remnic.config.json"),
11226
- path92.join(process.cwd(), "engram.config.json")
11247
+ ...envPath ? [path93.resolve(envPath)] : [],
11248
+ path93.join(resolveHomeDir3(), ".config", "remnic", "config.json"),
11249
+ path93.join(resolveHomeDir3(), ".config", "engram", "config.json"),
11250
+ path93.join(process.cwd(), "remnic.config.json"),
11251
+ path93.join(process.cwd(), "engram.config.json")
11227
11252
  ];
11228
11253
  }
11229
11254
  function fileExists2(filePath) {
@@ -11235,8 +11260,8 @@ function fileExists2(filePath) {
11235
11260
  }
11236
11261
  function isDaemonRunning() {
11237
11262
  for (const pidFile of [
11238
- path92.join(resolveHomeDir3(), ".remnic", "server.pid"),
11239
- path92.join(resolveHomeDir3(), ".engram", "server.pid")
11263
+ path93.join(resolveHomeDir3(), ".remnic", "server.pid"),
11264
+ path93.join(resolveHomeDir3(), ".engram", "server.pid")
11240
11265
  ]) {
11241
11266
  try {
11242
11267
  const pid = parseInt(fs15["re"+"ad"+"Fi"+"le"+"Sync"](pidFile, "utf8").trim(), 10);
@@ -11250,7 +11275,7 @@ function isDaemonRunning() {
11250
11275
  function isDaemonServiceConfigured() {
11251
11276
  const homeDir = resolveHomeDir3();
11252
11277
  for (const segments of [...LAUNCHD_SERVICE_PATHS, ...SYSTEMD_SERVICE_PATHS]) {
11253
- if (fileExists2(path92.join(homeDir, ...segments))) return true;
11278
+ if (fileExists2(path93.join(homeDir, ...segments))) return true;
11254
11279
  }
11255
11280
  return false;
11256
11281
  }
@@ -11338,8 +11363,8 @@ function detectBridgeMode() {
11338
11363
  }
11339
11364
  function loadAnyToken() {
11340
11365
  const tokenPaths = [
11341
- path92.join(resolveHomeDir3(), ".remnic", "tokens.json"),
11342
- path92.join(resolveHomeDir3(), ".engram", "tokens.json")
11366
+ path93.join(resolveHomeDir3(), ".remnic", "tokens.json"),
11367
+ path93.join(resolveHomeDir3(), ".engram", "tokens.json")
11343
11368
  ];
11344
11369
  for (const tokensPath of tokenPaths) {
11345
11370
  if (!fs15.existsSync(tokensPath)) continue;
@@ -6,11 +6,11 @@ import {
6
6
  readMemoryGovernanceRunArtifact,
7
7
  restoreMemoryGovernanceRun,
8
8
  runMemoryGovernance
9
- } from "./chunk-6O3H3DPL.js";
9
+ } from "./chunk-J3EKUNTG.js";
10
10
  import "./chunk-BZ4EYURA.js";
11
- import "./chunk-G3CZA4SD.js";
11
+ import "./chunk-SDPTCSV7.js";
12
12
  import "./chunk-QMUQV5NP.js";
13
- import "./chunk-RKR6PTPA.js";
13
+ import "./chunk-IB4WJJF7.js";
14
14
  import "./chunk-UFU5GGGA.js";
15
15
  import "./chunk-YGGGUTG3.js";
16
16
  import "./chunk-I2KLQ2HA.js";
@@ -13,7 +13,7 @@ import {
13
13
  runSecureStoreMigrate,
14
14
  runSecureStoreStatus,
15
15
  runSecureStoreUnlock
16
- } from "./chunk-QXXEF7VI.js";
16
+ } from "./chunk-Q7COZSFU.js";
17
17
  import {
18
18
  HEADER_FILENAME,
19
19
  HEADER_FORMAT,
@@ -66,7 +66,7 @@ import {
66
66
  migrateMemoryDirToEncrypted,
67
67
  readMaybeEncryptedFile,
68
68
  writeMaybeEncryptedFile
69
- } from "./chunk-RKR6PTPA.js";
69
+ } from "./chunk-IB4WJJF7.js";
70
70
  import {
71
71
  AES_KEY_LENGTH,
72
72
  AUTH_TAG_LENGTH,
@@ -8,9 +8,9 @@ import {
8
8
  normalizeEntityName,
9
9
  parseEntityFile,
10
10
  serializeEntityFile
11
- } from "./chunk-G3CZA4SD.js";
11
+ } from "./chunk-SDPTCSV7.js";
12
12
  import "./chunk-QMUQV5NP.js";
13
- import "./chunk-RKR6PTPA.js";
13
+ import "./chunk-IB4WJJF7.js";
14
14
  import "./chunk-UFU5GGGA.js";
15
15
  import "./chunk-YGGGUTG3.js";
16
16
  import "./chunk-I2KLQ2HA.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "openclaw-remnic",
3
3
  "name": "Remnic OpenClaw Plugin",
4
- "version": "1.0.38",
4
+ "version": "1.0.40",
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": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "OpenClaw adapter for Remnic memory with bundled @remnic/core runtime",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -71,7 +71,7 @@
71
71
  },
72
72
  "dependencies": {
73
73
  "openai": "^6.0.0",
74
- "@remnic/core": "^1.1.14"
74
+ "@remnic/core": "^1.1.16"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "openclaw": ">=2026.5.16-beta.1"