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,354 @@
|
|
|
1
|
+
"""Pure rendering helpers for the /prune TUI.
|
|
2
|
+
|
|
3
|
+
All functions here take read-only state and return prompt_toolkit-style
|
|
4
|
+
formatted-text tuples. Keeping them out of the menu class keeps the
|
|
5
|
+
menu focused on state + key bindings, and makes the renderers easy to
|
|
6
|
+
unit-test with hand-built fixtures.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from typing import Any, List, Tuple
|
|
12
|
+
|
|
13
|
+
from code_puppy_core_plugins.prune.prune_model import (
|
|
14
|
+
ContextBudget,
|
|
15
|
+
MessageEntry,
|
|
16
|
+
Row,
|
|
17
|
+
ToolCallInfo,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# ── small atomic helpers ────────────────────────────────────────────────────
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def ctx_indicator(entry: MessageEntry) -> Tuple[str, str]:
|
|
25
|
+
"""Return (glyph, style) for the in-context indicator."""
|
|
26
|
+
if entry.in_context is True:
|
|
27
|
+
return ("●", "class:tui.success")
|
|
28
|
+
if entry.in_context is False:
|
|
29
|
+
return ("○", "class:tui.muted")
|
|
30
|
+
return ("·", "class:tui.muted")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def tokens_str(entry: MessageEntry) -> str:
|
|
34
|
+
if entry.tokens is None:
|
|
35
|
+
return ""
|
|
36
|
+
return f"~{entry.tokens}t"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def ctx_detail_text(entry: MessageEntry) -> str:
|
|
40
|
+
if entry.in_context is True:
|
|
41
|
+
return " · ● in context"
|
|
42
|
+
if entry.in_context is False:
|
|
43
|
+
return " · ○ out of context"
|
|
44
|
+
return ""
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def format_args_full(full_args: dict, fallback: str) -> List[str]:
|
|
48
|
+
"""Pretty-print tool args with no truncation, no JSON escaping.
|
|
49
|
+
|
|
50
|
+
Recursive YAML-ish layout:
|
|
51
|
+
* Short scalars render inline: ``key: value``
|
|
52
|
+
* Multi-line / long strings render as a block scalar with native
|
|
53
|
+
line breaks (no ``\\n`` escapes), indented under the key.
|
|
54
|
+
* Nested dicts and lists recurse with the same rules so inner
|
|
55
|
+
strings keep their native formatting too.
|
|
56
|
+
* Lists use a leading ``- `` on each item.
|
|
57
|
+
|
|
58
|
+
Returns a flat list of lines for the caller to indent/format. Falls
|
|
59
|
+
back to the abbreviated preview if the full args dict isn't usable.
|
|
60
|
+
"""
|
|
61
|
+
if not full_args:
|
|
62
|
+
return [fallback or "<no args>"]
|
|
63
|
+
if not isinstance(full_args, dict):
|
|
64
|
+
return [fallback or str(full_args)]
|
|
65
|
+
|
|
66
|
+
lines: List[str] = []
|
|
67
|
+
for key, value in full_args.items():
|
|
68
|
+
lines.extend(_format_kv(str(key), value))
|
|
69
|
+
return lines or ["<no args>"]
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
_INLINE_STR_LIMIT = 60 # short strings render on the same line as the key
|
|
73
|
+
_INDENT = " "
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def _is_inline_scalar(value: Any) -> bool:
|
|
77
|
+
if value is None or isinstance(value, (bool, int, float)):
|
|
78
|
+
return True
|
|
79
|
+
if isinstance(value, str) and "\n" not in value and len(value) <= _INLINE_STR_LIMIT:
|
|
80
|
+
return True
|
|
81
|
+
return False
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def _format_kv(key: str, value: Any) -> List[str]:
|
|
85
|
+
"""Render ``key: value``, recursing for complex values."""
|
|
86
|
+
if _is_inline_scalar(value):
|
|
87
|
+
return [f"{key}: {value}"]
|
|
88
|
+
|
|
89
|
+
if isinstance(value, str):
|
|
90
|
+
body = value.splitlines() or [value]
|
|
91
|
+
return [f"{key}: |"] + [f"{_INDENT}{line}" for line in body]
|
|
92
|
+
|
|
93
|
+
nested = _format_value_lines(value)
|
|
94
|
+
if not nested:
|
|
95
|
+
return [f"{key}: <empty>"]
|
|
96
|
+
return [f"{key}:"] + [f"{_INDENT}{line}" for line in nested]
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _format_value_lines(value: Any) -> List[str]:
|
|
100
|
+
"""Render ``value`` (with no leading key) as a list of lines."""
|
|
101
|
+
if _is_inline_scalar(value):
|
|
102
|
+
return [str(value)]
|
|
103
|
+
|
|
104
|
+
if isinstance(value, str):
|
|
105
|
+
body = value.splitlines() or [value]
|
|
106
|
+
return ["|"] + [f"{_INDENT}{line}" for line in body]
|
|
107
|
+
|
|
108
|
+
if isinstance(value, dict):
|
|
109
|
+
if not value:
|
|
110
|
+
return ["{}"]
|
|
111
|
+
lines: List[str] = []
|
|
112
|
+
for k, v in value.items():
|
|
113
|
+
lines.extend(_format_kv(str(k), v))
|
|
114
|
+
return lines
|
|
115
|
+
|
|
116
|
+
if isinstance(value, list):
|
|
117
|
+
if not value:
|
|
118
|
+
return ["[]"]
|
|
119
|
+
lines = []
|
|
120
|
+
for item in value:
|
|
121
|
+
item_lines = _format_value_lines(item) or [""]
|
|
122
|
+
lines.append(f"- {item_lines[0]}")
|
|
123
|
+
for line in item_lines[1:]:
|
|
124
|
+
lines.append(f"{_INDENT}{line}")
|
|
125
|
+
return lines
|
|
126
|
+
|
|
127
|
+
# Fallback for anything weird
|
|
128
|
+
return [str(value)]
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def render_budget_line(budget: ContextBudget) -> List[tuple]:
|
|
132
|
+
if not budget.available or budget.context_length is None:
|
|
133
|
+
return [("class:tui.muted", "context: unavailable\n")]
|
|
134
|
+
|
|
135
|
+
total = budget.total_used or 0
|
|
136
|
+
pct = budget.percent_used or 0.0
|
|
137
|
+
if pct < 70:
|
|
138
|
+
style = "class:tui.success"
|
|
139
|
+
elif pct < 90:
|
|
140
|
+
style = "class:tui.warning"
|
|
141
|
+
else:
|
|
142
|
+
style = "class:tui.error"
|
|
143
|
+
|
|
144
|
+
parts: List[tuple] = [
|
|
145
|
+
(
|
|
146
|
+
style,
|
|
147
|
+
f"context: {total:,}/{budget.context_length:,} tokens ({pct:.0f}%)",
|
|
148
|
+
),
|
|
149
|
+
("class:tui.muted", f" overhead: {budget.overhead_tokens or 0:,}t\n"),
|
|
150
|
+
]
|
|
151
|
+
if budget.out_of_context_messages > 0:
|
|
152
|
+
# Keep overflow on its own line; newer messages can be popped/pruned to
|
|
153
|
+
# bring these history entries back into context.
|
|
154
|
+
parts.append(
|
|
155
|
+
(
|
|
156
|
+
"class:tui.error",
|
|
157
|
+
f" ↯ {budget.out_of_context_tokens:,}t in "
|
|
158
|
+
f"{budget.out_of_context_messages} older msg(s) out of context\n",
|
|
159
|
+
)
|
|
160
|
+
)
|
|
161
|
+
return parts
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def render_legend() -> List[tuple]:
|
|
165
|
+
"""One-line legend explaining the context-window indicator glyphs.
|
|
166
|
+
|
|
167
|
+
Placed under the budget header so a first-time pruner can map the
|
|
168
|
+
dots they see in the rows to what they mean. Compact on purpose —
|
|
169
|
+
legends that wrap are worse than no legend.
|
|
170
|
+
|
|
171
|
+
Note: ``○`` messages are NOT gone — they're still in conversation
|
|
172
|
+
history. They just don't fit in this turn's context window. If newer
|
|
173
|
+
messages are pruned (or compacted), older ``○`` messages slide back
|
|
174
|
+
into the window. The genuinely valuable prune targets for reclaiming
|
|
175
|
+
budget are noisy ``●`` messages.
|
|
176
|
+
"""
|
|
177
|
+
return [
|
|
178
|
+
("class:tui.muted", " legend: "),
|
|
179
|
+
("class:tui.success", "● in context"),
|
|
180
|
+
("class:tui.muted", " "),
|
|
181
|
+
("class:tui.muted", "○ out of context"),
|
|
182
|
+
("class:tui.muted", " "),
|
|
183
|
+
("class:tui.muted", "· unknown\n"),
|
|
184
|
+
]
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
# ── list pane ───────────────────────────────────────────────────────────────
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def render_list(menu: Any) -> List[tuple]:
|
|
191
|
+
"""Render the left (history list) pane.
|
|
192
|
+
|
|
193
|
+
Reads from the menu: entries, rows, viewport_top, _visible_rows,
|
|
194
|
+
cursor, selected_messages, budget.
|
|
195
|
+
"""
|
|
196
|
+
out: List[tuple] = []
|
|
197
|
+
out.append(
|
|
198
|
+
(
|
|
199
|
+
"class:tui.title dim",
|
|
200
|
+
" prune ↓/↑ move space toggle a all c clear enter confirm q quit\n",
|
|
201
|
+
)
|
|
202
|
+
)
|
|
203
|
+
out.append(("", " "))
|
|
204
|
+
out.extend(render_budget_line(menu.budget))
|
|
205
|
+
out.append(("", "\n"))
|
|
206
|
+
|
|
207
|
+
page = max(1, menu._visible_rows)
|
|
208
|
+
total = len(menu.rows)
|
|
209
|
+
top = menu.viewport_top
|
|
210
|
+
bottom = min(total, top + page)
|
|
211
|
+
hidden_above = top
|
|
212
|
+
hidden_below = max(0, total - bottom)
|
|
213
|
+
|
|
214
|
+
if hidden_above:
|
|
215
|
+
out.append(("class:tui.muted", f" ↑ {hidden_above} more above\n"))
|
|
216
|
+
else:
|
|
217
|
+
out.append(("", "\n"))
|
|
218
|
+
|
|
219
|
+
for idx in range(top, bottom):
|
|
220
|
+
render_row(menu, idx, menu.rows[idx], out)
|
|
221
|
+
|
|
222
|
+
if hidden_below:
|
|
223
|
+
out.append(("class:tui.muted", f" ↓ {hidden_below} more below\n"))
|
|
224
|
+
else:
|
|
225
|
+
out.append(("", "\n"))
|
|
226
|
+
|
|
227
|
+
msg_count = len(menu.selected_messages)
|
|
228
|
+
out.append(("", "\n"))
|
|
229
|
+
out.append(
|
|
230
|
+
(
|
|
231
|
+
"class:tui.success",
|
|
232
|
+
f" enter = remove {msg_count} message(s)\n",
|
|
233
|
+
)
|
|
234
|
+
)
|
|
235
|
+
out.extend(render_legend())
|
|
236
|
+
out.append(("class:tui.muted", f" cursor {menu.cursor + 1}/{total}\n"))
|
|
237
|
+
return out
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
def render_row(menu: Any, idx: int, row: Row, out: List[tuple]) -> None:
|
|
241
|
+
is_cursor = idx == menu.cursor
|
|
242
|
+
cursor_marker = "▶ " if is_cursor else " "
|
|
243
|
+
cursor_style = "class:tui.selected" if is_cursor else ""
|
|
244
|
+
checked = menu._row_is_checked(row)
|
|
245
|
+
|
|
246
|
+
entry = menu.entries[row.message_idx]
|
|
247
|
+
|
|
248
|
+
# Locked rows (sys bundle or history[0]) get a distinct "locked" box
|
|
249
|
+
# so the user can see at a glance that this isn't toggleable.
|
|
250
|
+
if entry.is_locked:
|
|
251
|
+
box, box_style = "[-] ", "class:tui.muted"
|
|
252
|
+
elif checked:
|
|
253
|
+
box, box_style = "[x] ", "class:tui.error"
|
|
254
|
+
else:
|
|
255
|
+
box, box_style = "[ ] ", "class:tui.muted"
|
|
256
|
+
|
|
257
|
+
role_short = {
|
|
258
|
+
"system": "sys ",
|
|
259
|
+
"user": "user ",
|
|
260
|
+
"assistant": "asst ",
|
|
261
|
+
"tool-return": "tool ",
|
|
262
|
+
"unknown": "? ",
|
|
263
|
+
}.get(entry.role, "? ")
|
|
264
|
+
row_style = "class:tui.error" if checked else entry.role_color
|
|
265
|
+
out.append((cursor_style, cursor_marker))
|
|
266
|
+
out.append((box_style, box))
|
|
267
|
+
ctx_glyph, ctx_style = ctx_indicator(entry)
|
|
268
|
+
out.append((ctx_style, f"{ctx_glyph} "))
|
|
269
|
+
idx_col = f"{entry.history_index:3d}"
|
|
270
|
+
out.append(
|
|
271
|
+
(
|
|
272
|
+
row_style,
|
|
273
|
+
f"{idx_col} {role_short} {entry.preview}",
|
|
274
|
+
)
|
|
275
|
+
)
|
|
276
|
+
tok = tokens_str(entry)
|
|
277
|
+
if tok:
|
|
278
|
+
out.append(("class:tui.muted", f" {tok}"))
|
|
279
|
+
out.append(("", "\n"))
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
# ── detail pane ─────────────────────────────────────────────────────────────
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
def render_detail(menu: Any) -> List[tuple]:
|
|
286
|
+
"""Render the right (detail) pane for whatever the cursor is on."""
|
|
287
|
+
if not menu.rows:
|
|
288
|
+
return [("", "")]
|
|
289
|
+
|
|
290
|
+
row = menu.rows[menu.cursor]
|
|
291
|
+
entry = menu.entries[row.message_idx]
|
|
292
|
+
out: List[tuple] = []
|
|
293
|
+
_render_message_detail(entry, out)
|
|
294
|
+
|
|
295
|
+
out.append(("", "\n"))
|
|
296
|
+
if menu._selection_has_side_effects():
|
|
297
|
+
out.append(
|
|
298
|
+
(
|
|
299
|
+
"class:tui.error",
|
|
300
|
+
" ⚠ selection includes side-effecting tool calls; "
|
|
301
|
+
"pruning does NOT roll them back\n",
|
|
302
|
+
)
|
|
303
|
+
)
|
|
304
|
+
return out
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
def _render_message_detail(entry: MessageEntry, out: List[tuple]) -> None:
|
|
308
|
+
out.append(("class:tui.title dim", f" {entry.role} (message)\n"))
|
|
309
|
+
tok = f" · ~{entry.tokens}t" if entry.tokens is not None else ""
|
|
310
|
+
location = f"history index {entry.history_index}"
|
|
311
|
+
# Surface thinking presence in the metadata line so it's clear at a
|
|
312
|
+
# glance that this assistant turn carried chain-of-thought tokens.
|
|
313
|
+
thinking_note = (
|
|
314
|
+
f" · 🧠 {len(entry.thinking_segments)} thinking block(s)"
|
|
315
|
+
if entry.thinking_segments
|
|
316
|
+
else ""
|
|
317
|
+
)
|
|
318
|
+
out.append(
|
|
319
|
+
(
|
|
320
|
+
"class:tui.muted",
|
|
321
|
+
f" {location} · "
|
|
322
|
+
f"{len(entry.tool_calls)} tool call(s){tok}{ctx_detail_text(entry)}"
|
|
323
|
+
f"{thinking_note}\n\n",
|
|
324
|
+
)
|
|
325
|
+
)
|
|
326
|
+
for line in (entry.full_text or "<empty>").splitlines() or [""]:
|
|
327
|
+
out.append(("", f" {line}\n"))
|
|
328
|
+
|
|
329
|
+
if entry.tool_calls:
|
|
330
|
+
out.append(("", "\n"))
|
|
331
|
+
out.append(("class:tui.title dim", " tool calls (will go with message):\n"))
|
|
332
|
+
for tc in entry.tool_calls:
|
|
333
|
+
_render_tool_call_block(tc, out)
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
def _render_tool_call_block(tc: ToolCallInfo, out: List[tuple]) -> None:
|
|
337
|
+
"""Inline tool-call block inside a message detail view, full args."""
|
|
338
|
+
out.append(("class:tui.warning", f" {tc.icon} {tc.name}"))
|
|
339
|
+
out.append(("", "\n"))
|
|
340
|
+
for line in format_args_full(tc.full_args, tc.args_preview):
|
|
341
|
+
out.append(("class:tui.muted", f" {line}\n"))
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
__all__ = [
|
|
345
|
+
"ctx_detail_text",
|
|
346
|
+
"ctx_indicator",
|
|
347
|
+
"format_args_full",
|
|
348
|
+
"render_budget_line",
|
|
349
|
+
"render_detail",
|
|
350
|
+
"render_legend",
|
|
351
|
+
"render_list",
|
|
352
|
+
"render_row",
|
|
353
|
+
"tokens_str",
|
|
354
|
+
]
|