@digitalforgestudios/openclaw-sulcus 6.6.4 → 6.6.5
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.js +6 -6
- package/index.ts +11 -11
- package/openclaw.plugin.json +29 -10
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -2740,7 +2740,7 @@ You have Sulcus \u2014 persistent, thermodynamic memory. Memories survive across
|
|
|
2740
2740
|
</sulcus_context>`;
|
|
2741
2741
|
}
|
|
2742
2742
|
var STATIC_AWARENESS = buildStaticAwareness("local", "default");
|
|
2743
|
-
var FALLBACK_AWARENESS = `<sulcus_context token_budget="
|
|
2743
|
+
var FALLBACK_AWARENESS = `<sulcus_context token_budget="10000">
|
|
2744
2744
|
You have Sulcus \u2014 persistent memory. Context build failed this turn. Use memory_recall to search manually.
|
|
2745
2745
|
</sulcus_context>`;
|
|
2746
2746
|
var BUILTIN_PII_PATTERNS = [
|
|
@@ -2878,7 +2878,7 @@ var recallQM = {
|
|
|
2878
2878
|
scoreTurns: 0
|
|
2879
2879
|
};
|
|
2880
2880
|
var wasJustCompacted = false;
|
|
2881
|
-
var REBUILD_TOKEN_BUDGET =
|
|
2881
|
+
var REBUILD_TOKEN_BUDGET = 1e4;
|
|
2882
2882
|
var CORE_MEMORY_MAX_CHARS = 4e3;
|
|
2883
2883
|
var coreMemoryCache = void 0;
|
|
2884
2884
|
var activeNamespaceOverride = null;
|
|
@@ -2912,7 +2912,7 @@ var hookHandlers = {
|
|
|
2912
2912
|
hookProfileState.turnCount++;
|
|
2913
2913
|
const hookTurn = hookProfileState.turnCount;
|
|
2914
2914
|
const includeProfile = hookTurn === 1 || hookTurn % profileFreq === 0;
|
|
2915
|
-
const hookScale = applyAdaptiveScaling(hookTurn, limit, ctx.tokenBudget ??
|
|
2915
|
+
const hookScale = applyAdaptiveScaling(hookTurn, limit, ctx.tokenBudget ?? 1e4);
|
|
2916
2916
|
const hookContextWindow = ctx.contextWindowSize ?? 2e5;
|
|
2917
2917
|
const hookThrottled = applyContextWindowThrottle(rawPrompt.length, hookContextWindow, hookScale, logger);
|
|
2918
2918
|
if (hookThrottled.selfMuted) {
|
|
@@ -4627,7 +4627,7 @@ async function expandQueryWithEntities(client, originalQuery, namespace, logger)
|
|
|
4627
4627
|
return { extraMemories, expandedQuery };
|
|
4628
4628
|
}
|
|
4629
4629
|
var THIN_RECALL_THRESHOLD = 3;
|
|
4630
|
-
function buildSdkRecallHandler(sulcusMem, namespace, maxResults, profileFrequency, logger, boostOnRecall = true, tokenBudget =
|
|
4630
|
+
function buildSdkRecallHandler(sulcusMem, namespace, maxResults, profileFrequency, logger, boostOnRecall = true, tokenBudget = 1e4, contextRebuild = true, contextWindowSize = 2e5) {
|
|
4631
4631
|
let turnCount = 0;
|
|
4632
4632
|
let profileCache = null;
|
|
4633
4633
|
let recallCache = null;
|
|
@@ -6516,12 +6516,12 @@ var sulcusPlugin = {
|
|
|
6516
6516
|
const profileFrequency = Math.min(500, Math.max(1, pluginConfig?.profileFrequency ?? 10));
|
|
6517
6517
|
const rawMaxRecallChars = pluginConfig?.maxRecallChars;
|
|
6518
6518
|
const tokenBudgetFromChars = rawMaxRecallChars ? Math.floor(rawMaxRecallChars / 4) : void 0;
|
|
6519
|
-
const tokenBudget = Math.min(
|
|
6519
|
+
const tokenBudget = Math.min(16e3, Math.max(100, tokenBudgetFromChars ?? pluginConfig?.tokenBudget ?? 1e4));
|
|
6520
6520
|
const contextWindowSize = Math.max(8e3, pluginConfig?.contextWindowSize ?? 2e5);
|
|
6521
6521
|
const boostOnRecallEnabled = pluginConfig?.boostOnRecall ?? true;
|
|
6522
6522
|
const captureFromAssistant = pluginConfig?.captureFromAssistant ?? false;
|
|
6523
6523
|
const contextRebuildEnabled = pluginConfig?.contextRebuild?.enabled !== false;
|
|
6524
|
-
const contextRebuildBudget = Math.min(
|
|
6524
|
+
const contextRebuildBudget = Math.min(16e3, Math.max(500, pluginConfig?.contextRebuild?.tokenBudget ?? 1e4));
|
|
6525
6525
|
const hooksConfig = loadHooksConfig(pluginConfig);
|
|
6526
6526
|
let sulcusMem = null;
|
|
6527
6527
|
let backendMode = "unavailable";
|
package/index.ts
CHANGED
|
@@ -195,7 +195,7 @@ You have Sulcus — persistent, thermodynamic memory. Memories survive across se
|
|
|
195
195
|
let STATIC_AWARENESS = buildStaticAwareness("local", "default");
|
|
196
196
|
|
|
197
197
|
// Fallback when recall fails — same minimal awareness, plus a hint to search manually.
|
|
198
|
-
const FALLBACK_AWARENESS = `<sulcus_context token_budget="
|
|
198
|
+
const FALLBACK_AWARENESS = `<sulcus_context token_budget="10000">
|
|
199
199
|
You have Sulcus — persistent memory. Context build failed this turn. Use memory_recall to search manually.
|
|
200
200
|
</sulcus_context>`;
|
|
201
201
|
|
|
@@ -232,7 +232,7 @@ interface HookHandlerCtx {
|
|
|
232
232
|
wasmDir?: string;
|
|
233
233
|
boostOnRecall?: boolean;
|
|
234
234
|
profileFrequency?: number;
|
|
235
|
-
/** Task 66: configurable token budget for recall context injection. Default:
|
|
235
|
+
/** Task 66: configurable token budget for recall context injection. Default: 10000. */
|
|
236
236
|
tokenBudget?: number;
|
|
237
237
|
/** Task 102: model context window size in tokens. Default: 200000. */
|
|
238
238
|
contextWindowSize?: number;
|
|
@@ -551,8 +551,8 @@ const recallQM: RecallQualityMetrics = {
|
|
|
551
551
|
let wasJustCompacted = false;
|
|
552
552
|
|
|
553
553
|
// Token budget for post-compaction context rebuild. Configured via
|
|
554
|
-
// contextRebuild.tokenBudget (default
|
|
555
|
-
let REBUILD_TOKEN_BUDGET =
|
|
554
|
+
// contextRebuild.tokenBudget (default 10000, max 16000).
|
|
555
|
+
let REBUILD_TOKEN_BUDGET = 10000;
|
|
556
556
|
|
|
557
557
|
// --- CORE MEMORY CACHE (Phase 3) -----------------------------------------------
|
|
558
558
|
// Core memory is fetched once on first turn and cached for the session.
|
|
@@ -627,7 +627,7 @@ const hookHandlers: Record<string, HookHandler> = {
|
|
|
627
627
|
const includeProfile = hookTurn === 1 || hookTurn % profileFreq === 0;
|
|
628
628
|
|
|
629
629
|
// -- Task 101: Adaptive scaling — reduce recall footprint as conversation grows
|
|
630
|
-
const hookScale = applyAdaptiveScaling(hookTurn, limit, ctx.tokenBudget ??
|
|
630
|
+
const hookScale = applyAdaptiveScaling(hookTurn, limit, ctx.tokenBudget ?? 10000);
|
|
631
631
|
|
|
632
632
|
// -- Task 102: Context-window-aware throttling (hook path) — same logic as SDK
|
|
633
633
|
const hookContextWindow = ctx.contextWindowSize ?? 200000;
|
|
@@ -2928,7 +2928,7 @@ function buildSdkRecallHandler(
|
|
|
2928
2928
|
logger: PluginLogger,
|
|
2929
2929
|
boostOnRecall: boolean = true,
|
|
2930
2930
|
/** Task 66: configurable token budget for recall context injection. */
|
|
2931
|
-
tokenBudget: number =
|
|
2931
|
+
tokenBudget: number = 10000,
|
|
2932
2932
|
/** Task 70: enable post-compaction context rebuild. Default true. */
|
|
2933
2933
|
contextRebuild: boolean = true,
|
|
2934
2934
|
/** Task 102: model context window size in tokens. Used for utilization-based throttling. */
|
|
@@ -3275,7 +3275,7 @@ function buildSdkRecallHandler(
|
|
|
3275
3275
|
// -- end category-priority ranking -------------------------------------
|
|
3276
3276
|
|
|
3277
3277
|
// Sort all items by heat desc so highest-value memories always fit first.
|
|
3278
|
-
// Task 66: token budget is configurable (default
|
|
3278
|
+
// Task 66: token budget is configurable (default 10000). ~80 for fixed overhead.
|
|
3279
3279
|
// Remaining split ~30% profile / ~70% recall.
|
|
3280
3280
|
// Task 101: Use adaptive token budget instead of raw config value
|
|
3281
3281
|
const TOKEN_BUDGET = effectiveTokenBudget;
|
|
@@ -5145,11 +5145,11 @@ const sulcusPlugin = {
|
|
|
5145
5145
|
const autoCapture: boolean = (pluginConfig?.autoCapture as boolean | undefined) ?? false;
|
|
5146
5146
|
const maxRecallResults: number = Math.min(20, Math.max(1, (pluginConfig?.maxRecallResults as number | undefined) ?? 5));
|
|
5147
5147
|
const profileFrequency: number = Math.min(500, Math.max(1, (pluginConfig?.profileFrequency as number | undefined) ?? 10));
|
|
5148
|
-
// Task 66: configurable token budget. Clamped to [100,
|
|
5148
|
+
// Task 66: configurable token budget. Clamped to [100, 16000]; default 10000.
|
|
5149
5149
|
// Task 101: maxRecallChars is an alias — converted to token budget at ~4 chars/token.
|
|
5150
5150
|
const rawMaxRecallChars = pluginConfig?.maxRecallChars as number | undefined;
|
|
5151
5151
|
const tokenBudgetFromChars = rawMaxRecallChars ? Math.floor(rawMaxRecallChars / 4) : undefined;
|
|
5152
|
-
const tokenBudget: number = Math.min(
|
|
5152
|
+
const tokenBudget: number = Math.min(16000, Math.max(100, tokenBudgetFromChars ?? (pluginConfig?.tokenBudget as number | undefined) ?? 10000));
|
|
5153
5153
|
// Task 102: Context window size for utilization-based throttling.
|
|
5154
5154
|
const contextWindowSize: number = Math.max(8000, (pluginConfig?.contextWindowSize as number | undefined) ?? 200000);
|
|
5155
5155
|
const boostOnRecallEnabled: boolean = (pluginConfig?.boostOnRecall as boolean | undefined) ?? true;
|
|
@@ -5157,9 +5157,9 @@ const sulcusPlugin = {
|
|
|
5157
5157
|
const captureFromAssistant: boolean = (pluginConfig?.captureFromAssistant as boolean | undefined) ?? false;
|
|
5158
5158
|
// Task 70: Context rebuild config. Enabled by default when autoRecall + cloud backend are active.
|
|
5159
5159
|
const contextRebuildEnabled: boolean = (pluginConfig?.contextRebuild as Record<string, unknown> | undefined)?.enabled !== false;
|
|
5160
|
-
const contextRebuildBudget: number = Math.min(
|
|
5160
|
+
const contextRebuildBudget: number = Math.min(16000, Math.max(500, (
|
|
5161
5161
|
(pluginConfig?.contextRebuild as Record<string, unknown> | undefined)?.tokenBudget as number | undefined
|
|
5162
|
-
) ??
|
|
5162
|
+
) ?? 10000));
|
|
5163
5163
|
|
|
5164
5164
|
// -- Load hooks config --
|
|
5165
5165
|
const hooksConfig = loadHooksConfig(pluginConfig);
|
package/openclaw.plugin.json
CHANGED
|
@@ -237,19 +237,31 @@
|
|
|
237
237
|
},
|
|
238
238
|
"sensitiveTools": {
|
|
239
239
|
"type": "array",
|
|
240
|
-
"items": {
|
|
241
|
-
|
|
240
|
+
"items": {
|
|
241
|
+
"type": "string"
|
|
242
|
+
},
|
|
243
|
+
"default": [
|
|
244
|
+
"exec",
|
|
245
|
+
"write",
|
|
246
|
+
"edit",
|
|
247
|
+
"delete",
|
|
248
|
+
"message"
|
|
249
|
+
],
|
|
242
250
|
"description": "Tools that trigger memory-based objective check before execution"
|
|
243
251
|
},
|
|
244
252
|
"allowlist": {
|
|
245
253
|
"type": "array",
|
|
246
|
-
"items": {
|
|
254
|
+
"items": {
|
|
255
|
+
"type": "string"
|
|
256
|
+
},
|
|
247
257
|
"default": [],
|
|
248
258
|
"description": "Tools always allowed (bypass all checks)"
|
|
249
259
|
},
|
|
250
260
|
"blocklist": {
|
|
251
261
|
"type": "array",
|
|
252
|
-
"items": {
|
|
262
|
+
"items": {
|
|
263
|
+
"type": "string"
|
|
264
|
+
},
|
|
253
265
|
"default": [],
|
|
254
266
|
"description": "Tools always blocked (cannot be used regardless of context)"
|
|
255
267
|
},
|
|
@@ -260,13 +272,20 @@
|
|
|
260
272
|
},
|
|
261
273
|
"requireApprovalThreshold": {
|
|
262
274
|
"type": "string",
|
|
263
|
-
"enum": [
|
|
275
|
+
"enum": [
|
|
276
|
+
"info",
|
|
277
|
+
"warning",
|
|
278
|
+
"critical"
|
|
279
|
+
],
|
|
264
280
|
"default": "warning",
|
|
265
281
|
"description": "Minimum severity level that triggers a requireApproval pause instead of proceeding"
|
|
266
282
|
},
|
|
267
283
|
"failMode": {
|
|
268
284
|
"type": "string",
|
|
269
|
-
"enum": [
|
|
285
|
+
"enum": [
|
|
286
|
+
"fail-open",
|
|
287
|
+
"fail-closed"
|
|
288
|
+
],
|
|
270
289
|
"default": "fail-open",
|
|
271
290
|
"description": "Behavior when guardrail throws an error: fail-open allows the tool call, fail-closed blocks it"
|
|
272
291
|
},
|
|
@@ -285,10 +304,10 @@
|
|
|
285
304
|
},
|
|
286
305
|
"tokenBudget": {
|
|
287
306
|
"type": "number",
|
|
288
|
-
"description": "Maximum token budget for memory context injection (100-
|
|
289
|
-
"default":
|
|
307
|
+
"description": "Maximum token budget for memory context injection (100-16000). Default: 10000. Configure via plugin config: plugins.entries.openclaw-sulcus.config.tokenBudget",
|
|
308
|
+
"default": 10000,
|
|
290
309
|
"minimum": 100,
|
|
291
|
-
"maximum":
|
|
310
|
+
"maximum": 16000
|
|
292
311
|
},
|
|
293
312
|
"maxRecallChars": {
|
|
294
313
|
"type": "number",
|
|
@@ -478,4 +497,4 @@
|
|
|
478
497
|
"commandAliases": [
|
|
479
498
|
"sulcus"
|
|
480
499
|
]
|
|
481
|
-
}
|
|
500
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitalforgestudios/openclaw-sulcus",
|
|
3
|
-
"version": "6.6.
|
|
4
|
-
"description": "Sulcus
|
|
3
|
+
"version": "6.6.5",
|
|
4
|
+
"description": "Sulcus — thermodynamic memory + Apache AGE knowledge graph for OpenClaw agents. v6.0: Multi-signal recall (semantic + hot-context + entity-graph + profile), configurable guardrails (outputGuard + toolGuard), token budget enforcement, context rebuild post-compaction, sulcus.toml config layer, SIRU training data logging, session-scoped memory, batch heat-boost. SIU v2 pipeline (SIVU/SICU/SILU/SITU/SIRU). Interaction-based decay. Curator sleep-cycle. Cross-agent sync.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openclaw",
|
|
7
7
|
"openclaw-plugin",
|