code-puppy-core-plugins 0.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- code_puppy_core_plugins/__init__.py +5 -0
- code_puppy_core_plugins/acp/README.md +266 -0
- code_puppy_core_plugins/acp/__init__.py +8 -0
- code_puppy_core_plugins/acp/agent.py +494 -0
- code_puppy_core_plugins/acp/bridge.py +309 -0
- code_puppy_core_plugins/acp/capabilities.py +73 -0
- code_puppy_core_plugins/acp/commands.py +116 -0
- code_puppy_core_plugins/acp/content.py +115 -0
- code_puppy_core_plugins/acp/io_delegation.py +231 -0
- code_puppy_core_plugins/acp/mcp_config.py +66 -0
- code_puppy_core_plugins/acp/permissions.py +159 -0
- code_puppy_core_plugins/acp/persistence.py +197 -0
- code_puppy_core_plugins/acp/register_callbacks.py +110 -0
- code_puppy_core_plugins/acp/replay.py +114 -0
- code_puppy_core_plugins/acp/session.py +329 -0
- code_puppy_core_plugins/acp/session_config.py +179 -0
- code_puppy_core_plugins/acp/state.py +135 -0
- code_puppy_core_plugins/agent_skills/__init__.py +22 -0
- code_puppy_core_plugins/agent_skills/config.py +208 -0
- code_puppy_core_plugins/agent_skills/discovery.py +337 -0
- code_puppy_core_plugins/agent_skills/downloader.py +392 -0
- code_puppy_core_plugins/agent_skills/enabled_skills.py +82 -0
- code_puppy_core_plugins/agent_skills/installer.py +22 -0
- code_puppy_core_plugins/agent_skills/metadata.py +219 -0
- code_puppy_core_plugins/agent_skills/prompt_builder.py +49 -0
- code_puppy_core_plugins/agent_skills/provider.py +52 -0
- code_puppy_core_plugins/agent_skills/register_callbacks.py +309 -0
- code_puppy_core_plugins/agent_skills/remote_catalog.py +322 -0
- code_puppy_core_plugins/agent_skills/skill_catalog.py +257 -0
- code_puppy_core_plugins/agent_skills/skill_commands.py +102 -0
- code_puppy_core_plugins/agent_skills/skills_install_menu.py +698 -0
- code_puppy_core_plugins/agent_skills/skills_menu.py +794 -0
- code_puppy_core_plugins/aws_bedrock/__init__.py +14 -0
- code_puppy_core_plugins/aws_bedrock/config.py +101 -0
- code_puppy_core_plugins/aws_bedrock/register_callbacks.py +243 -0
- code_puppy_core_plugins/aws_bedrock/utils.py +186 -0
- code_puppy_core_plugins/azure_foundry/README.md +238 -0
- code_puppy_core_plugins/azure_foundry/__init__.py +15 -0
- code_puppy_core_plugins/azure_foundry/config.py +126 -0
- code_puppy_core_plugins/azure_foundry/discovery.py +189 -0
- code_puppy_core_plugins/azure_foundry/register_callbacks.py +506 -0
- code_puppy_core_plugins/azure_foundry/token.py +182 -0
- code_puppy_core_plugins/azure_foundry/utils.py +375 -0
- code_puppy_core_plugins/btw/__init__.py +1 -0
- code_puppy_core_plugins/btw/inline_view.py +135 -0
- code_puppy_core_plugins/btw/register_callbacks.py +106 -0
- code_puppy_core_plugins/btw/side_query.py +91 -0
- code_puppy_core_plugins/chatgpt_oauth/IMAGEGEN_SKILL.md +83 -0
- code_puppy_core_plugins/chatgpt_oauth/__init__.py +8 -0
- code_puppy_core_plugins/chatgpt_oauth/config.py +52 -0
- code_puppy_core_plugins/chatgpt_oauth/image_generation.py +253 -0
- code_puppy_core_plugins/chatgpt_oauth/image_tool.py +70 -0
- code_puppy_core_plugins/chatgpt_oauth/oauth_flow.py +461 -0
- code_puppy_core_plugins/chatgpt_oauth/register_callbacks.py +288 -0
- code_puppy_core_plugins/chatgpt_oauth/test_plugin.py +663 -0
- code_puppy_core_plugins/chatgpt_oauth/usage.py +113 -0
- code_puppy_core_plugins/chatgpt_oauth/utils.py +534 -0
- code_puppy_core_plugins/claude_code_hooks/__init__.py +1 -0
- code_puppy_core_plugins/claude_code_hooks/config.py +137 -0
- code_puppy_core_plugins/claude_code_hooks/register_callbacks.py +383 -0
- code_puppy_core_plugins/claude_code_oauth/README.md +167 -0
- code_puppy_core_plugins/claude_code_oauth/SETUP.md +93 -0
- code_puppy_core_plugins/claude_code_oauth/__init__.py +25 -0
- code_puppy_core_plugins/claude_code_oauth/config.py +59 -0
- code_puppy_core_plugins/claude_code_oauth/fast_mode.py +122 -0
- code_puppy_core_plugins/claude_code_oauth/prompt_handler.py +64 -0
- code_puppy_core_plugins/claude_code_oauth/register_callbacks.py +719 -0
- code_puppy_core_plugins/claude_code_oauth/test_plugin.py +285 -0
- code_puppy_core_plugins/claude_code_oauth/token_refresh_heartbeat.py +240 -0
- code_puppy_core_plugins/claude_code_oauth/utils.py +663 -0
- code_puppy_core_plugins/code_puppy_agent/AGENTS_AND_TOOLS.md +155 -0
- code_puppy_core_plugins/code_puppy_agent/MODELS_AND_MCP.md +104 -0
- code_puppy_core_plugins/code_puppy_agent/PLUGINS_AND_CALLBACKS.md +147 -0
- code_puppy_core_plugins/code_puppy_agent/SESSIONS_AND_HISTORY.md +39 -0
- code_puppy_core_plugins/code_puppy_agent/SKILL.md +180 -0
- code_puppy_core_plugins/code_puppy_agent/SKILLS_SYSTEM.md +136 -0
- code_puppy_core_plugins/code_puppy_agent/SYSTEM_PROMPT_CONFIG_AND_I18N.md +160 -0
- code_puppy_core_plugins/code_puppy_agent/__init__.py +5 -0
- code_puppy_core_plugins/code_puppy_agent/register_callbacks.py +46 -0
- code_puppy_core_plugins/computer_use/NativeCapture.swift +123 -0
- code_puppy_core_plugins/computer_use/README.md +109 -0
- code_puppy_core_plugins/computer_use/__init__.py +1 -0
- code_puppy_core_plugins/computer_use/accessibility.py +163 -0
- code_puppy_core_plugins/computer_use/activation.py +75 -0
- code_puppy_core_plugins/computer_use/backend.py +584 -0
- code_puppy_core_plugins/computer_use/backend_types.py +5 -0
- code_puppy_core_plugins/computer_use/capture.py +110 -0
- code_puppy_core_plugins/computer_use/commands.py +62 -0
- code_puppy_core_plugins/computer_use/geometry.py +81 -0
- code_puppy_core_plugins/computer_use/inline_image.py +56 -0
- code_puppy_core_plugins/computer_use/keycodes.py +47 -0
- code_puppy_core_plugins/computer_use/policy.py +144 -0
- code_puppy_core_plugins/computer_use/register_callbacks.py +96 -0
- code_puppy_core_plugins/computer_use/safety.py +18 -0
- code_puppy_core_plugins/computer_use/settle.py +64 -0
- code_puppy_core_plugins/computer_use/state.py +86 -0
- code_puppy_core_plugins/computer_use/tools.py +469 -0
- code_puppy_core_plugins/context_indicator/__init__.py +14 -0
- code_puppy_core_plugins/context_indicator/register_callbacks.py +249 -0
- code_puppy_core_plugins/context_indicator/usage.py +40 -0
- code_puppy_core_plugins/copilot_auth/__init__.py +11 -0
- code_puppy_core_plugins/copilot_auth/config.py +93 -0
- code_puppy_core_plugins/copilot_auth/reasoning_client.py +409 -0
- code_puppy_core_plugins/copilot_auth/register_callbacks.py +460 -0
- code_puppy_core_plugins/copilot_auth/utils.py +587 -0
- code_puppy_core_plugins/customizable_commands/__init__.py +0 -0
- code_puppy_core_plugins/customizable_commands/register_callbacks.py +464 -0
- code_puppy_core_plugins/dbos_durable_exec/__init__.py +1 -0
- code_puppy_core_plugins/dbos_durable_exec/cancel.py +15 -0
- code_puppy_core_plugins/dbos_durable_exec/commands.py +31 -0
- code_puppy_core_plugins/dbos_durable_exec/config.py +31 -0
- code_puppy_core_plugins/dbos_durable_exec/lifecycle.py +83 -0
- code_puppy_core_plugins/dbos_durable_exec/register_callbacks.py +45 -0
- code_puppy_core_plugins/dbos_durable_exec/runtime.py +65 -0
- code_puppy_core_plugins/dbos_durable_exec/startup_lock.py +155 -0
- code_puppy_core_plugins/dbos_durable_exec/workflow_ids.py +16 -0
- code_puppy_core_plugins/dbos_durable_exec/wrapper.py +58 -0
- code_puppy_core_plugins/destructive_command_guard/AGENTS.md +79 -0
- code_puppy_core_plugins/destructive_command_guard/__init__.py +14 -0
- code_puppy_core_plugins/destructive_command_guard/detector.py +374 -0
- code_puppy_core_plugins/destructive_command_guard/register_callbacks.py +165 -0
- code_puppy_core_plugins/emoji_filter/__init__.py +12 -0
- code_puppy_core_plugins/emoji_filter/config.py +26 -0
- code_puppy_core_plugins/emoji_filter/register_callbacks.py +238 -0
- code_puppy_core_plugins/emoji_filter/stripper.py +45 -0
- code_puppy_core_plugins/empty_html_comment_filter/register_callbacks.py +116 -0
- code_puppy_core_plugins/example_custom_command/README.md +328 -0
- code_puppy_core_plugins/example_custom_command/register_callbacks.py +66 -0
- code_puppy_core_plugins/file_permission_handler/__init__.py +4 -0
- code_puppy_core_plugins/file_permission_handler/register_callbacks.py +575 -0
- code_puppy_core_plugins/flux_bootstrap/__init__.py +5 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/_docs/README.md +173 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/_docs/cheatsheet.md +86 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/_docs/pipeline.md +167 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/_docs/synopsis.md +392 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/about.md +51 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/address-feedback.md +129 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/ask.md +211 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/aug.md +181 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/auto-pilot.md +71 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/cheatsheet.md +16 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/commit.md +103 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/config.md +108 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/create-pr.md +195 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/exec.md +221 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/new.md +151 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/qa.md +208 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/rebase.md +180 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/review.md +304 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/split.md +120 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/squash-commits.md +179 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/status.md +46 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/tests.md +155 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/scripts/flux_about.py +154 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/scripts/flux_cheatsheet.py +248 -0
- code_puppy_core_plugins/flux_bootstrap/bundled/scripts/flux_status.py +345 -0
- code_puppy_core_plugins/flux_bootstrap/installer.py +256 -0
- code_puppy_core_plugins/flux_bootstrap/register_callbacks.py +71 -0
- code_puppy_core_plugins/force_push_guard/__init__.py +5 -0
- code_puppy_core_plugins/force_push_guard/detector.py +96 -0
- code_puppy_core_plugins/force_push_guard/register_callbacks.py +161 -0
- code_puppy_core_plugins/fork/__init__.py +7 -0
- code_puppy_core_plugins/fork/register_callbacks.py +445 -0
- code_puppy_core_plugins/frontend_emitter/__init__.py +25 -0
- code_puppy_core_plugins/frontend_emitter/emitter.py +249 -0
- code_puppy_core_plugins/frontend_emitter/register_callbacks.py +412 -0
- code_puppy_core_plugins/frontend_emitter/session_context.py +50 -0
- code_puppy_core_plugins/grok_oauth/__init__.py +6 -0
- code_puppy_core_plugins/grok_oauth/config.py +49 -0
- code_puppy_core_plugins/grok_oauth/oauth_flow.py +213 -0
- code_puppy_core_plugins/grok_oauth/register_callbacks.py +132 -0
- code_puppy_core_plugins/grok_oauth/utils.py +195 -0
- code_puppy_core_plugins/herdr/README.md +168 -0
- code_puppy_core_plugins/herdr/__init__.py +9 -0
- code_puppy_core_plugins/herdr/client.py +339 -0
- code_puppy_core_plugins/herdr/register_callbacks.py +140 -0
- code_puppy_core_plugins/herdr/reporter.py +212 -0
- code_puppy_core_plugins/herdr/smoke.py +143 -0
- code_puppy_core_plugins/herdr/sources.py +133 -0
- code_puppy_core_plugins/hook_creator/__init__.py +1 -0
- code_puppy_core_plugins/hook_creator/register_callbacks.py +33 -0
- code_puppy_core_plugins/hook_manager/__init__.py +1 -0
- code_puppy_core_plugins/hook_manager/config.py +290 -0
- code_puppy_core_plugins/hook_manager/hooks_menu.py +571 -0
- code_puppy_core_plugins/hook_manager/register_callbacks.py +227 -0
- code_puppy_core_plugins/meta_oauth/__init__.py +1 -0
- code_puppy_core_plugins/meta_oauth/config.py +55 -0
- code_puppy_core_plugins/meta_oauth/oauth_flow.py +109 -0
- code_puppy_core_plugins/meta_oauth/register_callbacks.py +154 -0
- code_puppy_core_plugins/meta_oauth/utils.py +252 -0
- code_puppy_core_plugins/namespace_skill_search/README.md +118 -0
- code_puppy_core_plugins/namespace_skill_search/__init__.py +15 -0
- code_puppy_core_plugins/namespace_skill_search/namespaces.py +125 -0
- code_puppy_core_plugins/namespace_skill_search/register_callbacks.py +99 -0
- code_puppy_core_plugins/namespace_skill_search/search_tool.py +158 -0
- code_puppy_core_plugins/no_tools/__init__.py +0 -0
- code_puppy_core_plugins/no_tools/register_callbacks.py +42 -0
- code_puppy_core_plugins/oauth_pasteback.py +110 -0
- code_puppy_core_plugins/oauth_puppy_html.py +194 -0
- code_puppy_core_plugins/obsidian_agent/README.md +52 -0
- code_puppy_core_plugins/obsidian_agent/__init__.py +8 -0
- code_puppy_core_plugins/obsidian_agent/agent_obsidian.py +147 -0
- code_puppy_core_plugins/obsidian_agent/register_callbacks.py +13 -0
- code_puppy_core_plugins/ollama/__init__.py +1 -0
- code_puppy_core_plugins/ollama/register_callbacks.py +127 -0
- code_puppy_core_plugins/ollama_setup/__init__.py +5 -0
- code_puppy_core_plugins/ollama_setup/completer.py +38 -0
- code_puppy_core_plugins/ollama_setup/register_callbacks.py +419 -0
- code_puppy_core_plugins/plugin_list/__init__.py +0 -0
- code_puppy_core_plugins/plugin_list/plugin_contributions.py +348 -0
- code_puppy_core_plugins/plugin_list/plugin_meta.py +67 -0
- code_puppy_core_plugins/plugin_list/plugin_text_utils.py +173 -0
- code_puppy_core_plugins/plugin_list/plugins_menu.py +455 -0
- code_puppy_core_plugins/plugin_list/plugins_menu_layout.py +194 -0
- code_puppy_core_plugins/plugin_list/plugins_menu_render.py +431 -0
- code_puppy_core_plugins/plugin_list/project_trust_flow.py +162 -0
- code_puppy_core_plugins/plugin_list/register_callbacks.py +281 -0
- code_puppy_core_plugins/pop_command/__init__.py +1 -0
- code_puppy_core_plugins/pop_command/register_callbacks.py +191 -0
- code_puppy_core_plugins/prompt_newline/__init__.py +13 -0
- code_puppy_core_plugins/prompt_newline/config.py +21 -0
- code_puppy_core_plugins/prompt_newline/register_callbacks.py +163 -0
- code_puppy_core_plugins/prune/__init__.py +1 -0
- code_puppy_core_plugins/prune/prune_menu.py +308 -0
- code_puppy_core_plugins/prune/prune_model.py +517 -0
- code_puppy_core_plugins/prune/prune_render.py +354 -0
- code_puppy_core_plugins/prune/register_callbacks.py +388 -0
- code_puppy_core_plugins/puppy_kennel/README.md +203 -0
- code_puppy_core_plugins/puppy_kennel/__init__.py +6 -0
- code_puppy_core_plugins/puppy_kennel/commands.py +206 -0
- code_puppy_core_plugins/puppy_kennel/config.py +36 -0
- code_puppy_core_plugins/puppy_kennel/kennel.py +368 -0
- code_puppy_core_plugins/puppy_kennel/packer.py +152 -0
- code_puppy_core_plugins/puppy_kennel/recorder.py +83 -0
- code_puppy_core_plugins/puppy_kennel/register_callbacks.py +109 -0
- code_puppy_core_plugins/puppy_kennel/retriever.py +28 -0
- code_puppy_core_plugins/puppy_kennel/schema.py +78 -0
- code_puppy_core_plugins/puppy_kennel/state.py +68 -0
- code_puppy_core_plugins/puppy_kennel/tools.py +449 -0
- code_puppy_core_plugins/puppy_kennel/wings.py +110 -0
- code_puppy_core_plugins/puppy_spinner/README.md +93 -0
- code_puppy_core_plugins/puppy_spinner/__init__.py +11 -0
- code_puppy_core_plugins/puppy_spinner/builtin_frames.py +172 -0
- code_puppy_core_plugins/puppy_spinner/commands.py +116 -0
- code_puppy_core_plugins/puppy_spinner/picker.py +379 -0
- code_puppy_core_plugins/puppy_spinner/register_callbacks.py +193 -0
- code_puppy_core_plugins/puppy_spinner/spinners.py +444 -0
- code_puppy_core_plugins/quick_resume/__init__.py +0 -0
- code_puppy_core_plugins/quick_resume/register_callbacks.py +77 -0
- code_puppy_core_plugins/review_pr/__init__.py +1 -0
- code_puppy_core_plugins/review_pr/register_callbacks.py +162 -0
- code_puppy_core_plugins/shell_safety/__init__.py +6 -0
- code_puppy_core_plugins/shell_safety/agent_shell_safety.py +69 -0
- code_puppy_core_plugins/shell_safety/command_cache.py +156 -0
- code_puppy_core_plugins/shell_safety/register_callbacks.py +203 -0
- code_puppy_core_plugins/stack_dump/__init__.py +1 -0
- code_puppy_core_plugins/stack_dump/register_callbacks.py +79 -0
- code_puppy_core_plugins/statusline/__init__.py +14 -0
- code_puppy_core_plugins/statusline/config.py +68 -0
- code_puppy_core_plugins/statusline/payload.py +138 -0
- code_puppy_core_plugins/statusline/prompt_patch.py +76 -0
- code_puppy_core_plugins/statusline/register_callbacks.py +45 -0
- code_puppy_core_plugins/statusline/runner.py +122 -0
- code_puppy_core_plugins/statusline/statusline_command.py +197 -0
- code_puppy_core_plugins/steer_queue/__init__.py +10 -0
- code_puppy_core_plugins/steer_queue/queue_menu.py +444 -0
- code_puppy_core_plugins/steer_queue/register_callbacks.py +138 -0
- code_puppy_core_plugins/subagent_panel/README.md +102 -0
- code_puppy_core_plugins/subagent_panel/__init__.py +24 -0
- code_puppy_core_plugins/subagent_panel/coalesce_patch.py +242 -0
- code_puppy_core_plugins/subagent_panel/panel_render.py +145 -0
- code_puppy_core_plugins/subagent_panel/register_callbacks.py +535 -0
- code_puppy_core_plugins/subagent_panel/resume_repaint.py +112 -0
- code_puppy_core_plugins/subagent_panel/state.py +231 -0
- code_puppy_core_plugins/switch_agent_resume/__init__.py +5 -0
- code_puppy_core_plugins/switch_agent_resume/register_callbacks.py +314 -0
- code_puppy_core_plugins/theme/README.md +86 -0
- code_puppy_core_plugins/theme/__init__.py +14 -0
- code_puppy_core_plugins/theme/bundled_palettes.py +346 -0
- code_puppy_core_plugins/theme/content_styles.py +146 -0
- code_puppy_core_plugins/theme/osc_palette.py +178 -0
- code_puppy_core_plugins/theme/picker.py +358 -0
- code_puppy_core_plugins/theme/prompt_toolkit_theme.py +113 -0
- code_puppy_core_plugins/theme/register_callbacks.py +348 -0
- code_puppy_core_plugins/theme/rich_themes.py +202 -0
- code_puppy_core_plugins/theme/themes.py +720 -0
- code_puppy_core_plugins/timestamp_heartbeat/__init__.py +1 -0
- code_puppy_core_plugins/timestamp_heartbeat/register_callbacks.py +114 -0
- code_puppy_core_plugins/token_ratio_learner/__init__.py +5 -0
- code_puppy_core_plugins/token_ratio_learner/ratios.py +208 -0
- code_puppy_core_plugins/token_ratio_learner/register_callbacks.py +213 -0
- code_puppy_core_plugins/universal_constructor/__init__.py +13 -0
- code_puppy_core_plugins/universal_constructor/models.py +138 -0
- code_puppy_core_plugins/universal_constructor/provider.py +62 -0
- code_puppy_core_plugins/universal_constructor/register_callbacks.py +75 -0
- code_puppy_core_plugins/universal_constructor/registry.py +302 -0
- code_puppy_core_plugins/universal_constructor/sandbox.py +584 -0
- code_puppy_core_plugins/wide_completion_menu/__init__.py +6 -0
- code_puppy_core_plugins/wide_completion_menu/register_callbacks.py +165 -0
- code_puppy_core_plugins/wiggum/__init__.py +1 -0
- code_puppy_core_plugins/wiggum/goal_runs.py +91 -0
- code_puppy_core_plugins/wiggum/judge.py +299 -0
- code_puppy_core_plugins/wiggum/judge_config.py +249 -0
- code_puppy_core_plugins/wiggum/judges_menu.py +814 -0
- code_puppy_core_plugins/wiggum/register_callbacks.py +569 -0
- code_puppy_core_plugins/wiggum/state.py +89 -0
- code_puppy_core_plugins/yolo_cli/__init__.py +1 -0
- code_puppy_core_plugins/yolo_cli/register_callbacks.py +41 -0
- code_puppy_core_plugins-0.0.2.dist-info/METADATA +64 -0
- code_puppy_core_plugins-0.0.2.dist-info/RECORD +313 -0
- code_puppy_core_plugins-0.0.2.dist-info/WHEEL +4 -0
- code_puppy_core_plugins-0.0.2.dist-info/entry_points.txt +55 -0
- code_puppy_core_plugins-0.0.2.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
"""Pydantic-AI registrations for the macOS computer-use backend."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import asyncio
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Any, Callable
|
|
8
|
+
|
|
9
|
+
from pydantic_ai import BinaryContent, RunContext, ToolReturn
|
|
10
|
+
|
|
11
|
+
from .backend import ComputerUseError, backend
|
|
12
|
+
from .inline_image import emit_inline_image
|
|
13
|
+
from .settle import wait_for_ui_settle
|
|
14
|
+
|
|
15
|
+
MAX_BATCH_STEPS = 20
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
async def _call(func: Callable[..., dict[str, Any]], *args: Any, **kwargs: Any):
|
|
19
|
+
try:
|
|
20
|
+
return await asyncio.to_thread(func, *args, **kwargs)
|
|
21
|
+
except ComputerUseError as exc:
|
|
22
|
+
return {"success": False, "error": str(exc)}
|
|
23
|
+
except Exception as exc:
|
|
24
|
+
return {"success": False, "error": f"Computer Use failed: {exc}"}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def register_get_app_state(agent):
|
|
28
|
+
@agent.tool
|
|
29
|
+
async def computer_get_app_state(
|
|
30
|
+
context: RunContext,
|
|
31
|
+
app_name: str,
|
|
32
|
+
max_nodes: int = 100,
|
|
33
|
+
show_screenshot: bool = True,
|
|
34
|
+
) -> Any:
|
|
35
|
+
"""Get one revisioned screenshot and accessibility tree for an app.
|
|
36
|
+
|
|
37
|
+
Call this once per turn and after every standalone mutation. All action
|
|
38
|
+
tools require the returned state_revision and reject stale state.
|
|
39
|
+
"""
|
|
40
|
+
del context
|
|
41
|
+
result = await _call(backend.get_app_state, app_name, max_nodes)
|
|
42
|
+
if not result.get("success") or not show_screenshot:
|
|
43
|
+
return result
|
|
44
|
+
return _state_tool_return(result, "macOS app state")
|
|
45
|
+
|
|
46
|
+
return computer_get_app_state
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def register_snapshot(agent):
|
|
50
|
+
@agent.tool
|
|
51
|
+
async def computer_snapshot(
|
|
52
|
+
context: RunContext,
|
|
53
|
+
app_name: str | None = None,
|
|
54
|
+
max_nodes: int = 100,
|
|
55
|
+
show_screenshot: bool = True,
|
|
56
|
+
) -> Any:
|
|
57
|
+
"""Inspect a macOS application's accessibility tree.
|
|
58
|
+
|
|
59
|
+
Call this before acting and again after navigation. Returned element IDs
|
|
60
|
+
are invalidated by the next snapshot. By default, also capture and show
|
|
61
|
+
a compact inline screenshot in Ghostty, Kitty, WezTerm, or iTerm2.
|
|
62
|
+
"""
|
|
63
|
+
del context
|
|
64
|
+
if app_name:
|
|
65
|
+
result = await _call(backend.get_app_state, app_name, max_nodes)
|
|
66
|
+
if not result.get("success") or not show_screenshot:
|
|
67
|
+
return result
|
|
68
|
+
return _state_tool_return(result, "macOS accessibility snapshot")
|
|
69
|
+
return await _call(backend.snapshot, None, max_nodes)
|
|
70
|
+
|
|
71
|
+
return computer_snapshot
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def register_click(agent):
|
|
75
|
+
@agent.tool
|
|
76
|
+
async def computer_click(
|
|
77
|
+
context: RunContext,
|
|
78
|
+
state_revision: str,
|
|
79
|
+
element_id: int | None = None,
|
|
80
|
+
x: float | None = None,
|
|
81
|
+
y: float | None = None,
|
|
82
|
+
button: str = "left",
|
|
83
|
+
click_count: int = 1,
|
|
84
|
+
) -> dict[str, Any]:
|
|
85
|
+
"""Click by element ID or screenshot-pixel coordinates.
|
|
86
|
+
|
|
87
|
+
Exactly one target form is required: element_id, or both x and y from
|
|
88
|
+
the screenshot associated with state_revision.
|
|
89
|
+
"""
|
|
90
|
+
del context
|
|
91
|
+
if element_id is not None and x is None and y is None:
|
|
92
|
+
return await _call(backend.click, state_revision, element_id)
|
|
93
|
+
if element_id is None and x is not None and y is not None:
|
|
94
|
+
return await _call(
|
|
95
|
+
backend.click_pixel,
|
|
96
|
+
state_revision,
|
|
97
|
+
x,
|
|
98
|
+
y,
|
|
99
|
+
button,
|
|
100
|
+
click_count,
|
|
101
|
+
)
|
|
102
|
+
return {
|
|
103
|
+
"success": False,
|
|
104
|
+
"error": "Provide element_id or both x and y, but not both target forms.",
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return computer_click
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def register_set_value(agent):
|
|
111
|
+
@agent.tool
|
|
112
|
+
async def computer_set_value(
|
|
113
|
+
context: RunContext,
|
|
114
|
+
state_revision: str,
|
|
115
|
+
element_id: int,
|
|
116
|
+
value: str,
|
|
117
|
+
) -> dict[str, Any]:
|
|
118
|
+
"""Set the value of an accessible text field or control."""
|
|
119
|
+
del context
|
|
120
|
+
return await _call(backend.set_value, state_revision, element_id, value)
|
|
121
|
+
|
|
122
|
+
return computer_set_value
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def register_perform_action(agent):
|
|
126
|
+
@agent.tool
|
|
127
|
+
async def computer_perform_action(
|
|
128
|
+
context: RunContext,
|
|
129
|
+
state_revision: str,
|
|
130
|
+
element_id: int,
|
|
131
|
+
action: str,
|
|
132
|
+
) -> dict[str, Any]:
|
|
133
|
+
"""Perform an action listed in an element's `actions` array."""
|
|
134
|
+
del context
|
|
135
|
+
return await _call(
|
|
136
|
+
backend.perform_action,
|
|
137
|
+
state_revision,
|
|
138
|
+
element_id,
|
|
139
|
+
action,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
return computer_perform_action
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def register_select_text(agent):
|
|
146
|
+
@agent.tool
|
|
147
|
+
async def computer_select_text(
|
|
148
|
+
context: RunContext,
|
|
149
|
+
state_revision: str,
|
|
150
|
+
element_id: int,
|
|
151
|
+
text: str,
|
|
152
|
+
mode: str = "text",
|
|
153
|
+
prefix: str | None = None,
|
|
154
|
+
suffix: str | None = None,
|
|
155
|
+
) -> dict[str, Any]:
|
|
156
|
+
"""Select exact text or place the cursor before/after it.
|
|
157
|
+
|
|
158
|
+
Use prefix or suffix when the target text occurs more than once.
|
|
159
|
+
"""
|
|
160
|
+
del context
|
|
161
|
+
return await _call(
|
|
162
|
+
backend.select_text,
|
|
163
|
+
state_revision,
|
|
164
|
+
element_id,
|
|
165
|
+
text,
|
|
166
|
+
mode,
|
|
167
|
+
prefix,
|
|
168
|
+
suffix,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
return computer_select_text
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def register_press_key(agent):
|
|
175
|
+
@agent.tool
|
|
176
|
+
async def computer_press_key(
|
|
177
|
+
context: RunContext,
|
|
178
|
+
state_revision: str,
|
|
179
|
+
key: str,
|
|
180
|
+
modifiers: list[str] | None = None,
|
|
181
|
+
) -> dict[str, Any]:
|
|
182
|
+
"""Press a supported key, optionally with command/shift/option/control."""
|
|
183
|
+
del context
|
|
184
|
+
return await _call(backend.press_key, state_revision, key, modifiers)
|
|
185
|
+
|
|
186
|
+
return computer_press_key
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
def register_type_text(agent):
|
|
190
|
+
@agent.tool
|
|
191
|
+
async def computer_type_text(
|
|
192
|
+
context: RunContext, state_revision: str, text: str
|
|
193
|
+
) -> dict[str, Any]:
|
|
194
|
+
"""Type Unicode text into the currently focused macOS control."""
|
|
195
|
+
del context
|
|
196
|
+
return await _call(backend.type_text, state_revision, text)
|
|
197
|
+
|
|
198
|
+
return computer_type_text
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def register_scroll(agent):
|
|
202
|
+
@agent.tool
|
|
203
|
+
async def computer_scroll(
|
|
204
|
+
context: RunContext,
|
|
205
|
+
state_revision: str,
|
|
206
|
+
direction: str,
|
|
207
|
+
pages: float = 1.0,
|
|
208
|
+
) -> dict[str, Any]:
|
|
209
|
+
"""Scroll up, down, left, or right by fractional pages."""
|
|
210
|
+
del context
|
|
211
|
+
return await _call(backend.scroll_pages, state_revision, direction, pages)
|
|
212
|
+
|
|
213
|
+
return computer_scroll
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def register_drag(agent):
|
|
217
|
+
@agent.tool
|
|
218
|
+
async def computer_drag(
|
|
219
|
+
context: RunContext,
|
|
220
|
+
state_revision: str,
|
|
221
|
+
start_x: float,
|
|
222
|
+
start_y: float,
|
|
223
|
+
end_x: float,
|
|
224
|
+
end_y: float,
|
|
225
|
+
duration: float = 0.5,
|
|
226
|
+
) -> dict[str, Any]:
|
|
227
|
+
"""Drag between two screenshot-pixel coordinates."""
|
|
228
|
+
del context
|
|
229
|
+
return await _call(
|
|
230
|
+
backend.drag_pixel,
|
|
231
|
+
state_revision,
|
|
232
|
+
start_x,
|
|
233
|
+
start_y,
|
|
234
|
+
end_x,
|
|
235
|
+
end_y,
|
|
236
|
+
duration,
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
return computer_drag
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
def register_screenshot(agent):
|
|
243
|
+
@agent.tool
|
|
244
|
+
async def computer_screenshot(
|
|
245
|
+
context: RunContext,
|
|
246
|
+
path: str | None = None,
|
|
247
|
+
app_name: str | None = None,
|
|
248
|
+
) -> Any:
|
|
249
|
+
"""Capture and display a macOS application window."""
|
|
250
|
+
del context
|
|
251
|
+
result = await _call(backend.screenshot, path, app_name)
|
|
252
|
+
if not result.get("success"):
|
|
253
|
+
return result
|
|
254
|
+
return _image_tool_return(result, "macOS screenshot")
|
|
255
|
+
|
|
256
|
+
return computer_screenshot
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def register_batch(agent):
|
|
260
|
+
@agent.tool
|
|
261
|
+
async def computer_use_batch(
|
|
262
|
+
context: RunContext,
|
|
263
|
+
state_revision: str,
|
|
264
|
+
steps: list[dict[str, Any]],
|
|
265
|
+
) -> Any:
|
|
266
|
+
"""Run up to 20 computer-use actions sequentially.
|
|
267
|
+
|
|
268
|
+
Supported action values are click, set_value, perform_action,
|
|
269
|
+
select_text, press_key, type_text, scroll, drag, and wait. Stop
|
|
270
|
+
immediately when an action fails, then return updated state after
|
|
271
|
+
deterministic UI settling.
|
|
272
|
+
"""
|
|
273
|
+
del context
|
|
274
|
+
if len(steps) > MAX_BATCH_STEPS:
|
|
275
|
+
return {
|
|
276
|
+
"success": False,
|
|
277
|
+
"error": f"A batch may contain at most {MAX_BATCH_STEPS} steps.",
|
|
278
|
+
}
|
|
279
|
+
completed = []
|
|
280
|
+
try:
|
|
281
|
+
initial_state = backend.require_state(state_revision)
|
|
282
|
+
except ComputerUseError as exc:
|
|
283
|
+
return {"success": False, "error": str(exc)}
|
|
284
|
+
except Exception as exc:
|
|
285
|
+
return {
|
|
286
|
+
"success": False,
|
|
287
|
+
"error": f"Computer Use activation failed: {exc}",
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
def invoke(action_name: str, kwargs: dict[str, Any]):
|
|
291
|
+
if action_name == "click":
|
|
292
|
+
if "element_id" in kwargs:
|
|
293
|
+
return backend.click(state_revision, consume=False, **kwargs)
|
|
294
|
+
return backend.click_pixel(state_revision, consume=False, **kwargs)
|
|
295
|
+
actions: dict[str, Callable[..., Any]] = {
|
|
296
|
+
"set_value": backend.set_value,
|
|
297
|
+
"perform_action": backend.perform_action,
|
|
298
|
+
"select_text": backend.select_text,
|
|
299
|
+
"press_key": backend.press_key,
|
|
300
|
+
"type_text": backend.type_text,
|
|
301
|
+
"scroll": backend.scroll_pages,
|
|
302
|
+
"drag": backend.drag_pixel,
|
|
303
|
+
}
|
|
304
|
+
return actions[action_name](state_revision, consume=False, **kwargs)
|
|
305
|
+
|
|
306
|
+
supported = {
|
|
307
|
+
"click",
|
|
308
|
+
"set_value",
|
|
309
|
+
"perform_action",
|
|
310
|
+
"select_text",
|
|
311
|
+
"press_key",
|
|
312
|
+
"type_text",
|
|
313
|
+
"scroll",
|
|
314
|
+
"drag",
|
|
315
|
+
}
|
|
316
|
+
for index, step in enumerate(steps):
|
|
317
|
+
action = str(step.get("action", ""))
|
|
318
|
+
if action == "wait":
|
|
319
|
+
seconds = max(0.0, min(float(step.get("seconds", 1)), 10.0))
|
|
320
|
+
await asyncio.sleep(seconds)
|
|
321
|
+
result = {"success": True, "seconds": seconds}
|
|
322
|
+
elif action in supported:
|
|
323
|
+
kwargs = {key: value for key, value in step.items() if key != "action"}
|
|
324
|
+
result = await _call(invoke, action, kwargs)
|
|
325
|
+
else:
|
|
326
|
+
result = {"success": False, "error": f"Unknown action: {action}"}
|
|
327
|
+
completed.append({"index": index, "action": action, "result": result})
|
|
328
|
+
if not result.get("success"):
|
|
329
|
+
return {"success": False, "completed_steps": completed}
|
|
330
|
+
try:
|
|
331
|
+
backend.require_state(state_revision, consume=True)
|
|
332
|
+
except ComputerUseError as exc:
|
|
333
|
+
return {
|
|
334
|
+
"success": False,
|
|
335
|
+
"error": str(exc),
|
|
336
|
+
"completed_steps": completed,
|
|
337
|
+
}
|
|
338
|
+
except Exception as exc:
|
|
339
|
+
return {
|
|
340
|
+
"success": False,
|
|
341
|
+
"error": f"Computer Use finalization failed: {exc}",
|
|
342
|
+
"completed_steps": completed,
|
|
343
|
+
}
|
|
344
|
+
settle = await asyncio.to_thread(
|
|
345
|
+
wait_for_ui_settle,
|
|
346
|
+
backend.snapshot,
|
|
347
|
+
initial_state.application,
|
|
348
|
+
)
|
|
349
|
+
updated = await _call(backend.get_app_state, initial_state.application, 100)
|
|
350
|
+
if not updated.get("success"):
|
|
351
|
+
return {
|
|
352
|
+
"success": True,
|
|
353
|
+
"completed_steps": completed,
|
|
354
|
+
"updated_state_error": updated.get("error"),
|
|
355
|
+
}
|
|
356
|
+
updated["completed_steps"] = completed
|
|
357
|
+
updated["ui_settle"] = settle
|
|
358
|
+
return _state_tool_return(updated, "macOS state after computer-use batch")
|
|
359
|
+
|
|
360
|
+
return computer_use_batch
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
REGISTRARS = {
|
|
364
|
+
"computer_get_app_state": register_get_app_state,
|
|
365
|
+
"computer_snapshot": register_snapshot,
|
|
366
|
+
"computer_click": register_click,
|
|
367
|
+
"computer_set_value": register_set_value,
|
|
368
|
+
"computer_perform_action": register_perform_action,
|
|
369
|
+
"computer_select_text": register_select_text,
|
|
370
|
+
"computer_press_key": register_press_key,
|
|
371
|
+
"computer_type_text": register_type_text,
|
|
372
|
+
"computer_scroll": register_scroll,
|
|
373
|
+
"computer_drag": register_drag,
|
|
374
|
+
"computer_screenshot": register_screenshot,
|
|
375
|
+
"computer_use_batch": register_batch,
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
def _image_tool_return(result: dict[str, Any], label: str) -> ToolReturn:
|
|
380
|
+
path = str(result["path"])
|
|
381
|
+
image_bytes = Path(path).read_bytes()
|
|
382
|
+
displayed = emit_inline_image(path)
|
|
383
|
+
metadata = dict(result)
|
|
384
|
+
metadata["displayed_inline"] = displayed
|
|
385
|
+
return ToolReturn(
|
|
386
|
+
return_value=metadata,
|
|
387
|
+
content=[
|
|
388
|
+
f"Here is the {label}:",
|
|
389
|
+
BinaryContent(data=image_bytes, media_type="image/png"),
|
|
390
|
+
],
|
|
391
|
+
metadata=metadata,
|
|
392
|
+
)
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
def _state_tool_return(result: dict[str, Any], label: str) -> ToolReturn:
|
|
396
|
+
image = _image_tool_return(
|
|
397
|
+
{"success": True, "path": result["screenshot_path"]}, label
|
|
398
|
+
)
|
|
399
|
+
metadata = dict(result)
|
|
400
|
+
metadata["displayed_inline"] = image.metadata["displayed_inline"]
|
|
401
|
+
return ToolReturn(
|
|
402
|
+
return_value=_compact_state_for_model(metadata),
|
|
403
|
+
content=image.content,
|
|
404
|
+
metadata=metadata,
|
|
405
|
+
)
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
def _compact_state_for_model(state: dict[str, Any]) -> dict[str, Any]:
|
|
409
|
+
"""Keep control semantics while removing repetitive AX bookkeeping."""
|
|
410
|
+
keep = (
|
|
411
|
+
"success",
|
|
412
|
+
"state_revision",
|
|
413
|
+
"application",
|
|
414
|
+
"bundle_id",
|
|
415
|
+
"window_title",
|
|
416
|
+
"window_bounds_points",
|
|
417
|
+
"screenshot_size_pixels",
|
|
418
|
+
"screenshot_coordinate_system",
|
|
419
|
+
"action_coordinate_system",
|
|
420
|
+
"node_count",
|
|
421
|
+
"truncated",
|
|
422
|
+
"overflow_summary",
|
|
423
|
+
"warning",
|
|
424
|
+
"completed_steps",
|
|
425
|
+
"ui_settle",
|
|
426
|
+
)
|
|
427
|
+
compact = {key: state[key] for key in keep if key in state}
|
|
428
|
+
compact_nodes = []
|
|
429
|
+
ignored_actions = {"AXShowMenu", "AXScrollToVisible"}
|
|
430
|
+
for node in state.get("nodes", []):
|
|
431
|
+
item = {
|
|
432
|
+
key: node[key]
|
|
433
|
+
for key in ("id", "role", "title", "description", "value")
|
|
434
|
+
if node.get(key) not in (None, "")
|
|
435
|
+
}
|
|
436
|
+
actions = [
|
|
437
|
+
action
|
|
438
|
+
for action in node.get("actions", [])
|
|
439
|
+
if action not in ignored_actions
|
|
440
|
+
]
|
|
441
|
+
if actions:
|
|
442
|
+
item["actions"] = actions
|
|
443
|
+
if node.get("focused"):
|
|
444
|
+
item["focused"] = True
|
|
445
|
+
if node.get("enabled") is False:
|
|
446
|
+
item["enabled"] = False
|
|
447
|
+
compact_nodes.append(item)
|
|
448
|
+
compact["nodes"] = compact_nodes
|
|
449
|
+
return compact
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
async def _attach_screenshot(
|
|
453
|
+
result: dict[str, Any],
|
|
454
|
+
label: str,
|
|
455
|
+
app_name: str | None = None,
|
|
456
|
+
) -> ToolReturn | dict[str, Any]:
|
|
457
|
+
screenshot = await _call(backend.screenshot, None, app_name)
|
|
458
|
+
if not screenshot.get("success"):
|
|
459
|
+
result["screenshot_error"] = screenshot.get("error")
|
|
460
|
+
return result
|
|
461
|
+
screenshot_return = _image_tool_return(screenshot, label)
|
|
462
|
+
merged = dict(result)
|
|
463
|
+
merged["screenshot_path"] = screenshot["path"]
|
|
464
|
+
merged["displayed_inline"] = screenshot_return.metadata["displayed_inline"]
|
|
465
|
+
return ToolReturn(
|
|
466
|
+
return_value=merged,
|
|
467
|
+
content=screenshot_return.content,
|
|
468
|
+
metadata=merged,
|
|
469
|
+
)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Context-window usage indicator.
|
|
2
|
+
|
|
3
|
+
Shows a colored circle on the bottom bar's status row (next to the token
|
|
4
|
+
summary) reflecting how full the current agent's message history is
|
|
5
|
+
relative to the active model's context window:
|
|
6
|
+
|
|
7
|
+
* 🟢 — under 30% used
|
|
8
|
+
* 🟡 — 30%-65% used
|
|
9
|
+
* 🔴 — over 65% used
|
|
10
|
+
|
|
11
|
+
Also exposes a ``/context`` slash command for a detailed breakdown.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
__all__: list[str] = []
|