@remnic/plugin-openclaw 9.69.10 → 9.69.13

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
@@ -212,6 +212,16 @@ async function executeMemoryPromote(orchestrator, params) {
212
212
  return `Promoted ${srcNs}:${memoryId} \u2192 ${dstNs}:${newId}`;
213
213
  }
214
214
 
215
+ // ../../src/tool-write-origin.ts
216
+ var UNATTRIBUTED_TOOL_WRITE_ORIGIN = "unattributed:openclaw-host";
217
+ function openClawToolWriteOrigin(runtimeAgentId, requestedAgentId) {
218
+ const hostAgentId = typeof runtimeAgentId === "string" ? runtimeAgentId.trim() : "";
219
+ if (hostAgentId.length > 0) {
220
+ return { agentId: requestedAgentId, authenticatedIdentity: hostAgentId };
221
+ }
222
+ return { agentId: requestedAgentId, unattributedOrigin: UNATTRIBUTED_TOOL_WRITE_ORIGIN };
223
+ }
224
+
215
225
  // ../../src/tools.ts
216
226
  import { WorkStorage } from "@remnic/core/work/storage";
217
227
  import { exportWorkBoardMarkdown, exportWorkBoardSnapshot, importWorkBoardSnapshot } from "@remnic/core/work/board";
@@ -438,7 +448,7 @@ function formatContinuityLoopSummary(loop) {
438
448
  if (loop.notes) lines.push(`Notes: ${loop.notes}`);
439
449
  return lines.join("\n");
440
450
  }
441
- function registerTools(api, orchestrator) {
451
+ function registerTools(api, orchestrator, hostRuntimeAgentId) {
442
452
  const useDedicatedOpenClawMemoryTools = orchestrator.config.openclawToolsEnabled !== false;
443
453
  const actionTypes = [
444
454
  "store_episode",
@@ -2745,7 +2755,9 @@ Best for:
2745
2755
  label: "Write Shared Agent Output",
2746
2756
  description: "Write an agent work product into the shared-context directory (v4.0). Other agents can read these files to coordinate without explicit message passing.",
2747
2757
  parameters: Type.Object({
2748
- agentId: Type.String({ description: "Agent ID producing this output (e.g., generalist, oracle, flash)." }),
2758
+ // Provenance is server-derived from the host runtime agent; a
2759
+ // mismatching value here is rejected, never used as the origin.
2760
+ agentId: Type.String({ description: "Agent ID producing this output; must match this host's runtime agent id when the host exposes one." }),
2749
2761
  title: Type.String({ description: "Short title for the output." }),
2750
2762
  content: Type.String({ description: "Markdown content to write." })
2751
2763
  }),
@@ -2756,8 +2768,16 @@ Best for:
2756
2768
  "Shared context is disabled. Enable `sharedContextEnabled: true` to use shared-context tools."
2757
2769
  );
2758
2770
  }
2759
- const fp = await orchestrator.sharedContext.writeAgentOutput({ agentId, title, content });
2760
- return toolResult(`Wrote shared agent output: ${fp}`);
2771
+ try {
2772
+ const fp = await orchestrator.sharedContext.writeAgentOutput({
2773
+ title,
2774
+ content,
2775
+ ...openClawToolWriteOrigin(hostRuntimeAgentId, agentId)
2776
+ });
2777
+ return toolResult(`Wrote shared agent output: ${fp}`);
2778
+ } catch (err) {
2779
+ return toolResult(`shared_context_write_output error: ${err instanceof Error ? err.message : String(err)}`);
2780
+ }
2761
2781
  }
2762
2782
  },
2763
2783
  { name: "shared_context_write_output" }
@@ -12253,7 +12273,9 @@ Keep the reflection grounded in the evidence below.
12253
12273
  }
12254
12274
  registerTools(
12255
12275
  api,
12256
- orchestrator
12276
+ orchestrator,
12277
+ // Host-native, model-inaccessible origin for shared-context tool writes.
12278
+ getOpenClawRuntimeAgentId(api)
12257
12279
  );
12258
12280
  if (orchestrator.lcmEngine?.enabled) {
12259
12281
  registerLcmTools(