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.
- {code_puppy-0.0.49 → code_puppy-0.0.50}/PKG-INFO +1 -1
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/command_line/meta_command_handler.py +17 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/config.py +19 -2
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/command_runner.py +2 -1
- {code_puppy-0.0.49 → code_puppy-0.0.50}/pyproject.toml +1 -1
- {code_puppy-0.0.49 → code_puppy-0.0.50}/.gitignore +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/LICENSE +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/README.md +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/__init__.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/agent.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/agent_prompts.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/command_line/__init__.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/command_line/file_path_completion.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/command_line/model_picker_completion.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/command_line/prompt_toolkit_completion.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/command_line/utils.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/main.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/model_factory.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/models.json +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/session_memory.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/__init__.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/code_map.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/common.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/file_modifications.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/file_operations.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/tools/web_search.py +0 -0
- {code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/version_checker.py +0 -0
|
@@ -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
|
-
|
|
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"}:
|
|
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
|
{code_puppy-0.0.49 → code_puppy-0.0.50}/code_puppy/command_line/prompt_toolkit_completion.py
RENAMED
|
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
|