@remnic/plugin-openclaw 1.0.34 → 1.0.36

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.
Files changed (87) hide show
  1. package/README.md +59 -10
  2. package/dist/{calibration-JD4AU7FB.js → calibration-RKL2LRW4.js} +4 -4
  3. package/dist/{capsule-cli-GBM3WPAM.js → capsule-cli-EHZPMXBC.js} +2 -2
  4. package/dist/{capsule-crypto-K3IRTKRH.js → capsule-crypto-JS67OSWM.js} +3 -3
  5. package/dist/capsule-export-YPDWRB3C.js +17 -0
  6. package/dist/capsule-import-SWPOFG6F.js +16 -0
  7. package/dist/{capsule-merge-IWOQ34KL.js → capsule-merge-YXAF7ZJW.js} +7 -7
  8. package/dist/{causal-chain-WYN5QOPS.js → causal-chain-BVTOWZKC.js} +4 -4
  9. package/dist/{causal-consolidation-DSLFN64P.js → causal-consolidation-DRPM2KOE.js} +13 -10
  10. package/dist/{causal-retrieval-NZHQOZOE.js → causal-retrieval-XAP6QKHZ.js} +4 -5
  11. package/dist/{causal-trajectory-graph-VBPE2WPM.js → causal-trajectory-graph-ZWQWZ7N5.js} +2 -2
  12. package/dist/{chunk-5LE4HTVL.js → chunk-25J4PXDH.js} +0 -18
  13. package/dist/{chunk-FGTYFLL5.js → chunk-3IHGISUN.js} +29 -32
  14. package/dist/{chunk-6UFI73TJ.js → chunk-3IKMUNW5.js} +53 -46
  15. package/dist/{chunk-EXDYWXMB.js → chunk-4XDQ3KEC.js} +1 -2
  16. package/dist/{chunk-4UA6KMRO.js → chunk-6O3H3DPL.js} +2 -2
  17. package/dist/{chunk-7NMHI4IC.js → chunk-BLC3RQNV.js} +5 -555
  18. package/dist/{chunk-4G2XCSD2.js → chunk-BZ4EYURA.js} +0 -5
  19. package/dist/{chunk-4LYQ4ONL.js → chunk-E4RM7637.js} +1 -1
  20. package/dist/{chunk-TDRJVMUP.js → chunk-EH4AXGRO.js} +0 -12
  21. package/dist/{chunk-ZXLYEVOP.js → chunk-G3CZA4SD.js} +60 -362
  22. package/dist/chunk-I2KLQ2HA.js +22 -0
  23. package/dist/chunk-IO5WWY6A.js +156 -0
  24. package/dist/{contradiction-scan-U3QKHWQN.js → chunk-JC3FCKYL.js} +191 -87
  25. package/dist/{chunk-SVSQAG6M.js → chunk-KC7KSQR4.js} +47 -28
  26. package/dist/chunk-LZCGPRHS.js +228 -0
  27. package/dist/{chunk-CXM7EBAO.js → chunk-MXFJXUHC.js} +1 -1
  28. package/dist/{chunk-L6I4MQKO.js → chunk-NNAN63QK.js} +6 -6
  29. package/dist/{chunk-VRGUUHBV.js → chunk-NUWDSTP7.js} +1 -1
  30. package/dist/{chunk-6OJAU466.js → chunk-QMUQV5NP.js} +0 -1
  31. package/dist/{chunk-LLUROTZJ.js → chunk-QQXJODFL.js} +9 -9
  32. package/dist/{chunk-6F6EKSVP.js → chunk-QXXEF7VI.js} +1 -1
  33. package/dist/{chunk-NDZNURDM.js → chunk-SEGEX7W4.js} +73 -241
  34. package/dist/{chunk-7NUFIRM3.js → chunk-SWOYEQN2.js} +97 -21
  35. package/dist/chunk-TH5FF5SC.js +16 -0
  36. package/dist/chunk-UZJ7EERS.js +272 -0
  37. package/dist/chunk-YJYZMLD5.js +360 -0
  38. package/dist/{chunk-NKVIN6RD.js → chunk-YKV4EFUI.js} +84 -2
  39. package/dist/{chunk-SSFTU6LP.js → chunk-ZS6VABML.js} +4 -4
  40. package/dist/{cipher-VHAFCG7Z.js → cipher-E23BHBSO.js} +1 -1
  41. package/dist/{consolidation-undo-5ZSX4MWO.js → consolidation-undo-FKJZCJHS.js} +2 -2
  42. package/dist/contradiction-review-WJRWNQ5N.js +29 -0
  43. package/dist/contradiction-scan-5X423QGT.js +12 -0
  44. package/dist/{dreams-ledger-3I52ISYR.js → dreams-ledger-KDX44I7R.js} +1 -1
  45. package/dist/{engine-57HLTQBN.js → engine-5P774HTZ.js} +6 -6
  46. package/dist/{extraction-judge-telemetry-GHOTVYMP.js → extraction-judge-telemetry-O4ZVGLTU.js} +1 -1
  47. package/dist/{fallback-llm-33SPYXQY.js → fallback-llm-43UMEXNJ.js} +3 -3
  48. package/dist/{first-start-migration-I24M2JEE.js → first-start-migration-H2SAXAGR.js} +4 -4
  49. package/dist/{forget-NI4RBDPB.js → forget-ZECIDNL5.js} +1 -1
  50. package/dist/{fs-utils-PZRI2HDZ.js → fs-utils-OYXSZSVV.js} +12 -2
  51. package/dist/{graph-edge-decay-5CVKWBYH.js → graph-edge-decay-24ZKD5QL.js} +5 -5
  52. package/dist/index.js +7187 -71983
  53. package/dist/{kdf-H5B23ZM2.js → kdf-RXKIWHRU.js} +1 -1
  54. package/dist/legacy-hook-compat-QHHKF4GK.js +2 -0
  55. package/dist/{logger-TNOKCH7X.js → logger-XG7JKLPS.js} +1 -1
  56. package/dist/{memory-governance-FEQCA35V.js → memory-governance-6K4M4YXD.js} +5 -5
  57. package/dist/{metadata-JAGIWHEA.js → metadata-WK2TRPYZ.js} +1 -1
  58. package/dist/{migrate-from-identity-anchor-7MMSPEUM.js → migrate-from-identity-anchor-SNDNKHZD.js} +1 -1
  59. package/dist/path-ZKO74XXC.js +7 -0
  60. package/dist/{peers-KRFXWRQ6.js → peers-W53WSDXG.js} +1 -1
  61. package/dist/{purge-XN2VSPZ2.js → purge-IKJISXEQ.js} +1 -1
  62. package/dist/resolution-BN35OXDS.js +11 -0
  63. package/dist/{secure-store-A4NGCNXV.js → secure-store-F75I54O5.js} +3 -3
  64. package/dist/{state-PVISYXRH.js → state-4ITLYMAU.js} +1 -1
  65. package/dist/{state-store-N6TFBFSP.js → state-store-ET3ADVY5.js} +3 -3
  66. package/dist/{storage-R3V6ZFQT.js → storage-5EY6T7ON.js} +3 -3
  67. package/dist/{tier-stats-IZNW66NC.js → tier-stats-ZRQBV6G2.js} +4 -4
  68. package/dist/{trace-NJESSGH7.js → trace-IL2Y34EH.js} +1 -1
  69. package/dist/{tui-MGK2LYJY.js → tui-7KRDCMYK.js} +1 -1
  70. package/dist/{types-R4DO7AKM.js → types-7L34HYDW.js} +3 -3
  71. package/openclaw.plugin.json +153 -20
  72. package/package.json +18 -9
  73. package/scripts/faiss_index.py +756 -0
  74. package/scripts/faiss_requirements.txt +3 -0
  75. package/dist/capsule-export-IXVERCQG.js +0 -17
  76. package/dist/capsule-import-IA6VIOPQ.js +0 -16
  77. package/dist/chunk-3GUF7RQI.js +0 -559
  78. package/dist/chunk-7OQEPGQF.js +0 -533
  79. package/dist/chunk-DIZW6H5J.js +0 -136
  80. package/dist/chunk-FQRSVYY4.js +0 -110
  81. package/dist/chunk-GUSMRW4H.js +0 -12
  82. package/dist/chunk-MLKGABMK.js +0 -9
  83. package/dist/chunk-WPINX4MF.js +0 -380
  84. package/dist/contradiction-review-SVGBS3V5.js +0 -21
  85. package/dist/legacy-hook-compat-XQ7FP6FV.js +0 -35
  86. package/dist/path-JIEGNWFL.js +0 -7
  87. package/dist/resolution-YITUVUTH.js +0 -100
@@ -9,16 +9,30 @@ const realpath = fsReadModule0.realpath;
9
9
  const stat = fsReadModule0.stat;
10
10
  const writeFile = fsReadModule0.writeFile;
11
11
  import path from "path";
12
+ var fatalUtf8Decoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
12
13
  async function sha256File(filePath) {
13
14
  const buf = await fileReader(filePath);
14
15
  const sha256 = createHash("sha256").update(buf).digest("hex");
15
16
  return { sha256, bytes: buf.byteLength };
16
17
  }
17
- function sha256String(content) {
18
- const buf = Buffer.from(content, "utf-8");
18
+ function sha256Bytes(content) {
19
+ const buf = Buffer.from(content);
19
20
  const sha256 = createHash("sha256").update(buf).digest("hex");
20
21
  return { sha256, bytes: buf.byteLength };
21
22
  }
23
+ function sha256String(content) {
24
+ return sha256Bytes(Buffer.from(content, "utf-8"));
25
+ }
26
+ async function readUtf8FileStrict(filePath) {
27
+ const buf = await fileReader(filePath);
28
+ let content;
29
+ try {
30
+ content = fatalUtf8Decoder.decode(buf);
31
+ } catch {
32
+ throw new Error(`transfer export requires UTF-8 text files: ${filePath}`);
33
+ }
34
+ return { content, ...sha256Bytes(buf) };
35
+ }
22
36
  async function writeJsonFile(filePath, value) {
23
37
  await mkdir(path.dirname(filePath), { recursive: true });
24
38
  await writeFile(filePath, JSON.stringify(value, null, 2) + "\n", "utf-8");
@@ -61,6 +75,69 @@ function toPosixRelPath(absPath, rootDir) {
61
75
  function fromPosixRelPath(relPath) {
62
76
  return relPath.split("/").join(path.sep);
63
77
  }
78
+ async function prepareSafeArchiveRoot(absPath, errorPrefix, argName) {
79
+ const rootAbs = path.resolve(absPath);
80
+ await assertIsDirectoryNotSymlink(rootAbs, errorPrefix, argName);
81
+ return {
82
+ abs: rootAbs,
83
+ real: await realpath(rootAbs),
84
+ errorPrefix,
85
+ argName
86
+ };
87
+ }
88
+ function validateArchiveRelativePath(relPath, errorPrefix) {
89
+ if (relPath.length === 0) {
90
+ throw new Error(`${errorPrefix}: record path must not be empty`);
91
+ }
92
+ if (relPath.includes("\\")) {
93
+ throw new Error(
94
+ `${errorPrefix}: record path must use POSIX separators: ${relPath}`
95
+ );
96
+ }
97
+ if (path.posix.isAbsolute(relPath)) {
98
+ throw new Error(
99
+ `${errorPrefix}: record path must be relative: ${relPath}`
100
+ );
101
+ }
102
+ const segments = relPath.split("/");
103
+ if (segments.some((segment) => segment === "" || segment === "." || segment === "..")) {
104
+ throw new Error(
105
+ `${errorPrefix}: record path contains unsafe segments: ${relPath}`
106
+ );
107
+ }
108
+ const normalized = path.posix.normalize(relPath);
109
+ if (normalized === "." || normalized === ".." || normalized.startsWith("../") || path.posix.isAbsolute(normalized)) {
110
+ throw new Error(
111
+ `${errorPrefix}: record path escapes target root: ${relPath}`
112
+ );
113
+ }
114
+ return normalized;
115
+ }
116
+ async function resolveSafeArchiveTarget(root, relPath) {
117
+ const safeRelPath = validateArchiveRelativePath(relPath, root.errorPrefix);
118
+ const targetAbs = path.resolve(root.abs, fromPosixRelPath(safeRelPath));
119
+ if (!isPathInsideRoot(root.abs, targetAbs)) {
120
+ throw new Error(
121
+ `${root.errorPrefix}: record path escapes target root: ${relPath}`
122
+ );
123
+ }
124
+ const targetStat = await lstat(targetAbs).catch((error) => {
125
+ if (error.code === "ENOENT") return null;
126
+ throw error;
127
+ });
128
+ if (targetStat?.isSymbolicLink()) {
129
+ throw new Error(
130
+ `${root.errorPrefix}: record path targets a symlink: ${relPath}`
131
+ );
132
+ }
133
+ await assertRealpathInsideRoot(
134
+ root.real,
135
+ targetAbs,
136
+ relPath,
137
+ root.errorPrefix
138
+ );
139
+ return targetAbs;
140
+ }
64
141
  function isPathInsideRoot(rootReal, absPath) {
65
142
  const rel = path.relative(rootReal, absPath);
66
143
  if (rel === "") return true;
@@ -103,7 +180,9 @@ async function assertRealpathInsideRoot(rootReal, targetAbs, sourcePath, errorPr
103
180
 
104
181
  export {
105
182
  sha256File,
183
+ sha256Bytes,
106
184
  sha256String,
185
+ readUtf8FileStrict,
107
186
  writeJsonFile,
108
187
  readJsonFile,
109
188
  listFilesRecursive,
@@ -111,6 +190,9 @@ export {
111
190
  fileExists,
112
191
  toPosixRelPath,
113
192
  fromPosixRelPath,
193
+ prepareSafeArchiveRoot,
194
+ validateArchiveRelativePath,
195
+ resolveSafeArchiveTarget,
114
196
  isPathInsideRoot,
115
197
  assertIsDirectoryNotSymlink,
116
198
  assertRealpathInsideRoot
@@ -2,7 +2,7 @@ import {
2
2
  getKey,
3
3
  readHeader,
4
4
  secureStoreDir
5
- } from "./chunk-CXM7EBAO.js";
5
+ } from "./chunk-MXFJXUHC.js";
6
6
  import {
7
7
  open,
8
8
  seal
@@ -122,7 +122,7 @@ async function loadKdfSection(memoryDir) {
122
122
  try {
123
123
  const header = await readHeader(memoryDir);
124
124
  if (header !== null) {
125
- const { decodeMetadataSalt } = await import("./metadata-JAGIWHEA.js");
125
+ const { decodeMetadataSalt } = await import("./metadata-WK2TRPYZ.js");
126
126
  const salt2 = decodeMetadataSalt(header.metadata);
127
127
  const kdf = header.metadata.kdf;
128
128
  const json2 = JSON.stringify({
@@ -134,9 +134,9 @@ async function loadKdfSection(memoryDir) {
134
134
  }
135
135
  } catch {
136
136
  }
137
- const { generateSalt } = await import("./cipher-VHAFCG7Z.js");
137
+ const { generateSalt } = await import("./cipher-E23BHBSO.js");
138
138
  const salt = generateSalt();
139
- const { DEFAULT_ARGON2ID_PARAMS } = await import("./kdf-H5B23ZM2.js");
139
+ const { DEFAULT_ARGON2ID_PARAMS } = await import("./kdf-RXKIWHRU.js");
140
140
  const json = JSON.stringify({
141
141
  algorithm: "argon2id",
142
142
  params: DEFAULT_ARGON2ID_PARAMS,
@@ -11,7 +11,7 @@ import {
11
11
  parseEnvelope,
12
12
  seal
13
13
  } from "./chunk-YGGGUTG3.js";
14
- import "./chunk-MLKGABMK.js";
14
+ import "./chunk-I2KLQ2HA.js";
15
15
  export {
16
16
  AES_KEY_LENGTH,
17
17
  AUTH_TAG_LENGTH,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getVersion
3
- } from "./chunk-6OJAU466.js";
4
- import "./chunk-MLKGABMK.js";
3
+ } from "./chunk-QMUQV5NP.js";
4
+ import "./chunk-I2KLQ2HA.js";
5
5
 
6
6
  // ../remnic-core/src/consolidation-undo.ts
7
7
  import path from "path";
@@ -0,0 +1,29 @@
1
+ import {
2
+ computeMemoryContentHash,
3
+ computePairId,
4
+ deferPair,
5
+ isCoolingDown,
6
+ isDefaultReviewNamespace,
7
+ listPairs,
8
+ memoryHashesChanged,
9
+ migrateUnscopedPairsToNamespace,
10
+ readPair,
11
+ resolvePair,
12
+ writePair,
13
+ writePairs
14
+ } from "./chunk-YJYZMLD5.js";
15
+ import "./chunk-I2KLQ2HA.js";
16
+ export {
17
+ computeMemoryContentHash,
18
+ computePairId,
19
+ deferPair,
20
+ isCoolingDown,
21
+ isDefaultReviewNamespace,
22
+ listPairs,
23
+ memoryHashesChanged,
24
+ migrateUnscopedPairsToNamespace,
25
+ readPair,
26
+ resolvePair,
27
+ writePair,
28
+ writePairs
29
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ ACTIVE_STATUSES,
3
+ runContradictionScan
4
+ } from "./chunk-JC3FCKYL.js";
5
+ import "./chunk-YJYZMLD5.js";
6
+ import "./chunk-3A5ELHTT.js";
7
+ import "./chunk-UFU5GGGA.js";
8
+ import "./chunk-I2KLQ2HA.js";
9
+ export {
10
+ ACTIVE_STATUSES,
11
+ runContradictionScan
12
+ };
@@ -1,4 +1,4 @@
1
- import "./chunk-MLKGABMK.js";
1
+ import "./chunk-I2KLQ2HA.js";
2
2
 
3
3
  // ../remnic-core/src/maintenance/dreams-ledger.ts
4
4
  import path from "path";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  CompoundingEngine,
3
3
  defaultTierMigrationCycleBudget
4
- } from "./chunk-7NMHI4IC.js";
5
- import "./chunk-EXDYWXMB.js";
6
- import "./chunk-ZXLYEVOP.js";
7
- import "./chunk-6OJAU466.js";
4
+ } from "./chunk-BLC3RQNV.js";
5
+ import "./chunk-4XDQ3KEC.js";
6
+ import "./chunk-G3CZA4SD.js";
7
+ import "./chunk-QMUQV5NP.js";
8
8
  import "./chunk-RKR6PTPA.js";
9
9
  import "./chunk-UFU5GGGA.js";
10
10
  import "./chunk-YGGGUTG3.js";
11
- import "./chunk-TDRJVMUP.js";
12
- import "./chunk-MLKGABMK.js";
11
+ import "./chunk-EH4AXGRO.js";
12
+ import "./chunk-I2KLQ2HA.js";
13
13
  export {
14
14
  CompoundingEngine,
15
15
  defaultTierMigrationCycleBudget
@@ -5,7 +5,7 @@ import {
5
5
  recordJudgeVerdict
6
6
  } from "./chunk-5ZW5XJQ6.js";
7
7
  import "./chunk-UFU5GGGA.js";
8
- import "./chunk-MLKGABMK.js";
8
+ import "./chunk-I2KLQ2HA.js";
9
9
  export {
10
10
  EXTRACTION_JUDGE_VERDICT_CATEGORY,
11
11
  judgeTelemetryPath,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  FallbackLlmClient
3
- } from "./chunk-7NUFIRM3.js";
3
+ } from "./chunk-SWOYEQN2.js";
4
4
  import "./chunk-3A5ELHTT.js";
5
5
  import "./chunk-UFU5GGGA.js";
6
- import "./chunk-TDRJVMUP.js";
7
- import "./chunk-MLKGABMK.js";
6
+ import "./chunk-EH4AXGRO.js";
7
+ import "./chunk-I2KLQ2HA.js";
8
8
  export {
9
9
  FallbackLlmClient
10
10
  };
@@ -5,11 +5,11 @@ import {
5
5
  applyUtilityPromotionRuntimePolicy,
6
6
  decideTierTransition,
7
7
  loadUtilityRuntimeValues
8
- } from "./chunk-7OQEPGQF.js";
9
- import "./chunk-4G2XCSD2.js";
8
+ } from "./chunk-LZCGPRHS.js";
9
+ import "./chunk-BZ4EYURA.js";
10
10
  import "./chunk-3G7FAF6S.js";
11
- import "./chunk-5LE4HTVL.js";
12
- import "./chunk-MLKGABMK.js";
11
+ import "./chunk-25J4PXDH.js";
12
+ import "./chunk-I2KLQ2HA.js";
13
13
 
14
14
  // ../remnic-core/src/maintenance/first-start-migration.ts
15
15
  import path from "path";
@@ -1,4 +1,4 @@
1
- import "./chunk-MLKGABMK.js";
1
+ import "./chunk-I2KLQ2HA.js";
2
2
 
3
3
  // ../remnic-core/src/maintenance/forget.ts
4
4
  var ForgetMemoryNotFoundError = class extends Error {
@@ -6,13 +6,18 @@ import {
6
6
  fromPosixRelPath,
7
7
  isPathInsideRoot,
8
8
  listFilesRecursive,
9
+ prepareSafeArchiveRoot,
9
10
  readJsonFile,
11
+ readUtf8FileStrict,
12
+ resolveSafeArchiveTarget,
13
+ sha256Bytes,
10
14
  sha256File,
11
15
  sha256String,
12
16
  toPosixRelPath,
17
+ validateArchiveRelativePath,
13
18
  writeJsonFile
14
- } from "./chunk-NKVIN6RD.js";
15
- import "./chunk-MLKGABMK.js";
19
+ } from "./chunk-YKV4EFUI.js";
20
+ import "./chunk-I2KLQ2HA.js";
16
21
  export {
17
22
  assertIsDirectoryNotSymlink,
18
23
  assertRealpathInsideRoot,
@@ -21,9 +26,14 @@ export {
21
26
  fromPosixRelPath,
22
27
  isPathInsideRoot,
23
28
  listFilesRecursive,
29
+ prepareSafeArchiveRoot,
24
30
  readJsonFile,
31
+ readUtf8FileStrict,
32
+ resolveSafeArchiveTarget,
33
+ sha256Bytes,
25
34
  sha256File,
26
35
  sha256String,
27
36
  toPosixRelPath,
37
+ validateArchiveRelativePath,
28
38
  writeJsonFile
29
39
  };
@@ -1,6 +1,3 @@
1
- import {
2
- isSafeRouteNamespace
3
- } from "./chunk-FQRSVYY4.js";
4
1
  import {
5
2
  DEFAULT_DECAY_FLOOR,
6
3
  DEFAULT_DECAY_PER_WINDOW,
@@ -11,8 +8,11 @@ import {
11
8
  readEdgeConfidence,
12
9
  readEdgesStrict,
13
10
  withGraphWriteLock
14
- } from "./chunk-3GUF7RQI.js";
15
- import "./chunk-MLKGABMK.js";
11
+ } from "./chunk-IO5WWY6A.js";
12
+ import {
13
+ isSafeRouteNamespace
14
+ } from "./chunk-TH5FF5SC.js";
15
+ import "./chunk-I2KLQ2HA.js";
16
16
 
17
17
  // ../remnic-core/src/maintenance/graph-edge-decay.ts
18
18
  import * as fsReadModule0 from "fs/promises";