codeguardian-mcp 1.0.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/LICENSE +21 -0
- package/README.md +348 -0
- package/dist/agent/agentTools.d.ts +26 -0
- package/dist/agent/agentTools.d.ts.map +1 -0
- package/dist/agent/agentTools.js +699 -0
- package/dist/agent/agentTools.js.map +1 -0
- package/dist/agent/autoValidator.d.ts +110 -0
- package/dist/agent/autoValidator.d.ts.map +1 -0
- package/dist/agent/autoValidator.js +964 -0
- package/dist/agent/autoValidator.js.map +1 -0
- package/dist/agent/fileWatcher.d.ts +28 -0
- package/dist/agent/fileWatcher.d.ts.map +1 -0
- package/dist/agent/fileWatcher.js +88 -0
- package/dist/agent/fileWatcher.js.map +1 -0
- package/dist/agent/guardianPersistence.d.ts +98 -0
- package/dist/agent/guardianPersistence.d.ts.map +1 -0
- package/dist/agent/guardianPersistence.js +296 -0
- package/dist/agent/guardianPersistence.js.map +1 -0
- package/dist/agent/mcpNotifications.d.ts +38 -0
- package/dist/agent/mcpNotifications.d.ts.map +1 -0
- package/dist/agent/mcpNotifications.js +81 -0
- package/dist/agent/mcpNotifications.js.map +1 -0
- package/dist/analyzers/aiPatterns.d.ts +16 -0
- package/dist/analyzers/aiPatterns.d.ts.map +1 -0
- package/dist/analyzers/aiPatterns.js +103 -0
- package/dist/analyzers/aiPatterns.js.map +1 -0
- package/dist/analyzers/antiPatterns.d.ts +60 -0
- package/dist/analyzers/antiPatterns.d.ts.map +1 -0
- package/dist/analyzers/antiPatterns.js +198 -0
- package/dist/analyzers/antiPatterns.js.map +1 -0
- package/dist/analyzers/builtinTypes.d.ts +18 -0
- package/dist/analyzers/builtinTypes.d.ts.map +1 -0
- package/dist/analyzers/builtinTypes.js +1275 -0
- package/dist/analyzers/builtinTypes.js.map +1 -0
- package/dist/analyzers/complexity.d.ts +14 -0
- package/dist/analyzers/complexity.d.ts.map +1 -0
- package/dist/analyzers/complexity.js +610 -0
- package/dist/analyzers/complexity.js.map +1 -0
- package/dist/analyzers/findingVerifier.d.ts +59 -0
- package/dist/analyzers/findingVerifier.d.ts.map +1 -0
- package/dist/analyzers/findingVerifier.js +1169 -0
- package/dist/analyzers/findingVerifier.js.map +1 -0
- package/dist/analyzers/impactAnalyzer.d.ts +53 -0
- package/dist/analyzers/impactAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/impactAnalyzer.js +152 -0
- package/dist/analyzers/impactAnalyzer.js.map +1 -0
- package/dist/analyzers/languageDetector.d.ts +48 -0
- package/dist/analyzers/languageDetector.d.ts.map +1 -0
- package/dist/analyzers/languageDetector.js +404 -0
- package/dist/analyzers/languageDetector.js.map +1 -0
- package/dist/analyzers/parsers/incrementalParser.d.ts +53 -0
- package/dist/analyzers/parsers/incrementalParser.d.ts.map +1 -0
- package/dist/analyzers/parsers/incrementalParser.js +193 -0
- package/dist/analyzers/parsers/incrementalParser.js.map +1 -0
- package/dist/analyzers/parsers/scopeResolver.d.ts +92 -0
- package/dist/analyzers/parsers/scopeResolver.d.ts.map +1 -0
- package/dist/analyzers/parsers/scopeResolver.js +324 -0
- package/dist/analyzers/parsers/scopeResolver.js.map +1 -0
- package/dist/analyzers/parsers/semanticIndex.d.ts +127 -0
- package/dist/analyzers/parsers/semanticIndex.d.ts.map +1 -0
- package/dist/analyzers/parsers/semanticIndex.js +429 -0
- package/dist/analyzers/parsers/semanticIndex.js.map +1 -0
- package/dist/analyzers/parsers/sessionDiffAnalyzer.d.ts +42 -0
- package/dist/analyzers/parsers/sessionDiffAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/parsers/sessionDiffAnalyzer.js +233 -0
- package/dist/analyzers/parsers/sessionDiffAnalyzer.js.map +1 -0
- package/dist/analyzers/parsers/treeSitterParser.d.ts +76 -0
- package/dist/analyzers/parsers/treeSitterParser.d.ts.map +1 -0
- package/dist/analyzers/parsers/treeSitterParser.js +709 -0
- package/dist/analyzers/parsers/treeSitterParser.js.map +1 -0
- package/dist/analyzers/relevanceScorer.d.ts +43 -0
- package/dist/analyzers/relevanceScorer.d.ts.map +1 -0
- package/dist/analyzers/relevanceScorer.js +200 -0
- package/dist/analyzers/relevanceScorer.js.map +1 -0
- package/dist/analyzers/standardLibrary.d.ts +22 -0
- package/dist/analyzers/standardLibrary.d.ts.map +1 -0
- package/dist/analyzers/standardLibrary.js +211 -0
- package/dist/analyzers/standardLibrary.js.map +1 -0
- package/dist/analyzers/symbolGraph.d.ts +30 -0
- package/dist/analyzers/symbolGraph.d.ts.map +1 -0
- package/dist/analyzers/symbolGraph.js +380 -0
- package/dist/analyzers/symbolGraph.js.map +1 -0
- package/dist/analyzers/symbolTable.d.ts +18 -0
- package/dist/analyzers/symbolTable.d.ts.map +1 -0
- package/dist/analyzers/symbolTable.js +176 -0
- package/dist/analyzers/symbolTable.js.map +1 -0
- package/dist/analyzers/typeChecker.d.ts +13 -0
- package/dist/analyzers/typeChecker.d.ts.map +1 -0
- package/dist/analyzers/typeChecker.js +580 -0
- package/dist/analyzers/typeChecker.js.map +1 -0
- package/dist/analyzers/usagePatterns.d.ts +42 -0
- package/dist/analyzers/usagePatterns.d.ts.map +1 -0
- package/dist/analyzers/usagePatterns.js +75 -0
- package/dist/analyzers/usagePatterns.js.map +1 -0
- package/dist/api-contract/context/backend.d.ts +19 -0
- package/dist/api-contract/context/backend.d.ts.map +1 -0
- package/dist/api-contract/context/backend.js +64 -0
- package/dist/api-contract/context/backend.js.map +1 -0
- package/dist/api-contract/context/contract.d.ts +34 -0
- package/dist/api-contract/context/contract.d.ts.map +1 -0
- package/dist/api-contract/context/contract.js +306 -0
- package/dist/api-contract/context/contract.js.map +1 -0
- package/dist/api-contract/context/frontend.d.ts +19 -0
- package/dist/api-contract/context/frontend.d.ts.map +1 -0
- package/dist/api-contract/context/frontend.js +64 -0
- package/dist/api-contract/context/frontend.js.map +1 -0
- package/dist/api-contract/detector.d.ts +28 -0
- package/dist/api-contract/detector.d.ts.map +1 -0
- package/dist/api-contract/detector.js +393 -0
- package/dist/api-contract/detector.js.map +1 -0
- package/dist/api-contract/extractors/python.d.ts +32 -0
- package/dist/api-contract/extractors/python.d.ts.map +1 -0
- package/dist/api-contract/extractors/python.js +521 -0
- package/dist/api-contract/extractors/python.js.map +1 -0
- package/dist/api-contract/extractors/pythonAstUtils.d.ts +44 -0
- package/dist/api-contract/extractors/pythonAstUtils.d.ts.map +1 -0
- package/dist/api-contract/extractors/pythonAstUtils.js +489 -0
- package/dist/api-contract/extractors/pythonAstUtils.js.map +1 -0
- package/dist/api-contract/extractors/tsAstUtils.d.ts +47 -0
- package/dist/api-contract/extractors/tsAstUtils.d.ts.map +1 -0
- package/dist/api-contract/extractors/tsAstUtils.js +173 -0
- package/dist/api-contract/extractors/tsAstUtils.js.map +1 -0
- package/dist/api-contract/extractors/typescript.d.ts +32 -0
- package/dist/api-contract/extractors/typescript.d.ts.map +1 -0
- package/dist/api-contract/extractors/typescript.js +666 -0
- package/dist/api-contract/extractors/typescript.js.map +1 -0
- package/dist/api-contract/index.d.ts +104 -0
- package/dist/api-contract/index.d.ts.map +1 -0
- package/dist/api-contract/index.js +232 -0
- package/dist/api-contract/index.js.map +1 -0
- package/dist/api-contract/types.d.ts +151 -0
- package/dist/api-contract/types.d.ts.map +1 -0
- package/dist/api-contract/types.js +19 -0
- package/dist/api-contract/types.js.map +1 -0
- package/dist/api-contract/validators/endpoint.d.ts +21 -0
- package/dist/api-contract/validators/endpoint.d.ts.map +1 -0
- package/dist/api-contract/validators/endpoint.js +224 -0
- package/dist/api-contract/validators/endpoint.js.map +1 -0
- package/dist/api-contract/validators/index.d.ts +40 -0
- package/dist/api-contract/validators/index.d.ts.map +1 -0
- package/dist/api-contract/validators/index.js +875 -0
- package/dist/api-contract/validators/index.js.map +1 -0
- package/dist/api-contract/validators/parameter.d.ts +17 -0
- package/dist/api-contract/validators/parameter.d.ts.map +1 -0
- package/dist/api-contract/validators/parameter.js +250 -0
- package/dist/api-contract/validators/parameter.js.map +1 -0
- package/dist/api-contract/validators/type.d.ts +38 -0
- package/dist/api-contract/validators/type.d.ts.map +1 -0
- package/dist/api-contract/validators/type.js +244 -0
- package/dist/api-contract/validators/type.js.map +1 -0
- package/dist/context/apiContract/complexTypeSupport.d.ts +83 -0
- package/dist/context/apiContract/complexTypeSupport.d.ts.map +1 -0
- package/dist/context/apiContract/complexTypeSupport.js +665 -0
- package/dist/context/apiContract/complexTypeSupport.js.map +1 -0
- package/dist/context/apiContract/graphqlSupport.d.ts +105 -0
- package/dist/context/apiContract/graphqlSupport.d.ts.map +1 -0
- package/dist/context/apiContract/graphqlSupport.js +671 -0
- package/dist/context/apiContract/graphqlSupport.js.map +1 -0
- package/dist/context/apiContract/index.d.ts +14 -0
- package/dist/context/apiContract/index.d.ts.map +1 -0
- package/dist/context/apiContract/index.js +17 -0
- package/dist/context/apiContract/index.js.map +1 -0
- package/dist/context/apiContract/webSocketSupport.d.ts +104 -0
- package/dist/context/apiContract/webSocketSupport.d.ts.map +1 -0
- package/dist/context/apiContract/webSocketSupport.js +465 -0
- package/dist/context/apiContract/webSocketSupport.js.map +1 -0
- package/dist/context/apiContractContext.d.ts +15 -0
- package/dist/context/apiContractContext.d.ts.map +1 -0
- package/dist/context/apiContractContext.js +979 -0
- package/dist/context/apiContractContext.js.map +1 -0
- package/dist/context/apiContractExtraction.d.ts +52 -0
- package/dist/context/apiContractExtraction.d.ts.map +1 -0
- package/dist/context/apiContractExtraction.js +438 -0
- package/dist/context/apiContractExtraction.js.map +1 -0
- package/dist/context/contextLineage.d.ts +79 -0
- package/dist/context/contextLineage.d.ts.map +1 -0
- package/dist/context/contextLineage.js +259 -0
- package/dist/context/contextLineage.js.map +1 -0
- package/dist/context/contextOrchestrator.d.ts +57 -0
- package/dist/context/contextOrchestrator.d.ts.map +1 -0
- package/dist/context/contextOrchestrator.js +162 -0
- package/dist/context/contextOrchestrator.js.map +1 -0
- package/dist/context/intentTracker.d.ts +73 -0
- package/dist/context/intentTracker.d.ts.map +1 -0
- package/dist/context/intentTracker.js +168 -0
- package/dist/context/intentTracker.js.map +1 -0
- package/dist/context/projectContext.d.ts +219 -0
- package/dist/context/projectContext.d.ts.map +1 -0
- package/dist/context/projectContext.js +1984 -0
- package/dist/context/projectContext.js.map +1 -0
- package/dist/prompts/index.d.ts +17 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +260 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/library.d.ts +51 -0
- package/dist/prompts/library.d.ts.map +1 -0
- package/dist/prompts/library.js +65 -0
- package/dist/prompts/library.js.map +1 -0
- package/dist/prompts/templates.d.ts +44 -0
- package/dist/prompts/templates.d.ts.map +1 -0
- package/dist/prompts/templates.js +97 -0
- package/dist/prompts/templates.js.map +1 -0
- package/dist/queue/jobPersistence.d.ts +46 -0
- package/dist/queue/jobPersistence.d.ts.map +1 -0
- package/dist/queue/jobPersistence.js +158 -0
- package/dist/queue/jobPersistence.js.map +1 -0
- package/dist/queue/jobQueue.d.ts +116 -0
- package/dist/queue/jobQueue.d.ts.map +1 -0
- package/dist/queue/jobQueue.js +275 -0
- package/dist/queue/jobQueue.js.map +1 -0
- package/dist/queue/validationJob.d.ts +69 -0
- package/dist/queue/validationJob.d.ts.map +1 -0
- package/dist/queue/validationJob.js +435 -0
- package/dist/queue/validationJob.js.map +1 -0
- package/dist/resources/index.d.ts +15 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +328 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/validationReportStore.d.ts +170 -0
- package/dist/resources/validationReportStore.d.ts.map +1 -0
- package/dist/resources/validationReportStore.js +515 -0
- package/dist/resources/validationReportStore.js.map +1 -0
- package/dist/server.d.ts +12 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +102 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/asyncValidation.d.ts +19 -0
- package/dist/tools/asyncValidation.d.ts.map +1 -0
- package/dist/tools/asyncValidation.js +346 -0
- package/dist/tools/asyncValidation.js.map +1 -0
- package/dist/tools/buildContext.d.ts +17 -0
- package/dist/tools/buildContext.d.ts.map +1 -0
- package/dist/tools/buildContext.js +188 -0
- package/dist/tools/buildContext.js.map +1 -0
- package/dist/tools/getDependencyGraph.d.ts +16 -0
- package/dist/tools/getDependencyGraph.d.ts.map +1 -0
- package/dist/tools/getDependencyGraph.js +436 -0
- package/dist/tools/getDependencyGraph.js.map +1 -0
- package/dist/tools/incrementalValidation.d.ts +71 -0
- package/dist/tools/incrementalValidation.d.ts.map +1 -0
- package/dist/tools/incrementalValidation.js +203 -0
- package/dist/tools/incrementalValidation.js.map +1 -0
- package/dist/tools/index.d.ts +24 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +106 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/validateCode.d.ts +17 -0
- package/dist/tools/validateCode.d.ts.map +1 -0
- package/dist/tools/validateCode.js +368 -0
- package/dist/tools/validateCode.js.map +1 -0
- package/dist/tools/validateCodeLite.d.ts +2 -0
- package/dist/tools/validateCodeLite.d.ts.map +1 -0
- package/dist/tools/validateCodeLite.js +2 -0
- package/dist/tools/validateCodeLite.js.map +1 -0
- package/dist/tools/validation/builtins.d.ts +92 -0
- package/dist/tools/validation/builtins.d.ts.map +1 -0
- package/dist/tools/validation/builtins.js +2184 -0
- package/dist/tools/validation/builtins.js.map +1 -0
- package/dist/tools/validation/contextualNaming.d.ts +99 -0
- package/dist/tools/validation/contextualNaming.d.ts.map +1 -0
- package/dist/tools/validation/contextualNaming.js +959 -0
- package/dist/tools/validation/contextualNaming.js.map +1 -0
- package/dist/tools/validation/deadCode.d.ts +115 -0
- package/dist/tools/validation/deadCode.d.ts.map +1 -0
- package/dist/tools/validation/deadCode.js +861 -0
- package/dist/tools/validation/deadCode.js.map +1 -0
- package/dist/tools/validation/extractors/index.d.ts +131 -0
- package/dist/tools/validation/extractors/index.d.ts.map +1 -0
- package/dist/tools/validation/extractors/index.js +233 -0
- package/dist/tools/validation/extractors/index.js.map +1 -0
- package/dist/tools/validation/extractors/javascript.d.ts +73 -0
- package/dist/tools/validation/extractors/javascript.d.ts.map +1 -0
- package/dist/tools/validation/extractors/javascript.js +1841 -0
- package/dist/tools/validation/extractors/javascript.js.map +1 -0
- package/dist/tools/validation/extractors/python.d.ts +93 -0
- package/dist/tools/validation/extractors/python.d.ts.map +1 -0
- package/dist/tools/validation/extractors/python.js +799 -0
- package/dist/tools/validation/extractors/python.js.map +1 -0
- package/dist/tools/validation/manifest.d.ts +45 -0
- package/dist/tools/validation/manifest.d.ts.map +1 -0
- package/dist/tools/validation/manifest.js +719 -0
- package/dist/tools/validation/manifest.js.map +1 -0
- package/dist/tools/validation/parser.d.ts +58 -0
- package/dist/tools/validation/parser.d.ts.map +1 -0
- package/dist/tools/validation/parser.js +232 -0
- package/dist/tools/validation/parser.js.map +1 -0
- package/dist/tools/validation/registry.d.ts +15 -0
- package/dist/tools/validation/registry.d.ts.map +1 -0
- package/dist/tools/validation/registry.js +169 -0
- package/dist/tools/validation/registry.js.map +1 -0
- package/dist/tools/validation/scoring.d.ts +54 -0
- package/dist/tools/validation/scoring.d.ts.map +1 -0
- package/dist/tools/validation/scoring.js +242 -0
- package/dist/tools/validation/scoring.js.map +1 -0
- package/dist/tools/validation/types.d.ts +120 -0
- package/dist/tools/validation/types.d.ts.map +1 -0
- package/dist/tools/validation/types.js +11 -0
- package/dist/tools/validation/types.js.map +1 -0
- package/dist/tools/validation/unusedLocals.d.ts +36 -0
- package/dist/tools/validation/unusedLocals.d.ts.map +1 -0
- package/dist/tools/validation/unusedLocals.js +333 -0
- package/dist/tools/validation/unusedLocals.js.map +1 -0
- package/dist/tools/validation/validation.d.ts +98 -0
- package/dist/tools/validation/validation.d.ts.map +1 -0
- package/dist/tools/validation/validation.js +1837 -0
- package/dist/tools/validation/validation.js.map +1 -0
- package/dist/types/codeGraph.d.ts +163 -0
- package/dist/types/codeGraph.d.ts.map +1 -0
- package/dist/types/codeGraph.js +9 -0
- package/dist/types/codeGraph.js.map +1 -0
- package/dist/types/symbolGraph.d.ts +68 -0
- package/dist/types/symbolGraph.d.ts.map +1 -0
- package/dist/types/symbolGraph.js +10 -0
- package/dist/types/symbolGraph.js.map +1 -0
- package/dist/types/tools.d.ts +43 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +7 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/utils/fileFilter.d.ts +37 -0
- package/dist/utils/fileFilter.d.ts.map +1 -0
- package/dist/utils/fileFilter.js +91 -0
- package/dist/utils/fileFilter.js.map +1 -0
- package/dist/utils/gitUtils.d.ts +28 -0
- package/dist/utils/gitUtils.d.ts.map +1 -0
- package/dist/utils/gitUtils.js +81 -0
- package/dist/utils/gitUtils.js.map +1 -0
- package/dist/utils/logger.d.ts +15 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +38 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/serialization.d.ts +25 -0
- package/dist/utils/serialization.d.ts.map +1 -0
- package/dist/utils/serialization.js +53 -0
- package/dist/utils/serialization.js.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,2184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in Symbol Sets Module
|
|
3
|
+
*
|
|
4
|
+
* This module centralizes all built-in symbol sets for different programming languages.
|
|
5
|
+
* It provides fast lookup functions for checking if a symbol is a language built-in,
|
|
6
|
+
* which is essential for validation to avoid false positives when detecting hallucinations.
|
|
7
|
+
*
|
|
8
|
+
* Supported Languages:
|
|
9
|
+
* - Python: Built-in functions, types, exceptions, and standard library modules
|
|
10
|
+
* - JavaScript/TypeScript: Built-in globals, constructors, DOM APIs, and utility types
|
|
11
|
+
*
|
|
12
|
+
* @format
|
|
13
|
+
*/
|
|
14
|
+
// ============ Python Built-in Symbol Sets ============
|
|
15
|
+
/**
|
|
16
|
+
* Python built-in functions, types, and constants
|
|
17
|
+
* Based on Python 3.11+ builtins
|
|
18
|
+
*/
|
|
19
|
+
export const PYTHON_BUILTINS = new Set([
|
|
20
|
+
// Built-in functions
|
|
21
|
+
"abs",
|
|
22
|
+
"aiter",
|
|
23
|
+
"all",
|
|
24
|
+
"anext",
|
|
25
|
+
"any",
|
|
26
|
+
"ascii",
|
|
27
|
+
"bin",
|
|
28
|
+
"bool",
|
|
29
|
+
"breakpoint",
|
|
30
|
+
"bytearray",
|
|
31
|
+
"bytes",
|
|
32
|
+
"callable",
|
|
33
|
+
"chr",
|
|
34
|
+
"classmethod",
|
|
35
|
+
"compile",
|
|
36
|
+
"complex",
|
|
37
|
+
"delattr",
|
|
38
|
+
"dict",
|
|
39
|
+
"dir",
|
|
40
|
+
"divmod",
|
|
41
|
+
"enumerate",
|
|
42
|
+
"eval",
|
|
43
|
+
"exec",
|
|
44
|
+
"filter",
|
|
45
|
+
"float",
|
|
46
|
+
"format",
|
|
47
|
+
"frozenset",
|
|
48
|
+
"getattr",
|
|
49
|
+
"globals",
|
|
50
|
+
"hasattr",
|
|
51
|
+
"hash",
|
|
52
|
+
"help",
|
|
53
|
+
"hex",
|
|
54
|
+
"id",
|
|
55
|
+
"input",
|
|
56
|
+
"int",
|
|
57
|
+
"isinstance",
|
|
58
|
+
"issubclass",
|
|
59
|
+
"iter",
|
|
60
|
+
"len",
|
|
61
|
+
"list",
|
|
62
|
+
"locals",
|
|
63
|
+
"map",
|
|
64
|
+
"max",
|
|
65
|
+
"memoryview",
|
|
66
|
+
"min",
|
|
67
|
+
"next",
|
|
68
|
+
"object",
|
|
69
|
+
"oct",
|
|
70
|
+
"open",
|
|
71
|
+
"ord",
|
|
72
|
+
"pow",
|
|
73
|
+
"print",
|
|
74
|
+
"property",
|
|
75
|
+
"range",
|
|
76
|
+
"repr",
|
|
77
|
+
"reversed",
|
|
78
|
+
"round",
|
|
79
|
+
"set",
|
|
80
|
+
"setattr",
|
|
81
|
+
"slice",
|
|
82
|
+
"sorted",
|
|
83
|
+
"staticmethod",
|
|
84
|
+
"str",
|
|
85
|
+
"sum",
|
|
86
|
+
"super",
|
|
87
|
+
"tuple",
|
|
88
|
+
"type",
|
|
89
|
+
"vars",
|
|
90
|
+
"zip",
|
|
91
|
+
// Built-in constants
|
|
92
|
+
"True",
|
|
93
|
+
"False",
|
|
94
|
+
"None",
|
|
95
|
+
"Ellipsis",
|
|
96
|
+
"NotImplemented",
|
|
97
|
+
"__debug__",
|
|
98
|
+
"__name__",
|
|
99
|
+
"__doc__",
|
|
100
|
+
"__package__",
|
|
101
|
+
"__loader__",
|
|
102
|
+
"__spec__",
|
|
103
|
+
// Built-in exceptions (common ones)
|
|
104
|
+
"Exception",
|
|
105
|
+
"BaseException",
|
|
106
|
+
"ValueError",
|
|
107
|
+
"TypeError",
|
|
108
|
+
"KeyError",
|
|
109
|
+
"IndexError",
|
|
110
|
+
"AttributeError",
|
|
111
|
+
"ImportError",
|
|
112
|
+
"RuntimeError",
|
|
113
|
+
"StopIteration",
|
|
114
|
+
"GeneratorExit",
|
|
115
|
+
"AssertionError",
|
|
116
|
+
"NameError",
|
|
117
|
+
"ZeroDivisionError",
|
|
118
|
+
"FileNotFoundError",
|
|
119
|
+
"OSError",
|
|
120
|
+
"IOError",
|
|
121
|
+
"PermissionError",
|
|
122
|
+
"TimeoutError",
|
|
123
|
+
"ConnectionError",
|
|
124
|
+
"BrokenPipeError",
|
|
125
|
+
"UnicodeDecodeError",
|
|
126
|
+
"UnicodeEncodeError",
|
|
127
|
+
"UnicodeError",
|
|
128
|
+
"NotImplementedError",
|
|
129
|
+
"StopAsyncIteration",
|
|
130
|
+
"RecursionError",
|
|
131
|
+
"SystemExit",
|
|
132
|
+
"KeyboardInterrupt",
|
|
133
|
+
"ArithmeticError",
|
|
134
|
+
"LookupError",
|
|
135
|
+
"SyntaxError",
|
|
136
|
+
"IndentationError",
|
|
137
|
+
"TabError",
|
|
138
|
+
"SystemError",
|
|
139
|
+
"BufferError",
|
|
140
|
+
"EOFError",
|
|
141
|
+
"ModuleNotFoundError",
|
|
142
|
+
"UnboundLocalError",
|
|
143
|
+
"BlockingIOError",
|
|
144
|
+
"ChildProcessError",
|
|
145
|
+
"ConnectionAbortedError",
|
|
146
|
+
"ConnectionRefusedError",
|
|
147
|
+
"ConnectionResetError",
|
|
148
|
+
"FileExistsError",
|
|
149
|
+
"InterruptedError",
|
|
150
|
+
"IsADirectoryError",
|
|
151
|
+
"NotADirectoryError",
|
|
152
|
+
"ProcessLookupError",
|
|
153
|
+
"OverflowError",
|
|
154
|
+
"FloatingPointError",
|
|
155
|
+
"Warning",
|
|
156
|
+
"UserWarning",
|
|
157
|
+
"DeprecationWarning",
|
|
158
|
+
"FutureWarning",
|
|
159
|
+
"RuntimeWarning",
|
|
160
|
+
"PendingDeprecationWarning",
|
|
161
|
+
"ResourceWarning",
|
|
162
|
+
"CancelledError",
|
|
163
|
+
// Special names
|
|
164
|
+
"self",
|
|
165
|
+
"cls",
|
|
166
|
+
// Common typing module types (often used without import in type hints)
|
|
167
|
+
"Any",
|
|
168
|
+
"Union",
|
|
169
|
+
"Optional",
|
|
170
|
+
"List",
|
|
171
|
+
"Dict",
|
|
172
|
+
"Set",
|
|
173
|
+
"Tuple",
|
|
174
|
+
"Callable",
|
|
175
|
+
"Type",
|
|
176
|
+
"Generic",
|
|
177
|
+
"TypeVar",
|
|
178
|
+
"Protocol",
|
|
179
|
+
"Final",
|
|
180
|
+
"Literal",
|
|
181
|
+
// Python standard library module names (commonly used as identifiers after import)
|
|
182
|
+
"os",
|
|
183
|
+
"sys",
|
|
184
|
+
"json",
|
|
185
|
+
"re",
|
|
186
|
+
"math",
|
|
187
|
+
"logging",
|
|
188
|
+
"datetime",
|
|
189
|
+
"time",
|
|
190
|
+
"pathlib",
|
|
191
|
+
"collections",
|
|
192
|
+
"itertools",
|
|
193
|
+
"functools",
|
|
194
|
+
"typing",
|
|
195
|
+
"abc",
|
|
196
|
+
"io",
|
|
197
|
+
"hashlib",
|
|
198
|
+
"hmac",
|
|
199
|
+
"secrets",
|
|
200
|
+
"base64",
|
|
201
|
+
"urllib",
|
|
202
|
+
"http",
|
|
203
|
+
"email",
|
|
204
|
+
"html",
|
|
205
|
+
"xml",
|
|
206
|
+
"csv",
|
|
207
|
+
"sqlite3",
|
|
208
|
+
"subprocess",
|
|
209
|
+
"threading",
|
|
210
|
+
"multiprocessing",
|
|
211
|
+
"asyncio",
|
|
212
|
+
"uuid",
|
|
213
|
+
"copy",
|
|
214
|
+
"shutil",
|
|
215
|
+
"tempfile",
|
|
216
|
+
"glob",
|
|
217
|
+
"fnmatch",
|
|
218
|
+
"pickle",
|
|
219
|
+
"struct",
|
|
220
|
+
"traceback",
|
|
221
|
+
"inspect",
|
|
222
|
+
"importlib",
|
|
223
|
+
"contextlib",
|
|
224
|
+
"dataclasses",
|
|
225
|
+
"enum",
|
|
226
|
+
"string",
|
|
227
|
+
"textwrap",
|
|
228
|
+
"random",
|
|
229
|
+
"statistics",
|
|
230
|
+
"decimal",
|
|
231
|
+
"fractions",
|
|
232
|
+
"operator",
|
|
233
|
+
"warnings",
|
|
234
|
+
"unittest",
|
|
235
|
+
"pytest",
|
|
236
|
+
"pprint",
|
|
237
|
+
"socket",
|
|
238
|
+
"signal",
|
|
239
|
+
"select",
|
|
240
|
+
"platform",
|
|
241
|
+
"ctypes",
|
|
242
|
+
"array",
|
|
243
|
+
"queue",
|
|
244
|
+
"heapq",
|
|
245
|
+
"bisect",
|
|
246
|
+
"weakref",
|
|
247
|
+
"types",
|
|
248
|
+
"pdb",
|
|
249
|
+
"dis",
|
|
250
|
+
"ast",
|
|
251
|
+
"token",
|
|
252
|
+
"tokenize",
|
|
253
|
+
"codecs",
|
|
254
|
+
"locale",
|
|
255
|
+
"gettext",
|
|
256
|
+
"argparse",
|
|
257
|
+
"configparser",
|
|
258
|
+
"tomllib",
|
|
259
|
+
// Python dunder names (commonly referenced)
|
|
260
|
+
"__init__",
|
|
261
|
+
"__main__",
|
|
262
|
+
"__all__",
|
|
263
|
+
"__file__",
|
|
264
|
+
"__path__",
|
|
265
|
+
"__builtins__",
|
|
266
|
+
"__import__",
|
|
267
|
+
"__class__",
|
|
268
|
+
"__dict__",
|
|
269
|
+
"__slots__",
|
|
270
|
+
"__str__",
|
|
271
|
+
"__repr__",
|
|
272
|
+
"__len__",
|
|
273
|
+
"__getitem__",
|
|
274
|
+
"__setitem__",
|
|
275
|
+
"__delitem__",
|
|
276
|
+
"__contains__",
|
|
277
|
+
"__iter__",
|
|
278
|
+
"__next__",
|
|
279
|
+
"__enter__",
|
|
280
|
+
"__exit__",
|
|
281
|
+
"__call__",
|
|
282
|
+
"__eq__",
|
|
283
|
+
"__ne__",
|
|
284
|
+
"__lt__",
|
|
285
|
+
"__gt__",
|
|
286
|
+
"__le__",
|
|
287
|
+
"__ge__",
|
|
288
|
+
"__hash__",
|
|
289
|
+
"__bool__",
|
|
290
|
+
"__add__",
|
|
291
|
+
"__sub__",
|
|
292
|
+
"__mul__",
|
|
293
|
+
"__truediv__",
|
|
294
|
+
"__floordiv__",
|
|
295
|
+
"__mod__",
|
|
296
|
+
"__pow__",
|
|
297
|
+
"__and__",
|
|
298
|
+
"__or__",
|
|
299
|
+
"__xor__",
|
|
300
|
+
"__neg__",
|
|
301
|
+
"__pos__",
|
|
302
|
+
"__abs__",
|
|
303
|
+
"__invert__",
|
|
304
|
+
"__aenter__",
|
|
305
|
+
"__aexit__",
|
|
306
|
+
"__aiter__",
|
|
307
|
+
"__anext__",
|
|
308
|
+
// Common Python identifiers that are not hallucinations
|
|
309
|
+
"logger",
|
|
310
|
+
"app",
|
|
311
|
+
"db",
|
|
312
|
+
"session",
|
|
313
|
+
"cursor",
|
|
314
|
+
"conn",
|
|
315
|
+
"connection",
|
|
316
|
+
"engine",
|
|
317
|
+
"metadata",
|
|
318
|
+
"router",
|
|
319
|
+
"schema",
|
|
320
|
+
"config",
|
|
321
|
+
"settings",
|
|
322
|
+
]);
|
|
323
|
+
/**
|
|
324
|
+
* Python built-in types for type hint checking
|
|
325
|
+
*/
|
|
326
|
+
export const PYTHON_BUILTIN_TYPES = new Set([
|
|
327
|
+
// Basic types
|
|
328
|
+
"int",
|
|
329
|
+
"float",
|
|
330
|
+
"str",
|
|
331
|
+
"bool",
|
|
332
|
+
"bytes",
|
|
333
|
+
"bytearray",
|
|
334
|
+
"list",
|
|
335
|
+
"dict",
|
|
336
|
+
"set",
|
|
337
|
+
"frozenset",
|
|
338
|
+
"tuple",
|
|
339
|
+
"None",
|
|
340
|
+
"type",
|
|
341
|
+
"object",
|
|
342
|
+
// typing module types
|
|
343
|
+
"Any",
|
|
344
|
+
"Union",
|
|
345
|
+
"Optional",
|
|
346
|
+
"List",
|
|
347
|
+
"Dict",
|
|
348
|
+
"Set",
|
|
349
|
+
"FrozenSet",
|
|
350
|
+
"Tuple",
|
|
351
|
+
"Callable",
|
|
352
|
+
"Type",
|
|
353
|
+
"Generic",
|
|
354
|
+
"TypeVar",
|
|
355
|
+
"Protocol",
|
|
356
|
+
"Final",
|
|
357
|
+
"Literal",
|
|
358
|
+
"ClassVar",
|
|
359
|
+
"Annotated",
|
|
360
|
+
"TypeAlias",
|
|
361
|
+
"TypeGuard",
|
|
362
|
+
"ParamSpec",
|
|
363
|
+
"Concatenate",
|
|
364
|
+
"Awaitable",
|
|
365
|
+
"Coroutine",
|
|
366
|
+
"AsyncGenerator",
|
|
367
|
+
"AsyncIterator",
|
|
368
|
+
"AsyncIterable",
|
|
369
|
+
"Iterator",
|
|
370
|
+
"Iterable",
|
|
371
|
+
"Generator",
|
|
372
|
+
"Sequence",
|
|
373
|
+
"Mapping",
|
|
374
|
+
"MutableMapping",
|
|
375
|
+
"MutableSequence",
|
|
376
|
+
"MutableSet",
|
|
377
|
+
"AbstractSet",
|
|
378
|
+
"Collection",
|
|
379
|
+
"Container",
|
|
380
|
+
"Reversible",
|
|
381
|
+
"SupportsInt",
|
|
382
|
+
"SupportsFloat",
|
|
383
|
+
"SupportsComplex",
|
|
384
|
+
"SupportsBytes",
|
|
385
|
+
"SupportsAbs",
|
|
386
|
+
"SupportsRound",
|
|
387
|
+
"Hashable",
|
|
388
|
+
"Sized",
|
|
389
|
+
"IO",
|
|
390
|
+
"TextIO",
|
|
391
|
+
"BinaryIO",
|
|
392
|
+
"Pattern",
|
|
393
|
+
"Match",
|
|
394
|
+
"AnyStr",
|
|
395
|
+
"NoReturn",
|
|
396
|
+
"Never",
|
|
397
|
+
"Self",
|
|
398
|
+
"LiteralString",
|
|
399
|
+
"Unpack",
|
|
400
|
+
"TypeVarTuple",
|
|
401
|
+
"Required",
|
|
402
|
+
"NotRequired",
|
|
403
|
+
"ReadOnly",
|
|
404
|
+
// collections.abc types
|
|
405
|
+
"Hashable",
|
|
406
|
+
"Iterable",
|
|
407
|
+
"Iterator",
|
|
408
|
+
"Reversible",
|
|
409
|
+
"Generator",
|
|
410
|
+
"Container",
|
|
411
|
+
"Collection",
|
|
412
|
+
"Callable",
|
|
413
|
+
"Set",
|
|
414
|
+
"MutableSet",
|
|
415
|
+
"Mapping",
|
|
416
|
+
"MutableMapping",
|
|
417
|
+
"Sequence",
|
|
418
|
+
"MutableSequence",
|
|
419
|
+
"ByteString",
|
|
420
|
+
"Awaitable",
|
|
421
|
+
"Coroutine",
|
|
422
|
+
"AsyncIterable",
|
|
423
|
+
"AsyncIterator",
|
|
424
|
+
"AsyncGenerator",
|
|
425
|
+
]);
|
|
426
|
+
// ============ JavaScript/TypeScript Built-in Symbol Sets ============
|
|
427
|
+
/**
|
|
428
|
+
* JavaScript/TypeScript built-in globals and constructors
|
|
429
|
+
* Based on ECMAScript 2023 and common Node.js/Browser APIs
|
|
430
|
+
*/
|
|
431
|
+
export const JS_BUILTINS = new Set([
|
|
432
|
+
// Global objects
|
|
433
|
+
"globalThis",
|
|
434
|
+
"Infinity",
|
|
435
|
+
"NaN",
|
|
436
|
+
"undefined",
|
|
437
|
+
// Fundamental objects
|
|
438
|
+
"Object",
|
|
439
|
+
"Function",
|
|
440
|
+
"Boolean",
|
|
441
|
+
"Symbol",
|
|
442
|
+
// Error objects
|
|
443
|
+
"Error",
|
|
444
|
+
"AggregateError",
|
|
445
|
+
"EvalError",
|
|
446
|
+
"RangeError",
|
|
447
|
+
"ReferenceError",
|
|
448
|
+
"SyntaxError",
|
|
449
|
+
"TypeError",
|
|
450
|
+
"URIError",
|
|
451
|
+
// Numbers and dates
|
|
452
|
+
"Number",
|
|
453
|
+
"BigInt",
|
|
454
|
+
"Math",
|
|
455
|
+
"Date",
|
|
456
|
+
// Text processing
|
|
457
|
+
"String",
|
|
458
|
+
"RegExp",
|
|
459
|
+
// Indexed collections
|
|
460
|
+
"Array",
|
|
461
|
+
"Int8Array",
|
|
462
|
+
"Uint8Array",
|
|
463
|
+
"Uint8ClampedArray",
|
|
464
|
+
"Int16Array",
|
|
465
|
+
"Uint16Array",
|
|
466
|
+
"Int32Array",
|
|
467
|
+
"Uint32Array",
|
|
468
|
+
"Float32Array",
|
|
469
|
+
"Float64Array",
|
|
470
|
+
"BigInt64Array",
|
|
471
|
+
"BigUint64Array",
|
|
472
|
+
// Keyed collections
|
|
473
|
+
"Map",
|
|
474
|
+
"Set",
|
|
475
|
+
"WeakMap",
|
|
476
|
+
"WeakSet",
|
|
477
|
+
"WeakRef",
|
|
478
|
+
"FinalizationRegistry",
|
|
479
|
+
// Structured data
|
|
480
|
+
"ArrayBuffer",
|
|
481
|
+
"SharedArrayBuffer",
|
|
482
|
+
"DataView",
|
|
483
|
+
"Atomics",
|
|
484
|
+
"JSON",
|
|
485
|
+
// Control abstraction
|
|
486
|
+
"Promise",
|
|
487
|
+
"Generator",
|
|
488
|
+
"GeneratorFunction",
|
|
489
|
+
"AsyncFunction",
|
|
490
|
+
"AsyncGenerator",
|
|
491
|
+
"AsyncGeneratorFunction",
|
|
492
|
+
// Reflection
|
|
493
|
+
"Reflect",
|
|
494
|
+
"Proxy",
|
|
495
|
+
// Internationalization
|
|
496
|
+
"Intl",
|
|
497
|
+
// Web APIs (common)
|
|
498
|
+
"console",
|
|
499
|
+
"fetch",
|
|
500
|
+
"setTimeout",
|
|
501
|
+
"setInterval",
|
|
502
|
+
"clearTimeout",
|
|
503
|
+
"clearInterval",
|
|
504
|
+
"setImmediate",
|
|
505
|
+
"clearImmediate",
|
|
506
|
+
"queueMicrotask",
|
|
507
|
+
"URL",
|
|
508
|
+
"URLSearchParams",
|
|
509
|
+
"TextEncoder",
|
|
510
|
+
"TextDecoder",
|
|
511
|
+
"AbortController",
|
|
512
|
+
"AbortSignal",
|
|
513
|
+
"FormData",
|
|
514
|
+
"Headers",
|
|
515
|
+
"Request",
|
|
516
|
+
"Response",
|
|
517
|
+
"Blob",
|
|
518
|
+
"File",
|
|
519
|
+
"FileReader",
|
|
520
|
+
"FileList",
|
|
521
|
+
"Event",
|
|
522
|
+
"EventTarget",
|
|
523
|
+
"CustomEvent",
|
|
524
|
+
"document",
|
|
525
|
+
"window",
|
|
526
|
+
"navigator",
|
|
527
|
+
"location",
|
|
528
|
+
"history",
|
|
529
|
+
"localStorage",
|
|
530
|
+
"sessionStorage",
|
|
531
|
+
"WebSocket",
|
|
532
|
+
"Worker",
|
|
533
|
+
"MessageChannel",
|
|
534
|
+
"MessagePort",
|
|
535
|
+
"Crypto",
|
|
536
|
+
"crypto",
|
|
537
|
+
"SubtleCrypto",
|
|
538
|
+
// Node.js globals
|
|
539
|
+
"process",
|
|
540
|
+
"Buffer",
|
|
541
|
+
"global",
|
|
542
|
+
"__dirname",
|
|
543
|
+
"__filename",
|
|
544
|
+
"require",
|
|
545
|
+
"module",
|
|
546
|
+
"exports",
|
|
547
|
+
// Common functions
|
|
548
|
+
"parseInt",
|
|
549
|
+
"parseFloat",
|
|
550
|
+
"isNaN",
|
|
551
|
+
"isFinite",
|
|
552
|
+
"encodeURI",
|
|
553
|
+
"encodeURIComponent",
|
|
554
|
+
"decodeURI",
|
|
555
|
+
"decodeURIComponent",
|
|
556
|
+
"eval",
|
|
557
|
+
"atob",
|
|
558
|
+
"btoa",
|
|
559
|
+
"alert",
|
|
560
|
+
"confirm",
|
|
561
|
+
"prompt",
|
|
562
|
+
"Image",
|
|
563
|
+
"Audio",
|
|
564
|
+
"Option",
|
|
565
|
+
"Notification",
|
|
566
|
+
"Geolocation",
|
|
567
|
+
"Screen",
|
|
568
|
+
"screen",
|
|
569
|
+
"Performance",
|
|
570
|
+
"performance",
|
|
571
|
+
"requestAnimationFrame",
|
|
572
|
+
"cancelAnimationFrame",
|
|
573
|
+
"requestIdleCallback",
|
|
574
|
+
"cancelIdleCallback",
|
|
575
|
+
"IntersectionObserver",
|
|
576
|
+
"ResizeObserver",
|
|
577
|
+
"MutationObserver",
|
|
578
|
+
"Storage",
|
|
579
|
+
"StorageEvent",
|
|
580
|
+
"indexedDB",
|
|
581
|
+
"IDBDatabase",
|
|
582
|
+
"IDBTransaction",
|
|
583
|
+
"IDBCursor",
|
|
584
|
+
"IDBRequest",
|
|
585
|
+
"ServiceWorker",
|
|
586
|
+
"ServiceWorkerContainer",
|
|
587
|
+
"ServiceWorkerRegistration",
|
|
588
|
+
"Cache",
|
|
589
|
+
"CacheStorage",
|
|
590
|
+
"caches",
|
|
591
|
+
"BroadcastChannel",
|
|
592
|
+
"SharedWorker",
|
|
593
|
+
"WorkerGlobalScope",
|
|
594
|
+
"Window",
|
|
595
|
+
"Document",
|
|
596
|
+
"Element",
|
|
597
|
+
"Node",
|
|
598
|
+
"SVGElement",
|
|
599
|
+
"CanvasRenderingContext2D",
|
|
600
|
+
"WebGLRenderingContext",
|
|
601
|
+
"AudioContext",
|
|
602
|
+
"MediaStream",
|
|
603
|
+
"MediaRecorder",
|
|
604
|
+
"URL",
|
|
605
|
+
"URLSearchParams",
|
|
606
|
+
"WebAssembly",
|
|
607
|
+
"SharedArrayBuffer",
|
|
608
|
+
// Common test globals (Jest/Vitest/Mocha)
|
|
609
|
+
"expect",
|
|
610
|
+
"test",
|
|
611
|
+
"it",
|
|
612
|
+
"describe",
|
|
613
|
+
"beforeEach",
|
|
614
|
+
"afterEach",
|
|
615
|
+
"beforeAll",
|
|
616
|
+
"afterAll",
|
|
617
|
+
"vi",
|
|
618
|
+
"jest",
|
|
619
|
+
"fixture",
|
|
620
|
+
// Iterator/Generator
|
|
621
|
+
"Iterator",
|
|
622
|
+
"AsyncIterator",
|
|
623
|
+
// React Hooks and standard React globals
|
|
624
|
+
"React",
|
|
625
|
+
"useState",
|
|
626
|
+
"useEffect",
|
|
627
|
+
"useContext",
|
|
628
|
+
"useReducer",
|
|
629
|
+
"useCallback",
|
|
630
|
+
"useMemo",
|
|
631
|
+
"useRef",
|
|
632
|
+
"useImperativeHandle",
|
|
633
|
+
"useLayoutEffect",
|
|
634
|
+
"useDebugValue",
|
|
635
|
+
"useDeferredValue",
|
|
636
|
+
"useTransition",
|
|
637
|
+
"useId",
|
|
638
|
+
"useSyncExternalStore",
|
|
639
|
+
"useInsertionEffect",
|
|
640
|
+
// Common method names (to avoid flagging standard API usage as hallucinations)
|
|
641
|
+
"append",
|
|
642
|
+
"get",
|
|
643
|
+
"set",
|
|
644
|
+
"has",
|
|
645
|
+
"delete",
|
|
646
|
+
"entries",
|
|
647
|
+
"keys",
|
|
648
|
+
"values",
|
|
649
|
+
"forEach",
|
|
650
|
+
"map",
|
|
651
|
+
"filter",
|
|
652
|
+
"reduce",
|
|
653
|
+
"some",
|
|
654
|
+
"every",
|
|
655
|
+
"find",
|
|
656
|
+
"push",
|
|
657
|
+
"pop",
|
|
658
|
+
"shift",
|
|
659
|
+
"unshift",
|
|
660
|
+
"splice",
|
|
661
|
+
"slice",
|
|
662
|
+
"join",
|
|
663
|
+
"split",
|
|
664
|
+
"includes",
|
|
665
|
+
"indexOf",
|
|
666
|
+
"lastIndexOf",
|
|
667
|
+
"toString",
|
|
668
|
+
"toJSON",
|
|
669
|
+
"then",
|
|
670
|
+
"catch",
|
|
671
|
+
"finally",
|
|
672
|
+
"json",
|
|
673
|
+
"text",
|
|
674
|
+
"blob",
|
|
675
|
+
"status",
|
|
676
|
+
"ok",
|
|
677
|
+
"headers",
|
|
678
|
+
"clone",
|
|
679
|
+
"addEventListener",
|
|
680
|
+
"removeEventListener",
|
|
681
|
+
"dispatchEvent",
|
|
682
|
+
"preventDefault",
|
|
683
|
+
"stopPropagation",
|
|
684
|
+
"getElementById",
|
|
685
|
+
"querySelector",
|
|
686
|
+
"querySelectorAll",
|
|
687
|
+
// Test framework methods (Jest/Vitest)
|
|
688
|
+
"mockReturnValue",
|
|
689
|
+
"mockResolvedValue",
|
|
690
|
+
"mockRejectedValue",
|
|
691
|
+
"mockImplementation",
|
|
692
|
+
"mockClear",
|
|
693
|
+
"mockReset",
|
|
694
|
+
"mockRestore",
|
|
695
|
+
"spyOn",
|
|
696
|
+
"fn",
|
|
697
|
+
// Node.js Namespace
|
|
698
|
+
"NodeJS",
|
|
699
|
+
// Common library variables (Zod, tRPC, Drizzle, Prisma - used so frequently they might as well be built-ins)
|
|
700
|
+
"z", // Zod
|
|
701
|
+
"t", // tRPC
|
|
702
|
+
"db", // Database
|
|
703
|
+
"prisma", // Prisma
|
|
704
|
+
"ctx", // Context
|
|
705
|
+
]);
|
|
706
|
+
/**
|
|
707
|
+
* Standard HTML tags to avoid false positives in JSX
|
|
708
|
+
*/
|
|
709
|
+
export const HTML_TAGS = new Set([
|
|
710
|
+
"div",
|
|
711
|
+
"span",
|
|
712
|
+
"p",
|
|
713
|
+
"a",
|
|
714
|
+
"button",
|
|
715
|
+
"input",
|
|
716
|
+
"label",
|
|
717
|
+
"form",
|
|
718
|
+
"ul",
|
|
719
|
+
"ol",
|
|
720
|
+
"li",
|
|
721
|
+
"h1",
|
|
722
|
+
"h2",
|
|
723
|
+
"h3",
|
|
724
|
+
"h4",
|
|
725
|
+
"h5",
|
|
726
|
+
"h6",
|
|
727
|
+
"nav",
|
|
728
|
+
"header",
|
|
729
|
+
"footer",
|
|
730
|
+
"main",
|
|
731
|
+
"aside",
|
|
732
|
+
"section",
|
|
733
|
+
"article",
|
|
734
|
+
"table",
|
|
735
|
+
"thead",
|
|
736
|
+
"tbody",
|
|
737
|
+
"tr",
|
|
738
|
+
"th",
|
|
739
|
+
"td",
|
|
740
|
+
"img",
|
|
741
|
+
"br",
|
|
742
|
+
"hr",
|
|
743
|
+
"textarea",
|
|
744
|
+
"select",
|
|
745
|
+
"option",
|
|
746
|
+
"canvas",
|
|
747
|
+
"svg",
|
|
748
|
+
"video",
|
|
749
|
+
"audio",
|
|
750
|
+
"iframe",
|
|
751
|
+
"details",
|
|
752
|
+
"summary",
|
|
753
|
+
"progress",
|
|
754
|
+
"meter",
|
|
755
|
+
"time",
|
|
756
|
+
"mark",
|
|
757
|
+
"cite",
|
|
758
|
+
"code",
|
|
759
|
+
"pre",
|
|
760
|
+
"strong",
|
|
761
|
+
"em",
|
|
762
|
+
"small",
|
|
763
|
+
"i",
|
|
764
|
+
"b",
|
|
765
|
+
"sub",
|
|
766
|
+
"sup",
|
|
767
|
+
"del",
|
|
768
|
+
"ins",
|
|
769
|
+
"kbd",
|
|
770
|
+
"samp",
|
|
771
|
+
"var",
|
|
772
|
+
"q",
|
|
773
|
+
"blockquote",
|
|
774
|
+
"address",
|
|
775
|
+
"dfn",
|
|
776
|
+
"abbr",
|
|
777
|
+
"data",
|
|
778
|
+
"ruby",
|
|
779
|
+
"rt",
|
|
780
|
+
"rp",
|
|
781
|
+
"bdi",
|
|
782
|
+
"bdo",
|
|
783
|
+
"wbr",
|
|
784
|
+
"dl",
|
|
785
|
+
"dt",
|
|
786
|
+
"dd",
|
|
787
|
+
"figure",
|
|
788
|
+
"figcaption",
|
|
789
|
+
"fieldset",
|
|
790
|
+
"legend",
|
|
791
|
+
"template",
|
|
792
|
+
"slot",
|
|
793
|
+
"style",
|
|
794
|
+
"script",
|
|
795
|
+
"link",
|
|
796
|
+
"meta",
|
|
797
|
+
"title",
|
|
798
|
+
"head",
|
|
799
|
+
"html",
|
|
800
|
+
"body",
|
|
801
|
+
]);
|
|
802
|
+
/**
|
|
803
|
+
* Standard SVG tags to avoid false positives in JSX
|
|
804
|
+
*/
|
|
805
|
+
export const SVG_TAGS = new Set([
|
|
806
|
+
"svg",
|
|
807
|
+
"path",
|
|
808
|
+
"g",
|
|
809
|
+
"circle",
|
|
810
|
+
"rect",
|
|
811
|
+
"line",
|
|
812
|
+
"polyline",
|
|
813
|
+
"polygon",
|
|
814
|
+
"ellipse",
|
|
815
|
+
"text",
|
|
816
|
+
"tspan",
|
|
817
|
+
"defs",
|
|
818
|
+
"use",
|
|
819
|
+
"symbol",
|
|
820
|
+
"marker",
|
|
821
|
+
"linearGradient",
|
|
822
|
+
"radialGradient",
|
|
823
|
+
"stop",
|
|
824
|
+
"clipPath",
|
|
825
|
+
"mask",
|
|
826
|
+
"filter",
|
|
827
|
+
"feGaussianBlur",
|
|
828
|
+
"feOffset",
|
|
829
|
+
"feMerge",
|
|
830
|
+
"feMergeNode",
|
|
831
|
+
"feColorMatrix",
|
|
832
|
+
"feComponentTransfer",
|
|
833
|
+
"feFuncR",
|
|
834
|
+
"feFuncG",
|
|
835
|
+
"feFuncB",
|
|
836
|
+
"feFuncA",
|
|
837
|
+
"feComposite",
|
|
838
|
+
"feFlood",
|
|
839
|
+
"feTile",
|
|
840
|
+
"feTurbulence",
|
|
841
|
+
"feDisplacementMap",
|
|
842
|
+
"feMorphology",
|
|
843
|
+
"feSpecularLighting",
|
|
844
|
+
"feDiffuseLighting",
|
|
845
|
+
"fePointLight",
|
|
846
|
+
"feDistantLight",
|
|
847
|
+
"feSpotLight",
|
|
848
|
+
"image",
|
|
849
|
+
"foreignObject",
|
|
850
|
+
]);
|
|
851
|
+
/**
|
|
852
|
+
* TypeScript built-in types (for type reference checking)
|
|
853
|
+
*/
|
|
854
|
+
export const TS_BUILTIN_TYPES = new Set([
|
|
855
|
+
// Primitive types
|
|
856
|
+
"string",
|
|
857
|
+
"number",
|
|
858
|
+
"boolean",
|
|
859
|
+
"null",
|
|
860
|
+
"undefined",
|
|
861
|
+
"void",
|
|
862
|
+
"never",
|
|
863
|
+
"any",
|
|
864
|
+
"unknown",
|
|
865
|
+
"object",
|
|
866
|
+
"symbol",
|
|
867
|
+
"bigint",
|
|
868
|
+
// Wrapper types
|
|
869
|
+
"String",
|
|
870
|
+
"Number",
|
|
871
|
+
"Boolean",
|
|
872
|
+
"Object",
|
|
873
|
+
"Function",
|
|
874
|
+
"Symbol",
|
|
875
|
+
"BigInt",
|
|
876
|
+
// Collections
|
|
877
|
+
"Array",
|
|
878
|
+
"Map",
|
|
879
|
+
"Set",
|
|
880
|
+
"WeakMap",
|
|
881
|
+
"WeakSet",
|
|
882
|
+
"Promise",
|
|
883
|
+
"ReadonlyArray",
|
|
884
|
+
"ReadonlyMap",
|
|
885
|
+
"ReadonlySet",
|
|
886
|
+
// Utility types
|
|
887
|
+
"Partial",
|
|
888
|
+
"Required",
|
|
889
|
+
"Readonly",
|
|
890
|
+
"Record",
|
|
891
|
+
"Pick",
|
|
892
|
+
"Omit",
|
|
893
|
+
"Exclude",
|
|
894
|
+
"Extract",
|
|
895
|
+
"NonNullable",
|
|
896
|
+
"Parameters",
|
|
897
|
+
"ReturnType",
|
|
898
|
+
"ConstructorParameters",
|
|
899
|
+
"InstanceType",
|
|
900
|
+
"ThisType",
|
|
901
|
+
"ThisParameterType",
|
|
902
|
+
"OmitThisParameter",
|
|
903
|
+
"Uppercase",
|
|
904
|
+
"Lowercase",
|
|
905
|
+
"Capitalize",
|
|
906
|
+
"Uncapitalize",
|
|
907
|
+
"Awaited",
|
|
908
|
+
"NoInfer",
|
|
909
|
+
// TypeScript keywords used in type contexts
|
|
910
|
+
"infer",
|
|
911
|
+
// DOM types (common)
|
|
912
|
+
"HTMLElement",
|
|
913
|
+
"Element",
|
|
914
|
+
"Node",
|
|
915
|
+
"Document",
|
|
916
|
+
"Window",
|
|
917
|
+
"Event",
|
|
918
|
+
"MouseEvent",
|
|
919
|
+
"KeyboardEvent",
|
|
920
|
+
"TouchEvent",
|
|
921
|
+
"FocusEvent",
|
|
922
|
+
"DragEvent",
|
|
923
|
+
"ClipboardEvent",
|
|
924
|
+
"PointerEvent",
|
|
925
|
+
"WheelEvent",
|
|
926
|
+
"AnimationEvent",
|
|
927
|
+
"TransitionEvent",
|
|
928
|
+
"CompositionEvent",
|
|
929
|
+
"InputEvent",
|
|
930
|
+
"UIEvent",
|
|
931
|
+
"BeforeUnloadEvent",
|
|
932
|
+
"HashChangeEvent",
|
|
933
|
+
"PopStateEvent",
|
|
934
|
+
"PageTransitionEvent",
|
|
935
|
+
"StorageEvent",
|
|
936
|
+
"MessageEvent",
|
|
937
|
+
"CloseEvent",
|
|
938
|
+
"ErrorEvent",
|
|
939
|
+
"PromiseRejectionEvent",
|
|
940
|
+
"ProgressEvent",
|
|
941
|
+
"IDBVersionChangeEvent",
|
|
942
|
+
"RTCPeerConnectionIceEvent",
|
|
943
|
+
"MediaStreamTrackEvent",
|
|
944
|
+
"RTCDTMFToneChangeEvent",
|
|
945
|
+
"RTCIceCandidate",
|
|
946
|
+
"RTCSessionDescription",
|
|
947
|
+
"RTCDataChannelEvent",
|
|
948
|
+
// HTML Element types
|
|
949
|
+
"HTMLInputElement",
|
|
950
|
+
"HTMLButtonElement",
|
|
951
|
+
"HTMLDivElement",
|
|
952
|
+
"HTMLFormElement",
|
|
953
|
+
"HTMLAnchorElement",
|
|
954
|
+
"HTMLImageElement",
|
|
955
|
+
"HTMLSelectElement",
|
|
956
|
+
"HTMLTextAreaElement",
|
|
957
|
+
"HTMLLabelElement",
|
|
958
|
+
"HTMLSpanElement",
|
|
959
|
+
"HTMLParagraphElement",
|
|
960
|
+
"HTMLHeadingElement",
|
|
961
|
+
"HTMLUListElement",
|
|
962
|
+
"HTMLOListElement",
|
|
963
|
+
"HTMLLIElement",
|
|
964
|
+
"HTMLTableElement",
|
|
965
|
+
"HTMLTableRowElement",
|
|
966
|
+
"HTMLTableCellElement",
|
|
967
|
+
"HTMLTableSectionElement",
|
|
968
|
+
"HTMLCanvasElement",
|
|
969
|
+
"HTMLVideoElement",
|
|
970
|
+
"HTMLAudioElement",
|
|
971
|
+
"HTMLIFrameElement",
|
|
972
|
+
"HTMLScriptElement",
|
|
973
|
+
"HTMLStyleElement",
|
|
974
|
+
"HTMLLinkElement",
|
|
975
|
+
"HTMLMetaElement",
|
|
976
|
+
"HTMLHeadElement",
|
|
977
|
+
"HTMLBodyElement",
|
|
978
|
+
"HTMLHtmlElement",
|
|
979
|
+
"HTMLDocument",
|
|
980
|
+
"DocumentFragment",
|
|
981
|
+
"ShadowRoot",
|
|
982
|
+
"TemplateContent",
|
|
983
|
+
"HTMLTemplateElement",
|
|
984
|
+
"HTMLSlotElement",
|
|
985
|
+
"HTMLOptionElement",
|
|
986
|
+
"HTMLOptGroupElement",
|
|
987
|
+
"HTMLDListElement",
|
|
988
|
+
"HTMLDirectoryElement",
|
|
989
|
+
"HTMLFieldSetElement",
|
|
990
|
+
"HTMLLegendElement",
|
|
991
|
+
"HTMLObjectElement",
|
|
992
|
+
"HTMLParamElement",
|
|
993
|
+
"HTMLAreaElement",
|
|
994
|
+
"HTMLMapElement",
|
|
995
|
+
"HTMLBRElement",
|
|
996
|
+
"HTMLBaseElement",
|
|
997
|
+
"HTMLQuoteElement",
|
|
998
|
+
"HTMLPreElement",
|
|
999
|
+
"HTMLModElement",
|
|
1000
|
+
"HTMLMenuElement",
|
|
1001
|
+
"HTMLDialogElement",
|
|
1002
|
+
"HTMLDataElement",
|
|
1003
|
+
"HTMLTimeElement",
|
|
1004
|
+
"HTMLProgressElement",
|
|
1005
|
+
"HTMLMeterElement",
|
|
1006
|
+
"HTMLOutputElement",
|
|
1007
|
+
"HTMLDetailsElement",
|
|
1008
|
+
"HTMLSummaryElement",
|
|
1009
|
+
"HTMLDataListElement",
|
|
1010
|
+
"HTMLHRElement",
|
|
1011
|
+
"HTMLFrameSetElement",
|
|
1012
|
+
"HTMLFrameElement",
|
|
1013
|
+
// DOM and CSS types
|
|
1014
|
+
"NodeList",
|
|
1015
|
+
"NodeListOf",
|
|
1016
|
+
"HTMLCollection",
|
|
1017
|
+
"DOMTokenList",
|
|
1018
|
+
"DOMStringMap",
|
|
1019
|
+
"DOMRect",
|
|
1020
|
+
"DOMRectReadOnly",
|
|
1021
|
+
"DOMPoint",
|
|
1022
|
+
"DOMPointReadOnly",
|
|
1023
|
+
"DOMQuad",
|
|
1024
|
+
"DOMMatrix",
|
|
1025
|
+
"DOMMatrixReadOnly",
|
|
1026
|
+
"DOMImplementation",
|
|
1027
|
+
"DOMParser",
|
|
1028
|
+
"XMLSerializer",
|
|
1029
|
+
"XPathResult",
|
|
1030
|
+
"XPathExpression",
|
|
1031
|
+
"CSSStyleDeclaration",
|
|
1032
|
+
"CSSRule",
|
|
1033
|
+
"CSSRuleList",
|
|
1034
|
+
"CSSStyleSheet",
|
|
1035
|
+
"CSSStyleRule",
|
|
1036
|
+
"CSSMediaRule",
|
|
1037
|
+
"CSSImportRule",
|
|
1038
|
+
"CSSFontFaceRule",
|
|
1039
|
+
"CSSPageRule",
|
|
1040
|
+
"CSSNamespaceRule",
|
|
1041
|
+
"CSSKeyframesRule",
|
|
1042
|
+
"CSSKeyframeRule",
|
|
1043
|
+
"CSSCounterStyleRule",
|
|
1044
|
+
"CSSSupportsRule",
|
|
1045
|
+
"CSS",
|
|
1046
|
+
"StyleSheet",
|
|
1047
|
+
"StyleSheetList",
|
|
1048
|
+
"MediaList",
|
|
1049
|
+
"Screen",
|
|
1050
|
+
"ScreenOrientation",
|
|
1051
|
+
"VisualViewport",
|
|
1052
|
+
"CaretPosition",
|
|
1053
|
+
"Range",
|
|
1054
|
+
"Selection",
|
|
1055
|
+
"MutationRecord",
|
|
1056
|
+
"MutationObserver",
|
|
1057
|
+
"ResizeObserver",
|
|
1058
|
+
"ResizeObserverEntry",
|
|
1059
|
+
"IntersectionObserver",
|
|
1060
|
+
"IntersectionObserverEntry",
|
|
1061
|
+
"Performance",
|
|
1062
|
+
"PerformanceEntry",
|
|
1063
|
+
"PerformanceMark",
|
|
1064
|
+
"PerformanceMeasure",
|
|
1065
|
+
"PerformanceObserver",
|
|
1066
|
+
"PerformanceObserverEntryList",
|
|
1067
|
+
"PerformanceResourceTiming",
|
|
1068
|
+
"PerformanceNavigationTiming",
|
|
1069
|
+
"PerformancePaintTiming",
|
|
1070
|
+
"PerformanceServerTiming",
|
|
1071
|
+
"PerformanceLongTaskTiming",
|
|
1072
|
+
"PerformanceEventTiming",
|
|
1073
|
+
"PerformanceElementTiming",
|
|
1074
|
+
"PerformanceLayoutShift",
|
|
1075
|
+
"PerformanceLargestContentfulPaint",
|
|
1076
|
+
// Web API types
|
|
1077
|
+
"RequestInit",
|
|
1078
|
+
"ResponseInit",
|
|
1079
|
+
"Request",
|
|
1080
|
+
"Response",
|
|
1081
|
+
"Headers",
|
|
1082
|
+
"HeadersInit",
|
|
1083
|
+
"Body",
|
|
1084
|
+
"BodyInit",
|
|
1085
|
+
"ReadableStream",
|
|
1086
|
+
"WritableStream",
|
|
1087
|
+
"TransformStream",
|
|
1088
|
+
"ReadableStreamDefaultReader",
|
|
1089
|
+
"ReadableStreamDefaultController",
|
|
1090
|
+
"WritableStreamDefaultWriter",
|
|
1091
|
+
"WritableStreamDefaultController",
|
|
1092
|
+
"TransformStreamDefaultController",
|
|
1093
|
+
"Blob",
|
|
1094
|
+
"BlobPart",
|
|
1095
|
+
"BlobPropertyBag",
|
|
1096
|
+
"File",
|
|
1097
|
+
"FilePropertyBag",
|
|
1098
|
+
"FileReader",
|
|
1099
|
+
"FileReaderSync",
|
|
1100
|
+
"FileList",
|
|
1101
|
+
"FormData",
|
|
1102
|
+
"FormDataEntryValue",
|
|
1103
|
+
"URL",
|
|
1104
|
+
"URLSearchParams",
|
|
1105
|
+
"URLSearchParamsInit",
|
|
1106
|
+
"WebSocket",
|
|
1107
|
+
"EventSource",
|
|
1108
|
+
"EventSourceInit",
|
|
1109
|
+
"AbortController",
|
|
1110
|
+
"AbortSignal",
|
|
1111
|
+
"AbortSignalEventMap",
|
|
1112
|
+
"TextEncoder",
|
|
1113
|
+
"TextDecoder",
|
|
1114
|
+
"TextEncoderStream",
|
|
1115
|
+
"TextDecoderStream",
|
|
1116
|
+
"CompressionStream",
|
|
1117
|
+
"DecompressionStream",
|
|
1118
|
+
"Crypto",
|
|
1119
|
+
"CryptoKey",
|
|
1120
|
+
"SubtleCrypto",
|
|
1121
|
+
"RandomSource",
|
|
1122
|
+
"CryptoKeyPair",
|
|
1123
|
+
"JsonWebKey",
|
|
1124
|
+
"AlgorithmIdentifier",
|
|
1125
|
+
"Algorithm",
|
|
1126
|
+
"KeyAlgorithm",
|
|
1127
|
+
"AesKeyAlgorithm",
|
|
1128
|
+
"RsaKeyAlgorithm",
|
|
1129
|
+
"EcKeyAlgorithm",
|
|
1130
|
+
"HmacKeyAlgorithm",
|
|
1131
|
+
"Pbkdf2Params",
|
|
1132
|
+
"AesDerivedKeyParams",
|
|
1133
|
+
"HmacImportParams",
|
|
1134
|
+
"RsaHashedImportParams",
|
|
1135
|
+
"EcKeyImportParams",
|
|
1136
|
+
"AesKeyGenParams",
|
|
1137
|
+
"HmacKeyGenParams",
|
|
1138
|
+
"RsaHashedKeyGenParams",
|
|
1139
|
+
"EcKeyGenParams",
|
|
1140
|
+
// Storage and Cache
|
|
1141
|
+
"Storage",
|
|
1142
|
+
"StorageEvent",
|
|
1143
|
+
"StorageEventInit",
|
|
1144
|
+
"Cache",
|
|
1145
|
+
"CacheStorage",
|
|
1146
|
+
"CacheQueryOptions",
|
|
1147
|
+
"CacheBatchOperation",
|
|
1148
|
+
// React types (common)
|
|
1149
|
+
"React",
|
|
1150
|
+
"ReactNode",
|
|
1151
|
+
"ReactElement",
|
|
1152
|
+
"ReactPortal",
|
|
1153
|
+
"ReactFragment",
|
|
1154
|
+
"ReactChild",
|
|
1155
|
+
"ReactChildren",
|
|
1156
|
+
"ReactText",
|
|
1157
|
+
"JSX",
|
|
1158
|
+
"JSXElement",
|
|
1159
|
+
"JSXElementConstructor",
|
|
1160
|
+
"JSXElementAttributesProperty",
|
|
1161
|
+
"JSXElementChildrenAttribute",
|
|
1162
|
+
"JSXAttribute",
|
|
1163
|
+
"JSXAttributes",
|
|
1164
|
+
"JSXChild",
|
|
1165
|
+
"JSXChildren",
|
|
1166
|
+
"JSXFragment",
|
|
1167
|
+
"JSXIntrinsicAttributes",
|
|
1168
|
+
"JSXIntrinsicElements",
|
|
1169
|
+
"JSX.Library",
|
|
1170
|
+
"JSX.LibraryManagedAttributes",
|
|
1171
|
+
"JSX.Element",
|
|
1172
|
+
"JSX.ElementClass",
|
|
1173
|
+
"JSX.ElementAttributesProperty",
|
|
1174
|
+
"JSX.ElementChildrenAttribute",
|
|
1175
|
+
"JSX.IntrinsicAttributes",
|
|
1176
|
+
"JSX.IntrinsicElements",
|
|
1177
|
+
"FC",
|
|
1178
|
+
"FunctionComponent",
|
|
1179
|
+
"Component",
|
|
1180
|
+
"ComponentClass",
|
|
1181
|
+
"PureComponent",
|
|
1182
|
+
"ComponentType",
|
|
1183
|
+
"ComponentProps",
|
|
1184
|
+
"ComponentPropsWithRef",
|
|
1185
|
+
"ComponentPropsWithoutRef",
|
|
1186
|
+
"ComponentState",
|
|
1187
|
+
"ComponentLifecycle",
|
|
1188
|
+
"ReactComponentElement",
|
|
1189
|
+
"ClassAttributes",
|
|
1190
|
+
"DOMAttributes",
|
|
1191
|
+
"HTMLAttributes",
|
|
1192
|
+
"SVGAttributes",
|
|
1193
|
+
"AriaAttributes",
|
|
1194
|
+
"AllHTMLAttributes",
|
|
1195
|
+
"AnchorHTMLAttributes",
|
|
1196
|
+
"AreaHTMLAttributes",
|
|
1197
|
+
"AudioHTMLAttributes",
|
|
1198
|
+
"BaseHTMLAttributes",
|
|
1199
|
+
"BlockquoteHTMLAttributes",
|
|
1200
|
+
"ButtonHTMLAttributes",
|
|
1201
|
+
"CanvasHTMLAttributes",
|
|
1202
|
+
"ColHTMLAttributes",
|
|
1203
|
+
"ColgroupHTMLAttributes",
|
|
1204
|
+
"DataHTMLAttributes",
|
|
1205
|
+
"DetailsHTMLAttributes",
|
|
1206
|
+
"DelHTMLAttributes",
|
|
1207
|
+
"DialogHTMLAttributes",
|
|
1208
|
+
"EmbedHTMLAttributes",
|
|
1209
|
+
"FieldsetHTMLAttributes",
|
|
1210
|
+
"FormHTMLAttributes",
|
|
1211
|
+
"HtmlHTMLAttributes",
|
|
1212
|
+
"IframeHTMLAttributes",
|
|
1213
|
+
"ImgHTMLAttributes",
|
|
1214
|
+
"InputHTMLAttributes",
|
|
1215
|
+
"InsHTMLAttributes",
|
|
1216
|
+
"KeygenHTMLAttributes",
|
|
1217
|
+
"LabelHTMLAttributes",
|
|
1218
|
+
"LegendHTMLAttributes",
|
|
1219
|
+
"LiHTMLAttributes",
|
|
1220
|
+
"LinkHTMLAttributes",
|
|
1221
|
+
"MapHTMLAttributes",
|
|
1222
|
+
"MenuHTMLAttributes",
|
|
1223
|
+
"MetaHTMLAttributes",
|
|
1224
|
+
"MeterHTMLAttributes",
|
|
1225
|
+
"ObjectHTMLAttributes",
|
|
1226
|
+
"OlHTMLAttributes",
|
|
1227
|
+
"OptgroupHTMLAttributes",
|
|
1228
|
+
"OptionHTMLAttributes",
|
|
1229
|
+
"OutputHTMLAttributes",
|
|
1230
|
+
"ParamHTMLAttributes",
|
|
1231
|
+
"ProgressHTMLAttributes",
|
|
1232
|
+
"QuoteHTMLAttributes",
|
|
1233
|
+
"SlotHTMLAttributes",
|
|
1234
|
+
"ScriptHTMLAttributes",
|
|
1235
|
+
"SelectHTMLAttributes",
|
|
1236
|
+
"SourceHTMLAttributes",
|
|
1237
|
+
"StyleHTMLAttributes",
|
|
1238
|
+
"SummaryHTMLAttributes",
|
|
1239
|
+
"TableHTMLAttributes",
|
|
1240
|
+
"TableDataCellHTMLAttributes",
|
|
1241
|
+
"TableHeaderCellHTMLAttributes",
|
|
1242
|
+
"TableColHTMLAttributes",
|
|
1243
|
+
"TableRowHTMLAttributes",
|
|
1244
|
+
"TableSectionHTMLAttributes",
|
|
1245
|
+
"TextareaHTMLAttributes",
|
|
1246
|
+
"TdHTMLAttributes",
|
|
1247
|
+
"ThHTMLAttributes",
|
|
1248
|
+
"TimeHTMLAttributes",
|
|
1249
|
+
"TrackHTMLAttributes",
|
|
1250
|
+
"VideoHTMLAttributes",
|
|
1251
|
+
"WebViewHTMLAttributes",
|
|
1252
|
+
"SVGProps",
|
|
1253
|
+
"SVGLineElementAttributes",
|
|
1254
|
+
"SVGPathElementAttributes",
|
|
1255
|
+
"SVGTextElementAttributes",
|
|
1256
|
+
"PropsWithChildren",
|
|
1257
|
+
"PropsWithRef",
|
|
1258
|
+
"Provider",
|
|
1259
|
+
"Consumer",
|
|
1260
|
+
"Context",
|
|
1261
|
+
"RefObject",
|
|
1262
|
+
"RefCallback",
|
|
1263
|
+
"Ref",
|
|
1264
|
+
"MutableRefObject",
|
|
1265
|
+
"LegacyRef",
|
|
1266
|
+
"ForwardRefRenderFunction",
|
|
1267
|
+
"ForwardRefExoticComponent",
|
|
1268
|
+
"ForwardRefExoticComponent",
|
|
1269
|
+
"ExoticComponent",
|
|
1270
|
+
"NamedExoticComponent",
|
|
1271
|
+
"MemoExoticComponent",
|
|
1272
|
+
"LazyExoticComponent",
|
|
1273
|
+
"SuspenseProps",
|
|
1274
|
+
"SuspenseListProps",
|
|
1275
|
+
"TransitionStartFunction",
|
|
1276
|
+
"TransitionFunction",
|
|
1277
|
+
"FormEvent",
|
|
1278
|
+
"ChangeEvent",
|
|
1279
|
+
"KeyboardEvent",
|
|
1280
|
+
"MouseEvent",
|
|
1281
|
+
"TouchEvent",
|
|
1282
|
+
"PointerEvent",
|
|
1283
|
+
"FocusEvent",
|
|
1284
|
+
"ClipboardEvent",
|
|
1285
|
+
"DragEvent",
|
|
1286
|
+
"AnimationEvent",
|
|
1287
|
+
"TransitionEvent",
|
|
1288
|
+
"CompositionEvent",
|
|
1289
|
+
"InputEvent",
|
|
1290
|
+
"UIEvent",
|
|
1291
|
+
"WheelEvent",
|
|
1292
|
+
"SyntheticEvent",
|
|
1293
|
+
"BaseSyntheticEvent",
|
|
1294
|
+
"InvalidEvent",
|
|
1295
|
+
"TargetedEvent",
|
|
1296
|
+
// React hooks
|
|
1297
|
+
"useState",
|
|
1298
|
+
"useEffect",
|
|
1299
|
+
"useLayoutEffect",
|
|
1300
|
+
"useInsertionEffect",
|
|
1301
|
+
"useCallback",
|
|
1302
|
+
"useMemo",
|
|
1303
|
+
"useRef",
|
|
1304
|
+
"useImperativeHandle",
|
|
1305
|
+
"useContext",
|
|
1306
|
+
"useReducer",
|
|
1307
|
+
"useDebugValue",
|
|
1308
|
+
"useDeferredValue",
|
|
1309
|
+
"useTransition",
|
|
1310
|
+
"useId",
|
|
1311
|
+
"useSyncExternalStore",
|
|
1312
|
+
// Zod types (common)
|
|
1313
|
+
"ZodType",
|
|
1314
|
+
"ZodSchema",
|
|
1315
|
+
"ZodError",
|
|
1316
|
+
"ZodIssue",
|
|
1317
|
+
"ZodIssueCode",
|
|
1318
|
+
"ZodFormattedError",
|
|
1319
|
+
"ZodParsedType",
|
|
1320
|
+
"ZodTypeDef",
|
|
1321
|
+
"ZodRawShape",
|
|
1322
|
+
"ZodIntersection",
|
|
1323
|
+
"ZodUnion",
|
|
1324
|
+
"ZodDiscriminatedUnion",
|
|
1325
|
+
"ZodDiscriminatedUnionOption",
|
|
1326
|
+
"ZodTuple",
|
|
1327
|
+
"ZodRecord",
|
|
1328
|
+
"ZodMap",
|
|
1329
|
+
"ZodSet",
|
|
1330
|
+
"ZodFunction",
|
|
1331
|
+
"ZodPromise",
|
|
1332
|
+
"ZodLazy",
|
|
1333
|
+
"ZodLiteral",
|
|
1334
|
+
"ZodEnum",
|
|
1335
|
+
"ZodNativeEnum",
|
|
1336
|
+
"ZodOptional",
|
|
1337
|
+
"ZodNullable",
|
|
1338
|
+
"ZodDefault",
|
|
1339
|
+
"ZodReadonly",
|
|
1340
|
+
"ZodCatch",
|
|
1341
|
+
"ZodBranded",
|
|
1342
|
+
"ZodPipeline",
|
|
1343
|
+
"ZodEffects",
|
|
1344
|
+
"ZodTransformer",
|
|
1345
|
+
"ZodPreprocess",
|
|
1346
|
+
"ZodRefinement",
|
|
1347
|
+
"ZodSuperRefinement",
|
|
1348
|
+
"ZodCustomIssueParams",
|
|
1349
|
+
"ZodString",
|
|
1350
|
+
"ZodNumber",
|
|
1351
|
+
"ZodBigInt",
|
|
1352
|
+
"ZodBoolean",
|
|
1353
|
+
"ZodDate",
|
|
1354
|
+
"ZodSymbol",
|
|
1355
|
+
"ZodUndefined",
|
|
1356
|
+
"ZodNull",
|
|
1357
|
+
"ZodVoid",
|
|
1358
|
+
"ZodAny",
|
|
1359
|
+
"ZodUnknown",
|
|
1360
|
+
"ZodNever",
|
|
1361
|
+
"ZodArray",
|
|
1362
|
+
"ZodObject",
|
|
1363
|
+
"ZodBoolean",
|
|
1364
|
+
// Node types
|
|
1365
|
+
"Buffer",
|
|
1366
|
+
"NodeJS",
|
|
1367
|
+
"Process",
|
|
1368
|
+
"Global",
|
|
1369
|
+
"Console",
|
|
1370
|
+
"Timer",
|
|
1371
|
+
"Timeout",
|
|
1372
|
+
"Immediate",
|
|
1373
|
+
"Require",
|
|
1374
|
+
"NodeModule",
|
|
1375
|
+
"NodeRequire",
|
|
1376
|
+
"NodeJS.Global",
|
|
1377
|
+
"NodeJS.Process",
|
|
1378
|
+
"NodeJS.ReadableStream",
|
|
1379
|
+
"NodeJS.WritableStream",
|
|
1380
|
+
"NodeJS.ReadWriteStream",
|
|
1381
|
+
"NodeJS.Dict",
|
|
1382
|
+
"NodeJS.TypedArray",
|
|
1383
|
+
"NodeJS.ArrayBufferView",
|
|
1384
|
+
// Error types
|
|
1385
|
+
"Error",
|
|
1386
|
+
"TypeError",
|
|
1387
|
+
"RangeError",
|
|
1388
|
+
"SyntaxError",
|
|
1389
|
+
"ReferenceError",
|
|
1390
|
+
"EvalError",
|
|
1391
|
+
"URIError",
|
|
1392
|
+
"AggregateError",
|
|
1393
|
+
// Iterator types
|
|
1394
|
+
"Iterator",
|
|
1395
|
+
"IterableIterator",
|
|
1396
|
+
"AsyncIterator",
|
|
1397
|
+
"AsyncIterableIterator",
|
|
1398
|
+
"Generator",
|
|
1399
|
+
"AsyncGenerator",
|
|
1400
|
+
"Iterable",
|
|
1401
|
+
"AsyncIterable",
|
|
1402
|
+
"IteratorResult",
|
|
1403
|
+
"IteratorReturnResult",
|
|
1404
|
+
"IteratorYieldResult",
|
|
1405
|
+
"ArrayLike",
|
|
1406
|
+
"ArrayBufferLike",
|
|
1407
|
+
"ArrayBufferView",
|
|
1408
|
+
"ReadonlyArray",
|
|
1409
|
+
"ReadonlyMap",
|
|
1410
|
+
"ReadonlySet",
|
|
1411
|
+
// TypeScript lib types
|
|
1412
|
+
"PropertyKey",
|
|
1413
|
+
"ThisParameterType",
|
|
1414
|
+
"OmitThisParameter",
|
|
1415
|
+
"ThisType",
|
|
1416
|
+
"Uppercase",
|
|
1417
|
+
"Lowercase",
|
|
1418
|
+
"Capitalize",
|
|
1419
|
+
"Uncapitalize",
|
|
1420
|
+
// Utility types from lib.es5.d.ts and lib.dom.d.ts
|
|
1421
|
+
"Exclude",
|
|
1422
|
+
"Extract",
|
|
1423
|
+
"NonNullable",
|
|
1424
|
+
"Parameters",
|
|
1425
|
+
"ConstructorParameters",
|
|
1426
|
+
"ReturnType",
|
|
1427
|
+
"InstanceType",
|
|
1428
|
+
"ThisParameterType",
|
|
1429
|
+
"OmitThisParameter",
|
|
1430
|
+
"ThisType",
|
|
1431
|
+
"Readonly",
|
|
1432
|
+
"Partial",
|
|
1433
|
+
"Required",
|
|
1434
|
+
"Pick",
|
|
1435
|
+
"Omit",
|
|
1436
|
+
"Record",
|
|
1437
|
+
"Awaited",
|
|
1438
|
+
"NoInfer",
|
|
1439
|
+
"Uppercase",
|
|
1440
|
+
"Lowercase",
|
|
1441
|
+
"Capitalize",
|
|
1442
|
+
"Uncapitalize",
|
|
1443
|
+
// Additional type helpers
|
|
1444
|
+
"ElementRef",
|
|
1445
|
+
"ComponentRef",
|
|
1446
|
+
"ElementType",
|
|
1447
|
+
"ComponentPropsWithoutRef",
|
|
1448
|
+
"ComponentPropsWithRef",
|
|
1449
|
+
// Additional built-in utility types
|
|
1450
|
+
"ArrayBufferTypes",
|
|
1451
|
+
"ArrayBufferView",
|
|
1452
|
+
]);
|
|
1453
|
+
/**
|
|
1454
|
+
* Get Node.js built-in modules.
|
|
1455
|
+
*
|
|
1456
|
+
* @returns A Set of Node.js built-In module names
|
|
1457
|
+
*/
|
|
1458
|
+
export function getNodeBuiltInModules() {
|
|
1459
|
+
return NODE_BUILTIN_MODULES;
|
|
1460
|
+
}
|
|
1461
|
+
/**
|
|
1462
|
+
* Node.js built-in modules
|
|
1463
|
+
* Based on Node.js 20+ documentation
|
|
1464
|
+
*/
|
|
1465
|
+
export const NODE_BUILTIN_MODULES = new Set([
|
|
1466
|
+
"assert",
|
|
1467
|
+
"async_hooks",
|
|
1468
|
+
"buffer",
|
|
1469
|
+
"child_process",
|
|
1470
|
+
"cluster",
|
|
1471
|
+
"console",
|
|
1472
|
+
"constants",
|
|
1473
|
+
"crypto",
|
|
1474
|
+
"dgram",
|
|
1475
|
+
"diagnostics_channel",
|
|
1476
|
+
"dns",
|
|
1477
|
+
"domain",
|
|
1478
|
+
"events",
|
|
1479
|
+
"fs",
|
|
1480
|
+
"fs/promises",
|
|
1481
|
+
"http",
|
|
1482
|
+
"http2",
|
|
1483
|
+
"https",
|
|
1484
|
+
"inspector",
|
|
1485
|
+
"module",
|
|
1486
|
+
"net",
|
|
1487
|
+
"os",
|
|
1488
|
+
"path",
|
|
1489
|
+
"path/posix",
|
|
1490
|
+
"path/win32",
|
|
1491
|
+
"perf_hooks",
|
|
1492
|
+
"process",
|
|
1493
|
+
"punycode",
|
|
1494
|
+
"querystring",
|
|
1495
|
+
"readline",
|
|
1496
|
+
"repl",
|
|
1497
|
+
"stream",
|
|
1498
|
+
"stream/consumers",
|
|
1499
|
+
"stream/promises",
|
|
1500
|
+
"stream/web",
|
|
1501
|
+
"string_decoder",
|
|
1502
|
+
"sys",
|
|
1503
|
+
"timers",
|
|
1504
|
+
"timers/promises",
|
|
1505
|
+
"tls",
|
|
1506
|
+
"trace_events",
|
|
1507
|
+
"tty",
|
|
1508
|
+
"url",
|
|
1509
|
+
"util",
|
|
1510
|
+
"v8",
|
|
1511
|
+
"vm",
|
|
1512
|
+
"wasi",
|
|
1513
|
+
"worker_threads",
|
|
1514
|
+
"zlib",
|
|
1515
|
+
]);
|
|
1516
|
+
// ============ Helper Functions ============
|
|
1517
|
+
/**
|
|
1518
|
+
* Check if a name is a Python built-in function, type, or constant.
|
|
1519
|
+
* @param name - The symbol name to check
|
|
1520
|
+
* @returns true if the name is a Python built-in
|
|
1521
|
+
*/
|
|
1522
|
+
export function isPythonBuiltin(name) {
|
|
1523
|
+
return (PYTHON_BUILTINS.has(name) ||
|
|
1524
|
+
PYTHON_BUILTIN_TYPES.has(name) ||
|
|
1525
|
+
PYTHON_COMMON_METHODS.has(name));
|
|
1526
|
+
}
|
|
1527
|
+
/**
|
|
1528
|
+
* Common method names from popular libraries that should not be flagged as hallucinations.
|
|
1529
|
+
* These are methods that are commonly returned by library functions but not tracked in our symbol table.
|
|
1530
|
+
*/
|
|
1531
|
+
export const COMMON_LIBRARY_METHODS = new Set([
|
|
1532
|
+
// React DOM methods
|
|
1533
|
+
"render",
|
|
1534
|
+
"unmount",
|
|
1535
|
+
"hydrate",
|
|
1536
|
+
// Array/Collection methods (JavaScript built-ins)
|
|
1537
|
+
"push",
|
|
1538
|
+
"pop",
|
|
1539
|
+
"shift",
|
|
1540
|
+
"unshift",
|
|
1541
|
+
"slice",
|
|
1542
|
+
"splice",
|
|
1543
|
+
"concat",
|
|
1544
|
+
"join",
|
|
1545
|
+
"reverse",
|
|
1546
|
+
"sort",
|
|
1547
|
+
"filter",
|
|
1548
|
+
"map",
|
|
1549
|
+
"reduce",
|
|
1550
|
+
"reduceRight",
|
|
1551
|
+
"forEach",
|
|
1552
|
+
"find",
|
|
1553
|
+
"findIndex",
|
|
1554
|
+
"findLast",
|
|
1555
|
+
"findLastIndex",
|
|
1556
|
+
"some",
|
|
1557
|
+
"every",
|
|
1558
|
+
"includes",
|
|
1559
|
+
"indexOf",
|
|
1560
|
+
"lastIndexOf",
|
|
1561
|
+
"flat",
|
|
1562
|
+
"flatMap",
|
|
1563
|
+
"fill",
|
|
1564
|
+
"copyWithin",
|
|
1565
|
+
"entries",
|
|
1566
|
+
"keys",
|
|
1567
|
+
"values",
|
|
1568
|
+
"at",
|
|
1569
|
+
"toReversed",
|
|
1570
|
+
"toSorted",
|
|
1571
|
+
"toSpliced",
|
|
1572
|
+
"with",
|
|
1573
|
+
// String methods
|
|
1574
|
+
"charAt",
|
|
1575
|
+
"charCodeAt",
|
|
1576
|
+
"codePointAt",
|
|
1577
|
+
"endsWith",
|
|
1578
|
+
"startsWith",
|
|
1579
|
+
"toLowerCase",
|
|
1580
|
+
"toUpperCase",
|
|
1581
|
+
"trim",
|
|
1582
|
+
"trimStart",
|
|
1583
|
+
"trimEnd",
|
|
1584
|
+
"padStart",
|
|
1585
|
+
"padEnd",
|
|
1586
|
+
"repeat",
|
|
1587
|
+
"replace",
|
|
1588
|
+
"replaceAll",
|
|
1589
|
+
"split",
|
|
1590
|
+
"substring",
|
|
1591
|
+
"substr",
|
|
1592
|
+
"match",
|
|
1593
|
+
"matchAll",
|
|
1594
|
+
"search",
|
|
1595
|
+
"localeCompare",
|
|
1596
|
+
"normalize",
|
|
1597
|
+
"isWellFormed",
|
|
1598
|
+
"toWellFormed",
|
|
1599
|
+
// Object methods
|
|
1600
|
+
"toString",
|
|
1601
|
+
"toLocaleString",
|
|
1602
|
+
"valueOf",
|
|
1603
|
+
"hasOwnProperty",
|
|
1604
|
+
"isPrototypeOf",
|
|
1605
|
+
"propertyIsEnumerable",
|
|
1606
|
+
// Map/Set methods
|
|
1607
|
+
"get",
|
|
1608
|
+
"set",
|
|
1609
|
+
"has",
|
|
1610
|
+
"delete",
|
|
1611
|
+
"clear",
|
|
1612
|
+
"add",
|
|
1613
|
+
"size",
|
|
1614
|
+
// Promise methods
|
|
1615
|
+
"then",
|
|
1616
|
+
"catch",
|
|
1617
|
+
"finally",
|
|
1618
|
+
// Date methods
|
|
1619
|
+
"getTime",
|
|
1620
|
+
"getFullYear",
|
|
1621
|
+
"getMonth",
|
|
1622
|
+
"getDate",
|
|
1623
|
+
"getDay",
|
|
1624
|
+
"getHours",
|
|
1625
|
+
"getMinutes",
|
|
1626
|
+
"getSeconds",
|
|
1627
|
+
"getMilliseconds",
|
|
1628
|
+
"toISOString",
|
|
1629
|
+
"toDateString",
|
|
1630
|
+
"toTimeString",
|
|
1631
|
+
"toLocaleDateString",
|
|
1632
|
+
"toLocaleTimeString",
|
|
1633
|
+
"toLocaleString",
|
|
1634
|
+
"toJSON",
|
|
1635
|
+
// Number methods
|
|
1636
|
+
"toExponential",
|
|
1637
|
+
"toFixed",
|
|
1638
|
+
"toPrecision",
|
|
1639
|
+
"toLocaleString",
|
|
1640
|
+
"toString",
|
|
1641
|
+
// DOM methods
|
|
1642
|
+
"addEventListener",
|
|
1643
|
+
"removeEventListener",
|
|
1644
|
+
"dispatchEvent",
|
|
1645
|
+
"appendChild",
|
|
1646
|
+
"removeChild",
|
|
1647
|
+
"insertBefore",
|
|
1648
|
+
"replaceChild",
|
|
1649
|
+
"cloneNode",
|
|
1650
|
+
"contains",
|
|
1651
|
+
"querySelector",
|
|
1652
|
+
"querySelectorAll",
|
|
1653
|
+
"getElementById",
|
|
1654
|
+
"getElementsByClassName",
|
|
1655
|
+
"getElementsByTagName",
|
|
1656
|
+
"setAttribute",
|
|
1657
|
+
"getAttribute",
|
|
1658
|
+
"removeAttribute",
|
|
1659
|
+
"hasAttribute",
|
|
1660
|
+
"classList",
|
|
1661
|
+
"focus",
|
|
1662
|
+
"blur",
|
|
1663
|
+
"click",
|
|
1664
|
+
"submit",
|
|
1665
|
+
"reset",
|
|
1666
|
+
"scrollIntoView",
|
|
1667
|
+
"getBoundingClientRect",
|
|
1668
|
+
"getComputedStyle",
|
|
1669
|
+
// Event/DOM specifics (Vibe whitelisting)
|
|
1670
|
+
"preventDefault",
|
|
1671
|
+
"stopPropagation",
|
|
1672
|
+
"stopImmediatePropagation",
|
|
1673
|
+
"persist",
|
|
1674
|
+
// Date specifics
|
|
1675
|
+
"setDate",
|
|
1676
|
+
"setFullYear",
|
|
1677
|
+
"setHours",
|
|
1678
|
+
"setMinutes",
|
|
1679
|
+
"setSeconds",
|
|
1680
|
+
"setMilliseconds",
|
|
1681
|
+
"setMonth",
|
|
1682
|
+
"setTime",
|
|
1683
|
+
"setUTCDate",
|
|
1684
|
+
"setUTCFullYear",
|
|
1685
|
+
"setUTCHours",
|
|
1686
|
+
"setUTCMilliseconds",
|
|
1687
|
+
"setUTCMinutes",
|
|
1688
|
+
"setUTCMonth",
|
|
1689
|
+
"setUTCSeconds",
|
|
1690
|
+
"format",
|
|
1691
|
+
"formatToParts",
|
|
1692
|
+
"resolvedOptions",
|
|
1693
|
+
"NumberFormat",
|
|
1694
|
+
"DateTimeFormat",
|
|
1695
|
+
"RelativeTimeFormat",
|
|
1696
|
+
"Intl",
|
|
1697
|
+
// Common library methods
|
|
1698
|
+
"subscribe",
|
|
1699
|
+
"unsubscribe",
|
|
1700
|
+
"dispatch",
|
|
1701
|
+
"getState",
|
|
1702
|
+
"connect",
|
|
1703
|
+
"disconnect",
|
|
1704
|
+
"on",
|
|
1705
|
+
"off",
|
|
1706
|
+
"emit",
|
|
1707
|
+
"once",
|
|
1708
|
+
"pipe",
|
|
1709
|
+
"tap",
|
|
1710
|
+
"debounce",
|
|
1711
|
+
"throttle",
|
|
1712
|
+
"clone",
|
|
1713
|
+
"merge",
|
|
1714
|
+
"extend",
|
|
1715
|
+
"assign",
|
|
1716
|
+
"pick",
|
|
1717
|
+
"omit",
|
|
1718
|
+
"defaults",
|
|
1719
|
+
"isEqual",
|
|
1720
|
+
"isEmpty",
|
|
1721
|
+
"isArray",
|
|
1722
|
+
"isObject",
|
|
1723
|
+
"isString",
|
|
1724
|
+
"isNumber",
|
|
1725
|
+
"isBoolean",
|
|
1726
|
+
"isFunction",
|
|
1727
|
+
"isNull",
|
|
1728
|
+
"isUndefined",
|
|
1729
|
+
"isDefined",
|
|
1730
|
+
"isNaN",
|
|
1731
|
+
"isFinite",
|
|
1732
|
+
// Fluent API / Method chaining (Zod, Query Client, etc.)
|
|
1733
|
+
"string",
|
|
1734
|
+
"number",
|
|
1735
|
+
"boolean",
|
|
1736
|
+
"object",
|
|
1737
|
+
"array",
|
|
1738
|
+
"min",
|
|
1739
|
+
"max",
|
|
1740
|
+
"email",
|
|
1741
|
+
"url",
|
|
1742
|
+
"regex",
|
|
1743
|
+
"optional",
|
|
1744
|
+
"nullable",
|
|
1745
|
+
"default",
|
|
1746
|
+
"refine",
|
|
1747
|
+
"transform",
|
|
1748
|
+
"parse",
|
|
1749
|
+
"safeParse",
|
|
1750
|
+
"parseAsync",
|
|
1751
|
+
"safeParseAsync",
|
|
1752
|
+
"length",
|
|
1753
|
+
"datetime",
|
|
1754
|
+
"int",
|
|
1755
|
+
"positive",
|
|
1756
|
+
"negative",
|
|
1757
|
+
"multipleOf",
|
|
1758
|
+
// React Query / TanStack Query
|
|
1759
|
+
"invalidateQueries",
|
|
1760
|
+
"refetchQueries",
|
|
1761
|
+
"setQueryData",
|
|
1762
|
+
"getQueryData",
|
|
1763
|
+
"prefetchQuery",
|
|
1764
|
+
"fetchQuery",
|
|
1765
|
+
"cancelQueries",
|
|
1766
|
+
"removeQueries",
|
|
1767
|
+
"resetQueries",
|
|
1768
|
+
"isFetching",
|
|
1769
|
+
"isMutating",
|
|
1770
|
+
"refetch",
|
|
1771
|
+
"mutate",
|
|
1772
|
+
"mutateAsync",
|
|
1773
|
+
// Fetch API / HTTP
|
|
1774
|
+
"json",
|
|
1775
|
+
"text",
|
|
1776
|
+
"blob",
|
|
1777
|
+
"arrayBuffer",
|
|
1778
|
+
"formData",
|
|
1779
|
+
"ok",
|
|
1780
|
+
"status",
|
|
1781
|
+
"statusText",
|
|
1782
|
+
"headers",
|
|
1783
|
+
"body",
|
|
1784
|
+
"url",
|
|
1785
|
+
"redirected",
|
|
1786
|
+
"type",
|
|
1787
|
+
// AbortController
|
|
1788
|
+
"abort",
|
|
1789
|
+
"signal",
|
|
1790
|
+
"aborted",
|
|
1791
|
+
"reason",
|
|
1792
|
+
"writeText",
|
|
1793
|
+
"readText",
|
|
1794
|
+
"clipboard",
|
|
1795
|
+
"reload",
|
|
1796
|
+
"close",
|
|
1797
|
+
"open",
|
|
1798
|
+
"send",
|
|
1799
|
+
"onmessage",
|
|
1800
|
+
"onerror",
|
|
1801
|
+
"onopen",
|
|
1802
|
+
"onclose",
|
|
1803
|
+
// Toast/Notification libraries
|
|
1804
|
+
"success",
|
|
1805
|
+
"error",
|
|
1806
|
+
"warning",
|
|
1807
|
+
"info",
|
|
1808
|
+
"promise",
|
|
1809
|
+
"loading",
|
|
1810
|
+
"dismiss",
|
|
1811
|
+
"update",
|
|
1812
|
+
// Router methods
|
|
1813
|
+
"push",
|
|
1814
|
+
"replace",
|
|
1815
|
+
"back",
|
|
1816
|
+
"forward",
|
|
1817
|
+
"go",
|
|
1818
|
+
"prefetch",
|
|
1819
|
+
"reload",
|
|
1820
|
+
// Form libraries
|
|
1821
|
+
"register",
|
|
1822
|
+
"handleSubmit",
|
|
1823
|
+
"watch",
|
|
1824
|
+
"setValue",
|
|
1825
|
+
"getValues",
|
|
1826
|
+
"reset",
|
|
1827
|
+
"trigger",
|
|
1828
|
+
"setError",
|
|
1829
|
+
"clearErrors",
|
|
1830
|
+
"formState",
|
|
1831
|
+
// Common ORM/Database methods
|
|
1832
|
+
"findMany",
|
|
1833
|
+
"findUnique",
|
|
1834
|
+
"findFirst",
|
|
1835
|
+
"create",
|
|
1836
|
+
"createMany",
|
|
1837
|
+
"update",
|
|
1838
|
+
"updateMany",
|
|
1839
|
+
"upsert",
|
|
1840
|
+
"delete",
|
|
1841
|
+
"deleteMany",
|
|
1842
|
+
"count",
|
|
1843
|
+
"aggregate",
|
|
1844
|
+
"groupBy",
|
|
1845
|
+
"where",
|
|
1846
|
+
"select",
|
|
1847
|
+
"include",
|
|
1848
|
+
"orderBy",
|
|
1849
|
+
"take",
|
|
1850
|
+
"skip",
|
|
1851
|
+
]);
|
|
1852
|
+
/**
|
|
1853
|
+
* Common Python methods to whitelist globally to reduce noise
|
|
1854
|
+
*/
|
|
1855
|
+
export const PYTHON_COMMON_METHODS = new Set([
|
|
1856
|
+
"append",
|
|
1857
|
+
"extend",
|
|
1858
|
+
"insert",
|
|
1859
|
+
"remove",
|
|
1860
|
+
"pop",
|
|
1861
|
+
"clear",
|
|
1862
|
+
"index",
|
|
1863
|
+
"count",
|
|
1864
|
+
"sort",
|
|
1865
|
+
"reverse",
|
|
1866
|
+
"copy",
|
|
1867
|
+
"items",
|
|
1868
|
+
"keys",
|
|
1869
|
+
"values",
|
|
1870
|
+
"update",
|
|
1871
|
+
"get",
|
|
1872
|
+
"popitem",
|
|
1873
|
+
"setdefault",
|
|
1874
|
+
"fromkeys",
|
|
1875
|
+
"add",
|
|
1876
|
+
"discard",
|
|
1877
|
+
"difference",
|
|
1878
|
+
"intersection",
|
|
1879
|
+
"isdisjoint",
|
|
1880
|
+
"issubset",
|
|
1881
|
+
"issuperset",
|
|
1882
|
+
"symmetric_difference",
|
|
1883
|
+
"union",
|
|
1884
|
+
"capitalize",
|
|
1885
|
+
"casefold",
|
|
1886
|
+
"center",
|
|
1887
|
+
"encode",
|
|
1888
|
+
"endswith",
|
|
1889
|
+
"expandtabs",
|
|
1890
|
+
"find",
|
|
1891
|
+
"format",
|
|
1892
|
+
"format_map",
|
|
1893
|
+
"isalnum",
|
|
1894
|
+
"isalpha",
|
|
1895
|
+
"isascii",
|
|
1896
|
+
"isdecimal",
|
|
1897
|
+
"isdigit",
|
|
1898
|
+
"isidentifier",
|
|
1899
|
+
"islower",
|
|
1900
|
+
"isnumeric",
|
|
1901
|
+
"isprintable",
|
|
1902
|
+
"isspace",
|
|
1903
|
+
"istitle",
|
|
1904
|
+
"isupper",
|
|
1905
|
+
"join",
|
|
1906
|
+
"ljust",
|
|
1907
|
+
"lower",
|
|
1908
|
+
"lstrip",
|
|
1909
|
+
"maketrans",
|
|
1910
|
+
"partition",
|
|
1911
|
+
"removeprefix",
|
|
1912
|
+
"removesuffix",
|
|
1913
|
+
"rfind",
|
|
1914
|
+
"rindex",
|
|
1915
|
+
"rjust",
|
|
1916
|
+
"rpartition",
|
|
1917
|
+
"rsplit",
|
|
1918
|
+
"rstrip",
|
|
1919
|
+
"splitlines",
|
|
1920
|
+
"startswith",
|
|
1921
|
+
"strip",
|
|
1922
|
+
"swapcase",
|
|
1923
|
+
"title",
|
|
1924
|
+
"translate",
|
|
1925
|
+
"upper",
|
|
1926
|
+
"zfill",
|
|
1927
|
+
"read",
|
|
1928
|
+
"readline",
|
|
1929
|
+
"readlines",
|
|
1930
|
+
"write",
|
|
1931
|
+
"writelines",
|
|
1932
|
+
"seek",
|
|
1933
|
+
"tell",
|
|
1934
|
+
"flush",
|
|
1935
|
+
"close",
|
|
1936
|
+
"with_traceback",
|
|
1937
|
+
"strftime",
|
|
1938
|
+
"isoformat",
|
|
1939
|
+
"timestamp",
|
|
1940
|
+
"weekday",
|
|
1941
|
+
"isoweekday",
|
|
1942
|
+
"astimezone",
|
|
1943
|
+
"replace",
|
|
1944
|
+
]);
|
|
1945
|
+
/**
|
|
1946
|
+
* Check if a name is a JavaScript built-in global or constructor.
|
|
1947
|
+
* @param name - The symbol name to check
|
|
1948
|
+
* @returns true if the name is a JavaScript built-in
|
|
1949
|
+
*/
|
|
1950
|
+
export function isJSBuiltin(name) {
|
|
1951
|
+
return (JS_BUILTINS.has(name) ||
|
|
1952
|
+
HTML_TAGS.has(name) ||
|
|
1953
|
+
SVG_TAGS.has(name) ||
|
|
1954
|
+
COMMON_LIBRARY_METHODS.has(name));
|
|
1955
|
+
}
|
|
1956
|
+
/**
|
|
1957
|
+
* Check if a name is a Python built-in type (for type hint checking).
|
|
1958
|
+
* @param name - The type name to check
|
|
1959
|
+
* @returns true if the name is a Python built-in type
|
|
1960
|
+
*/
|
|
1961
|
+
export function isPythonBuiltinType(name) {
|
|
1962
|
+
return PYTHON_BUILTIN_TYPES.has(name);
|
|
1963
|
+
}
|
|
1964
|
+
/**
|
|
1965
|
+
* Check if a name is a TypeScript built-in type.
|
|
1966
|
+
* @param name - The type name to check
|
|
1967
|
+
* @returns true if the name is a TypeScript built-in type
|
|
1968
|
+
*/
|
|
1969
|
+
export function isTSBuiltinType(name) {
|
|
1970
|
+
return TS_BUILTIN_TYPES.has(name);
|
|
1971
|
+
}
|
|
1972
|
+
/**
|
|
1973
|
+
* Get Python standard library modules.
|
|
1974
|
+
* This is a comprehensive list based on Python 3.11+ documentation.
|
|
1975
|
+
* Organized by category for maintainability.
|
|
1976
|
+
*
|
|
1977
|
+
* @returns A Set of Python standard library module names
|
|
1978
|
+
*/
|
|
1979
|
+
export function getPythonStdLib() {
|
|
1980
|
+
const modules = [
|
|
1981
|
+
// Text Processing
|
|
1982
|
+
"string",
|
|
1983
|
+
"re",
|
|
1984
|
+
"difflib",
|
|
1985
|
+
"textwrap",
|
|
1986
|
+
"unicodedata",
|
|
1987
|
+
"stringprep",
|
|
1988
|
+
"readline",
|
|
1989
|
+
"rlcompleter",
|
|
1990
|
+
// Binary Data Services
|
|
1991
|
+
"struct",
|
|
1992
|
+
"codecs",
|
|
1993
|
+
// Data Types
|
|
1994
|
+
"datetime",
|
|
1995
|
+
"zoneinfo",
|
|
1996
|
+
"calendar",
|
|
1997
|
+
"collections",
|
|
1998
|
+
"heapq",
|
|
1999
|
+
"bisect",
|
|
2000
|
+
"array",
|
|
2001
|
+
"weakref",
|
|
2002
|
+
"types",
|
|
2003
|
+
"copy",
|
|
2004
|
+
"pprint",
|
|
2005
|
+
"reprlib",
|
|
2006
|
+
"enum",
|
|
2007
|
+
"graphlib",
|
|
2008
|
+
// Numeric and Mathematical
|
|
2009
|
+
"numbers",
|
|
2010
|
+
"math",
|
|
2011
|
+
"cmath",
|
|
2012
|
+
"decimal",
|
|
2013
|
+
"fractions",
|
|
2014
|
+
"random",
|
|
2015
|
+
"statistics",
|
|
2016
|
+
// Functional Programming
|
|
2017
|
+
"itertools",
|
|
2018
|
+
"functools",
|
|
2019
|
+
"operator",
|
|
2020
|
+
// File and Directory Access
|
|
2021
|
+
"pathlib",
|
|
2022
|
+
"os",
|
|
2023
|
+
"fileinput",
|
|
2024
|
+
"stat",
|
|
2025
|
+
"filecmp",
|
|
2026
|
+
"tempfile",
|
|
2027
|
+
"glob",
|
|
2028
|
+
"fnmatch",
|
|
2029
|
+
"linecache",
|
|
2030
|
+
"shutil",
|
|
2031
|
+
// Data Persistence
|
|
2032
|
+
"pickle",
|
|
2033
|
+
"copyreg",
|
|
2034
|
+
"shelve",
|
|
2035
|
+
"marshal",
|
|
2036
|
+
"dbm",
|
|
2037
|
+
"sqlite3",
|
|
2038
|
+
// Data Compression
|
|
2039
|
+
"zlib",
|
|
2040
|
+
"gzip",
|
|
2041
|
+
"bz2",
|
|
2042
|
+
"lzma",
|
|
2043
|
+
"zipfile",
|
|
2044
|
+
"tarfile",
|
|
2045
|
+
// File Formats
|
|
2046
|
+
"csv",
|
|
2047
|
+
"configparser",
|
|
2048
|
+
"tomllib",
|
|
2049
|
+
"netrc",
|
|
2050
|
+
"plistlib",
|
|
2051
|
+
// Cryptographic Services
|
|
2052
|
+
"hashlib",
|
|
2053
|
+
"hmac",
|
|
2054
|
+
"secrets",
|
|
2055
|
+
// Generic OS Services
|
|
2056
|
+
"sys",
|
|
2057
|
+
"sysconfig",
|
|
2058
|
+
"builtins",
|
|
2059
|
+
"warnings",
|
|
2060
|
+
"dataclasses",
|
|
2061
|
+
"contextlib",
|
|
2062
|
+
"abc",
|
|
2063
|
+
"atexit",
|
|
2064
|
+
"traceback",
|
|
2065
|
+
"gc",
|
|
2066
|
+
"inspect",
|
|
2067
|
+
"site",
|
|
2068
|
+
// Concurrent Execution
|
|
2069
|
+
"threading",
|
|
2070
|
+
"multiprocessing",
|
|
2071
|
+
"concurrent",
|
|
2072
|
+
"subprocess",
|
|
2073
|
+
"sched",
|
|
2074
|
+
"queue",
|
|
2075
|
+
"contextvars",
|
|
2076
|
+
// Networking and IPC
|
|
2077
|
+
"asyncio",
|
|
2078
|
+
"socket",
|
|
2079
|
+
"ssl",
|
|
2080
|
+
"select",
|
|
2081
|
+
"selectors",
|
|
2082
|
+
"signal",
|
|
2083
|
+
"mmap",
|
|
2084
|
+
// Internet Data Handling
|
|
2085
|
+
"email",
|
|
2086
|
+
"json",
|
|
2087
|
+
"mailbox",
|
|
2088
|
+
"mimetypes",
|
|
2089
|
+
"base64",
|
|
2090
|
+
"binascii",
|
|
2091
|
+
"quopri",
|
|
2092
|
+
// Structured Markup
|
|
2093
|
+
"html",
|
|
2094
|
+
"xml",
|
|
2095
|
+
// Internet Protocols
|
|
2096
|
+
"webbrowser",
|
|
2097
|
+
"wsgiref",
|
|
2098
|
+
"urllib",
|
|
2099
|
+
"http",
|
|
2100
|
+
"ftplib",
|
|
2101
|
+
"poplib",
|
|
2102
|
+
"imaplib",
|
|
2103
|
+
"smtplib",
|
|
2104
|
+
"uuid",
|
|
2105
|
+
"socketserver",
|
|
2106
|
+
"xmlrpc",
|
|
2107
|
+
"ipaddress",
|
|
2108
|
+
// Multimedia
|
|
2109
|
+
"wave",
|
|
2110
|
+
"colorsys",
|
|
2111
|
+
// Internationalization
|
|
2112
|
+
"gettext",
|
|
2113
|
+
"locale",
|
|
2114
|
+
// Program Frameworks
|
|
2115
|
+
"turtle",
|
|
2116
|
+
"cmd",
|
|
2117
|
+
"shlex",
|
|
2118
|
+
// GUI
|
|
2119
|
+
"tkinter",
|
|
2120
|
+
"idlelib",
|
|
2121
|
+
// Development Tools
|
|
2122
|
+
"typing",
|
|
2123
|
+
"pydoc",
|
|
2124
|
+
"doctest",
|
|
2125
|
+
"unittest",
|
|
2126
|
+
"test",
|
|
2127
|
+
// Debugging and Profiling
|
|
2128
|
+
"bdb",
|
|
2129
|
+
"faulthandler",
|
|
2130
|
+
"pdb",
|
|
2131
|
+
"timeit",
|
|
2132
|
+
"trace",
|
|
2133
|
+
"tracemalloc",
|
|
2134
|
+
// Software Packaging
|
|
2135
|
+
"ensurepip",
|
|
2136
|
+
"venv",
|
|
2137
|
+
"zipapp",
|
|
2138
|
+
// Python Runtime
|
|
2139
|
+
"importlib",
|
|
2140
|
+
"runpy",
|
|
2141
|
+
"ast",
|
|
2142
|
+
"symtable",
|
|
2143
|
+
"token",
|
|
2144
|
+
"keyword",
|
|
2145
|
+
"tokenize",
|
|
2146
|
+
"tabnanny",
|
|
2147
|
+
"pyclbr",
|
|
2148
|
+
"py_compile",
|
|
2149
|
+
"compileall",
|
|
2150
|
+
"dis",
|
|
2151
|
+
"pickletools",
|
|
2152
|
+
// Custom Interpreters
|
|
2153
|
+
"code",
|
|
2154
|
+
"codeop",
|
|
2155
|
+
// Importing
|
|
2156
|
+
"zipimport",
|
|
2157
|
+
"pkgutil",
|
|
2158
|
+
"modulefinder",
|
|
2159
|
+
// Unix Specific
|
|
2160
|
+
"posix",
|
|
2161
|
+
"pwd",
|
|
2162
|
+
"grp",
|
|
2163
|
+
"termios",
|
|
2164
|
+
"tty",
|
|
2165
|
+
"pty",
|
|
2166
|
+
"fcntl",
|
|
2167
|
+
"resource",
|
|
2168
|
+
"syslog",
|
|
2169
|
+
// Windows Specific
|
|
2170
|
+
"msvcrt",
|
|
2171
|
+
"winreg",
|
|
2172
|
+
"winsound",
|
|
2173
|
+
// Logging
|
|
2174
|
+
"logging",
|
|
2175
|
+
// Argument Parsing
|
|
2176
|
+
"argparse",
|
|
2177
|
+
"getopt",
|
|
2178
|
+
"optparse",
|
|
2179
|
+
// Common third-party that feel like stdlib
|
|
2180
|
+
"typing_extensions",
|
|
2181
|
+
];
|
|
2182
|
+
return new Set(modules);
|
|
2183
|
+
}
|
|
2184
|
+
//# sourceMappingURL=builtins.js.map
|