@openviking/dsh-memory-plugin 0.5.4 → 0.5.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/config.mjs +1 -1
- package/package.json +1 -1
- package/shared/capture-utils.mjs +6 -4
package/config.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { buildPluginConfig } from "./shared/plugin-config.mjs";
|
|
2
2
|
import { loadCredentialFiles } from "./shared/credentials.mjs";
|
|
3
3
|
|
|
4
|
-
export const PLUGIN_VERSION = "0.5.
|
|
4
|
+
export const PLUGIN_VERSION = "0.5.5";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Namespace for the bridged OpenViking MCP tools. DSH publishes every MCP tool
|
package/package.json
CHANGED
package/shared/capture-utils.mjs
CHANGED
|
@@ -642,16 +642,18 @@ export function shouldCaptureText(text, role, cfg = {}, { filters = true } = {})
|
|
|
642
642
|
const sanitized = sanitizeCapturedText(text);
|
|
643
643
|
if (!sanitized) return { shouldCapture: false, reason: "empty", text: "" };
|
|
644
644
|
|
|
645
|
-
|
|
645
|
+
// Rules judge the full sanitized turn; the wire cap applies afterward.
|
|
646
|
+
let filtered = sanitized;
|
|
646
647
|
if (filters) {
|
|
647
648
|
const compiled = compileInputFilters(cfg?.captureFilters);
|
|
648
649
|
if (compiled.rules.length) {
|
|
649
|
-
const verdict = applyInputFilters(
|
|
650
|
+
const verdict = applyInputFilters(filtered, compiled.rules, { role });
|
|
650
651
|
if (verdict.dropped) return { shouldCapture: false, reason: "filtered", text: "" };
|
|
651
|
-
|
|
652
|
-
if (!
|
|
652
|
+
filtered = verdict.text;
|
|
653
|
+
if (!filtered) return { shouldCapture: false, reason: "empty", text: "" };
|
|
653
654
|
}
|
|
654
655
|
}
|
|
656
|
+
const capped = truncateCaptureText(filtered, maxLength);
|
|
655
657
|
const compact = oneLine(capped);
|
|
656
658
|
const isToolSummary = /^\[tool-(?:call|result)\b/i.test(compact);
|
|
657
659
|
|