@remnic/plugin-openclaw 9.65.8 → 9.66.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -123,6 +123,7 @@ import {
123
123
  TAG_LIMITS
124
124
  } from "@remnic/core/write-envelope";
125
125
  import { stripAttributesSuffix } from "@remnic/core/storage";
126
+ import { isSupportPassportPrivateMemory } from "@remnic/core/support-passport";
126
127
  import { displayErrorDetail } from "@remnic/core/runtime/better-sqlite";
127
128
  import { isSafeRouteNamespace } from "@remnic/core/routing/engine";
128
129
  function buildPromotionOrigin(srcNamespace, memoryId) {
@@ -154,7 +155,7 @@ async function executeMemoryPromote(orchestrator, params) {
154
155
  const dstNs = toNamespace ?? orchestrator.config.sharedNamespace;
155
156
  const src = await orchestrator.getStorage(srcNs);
156
157
  const mem = await src.getMemoryById(memoryId);
157
- if (!mem) {
158
+ if (!mem || isSupportPassportPrivateMemory(mem)) {
158
159
  return `Memory not found in ${srcNs}: ${memoryId}`;
159
160
  }
160
161
  const dst = await orchestrator.getStorage(dstNs);
@@ -226,7 +227,7 @@ import {
226
227
  import { runMemoryGovernance } from "@remnic/core/maintenance/memory-governance";
227
228
 
228
229
  // ../../src/memory-action-target.ts
229
- import { isSupportPassportPrivateMemory } from "@remnic/core";
230
+ import { isSupportPassportPrivateMemory as isSupportPassportPrivateMemory2 } from "@remnic/core";
230
231
  function clampUnitInterval(value, fallback) {
231
232
  if (typeof value !== "number" || !Number.isFinite(value)) return fallback;
232
233
  if (value < 0) return 0;
@@ -263,7 +264,7 @@ async function readReferencedMemoryForPolicyEligibility(storage, memoryId) {
263
264
  return (await storage.readArchivedMemories?.())?.find((memory) => memory.frontmatter.id === memoryId);
264
265
  }
265
266
  function blocksSupportPassportMutation(action, memory) {
266
- return (action === "update_note" || action === "discard" || action === "link_graph") && Boolean(memory && isSupportPassportPrivateMemory(memory));
267
+ return (action === "update_note" || action === "discard" || action === "link_graph") && Boolean(memory && isSupportPassportPrivateMemory2(memory));
267
268
  }
268
269
 
269
270
  // ../../src/tools.ts
@@ -6992,8 +6993,8 @@ async function closeQuietly(handle) {
6992
6993
  // src/memory-flush-plan.ts
6993
6994
  var DEFAULT_MAX_TURN_CHARS = 8e3;
6994
6995
  var MIN_MAX_TURN_CHARS = 1e3;
6995
- var FLUSH_PROMPT = "Flush the recent OpenClaw transcript into Remnic memory by appending to the allowed flush-plan file only. Preserve durable user preferences, project facts, decisions, corrections, and commitments. Ignore runtime metadata, credentials, and transient command noise.";
6996
- var FLUSH_SYSTEM_PROMPT = "You are Remnic's memory flush planner. Read the transcript and append concise durable memory notes to the file the write tool allows. Do not create files, directories, or dated paths; use only the allowed flush-plan file. Ignore runtime metadata, credentials, transient command noise, and content that is not worth remembering.";
6996
+ var FLUSH_PROMPT = "Flush the recent OpenClaw transcript into Remnic memory by appending durable notes to the flush-plan file. Preserve durable user preferences, project facts, decisions, corrections, and commitments. Ignore runtime metadata, credentials, and transient command noise.";
6997
+ var FLUSH_SYSTEM_PROMPT = "You are Remnic's memory flush planner. Read the transcript and append concise durable memory notes to the flush-plan file. Do not create dated memory paths or write credentials. Ignore runtime metadata, transient command noise, and content that is not worth remembering.";
6997
6998
  function buildMemoryFlushPlan(options) {
6998
6999
  const maxTurnChars = typeof options.extractionMaxTurnChars === "number" && Number.isFinite(options.extractionMaxTurnChars) ? Math.max(MIN_MAX_TURN_CHARS, Math.floor(options.extractionMaxTurnChars)) : DEFAULT_MAX_TURN_CHARS;
6999
7000
  const flushModel = typeof options.flushModel === "string" && options.flushModel.length > 0 ? options.flushModel : void 0;
@@ -7004,7 +7005,8 @@ function buildMemoryFlushPlan(options) {
7004
7005
  ...flushModel ? { model: flushModel } : {},
7005
7006
  prompt: FLUSH_PROMPT,
7006
7007
  systemPrompt: FLUSH_SYSTEM_PROMPT,
7007
- relativePath: ["state", "plugins", options.serviceId, "flush-plan.md"].join("/")
7008
+ relativePath: ["state", "plugins", options.serviceId, "flush-plan.md"].join("/"),
7009
+ writeRestrictPrefix: ["state", "plugins", options.serviceId, ""].join("/")
7008
7010
  };
7009
7011
  }
7010
7012
 
@@ -7067,7 +7069,6 @@ async function getJson(target, serviceId, pathname, timeoutMs) {
7067
7069
 
7068
7070
  // src/delegate-flush-plan-ingest.ts
7069
7071
  var MAX_OBSERVE_CHUNK_BYTES = 96 * 1024;
7070
- var MIN_OBSERVE_CHUNK_BYTES = 4 * 1024;
7071
7072
  var LOCK_MAX_WAIT_MS = 5e3;
7072
7073
  var LOCK_STALE_MS = 6e4;
7073
7074
  var MAX_RECLAIM_PASSES = 4;
@@ -8939,7 +8940,7 @@ function buildTurnFingerprint(input) {
8939
8940
  import { planRecallMode } from "@remnic/core/intent";
8940
8941
  import {
8941
8942
  expandTildePath as expandTildePath4,
8942
- isSupportPassportPrivateMemory as isSupportPassportPrivateMemory2,
8943
+ isSupportPassportPrivateMemory as isSupportPassportPrivateMemory3,
8943
8944
  renderMemoryContextPrompt as renderSharedMemoryContextPrompt,
8944
8945
  resolveAgentAccessAuthToken,
8945
8946
  resolvePrincipal,
@@ -11222,16 +11223,14 @@ Keep the reflection grounded in the evidence below.
11222
11223
  namespaces: namespace ? [namespace] : void 0,
11223
11224
  mode: resolvedMode
11224
11225
  }),
11225
- filterPrivate: async (results) => {
11226
- const visible = await orchestrator.filterPrivateSearchResults(
11227
- results,
11228
- namespace ? [namespace] : []
11229
- );
11230
- return minScore === void 0 ? visible : visible.filter((result) => result.score >= minScore);
11231
- },
11226
+ filterPrivate: (results) => orchestrator.filterPrivateSearchResults(
11227
+ results,
11228
+ namespace ? [namespace] : []
11229
+ ),
11232
11230
  isExcluded: (resultPath) => isMemoryArtifactPath(resultPath)
11233
11231
  });
11234
- return visibleResults.map((result, index) => {
11232
+ const scoredResults = minScore === void 0 ? visibleResults : visibleResults.filter((result) => result.score >= minScore);
11233
+ return scoredResults.map((result, index) => {
11235
11234
  const candidate = result;
11236
11235
  const rawPath = typeof candidate.path === "string" ? candidate.path : typeof candidate.id === "string" ? candidate.id : `memory-${index + 1}`;
11237
11236
  const absolutePath = readScope.absolutize(rawPath);
@@ -12202,7 +12201,7 @@ Keep the reflection grounded in the evidence below.
12202
12201
  const resolved = await readMemoryByLookup(lookup, agentSessionKey);
12203
12202
  if (!resolved) return null;
12204
12203
  const { memory, displayPath } = resolved;
12205
- if (isMemoryArtifactPath(displayPath) || isMemoryArtifactPath(memory.path) || isSupportPassportPrivateMemory2(memory)) {
12204
+ if (isMemoryArtifactPath(displayPath) || isMemoryArtifactPath(memory.path) || isSupportPassportPrivateMemory3(memory)) {
12206
12205
  return null;
12207
12206
  }
12208
12207
  const allLines = memory.content.split(/\r?\n/);