@remnic/plugin-openclaw 1.0.38 → 1.0.39

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,13 @@ 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
+ });
6901
6921
  var nullableOptional = (schema) => schema.optional().nullable().transform((value) => value ?? void 0);
6902
6922
  var actionConfidenceRuleSchema = external_exports.object({
6903
6923
  kind: external_exports.enum(ACTION_CONFIDENCE_RULE_KINDS),
@@ -7076,14 +7096,14 @@ var REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_HTML = `
7076
7096
 
7077
7097
  // ../remnic-core/src/access-http.ts
7078
7098
  function resolveDefaultAdminConsolePublicDir() {
7079
- const thisDir = path48.dirname(fileURLToPath3(import.meta.url));
7099
+ const thisDir = path49.dirname(fileURLToPath3(import.meta.url));
7080
7100
  const candidates = [
7081
7101
  // Standard: admin-console sibling to src/ (development layout)
7082
- path48.resolve(thisDir, "../admin-console/public"),
7102
+ path49.resolve(thisDir, "../admin-console/public"),
7083
7103
  // Bundled: admin-console inside dist/ alongside the bundle
7084
- path48.resolve(thisDir, "./admin-console/public"),
7104
+ path49.resolve(thisDir, "./admin-console/public"),
7085
7105
  // Package root: walk up from dist/ to the package root
7086
- path48.resolve(thisDir, "../../admin-console/public")
7106
+ path49.resolve(thisDir, "../../admin-console/public")
7087
7107
  ];
7088
7108
  return candidates.find((candidate) => existsSync4(candidate)) ?? candidates[0];
7089
7109
  }
@@ -7213,28 +7233,28 @@ var DEFAULT_MAX_BINARY_SIZE_BYTES = 50 * 1024 * 1024;
7213
7233
  // ../remnic-core/src/binary-lifecycle/backend.ts
7214
7234
  import fs3 from "fs";
7215
7235
  import fsp2 from "fs/promises";
7216
- import path49 from "path";
7236
+ import path50 from "path";
7217
7237
 
7218
7238
  // ../remnic-core/src/binary-lifecycle/scanner.ts
7219
7239
  import fsp3 from "fs/promises";
7220
- import path50 from "path";
7240
+ import path51 from "path";
7221
7241
 
7222
7242
  // ../remnic-core/src/binary-lifecycle/manifest.ts
7223
7243
  import fsp4 from "fs/promises";
7224
- import path51 from "path";
7244
+ import path52 from "path";
7225
7245
  import crypto3 from "crypto";
7226
7246
 
7227
7247
  // ../remnic-core/src/binary-lifecycle/pipeline.ts
7228
7248
  import fsp5 from "fs/promises";
7229
- import path52 from "path";
7249
+ import path53 from "path";
7230
7250
  import crypto4 from "crypto";
7231
7251
 
7232
7252
  // ../remnic-core/src/projection/index.ts
7233
7253
  import fs4 from "fs";
7234
- import path54 from "path";
7254
+ import path55 from "path";
7235
7255
 
7236
7256
  // ../remnic-core/src/utils/category-dir.ts
7237
- import path53 from "path";
7257
+ import path54 from "path";
7238
7258
  var CATEGORY_DIR_MAP = {
7239
7259
  correction: "corrections",
7240
7260
  question: "questions",
@@ -7260,211 +7280,211 @@ var ALL_CATEGORY_KEYS = [
7260
7280
 
7261
7281
  // ../remnic-core/src/onboarding/index.ts
7262
7282
  import fs5 from "fs";
7263
- import path55 from "path";
7283
+ import path56 from "path";
7264
7284
 
7265
7285
  // ../remnic-core/src/curation/index.ts
7266
7286
  import fs6 from "fs";
7267
- import path56 from "path";
7287
+ import path57 from "path";
7268
7288
  import crypto5 from "crypto";
7269
7289
 
7270
7290
  // ../remnic-core/src/dedup/index.ts
7271
7291
  import fs7 from "fs";
7272
- import path57 from "path";
7292
+ import path58 from "path";
7273
7293
  import crypto6 from "crypto";
7274
7294
 
7275
7295
  // ../remnic-core/src/review/index.ts
7276
7296
  import fs8 from "fs";
7277
- import path58 from "path";
7297
+ import path59 from "path";
7278
7298
 
7279
7299
  // ../remnic-core/src/sync/index.ts
7280
7300
  import fs9 from "fs";
7281
- import path59 from "path";
7301
+ import path60 from "path";
7282
7302
  import crypto7 from "crypto";
7283
7303
 
7284
7304
  // ../remnic-core/src/connectors/index.ts
7285
7305
  import fs12 from "fs";
7286
- import path62 from "path";
7306
+ import path63 from "path";
7287
7307
  import os5 from "os";
7288
7308
  import { createRequire as createRequire2 } from "module";
7289
7309
  import { fileURLToPath as fileURLToPath4 } from "url";
7290
7310
 
7291
7311
  // ../remnic-core/src/tokens.ts
7292
7312
  import fs10 from "fs";
7293
- import path60 from "path";
7294
- import { randomBytes as randomBytes2, randomUUID as randomUUID7 } from "crypto";
7313
+ import path61 from "path";
7314
+ import { randomBytes as randomBytes2, randomUUID as randomUUID8 } from "crypto";
7295
7315
 
7296
7316
  // ../remnic-core/src/connectors/codex-marketplace.ts
7297
7317
  import fs11 from "fs";
7298
- import path61 from "path";
7318
+ import path62 from "path";
7299
7319
 
7300
7320
  // ../remnic-core/src/spaces/index.ts
7301
7321
  import fs13 from "fs";
7302
- import path63 from "path";
7322
+ import path64 from "path";
7303
7323
  import crypto8 from "crypto";
7304
7324
 
7305
7325
  // ../remnic-core/src/memory-extension/codex-publisher.ts
7306
7326
  import fs14 from "fs";
7307
7327
  import os6 from "os";
7308
- import path64 from "path";
7328
+ import path65 from "path";
7309
7329
 
7310
7330
  // ../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;
7331
+ import * as fsReadModule30 from "fs/promises";
7332
+ const mkdir34 = fsReadModule30.mkdir;
7333
+ const fileReader33 = fsReadModule30["re"+"ad"+"Fi"+"le"];
7334
+ const appendFile5 = fsReadModule30.appendFile;
7315
7335
  import { existsSync as existsSync5 } from "fs";
7316
- import path65 from "path";
7336
+ import path66 from "path";
7317
7337
 
7318
7338
  // ../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";
7339
+ import path90 from "path";
7329
7340
  import * as fsReadModule31 from "fs/promises";
7330
- const mkdir34 = fsReadModule31.mkdir;
7331
- const fileReader33 = fsReadModule31["re"+"ad"+"Fi"+"le"];
7341
+ const access8 = fsReadModule31.access;
7342
+ const fileReader47 = fsReadModule31["re"+"ad"+"Fi"+"le"];
7343
+ const readdir30 = fsReadModule31.readdir;
7344
+ const unlink13 = fsReadModule31.unlink;
7345
+ import { createHash as createHash16 } from "crypto";
7332
7346
 
7333
- // ../remnic-core/src/transfer/export-md.ts
7347
+ // ../remnic-core/src/transfer/export-json.ts
7334
7348
  import path67 from "path";
7335
7349
  import * as fsReadModule32 from "fs/promises";
7336
7350
  const mkdir35 = fsReadModule32.mkdir;
7337
7351
  const fileReader34 = fsReadModule32["re"+"ad"+"Fi"+"le"];
7338
- const writeFile31 = fsReadModule32.writeFile;
7339
7352
 
7340
- // ../remnic-core/src/transfer/backup.ts
7353
+ // ../remnic-core/src/transfer/export-md.ts
7341
7354
  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";
7355
+ import * as fsReadModule33 from "fs/promises";
7356
+ const mkdir36 = fsReadModule33.mkdir;
7357
+ const fileReader35 = fsReadModule33["re"+"ad"+"Fi"+"le"];
7358
+ const writeFile32 = fsReadModule33.writeFile;
7344
7359
 
7345
- // ../remnic-core/src/transfer/export-sqlite.ts
7360
+ // ../remnic-core/src/transfer/backup.ts
7346
7361
  import path69 from "path";
7362
+ import { mkdir as mkdir37, readdir as readdir21, rm as rm8, unlink as unlink10, writeFile as writeFile33 } from "fs/promises";
7363
+ import { gzipSync } from "zlib";
7347
7364
 
7348
- // ../remnic-core/src/transfer/import-json.ts
7365
+ // ../remnic-core/src/transfer/export-sqlite.ts
7349
7366
  import path70 from "path";
7350
- import { mkdir as mkdir37, writeFile as writeFile33 } from "fs/promises";
7351
7367
 
7352
- // ../remnic-core/src/transfer/import-sqlite.ts
7368
+ // ../remnic-core/src/transfer/import-json.ts
7353
7369
  import path71 from "path";
7354
7370
  import { mkdir as mkdir38, writeFile as writeFile34 } from "fs/promises";
7355
7371
 
7356
- // ../remnic-core/src/transfer/import-md.ts
7372
+ // ../remnic-core/src/transfer/import-sqlite.ts
7357
7373
  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;
7374
+ import { mkdir as mkdir39, writeFile as writeFile35 } from "fs/promises";
7362
7375
 
7363
- // ../remnic-core/src/transfer/autodetect.ts
7376
+ // ../remnic-core/src/transfer/import-md.ts
7364
7377
  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
7378
  import * as fsReadModule34 from "fs/promises";
7370
7379
  const mkdir40 = fsReadModule34.mkdir;
7371
- const readdir21 = fsReadModule34.readdir;
7372
7380
  const fileReader36 = fsReadModule34["re"+"ad"+"Fi"+"le"];
7373
- const unlink10 = fsReadModule34.unlink;
7374
7381
  const writeFile36 = fsReadModule34.writeFile;
7375
7382
 
7376
- // ../remnic-core/src/maintenance/rebuild-memory-lifecycle-ledger.ts
7383
+ // ../remnic-core/src/transfer/autodetect.ts
7384
+ import path74 from "path";
7385
+ import { stat as stat16 } from "fs/promises";
7386
+
7387
+ // ../remnic-core/src/maintenance/archive-observations.ts
7377
7388
  import path75 from "path";
7378
- import { mkdir as mkdir41, rename as rename5, stat as stat16, writeFile as writeFile37 } from "fs/promises";
7389
+ import * as fsReadModule35 from "fs/promises";
7390
+ const mkdir41 = fsReadModule35.mkdir;
7391
+ const readdir22 = fsReadModule35.readdir;
7392
+ const fileReader37 = fsReadModule35["re"+"ad"+"Fi"+"le"];
7393
+ const unlink11 = fsReadModule35.unlink;
7394
+ const writeFile37 = fsReadModule35.writeFile;
7379
7395
 
7380
- // ../remnic-core/src/maintenance/rebuild-memory-projection.ts
7396
+ // ../remnic-core/src/maintenance/rebuild-memory-lifecycle-ledger.ts
7381
7397
  import path76 from "path";
7382
- import { mkdir as mkdir42, rename as rename6, rm as rm9, stat as stat17 } from "fs/promises";
7398
+ import { mkdir as mkdir42, rename as rename6, stat as stat17, writeFile as writeFile38 } from "fs/promises";
7399
+
7400
+ // ../remnic-core/src/maintenance/rebuild-memory-projection.ts
7401
+ import path77 from "path";
7402
+ import { mkdir as mkdir43, rename as rename7, rm as rm9, stat as stat18 } from "fs/promises";
7383
7403
 
7384
7404
  // ../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"];
7405
+ import path79 from "path";
7406
+ import * as fsReadModule36 from "fs/promises";
7407
+ const readdir23 = fsReadModule36.readdir;
7408
+ const fileReader39 = fsReadModule36["re"+"ad"+"Fi"+"le"];
7389
7409
 
7390
7410
  // ../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;
7411
+ import path78 from "path";
7412
+ import * as fsReadModule37 from "fs/promises";
7413
+ const mkdir44 = fsReadModule37.mkdir;
7414
+ const fileReader38 = fsReadModule37["re"+"ad"+"Fi"+"le"];
7415
+ const writeFile39 = fsReadModule37.writeFile;
7396
7416
 
7397
7417
  // ../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"];
7418
+ import path80 from "path";
7419
+ import * as fsReadModule38 from "fs/promises";
7420
+ const readdir24 = fsReadModule38.readdir;
7421
+ const fileReader40 = fsReadModule38["re"+"ad"+"Fi"+"le"];
7402
7422
 
7403
7423
  // ../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";
7424
+ import path81 from "path";
7425
+ import { access as access4, mkdir as mkdir45, readdir as readdir25, rename as rename8 } from "fs/promises";
7406
7426
 
7407
7427
  // ../remnic-core/src/operator-toolkit.ts
7408
- import path82 from "path";
7428
+ import path83 from "path";
7409
7429
  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;
7430
+ import * as fsReadModule39 from "fs/promises";
7431
+ const access6 = fsReadModule39.access;
7432
+ const mkdir46 = fsReadModule39.mkdir;
7433
+ const fileReader42 = fsReadModule39["re"+"ad"+"Fi"+"le"];
7434
+ const readdir27 = fsReadModule39.readdir;
7435
+ const stat20 = fsReadModule39.stat;
7436
+ const unlink12 = fsReadModule39.unlink;
7437
+ const writeFile40 = fsReadModule39.writeFile;
7418
7438
 
7419
7439
  // ../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;
7440
+ import path82 from "path";
7441
+ import * as fsReadModule40 from "fs/promises";
7442
+ const readdir26 = fsReadModule40.readdir;
7443
+ const fileReader41 = fsReadModule40["re"+"ad"+"Fi"+"le"];
7444
+ const stat19 = fsReadModule40.stat;
7425
7445
 
7426
7446
  // ../remnic-core/src/network/tailscale.ts
7427
- import { stat as stat20 } from "fs/promises";
7447
+ import { stat as stat21 } from "fs/promises";
7428
7448
 
7429
7449
  // ../remnic-core/src/network/webdav.ts
7430
7450
  import { createReadStream } from "fs";
7431
- import { mkdir as mkdir46, readdir as readdir27, realpath as realpath5, stat as stat21 } from "fs/promises";
7451
+ import { mkdir as mkdir47, readdir as readdir28, realpath as realpath5, stat as stat22 } from "fs/promises";
7432
7452
  import { createServer as createServer2 } from "http";
7433
7453
  import { timingSafeEqual as timingSafeEqual2 } from "crypto";
7434
- import path83 from "path";
7454
+ import path84 from "path";
7435
7455
  import { pipeline } from "stream/promises";
7436
7456
  import { URL as URL3 } from "url";
7437
7457
 
7438
7458
  // ../remnic-core/src/dashboard-runtime.ts
7439
- import { createHash as createHash14 } from "crypto";
7459
+ import { createHash as createHash15 } from "crypto";
7440
7460
  import { createServer as createServer3 } from "http";
7441
7461
  import { watch } from "fs";
7442
- import * as fsReadModule40 from "fs/promises";
7443
- const fileReader43 = fsReadModule40["re"+"ad"+"Fi"+"le"];
7444
- import path85 from "path";
7462
+ import * as fsReadModule41 from "fs/promises";
7463
+ const fileReader44 = fsReadModule41["re"+"ad"+"Fi"+"le"];
7464
+ import path86 from "path";
7445
7465
 
7446
7466
  // ../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"];
7467
+ import path85 from "path";
7468
+ import * as fsReadModule42 from "fs/promises";
7469
+ const fileReader43 = fsReadModule42["re"+"ad"+"Fi"+"le"];
7450
7470
 
7451
7471
  // ../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";
7472
+ import * as fsReadModule43 from "fs/promises";
7473
+ const access7 = fsReadModule43.access;
7474
+ const fileReader45 = fsReadModule43["re"+"ad"+"Fi"+"le"];
7475
+ import path87 from "path";
7456
7476
 
7457
7477
  // ../remnic-core/src/resume-bundles.ts
7458
- import path87 from "path";
7459
- import { mkdir as mkdir47, writeFile as writeFile40 } from "fs/promises";
7478
+ import path88 from "path";
7479
+ import { mkdir as mkdir48, writeFile as writeFile41 } from "fs/promises";
7460
7480
 
7461
7481
  // ../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";
7482
+ import * as fsReadModule44 from "fs/promises";
7483
+ const lstat8 = fsReadModule44.lstat;
7484
+ const readdir29 = fsReadModule44.readdir;
7485
+ const fileReader46 = fsReadModule44["re"+"ad"+"Fi"+"le"];
7486
+ const realpath6 = fsReadModule44.realpath;
7487
+ import path89 from "path";
7468
7488
 
7469
7489
  // ../remnic-core/src/cli.ts
7470
7490
  var webDavOperationChain = Promise.resolve();
@@ -7472,13 +7492,13 @@ var dashboardOperationChain = Promise.resolve();
7472
7492
  var accessHttpOperationChain = Promise.resolve();
7473
7493
 
7474
7494
  // ../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";
7495
+ import * as fsReadModule45 from "fs/promises";
7496
+ const lstat9 = fsReadModule45.lstat;
7497
+ const mkdir49 = fsReadModule45.mkdir;
7498
+ const fileReader48 = fsReadModule45["re"+"ad"+"Fi"+"le"];
7499
+ const realpath7 = fsReadModule45.realpath;
7500
+ const writeFile42 = fsReadModule45.writeFile;
7501
+ import path91 from "path";
7482
7502
 
7483
7503
  // src/openclaw-tools/shapes.ts
7484
7504
  var MemorySearchInputSchema = Type.Object({
@@ -8520,7 +8540,7 @@ function loadPluginEntryFromFile(pluginId) {
8520
8540
  try {
8521
8541
  const explicitConfigPath = (0, env_exports.readEnvVar)("OPENCLAW_CONFIG_PATH") || (0, env_exports.readEnvVar)("OPENCLAW_ENGRAM_CONFIG_PATH");
8522
8542
  const homeDir = (0, env_exports.resolveHomeDir)();
8523
- const configPath = explicitConfigPath && explicitConfigPath.length > 0 ? explicitConfigPath : path91.join(homeDir, ".openclaw", "openclaw.json");
8543
+ const configPath = explicitConfigPath && explicitConfigPath.length > 0 ? explicitConfigPath : path92.join(homeDir, ".openclaw", "openclaw.json");
8524
8544
  const content = readTextFileNow(configPath);
8525
8545
  const config = JSON.parse(content);
8526
8546
  return resolveRemnicPluginEntry2(config, pluginId);
@@ -8536,7 +8556,7 @@ function loadRawConfigFromFile() {
8536
8556
  try {
8537
8557
  const explicitConfigPath = (0, env_exports.readEnvVar)("OPENCLAW_CONFIG_PATH") || (0, env_exports.readEnvVar)("OPENCLAW_ENGRAM_CONFIG_PATH");
8538
8558
  const homeDir = (0, env_exports.resolveHomeDir)();
8539
- const configPath = explicitConfigPath && explicitConfigPath.length > 0 ? explicitConfigPath : path91.join(homeDir, ".openclaw", "openclaw.json");
8559
+ const configPath = explicitConfigPath && explicitConfigPath.length > 0 ? explicitConfigPath : path92.join(homeDir, ".openclaw", "openclaw.json");
8540
8560
  const content = readTextFileNow(configPath);
8541
8561
  const config = JSON.parse(content);
8542
8562
  return config && typeof config === "object" ? config : void 0;
@@ -8553,7 +8573,7 @@ function readPluginHooksPolicy(apiConfig, pluginId) {
8553
8573
  }
8554
8574
  async function maybeRegisterLiveConnectorCron(orchestrator) {
8555
8575
  if (!hasEnabledLiveConnectorConfig(orchestrator.config.connectors)) return;
8556
- const jobsPath = path91.join((0, env_exports.resolveHomeDir)(), ".openclaw", "cron", "jobs.json");
8576
+ const jobsPath = path92.join((0, env_exports.resolveHomeDir)(), ".openclaw", "cron", "jobs.json");
8557
8577
  try {
8558
8578
  if (!fileExistsNow(jobsPath)) {
8559
8579
  logger_exports.log.debug("live connectors cron: jobs.json not found, skipping auto-register");
@@ -8810,9 +8830,9 @@ var pluginDefinition = {
8810
8830
  citationsAutoDetect: cfg.citationsAutoDetect
8811
8831
  });
8812
8832
  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;
8833
+ const pluginStateDir = path92.join(cfg.memoryDir, "state", "plugins", serviceId);
8834
+ const togglePrimaryPath = path92.join(pluginStateDir, "session-toggles.json");
8835
+ const toggleSecondaryPath = cfg.respectBundledActiveMemoryToggle ? path92.join(cfg.memoryDir, "state", "plugins", "active-memory", "session-toggles.json") : void 0;
8816
8836
  const sessionToggleStore = createFileToggleStore(togglePrimaryPath, {
8817
8837
  secondaryReadOnlyPath: toggleSecondaryPath
8818
8838
  });
@@ -8834,11 +8854,11 @@ var pluginDefinition = {
8834
8854
  }
8835
8855
  function resolveDreamJournalPath(runtimeWorkspaceDir) {
8836
8856
  const workspaceRoot = resolveWorkspaceRoot(runtimeWorkspaceDir);
8837
- return path91.isAbsolute(cfg.dreaming.journalPath) ? cfg.dreaming.journalPath : path91.join(workspaceRoot, cfg.dreaming.journalPath);
8857
+ return path92.isAbsolute(cfg.dreaming.journalPath) ? cfg.dreaming.journalPath : path92.join(workspaceRoot, cfg.dreaming.journalPath);
8838
8858
  }
8839
8859
  function resolveHeartbeatJournalPath(runtimeWorkspaceDir) {
8840
8860
  const workspaceRoot = resolveWorkspaceRoot(runtimeWorkspaceDir);
8841
- return path91.isAbsolute(cfg.heartbeat.journalPath) ? cfg.heartbeat.journalPath : path91.join(workspaceRoot, cfg.heartbeat.journalPath);
8861
+ return path92.isAbsolute(cfg.heartbeat.journalPath) ? cfg.heartbeat.journalPath : path92.join(workspaceRoot, cfg.heartbeat.journalPath);
8842
8862
  }
8843
8863
  function queueDreamSurfaceSync(runtimeWorkspaceDir) {
8844
8864
  if (!cfg.dreaming.enabled) return Promise.resolve();
@@ -8996,7 +9016,7 @@ Keep the reflection grounded in the evidence below.
8996
9016
  timeoutMs: cfg.activeRecallTimeoutMs,
8997
9017
  cacheTtlMs: cfg.activeRecallCacheTtlMs,
8998
9018
  persistTranscripts: cfg.activeRecallPersistTranscripts,
8999
- transcriptDir: path91.isAbsolute(cfg.activeRecallTranscriptDir) ? cfg.activeRecallTranscriptDir : path91.join(pluginStateDir, cfg.activeRecallTranscriptDir),
9019
+ transcriptDir: path92.isAbsolute(cfg.activeRecallTranscriptDir) ? cfg.activeRecallTranscriptDir : path92.join(pluginStateDir, cfg.activeRecallTranscriptDir),
9000
9020
  entityGraphDepth: cfg.activeRecallEntityGraphDepth,
9001
9021
  includeCausalTrajectories: cfg.activeRecallIncludeCausalTrajectories,
9002
9022
  includeDaySummary: cfg.activeRecallIncludeDaySummary,
@@ -9872,20 +9892,20 @@ Keep the reflection grounded in the evidence below.
9872
9892
  const remnicQmdCommand = typeof orchestrator.config.qmdPath === "string" && orchestrator.config.qmdPath.trim().length > 0 ? orchestrator.config.qmdPath.trim() : "qmd";
9873
9893
  const readAllowedRoots = [
9874
9894
  orchestrator.config.memoryDir,
9875
- capabilityWorkspaceDir ? path91.join(capabilityWorkspaceDir, "memory") : void 0
9895
+ capabilityWorkspaceDir ? path92.join(capabilityWorkspaceDir, "memory") : void 0
9876
9896
  ].filter((root) => typeof root === "string" && root.length > 0);
9877
9897
  const canonicalizeRootForContainment = async (rawPath) => {
9878
- const resolved = path91.resolve(rawPath);
9898
+ const resolved = path92.resolve(rawPath);
9879
9899
  try {
9880
- return path91.normalize(await realPathLater(resolved));
9900
+ return path92.normalize(await realPathLater(resolved));
9881
9901
  } catch {
9882
- return path91.normalize(resolved);
9902
+ return path92.normalize(resolved);
9883
9903
  }
9884
9904
  };
9885
9905
  const canonicalizeForRead = async (rawPath) => {
9886
- const resolved = path91.resolve(rawPath);
9906
+ const resolved = path92.resolve(rawPath);
9887
9907
  const real = await realPathLater(resolved);
9888
- return path91.normalize(real);
9908
+ return path92.normalize(real);
9889
9909
  };
9890
9910
  const readAllowedCanonicalRootsPromise = Promise.all(
9891
9911
  readAllowedRoots.map((root) => canonicalizeRootForContainment(root))
@@ -9899,29 +9919,29 @@ Keep the reflection grounded in the evidence below.
9899
9919
  }
9900
9920
  const canonicalRoots = await readAllowedCanonicalRootsPromise;
9901
9921
  return canonicalRoots.some((root) => {
9902
- const relative = path91.relative(root, canonicalCandidatePath);
9903
- return relative === "" || !relative.startsWith("..") && !path91.isAbsolute(relative);
9922
+ const relative = path92.relative(root, canonicalCandidatePath);
9923
+ return relative === "" || !relative.startsWith("..") && !path92.isAbsolute(relative);
9904
9924
  });
9905
9925
  };
9906
9926
  const normalizeWorkspacePath = (rawPath) => {
9907
9927
  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;
9928
+ const resolved = path92.isAbsolute(rawPath) ? path92.resolve(rawPath) : path92.resolve(capabilityWorkspaceDir, rawPath);
9929
+ const relative = path92.relative(capabilityWorkspaceDir, resolved);
9930
+ return relative && !relative.startsWith("..") && !path92.isAbsolute(relative) ? relative : rawPath;
9911
9931
  };
9912
9932
  const relativizeToMemoryRoot = (rawPath) => {
9913
9933
  if (!rawPath || typeof rawPath !== "string") return "memory";
9914
- const resolved = path91.isAbsolute(rawPath) ? path91.resolve(rawPath) : path91.resolve(capabilityWorkspaceDir, rawPath);
9934
+ const resolved = path92.isAbsolute(rawPath) ? path92.resolve(rawPath) : path92.resolve(capabilityWorkspaceDir, rawPath);
9915
9935
  for (const root of readAllowedRoots) {
9916
- const relative = path91.relative(root, resolved);
9917
- if (relative !== "" && !relative.startsWith("..") && !path91.isAbsolute(relative)) {
9936
+ const relative = path92.relative(root, resolved);
9937
+ if (relative !== "" && !relative.startsWith("..") && !path92.isAbsolute(relative)) {
9918
9938
  return relative;
9919
9939
  }
9920
9940
  }
9921
9941
  return normalizeWorkspacePath(rawPath);
9922
9942
  };
9923
9943
  const resolveReadablePath = async (requestedPath) => {
9924
- const candidateAbsolutePaths = path91.isAbsolute(requestedPath) ? [path91.resolve(requestedPath)] : readAllowedRoots.map((root) => path91.resolve(root, requestedPath));
9944
+ const candidateAbsolutePaths = path92.isAbsolute(requestedPath) ? [path92.resolve(requestedPath)] : readAllowedRoots.map((root) => path92.resolve(root, requestedPath));
9925
9945
  let canonicalPath;
9926
9946
  let lastError;
9927
9947
  for (const absolutePath of candidateAbsolutePaths) {
@@ -9939,8 +9959,8 @@ Keep the reflection grounded in the evidence below.
9939
9959
  }
9940
9960
  const canonicalRoots = await readAllowedCanonicalRootsPromise;
9941
9961
  const contained = canonicalRoots.some((root) => {
9942
- const relative = path91.relative(root, canonicalPath);
9943
- return relative === "" || !relative.startsWith("..") && !path91.isAbsolute(relative);
9962
+ const relative = path92.relative(root, canonicalPath);
9963
+ return relative === "" || !relative.startsWith("..") && !path92.isAbsolute(relative);
9944
9964
  });
9945
9965
  if (!contained) {
9946
9966
  throw new Error(`memory read outside allowed roots: ${requestedPath}`);
@@ -9972,15 +9992,15 @@ Keep the reflection grounded in the evidence below.
9972
9992
  }).map((result, index) => {
9973
9993
  const candidate = result;
9974
9994
  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) : (() => {
9995
+ const absolutePath = path92.isAbsolute(rawPath) ? path92.resolve(rawPath) : (() => {
9976
9996
  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)) {
9997
+ const candidateAbs = path92.resolve(root, rawPath);
9998
+ const relative = path92.relative(root, candidateAbs);
9999
+ if (!relative.startsWith("..") && !path92.isAbsolute(relative)) {
9980
10000
  return candidateAbs;
9981
10001
  }
9982
10002
  }
9983
- return path91.resolve(capabilityWorkspaceDir, rawPath);
10003
+ return path92.resolve(capabilityWorkspaceDir, rawPath);
9984
10004
  })();
9985
10005
  const normalizedPath = relativizeToMemoryRoot(rawPath);
9986
10006
  const startLine = typeof candidate.startLine === "number" && Number.isFinite(candidate.startLine) ? Math.max(1, Math.floor(candidate.startLine)) : 1;
@@ -10436,7 +10456,7 @@ Keep the reflection grounded in the evidence below.
10436
10456
  `session reset via API for ${sessionKey}, new sessionId=${result.sessionId}`
10437
10457
  );
10438
10458
  const safeSessionKey = (0, orchestrator_exports.sanitizeSessionKeyForFilename)(sessionKey);
10439
- const signalPath = path91.join(
10459
+ const signalPath = path92.join(
10440
10460
  workspaceDir,
10441
10461
  `.compaction-reset-signal-${safeSessionKey}`
10442
10462
  );
@@ -10678,7 +10698,7 @@ Keep the reflection grounded in the evidence below.
10678
10698
  }
10679
10699
  async function ensureHourlySummaryCron(api2) {
10680
10700
  const jobId = "engram-hourly-summary";
10681
- const cronFilePath = path91.join(
10701
+ const cronFilePath = path92.join(
10682
10702
  os7.homedir(),
10683
10703
  ".openclaw",
10684
10704
  "cron",
@@ -10744,32 +10764,32 @@ Keep the reflection grounded in the evidence below.
10744
10764
  };
10745
10765
  const normalizeCorpusPath = (value) => value.trim().replace(/\\/g, "/").replace(/^\.\//, "");
10746
10766
  const pathIsInside = (root, candidate) => {
10747
- const relative = path91.relative(root, candidate);
10748
- return relative === "" || !relative.startsWith("..") && !path91.isAbsolute(relative);
10767
+ const relative = path92.relative(root, candidate);
10768
+ return relative === "" || !relative.startsWith("..") && !path92.isAbsolute(relative);
10749
10769
  };
10750
10770
  const corpusPathCandidates = (rawPath, storageDir) => {
10751
10771
  const candidates = /* @__PURE__ */ new Set();
10752
10772
  const trimmed = rawPath.trim();
10753
10773
  if (!trimmed) return [];
10754
10774
  candidates.add(normalizeCorpusPath(trimmed));
10755
- if (path91.isAbsolute(trimmed)) {
10756
- const absolutePath = path91.resolve(trimmed);
10757
- const absoluteStorageDir = path91.resolve(storageDir);
10775
+ if (path92.isAbsolute(trimmed)) {
10776
+ const absolutePath = path92.resolve(trimmed);
10777
+ const absoluteStorageDir = path92.resolve(storageDir);
10758
10778
  if (pathIsInside(absoluteStorageDir, absolutePath)) {
10759
- candidates.add(normalizeCorpusPath(path91.relative(absoluteStorageDir, absolutePath)));
10779
+ candidates.add(normalizeCorpusPath(path92.relative(absoluteStorageDir, absolutePath)));
10760
10780
  }
10761
10781
  }
10762
- candidates.add(path91.basename(trimmed));
10782
+ candidates.add(path92.basename(trimmed));
10763
10783
  return [...candidates].filter((candidate) => candidate.length > 0);
10764
10784
  };
10765
10785
  const displayCorpusPath = (rawPath, storageDir) => {
10766
10786
  const trimmed = rawPath.trim();
10767
10787
  if (!trimmed) return "";
10768
- if (path91.isAbsolute(trimmed)) {
10769
- const absolutePath = path91.resolve(trimmed);
10770
- const absoluteStorageDir = path91.resolve(storageDir);
10788
+ if (path92.isAbsolute(trimmed)) {
10789
+ const absolutePath = path92.resolve(trimmed);
10790
+ const absoluteStorageDir = path92.resolve(storageDir);
10771
10791
  if (pathIsInside(absoluteStorageDir, absolutePath)) {
10772
- return normalizeCorpusPath(path91.relative(absoluteStorageDir, absolutePath));
10792
+ return normalizeCorpusPath(path92.relative(absoluteStorageDir, absolutePath));
10773
10793
  }
10774
10794
  }
10775
10795
  return normalizeCorpusPath(trimmed);
@@ -11150,7 +11170,7 @@ function extractTextContent(msg) {
11150
11170
 
11151
11171
  // src/bridge.ts
11152
11172
  import fs15 from "fs";
11153
- import path92 from "path";
11173
+ import path93 from "path";
11154
11174
  import { Worker } from "worker_threads";
11155
11175
  var DEFAULT_HOST = "127.0.0.1";
11156
11176
  var DEFAULT_PORT = 4318;
@@ -11219,11 +11239,11 @@ function readCompatEnv(primary, legacy) {
11219
11239
  function configPathCandidates() {
11220
11240
  const envPath = readCompatEnv("REMNIC_CONFIG_PATH", "ENGRAM_CONFIG_PATH");
11221
11241
  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")
11242
+ ...envPath ? [path93.resolve(envPath)] : [],
11243
+ path93.join(resolveHomeDir3(), ".config", "remnic", "config.json"),
11244
+ path93.join(resolveHomeDir3(), ".config", "engram", "config.json"),
11245
+ path93.join(process.cwd(), "remnic.config.json"),
11246
+ path93.join(process.cwd(), "engram.config.json")
11227
11247
  ];
11228
11248
  }
11229
11249
  function fileExists2(filePath) {
@@ -11235,8 +11255,8 @@ function fileExists2(filePath) {
11235
11255
  }
11236
11256
  function isDaemonRunning() {
11237
11257
  for (const pidFile of [
11238
- path92.join(resolveHomeDir3(), ".remnic", "server.pid"),
11239
- path92.join(resolveHomeDir3(), ".engram", "server.pid")
11258
+ path93.join(resolveHomeDir3(), ".remnic", "server.pid"),
11259
+ path93.join(resolveHomeDir3(), ".engram", "server.pid")
11240
11260
  ]) {
11241
11261
  try {
11242
11262
  const pid = parseInt(fs15["re"+"ad"+"Fi"+"le"+"Sync"](pidFile, "utf8").trim(), 10);
@@ -11250,7 +11270,7 @@ function isDaemonRunning() {
11250
11270
  function isDaemonServiceConfigured() {
11251
11271
  const homeDir = resolveHomeDir3();
11252
11272
  for (const segments of [...LAUNCHD_SERVICE_PATHS, ...SYSTEMD_SERVICE_PATHS]) {
11253
- if (fileExists2(path92.join(homeDir, ...segments))) return true;
11273
+ if (fileExists2(path93.join(homeDir, ...segments))) return true;
11254
11274
  }
11255
11275
  return false;
11256
11276
  }
@@ -11338,8 +11358,8 @@ function detectBridgeMode() {
11338
11358
  }
11339
11359
  function loadAnyToken() {
11340
11360
  const tokenPaths = [
11341
- path92.join(resolveHomeDir3(), ".remnic", "tokens.json"),
11342
- path92.join(resolveHomeDir3(), ".engram", "tokens.json")
11361
+ path93.join(resolveHomeDir3(), ".remnic", "tokens.json"),
11362
+ path93.join(resolveHomeDir3(), ".engram", "tokens.json")
11343
11363
  ];
11344
11364
  for (const tokensPath of tokenPaths) {
11345
11365
  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.39",
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.39",
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.15"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "openclaw": ">=2026.5.16-beta.1"