protect-mcp 0.3.0 → 0.3.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/README.md +11 -1
- package/dist/bundle-TXOTFJIJ.mjs +8 -0
- package/dist/chunk-5JXFV37Y.mjs +53 -0
- package/dist/{chunk-3WCA7O4D.mjs → chunk-GV7N53QE.mjs} +300 -11
- package/dist/chunk-JQDVKZBN.mjs +165 -0
- package/dist/cli.js +1180 -38
- package/dist/cli.mjs +640 -11
- package/dist/index.d.mts +156 -2
- package/dist/index.d.ts +156 -2
- package/dist/index.js +466 -19
- package/dist/index.mjs +17 -50
- package/dist/report-ENQ3KUI2.mjs +8 -0
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
buildDecisionContext,
|
|
4
4
|
checkRateLimit,
|
|
5
5
|
evaluateTier,
|
|
6
|
+
formatSimulation,
|
|
6
7
|
getSignerInfo,
|
|
7
8
|
getToolPolicy,
|
|
8
9
|
initSigning,
|
|
@@ -10,61 +11,22 @@ import {
|
|
|
10
11
|
listCredentialLabels,
|
|
11
12
|
loadPolicy,
|
|
12
13
|
meetsMinTier,
|
|
14
|
+
parseLogFile,
|
|
13
15
|
parseRateLimit,
|
|
14
16
|
queryExternalPDP,
|
|
15
17
|
resolveCredential,
|
|
16
18
|
signDecision,
|
|
19
|
+
simulate,
|
|
17
20
|
validateCredentials
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
const keyMap = /* @__PURE__ */ new Map();
|
|
29
|
-
for (const key of opts.signingKeys) {
|
|
30
|
-
if (!keyMap.has(key.kid)) {
|
|
31
|
-
keyMap.set(key.kid, key);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
let timeRange = opts.timeRange || null;
|
|
35
|
-
if (!timeRange) {
|
|
36
|
-
const timestamps = receipts.map((r) => r.issued_at || r.timestamp).filter(Boolean).sort();
|
|
37
|
-
if (timestamps.length > 0) {
|
|
38
|
-
timeRange = {
|
|
39
|
-
from: timestamps[0],
|
|
40
|
-
to: timestamps[timestamps.length - 1]
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
format: "scopeblind:audit-bundle",
|
|
46
|
-
version: 1,
|
|
47
|
-
exported_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
48
|
-
tenant: opts.tenant,
|
|
49
|
-
time_range: timeRange,
|
|
50
|
-
receipts,
|
|
51
|
-
anchors: opts.anchors || [],
|
|
52
|
-
verification: {
|
|
53
|
-
algorithm: "ed25519",
|
|
54
|
-
signing_keys: Array.from(keyMap.values()),
|
|
55
|
-
instructions: `Verify each receipt by: (1) remove the "signature" field, (2) canonicalize the remaining object with JCS (sorted keys at every level), (3) encode as UTF-8 bytes, (4) verify the Ed25519 signature using the signing key matching the receipt's "kid" field. CLI: npx @veritasacta/verify bundle.json --bundle`
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function collectSignedReceipts(logs) {
|
|
60
|
-
return logs.filter((log) => log.v === 2).map((log) => {
|
|
61
|
-
const logRecord = log;
|
|
62
|
-
if (logRecord.receipt) {
|
|
63
|
-
return logRecord.receipt;
|
|
64
|
-
}
|
|
65
|
-
return logRecord;
|
|
66
|
-
}).filter((r) => typeof r.signature === "string");
|
|
67
|
-
}
|
|
21
|
+
} from "./chunk-GV7N53QE.mjs";
|
|
22
|
+
import {
|
|
23
|
+
collectSignedReceipts,
|
|
24
|
+
createAuditBundle
|
|
25
|
+
} from "./chunk-5JXFV37Y.mjs";
|
|
26
|
+
import {
|
|
27
|
+
formatReportMarkdown,
|
|
28
|
+
generateReport
|
|
29
|
+
} from "./chunk-JQDVKZBN.mjs";
|
|
68
30
|
|
|
69
31
|
// src/manifest.ts
|
|
70
32
|
function isAgentId(s) {
|
|
@@ -227,6 +189,9 @@ export {
|
|
|
227
189
|
collectSignedReceipts,
|
|
228
190
|
createAuditBundle,
|
|
229
191
|
evaluateTier,
|
|
192
|
+
formatReportMarkdown,
|
|
193
|
+
formatSimulation,
|
|
194
|
+
generateReport,
|
|
230
195
|
getSignerInfo,
|
|
231
196
|
getToolPolicy,
|
|
232
197
|
initSigning,
|
|
@@ -238,10 +203,12 @@ export {
|
|
|
238
203
|
listCredentialLabels,
|
|
239
204
|
loadPolicy,
|
|
240
205
|
meetsMinTier,
|
|
206
|
+
parseLogFile,
|
|
241
207
|
parseRateLimit,
|
|
242
208
|
queryExternalPDP,
|
|
243
209
|
resolveCredential,
|
|
244
210
|
signDecision,
|
|
211
|
+
simulate,
|
|
245
212
|
validateCredentials,
|
|
246
213
|
validateEvidenceReceipt,
|
|
247
214
|
validateManifest
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "protect-mcp",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Security gateway for MCP servers. Shadow-mode logs
|
|
3
|
+
"version": "0.3.2",
|
|
4
|
+
"description": "Security gateway for MCP servers. Shadow-mode logs, per-tool policies, optional local Ed25519-signed receipts. Programmatic hooks for trust tiers, credential config, and external policy engines.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"module": "dist/index.mjs",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"url": "https://github.com/tomjwxf/scopeblind-gateway/issues"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@veritasacta/
|
|
52
|
+
"@veritasacta/protocol": "^0.1.0"
|
|
53
53
|
},
|
|
54
54
|
"optionalDependencies": {
|
|
55
55
|
"@noble/curves": "^1.8.0",
|