@digitalforgestudios/openclaw-sulcus 0.1.1 → 0.1.3

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 (2) hide show
  1. package/index.ts +15 -8
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -82,14 +82,17 @@ class SulcusClient {
82
82
  return res.json();
83
83
  }
84
84
 
85
- async store(label: string, memoryType = "episodic", namespace?: string): Promise<SulcusNode> {
86
- const body: Record<string, string> = {
85
+ async store(label: string, memoryType = "episodic", namespace?: string, isPinned?: boolean): Promise<SulcusNode> {
86
+ const body: Record<string, unknown> = {
87
87
  label,
88
88
  memory_type: memoryType,
89
89
  };
90
90
  if (namespace ?? this.config.namespace) {
91
91
  body.namespace = namespace ?? this.config.namespace!;
92
92
  }
93
+ if (isPinned) {
94
+ body.is_pinned = true;
95
+ }
93
96
 
94
97
  const res = await fetch(`${this.baseUrl}/api/v1/agent/nodes`, {
95
98
  method: "POST",
@@ -204,7 +207,9 @@ const sulcusMemoryPlugin = {
204
207
  serverUrl: (rawCfg as any).serverUrl ?? "https://api.sulcus.ca",
205
208
  apiKey: (rawCfg as any).apiKey ?? "",
206
209
  agentId: (rawCfg as any).agentId,
207
- namespace: (rawCfg as any).namespace ?? (rawCfg as any).agentId,
210
+ namespace: ((rawCfg as any).namespace && (rawCfg as any).namespace !== "default")
211
+ ? (rawCfg as any).namespace
212
+ : ((rawCfg as any).agentId ?? "default"),
208
213
  autoRecall: (rawCfg as any).autoRecall ?? true,
209
214
  autoCapture: (rawCfg as any).autoCapture ?? true,
210
215
  maxRecallResults: (rawCfg as any).maxRecallResults ?? 5,
@@ -377,18 +382,20 @@ const sulcusMemoryPlugin = {
377
382
  }),
378
383
  ),
379
384
  namespace: Type.Optional(Type.String({ description: "Namespace (default: agent namespace)" })),
385
+ isPinned: Type.Optional(Type.Boolean({ description: "Pin memory to freeze heat at current value, preventing ALL decay. Pinned memories never lose heat." })),
380
386
  }),
381
387
  async execute(_toolCallId, params) {
382
- const { text, memoryType, namespace } = params as {
388
+ const { text, memoryType, namespace, isPinned } = params as {
383
389
  text: string;
384
390
  memoryType?: string;
385
391
  namespace?: string;
392
+ isPinned?: boolean;
386
393
  };
387
394
 
388
395
  const type = memoryType ?? detectMemoryType(text);
389
396
 
390
397
  try {
391
- const node = await client.store(text, type, namespace);
398
+ const node = await client.store(text, type, namespace, isPinned);
392
399
  return {
393
400
  content: [
394
401
  {
@@ -477,9 +484,9 @@ const sulcusMemoryPlugin = {
477
484
  "- When the user references something from a previous conversation",
478
485
  ].join("\n");
479
486
 
480
- // Inject preamble into system prompt
481
- api.on("system_prompt", () => {
482
- return { appendSystemPrompt: sulcusPreamble };
487
+ // Inject preamble into system prompt via before_prompt_build hook
488
+ api.on("before_prompt_build", () => {
489
+ return { appendSystemContext: sulcusPreamble };
483
490
  });
484
491
 
485
492
  // ========================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalforgestudios/openclaw-sulcus",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Sulcus thermodynamic memory backend plugin for OpenClaw. Heat-based decay, cross-agent sync, programmable triggers, auto-recall, and auto-capture.",
5
5
  "keywords": [
6
6
  "openclaw",