code-puppy-core-plugins 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. code_puppy_core_plugins-0.0.2/.gitignore +8 -0
  2. code_puppy_core_plugins-0.0.2/LICENSE +21 -0
  3. code_puppy_core_plugins-0.0.2/PKG-INFO +64 -0
  4. code_puppy_core_plugins-0.0.2/README.md +46 -0
  5. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/__init__.py +5 -0
  6. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/README.md +266 -0
  7. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/__init__.py +8 -0
  8. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/agent.py +494 -0
  9. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/bridge.py +309 -0
  10. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/capabilities.py +73 -0
  11. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/commands.py +116 -0
  12. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/content.py +115 -0
  13. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/io_delegation.py +231 -0
  14. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/mcp_config.py +66 -0
  15. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/permissions.py +159 -0
  16. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/persistence.py +197 -0
  17. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/register_callbacks.py +110 -0
  18. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/replay.py +114 -0
  19. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/session.py +329 -0
  20. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/session_config.py +179 -0
  21. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/acp/state.py +135 -0
  22. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/__init__.py +22 -0
  23. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/config.py +208 -0
  24. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/discovery.py +337 -0
  25. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/downloader.py +392 -0
  26. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/enabled_skills.py +82 -0
  27. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/installer.py +22 -0
  28. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/metadata.py +219 -0
  29. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/prompt_builder.py +49 -0
  30. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/provider.py +52 -0
  31. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/register_callbacks.py +309 -0
  32. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/remote_catalog.py +322 -0
  33. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/skill_catalog.py +257 -0
  34. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/skill_commands.py +102 -0
  35. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/skills_install_menu.py +698 -0
  36. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/agent_skills/skills_menu.py +794 -0
  37. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/aws_bedrock/__init__.py +14 -0
  38. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/aws_bedrock/config.py +101 -0
  39. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/aws_bedrock/register_callbacks.py +243 -0
  40. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/aws_bedrock/utils.py +186 -0
  41. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/azure_foundry/README.md +238 -0
  42. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/azure_foundry/__init__.py +15 -0
  43. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/azure_foundry/config.py +126 -0
  44. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/azure_foundry/discovery.py +189 -0
  45. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/azure_foundry/register_callbacks.py +506 -0
  46. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/azure_foundry/token.py +182 -0
  47. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/azure_foundry/utils.py +375 -0
  48. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/btw/__init__.py +1 -0
  49. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/btw/inline_view.py +135 -0
  50. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/btw/register_callbacks.py +106 -0
  51. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/btw/side_query.py +91 -0
  52. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/chatgpt_oauth/IMAGEGEN_SKILL.md +83 -0
  53. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/chatgpt_oauth/__init__.py +8 -0
  54. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/chatgpt_oauth/config.py +52 -0
  55. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/chatgpt_oauth/image_generation.py +253 -0
  56. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/chatgpt_oauth/image_tool.py +70 -0
  57. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/chatgpt_oauth/oauth_flow.py +461 -0
  58. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/chatgpt_oauth/register_callbacks.py +288 -0
  59. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/chatgpt_oauth/test_plugin.py +663 -0
  60. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/chatgpt_oauth/usage.py +113 -0
  61. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/chatgpt_oauth/utils.py +534 -0
  62. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/claude_code_hooks/__init__.py +1 -0
  63. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/claude_code_hooks/config.py +137 -0
  64. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/claude_code_hooks/register_callbacks.py +383 -0
  65. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/claude_code_oauth/README.md +167 -0
  66. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/claude_code_oauth/SETUP.md +93 -0
  67. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/claude_code_oauth/__init__.py +25 -0
  68. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/claude_code_oauth/config.py +59 -0
  69. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/claude_code_oauth/fast_mode.py +122 -0
  70. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/claude_code_oauth/prompt_handler.py +64 -0
  71. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/claude_code_oauth/register_callbacks.py +719 -0
  72. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/claude_code_oauth/test_plugin.py +285 -0
  73. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/claude_code_oauth/token_refresh_heartbeat.py +240 -0
  74. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/claude_code_oauth/utils.py +663 -0
  75. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/code_puppy_agent/AGENTS_AND_TOOLS.md +155 -0
  76. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/code_puppy_agent/MODELS_AND_MCP.md +104 -0
  77. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/code_puppy_agent/PLUGINS_AND_CALLBACKS.md +147 -0
  78. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/code_puppy_agent/SESSIONS_AND_HISTORY.md +39 -0
  79. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/code_puppy_agent/SKILL.md +180 -0
  80. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/code_puppy_agent/SKILLS_SYSTEM.md +136 -0
  81. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/code_puppy_agent/SYSTEM_PROMPT_CONFIG_AND_I18N.md +160 -0
  82. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/code_puppy_agent/__init__.py +5 -0
  83. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/code_puppy_agent/register_callbacks.py +46 -0
  84. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/NativeCapture.swift +123 -0
  85. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/README.md +109 -0
  86. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/__init__.py +1 -0
  87. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/accessibility.py +163 -0
  88. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/activation.py +75 -0
  89. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/backend.py +584 -0
  90. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/backend_types.py +5 -0
  91. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/capture.py +110 -0
  92. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/commands.py +62 -0
  93. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/geometry.py +81 -0
  94. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/inline_image.py +56 -0
  95. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/keycodes.py +47 -0
  96. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/policy.py +144 -0
  97. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/register_callbacks.py +96 -0
  98. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/safety.py +18 -0
  99. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/settle.py +64 -0
  100. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/state.py +86 -0
  101. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/computer_use/tools.py +469 -0
  102. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/context_indicator/__init__.py +14 -0
  103. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/context_indicator/register_callbacks.py +249 -0
  104. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/context_indicator/usage.py +40 -0
  105. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/copilot_auth/__init__.py +11 -0
  106. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/copilot_auth/config.py +93 -0
  107. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/copilot_auth/reasoning_client.py +409 -0
  108. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/copilot_auth/register_callbacks.py +460 -0
  109. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/copilot_auth/utils.py +587 -0
  110. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/customizable_commands/__init__.py +0 -0
  111. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/customizable_commands/register_callbacks.py +464 -0
  112. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/dbos_durable_exec/__init__.py +1 -0
  113. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/dbos_durable_exec/cancel.py +15 -0
  114. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/dbos_durable_exec/commands.py +31 -0
  115. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/dbos_durable_exec/config.py +31 -0
  116. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/dbos_durable_exec/lifecycle.py +83 -0
  117. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/dbos_durable_exec/register_callbacks.py +45 -0
  118. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/dbos_durable_exec/runtime.py +65 -0
  119. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/dbos_durable_exec/startup_lock.py +155 -0
  120. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/dbos_durable_exec/workflow_ids.py +16 -0
  121. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/dbos_durable_exec/wrapper.py +58 -0
  122. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/destructive_command_guard/AGENTS.md +79 -0
  123. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/destructive_command_guard/__init__.py +14 -0
  124. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/destructive_command_guard/detector.py +374 -0
  125. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/destructive_command_guard/register_callbacks.py +165 -0
  126. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/emoji_filter/__init__.py +12 -0
  127. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/emoji_filter/config.py +26 -0
  128. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/emoji_filter/register_callbacks.py +238 -0
  129. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/emoji_filter/stripper.py +45 -0
  130. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/empty_html_comment_filter/register_callbacks.py +116 -0
  131. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/example_custom_command/README.md +328 -0
  132. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/example_custom_command/register_callbacks.py +66 -0
  133. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/file_permission_handler/__init__.py +4 -0
  134. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/file_permission_handler/register_callbacks.py +575 -0
  135. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/__init__.py +5 -0
  136. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/_docs/README.md +173 -0
  137. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/_docs/cheatsheet.md +86 -0
  138. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/_docs/pipeline.md +167 -0
  139. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/_docs/synopsis.md +392 -0
  140. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/about.md +51 -0
  141. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/address-feedback.md +129 -0
  142. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/ask.md +211 -0
  143. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/aug.md +181 -0
  144. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/auto-pilot.md +71 -0
  145. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/cheatsheet.md +16 -0
  146. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/commit.md +103 -0
  147. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/config.md +108 -0
  148. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/create-pr.md +195 -0
  149. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/exec.md +221 -0
  150. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/new.md +151 -0
  151. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/qa.md +208 -0
  152. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/rebase.md +180 -0
  153. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/review.md +304 -0
  154. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/split.md +120 -0
  155. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/squash-commits.md +179 -0
  156. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/status.md +46 -0
  157. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/tests.md +155 -0
  158. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/scripts/flux_about.py +154 -0
  159. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/scripts/flux_cheatsheet.py +248 -0
  160. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/bundled/scripts/flux_status.py +345 -0
  161. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/installer.py +256 -0
  162. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/flux_bootstrap/register_callbacks.py +71 -0
  163. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/force_push_guard/__init__.py +5 -0
  164. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/force_push_guard/detector.py +96 -0
  165. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/force_push_guard/register_callbacks.py +161 -0
  166. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/fork/__init__.py +7 -0
  167. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/fork/register_callbacks.py +445 -0
  168. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/frontend_emitter/__init__.py +25 -0
  169. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/frontend_emitter/emitter.py +249 -0
  170. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/frontend_emitter/register_callbacks.py +412 -0
  171. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/frontend_emitter/session_context.py +50 -0
  172. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/grok_oauth/__init__.py +6 -0
  173. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/grok_oauth/config.py +49 -0
  174. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/grok_oauth/oauth_flow.py +213 -0
  175. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/grok_oauth/register_callbacks.py +132 -0
  176. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/grok_oauth/utils.py +195 -0
  177. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/herdr/README.md +168 -0
  178. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/herdr/__init__.py +9 -0
  179. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/herdr/client.py +339 -0
  180. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/herdr/register_callbacks.py +140 -0
  181. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/herdr/reporter.py +212 -0
  182. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/herdr/smoke.py +143 -0
  183. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/herdr/sources.py +133 -0
  184. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/hook_creator/__init__.py +1 -0
  185. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/hook_creator/register_callbacks.py +33 -0
  186. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/hook_manager/__init__.py +1 -0
  187. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/hook_manager/config.py +290 -0
  188. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/hook_manager/hooks_menu.py +571 -0
  189. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/hook_manager/register_callbacks.py +227 -0
  190. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/meta_oauth/__init__.py +1 -0
  191. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/meta_oauth/config.py +55 -0
  192. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/meta_oauth/oauth_flow.py +109 -0
  193. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/meta_oauth/register_callbacks.py +154 -0
  194. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/meta_oauth/utils.py +252 -0
  195. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/namespace_skill_search/README.md +118 -0
  196. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/namespace_skill_search/__init__.py +15 -0
  197. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/namespace_skill_search/namespaces.py +125 -0
  198. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/namespace_skill_search/register_callbacks.py +99 -0
  199. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/namespace_skill_search/search_tool.py +158 -0
  200. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/no_tools/__init__.py +0 -0
  201. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/no_tools/register_callbacks.py +42 -0
  202. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/oauth_pasteback.py +110 -0
  203. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/oauth_puppy_html.py +194 -0
  204. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/obsidian_agent/README.md +52 -0
  205. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/obsidian_agent/__init__.py +8 -0
  206. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/obsidian_agent/agent_obsidian.py +147 -0
  207. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/obsidian_agent/register_callbacks.py +13 -0
  208. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/ollama/__init__.py +1 -0
  209. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/ollama/register_callbacks.py +127 -0
  210. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/ollama_setup/__init__.py +5 -0
  211. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/ollama_setup/completer.py +38 -0
  212. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/ollama_setup/register_callbacks.py +419 -0
  213. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/plugin_list/__init__.py +0 -0
  214. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/plugin_list/plugin_contributions.py +348 -0
  215. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/plugin_list/plugin_meta.py +67 -0
  216. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/plugin_list/plugin_text_utils.py +173 -0
  217. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/plugin_list/plugins_menu.py +455 -0
  218. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/plugin_list/plugins_menu_layout.py +194 -0
  219. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/plugin_list/plugins_menu_render.py +431 -0
  220. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/plugin_list/project_trust_flow.py +162 -0
  221. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/plugin_list/register_callbacks.py +281 -0
  222. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/pop_command/__init__.py +1 -0
  223. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/pop_command/register_callbacks.py +191 -0
  224. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/prompt_newline/__init__.py +13 -0
  225. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/prompt_newline/config.py +21 -0
  226. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/prompt_newline/register_callbacks.py +163 -0
  227. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/prune/__init__.py +1 -0
  228. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/prune/prune_menu.py +308 -0
  229. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/prune/prune_model.py +517 -0
  230. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/prune/prune_render.py +354 -0
  231. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/prune/register_callbacks.py +388 -0
  232. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_kennel/README.md +203 -0
  233. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_kennel/__init__.py +6 -0
  234. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_kennel/commands.py +206 -0
  235. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_kennel/config.py +36 -0
  236. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_kennel/kennel.py +368 -0
  237. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_kennel/packer.py +152 -0
  238. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_kennel/recorder.py +83 -0
  239. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_kennel/register_callbacks.py +109 -0
  240. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_kennel/retriever.py +28 -0
  241. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_kennel/schema.py +78 -0
  242. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_kennel/state.py +68 -0
  243. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_kennel/tools.py +449 -0
  244. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_kennel/wings.py +110 -0
  245. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_spinner/README.md +93 -0
  246. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_spinner/__init__.py +11 -0
  247. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_spinner/builtin_frames.py +172 -0
  248. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_spinner/commands.py +116 -0
  249. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_spinner/picker.py +379 -0
  250. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_spinner/register_callbacks.py +193 -0
  251. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/puppy_spinner/spinners.py +444 -0
  252. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/quick_resume/__init__.py +0 -0
  253. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/quick_resume/register_callbacks.py +77 -0
  254. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/review_pr/__init__.py +1 -0
  255. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/review_pr/register_callbacks.py +162 -0
  256. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/shell_safety/__init__.py +6 -0
  257. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/shell_safety/agent_shell_safety.py +69 -0
  258. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/shell_safety/command_cache.py +156 -0
  259. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/shell_safety/register_callbacks.py +203 -0
  260. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/stack_dump/__init__.py +1 -0
  261. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/stack_dump/register_callbacks.py +79 -0
  262. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/statusline/__init__.py +14 -0
  263. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/statusline/config.py +68 -0
  264. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/statusline/payload.py +138 -0
  265. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/statusline/prompt_patch.py +76 -0
  266. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/statusline/register_callbacks.py +45 -0
  267. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/statusline/runner.py +122 -0
  268. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/statusline/statusline_command.py +197 -0
  269. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/steer_queue/__init__.py +10 -0
  270. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/steer_queue/queue_menu.py +444 -0
  271. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/steer_queue/register_callbacks.py +138 -0
  272. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/subagent_panel/README.md +102 -0
  273. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/subagent_panel/__init__.py +24 -0
  274. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/subagent_panel/coalesce_patch.py +242 -0
  275. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/subagent_panel/panel_render.py +145 -0
  276. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/subagent_panel/register_callbacks.py +535 -0
  277. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/subagent_panel/resume_repaint.py +112 -0
  278. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/subagent_panel/state.py +231 -0
  279. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/switch_agent_resume/__init__.py +5 -0
  280. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/switch_agent_resume/register_callbacks.py +314 -0
  281. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/theme/README.md +86 -0
  282. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/theme/__init__.py +14 -0
  283. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/theme/bundled_palettes.py +346 -0
  284. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/theme/content_styles.py +146 -0
  285. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/theme/osc_palette.py +178 -0
  286. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/theme/picker.py +358 -0
  287. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/theme/prompt_toolkit_theme.py +113 -0
  288. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/theme/register_callbacks.py +348 -0
  289. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/theme/rich_themes.py +202 -0
  290. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/theme/themes.py +720 -0
  291. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/timestamp_heartbeat/__init__.py +1 -0
  292. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/timestamp_heartbeat/register_callbacks.py +114 -0
  293. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/token_ratio_learner/__init__.py +5 -0
  294. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/token_ratio_learner/ratios.py +208 -0
  295. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/token_ratio_learner/register_callbacks.py +213 -0
  296. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/universal_constructor/__init__.py +13 -0
  297. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/universal_constructor/models.py +138 -0
  298. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/universal_constructor/provider.py +62 -0
  299. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/universal_constructor/register_callbacks.py +75 -0
  300. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/universal_constructor/registry.py +302 -0
  301. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/universal_constructor/sandbox.py +584 -0
  302. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/wide_completion_menu/__init__.py +6 -0
  303. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/wide_completion_menu/register_callbacks.py +165 -0
  304. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/wiggum/__init__.py +1 -0
  305. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/wiggum/goal_runs.py +91 -0
  306. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/wiggum/judge.py +299 -0
  307. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/wiggum/judge_config.py +249 -0
  308. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/wiggum/judges_menu.py +814 -0
  309. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/wiggum/register_callbacks.py +569 -0
  310. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/wiggum/state.py +89 -0
  311. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/yolo_cli/__init__.py +1 -0
  312. code_puppy_core_plugins-0.0.2/code_puppy_core_plugins/yolo_cli/register_callbacks.py +41 -0
  313. code_puppy_core_plugins-0.0.2/pyproject.toml +100 -0
@@ -0,0 +1,8 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.py[cod]
4
+ .pytest_cache/
5
+ .coverage
6
+ htmlcov/
7
+ dist/
8
+ *.egg-info/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Mike Pfaffenberger
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.5
2
+ Name: code-puppy-core-plugins
3
+ Version: 0.0.2
4
+ Summary: Official plugin bundle for Code Puppy
5
+ Project-URL: Repository, https://github.com/mpfaffenberger/code_puppy_core_plugins
6
+ Project-URL: Homepage, https://github.com/mpfaffenberger/code_puppy_core_plugins
7
+ Author: Michael Pfaffenberger
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Requires-Python: <3.15,>=3.11
17
+ Description-Content-Type: text/markdown
18
+
19
+ # Code Puppy Core Plugins
20
+
21
+ Official plugin bundle for [Code Puppy](https://github.com/mpfaffenberger/code_puppy).
22
+
23
+ This distribution contains Code Puppy's builtin feature plugins. The core runtime
24
+ discovers them through the `code_puppy.plugins` Python entry-point group, so the
25
+ runtime remains independent of plugin implementation modules.
26
+
27
+ ## Installation
28
+
29
+ Normal users do not need to install this package directly: `code-puppy` depends
30
+ on it and installs a compatible version automatically.
31
+
32
+ For development:
33
+
34
+ ```bash
35
+ git clone https://github.com/mpfaffenberger/code_puppy.git
36
+
37
+ git clone https://github.com/mpfaffenberger/code_puppy_core_plugins.git
38
+ cd code_puppy_core_plugins
39
+ uv sync
40
+ uv pip install -e ../code_puppy
41
+ uv pip install -e .
42
+ uv run pytest
43
+ ```
44
+
45
+ ## Architecture
46
+
47
+ Each plugin is a package under `code_puppy_core_plugins/` with one
48
+ `register_callbacks.py`. Package metadata advertises those modules as entry
49
+ points. Code Puppy loads the entry points as its builtin tier, followed by user
50
+ plugins and trusted project plugins.
51
+
52
+ The package deliberately does not depend on `code-puppy` in its own metadata.
53
+ `code-puppy` depends on this bundle; adding the reverse edge would create a
54
+ packaging dependency cycle. Plugin CI installs the core runtime separately.
55
+
56
+ ## Releases
57
+
58
+ Pushes to `main` run lint and tests, bump the patch version, build, publish to
59
+ PyPI as `code-puppy-core-plugins`, and push the version tag. Configure the
60
+ `PYPI_API_TOKEN` repository secret before the first release.
61
+
62
+ ## License
63
+
64
+ MIT
@@ -0,0 +1,46 @@
1
+ # Code Puppy Core Plugins
2
+
3
+ Official plugin bundle for [Code Puppy](https://github.com/mpfaffenberger/code_puppy).
4
+
5
+ This distribution contains Code Puppy's builtin feature plugins. The core runtime
6
+ discovers them through the `code_puppy.plugins` Python entry-point group, so the
7
+ runtime remains independent of plugin implementation modules.
8
+
9
+ ## Installation
10
+
11
+ Normal users do not need to install this package directly: `code-puppy` depends
12
+ on it and installs a compatible version automatically.
13
+
14
+ For development:
15
+
16
+ ```bash
17
+ git clone https://github.com/mpfaffenberger/code_puppy.git
18
+
19
+ git clone https://github.com/mpfaffenberger/code_puppy_core_plugins.git
20
+ cd code_puppy_core_plugins
21
+ uv sync
22
+ uv pip install -e ../code_puppy
23
+ uv pip install -e .
24
+ uv run pytest
25
+ ```
26
+
27
+ ## Architecture
28
+
29
+ Each plugin is a package under `code_puppy_core_plugins/` with one
30
+ `register_callbacks.py`. Package metadata advertises those modules as entry
31
+ points. Code Puppy loads the entry points as its builtin tier, followed by user
32
+ plugins and trusted project plugins.
33
+
34
+ The package deliberately does not depend on `code-puppy` in its own metadata.
35
+ `code-puppy` depends on this bundle; adding the reverse edge would create a
36
+ packaging dependency cycle. Plugin CI installs the core runtime separately.
37
+
38
+ ## Releases
39
+
40
+ Pushes to `main` run lint and tests, bump the patch version, build, publish to
41
+ PyPI as `code-puppy-core-plugins`, and push the version tag. Configure the
42
+ `PYPI_API_TOKEN` repository secret before the first release.
43
+
44
+ ## License
45
+
46
+ MIT
@@ -0,0 +1,5 @@
1
+ """Official plugin bundle for Code Puppy.
2
+
3
+ Plugins are discovered through the ``code_puppy.plugins`` entry-point group.
4
+ Importing this package alone performs no registration side effects.
5
+ """
@@ -0,0 +1,266 @@
1
+ # `acp` — Code Puppy as a native ACP agent
2
+
3
+ Run Code Puppy inside any ACP-capable editor's agent panel (e.g.
4
+ [Zed](https://github.com/zed-industries/zed))
5
+ by speaking the **Agent Client Protocol (ACP)** — the same JSON-RPC-over-stdio
6
+ protocol these editors use to host Gemini CLI and Claude Code.
7
+
8
+ This plugin is built on the **official [`agent-client-protocol`](https://pypi.org/project/agent-client-protocol/)
9
+ Python SDK** (`acp`). The SDK owns the wire — stdio binding, JSON-RPC framing,
10
+ typed Pydantic models, and the bidirectional connection — so this plugin is
11
+ pure *behaviour*: mapping ACP sessions to Code Puppy agents, translating
12
+ runtime events into `session/update`s, and routing Code Puppy's I/O + approval
13
+ edges to the client.
14
+
15
+ > **Status:** live over real stdio. Implemented: `initialize`, `session/new`,
16
+ > `session/load` (replays persisted history), `session/prompt`,
17
+ > `session/cancel` (also kills local shells), `session/list`, `session/close`,
18
+ > `session/fork` (duplicates history), `session/resume` (rehydrates across
19
+ restarts), `session/set_mode`, `session/set_config_option`. Assistant text +
20
+ > thinking stream as `agent_message_chunk` / `agent_thought_chunk`; tool calls
21
+ > stream as `tool_call` / `tool_call_update` (with `kind`, file `locations`,
22
+ > friendly titles, and inline diffs); slash commands are advertised via
23
+ > `available_commands_update` **and executed** when the client sends one. Prompt
24
+ > turns report token usage; **image** input is accepted. Client-injected MCP
25
+ > servers and multi-root `additionalDirectories` are honoured. Workspace file
26
+ > I/O and shell delegate to the client (capability-gated), and **permissions**
27
+ > for file writes and shell commands are surfaced in the client's own allow/deny
28
+ > dialog in non-yolo mode.
29
+ >
30
+ > Not implemented: `elicitation/*` (the SDK's connection API exposes no
31
+ > elicitation call in 0.10.1), `plan` updates (Code Puppy has no plan model),
32
+ > and the unstable `document/*` / `nes/*` / `providers/*` surface.
33
+
34
+ ---
35
+
36
+ ## How the client hosts an external agent
37
+
38
+ 1. The client launches the agent as a **subprocess** and talks JSON-RPC 2.0 over the
39
+ process's **stdin/stdout** (stderr is free for logging).
40
+ 2. The agent advertises what it can do in an `initialize` handshake; the client
41
+ advertises what *it* can do (read/write files, run terminals, permissions).
42
+ 3. The client drives with `session/new` then `session/prompt`; the agent streams
43
+ progress back with `session/update` notifications and can call *back into
44
+ the client* for file I/O, terminals, and permission prompts.
45
+
46
+ This is a **bidirectional** JSON-RPC connection: both sides send requests.
47
+
48
+ ### Registering us in a client
49
+
50
+ Registration is client-specific. Example — Zed's `settings.json`:
51
+
52
+ ```jsonc
53
+ {
54
+ "agent_servers": {
55
+ "Code Puppy": { "command": "code-puppy", "args": ["--acp"], "env": {} }
56
+ }
57
+ }
58
+ ```
59
+
60
+ Then "Code Puppy" appears in the agent panel's "New Thread" menu.
61
+
62
+ ---
63
+
64
+ ## Why the official SDK
65
+
66
+ We adopted `agent-client-protocol` instead of hand-rolling JSON-RPC because it
67
+ gives us, maintained and spec-accurate:
68
+
69
+ * **Typed models** for the entire protocol (`InitializeResponse`,
70
+ `SessionNotification`, all content/capability/tool-call types).
71
+ * **`acp.run_agent(agent)`** — binds stdio, frames ndjson JSON-RPC, parses
72
+ params into models, dispatches to our `Agent`, and hands us a `Client`
73
+ connection for talking back.
74
+ * **Update builders** (`update_agent_message_text`, `start_tool_call`, …).
75
+
76
+ Net effect: ~400 lines of hand-rolled transport/framing/capability code
77
+ deleted, correct-by-construction wire behaviour, and a PR that speaks the
78
+ project's own library. Our two small **core seams stay unchanged** — only the
79
+ plugin's protocol layer changed.
80
+
81
+ ---
82
+
83
+ ## Design decisions (locked in)
84
+
85
+ | Decision | Choice |
86
+ |----------|--------|
87
+ | **Protocol layer** | **Official `acp` SDK.** We implement its `Agent` interface; `acp.run_agent` owns stdio + framing. |
88
+ | **Who does I/O** | **Delegated to the client when the client supports it.** Workspace file reads/writes go through the client's `fs/read_text_file` / `fs/write_text_file` (edits land in the client's diff UI; reads see unsaved buffers), and shell commands run via the client's `terminal/*`. This rides two small, general **I/O-backend seams** in core (`code_puppy/tools/io_backends.py`): a sync `FileSystemBackend` and an async `CommandExecutor`, both `None` by default (local I/O) and installed by this plugin, capability-gated, after `initialize`. Internal writes (config, session state, agent metadata) deliberately stay local — only *workspace* edits reroute (via `common.write_project_file`). |
89
+ | **Permissions** | **the client is the authority (non-yolo).** Every approval — file writes and shell commands — is surfaced in the client's own allow/deny dialog via `session/request_permission`. No yolo forcing, no terminal prompts. |
90
+ | **Entry point** | A `--acp` CLI flag contributed via the `register_cli_args` hook; `handle_cli_args` boots the agent (on its own loop, in a thread) and short-circuits normal TUI startup. |
91
+ | **Core footprint** | Small, general, additive core seams — **no monkeypatching**: (1) a pluggable *approval backend* (`common.set_approval_backend`), (2) a *workspace write* wrapper (`common.write_project_file`) + backend-aware `_read_file`, and (3) `FileSystemBackend` / `CommandExecutor` registries (`tools/io_backends.py`). Each is useful to any non-terminal embedder, not ACP-specific. Everything else is this plugin + existing public hooks + the SDK. |
92
+
93
+ ### Permissions in non-yolo mode (the important part)
94
+
95
+ Code Puppy has two approval edges. In a headless ACP server there is no TTY, so
96
+ the built-in stdin prompt would **fail closed** (auto-deny every file op — a
97
+ latent bug this integration also fixes). We route both edges to the client *without*
98
+ forcing yolo and *without* patching tool logic:
99
+
100
+ * **File operations** use the **approval-backend seam** in `tools.common`. Sync
101
+ file tools run in Code Puppy's tool threadpool, so the backend
102
+ (`permissions.py`) bridges to the ACP event loop with
103
+ `run_coroutine_threadsafe` to ask the client via the SDK's `request_permission`,
104
+ then blocks the worker thread for the answer. The loop is free to service the
105
+ round-trip → no deadlock (guarded against being called on the loop itself).
106
+ * **Shell commands** use the async `run_shell_command` hook (it runs on the ACP
107
+ loop and can `await` the client directly).
108
+
109
+ Both edges **fail closed** if the connection drops or the client errors.
110
+
111
+ ---
112
+
113
+ ## Module layout
114
+
115
+ Every file stays well under the 600-line cap and owns one concern.
116
+
117
+ | File | Responsibility |
118
+ |------|----------------|
119
+ | `register_callbacks.py` | Register the `--acp` flag; when present, redirect the console to stderr, run `acp.run_agent(CodePuppyAgent())` on its own loop in a thread, and return `{"handled": True}` so the TUI never starts. |
120
+ | `agent.py` | `CodePuppyAgent(acp.Agent)` — the SDK agent implementation: initialize, new/load/resume/fork/list/close session, prompt, cancel, set_session_mode/model, set_config_option, authenticate, plus `on_connect` (stashes the client handle + installs approvals). |
121
+ | `capabilities.py` | Declarative capability negotiation in SDK models: our `AgentCapabilities`, and parsing the client's `ClientCapabilities` into `(fs_read, fs_write, terminal)`. |
122
+ | `content.py` | Parse ACP prompt content blocks → text + multimodal attachments (`BinaryContent` / `ImageUrl`), honouring `embeddedContext` + `image`. |
123
+ | `session.py` | `ACPSession`: one ACP session ⇄ one `BaseAgent` + its `_message_history`. Runs each turn as a cancellable `asyncio.Task`; persists history after each turn; owns the final-result fallback. |
124
+ | `commands.py` | Execute client-typed `/slash` commands via `command_handler`, capturing MessageBus output and forwarding it (never touches stdin). |
125
+ | `persistence.py` | Pickle each session's history under `AUTOSAVE_DIR/acp` keyed by session id, plus an ACP metadata sidecar (`cwd` + `additionalDirectories` + title). Rehydrate on `load`/`resume`/`fork`; enumerate for `session/list` (`list_persisted`); tombstone on `session/close` (`delete`). |
126
+ | `replay.py` | On `load`/`resume`, stream the rehydrated history back to the client as ordered `session/update`s (user / agent text / thinking / past tool calls) so the client rebuilds the thread UI. |
127
+ | `mcp_config.py` | Translate client-injected ACP MCP server specs → pydantic-ai servers on the session agent. |
128
+ | `session_config.py` | Build the model list (surfaced as ACP *modes*) + safe config options; apply `set_mode` / `set_config_option`. |
129
+ | `bridge.py` | `EventBridge`: registers `stream_event` / `pre_tool_call` / `post_tool_call` hooks and translates them into SDK `session/update`s via `connection.session_update`. (Hooks, **not** MessageBus — see *Event source*.) |
130
+ | `permissions.py` | Wires Code Puppy's two approval edges to the client via the SDK's `request_permission`: the `tools.common` approval backend (files, cross-thread) and the `run_shell_command` hook (shell). Fails closed. |
131
+ | `io_delegation.py` | `DelegatedFileSystemBackend` (sync, cross-thread) + `DelegatedCommandExecutor` (async terminal lifecycle) that plug into the core I/O seams, capability-gated. |
132
+ | `state.py` | Process-wide run context: the SDK connection + its loop, the active session id, and the open-tool-call stack — so the permission/I/O seams (plain module functions) can reach the running connection and correlate events. |
133
+
134
+ ```
135
+ Client ──stdin──▶ acp.run_agent ──▶ CodePuppyAgent.prompt ──▶ ACPSession ──▶ agent.run_with_mcp
136
+
137
+ stream_event / pre_tool_call / post_tool_call hooks fire ─────┘
138
+
139
+
140
+ bridge ──▶ connection.session_update ──stdout──▶ the client
141
+
142
+ │ agent needs to read/write/run/ask
143
+ └── permissions / io_delegation ──▶ connection.{request_permission,
144
+ read_text_file, write_text_file, create_terminal, …} ──▶ the client
145
+ ```
146
+
147
+ ### Event source: hooks, not the MessageBus
148
+
149
+ Code Puppy's `MessageBus` is **single-consumer** and *buffers* until a renderer
150
+ attaches; agent text streams through pydantic-ai's `event_stream_handler`
151
+ (which fires the `stream_event` callback), not the bus. So the bridge taps the
152
+ **callback hooks** — the same seam the shipping `frontend_emitter` plugin uses:
153
+
154
+ | Hook | Fires with | ACP update |
155
+ |------|-----------|------------|
156
+ | `stream_event` (`part_delta`, `TextPartDelta`) | `event_data.delta.content_delta` | `agent_message_chunk` |
157
+ | `stream_event` (`part_delta`, `ThinkingPartDelta`) | `event_data.delta.content_delta` | `agent_thought_chunk` |
158
+ | `pre_tool_call` | `tool_name`, `tool_args` | `tool_call` (status `in_progress`) |
159
+ | `post_tool_call` | `tool_name`, `result` | `tool_call_update` (status `completed`/`failed`) |
160
+
161
+ Run context (active session id, whether text streamed, the open-tool-call
162
+ stack) lives in `state`, so `bridge`, `permissions`, and `io_delegation` share
163
+ one source of truth. `set_session_context(session_id)` is also set around each
164
+ run so streamed events carry the right session id.
165
+
166
+ ### stdout is sacred
167
+
168
+ ACP speaks JSON-RPC on **stdout**, so nothing else may write there. At boot we
169
+ point the streaming console (`set_streaming_console`) and the root logger at
170
+ **stderr**; the interactive path that normally configures the console is
171
+ short-circuited in `--acp` mode.
172
+
173
+ ### Streaming-off fallback
174
+
175
+ `use_streaming` is config-gated. When off, no `stream_event` deltas fire, so the
176
+ session sends the return value of `run_with_mcp` as a single final
177
+ `agent_message_chunk`. `state` tracks whether any text streamed so we never
178
+ double-send.
179
+
180
+ ---
181
+
182
+ ## ACP surface we implement
183
+
184
+ ### Inbound (the client → us)
185
+
186
+ | Method | Behaviour |
187
+ |--------|-----------|
188
+ | `initialize` | Negotiate version + capabilities; install capability-gated I/O delegation. |
189
+ | `authenticate` / `logout` | No-op (auth is via Code Puppy's own model config/env). |
190
+ | `session/new` | Create an `ACPSession` (fresh `BaseAgent`) from `cwd` + `additionalDirectories`; attach client `mcpServers`; return models + config options; schedule `available_commands_update`. |
191
+ | `session/load` | Re-open a thread: **replay persisted history into the agent AND stream it back to the client** as `session/update`s so the client rebuilds the thread UI. |
192
+ | `session/resume` | Rehydrate + replay a session across a restart from persisted history. |
193
+ | `session/fork` | Branch a session: copy its history into a new id. Works on a live session **or** one persisted by a prior process (rehydrated from disk), so forking survives a restart. |
194
+ | `session/prompt` | Parse content blocks (text + image attachments) or execute a `/slash` command; run the agent as a cancellable task; stream updates; return stop reason **+ token usage**. |
195
+ | `session/cancel` | Cancel the in-flight run's task **and kill local shells** → `cancelled`. |
196
+ | `session/list` / `session/close` | List sessions (**live in-memory + persisted on disk**, deduped, so threads survive a restart and stay revivable) / drop a session (also deletes its persisted copy). |
197
+ | `session/set_mode` | Switch the active model, rebinding the session agent (history preserved). Code Puppy surfaces its model list as ACP *modes* (0.11 removed the separate models API). |
198
+ | `session/set_config_option` | Apply a safe config change (streaming toggle); never yolo. |
199
+ | `session/set_mode` | No-op (Code Puppy has one mode). |
200
+
201
+ Not implemented: `elicitation/*` (the SDK connection exposes no elicitation
202
+ call in 0.10.1), `plan` updates (no native plan model), and the unstable
203
+ `document/*` / `nes/*` / `providers/*` surface. The SDK router resolves any
204
+ unimplemented method to a clean "method not found", so we advertise honestly
205
+ and stub nothing.
206
+
207
+ ### Outbound notifications (us → the client) — `session/update`
208
+
209
+ `agent_message_chunk`, `agent_thought_chunk`, `tool_call`, `tool_call_update`,
210
+ `available_commands_update`. Tool calls carry human-friendly titles
211
+ ("Edit foo.py", "Run: pytest"), a `kind`, file `locations`, and — on completion
212
+ — the unified diff as an inline `diff` content block so edits are visible in
213
+ the client's tool-call entry.
214
+
215
+ ### Outbound requests (us → the client)
216
+
217
+ `session/request_permission` (approvals), and — when the client advertises the
218
+ capability — `fs/read_text_file`, `fs/write_text_file`, and the `terminal/*`
219
+ family (`create`, `wait_for_exit`, `output`, `kill`, `release`).
220
+
221
+ ---
222
+
223
+ ## Session & history model
224
+
225
+ - One ACP session id ⇄ one `ACPSession` ⇄ one `BaseAgent` instance.
226
+ - Multi-turn is native: `_message_history` persists across `session/prompt`
227
+ calls within the same session.
228
+ - `cwd` from `session/new` anchors that session's tools.
229
+
230
+ ---
231
+
232
+ ## Interactive tools (`ask_user_question`)
233
+
234
+ Code Puppy's `ask_user_question` renders a terminal picker and reads stdin —
235
+ neither is available over ACP (stdin *is* the JSON-RPC pipe). The tool's own
236
+ `isatty()` guard already makes it fail closed there (no stdout corruption), but
237
+ the default "not an interactive terminal" error is a dead end.
238
+
239
+ So in ACP mode the `EventBridge` **blocks** `ask_user_question` at the
240
+ `pre_tool_call` seam (before any tool-call entry is opened) and returns guidance
241
+ steering the model to *ask the user directly in its normal text response* — which
242
+ the client renders as a regular assistant message the user can reply to. This is
243
+ the pragmatic stand-in until ACP ratifies structured **elicitation** (currently
244
+ only an [RFD](https://agentclientprotocol.com), not in stable v1 — no client,
245
+ including Zed, implements it yet). When elicitation lands and the SDK exposes a
246
+ connection method for it, this block becomes a real native picker.
247
+
248
+ ---
249
+
250
+ ## Testing
251
+
252
+ `tests/test_acp_plugin.py` drives `CodePuppyAgent` directly against a fake SDK
253
+ connection (no real stdio) and covers:
254
+
255
+ - capability negotiation + client-cap parsing,
256
+ - content-block flattening (incl. embedded resources),
257
+ - lifecycle: initialize / new_session / prompt (stream + fallback) / cancel /
258
+ list / close / unknown-session error,
259
+ - tool-call `kind` / `locations` / pre↔post correlation,
260
+ - the core approval-backend seam (sync + async) + the shell hook,
261
+ - the **cross-thread approval bridge** (worker thread → ACP loop → the client → back),
262
+ - I/O delegation core seams + the client fs/terminal backends (capability-gated).
263
+
264
+ Real end-to-end: `code-puppy --acp` spawned as a subprocess answers
265
+ `initialize` + `session/new` with clean JSON-RPC on stdout. Manual: point a
266
+ real client at `code-puppy --acp` via `agent_servers`.
@@ -0,0 +1,8 @@
1
+ """Code Puppy as a native Agent Client Protocol (ACP) agent.
2
+
3
+ This plugin lets Code Puppy run as an external agent inside the client's agent
4
+ panel by speaking the Agent Client Protocol (ACP) — JSON-RPC 2.0 over
5
+ stdio. See ``README.md`` in this directory for the full design.
6
+
7
+ Boot it with ``code-puppy --acp`` (the client does this for you once configured).
8
+ """