code-puppy 1.0.0__tar.gz → 1.0.2__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 (42) hide show
  1. code_puppy-1.0.2/PKG-INFO +208 -0
  2. code_puppy-1.0.2/README.md +183 -0
  3. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/distribution.py +54 -9
  4. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/main.py +32 -1
  5. {code_puppy-1.0.0 → code_puppy-1.0.2}/pyproject.toml +1 -1
  6. code_puppy-1.0.0/PKG-INFO +0 -972
  7. code_puppy-1.0.0/README.md +0 -947
  8. {code_puppy-1.0.0 → code_puppy-1.0.2}/.gitignore +0 -0
  9. {code_puppy-1.0.0 → code_puppy-1.0.2}/LICENSE +0 -0
  10. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/__init__.py +0 -0
  11. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/__main__.py +0 -0
  12. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/_art.py +0 -0
  13. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/api_keys.py +0 -0
  14. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/branding.py +0 -0
  15. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/builtin_plugins.py +0 -0
  16. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/callbacks.py +0 -0
  17. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/colors.py +0 -0
  18. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/compat/__init__.py +0 -0
  19. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/compat/bridge.py +0 -0
  20. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/compat/tools.py +0 -0
  21. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/config.py +0 -0
  22. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/first_run.py +0 -0
  23. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/former_name.py +0 -0
  24. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/i18n/__init__.py +0 -0
  25. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/identity.py +0 -0
  26. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/legacy_sessions.py +0 -0
  27. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/legacy_store.py +0 -0
  28. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/messaging/__init__.py +0 -0
  29. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/messaging/bus.py +0 -0
  30. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/migrate/__init__.py +0 -0
  31. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/migrate/runner.py +0 -0
  32. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/migrate/sources.py +0 -0
  33. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/migrate/translate.py +0 -0
  34. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/personality.py +0 -0
  35. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/plugins/__init__.py +0 -0
  36. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/plugins/source_only.py +0 -0
  37. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/plugins/trust.py +0 -0
  38. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/splash/__init__.py +0 -0
  39. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/splash/__main__.py +0 -0
  40. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/splash/canvas.py +0 -0
  41. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/splash/scenes.py +0 -0
  42. {code_puppy-1.0.0 → code_puppy-1.0.2}/code_puppy/update.py +0 -0
@@ -0,0 +1,208 @@
1
+ Metadata-Version: 2.5
2
+ Name: code-puppy
3
+ Version: 1.0.2
4
+ Summary: Code generation agent
5
+ Project-URL: repository, https://github.com/mpfaffenberger/code_puppy
6
+ Project-URL: HomePage, https://github.com/mpfaffenberger/code_puppy
7
+ Author: Michael Pfaffenberger
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Topic :: Software Development :: Code Generators
18
+ Requires-Python: <3.15,>=3.11
19
+ Requires-Dist: cbor2<6; sys_platform == 'darwin' and platform_machine == 'x86_64'
20
+ Requires-Dist: cryptography<49; sys_platform == 'darwin' and platform_machine == 'x86_64'
21
+ Requires-Dist: packaging>=24.0
22
+ Requires-Dist: pydantic-ai-pax[boxd,daytona,e2b,kubernetes,local,modal,opensandbox,render,sprites,typesafe]==0.75.0
23
+ Requires-Dist: pydantic-claude-code<0.8,>=0.7.5
24
+ Description-Content-Type: text/markdown
25
+
26
+ <div align="center">
27
+
28
+ ![Code Puppy Logo](code_puppy.png)
29
+
30
+ **🐶✨The sassy AI code agent that makes IDEs look outdated ✨🐶**
31
+
32
+ [![Version](https://img.shields.io/pypi/v/code-puppy?style=for-the-badge&logo=python&label=Version&color=purple)](https://pypi.org/project/code-puppy/)
33
+ [![Python](https://img.shields.io/badge/Python-3.11--3.14-blue?style=for-the-badge&logo=python&logoColor=white)](https://python.org)
34
+ [![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)](LICENSE)
35
+ [![Pydantic AI](https://img.shields.io/badge/Pydantic-AI%20Pax-success?style=for-the-badge)](https://github.com/pydantic/pydantic-ai/tree/main/src/pydantic_ai_pax)
36
+ [![Privacy](https://img.shields.io/badge/FULL-Privacy%20Commitment-blue?style=for-the-badge)](#code-puppy-privacy-commitment)
37
+
38
+ [![GitHub stars](https://img.shields.io/github/stars/mpfaffenberger/code_puppy?style=for-the-badge&logo=github)](https://github.com/mpfaffenberger/code_puppy/stargazers)
39
+ [![GitHub forks](https://img.shields.io/github/forks/mpfaffenberger/code_puppy?style=for-the-badge&logo=github)](https://github.com/mpfaffenberger/code_puppy/network)
40
+ [![Discord](https://img.shields.io/badge/Discord-Community-purple?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/eAGdE4J7Ca)
41
+
42
+ <br>
43
+
44
+ ![Code Puppy CLI Demo](code_puppy.gif)
45
+
46
+ </div>
47
+
48
+ ---
49
+
50
+ ## What is Code Puppy 1.0?
51
+
52
+ **Code Puppy 1.0 is an opinionated distribution built on [Pydantic AI Pax](https://github.com/pydantic/pydantic-ai/tree/main/src/pydantic_ai_pax)** (powered by [`pydantic-ai-harness`](https://pydantic.dev/docs/ai/harness/) and [`pydantic-ai`](https://ai.pydantic.dev/))—combining Pax's agent runtime, terminal/web UI, sessions, MCP, and sandboxes with Code Puppy's personality, theme, batteries-included extras, and pre-installed plugins.
53
+
54
+ > **Looking for Code Puppy 0.0.x?** It's still on PyPI: `uvx --from 'code-puppy<1' code-puppy`.
55
+ > See [`docs/upgrade/code_puppy_1_0_rewrite_plan.md`](docs/upgrade/code_puppy_1_0_rewrite_plan.md) for rewrite details and status.
56
+
57
+ ## Quick Start
58
+
59
+ Requires **Python 3.11–3.14** and [`uv`](https://docs.astral.sh/uv/).
60
+
61
+ ```bash
62
+ # Run directly without installing
63
+ uvx code-puppy
64
+
65
+ # Or install globally (gives you both `pup` and `code-puppy`)
66
+ uv tool install code-puppy
67
+ pup
68
+ ```
69
+
70
+ <details>
71
+ <summary>Don't have <code>uv</code> yet?</summary>
72
+
73
+ **macOS / Linux:**
74
+
75
+ ```bash
76
+ curl -LsSf https://astral.sh/uv/install.sh | sh
77
+ ```
78
+
79
+ **Windows (PowerShell):**
80
+
81
+ ```powershell
82
+ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
83
+ ```
84
+
85
+ > **Windows note:** The agent executes shell commands in PowerShell via Pax's `WindowsWorkspace`.
86
+
87
+ </details>
88
+
89
+ ## Logging In & Choosing Models
90
+
91
+ Start `pup` and run `/login` to open the sign-in picker, or connect a provider directly:
92
+
93
+ | Provider | Command | Notes |
94
+ |---|---|---|
95
+ | **OpenAI Codex** (ChatGPT subscription) | `/login codex` | Alias for `/login openai-codex`; adds available Codex models |
96
+ | **Claude Code** (Claude subscription) | `/login claude-code` | Powered by the bundled `claude_code` plugin (`claude-code:` models) |
97
+ | **GitHub Copilot** | `/login copilot` | Alias for `/login github-copilot`; adds every model your account serves |
98
+ | **OpenRouter** | `/model add` → **OpenRouter** → **OAuth** | You can also enter an API key instead of using browser OAuth. |
99
+
100
+ - **Switch models:** Run `/model` (or `/model add` to add any provider/model).
101
+ - **Use API keys directly:** Run `/keys` to store keys securely in your OS keyring, or export standard environment variables (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `OPENROUTER_API_KEY`, etc.) or put them in a local `.env` file.
102
+ - **Multiple accounts:** Append `@<profile>` to sign in to more than one account—for example `/login codex@work` or `/login claude-code@personal`—then select `PROVIDER@PROFILE:MODEL`.
103
+
104
+ ## Setting Custom Rules (`/system_prompt` & `AGENTS.md`)
105
+
106
+ ### Global personal rules with `/system_prompt`
107
+
108
+ Run `/system_prompt` inside a session to open the system prompt menu:
109
+
110
+ - **Your instructions (`Edit…`)** — Opens a multi-line editor for your personal rules (stored in the `run.instructions` setting). Clearing it restores the defaults.
111
+ - **Append to yours (`Append…`)** — Adds a new paragraph to the end of your existing instructions.
112
+ - **Full system prompt (`View…`)** — Read-only view of the exact system prompt last sent to the model.
113
+
114
+ Your custom instructions are **appended** after Pax's built-in instructions, the repo's `AGENTS.md`, and plugin instructions (such as `personality`), and take effect on your very next prompt.
115
+
116
+ ### Project rules with `AGENTS.md`
117
+
118
+ Drop an `AGENTS.md` file in your repository root to share coding standards, architecture notes, and commands with everyone working on that repo. Code Puppy loads it automatically.
119
+
120
+ > **Tip:** Want to rename your puppy/owner or tone down the sass? Run `/plugins configure personality` to change names, or `/plugins disable personality` for a plain agent.
121
+
122
+ ## What Code Puppy Adds on Top of Pax
123
+
124
+ - **Code Puppy Identity & Theme** — Custom banner, color palette, animated startup splash (set `CODE_PUPPY_NO_SPLASH=1` to skip), and a one-time first-launch prompt to name your puppy and tell it who its owner is.
125
+ - **Every Pax Extra Pre-Installed** — Ships with all ten `/sandbox` providers (`boxd`, `daytona`, `e2b`, `kubernetes`, `modal`, `opensandbox`, `render`, `sprites`, plus local BoxLite & SmolVM) and the `typesafe` model provider, so nothing replies *"support is not installed"*.
126
+ - **Built-in Plugins** (alongside Pax's own default plugins; manage with `/plugins`):
127
+ - **`personality`** — Gives the main agent Code Puppy's name, informal/sassy tone, and strong coding opinions (DRY, YAGNI, SOLID, Zen of Python, ~600-line file guideline). Delegated sub-agents stay plain.
128
+ - **`claude_code`** ([`pydantic-claude-code`](https://pypi.org/project/pydantic-claude-code/)) — Claude Code subscription models (`claude-code:` prefix, `/login claude-code`).
129
+ - **`legacy_plugins`** — Compatibility bridge that loads Code Puppy 0.0.x plugins (`register_callbacks.py`) from entry points, `~/.code_puppy/plugins/`, and project `.code_puppy/plugins/`. Inspect and trust project plugins with `/puppy-plugins`.
130
+ - **0.0.x Migration & Session Import** — Automatically carries over your 0.0.x setup on first start and exposes 0.0.x sessions in `/resume`.
131
+
132
+ ## Everyday Usage
133
+
134
+ Because Code Puppy *is* Pax under the hood, all of Pax's CLI flags and slash commands work out of the box:
135
+
136
+ ```bash
137
+ pup # Interactive terminal session
138
+ pup -p "explain this repo" # Single non-interactive prompt
139
+ pup -m claude-code:claude-sonnet-5-5 # Pick a provider-qualified model
140
+ pup -c # Continue this directory's most recent session
141
+ pup --resume # Browse and restore saved sessions
142
+ pup -w # Start in an isolated Git worktree
143
+ pup --web # Launch the local web UI
144
+ pup update # Update Code Puppy (or use /update inside a session)
145
+ pup --help # Full CLI reference
146
+ ```
147
+
148
+ Inside an interactive session:
149
+
150
+ - `/login` — Sign in to Codex, Claude Code, or GitHub Copilot
151
+ - `/model` — Switch or add models (including OpenRouter via OAuth)
152
+ - `/system_prompt` — Edit your global rules or inspect the full system prompt
153
+ - `/plugins` — List, enable, disable, or configure plugins
154
+ - `/mcp` — Manage MCP servers
155
+ - `/sandbox` — Run the agent inside a local or cloud sandbox
156
+ - `/resume` — Restore a saved session (including Claude Code, Codex, and Code Puppy 0.0.x sessions via `/resume puppy`)
157
+ - `/new`, `/clear`, `/exit` — Session controls (`Esc` or `Ctrl-C` interrupts a turn)
158
+
159
+ ## Upgrading from 0.0.x
160
+
161
+ On first launch, Code Puppy automatically carries over your 0.0.x settings, saved API keys, and MCP servers. **Your 0.0.x files are never modified, renamed, or deleted**, and existing 1.0 values are never overwritten.
162
+
163
+ ```bash
164
+ pup migrate --dry-run # Preview what would be carried over
165
+ pup migrate # Run migration explicitly
166
+ ```
167
+
168
+ - **Sessions:** 0.0.x sessions show up in `/resume` (filter with `/resume puppy`) and are imported on demand when picked.
169
+ - **0.0.x Plugins:** Plugins with a `register_callbacks.py` continue to load through the `legacy_plugins` bridge (15 core hooks supported; `/puppy-plugins` shows status). Project-local plugins in `.code_puppy/plugins/` require explicit opt-in with `/puppy-plugins trust <name>`.
170
+ - **Not carried over from 0.0.x:** Custom JSON agents (`/agent`), `/add_model`, speculative code mode, and DBOS durable execution are 0.0.x features not present in 1.0.
171
+
172
+ ## Configuration & Plugins
173
+
174
+ - **Config & state:** Stored in `~/.code_puppy/` (or `$XDG_CONFIG_HOME/code_puppy`, `$XDG_DATA_HOME/code_puppy`, etc. if XDG variables are set).
175
+ - **API keys:** Save with `/keys`, set standard provider environment variables, or place them in a local `.env` file (only credential-shaped variables are read from `.env`, and existing environment variables always take precedence).
176
+ - **Custom plugins:** Drop a Pax `Plugin` file or package into `~/.code_puppy/plugins/`. See Pax's plugin docs (`pydantic_ai_pax/_docs/PLUGINS.md`) for the plugin API.
177
+
178
+ ## Changelog
179
+
180
+ [📋 View the full changelog on Kittylog](https://kittylog.app/c/mpfaffenberger/code_puppy)
181
+
182
+ ## Contributing
183
+
184
+ Read [`AGENTS.md`](AGENTS.md) before opening a PR. Because Code Puppy is a thin distribution of `pydantic-ai-pax`, new agent/UI behavior belongs in a Pax plugin, a `pydantic-ai-harness` capability, or upstream.
185
+
186
+ ```bash
187
+ uv run ruff check --fix
188
+ uv run ruff format .
189
+ uv run pytest
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Code Puppy Privacy Commitment
195
+
196
+ **Zero-compromise privacy policy. Always.**
197
+
198
+ There is no corporate or investor backing for this project—just open-source software that respects your data:
199
+
200
+ - ❌ **Zero telemetry** — Code Puppy collects no usage analytics, crash reports, or behavioral tracking.
201
+ - ❌ **Zero prompt logging** — Code Puppy never sends your code, prompts, or project details to any Code Puppy server.
202
+ - ❌ **Zero third-party data sharing** — Nothing is sold, traded, or harvested.
203
+
204
+ Your prompts go only to the model provider you configure (including local endpoints if you run your own server).
205
+
206
+ ## License
207
+
208
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,183 @@
1
+ <div align="center">
2
+
3
+ ![Code Puppy Logo](code_puppy.png)
4
+
5
+ **🐶✨The sassy AI code agent that makes IDEs look outdated ✨🐶**
6
+
7
+ [![Version](https://img.shields.io/pypi/v/code-puppy?style=for-the-badge&logo=python&label=Version&color=purple)](https://pypi.org/project/code-puppy/)
8
+ [![Python](https://img.shields.io/badge/Python-3.11--3.14-blue?style=for-the-badge&logo=python&logoColor=white)](https://python.org)
9
+ [![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)](LICENSE)
10
+ [![Pydantic AI](https://img.shields.io/badge/Pydantic-AI%20Pax-success?style=for-the-badge)](https://github.com/pydantic/pydantic-ai/tree/main/src/pydantic_ai_pax)
11
+ [![Privacy](https://img.shields.io/badge/FULL-Privacy%20Commitment-blue?style=for-the-badge)](#code-puppy-privacy-commitment)
12
+
13
+ [![GitHub stars](https://img.shields.io/github/stars/mpfaffenberger/code_puppy?style=for-the-badge&logo=github)](https://github.com/mpfaffenberger/code_puppy/stargazers)
14
+ [![GitHub forks](https://img.shields.io/github/forks/mpfaffenberger/code_puppy?style=for-the-badge&logo=github)](https://github.com/mpfaffenberger/code_puppy/network)
15
+ [![Discord](https://img.shields.io/badge/Discord-Community-purple?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/eAGdE4J7Ca)
16
+
17
+ <br>
18
+
19
+ ![Code Puppy CLI Demo](code_puppy.gif)
20
+
21
+ </div>
22
+
23
+ ---
24
+
25
+ ## What is Code Puppy 1.0?
26
+
27
+ **Code Puppy 1.0 is an opinionated distribution built on [Pydantic AI Pax](https://github.com/pydantic/pydantic-ai/tree/main/src/pydantic_ai_pax)** (powered by [`pydantic-ai-harness`](https://pydantic.dev/docs/ai/harness/) and [`pydantic-ai`](https://ai.pydantic.dev/))—combining Pax's agent runtime, terminal/web UI, sessions, MCP, and sandboxes with Code Puppy's personality, theme, batteries-included extras, and pre-installed plugins.
28
+
29
+ > **Looking for Code Puppy 0.0.x?** It's still on PyPI: `uvx --from 'code-puppy<1' code-puppy`.
30
+ > See [`docs/upgrade/code_puppy_1_0_rewrite_plan.md`](docs/upgrade/code_puppy_1_0_rewrite_plan.md) for rewrite details and status.
31
+
32
+ ## Quick Start
33
+
34
+ Requires **Python 3.11–3.14** and [`uv`](https://docs.astral.sh/uv/).
35
+
36
+ ```bash
37
+ # Run directly without installing
38
+ uvx code-puppy
39
+
40
+ # Or install globally (gives you both `pup` and `code-puppy`)
41
+ uv tool install code-puppy
42
+ pup
43
+ ```
44
+
45
+ <details>
46
+ <summary>Don't have <code>uv</code> yet?</summary>
47
+
48
+ **macOS / Linux:**
49
+
50
+ ```bash
51
+ curl -LsSf https://astral.sh/uv/install.sh | sh
52
+ ```
53
+
54
+ **Windows (PowerShell):**
55
+
56
+ ```powershell
57
+ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
58
+ ```
59
+
60
+ > **Windows note:** The agent executes shell commands in PowerShell via Pax's `WindowsWorkspace`.
61
+
62
+ </details>
63
+
64
+ ## Logging In & Choosing Models
65
+
66
+ Start `pup` and run `/login` to open the sign-in picker, or connect a provider directly:
67
+
68
+ | Provider | Command | Notes |
69
+ |---|---|---|
70
+ | **OpenAI Codex** (ChatGPT subscription) | `/login codex` | Alias for `/login openai-codex`; adds available Codex models |
71
+ | **Claude Code** (Claude subscription) | `/login claude-code` | Powered by the bundled `claude_code` plugin (`claude-code:` models) |
72
+ | **GitHub Copilot** | `/login copilot` | Alias for `/login github-copilot`; adds every model your account serves |
73
+ | **OpenRouter** | `/model add` → **OpenRouter** → **OAuth** | You can also enter an API key instead of using browser OAuth. |
74
+
75
+ - **Switch models:** Run `/model` (or `/model add` to add any provider/model).
76
+ - **Use API keys directly:** Run `/keys` to store keys securely in your OS keyring, or export standard environment variables (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `OPENROUTER_API_KEY`, etc.) or put them in a local `.env` file.
77
+ - **Multiple accounts:** Append `@<profile>` to sign in to more than one account—for example `/login codex@work` or `/login claude-code@personal`—then select `PROVIDER@PROFILE:MODEL`.
78
+
79
+ ## Setting Custom Rules (`/system_prompt` & `AGENTS.md`)
80
+
81
+ ### Global personal rules with `/system_prompt`
82
+
83
+ Run `/system_prompt` inside a session to open the system prompt menu:
84
+
85
+ - **Your instructions (`Edit…`)** — Opens a multi-line editor for your personal rules (stored in the `run.instructions` setting). Clearing it restores the defaults.
86
+ - **Append to yours (`Append…`)** — Adds a new paragraph to the end of your existing instructions.
87
+ - **Full system prompt (`View…`)** — Read-only view of the exact system prompt last sent to the model.
88
+
89
+ Your custom instructions are **appended** after Pax's built-in instructions, the repo's `AGENTS.md`, and plugin instructions (such as `personality`), and take effect on your very next prompt.
90
+
91
+ ### Project rules with `AGENTS.md`
92
+
93
+ Drop an `AGENTS.md` file in your repository root to share coding standards, architecture notes, and commands with everyone working on that repo. Code Puppy loads it automatically.
94
+
95
+ > **Tip:** Want to rename your puppy/owner or tone down the sass? Run `/plugins configure personality` to change names, or `/plugins disable personality` for a plain agent.
96
+
97
+ ## What Code Puppy Adds on Top of Pax
98
+
99
+ - **Code Puppy Identity & Theme** — Custom banner, color palette, animated startup splash (set `CODE_PUPPY_NO_SPLASH=1` to skip), and a one-time first-launch prompt to name your puppy and tell it who its owner is.
100
+ - **Every Pax Extra Pre-Installed** — Ships with all ten `/sandbox` providers (`boxd`, `daytona`, `e2b`, `kubernetes`, `modal`, `opensandbox`, `render`, `sprites`, plus local BoxLite & SmolVM) and the `typesafe` model provider, so nothing replies *"support is not installed"*.
101
+ - **Built-in Plugins** (alongside Pax's own default plugins; manage with `/plugins`):
102
+ - **`personality`** — Gives the main agent Code Puppy's name, informal/sassy tone, and strong coding opinions (DRY, YAGNI, SOLID, Zen of Python, ~600-line file guideline). Delegated sub-agents stay plain.
103
+ - **`claude_code`** ([`pydantic-claude-code`](https://pypi.org/project/pydantic-claude-code/)) — Claude Code subscription models (`claude-code:` prefix, `/login claude-code`).
104
+ - **`legacy_plugins`** — Compatibility bridge that loads Code Puppy 0.0.x plugins (`register_callbacks.py`) from entry points, `~/.code_puppy/plugins/`, and project `.code_puppy/plugins/`. Inspect and trust project plugins with `/puppy-plugins`.
105
+ - **0.0.x Migration & Session Import** — Automatically carries over your 0.0.x setup on first start and exposes 0.0.x sessions in `/resume`.
106
+
107
+ ## Everyday Usage
108
+
109
+ Because Code Puppy *is* Pax under the hood, all of Pax's CLI flags and slash commands work out of the box:
110
+
111
+ ```bash
112
+ pup # Interactive terminal session
113
+ pup -p "explain this repo" # Single non-interactive prompt
114
+ pup -m claude-code:claude-sonnet-5-5 # Pick a provider-qualified model
115
+ pup -c # Continue this directory's most recent session
116
+ pup --resume # Browse and restore saved sessions
117
+ pup -w # Start in an isolated Git worktree
118
+ pup --web # Launch the local web UI
119
+ pup update # Update Code Puppy (or use /update inside a session)
120
+ pup --help # Full CLI reference
121
+ ```
122
+
123
+ Inside an interactive session:
124
+
125
+ - `/login` — Sign in to Codex, Claude Code, or GitHub Copilot
126
+ - `/model` — Switch or add models (including OpenRouter via OAuth)
127
+ - `/system_prompt` — Edit your global rules or inspect the full system prompt
128
+ - `/plugins` — List, enable, disable, or configure plugins
129
+ - `/mcp` — Manage MCP servers
130
+ - `/sandbox` — Run the agent inside a local or cloud sandbox
131
+ - `/resume` — Restore a saved session (including Claude Code, Codex, and Code Puppy 0.0.x sessions via `/resume puppy`)
132
+ - `/new`, `/clear`, `/exit` — Session controls (`Esc` or `Ctrl-C` interrupts a turn)
133
+
134
+ ## Upgrading from 0.0.x
135
+
136
+ On first launch, Code Puppy automatically carries over your 0.0.x settings, saved API keys, and MCP servers. **Your 0.0.x files are never modified, renamed, or deleted**, and existing 1.0 values are never overwritten.
137
+
138
+ ```bash
139
+ pup migrate --dry-run # Preview what would be carried over
140
+ pup migrate # Run migration explicitly
141
+ ```
142
+
143
+ - **Sessions:** 0.0.x sessions show up in `/resume` (filter with `/resume puppy`) and are imported on demand when picked.
144
+ - **0.0.x Plugins:** Plugins with a `register_callbacks.py` continue to load through the `legacy_plugins` bridge (15 core hooks supported; `/puppy-plugins` shows status). Project-local plugins in `.code_puppy/plugins/` require explicit opt-in with `/puppy-plugins trust <name>`.
145
+ - **Not carried over from 0.0.x:** Custom JSON agents (`/agent`), `/add_model`, speculative code mode, and DBOS durable execution are 0.0.x features not present in 1.0.
146
+
147
+ ## Configuration & Plugins
148
+
149
+ - **Config & state:** Stored in `~/.code_puppy/` (or `$XDG_CONFIG_HOME/code_puppy`, `$XDG_DATA_HOME/code_puppy`, etc. if XDG variables are set).
150
+ - **API keys:** Save with `/keys`, set standard provider environment variables, or place them in a local `.env` file (only credential-shaped variables are read from `.env`, and existing environment variables always take precedence).
151
+ - **Custom plugins:** Drop a Pax `Plugin` file or package into `~/.code_puppy/plugins/`. See Pax's plugin docs (`pydantic_ai_pax/_docs/PLUGINS.md`) for the plugin API.
152
+
153
+ ## Changelog
154
+
155
+ [📋 View the full changelog on Kittylog](https://kittylog.app/c/mpfaffenberger/code_puppy)
156
+
157
+ ## Contributing
158
+
159
+ Read [`AGENTS.md`](AGENTS.md) before opening a PR. Because Code Puppy is a thin distribution of `pydantic-ai-pax`, new agent/UI behavior belongs in a Pax plugin, a `pydantic-ai-harness` capability, or upstream.
160
+
161
+ ```bash
162
+ uv run ruff check --fix
163
+ uv run ruff format .
164
+ uv run pytest
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Code Puppy Privacy Commitment
170
+
171
+ **Zero-compromise privacy policy. Always.**
172
+
173
+ There is no corporate or investor backing for this project—just open-source software that respects your data:
174
+
175
+ - ❌ **Zero telemetry** — Code Puppy collects no usage analytics, crash reports, or behavioral tracking.
176
+ - ❌ **Zero prompt logging** — Code Puppy never sends your code, prompts, or project details to any Code Puppy server.
177
+ - ❌ **Zero third-party data sharing** — Nothing is sold, traded, or harvested.
178
+
179
+ Your prompts go only to the model provider you configure (including local endpoints if you run your own server).
180
+
181
+ ## License
182
+
183
+ MIT — see [LICENSE](LICENSE).
@@ -28,6 +28,7 @@ pax symbol Seam that would replace it
28
28
  ``app.chat`` a hook before an interactive session starts
29
29
  ``imported_sessions.IMPORT_SOURCES`` registering a session import source
30
30
  ``ProcessPlugins._discover`` pluggable drop-in discovery
31
+ ``reloading._reload`` post-reload hook for distributions
31
32
  ========================================== =====================================
32
33
 
33
34
  The 0.0.x session source is also added to ``imported_sessions._SOURCES`` and to
@@ -148,7 +149,44 @@ def _naming_first(start_chat: Callable[P, T]) -> Callable[P, T]:
148
149
  def _install_first_run() -> None:
149
150
  from pydantic_ai_pax import app
150
151
 
151
- _replace(app, "chat", _naming_first(app.chat))
152
+ if getattr(app.chat, "_puppy_wrapped", False):
153
+ return
154
+ wrapped = _naming_first(app.chat)
155
+ wrapped._puppy_wrapped = True # type: ignore[attr-defined]
156
+ _replace(app, "chat", wrapped)
157
+
158
+
159
+ def _reload_modules(
160
+ modules: dict[str, ModuleType], ordered: tuple[tuple[str, Path], ...]
161
+ ) -> None:
162
+ """Reload pax's modules while keeping Code Puppy's theme and replacements."""
163
+ import importlib.util
164
+
165
+ try:
166
+ for name, path in ordered:
167
+ if path.name == "__init__.py" and name in modules:
168
+ vars(modules[name])["__path__"] = [str(path.parent)]
169
+ Path(importlib.util.cache_from_source(str(path))).unlink(missing_ok=True)
170
+ for name, _ in ordered:
171
+ if name in modules:
172
+ importlib.reload(modules[name])
173
+ if name == f"{RUNTIME_PACKAGE}.ui.rendering.theme":
174
+ _install_theme()
175
+ finally:
176
+ _reinstall()
177
+
178
+
179
+ def _install_reloading() -> None:
180
+ from pydantic_ai_pax.runtime import reloading
181
+
182
+ _replace(reloading, "_reload", _reload_modules)
183
+
184
+
185
+ def _reinstall() -> None:
186
+ """Re-apply every Code Puppy replacement after pax reloads its modules."""
187
+ global _installed
188
+ _installed = False
189
+ install()
152
190
 
153
191
 
154
192
  def install() -> None:
@@ -166,6 +204,7 @@ def install() -> None:
166
204
  _install_agent()
167
205
  _install_first_run()
168
206
  _install_sessions()
207
+ _install_reloading()
169
208
  _installed = True
170
209
 
171
210
 
@@ -264,13 +303,15 @@ def _install_sessions() -> None:
264
303
  messages=legacy.messages,
265
304
  tasks=legacy.tasks,
266
305
  )
267
- _replace(
268
- imported_sessions,
269
- "IMPORT_SOURCES",
270
- (*imported_sessions.IMPORT_SOURCES, source),
271
- )
306
+ if source not in imported_sessions.IMPORT_SOURCES:
307
+ _replace(
308
+ imported_sessions,
309
+ "IMPORT_SOURCES",
310
+ (*imported_sessions.IMPORT_SOURCES, source),
311
+ )
272
312
  # Built from IMPORT_SOURCES when the browser was imported, so extend it too.
273
- _replace(session_browser, "_FILTERS", (*session_browser._FILTERS, source))
313
+ if source not in session_browser._FILTERS:
314
+ _replace(session_browser, "_FILTERS", (*session_browser._FILTERS, source))
274
315
 
275
316
 
276
317
  def is_legacy_plugin(entry: Path) -> bool:
@@ -288,10 +329,13 @@ def _install_plugins() -> None:
288
329
 
289
330
  os.environ.setdefault(CLAUDE_CODE_NO_UPDATE_CHECK, "1")
290
331
 
291
- _replace(builtins, "DEFAULT_PLUGINS", (*builtins.DEFAULT_PLUGINS, *PUPPY_PLUGINS))
292
- _replace(builtins, "STOCK_PLUGINS", (*builtins.STOCK_PLUGINS, *PUPPY_PLUGINS))
332
+ for name in ("DEFAULT_PLUGINS", "STOCK_PLUGINS"):
333
+ kept = tuple(p for p in getattr(builtins, name) if p not in PUPPY_PLUGINS)
334
+ _replace(builtins, name, (*kept, *PUPPY_PLUGINS))
293
335
 
294
336
  upstream_discover = process_plugins.ProcessPlugins._discover
337
+ if getattr(upstream_discover, "_puppy_wrapped", False):
338
+ return
295
339
 
296
340
  def _discover(
297
341
  self: process_plugins.ProcessPlugins, console: Console
@@ -302,4 +346,5 @@ def _install_plugins() -> None:
302
346
  name: path for name, path in found.items() if not is_legacy_plugin(path)
303
347
  }
304
348
 
349
+ _discover._puppy_wrapped = True # type: ignore[attr-defined]
305
350
  process_plugins.ProcessPlugins._discover = _discover
@@ -7,15 +7,20 @@ it animates. The order below is load-bearing; see ``distribution``.
7
7
  from __future__ import annotations
8
8
 
9
9
  import json
10
+ import logging
10
11
  import os
11
12
  import sqlite3
12
13
  import sys
13
14
  import warnings
15
+ from collections.abc import Iterator
16
+ from contextlib import contextmanager
14
17
  from pathlib import Path
15
18
 
16
19
  from code_puppy import identity
17
20
 
18
21
  NO_SPLASH_VARIABLES = ("CODE_PUPPY_NO_SPLASH", "CLAI_NO_SPLASH")
22
+ WSAECONNRESET = 10054
23
+ """Windows' "connection forcibly closed by the remote host"."""
19
24
 
20
25
 
21
26
  def _load_dotenv() -> None:
@@ -105,6 +110,32 @@ def _own_command(argv: list[str]) -> int | None:
105
110
  return migrate.main(argv[2:])
106
111
 
107
112
 
113
+ def _not_a_peer_reset(record: logging.LogRecord) -> bool:
114
+ exc = record.exc_info[1] if record.exc_info else None
115
+ return not (
116
+ isinstance(exc, ConnectionResetError)
117
+ and getattr(exc, "winerror", None) == WSAECONNRESET
118
+ )
119
+
120
+
121
+ @contextmanager
122
+ def quiet_peer_resets() -> Iterator[None]:
123
+ """Keep Windows' WinError 10054 socket-teardown traceback off the live display.
124
+
125
+ When a server drops an idle keep-alive connection, asyncio's Proactor loop
126
+ raises it while closing the socket and logs it on the ``asyncio`` logger.
127
+ The connection was already gone; nothing is lost. Only this record is
128
+ dropped: every other asyncio error still reaches stderr. Remove once
129
+ pydantic/pydantic-ai#14639 ships in the pinned pax.
130
+ """
131
+ logger = logging.getLogger("asyncio")
132
+ logger.addFilter(_not_a_peer_reset)
133
+ try:
134
+ yield
135
+ finally:
136
+ logger.removeFilter(_not_a_peer_reset)
137
+
138
+
108
139
  def main_entry() -> None:
109
140
  """Start Code Puppy: pydantic-ai-pax with Code Puppy's identity installed."""
110
141
  _load_dotenv()
@@ -131,7 +162,7 @@ def main_entry() -> None:
131
162
  from pydantic_ai_pax.__main__ import quiet_telemetry_logs
132
163
  from pydantic_ai_pax.cli.cli import run
133
164
 
134
- with warnings.catch_warnings(), quiet_telemetry_logs():
165
+ with warnings.catch_warnings(), quiet_telemetry_logs(), quiet_peer_resets():
135
166
  if not sys.warnoptions:
136
167
  # Library warnings are advice for whoever wired the agent, not
137
168
  # the person at the prompt, and stderr output tears through the
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "code-puppy"
7
- version = "1.0.0"
7
+ version = "1.0.2"
8
8
  description = "Code generation agent"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11,<3.15"