tunacode-cli 0.0.49__py3-none-any.whl → 0.0.51__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 CHANGED
@@ -7,7 +7,7 @@ Centralizes all magic strings, UI text, error messages, and application constant
7
7
 
8
8
  # Application info
9
9
  APP_NAME = "TunaCode"
10
- APP_VERSION = "0.0.49"
10
+ APP_VERSION = "0.0.51"
11
11
 
12
12
 
13
13
  # File patterns
@@ -1,28 +1,70 @@
1
1
  import logging
2
2
  import logging.config
3
- import os
4
3
 
5
- import yaml
4
+ from tunacode.utils import user_configuration
6
5
 
7
- DEFAULT_CONFIG_PATH = os.path.join(
8
- os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "config", "logging.yaml"
9
- )
6
+ # Default logging configuration when none is provided
7
+ DEFAULT_LOGGING_CONFIG = {
8
+ "version": 1,
9
+ "disable_existing_loggers": False,
10
+ "formatters": {
11
+ "simple": {"format": "[%(levelname)s] %(message)s"},
12
+ "detailed": {"format": "[%(asctime)s] [%(levelname)s] [%(name)s:%(lineno)d] - %(message)s"},
13
+ },
14
+ "handlers": {
15
+ "file": {
16
+ "class": "logging.handlers.RotatingFileHandler",
17
+ "level": "DEBUG",
18
+ "formatter": "detailed",
19
+ "filename": "tunacode.log",
20
+ "maxBytes": 10485760, # 10MB
21
+ "backupCount": 5,
22
+ }
23
+ },
24
+ "root": {"level": "DEBUG", "handlers": ["file"]},
25
+ "loggers": {
26
+ "tunacode.ui": {"level": "INFO", "propagate": False},
27
+ "tunacode.tools": {"level": "DEBUG"},
28
+ "tunacode.core.agents": {"level": "DEBUG"},
29
+ },
30
+ }
10
31
 
11
32
 
12
33
  class LogConfig:
13
34
  @staticmethod
14
35
  def load(config_path=None):
15
36
  """
16
- Load logging configuration from YAML file and apply it.
37
+ Load logging configuration based on user preferences.
38
+ If logging is disabled (default), use minimal configuration.
17
39
  """
18
- path = config_path or DEFAULT_CONFIG_PATH
19
- if not os.path.exists(path):
20
- raise FileNotFoundError(f"Logging config file not found: {path}")
21
- with open(path, "r") as f:
22
- config = yaml.safe_load(f)
23
- logging_config = config.get("logging", config)
24
- try:
25
- logging.config.dictConfig(logging_config)
26
- except Exception as e:
27
- print(f"Failed to configure logging: {e}")
28
- logging.basicConfig(level=logging.INFO)
40
+ # First check if user has enabled logging
41
+ user_config = user_configuration.load_config()
42
+ logging_enabled = False
43
+ custom_logging_config = None
44
+
45
+ if user_config:
46
+ logging_enabled = user_config.get("logging_enabled", False)
47
+ custom_logging_config = user_config.get("logging", None)
48
+
49
+ if not logging_enabled:
50
+ # Configure minimal logging - only critical errors to console
51
+ logging.basicConfig(level=logging.CRITICAL, handlers=[logging.NullHandler()])
52
+ # Ensure no file handlers are created
53
+ logging.getLogger().handlers = [logging.NullHandler()]
54
+ return
55
+
56
+ # Logging is enabled, load configuration
57
+ if custom_logging_config:
58
+ # Use user's custom logging configuration
59
+ try:
60
+ logging.config.dictConfig(custom_logging_config)
61
+ except Exception as e:
62
+ print(f"Failed to configure custom logging: {e}")
63
+ logging.basicConfig(level=logging.INFO)
64
+ else:
65
+ # Use default configuration
66
+ try:
67
+ logging.config.dictConfig(DEFAULT_LOGGING_CONFIG)
68
+ except Exception as e:
69
+ print(f"Failed to configure default logging: {e}")
70
+ logging.basicConfig(level=logging.INFO)
tunacode/types.py CHANGED
@@ -49,6 +49,10 @@ SessionId = str
49
49
  DeviceId = str
50
50
  InputSessions = Dict[str, Any]
51
51
 
52
+ # Logging configuration types
53
+ LoggingConfig = Dict[str, Any]
54
+ LoggingEnabled = bool
55
+
52
56
  # =============================================================================
53
57
  # Configuration Types
54
58
  # =============================================================================
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tunacode-cli
3
- Version: 0.0.49
3
+ Version: 0.0.51
4
4
  Summary: Your agentic CLI developer.
5
5
  Author-email: larock22 <noreply@github.com>
6
6
  License: MIT
@@ -1,12 +1,12 @@
1
1
  api/auth.py,sha256=_ysF1RCXvtJR1S35lbYQZexES1lif4J6VVzEyqNK74Q,303
2
2
  api/users.py,sha256=WRcy1Vsr4cEC8CW2qeN3XrA9EMyIk47ufpMyvQ4nLuw,193
3
3
  tunacode/__init__.py,sha256=yUul8igNYMfUrHnYfioIGAqvrH8b5BKiO_pt1wVnmd0,119
4
- tunacode/constants.py,sha256=oxUB7zL0wk998eBXu9xV85PKp18FtYSbHlqxRy8TtbI,5169
4
+ tunacode/constants.py,sha256=UHIkQ_6jwGc9xdupwtCXJRJnRM4yqHx5bXkcej6mCE0,5169
5
5
  tunacode/context.py,sha256=_gXVCyjU052jlyRAl9tklZSwl5U_zI_EIX8XN87VVWE,2786
6
6
  tunacode/exceptions.py,sha256=oDO1SVKOgjcKIylwqdbqh_g5my4roU5mB9Nv4n_Vb0s,3877
7
7
  tunacode/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  tunacode/setup.py,sha256=XPt4eAK-qcIZQv64jGZ_ryxcImDwps9OmXjJfIS1xcs,1899
9
- tunacode/types.py,sha256=y8jqLvdSDdi2Y4YECVG2uctpBjjBh9MJ4w1EDEZdYf0,8173
9
+ tunacode/types.py,sha256=JqHTPb3fyCh5EC9ZSdoHmBN4DgiLj_2gMK8LbUMqtLk,8257
10
10
  tunacode/cli/__init__.py,sha256=zgs0UbAck8hfvhYsWhWOfBe5oK09ug2De1r4RuQZREA,55
11
11
  tunacode/cli/main.py,sha256=erP6jNXcxVQOVn8sm6uNaLEAYevniVXl6Sem872mW68,2755
12
12
  tunacode/cli/repl.py,sha256=jg2lnr-ZuYUKiSIJBDR9uFsIP7b_gBA6EoxMDgTSwCw,20385
@@ -35,7 +35,7 @@ tunacode/core/background/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
35
35
  tunacode/core/background/manager.py,sha256=rJdl3eDLTQwjbT7VhxXcJbZopCNR3M8ZGMbmeVnwwMc,1126
36
36
  tunacode/core/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
37
  tunacode/core/logging/__init__.py,sha256=pGr3EXxS4Yyz6Gasqg-m9fUENWnnbyaQqMaxR56WW4c,635
38
- tunacode/core/logging/config.py,sha256=EC5JLPq6JcF-zYNxJ6ZTizrxttY3Jp56zb8TGTWaUjQ,845
38
+ tunacode/core/logging/config.py,sha256=qwY7D8PYdMziGyJIYiZqChmOjgbsScluRJkruuOXu2A,2514
39
39
  tunacode/core/logging/formatters.py,sha256=lDex7P5eFzu-r9VEMshohj1zxWqANWSS581CJoMp-HA,1210
40
40
  tunacode/core/logging/handlers.py,sha256=SxmgH7yWc8bbCKcDeBtkbkHJy5saRqbIoDoTQh4jiYQ,2538
41
41
  tunacode/core/logging/logger.py,sha256=9RjRuX0GoUojRJ8WnJGQPFdXiluiJMCoFmvc8xEioB8,142
@@ -99,9 +99,9 @@ tunacode/utils/system.py,sha256=FSoibTIH0eybs4oNzbYyufIiV6gb77QaeY2yGqW39AY,1138
99
99
  tunacode/utils/text_utils.py,sha256=6YBD9QfkDO44-6jxnwRWIpmfIifPG-NqMzy_O2NAouc,7277
100
100
  tunacode/utils/token_counter.py,sha256=lLbkrNUraRQn5RMhwnGurqq1RHFDyn4AaFhruONWIxo,2690
101
101
  tunacode/utils/user_configuration.py,sha256=Ilz8dpGVJDBE2iLWHAPT0xR8D51VRKV3kIbsAz8Bboc,3275
102
- tunacode_cli-0.0.49.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
103
- tunacode_cli-0.0.49.dist-info/METADATA,sha256=YdmUijOV5ybOmyMWEYJHEtAWpVur1dhi8ezMKKS81BM,5906
104
- tunacode_cli-0.0.49.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
105
- tunacode_cli-0.0.49.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
106
- tunacode_cli-0.0.49.dist-info/top_level.txt,sha256=GuU751acRvOhM5yLKFW0-gBg62JGh5zycDSq4tRFOYE,13
107
- tunacode_cli-0.0.49.dist-info/RECORD,,
102
+ tunacode_cli-0.0.51.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
103
+ tunacode_cli-0.0.51.dist-info/METADATA,sha256=fmzMXrwNvILw3BFNvJmIt3HwZWLVhP7_FAjWM5ysFNM,5906
104
+ tunacode_cli-0.0.51.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
105
+ tunacode_cli-0.0.51.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
106
+ tunacode_cli-0.0.51.dist-info/top_level.txt,sha256=GuU751acRvOhM5yLKFW0-gBg62JGh5zycDSq4tRFOYE,13
107
+ tunacode_cli-0.0.51.dist-info/RECORD,,