@lmzhen/dsh-evolution-threat 0.3.19 → 0.3.21
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/lib/index.js +2 -2
- package/lib/types/index.d.ts +1 -1
- package/package.json +5 -7
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import z from "@deepseek-ai/schemastery";
|
|
2
|
-
import { scanContentThreats, scanMemoryThreats } from "@lmzhen/dsh-evolution-core";
|
|
2
|
+
import { EVOLUTION_WRITE_TOOLS, scanContentThreats, scanMemoryThreats } from "@lmzhen/dsh-evolution-core";
|
|
3
3
|
//#region lib/types/index.js
|
|
4
4
|
/**
|
|
5
5
|
* Write-time threat guard for evolution tools.
|
|
@@ -17,7 +17,7 @@ function asRecord(value) {
|
|
|
17
17
|
/** Scan one tool invocation for threat-shaped payload text. Exported so the
|
|
18
18
|
* guard contract is testable directly (0.3.17). */
|
|
19
19
|
function scanToolArgs(toolName, args, maxScanChars) {
|
|
20
|
-
if (toolName
|
|
20
|
+
if (!EVOLUTION_WRITE_TOOLS.includes(toolName)) return null;
|
|
21
21
|
const record = asRecord(args);
|
|
22
22
|
if (toolName === "memory") {
|
|
23
23
|
for (const text of [record.facts, record.content]) if (typeof text === "string") {
|
package/lib/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-threat",
|
|
3
3
|
"description": "Write-time threat guard for evolution tools (community build)",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.21",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -25,15 +25,13 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
|
-
"lib
|
|
29
|
-
"lib/
|
|
30
|
-
"lib/types/**/*.d.ts",
|
|
31
|
-
"lib/types/invariant.d.ts"
|
|
28
|
+
"lib/*.js",
|
|
29
|
+
"lib/types/**/*.d.ts"
|
|
32
30
|
],
|
|
33
31
|
"license": "MIT",
|
|
34
32
|
"dependencies": {
|
|
35
33
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
36
|
-
"@lmzhen/dsh-evolution-core": "^0.3.
|
|
34
|
+
"@lmzhen/dsh-evolution-core": "^0.3.21"
|
|
37
35
|
},
|
|
38
36
|
"peerDependencies": {
|
|
39
37
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
@@ -44,6 +42,6 @@
|
|
|
44
42
|
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.1-rc.2",
|
|
45
43
|
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
|
|
46
44
|
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
|
|
47
|
-
"@lmzhen/dsh-evolution-core": "^0.3.
|
|
45
|
+
"@lmzhen/dsh-evolution-core": "^0.3.21"
|
|
48
46
|
}
|
|
49
47
|
}
|