code-puppy 0.0.905__tar.gz → 0.0.907__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.905 → code_puppy-0.0.907}/PKG-INFO +1 -1
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/_pydantic_tool_helpers.py +38 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_builder.py +16 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/base_agent.py +18 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/pydantic_patches.py +148 -23
- {code_puppy-0.0.905 → code_puppy-0.0.907}/pyproject.toml +1 -1
- {code_puppy-0.0.905 → code_puppy-0.0.907}/.gitignore +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/LICENSE +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/README.md +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/__main__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/_plugin_i18n_lifecycle.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/_pydantic_video_patch.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agent_completion_inbox.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agent_execution_context.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_code_mode.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_code_mode_guidance.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_compaction.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_diagnostics.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_foreign_thinking.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_history.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_key_listeners.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_model_message_transform.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_non_streaming_render.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_output_limits.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_run_signals.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_runtime.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_steer_processor.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_subagent_recursion.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_windows_console.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/_wire_tool_names.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/agent_code_puppy.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/agent_creator_agent.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/agent_helios.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/agent_manager.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/agent_model_judge.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/agent_planning.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/agent_qa_kitten.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/agent_web_retriever.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/event_stream_handler.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/json_agent.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/retry_checkpoint.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/retry_profiles.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/run_stats.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/smooth_stream.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/stream_status.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/subagent_stream_handler.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/agents/thinking_output.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/asyncio_cleanup.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/atomic_io.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/atomic_json.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/ca_bundle.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/callbacks.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/capabilities/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/capabilities/compaction.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/capabilities/eager_timing.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/chatgpt_codex_client.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/claude_cache_client.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/claude_oauth_transport.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/cli_runner.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/add_model_details.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/add_model_menu.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/add_model_menus.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/add_model_vllm.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/agent_menu.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/attachments.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/autosave_menu.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/autosave_search.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/clipboard.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/colors_menu.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/command_handler.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/command_registry.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/completers.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/completion_cache.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/config_apply.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/config_commands.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/core_commands.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/file_index.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/file_path_completion.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/help_catalog.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/help_overlay.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/image_utils.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/load_context_completion.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/base.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/catalog_server_installer.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/custom_server_form.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/custom_server_installer.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/edit_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/handler.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/help_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/install_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/install_menu.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/list_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/logs_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/mcp_servers_store.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/remove_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/restart_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/search_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/silence_warning_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/start_all_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/start_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/status_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/stop_all_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/stop_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/trust_command.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/utils.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/wizard_utils.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp_binding_menu.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp_completion.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/menu_session.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/model_picker_completion.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/model_settings_defs.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/model_settings_menu.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/onboarding_slides.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/onboarding_wizard.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/pagination.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/pin_command_completion.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/refresh_models.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/session_browser.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/session_browser_data.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/session_commands.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/set_menu.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/set_menu_catalog.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/set_menu_schema.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/set_menu_settings.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/set_menu_shims.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/set_menu_values.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/shell_passthrough.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/skills_completion.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/tui_style.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/uc_menu.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/utils.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/config.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/config_file.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/diagnostics.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/error_logging.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/events/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/events/bridge.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/file_completion_io.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/file_completion_tokens.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/gemini_code_assist.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/gemini_common.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/gemini_model.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/hook_engine/README.md +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/hook_engine/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/hook_engine/aliases.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/hook_engine/engine.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/hook_engine/executor.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/hook_engine/matcher.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/hook_engine/models.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/hook_engine/registry.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/hook_engine/validator.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/http_retry.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/http_utils.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/httpx2_utils.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/i18n/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/i18n/audit.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/i18n/catalog.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/i18n/formats.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/i18n/interpolation.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/i18n/locale.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/i18n/locales/en-US.json +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/i18n/locales/es.json +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/i18n/locales/fr-CA.json +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/i18n/plugin_catalog.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/i18n/plurals.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/i18n/pseudo.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/i18n/translate.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/kennel_provider.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/keymap.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/list_filtering.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/main.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/agent_bindings.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/async_lifecycle.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/blocking_startup.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/circuit_breaker.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/config_wizard.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/dashboard.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/error_isolation.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/examples/retry_example.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/health_monitor.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/http_auth.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/managed_server.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/manager.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/manager_lifecycle.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/mcp_logs.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/project_config.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/registry.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/retry_manager.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/server_registry_catalog.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/status_tracker.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/system_tools.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/tool_arg_coercion.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_/toolset_utils.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_prompts/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/mcp_prompts/hook_creator.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/bar_painters.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/bar_rendering.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/bottom_bar.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/bus.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/chords.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/commands.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/editor_actions.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/editor_completion.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/editor_display.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/editor_history.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/editor_keys.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/editor_paste.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/editor_queue.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/editor_submission.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/external_editor.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/identity_line.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/idle_status.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/inline_bar.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/line_editor.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/markdown_patches.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/menu_lifecycle.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/message_queue.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/messages.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/pause_controller.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/prompt_prefix_style.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/queue_console.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/renderers.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/rich_renderer.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/run_ui.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/run_ui_wiring.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/speculation_line.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/speculation_stats.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/speculation_toggle.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/spinner/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/status_line.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/subagent_console.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/theme_accent.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/tool_output.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/messaging/transcript_guard.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/model_descriptions.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/model_factory.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/model_switching.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/model_utils.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/models.json +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/models_dev_api.json +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/models_dev_parser.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/observability.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/platform_utils.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/plugins/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/plugins/config.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/plugins/oauth_pasteback.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/plugins/oauth_puppy_html.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/plugins/trust.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/plugins/trust_notice.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/private_inference.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/provider_credentials.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/provider_identity.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/reopenable_async_client.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/round_robin_model.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/secret_store.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/secret_store_backends.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/session_format_migration.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/session_lifecycle.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/session_migration.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/session_storage.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/session_surrogate_unpickler.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/shared_credentials.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/skill_provider.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/splash.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/status_display.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/steer_metadata.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/terminal_utils.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/token_usage.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/_browser_registry.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/_lazy.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/agent_tools.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/approval_feedback.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/ask_user_question/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/ask_user_question/constants.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/ask_user_question/demo_tui.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/ask_user_question/handler.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/ask_user_question/models.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/ask_user_question/registration.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/ask_user_question/renderers.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/ask_user_question/terminal_ui.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/ask_user_question/theme.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/ask_user_question/tui_loop.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/browser/__init__.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/browser/browser_control.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/browser/browser_interactions.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/browser/browser_locator_resolver.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/browser/browser_locators.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/browser/browser_manager.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/browser/browser_navigation.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/browser/browser_page_snapshot.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/browser/browser_screenshot.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/browser/browser_scripts.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/browser/browser_semantic_interactions.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/browser/browser_workflows.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/browser/tool_registry.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/command_runner.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/common.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/display.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/file_modifications.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/file_operations.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/file_permission_state.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/fs_access.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/image_tools.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/io_backends.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/model_tools.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/ripgrep.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/shell_backgrounding.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/skills_tools.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/subagent_context.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/subagent_invocation.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/subagent_usage_metrics.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/tools_content.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/universal_constructor.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/tools/win_shell_io.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/undo_manager.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/universal_constructor_provider.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/version_checker.py +0 -0
- {code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/zai_model.py +0 -0
|
@@ -95,8 +95,46 @@ def _block_reason(callback_result: dict) -> str:
|
|
|
95
95
|
return _GENERIC_BLOCK_REASON
|
|
96
96
|
|
|
97
97
|
|
|
98
|
+
def _handled_tool_result(callback_result: dict) -> str | None:
|
|
99
|
+
"""Return the result a blocking hook supplies in place of the tool's.
|
|
100
|
+
|
|
101
|
+
A ``pre_tool_call`` hook that has *handled* the call itself -- e.g. an
|
|
102
|
+
editor client that shows ``ask_user_question`` as its own question UI --
|
|
103
|
+
blocks the tool and passes ``tool_result``: the text the model receives
|
|
104
|
+
as the tool's return value. Anything that is not a non-blank string is
|
|
105
|
+
ignored, so the block falls back to an ordinary deny.
|
|
106
|
+
"""
|
|
107
|
+
try:
|
|
108
|
+
value = callback_result.get("tool_result")
|
|
109
|
+
if isinstance(value, str) and value.strip():
|
|
110
|
+
return value
|
|
111
|
+
except Exception:
|
|
112
|
+
pass
|
|
113
|
+
return None
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def _handled_result_for_blocks(callback_results: list) -> str | None:
|
|
117
|
+
"""Return the handled result when every blocking hook supplied one.
|
|
118
|
+
|
|
119
|
+
``None`` means "treat the blocks as an ordinary deny" -- including when
|
|
120
|
+
any one blocking hook gave no ``tool_result``, so a policy deny from one
|
|
121
|
+
hook is never overridden by another hook's handled result.
|
|
122
|
+
"""
|
|
123
|
+
blocks = [
|
|
124
|
+
result
|
|
125
|
+
for result in callback_results
|
|
126
|
+
if result and isinstance(result, dict) and result.get("blocked")
|
|
127
|
+
]
|
|
128
|
+
handled = [_handled_tool_result(block) for block in blocks]
|
|
129
|
+
if blocks and all(handled):
|
|
130
|
+
return handled[0]
|
|
131
|
+
return None
|
|
132
|
+
|
|
133
|
+
|
|
98
134
|
__all__ = [
|
|
99
135
|
"_block_reason",
|
|
136
|
+
"_handled_result_for_blocks",
|
|
137
|
+
"_handled_tool_result",
|
|
100
138
|
"_normalize_claude_code_tool_name",
|
|
101
139
|
"_tool_args_for_pre_tool_call",
|
|
102
140
|
"_writeback_tool_args",
|
|
@@ -241,6 +241,21 @@ def load_mcp_servers(
|
|
|
241
241
|
return manager.get_servers_for_agent(agent_name=agent_name)
|
|
242
242
|
|
|
243
243
|
|
|
244
|
+
def _with_runtime_mcp_toolsets(agent: Any, mcp_servers: List[Any]) -> List[Any]:
|
|
245
|
+
"""Append the MCP toolsets injected for this agent instance.
|
|
246
|
+
|
|
247
|
+
Embedders (an ACP client's ``mcpServers``) attach these with
|
|
248
|
+
``BaseAgent.set_runtime_mcp_toolsets``. ``--no-tools`` still means no MCP
|
|
249
|
+
toolsets at all.
|
|
250
|
+
"""
|
|
251
|
+
from code_puppy.tools import tools_disabled
|
|
252
|
+
|
|
253
|
+
runtime = getattr(agent, "get_runtime_mcp_toolsets", lambda: [])()
|
|
254
|
+
if not runtime or tools_disabled():
|
|
255
|
+
return mcp_servers
|
|
256
|
+
return list(mcp_servers or []) + list(runtime)
|
|
257
|
+
|
|
258
|
+
|
|
244
259
|
def _iter_autostart_targets(manager: Any, agent_name: str):
|
|
245
260
|
"""Yield ``(server_name, config)`` tuples that need to be auto-started.
|
|
246
261
|
|
|
@@ -650,6 +665,7 @@ def build_pydantic_agent(
|
|
|
650
665
|
)
|
|
651
666
|
prepared = _assemble_instructions(agent, resolved_model_name)
|
|
652
667
|
mcp_servers = load_mcp_servers(agent_name=getattr(agent, "name", None))
|
|
668
|
+
mcp_servers = _with_runtime_mcp_toolsets(agent, mcp_servers)
|
|
653
669
|
model_settings = make_model_settings(
|
|
654
670
|
resolved_model_name,
|
|
655
671
|
overrides=agent.get_model_settings_overrides(),
|
|
@@ -72,6 +72,9 @@ class BaseAgent(ABC):
|
|
|
72
72
|
self._last_model_name: Optional[str] = None
|
|
73
73
|
self._runtime_model_name_override: Optional[str] = None
|
|
74
74
|
self._runtime_system_prompt_additions: List[str] = []
|
|
75
|
+
# MCP toolsets injected by an embedding client (e.g. ACP ``mcpServers``)
|
|
76
|
+
# for this agent instance only; merged on every build.
|
|
77
|
+
self._runtime_mcp_toolsets: List[Any] = []
|
|
75
78
|
# Model chosen by a ``model_select`` hook for the current run. Slots
|
|
76
79
|
# below an explicit runtime override but above pinned/JSON/global, and
|
|
77
80
|
# is reset at the start of every run (see resolve_run_model_selection),
|
|
@@ -303,6 +306,21 @@ class BaseAgent(ABC):
|
|
|
303
306
|
return await run_with_mcp(self, prompt, **kwargs)
|
|
304
307
|
|
|
305
308
|
# ---- MCP integration shims --------------------------------------------
|
|
309
|
+
def get_runtime_mcp_toolsets(self) -> List[Any]:
|
|
310
|
+
"""Return MCP toolsets injected for this agent instance."""
|
|
311
|
+
return list(self._runtime_mcp_toolsets)
|
|
312
|
+
|
|
313
|
+
def set_runtime_mcp_toolsets(self, toolsets: List[Any]) -> None:
|
|
314
|
+
"""Replace this instance's injected MCP toolsets.
|
|
315
|
+
|
|
316
|
+
For embedders that bring their own MCP servers -- an ACP client's
|
|
317
|
+
``mcpServers`` -- rather than ``mcp_servers.json``. They are merged
|
|
318
|
+
with the configured servers on every build, so a rebuild (a model
|
|
319
|
+
switch, a reload) keeps them, and they never touch global bindings or
|
|
320
|
+
other agent instances.
|
|
321
|
+
"""
|
|
322
|
+
self._runtime_mcp_toolsets = list(toolsets)
|
|
323
|
+
|
|
306
324
|
def transform_mcp_toolsets(self, toolsets: List[Any]) -> List[Any]:
|
|
307
325
|
"""Extension seam: post-process resolved MCP toolsets before build.
|
|
308
326
|
|
|
@@ -29,6 +29,7 @@ from typing import Any
|
|
|
29
29
|
|
|
30
30
|
from code_puppy._pydantic_tool_helpers import (
|
|
31
31
|
_block_reason,
|
|
32
|
+
_handled_result_for_blocks,
|
|
32
33
|
_normalize_claude_code_tool_name,
|
|
33
34
|
_tool_args_for_pre_tool_call,
|
|
34
35
|
_writeback_tool_args,
|
|
@@ -67,22 +68,38 @@ def _repair_tool_call_json(raw: str) -> str:
|
|
|
67
68
|
return raw
|
|
68
69
|
|
|
69
70
|
|
|
70
|
-
def
|
|
71
|
-
"""Best-effort lookup of a tool's
|
|
71
|
+
def _resolve_tool_schema(manager: Any, call: Any) -> dict | None:
|
|
72
|
+
"""Best-effort lookup of a tool's full parameters JSON-Schema.
|
|
72
73
|
|
|
73
|
-
Returns the
|
|
74
|
-
|
|
75
|
-
Never raises: this runs on the validation hot
|
|
74
|
+
Returns the schema dict, or ``None`` when the tool (or its schema)
|
|
75
|
+
cannot be resolved — callers must treat ``None`` as "unknown" and
|
|
76
|
+
keep their hands off. Never raises: this runs on the validation hot
|
|
77
|
+
path. Interpreting the keywords is the callers' job; in particular
|
|
78
|
+
an omitted ``properties`` key means the parameter surface is
|
|
79
|
+
*unknown* (free-form args may be legitimate), not "no parameters".
|
|
76
80
|
"""
|
|
77
81
|
try:
|
|
78
82
|
tool_def = manager.get_tool_def(getattr(call, "tool_name", None))
|
|
79
83
|
schema = getattr(tool_def, "parameters_json_schema", None)
|
|
80
|
-
|
|
81
|
-
return properties if isinstance(properties, dict) else None
|
|
84
|
+
return schema if isinstance(schema, dict) else None
|
|
82
85
|
except Exception:
|
|
83
86
|
return None
|
|
84
87
|
|
|
85
88
|
|
|
89
|
+
def _schema_properties(schema: dict | None) -> dict | None:
|
|
90
|
+
"""Declared ``properties`` of a schema, or ``None`` when the schema is
|
|
91
|
+
unresolvable or omits/malforms the key.
|
|
92
|
+
|
|
93
|
+
The ``None``-vs-empty distinction matters: an omitted ``properties`` key
|
|
94
|
+
means the tool's parameter surface is *unknown* (it may accept free-form
|
|
95
|
+
args), which the envelope unwrap's provability gate must not guess past.
|
|
96
|
+
"""
|
|
97
|
+
if not isinstance(schema, dict):
|
|
98
|
+
return None
|
|
99
|
+
properties = schema.get("properties")
|
|
100
|
+
return properties if isinstance(properties, dict) else None
|
|
101
|
+
|
|
102
|
+
|
|
86
103
|
def _unwrap_arguments_envelope(tool_args: Any, properties: dict | None) -> Any:
|
|
87
104
|
"""Collapse a spurious ``{"arguments": {...}}`` envelope into its payload.
|
|
88
105
|
|
|
@@ -94,14 +111,16 @@ def _unwrap_arguments_envelope(tool_args: Any, properties: dict | None) -> Any:
|
|
|
94
111
|
are hit hardest: the model has no real parameter to name, so it emits the
|
|
95
112
|
envelope and every call is rejected with ``extra_forbidden``.
|
|
96
113
|
|
|
97
|
-
Unwraps ONLY when
|
|
98
|
-
|
|
99
|
-
|
|
114
|
+
Unwraps ONLY when the tool's schema resolved and provably declares no
|
|
115
|
+
``arguments`` property — an unresolvable schema, or one that omits
|
|
116
|
+
``properties`` entirely (free-form args may be legitimate, including an
|
|
117
|
+
``arguments`` one), is returned untouched. A declared parameter of that
|
|
118
|
+
name is likewise never clobbered.
|
|
100
119
|
"""
|
|
101
120
|
if not isinstance(tool_args, dict) or list(tool_args) != ["arguments"]:
|
|
102
121
|
return tool_args
|
|
103
|
-
if isinstance(properties, dict)
|
|
104
|
-
return tool_args # a real parameter -- hands off
|
|
122
|
+
if not isinstance(properties, dict) or "arguments" in properties:
|
|
123
|
+
return tool_args # unproven, or a real parameter -- hands off
|
|
105
124
|
|
|
106
125
|
inner = tool_args["arguments"]
|
|
107
126
|
if isinstance(inner, str):
|
|
@@ -109,23 +128,124 @@ def _unwrap_arguments_envelope(tool_args: Any, properties: dict | None) -> Any:
|
|
|
109
128
|
inner = json.loads(inner)
|
|
110
129
|
except Exception:
|
|
111
130
|
return tool_args
|
|
131
|
+
if isinstance(inner, dict):
|
|
132
|
+
logger.debug("unwrapped spurious {arguments: ...} tool-call envelope")
|
|
112
133
|
return inner if isinstance(inner, dict) else tool_args
|
|
113
134
|
|
|
114
135
|
|
|
136
|
+
def _is_strict_zero_param_schema(schema: Any) -> bool:
|
|
137
|
+
"""True when ``schema`` provably accepts no arguments at all.
|
|
138
|
+
|
|
139
|
+
Requires a resolved schema whose ``type`` admits objects (``"object"``
|
|
140
|
+
or a type list containing it; an absent ``type`` constrains nothing, and
|
|
141
|
+
tool-call arguments are objects by construction) and which declares no
|
|
142
|
+
properties while *forbidding* additional ones. ``additionalProperties``
|
|
143
|
+
must be literally ``false``: absent means "allow extras" (the JSON-Schema
|
|
144
|
+
default) and a dict value means "allow, constrained" — either way the
|
|
145
|
+
tool may legitimately receive free-form args, and stripping would
|
|
146
|
+
destroy them.
|
|
147
|
+
"""
|
|
148
|
+
if not isinstance(schema, dict):
|
|
149
|
+
return False
|
|
150
|
+
declared_type = schema.get("type", "object")
|
|
151
|
+
types = declared_type if isinstance(declared_type, list) else [declared_type]
|
|
152
|
+
if "object" not in types:
|
|
153
|
+
return False
|
|
154
|
+
if _schema_properties(schema):
|
|
155
|
+
return False
|
|
156
|
+
return schema.get("additionalProperties") is False
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def _strip_placeholder_args(
|
|
160
|
+
tool_args: Any, schema: dict | None, tool_name: str | None
|
|
161
|
+
) -> Any:
|
|
162
|
+
"""Drop invented keys from a call to a zero-parameter tool.
|
|
163
|
+
|
|
164
|
+
Some providers cannot serialize an empty function-call arguments object
|
|
165
|
+
and inject a placeholder key instead — observed in the wild:
|
|
166
|
+
``{"command": "list_agents"}``, ``{"city": "ignore"}``, ``{"dummy": "x"}``.
|
|
167
|
+
Each one hard-fails validation with ``extra_forbidden`` while the model
|
|
168
|
+
insists it sent ``{}``, so the agent burns retries on an error it cannot
|
|
169
|
+
see to fix.
|
|
170
|
+
|
|
171
|
+
Fires only when :func:`_is_strict_zero_param_schema` says the schema
|
|
172
|
+
resolved and forbids every argument — under that contract any non-empty
|
|
173
|
+
argument object is junk (including non-dict ``arguments``-envelope
|
|
174
|
+
payloads, which validation would reject anyway) and is replaced with
|
|
175
|
+
``{}``. Everything else — unresolvable schemas, permissive schemas,
|
|
176
|
+
tools with declared properties — is returned untouched, so a legitimate
|
|
177
|
+
or merely confused call is never masked.
|
|
178
|
+
"""
|
|
179
|
+
if not isinstance(tool_args, dict) or not tool_args:
|
|
180
|
+
return tool_args
|
|
181
|
+
if not _is_strict_zero_param_schema(schema):
|
|
182
|
+
return tool_args
|
|
183
|
+
_log_placeholder_strip(tool_args, tool_name)
|
|
184
|
+
return {}
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
# (tool name, junk signature) pairs already warned at WARNING level; the
|
|
188
|
+
# providers that inject placeholder args do it on *every* zero-param call,
|
|
189
|
+
# so an identical repeat drops to DEBUG — while a *new* quirk on the same
|
|
190
|
+
# tool still surfaces at WARNING. Bounded: signatures use the same 200-char
|
|
191
|
+
# bound as the log line (visually identical repeats dedup identically) and
|
|
192
|
+
# the set stops growing at the cap rather than leaking per-call memory.
|
|
193
|
+
_PLACEHOLDER_WARNED_KEYS: set[tuple[str, str]] = set()
|
|
194
|
+
_PLACEHOLDER_WARNED_KEYS_MAX = 512
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def _log_placeholder_strip(tool_args: dict, tool_name: str | None) -> None:
|
|
198
|
+
"""One WARNING per (tool, quirk), then DEBUG for identical repeats —
|
|
199
|
+
with the payload that identifies the provider quirk, bounded so a junk
|
|
200
|
+
dict cannot flood the log. Cannot raise, even for repr-hostile values."""
|
|
201
|
+
try:
|
|
202
|
+
payload = json.dumps(tool_args, sort_keys=True, default=str)
|
|
203
|
+
except Exception: # mixed-type keys defeat sort_keys; repr is the fallback
|
|
204
|
+
try:
|
|
205
|
+
payload = repr(tool_args)
|
|
206
|
+
except Exception: # never let logging break the validation hot path
|
|
207
|
+
payload = "<unrepr-able args>"
|
|
208
|
+
tool_key = tool_name or "<unknown>"
|
|
209
|
+
if len(_PLACEHOLDER_WARNED_KEYS) >= _PLACEHOLDER_WARNED_KEYS_MAX:
|
|
210
|
+
log = logger.warning # set full: never silently dedup a new quirk
|
|
211
|
+
else:
|
|
212
|
+
key = (tool_key, payload[:200])
|
|
213
|
+
log = logger.debug if key in _PLACEHOLDER_WARNED_KEYS else logger.warning
|
|
214
|
+
_PLACEHOLDER_WARNED_KEYS.add(key)
|
|
215
|
+
log(
|
|
216
|
+
"dropping placeholder args %.200s for zero-parameter tool %r "
|
|
217
|
+
"(provider cannot serialize an empty arguments object)",
|
|
218
|
+
payload,
|
|
219
|
+
tool_key,
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def _sanitize_args(tool_args: Any, schema: dict | None, tool_name: str | None) -> Any:
|
|
224
|
+
"""Envelope-unwrap then placeholder-strip; identity when untouched."""
|
|
225
|
+
return _strip_placeholder_args(
|
|
226
|
+
_unwrap_arguments_envelope(tool_args, _schema_properties(schema)),
|
|
227
|
+
schema,
|
|
228
|
+
tool_name,
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
|
|
115
232
|
def _sanitize_tool_call_args(manager: Any, call: Any) -> None:
|
|
116
|
-
"""Rewrite ``call.args`` in place
|
|
233
|
+
"""Rewrite ``call.args`` in place to survive strict validation.
|
|
117
234
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
235
|
+
Two malformations are handled, for dict and JSON-string shapes alike
|
|
236
|
+
(a string is re-serialized to preserve the original shape): the spurious
|
|
237
|
+
``{"arguments": ...}`` envelope, and placeholder keys invented for a
|
|
238
|
+
zero-parameter tool. Invalid JSON strings are left for
|
|
239
|
+
:func:`_repair_tool_call_json`.
|
|
121
240
|
"""
|
|
122
241
|
args = getattr(call, "args", None)
|
|
123
|
-
|
|
242
|
+
schema = _resolve_tool_schema(manager, call)
|
|
243
|
+
tool_name = getattr(call, "tool_name", None)
|
|
124
244
|
|
|
125
245
|
if isinstance(args, dict):
|
|
126
|
-
|
|
127
|
-
if
|
|
128
|
-
call.args =
|
|
246
|
+
sanitized = _sanitize_args(args, schema, tool_name)
|
|
247
|
+
if sanitized is not args:
|
|
248
|
+
call.args = sanitized
|
|
129
249
|
elif isinstance(args, str) and args:
|
|
130
250
|
try:
|
|
131
251
|
parsed = json.loads(args)
|
|
@@ -133,9 +253,9 @@ def _sanitize_tool_call_args(manager: Any, call: Any) -> None:
|
|
|
133
253
|
return
|
|
134
254
|
if not isinstance(parsed, dict):
|
|
135
255
|
return
|
|
136
|
-
|
|
137
|
-
if
|
|
138
|
-
call.args = json.dumps(
|
|
256
|
+
sanitized = _sanitize_args(parsed, schema, tool_name)
|
|
257
|
+
if sanitized is not parsed:
|
|
258
|
+
call.args = json.dumps(sanitized)
|
|
139
259
|
|
|
140
260
|
|
|
141
261
|
# Loud failures recorded during the current apply_all_patches() run, so the
|
|
@@ -489,6 +609,11 @@ def patch_tool_call_callbacks() -> bool:
|
|
|
489
609
|
if isinstance(ctx_msg, str) and ctx_msg.strip():
|
|
490
610
|
hook_context_messages.append(ctx_msg.strip())
|
|
491
611
|
|
|
612
|
+
# A hook that handled the call itself returns the tool's result.
|
|
613
|
+
handled_result = _handled_result_for_blocks(callback_results)
|
|
614
|
+
if handled_result is not None:
|
|
615
|
+
return handled_result
|
|
616
|
+
|
|
492
617
|
for callback_result in callback_results:
|
|
493
618
|
if (
|
|
494
619
|
callback_result
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/load_context_completion.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/catalog_server_installer.py
RENAMED
|
File without changes
|
|
File without changes
|
{code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/custom_server_installer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{code_puppy-0.0.905 → code_puppy-0.0.907}/code_puppy/command_line/mcp/silence_warning_command.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|