code-puppy 0.0.49__tar.gz → 0.0.50__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.
Files changed (27) hide show
  1. {code_puppy-0.0.49 → code_puppy-0.0.50}/PKG-INFO +1 -1
  2. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/command_line/meta_command_handler.py +17 -0
  3. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/config.py +19 -2
  4. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/command_runner.py +2 -1
  5. {code_puppy-0.0.49 → code_puppy-0.0.50}/pyproject.toml +1 -1
  6. {code_puppy-0.0.49 → code_puppy-0.0.50}/.gitignore +0 -0
  7. {code_puppy-0.0.49 → code_puppy-0.0.50}/LICENSE +0 -0
  8. {code_puppy-0.0.49 → code_puppy-0.0.50}/README.md +0 -0
  9. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/__init__.py +0 -0
  10. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/agent.py +0 -0
  11. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/agent_prompts.py +0 -0
  12. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/command_line/__init__.py +0 -0
  13. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/command_line/file_path_completion.py +0 -0
  14. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/command_line/model_picker_completion.py +0 -0
  15. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/command_line/prompt_toolkit_completion.py +0 -0
  16. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/command_line/utils.py +0 -0
  17. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/main.py +0 -0
  18. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/model_factory.py +0 -0
  19. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/models.json +0 -0
  20. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/session_memory.py +0 -0
  21. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/__init__.py +0 -0
  22. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/code_map.py +0 -0
  23. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/common.py +0 -0
  24. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/file_modifications.py +0 -0
  25. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/file_operations.py +0 -0
  26. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/web_search.py +0 -0
  27. {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/version_checker.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-puppy
3
- Version: 0.0.49
3
+ Version: 0.0.50
4
4
  Summary: Code generation agent
5
5
  Author: Michael Pfaffenberger
6
6
  License: MIT
@@ -44,6 +44,23 @@ def handle_meta_command(command: str, console: Console) -> bool:
44
44
  console.print(f'[red]Not a directory:[/red] [bold]{dirname}[/bold]')
45
45
  return True
46
46
 
47
+ if command.strip().startswith("~show"):
48
+ from code_puppy.config import get_puppy_name, get_owner_name
49
+ from code_puppy.command_line.model_picker_completion import get_active_model
50
+ import os
51
+ puppy_name = get_puppy_name()
52
+ owner_name = get_owner_name()
53
+ model = get_active_model()
54
+ from code_puppy.config import get_yolo_mode
55
+ yolo_mode = get_yolo_mode()
56
+ console.print(f'''[bold magenta]🐶 Puppy Status[/bold magenta]
57
+ \n[bold]puppy_name:[/bold] [cyan]{puppy_name}[/cyan]
58
+ [bold]owner_name:[/bold] [cyan]{owner_name}[/cyan]
59
+ [bold]model:[/bold] [green]{model}[/green]
60
+ [bold]YOLO_MODE:[/bold] {'[red]ON[/red]' if yolo_mode else '[yellow]off[/yellow]'}
61
+ ''')
62
+ return True
63
+
47
64
  if command.startswith("~m"):
48
65
  # Try setting model and show confirmation
49
66
  new_input = update_model_in_input(command)
@@ -7,7 +7,6 @@ CONFIG_FILE = os.path.join(CONFIG_DIR, "puppy.cfg")
7
7
  DEFAULT_SECTION = "puppy"
8
8
  REQUIRED_KEYS = ["puppy_name", "owner_name"]
9
9
 
10
-
11
10
  def ensure_config_exists():
12
11
  """
13
12
  Ensure that the .code_puppy dir and puppy.cfg exist, prompting if needed.
@@ -45,7 +44,6 @@ def get_value(key: str):
45
44
  val = config.get(DEFAULT_SECTION, key, fallback=None)
46
45
  return val
47
46
 
48
-
49
47
  def get_puppy_name():
50
48
  return get_value("puppy_name") or "Puppy"
51
49
 
@@ -66,3 +64,22 @@ def set_model_name(model: str):
66
64
  config[DEFAULT_SECTION]["model"] = model or ""
67
65
  with open(CONFIG_FILE, "w") as f:
68
66
  config.write(f)
67
+
68
+ def get_yolo_mode():
69
+ """Checks env var CODE_PUPPY_YOLO or puppy.cfg for 'yolo_mode'.
70
+ Returns True if either is explicitly truthy, else False by default.
71
+ Env var wins if both are set.
72
+ Allowed env/cfg values: 1, '1', 'true', 'yes', 'on' (case-insensitive).
73
+ """
74
+ env_val = os.getenv('YOLO_MODE')
75
+ true_vals = {'1', 'true', 'yes', 'on'}
76
+ if env_val is not None:
77
+ if str(env_val).strip().lower() in true_vals:
78
+ return True
79
+ return False
80
+ cfg_val = get_value('yolo_mode')
81
+ if cfg_val is not None:
82
+ if str(cfg_val).strip().lower() in true_vals:
83
+ return True
84
+ return False
85
+ return False
@@ -19,7 +19,8 @@ def register_command_runner_tools(agent):
19
19
  if cwd:
20
20
  console.print(f"[dim]Working directory: {cwd}[/dim]")
21
21
  console.print("[dim]" + "-" * 60 + "[/dim]")
22
- yolo_mode = os.getenv("YOLO_MODE", "false").lower() == "true"
22
+ from code_puppy.config import get_yolo_mode
23
+ yolo_mode = get_yolo_mode()
23
24
  if not yolo_mode:
24
25
  user_input = input("Are you sure you want to run this command? (yes/no): ")
25
26
  if user_input.strip().lower() not in {"yes", "y"}:
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "code-puppy"
7
- version = "0.0.49"
7
+ version = "0.0.50"
8
8
  description = "Code generation agent"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes
File without changes