code2llm 0.5.19__tar.gz → 0.5.20__tar.gz
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.
- {code2llm-0.5.19 → code2llm-0.5.20}/PKG-INFO +1 -1
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/__init__.py +1 -1
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/cli_exports.py +99 -1
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/nlp/__init__.py +1 -1
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm.egg-info/PKG-INFO +1 -1
- {code2llm-0.5.19 → code2llm-0.5.20}/pyproject.toml +1 -1
- {code2llm-0.5.19 → code2llm-0.5.20}/LICENSE +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/README.md +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/__main__.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/analysis/__init__.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/analysis/call_graph.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/analysis/cfg.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/analysis/coupling.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/analysis/data_analysis.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/analysis/dfg.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/analysis/pipeline_detector.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/analysis/side_effects.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/analysis/smells.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/analysis/type_inference.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/cli.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/__init__.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/analyzer.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/config.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/core/__init__.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/core/file_analyzer.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/core/file_cache.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/core/file_filter.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/core/refactoring.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/large_repo.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/models.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/streaming/__init__.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/streaming/cache.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/streaming/incremental.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/streaming/prioritizer.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/streaming/scanner.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/streaming/strategies.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/streaming_analyzer.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/core/toon_size_manager.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/__init__.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/base.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/context_exporter.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/evolution_exporter.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/flow_constants.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/flow_exporter.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/flow_renderer.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/json_exporter.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/llm_exporter.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/map_exporter.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/mermaid_exporter.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/readme_exporter.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/toon/__init__.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/toon/helpers.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/toon/metrics.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/toon/module_detail.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/toon/renderer.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/toon.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/exporters/yaml_exporter.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/generators/__init__.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/generators/llm_flow.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/generators/llm_task.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/generators/mermaid.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/nlp/config.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/nlp/entity_resolution.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/nlp/intent_matching.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/nlp/normalization.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/nlp/pipeline.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/patterns/__init__.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/patterns/detector.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/refactor/__init__.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm/refactor/prompt_engine.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm.egg-info/SOURCES.txt +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm.egg-info/dependency_links.txt +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm.egg-info/entry_points.txt +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm.egg-info/requires.txt +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/code2llm.egg-info/top_level.txt +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/setup.cfg +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/setup.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/tests/test_advanced_analysis.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/tests/test_analyzer.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/tests/test_deep_analysis.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/tests/test_edge_cases.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/tests/test_flow_exporter.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/tests/test_format_quality.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/tests/test_nlp_pipeline.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/tests/test_pipeline_detector.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/tests/test_prompt_engine.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/tests/test_prompt_txt.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/tests/test_refactoring_engine.py +0 -0
- {code2llm-0.5.19 → code2llm-0.5.20}/tests/test_toon_v2.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code2llm
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.20
|
|
4
4
|
Summary: High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries
|
|
5
5
|
Home-page: https://github.com/wronai/stts
|
|
6
6
|
Author: STTS Project
|
|
@@ -180,6 +180,104 @@ def _normalize_code2logic_output(found: Path, target: Path, args) -> List[Path]:
|
|
|
180
180
|
)
|
|
181
181
|
|
|
182
182
|
|
|
183
|
+
def _export_chunked_prompt_txt(args, output_dir: Path, formats: list[str], source_path: Optional[Path] = None, subprojects: list = None) -> None:
|
|
184
|
+
"""Generate prompt.txt for chunked analysis with all subproject files."""
|
|
185
|
+
if 'code2logic' not in formats and 'all' not in formats:
|
|
186
|
+
return
|
|
187
|
+
|
|
188
|
+
prompt_path = output_dir / 'prompt.txt'
|
|
189
|
+
|
|
190
|
+
# Determine project name and relative output path
|
|
191
|
+
if source_path:
|
|
192
|
+
project_path = source_path.name if source_path.name else str(source_path)
|
|
193
|
+
try:
|
|
194
|
+
output_rel_path = str(output_dir.relative_to(source_path))
|
|
195
|
+
except ValueError:
|
|
196
|
+
output_rel_path = str(output_dir)
|
|
197
|
+
else:
|
|
198
|
+
cwd = Path.cwd()
|
|
199
|
+
project_path = cwd.name
|
|
200
|
+
try:
|
|
201
|
+
output_rel_path = str(output_dir.relative_to(cwd))
|
|
202
|
+
except ValueError:
|
|
203
|
+
output_rel_path = str(output_dir)
|
|
204
|
+
|
|
205
|
+
lines: list[str] = []
|
|
206
|
+
lines.append("You are an AI assistant helping me understand and improve a codebase.")
|
|
207
|
+
lines.append("Use the attached/generated files as the authoritative context.")
|
|
208
|
+
lines.append("")
|
|
209
|
+
lines.append(f"we are in project path: {project_path}")
|
|
210
|
+
lines.append("")
|
|
211
|
+
lines.append("Files for analysis:")
|
|
212
|
+
|
|
213
|
+
# Main files (merged summaries)
|
|
214
|
+
main_files = [
|
|
215
|
+
('analysis.toon', 'Health diagnostics - complexity metrics, god modules, coupling issues, refactoring priorities'),
|
|
216
|
+
('context.md', 'LLM narrative - architecture summary, key entry points, process flows, public API surface'),
|
|
217
|
+
('evolution.toon', 'Refactoring queue - ranked actions by impact/effort, risks, metrics targets, history'),
|
|
218
|
+
('project.toon', 'Project logic - compact module view from code2logic, file sizes, dependencies overview'),
|
|
219
|
+
('README.md', 'Documentation - complete guide to all generated files, usage examples, interpretation'),
|
|
220
|
+
]
|
|
221
|
+
|
|
222
|
+
# Add main existing files
|
|
223
|
+
for name, desc in main_files:
|
|
224
|
+
if (output_dir / name).exists():
|
|
225
|
+
file_path = f"{output_rel_path}/{name}"
|
|
226
|
+
lines.append(f"- {file_path} ({desc})")
|
|
227
|
+
|
|
228
|
+
# Add chunked subproject files
|
|
229
|
+
if subprojects:
|
|
230
|
+
lines.append("")
|
|
231
|
+
lines.append("Subproject Analysis Files (hierarchical chunking for large repository):")
|
|
232
|
+
|
|
233
|
+
for sp in subprojects:
|
|
234
|
+
sp_dir = output_dir / sp.name.replace('.', '_')
|
|
235
|
+
if not sp_dir.exists():
|
|
236
|
+
continue
|
|
237
|
+
|
|
238
|
+
level_name = {0: 'root', 1: 'L1', 2: 'L2', 3: 'chunk'}.get(sp.level, f'L{sp.level}')
|
|
239
|
+
|
|
240
|
+
# Check which files exist for this subproject
|
|
241
|
+
sp_files = []
|
|
242
|
+
if (sp_dir / 'analysis.toon').exists():
|
|
243
|
+
sp_files.append('analysis.toon')
|
|
244
|
+
if (sp_dir / 'context.md').exists():
|
|
245
|
+
sp_files.append('context.md')
|
|
246
|
+
if (sp_dir / 'evolution.toon').exists():
|
|
247
|
+
sp_files.append('evolution.toon')
|
|
248
|
+
|
|
249
|
+
if sp_files:
|
|
250
|
+
file_list = ', '.join(sp_files)
|
|
251
|
+
lines.append(f"- {output_rel_path}/{sp.name.replace('.', '_')}/ [{level_name}] ~{sp.estimated_size_kb}KB - Contains: {file_list}")
|
|
252
|
+
|
|
253
|
+
# Check for missing files
|
|
254
|
+
missing_main = [name for name, _ in main_files if not (output_dir / name).exists() and name != 'project.toon']
|
|
255
|
+
if missing_main:
|
|
256
|
+
lines.append("")
|
|
257
|
+
lines.append("Missing files (not generated in this run):")
|
|
258
|
+
for name in missing_main:
|
|
259
|
+
file_path = f"{output_rel_path}/{name}"
|
|
260
|
+
lines.append(f"- {file_path}")
|
|
261
|
+
|
|
262
|
+
lines.append("")
|
|
263
|
+
lines.append("Task:")
|
|
264
|
+
lines.append("- Summarize the architecture and main flows.")
|
|
265
|
+
lines.append("- Identify the highest-risk areas and propose a refactoring plan.")
|
|
266
|
+
lines.append("- If you suggest changes, keep behavior backward compatible and provide concrete steps.")
|
|
267
|
+
lines.append("")
|
|
268
|
+
lines.append("Constraints:")
|
|
269
|
+
lines.append("- Prefer minimal, incremental changes.")
|
|
270
|
+
lines.append("- If uncertain, ask clarifying questions.")
|
|
271
|
+
lines.append("")
|
|
272
|
+
lines.append("Note: This repository was analyzed using hierarchical chunking due to its size.")
|
|
273
|
+
lines.append(" Start with the main files (analysis.toon, context.md) for overview,")
|
|
274
|
+
lines.append(" then examine specific subproject directories as needed.")
|
|
275
|
+
|
|
276
|
+
prompt_path.write_text("\n".join(lines) + "\n", encoding='utf-8')
|
|
277
|
+
if args.verbose:
|
|
278
|
+
print(f" - PROMPT (chunked): {prompt_path}")
|
|
279
|
+
|
|
280
|
+
|
|
183
281
|
def _export_prompt_txt(args, output_dir: Path, formats: list[str], source_path: Optional[Path] = None) -> None:
|
|
184
282
|
"""Generate prompt.txt useful to send to an LLM."""
|
|
185
283
|
# Keep it conservative: generate when code2logic is requested.
|
|
@@ -434,6 +532,6 @@ def _export_chunked_results(args, result, output_dir: Path, source_path: Path, f
|
|
|
434
532
|
|
|
435
533
|
if source_path is not None:
|
|
436
534
|
_export_code2logic(args, source_path, output_dir, formats)
|
|
437
|
-
|
|
535
|
+
_export_chunked_prompt_txt(args, output_dir, formats, source_path, subprojects)
|
|
438
536
|
|
|
439
537
|
_export_readme(args, result, output_dir)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code2llm
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.20
|
|
4
4
|
Summary: High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries
|
|
5
5
|
Home-page: https://github.com/wronai/stts
|
|
6
6
|
Author: STTS Project
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "code2llm"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.20"
|
|
8
8
|
description = "High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|