webmcp-cli 1.0.0 → 1.2.1
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/dist/agent/features/agent-simulator.d.ts +67 -0
- package/dist/agent/features/agent-simulator.js +368 -0
- package/dist/agent/features/agent-simulator.js.map +1 -0
- package/dist/agent/features/index.d.ts +8 -0
- package/dist/agent/features/index.js +9 -0
- package/dist/agent/features/index.js.map +1 -0
- package/dist/agent/features/simulation-judge.d.ts +78 -0
- package/dist/agent/features/simulation-judge.js +276 -0
- package/dist/agent/features/simulation-judge.js.map +1 -0
- package/dist/agent/features/test-case-generator.d.ts +35 -0
- package/dist/agent/features/test-case-generator.js +257 -0
- package/dist/agent/features/test-case-generator.js.map +1 -0
- package/dist/agent/index.d.ts +7 -0
- package/dist/agent/index.js +10 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/llm-client.d.ts +76 -0
- package/dist/agent/llm-client.js +198 -0
- package/dist/agent/llm-client.js.map +1 -0
- package/dist/audit/run-single-page-audit.d.ts +41 -0
- package/dist/audit/run-single-page-audit.js +103 -0
- package/dist/audit/run-single-page-audit.js.map +1 -0
- package/dist/bin/webmcp.d.ts +5 -0
- package/dist/bin/webmcp.js +14 -0
- package/dist/bin/webmcp.js.map +1 -0
- package/dist/browser/audit-runner.d.ts +30 -0
- package/dist/browser/audit-runner.js +77 -0
- package/dist/browser/audit-runner.js.map +1 -0
- package/dist/browser/index.d.ts +6 -0
- package/dist/browser/index.js +7 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/interceptor.d.ts +68 -0
- package/dist/browser/interceptor.js +257 -0
- package/dist/browser/interceptor.js.map +1 -0
- package/dist/browser/playwright.d.ts +98 -0
- package/dist/browser/playwright.js +158 -0
- package/dist/browser/playwright.js.map +1 -0
- package/dist/cli/commands/audit.d.ts +12 -0
- package/dist/cli/commands/audit.js +349 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/interactive.d.ts +10 -0
- package/dist/cli/commands/interactive.js +34 -0
- package/dist/cli/commands/interactive.js.map +1 -0
- package/dist/cli/index.d.ts +17 -0
- package/dist/cli/index.js +84 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/options/parse-audit-options.d.ts +12 -0
- package/dist/cli/options/parse-audit-options.js +64 -0
- package/dist/cli/options/parse-audit-options.js.map +1 -0
- package/dist/core/constants.d.ts +102 -0
- package/dist/core/constants.js +214 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/types/audit.d.ts +260 -0
- package/dist/core/types/audit.js +5 -0
- package/dist/core/types/audit.js.map +1 -0
- package/dist/core/types/index.d.ts +6 -0
- package/dist/core/types/index.js +7 -0
- package/dist/core/types/index.js.map +1 -0
- package/dist/core/types/rule.d.ts +190 -0
- package/dist/core/types/rule.js +26 -0
- package/dist/core/types/rule.js.map +1 -0
- package/dist/core/types/tool.d.ts +312 -0
- package/dist/core/types/tool.js +6 -0
- package/dist/core/types/tool.js.map +1 -0
- package/dist/detection/declarative.d.ts +27 -0
- package/dist/detection/declarative.js +343 -0
- package/dist/detection/declarative.js.map +1 -0
- package/dist/detection/imperative.d.ts +38 -0
- package/dist/detection/imperative.js +99 -0
- package/dist/detection/imperative.js.map +1 -0
- package/dist/detection/index.d.ts +5 -0
- package/dist/detection/index.js +6 -0
- package/dist/detection/index.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/advice-service.d.ts +38 -0
- package/dist/llm/advice-service.js +243 -0
- package/dist/llm/advice-service.js.map +1 -0
- package/dist/llm/evaluator.d.ts +89 -0
- package/dist/llm/evaluator.js +274 -0
- package/dist/llm/evaluator.js.map +1 -0
- package/dist/llm/index.d.ts +11 -0
- package/dist/llm/index.js +15 -0
- package/dist/llm/index.js.map +1 -0
- package/dist/llm/json-response.d.ts +12 -0
- package/dist/llm/json-response.js +67 -0
- package/dist/llm/json-response.js.map +1 -0
- package/dist/llm/providers/mock.d.ts +29 -0
- package/dist/llm/providers/mock.js +324 -0
- package/dist/llm/providers/mock.js.map +1 -0
- package/dist/llm/providers/openrouter.d.ts +53 -0
- package/dist/llm/providers/openrouter.js +321 -0
- package/dist/llm/providers/openrouter.js.map +1 -0
- package/dist/llm/request-cache.d.ts +28 -0
- package/dist/llm/request-cache.js +99 -0
- package/dist/llm/request-cache.js.map +1 -0
- package/dist/llm/types.d.ts +233 -0
- package/dist/llm/types.js +7 -0
- package/dist/llm/types.js.map +1 -0
- package/dist/rules/best-practices/BP-001.d.ts +11 -0
- package/dist/rules/best-practices/BP-001.js +56 -0
- package/dist/rules/best-practices/BP-001.js.map +1 -0
- package/dist/rules/best-practices/BP-002.d.ts +11 -0
- package/dist/rules/best-practices/BP-002.js +63 -0
- package/dist/rules/best-practices/BP-002.js.map +1 -0
- package/dist/rules/best-practices/BP-003.d.ts +11 -0
- package/dist/rules/best-practices/BP-003.js +68 -0
- package/dist/rules/best-practices/BP-003.js.map +1 -0
- package/dist/rules/coverage/COV-001.d.ts +8 -0
- package/dist/rules/coverage/COV-001.js +51 -0
- package/dist/rules/coverage/COV-001.js.map +1 -0
- package/dist/rules/description/DESC-003.d.ts +13 -0
- package/dist/rules/description/DESC-003.js +96 -0
- package/dist/rules/description/DESC-003.js.map +1 -0
- package/dist/rules/description/DESC-004.d.ts +8 -0
- package/dist/rules/description/DESC-004.js +61 -0
- package/dist/rules/description/DESC-004.js.map +1 -0
- package/dist/rules/description/DESC-005.d.ts +12 -0
- package/dist/rules/description/DESC-005.js +70 -0
- package/dist/rules/description/DESC-005.js.map +1 -0
- package/dist/rules/description/index.d.ts +4 -0
- package/dist/rules/description/index.js +5 -0
- package/dist/rules/description/index.js.map +1 -0
- package/dist/rules/implementation/IMP-001.d.ts +10 -0
- package/dist/rules/implementation/IMP-001.js +36 -0
- package/dist/rules/implementation/IMP-001.js.map +1 -0
- package/dist/rules/implementation/IMP-003.d.ts +9 -0
- package/dist/rules/implementation/IMP-003.js +45 -0
- package/dist/rules/implementation/IMP-003.js.map +1 -0
- package/dist/rules/implementation/IMP-004.d.ts +9 -0
- package/dist/rules/implementation/IMP-004.js +48 -0
- package/dist/rules/implementation/IMP-004.js.map +1 -0
- package/dist/rules/implementation/IMP-005.d.ts +9 -0
- package/dist/rules/implementation/IMP-005.js +54 -0
- package/dist/rules/implementation/IMP-005.js.map +1 -0
- package/dist/rules/implementation/IMP-007.d.ts +8 -0
- package/dist/rules/implementation/IMP-007.js +79 -0
- package/dist/rules/implementation/IMP-007.js.map +1 -0
- package/dist/rules/implementation/IMP-013.d.ts +9 -0
- package/dist/rules/implementation/IMP-013.js +55 -0
- package/dist/rules/implementation/IMP-013.js.map +1 -0
- package/dist/rules/implementation/index.d.ts +9 -0
- package/dist/rules/implementation/index.js +10 -0
- package/dist/rules/implementation/index.js.map +1 -0
- package/dist/rules/index.d.ts +51 -0
- package/dist/rules/index.js +100 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/llm/LLM-001.d.ts +14 -0
- package/dist/rules/llm/LLM-001.js +78 -0
- package/dist/rules/llm/LLM-001.js.map +1 -0
- package/dist/rules/llm/LLM-002.d.ts +14 -0
- package/dist/rules/llm/LLM-002.js +77 -0
- package/dist/rules/llm/LLM-002.js.map +1 -0
- package/dist/rules/llm/LLM-003.d.ts +16 -0
- package/dist/rules/llm/LLM-003.js +82 -0
- package/dist/rules/llm/LLM-003.js.map +1 -0
- package/dist/rules/llm/LLM-004.d.ts +14 -0
- package/dist/rules/llm/LLM-004.js +87 -0
- package/dist/rules/llm/LLM-004.js.map +1 -0
- package/dist/rules/llm/LLM-005.d.ts +16 -0
- package/dist/rules/llm/LLM-005.js +105 -0
- package/dist/rules/llm/LLM-005.js.map +1 -0
- package/dist/rules/llm/index.d.ts +10 -0
- package/dist/rules/llm/index.js +11 -0
- package/dist/rules/llm/index.js.map +1 -0
- package/dist/rules/runner.d.ts +54 -0
- package/dist/rules/runner.js +138 -0
- package/dist/rules/runner.js.map +1 -0
- package/dist/rules/schema/SCHEMA-001.d.ts +9 -0
- package/dist/rules/schema/SCHEMA-001.js +57 -0
- package/dist/rules/schema/SCHEMA-001.js.map +1 -0
- package/dist/rules/schema/SCHEMA-002.d.ts +9 -0
- package/dist/rules/schema/SCHEMA-002.js +59 -0
- package/dist/rules/schema/SCHEMA-002.js.map +1 -0
- package/dist/rules/schema/SCHEMA-003.d.ts +10 -0
- package/dist/rules/schema/SCHEMA-003.js +66 -0
- package/dist/rules/schema/SCHEMA-003.js.map +1 -0
- package/dist/rules/schema/SCHEMA-011.d.ts +10 -0
- package/dist/rules/schema/SCHEMA-011.js +62 -0
- package/dist/rules/schema/SCHEMA-011.js.map +1 -0
- package/dist/rules/security/SEC-001.d.ts +12 -0
- package/dist/rules/security/SEC-001.js +66 -0
- package/dist/rules/security/SEC-001.js.map +1 -0
- package/dist/rules/utils/keywords.d.ts +35 -0
- package/dist/rules/utils/keywords.js +100 -0
- package/dist/rules/utils/keywords.js.map +1 -0
- package/dist/scoring/calculator.d.ts +27 -0
- package/dist/scoring/calculator.js +194 -0
- package/dist/scoring/calculator.js.map +1 -0
- package/dist/scoring/grades.d.ts +34 -0
- package/dist/scoring/grades.js +167 -0
- package/dist/scoring/grades.js.map +1 -0
- package/dist/scoring/index.d.ts +5 -0
- package/dist/scoring/index.js +6 -0
- package/dist/scoring/index.js.map +1 -0
- package/dist/ui/banner.d.ts +21 -0
- package/dist/ui/banner.js +60 -0
- package/dist/ui/banner.js.map +1 -0
- package/dist/ui/design-tokens.d.ts +23 -0
- package/dist/ui/design-tokens.js +58 -0
- package/dist/ui/design-tokens.js.map +1 -0
- package/dist/ui/findings.d.ts +23 -0
- package/dist/ui/findings.js +190 -0
- package/dist/ui/findings.js.map +1 -0
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.js +10 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/ink/App.d.ts +14 -0
- package/dist/ui/ink/App.js +113 -0
- package/dist/ui/ink/App.js.map +1 -0
- package/dist/ui/ink/FullScreenLayout.d.ts +16 -0
- package/dist/ui/ink/FullScreenLayout.js +29 -0
- package/dist/ui/ink/FullScreenLayout.js.map +1 -0
- package/dist/ui/ink/InteractiveApp.d.ts +28 -0
- package/dist/ui/ink/InteractiveApp.js +229 -0
- package/dist/ui/ink/InteractiveApp.js.map +1 -0
- package/dist/ui/ink/RealAuditApp.d.ts +19 -0
- package/dist/ui/ink/RealAuditApp.js +170 -0
- package/dist/ui/ink/RealAuditApp.js.map +1 -0
- package/dist/ui/ink/components/AnimatedProgressBar.d.ts +20 -0
- package/dist/ui/ink/components/AnimatedProgressBar.js +46 -0
- package/dist/ui/ink/components/AnimatedProgressBar.js.map +1 -0
- package/dist/ui/ink/components/AsciiLogo.d.ts +12 -0
- package/dist/ui/ink/components/AsciiLogo.js +35 -0
- package/dist/ui/ink/components/AsciiLogo.js.map +1 -0
- package/dist/ui/ink/components/CategoryBars.d.ts +18 -0
- package/dist/ui/ink/components/CategoryBars.js +18 -0
- package/dist/ui/ink/components/CategoryBars.js.map +1 -0
- package/dist/ui/ink/components/FindingsTable.d.ts +18 -0
- package/dist/ui/ink/components/FindingsTable.js +19 -0
- package/dist/ui/ink/components/FindingsTable.js.map +1 -0
- package/dist/ui/ink/components/Footer.d.ts +15 -0
- package/dist/ui/ink/components/Footer.js +20 -0
- package/dist/ui/ink/components/Footer.js.map +1 -0
- package/dist/ui/ink/components/Header.d.ts +11 -0
- package/dist/ui/ink/components/Header.js +12 -0
- package/dist/ui/ink/components/Header.js.map +1 -0
- package/dist/ui/ink/components/LinkList.d.ts +17 -0
- package/dist/ui/ink/components/LinkList.js +44 -0
- package/dist/ui/ink/components/LinkList.js.map +1 -0
- package/dist/ui/ink/components/Navigation.d.ts +26 -0
- package/dist/ui/ink/components/Navigation.js +62 -0
- package/dist/ui/ink/components/Navigation.js.map +1 -0
- package/dist/ui/ink/components/ProgressBar.d.ts +15 -0
- package/dist/ui/ink/components/ProgressBar.js +14 -0
- package/dist/ui/ink/components/ProgressBar.js.map +1 -0
- package/dist/ui/ink/components/ScoreCard.d.ts +30 -0
- package/dist/ui/ink/components/ScoreCard.js +26 -0
- package/dist/ui/ink/components/ScoreCard.js.map +1 -0
- package/dist/ui/ink/components/SimulationResults.d.ts +33 -0
- package/dist/ui/ink/components/SimulationResults.js +23 -0
- package/dist/ui/ink/components/SimulationResults.js.map +1 -0
- package/dist/ui/ink/components/Spinner.d.ts +11 -0
- package/dist/ui/ink/components/Spinner.js +12 -0
- package/dist/ui/ink/components/Spinner.js.map +1 -0
- package/dist/ui/ink/components/ToolCard.d.ts +23 -0
- package/dist/ui/ink/components/ToolCard.js +20 -0
- package/dist/ui/ink/components/ToolCard.js.map +1 -0
- package/dist/ui/ink/components/shared/Badge.d.ts +21 -0
- package/dist/ui/ink/components/shared/Badge.js +39 -0
- package/dist/ui/ink/components/shared/Badge.js.map +1 -0
- package/dist/ui/ink/components/shared/Card.d.ts +18 -0
- package/dist/ui/ink/components/shared/Card.js +11 -0
- package/dist/ui/ink/components/shared/Card.js.map +1 -0
- package/dist/ui/ink/components/shared/HelpOverlay.d.ts +10 -0
- package/dist/ui/ink/components/shared/HelpOverlay.js +28 -0
- package/dist/ui/ink/components/shared/HelpOverlay.js.map +1 -0
- package/dist/ui/ink/components/shared/LoadingWithTimeout.d.ts +11 -0
- package/dist/ui/ink/components/shared/LoadingWithTimeout.js +21 -0
- package/dist/ui/ink/components/shared/LoadingWithTimeout.js.map +1 -0
- package/dist/ui/ink/components/shared/Menu.d.ts +23 -0
- package/dist/ui/ink/components/shared/Menu.js +43 -0
- package/dist/ui/ink/components/shared/Menu.js.map +1 -0
- package/dist/ui/ink/components/shared/Table.d.ts +23 -0
- package/dist/ui/ink/components/shared/Table.js +40 -0
- package/dist/ui/ink/components/shared/Table.js.map +1 -0
- package/dist/ui/ink/components/views/CrawlingView.d.ts +12 -0
- package/dist/ui/ink/components/views/CrawlingView.js +34 -0
- package/dist/ui/ink/components/views/CrawlingView.js.map +1 -0
- package/dist/ui/ink/components/views/DashboardView.d.ts +21 -0
- package/dist/ui/ink/components/views/DashboardView.js +51 -0
- package/dist/ui/ink/components/views/DashboardView.js.map +1 -0
- package/dist/ui/ink/components/views/FindingDetailView.d.ts +16 -0
- package/dist/ui/ink/components/views/FindingDetailView.js +34 -0
- package/dist/ui/ink/components/views/FindingDetailView.js.map +1 -0
- package/dist/ui/ink/components/views/FindingsView.d.ts +16 -0
- package/dist/ui/ink/components/views/FindingsView.js +79 -0
- package/dist/ui/ink/components/views/FindingsView.js.map +1 -0
- package/dist/ui/ink/components/views/OnboardingView.d.ts +12 -0
- package/dist/ui/ink/components/views/OnboardingView.js +40 -0
- package/dist/ui/ink/components/views/OnboardingView.js.map +1 -0
- package/dist/ui/ink/components/views/SimulationView.d.ts +17 -0
- package/dist/ui/ink/components/views/SimulationView.js +53 -0
- package/dist/ui/ink/components/views/SimulationView.js.map +1 -0
- package/dist/ui/ink/components/views/TestCaseDetailView.d.ts +11 -0
- package/dist/ui/ink/components/views/TestCaseDetailView.js +53 -0
- package/dist/ui/ink/components/views/TestCaseDetailView.js.map +1 -0
- package/dist/ui/ink/components/views/ToolDetailView.d.ts +15 -0
- package/dist/ui/ink/components/views/ToolDetailView.js +25 -0
- package/dist/ui/ink/components/views/ToolDetailView.js.map +1 -0
- package/dist/ui/ink/components/views/ToolsView.d.ts +15 -0
- package/dist/ui/ink/components/views/ToolsView.js +43 -0
- package/dist/ui/ink/components/views/ToolsView.js.map +1 -0
- package/dist/ui/ink/demo.d.ts +6 -0
- package/dist/ui/ink/demo.js +254 -0
- package/dist/ui/ink/demo.js.map +1 -0
- package/dist/ui/ink/hooks/useAnimation.d.ts +29 -0
- package/dist/ui/ink/hooks/useAnimation.js +89 -0
- package/dist/ui/ink/hooks/useAnimation.js.map +1 -0
- package/dist/ui/ink/hooks/useAudit.d.ts +69 -0
- package/dist/ui/ink/hooks/useAudit.js +99 -0
- package/dist/ui/ink/hooks/useAudit.js.map +1 -0
- package/dist/ui/ink/hooks/useCrawlAnimation.d.ts +19 -0
- package/dist/ui/ink/hooks/useCrawlAnimation.js +204 -0
- package/dist/ui/ink/hooks/useCrawlAnimation.js.map +1 -0
- package/dist/ui/ink/hooks/useKeyboardNav.d.ts +23 -0
- package/dist/ui/ink/hooks/useKeyboardNav.js +81 -0
- package/dist/ui/ink/hooks/useKeyboardNav.js.map +1 -0
- package/dist/ui/ink/hooks/useNavigation.d.ts +16 -0
- package/dist/ui/ink/hooks/useNavigation.js +42 -0
- package/dist/ui/ink/hooks/useNavigation.js.map +1 -0
- package/dist/ui/ink/hooks/useTerminalSize.d.ts +10 -0
- package/dist/ui/ink/hooks/useTerminalSize.js +29 -0
- package/dist/ui/ink/hooks/useTerminalSize.js.map +1 -0
- package/dist/ui/ink/index.d.ts +43 -0
- package/dist/ui/ink/index.js +50 -0
- package/dist/ui/ink/index.js.map +1 -0
- package/dist/ui/ink/render.d.ts +24 -0
- package/dist/ui/ink/render.js +14 -0
- package/dist/ui/ink/render.js.map +1 -0
- package/dist/ui/ink/theme.d.ts +37 -0
- package/dist/ui/ink/theme.js +38 -0
- package/dist/ui/ink/theme.js.map +1 -0
- package/dist/ui/ink/types.d.ts +77 -0
- package/dist/ui/ink/types.js +5 -0
- package/dist/ui/ink/types.js.map +1 -0
- package/dist/ui/score-display.d.ts +16 -0
- package/dist/ui/score-display.js +201 -0
- package/dist/ui/score-display.js.map +1 -0
- package/dist/ui/spinner.d.ts +45 -0
- package/dist/ui/spinner.js +112 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/utils.d.ts +13 -0
- package/dist/ui/utils.js +25 -0
- package/dist/ui/utils.js.map +1 -0
- package/package.json +61 -9
- package/index.js +0 -105
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SEC-001: Destructive Actions Flagged
|
|
3
|
+
*
|
|
4
|
+
* CRITICAL security rule that checks if tools with critical
|
|
5
|
+
* destructive operations have either destructiveHint OR
|
|
6
|
+
* requiresConfirmation set.
|
|
7
|
+
*
|
|
8
|
+
* Critical operations include: delete, destroy, purchase, pay, transfer, etc.
|
|
9
|
+
*/
|
|
10
|
+
import type { Rule } from '../../core/types/rule.js';
|
|
11
|
+
export declare const SEC_001: Rule;
|
|
12
|
+
export default SEC_001;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SEC-001: Destructive Actions Flagged
|
|
3
|
+
*
|
|
4
|
+
* CRITICAL security rule that checks if tools with critical
|
|
5
|
+
* destructive operations have either destructiveHint OR
|
|
6
|
+
* requiresConfirmation set.
|
|
7
|
+
*
|
|
8
|
+
* Critical operations include: delete, destroy, purchase, pay, transfer, etc.
|
|
9
|
+
*/
|
|
10
|
+
import { createRuleResult } from '../runner.js';
|
|
11
|
+
import { CRITICAL_DESTRUCTIVE_KEYWORDS, hasKeyword, findMatchedKeywords, } from '../utils/keywords.js';
|
|
12
|
+
export const SEC_001 = {
|
|
13
|
+
id: 'SEC-001',
|
|
14
|
+
category: 'security',
|
|
15
|
+
name: 'Destructive Actions Flagged',
|
|
16
|
+
description: 'Critical destructive operations must have destructiveHint or requiresConfirmation',
|
|
17
|
+
severity: 'critical',
|
|
18
|
+
maxScore: 15,
|
|
19
|
+
async check(context) {
|
|
20
|
+
const tools = context.tools;
|
|
21
|
+
if (tools.length === 0) {
|
|
22
|
+
return createRuleResult('SEC-001', 15, {
|
|
23
|
+
passed: true,
|
|
24
|
+
score: 15,
|
|
25
|
+
message: 'No tools detected (rule not applicable)',
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const violations = [];
|
|
29
|
+
for (const tool of tools) {
|
|
30
|
+
const textToSearch = `${tool.name} ${tool.description}`;
|
|
31
|
+
if (hasKeyword(textToSearch, CRITICAL_DESTRUCTIVE_KEYWORDS)) {
|
|
32
|
+
// Check if either destructiveHint OR requiresConfirmation is set
|
|
33
|
+
const hasDestructiveHint = tool.annotations?.destructiveHint === true;
|
|
34
|
+
const hasRequiresConfirmation = tool.annotations?.requiresConfirmation === true;
|
|
35
|
+
if (!hasDestructiveHint && !hasRequiresConfirmation) {
|
|
36
|
+
const matchedKeywords = findMatchedKeywords(textToSearch, CRITICAL_DESTRUCTIVE_KEYWORDS);
|
|
37
|
+
violations.push({ name: tool.name, keywords: matchedKeywords });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (violations.length === 0) {
|
|
42
|
+
return createRuleResult('SEC-001', 15, {
|
|
43
|
+
passed: true,
|
|
44
|
+
score: 15,
|
|
45
|
+
message: 'All critical destructive tools are properly flagged',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// Deduct 5 points per violation (critical security issue)
|
|
49
|
+
const penalty = violations.length * 5;
|
|
50
|
+
const score = Math.max(0, 15 - penalty);
|
|
51
|
+
return createRuleResult('SEC-001', 15, {
|
|
52
|
+
passed: false,
|
|
53
|
+
score,
|
|
54
|
+
message: `${violations.length} critical tool(s) missing security annotations`,
|
|
55
|
+
details: violations.map((v) => `CRITICAL: Tool "${v.name}" contains [${v.keywords.join(', ')}] but lacks destructiveHint or requiresConfirmation`),
|
|
56
|
+
suggestions: [
|
|
57
|
+
'Add destructiveHint: true OR requiresConfirmation: true for critical operations',
|
|
58
|
+
'These annotations help agents understand the impact of tool execution',
|
|
59
|
+
'Example: { annotations: { destructiveHint: true, requiresConfirmation: true } }',
|
|
60
|
+
],
|
|
61
|
+
affectedTools: violations.map((v) => v.name),
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
export default SEC_001;
|
|
66
|
+
//# sourceMappingURL=SEC-001.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SEC-001.js","sourceRoot":"","sources":["../../../src/rules/security/SEC-001.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,6BAA6B,EAC7B,UAAU,EACV,mB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KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,gBAAgB,CAAC,SAAS,EAAE,EAAE,EAAE;gBACrC,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,EAAE;gBACT,OAAO,EAAE,qDAAqD;aAC/D,CAAC,CAAC;QACL,CAAC;QAED,0DAA0D;QAC1D,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,CAAC;QAExC,OAAO,gBAAgB,CAAC,SAAS,EAAE,EAAE,EAAE;YACrC,MAAM,EAAE,KAAK;YACb,KAAK;YACL,OAAO,EAAE,GAAG,UAAU,CAAC,MAAM,gDAAgD;YAC7E,OAAO,EAAE,UAAU,CAAC,GAAG,CACrB,CAAC,CAAC,EAAE,EAAE,CACJ,mBAAmB,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,qDAAqD,CACrH;YACD,WAAW,EAAE;gBACX,iFAAiF;gBACjF,uEAAuE;gBACvE,iFAAiF;aAClF;YACD,aAAa,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;SAC7C,CAAC,CAAC;IACL,CAAC;CACF,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyword utilities for rule analysis
|
|
3
|
+
*
|
|
4
|
+
* Shared keyword lists and matching utilities used by
|
|
5
|
+
* best-practices and security rules.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Keywords that suggest destructive operations
|
|
9
|
+
* Used by BP-002 to check if destructiveHint should be set
|
|
10
|
+
*/
|
|
11
|
+
export declare const DESTRUCTIVE_KEYWORDS: string[];
|
|
12
|
+
/**
|
|
13
|
+
* Critical destructive keywords that MUST have destructiveHint or requiresConfirmation
|
|
14
|
+
* Used by SEC-001 for security enforcement
|
|
15
|
+
*/
|
|
16
|
+
export declare const CRITICAL_DESTRUCTIVE_KEYWORDS: string[];
|
|
17
|
+
/**
|
|
18
|
+
* Keywords that suggest read-only operations
|
|
19
|
+
* Used by BP-003 to check if readOnlyHint should be set
|
|
20
|
+
*/
|
|
21
|
+
export declare const READONLY_KEYWORDS: string[];
|
|
22
|
+
/**
|
|
23
|
+
* Check if text contains any of the given keywords
|
|
24
|
+
* @param text - Text to search in (name or description)
|
|
25
|
+
* @param keywords - List of keywords to search for
|
|
26
|
+
* @returns true if any keyword is found
|
|
27
|
+
*/
|
|
28
|
+
export declare function hasKeyword(text: string, keywords: string[]): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Find all matching keywords in the text
|
|
31
|
+
* @param text - Text to search in (name or description)
|
|
32
|
+
* @param keywords - List of keywords to search for
|
|
33
|
+
* @returns Array of matched keywords
|
|
34
|
+
*/
|
|
35
|
+
export declare function findMatchedKeywords(text: string, keywords: string[]): string[];
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyword utilities for rule analysis
|
|
3
|
+
*
|
|
4
|
+
* Shared keyword lists and matching utilities used by
|
|
5
|
+
* best-practices and security rules.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Keywords that suggest destructive operations
|
|
9
|
+
* Used by BP-002 to check if destructiveHint should be set
|
|
10
|
+
*/
|
|
11
|
+
export const DESTRUCTIVE_KEYWORDS = [
|
|
12
|
+
'delete',
|
|
13
|
+
'remove',
|
|
14
|
+
'destroy',
|
|
15
|
+
'drop',
|
|
16
|
+
'truncate',
|
|
17
|
+
'purchase',
|
|
18
|
+
'buy',
|
|
19
|
+
'order',
|
|
20
|
+
'checkout',
|
|
21
|
+
'pay',
|
|
22
|
+
'cancel',
|
|
23
|
+
'terminate',
|
|
24
|
+
'revoke',
|
|
25
|
+
'disable',
|
|
26
|
+
'wipe',
|
|
27
|
+
'clear',
|
|
28
|
+
'reset',
|
|
29
|
+
'unsubscribe',
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Critical destructive keywords that MUST have destructiveHint or requiresConfirmation
|
|
33
|
+
* Used by SEC-001 for security enforcement
|
|
34
|
+
*/
|
|
35
|
+
export const CRITICAL_DESTRUCTIVE_KEYWORDS = [
|
|
36
|
+
'delete',
|
|
37
|
+
'remove',
|
|
38
|
+
'destroy',
|
|
39
|
+
'drop',
|
|
40
|
+
'wipe',
|
|
41
|
+
'purchase',
|
|
42
|
+
'buy',
|
|
43
|
+
'checkout',
|
|
44
|
+
'pay',
|
|
45
|
+
'transfer',
|
|
46
|
+
'cancel',
|
|
47
|
+
'terminate',
|
|
48
|
+
'revoke',
|
|
49
|
+
'ban',
|
|
50
|
+
'deactivate',
|
|
51
|
+
];
|
|
52
|
+
/**
|
|
53
|
+
* Keywords that suggest read-only operations
|
|
54
|
+
* Used by BP-003 to check if readOnlyHint should be set
|
|
55
|
+
*/
|
|
56
|
+
export const READONLY_KEYWORDS = [
|
|
57
|
+
'get',
|
|
58
|
+
'fetch',
|
|
59
|
+
'read',
|
|
60
|
+
'retrieve',
|
|
61
|
+
'load',
|
|
62
|
+
'search',
|
|
63
|
+
'find',
|
|
64
|
+
'lookup',
|
|
65
|
+
'query',
|
|
66
|
+
'browse',
|
|
67
|
+
'list',
|
|
68
|
+
'show',
|
|
69
|
+
'display',
|
|
70
|
+
'view',
|
|
71
|
+
'check',
|
|
72
|
+
];
|
|
73
|
+
/**
|
|
74
|
+
* Check if text contains any of the given keywords
|
|
75
|
+
* @param text - Text to search in (name or description)
|
|
76
|
+
* @param keywords - List of keywords to search for
|
|
77
|
+
* @returns true if any keyword is found
|
|
78
|
+
*/
|
|
79
|
+
export function hasKeyword(text, keywords) {
|
|
80
|
+
const lowerText = text.toLowerCase();
|
|
81
|
+
return keywords.some((keyword) => {
|
|
82
|
+
// Match as whole word or at word boundaries
|
|
83
|
+
const regex = new RegExp(`\\b${keyword}\\b`, 'i');
|
|
84
|
+
return regex.test(lowerText);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Find all matching keywords in the text
|
|
89
|
+
* @param text - Text to search in (name or description)
|
|
90
|
+
* @param keywords - List of keywords to search for
|
|
91
|
+
* @returns Array of matched keywords
|
|
92
|
+
*/
|
|
93
|
+
export function findMatchedKeywords(text, keywords) {
|
|
94
|
+
const lowerText = text.toLowerCase();
|
|
95
|
+
return keywords.filter((keyword) => {
|
|
96
|
+
const regex = new RegExp(`\\b${keyword}\\b`, 'i');
|
|
97
|
+
return regex.test(lowerText);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=keywords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keywords.js","sourceRoot":"","sources":["../../../src/rules/utils/keywords.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,MAAM;IACN,UAAU;IACV,UAAU;IACV,KAAK;IACL,OAAO;IACP,UAAU;IACV,KAAK;IACL,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,SAAS;IACT,MAAM;IACN,OAAO;IACP,OAAO;IACP,aAAa;CACd,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,MAAM;IACN,MAAM;IACN,UAAU;IACV,KAAK;IACL,UAAU;IACV,KAAK;IACL,UAAU;IACV,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,KAAK;IACL,YAAY;CACb,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK;IACL,OAAO;IACP,MAAM;IACN,UAAU;IACV,MAAM;IACN,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;IACN,MAAM;IACN,SAAS;IACT,MAAM;IACN,OAAO;CACR,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,QAAkB;IACzD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACrC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;QAC/B,4CAA4C;QAC5C,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,OAAO,KAAK,EAAE,GAAG,CAAC,CAAC;QAClD,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY,EAAE,QAAkB;IAClE,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACrC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;QACjC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,OAAO,KAAK,EAAE,GAAG,CAAC,CAAC;QAClD,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Score Calculator
|
|
3
|
+
*
|
|
4
|
+
* Aggregates rule results into a final score and grade.
|
|
5
|
+
*/
|
|
6
|
+
import type { RuleResult, RuleCategory, Finding } from '../core/types/rule.js';
|
|
7
|
+
import type { ScoreSummary, Grade, Recommendation } from '../core/types/audit.js';
|
|
8
|
+
/**
|
|
9
|
+
* Calculate the overall score from rule results
|
|
10
|
+
*/
|
|
11
|
+
export declare function calculateScore(ruleResults: Map<string, RuleResult>, ruleCategories: Map<string, RuleCategory>): ScoreSummary;
|
|
12
|
+
/**
|
|
13
|
+
* Calculate the letter grade from a numeric score
|
|
14
|
+
*/
|
|
15
|
+
export declare function calculateGrade(score: number): Grade;
|
|
16
|
+
/**
|
|
17
|
+
* Extract findings (issues) from rule results
|
|
18
|
+
*/
|
|
19
|
+
export declare function extractFindings(ruleResults: Map<string, RuleResult>, ruleSeverities: Map<string, 'critical' | 'warning' | 'info'>): Finding[];
|
|
20
|
+
/**
|
|
21
|
+
* Generate recommendations from findings
|
|
22
|
+
*/
|
|
23
|
+
export declare function generateRecommendations(findings: Finding[]): Recommendation[];
|
|
24
|
+
/**
|
|
25
|
+
* Calculate score impact of fixing a specific rule
|
|
26
|
+
*/
|
|
27
|
+
export declare function estimateScoreImpact(currentScore: number, ruleResult: RuleResult, categoryWeight: number): number;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Score Calculator
|
|
3
|
+
*
|
|
4
|
+
* Aggregates rule results into a final score and grade.
|
|
5
|
+
*/
|
|
6
|
+
import { CATEGORY_WEIGHTS, CATEGORY_NAMES } from '../core/types/rule.js';
|
|
7
|
+
import { GRADE_THRESHOLDS } from '../core/constants.js';
|
|
8
|
+
/**
|
|
9
|
+
* Calculate the overall score from rule results
|
|
10
|
+
*/
|
|
11
|
+
export function calculateScore(ruleResults, ruleCategories) {
|
|
12
|
+
// Group results by category
|
|
13
|
+
const categoryResults = {
|
|
14
|
+
implementation: [],
|
|
15
|
+
description: [],
|
|
16
|
+
schema: [],
|
|
17
|
+
security: [],
|
|
18
|
+
'best-practices': [],
|
|
19
|
+
coverage: [],
|
|
20
|
+
};
|
|
21
|
+
for (const [ruleId, result] of ruleResults) {
|
|
22
|
+
const category = ruleCategories.get(ruleId);
|
|
23
|
+
if (category) {
|
|
24
|
+
categoryResults[category].push(result);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// Calculate scores per category
|
|
28
|
+
const categories = [];
|
|
29
|
+
let totalWeightedScore = 0;
|
|
30
|
+
let totalWeight = 0;
|
|
31
|
+
for (const [categoryId, results] of Object.entries(categoryResults)) {
|
|
32
|
+
if (results.length === 0)
|
|
33
|
+
continue;
|
|
34
|
+
const earnedScore = results.reduce((sum, r) => sum + r.score, 0);
|
|
35
|
+
const maxScore = results.reduce((sum, r) => sum + r.maxScore, 0);
|
|
36
|
+
const percentage = maxScore > 0 ? (earnedScore / maxScore) * 100 : 100;
|
|
37
|
+
categories.push({
|
|
38
|
+
name: CATEGORY_NAMES[categoryId],
|
|
39
|
+
id: categoryId,
|
|
40
|
+
score: earnedScore,
|
|
41
|
+
maxScore,
|
|
42
|
+
percentage: Math.round(percentage),
|
|
43
|
+
});
|
|
44
|
+
const weight = CATEGORY_WEIGHTS[categoryId];
|
|
45
|
+
totalWeightedScore += percentage * weight;
|
|
46
|
+
totalWeight += weight;
|
|
47
|
+
}
|
|
48
|
+
// Calculate final score (0-100)
|
|
49
|
+
const total = totalWeight > 0 ? Math.round(totalWeightedScore / totalWeight) : 0;
|
|
50
|
+
// Determine grade
|
|
51
|
+
const grade = calculateGrade(total);
|
|
52
|
+
// Count issues by severity
|
|
53
|
+
const issueCount = {
|
|
54
|
+
critical: 0,
|
|
55
|
+
warning: 0,
|
|
56
|
+
info: 0,
|
|
57
|
+
};
|
|
58
|
+
for (const result of ruleResults.values()) {
|
|
59
|
+
if (!result.passed) {
|
|
60
|
+
// Infer severity from score impact
|
|
61
|
+
if (result.maxScore - result.score >= 10) {
|
|
62
|
+
issueCount.critical++;
|
|
63
|
+
}
|
|
64
|
+
else if (result.maxScore - result.score >= 3) {
|
|
65
|
+
issueCount.warning++;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
issueCount.info++;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
total,
|
|
74
|
+
grade,
|
|
75
|
+
categories,
|
|
76
|
+
issueCount,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Calculate the letter grade from a numeric score
|
|
81
|
+
*/
|
|
82
|
+
export function calculateGrade(score) {
|
|
83
|
+
if (score >= GRADE_THRESHOLDS['A+'])
|
|
84
|
+
return 'A+';
|
|
85
|
+
if (score >= GRADE_THRESHOLDS['A'])
|
|
86
|
+
return 'A';
|
|
87
|
+
if (score >= GRADE_THRESHOLDS['B+'])
|
|
88
|
+
return 'B+';
|
|
89
|
+
if (score >= GRADE_THRESHOLDS['B'])
|
|
90
|
+
return 'B';
|
|
91
|
+
if (score >= GRADE_THRESHOLDS['C+'])
|
|
92
|
+
return 'C+';
|
|
93
|
+
if (score >= GRADE_THRESHOLDS['C'])
|
|
94
|
+
return 'C';
|
|
95
|
+
if (score >= GRADE_THRESHOLDS['D'])
|
|
96
|
+
return 'D';
|
|
97
|
+
return 'F';
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Extract findings (issues) from rule results
|
|
101
|
+
*/
|
|
102
|
+
export function extractFindings(ruleResults, ruleSeverities) {
|
|
103
|
+
const findings = [];
|
|
104
|
+
for (const [ruleId, result] of ruleResults) {
|
|
105
|
+
if (result.passed)
|
|
106
|
+
continue;
|
|
107
|
+
const severity = ruleSeverities.get(ruleId) ?? 'warning';
|
|
108
|
+
const scoreImpact = result.maxScore - result.score;
|
|
109
|
+
// Create a finding for the main issue
|
|
110
|
+
findings.push({
|
|
111
|
+
ruleId,
|
|
112
|
+
severity,
|
|
113
|
+
message: result.message,
|
|
114
|
+
tool: result.affectedTools?.[0],
|
|
115
|
+
page: result.affectedPages?.[0],
|
|
116
|
+
fix: result.suggestions?.[0],
|
|
117
|
+
scoreImpact,
|
|
118
|
+
});
|
|
119
|
+
// Create additional findings for each affected tool
|
|
120
|
+
if (result.affectedTools && result.affectedTools.length > 1) {
|
|
121
|
+
for (const tool of result.affectedTools.slice(1)) {
|
|
122
|
+
findings.push({
|
|
123
|
+
ruleId,
|
|
124
|
+
severity,
|
|
125
|
+
message: result.message,
|
|
126
|
+
tool,
|
|
127
|
+
fix: result.suggestions?.[0],
|
|
128
|
+
scoreImpact: 0, // Only count once
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// Sort by severity (critical first) and then by score impact
|
|
134
|
+
const severityOrder = { critical: 0, warning: 1, info: 2 };
|
|
135
|
+
findings.sort((a, b) => {
|
|
136
|
+
const severityDiff = severityOrder[a.severity] - severityOrder[b.severity];
|
|
137
|
+
if (severityDiff !== 0)
|
|
138
|
+
return severityDiff;
|
|
139
|
+
return b.scoreImpact - a.scoreImpact;
|
|
140
|
+
});
|
|
141
|
+
return findings;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Generate recommendations from findings
|
|
145
|
+
*/
|
|
146
|
+
export function generateRecommendations(findings) {
|
|
147
|
+
const recommendations = [];
|
|
148
|
+
const seenRules = new Set();
|
|
149
|
+
for (const finding of findings) {
|
|
150
|
+
if (seenRules.has(finding.ruleId))
|
|
151
|
+
continue;
|
|
152
|
+
seenRules.add(finding.ruleId);
|
|
153
|
+
if (!finding.fix)
|
|
154
|
+
continue;
|
|
155
|
+
// Estimate effort based on severity and type
|
|
156
|
+
let effort = 'medium';
|
|
157
|
+
if (finding.scoreImpact <= 3)
|
|
158
|
+
effort = 'low';
|
|
159
|
+
if (finding.scoreImpact >= 10)
|
|
160
|
+
effort = 'high';
|
|
161
|
+
if (finding.ruleId.startsWith('SEC-'))
|
|
162
|
+
effort = 'high';
|
|
163
|
+
if (finding.ruleId.startsWith('DESC-'))
|
|
164
|
+
effort = 'low';
|
|
165
|
+
// Collect affected tools
|
|
166
|
+
const affectedTools = findings
|
|
167
|
+
.filter((f) => f.ruleId === finding.ruleId && f.tool)
|
|
168
|
+
.map((f) => f.tool);
|
|
169
|
+
recommendations.push({
|
|
170
|
+
priority: recommendations.length + 1,
|
|
171
|
+
action: finding.fix,
|
|
172
|
+
scoreImpact: finding.scoreImpact,
|
|
173
|
+
effort,
|
|
174
|
+
ruleId: finding.ruleId,
|
|
175
|
+
affectedTools: affectedTools.length > 0 ? affectedTools : undefined,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
// Sort by score impact (highest first)
|
|
179
|
+
recommendations.sort((a, b) => b.scoreImpact - a.scoreImpact);
|
|
180
|
+
// Reassign priorities after sorting
|
|
181
|
+
recommendations.forEach((rec, i) => {
|
|
182
|
+
rec.priority = i + 1;
|
|
183
|
+
});
|
|
184
|
+
return recommendations.slice(0, 10); // Return top 10
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Calculate score impact of fixing a specific rule
|
|
188
|
+
*/
|
|
189
|
+
export function estimateScoreImpact(currentScore, ruleResult, categoryWeight) {
|
|
190
|
+
const improvement = ruleResult.maxScore - ruleResult.score;
|
|
191
|
+
const percentageImprovement = improvement; // Assuming max score per rule is normalized
|
|
192
|
+
return Math.round((percentageImprovement * categoryWeight) / 100);
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=calculator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculator.js","sourceRoot":"","sources":["../../src/scoring/calculator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,WAAoC,EACpC,cAAyC;IAEzC,4BAA4B;IAC5B,MAAM,eAAe,GAAuC;QAC1D,cAAc,EAAE,EAAE;QAClB,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,gBAAgB,EAAE,EAAE;QACpB,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC5C,IA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AAU,CAAC,KAAK,CAAC;IAC3D,MAAM,qBAAqB,GAAG,WAAW,CAAC,CAAC,4CAA4C;IACvF,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,qBAAqB,GAAG,cAAc,CAAC,GAAG,GAAG,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grade Definitions and Display
|
|
3
|
+
*/
|
|
4
|
+
import type { Grade } from '../core/types/audit.js';
|
|
5
|
+
/**
|
|
6
|
+
* Grade metadata
|
|
7
|
+
*/
|
|
8
|
+
export interface GradeInfo {
|
|
9
|
+
letter: Grade;
|
|
10
|
+
label: string;
|
|
11
|
+
description: string;
|
|
12
|
+
minScore: number;
|
|
13
|
+
color: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Grade definitions
|
|
17
|
+
*/
|
|
18
|
+
export declare const GRADES: Record<Grade, GradeInfo>;
|
|
19
|
+
/**
|
|
20
|
+
* Get grade info for a score
|
|
21
|
+
*/
|
|
22
|
+
export declare function getGradeInfo(score: number): GradeInfo;
|
|
23
|
+
/**
|
|
24
|
+
* Get the next grade up from the current score
|
|
25
|
+
*/
|
|
26
|
+
export declare function getNextGrade(score: number): GradeInfo | null;
|
|
27
|
+
/**
|
|
28
|
+
* Calculate points needed to reach the next grade
|
|
29
|
+
*/
|
|
30
|
+
export declare function pointsToNextGrade(score: number): number;
|
|
31
|
+
/**
|
|
32
|
+
* ASCII art for each grade letter
|
|
33
|
+
*/
|
|
34
|
+
export declare const GRADE_ASCII: Record<Grade, string>;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grade Definitions and Display
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Grade definitions
|
|
6
|
+
*/
|
|
7
|
+
export const GRADES = {
|
|
8
|
+
'A+': {
|
|
9
|
+
letter: 'A+',
|
|
10
|
+
label: 'Excellent',
|
|
11
|
+
description: 'Exceptional WebMCP implementation with best-in-class practices',
|
|
12
|
+
minScore: 95,
|
|
13
|
+
color: 'green',
|
|
14
|
+
},
|
|
15
|
+
'A': {
|
|
16
|
+
letter: 'A',
|
|
17
|
+
label: 'Great',
|
|
18
|
+
description: 'Strong WebMCP implementation with minor improvements possible',
|
|
19
|
+
minScore: 85,
|
|
20
|
+
color: 'green',
|
|
21
|
+
},
|
|
22
|
+
'B+': {
|
|
23
|
+
letter: 'B+',
|
|
24
|
+
label: 'Good',
|
|
25
|
+
description: 'Good implementation with some areas for improvement',
|
|
26
|
+
minScore: 80,
|
|
27
|
+
color: 'yellow',
|
|
28
|
+
},
|
|
29
|
+
'B': {
|
|
30
|
+
letter: 'B',
|
|
31
|
+
label: 'Above Average',
|
|
32
|
+
description: 'Functional implementation with notable gaps',
|
|
33
|
+
minScore: 70,
|
|
34
|
+
color: 'yellow',
|
|
35
|
+
},
|
|
36
|
+
'C+': {
|
|
37
|
+
letter: 'C+',
|
|
38
|
+
label: 'Average',
|
|
39
|
+
description: 'Basic implementation with significant room for improvement',
|
|
40
|
+
minScore: 65,
|
|
41
|
+
color: '#FF8C00',
|
|
42
|
+
},
|
|
43
|
+
'C': {
|
|
44
|
+
letter: 'C',
|
|
45
|
+
label: 'Below Average',
|
|
46
|
+
description: 'Minimal implementation with many issues',
|
|
47
|
+
minScore: 55,
|
|
48
|
+
color: '#FF8C00',
|
|
49
|
+
},
|
|
50
|
+
'D': {
|
|
51
|
+
letter: 'D',
|
|
52
|
+
label: 'Poor',
|
|
53
|
+
description: 'Inadequate implementation requiring significant work',
|
|
54
|
+
minScore: 40,
|
|
55
|
+
color: 'red',
|
|
56
|
+
},
|
|
57
|
+
'F': {
|
|
58
|
+
letter: 'F',
|
|
59
|
+
label: 'Failing',
|
|
60
|
+
description: 'Little to no WebMCP support detected',
|
|
61
|
+
minScore: 0,
|
|
62
|
+
color: 'red',
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Get grade info for a score
|
|
67
|
+
*/
|
|
68
|
+
export function getGradeInfo(score) {
|
|
69
|
+
if (score >= 95)
|
|
70
|
+
return GRADES['A+'];
|
|
71
|
+
if (score >= 85)
|
|
72
|
+
return GRADES['A'];
|
|
73
|
+
if (score >= 80)
|
|
74
|
+
return GRADES['B+'];
|
|
75
|
+
if (score >= 70)
|
|
76
|
+
return GRADES['B'];
|
|
77
|
+
if (score >= 65)
|
|
78
|
+
return GRADES['C+'];
|
|
79
|
+
if (score >= 55)
|
|
80
|
+
return GRADES['C'];
|
|
81
|
+
if (score >= 40)
|
|
82
|
+
return GRADES['D'];
|
|
83
|
+
return GRADES['F'];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get the next grade up from the current score
|
|
87
|
+
*/
|
|
88
|
+
export function getNextGrade(score) {
|
|
89
|
+
const grades = Object.values(GRADES).sort((a, b) => b.minScore - a.minScore);
|
|
90
|
+
for (const grade of grades) {
|
|
91
|
+
if (score < grade.minScore) {
|
|
92
|
+
return grade;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return null; // Already at A+
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Calculate points needed to reach the next grade
|
|
99
|
+
*/
|
|
100
|
+
export function pointsToNextGrade(score) {
|
|
101
|
+
const next = getNextGrade(score);
|
|
102
|
+
if (!next)
|
|
103
|
+
return 0;
|
|
104
|
+
return next.minScore - score;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* ASCII art for each grade letter
|
|
108
|
+
*/
|
|
109
|
+
export const GRADE_ASCII = {
|
|
110
|
+
'A+': `
|
|
111
|
+
█████╗ ╋
|
|
112
|
+
██╔══██╗ ╋╋
|
|
113
|
+
███████║ ╋
|
|
114
|
+
██╔══██║
|
|
115
|
+
██║ ██║ ╋
|
|
116
|
+
╚═╝ ╚═╝ `,
|
|
117
|
+
'A': `
|
|
118
|
+
█████╗
|
|
119
|
+
██╔══██╗
|
|
120
|
+
███████║
|
|
121
|
+
██╔══██║
|
|
122
|
+
██║ ██║
|
|
123
|
+
╚═╝ ╚═╝ `,
|
|
124
|
+
'B+': `
|
|
125
|
+
██████╗ ╋
|
|
126
|
+
██╔══██╗ ╋╋
|
|
127
|
+
██████╔╝ ╋
|
|
128
|
+
██╔══██╗
|
|
129
|
+
██████╔╝ ╋
|
|
130
|
+
╚═════╝ `,
|
|
131
|
+
'B': `
|
|
132
|
+
██████╗
|
|
133
|
+
██╔══██╗
|
|
134
|
+
██████╔╝
|
|
135
|
+
██╔══██╗
|
|
136
|
+
██████╔╝
|
|
137
|
+
╚═════╝ `,
|
|
138
|
+
'C+': `
|
|
139
|
+
██████╗ ╋
|
|
140
|
+
██╔════╝ ╋╋
|
|
141
|
+
██║ ╋
|
|
142
|
+
██║
|
|
143
|
+
╚██████╗ ╋
|
|
144
|
+
╚═════╝ `,
|
|
145
|
+
'C': `
|
|
146
|
+
██████╗
|
|
147
|
+
██╔════╝
|
|
148
|
+
██║
|
|
149
|
+
██║
|
|
150
|
+
╚██████╗
|
|
151
|
+
╚═════╝ `,
|
|
152
|
+
'D': `
|
|
153
|
+
██████╗
|
|
154
|
+
██╔══██╗
|
|
155
|
+
██║ ██║
|
|
156
|
+
██║ ██║
|
|
157
|
+
██████╔╝
|
|
158
|
+
╚═════╝ `,
|
|
159
|
+
'F': `
|
|
160
|
+
███████╗
|
|
161
|
+
██╔════╝
|
|
162
|
+
█████╗
|
|
163
|
+
██╔══╝
|
|
164
|
+
██║
|
|
165
|
+
╚═╝ `,
|
|
166
|
+
};
|
|
167
|
+
//# sourceMappingURL=grades.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grades.js","sourceRoot":"","sources":["../../src/scoring/grades.ts"],"names":[],"mappings":"AAAA;;GAEG;AAeH;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAA6B;IAC9C,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,WAAW;QAClB,WA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