@digitalforgestudios/openclaw-sulcus 3.5.0 → 3.5.2
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 +37 -23
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -741,34 +741,34 @@ const sulcusPlugin = {
|
|
|
741
741
|
|
|
742
742
|
register(api: any) {
|
|
743
743
|
// ── Configuration ──
|
|
744
|
-
const libDir = api.
|
|
745
|
-
? resolve(api.
|
|
744
|
+
const libDir = api.pluginConfig?.libDir
|
|
745
|
+
? resolve(api.pluginConfig.libDir)
|
|
746
746
|
: resolve(process.env.HOME || "~", ".sulcus/lib");
|
|
747
747
|
|
|
748
|
-
const storeLibPath = api.
|
|
749
|
-
? resolve(api.
|
|
748
|
+
const storeLibPath = api.pluginConfig?.storeLibPath
|
|
749
|
+
? resolve(api.pluginConfig.storeLibPath)
|
|
750
750
|
: resolve(libDir, process.platform === "darwin" ? "libsulcus_store.dylib" : "libsulcus_store.so");
|
|
751
751
|
|
|
752
|
-
const vectorsLibPath = api.
|
|
753
|
-
? resolve(api.
|
|
752
|
+
const vectorsLibPath = api.pluginConfig?.vectorsLibPath
|
|
753
|
+
? resolve(api.pluginConfig.vectorsLibPath)
|
|
754
754
|
: resolve(libDir, process.platform === "darwin" ? "libsulcus_vectors.dylib" : "libsulcus_vectors.so");
|
|
755
755
|
|
|
756
|
-
const wasmDir = api.
|
|
757
|
-
? resolve(api.
|
|
756
|
+
const wasmDir = api.pluginConfig?.wasmDir
|
|
757
|
+
? resolve(api.pluginConfig.wasmDir)
|
|
758
758
|
: resolve(__dirname, "wasm");
|
|
759
759
|
|
|
760
760
|
// Cloud fallback credentials (used when local libs unavailable)
|
|
761
|
-
const serverUrl: string | undefined = api.
|
|
762
|
-
const apiKey: string | undefined = api.
|
|
761
|
+
const serverUrl: string | undefined = api.pluginConfig?.serverUrl;
|
|
762
|
+
const apiKey: string | undefined = api.pluginConfig?.apiKey;
|
|
763
763
|
|
|
764
764
|
// Default namespace = agent name (prevents everything landing in "default")
|
|
765
|
-
const agentId = api.
|
|
766
|
-
const namespace = api.
|
|
765
|
+
const agentId = api.pluginConfig?.agentId;
|
|
766
|
+
const namespace = api.pluginConfig?.namespace === "default" && agentId
|
|
767
767
|
? agentId
|
|
768
|
-
: (api.
|
|
768
|
+
: (api.pluginConfig?.namespace || agentId || "default");
|
|
769
769
|
|
|
770
770
|
// ── Load hooks config (config-driven dispatch) ──
|
|
771
|
-
const hooksConfig = loadHooksConfig(api.
|
|
771
|
+
const hooksConfig = loadHooksConfig(api.pluginConfig);
|
|
772
772
|
|
|
773
773
|
// ── Load native dylibs ──
|
|
774
774
|
const nativeLoader = new NativeLibLoader(storeLibPath, vectorsLibPath);
|
|
@@ -805,14 +805,18 @@ const sulcusPlugin = {
|
|
|
805
805
|
// ── Cloud HTTP fallback ──
|
|
806
806
|
// Activates only when local WASM/native libs are unavailable AND
|
|
807
807
|
// serverUrl + apiKey are configured. Zero external dependencies.
|
|
808
|
-
if (sulcusMem === null
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
808
|
+
if (sulcusMem === null) {
|
|
809
|
+
if (serverUrl && apiKey) {
|
|
810
|
+
try {
|
|
811
|
+
const cloudClient = new SulcusCloudClient(serverUrl, apiKey);
|
|
812
|
+
sulcusMem = cloudClient;
|
|
813
|
+
backendMode = "cloud";
|
|
814
|
+
api.logger.info(`sulcus: using cloud backend (server: ${serverUrl})`);
|
|
815
|
+
} catch (e: any) {
|
|
816
|
+
api.logger.warn(`sulcus: cloud client init failed: ${e.message}`);
|
|
817
|
+
}
|
|
818
|
+
} else {
|
|
819
|
+
api.logger.info(`sulcus: no cloud fallback — serverUrl: ${serverUrl ? "set" : "missing"}, apiKey: ${apiKey ? "set" : "missing"}`);
|
|
816
820
|
}
|
|
817
821
|
}
|
|
818
822
|
|
|
@@ -821,7 +825,17 @@ const sulcusPlugin = {
|
|
|
821
825
|
// Update static awareness with runtime info
|
|
822
826
|
STATIC_AWARENESS = buildStaticAwareness(backendMode, namespace);
|
|
823
827
|
|
|
824
|
-
|
|
828
|
+
// ── Startup summary ──
|
|
829
|
+
if (isAvailable) {
|
|
830
|
+
api.logger.info(`sulcus: ✓ registered (backend: ${backendMode}, namespace: ${namespace})`);
|
|
831
|
+
} else {
|
|
832
|
+
const hints: string[] = [];
|
|
833
|
+
if (!serverUrl && !apiKey) hints.push("no serverUrl/apiKey for cloud mode");
|
|
834
|
+
if (serverUrl && !apiKey) hints.push("serverUrl set but apiKey missing");
|
|
835
|
+
if (!serverUrl && apiKey) hints.push("apiKey set but serverUrl missing");
|
|
836
|
+
if (nativeLoader.error) hints.push(`local: ${nativeLoader.error}`);
|
|
837
|
+
api.logger.warn(`sulcus: ✗ unavailable — ${hints.join("; ") || "unknown reason"}. Configure serverUrl+apiKey for cloud, or install native dylibs for local.`);
|
|
838
|
+
}
|
|
825
839
|
|
|
826
840
|
// ── Shared deps for tool executors ──
|
|
827
841
|
const toolDeps: ToolDeps = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitalforgestudios/openclaw-sulcus",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"description": "Sulcus — reactive, thermodynamic memory plugin for OpenClaw. Opt-in persistent memory with heat-based decay, semantic search, and cross-agent sync. Auto-recall and auto-capture disabled by default.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openclaw",
|