code2logic 1.0.24__tar.gz → 1.0.26__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.
- {code2logic-1.0.24 → code2logic-1.0.26}/PKG-INFO +1 -1
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/__init__.py +1 -1
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/analyzer.py +1 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/benchmarks/common.py +1 -1
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/chunked_reproduction.py +6 -3
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/parsers.py +46 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/pyproject.toml +2 -2
- {code2logic-1.0.24 → code2logic-1.0.26}/LICENSE +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/README.md +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/__main__.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/adaptive.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/base.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/benchmark.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/benchmarks/__init__.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/benchmarks/results.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/benchmarks/runner.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/cli.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/code_review.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/config.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/core/__init__.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/dependency.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/errors.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/file_formats.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/formats/__init__.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/function_logic.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/generators.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/gherkin.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/integrations/__init__.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/intent.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/llm/__init__.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/llm.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/llm_clients.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/llm_clients_new.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/llm_profiler.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/logicml.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/markdown_format.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/mcp_server.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/metrics.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/models.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/project_reproducer.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/prompts.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/py.typed +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/quality.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/refactor.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/reproducer.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/reproduction.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/schemas/__init__.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/schemas/json_schema.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/schemas/logicml_schema.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/schemas/markdown_schema.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/schemas/yaml_schema.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/shared_utils.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/similarity.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/terminal.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/tools/__init__.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/toon_format.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/universal.py +0 -0
- {code2logic-1.0.24 → code2logic-1.0.26}/code2logic/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: code2logic
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.26
|
|
4
4
|
Summary: Convert source code to logical representation for LLM analysis
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Keywords: code-analysis,llm,ast,static-analysis,tree-sitter,code-understanding,documentation,dependency-graph,nlp
|
|
@@ -16,7 +16,7 @@ def create_single_project(module_info, file_path: Path) -> ProjectInfo:
|
|
|
16
16
|
return ProjectInfo(
|
|
17
17
|
name=file_path.name,
|
|
18
18
|
root_path=str(file_path.parent),
|
|
19
|
-
languages={"python": 1},
|
|
19
|
+
languages={getattr(module_info, "language", "python") or "python": 1},
|
|
20
20
|
modules=[module_info],
|
|
21
21
|
dependency_graph={},
|
|
22
22
|
dependency_metrics={},
|
|
@@ -13,7 +13,7 @@ Features:
|
|
|
13
13
|
|
|
14
14
|
import re
|
|
15
15
|
from dataclasses import dataclass
|
|
16
|
-
from typing import List
|
|
16
|
+
from typing import List, Optional
|
|
17
17
|
|
|
18
18
|
from .utils import estimate_tokens
|
|
19
19
|
|
|
@@ -348,10 +348,13 @@ def merge_chunk_codes(codes: List[str], file_name: str) -> str:
|
|
|
348
348
|
class ChunkedReproducer:
|
|
349
349
|
"""Reproduce code from chunked specifications."""
|
|
350
350
|
|
|
351
|
-
def __init__(self, client, model_name: str = 'default'):
|
|
351
|
+
def __init__(self, client, model_name: str = 'default', max_tokens: Optional[int] = None):
|
|
352
352
|
self.client = client
|
|
353
353
|
self.model_name = model_name
|
|
354
|
-
|
|
354
|
+
if max_tokens is None:
|
|
355
|
+
self.max_tokens = get_llm_limit(model_name) // 2 # Leave room for response
|
|
356
|
+
else:
|
|
357
|
+
self.max_tokens = int(max_tokens)
|
|
355
358
|
|
|
356
359
|
def reproduce(self, spec: str, fmt: str, file_name: str) -> ChunkedResult:
|
|
357
360
|
"""Reproduce code from specification, chunking if needed."""
|
|
@@ -1449,6 +1449,8 @@ class UniversalParser:
|
|
|
1449
1449
|
module = node.module or ''
|
|
1450
1450
|
for alias in node.names:
|
|
1451
1451
|
if alias.name == '*':
|
|
1452
|
+
if module:
|
|
1453
|
+
imports.append(f"{module}.*")
|
|
1452
1454
|
continue
|
|
1453
1455
|
imports.append(_combine_import_name(module, alias.name))
|
|
1454
1456
|
elif isinstance(node, ast.ClassDef):
|
|
@@ -1814,6 +1816,50 @@ class UniversalParser:
|
|
|
1814
1816
|
for m in re.finditer(r"import\s+.*?from\s+['\"]([^'\"]+)['\"]", content):
|
|
1815
1817
|
imports.append(m.group(1))
|
|
1816
1818
|
|
|
1819
|
+
# Re-export patterns (export * / export {...} from)
|
|
1820
|
+
for m in re.finditer(r"export\s+\*\s+from\s+['\"]([^'\"]+)['\"]", content):
|
|
1821
|
+
mod = m.group(1)
|
|
1822
|
+
imports.append(mod)
|
|
1823
|
+
exports.append(f"* from {mod}")
|
|
1824
|
+
|
|
1825
|
+
for m in re.finditer(r"export\s+\*\s+as\s+(\w+)\s+from\s+['\"]([^'\"]+)['\"]", content):
|
|
1826
|
+
name = m.group(1)
|
|
1827
|
+
mod = m.group(2)
|
|
1828
|
+
imports.append(mod)
|
|
1829
|
+
exports.append(f"* as {name} from {mod}")
|
|
1830
|
+
exports.append(name)
|
|
1831
|
+
|
|
1832
|
+
for m in re.finditer(r"export\s+\{([^}]+)\}\s+from\s+['\"]([^'\"]+)['\"]", content):
|
|
1833
|
+
items = m.group(1)
|
|
1834
|
+
mod = m.group(2)
|
|
1835
|
+
imports.append(mod)
|
|
1836
|
+
for raw in (items or '').split(','):
|
|
1837
|
+
part = raw.strip()
|
|
1838
|
+
if not part:
|
|
1839
|
+
continue
|
|
1840
|
+
if ' as ' in part:
|
|
1841
|
+
exported = part.split(' as ', 1)[1].strip()
|
|
1842
|
+
else:
|
|
1843
|
+
exported = part
|
|
1844
|
+
if exported:
|
|
1845
|
+
exports.append(exported)
|
|
1846
|
+
|
|
1847
|
+
# Local export list (export { A, B as C };)
|
|
1848
|
+
for m in re.finditer(r"export\s+\{([^}]+)\}\s*;", content):
|
|
1849
|
+
if 'from' in m.group(0):
|
|
1850
|
+
continue
|
|
1851
|
+
items = m.group(1)
|
|
1852
|
+
for raw in (items or '').split(','):
|
|
1853
|
+
part = raw.strip()
|
|
1854
|
+
if not part:
|
|
1855
|
+
continue
|
|
1856
|
+
if ' as ' in part:
|
|
1857
|
+
exported = part.split(' as ', 1)[1].strip()
|
|
1858
|
+
else:
|
|
1859
|
+
exported = part
|
|
1860
|
+
if exported:
|
|
1861
|
+
exports.append(exported)
|
|
1862
|
+
|
|
1817
1863
|
# Class patterns
|
|
1818
1864
|
for m in re.finditer(
|
|
1819
1865
|
r'(?:export\s+)?(?:abstract\s+)?class\s+(\w+)(?:\s+extends\s+(\w+))?',
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "code2logic"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.26"
|
|
8
8
|
description = "Convert source code to logical representation for LLM analysis"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -183,7 +183,7 @@ module = [
|
|
|
183
183
|
ignore_missing_imports = true
|
|
184
184
|
|
|
185
185
|
[tool.bumpver]
|
|
186
|
-
current_version = "1.0.
|
|
186
|
+
current_version = "1.0.26"
|
|
187
187
|
version_pattern = "MAJOR.MINOR.PATCH"
|
|
188
188
|
commit = false
|
|
189
189
|
tag = false
|
|
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
|