code-puppy 0.0.287__py3-none-any.whl → 0.0.323__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.
- code_puppy/__init__.py +3 -1
- code_puppy/agents/agent_code_puppy.py +5 -4
- code_puppy/agents/agent_creator_agent.py +22 -18
- code_puppy/agents/agent_manager.py +2 -2
- code_puppy/agents/base_agent.py +496 -102
- code_puppy/callbacks.py +8 -0
- code_puppy/chatgpt_codex_client.py +283 -0
- code_puppy/cli_runner.py +795 -0
- code_puppy/command_line/add_model_menu.py +19 -16
- code_puppy/command_line/attachments.py +10 -5
- code_puppy/command_line/autosave_menu.py +269 -41
- code_puppy/command_line/colors_menu.py +515 -0
- code_puppy/command_line/command_handler.py +10 -24
- code_puppy/command_line/config_commands.py +106 -25
- code_puppy/command_line/core_commands.py +32 -20
- code_puppy/command_line/mcp/add_command.py +3 -16
- code_puppy/command_line/mcp/base.py +0 -3
- code_puppy/command_line/mcp/catalog_server_installer.py +15 -15
- code_puppy/command_line/mcp/custom_server_form.py +66 -5
- code_puppy/command_line/mcp/custom_server_installer.py +17 -17
- code_puppy/command_line/mcp/edit_command.py +15 -22
- code_puppy/command_line/mcp/handler.py +7 -2
- code_puppy/command_line/mcp/help_command.py +2 -2
- code_puppy/command_line/mcp/install_command.py +10 -14
- code_puppy/command_line/mcp/install_menu.py +2 -6
- code_puppy/command_line/mcp/list_command.py +2 -2
- code_puppy/command_line/mcp/logs_command.py +174 -65
- code_puppy/command_line/mcp/remove_command.py +2 -2
- code_puppy/command_line/mcp/restart_command.py +7 -2
- code_puppy/command_line/mcp/search_command.py +16 -10
- code_puppy/command_line/mcp/start_all_command.py +16 -6
- code_puppy/command_line/mcp/start_command.py +12 -10
- code_puppy/command_line/mcp/status_command.py +4 -5
- code_puppy/command_line/mcp/stop_all_command.py +5 -1
- code_puppy/command_line/mcp/stop_command.py +6 -4
- code_puppy/command_line/mcp/test_command.py +2 -2
- code_puppy/command_line/mcp/wizard_utils.py +20 -16
- code_puppy/command_line/model_settings_menu.py +53 -7
- code_puppy/command_line/motd.py +1 -1
- code_puppy/command_line/pin_command_completion.py +82 -7
- code_puppy/command_line/prompt_toolkit_completion.py +32 -9
- code_puppy/command_line/session_commands.py +11 -4
- code_puppy/config.py +217 -53
- code_puppy/error_logging.py +118 -0
- code_puppy/gemini_code_assist.py +385 -0
- code_puppy/keymap.py +126 -0
- code_puppy/main.py +5 -745
- code_puppy/mcp_/__init__.py +17 -0
- code_puppy/mcp_/blocking_startup.py +63 -36
- code_puppy/mcp_/captured_stdio_server.py +1 -1
- code_puppy/mcp_/config_wizard.py +4 -4
- code_puppy/mcp_/dashboard.py +15 -6
- code_puppy/mcp_/managed_server.py +25 -5
- code_puppy/mcp_/manager.py +65 -0
- code_puppy/mcp_/mcp_logs.py +224 -0
- code_puppy/mcp_/registry.py +6 -6
- code_puppy/messaging/__init__.py +184 -2
- code_puppy/messaging/bus.py +610 -0
- code_puppy/messaging/commands.py +167 -0
- code_puppy/messaging/markdown_patches.py +57 -0
- code_puppy/messaging/message_queue.py +3 -3
- code_puppy/messaging/messages.py +470 -0
- code_puppy/messaging/renderers.py +43 -141
- code_puppy/messaging/rich_renderer.py +900 -0
- code_puppy/messaging/spinner/console_spinner.py +39 -2
- code_puppy/model_factory.py +292 -53
- code_puppy/model_utils.py +57 -48
- code_puppy/models.json +19 -5
- code_puppy/plugins/__init__.py +152 -10
- code_puppy/plugins/chatgpt_oauth/config.py +20 -12
- code_puppy/plugins/chatgpt_oauth/oauth_flow.py +5 -6
- code_puppy/plugins/chatgpt_oauth/register_callbacks.py +3 -3
- code_puppy/plugins/chatgpt_oauth/test_plugin.py +30 -13
- code_puppy/plugins/chatgpt_oauth/utils.py +180 -65
- code_puppy/plugins/claude_code_oauth/config.py +15 -11
- code_puppy/plugins/claude_code_oauth/register_callbacks.py +28 -0
- code_puppy/plugins/claude_code_oauth/utils.py +6 -1
- code_puppy/plugins/example_custom_command/register_callbacks.py +2 -2
- code_puppy/plugins/oauth_puppy_html.py +3 -0
- code_puppy/plugins/shell_safety/agent_shell_safety.py +1 -134
- code_puppy/plugins/shell_safety/command_cache.py +156 -0
- code_puppy/plugins/shell_safety/register_callbacks.py +77 -3
- code_puppy/prompts/codex_system_prompt.md +310 -0
- code_puppy/pydantic_patches.py +131 -0
- code_puppy/session_storage.py +2 -1
- code_puppy/status_display.py +7 -5
- code_puppy/terminal_utils.py +126 -0
- code_puppy/tools/agent_tools.py +131 -70
- code_puppy/tools/browser/browser_control.py +10 -14
- code_puppy/tools/browser/browser_interactions.py +20 -28
- code_puppy/tools/browser/browser_locators.py +27 -29
- code_puppy/tools/browser/browser_navigation.py +9 -9
- code_puppy/tools/browser/browser_screenshot.py +12 -14
- code_puppy/tools/browser/browser_scripts.py +17 -29
- code_puppy/tools/browser/browser_workflows.py +24 -25
- code_puppy/tools/browser/camoufox_manager.py +22 -26
- code_puppy/tools/command_runner.py +410 -88
- code_puppy/tools/common.py +51 -38
- code_puppy/tools/file_modifications.py +98 -24
- code_puppy/tools/file_operations.py +113 -202
- code_puppy/version_checker.py +28 -13
- {code_puppy-0.0.287.data → code_puppy-0.0.323.data}/data/code_puppy/models.json +19 -5
- {code_puppy-0.0.287.dist-info → code_puppy-0.0.323.dist-info}/METADATA +3 -8
- code_puppy-0.0.323.dist-info/RECORD +168 -0
- code_puppy/tui_state.py +0 -55
- code_puppy-0.0.287.dist-info/RECORD +0 -153
- {code_puppy-0.0.287.data → code_puppy-0.0.323.data}/data/code_puppy/models_dev_api.json +0 -0
- {code_puppy-0.0.287.dist-info → code_puppy-0.0.323.dist-info}/WHEEL +0 -0
- {code_puppy-0.0.287.dist-info → code_puppy-0.0.323.dist-info}/entry_points.txt +0 -0
- {code_puppy-0.0.287.dist-info → code_puppy-0.0.323.dist-info}/licenses/LICENSE +0 -0
code_puppy/__init__.py
CHANGED
|
@@ -2,7 +2,9 @@ import importlib.metadata
|
|
|
2
2
|
|
|
3
3
|
# Biscuit was here! 🐶
|
|
4
4
|
try:
|
|
5
|
-
|
|
5
|
+
_detected_version = importlib.metadata.version("code-puppy")
|
|
6
|
+
# Ensure we never end up with None or empty string
|
|
7
|
+
__version__ = _detected_version if _detected_version else "0.0.0-dev"
|
|
6
8
|
except Exception:
|
|
7
9
|
# Fallback for dev environments where metadata might not be available
|
|
8
10
|
__version__ = "0.0.0-dev"
|
|
@@ -128,10 +128,11 @@ Reasoning & Explanation:
|
|
|
128
128
|
|
|
129
129
|
Agent Management:
|
|
130
130
|
- list_agents(): Use this to list all available sub-agents that can be invoked
|
|
131
|
-
- invoke_agent(agent_name: str, prompt: str, session_id: str | None = None): Use this to invoke a specific sub-agent with a given prompt.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
- invoke_agent(agent_name: str, prompt: str, session_id: str | None = None): Use this to invoke a specific sub-agent with a given prompt.
|
|
132
|
+
Returns: {{response, agent_name, session_id, error}} - The session_id in the response is the FULL ID to use for continuation!
|
|
133
|
+
- For NEW sessions: provide a base name like "review-auth" - a SHA1 hash suffix is automatically appended
|
|
134
|
+
- To CONTINUE a session: use the session_id from the previous invocation's response
|
|
135
|
+
- For one-off tasks: leave session_id as None (auto-generates)
|
|
135
136
|
|
|
136
137
|
Important rules:
|
|
137
138
|
- You MUST use tools to accomplish tasks - DO NOT just output code or descriptions
|
|
@@ -223,40 +223,45 @@ Arguments:
|
|
|
223
223
|
- agent_name (required): Name of the agent to invoke
|
|
224
224
|
- user_prompt (required): The prompt to send to the invoked agent
|
|
225
225
|
- session_id (optional): Kebab-case session identifier for conversation memory
|
|
226
|
-
- Format: lowercase, numbers, hyphens only
|
|
227
|
-
-
|
|
228
|
-
-
|
|
229
|
-
-
|
|
230
|
-
|
|
226
|
+
- Format: lowercase, numbers, hyphens only (e.g., "implement-oauth", "review-auth")
|
|
227
|
+
- For NEW sessions: provide a base name - a SHA1 hash suffix is automatically appended for uniqueness
|
|
228
|
+
- To CONTINUE a session: use the session_id from the previous invocation's response
|
|
229
|
+
- If None (default): Auto-generates a unique session like "agent-name-session-a3f2b1"
|
|
230
|
+
|
|
231
|
+
Returns: `{{response, agent_name, session_id, error}}`
|
|
232
|
+
- **session_id in the response is the FULL ID** - use this to continue the conversation!
|
|
231
233
|
|
|
232
234
|
Example usage:
|
|
233
235
|
```python
|
|
234
236
|
# Common case: one-off invocation (no memory needed)
|
|
235
|
-
invoke_agent(
|
|
237
|
+
result = invoke_agent(
|
|
236
238
|
agent_name="python-tutor",
|
|
237
239
|
user_prompt="Explain how to use list comprehensions"
|
|
238
240
|
)
|
|
241
|
+
# result.session_id contains the auto-generated full ID
|
|
239
242
|
|
|
240
|
-
# Multi-turn conversation: start with
|
|
241
|
-
invoke_agent(
|
|
243
|
+
# Multi-turn conversation: start with a base session_id
|
|
244
|
+
result1 = invoke_agent(
|
|
242
245
|
agent_name="code-reviewer",
|
|
243
246
|
user_prompt="Review this authentication code",
|
|
244
|
-
session_id="auth-code-review
|
|
247
|
+
session_id="auth-code-review" # Hash suffix auto-appended
|
|
245
248
|
)
|
|
249
|
+
# result1.session_id is now "auth-code-review-a3f2b1" (or similar)
|
|
246
250
|
|
|
247
|
-
# Continue the SAME conversation
|
|
248
|
-
invoke_agent(
|
|
251
|
+
# Continue the SAME conversation using session_id from the response
|
|
252
|
+
result2 = invoke_agent(
|
|
249
253
|
agent_name="code-reviewer",
|
|
250
254
|
user_prompt="Can you also check the authorization logic?",
|
|
251
|
-
session_id=
|
|
255
|
+
session_id=result1.session_id # Use session_id from previous response!
|
|
252
256
|
)
|
|
253
257
|
|
|
254
|
-
# Independent task (different
|
|
255
|
-
invoke_agent(
|
|
258
|
+
# Independent task (different base name = different session)
|
|
259
|
+
result3 = invoke_agent(
|
|
256
260
|
agent_name="code-reviewer",
|
|
257
261
|
user_prompt="Review the payment processing code",
|
|
258
|
-
session_id="payment-review
|
|
262
|
+
session_id="payment-review" # Gets its own unique hash suffix
|
|
259
263
|
)
|
|
264
|
+
# result3.session_id is different from result1.session_id
|
|
260
265
|
```
|
|
261
266
|
|
|
262
267
|
Best-practice guidelines for `invoke_agent`:
|
|
@@ -266,9 +271,8 @@ Best-practice guidelines for `invoke_agent`:
|
|
|
266
271
|
• Avoid circular dependencies (don't invoke yourself!)
|
|
267
272
|
• **Session management:**
|
|
268
273
|
- Default behavior (session_id=None): Each invocation is independent with no memory
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
- ALWAYS append 3-6 random characters/numbers at the end for uniqueness (prevents namespace collisions)
|
|
274
|
+
- For NEW sessions: provide a human-readable base name like "review-oauth" - hash suffix is auto-appended
|
|
275
|
+
- To CONTINUE: use the session_id from the previous response (it contains the full ID with hash)
|
|
272
276
|
- Most tasks don't need conversational memory - let it auto-generate!
|
|
273
277
|
|
|
274
278
|
### Important Rules for Agent Creation:
|
|
@@ -28,9 +28,9 @@ _SESSION_FILE_LOADED: bool = False
|
|
|
28
28
|
# Session persistence file path
|
|
29
29
|
def _get_session_file_path() -> Path:
|
|
30
30
|
"""Get the path to the terminal sessions file."""
|
|
31
|
-
from ..config import
|
|
31
|
+
from ..config import STATE_DIR
|
|
32
32
|
|
|
33
|
-
return Path(
|
|
33
|
+
return Path(STATE_DIR) / "terminal_sessions.json"
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def get_terminal_session_id() -> str:
|