code-puppy 0.0.970__tar.gz → 1.0.0__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.970 → code_puppy-1.0.0}/PKG-INFO +27 -40
- {code_puppy-0.0.970 → code_puppy-1.0.0}/README.md +22 -6
- code_puppy-1.0.0/code_puppy/__init__.py +5 -0
- code_puppy-1.0.0/code_puppy/__main__.py +6 -0
- code_puppy-1.0.0/code_puppy/_art.py +35 -0
- code_puppy-1.0.0/code_puppy/api_keys.py +45 -0
- code_puppy-1.0.0/code_puppy/branding.py +70 -0
- code_puppy-1.0.0/code_puppy/builtin_plugins.py +33 -0
- code_puppy-1.0.0/code_puppy/callbacks.py +279 -0
- code_puppy-1.0.0/code_puppy/colors.py +80 -0
- code_puppy-1.0.0/code_puppy/compat/__init__.py +1 -0
- code_puppy-1.0.0/code_puppy/compat/bridge.py +356 -0
- code_puppy-1.0.0/code_puppy/compat/tools.py +100 -0
- code_puppy-1.0.0/code_puppy/config.py +117 -0
- code_puppy-1.0.0/code_puppy/distribution.py +305 -0
- code_puppy-1.0.0/code_puppy/first_run.py +135 -0
- code_puppy-1.0.0/code_puppy/former_name.py +98 -0
- code_puppy-1.0.0/code_puppy/i18n/__init__.py +57 -0
- code_puppy-1.0.0/code_puppy/identity.py +79 -0
- code_puppy-1.0.0/code_puppy/legacy_sessions.py +157 -0
- code_puppy-1.0.0/code_puppy/legacy_store.py +109 -0
- code_puppy-1.0.0/code_puppy/main.py +146 -0
- code_puppy-1.0.0/code_puppy/messaging/__init__.py +88 -0
- code_puppy-1.0.0/code_puppy/messaging/bus.py +19 -0
- code_puppy-1.0.0/code_puppy/migrate/__init__.py +5 -0
- code_puppy-1.0.0/code_puppy/migrate/runner.py +239 -0
- code_puppy-1.0.0/code_puppy/migrate/sources.py +107 -0
- code_puppy-1.0.0/code_puppy/migrate/translate.py +149 -0
- code_puppy-1.0.0/code_puppy/personality.py +174 -0
- code_puppy-1.0.0/code_puppy/plugins/__init__.py +215 -0
- code_puppy-1.0.0/code_puppy/plugins/source_only.py +162 -0
- {code_puppy-0.0.970 → code_puppy-1.0.0}/code_puppy/plugins/trust.py +15 -13
- code_puppy-1.0.0/code_puppy/splash/__init__.py +162 -0
- code_puppy-1.0.0/code_puppy/splash/__main__.py +36 -0
- code_puppy-1.0.0/code_puppy/splash/canvas.py +66 -0
- code_puppy-1.0.0/code_puppy/splash/scenes.py +182 -0
- code_puppy-1.0.0/code_puppy/update.py +319 -0
- code_puppy-1.0.0/pyproject.toml +86 -0
- code_puppy-0.0.970/code_puppy/__init__.py +0 -37
- code_puppy-0.0.970/code_puppy/__main__.py +0 -10
- code_puppy-0.0.970/code_puppy/_plugin_i18n_lifecycle.py +0 -59
- code_puppy-0.0.970/code_puppy/_pydantic_tool_helpers.py +0 -160
- code_puppy-0.0.970/code_puppy/_pydantic_video_patch.py +0 -95
- code_puppy-0.0.970/code_puppy/agent_completion_inbox.py +0 -70
- code_puppy-0.0.970/code_puppy/agent_execution_context.py +0 -56
- code_puppy-0.0.970/code_puppy/agents/__init__.py +0 -34
- code_puppy-0.0.970/code_puppy/agents/_builder.py +0 -597
- code_puppy-0.0.970/code_puppy/agents/_code_mode.py +0 -266
- code_puppy-0.0.970/code_puppy/agents/_code_mode_guidance.py +0 -96
- code_puppy-0.0.970/code_puppy/agents/_code_mode_session.py +0 -80
- code_puppy-0.0.970/code_puppy/agents/_compaction.py +0 -318
- code_puppy-0.0.970/code_puppy/agents/_diagnostics.py +0 -191
- code_puppy-0.0.970/code_puppy/agents/_foreign_thinking.py +0 -63
- code_puppy-0.0.970/code_puppy/agents/_history.py +0 -652
- code_puppy-0.0.970/code_puppy/agents/_key_listeners.py +0 -1028
- code_puppy-0.0.970/code_puppy/agents/_mcp.py +0 -247
- code_puppy-0.0.970/code_puppy/agents/_model_message_transform.py +0 -158
- code_puppy-0.0.970/code_puppy/agents/_multimodal_error_hint.py +0 -55
- code_puppy-0.0.970/code_puppy/agents/_non_streaming_render.py +0 -149
- code_puppy-0.0.970/code_puppy/agents/_output_limits.py +0 -104
- code_puppy-0.0.970/code_puppy/agents/_rules.py +0 -106
- code_puppy-0.0.970/code_puppy/agents/_run_signals.py +0 -363
- code_puppy-0.0.970/code_puppy/agents/_runtime.py +0 -1235
- code_puppy-0.0.970/code_puppy/agents/_steer_processor.py +0 -102
- code_puppy-0.0.970/code_puppy/agents/_subagent_recursion.py +0 -114
- code_puppy-0.0.970/code_puppy/agents/_token_limit_hint.py +0 -64
- code_puppy-0.0.970/code_puppy/agents/_tty_modes.py +0 -50
- code_puppy-0.0.970/code_puppy/agents/_windows_console.py +0 -77
- code_puppy-0.0.970/code_puppy/agents/_wire_tool_names.py +0 -46
- code_puppy-0.0.970/code_puppy/agents/agent_code_puppy.py +0 -146
- code_puppy-0.0.970/code_puppy/agents/agent_creator_agent.py +0 -707
- code_puppy-0.0.970/code_puppy/agents/agent_helios.py +0 -123
- code_puppy-0.0.970/code_puppy/agents/agent_manager.py +0 -847
- code_puppy-0.0.970/code_puppy/agents/agent_model_judge.py +0 -196
- code_puppy-0.0.970/code_puppy/agents/agent_planning.py +0 -164
- code_puppy-0.0.970/code_puppy/agents/agent_qa_kitten.py +0 -257
- code_puppy-0.0.970/code_puppy/agents/agent_web_retriever.py +0 -256
- code_puppy-0.0.970/code_puppy/agents/base_agent.py +0 -405
- code_puppy-0.0.970/code_puppy/agents/event_stream_handler.py +0 -543
- code_puppy-0.0.970/code_puppy/agents/json_agent.py +0 -398
- code_puppy-0.0.970/code_puppy/agents/retry_checkpoint.py +0 -62
- code_puppy-0.0.970/code_puppy/agents/retry_profiles.py +0 -281
- code_puppy-0.0.970/code_puppy/agents/run_invocation.py +0 -72
- code_puppy-0.0.970/code_puppy/agents/run_stats.py +0 -684
- code_puppy-0.0.970/code_puppy/agents/smooth_stream.py +0 -136
- code_puppy-0.0.970/code_puppy/agents/stream_status.py +0 -116
- code_puppy-0.0.970/code_puppy/agents/subagent_stream_handler.py +0 -277
- code_puppy-0.0.970/code_puppy/agents/thinking_output.py +0 -21
- code_puppy-0.0.970/code_puppy/asyncio_cleanup.py +0 -71
- code_puppy-0.0.970/code_puppy/atomic_io.py +0 -279
- code_puppy-0.0.970/code_puppy/atomic_json.py +0 -129
- code_puppy-0.0.970/code_puppy/banner_defs.py +0 -228
- code_puppy-0.0.970/code_puppy/banners.py +0 -435
- code_puppy-0.0.970/code_puppy/ca_bundle.py +0 -239
- code_puppy-0.0.970/code_puppy/callbacks.py +0 -2008
- code_puppy-0.0.970/code_puppy/capabilities/__init__.py +0 -43
- code_puppy-0.0.970/code_puppy/capabilities/compaction.py +0 -487
- code_puppy-0.0.970/code_puppy/capabilities/eager_timing.py +0 -112
- code_puppy-0.0.970/code_puppy/chatgpt_codex_client.py +0 -437
- code_puppy-0.0.970/code_puppy/claude_cache_client.py +0 -554
- code_puppy-0.0.970/code_puppy/claude_oauth_transport.py +0 -285
- code_puppy-0.0.970/code_puppy/claude_thinking_display.py +0 -71
- code_puppy-0.0.970/code_puppy/cli_entry.py +0 -562
- code_puppy-0.0.970/code_puppy/cli_runner.py +0 -99
- code_puppy-0.0.970/code_puppy/command_line/__init__.py +0 -1
- code_puppy-0.0.970/code_puppy/command_line/add_model_details.py +0 -144
- code_puppy-0.0.970/code_puppy/command_line/add_model_menu.py +0 -557
- code_puppy-0.0.970/code_puppy/command_line/add_model_menus.py +0 -116
- code_puppy-0.0.970/code_puppy/command_line/add_model_vllm.py +0 -451
- code_puppy-0.0.970/code_puppy/command_line/agent_menu.py +0 -476
- code_puppy-0.0.970/code_puppy/command_line/attachments.py +0 -573
- code_puppy-0.0.970/code_puppy/command_line/autosave_menu.py +0 -114
- code_puppy-0.0.970/code_puppy/command_line/autosave_search.py +0 -178
- code_puppy-0.0.970/code_puppy/command_line/clipboard.py +0 -482
- code_puppy-0.0.970/code_puppy/command_line/colors_menu.py +0 -104
- code_puppy-0.0.970/code_puppy/command_line/command_catalog.py +0 -106
- code_puppy-0.0.970/code_puppy/command_line/command_handler.py +0 -268
- code_puppy-0.0.970/code_puppy/command_line/command_registry.py +0 -191
- code_puppy-0.0.970/code_puppy/command_line/completers.py +0 -473
- code_puppy-0.0.970/code_puppy/command_line/completion_cache.py +0 -37
- code_puppy-0.0.970/code_puppy/command_line/config_apply.py +0 -152
- code_puppy-0.0.970/code_puppy/command_line/config_commands.py +0 -481
- code_puppy-0.0.970/code_puppy/command_line/core_commands.py +0 -750
- code_puppy-0.0.970/code_puppy/command_line/file_index.py +0 -176
- code_puppy-0.0.970/code_puppy/command_line/file_path_completion.py +0 -189
- code_puppy-0.0.970/code_puppy/command_line/help_catalog.py +0 -285
- code_puppy-0.0.970/code_puppy/command_line/help_overlay.py +0 -100
- code_puppy-0.0.970/code_puppy/command_line/image_utils.py +0 -299
- code_puppy-0.0.970/code_puppy/command_line/load_context_completion.py +0 -52
- code_puppy-0.0.970/code_puppy/command_line/mcp/__init__.py +0 -10
- code_puppy-0.0.970/code_puppy/command_line/mcp/base.py +0 -32
- code_puppy-0.0.970/code_puppy/command_line/mcp/catalog_server_installer.py +0 -184
- code_puppy-0.0.970/code_puppy/command_line/mcp/custom_server_form.py +0 -544
- code_puppy-0.0.970/code_puppy/command_line/mcp/custom_server_installer.py +0 -192
- code_puppy-0.0.970/code_puppy/command_line/mcp/edit_command.py +0 -151
- code_puppy-0.0.970/code_puppy/command_line/mcp/handler.py +0 -141
- code_puppy-0.0.970/code_puppy/command_line/mcp/help_command.py +0 -153
- code_puppy-0.0.970/code_puppy/command_line/mcp/install_command.py +0 -225
- code_puppy-0.0.970/code_puppy/command_line/mcp/install_menu.py +0 -320
- code_puppy-0.0.970/code_puppy/command_line/mcp/list_command.py +0 -100
- code_puppy-0.0.970/code_puppy/command_line/mcp/logs_command.py +0 -261
- code_puppy-0.0.970/code_puppy/command_line/mcp/mcp_servers_store.py +0 -74
- code_puppy-0.0.970/code_puppy/command_line/mcp/remove_command.py +0 -98
- code_puppy-0.0.970/code_puppy/command_line/mcp/restart_command.py +0 -109
- code_puppy-0.0.970/code_puppy/command_line/mcp/search_command.py +0 -122
- code_puppy-0.0.970/code_puppy/command_line/mcp/silence_warning_command.py +0 -91
- code_puppy-0.0.970/code_puppy/command_line/mcp/start_all_command.py +0 -147
- code_puppy-0.0.970/code_puppy/command_line/mcp/start_command.py +0 -153
- code_puppy-0.0.970/code_puppy/command_line/mcp/status_command.py +0 -204
- code_puppy-0.0.970/code_puppy/command_line/mcp/stop_all_command.py +0 -121
- code_puppy-0.0.970/code_puppy/command_line/mcp/stop_command.py +0 -88
- code_puppy-0.0.970/code_puppy/command_line/mcp/trust_command.py +0 -218
- code_puppy-0.0.970/code_puppy/command_line/mcp/utils.py +0 -134
- code_puppy-0.0.970/code_puppy/command_line/mcp/wizard_utils.py +0 -382
- code_puppy-0.0.970/code_puppy/command_line/mcp_binding_menu.py +0 -249
- code_puppy-0.0.970/code_puppy/command_line/mcp_completion.py +0 -174
- code_puppy-0.0.970/code_puppy/command_line/menu_session.py +0 -72
- code_puppy-0.0.970/code_puppy/command_line/model_picker_completion.py +0 -411
- code_puppy-0.0.970/code_puppy/command_line/model_settings_defs.py +0 -436
- code_puppy-0.0.970/code_puppy/command_line/model_settings_menu.py +0 -497
- code_puppy-0.0.970/code_puppy/command_line/onboarding_slides.py +0 -192
- code_puppy-0.0.970/code_puppy/command_line/onboarding_wizard.py +0 -413
- code_puppy-0.0.970/code_puppy/command_line/pagination.py +0 -43
- code_puppy-0.0.970/code_puppy/command_line/pin_command_completion.py +0 -361
- code_puppy-0.0.970/code_puppy/command_line/refresh_models.py +0 -125
- code_puppy-0.0.970/code_puppy/command_line/session_browser.py +0 -604
- code_puppy-0.0.970/code_puppy/command_line/session_browser_data.py +0 -387
- code_puppy-0.0.970/code_puppy/command_line/session_commands.py +0 -600
- code_puppy-0.0.970/code_puppy/command_line/set_menu.py +0 -440
- code_puppy-0.0.970/code_puppy/command_line/set_menu_catalog.py +0 -649
- code_puppy-0.0.970/code_puppy/command_line/set_menu_schema.py +0 -33
- code_puppy-0.0.970/code_puppy/command_line/set_menu_settings.py +0 -44
- code_puppy-0.0.970/code_puppy/command_line/set_menu_shims.py +0 -36
- code_puppy-0.0.970/code_puppy/command_line/set_menu_values.py +0 -123
- code_puppy-0.0.970/code_puppy/command_line/shell_passthrough.py +0 -150
- code_puppy-0.0.970/code_puppy/command_line/skills_completion.py +0 -89
- code_puppy-0.0.970/code_puppy/command_line/tui_style.py +0 -44
- code_puppy-0.0.970/code_puppy/command_line/uc_menu.py +0 -377
- code_puppy-0.0.970/code_puppy/command_line/utils.py +0 -104
- code_puppy-0.0.970/code_puppy/config.py +0 -3364
- code_puppy-0.0.970/code_puppy/config_file.py +0 -158
- code_puppy-0.0.970/code_puppy/context_accounting.py +0 -154
- code_puppy-0.0.970/code_puppy/diagnostics.py +0 -124
- code_puppy-0.0.970/code_puppy/early_startup.py +0 -93
- code_puppy-0.0.970/code_puppy/error_format.py +0 -219
- code_puppy-0.0.970/code_puppy/error_hooks.py +0 -122
- code_puppy-0.0.970/code_puppy/error_logging.py +0 -225
- code_puppy-0.0.970/code_puppy/error_policy.py +0 -67
- code_puppy-0.0.970/code_puppy/error_redaction.py +0 -98
- code_puppy-0.0.970/code_puppy/events/__init__.py +0 -16
- code_puppy-0.0.970/code_puppy/events/bridge.py +0 -284
- code_puppy-0.0.970/code_puppy/file_completion_io.py +0 -59
- code_puppy-0.0.970/code_puppy/file_completion_tokens.py +0 -58
- code_puppy-0.0.970/code_puppy/gemini_code_assist.py +0 -351
- code_puppy-0.0.970/code_puppy/gemini_common.py +0 -345
- code_puppy-0.0.970/code_puppy/gemini_model.py +0 -690
- code_puppy-0.0.970/code_puppy/hook_engine/README.md +0 -105
- code_puppy-0.0.970/code_puppy/hook_engine/__init__.py +0 -21
- code_puppy-0.0.970/code_puppy/hook_engine/aliases.py +0 -155
- code_puppy-0.0.970/code_puppy/hook_engine/engine.py +0 -221
- code_puppy-0.0.970/code_puppy/hook_engine/executor.py +0 -552
- code_puppy-0.0.970/code_puppy/hook_engine/matcher.py +0 -156
- code_puppy-0.0.970/code_puppy/hook_engine/models.py +0 -240
- code_puppy-0.0.970/code_puppy/hook_engine/registry.py +0 -106
- code_puppy-0.0.970/code_puppy/hook_engine/validator.py +0 -144
- code_puppy-0.0.970/code_puppy/http_retry.py +0 -160
- code_puppy-0.0.970/code_puppy/http_utils.py +0 -349
- code_puppy-0.0.970/code_puppy/httpx2_utils.py +0 -66
- code_puppy-0.0.970/code_puppy/i18n/__init__.py +0 -87
- code_puppy-0.0.970/code_puppy/i18n/audit.py +0 -336
- code_puppy-0.0.970/code_puppy/i18n/catalog.py +0 -508
- code_puppy-0.0.970/code_puppy/i18n/formats.py +0 -90
- code_puppy-0.0.970/code_puppy/i18n/interpolation.py +0 -34
- code_puppy-0.0.970/code_puppy/i18n/locale.py +0 -147
- code_puppy-0.0.970/code_puppy/i18n/locales/en-US.json +0 -1022
- code_puppy-0.0.970/code_puppy/i18n/locales/es.json +0 -1022
- code_puppy-0.0.970/code_puppy/i18n/locales/fr-CA.json +0 -1022
- code_puppy-0.0.970/code_puppy/i18n/plugin_catalog.py +0 -240
- code_puppy-0.0.970/code_puppy/i18n/plurals.py +0 -71
- code_puppy-0.0.970/code_puppy/i18n/pseudo.py +0 -108
- code_puppy-0.0.970/code_puppy/i18n/translate.py +0 -166
- code_puppy-0.0.970/code_puppy/interactive_runner.py +0 -600
- code_puppy-0.0.970/code_puppy/interactive_support.py +0 -231
- code_puppy-0.0.970/code_puppy/kennel_provider.py +0 -39
- code_puppy-0.0.970/code_puppy/keymap.py +0 -154
- code_puppy-0.0.970/code_puppy/list_filtering.py +0 -26
- code_puppy-0.0.970/code_puppy/main.py +0 -42
- code_puppy-0.0.970/code_puppy/malloc_noise_guard.py +0 -132
- code_puppy-0.0.970/code_puppy/mcp_/__init__.py +0 -66
- code_puppy-0.0.970/code_puppy/mcp_/agent_bindings.py +0 -337
- code_puppy-0.0.970/code_puppy/mcp_/async_lifecycle.py +0 -250
- code_puppy-0.0.970/code_puppy/mcp_/blocking_startup.py +0 -292
- code_puppy-0.0.970/code_puppy/mcp_/circuit_breaker.py +0 -287
- code_puppy-0.0.970/code_puppy/mcp_/config_wizard.py +0 -530
- code_puppy-0.0.970/code_puppy/mcp_/dashboard.py +0 -308
- code_puppy-0.0.970/code_puppy/mcp_/error_isolation.py +0 -407
- code_puppy-0.0.970/code_puppy/mcp_/examples/retry_example.py +0 -226
- code_puppy-0.0.970/code_puppy/mcp_/health_monitor.py +0 -582
- code_puppy-0.0.970/code_puppy/mcp_/http_auth.py +0 -49
- code_puppy-0.0.970/code_puppy/mcp_/managed_server.py +0 -582
- code_puppy-0.0.970/code_puppy/mcp_/manager.py +0 -582
- code_puppy-0.0.970/code_puppy/mcp_/manager_lifecycle.py +0 -339
- code_puppy-0.0.970/code_puppy/mcp_/mcp_logs.py +0 -224
- code_puppy-0.0.970/code_puppy/mcp_/project_config.py +0 -298
- code_puppy-0.0.970/code_puppy/mcp_/registry.py +0 -452
- code_puppy-0.0.970/code_puppy/mcp_/retry_manager.py +0 -337
- code_puppy-0.0.970/code_puppy/mcp_/server_registry_catalog.py +0 -1122
- code_puppy-0.0.970/code_puppy/mcp_/status_tracker.py +0 -355
- code_puppy-0.0.970/code_puppy/mcp_/system_tools.py +0 -209
- code_puppy-0.0.970/code_puppy/mcp_/tool_arg_coercion.py +0 -181
- code_puppy-0.0.970/code_puppy/mcp_/toolset_utils.py +0 -115
- code_puppy-0.0.970/code_puppy/mcp_prompts/__init__.py +0 -1
- code_puppy-0.0.970/code_puppy/mcp_prompts/hook_creator.py +0 -103
- code_puppy-0.0.970/code_puppy/messaging/__init__.py +0 -305
- code_puppy-0.0.970/code_puppy/messaging/bar_painters.py +0 -384
- code_puppy-0.0.970/code_puppy/messaging/bar_rendering.py +0 -438
- code_puppy-0.0.970/code_puppy/messaging/bottom_bar.py +0 -861
- code_puppy-0.0.970/code_puppy/messaging/bus.py +0 -682
- code_puppy-0.0.970/code_puppy/messaging/chords.py +0 -151
- code_puppy-0.0.970/code_puppy/messaging/commands.py +0 -216
- code_puppy-0.0.970/code_puppy/messaging/editor_actions.py +0 -155
- code_puppy-0.0.970/code_puppy/messaging/editor_completion.py +0 -313
- code_puppy-0.0.970/code_puppy/messaging/editor_display.py +0 -141
- code_puppy-0.0.970/code_puppy/messaging/editor_history.py +0 -299
- code_puppy-0.0.970/code_puppy/messaging/editor_keys.py +0 -249
- code_puppy-0.0.970/code_puppy/messaging/editor_paste.py +0 -175
- code_puppy-0.0.970/code_puppy/messaging/editor_queue.py +0 -150
- code_puppy-0.0.970/code_puppy/messaging/editor_submission.py +0 -159
- code_puppy-0.0.970/code_puppy/messaging/editor_undo.py +0 -120
- code_puppy-0.0.970/code_puppy/messaging/external_editor.py +0 -137
- code_puppy-0.0.970/code_puppy/messaging/identity_line.py +0 -66
- code_puppy-0.0.970/code_puppy/messaging/idle_status.py +0 -58
- code_puppy-0.0.970/code_puppy/messaging/inline_bar.py +0 -404
- code_puppy-0.0.970/code_puppy/messaging/line_editor.py +0 -575
- code_puppy-0.0.970/code_puppy/messaging/markdown_patches.py +0 -88
- code_puppy-0.0.970/code_puppy/messaging/menu_lifecycle.py +0 -39
- code_puppy-0.0.970/code_puppy/messaging/message_queue.py +0 -434
- code_puppy-0.0.970/code_puppy/messaging/messages.py +0 -585
- code_puppy-0.0.970/code_puppy/messaging/pause_controller.py +0 -574
- code_puppy-0.0.970/code_puppy/messaging/prompt_prefix_style.py +0 -103
- code_puppy-0.0.970/code_puppy/messaging/queue_console.py +0 -285
- code_puppy-0.0.970/code_puppy/messaging/renderers.py +0 -577
- code_puppy-0.0.970/code_puppy/messaging/rich_renderer.py +0 -1417
- code_puppy-0.0.970/code_puppy/messaging/run_ui.py +0 -775
- code_puppy-0.0.970/code_puppy/messaging/run_ui_wiring.py +0 -131
- code_puppy-0.0.970/code_puppy/messaging/safe_console.py +0 -72
- code_puppy-0.0.970/code_puppy/messaging/safe_stream.py +0 -79
- code_puppy-0.0.970/code_puppy/messaging/speculation_line.py +0 -59
- code_puppy-0.0.970/code_puppy/messaging/speculation_stats.py +0 -152
- code_puppy-0.0.970/code_puppy/messaging/speculation_toggle.py +0 -91
- code_puppy-0.0.970/code_puppy/messaging/spinner/__init__.py +0 -162
- code_puppy-0.0.970/code_puppy/messaging/status_line.py +0 -58
- code_puppy-0.0.970/code_puppy/messaging/subagent_console.py +0 -468
- code_puppy-0.0.970/code_puppy/messaging/theme_accent.py +0 -26
- code_puppy-0.0.970/code_puppy/messaging/tool_output.py +0 -150
- code_puppy-0.0.970/code_puppy/messaging/transcript_guard.py +0 -475
- code_puppy-0.0.970/code_puppy/model_descriptions.py +0 -62
- code_puppy-0.0.970/code_puppy/model_factory.py +0 -1403
- code_puppy-0.0.970/code_puppy/model_media.py +0 -105
- code_puppy-0.0.970/code_puppy/model_switching.py +0 -146
- code_puppy-0.0.970/code_puppy/model_utils.py +0 -717
- code_puppy-0.0.970/code_puppy/models.json +0 -2
- code_puppy-0.0.970/code_puppy/models_dev_api.json +0 -1
- code_puppy-0.0.970/code_puppy/models_dev_family.py +0 -77
- code_puppy-0.0.970/code_puppy/models_dev_parser.py +0 -591
- code_puppy-0.0.970/code_puppy/platform_utils.py +0 -52
- code_puppy-0.0.970/code_puppy/plugins/__init__.py +0 -999
- code_puppy-0.0.970/code_puppy/plugins/config.py +0 -74
- code_puppy-0.0.970/code_puppy/plugins/oauth_pasteback.py +0 -110
- code_puppy-0.0.970/code_puppy/plugins/oauth_puppy_html.py +0 -194
- code_puppy-0.0.970/code_puppy/plugins/prewarm_sdks/__init__.py +0 -0
- code_puppy-0.0.970/code_puppy/plugins/prewarm_sdks/prewarm.py +0 -98
- code_puppy-0.0.970/code_puppy/plugins/prewarm_sdks/register_callbacks.py +0 -18
- code_puppy-0.0.970/code_puppy/plugins/trust_notice.py +0 -69
- code_puppy-0.0.970/code_puppy/private_inference.py +0 -114
- code_puppy-0.0.970/code_puppy/prompt_runner.py +0 -265
- code_puppy-0.0.970/code_puppy/provider_credentials.py +0 -328
- code_puppy-0.0.970/code_puppy/provider_identity.py +0 -110
- code_puppy-0.0.970/code_puppy/pydantic_patches.py +0 -1114
- code_puppy-0.0.970/code_puppy/reopenable_async_client.py +0 -232
- code_puppy-0.0.970/code_puppy/round_robin_model.py +0 -155
- code_puppy-0.0.970/code_puppy/secret_store.py +0 -796
- code_puppy-0.0.970/code_puppy/secret_store_backends.py +0 -193
- code_puppy-0.0.970/code_puppy/session_format_migration.py +0 -302
- code_puppy-0.0.970/code_puppy/session_lifecycle.py +0 -313
- code_puppy-0.0.970/code_puppy/session_migration.py +0 -220
- code_puppy-0.0.970/code_puppy/session_storage.py +0 -460
- code_puppy-0.0.970/code_puppy/session_surrogate_unpickler.py +0 -418
- code_puppy-0.0.970/code_puppy/shared_credentials.py +0 -135
- code_puppy-0.0.970/code_puppy/skill_provider.py +0 -43
- code_puppy-0.0.970/code_puppy/splash.py +0 -385
- code_puppy-0.0.970/code_puppy/status_display.py +0 -315
- code_puppy-0.0.970/code_puppy/steer_metadata.py +0 -33
- code_puppy-0.0.970/code_puppy/terminal_utils.py +0 -671
- code_puppy-0.0.970/code_puppy/token_usage.py +0 -434
- code_puppy-0.0.970/code_puppy/tools/__init__.py +0 -470
- code_puppy-0.0.970/code_puppy/tools/_browser_registry.py +0 -139
- code_puppy-0.0.970/code_puppy/tools/_lazy.py +0 -12
- code_puppy-0.0.970/code_puppy/tools/agent_tools.py +0 -345
- code_puppy-0.0.970/code_puppy/tools/approval_feedback.py +0 -29
- code_puppy-0.0.970/code_puppy/tools/ask_user_question/__init__.py +0 -26
- code_puppy-0.0.970/code_puppy/tools/ask_user_question/constants.py +0 -77
- code_puppy-0.0.970/code_puppy/tools/ask_user_question/demo_tui.py +0 -55
- code_puppy-0.0.970/code_puppy/tools/ask_user_question/handler.py +0 -237
- code_puppy-0.0.970/code_puppy/tools/ask_user_question/models.py +0 -304
- code_puppy-0.0.970/code_puppy/tools/ask_user_question/registration.py +0 -153
- code_puppy-0.0.970/code_puppy/tools/ask_user_question/renderers.py +0 -406
- code_puppy-0.0.970/code_puppy/tools/ask_user_question/terminal_ui.py +0 -344
- code_puppy-0.0.970/code_puppy/tools/ask_user_question/theme.py +0 -155
- code_puppy-0.0.970/code_puppy/tools/ask_user_question/tui_loop.py +0 -280
- code_puppy-0.0.970/code_puppy/tools/browser/__init__.py +0 -37
- code_puppy-0.0.970/code_puppy/tools/browser/browser_control.py +0 -297
- code_puppy-0.0.970/code_puppy/tools/browser/browser_interactions.py +0 -581
- code_puppy-0.0.970/code_puppy/tools/browser/browser_locator_resolver.py +0 -70
- code_puppy-0.0.970/code_puppy/tools/browser/browser_locators.py +0 -654
- code_puppy-0.0.970/code_puppy/tools/browser/browser_manager.py +0 -591
- code_puppy-0.0.970/code_puppy/tools/browser/browser_navigation.py +0 -257
- code_puppy-0.0.970/code_puppy/tools/browser/browser_page_snapshot.py +0 -156
- code_puppy-0.0.970/code_puppy/tools/browser/browser_screenshot.py +0 -196
- code_puppy-0.0.970/code_puppy/tools/browser/browser_scripts.py +0 -526
- code_puppy-0.0.970/code_puppy/tools/browser/browser_semantic_interactions.py +0 -216
- code_puppy-0.0.970/code_puppy/tools/browser/browser_workflows.py +0 -228
- code_puppy-0.0.970/code_puppy/tools/browser/tool_registry.py +0 -5
- code_puppy-0.0.970/code_puppy/tools/command_runner.py +0 -1501
- code_puppy-0.0.970/code_puppy/tools/common.py +0 -1358
- code_puppy-0.0.970/code_puppy/tools/display.py +0 -111
- code_puppy-0.0.970/code_puppy/tools/file_modifications.py +0 -1295
- code_puppy-0.0.970/code_puppy/tools/file_operations.py +0 -1444
- code_puppy-0.0.970/code_puppy/tools/file_permission_state.py +0 -153
- code_puppy-0.0.970/code_puppy/tools/fs_access.py +0 -228
- code_puppy-0.0.970/code_puppy/tools/image_tools.py +0 -227
- code_puppy-0.0.970/code_puppy/tools/io_backends.py +0 -186
- code_puppy-0.0.970/code_puppy/tools/model_tools.py +0 -105
- code_puppy-0.0.970/code_puppy/tools/ripgrep.py +0 -31
- code_puppy-0.0.970/code_puppy/tools/shell_backgrounding.py +0 -94
- code_puppy-0.0.970/code_puppy/tools/skills_tools.py +0 -205
- code_puppy-0.0.970/code_puppy/tools/subagent_context.py +0 -247
- code_puppy-0.0.970/code_puppy/tools/subagent_invocation.py +0 -921
- code_puppy-0.0.970/code_puppy/tools/subagent_usage_metrics.py +0 -221
- code_puppy-0.0.970/code_puppy/tools/tools_content.py +0 -50
- code_puppy-0.0.970/code_puppy/tools/universal_constructor.py +0 -923
- code_puppy-0.0.970/code_puppy/tools/win_shell_io.py +0 -161
- code_puppy-0.0.970/code_puppy/undo_manager.py +0 -67
- code_puppy-0.0.970/code_puppy/universal_constructor_provider.py +0 -97
- code_puppy-0.0.970/code_puppy/version_checker.py +0 -101
- code_puppy-0.0.970/code_puppy/zai_model.py +0 -16
- code_puppy-0.0.970/pyproject.toml +0 -125
- {code_puppy-0.0.970 → code_puppy-1.0.0}/.gitignore +0 -0
- {code_puppy-0.0.970 → code_puppy-1.0.0}/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: code-puppy
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Code generation agent
|
|
5
5
|
Project-URL: repository, https://github.com/mpfaffenberger/code_puppy
|
|
6
6
|
Project-URL: HomePage, https://github.com/mpfaffenberger/code_puppy
|
|
@@ -13,45 +13,28 @@ Classifier: Programming Language :: Python :: 3
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
17
|
Classifier: Topic :: Software Development :: Code Generators
|
|
17
18
|
Requires-Python: <3.15,>=3.11
|
|
18
|
-
Requires-Dist:
|
|
19
|
-
Requires-Dist: anthropic<2,>=1.0.0
|
|
20
|
-
Requires-Dist: anyio>=4.14.2
|
|
21
|
-
Requires-Dist: azure-identity>=1.15.0
|
|
22
|
-
Requires-Dist: boto3>=1.43.9
|
|
23
|
-
Requires-Dist: code-puppy-core-plugins>=0.0.110
|
|
19
|
+
Requires-Dist: cbor2<6; sys_platform == 'darwin' and platform_machine == 'x86_64'
|
|
24
20
|
Requires-Dist: cryptography<49; sys_platform == 'darwin' and platform_machine == 'x86_64'
|
|
25
|
-
Requires-Dist: fastmcp-slim[client]<5,>=3.3.0
|
|
26
|
-
Requires-Dist: httpx2>=2.7
|
|
27
|
-
Requires-Dist: httpx[http2]>=0.24.1
|
|
28
|
-
Requires-Dist: json-repair>=0.46.2
|
|
29
|
-
Requires-Dist: keyring>=24.0.0
|
|
30
|
-
Requires-Dist: mcp>=1.9.4
|
|
31
|
-
Requires-Dist: openai>=2.45.0
|
|
32
21
|
Requires-Dist: packaging>=24.0
|
|
33
|
-
Requires-Dist:
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
Requires-Dist: pydantic-ai-harness[code-mode]==0.64.0
|
|
36
|
-
Requires-Dist: pydantic-ai-slim[anthropic,mcp,openai]==2.64.0
|
|
37
|
-
Requires-Dist: pydantic-monty<2,>=1.4.0
|
|
38
|
-
Requires-Dist: pydantic>=2.4.0
|
|
39
|
-
Requires-Dist: pyfiglet>=0.8.post1
|
|
40
|
-
Requires-Dist: python-dotenv>=1.0.0
|
|
41
|
-
Requires-Dist: requests>=2.28.0
|
|
42
|
-
Requires-Dist: rich>=13.4.2
|
|
43
|
-
Requires-Dist: ripgrep==14.1.0; sys_platform != 'android'
|
|
44
|
-
Requires-Dist: termflow-md>=0.10.0
|
|
45
|
-
Requires-Dist: typer>=0.12.0
|
|
46
|
-
Requires-Dist: websockets>=14.0
|
|
47
|
-
Provides-Extra: bedrock
|
|
48
|
-
Requires-Dist: boto3>=1.35.0; extra == 'bedrock'
|
|
49
|
-
Provides-Extra: computer-use
|
|
50
|
-
Requires-Dist: code-puppy-core-plugins[computer-use]>=0.0.110; extra == 'computer-use'
|
|
51
|
-
Provides-Extra: durable
|
|
52
|
-
Requires-Dist: dbos>=2.11.0; extra == 'durable'
|
|
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
|
|
53
24
|
Description-Content-Type: text/markdown
|
|
54
25
|
|
|
26
|
+
> **Code Puppy 1.0** is a rebuild on
|
|
27
|
+
> [pydantic-ai-pax](https://github.com/pydantic/pydantic-ai/tree/main/src/pydantic_ai_pax)
|
|
28
|
+
> and [pydantic-ai-harness](https://pydantic.dev/docs/ai/harness/). Most of this
|
|
29
|
+
> README still describes 0.0.x and has not been rewritten yet.
|
|
30
|
+
>
|
|
31
|
+
> - Run it: `uvx code-puppy`. 0.0.x stays available: `uvx --from 'code-puppy<1' code-puppy`.
|
|
32
|
+
> - Your 0.0.x settings, API keys and MCP servers are carried over on first start;
|
|
33
|
+
> `pup migrate --dry-run` shows what would move. 0.0.x files are never modified.
|
|
34
|
+
> - 0.0.x plugins keep loading; `/puppy-plugins` lists them.
|
|
35
|
+
> - **Windows:** the agent runs its commands in PowerShell.
|
|
36
|
+
> - Plan and status: [`docs/upgrade/code_puppy_1_0_rewrite_plan.md`](docs/upgrade/code_puppy_1_0_rewrite_plan.md).
|
|
37
|
+
|
|
55
38
|
<div align="center">
|
|
56
39
|
|
|
57
40
|

|
|
@@ -167,16 +150,19 @@ After a `git pull`, Python source changes are available immediately. Run
|
|
|
167
150
|
`pipx reinstall code-puppy` only when project dependencies change.
|
|
168
151
|
Playwright-backed browser tools are not installed on Android.
|
|
169
152
|
|
|
170
|
-
#### Optional: DBOS durable execution
|
|
153
|
+
#### Optional: DBOS durable execution (0.0.x only)
|
|
154
|
+
|
|
155
|
+
> 1.0 has no `durable` extra and no `/dbos` command yet. These steps install
|
|
156
|
+
> the 0.0.x line, which still has both.
|
|
171
157
|
|
|
172
|
-
Code Puppy ships with an optional [DBOS](https://github.com/dbos-inc/dbos-transact-py)-backed
|
|
158
|
+
Code Puppy 0.0.x ships with an optional [DBOS](https://github.com/dbos-inc/dbos-transact-py)-backed
|
|
173
159
|
durable-execution plugin that survives crashes and lets you resume long agent runs.
|
|
174
160
|
It's **off by default in the dependency tree** — install the `durable` extra to opt in:
|
|
175
161
|
|
|
176
162
|
```bash
|
|
177
|
-
pip install "code-puppy[durable]"
|
|
163
|
+
pip install "code-puppy[durable]<1"
|
|
178
164
|
# or
|
|
179
|
-
uv pip install "code-puppy[durable]"
|
|
165
|
+
uv pip install "code-puppy[durable]<1"
|
|
180
166
|
```
|
|
181
167
|
|
|
182
168
|
Then toggle it from inside the app via `/dbos on` (and restart). Use `/dbos status`
|
|
@@ -280,9 +266,10 @@ These providers are automatically configured with correct OpenAI-compatible endp
|
|
|
280
266
|
- **⚠️ Unsupported Providers** - Providers like Amazon Bedrock and Google Vertex that require special authentication are clearly marked
|
|
281
267
|
- **⚠️ No Tool Calling** - Models without tool calling support show a big warning since they can't use Code Puppy's file/shell tools
|
|
282
268
|
|
|
283
|
-
### Durable Execution
|
|
269
|
+
### Durable Execution (0.0.x only)
|
|
284
270
|
|
|
285
|
-
Code Puppy
|
|
271
|
+
Code Puppy 0.0.x supports **[DBOS](https://github.com/dbos-inc/dbos-transact-py)** durable execution;
|
|
272
|
+
see [the install steps above](#optional-dbos-durable-execution-00x-only).
|
|
286
273
|
|
|
287
274
|
When enabled, every agent is automatically wrapped as a `DBOSAgent`, checkpointing key interactions (including agent inputs, LLM responses, MCP calls, and tool calls) in a database for durability and recovery.
|
|
288
275
|
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
> **Code Puppy 1.0** is a rebuild on
|
|
2
|
+
> [pydantic-ai-pax](https://github.com/pydantic/pydantic-ai/tree/main/src/pydantic_ai_pax)
|
|
3
|
+
> and [pydantic-ai-harness](https://pydantic.dev/docs/ai/harness/). Most of this
|
|
4
|
+
> README still describes 0.0.x and has not been rewritten yet.
|
|
5
|
+
>
|
|
6
|
+
> - Run it: `uvx code-puppy`. 0.0.x stays available: `uvx --from 'code-puppy<1' code-puppy`.
|
|
7
|
+
> - Your 0.0.x settings, API keys and MCP servers are carried over on first start;
|
|
8
|
+
> `pup migrate --dry-run` shows what would move. 0.0.x files are never modified.
|
|
9
|
+
> - 0.0.x plugins keep loading; `/puppy-plugins` lists them.
|
|
10
|
+
> - **Windows:** the agent runs its commands in PowerShell.
|
|
11
|
+
> - Plan and status: [`docs/upgrade/code_puppy_1_0_rewrite_plan.md`](docs/upgrade/code_puppy_1_0_rewrite_plan.md).
|
|
12
|
+
|
|
1
13
|
<div align="center">
|
|
2
14
|
|
|
3
15
|

|
|
@@ -113,16 +125,19 @@ After a `git pull`, Python source changes are available immediately. Run
|
|
|
113
125
|
`pipx reinstall code-puppy` only when project dependencies change.
|
|
114
126
|
Playwright-backed browser tools are not installed on Android.
|
|
115
127
|
|
|
116
|
-
#### Optional: DBOS durable execution
|
|
128
|
+
#### Optional: DBOS durable execution (0.0.x only)
|
|
129
|
+
|
|
130
|
+
> 1.0 has no `durable` extra and no `/dbos` command yet. These steps install
|
|
131
|
+
> the 0.0.x line, which still has both.
|
|
117
132
|
|
|
118
|
-
Code Puppy ships with an optional [DBOS](https://github.com/dbos-inc/dbos-transact-py)-backed
|
|
133
|
+
Code Puppy 0.0.x ships with an optional [DBOS](https://github.com/dbos-inc/dbos-transact-py)-backed
|
|
119
134
|
durable-execution plugin that survives crashes and lets you resume long agent runs.
|
|
120
135
|
It's **off by default in the dependency tree** — install the `durable` extra to opt in:
|
|
121
136
|
|
|
122
137
|
```bash
|
|
123
|
-
pip install "code-puppy[durable]"
|
|
138
|
+
pip install "code-puppy[durable]<1"
|
|
124
139
|
# or
|
|
125
|
-
uv pip install "code-puppy[durable]"
|
|
140
|
+
uv pip install "code-puppy[durable]<1"
|
|
126
141
|
```
|
|
127
142
|
|
|
128
143
|
Then toggle it from inside the app via `/dbos on` (and restart). Use `/dbos status`
|
|
@@ -226,9 +241,10 @@ These providers are automatically configured with correct OpenAI-compatible endp
|
|
|
226
241
|
- **⚠️ Unsupported Providers** - Providers like Amazon Bedrock and Google Vertex that require special authentication are clearly marked
|
|
227
242
|
- **⚠️ No Tool Calling** - Models without tool calling support show a big warning since they can't use Code Puppy's file/shell tools
|
|
228
243
|
|
|
229
|
-
### Durable Execution
|
|
244
|
+
### Durable Execution (0.0.x only)
|
|
230
245
|
|
|
231
|
-
Code Puppy
|
|
246
|
+
Code Puppy 0.0.x supports **[DBOS](https://github.com/dbos-inc/dbos-transact-py)** durable execution;
|
|
247
|
+
see [the install steps above](#optional-dbos-durable-execution-00x-only).
|
|
232
248
|
|
|
233
249
|
When enabled, every agent is automatically wrapped as a `DBOSAgent`, checkpointing key interactions (including agent inputs, LLM responses, MCP calls, and tool calls) in a database for durability and recovery.
|
|
234
250
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""Code Puppy's startup art: rasters and sprites the splash scenes paint.
|
|
2
|
+
|
|
3
|
+
Plain data, so the splash stays import-light. In ``PAW`` each digit is a shade
|
|
4
|
+
tier, 0 blank .. 3 solid. Sprites are rows of text; a space is transparent.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
PAW = (
|
|
8
|
+
"00000000000011222110000112221100000000000",
|
|
9
|
+
"00000000000123333210000123333210000000000",
|
|
10
|
+
"00000000001233333321001233333321000000000",
|
|
11
|
+
"00000000001233333321001233333321000000000",
|
|
12
|
+
"00112211000123333210000123333210000112211",
|
|
13
|
+
"01233332100112222110000112222110012333321",
|
|
14
|
+
"12333333210000000000000000000001233333321",
|
|
15
|
+
"12333333210000000000000000000001233333321",
|
|
16
|
+
"01233332100000000112222110000000123333210",
|
|
17
|
+
"00112211000000001233333321000000011221100",
|
|
18
|
+
"00000000000000012333333332100000000000000",
|
|
19
|
+
"00000000000000123333333333210000000000000",
|
|
20
|
+
"00000000000001233333333333321000000000000",
|
|
21
|
+
"00000000000012333333333333332100000000000",
|
|
22
|
+
"00000000000123333333333333333210000000000",
|
|
23
|
+
"00000000001233333333333333333321000000000",
|
|
24
|
+
"00000000001233333333333333333321000000000",
|
|
25
|
+
"00000000000123333332222333333321000000000",
|
|
26
|
+
"00000000000012333321001233333210000000000",
|
|
27
|
+
"00000000000001122110000112211000000000000",
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
PRINT = (
|
|
31
|
+
" ● ● ",
|
|
32
|
+
"● ●",
|
|
33
|
+
" ▟█▙ ",
|
|
34
|
+
)
|
|
35
|
+
"""One small paw print."""
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""Make saved API keys reach model providers, as Code Puppy 0.0.x did.
|
|
2
|
+
|
|
3
|
+
0.0.x kept keys such as ``OPENAI_API_KEY`` in ``puppy.cfg`` and exported them
|
|
4
|
+
at startup. The migration moves them into the encrypted ``/keys`` store, where
|
|
5
|
+
the runtime treats names as labels and exports nothing. Providers read their
|
|
6
|
+
key from the environment, so without this step a migrated user would have to
|
|
7
|
+
set every key again.
|
|
8
|
+
|
|
9
|
+
Only names shaped like a key variable are exported, and a variable the user
|
|
10
|
+
already set always wins.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import os
|
|
16
|
+
from collections.abc import MutableMapping
|
|
17
|
+
|
|
18
|
+
KEY_ACCOUNT = "api-keys"
|
|
19
|
+
CREDENTIAL_SUFFIXES = ("_API_KEY", "_TOKEN")
|
|
20
|
+
"""What a credential variable is called. A name that redirects requests or
|
|
21
|
+
moves Code Puppy's own folders is not one, which is what keeps an untrusted
|
|
22
|
+
``.env`` from setting it; see ``main._load_dotenv``."""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def is_credential_name(name: str) -> bool:
|
|
26
|
+
"""Whether ``name`` is a provider credential rather than a setting."""
|
|
27
|
+
return name.endswith(CREDENTIAL_SUFFIXES)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def export_saved_keys(environ: MutableMapping[str, str] = os.environ) -> list[str]:
|
|
31
|
+
"""Export saved keys that the environment lacks; return the names exported.
|
|
32
|
+
|
|
33
|
+
Does not touch the keyring unless a key bundle exists.
|
|
34
|
+
"""
|
|
35
|
+
from pydantic_ai_pax.config.api_keys import load_keys
|
|
36
|
+
from pydantic_ai_pax.config.credential_store import has_credentials
|
|
37
|
+
|
|
38
|
+
if not has_credentials(account=KEY_ACCOUNT):
|
|
39
|
+
return []
|
|
40
|
+
exported: list[str] = []
|
|
41
|
+
for name, secret in load_keys().items():
|
|
42
|
+
if is_credential_name(name) and not environ.get(name):
|
|
43
|
+
environ[name] = secret.get_secret_value()
|
|
44
|
+
exported.append(name)
|
|
45
|
+
return exported
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""What Code Puppy prints about itself: the banner and the welcome lines."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib import metadata
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
from pyfiglet import Figlet
|
|
9
|
+
from rich.text import Text
|
|
10
|
+
|
|
11
|
+
from code_puppy import identity
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from pydantic_ai_pax.config.project_settings import ProjectSettings
|
|
15
|
+
from pydantic_ai_pax.runtime.worktrees import Worktree
|
|
16
|
+
from rich.console import Console
|
|
17
|
+
|
|
18
|
+
BANNER_TEXT = "CODE PUPPY"
|
|
19
|
+
BANNER_COMPACT = "PUP"
|
|
20
|
+
RUNTIME_DISTRIBUTION = "pydantic-ai-pax"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def version_line() -> str:
|
|
24
|
+
"""Code Puppy's version and the runtime underneath, for bug reports."""
|
|
25
|
+
try:
|
|
26
|
+
runtime = metadata.version(RUNTIME_DISTRIBUTION)
|
|
27
|
+
except metadata.PackageNotFoundError:
|
|
28
|
+
runtime = "unknown"
|
|
29
|
+
return f"{identity.DISTRIBUTION} {identity.version()} ({RUNTIME_DISTRIBUTION} {runtime})"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def print_banner(console: Console) -> None:
|
|
33
|
+
"""Print the wordmark, falling back to shorter forms on a narrow terminal."""
|
|
34
|
+
from pydantic_ai_pax.ui.rendering import theme
|
|
35
|
+
|
|
36
|
+
figlet = Figlet(font="ansi_shadow", width=200)
|
|
37
|
+
with theme.branded():
|
|
38
|
+
for text in (BANNER_TEXT, BANNER_COMPACT):
|
|
39
|
+
lines = figlet.renderText(text).splitlines()
|
|
40
|
+
if console.width >= max(map(len, lines)):
|
|
41
|
+
for index, line in enumerate(lines):
|
|
42
|
+
console.print(Text(line, style=theme.BANNER[min(index // 2, 2)]))
|
|
43
|
+
return
|
|
44
|
+
console.print(identity.DISPLAY_NAME, style=theme.LOGO, highlight=False)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def print_welcome(
|
|
48
|
+
project: ProjectSettings, console: Console, *, worktree: Worktree | None = None
|
|
49
|
+
) -> None:
|
|
50
|
+
"""The banner, version and hints a fresh launch and ``/clear`` show."""
|
|
51
|
+
from pydantic_ai_pax.ui.rendering import theme, welcome
|
|
52
|
+
|
|
53
|
+
muted = theme.color(theme.MUTED)
|
|
54
|
+
console.print()
|
|
55
|
+
print_banner(console)
|
|
56
|
+
# `highlight=False` throughout: Rich would recolour the version numbers and
|
|
57
|
+
# the slash commands as if this text were a Python repr.
|
|
58
|
+
console.print(version_line(), style=muted, highlight=False)
|
|
59
|
+
if worktree is not None:
|
|
60
|
+
# Soft wrap keeps the path copyable: hard wrapping would break it.
|
|
61
|
+
console.print(
|
|
62
|
+
worktree.notice, style=muted, markup=False, highlight=False, soft_wrap=True
|
|
63
|
+
)
|
|
64
|
+
console.print(
|
|
65
|
+
"/new starts a session; /resume restores one; /exit quits. "
|
|
66
|
+
"Esc or Ctrl-C interrupts a turn.",
|
|
67
|
+
style=muted,
|
|
68
|
+
highlight=False,
|
|
69
|
+
)
|
|
70
|
+
welcome._report_project(project, console)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Plugins Code Puppy ships on top of pydantic-ai-pax's own.
|
|
2
|
+
|
|
3
|
+
Each entry is a pax plugin declaration. ``distribution`` appends them to
|
|
4
|
+
pax's built-in set, so ``/plugins`` lists them as shipped and
|
|
5
|
+
``/plugins remove`` restores their defaults.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from pydantic_ai_pax.config import PluginSettings
|
|
11
|
+
|
|
12
|
+
from code_puppy import personality
|
|
13
|
+
|
|
14
|
+
CLAUDE_CODE_NO_UPDATE_CHECK = "CLAUDE_CODE_NO_UPDATE_CHECK"
|
|
15
|
+
"""Turns off the Claude Code plugin's own update notice.
|
|
16
|
+
|
|
17
|
+
The notice tells users to reinstall the plugin as a drop-in. Here it is a
|
|
18
|
+
dependency of Code Puppy, so it updates with Code Puppy instead.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
PUPPY_PLUGINS: tuple[PluginSettings, ...] = (
|
|
22
|
+
# The main agent's name, tone and opinions. See `code_puppy.personality`.
|
|
23
|
+
PluginSettings(id=personality.PLUGIN_ID, factory=personality.FACTORY),
|
|
24
|
+
PluginSettings(
|
|
25
|
+
id="legacy_plugins", factory="code_puppy.compat.bridge:LegacyPlugins"
|
|
26
|
+
),
|
|
27
|
+
# Claude Code subscription models, from the `pydantic-claude-code` package.
|
|
28
|
+
# Same id as that plugin's drop-in install, so a user's own copy replaces
|
|
29
|
+
# this one instead of loading beside it.
|
|
30
|
+
PluginSettings(
|
|
31
|
+
id="claude_code", factory="pydantic_ai_claude_code.clai2:ClaudeCodePlugin"
|
|
32
|
+
),
|
|
33
|
+
)
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"""The 0.0.x plugin hook registry, kept so existing plugins load unchanged.
|
|
2
|
+
|
|
3
|
+
``register_callback("<hook>", func)`` works as it always did. What changed is
|
|
4
|
+
who fires the hooks: ``code_puppy.compat.bridge`` translates the runtime's
|
|
5
|
+
moments into these calls.
|
|
6
|
+
|
|
7
|
+
Hooks come in three tiers:
|
|
8
|
+
|
|
9
|
+
* **Supported** hooks fire at the equivalent 1.0 moment.
|
|
10
|
+
* **Accepted** hooks register without error but never fire. 1.0 has no
|
|
11
|
+
equivalent moment, or firing them would undo what the runtime guarantees
|
|
12
|
+
(rewriting model messages breaks prompt caching, for example).
|
|
13
|
+
* **Removed** hooks were internal plumbing between 0.0.x core and its own
|
|
14
|
+
plugins. They register and never fire too, and are listed separately so the
|
|
15
|
+
bridge can say which is which.
|
|
16
|
+
|
|
17
|
+
New plugins should use the pydantic-ai-pax ``Plugin`` API instead.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
import inspect
|
|
23
|
+
from collections.abc import Callable, Iterator
|
|
24
|
+
from contextlib import contextmanager
|
|
25
|
+
from contextvars import ContextVar
|
|
26
|
+
from dataclasses import dataclass
|
|
27
|
+
from typing import Any
|
|
28
|
+
|
|
29
|
+
CallbackFunc = Callable[..., Any]
|
|
30
|
+
PhaseType = str
|
|
31
|
+
CustomCommandResult = bool | str | None
|
|
32
|
+
|
|
33
|
+
SUPPORTED = frozenset(
|
|
34
|
+
{
|
|
35
|
+
"startup",
|
|
36
|
+
"shutdown",
|
|
37
|
+
"session_end",
|
|
38
|
+
"custom_command",
|
|
39
|
+
"custom_command_help",
|
|
40
|
+
"load_prompt",
|
|
41
|
+
"pre_tool_call",
|
|
42
|
+
"post_tool_call",
|
|
43
|
+
"run_shell_command",
|
|
44
|
+
"register_tools",
|
|
45
|
+
"user_prompt_submit",
|
|
46
|
+
"agent_run_start",
|
|
47
|
+
"agent_run_end",
|
|
48
|
+
"interactive_turn_end",
|
|
49
|
+
"interactive_turn_cancel",
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
REMOVED = frozenset(
|
|
54
|
+
{
|
|
55
|
+
"check_claude_oauth_token_expiry",
|
|
56
|
+
"refresh_claude_oauth_token",
|
|
57
|
+
"load_claude_oauth_models",
|
|
58
|
+
"claude_oauth_authenticate",
|
|
59
|
+
"should_skip_fallback_render",
|
|
60
|
+
"agent_event_stream_start",
|
|
61
|
+
"version_check",
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
ACCEPTED = frozenset(
|
|
66
|
+
{
|
|
67
|
+
# Every tool from `register_tools` is offered to the agent (deferred),
|
|
68
|
+
# so there is no per-agent list for `register_agent_tools` to extend.
|
|
69
|
+
"register_agent_tools",
|
|
70
|
+
"register_agents",
|
|
71
|
+
"invoke_agent",
|
|
72
|
+
"agent_exception",
|
|
73
|
+
"edit_file",
|
|
74
|
+
"create_file",
|
|
75
|
+
"replace_in_file",
|
|
76
|
+
"delete_snippet",
|
|
77
|
+
"delete_file",
|
|
78
|
+
"run_shell_command_output",
|
|
79
|
+
"load_model_config",
|
|
80
|
+
"load_models_config",
|
|
81
|
+
"load_model_descriptions",
|
|
82
|
+
"agent_reload",
|
|
83
|
+
"usage_status",
|
|
84
|
+
"file_permission",
|
|
85
|
+
"stream_event",
|
|
86
|
+
"thinking_display_filter",
|
|
87
|
+
"termflow_style",
|
|
88
|
+
"prompt_toolkit_style",
|
|
89
|
+
"termflow_highlighter",
|
|
90
|
+
"prompt_text_color",
|
|
91
|
+
"register_model_type",
|
|
92
|
+
"register_skills",
|
|
93
|
+
"register_settings",
|
|
94
|
+
"register_kennel_memory",
|
|
95
|
+
"register_cli_args",
|
|
96
|
+
"handle_cli_args",
|
|
97
|
+
"get_model_system_prompt",
|
|
98
|
+
"prepare_model_prompt",
|
|
99
|
+
"agent_run_result",
|
|
100
|
+
"model_select",
|
|
101
|
+
"provider_credential_flow",
|
|
102
|
+
"register_mcp_catalog_servers",
|
|
103
|
+
"register_browser_types",
|
|
104
|
+
"register_model_providers",
|
|
105
|
+
"register_completion_provider",
|
|
106
|
+
"message_history_processor_start",
|
|
107
|
+
"message_history_processor_end",
|
|
108
|
+
"on_message",
|
|
109
|
+
"wrap_pydantic_agent",
|
|
110
|
+
"agent_run_context",
|
|
111
|
+
"agent_run_cancel",
|
|
112
|
+
"pre_mcp_autostart",
|
|
113
|
+
"pre_compact",
|
|
114
|
+
"post_autosave",
|
|
115
|
+
"session_browser_open",
|
|
116
|
+
"notification",
|
|
117
|
+
"awaiting_user_input",
|
|
118
|
+
"git_branch_provider",
|
|
119
|
+
"feature_capability",
|
|
120
|
+
"transform_model_messages",
|
|
121
|
+
"error_logged",
|
|
122
|
+
"banner_notice",
|
|
123
|
+
"prompt_ready",
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
ALL_PHASES = SUPPORTED | ACCEPTED | REMOVED
|
|
128
|
+
BLOCKING_PHASES = frozenset({"pre_tool_call", "run_shell_command"})
|
|
129
|
+
"""Hooks whose consumers act on the result, so ``fail_closed`` means something."""
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
@dataclass(frozen=True)
|
|
133
|
+
class Registration:
|
|
134
|
+
"""One registered callback and the plugin that registered it."""
|
|
135
|
+
|
|
136
|
+
func: CallbackFunc
|
|
137
|
+
fail_closed: bool = False
|
|
138
|
+
owner: str | None = None
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
@dataclass(frozen=True)
|
|
142
|
+
class CallbackError:
|
|
143
|
+
"""A callback raised. ``fail_closed`` callbacks block when this happens."""
|
|
144
|
+
|
|
145
|
+
phase: str
|
|
146
|
+
owner: str | None
|
|
147
|
+
error: BaseException
|
|
148
|
+
fail_closed: bool = False
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
_registry: dict[str, list[Registration]] = {}
|
|
152
|
+
_owner: ContextVar[str | None] = ContextVar("code_puppy_plugin_owner", default=None)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
@contextmanager
|
|
156
|
+
def owned_by(plugin: str) -> Iterator[None]:
|
|
157
|
+
"""Attribute callbacks registered inside the block to ``plugin``."""
|
|
158
|
+
token = _owner.set(plugin)
|
|
159
|
+
try:
|
|
160
|
+
yield
|
|
161
|
+
finally:
|
|
162
|
+
_owner.reset(token)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def register_callback(
|
|
166
|
+
phase: PhaseType, func: CallbackFunc, fail_closed: bool = False
|
|
167
|
+
) -> None:
|
|
168
|
+
"""Register ``func`` for ``phase``. Registering the same function twice is a no-op."""
|
|
169
|
+
if phase not in ALL_PHASES:
|
|
170
|
+
raise ValueError(f"Unsupported callback phase: {phase!r}")
|
|
171
|
+
if not callable(func):
|
|
172
|
+
raise TypeError(
|
|
173
|
+
f"Callback for {phase!r} must be callable, got {type(func).__name__}"
|
|
174
|
+
)
|
|
175
|
+
if fail_closed and phase not in BLOCKING_PHASES:
|
|
176
|
+
raise ValueError(
|
|
177
|
+
"fail_closed=True is only meaningful on phases whose consumers act on "
|
|
178
|
+
f"the result: {', '.join(sorted(BLOCKING_PHASES))}"
|
|
179
|
+
)
|
|
180
|
+
registered = _registry.setdefault(phase, [])
|
|
181
|
+
if any(entry.func is func for entry in registered):
|
|
182
|
+
return
|
|
183
|
+
registered.append(
|
|
184
|
+
Registration(func=func, fail_closed=fail_closed, owner=_owner.get())
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def unregister_callback(phase: PhaseType, func: CallbackFunc) -> bool:
|
|
189
|
+
"""Remove ``func`` from ``phase``; ``False`` when it was not registered."""
|
|
190
|
+
registered = _registry.get(phase, [])
|
|
191
|
+
kept = [entry for entry in registered if entry.func is not func]
|
|
192
|
+
_registry[phase] = kept
|
|
193
|
+
return len(kept) != len(registered)
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def clear_callbacks(phase: PhaseType | None = None) -> None:
|
|
197
|
+
"""Forget every callback, or those of one phase."""
|
|
198
|
+
if phase is None:
|
|
199
|
+
_registry.clear()
|
|
200
|
+
else:
|
|
201
|
+
_registry.pop(phase, None)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def unregister_owner(plugin: str) -> int:
|
|
205
|
+
"""Remove everything ``plugin`` registered; the number of callbacks removed."""
|
|
206
|
+
removed = 0
|
|
207
|
+
for phase, registered in _registry.items():
|
|
208
|
+
kept = [entry for entry in registered if entry.owner != plugin]
|
|
209
|
+
removed += len(registered) - len(kept)
|
|
210
|
+
_registry[phase] = kept
|
|
211
|
+
return removed
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
def get_callbacks(phase: PhaseType) -> list[CallbackFunc]:
|
|
215
|
+
return [entry.func for entry in _registry.get(phase, [])]
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def get_callback_owner(func: CallbackFunc) -> str | None:
|
|
219
|
+
"""The plugin that registered ``func``, when it was loaded as one."""
|
|
220
|
+
for registered in _registry.values():
|
|
221
|
+
for entry in registered:
|
|
222
|
+
if entry.func is func:
|
|
223
|
+
return entry.owner
|
|
224
|
+
return None
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def count_callbacks(phase: PhaseType | None = None) -> int:
|
|
228
|
+
if phase is not None:
|
|
229
|
+
return len(_registry.get(phase, []))
|
|
230
|
+
return sum(len(registered) for registered in _registry.values())
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
def registrations(phase: PhaseType) -> list[Registration]:
|
|
234
|
+
return list(_registry.get(phase, []))
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def inert_registrations() -> dict[str, list[str]]:
|
|
238
|
+
"""Plugins that registered hooks 1.0 never fires, by plugin name."""
|
|
239
|
+
found: dict[str, set[str]] = {}
|
|
240
|
+
for phase, registered in _registry.items():
|
|
241
|
+
if phase in SUPPORTED:
|
|
242
|
+
continue
|
|
243
|
+
for entry in registered:
|
|
244
|
+
found.setdefault(entry.owner or "(unknown)", set()).add(phase)
|
|
245
|
+
return {owner: sorted(phases) for owner, phases in sorted(found.items())}
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def fire_sync(phase: PhaseType, *args: object, **kwargs: object) -> list[Any]:
|
|
249
|
+
"""Call every callback of ``phase`` now. A failing callback yields a ``CallbackError``.
|
|
250
|
+
|
|
251
|
+
A callback that returns an awaitable cannot be awaited here: it is closed
|
|
252
|
+
and reported as an error instead of being left to warn at garbage collection.
|
|
253
|
+
"""
|
|
254
|
+
results: list[Any] = []
|
|
255
|
+
for entry in registrations(phase):
|
|
256
|
+
try:
|
|
257
|
+
result = entry.func(*args, **kwargs)
|
|
258
|
+
if inspect.isawaitable(result):
|
|
259
|
+
if inspect.iscoroutine(result):
|
|
260
|
+
result.close()
|
|
261
|
+
raise TypeError(f"{phase} callbacks must be synchronous")
|
|
262
|
+
except Exception as exc: # noqa: BLE001 - one plugin must not break the rest
|
|
263
|
+
result = CallbackError(phase, entry.owner, exc, entry.fail_closed)
|
|
264
|
+
results.append(result)
|
|
265
|
+
return results
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
async def fire(phase: PhaseType, *args: object, **kwargs: object) -> list[Any]:
|
|
269
|
+
"""Call every callback of ``phase``, awaiting the asynchronous ones."""
|
|
270
|
+
results: list[Any] = []
|
|
271
|
+
for entry in registrations(phase):
|
|
272
|
+
try:
|
|
273
|
+
result = entry.func(*args, **kwargs)
|
|
274
|
+
if inspect.isawaitable(result):
|
|
275
|
+
result = await result
|
|
276
|
+
except Exception as exc: # noqa: BLE001 - one plugin must not break the rest
|
|
277
|
+
result = CallbackError(phase, entry.owner, exc, entry.fail_closed)
|
|
278
|
+
results.append(result)
|
|
279
|
+
return results
|