switchforge 1.0.0__tar.gz → 1.0.1__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.
- {switchforge-1.0.0 → switchforge-1.0.1}/PKG-INFO +4 -2
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/utils/tokens.py +16 -2
- {switchforge-1.0.0 → switchforge-1.0.1}/pyproject.toml +3 -2
- {switchforge-1.0.0 → switchforge-1.0.1}/.gitignore +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/README.md +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge-core.spec +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/__init__.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/__main__.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/ai/__init__.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/ai/prompts.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/ai/provider.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/ai/structured.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/auth.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/cli.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/config.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/core/__init__.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/core/agent_manager.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/core/coverage.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/core/file_manager.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/models/__init__.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/models/config.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/models/dto.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/models/project.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/models/test_result.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/orchestrator.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/phases/__init__.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/phases/analyze_project.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/phases/audit_tests.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/phases/compile_fix.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/phases/coverage_report.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/phases/detect_stack.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/phases/exclusion_scan.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/phases/fix_broken.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/phases/generate_tests.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/phases/journey_mapping.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/phases/self_learn.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/utils/__init__.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/utils/logger.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/utils/reporter.py +0 -0
- {switchforge-1.0.0 → switchforge-1.0.1}/forge_core/utils/shell.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: switchforge
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: AI-powered backend test generation engine
|
|
5
5
|
Project-URL: Homepage, https://theswitchcompany.online/products/forge/core
|
|
6
6
|
Project-URL: Repository, https://github.com/switchcompany/forge-core
|
|
@@ -23,13 +23,15 @@ Requires-Dist: litellm>=1.40.0
|
|
|
23
23
|
Requires-Dist: pydantic>=2.7.0
|
|
24
24
|
Requires-Dist: pyyaml>=6.0
|
|
25
25
|
Requires-Dist: rich>=13.7.0
|
|
26
|
-
Requires-Dist: tiktoken>=0.7.0
|
|
27
26
|
Requires-Dist: typer>=0.12.0
|
|
27
|
+
Provides-Extra: accurate-tokens
|
|
28
|
+
Requires-Dist: tiktoken>=0.7.0; extra == 'accurate-tokens'
|
|
28
29
|
Provides-Extra: dev
|
|
29
30
|
Requires-Dist: pyinstaller>=6.0; extra == 'dev'
|
|
30
31
|
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
31
32
|
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
32
33
|
Requires-Dist: ruff>=0.5.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: tiktoken>=0.7.0; extra == 'dev'
|
|
33
35
|
Description-Content-Type: text/markdown
|
|
34
36
|
|
|
35
37
|
# Switchforge (Forge Core CLI)
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
"""Token counting and prompt size management
|
|
1
|
+
"""Token counting and prompt size management."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
try:
|
|
6
|
+
import tiktoken
|
|
7
|
+
_HAS_TIKTOKEN = True
|
|
8
|
+
except ImportError:
|
|
9
|
+
_HAS_TIKTOKEN = False
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _estimate_tokens(text: str) -> int:
|
|
13
|
+
"""Rough token estimate (~4 chars per token) when tiktoken is unavailable."""
|
|
14
|
+
return len(text) // 4 + 1
|
|
6
15
|
|
|
7
16
|
|
|
8
17
|
def count_tokens(text: str, model: str = "gpt-4o") -> int:
|
|
9
18
|
"""Count tokens in text for a given model."""
|
|
19
|
+
if not _HAS_TIKTOKEN:
|
|
20
|
+
return _estimate_tokens(text)
|
|
10
21
|
try:
|
|
11
22
|
enc = tiktoken.encoding_for_model(model)
|
|
12
23
|
except KeyError:
|
|
@@ -16,6 +27,9 @@ def count_tokens(text: str, model: str = "gpt-4o") -> int:
|
|
|
16
27
|
|
|
17
28
|
def truncate_to_tokens(text: str, max_tokens: int, model: str = "gpt-4o") -> str:
|
|
18
29
|
"""Truncate text to fit within max_tokens."""
|
|
30
|
+
if not _HAS_TIKTOKEN:
|
|
31
|
+
char_limit = max_tokens * 4
|
|
32
|
+
return text[:char_limit] if len(text) > char_limit else text
|
|
19
33
|
try:
|
|
20
34
|
enc = tiktoken.encoding_for_model(model)
|
|
21
35
|
except KeyError:
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "switchforge"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.1"
|
|
8
8
|
description = "AI-powered backend test generation engine"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -30,17 +30,18 @@ dependencies = [
|
|
|
30
30
|
"typer>=0.12.0",
|
|
31
31
|
"rich>=13.7.0",
|
|
32
32
|
"pyyaml>=6.0",
|
|
33
|
-
"tiktoken>=0.7.0",
|
|
34
33
|
"httpx>=0.27.0",
|
|
35
34
|
"pydantic>=2.7.0",
|
|
36
35
|
]
|
|
37
36
|
|
|
38
37
|
[project.optional-dependencies]
|
|
38
|
+
accurate-tokens = ["tiktoken>=0.7.0"]
|
|
39
39
|
dev = [
|
|
40
40
|
"pytest>=8.0",
|
|
41
41
|
"pytest-asyncio>=0.23",
|
|
42
42
|
"ruff>=0.5.0",
|
|
43
43
|
"pyinstaller>=6.0",
|
|
44
|
+
"tiktoken>=0.7.0",
|
|
44
45
|
]
|
|
45
46
|
|
|
46
47
|
[project.scripts]
|
|
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
|