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.
Files changed (313) hide show
  1. code_puppy_core_plugins/__init__.py +5 -0
  2. code_puppy_core_plugins/acp/README.md +266 -0
  3. code_puppy_core_plugins/acp/__init__.py +8 -0
  4. code_puppy_core_plugins/acp/agent.py +494 -0
  5. code_puppy_core_plugins/acp/bridge.py +309 -0
  6. code_puppy_core_plugins/acp/capabilities.py +73 -0
  7. code_puppy_core_plugins/acp/commands.py +116 -0
  8. code_puppy_core_plugins/acp/content.py +115 -0
  9. code_puppy_core_plugins/acp/io_delegation.py +231 -0
  10. code_puppy_core_plugins/acp/mcp_config.py +66 -0
  11. code_puppy_core_plugins/acp/permissions.py +159 -0
  12. code_puppy_core_plugins/acp/persistence.py +197 -0
  13. code_puppy_core_plugins/acp/register_callbacks.py +110 -0
  14. code_puppy_core_plugins/acp/replay.py +114 -0
  15. code_puppy_core_plugins/acp/session.py +329 -0
  16. code_puppy_core_plugins/acp/session_config.py +179 -0
  17. code_puppy_core_plugins/acp/state.py +135 -0
  18. code_puppy_core_plugins/agent_skills/__init__.py +22 -0
  19. code_puppy_core_plugins/agent_skills/config.py +208 -0
  20. code_puppy_core_plugins/agent_skills/discovery.py +337 -0
  21. code_puppy_core_plugins/agent_skills/downloader.py +392 -0
  22. code_puppy_core_plugins/agent_skills/enabled_skills.py +82 -0
  23. code_puppy_core_plugins/agent_skills/installer.py +22 -0
  24. code_puppy_core_plugins/agent_skills/metadata.py +219 -0
  25. code_puppy_core_plugins/agent_skills/prompt_builder.py +49 -0
  26. code_puppy_core_plugins/agent_skills/provider.py +52 -0
  27. code_puppy_core_plugins/agent_skills/register_callbacks.py +309 -0
  28. code_puppy_core_plugins/agent_skills/remote_catalog.py +322 -0
  29. code_puppy_core_plugins/agent_skills/skill_catalog.py +257 -0
  30. code_puppy_core_plugins/agent_skills/skill_commands.py +102 -0
  31. code_puppy_core_plugins/agent_skills/skills_install_menu.py +698 -0
  32. code_puppy_core_plugins/agent_skills/skills_menu.py +794 -0
  33. code_puppy_core_plugins/aws_bedrock/__init__.py +14 -0
  34. code_puppy_core_plugins/aws_bedrock/config.py +101 -0
  35. code_puppy_core_plugins/aws_bedrock/register_callbacks.py +243 -0
  36. code_puppy_core_plugins/aws_bedrock/utils.py +186 -0
  37. code_puppy_core_plugins/azure_foundry/README.md +238 -0
  38. code_puppy_core_plugins/azure_foundry/__init__.py +15 -0
  39. code_puppy_core_plugins/azure_foundry/config.py +126 -0
  40. code_puppy_core_plugins/azure_foundry/discovery.py +189 -0
  41. code_puppy_core_plugins/azure_foundry/register_callbacks.py +506 -0
  42. code_puppy_core_plugins/azure_foundry/token.py +182 -0
  43. code_puppy_core_plugins/azure_foundry/utils.py +375 -0
  44. code_puppy_core_plugins/btw/__init__.py +1 -0
  45. code_puppy_core_plugins/btw/inline_view.py +135 -0
  46. code_puppy_core_plugins/btw/register_callbacks.py +106 -0
  47. code_puppy_core_plugins/btw/side_query.py +91 -0
  48. code_puppy_core_plugins/chatgpt_oauth/IMAGEGEN_SKILL.md +83 -0
  49. code_puppy_core_plugins/chatgpt_oauth/__init__.py +8 -0
  50. code_puppy_core_plugins/chatgpt_oauth/config.py +52 -0
  51. code_puppy_core_plugins/chatgpt_oauth/image_generation.py +253 -0
  52. code_puppy_core_plugins/chatgpt_oauth/image_tool.py +70 -0
  53. code_puppy_core_plugins/chatgpt_oauth/oauth_flow.py +461 -0
  54. code_puppy_core_plugins/chatgpt_oauth/register_callbacks.py +288 -0
  55. code_puppy_core_plugins/chatgpt_oauth/test_plugin.py +663 -0
  56. code_puppy_core_plugins/chatgpt_oauth/usage.py +113 -0
  57. code_puppy_core_plugins/chatgpt_oauth/utils.py +534 -0
  58. code_puppy_core_plugins/claude_code_hooks/__init__.py +1 -0
  59. code_puppy_core_plugins/claude_code_hooks/config.py +137 -0
  60. code_puppy_core_plugins/claude_code_hooks/register_callbacks.py +383 -0
  61. code_puppy_core_plugins/claude_code_oauth/README.md +167 -0
  62. code_puppy_core_plugins/claude_code_oauth/SETUP.md +93 -0
  63. code_puppy_core_plugins/claude_code_oauth/__init__.py +25 -0
  64. code_puppy_core_plugins/claude_code_oauth/config.py +59 -0
  65. code_puppy_core_plugins/claude_code_oauth/fast_mode.py +122 -0
  66. code_puppy_core_plugins/claude_code_oauth/prompt_handler.py +64 -0
  67. code_puppy_core_plugins/claude_code_oauth/register_callbacks.py +719 -0
  68. code_puppy_core_plugins/claude_code_oauth/test_plugin.py +285 -0
  69. code_puppy_core_plugins/claude_code_oauth/token_refresh_heartbeat.py +240 -0
  70. code_puppy_core_plugins/claude_code_oauth/utils.py +663 -0
  71. code_puppy_core_plugins/code_puppy_agent/AGENTS_AND_TOOLS.md +155 -0
  72. code_puppy_core_plugins/code_puppy_agent/MODELS_AND_MCP.md +104 -0
  73. code_puppy_core_plugins/code_puppy_agent/PLUGINS_AND_CALLBACKS.md +147 -0
  74. code_puppy_core_plugins/code_puppy_agent/SESSIONS_AND_HISTORY.md +39 -0
  75. code_puppy_core_plugins/code_puppy_agent/SKILL.md +180 -0
  76. code_puppy_core_plugins/code_puppy_agent/SKILLS_SYSTEM.md +136 -0
  77. code_puppy_core_plugins/code_puppy_agent/SYSTEM_PROMPT_CONFIG_AND_I18N.md +160 -0
  78. code_puppy_core_plugins/code_puppy_agent/__init__.py +5 -0
  79. code_puppy_core_plugins/code_puppy_agent/register_callbacks.py +46 -0
  80. code_puppy_core_plugins/computer_use/NativeCapture.swift +123 -0
  81. code_puppy_core_plugins/computer_use/README.md +109 -0
  82. code_puppy_core_plugins/computer_use/__init__.py +1 -0
  83. code_puppy_core_plugins/computer_use/accessibility.py +163 -0
  84. code_puppy_core_plugins/computer_use/activation.py +75 -0
  85. code_puppy_core_plugins/computer_use/backend.py +584 -0
  86. code_puppy_core_plugins/computer_use/backend_types.py +5 -0
  87. code_puppy_core_plugins/computer_use/capture.py +110 -0
  88. code_puppy_core_plugins/computer_use/commands.py +62 -0
  89. code_puppy_core_plugins/computer_use/geometry.py +81 -0
  90. code_puppy_core_plugins/computer_use/inline_image.py +56 -0
  91. code_puppy_core_plugins/computer_use/keycodes.py +47 -0
  92. code_puppy_core_plugins/computer_use/policy.py +144 -0
  93. code_puppy_core_plugins/computer_use/register_callbacks.py +96 -0
  94. code_puppy_core_plugins/computer_use/safety.py +18 -0
  95. code_puppy_core_plugins/computer_use/settle.py +64 -0
  96. code_puppy_core_plugins/computer_use/state.py +86 -0
  97. code_puppy_core_plugins/computer_use/tools.py +469 -0
  98. code_puppy_core_plugins/context_indicator/__init__.py +14 -0
  99. code_puppy_core_plugins/context_indicator/register_callbacks.py +249 -0
  100. code_puppy_core_plugins/context_indicator/usage.py +40 -0
  101. code_puppy_core_plugins/copilot_auth/__init__.py +11 -0
  102. code_puppy_core_plugins/copilot_auth/config.py +93 -0
  103. code_puppy_core_plugins/copilot_auth/reasoning_client.py +409 -0
  104. code_puppy_core_plugins/copilot_auth/register_callbacks.py +460 -0
  105. code_puppy_core_plugins/copilot_auth/utils.py +587 -0
  106. code_puppy_core_plugins/customizable_commands/__init__.py +0 -0
  107. code_puppy_core_plugins/customizable_commands/register_callbacks.py +464 -0
  108. code_puppy_core_plugins/dbos_durable_exec/__init__.py +1 -0
  109. code_puppy_core_plugins/dbos_durable_exec/cancel.py +15 -0
  110. code_puppy_core_plugins/dbos_durable_exec/commands.py +31 -0
  111. code_puppy_core_plugins/dbos_durable_exec/config.py +31 -0
  112. code_puppy_core_plugins/dbos_durable_exec/lifecycle.py +83 -0
  113. code_puppy_core_plugins/dbos_durable_exec/register_callbacks.py +45 -0
  114. code_puppy_core_plugins/dbos_durable_exec/runtime.py +65 -0
  115. code_puppy_core_plugins/dbos_durable_exec/startup_lock.py +155 -0
  116. code_puppy_core_plugins/dbos_durable_exec/workflow_ids.py +16 -0
  117. code_puppy_core_plugins/dbos_durable_exec/wrapper.py +58 -0
  118. code_puppy_core_plugins/destructive_command_guard/AGENTS.md +79 -0
  119. code_puppy_core_plugins/destructive_command_guard/__init__.py +14 -0
  120. code_puppy_core_plugins/destructive_command_guard/detector.py +374 -0
  121. code_puppy_core_plugins/destructive_command_guard/register_callbacks.py +165 -0
  122. code_puppy_core_plugins/emoji_filter/__init__.py +12 -0
  123. code_puppy_core_plugins/emoji_filter/config.py +26 -0
  124. code_puppy_core_plugins/emoji_filter/register_callbacks.py +238 -0
  125. code_puppy_core_plugins/emoji_filter/stripper.py +45 -0
  126. code_puppy_core_plugins/empty_html_comment_filter/register_callbacks.py +116 -0
  127. code_puppy_core_plugins/example_custom_command/README.md +328 -0
  128. code_puppy_core_plugins/example_custom_command/register_callbacks.py +66 -0
  129. code_puppy_core_plugins/file_permission_handler/__init__.py +4 -0
  130. code_puppy_core_plugins/file_permission_handler/register_callbacks.py +575 -0
  131. code_puppy_core_plugins/flux_bootstrap/__init__.py +5 -0
  132. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/_docs/README.md +173 -0
  133. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/_docs/cheatsheet.md +86 -0
  134. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/_docs/pipeline.md +167 -0
  135. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/_docs/synopsis.md +392 -0
  136. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/about.md +51 -0
  137. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/address-feedback.md +129 -0
  138. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/ask.md +211 -0
  139. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/aug.md +181 -0
  140. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/auto-pilot.md +71 -0
  141. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/cheatsheet.md +16 -0
  142. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/commit.md +103 -0
  143. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/config.md +108 -0
  144. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/create-pr.md +195 -0
  145. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/exec.md +221 -0
  146. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/new.md +151 -0
  147. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/qa.md +208 -0
  148. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/rebase.md +180 -0
  149. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/review.md +304 -0
  150. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/split.md +120 -0
  151. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/squash-commits.md +179 -0
  152. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/status.md +46 -0
  153. code_puppy_core_plugins/flux_bootstrap/bundled/commands/flux/tests.md +155 -0
  154. code_puppy_core_plugins/flux_bootstrap/bundled/scripts/flux_about.py +154 -0
  155. code_puppy_core_plugins/flux_bootstrap/bundled/scripts/flux_cheatsheet.py +248 -0
  156. code_puppy_core_plugins/flux_bootstrap/bundled/scripts/flux_status.py +345 -0
  157. code_puppy_core_plugins/flux_bootstrap/installer.py +256 -0
  158. code_puppy_core_plugins/flux_bootstrap/register_callbacks.py +71 -0
  159. code_puppy_core_plugins/force_push_guard/__init__.py +5 -0
  160. code_puppy_core_plugins/force_push_guard/detector.py +96 -0
  161. code_puppy_core_plugins/force_push_guard/register_callbacks.py +161 -0
  162. code_puppy_core_plugins/fork/__init__.py +7 -0
  163. code_puppy_core_plugins/fork/register_callbacks.py +445 -0
  164. code_puppy_core_plugins/frontend_emitter/__init__.py +25 -0
  165. code_puppy_core_plugins/frontend_emitter/emitter.py +249 -0
  166. code_puppy_core_plugins/frontend_emitter/register_callbacks.py +412 -0
  167. code_puppy_core_plugins/frontend_emitter/session_context.py +50 -0
  168. code_puppy_core_plugins/grok_oauth/__init__.py +6 -0
  169. code_puppy_core_plugins/grok_oauth/config.py +49 -0
  170. code_puppy_core_plugins/grok_oauth/oauth_flow.py +213 -0
  171. code_puppy_core_plugins/grok_oauth/register_callbacks.py +132 -0
  172. code_puppy_core_plugins/grok_oauth/utils.py +195 -0
  173. code_puppy_core_plugins/herdr/README.md +168 -0
  174. code_puppy_core_plugins/herdr/__init__.py +9 -0
  175. code_puppy_core_plugins/herdr/client.py +339 -0
  176. code_puppy_core_plugins/herdr/register_callbacks.py +140 -0
  177. code_puppy_core_plugins/herdr/reporter.py +212 -0
  178. code_puppy_core_plugins/herdr/smoke.py +143 -0
  179. code_puppy_core_plugins/herdr/sources.py +133 -0
  180. code_puppy_core_plugins/hook_creator/__init__.py +1 -0
  181. code_puppy_core_plugins/hook_creator/register_callbacks.py +33 -0
  182. code_puppy_core_plugins/hook_manager/__init__.py +1 -0
  183. code_puppy_core_plugins/hook_manager/config.py +290 -0
  184. code_puppy_core_plugins/hook_manager/hooks_menu.py +571 -0
  185. code_puppy_core_plugins/hook_manager/register_callbacks.py +227 -0
  186. code_puppy_core_plugins/meta_oauth/__init__.py +1 -0
  187. code_puppy_core_plugins/meta_oauth/config.py +55 -0
  188. code_puppy_core_plugins/meta_oauth/oauth_flow.py +109 -0
  189. code_puppy_core_plugins/meta_oauth/register_callbacks.py +154 -0
  190. code_puppy_core_plugins/meta_oauth/utils.py +252 -0
  191. code_puppy_core_plugins/namespace_skill_search/README.md +118 -0
  192. code_puppy_core_plugins/namespace_skill_search/__init__.py +15 -0
  193. code_puppy_core_plugins/namespace_skill_search/namespaces.py +125 -0
  194. code_puppy_core_plugins/namespace_skill_search/register_callbacks.py +99 -0
  195. code_puppy_core_plugins/namespace_skill_search/search_tool.py +158 -0
  196. code_puppy_core_plugins/no_tools/__init__.py +0 -0
  197. code_puppy_core_plugins/no_tools/register_callbacks.py +42 -0
  198. code_puppy_core_plugins/oauth_pasteback.py +110 -0
  199. code_puppy_core_plugins/oauth_puppy_html.py +194 -0
  200. code_puppy_core_plugins/obsidian_agent/README.md +52 -0
  201. code_puppy_core_plugins/obsidian_agent/__init__.py +8 -0
  202. code_puppy_core_plugins/obsidian_agent/agent_obsidian.py +147 -0
  203. code_puppy_core_plugins/obsidian_agent/register_callbacks.py +13 -0
  204. code_puppy_core_plugins/ollama/__init__.py +1 -0
  205. code_puppy_core_plugins/ollama/register_callbacks.py +127 -0
  206. code_puppy_core_plugins/ollama_setup/__init__.py +5 -0
  207. code_puppy_core_plugins/ollama_setup/completer.py +38 -0
  208. code_puppy_core_plugins/ollama_setup/register_callbacks.py +419 -0
  209. code_puppy_core_plugins/plugin_list/__init__.py +0 -0
  210. code_puppy_core_plugins/plugin_list/plugin_contributions.py +348 -0
  211. code_puppy_core_plugins/plugin_list/plugin_meta.py +67 -0
  212. code_puppy_core_plugins/plugin_list/plugin_text_utils.py +173 -0
  213. code_puppy_core_plugins/plugin_list/plugins_menu.py +455 -0
  214. code_puppy_core_plugins/plugin_list/plugins_menu_layout.py +194 -0
  215. code_puppy_core_plugins/plugin_list/plugins_menu_render.py +431 -0
  216. code_puppy_core_plugins/plugin_list/project_trust_flow.py +162 -0
  217. code_puppy_core_plugins/plugin_list/register_callbacks.py +281 -0
  218. code_puppy_core_plugins/pop_command/__init__.py +1 -0
  219. code_puppy_core_plugins/pop_command/register_callbacks.py +191 -0
  220. code_puppy_core_plugins/prompt_newline/__init__.py +13 -0
  221. code_puppy_core_plugins/prompt_newline/config.py +21 -0
  222. code_puppy_core_plugins/prompt_newline/register_callbacks.py +163 -0
  223. code_puppy_core_plugins/prune/__init__.py +1 -0
  224. code_puppy_core_plugins/prune/prune_menu.py +308 -0
  225. code_puppy_core_plugins/prune/prune_model.py +517 -0
  226. code_puppy_core_plugins/prune/prune_render.py +354 -0
  227. code_puppy_core_plugins/prune/register_callbacks.py +388 -0
  228. code_puppy_core_plugins/puppy_kennel/README.md +203 -0
  229. code_puppy_core_plugins/puppy_kennel/__init__.py +6 -0
  230. code_puppy_core_plugins/puppy_kennel/commands.py +206 -0
  231. code_puppy_core_plugins/puppy_kennel/config.py +36 -0
  232. code_puppy_core_plugins/puppy_kennel/kennel.py +368 -0
  233. code_puppy_core_plugins/puppy_kennel/packer.py +152 -0
  234. code_puppy_core_plugins/puppy_kennel/recorder.py +83 -0
  235. code_puppy_core_plugins/puppy_kennel/register_callbacks.py +109 -0
  236. code_puppy_core_plugins/puppy_kennel/retriever.py +28 -0
  237. code_puppy_core_plugins/puppy_kennel/schema.py +78 -0
  238. code_puppy_core_plugins/puppy_kennel/state.py +68 -0
  239. code_puppy_core_plugins/puppy_kennel/tools.py +449 -0
  240. code_puppy_core_plugins/puppy_kennel/wings.py +110 -0
  241. code_puppy_core_plugins/puppy_spinner/README.md +93 -0
  242. code_puppy_core_plugins/puppy_spinner/__init__.py +11 -0
  243. code_puppy_core_plugins/puppy_spinner/builtin_frames.py +172 -0
  244. code_puppy_core_plugins/puppy_spinner/commands.py +116 -0
  245. code_puppy_core_plugins/puppy_spinner/picker.py +379 -0
  246. code_puppy_core_plugins/puppy_spinner/register_callbacks.py +193 -0
  247. code_puppy_core_plugins/puppy_spinner/spinners.py +444 -0
  248. code_puppy_core_plugins/quick_resume/__init__.py +0 -0
  249. code_puppy_core_plugins/quick_resume/register_callbacks.py +77 -0
  250. code_puppy_core_plugins/review_pr/__init__.py +1 -0
  251. code_puppy_core_plugins/review_pr/register_callbacks.py +162 -0
  252. code_puppy_core_plugins/shell_safety/__init__.py +6 -0
  253. code_puppy_core_plugins/shell_safety/agent_shell_safety.py +69 -0
  254. code_puppy_core_plugins/shell_safety/command_cache.py +156 -0
  255. code_puppy_core_plugins/shell_safety/register_callbacks.py +203 -0
  256. code_puppy_core_plugins/stack_dump/__init__.py +1 -0
  257. code_puppy_core_plugins/stack_dump/register_callbacks.py +79 -0
  258. code_puppy_core_plugins/statusline/__init__.py +14 -0
  259. code_puppy_core_plugins/statusline/config.py +68 -0
  260. code_puppy_core_plugins/statusline/payload.py +138 -0
  261. code_puppy_core_plugins/statusline/prompt_patch.py +76 -0
  262. code_puppy_core_plugins/statusline/register_callbacks.py +45 -0
  263. code_puppy_core_plugins/statusline/runner.py +122 -0
  264. code_puppy_core_plugins/statusline/statusline_command.py +197 -0
  265. code_puppy_core_plugins/steer_queue/__init__.py +10 -0
  266. code_puppy_core_plugins/steer_queue/queue_menu.py +444 -0
  267. code_puppy_core_plugins/steer_queue/register_callbacks.py +138 -0
  268. code_puppy_core_plugins/subagent_panel/README.md +102 -0
  269. code_puppy_core_plugins/subagent_panel/__init__.py +24 -0
  270. code_puppy_core_plugins/subagent_panel/coalesce_patch.py +242 -0
  271. code_puppy_core_plugins/subagent_panel/panel_render.py +145 -0
  272. code_puppy_core_plugins/subagent_panel/register_callbacks.py +535 -0
  273. code_puppy_core_plugins/subagent_panel/resume_repaint.py +112 -0
  274. code_puppy_core_plugins/subagent_panel/state.py +231 -0
  275. code_puppy_core_plugins/switch_agent_resume/__init__.py +5 -0
  276. code_puppy_core_plugins/switch_agent_resume/register_callbacks.py +314 -0
  277. code_puppy_core_plugins/theme/README.md +86 -0
  278. code_puppy_core_plugins/theme/__init__.py +14 -0
  279. code_puppy_core_plugins/theme/bundled_palettes.py +346 -0
  280. code_puppy_core_plugins/theme/content_styles.py +146 -0
  281. code_puppy_core_plugins/theme/osc_palette.py +178 -0
  282. code_puppy_core_plugins/theme/picker.py +358 -0
  283. code_puppy_core_plugins/theme/prompt_toolkit_theme.py +113 -0
  284. code_puppy_core_plugins/theme/register_callbacks.py +348 -0
  285. code_puppy_core_plugins/theme/rich_themes.py +202 -0
  286. code_puppy_core_plugins/theme/themes.py +720 -0
  287. code_puppy_core_plugins/timestamp_heartbeat/__init__.py +1 -0
  288. code_puppy_core_plugins/timestamp_heartbeat/register_callbacks.py +114 -0
  289. code_puppy_core_plugins/token_ratio_learner/__init__.py +5 -0
  290. code_puppy_core_plugins/token_ratio_learner/ratios.py +208 -0
  291. code_puppy_core_plugins/token_ratio_learner/register_callbacks.py +213 -0
  292. code_puppy_core_plugins/universal_constructor/__init__.py +13 -0
  293. code_puppy_core_plugins/universal_constructor/models.py +138 -0
  294. code_puppy_core_plugins/universal_constructor/provider.py +62 -0
  295. code_puppy_core_plugins/universal_constructor/register_callbacks.py +75 -0
  296. code_puppy_core_plugins/universal_constructor/registry.py +302 -0
  297. code_puppy_core_plugins/universal_constructor/sandbox.py +584 -0
  298. code_puppy_core_plugins/wide_completion_menu/__init__.py +6 -0
  299. code_puppy_core_plugins/wide_completion_menu/register_callbacks.py +165 -0
  300. code_puppy_core_plugins/wiggum/__init__.py +1 -0
  301. code_puppy_core_plugins/wiggum/goal_runs.py +91 -0
  302. code_puppy_core_plugins/wiggum/judge.py +299 -0
  303. code_puppy_core_plugins/wiggum/judge_config.py +249 -0
  304. code_puppy_core_plugins/wiggum/judges_menu.py +814 -0
  305. code_puppy_core_plugins/wiggum/register_callbacks.py +569 -0
  306. code_puppy_core_plugins/wiggum/state.py +89 -0
  307. code_puppy_core_plugins/yolo_cli/__init__.py +1 -0
  308. code_puppy_core_plugins/yolo_cli/register_callbacks.py +41 -0
  309. code_puppy_core_plugins-0.0.2.dist-info/METADATA +64 -0
  310. code_puppy_core_plugins-0.0.2.dist-info/RECORD +313 -0
  311. code_puppy_core_plugins-0.0.2.dist-info/WHEEL +4 -0
  312. code_puppy_core_plugins-0.0.2.dist-info/entry_points.txt +55 -0
  313. code_puppy_core_plugins-0.0.2.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,374 @@
1
+ """Pattern detection for destructive shell commands.
2
+
3
+ Detects dangerous patterns in shell commands using pure regex — no LLM
4
+ calls, no caching, no yolo-mode checks. Covers:
5
+ - Unix/Linux: rm -rf root/home, git push --mirror, git clean -fd, git reset --hard,
6
+ git checkout/restore ., SQL DROP via clients, docker prune, accidental package publishes
7
+ - Windows PowerShell: Remove-Item, rmdir, del, Format-Volume, Clear-Disk, registry operations
8
+ - Windows CMD: rd, rmdir, del, erase with /s /q flags, format, diskpart
9
+ """
10
+
11
+ import re
12
+ from dataclasses import dataclass
13
+
14
+
15
+ @dataclass
16
+ class DestructiveCommandMatch:
17
+ """Result of a destructive command pattern match."""
18
+
19
+ pattern_name: str
20
+ description: str
21
+
22
+
23
+ # ---------------------------------------------------------------------------
24
+ # Shell-operator regex — same approach as force_push_guard
25
+ # ---------------------------------------------------------------------------
26
+
27
+ # Shell operators preceding a new command in a chain ("cd foo && rm -rf /", "true ||
28
+ # git reset --hard"); capture ensures the keyword follows a real shell boundary.
29
+ _SHELL_OPERATOR_RE = re.compile(r"(?:^|&&|\|\||;|\|)\s*\w+", re.MULTILINE)
30
+
31
+
32
+ def _is_real_command(command: str) -> bool:
33
+ """Check that the destructive keyword is an actual invocation, not a string arg.
34
+
35
+ Handles compound commands like "cd foo && rm -rf /" while
36
+ avoiding false positives like "echo 'rm -rf /'".
37
+
38
+ Args:
39
+ command: The shell command string to inspect.
40
+
41
+ Returns:
42
+ True if the command appears to be a real invocation.
43
+ """
44
+ return bool(_SHELL_OPERATOR_RE.search(command))
45
+
46
+
47
+ # ---------------------------------------------------------------------------
48
+ # Cheap pre-filter substrings — if none appear, bail immediately
49
+ # ---------------------------------------------------------------------------
50
+
51
+ _PREFILTER_SUBSTRINGS = (
52
+ # Unix/Linux
53
+ "rm",
54
+ "git",
55
+ "docker",
56
+ "drop",
57
+ "npm",
58
+ "yarn",
59
+ "twine",
60
+ "psql",
61
+ "mysql",
62
+ "sqlite3",
63
+ # Windows PowerShell (cmdlets and common aliases)
64
+ "remove-item",
65
+ " ri ",
66
+ "ri ",
67
+ " rmdir",
68
+ "del ",
69
+ "erase",
70
+ "format-volume",
71
+ "clear-disk",
72
+ "remove-itemproperty",
73
+ "clear-recyclebin",
74
+ "invoke-expression",
75
+ " irm ",
76
+ "iex",
77
+ "get-childitem",
78
+ # Windows CMD
79
+ "rd ",
80
+ "format",
81
+ "diskpart",
82
+ "bcdedit",
83
+ "reg ",
84
+ "netsh",
85
+ )
86
+
87
+
88
+ # ---------------------------------------------------------------------------
89
+ # Pattern lists — organized by shell type
90
+ # ---------------------------------------------------------------------------
91
+
92
+ # Unix destructive patterns
93
+ _UNIX_DESTRUCTIVE_PATTERNS: list[tuple[re.Pattern, str, str]] = [
94
+ # —— Tier 1 ——————————————————————————————————————————————————————————————
95
+ # 1. rm -rf / / rm -rf /* (recursive delete of root filesystem)
96
+ (
97
+ re.compile(r"\brm\b.*\s-rf?\b.*\s/\s*$"),
98
+ "rm -rf /",
99
+ "recursive delete of root filesystem",
100
+ ),
101
+ (
102
+ re.compile(r"\brm\b.*\s-rf?\b.*\s/\*\s*$"),
103
+ "rm -rf /*",
104
+ "recursive delete of root filesystem (glob)",
105
+ ),
106
+ # 2. rm -rf ~ / rm -rf ~/* (recursive delete of home directory)
107
+ (
108
+ re.compile(r"\brm\b.*\s-rf?\b.*\s~\s*$"),
109
+ "rm -rf ~",
110
+ "recursive delete of home directory",
111
+ ),
112
+ (
113
+ re.compile(r"\brm\b.*\s-rf?\b.*\s~/\*\s*$"),
114
+ "rm -rf ~/*",
115
+ "recursive delete of home directory (glob)",
116
+ ),
117
+ # 3. git push --mirror (deletes remote branches not present locally)
118
+ (
119
+ re.compile(r"\bgit\s+push\b.*--mirror\b"),
120
+ "git push --mirror",
121
+ "deletes remote branches not present locally",
122
+ ),
123
+ # 4. git clean -fd (deletes untracked files and directories)
124
+ (
125
+ re.compile(r"\bgit\s+clean\b.*-f(?:[dxf]|\s+-?[dxf])"),
126
+ "git clean -fd",
127
+ "deletes untracked files and directories",
128
+ ),
129
+ # 5. git reset --hard (destroys all uncommitted changes)
130
+ (
131
+ re.compile(r"\bgit\s+reset\b.*--hard\b"),
132
+ "git reset --hard",
133
+ "destroys all uncommitted changes",
134
+ ),
135
+ # 6. git checkout -- . / git restore . (discards all working dir changes)
136
+ (
137
+ re.compile(r"\bgit\s+(?:checkout|restore)\b.*\s--?\s*\.\s*$"),
138
+ "git checkout/restore .",
139
+ "discards all working directory changes",
140
+ ),
141
+ # —— Tier 2 ——————————————————————————————————————————————————————————————
142
+ # 7. DROP TABLE/DATABASE/SCHEMA via SQL client
143
+ (
144
+ re.compile(
145
+ r"(?:psql|mysql|sqlite3)\b.*(?:-c|-e)\b.*DROP\s+(?:TABLE|DATABASE|SCHEMA)\b",
146
+ re.IGNORECASE,
147
+ ),
148
+ "DROP via SQL client",
149
+ "drops a table/database/schema via SQL client",
150
+ ),
151
+ (
152
+ re.compile(
153
+ r"DROP\s+(?:TABLE|DATABASE|SCHEMA)\b.*\|\s*(?:psql|mysql|sqlite3)\b",
154
+ re.IGNORECASE,
155
+ ),
156
+ "DROP via SQL pipe",
157
+ "drops a table/database/schema piped to SQL client",
158
+ ),
159
+ # 8. docker system prune -af / docker volume prune -f
160
+ (
161
+ re.compile(
162
+ r"\bdocker\s+(?:system|volume)\s+prune\b.*(?:-[af]|\s-[af]|\s--all)"
163
+ ),
164
+ "docker prune",
165
+ "nukes Docker resources without confirmation",
166
+ ),
167
+ # 9. npm publish / yarn publish / twine upload
168
+ (
169
+ re.compile(r"\b(?:npm|yarn)\s+publish\b"),
170
+ "npm/yarn publish",
171
+ "accidental package publishing",
172
+ ),
173
+ (
174
+ re.compile(r"\btwine\s+upload\b"),
175
+ "twine upload",
176
+ "accidental package publishing",
177
+ ),
178
+ ]
179
+
180
+ # Windows PowerShell destructive patterns
181
+ _POWERSHELL_DESTRUCTIVE_PATTERNS: list[tuple[re.Pattern, str, str]] = [
182
+ # —— Tier 1 PowerShell ————————————————————————————————————————————————————
183
+ # 1. Remove-Item/ri with -Recurse/-r or -Force/-f flags
184
+ (
185
+ re.compile(
186
+ r"(?:^|[;|&])\s*(?:Remove-Item|ri)\b.*\s-(?:r|recurse|f|force)\b",
187
+ re.IGNORECASE,
188
+ ),
189
+ "Remove-Item with recursive/force flags",
190
+ "deletion with recursive or force flag",
191
+ ),
192
+ # 2. Remove-Item -Recurse -Force on system directories
193
+ (
194
+ re.compile(
195
+ r"\b(?:Remove-Item|ri)\b.*\s-(?:r|recurse)\b.*(?:C:|Windows|System32|Users|Program Files|ProgramData)",
196
+ re.IGNORECASE,
197
+ ),
198
+ "Remove-Item on system location",
199
+ "deletion operation on system directory or drive",
200
+ ),
201
+ # 3. Get-ChildItem piped to Remove-Item (pipeline delete)
202
+ (
203
+ re.compile(
204
+ r"\|\s*\b(?:Remove-Item|ri|del|erase)\b",
205
+ re.IGNORECASE,
206
+ ),
207
+ "Piped deletion command",
208
+ "deletion via pipeline (potentially recursive)",
209
+ ),
210
+ # 4. Format-Volume (disk formatting)
211
+ (
212
+ re.compile(
213
+ r"\b(?:Format-Volume|fdisk)\b",
214
+ re.IGNORECASE,
215
+ ),
216
+ "Format-Volume",
217
+ "formats a disk volume",
218
+ ),
219
+ # 5. Clear-Disk (wipes disk)
220
+ (
221
+ re.compile(
222
+ r"\bClear-Disk\b",
223
+ re.IGNORECASE,
224
+ ),
225
+ "Clear-Disk",
226
+ "removes all data and OEM recovery partitions",
227
+ ),
228
+ # 6. Remove-ItemProperty on critical registry paths
229
+ (
230
+ re.compile(
231
+ r"\b(?:Remove-ItemProperty|rp)\b.*\sHK(?:LM|CU|CR|U|CC):",
232
+ re.IGNORECASE,
233
+ ),
234
+ "Remove-ItemProperty registry",
235
+ "removes critical registry values",
236
+ ),
237
+ # 7. Clear-RecycleBin with -Force
238
+ (
239
+ re.compile(
240
+ r"\b(?:Clear-RecycleBin|recycle)\b.*\s-(?:f|force)\b",
241
+ re.IGNORECASE,
242
+ ),
243
+ "Clear-RecycleBin -Force",
244
+ "permanently deletes all recycle bin contents",
245
+ ),
246
+ # 8. Invoke-WebRequest / Invoke-RestMethod piped to IEX (remote code execution)
247
+ (
248
+ re.compile(
249
+ r"\b(?:irm|Invoke-WebRequest|iwr|Invoke-RestMethod|curl|wget)\b.*\|\s*(?:iex|Invoke-Expression)\b",
250
+ re.IGNORECASE,
251
+ ),
252
+ "Download + Execute (IWR| IEX)",
253
+ "downloads and executes remote code",
254
+ ),
255
+ ]
256
+
257
+ # Windows CMD destructive patterns
258
+ _CMD_DESTRUCTIVE_PATTERNS: list[tuple[re.Pattern, str, str]] = [
259
+ # —— Tier 1 CMD ———————————————————————————————————————————————————————————
260
+ # 1. rd /s /q - recursive silent delete
261
+ (
262
+ re.compile(
263
+ r"\b(?:rmdir|rd)\b.*\s/s\b.*\s/q\b",
264
+ re.IGNORECASE,
265
+ ),
266
+ "rd /s /q",
267
+ "recursive silent directory delete",
268
+ ),
269
+ (
270
+ re.compile(
271
+ r"\b(?:rmdir|rd)\b.*\s/q\b.*\s/s\b",
272
+ re.IGNORECASE,
273
+ ),
274
+ "rd /s /q",
275
+ "recursive silent directory delete",
276
+ ),
277
+ # 2. del /s /q /f on system directories
278
+ (
279
+ re.compile(
280
+ r"\b(?:del|erase)\b.*\s/s\b.*(?:Windows|System32|Program)",
281
+ re.IGNORECASE,
282
+ ),
283
+ "del /s system files",
284
+ "recursive delete of system files",
285
+ ),
286
+ (
287
+ re.compile(
288
+ r"\b(?:del|erase)\b.*\s/f\b.*\s/s\b.*(?:Windows|System32|Program)",
289
+ re.IGNORECASE,
290
+ ),
291
+ "del /f /s system files",
292
+ "force recursive delete of system files",
293
+ ),
294
+ # 3. format command without confirmation
295
+ (
296
+ re.compile(
297
+ r"(?:^|&&|\|\||;|\|)\s*format\b.*\s(?:C:|D:|E:)",
298
+ re.IGNORECASE,
299
+ ),
300
+ "format",
301
+ "formats drive",
302
+ ),
303
+ (
304
+ re.compile(
305
+ r"(?:^|&&|\|\||;|\|)\s*format\b.*\s/q\b.*\s(?:C:|D:|E:)",
306
+ re.IGNORECASE,
307
+ ),
308
+ "format /q",
309
+ "quick formats drive",
310
+ ),
311
+ # 4. diskpart invocation (almost never legitimate in automation)
312
+ (
313
+ re.compile(
314
+ r"\bdiskpart\b",
315
+ re.IGNORECASE,
316
+ ),
317
+ "diskpart",
318
+ "diskpart disk management tool",
319
+ ),
320
+ # 5. bcdedit (boot configuration) modifications
321
+ (
322
+ re.compile(
323
+ r"\bbcdedit\b.*\s/(?:delete|set|export|import|bootsequence)\b.*\s(?:{.*}|.*bootmgr|.*resume)",
324
+ re.IGNORECASE,
325
+ ),
326
+ "bcdedit destructive",
327
+ "modifies critical boot configuration",
328
+ ),
329
+ # 6. reg delete on critical keys
330
+ (
331
+ re.compile(
332
+ r"\breg\s+delete\b.*\sHK(?:LM|CR|CU)",
333
+ re.IGNORECASE,
334
+ ),
335
+ "reg delete",
336
+ "deletes critical registry keys",
337
+ ),
338
+ ]
339
+
340
+ # Combine all patterns
341
+ _DESTRUCTIVE_PATTERNS = (
342
+ _UNIX_DESTRUCTIVE_PATTERNS
343
+ + _POWERSHELL_DESTRUCTIVE_PATTERNS
344
+ + _CMD_DESTRUCTIVE_PATTERNS
345
+ )
346
+
347
+
348
+ def detect_destructive_command(command: str) -> DestructiveCommandMatch | None:
349
+ """Check if a shell command contains a destructive operation.
350
+
351
+ Uses a cheap substring pre-filter before any regex work, then verifies
352
+ the command is a real invocation (not a string argument), then checks
353
+ patterns first-match-wins.
354
+
355
+ Args:
356
+ command: The shell command string to inspect.
357
+
358
+ Returns:
359
+ DestructiveCommandMatch if a destructive pattern is found, None otherwise.
360
+ """
361
+ # Quick pre-filter: bail if none of the trigger substrings appear
362
+ command_lower = command.lower()
363
+ if not any(sub in command_lower for sub in _PREFILTER_SUBSTRINGS):
364
+ return None
365
+
366
+ # Ensure the command is a real invocation, not a string argument
367
+ if not _is_real_command(command):
368
+ return None
369
+
370
+ for pattern, name, description in _DESTRUCTIVE_PATTERNS:
371
+ if pattern.search(command):
372
+ return DestructiveCommandMatch(pattern_name=name, description=description)
373
+
374
+ return None
@@ -0,0 +1,165 @@
1
+ """Callback registration for the destructive command guard plugin.
2
+
3
+ Hooks into the run_shell_command phase to intercept destructive shell
4
+ commands (rm -rf /, git reset --hard, docker system prune -af, etc.) and
5
+ prompt the user for approval before allowing them through.
6
+
7
+ Returns {"blocked": True} to deny, None to allow.
8
+ """
9
+
10
+ import sys
11
+ from typing import Any, Dict, Optional
12
+
13
+ from rich.text import Text
14
+
15
+ from code_puppy.callbacks import register_callback
16
+ from code_puppy.config import (
17
+ get_disable_dangerous_command_guard,
18
+ is_dangerous_command_allowlisted,
19
+ )
20
+ from code_puppy.messaging import emit_info, emit_warning
21
+ from code_puppy_core_plugins.destructive_command_guard.detector import (
22
+ detect_destructive_command,
23
+ )
24
+
25
+
26
+ def _is_interactive() -> bool:
27
+ """Check if we're in an interactive terminal that can show prompts."""
28
+ try:
29
+ return sys.stdin.isatty()
30
+ except (AttributeError, OSError):
31
+ return False
32
+
33
+
34
+ async def destructive_command_guard_callback(
35
+ context: Any, command: str, cwd: Optional[str] = None, timeout: int = 60
36
+ ) -> Optional[Dict[str, Any]]:
37
+ """Intercept shell commands containing destructive operations.
38
+
39
+ When a destructive command is detected:
40
+ - Interactive TTY: prompt the user with approve/reject options.
41
+ - Non-interactive (CI, sub-agent, piped): hard-block with an error.
42
+
43
+ This runs on *every* shell command, but the heavy lifting (regex
44
+ matching) is gated behind a cheap substring pre-filter inside
45
+ detect_destructive_command().
46
+
47
+ Args:
48
+ context: Execution context (unused).
49
+ command: The shell command about to run.
50
+ cwd: Working directory (unused).
51
+ timeout: Command timeout (unused).
52
+
53
+ Returns:
54
+ None if the command is safe to proceed or user approved it.
55
+ Dict with blocked=True if a destructive command was detected and rejected.
56
+ """
57
+ # Check if dangerous command guards are disabled
58
+ if get_disable_dangerous_command_guard():
59
+ return None
60
+
61
+ match = detect_destructive_command(command)
62
+ if match is None:
63
+ return None
64
+
65
+ # Granular allowlist: trusted patterns bypass the guard while everything
66
+ # else stays protected (unlike the all-or-nothing disable flag above).
67
+ if is_dangerous_command_allowlisted(match.pattern_name):
68
+ emit_info(
69
+ f"Allowlisted destructive pattern '{match.pattern_name}' -- "
70
+ "proceeding (guard still active for other patterns)."
71
+ )
72
+ return None
73
+
74
+ # --- Interactive TTY: ask the user ---
75
+ if _is_interactive():
76
+ return await _prompt_user_approval(command, match)
77
+
78
+ # --- Non-interactive: hard-block ---
79
+ return _block_command(command, match)
80
+
81
+
82
+ async def _prompt_user_approval(command: str, match: Any) -> Optional[Dict[str, Any]]:
83
+ """Show an interactive approval prompt for the detected destructive command.
84
+
85
+ Args:
86
+ command: The original shell command.
87
+ match: The DestructiveCommandMatch from the detector.
88
+
89
+ Returns:
90
+ None if user approves, Dict with blocked=True if rejected.
91
+ """
92
+ from code_puppy.tools.common import get_user_approval_async
93
+
94
+ panel_content = Text()
95
+ panel_content.append("⚠️ Destructive command detected: ", style="bold yellow")
96
+ panel_content.append(match.pattern_name, style="bold red")
97
+ panel_content.append("\n", style="")
98
+ panel_content.append(f" {match.description}", style="dim")
99
+ panel_content.append("\n\n", style="")
100
+ panel_content.append("$ ", style="bold green")
101
+ panel_content.append(command, style="bold white")
102
+ panel_content.append(
103
+ "\n\nThis command could cause irreversible data loss.",
104
+ style="yellow",
105
+ )
106
+
107
+ confirmed, user_feedback = await get_user_approval_async(
108
+ title="Destructive Command Guard 🛡️",
109
+ content=panel_content,
110
+ border_style="red",
111
+ )
112
+
113
+ if confirmed:
114
+ emit_info("⚠️ Destructive command approved — proceeding with caution.")
115
+ return None # Allow the command through
116
+
117
+ # Rejected
118
+ reason = user_feedback or "User rejected destructive command"
119
+ return {
120
+ "blocked": True,
121
+ "reasoning": f"Destructive command rejected: {match.pattern_name} — {reason}",
122
+ "error_message": (
123
+ f"🛑 Destructive command rejected. Detected {match.pattern_name} "
124
+ f"in command:\n {command}\n"
125
+ f" {match.description}\n"
126
+ f"Feedback: {reason}"
127
+ ),
128
+ }
129
+
130
+
131
+ def _block_command(command: str, match: Any) -> Dict[str, Any]:
132
+ """Hard-block a destructive command in non-interactive contexts.
133
+
134
+ Args:
135
+ command: The original shell command.
136
+ match: The DestructiveCommandMatch from the detector.
137
+
138
+ Returns:
139
+ Dict with blocked=True and a descriptive error.
140
+ """
141
+ error_message = (
142
+ f"🛑 Destructive command blocked! Detected {match.pattern_name} "
143
+ f"in command:\n {command}\n"
144
+ f" {match.description}\n\n"
145
+ f"This operation could cause irreversible data loss.\n"
146
+ f"If you *really* need to run this, use the exact command directly\n"
147
+ f"in your terminal (outside code puppy) after double-checking the target."
148
+ )
149
+
150
+ emit_warning(error_message)
151
+
152
+ return {
153
+ "blocked": True,
154
+ "reasoning": f"Destructive command detected: {match.pattern_name} — {match.description}",
155
+ "error_message": error_message,
156
+ }
157
+
158
+
159
+ def register() -> None:
160
+ """Register the destructive command guard callback."""
161
+ register_callback("run_shell_command", destructive_command_guard_callback)
162
+
163
+
164
+ # Auto-register when this module is imported
165
+ register()
@@ -0,0 +1,12 @@
1
+ """Strip emojis from agent outputs and file writes.
2
+
3
+ Targets (and nothing else):
4
+ * Streaming TextPart / TextPartDelta content (rendered to the terminal).
5
+ * File-write tool args (create_file, edit_file, replace_in_file).
6
+ * Shell command strings (agent_run_shell_command).
7
+
8
+ Explicitly excluded: ThinkingPart / ThinkingPartDelta, banners, emit_* messages,
9
+ search strings (old_str / snippet), and anything else not listed above.
10
+
11
+ Toggle via the ``emoji_filter`` key in puppy.cfg. Default: on.
12
+ """
@@ -0,0 +1,26 @@
1
+ """Plugin-local config for the emoji_filter plugin."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from code_puppy.config import get_value, set_config_value
6
+
7
+ _CONFIG_KEY = "emoji_filter"
8
+ _FALSY = ("false", "0", "no", "off")
9
+
10
+
11
+ def is_enabled() -> bool:
12
+ """Return True if emoji filtering is enabled. Default: True.
13
+
14
+ Explicit ``false/0/no/off`` disables. Anything else (including unset
15
+ or an unparseable value) keeps the filter on. In the face of ambiguity,
16
+ refuse the temptation to leak emojis.
17
+ """
18
+ cfg_val = get_value(_CONFIG_KEY)
19
+ if cfg_val is None:
20
+ return True
21
+ return str(cfg_val).strip().lower() not in _FALSY
22
+
23
+
24
+ def set_enabled(enabled: bool) -> None:
25
+ """Persist the on/off switch to puppy.cfg."""
26
+ set_config_value(_CONFIG_KEY, "true" if enabled else "false")