tunacode-cli 0.0.4__py3-none-any.whl → 0.0.5__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.
Potentially problematic release.
This version of tunacode-cli might be problematic. Click here for more details.
- tunacode/constants.py +1 -1
- tunacode/exceptions.py +13 -13
- tunacode/services/undo_service.py +5 -5
- tunacode/types.py +2 -2
- tunacode/utils/system.py +13 -13
- {tunacode_cli-0.0.4.dist-info → tunacode_cli-0.0.5.dist-info}/METADATA +1 -1
- {tunacode_cli-0.0.4.dist-info → tunacode_cli-0.0.5.dist-info}/RECORD +11 -11
- {tunacode_cli-0.0.4.dist-info → tunacode_cli-0.0.5.dist-info}/WHEEL +0 -0
- {tunacode_cli-0.0.4.dist-info → tunacode_cli-0.0.5.dist-info}/entry_points.txt +0 -0
- {tunacode_cli-0.0.4.dist-info → tunacode_cli-0.0.5.dist-info}/licenses/LICENSE +0 -0
- {tunacode_cli-0.0.4.dist-info → tunacode_cli-0.0.5.dist-info}/top_level.txt +0 -0
tunacode/constants.py
CHANGED
tunacode/exceptions.py
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
"""
|
|
2
|
-
|
|
2
|
+
TunaCode CLI exception hierarchy.
|
|
3
3
|
|
|
4
|
-
This module defines all custom exceptions used throughout the
|
|
5
|
-
All exceptions inherit from
|
|
4
|
+
This module defines all custom exceptions used throughout the TunaCode CLI.
|
|
5
|
+
All exceptions inherit from TunaCodeError for easy catching of any TunaCode-specific error.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
from tunacode.types import ErrorMessage, FilePath, OriginalError, ToolName
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
12
|
-
"""Base exception for all
|
|
11
|
+
class TunaCodeError(Exception):
|
|
12
|
+
"""Base exception for all TunaCode errors."""
|
|
13
13
|
|
|
14
14
|
pass
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
# Configuration and Setup Exceptions
|
|
18
|
-
class ConfigurationError(
|
|
18
|
+
class ConfigurationError(TunaCodeError):
|
|
19
19
|
"""Raised when there's a configuration issue."""
|
|
20
20
|
|
|
21
21
|
pass
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
# User Interaction Exceptions
|
|
25
|
-
class UserAbortError(
|
|
25
|
+
class UserAbortError(TunaCodeError):
|
|
26
26
|
"""Raised when user aborts an operation."""
|
|
27
27
|
|
|
28
28
|
pass
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
class ValidationError(
|
|
31
|
+
class ValidationError(TunaCodeError):
|
|
32
32
|
"""Raised when input validation fails."""
|
|
33
33
|
|
|
34
34
|
pass
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
# Tool and Agent Exceptions
|
|
38
|
-
class ToolExecutionError(
|
|
38
|
+
class ToolExecutionError(TunaCodeError):
|
|
39
39
|
"""Raised when a tool fails to execute."""
|
|
40
40
|
|
|
41
41
|
def __init__(
|
|
@@ -46,21 +46,21 @@ class ToolExecutionError(SidekickError):
|
|
|
46
46
|
super().__init__(f"Tool '{tool_name}' failed: {message}")
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
class AgentError(
|
|
49
|
+
class AgentError(TunaCodeError):
|
|
50
50
|
"""Raised when agent operations fail."""
|
|
51
51
|
|
|
52
52
|
pass
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
# State Management Exceptions
|
|
56
|
-
class StateError(
|
|
56
|
+
class StateError(TunaCodeError):
|
|
57
57
|
"""Raised when there's an issue with application state."""
|
|
58
58
|
|
|
59
59
|
pass
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
# External Service Exceptions
|
|
63
|
-
class ServiceError(
|
|
63
|
+
class ServiceError(TunaCodeError):
|
|
64
64
|
"""Base exception for external service failures."""
|
|
65
65
|
|
|
66
66
|
pass
|
|
@@ -89,7 +89,7 @@ class GitOperationError(ServiceError):
|
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
# File System Exceptions
|
|
92
|
-
class FileOperationError(
|
|
92
|
+
class FileOperationError(TunaCodeError):
|
|
93
93
|
"""Raised when file system operations fail."""
|
|
94
94
|
|
|
95
95
|
def __init__(
|
|
@@ -59,7 +59,7 @@ def init_undo_system(state_manager: StateManager) -> bool:
|
|
|
59
59
|
home_dir = Path.home()
|
|
60
60
|
|
|
61
61
|
if cwd == home_dir:
|
|
62
|
-
|
|
62
|
+
print(f"⚠️ {UNDO_DISABLED_HOME}")
|
|
63
63
|
return False
|
|
64
64
|
|
|
65
65
|
if not is_in_git_project():
|
|
@@ -100,11 +100,11 @@ def init_undo_system(state_manager: StateManager) -> bool:
|
|
|
100
100
|
return True
|
|
101
101
|
except subprocess.TimeoutExpired as e:
|
|
102
102
|
error = GitOperationError(operation="init", message=UNDO_GIT_TIMEOUT, original_error=e)
|
|
103
|
-
|
|
103
|
+
print(f"⚠️ {str(error)}")
|
|
104
104
|
return False
|
|
105
105
|
except Exception as e:
|
|
106
106
|
error = GitOperationError(operation="init", message=str(e), original_error=e)
|
|
107
|
-
|
|
107
|
+
print(f"⚠️ {ERROR_UNDO_INIT.format(e=e)}")
|
|
108
108
|
return False
|
|
109
109
|
|
|
110
110
|
|
|
@@ -156,11 +156,11 @@ def commit_for_undo(
|
|
|
156
156
|
error = GitOperationError(
|
|
157
157
|
operation="commit", message="Git commit timed out", original_error=e
|
|
158
158
|
)
|
|
159
|
-
|
|
159
|
+
print(f"⚠️ {str(error)}")
|
|
160
160
|
return False
|
|
161
161
|
except Exception as e:
|
|
162
162
|
error = GitOperationError(operation="commit", message=str(e), original_error=e)
|
|
163
|
-
|
|
163
|
+
print(f"⚠️ Error creating undo commit: {e}")
|
|
164
164
|
return False
|
|
165
165
|
|
|
166
166
|
|
tunacode/types.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Centralized type definitions for
|
|
2
|
+
Centralized type definitions for TunaCode CLI.
|
|
3
3
|
|
|
4
4
|
This module contains all type aliases, protocols, and type definitions
|
|
5
|
-
used throughout the
|
|
5
|
+
used throughout the TunaCode codebase.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
from dataclasses import dataclass
|
tunacode/utils/system.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Module:
|
|
2
|
+
Module: tunacode.utils.system
|
|
3
3
|
|
|
4
4
|
Provides system information and directory management utilities.
|
|
5
5
|
Handles session management, device identification, file listing
|
|
@@ -13,7 +13,7 @@ import uuid
|
|
|
13
13
|
from pathlib import Path
|
|
14
14
|
|
|
15
15
|
from ..configuration.settings import ApplicationSettings
|
|
16
|
-
from ..constants import DEVICE_ID_FILE, ENV_FILE, SESSIONS_SUBDIR,
|
|
16
|
+
from ..constants import DEVICE_ID_FILE, ENV_FILE, SESSIONS_SUBDIR, TUNACODE_HOME_DIR
|
|
17
17
|
|
|
18
18
|
# Default ignore patterns if .gitignore is not found
|
|
19
19
|
DEFAULT_IGNORE_PATTERNS = {
|
|
@@ -45,15 +45,15 @@ DEFAULT_IGNORE_PATTERNS = {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
def
|
|
48
|
+
def get_tunacode_home():
|
|
49
49
|
"""
|
|
50
|
-
Get the path to the
|
|
50
|
+
Get the path to the TunaCode home directory (~/.tunacode).
|
|
51
51
|
Creates it if it doesn't exist.
|
|
52
52
|
|
|
53
53
|
Returns:
|
|
54
|
-
Path: The path to the
|
|
54
|
+
Path: The path to the TunaCode home directory.
|
|
55
55
|
"""
|
|
56
|
-
home = Path.home() /
|
|
56
|
+
home = Path.home() / TUNACODE_HOME_DIR
|
|
57
57
|
home.mkdir(exist_ok=True)
|
|
58
58
|
return home
|
|
59
59
|
|
|
@@ -68,7 +68,7 @@ def get_session_dir(state_manager):
|
|
|
68
68
|
Returns:
|
|
69
69
|
Path: The path to the current session directory.
|
|
70
70
|
"""
|
|
71
|
-
session_dir =
|
|
71
|
+
session_dir = get_tunacode_home() / SESSIONS_SUBDIR / state_manager.session.session_id
|
|
72
72
|
session_dir.mkdir(exist_ok=True, parents=True)
|
|
73
73
|
return session_dir
|
|
74
74
|
|
|
@@ -181,16 +181,16 @@ def get_cwd():
|
|
|
181
181
|
|
|
182
182
|
def get_device_id():
|
|
183
183
|
"""
|
|
184
|
-
Get the device ID from the ~/.
|
|
184
|
+
Get the device ID from the ~/.tunacode/device_id file.
|
|
185
185
|
If the file doesn't exist, generate a new UUID and save it.
|
|
186
186
|
|
|
187
187
|
Returns:
|
|
188
188
|
str: The device ID as a string.
|
|
189
189
|
"""
|
|
190
190
|
try:
|
|
191
|
-
# Get the ~/.
|
|
192
|
-
|
|
193
|
-
device_id_file =
|
|
191
|
+
# Get the ~/.tunacode directory
|
|
192
|
+
tunacode_home = get_tunacode_home()
|
|
193
|
+
device_id_file = tunacode_home / DEVICE_ID_FILE
|
|
194
194
|
|
|
195
195
|
# If the file exists, read the device ID
|
|
196
196
|
if device_id_file.exists():
|
|
@@ -245,7 +245,7 @@ def cleanup_session(state_manager):
|
|
|
245
245
|
|
|
246
246
|
def check_for_updates():
|
|
247
247
|
"""
|
|
248
|
-
Check if there's a newer version of
|
|
248
|
+
Check if there's a newer version of tunacode-cli available on PyPI.
|
|
249
249
|
|
|
250
250
|
Returns:
|
|
251
251
|
tuple: (has_update, latest_version)
|
|
@@ -257,7 +257,7 @@ def check_for_updates():
|
|
|
257
257
|
current_version = app_settings.version
|
|
258
258
|
try:
|
|
259
259
|
result = subprocess.run(
|
|
260
|
-
["pip", "index", "versions", "
|
|
260
|
+
["pip", "index", "versions", "tunacode-cli"], capture_output=True, text=True, check=True
|
|
261
261
|
)
|
|
262
262
|
output = result.stdout
|
|
263
263
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
tunacode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
tunacode/constants.py,sha256=
|
|
2
|
+
tunacode/constants.py,sha256=eht1b04PEbz2SPJL4BL1NkWTrQblvzdCws1bPPMumco,4249
|
|
3
3
|
tunacode/context.py,sha256=0ttsxxLAyD4pSoxw7S-pyzor0JUkhOFZh96aAf4Kqsg,2634
|
|
4
|
-
tunacode/exceptions.py,sha256=
|
|
4
|
+
tunacode/exceptions.py,sha256=RFUH8wOsWEvSPGIYM2exr4t47YkEyZt4Fr-DfTo6_JY,2647
|
|
5
5
|
tunacode/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
tunacode/setup.py,sha256=KCNhnu8FY5bFRqR0JMIh22xVakCC97kchmyGsUGUaJ4,1811
|
|
7
|
-
tunacode/types.py,sha256
|
|
7
|
+
tunacode/types.py,sha256=5mMJDgFqVcKzhtHh9unPISBFqkeNje6KISGUpRkqRjY,7146
|
|
8
8
|
tunacode/cli/__init__.py,sha256=zgs0UbAck8hfvhYsWhWOfBe5oK09ug2De1r4RuQZREA,55
|
|
9
9
|
tunacode/cli/commands.py,sha256=911tz2e13ljTVlY5DR44qt8aeyTQo4dF4H9BoziRMtA,20732
|
|
10
10
|
tunacode/cli/main.py,sha256=5_CXYtzN-Mc3nOv2Xpk6yfnV4d2SOgA9ENyTCe0cYYw,1226
|
|
@@ -29,7 +29,7 @@ tunacode/core/setup/undo_setup.py,sha256=uHy7YWXPnxQ-b_36SNKtMZNyDR_u-p4OPDARHAg
|
|
|
29
29
|
tunacode/prompts/system.txt,sha256=freAiukJH4PN-fKRWBdTogEak7BsZMgwdyWkxQtY-X4,3194
|
|
30
30
|
tunacode/services/__init__.py,sha256=w_E8QK6RnvKSvU866eDe8BCRV26rAm4d3R-Yg06OWCU,19
|
|
31
31
|
tunacode/services/mcp.py,sha256=R48X73KQjQ9vwhBrtbWHSBl-4K99QXmbIhh5J_1Gezo,3046
|
|
32
|
-
tunacode/services/undo_service.py,sha256=
|
|
32
|
+
tunacode/services/undo_service.py,sha256=lb2IlSv7bMDOOz72iVAiAy-0U49T1MsCO9bhhNhdzww,7783
|
|
33
33
|
tunacode/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
34
|
tunacode/tools/base.py,sha256=5IXKgiHVnV7pPgWTiT0mhFLy2dA2vuryy8Ri_CHsZBY,8936
|
|
35
35
|
tunacode/tools/read_file.py,sha256=QW97pPVcHvNJk48iPSwzOZ9Dbq_Ce8lQ7W0F82SXi7k,3051
|
|
@@ -54,12 +54,12 @@ tunacode/utils/bm25.py,sha256=yq7KFWP3g_zIsjUV7l2hFPXYCzXyNQUInLU7u4qsc_4,1909
|
|
|
54
54
|
tunacode/utils/diff_utils.py,sha256=V9PM1Of0wvWNTVyw7iZYrNowFuRiKSyWiw5F39yRRYA,2394
|
|
55
55
|
tunacode/utils/file_utils.py,sha256=AXiAJ_idtlmXEi9pMvwtfPy9Ys3yK-F4K7qb_NpwonU,923
|
|
56
56
|
tunacode/utils/ripgrep.py,sha256=AXUs2FFt0A7KBV996deS8wreIlUzKOlAHJmwrcAr4No,583
|
|
57
|
-
tunacode/utils/system.py,sha256=
|
|
57
|
+
tunacode/utils/system.py,sha256=FSoibTIH0eybs4oNzbYyufIiV6gb77QaeY2yGqW39AY,11381
|
|
58
58
|
tunacode/utils/text_utils.py,sha256=B9M1cuLTm_SSsr15WNHF6j7WdLWPvWzKZV0Lvfgdbjg,2458
|
|
59
59
|
tunacode/utils/user_configuration.py,sha256=uFrpSRTUf0CijZjw1rOp1sovqy1uyr0UNcn85S6jvdk,1790
|
|
60
|
-
tunacode_cli-0.0.
|
|
61
|
-
tunacode_cli-0.0.
|
|
62
|
-
tunacode_cli-0.0.
|
|
63
|
-
tunacode_cli-0.0.
|
|
64
|
-
tunacode_cli-0.0.
|
|
65
|
-
tunacode_cli-0.0.
|
|
60
|
+
tunacode_cli-0.0.5.dist-info/licenses/LICENSE,sha256=SgvEceNP-y3_WodntkMGAkZyl_hAUvzBw5T9W--7YpM,1070
|
|
61
|
+
tunacode_cli-0.0.5.dist-info/METADATA,sha256=NPj-s0FCkwHywQzvnaqAdRIBSLGraEG-D73XXuTNVxU,7422
|
|
62
|
+
tunacode_cli-0.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
63
|
+
tunacode_cli-0.0.5.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
|
|
64
|
+
tunacode_cli-0.0.5.dist-info/top_level.txt,sha256=lKy2P6BWNi5XSA4DHFvyjQ14V26lDZctwdmhEJrxQbU,9
|
|
65
|
+
tunacode_cli-0.0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|