codedd-cli 0.1.1__py3-none-any.whl
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.
- codedd_cli/__init__.py +3 -0
- codedd_cli/__main__.py +19 -0
- codedd_cli/api/__init__.py +4 -0
- codedd_cli/api/client.py +120 -0
- codedd_cli/api/endpoints.py +44 -0
- codedd_cli/api/exceptions.py +24 -0
- codedd_cli/auditor/__init__.py +6 -0
- codedd_cli/auditor/architecture_analyzer.py +1251 -0
- codedd_cli/auditor/architecture_prompts.py +173 -0
- codedd_cli/auditor/complexity_analyzer.py +1739 -0
- codedd_cli/auditor/dependency_scanner.py +2485 -0
- codedd_cli/auditor/file_auditor.py +578 -0
- codedd_cli/auditor/git_stats_collector.py +417 -0
- codedd_cli/auditor/response_parser.py +484 -0
- codedd_cli/auditor/vulnerability_validator.py +323 -0
- codedd_cli/auth/__init__.py +4 -0
- codedd_cli/auth/session.py +40 -0
- codedd_cli/auth/token_manager.py +86 -0
- codedd_cli/cli.py +69 -0
- codedd_cli/commands/__init__.py +1 -0
- codedd_cli/commands/audit_cmd.py +1987 -0
- codedd_cli/commands/audits_cmd.py +276 -0
- codedd_cli/commands/auth_cmd.py +235 -0
- codedd_cli/commands/config_cmd.py +421 -0
- codedd_cli/commands/scope_cmd.py +1016 -0
- codedd_cli/config/__init__.py +4 -0
- codedd_cli/config/constants.py +22 -0
- codedd_cli/config/settings.py +389 -0
- codedd_cli/llm/__init__.py +1 -0
- codedd_cli/llm/key_manager.py +267 -0
- codedd_cli/models/__init__.py +5 -0
- codedd_cli/models/account.py +13 -0
- codedd_cli/models/audit.py +31 -0
- codedd_cli/models/local_directory.py +25 -0
- codedd_cli/scanner/__init__.py +18 -0
- codedd_cli/scanner/file_classifier.py +752 -0
- codedd_cli/scanner/file_walker.py +213 -0
- codedd_cli/scanner/line_counter.py +80 -0
- codedd_cli/utils/__init__.py +1 -0
- codedd_cli/utils/directory_validator.py +178 -0
- codedd_cli/utils/display.py +497 -0
- codedd_cli/utils/payload_inspector.py +178 -0
- codedd_cli/utils/security.py +14 -0
- codedd_cli/utils/validators.py +37 -0
- codedd_cli-0.1.1.dist-info/METADATA +306 -0
- codedd_cli-0.1.1.dist-info/RECORD +49 -0
- codedd_cli-0.1.1.dist-info/WHEEL +4 -0
- codedd_cli-0.1.1.dist-info/entry_points.txt +3 -0
- codedd_cli-0.1.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Category-specific prompts and output schemas for CLI architecture Phase 2.
|
|
3
|
+
|
|
4
|
+
Kept in sync with the server's LLMAnalyzer.category_prompts and category_schemas
|
|
5
|
+
so that per-file analysis produces the same structure the server expects.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
# Output structure expected from the LLM per category (server-compatible)
|
|
9
|
+
CATEGORY_SCHEMAS = {
|
|
10
|
+
"dependency_files": {
|
|
11
|
+
"file_type": "dependency_manifest",
|
|
12
|
+
"primary_language": "",
|
|
13
|
+
"package_manager": "",
|
|
14
|
+
"tech_stack": [],
|
|
15
|
+
"frameworks": [],
|
|
16
|
+
"databases": [],
|
|
17
|
+
"infrastructure_tools": [],
|
|
18
|
+
"development_tools": [],
|
|
19
|
+
"testing_frameworks": [],
|
|
20
|
+
"architectural_implications": "",
|
|
21
|
+
},
|
|
22
|
+
"infrastructure_files": {
|
|
23
|
+
"file_type": "infrastructure_config",
|
|
24
|
+
"infrastructure_type": "",
|
|
25
|
+
"services_defined": [],
|
|
26
|
+
"network_config": [],
|
|
27
|
+
"storage_config": [],
|
|
28
|
+
"environment_variables": [],
|
|
29
|
+
"ports_exposed": [],
|
|
30
|
+
"dependencies_between_services": [],
|
|
31
|
+
"external_integrations": [],
|
|
32
|
+
"database_interactions": [],
|
|
33
|
+
"kubernetes_resources": [],
|
|
34
|
+
"kubernetes_services": [],
|
|
35
|
+
"pipeline_stages": [],
|
|
36
|
+
"deployment_targets": [],
|
|
37
|
+
"configuration_dependencies": [],
|
|
38
|
+
"deployment_pattern": "",
|
|
39
|
+
"scalability_features": [],
|
|
40
|
+
"security_configurations": [],
|
|
41
|
+
},
|
|
42
|
+
"backend_files": {
|
|
43
|
+
"file_type": "backend_code",
|
|
44
|
+
"code_purpose": "",
|
|
45
|
+
"api_endpoints": [],
|
|
46
|
+
"data_models": [],
|
|
47
|
+
"business_logic": [],
|
|
48
|
+
"external_integrations": [],
|
|
49
|
+
"database_interactions": [],
|
|
50
|
+
"middleware_components": [],
|
|
51
|
+
"configuration_settings": [],
|
|
52
|
+
"architectural_role": "",
|
|
53
|
+
"dependencies_on_other_files": [],
|
|
54
|
+
},
|
|
55
|
+
"frontend_files": {
|
|
56
|
+
"file_type": "frontend_code",
|
|
57
|
+
"code_purpose": "",
|
|
58
|
+
"ui_components": [],
|
|
59
|
+
"routing_config": [],
|
|
60
|
+
"state_management": [],
|
|
61
|
+
"api_interactions": [],
|
|
62
|
+
"styling_approach": "",
|
|
63
|
+
"build_configuration": [],
|
|
64
|
+
"third_party_integrations": [],
|
|
65
|
+
"architectural_role": "",
|
|
66
|
+
"user_interactions": [],
|
|
67
|
+
},
|
|
68
|
+
"database_files": {
|
|
69
|
+
"file_type": "database_config",
|
|
70
|
+
"database_purpose": "",
|
|
71
|
+
"tables_schemas": [],
|
|
72
|
+
"relationships": [],
|
|
73
|
+
"indexes": [],
|
|
74
|
+
"migrations": [],
|
|
75
|
+
"stored_procedures": [],
|
|
76
|
+
"database_type": "",
|
|
77
|
+
"data_access_patterns": [],
|
|
78
|
+
"performance_optimizations": [],
|
|
79
|
+
"data_relationships": [],
|
|
80
|
+
},
|
|
81
|
+
"ci_cd_files": {
|
|
82
|
+
"file_type": "cicd_pipeline",
|
|
83
|
+
"pipeline_platform": "",
|
|
84
|
+
"pipeline_stages": [],
|
|
85
|
+
"deployment_targets": [],
|
|
86
|
+
"testing_automation": [],
|
|
87
|
+
"build_processes": [],
|
|
88
|
+
"deployment_strategies": [],
|
|
89
|
+
"environment_management": [],
|
|
90
|
+
"security_scanning": [],
|
|
91
|
+
"notifications": [],
|
|
92
|
+
"automation_level": "",
|
|
93
|
+
},
|
|
94
|
+
"testing_files": {
|
|
95
|
+
"file_type": "testing_config",
|
|
96
|
+
"testing_framework": "",
|
|
97
|
+
"test_types": [],
|
|
98
|
+
"test_coverage_areas": [],
|
|
99
|
+
"testing_environments": [],
|
|
100
|
+
"automation_config": [],
|
|
101
|
+
"quality_gates": [],
|
|
102
|
+
"performance_testing": [],
|
|
103
|
+
"integration_testing": [],
|
|
104
|
+
"test_data_management": [],
|
|
105
|
+
},
|
|
106
|
+
"config_files": {
|
|
107
|
+
"file_type": "application_config",
|
|
108
|
+
"config_purpose": "",
|
|
109
|
+
"application_settings": [],
|
|
110
|
+
"environment_variables": [],
|
|
111
|
+
"external_service_config": [],
|
|
112
|
+
"security_settings": [],
|
|
113
|
+
"logging_configuration": [],
|
|
114
|
+
"feature_flags": [],
|
|
115
|
+
"performance_settings": [],
|
|
116
|
+
"integration_settings": [],
|
|
117
|
+
"deployment_config": [],
|
|
118
|
+
},
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
# Category-specific analysis prompts (server-compatible)
|
|
122
|
+
CATEGORY_PROMPTS = {
|
|
123
|
+
"dependency_files": """
|
|
124
|
+
Analyze this dependency/package management file to understand the technology stack and architectural implications.
|
|
125
|
+
|
|
126
|
+
IMPORTANT: Categorize technologies properly across different fields:
|
|
127
|
+
- tech_stack: ALL technologies found in the file
|
|
128
|
+
- frameworks: Only web/application frameworks (Django, React, Express, Spring, etc.)
|
|
129
|
+
- databases: Database technologies, including inferred ones (e.g., psycopg2 → PostgreSQL)
|
|
130
|
+
- infrastructure_tools: Deployment, containerization, orchestration tools
|
|
131
|
+
- development_tools: Testing, build, linting, development utilities
|
|
132
|
+
- testing_frameworks: Specific testing libraries and frameworks
|
|
133
|
+
|
|
134
|
+
Focus on extracting ALL technologies and categorizing them appropriately.
|
|
135
|
+
Keep architectural_implications to 2-3 sentences max.
|
|
136
|
+
""",
|
|
137
|
+
"infrastructure_files": """
|
|
138
|
+
Analyze this infrastructure configuration file to understand deployment architecture and service relationships.
|
|
139
|
+
|
|
140
|
+
**KUBERNETES ANALYSIS** (if applicable): Extract deployment, service, and ingress configurations.
|
|
141
|
+
**CI/CD ANALYSIS** (if applicable): Extract pipeline stages and deployment targets.
|
|
142
|
+
|
|
143
|
+
**STRICT REQUIREMENT**: Your response must be valid JSON and include ALL services found
|
|
144
|
+
in the file. Do not omit services or return empty arrays if services exist.
|
|
145
|
+
Focus on complete service definitions, networking, dependencies, and deployment patterns.
|
|
146
|
+
""",
|
|
147
|
+
"backend_files": """
|
|
148
|
+
Analyze this backend code file to understand its architectural role and relationships.
|
|
149
|
+
Focus on API endpoints, data models, business logic, and architectural role.
|
|
150
|
+
""",
|
|
151
|
+
"frontend_files": """
|
|
152
|
+
Analyze this frontend code file to understand UI architecture and user interactions.
|
|
153
|
+
Focus on UI components, routing, state management, and API interactions.
|
|
154
|
+
""",
|
|
155
|
+
"database_files": """
|
|
156
|
+
Analyze this database-related file to understand data architecture and relationships.
|
|
157
|
+
Focus on table schemas, relationships, indexes, and data access patterns.
|
|
158
|
+
""",
|
|
159
|
+
"ci_cd_files": """
|
|
160
|
+
Analyze this CI/CD configuration file to understand deployment and automation architecture.
|
|
161
|
+
Focus on pipeline stages, deployment strategies, testing automation, and environment management.
|
|
162
|
+
""",
|
|
163
|
+
"testing_files": """
|
|
164
|
+
Analyze this testing configuration file to understand quality assurance architecture.
|
|
165
|
+
Focus on testing frameworks, test types, coverage areas, and quality gates.
|
|
166
|
+
""",
|
|
167
|
+
"config_files": """
|
|
168
|
+
Analyze this configuration file to understand application settings and external integrations.
|
|
169
|
+
Focus on: purpose of configuration, application behavior settings, external service connections,
|
|
170
|
+
security and authentication settings, logging and monitoring, performance and caching, feature flags.
|
|
171
|
+
Focus on application settings, external integrations, security configurations, and performance settings.
|
|
172
|
+
""",
|
|
173
|
+
}
|