@digitalforgestudios/openclaw-sulcus 1.0.1 → 1.1.0
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/index.ts +9 -3
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -97,6 +97,10 @@ class SulcusClient {
|
|
|
97
97
|
body: JSON.stringify(body),
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
+
if (res.status === 409) {
|
|
101
|
+
// Duplicate memory — silently skip, not an error
|
|
102
|
+
return { id: "", label, memory_type: memoryType, namespace: namespace ?? this.config.namespace ?? "default" } as SulcusNode;
|
|
103
|
+
}
|
|
100
104
|
if (!res.ok) {
|
|
101
105
|
const errText = await res.text().catch(() => "");
|
|
102
106
|
throw new Error(`Sulcus store failed: ${res.status} ${errText}`);
|
|
@@ -296,7 +300,8 @@ const sulcusMemoryPlugin = {
|
|
|
296
300
|
const label = node.pointer_summary ?? node.label ?? "";
|
|
297
301
|
const heat = node.current_heat ?? node.heat ?? 0;
|
|
298
302
|
const type = node.memory_type ?? "unknown";
|
|
299
|
-
|
|
303
|
+
const id = node.id ?? "";
|
|
304
|
+
return `${i + 1}. [${type}] (heat: ${heat.toFixed(2)}) [id: ${id}] ${label.slice(0, 500)}`;
|
|
300
305
|
});
|
|
301
306
|
|
|
302
307
|
return {
|
|
@@ -528,7 +533,7 @@ const sulcusMemoryPlugin = {
|
|
|
528
533
|
// ========================================================================
|
|
529
534
|
|
|
530
535
|
if (config.autoRecall) {
|
|
531
|
-
api.on("
|
|
536
|
+
api.on("before_model_resolve", async (event) => {
|
|
532
537
|
if (!event.prompt || event.prompt.length < 5) return;
|
|
533
538
|
|
|
534
539
|
try {
|
|
@@ -538,7 +543,8 @@ const sulcusMemoryPlugin = {
|
|
|
538
543
|
const memoryLines = results.map((node, i) => {
|
|
539
544
|
const label = node.pointer_summary ?? node.label ?? "";
|
|
540
545
|
const heat = node.current_heat ?? node.heat ?? 0;
|
|
541
|
-
|
|
546
|
+
const id = node.id ?? "";
|
|
547
|
+
return `${i + 1}. [${node.memory_type}] (heat: ${heat.toFixed(2)}) [id: ${id}] ${escapeForPrompt(label.slice(0, 400))}`;
|
|
542
548
|
});
|
|
543
549
|
|
|
544
550
|
api.logger.info?.(`openclaw-sulcus: injecting ${results.length} memories into context`);
|
package/package.json
CHANGED