@oculum/scanner 1.0.11 → 1.0.12
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/ai-context/index.d.ts +6 -0
- package/dist/ai-context/index.d.ts.map +1 -0
- package/dist/ai-context/index.js +13 -0
- package/dist/ai-context/index.js.map +1 -0
- package/dist/ai-context/manager.d.ts +67 -0
- package/dist/ai-context/manager.d.ts.map +1 -0
- package/dist/ai-context/manager.js +104 -0
- package/dist/ai-context/manager.js.map +1 -0
- package/dist/category-filter.d.ts +125 -0
- package/dist/category-filter.d.ts.map +1 -0
- package/dist/category-filter.js +360 -0
- package/dist/category-filter.js.map +1 -0
- package/dist/filtering/context-adjustments.d.ts +23 -0
- package/dist/filtering/context-adjustments.d.ts.map +1 -0
- package/dist/filtering/context-adjustments.js +100 -0
- package/dist/filtering/context-adjustments.js.map +1 -0
- package/dist/filtering/index.d.ts +3 -0
- package/dist/filtering/index.d.ts.map +1 -0
- package/dist/filtering/index.js +8 -0
- package/dist/filtering/index.js.map +1 -0
- package/dist/filtering/pipeline.d.ts +48 -0
- package/dist/filtering/pipeline.d.ts.map +1 -0
- package/dist/filtering/pipeline.js +76 -0
- package/dist/filtering/pipeline.js.map +1 -0
- package/dist/formatters/ai-context.d.ts +23 -0
- package/dist/formatters/ai-context.d.ts.map +1 -0
- package/dist/formatters/ai-context.js +238 -0
- package/dist/formatters/ai-context.js.map +1 -0
- package/dist/formatters/github-comment.d.ts +1 -1
- package/dist/formatters/github-comment.d.ts.map +1 -1
- package/dist/formatters/github-comment.js +2 -2
- package/dist/formatters/github-comment.js.map +1 -1
- package/dist/formatters/ide/claude-code.d.ts +17 -0
- package/dist/formatters/ide/claude-code.d.ts.map +1 -0
- package/dist/formatters/ide/claude-code.js +94 -0
- package/dist/formatters/ide/claude-code.js.map +1 -0
- package/dist/formatters/ide/cursor.d.ts +13 -0
- package/dist/formatters/ide/cursor.d.ts.map +1 -0
- package/dist/formatters/ide/cursor.js +125 -0
- package/dist/formatters/ide/cursor.js.map +1 -0
- package/dist/formatters/ide/index.d.ts +62 -0
- package/dist/formatters/ide/index.d.ts.map +1 -0
- package/dist/formatters/ide/index.js +184 -0
- package/dist/formatters/ide/index.js.map +1 -0
- package/dist/formatters/ide/windsurf.d.ts +13 -0
- package/dist/formatters/ide/windsurf.d.ts.map +1 -0
- package/dist/formatters/ide/windsurf.js +117 -0
- package/dist/formatters/ide/windsurf.js.map +1 -0
- package/dist/formatters/index.d.ts +2 -0
- package/dist/formatters/index.d.ts.map +1 -1
- package/dist/formatters/index.js +17 -1
- package/dist/formatters/index.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +272 -44
- package/dist/index.js.map +1 -1
- package/dist/layer1/comments.d.ts +4 -1
- package/dist/layer1/comments.d.ts.map +1 -1
- package/dist/layer1/comments.js +1 -1
- package/dist/layer1/comments.js.map +1 -1
- package/dist/layer1/config-audit.d.ts +4 -1
- package/dist/layer1/config-audit.d.ts.map +1 -1
- package/dist/layer1/config-audit.js +45 -11
- package/dist/layer1/config-audit.js.map +1 -1
- package/dist/layer1/config-mcp-audit.d.ts +4 -1
- package/dist/layer1/config-mcp-audit.d.ts.map +1 -1
- package/dist/layer1/config-mcp-audit.js +2 -2
- package/dist/layer1/config-mcp-audit.js.map +1 -1
- package/dist/layer1/entropy.d.ts +4 -1
- package/dist/layer1/entropy.d.ts.map +1 -1
- package/dist/layer1/entropy.js +212 -1
- package/dist/layer1/entropy.js.map +1 -1
- package/dist/layer1/file-flags.d.ts +4 -1
- package/dist/layer1/file-flags.d.ts.map +1 -1
- package/dist/layer1/file-flags.js +12 -5
- package/dist/layer1/file-flags.js.map +1 -1
- package/dist/layer1/index.d.ts.map +1 -1
- package/dist/layer1/index.js +14 -19
- package/dist/layer1/index.js.map +1 -1
- package/dist/layer1/patterns.d.ts +4 -1
- package/dist/layer1/patterns.d.ts.map +1 -1
- package/dist/layer1/patterns.js +34 -4
- package/dist/layer1/patterns.js.map +1 -1
- package/dist/layer1/urls.d.ts +4 -1
- package/dist/layer1/urls.d.ts.map +1 -1
- package/dist/layer1/urls.js +162 -14
- package/dist/layer1/urls.js.map +1 -1
- package/dist/layer1/weak-crypto.d.ts +4 -1
- package/dist/layer1/weak-crypto.d.ts.map +1 -1
- package/dist/layer1/weak-crypto.js +144 -7
- package/dist/layer1/weak-crypto.js.map +1 -1
- package/dist/layer2/ai-agent-tools.d.ts +4 -1
- package/dist/layer2/ai-agent-tools.d.ts.map +1 -1
- package/dist/layer2/ai-agent-tools.js +661 -2
- package/dist/layer2/ai-agent-tools.js.map +1 -1
- package/dist/layer2/ai-endpoint-protection.d.ts +2 -0
- package/dist/layer2/ai-endpoint-protection.d.ts.map +1 -1
- package/dist/layer2/ai-endpoint-protection.js +1 -1
- package/dist/layer2/ai-endpoint-protection.js.map +1 -1
- package/dist/layer2/ai-execution-sinks.d.ts +4 -1
- package/dist/layer2/ai-execution-sinks.d.ts.map +1 -1
- package/dist/layer2/ai-execution-sinks.js +252 -43
- package/dist/layer2/ai-execution-sinks.js.map +1 -1
- package/dist/layer2/ai-fingerprinting.d.ts +4 -1
- package/dist/layer2/ai-fingerprinting.d.ts.map +1 -1
- package/dist/layer2/ai-fingerprinting.js +25 -32
- package/dist/layer2/ai-fingerprinting.js.map +1 -1
- package/dist/layer2/ai-mcp-security.d.ts +4 -1
- package/dist/layer2/ai-mcp-security.d.ts.map +1 -1
- package/dist/layer2/ai-mcp-security.js +200 -2
- package/dist/layer2/ai-mcp-security.js.map +1 -1
- package/dist/layer2/ai-package-hallucination.d.ts +4 -1
- package/dist/layer2/ai-package-hallucination.d.ts.map +1 -1
- package/dist/layer2/ai-package-hallucination.js +136 -4
- package/dist/layer2/ai-package-hallucination.js.map +1 -1
- package/dist/layer2/ai-prompt-hygiene.d.ts +4 -1
- package/dist/layer2/ai-prompt-hygiene.d.ts.map +1 -1
- package/dist/layer2/ai-prompt-hygiene.js +342 -28
- package/dist/layer2/ai-prompt-hygiene.js.map +1 -1
- package/dist/layer2/ai-rag-safety.d.ts +4 -1
- package/dist/layer2/ai-rag-safety.d.ts.map +1 -1
- package/dist/layer2/ai-rag-safety.js +82 -2
- package/dist/layer2/ai-rag-safety.js.map +1 -1
- package/dist/layer2/ai-schema-validation.d.ts +4 -1
- package/dist/layer2/ai-schema-validation.d.ts.map +1 -1
- package/dist/layer2/ai-schema-validation.js +2 -2
- package/dist/layer2/ai-schema-validation.js.map +1 -1
- package/dist/layer2/auth-antipatterns.d.ts +2 -0
- package/dist/layer2/auth-antipatterns.d.ts.map +1 -1
- package/dist/layer2/auth-antipatterns.js +205 -20
- package/dist/layer2/auth-antipatterns.js.map +1 -1
- package/dist/layer2/byok-patterns.d.ts +4 -1
- package/dist/layer2/byok-patterns.d.ts.map +1 -1
- package/dist/layer2/byok-patterns.js +2 -2
- package/dist/layer2/byok-patterns.js.map +1 -1
- package/dist/layer2/dangerous-functions/dom-xss.d.ts +9 -4
- package/dist/layer2/dangerous-functions/dom-xss.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/dom-xss.js +73 -22
- package/dist/layer2/dangerous-functions/dom-xss.js.map +1 -1
- package/dist/layer2/dangerous-functions/index.d.ts +4 -1
- package/dist/layer2/dangerous-functions/index.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/index.js +551 -20
- package/dist/layer2/dangerous-functions/index.js.map +1 -1
- package/dist/layer2/dangerous-functions/math-random.d.ts +54 -4
- package/dist/layer2/dangerous-functions/math-random.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/math-random.js +241 -16
- package/dist/layer2/dangerous-functions/math-random.js.map +1 -1
- package/dist/layer2/dangerous-functions/patterns.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/patterns.js +3 -1
- package/dist/layer2/dangerous-functions/patterns.js.map +1 -1
- package/dist/layer2/dangerous-functions/utils/control-flow.d.ts +3 -2
- package/dist/layer2/dangerous-functions/utils/control-flow.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/utils/control-flow.js +41 -120
- package/dist/layer2/dangerous-functions/utils/control-flow.js.map +1 -1
- package/dist/layer2/dangerous-functions/utils/helpers.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/utils/helpers.js +26 -3
- package/dist/layer2/dangerous-functions/utils/helpers.js.map +1 -1
- package/dist/layer2/dangerous-functions/utils/schema-validation.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/utils/schema-validation.js +14 -1
- package/dist/layer2/dangerous-functions/utils/schema-validation.js.map +1 -1
- package/dist/layer2/data-exposure.d.ts +4 -1
- package/dist/layer2/data-exposure.d.ts.map +1 -1
- package/dist/layer2/data-exposure.js +11 -38
- package/dist/layer2/data-exposure.js.map +1 -1
- package/dist/layer2/framework-checks.d.ts +4 -1
- package/dist/layer2/framework-checks.d.ts.map +1 -1
- package/dist/layer2/framework-checks.js +2 -2
- package/dist/layer2/framework-checks.js.map +1 -1
- package/dist/layer2/index.d.ts +9 -1
- package/dist/layer2/index.d.ts.map +1 -1
- package/dist/layer2/index.js +57 -51
- package/dist/layer2/index.js.map +1 -1
- package/dist/layer2/logic-gates.d.ts +4 -1
- package/dist/layer2/logic-gates.d.ts.map +1 -1
- package/dist/layer2/logic-gates.js +54 -20
- package/dist/layer2/logic-gates.js.map +1 -1
- package/dist/layer2/model-supply-chain.d.ts +4 -1
- package/dist/layer2/model-supply-chain.d.ts.map +1 -1
- package/dist/layer2/model-supply-chain.js +72 -4
- package/dist/layer2/model-supply-chain.js.map +1 -1
- package/dist/layer2/risky-imports.d.ts +4 -1
- package/dist/layer2/risky-imports.d.ts.map +1 -1
- package/dist/layer2/risky-imports.js +2 -2
- package/dist/layer2/risky-imports.js.map +1 -1
- package/dist/layer2/variables.d.ts +4 -1
- package/dist/layer2/variables.d.ts.map +1 -1
- package/dist/layer2/variables.js +2 -2
- package/dist/layer2/variables.js.map +1 -1
- package/dist/layer3/anthropic/auto-dismiss.d.ts.map +1 -1
- package/dist/layer3/anthropic/auto-dismiss.js +11 -0
- package/dist/layer3/anthropic/auto-dismiss.js.map +1 -1
- package/dist/modes/incremental.js +1 -1
- package/dist/tiers.d.ts +2 -2
- package/dist/tiers.d.ts.map +1 -1
- package/dist/tiers.js +7 -7
- package/dist/tiers.js.map +1 -1
- package/dist/types.d.ts +78 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +34 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/code-analysis.d.ts +39 -0
- package/dist/utils/code-analysis.d.ts.map +1 -0
- package/dist/utils/code-analysis.js +159 -0
- package/dist/utils/code-analysis.js.map +1 -0
- package/dist/utils/comment-analyzer.d.ts +38 -0
- package/dist/utils/comment-analyzer.d.ts.map +1 -0
- package/dist/utils/comment-analyzer.js +218 -0
- package/dist/utils/comment-analyzer.js.map +1 -0
- package/dist/utils/context-helpers.d.ts +108 -1
- package/dist/utils/context-helpers.d.ts.map +1 -1
- package/dist/utils/context-helpers.js +351 -2
- package/dist/utils/context-helpers.js.map +1 -1
- package/dist/utils/environment-context.d.ts +76 -0
- package/dist/utils/environment-context.d.ts.map +1 -0
- package/dist/utils/environment-context.js +271 -0
- package/dist/utils/environment-context.js.map +1 -0
- package/dist/utils/intent-detector.d.ts +66 -0
- package/dist/utils/intent-detector.d.ts.map +1 -0
- package/dist/utils/intent-detector.js +282 -0
- package/dist/utils/intent-detector.js.map +1 -0
- package/dist/utils/parsed-file.d.ts +51 -0
- package/dist/utils/parsed-file.d.ts.map +1 -0
- package/dist/utils/parsed-file.js +95 -0
- package/dist/utils/parsed-file.js.map +1 -0
- package/dist/utils/route-hierarchy.d.ts +50 -0
- package/dist/utils/route-hierarchy.d.ts.map +1 -0
- package/dist/utils/route-hierarchy.js +226 -0
- package/dist/utils/route-hierarchy.js.map +1 -0
- package/dist/utils/schema-semantics.d.ts +45 -0
- package/dist/utils/schema-semantics.d.ts.map +1 -0
- package/dist/utils/schema-semantics.js +193 -0
- package/dist/utils/schema-semantics.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/benchmark/fixtures/layer2/index.ts +12 -0
- package/src/__tests__/benchmark/fixtures/layer2/phase5-excessive-agency.ts +580 -0
- package/src/__tests__/benchmark/fixtures/layer2/sprint6-ai-enhancements.ts +515 -0
- package/src/__tests__/benchmark/run-depth-validation.ts +9 -9
- package/src/__tests__/category-filter.test.ts +478 -0
- package/src/__tests__/regression/known-false-positives.test.ts +490 -0
- package/src/__tests__/snapshots/__snapshots__/anthropic-validation-refactor.test.ts.snap +18 -14
- package/src/__tests__/snapshots/__snapshots__/scan-depth.test.ts.snap +0 -9
- package/src/__tests__/snapshots/anthropic-validation-refactor.test.ts +1 -1
- package/src/__tests__/validation/run-validation.ts +7 -7
- package/src/ai-context/__tests__/manager.test.ts +193 -0
- package/src/ai-context/index.ts +15 -0
- package/src/ai-context/manager.ts +145 -0
- package/src/baseline/__tests__/manager.test.ts +2 -2
- package/src/category-filter.ts +400 -0
- package/src/filtering/__tests__/pipeline.test.ts +134 -0
- package/src/filtering/context-adjustments.ts +111 -0
- package/src/filtering/index.ts +10 -0
- package/src/filtering/pipeline.ts +130 -0
- package/src/formatters/__tests__/ai-context.test.ts +254 -0
- package/src/formatters/ai-context.ts +302 -0
- package/src/formatters/github-comment.ts +3 -3
- package/src/formatters/ide/__tests__/ide.test.ts +319 -0
- package/src/formatters/ide/claude-code.ts +110 -0
- package/src/formatters/ide/cursor.ts +147 -0
- package/src/formatters/ide/index.ts +216 -0
- package/src/formatters/ide/windsurf.ts +135 -0
- package/src/formatters/index.ts +24 -0
- package/src/index.ts +312 -34
- package/src/layer1/comments.ts +3 -1
- package/src/layer1/config-audit.ts +50 -11
- package/src/layer1/config-mcp-audit.ts +4 -2
- package/src/layer1/entropy.ts +234 -1
- package/src/layer1/file-flags.ts +17 -6
- package/src/layer1/index.ts +14 -18
- package/src/layer1/patterns.ts +42 -4
- package/src/layer1/urls.ts +188 -14
- package/src/layer1/weak-crypto.ts +168 -16
- package/src/layer2/ai-agent-tools.ts +707 -2
- package/src/layer2/ai-endpoint-protection.ts +3 -1
- package/src/layer2/ai-execution-sinks.ts +265 -43
- package/src/layer2/ai-fingerprinting.ts +28 -32
- package/src/layer2/ai-mcp-security.ts +206 -3
- package/src/layer2/ai-package-hallucination.ts +153 -4
- package/src/layer2/ai-prompt-hygiene.ts +369 -26
- package/src/layer2/ai-rag-safety.ts +85 -2
- package/src/layer2/ai-schema-validation.ts +4 -2
- package/src/layer2/auth-antipatterns.ts +230 -20
- package/src/layer2/byok-patterns.ts +4 -2
- package/src/layer2/dangerous-functions/dom-xss.ts +94 -22
- package/src/layer2/dangerous-functions/index.ts +635 -51
- package/src/layer2/dangerous-functions/math-random.ts +268 -16
- package/src/layer2/dangerous-functions/patterns.ts +3 -1
- package/src/layer2/dangerous-functions/utils/control-flow.ts +8 -135
- package/src/layer2/dangerous-functions/utils/schema-validation.ts +16 -1
- package/src/layer2/data-exposure.ts +13 -38
- package/src/layer2/framework-checks.ts +4 -2
- package/src/layer2/index.ts +69 -50
- package/src/layer2/logic-gates.ts +59 -22
- package/src/layer2/model-supply-chain.ts +79 -4
- package/src/layer2/risky-imports.ts +4 -2
- package/src/layer2/variables.ts +4 -2
- package/src/layer3/anthropic/auto-dismiss.ts +11 -0
- package/src/modes/incremental.ts +1 -1
- package/src/tiers.ts +9 -9
- package/src/types.ts +122 -8
- package/src/utils/__tests__/code-analysis.test.ts +165 -0
- package/src/utils/__tests__/parsed-file.test.ts +124 -0
- package/src/utils/code-analysis.ts +179 -0
- package/src/utils/comment-analyzer.ts +249 -0
- package/src/utils/context-helpers.ts +408 -2
- package/src/utils/environment-context.ts +304 -0
- package/src/utils/intent-detector.ts +318 -0
- package/src/utils/parsed-file.ts +103 -0
- package/src/utils/route-hierarchy.ts +250 -0
- package/src/utils/schema-semantics.ts +233 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IDE Integration Module
|
|
3
|
+
* Exports formatters and utilities for IDE-specific config files
|
|
4
|
+
*/
|
|
5
|
+
export { formatCursorRules } from './cursor';
|
|
6
|
+
export { formatWindsurfRules } from './windsurf';
|
|
7
|
+
export { formatClaudeCodeSection, OCULUM_SECTION_START, OCULUM_SECTION_END } from './claude-code';
|
|
8
|
+
/** Supported IDE types */
|
|
9
|
+
export type IDEType = 'cursor' | 'windsurf' | 'claude-code';
|
|
10
|
+
/** Default file paths for each IDE */
|
|
11
|
+
export declare const IDE_FILE_PATHS: Record<IDEType, string>;
|
|
12
|
+
/** Result of a file write operation */
|
|
13
|
+
export interface WriteIDEFileResult {
|
|
14
|
+
success: boolean;
|
|
15
|
+
path: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Result of a file clear operation */
|
|
19
|
+
export interface ClearIDEFilesResult {
|
|
20
|
+
success: boolean;
|
|
21
|
+
clearedFiles: string[];
|
|
22
|
+
errors: string[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Detect which IDE configurations exist in the project
|
|
26
|
+
*
|
|
27
|
+
* @param projectPath - Path to the project root
|
|
28
|
+
* @returns Array of detected IDE types
|
|
29
|
+
*/
|
|
30
|
+
export declare function detectIDEConfigs(projectPath: string): IDEType[];
|
|
31
|
+
/**
|
|
32
|
+
* Write an IDE-specific file
|
|
33
|
+
*
|
|
34
|
+
* @param projectPath - Path to the project root
|
|
35
|
+
* @param relativePath - Relative path for the file
|
|
36
|
+
* @param content - Content to write
|
|
37
|
+
* @returns Result object
|
|
38
|
+
*/
|
|
39
|
+
export declare function writeIDEFile(projectPath: string, relativePath: string, content: string): WriteIDEFileResult;
|
|
40
|
+
/**
|
|
41
|
+
* Update the Oculum section in CLAUDE.md
|
|
42
|
+
* Replaces content between OCULUM_SECURITY_START and OCULUM_SECURITY_END markers
|
|
43
|
+
* If markers don't exist, appends the section at the end
|
|
44
|
+
*
|
|
45
|
+
* @param projectPath - Path to the project root
|
|
46
|
+
* @param section - The section content (including markers)
|
|
47
|
+
* @returns Result object
|
|
48
|
+
*/
|
|
49
|
+
export declare function updateClaudeMdSection(projectPath: string, section: string): WriteIDEFileResult;
|
|
50
|
+
/**
|
|
51
|
+
* Clear IDE rule files
|
|
52
|
+
*
|
|
53
|
+
* @param projectPath - Path to the project root
|
|
54
|
+
* @param types - Optional array of IDE types to clear. If not provided, clears all.
|
|
55
|
+
* @returns Result object with list of cleared files
|
|
56
|
+
*/
|
|
57
|
+
export declare function clearIDEFiles(projectPath: string, types?: IDEType[]): ClearIDEFilesResult;
|
|
58
|
+
/**
|
|
59
|
+
* Get the default file path for an IDE type
|
|
60
|
+
*/
|
|
61
|
+
export declare function getIDEFilePath(ide: IDEType): string;
|
|
62
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/formatters/ide/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEjG,0BAA0B;AAC1B,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,CAAA;AAE3D,sCAAsC;AACtC,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAIlD,CAAA;AAED,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,uCAAuC;AACvC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,EAAE,CAmB/D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GACd,kBAAkB,CAqBpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,kBAAkB,CAwCpB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,WAAW,EAAE,MAAM,EACnB,KAAK,CAAC,EAAE,OAAO,EAAE,GAChB,mBAAmB,CA6CrB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEnD"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* IDE Integration Module
|
|
4
|
+
* Exports formatters and utilities for IDE-specific config files
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.IDE_FILE_PATHS = exports.OCULUM_SECTION_END = exports.OCULUM_SECTION_START = exports.formatClaudeCodeSection = exports.formatWindsurfRules = exports.formatCursorRules = void 0;
|
|
8
|
+
exports.detectIDEConfigs = detectIDEConfigs;
|
|
9
|
+
exports.writeIDEFile = writeIDEFile;
|
|
10
|
+
exports.updateClaudeMdSection = updateClaudeMdSection;
|
|
11
|
+
exports.clearIDEFiles = clearIDEFiles;
|
|
12
|
+
exports.getIDEFilePath = getIDEFilePath;
|
|
13
|
+
const fs_1 = require("fs");
|
|
14
|
+
const path_1 = require("path");
|
|
15
|
+
// Export formatters
|
|
16
|
+
var cursor_1 = require("./cursor");
|
|
17
|
+
Object.defineProperty(exports, "formatCursorRules", { enumerable: true, get: function () { return cursor_1.formatCursorRules; } });
|
|
18
|
+
var windsurf_1 = require("./windsurf");
|
|
19
|
+
Object.defineProperty(exports, "formatWindsurfRules", { enumerable: true, get: function () { return windsurf_1.formatWindsurfRules; } });
|
|
20
|
+
var claude_code_1 = require("./claude-code");
|
|
21
|
+
Object.defineProperty(exports, "formatClaudeCodeSection", { enumerable: true, get: function () { return claude_code_1.formatClaudeCodeSection; } });
|
|
22
|
+
Object.defineProperty(exports, "OCULUM_SECTION_START", { enumerable: true, get: function () { return claude_code_1.OCULUM_SECTION_START; } });
|
|
23
|
+
Object.defineProperty(exports, "OCULUM_SECTION_END", { enumerable: true, get: function () { return claude_code_1.OCULUM_SECTION_END; } });
|
|
24
|
+
/** Default file paths for each IDE */
|
|
25
|
+
exports.IDE_FILE_PATHS = {
|
|
26
|
+
cursor: '.cursor/rules/security.mdc',
|
|
27
|
+
windsurf: '.windsurfrules',
|
|
28
|
+
'claude-code': 'CLAUDE.md',
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Detect which IDE configurations exist in the project
|
|
32
|
+
*
|
|
33
|
+
* @param projectPath - Path to the project root
|
|
34
|
+
* @returns Array of detected IDE types
|
|
35
|
+
*/
|
|
36
|
+
function detectIDEConfigs(projectPath) {
|
|
37
|
+
const detected = [];
|
|
38
|
+
// Check for Cursor
|
|
39
|
+
if ((0, fs_1.existsSync)((0, path_1.join)(projectPath, '.cursor'))) {
|
|
40
|
+
detected.push('cursor');
|
|
41
|
+
}
|
|
42
|
+
// Check for Windsurf rules
|
|
43
|
+
if ((0, fs_1.existsSync)((0, path_1.join)(projectPath, '.windsurfrules'))) {
|
|
44
|
+
detected.push('windsurf');
|
|
45
|
+
}
|
|
46
|
+
// Check for Claude Code
|
|
47
|
+
if ((0, fs_1.existsSync)((0, path_1.join)(projectPath, 'CLAUDE.md'))) {
|
|
48
|
+
detected.push('claude-code');
|
|
49
|
+
}
|
|
50
|
+
return detected;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Write an IDE-specific file
|
|
54
|
+
*
|
|
55
|
+
* @param projectPath - Path to the project root
|
|
56
|
+
* @param relativePath - Relative path for the file
|
|
57
|
+
* @param content - Content to write
|
|
58
|
+
* @returns Result object
|
|
59
|
+
*/
|
|
60
|
+
function writeIDEFile(projectPath, relativePath, content) {
|
|
61
|
+
const fullPath = (0, path_1.join)(projectPath, relativePath);
|
|
62
|
+
try {
|
|
63
|
+
// Ensure directory exists
|
|
64
|
+
const dir = (0, path_1.dirname)(fullPath);
|
|
65
|
+
if (!(0, fs_1.existsSync)(dir)) {
|
|
66
|
+
(0, fs_1.mkdirSync)(dir, { recursive: true });
|
|
67
|
+
}
|
|
68
|
+
// Write file
|
|
69
|
+
(0, fs_1.writeFileSync)(fullPath, content);
|
|
70
|
+
return { success: true, path: fullPath };
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
return {
|
|
74
|
+
success: false,
|
|
75
|
+
path: fullPath,
|
|
76
|
+
error: `Failed to write ${relativePath}: ${err instanceof Error ? err.message : 'Unknown error'}`,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Update the Oculum section in CLAUDE.md
|
|
82
|
+
* Replaces content between OCULUM_SECURITY_START and OCULUM_SECURITY_END markers
|
|
83
|
+
* If markers don't exist, appends the section at the end
|
|
84
|
+
*
|
|
85
|
+
* @param projectPath - Path to the project root
|
|
86
|
+
* @param section - The section content (including markers)
|
|
87
|
+
* @returns Result object
|
|
88
|
+
*/
|
|
89
|
+
function updateClaudeMdSection(projectPath, section) {
|
|
90
|
+
const filePath = (0, path_1.join)(projectPath, 'CLAUDE.md');
|
|
91
|
+
try {
|
|
92
|
+
let content;
|
|
93
|
+
if ((0, fs_1.existsSync)(filePath)) {
|
|
94
|
+
content = (0, fs_1.readFileSync)(filePath, 'utf-8');
|
|
95
|
+
// Check if markers exist
|
|
96
|
+
const startMarker = '<!-- OCULUM_SECURITY_START -->';
|
|
97
|
+
const endMarker = '<!-- OCULUM_SECURITY_END -->';
|
|
98
|
+
const startIndex = content.indexOf(startMarker);
|
|
99
|
+
const endIndex = content.indexOf(endMarker);
|
|
100
|
+
if (startIndex !== -1 && endIndex !== -1 && endIndex > startIndex) {
|
|
101
|
+
// Replace existing section
|
|
102
|
+
content =
|
|
103
|
+
content.substring(0, startIndex) +
|
|
104
|
+
section +
|
|
105
|
+
content.substring(endIndex + endMarker.length);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
// Append section at end
|
|
109
|
+
content = content.trimEnd() + '\n\n' + section;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
// Create new file with section
|
|
114
|
+
content = `# CLAUDE.md\n\n${section}`;
|
|
115
|
+
}
|
|
116
|
+
(0, fs_1.writeFileSync)(filePath, content);
|
|
117
|
+
return { success: true, path: filePath };
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
return {
|
|
121
|
+
success: false,
|
|
122
|
+
path: filePath,
|
|
123
|
+
error: `Failed to update CLAUDE.md: ${err instanceof Error ? err.message : 'Unknown error'}`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Clear IDE rule files
|
|
129
|
+
*
|
|
130
|
+
* @param projectPath - Path to the project root
|
|
131
|
+
* @param types - Optional array of IDE types to clear. If not provided, clears all.
|
|
132
|
+
* @returns Result object with list of cleared files
|
|
133
|
+
*/
|
|
134
|
+
function clearIDEFiles(projectPath, types) {
|
|
135
|
+
const toCheck = types || ['cursor', 'windsurf', 'claude-code'];
|
|
136
|
+
const clearedFiles = [];
|
|
137
|
+
const errors = [];
|
|
138
|
+
for (const ide of toCheck) {
|
|
139
|
+
const relativePath = exports.IDE_FILE_PATHS[ide];
|
|
140
|
+
const fullPath = (0, path_1.join)(projectPath, relativePath);
|
|
141
|
+
try {
|
|
142
|
+
if (ide === 'claude-code') {
|
|
143
|
+
// For CLAUDE.md, remove only the Oculum section, not the whole file
|
|
144
|
+
if ((0, fs_1.existsSync)(fullPath)) {
|
|
145
|
+
const content = (0, fs_1.readFileSync)(fullPath, 'utf-8');
|
|
146
|
+
const startMarker = '<!-- OCULUM_SECURITY_START -->';
|
|
147
|
+
const endMarker = '<!-- OCULUM_SECURITY_END -->';
|
|
148
|
+
const startIndex = content.indexOf(startMarker);
|
|
149
|
+
const endIndex = content.indexOf(endMarker);
|
|
150
|
+
if (startIndex !== -1 && endIndex !== -1) {
|
|
151
|
+
// Remove section (including potential surrounding newlines)
|
|
152
|
+
let newContent = content.substring(0, startIndex) + content.substring(endIndex + endMarker.length);
|
|
153
|
+
// Clean up extra newlines
|
|
154
|
+
newContent = newContent.replace(/\n{3,}/g, '\n\n').trimEnd() + '\n';
|
|
155
|
+
(0, fs_1.writeFileSync)(fullPath, newContent);
|
|
156
|
+
clearedFiles.push(relativePath);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
// For other IDEs, delete the file
|
|
162
|
+
if ((0, fs_1.existsSync)(fullPath)) {
|
|
163
|
+
(0, fs_1.unlinkSync)(fullPath);
|
|
164
|
+
clearedFiles.push(relativePath);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
catch (err) {
|
|
169
|
+
errors.push(`Failed to clear ${relativePath}: ${err instanceof Error ? err.message : 'Unknown error'}`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
success: errors.length === 0,
|
|
174
|
+
clearedFiles,
|
|
175
|
+
errors,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Get the default file path for an IDE type
|
|
180
|
+
*/
|
|
181
|
+
function getIDEFilePath(ide) {
|
|
182
|
+
return exports.IDE_FILE_PATHS[ide];
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/formatters/ide/index.ts"],"names":[],"mappings":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AK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAA;QACzG,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;QAC5B,YAAY;QACZ,MAAM;KACP,CAAA;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,cAAc,CAAC,GAAY;IACzC,OAAO,sBAAc,CAAC,GAAG,CAAC,CAAA;AAC5B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Windsurf IDE Integration
|
|
3
|
+
* Generates .windsurfrules format
|
|
4
|
+
*/
|
|
5
|
+
import type { ScanResult } from '../../types';
|
|
6
|
+
/**
|
|
7
|
+
* Format scan result as Windsurf rules
|
|
8
|
+
*
|
|
9
|
+
* @param result - The scan result to format
|
|
10
|
+
* @returns Markdown string for .windsurfrules
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatWindsurfRules(result: ScanResult): string;
|
|
13
|
+
//# sourceMappingURL=windsurf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windsurf.d.ts","sourceRoot":"","sources":["../../../src/formatters/ide/windsurf.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAwC,MAAM,aAAa,CAAA;AA0BnF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAiG9D"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Windsurf IDE Integration
|
|
4
|
+
* Generates .windsurfrules format
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.formatWindsurfRules = formatWindsurfRules;
|
|
8
|
+
const grouping_1 = require("../grouping");
|
|
9
|
+
/**
|
|
10
|
+
* Get security pattern rule for a category
|
|
11
|
+
*/
|
|
12
|
+
function getPatternRule(category) {
|
|
13
|
+
const rules = {
|
|
14
|
+
sql_injection: 'ALWAYS use parameterized queries for database operations.',
|
|
15
|
+
xss: 'ALWAYS escape user input before inserting into HTML.',
|
|
16
|
+
hardcoded_secret: 'NEVER hardcode secrets, API keys, or credentials in source code.',
|
|
17
|
+
high_entropy_string: 'NEVER commit high-entropy strings that could be secrets.',
|
|
18
|
+
missing_auth: 'ALWAYS add authentication middleware to API endpoints.',
|
|
19
|
+
dangerous_function: 'NEVER use eval(), exec(), or similar functions with user input.',
|
|
20
|
+
command_injection: 'ALWAYS sanitize input before passing to shell commands.',
|
|
21
|
+
sensitive_url: 'NEVER hardcode localhost or internal URLs in production code.',
|
|
22
|
+
insecure_config: 'ALWAYS review configuration files for security issues.',
|
|
23
|
+
data_exposure: 'NEVER log or expose sensitive data in error messages.',
|
|
24
|
+
weak_crypto: 'ALWAYS use strong cryptographic algorithms (avoid MD5, SHA1).',
|
|
25
|
+
ai_prompt_injection: 'ALWAYS sanitize user input before including in AI prompts.',
|
|
26
|
+
ai_unsafe_execution: 'NEVER execute code generated by AI without validation.',
|
|
27
|
+
};
|
|
28
|
+
return rules[category] || null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Format scan result as Windsurf rules
|
|
32
|
+
*
|
|
33
|
+
* @param result - The scan result to format
|
|
34
|
+
* @returns Markdown string for .windsurfrules
|
|
35
|
+
*/
|
|
36
|
+
function formatWindsurfRules(result) {
|
|
37
|
+
const { vulnerabilities, timestamp } = result;
|
|
38
|
+
// Sort by severity
|
|
39
|
+
const sorted = (0, grouping_1.sortBySeverity)(vulnerabilities);
|
|
40
|
+
let md = '';
|
|
41
|
+
// Header
|
|
42
|
+
md += `# Oculum Security Rules\n\n`;
|
|
43
|
+
md += `> Generated: ${timestamp}\n\n`;
|
|
44
|
+
// No findings case
|
|
45
|
+
if (vulnerabilities.length === 0) {
|
|
46
|
+
md += `## Status\n\n`;
|
|
47
|
+
md += `No security issues found.\n\n`;
|
|
48
|
+
md += `*Run \`oculum scan --windsurf --clear\` to remove this file.*\n`;
|
|
49
|
+
return md;
|
|
50
|
+
}
|
|
51
|
+
// Security Issues Section
|
|
52
|
+
md += `## Security Issues\n\n`;
|
|
53
|
+
md += `The following security issues were detected and need attention:\n\n`;
|
|
54
|
+
// Group by file
|
|
55
|
+
const byFile = new Map();
|
|
56
|
+
for (const vuln of sorted) {
|
|
57
|
+
const group = byFile.get(vuln.filePath) || [];
|
|
58
|
+
group.push(vuln);
|
|
59
|
+
byFile.set(vuln.filePath, group);
|
|
60
|
+
}
|
|
61
|
+
// List by file
|
|
62
|
+
for (const [filePath, vulns] of byFile) {
|
|
63
|
+
md += `### ${filePath}\n\n`;
|
|
64
|
+
for (const vuln of vulns) {
|
|
65
|
+
const severityEmoji = vuln.severity === 'critical' ? '!!' :
|
|
66
|
+
vuln.severity === 'high' ? '!' :
|
|
67
|
+
vuln.severity === 'medium' ? '*' : '-';
|
|
68
|
+
md += `- ${severityEmoji} **Line ${vuln.lineNumber}:** ${vuln.title}`;
|
|
69
|
+
if (vuln.suggestedFix) {
|
|
70
|
+
md += ` - ${vuln.suggestedFix}`;
|
|
71
|
+
}
|
|
72
|
+
md += '\n';
|
|
73
|
+
}
|
|
74
|
+
md += '\n';
|
|
75
|
+
}
|
|
76
|
+
// Code Patterns Section
|
|
77
|
+
md += `## Code Patterns\n\n`;
|
|
78
|
+
md += `Follow these security patterns when writing code:\n\n`;
|
|
79
|
+
// Collect unique pattern rules
|
|
80
|
+
const patternRules = new Set();
|
|
81
|
+
for (const vuln of vulnerabilities) {
|
|
82
|
+
const rule = getPatternRule(vuln.category);
|
|
83
|
+
if (rule) {
|
|
84
|
+
patternRules.add(rule);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
for (const rule of patternRules) {
|
|
88
|
+
md += `- ${rule}\n`;
|
|
89
|
+
}
|
|
90
|
+
md += '\n';
|
|
91
|
+
// Quick Reference
|
|
92
|
+
md += `## Quick Reference\n\n`;
|
|
93
|
+
md += `| Severity | Count | Action |\n`;
|
|
94
|
+
md += `|----------|-------|--------|\n`;
|
|
95
|
+
const { severityCounts } = result;
|
|
96
|
+
if (severityCounts.critical > 0) {
|
|
97
|
+
md += `| Critical | ${severityCounts.critical} | Fix immediately |\n`;
|
|
98
|
+
}
|
|
99
|
+
if (severityCounts.high > 0) {
|
|
100
|
+
md += `| High | ${severityCounts.high} | Fix before commit |\n`;
|
|
101
|
+
}
|
|
102
|
+
if (severityCounts.medium > 0) {
|
|
103
|
+
md += `| Medium | ${severityCounts.medium} | Review and fix |\n`;
|
|
104
|
+
}
|
|
105
|
+
if (severityCounts.low > 0) {
|
|
106
|
+
md += `| Low | ${severityCounts.low} | Consider fixing |\n`;
|
|
107
|
+
}
|
|
108
|
+
if (severityCounts.info > 0) {
|
|
109
|
+
md += `| Info | ${severityCounts.info} | For awareness |\n`;
|
|
110
|
+
}
|
|
111
|
+
md += '\n';
|
|
112
|
+
// Footer
|
|
113
|
+
md += `---\n\n`;
|
|
114
|
+
md += `*Run \`oculum scan\` to verify fixes. Run \`oculum scan --windsurf --clear\` to remove this file.*\n`;
|
|
115
|
+
return md;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=windsurf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windsurf.js","sourceRoot":"","sources":["../../../src/formatters/ide/windsurf.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAkCH,kDAiGC;AAhID,0CAA4C;AAE5C;;GAEG;AACH,SAAS,cAAc,CAAC,QAA+B;IACrD,MAAM,KAAK,GAAmD;QAC5D,aAAa,EAAE,2DAA2D;QAC1E,GAAG,EAAE,sDAAsD;QAC3D,gBAAgB,EAAE,kEAAkE;QACpF,mBAAmB,EAAE,0DAA0D;QAC/E,YAAY,EAAE,wDAAwD;QACtE,kBAAkB,EAAE,iEAAiE;QACrF,iBAAiB,EAAE,yDAAyD;QAC5E,a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EAAE,IAAI,iCAAiC,CAAA;IAEvC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAA;IACjC,IAAI,cAAc,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC;QAChC,EAAE,IAAI,gBAAgB,cAAc,CAAC,QAAQ,wBAAwB,CAAA;IACvE,CAAC;IACD,IAAI,cAAc,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QAC5B,EAAE,IAAI,YAAY,cAAc,CAAC,IAAI,0BAA0B,CAAA;IACjE,CAAC;IACD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,EAAE,IAAI,cAAc,cAAc,CAAC,MAAM,uBAAuB,CAAA;IAClE,CAAC;IACD,IAAI,cAAc,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC;QAC3B,EAAE,IAAI,WAAW,cAAc,CAAC,GAAG,wBAAwB,CAAA;IAC7D,CAAC;IACD,IAAI,cAAc,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QAC5B,EAAE,IAAI,YAAY,cAAc,CAAC,IAAI,sBAAsB,CAAA;IAC7D,CAAC;IACD,EAAE,IAAI,IAAI,CAAA;IAEV,SAAS;IACT,EAAE,IAAI,SAAS,CAAA;IACf,EAAE,IAAI,sGAAsG,CAAA;IAE5G,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Export all formatting utilities for different workflows
|
|
4
4
|
*/
|
|
5
5
|
export { groupByTheme, limitPerGroup, sortBySeverity, getBlockingIssues, getActionableIssues, getRiskTheme, THEME_CONFIG, type RiskTheme, type GroupedFindings, } from './grouping';
|
|
6
|
+
export { formatAIContext, type AIContextOptions, } from './ai-context';
|
|
7
|
+
export { formatCursorRules, formatWindsurfRules, formatClaudeCodeSection, detectIDEConfigs, writeIDEFile, updateClaudeMdSection, clearIDEFiles, getIDEFilePath, OCULUM_SECTION_START, OCULUM_SECTION_END, IDE_FILE_PATHS, type IDEType, type WriteIDEFileResult, type ClearIDEFilesResult, } from './ide';
|
|
6
8
|
export { formatGitHubComment, formatShortStatus, formatAnnotation, type GitHubCommentOptions, } from './github-comment';
|
|
7
9
|
export { formatDiagnostic, formatDiagnosticsByFile, generateCodeAction, formatForProblemsPanel, DiagnosticSeverity, type Diagnostic, type DiagnosticsByFile, type CodeAction, type Position, type Range, } from './vscode-diagnostic';
|
|
8
10
|
export { formatTerminalOutput, formatSimpleList, formatJSON, formatSARIF, formatCompactSummary, getNumberedFindings, formatFindingDetail, type CompactSummaryOptions, } from './cli-terminal';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formatters/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,YAAY,EACZ,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,YAAY,CAAA;AAGnB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,KAAK,GACX,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,qBAAqB,GAC3B,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formatters/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,YAAY,EACZ,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,YAAY,CAAA;AAGnB,OAAO,EACL,eAAe,EACf,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAA;AAGrB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,OAAO,CAAA;AAGd,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,KAAK,GACX,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,qBAAqB,GAC3B,MAAM,gBAAgB,CAAA"}
|
package/dist/formatters/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Export all formatting utilities for different workflows
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.formatFindingDetail = exports.getNumberedFindings = exports.formatCompactSummary = exports.formatSARIF = exports.formatJSON = exports.formatSimpleList = exports.formatTerminalOutput = exports.DiagnosticSeverity = exports.formatForProblemsPanel = exports.generateCodeAction = exports.formatDiagnosticsByFile = exports.formatDiagnostic = exports.formatAnnotation = exports.formatShortStatus = exports.formatGitHubComment = exports.THEME_CONFIG = exports.getRiskTheme = exports.getActionableIssues = exports.getBlockingIssues = exports.sortBySeverity = exports.limitPerGroup = exports.groupByTheme = void 0;
|
|
7
|
+
exports.formatFindingDetail = exports.getNumberedFindings = exports.formatCompactSummary = exports.formatSARIF = exports.formatJSON = exports.formatSimpleList = exports.formatTerminalOutput = exports.DiagnosticSeverity = exports.formatForProblemsPanel = exports.generateCodeAction = exports.formatDiagnosticsByFile = exports.formatDiagnostic = exports.formatAnnotation = exports.formatShortStatus = exports.formatGitHubComment = exports.IDE_FILE_PATHS = exports.OCULUM_SECTION_END = exports.OCULUM_SECTION_START = exports.getIDEFilePath = exports.clearIDEFiles = exports.updateClaudeMdSection = exports.writeIDEFile = exports.detectIDEConfigs = exports.formatClaudeCodeSection = exports.formatWindsurfRules = exports.formatCursorRules = exports.formatAIContext = exports.THEME_CONFIG = exports.getRiskTheme = exports.getActionableIssues = exports.getBlockingIssues = exports.sortBySeverity = exports.limitPerGroup = exports.groupByTheme = void 0;
|
|
8
8
|
// Grouping utilities
|
|
9
9
|
var grouping_1 = require("./grouping");
|
|
10
10
|
Object.defineProperty(exports, "groupByTheme", { enumerable: true, get: function () { return grouping_1.groupByTheme; } });
|
|
@@ -14,6 +14,22 @@ Object.defineProperty(exports, "getBlockingIssues", { enumerable: true, get: fun
|
|
|
14
14
|
Object.defineProperty(exports, "getActionableIssues", { enumerable: true, get: function () { return grouping_1.getActionableIssues; } });
|
|
15
15
|
Object.defineProperty(exports, "getRiskTheme", { enumerable: true, get: function () { return grouping_1.getRiskTheme; } });
|
|
16
16
|
Object.defineProperty(exports, "THEME_CONFIG", { enumerable: true, get: function () { return grouping_1.THEME_CONFIG; } });
|
|
17
|
+
// AI Context formatter
|
|
18
|
+
var ai_context_1 = require("./ai-context");
|
|
19
|
+
Object.defineProperty(exports, "formatAIContext", { enumerable: true, get: function () { return ai_context_1.formatAIContext; } });
|
|
20
|
+
// IDE integrations
|
|
21
|
+
var ide_1 = require("./ide");
|
|
22
|
+
Object.defineProperty(exports, "formatCursorRules", { enumerable: true, get: function () { return ide_1.formatCursorRules; } });
|
|
23
|
+
Object.defineProperty(exports, "formatWindsurfRules", { enumerable: true, get: function () { return ide_1.formatWindsurfRules; } });
|
|
24
|
+
Object.defineProperty(exports, "formatClaudeCodeSection", { enumerable: true, get: function () { return ide_1.formatClaudeCodeSection; } });
|
|
25
|
+
Object.defineProperty(exports, "detectIDEConfigs", { enumerable: true, get: function () { return ide_1.detectIDEConfigs; } });
|
|
26
|
+
Object.defineProperty(exports, "writeIDEFile", { enumerable: true, get: function () { return ide_1.writeIDEFile; } });
|
|
27
|
+
Object.defineProperty(exports, "updateClaudeMdSection", { enumerable: true, get: function () { return ide_1.updateClaudeMdSection; } });
|
|
28
|
+
Object.defineProperty(exports, "clearIDEFiles", { enumerable: true, get: function () { return ide_1.clearIDEFiles; } });
|
|
29
|
+
Object.defineProperty(exports, "getIDEFilePath", { enumerable: true, get: function () { return ide_1.getIDEFilePath; } });
|
|
30
|
+
Object.defineProperty(exports, "OCULUM_SECTION_START", { enumerable: true, get: function () { return ide_1.OCULUM_SECTION_START; } });
|
|
31
|
+
Object.defineProperty(exports, "OCULUM_SECTION_END", { enumerable: true, get: function () { return ide_1.OCULUM_SECTION_END; } });
|
|
32
|
+
Object.defineProperty(exports, "IDE_FILE_PATHS", { enumerable: true, get: function () { return ide_1.IDE_FILE_PATHS; } });
|
|
17
33
|
// GitHub comment formatter
|
|
18
34
|
var github_comment_1 = require("./github-comment");
|
|
19
35
|
Object.defineProperty(exports, "formatGitHubComment", { enumerable: true, get: function () { return github_comment_1.formatGitHubComment; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/formatters/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qBAAqB;AACrB,uCAUmB;AATjB,wGAAA,YAAY,OAAA;AACZ,yGAAA,aAAa,OAAA;AACb,0GAAA,cAAc,OAAA;AACd,6GA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AA,kBAAkB,OAAA;AAClB,qGAAA,cAAc,OAAA;AAMhB,2BAA2B;AAC3B,mDAKyB;AAJvB,qHAAA,mBAAmB,OAAA;AACnB,mHAAA,iBAAiB,OAAA;AACjB,kHAAA,gBAAgB,OAAA;AAIlB,+BAA+B;AAC/B,yDAW4B;AAV1B,qHAAA,gBAAgB,OAAA;AAChB,4HAAA,uBAAuB,OAAA;AACvB,uHAAA,kBAAkB,OAAA;AAClB,2HAAA,sBAAsB,OAAA;AACtB,uHAAA,kBAAkB,OAAA;AAQpB,yBAAyB;AACzB,+CASuB;AARrB,oHAAA,oBAAoB,OAAA;AACpB,gHAAA,gBAAgB,OAAA;AAChB,0GAAA,UAAU,OAAA;AACV,2GAAA,WAAW,OAAA;AACX,oHAAA,oBAAoB,OAAA;AACpB,mHAAA,mBAAmB,OAAA;AACnB,mHAAA,mBAAmB,OAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export interface ScanOptions {
|
|
|
22
22
|
projectPath?: string;
|
|
23
23
|
/** Include suppressed findings in output (for --show-suppressed) */
|
|
24
24
|
showSuppressed?: boolean;
|
|
25
|
+
/** Include filter audit trail in output (for debugging/explaining dismissals) */
|
|
26
|
+
includeFilterAudit?: boolean;
|
|
25
27
|
}
|
|
26
28
|
export interface ScanProgress {
|
|
27
29
|
status: 'fetching' | 'layer1' | 'layer2' | 'layer3' | 'validating' | 'complete' | 'failed';
|
|
@@ -61,4 +63,6 @@ export { createCancellationToken } from './types';
|
|
|
61
63
|
export { SuppressionManager, computeFindingHash, loadSuppressionConfig, addFindingSuppression, removeFindingSuppression, addRuleSuppression, listSuppressions, parseInlineSuppressions, generateSuppressionComment, isValidHash, type SuppressionConfig, type FindingSuppression, type RuleSuppression, type SuppressionResult, type SuppressedVulnerability, } from './suppression';
|
|
62
64
|
export { BaselineManager, computeDiff, hasNewBlockingIssues, formatDiffSummary, BASELINE_FILE_PATH, OCULUM_DIR, type BaselineData, type BaselineFinding, type DiffResult, type BaselineDiff, type BaselineManagerOptions, type LoadBaselineResult, type SaveBaselineResult, type ClearBaselineResult, } from './baseline';
|
|
63
65
|
export { RULE_REGISTRY, getRuleMetadata, getAllCategories, hasMetadata, type RuleMetadata, } from './rules';
|
|
66
|
+
export { AIContextManager, AI_CONTEXT_FILE, AI_CONTEXT_PATH, type AIContextManagerOptions, type SaveContextResult, type LoadContextResult, type ClearContextResult, } from './ai-context';
|
|
67
|
+
export { CATEGORY_GROUPS, ALL_CATEGORIES, normalizeCategory, expandCategoryPattern, matchesAnyCategory, shouldFailOnCategories, getMatchingCategories, parseCategoryList, validateCategories, getAvailableCategoryGroups, getCategoryGroupCounts, } from './category-filter';
|
|
64
68
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,aAAa,EACb,cAAc,EACd,cAAc,EAEd,QAAQ,EACR,cAAc,EACd,SAAS,EACT,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,aAAa,EACb,cAAc,EACd,cAAc,EAEd,QAAQ,EACR,cAAc,EACd,SAAS,EACT,iBAAiB,EAGlB,MAAM,SAAS,CAAA;AAuRhB,MAAM,WAAW,WAAW;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2BAA2B;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oDAAoD;IACpD,QAAQ,CAAC,EAAE,QAAQ,GAAG,cAAc,CAAA;IACpC,4DAA4D;IAC5D,SAAS,CAAC,EA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