@phosphor-dom/sentinel-ai 0.1.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 +111 -0
- package/dist/core/context-compression.d.ts +21 -0
- package/dist/core/context-compression.d.ts.map +1 -0
- package/dist/core/context-compression.js +62 -0
- package/dist/core/context-compression.js.map +1 -0
- package/dist/core/correlation-engine.d.ts +30 -0
- package/dist/core/correlation-engine.d.ts.map +1 -0
- package/dist/core/correlation-engine.js +43 -0
- package/dist/core/correlation-engine.js.map +1 -0
- package/dist/core/event-bus.d.ts +16 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +81 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/evidence-manager.d.ts +27 -0
- package/dist/core/evidence-manager.d.ts.map +1 -0
- package/dist/core/evidence-manager.js +38 -0
- package/dist/core/evidence-manager.js.map +1 -0
- package/dist/core/inter-agent-communication.d.ts +41 -0
- package/dist/core/inter-agent-communication.d.ts.map +1 -0
- package/dist/core/inter-agent-communication.js +68 -0
- package/dist/core/inter-agent-communication.js.map +1 -0
- package/dist/core/knowledge-base.d.ts +26 -0
- package/dist/core/knowledge-base.d.ts.map +1 -0
- package/dist/core/knowledge-base.js +87 -0
- package/dist/core/knowledge-base.js.map +1 -0
- package/dist/core/memory-manager.d.ts +25 -0
- package/dist/core/memory-manager.d.ts.map +1 -0
- package/dist/core/memory-manager.js +80 -0
- package/dist/core/memory-manager.js.map +1 -0
- package/dist/core/orchestrator.d.ts +43 -0
- package/dist/core/orchestrator.d.ts.map +1 -0
- package/dist/core/orchestrator.js +125 -0
- package/dist/core/orchestrator.js.map +1 -0
- package/dist/core/plugin-manager.d.ts +26 -0
- package/dist/core/plugin-manager.d.ts.map +1 -0
- package/dist/core/plugin-manager.js +57 -0
- package/dist/core/plugin-manager.js.map +1 -0
- package/dist/core/provider-abstraction.d.ts +41 -0
- package/dist/core/provider-abstraction.d.ts.map +1 -0
- package/dist/core/provider-abstraction.js +68 -0
- package/dist/core/provider-abstraction.js.map +1 -0
- package/dist/core/report-generator.d.ts +30 -0
- package/dist/core/report-generator.d.ts.map +1 -0
- package/dist/core/report-generator.js +104 -0
- package/dist/core/report-generator.js.map +1 -0
- package/dist/core/risk-analysis.d.ts +31 -0
- package/dist/core/risk-analysis.d.ts.map +1 -0
- package/dist/core/risk-analysis.js +40 -0
- package/dist/core/risk-analysis.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/types/agent.d.ts +24 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +2 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/event.d.ts +14 -0
- package/dist/types/event.d.ts.map +1 -0
- package/dist/types/event.js +9 -0
- package/dist/types/event.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export class ReportGenerator {
|
|
2
|
+
config = {
|
|
3
|
+
companyName: "Client",
|
|
4
|
+
author: "Sentinel Security Platform",
|
|
5
|
+
includeRemediationTimeline: true,
|
|
6
|
+
includeEvidenceSnippets: true,
|
|
7
|
+
formats: ["md"],
|
|
8
|
+
};
|
|
9
|
+
configure(config) {
|
|
10
|
+
Object.assign(this.config, config);
|
|
11
|
+
}
|
|
12
|
+
generate(sections) {
|
|
13
|
+
const reports = {};
|
|
14
|
+
if (this.config.formats.includes("md")) {
|
|
15
|
+
reports["md"] = this.generateMarkdown(sections);
|
|
16
|
+
}
|
|
17
|
+
return reports;
|
|
18
|
+
}
|
|
19
|
+
standardSections(params) {
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
title: "Executive Summary",
|
|
23
|
+
content: this.executiveSummary(params),
|
|
24
|
+
subsections: [
|
|
25
|
+
{ title: "Scope", content: params.scope },
|
|
26
|
+
{ title: "Key Findings", content: `${params.findings.length} findings identified` },
|
|
27
|
+
{ title: "Risk Overview", content: `Critical: ${params.riskMatrix.critical || 0}, High: ${params.riskMatrix.high || 0}` },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: "Technical Findings",
|
|
32
|
+
content: "Detailed technical findings from all agents.",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: "Risk Matrix",
|
|
36
|
+
content: `Total findings: ${params.findings.length}\n` + JSON.stringify(params.riskMatrix, null, 2),
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: "Evidence Mapping",
|
|
40
|
+
content: `${params.evidence.length} evidence items collected.\n${params.cves.length} CVEs correlated.`,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: "Remediation Plan",
|
|
44
|
+
content: this.remediationPlan(params.riskMatrix),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
title: "Appendix",
|
|
48
|
+
content: "Generated by Sentinel Security Platform.",
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
generateMarkdown(sections) {
|
|
53
|
+
let md = `# Security Audit Report\n\n`;
|
|
54
|
+
md += `**Author:** ${this.config.author}\n`;
|
|
55
|
+
md += `**Date:** ${new Date().toISOString().split("T")[0]}\n\n`;
|
|
56
|
+
md += "---\n\n";
|
|
57
|
+
for (const section of sections) {
|
|
58
|
+
md += `## ${section.title}\n\n`;
|
|
59
|
+
md += `${section.content}\n\n`;
|
|
60
|
+
if (section.subsections) {
|
|
61
|
+
for (const sub of section.subsections) {
|
|
62
|
+
md += `### ${sub.title}\n\n${sub.content}\n\n`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return md;
|
|
67
|
+
}
|
|
68
|
+
executiveSummary(params) {
|
|
69
|
+
return [
|
|
70
|
+
`A security audit was performed on "${params.scope}".`,
|
|
71
|
+
`A total of ${params.findings.length} findings were identified across all assessment categories.`,
|
|
72
|
+
`The risk distribution shows ${params.riskMatrix.critical || 0} critical, ${params.riskMatrix.high || 0} high, ${params.riskMatrix.medium || 0} medium, and ${params.riskMatrix.low || 0} low severity issues.`,
|
|
73
|
+
"Immediate remediation is recommended for all critical and high-severity findings.",
|
|
74
|
+
].join("\n\n");
|
|
75
|
+
}
|
|
76
|
+
remediationPlan(riskMatrix) {
|
|
77
|
+
const plan = [
|
|
78
|
+
"### Immediate (0-30 days)",
|
|
79
|
+
(riskMatrix.critical || 0) > 0 ? `- Remediate ${riskMatrix.critical} critical findings` : "- No critical findings",
|
|
80
|
+
(riskMatrix.high || 0) > 0 ? `- Address ${riskMatrix.high} high-severity issues` : "- No high-severity issues",
|
|
81
|
+
"",
|
|
82
|
+
"### Short-term (30-90 days)",
|
|
83
|
+
(riskMatrix.medium || 0) > 0 ? `- Resolve ${riskMatrix.medium} medium-severity findings` : "- No medium-severity findings",
|
|
84
|
+
"- Implement security hardening measures",
|
|
85
|
+
"",
|
|
86
|
+
"### Long-term (90+ days)",
|
|
87
|
+
(riskMatrix.low || 0) > 0 ? `- Address ${riskMatrix.low} low-severity issues` : "- No low-severity issues",
|
|
88
|
+
"- Establish continuous security monitoring",
|
|
89
|
+
"- Schedule periodic re-assessments",
|
|
90
|
+
];
|
|
91
|
+
return plan.join("\n");
|
|
92
|
+
}
|
|
93
|
+
async exportDocx(markdown) {
|
|
94
|
+
// DOCX generation requires external libraries (pandoc or docx npm package)
|
|
95
|
+
// Stub for Phase 5 implementation
|
|
96
|
+
return new TextEncoder().encode(markdown);
|
|
97
|
+
}
|
|
98
|
+
async exportPdf(markdown) {
|
|
99
|
+
// PDF generation requires external libraries
|
|
100
|
+
// Stub for Phase 5 implementation
|
|
101
|
+
return new TextEncoder().encode(markdown);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=report-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-generator.js","sourceRoot":"","sources":["../../src/core/report-generator.ts"],"names":[],"mappings":"AAcA,MAAM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AAK,CAAC,SAAS,CAAC,QAAgB;QAC9B,6CAA6C;QAC7C,kCAAkC;QAClC,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAC3C,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface RiskScore {
|
|
2
|
+
findingId: string;
|
|
3
|
+
riskScore: number;
|
|
4
|
+
severity: "critical" | "high" | "medium" | "low" | "info";
|
|
5
|
+
priority: number;
|
|
6
|
+
remediationDue: string;
|
|
7
|
+
factors: {
|
|
8
|
+
cvss: number;
|
|
9
|
+
epss: number;
|
|
10
|
+
exploitAvailable: boolean;
|
|
11
|
+
businessImpact: "low" | "medium" | "high";
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare class RiskAnalysis {
|
|
15
|
+
computeScore(params: {
|
|
16
|
+
cvss: number;
|
|
17
|
+
epss: number;
|
|
18
|
+
exploitAvailable: boolean;
|
|
19
|
+
businessImpact: "low" | "medium" | "high";
|
|
20
|
+
}): number;
|
|
21
|
+
severity(score: number): RiskScore["severity"];
|
|
22
|
+
prioritize(scores: RiskScore[]): RiskScore[];
|
|
23
|
+
aggregate(risks: RiskScore[]): {
|
|
24
|
+
total: number;
|
|
25
|
+
average: number;
|
|
26
|
+
max: number;
|
|
27
|
+
distribution: Record<string, number>;
|
|
28
|
+
};
|
|
29
|
+
timeline(scores: RiskScore[], daysFromNow?: number): RiskScore[];
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=risk-analysis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk-analysis.d.ts","sourceRoot":"","sources":["../../src/core/risk-analysis.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAA;IACzD,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,gBAAgB,EAAE,OAAO,CAAA;QACzB,cAAc,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;KAC1C,CAAA;CACF;AAED,qBAAa,YAAY;IACvB,YAAY,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,gBAAgB,EAAE,OAAO,CAAA;QACzB,cAAc,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;KAC1C,GAAG,MAAM;IAUV,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC;IAQ9C,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE;IAI5C,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE;IAWpH,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,WAAW,SAAK,GAAG,SAAS,EAAE;CAK7D"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export class RiskAnalysis {
|
|
2
|
+
computeScore(params) {
|
|
3
|
+
const impactWeight = { low: 0.5, medium: 1.0, high: 1.5 };
|
|
4
|
+
return (params.cvss * 0.4 +
|
|
5
|
+
params.epss * 0.3 +
|
|
6
|
+
(params.exploitAvailable ? 1.0 : 0) * 0.2 +
|
|
7
|
+
impactWeight[params.businessImpact] * 0.1);
|
|
8
|
+
}
|
|
9
|
+
severity(score) {
|
|
10
|
+
if (score >= 9.0)
|
|
11
|
+
return "critical";
|
|
12
|
+
if (score >= 7.0)
|
|
13
|
+
return "high";
|
|
14
|
+
if (score >= 4.0)
|
|
15
|
+
return "medium";
|
|
16
|
+
if (score >= 0.1)
|
|
17
|
+
return "low";
|
|
18
|
+
return "info";
|
|
19
|
+
}
|
|
20
|
+
prioritize(scores) {
|
|
21
|
+
return [...scores].sort((a, b) => b.riskScore - a.riskScore);
|
|
22
|
+
}
|
|
23
|
+
aggregate(risks) {
|
|
24
|
+
const distribution = { critical: 0, high: 0, medium: 0, low: 0, info: 0 };
|
|
25
|
+
for (const r of risks)
|
|
26
|
+
distribution[r.severity]++;
|
|
27
|
+
return {
|
|
28
|
+
total: risks.length,
|
|
29
|
+
average: risks.reduce((s, r) => s + r.riskScore, 0) / risks.length || 0,
|
|
30
|
+
max: Math.max(...risks.map((r) => r.riskScore), 0),
|
|
31
|
+
distribution,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
timeline(scores, daysFromNow = 30) {
|
|
35
|
+
const cutoff = new Date();
|
|
36
|
+
cutoff.setDate(cutoff.getDate() + daysFromNow);
|
|
37
|
+
return scores.filter((s) => new Date(s.remediationDue) <= cutoff);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=risk-analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk-analysis.js","sourceRoot":"","sources":["../../src/core/risk-analysis.ts"],"names":[],"mappings":"AAcA,MAAM,OAAO,YAAY;IACvB,YAAY,CAAC,MAKZ;QACC,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAA;QACzD,OAAO,CACL,MAAM,CAAC,IAAI,GAAG,GAAG;YACjB,MAAM,CAAC,IAAI,GAAG,GAAG;YACjB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG;Y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MAAmB,EAAE,WAAW,GAAG,EAAE;QAC5C,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAA;QACzB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,CAAA;QAC9C,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,CAAA;IACnE,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type AuditScope } from "./core/orchestrator";
|
|
2
|
+
export declare function runAudit(scope: AuditScope): Promise<void>;
|
|
3
|
+
export { SentinelOrchestrator } from "./core/orchestrator";
|
|
4
|
+
export { EventBus } from "./core/event-bus";
|
|
5
|
+
export { ProviderAbstraction } from "./core/provider-abstraction";
|
|
6
|
+
export { MemoryManager } from "./core/memory-manager";
|
|
7
|
+
export { InterAgentCommunication } from "./core/inter-agent-communication";
|
|
8
|
+
export { ContextCompression } from "./core/context-compression";
|
|
9
|
+
export { CorrelationEngine } from "./core/correlation-engine";
|
|
10
|
+
export { EvidenceManager } from "./core/evidence-manager";
|
|
11
|
+
export { RiskAnalysis } from "./core/risk-analysis";
|
|
12
|
+
export { PluginManager } from "./core/plugin-manager";
|
|
13
|
+
export { ReportGenerator } from "./core/report-generator";
|
|
14
|
+
export { KnowledgeBase } from "./core/knowledge-base";
|
|
15
|
+
export type { AuditScope } from "./core/orchestrator";
|
|
16
|
+
export type { CompressedContext } from "./core/context-compression";
|
|
17
|
+
export type { AttackChain, CorrelationRule } from "./core/correlation-engine";
|
|
18
|
+
export type { Evidence } from "./core/evidence-manager";
|
|
19
|
+
export type { RiskScore } from "./core/risk-analysis";
|
|
20
|
+
export type { PluginManifest, PluginResult } from "./core/plugin-manager";
|
|
21
|
+
export type { ReportConfig, ReportSection } from "./core/report-generator";
|
|
22
|
+
export type { KbEntry, KbEnr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AAM,uBAAuB,CAAA;AACzE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC1E,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SentinelOrchestrator } from "./core/orchestrator";
|
|
2
|
+
const orchestrator = new SentinelOrchestrator();
|
|
3
|
+
export async function runAudit(scope) {
|
|
4
|
+
console.log(`\n🔍 Sentinel Security Platform — Auditoría iniciada`);
|
|
5
|
+
console.log(` Target: ${scope.target}`);
|
|
6
|
+
console.log(` Type: ${scope.targetType}`);
|
|
7
|
+
if (scope.description)
|
|
8
|
+
console.log(` Scope: ${scope.description}`);
|
|
9
|
+
console.log();
|
|
10
|
+
const plan = await orchestrator.runAudit(scope);
|
|
11
|
+
console.log(`\n📋 Plan de auditoría completado`);
|
|
12
|
+
console.log(` ID: ${plan.id}`);
|
|
13
|
+
console.log(` Status: ${plan.status}`);
|
|
14
|
+
console.log(` Fases: ${plan.phases.length}`);
|
|
15
|
+
for (const phase of plan.phases) {
|
|
16
|
+
const icon = phase.status === "completed" ? "✅" : phase.status === "failed" ? "❌" : "⏳";
|
|
17
|
+
console.log(` ${icon} ${phase.name} (${phase.agent})`);
|
|
18
|
+
}
|
|
19
|
+
console.log(`\n📊 Hallazgos: ${plan.findings.length}`);
|
|
20
|
+
if (plan.findings.length > 0) {
|
|
21
|
+
for (const finding of plan.findings) {
|
|
22
|
+
console.log(` [${finding.severity.toUpperCase()}] ${finding.title}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export { SentinelOrchestrator } from "./core/orchestrator";
|
|
27
|
+
export { EventBus } from "./core/event-bus";
|
|
28
|
+
export { ProviderAbstraction } from "./core/provider-abstraction";
|
|
29
|
+
export { MemoryManager } from "./core/memory-manager";
|
|
30
|
+
export { InterAgentCommunication } from "./core/inter-agent-communication";
|
|
31
|
+
export { ContextCompression } from "./core/context-compression";
|
|
32
|
+
export { CorrelationEngine } from "./core/correlation-engine";
|
|
33
|
+
export { EvidenceManager } from "./core/evidence-manager";
|
|
34
|
+
export { RiskAnalysis } from "./core/risk-analysis";
|
|
35
|
+
export { PluginManager } from "./core/plugin-manager";
|
|
36
|
+
export { ReportGenerator } from "./core/report-generator";
|
|
37
|
+
export { KnowledgeBase } from "./core/knowledge-base";
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAmB,MAAM,qBAAqB,CAAA;AAE3E,MAAM,YAAY,GAAG,IAAI,oBAAoB,EAAE,CAAA;AAE/C,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,KAAiB;IAC9C,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAA;IACnE,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;IACzC,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,UAAU,EAAE,CAAC,CAAA;IAC7C,IAAI,KAAK,CAAC,WAAW;QAAE,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA;IACrE,OAAO,CAAC,GAAG,EAAE,CAAA;IAEb,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE/C,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAA;IAChD,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;IACpC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IACxC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,C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aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface AgentContext {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
status: "idle" | "busy" | "error" | "offline";
|
|
5
|
+
capabilities: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface Finding {
|
|
8
|
+
id: string;
|
|
9
|
+
agent: string;
|
|
10
|
+
type: string;
|
|
11
|
+
severity: "critical" | "high" | "medium" | "low" | "info";
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
evidence: EvidenceRef[];
|
|
15
|
+
cvss?: number;
|
|
16
|
+
cve?: string;
|
|
17
|
+
cwe?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface EvidenceRef {
|
|
20
|
+
id: string;
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/types/agent.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;IAC7C,YAAY,EAAE,MAAM,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAA;IACzD,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,WAAW,EAAE,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/types/agent.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Priority = "low" | "normal" | "high" | "critical";
|
|
2
|
+
export interface SentinelEvent<T = unknown> {
|
|
3
|
+
id: string;
|
|
4
|
+
timestamp: string;
|
|
5
|
+
type: string;
|
|
6
|
+
source: string;
|
|
7
|
+
target: string;
|
|
8
|
+
priority: Priority;
|
|
9
|
+
payload: T;
|
|
10
|
+
}
|
|
11
|
+
export type EventHandler<T = unknown> = (event: SentinelEvent<T>) => void | Promise<void>;
|
|
12
|
+
export type Unsubscribe = () => void;
|
|
13
|
+
export declare function uuid(): string;
|
|
14
|
+
//# sourceMappingURL=event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/types/event.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAA;AAE7D,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,OAAO;IACxC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,QAAQ,CAAA;IAClB,OAAO,EAAE,CAAC,CAAA;CACX;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAEzF,MAAM,MAAM,WAAW,GAAG,MAAM,IAAI,CAAA;AAEpC,wBAAgB,IAAI,IAAI,MAAM,CAM7B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function uuid() {
|
|
2
|
+
if (typeof crypto !== "undefined" && crypto.randomUUID)
|
|
3
|
+
return crypto.randomUUID();
|
|
4
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
5
|
+
const r = (Math.random() * 16) | 0;
|
|
6
|
+
return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/types/event.ts"],"names":[],"mappings":"AAgBA,MAAM,UAAU,IAAI;IAClB,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,UAAU;QAAE,OAAO,MAAM,CAAC,UAAU,EAAE,CAAA;IAClF,OAAO,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;QACnE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;QAClC,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IACvD,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
+
"name": "@phosphor-dom/sentinel-ai",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "Sentinel Security Platform — AI-powered multi-agent security engineering framework",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"private": false,
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/anomalyco/opencode"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"security",
|
|
15
|
+
"audit",
|
|
16
|
+
"penetration-testing",
|
|
17
|
+
"vulnerability-scanner",
|
|
18
|
+
"cve",
|
|
19
|
+
"owasp",
|
|
20
|
+
"multi-agent",
|
|
21
|
+
"ai-security"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc",
|
|
25
|
+
"typecheck": "tsc --noEmit"
|
|
26
|
+
},
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./dist/index.js",
|
|
31
|
+
"./core/*": "./dist/core/*.js",
|
|
32
|
+
"./types/*": "./dist/types/*.js"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist/",
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE"
|
|
38
|
+
],
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"typescript": "^5.6.0"
|
|
41
|
+
}
|
|
42
|
+
}
|