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,290 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Helpers for reading and writing hook configurations from both global and project sources.
|
|
3
|
+
|
|
4
|
+
Supports:
|
|
5
|
+
- Global hooks: ~/.code_puppy/hooks.json
|
|
6
|
+
- Project hooks: .claude/settings.json
|
|
7
|
+
|
|
8
|
+
Hooks from both sources are loaded and can be managed independently in the TUI.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import copy
|
|
12
|
+
import json
|
|
13
|
+
import logging
|
|
14
|
+
import os
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
from typing import Any, Dict, List, Literal, Optional
|
|
17
|
+
|
|
18
|
+
logger = logging.getLogger(__name__)
|
|
19
|
+
|
|
20
|
+
_SETTINGS_FILENAME = ".claude/settings.json"
|
|
21
|
+
_GLOBAL_HOOKS_FILE = os.path.expanduser("~/.code_puppy/hooks.json")
|
|
22
|
+
|
|
23
|
+
HookSource = Literal["project", "global"]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _find_settings_path() -> Path:
|
|
27
|
+
"""Return the path to .claude/settings.json, searching from cwd upward."""
|
|
28
|
+
cwd = Path.cwd()
|
|
29
|
+
for parent in [cwd, *cwd.parents]:
|
|
30
|
+
candidate = parent / _SETTINGS_FILENAME
|
|
31
|
+
if candidate.exists():
|
|
32
|
+
return candidate
|
|
33
|
+
return cwd / _SETTINGS_FILENAME
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _load_global_hooks_config() -> Dict[str, Any]:
|
|
37
|
+
"""Load hooks from ~/.code_puppy/hooks.json."""
|
|
38
|
+
path = Path(_GLOBAL_HOOKS_FILE)
|
|
39
|
+
if not path.exists():
|
|
40
|
+
return {}
|
|
41
|
+
try:
|
|
42
|
+
data = json.loads(path.read_text(encoding="utf-8"))
|
|
43
|
+
# Handle both wrapped {"hooks": {...}} and direct format
|
|
44
|
+
if "hooks" in data and isinstance(data["hooks"], dict):
|
|
45
|
+
return data.get("hooks", {})
|
|
46
|
+
return data
|
|
47
|
+
except Exception as exc:
|
|
48
|
+
logger.warning("Failed to parse global hooks from %s: %s", path, exc)
|
|
49
|
+
return {}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _load_project_hooks_config() -> Dict[str, Any]:
|
|
53
|
+
"""Load hooks from .claude/settings.json."""
|
|
54
|
+
path = _find_settings_path()
|
|
55
|
+
if not path.exists():
|
|
56
|
+
return {}
|
|
57
|
+
try:
|
|
58
|
+
data = json.loads(path.read_text(encoding="utf-8"))
|
|
59
|
+
return data.get("hooks", {})
|
|
60
|
+
except Exception as exc:
|
|
61
|
+
logger.warning("Failed to parse project hooks from %s: %s", path, exc)
|
|
62
|
+
return {}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def load_hooks_config() -> Dict[str, Any]:
|
|
66
|
+
"""Load raw hooks config from .claude/settings.json (project only).
|
|
67
|
+
|
|
68
|
+
Returns the value of the top-level "hooks" key, or {} if absent/unreadable.
|
|
69
|
+
Note: For the TUI, we load hooks from both sources separately.
|
|
70
|
+
"""
|
|
71
|
+
return _load_project_hooks_config()
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def load_all_hooks_config() -> Dict[str, Any]:
|
|
75
|
+
"""Load and merge hooks from both global and project sources.
|
|
76
|
+
|
|
77
|
+
Returns a merged configuration with all hooks.
|
|
78
|
+
"""
|
|
79
|
+
global_hooks = _load_global_hooks_config()
|
|
80
|
+
project_hooks = _load_project_hooks_config()
|
|
81
|
+
|
|
82
|
+
# Simple merge: combine hook groups
|
|
83
|
+
merged = {}
|
|
84
|
+
for event_type in set(list(global_hooks.keys()) + list(project_hooks.keys())):
|
|
85
|
+
if event_type.startswith("_"):
|
|
86
|
+
# Skip comment keys
|
|
87
|
+
merged[event_type] = project_hooks.get(event_type) or global_hooks.get(
|
|
88
|
+
event_type
|
|
89
|
+
)
|
|
90
|
+
continue
|
|
91
|
+
|
|
92
|
+
global_groups = (
|
|
93
|
+
global_hooks.get(event_type, [])
|
|
94
|
+
if isinstance(global_hooks.get(event_type), list)
|
|
95
|
+
else []
|
|
96
|
+
)
|
|
97
|
+
project_groups = (
|
|
98
|
+
project_hooks.get(event_type, [])
|
|
99
|
+
if isinstance(project_hooks.get(event_type), list)
|
|
100
|
+
else []
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
if global_groups or project_groups:
|
|
104
|
+
merged[event_type] = global_groups + project_groups
|
|
105
|
+
|
|
106
|
+
return merged
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def save_hooks_config(hooks: Dict[str, Any]) -> Path:
|
|
110
|
+
"""Persist hooks config back to .claude/settings.json.
|
|
111
|
+
|
|
112
|
+
Performs a read-modify-write so other top-level keys are preserved.
|
|
113
|
+
Returns the path written.
|
|
114
|
+
"""
|
|
115
|
+
path = _find_settings_path()
|
|
116
|
+
existing: Dict[str, Any] = {}
|
|
117
|
+
if path.exists():
|
|
118
|
+
try:
|
|
119
|
+
existing = json.loads(path.read_text(encoding="utf-8"))
|
|
120
|
+
except Exception:
|
|
121
|
+
existing = {}
|
|
122
|
+
existing["hooks"] = hooks
|
|
123
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
124
|
+
path.write_text(json.dumps(existing, indent=2) + "\n", encoding="utf-8")
|
|
125
|
+
logger.debug("Saved hooks config to %s", path)
|
|
126
|
+
return path
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def save_global_hooks_config(hooks: Dict[str, Any]) -> Path:
|
|
130
|
+
"""Persist hooks config to ~/.code_puppy/hooks.json.
|
|
131
|
+
|
|
132
|
+
Returns the path written.
|
|
133
|
+
"""
|
|
134
|
+
path = Path(_GLOBAL_HOOKS_FILE)
|
|
135
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
136
|
+
path.write_text(json.dumps(hooks, indent=2) + "\n", encoding="utf-8")
|
|
137
|
+
logger.debug("Saved global hooks config to %s", path)
|
|
138
|
+
return path
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class HookEntry:
|
|
142
|
+
"""Flat, mutable representation of a single hook for the TUI."""
|
|
143
|
+
|
|
144
|
+
__slots__ = (
|
|
145
|
+
"event_type",
|
|
146
|
+
"matcher",
|
|
147
|
+
"hook_type",
|
|
148
|
+
"command",
|
|
149
|
+
"timeout",
|
|
150
|
+
"enabled",
|
|
151
|
+
"hook_id",
|
|
152
|
+
"source",
|
|
153
|
+
"_group_index",
|
|
154
|
+
"_hook_index",
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
def __init__(
|
|
158
|
+
self,
|
|
159
|
+
event_type: str,
|
|
160
|
+
matcher: str,
|
|
161
|
+
hook_type: str,
|
|
162
|
+
command: str,
|
|
163
|
+
timeout: int = 5000,
|
|
164
|
+
enabled: bool = True,
|
|
165
|
+
hook_id: Optional[str] = None,
|
|
166
|
+
source: HookSource = "project",
|
|
167
|
+
group_index: int = 0,
|
|
168
|
+
hook_index: int = 0,
|
|
169
|
+
) -> None:
|
|
170
|
+
self.event_type = event_type
|
|
171
|
+
self.matcher = matcher
|
|
172
|
+
self.hook_type = hook_type
|
|
173
|
+
self.command = command
|
|
174
|
+
self.timeout = timeout
|
|
175
|
+
self.enabled = enabled
|
|
176
|
+
self.hook_id = hook_id
|
|
177
|
+
self.source = source
|
|
178
|
+
self._group_index = group_index
|
|
179
|
+
self._hook_index = hook_index
|
|
180
|
+
|
|
181
|
+
@property
|
|
182
|
+
def display_command(self) -> str:
|
|
183
|
+
"""Command truncated to 60 chars for list display."""
|
|
184
|
+
cmd = self.command
|
|
185
|
+
return cmd[:57] + "..." if len(cmd) > 60 else cmd
|
|
186
|
+
|
|
187
|
+
@property
|
|
188
|
+
def display_matcher(self) -> str:
|
|
189
|
+
"""Matcher truncated to 40 chars."""
|
|
190
|
+
m = self.matcher
|
|
191
|
+
return m[:37] + "..." if len(m) > 40 else m
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def flatten_hooks(
|
|
195
|
+
hooks_config: Dict[str, Any], source: HookSource = "project"
|
|
196
|
+
) -> List[HookEntry]:
|
|
197
|
+
"""Convert nested hooks config into a flat list of HookEntry objects.
|
|
198
|
+
|
|
199
|
+
Each entry remembers its group_index and hook_index for round-trip
|
|
200
|
+
serialisation, and which source it came from.
|
|
201
|
+
"""
|
|
202
|
+
entries: List[HookEntry] = []
|
|
203
|
+
for event_type, groups in hooks_config.items():
|
|
204
|
+
if event_type.startswith("_"):
|
|
205
|
+
# Skip comment keys
|
|
206
|
+
continue
|
|
207
|
+
if not isinstance(groups, list):
|
|
208
|
+
continue
|
|
209
|
+
for g_idx, group in enumerate(groups):
|
|
210
|
+
if not isinstance(group, dict):
|
|
211
|
+
continue
|
|
212
|
+
matcher = group.get("matcher", "*")
|
|
213
|
+
for h_idx, hook in enumerate(group.get("hooks", [])):
|
|
214
|
+
if not isinstance(hook, dict):
|
|
215
|
+
continue
|
|
216
|
+
command = hook.get("command") or hook.get("prompt", "")
|
|
217
|
+
entries.append(
|
|
218
|
+
HookEntry(
|
|
219
|
+
event_type=event_type,
|
|
220
|
+
matcher=matcher,
|
|
221
|
+
hook_type=hook.get("type", "command"),
|
|
222
|
+
command=command,
|
|
223
|
+
timeout=hook.get("timeout", 5000),
|
|
224
|
+
enabled=hook.get("enabled", True),
|
|
225
|
+
hook_id=hook.get("id"),
|
|
226
|
+
source=source,
|
|
227
|
+
group_index=g_idx,
|
|
228
|
+
hook_index=h_idx,
|
|
229
|
+
)
|
|
230
|
+
)
|
|
231
|
+
return entries
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def flatten_all_hooks() -> List[HookEntry]:
|
|
235
|
+
"""Load and flatten hooks from both global and project sources.
|
|
236
|
+
|
|
237
|
+
Returns a combined list with source information for each hook.
|
|
238
|
+
"""
|
|
239
|
+
global_config = _load_global_hooks_config()
|
|
240
|
+
project_config = _load_project_hooks_config()
|
|
241
|
+
|
|
242
|
+
global_entries = flatten_hooks(global_config, source="global")
|
|
243
|
+
project_entries = flatten_hooks(project_config, source="project")
|
|
244
|
+
|
|
245
|
+
# Project hooks first for easier viewing
|
|
246
|
+
return project_entries + global_entries
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
def toggle_hook_enabled(
|
|
250
|
+
hooks_config: Dict[str, Any],
|
|
251
|
+
event_type: str,
|
|
252
|
+
group_index: int,
|
|
253
|
+
hook_index: int,
|
|
254
|
+
enabled: bool,
|
|
255
|
+
) -> Dict[str, Any]:
|
|
256
|
+
"""Return a deep copy of hooks_config with the specified hook toggled.
|
|
257
|
+
|
|
258
|
+
Does NOT write to disk – call save_hooks_config() afterwards.
|
|
259
|
+
"""
|
|
260
|
+
cfg = copy.deepcopy(hooks_config)
|
|
261
|
+
try:
|
|
262
|
+
hook = cfg[event_type][group_index]["hooks"][hook_index]
|
|
263
|
+
hook["enabled"] = enabled
|
|
264
|
+
except (KeyError, IndexError, TypeError) as exc:
|
|
265
|
+
logger.warning("toggle_hook_enabled: cannot find hook (%s)", exc)
|
|
266
|
+
return cfg
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
def delete_hook(
|
|
270
|
+
hooks_config: Dict[str, Any],
|
|
271
|
+
event_type: str,
|
|
272
|
+
group_index: int,
|
|
273
|
+
hook_index: int,
|
|
274
|
+
) -> Dict[str, Any]:
|
|
275
|
+
"""Return a deep copy of hooks_config with the specified hook removed.
|
|
276
|
+
|
|
277
|
+
Empty groups and event keys are pruned automatically.
|
|
278
|
+
Does NOT write to disk – call save_hooks_config() afterwards.
|
|
279
|
+
"""
|
|
280
|
+
cfg = copy.deepcopy(hooks_config)
|
|
281
|
+
try:
|
|
282
|
+
group = cfg[event_type][group_index]
|
|
283
|
+
group["hooks"].pop(hook_index)
|
|
284
|
+
if not group["hooks"]:
|
|
285
|
+
cfg[event_type].pop(group_index)
|
|
286
|
+
if not cfg[event_type]:
|
|
287
|
+
del cfg[event_type]
|
|
288
|
+
except (KeyError, IndexError, TypeError) as exc:
|
|
289
|
+
logger.warning("delete_hook: cannot remove hook (%s)", exc)
|
|
290
|
+
return cfg
|