@pan-sec/notebooklm-mcp 1.4.0 → 1.7.0
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 +61 -7
- package/SECURITY.md +40 -6
- package/dist/auth/mcp-auth.d.ts.map +1 -1
- package/dist/auth/mcp-auth.js +3 -6
- package/dist/auth/mcp-auth.js.map +1 -1
- package/dist/compliance/alert-manager.d.ts +120 -0
- package/dist/compliance/alert-manager.d.ts.map +1 -0
- package/dist/compliance/alert-manager.js +420 -0
- package/dist/compliance/alert-manager.js.map +1 -0
- package/dist/compliance/breach-detection.d.ts +134 -0
- package/dist/compliance/breach-detection.d.ts.map +1 -0
- package/dist/compliance/breach-detection.js +456 -0
- package/dist/compliance/breach-detection.js.map +1 -0
- package/dist/compliance/change-log.d.ts +113 -0
- package/dist/compliance/change-log.d.ts.map +1 -0
- package/dist/compliance/change-log.js +275 -0
- package/dist/compliance/change-log.js.map +1 -0
- package/dist/compliance/compliance-logger.d.ts +136 -0
- package/dist/compliance/compliance-logger.d.ts.map +1 -0
- package/dist/compliance/compliance-logger.js +425 -0
- package/dist/compliance/compliance-logger.js.map +1 -0
- package/dist/compliance/compliance-tools.d.ts +18 -0
- package/dist/compliance/compliance-tools.d.ts.map +1 -0
- package/dist/compliance/compliance-tools.js +673 -0
- package/dist/compliance/compliance-tools.js.map +1 -0
- package/dist/compliance/consent-manager.d.ts +130 -0
- package/dist/compliance/consent-manager.d.ts.map +1 -0
- package/dist/compliance/consent-manager.js +386 -0
- package/dist/compliance/consent-manager.js.map +1 -0
- package/dist/compliance/dashboard.d.ts +243 -0
- package/dist/compliance/dashboard.d.ts.map +1 -0
- package/dist/compliance/dashboard.js +519 -0
- package/dist/compliance/dashboard.js.map +1 -0
- package/dist/compliance/data-classification.d.ts +117 -0
- package/dist/compliance/data-classification.d.ts.map +1 -0
- package/dist/compliance/data-classification.js +469 -0
- package/dist/compliance/data-classification.js.map +1 -0
- package/dist/compliance/data-erasure.d.ts +110 -0
- package/dist/compliance/data-erasure.d.ts.map +1 -0
- package/dist/compliance/data-erasure.js +501 -0
- package/dist/compliance/data-erasure.js.map +1 -0
- package/dist/compliance/data-export.d.ts +85 -0
- package/dist/compliance/data-export.d.ts.map +1 -0
- package/dist/compliance/data-export.js +394 -0
- package/dist/compliance/data-export.js.map +1 -0
- package/dist/compliance/data-inventory.d.ts +136 -0
- package/dist/compliance/data-inventory.d.ts.map +1 -0
- package/dist/compliance/data-inventory.js +335 -0
- package/dist/compliance/data-inventory.js.map +1 -0
- package/dist/compliance/dsar-handler.d.ts +123 -0
- package/dist/compliance/dsar-handler.d.ts.map +1 -0
- package/dist/compliance/dsar-handler.js +371 -0
- package/dist/compliance/dsar-handler.js.map +1 -0
- package/dist/compliance/evidence-collector.d.ts +187 -0
- package/dist/compliance/evidence-collector.d.ts.map +1 -0
- package/dist/compliance/evidence-collector.js +656 -0
- package/dist/compliance/evidence-collector.js.map +1 -0
- package/dist/compliance/health-monitor.d.ts +111 -0
- package/dist/compliance/health-monitor.d.ts.map +1 -0
- package/dist/compliance/health-monitor.js +509 -0
- package/dist/compliance/health-monitor.js.map +1 -0
- package/dist/compliance/incident-manager.d.ts +131 -0
- package/dist/compliance/incident-manager.d.ts.map +1 -0
- package/dist/compliance/incident-manager.js +418 -0
- package/dist/compliance/incident-manager.js.map +1 -0
- package/dist/compliance/index.d.ts +32 -0
- package/dist/compliance/index.d.ts.map +1 -0
- package/dist/compliance/index.js +35 -0
- package/dist/compliance/index.js.map +1 -0
- package/dist/compliance/policy-docs.d.ts +108 -0
- package/dist/compliance/policy-docs.d.ts.map +1 -0
- package/dist/compliance/policy-docs.js +464 -0
- package/dist/compliance/policy-docs.js.map +1 -0
- package/dist/compliance/privacy-notice-text.d.ts +58 -0
- package/dist/compliance/privacy-notice-text.d.ts.map +1 -0
- package/dist/compliance/privacy-notice-text.js +161 -0
- package/dist/compliance/privacy-notice-text.js.map +1 -0
- package/dist/compliance/privacy-notice.d.ts +128 -0
- package/dist/compliance/privacy-notice.d.ts.map +1 -0
- package/dist/compliance/privacy-notice.js +250 -0
- package/dist/compliance/privacy-notice.js.map +1 -0
- package/dist/compliance/report-generator.d.ts +168 -0
- package/dist/compliance/report-generator.d.ts.map +1 -0
- package/dist/compliance/report-generator.js +830 -0
- package/dist/compliance/report-generator.js.map +1 -0
- package/dist/compliance/retention-engine.d.ts +130 -0
- package/dist/compliance/retention-engine.d.ts.map +1 -0
- package/dist/compliance/retention-engine.js +510 -0
- package/dist/compliance/retention-engine.js.map +1 -0
- package/dist/compliance/siem-exporter.d.ts +150 -0
- package/dist/compliance/siem-exporter.d.ts.map +1 -0
- package/dist/compliance/siem-exporter.js +509 -0
- package/dist/compliance/siem-exporter.js.map +1 -0
- package/dist/compliance/types.d.ts +601 -0
- package/dist/compliance/types.d.ts.map +1 -0
- package/dist/compliance/types.js +22 -0
- package/dist/compliance/types.js.map +1 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -1
- package/dist/config.js.map +1 -1
- package/dist/events/event-emitter.d.ts +45 -0
- package/dist/events/event-emitter.d.ts.map +1 -0
- package/dist/events/event-emitter.js +100 -0
- package/dist/events/event-emitter.js.map +1 -0
- package/dist/events/event-types.d.ts +124 -0
- package/dist/events/event-types.d.ts.map +1 -0
- package/dist/events/event-types.js +18 -0
- package/dist/events/event-types.js.map +1 -0
- package/dist/index.js +59 -2
- package/dist/index.js.map +1 -1
- package/dist/library/notebook-library.d.ts +25 -2
- package/dist/library/notebook-library.d.ts.map +1 -1
- package/dist/library/notebook-library.js +144 -3
- package/dist/library/notebook-library.js.map +1 -1
- package/dist/library/types.d.ts +15 -0
- package/dist/library/types.d.ts.map +1 -1
- package/dist/notebook-creation/audio-manager.d.ts +56 -0
- package/dist/notebook-creation/audio-manager.d.ts.map +1 -0
- package/dist/notebook-creation/audio-manager.js +335 -0
- package/dist/notebook-creation/audio-manager.js.map +1 -0
- package/dist/notebook-creation/discover-creation-flow.d.ts +8 -0
- package/dist/notebook-creation/discover-creation-flow.d.ts.map +1 -0
- package/dist/notebook-creation/discover-creation-flow.js +177 -0
- package/dist/notebook-creation/discover-creation-flow.js.map +1 -0
- package/dist/notebook-creation/discover-quota.d.ts +8 -0
- package/dist/notebook-creation/discover-quota.d.ts.map +1 -0
- package/dist/notebook-creation/discover-quota.js +195 -0
- package/dist/notebook-creation/discover-quota.js.map +1 -0
- package/dist/notebook-creation/discover-source-dialog.d.ts +8 -0
- package/dist/notebook-creation/discover-source-dialog.d.ts.map +1 -0
- package/dist/notebook-creation/discover-source-dialog.js +134 -0
- package/dist/notebook-creation/discover-source-dialog.js.map +1 -0
- package/dist/notebook-creation/discover-sources.d.ts +8 -0
- package/dist/notebook-creation/discover-sources.d.ts.map +1 -0
- package/dist/notebook-creation/discover-sources.js +273 -0
- package/dist/notebook-creation/discover-sources.js.map +1 -0
- package/dist/notebook-creation/discover-text-input.d.ts +7 -0
- package/dist/notebook-creation/discover-text-input.d.ts.map +1 -0
- package/dist/notebook-creation/discover-text-input.js +135 -0
- package/dist/notebook-creation/discover-text-input.js.map +1 -0
- package/dist/notebook-creation/index.d.ts +12 -0
- package/dist/notebook-creation/index.d.ts.map +1 -0
- package/dist/notebook-creation/index.js +12 -0
- package/dist/notebook-creation/index.js.map +1 -0
- package/dist/notebook-creation/notebook-creator.d.ts +95 -0
- package/dist/notebook-creation/notebook-creator.d.ts.map +1 -0
- package/dist/notebook-creation/notebook-creator.js +689 -0
- package/dist/notebook-creation/notebook-creator.js.map +1 -0
- package/dist/notebook-creation/notebook-sync.d.ts +93 -0
- package/dist/notebook-creation/notebook-sync.d.ts.map +1 -0
- package/dist/notebook-creation/notebook-sync.js +370 -0
- package/dist/notebook-creation/notebook-sync.js.map +1 -0
- package/dist/notebook-creation/run-discovery.d.ts +11 -0
- package/dist/notebook-creation/run-discovery.d.ts.map +1 -0
- package/dist/notebook-creation/run-discovery.js +151 -0
- package/dist/notebook-creation/run-discovery.js.map +1 -0
- package/dist/notebook-creation/selector-discovery.d.ts +65 -0
- package/dist/notebook-creation/selector-discovery.d.ts.map +1 -0
- package/dist/notebook-creation/selector-discovery.js +421 -0
- package/dist/notebook-creation/selector-discovery.js.map +1 -0
- package/dist/notebook-creation/selectors.d.ts +150 -0
- package/dist/notebook-creation/selectors.d.ts.map +1 -0
- package/dist/notebook-creation/selectors.js +225 -0
- package/dist/notebook-creation/selectors.js.map +1 -0
- package/dist/notebook-creation/source-manager.d.ts +73 -0
- package/dist/notebook-creation/source-manager.d.ts.map +1 -0
- package/dist/notebook-creation/source-manager.js +486 -0
- package/dist/notebook-creation/source-manager.js.map +1 -0
- package/dist/notebook-creation/test-create.d.ts +8 -0
- package/dist/notebook-creation/test-create.d.ts.map +1 -0
- package/dist/notebook-creation/test-create.js +72 -0
- package/dist/notebook-creation/test-create.js.map +1 -0
- package/dist/notebook-creation/types.d.ts +173 -0
- package/dist/notebook-creation/types.d.ts.map +1 -0
- package/dist/notebook-creation/types.js +5 -0
- package/dist/notebook-creation/types.js.map +1 -0
- package/dist/quota/index.d.ts +8 -0
- package/dist/quota/index.d.ts.map +1 -0
- package/dist/quota/index.js +8 -0
- package/dist/quota/index.js.map +1 -0
- package/dist/quota/quota-manager.d.ts +125 -0
- package/dist/quota/quota-manager.d.ts.map +1 -0
- package/dist/quota/quota-manager.js +330 -0
- package/dist/quota/quota-manager.js.map +1 -0
- package/dist/session/session-manager.d.ts +5 -0
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +6 -0
- package/dist/session/session-manager.js.map +1 -1
- package/dist/session/shared-context-manager.d.ts.map +1 -1
- package/dist/session/shared-context-manager.js +2 -1
- package/dist/session/shared-context-manager.js.map +1 -1
- package/dist/tools/definitions/notebook-management.d.ts.map +1 -1
- package/dist/tools/definitions/notebook-management.js +525 -0
- package/dist/tools/definitions/notebook-management.js.map +1 -1
- package/dist/tools/definitions/system.d.ts.map +1 -1
- package/dist/tools/definitions/system.js +158 -0
- package/dist/tools/definitions/system.js.map +1 -1
- package/dist/tools/handlers.d.ts +225 -0
- package/dist/tools/handlers.d.ts.map +1 -1
- package/dist/tools/handlers.js +911 -0
- package/dist/tools/handlers.js.map +1 -1
- package/dist/utils/audit-logger.d.ts +21 -1
- package/dist/utils/audit-logger.d.ts.map +1 -1
- package/dist/utils/audit-logger.js +53 -4
- package/dist/utils/audit-logger.js.map +1 -1
- package/dist/utils/crypto.d.ts.map +1 -1
- package/dist/utils/crypto.js +8 -15
- package/dist/utils/crypto.js.map +1 -1
- package/dist/utils/file-permissions.d.ts +85 -0
- package/dist/utils/file-permissions.d.ts.map +1 -0
- package/dist/utils/file-permissions.js +180 -0
- package/dist/utils/file-permissions.js.map +1 -0
- package/dist/utils/settings-manager.d.ts.map +1 -1
- package/dist/utils/settings-manager.js +6 -11
- package/dist/utils/settings-manager.js.map +1 -1
- package/dist/webhooks/index.d.ts +8 -0
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/index.js +8 -0
- package/dist/webhooks/index.js.map +1 -0
- package/dist/webhooks/types.d.ts +57 -0
- package/dist/webhooks/types.d.ts.map +1 -0
- package/dist/webhooks/types.js +5 -0
- package/dist/webhooks/types.js.map +1 -0
- package/dist/webhooks/webhook-dispatcher.d.ts +120 -0
- package/dist/webhooks/webhook-dispatcher.d.ts.map +1 -0
- package/dist/webhooks/webhook-dispatcher.js +519 -0
- package/dist/webhooks/webhook-dispatcher.js.map +1 -0
- package/docs/COMPLIANCE-SPEC.md +1452 -0
- package/package.json +30 -4
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance MCP Tools
|
|
3
|
+
*
|
|
4
|
+
* Exposes compliance features as MCP tools for Claude integration.
|
|
5
|
+
* Provides structured access to compliance dashboard, reports, and evidence.
|
|
6
|
+
*
|
|
7
|
+
* Added by Pantheon Security for enterprise compliance support.
|
|
8
|
+
*/
|
|
9
|
+
import { getComplianceDashboard, getDashboardCLI } from "./dashboard.js";
|
|
10
|
+
import { getReportGenerator } from "./report-generator.js";
|
|
11
|
+
import { getEvidenceCollector } from "./evidence-collector.js";
|
|
12
|
+
import { getConsentManager } from "./consent-manager.js";
|
|
13
|
+
import { getDSARHandler } from "./dsar-handler.js";
|
|
14
|
+
import { getDataExporter } from "./data-export.js";
|
|
15
|
+
import { getDataErasureManager } from "./data-erasure.js";
|
|
16
|
+
import { getHealthMonitor } from "./health-monitor.js";
|
|
17
|
+
import { getPolicyDocManager } from "./policy-docs.js";
|
|
18
|
+
import { getComplianceLogger } from "./compliance-logger.js";
|
|
19
|
+
import { getIncidentManager } from "./incident-manager.js";
|
|
20
|
+
/**
|
|
21
|
+
* Tool definitions for compliance features
|
|
22
|
+
*/
|
|
23
|
+
export function getComplianceTools() {
|
|
24
|
+
return [
|
|
25
|
+
// Dashboard Tools
|
|
26
|
+
{
|
|
27
|
+
name: "compliance_dashboard",
|
|
28
|
+
description: "Get comprehensive compliance dashboard with GDPR, SOC2, and CSSF status. Shows overall compliance score, health status, and key metrics.",
|
|
29
|
+
inputSchema: {
|
|
30
|
+
type: "object",
|
|
31
|
+
properties: {
|
|
32
|
+
format: {
|
|
33
|
+
type: "string",
|
|
34
|
+
enum: ["json", "cli"],
|
|
35
|
+
description: "Output format: 'json' for structured data, 'cli' for human-readable text",
|
|
36
|
+
default: "cli",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "compliance_score",
|
|
43
|
+
description: "Get current compliance score (0-100) for each regulation and overall. Includes detailed breakdown by category.",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
type: "object",
|
|
46
|
+
properties: {},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
// Report Tools
|
|
50
|
+
{
|
|
51
|
+
name: "generate_compliance_report",
|
|
52
|
+
description: "Generate a compliance audit report. Supports multiple report types and formats.",
|
|
53
|
+
inputSchema: {
|
|
54
|
+
type: "object",
|
|
55
|
+
properties: {
|
|
56
|
+
report_type: {
|
|
57
|
+
type: "string",
|
|
58
|
+
enum: [
|
|
59
|
+
"compliance_summary",
|
|
60
|
+
"gdpr_audit",
|
|
61
|
+
"soc2_audit",
|
|
62
|
+
"cssf_audit",
|
|
63
|
+
"security_audit",
|
|
64
|
+
"incident_report",
|
|
65
|
+
"dsar_report",
|
|
66
|
+
"retention_report",
|
|
67
|
+
"change_management",
|
|
68
|
+
"full_audit",
|
|
69
|
+
],
|
|
70
|
+
description: "Type of report to generate",
|
|
71
|
+
},
|
|
72
|
+
format: {
|
|
73
|
+
type: "string",
|
|
74
|
+
enum: ["json", "csv", "html"],
|
|
75
|
+
description: "Output format",
|
|
76
|
+
default: "json",
|
|
77
|
+
},
|
|
78
|
+
from_date: {
|
|
79
|
+
type: "string",
|
|
80
|
+
description: "Start date (ISO format). Defaults to 30 days ago.",
|
|
81
|
+
},
|
|
82
|
+
to_date: {
|
|
83
|
+
type: "string",
|
|
84
|
+
description: "End date (ISO format). Defaults to now.",
|
|
85
|
+
},
|
|
86
|
+
save_to_disk: {
|
|
87
|
+
type: "boolean",
|
|
88
|
+
description: "Whether to save the report to disk",
|
|
89
|
+
default: false,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
required: ["report_type"],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
// Evidence Collection Tools
|
|
96
|
+
{
|
|
97
|
+
name: "collect_audit_evidence",
|
|
98
|
+
description: "Collect evidence package for compliance audits. Creates a verifiable package with checksums.",
|
|
99
|
+
inputSchema: {
|
|
100
|
+
type: "object",
|
|
101
|
+
properties: {
|
|
102
|
+
regulation: {
|
|
103
|
+
type: "string",
|
|
104
|
+
enum: ["GDPR", "SOC2", "CSSF", "all"],
|
|
105
|
+
description: "Regulation to collect evidence for, or 'all' for comprehensive package",
|
|
106
|
+
default: "all",
|
|
107
|
+
},
|
|
108
|
+
from_date: {
|
|
109
|
+
type: "string",
|
|
110
|
+
description: "Start date (ISO format)",
|
|
111
|
+
},
|
|
112
|
+
to_date: {
|
|
113
|
+
type: "string",
|
|
114
|
+
description: "End date (ISO format)",
|
|
115
|
+
},
|
|
116
|
+
save_to_disk: {
|
|
117
|
+
type: "boolean",
|
|
118
|
+
description: "Whether to save the evidence package to disk",
|
|
119
|
+
default: true,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "verify_evidence_integrity",
|
|
126
|
+
description: "Verify the integrity of an evidence package using cryptographic checksums.",
|
|
127
|
+
inputSchema: {
|
|
128
|
+
type: "object",
|
|
129
|
+
properties: {
|
|
130
|
+
package_id: {
|
|
131
|
+
type: "string",
|
|
132
|
+
description: "The evidence package ID to verify",
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
required: ["package_id"],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "list_evidence_packages",
|
|
140
|
+
description: "List all saved evidence packages with their metadata.",
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: "object",
|
|
143
|
+
properties: {},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
// GDPR Data Subject Rights Tools
|
|
147
|
+
{
|
|
148
|
+
name: "submit_dsar",
|
|
149
|
+
description: "Submit a Data Subject Access Request (GDPR Article 15-17, 20). Initiates the DSAR workflow.",
|
|
150
|
+
inputSchema: {
|
|
151
|
+
type: "object",
|
|
152
|
+
properties: {
|
|
153
|
+
type: {
|
|
154
|
+
type: "string",
|
|
155
|
+
enum: ["access", "rectification", "erasure", "portability", "restriction", "objection"],
|
|
156
|
+
description: "Type of DSAR",
|
|
157
|
+
},
|
|
158
|
+
data_subject_id: {
|
|
159
|
+
type: "string",
|
|
160
|
+
description: "Identifier for the data subject (optional, defaults to current user)",
|
|
161
|
+
},
|
|
162
|
+
details: {
|
|
163
|
+
type: "string",
|
|
164
|
+
description: "Additional details or specific data categories requested",
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
required: ["type"],
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: "export_user_data",
|
|
172
|
+
description: "Export all user data in machine-readable format (GDPR Article 20 - Right to Data Portability).",
|
|
173
|
+
inputSchema: {
|
|
174
|
+
type: "object",
|
|
175
|
+
properties: {
|
|
176
|
+
format: {
|
|
177
|
+
type: "string",
|
|
178
|
+
enum: ["json", "csv"],
|
|
179
|
+
description: "Export format",
|
|
180
|
+
default: "json",
|
|
181
|
+
},
|
|
182
|
+
include_categories: {
|
|
183
|
+
type: "array",
|
|
184
|
+
items: { type: "string" },
|
|
185
|
+
description: "Specific data categories to include (leave empty for all)",
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "request_data_erasure",
|
|
192
|
+
description: "Request erasure of personal data (GDPR Article 17 - Right to Erasure). Creates an erasure request for review.",
|
|
193
|
+
inputSchema: {
|
|
194
|
+
type: "object",
|
|
195
|
+
properties: {
|
|
196
|
+
data_categories: {
|
|
197
|
+
type: "array",
|
|
198
|
+
items: { type: "string" },
|
|
199
|
+
description: "Specific data categories to erase (leave empty for all erasable data)",
|
|
200
|
+
},
|
|
201
|
+
reason: {
|
|
202
|
+
type: "string",
|
|
203
|
+
description: "Reason for erasure request",
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
// Consent Management Tools
|
|
209
|
+
{
|
|
210
|
+
name: "get_consent_status",
|
|
211
|
+
description: "Get current consent status for all data processing purposes.",
|
|
212
|
+
inputSchema: {
|
|
213
|
+
type: "object",
|
|
214
|
+
properties: {},
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: "grant_consent",
|
|
219
|
+
description: "Grant consent for a specific data processing purpose.",
|
|
220
|
+
inputSchema: {
|
|
221
|
+
type: "object",
|
|
222
|
+
properties: {
|
|
223
|
+
purpose: {
|
|
224
|
+
type: "string",
|
|
225
|
+
description: "The purpose for which consent is being granted",
|
|
226
|
+
},
|
|
227
|
+
legal_basis: {
|
|
228
|
+
type: "string",
|
|
229
|
+
enum: ["consent", "contract", "legal_obligation", "vital_interest", "public_interest", "legitimate_interest"],
|
|
230
|
+
description: "Legal basis for processing",
|
|
231
|
+
default: "consent",
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
required: ["purpose"],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: "revoke_consent",
|
|
239
|
+
description: "Revoke previously granted consent for a data processing purpose.",
|
|
240
|
+
inputSchema: {
|
|
241
|
+
type: "object",
|
|
242
|
+
properties: {
|
|
243
|
+
purpose: {
|
|
244
|
+
type: "string",
|
|
245
|
+
description: "The purpose for which consent is being revoked",
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
required: ["purpose"],
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
// Security & Incident Tools
|
|
252
|
+
{
|
|
253
|
+
name: "report_security_incident",
|
|
254
|
+
description: "Report a security incident for investigation and tracking.",
|
|
255
|
+
inputSchema: {
|
|
256
|
+
type: "object",
|
|
257
|
+
properties: {
|
|
258
|
+
type: {
|
|
259
|
+
type: "string",
|
|
260
|
+
enum: [
|
|
261
|
+
"data_breach",
|
|
262
|
+
"unauthorized_access",
|
|
263
|
+
"policy_violation",
|
|
264
|
+
"suspicious_activity",
|
|
265
|
+
"system_compromise",
|
|
266
|
+
"data_loss",
|
|
267
|
+
"other",
|
|
268
|
+
],
|
|
269
|
+
description: "Type of security incident",
|
|
270
|
+
},
|
|
271
|
+
severity: {
|
|
272
|
+
type: "string",
|
|
273
|
+
enum: ["low", "medium", "high", "critical"],
|
|
274
|
+
description: "Incident severity",
|
|
275
|
+
},
|
|
276
|
+
title: {
|
|
277
|
+
type: "string",
|
|
278
|
+
description: "Brief title for the incident",
|
|
279
|
+
},
|
|
280
|
+
description: {
|
|
281
|
+
type: "string",
|
|
282
|
+
description: "Detailed description of the incident",
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
required: ["type", "severity", "title", "description"],
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: "get_incident_status",
|
|
290
|
+
description: "Get status of security incidents including open, investigating, and resolved counts.",
|
|
291
|
+
inputSchema: {
|
|
292
|
+
type: "object",
|
|
293
|
+
properties: {},
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
// Health & Monitoring Tools
|
|
297
|
+
{
|
|
298
|
+
name: "run_health_check",
|
|
299
|
+
description: "Run a comprehensive health check of all compliance components.",
|
|
300
|
+
inputSchema: {
|
|
301
|
+
type: "object",
|
|
302
|
+
properties: {},
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: "verify_audit_log_integrity",
|
|
307
|
+
description: "Verify the integrity of compliance audit logs using hash chain verification.",
|
|
308
|
+
inputSchema: {
|
|
309
|
+
type: "object",
|
|
310
|
+
properties: {},
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
// Policy Tools
|
|
314
|
+
{
|
|
315
|
+
name: "list_policies",
|
|
316
|
+
description: "List all compliance policies with their status and review dates.",
|
|
317
|
+
inputSchema: {
|
|
318
|
+
type: "object",
|
|
319
|
+
properties: {
|
|
320
|
+
regulation: {
|
|
321
|
+
type: "string",
|
|
322
|
+
enum: ["GDPR", "SOC2", "CSSF"],
|
|
323
|
+
description: "Filter by regulation (optional)",
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
name: "get_policy",
|
|
330
|
+
description: "Get detailed information about a specific compliance policy.",
|
|
331
|
+
inputSchema: {
|
|
332
|
+
type: "object",
|
|
333
|
+
properties: {
|
|
334
|
+
policy_id: {
|
|
335
|
+
type: "string",
|
|
336
|
+
description: "The policy ID to retrieve",
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
required: ["policy_id"],
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
];
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Handle compliance tool calls
|
|
346
|
+
*/
|
|
347
|
+
export async function handleComplianceToolCall(toolName, args) {
|
|
348
|
+
try {
|
|
349
|
+
switch (toolName) {
|
|
350
|
+
// Dashboard Tools
|
|
351
|
+
case "compliance_dashboard":
|
|
352
|
+
return await handleComplianceDashboard(args);
|
|
353
|
+
case "compliance_score":
|
|
354
|
+
return await handleComplianceScore();
|
|
355
|
+
// Report Tools
|
|
356
|
+
case "generate_compliance_report":
|
|
357
|
+
return await handleGenerateReport(args);
|
|
358
|
+
// Evidence Tools
|
|
359
|
+
case "collect_audit_evidence":
|
|
360
|
+
return await handleCollectEvidence(args);
|
|
361
|
+
case "verify_evidence_integrity":
|
|
362
|
+
return await handleVerifyEvidence(args);
|
|
363
|
+
case "list_evidence_packages":
|
|
364
|
+
return await handleListEvidence();
|
|
365
|
+
// DSAR Tools
|
|
366
|
+
case "submit_dsar":
|
|
367
|
+
return await handleSubmitDSAR(args);
|
|
368
|
+
case "export_user_data":
|
|
369
|
+
return await handleExportUserData(args);
|
|
370
|
+
case "request_data_erasure":
|
|
371
|
+
return await handleRequestErasure(args);
|
|
372
|
+
// Consent Tools
|
|
373
|
+
case "get_consent_status":
|
|
374
|
+
return await handleGetConsentStatus();
|
|
375
|
+
case "grant_consent":
|
|
376
|
+
return await handleGrantConsent(args);
|
|
377
|
+
case "revoke_consent":
|
|
378
|
+
return await handleRevokeConsent(args);
|
|
379
|
+
// Security Tools
|
|
380
|
+
case "report_security_incident":
|
|
381
|
+
return await handleReportIncident(args);
|
|
382
|
+
case "get_incident_status":
|
|
383
|
+
return await handleGetIncidentStatus();
|
|
384
|
+
// Health Tools
|
|
385
|
+
case "run_health_check":
|
|
386
|
+
return await handleRunHealthCheck();
|
|
387
|
+
case "verify_audit_log_integrity":
|
|
388
|
+
return await handleVerifyIntegrity();
|
|
389
|
+
// Policy Tools
|
|
390
|
+
case "list_policies":
|
|
391
|
+
return await handleListPolicies(args);
|
|
392
|
+
case "get_policy":
|
|
393
|
+
return await handleGetPolicy(args);
|
|
394
|
+
default:
|
|
395
|
+
return [{ type: "text", text: `Unknown compliance tool: ${toolName}` }];
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
catch (error) {
|
|
399
|
+
return [
|
|
400
|
+
{
|
|
401
|
+
type: "text",
|
|
402
|
+
text: `Error executing ${toolName}: ${error instanceof Error ? error.message : String(error)}`,
|
|
403
|
+
},
|
|
404
|
+
];
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
// ============================================
|
|
408
|
+
// TOOL HANDLERS
|
|
409
|
+
// ============================================
|
|
410
|
+
async function handleComplianceDashboard(args) {
|
|
411
|
+
const format = args.format || "cli";
|
|
412
|
+
if (format === "cli") {
|
|
413
|
+
const cliOutput = await getDashboardCLI();
|
|
414
|
+
return [{ type: "text", text: cliOutput }];
|
|
415
|
+
}
|
|
416
|
+
const dashboard = getComplianceDashboard();
|
|
417
|
+
const data = await dashboard.generateDashboard();
|
|
418
|
+
return [{ type: "text", text: JSON.stringify(data, null, 2) }];
|
|
419
|
+
}
|
|
420
|
+
async function handleComplianceScore() {
|
|
421
|
+
const dashboard = getComplianceDashboard();
|
|
422
|
+
const score = await dashboard.getComplianceScore();
|
|
423
|
+
return [{ type: "text", text: JSON.stringify(score, null, 2) }];
|
|
424
|
+
}
|
|
425
|
+
async function handleGenerateReport(args) {
|
|
426
|
+
const reportGenerator = getReportGenerator();
|
|
427
|
+
const reportType = args.report_type;
|
|
428
|
+
const format = args.format || "json";
|
|
429
|
+
const fromDate = args.from_date ? new Date(args.from_date) : undefined;
|
|
430
|
+
const toDate = args.to_date ? new Date(args.to_date) : undefined;
|
|
431
|
+
const saveToDisk = args.save_to_disk || false;
|
|
432
|
+
const report = await reportGenerator.generateReport(reportType, {
|
|
433
|
+
from: fromDate,
|
|
434
|
+
to: toDate,
|
|
435
|
+
format,
|
|
436
|
+
saveToDisk,
|
|
437
|
+
});
|
|
438
|
+
let result = `Report generated successfully.\n`;
|
|
439
|
+
result += `Report ID: ${report.metadata.report_id}\n`;
|
|
440
|
+
result += `Type: ${report.metadata.report_type}\n`;
|
|
441
|
+
result += `Format: ${report.metadata.format}\n`;
|
|
442
|
+
result += `Period: ${report.metadata.period.from} to ${report.metadata.period.to}\n`;
|
|
443
|
+
if (report.file_path) {
|
|
444
|
+
result += `Saved to: ${report.file_path}\n`;
|
|
445
|
+
}
|
|
446
|
+
result += `\n--- Report Content ---\n\n`;
|
|
447
|
+
result += report.content;
|
|
448
|
+
return [{ type: "text", text: result }];
|
|
449
|
+
}
|
|
450
|
+
async function handleCollectEvidence(args) {
|
|
451
|
+
const collector = getEvidenceCollector();
|
|
452
|
+
const regulation = args.regulation;
|
|
453
|
+
const fromDate = args.from_date ? new Date(args.from_date) : undefined;
|
|
454
|
+
const toDate = args.to_date ? new Date(args.to_date) : undefined;
|
|
455
|
+
const saveToDisk = args.save_to_disk !== false;
|
|
456
|
+
let evidencePackage;
|
|
457
|
+
if (regulation && regulation !== "all") {
|
|
458
|
+
evidencePackage = await collector.collectRegulationEvidence(regulation, { from: fromDate, to: toDate });
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
evidencePackage = await collector.collectEvidence({
|
|
462
|
+
from: fromDate,
|
|
463
|
+
to: toDate,
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
let filePath;
|
|
467
|
+
if (saveToDisk) {
|
|
468
|
+
filePath = await collector.savePackage(evidencePackage);
|
|
469
|
+
}
|
|
470
|
+
const result = {
|
|
471
|
+
package_id: evidencePackage.package_id,
|
|
472
|
+
created_at: evidencePackage.created_at,
|
|
473
|
+
purpose: evidencePackage.purpose,
|
|
474
|
+
period: evidencePackage.period,
|
|
475
|
+
item_count: evidencePackage.manifest.total_items,
|
|
476
|
+
total_size_bytes: evidencePackage.manifest.total_size_bytes,
|
|
477
|
+
types_included: evidencePackage.manifest.types_included,
|
|
478
|
+
package_checksum: evidencePackage.manifest.package_checksum,
|
|
479
|
+
saved_to: filePath,
|
|
480
|
+
};
|
|
481
|
+
return [{ type: "text", text: JSON.stringify(result, null, 2) }];
|
|
482
|
+
}
|
|
483
|
+
async function handleVerifyEvidence(args) {
|
|
484
|
+
const collector = getEvidenceCollector();
|
|
485
|
+
const packageId = args.package_id;
|
|
486
|
+
const evidencePackage = await collector.loadPackage(packageId);
|
|
487
|
+
if (!evidencePackage) {
|
|
488
|
+
return [{ type: "text", text: `Evidence package not found: ${packageId}` }];
|
|
489
|
+
}
|
|
490
|
+
const verification = collector.verifyPackageIntegrity(evidencePackage);
|
|
491
|
+
return [
|
|
492
|
+
{
|
|
493
|
+
type: "text",
|
|
494
|
+
text: JSON.stringify({
|
|
495
|
+
package_id: packageId,
|
|
496
|
+
integrity_valid: verification.valid,
|
|
497
|
+
errors: verification.errors,
|
|
498
|
+
}, null, 2),
|
|
499
|
+
},
|
|
500
|
+
];
|
|
501
|
+
}
|
|
502
|
+
async function handleListEvidence() {
|
|
503
|
+
const collector = getEvidenceCollector();
|
|
504
|
+
const packages = collector.listPackages();
|
|
505
|
+
return [{ type: "text", text: JSON.stringify(packages, null, 2) }];
|
|
506
|
+
}
|
|
507
|
+
async function handleSubmitDSAR(args) {
|
|
508
|
+
const dsarHandler = getDSARHandler();
|
|
509
|
+
const type = args.type;
|
|
510
|
+
const request = await dsarHandler.submitRequest(type);
|
|
511
|
+
return [
|
|
512
|
+
{
|
|
513
|
+
type: "text",
|
|
514
|
+
text: JSON.stringify({
|
|
515
|
+
request_id: request.request_id,
|
|
516
|
+
type: request.type,
|
|
517
|
+
status: request.status,
|
|
518
|
+
submitted_at: request.submitted_at,
|
|
519
|
+
message: "DSAR submitted successfully. You will be notified when processing is complete.",
|
|
520
|
+
}, null, 2),
|
|
521
|
+
},
|
|
522
|
+
];
|
|
523
|
+
}
|
|
524
|
+
async function handleExportUserData(args) {
|
|
525
|
+
const exporter = getDataExporter();
|
|
526
|
+
const format = args.format || "json_pretty";
|
|
527
|
+
const exportContent = await exporter.exportToString({ format });
|
|
528
|
+
return [
|
|
529
|
+
{
|
|
530
|
+
type: "text",
|
|
531
|
+
text: `Data Export (JSON)\n\n${exportContent}`,
|
|
532
|
+
},
|
|
533
|
+
];
|
|
534
|
+
}
|
|
535
|
+
async function handleRequestErasure(args) {
|
|
536
|
+
const erasureManager = getDataErasureManager();
|
|
537
|
+
const completeErasure = args.complete_erasure || false;
|
|
538
|
+
const request = await erasureManager.createRequest({
|
|
539
|
+
complete_erasure: completeErasure,
|
|
540
|
+
});
|
|
541
|
+
return [
|
|
542
|
+
{
|
|
543
|
+
type: "text",
|
|
544
|
+
text: JSON.stringify({
|
|
545
|
+
request_id: request.request_id,
|
|
546
|
+
requested_at: request.requested_at,
|
|
547
|
+
scope: request.scope,
|
|
548
|
+
confirmed: request.confirmed,
|
|
549
|
+
message: "Erasure request created. Use confirmAndExecute to proceed with deletion.",
|
|
550
|
+
}, null, 2),
|
|
551
|
+
},
|
|
552
|
+
];
|
|
553
|
+
}
|
|
554
|
+
async function handleGetConsentStatus() {
|
|
555
|
+
const consentManager = getConsentManager();
|
|
556
|
+
const consents = await consentManager.getActiveConsents();
|
|
557
|
+
const validation = await consentManager.validateConsents();
|
|
558
|
+
return [
|
|
559
|
+
{
|
|
560
|
+
type: "text",
|
|
561
|
+
text: JSON.stringify({
|
|
562
|
+
validation_result: validation,
|
|
563
|
+
consents: consents.map((c) => ({
|
|
564
|
+
purposes: c.purposes,
|
|
565
|
+
legal_basis: c.legal_basis,
|
|
566
|
+
granted_at: c.granted_at,
|
|
567
|
+
expires_at: c.expires_at,
|
|
568
|
+
revoked: c.revoked,
|
|
569
|
+
})),
|
|
570
|
+
}, null, 2),
|
|
571
|
+
},
|
|
572
|
+
];
|
|
573
|
+
}
|
|
574
|
+
async function handleGrantConsent(args) {
|
|
575
|
+
const consentManager = getConsentManager();
|
|
576
|
+
const purpose = args.purpose;
|
|
577
|
+
const legalBasis = args.legal_basis || "consent";
|
|
578
|
+
const consent = await consentManager.grantConsent([purpose], {
|
|
579
|
+
legalBasis: legalBasis,
|
|
580
|
+
method: "explicit",
|
|
581
|
+
});
|
|
582
|
+
return [
|
|
583
|
+
{
|
|
584
|
+
type: "text",
|
|
585
|
+
text: `Consent granted for purpose: ${purpose} (Legal basis: ${legalBasis})\nConsent ID: ${consent.id}`,
|
|
586
|
+
},
|
|
587
|
+
];
|
|
588
|
+
}
|
|
589
|
+
async function handleRevokeConsent(args) {
|
|
590
|
+
const consentManager = getConsentManager();
|
|
591
|
+
const purpose = args.purpose;
|
|
592
|
+
await consentManager.revokeConsent(purpose);
|
|
593
|
+
return [{ type: "text", text: `Consent revoked for purpose: ${purpose}` }];
|
|
594
|
+
}
|
|
595
|
+
async function handleReportIncident(args) {
|
|
596
|
+
const incidentManager = getIncidentManager();
|
|
597
|
+
const incident = await incidentManager.createIncident(args.type, args.severity, args.title, args.description);
|
|
598
|
+
return [
|
|
599
|
+
{
|
|
600
|
+
type: "text",
|
|
601
|
+
text: JSON.stringify({
|
|
602
|
+
incident_id: incident.id,
|
|
603
|
+
type: incident.type,
|
|
604
|
+
severity: incident.severity,
|
|
605
|
+
status: incident.status,
|
|
606
|
+
detected_at: incident.detected_at,
|
|
607
|
+
message: "Incident reported successfully and logged for investigation.",
|
|
608
|
+
}, null, 2),
|
|
609
|
+
},
|
|
610
|
+
];
|
|
611
|
+
}
|
|
612
|
+
async function handleGetIncidentStatus() {
|
|
613
|
+
const incidentManager = getIncidentManager();
|
|
614
|
+
const statistics = await incidentManager.getStatistics();
|
|
615
|
+
const openIncidents = await incidentManager.getOpenIncidents();
|
|
616
|
+
return [
|
|
617
|
+
{
|
|
618
|
+
type: "text",
|
|
619
|
+
text: JSON.stringify({
|
|
620
|
+
statistics,
|
|
621
|
+
open_incidents: openIncidents.map(i => ({
|
|
622
|
+
id: i.id,
|
|
623
|
+
type: i.type,
|
|
624
|
+
severity: i.severity,
|
|
625
|
+
title: i.title,
|
|
626
|
+
status: i.status,
|
|
627
|
+
detected_at: i.detected_at,
|
|
628
|
+
})),
|
|
629
|
+
}, null, 2),
|
|
630
|
+
},
|
|
631
|
+
];
|
|
632
|
+
}
|
|
633
|
+
async function handleRunHealthCheck() {
|
|
634
|
+
const monitor = getHealthMonitor();
|
|
635
|
+
const metrics = await monitor.runHealthCheck();
|
|
636
|
+
return [{ type: "text", text: JSON.stringify(metrics, null, 2) }];
|
|
637
|
+
}
|
|
638
|
+
async function handleVerifyIntegrity() {
|
|
639
|
+
const logger = getComplianceLogger();
|
|
640
|
+
const integrity = await logger.verifyIntegrity();
|
|
641
|
+
return [{ type: "text", text: JSON.stringify(integrity, null, 2) }];
|
|
642
|
+
}
|
|
643
|
+
async function handleListPolicies(args) {
|
|
644
|
+
const policyManager = getPolicyDocManager();
|
|
645
|
+
const regulation = args.regulation;
|
|
646
|
+
let policies;
|
|
647
|
+
if (regulation) {
|
|
648
|
+
policies = await policyManager.getPoliciesByRegulation(regulation);
|
|
649
|
+
}
|
|
650
|
+
else {
|
|
651
|
+
policies = await policyManager.getAllPolicies();
|
|
652
|
+
}
|
|
653
|
+
const summary = policies.map(p => ({
|
|
654
|
+
id: p.id,
|
|
655
|
+
title: p.title,
|
|
656
|
+
type: p.type,
|
|
657
|
+
regulations: p.regulations,
|
|
658
|
+
enforced: p.enforced,
|
|
659
|
+
last_reviewed: p.last_reviewed,
|
|
660
|
+
next_review: p.next_review,
|
|
661
|
+
}));
|
|
662
|
+
return [{ type: "text", text: JSON.stringify(summary, null, 2) }];
|
|
663
|
+
}
|
|
664
|
+
async function handleGetPolicy(args) {
|
|
665
|
+
const policyManager = getPolicyDocManager();
|
|
666
|
+
const policyId = args.policy_id;
|
|
667
|
+
const policy = await policyManager.getPolicy(policyId);
|
|
668
|
+
if (!policy) {
|
|
669
|
+
return [{ type: "text", text: `Policy not found: ${policyId}` }];
|
|
670
|
+
}
|
|
671
|
+
return [{ type: "text", text: JSON.stringify(policy, null, 2) }];
|
|
672
|
+
}
|
|
673
|
+
//# sourceMappingURL=compliance-tools.js.map
|