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,358 @@
1
+ """Interactive theme picker TUI.
2
+
3
+ Reuses prompt_toolkit's full-screen pattern (cribbed from
4
+ ``code_puppy.command_line.colors_menu``) but pared down to the curated
5
+ theme choices, with a live preview that shows banners AND content text
6
+ in the theme's body styles.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import asyncio
12
+ import io
13
+ import random
14
+ import sys
15
+ from typing import Optional
16
+
17
+ from prompt_toolkit import Application
18
+ from prompt_toolkit.formatted_text import ANSI, FormattedText
19
+ from prompt_toolkit.key_binding import KeyBindings
20
+ from prompt_toolkit.layout import Layout, VSplit, Window
21
+ from prompt_toolkit.layout.controls import FormattedTextControl
22
+ from prompt_toolkit.widgets import Frame
23
+ from rich.console import Console
24
+
25
+ from code_puppy.command_line.colors_menu import (
26
+ BANNER_DISPLAY_INFO,
27
+ BANNER_SAMPLE_CONTENT,
28
+ )
29
+
30
+ from .themes import (
31
+ MENU,
32
+ color_remap_for,
33
+ colors_for,
34
+ content_styles_for,
35
+ terminal_palette_for,
36
+ )
37
+ from code_puppy.callbacks import on_prompt_toolkit_style
38
+
39
+ # A few representative banners to show in the preview pane (keeps it readable).
40
+ PREVIEW_BANNERS = [
41
+ "thinking",
42
+ "agent_response",
43
+ "shell_command",
44
+ "read_file",
45
+ "edit_file",
46
+ "grep",
47
+ "invoke_agent",
48
+ "subagent_response",
49
+ ]
50
+
51
+ # Sample lines to demonstrate body content styling.
52
+ CONTENT_SAMPLES = [
53
+ ("info", "i Heads up, this is an info message."),
54
+ ("success", "v Success - task finished cleanly."),
55
+ ("warning", "! Warning - proceeding with caution."),
56
+ ("error", "x Error - something went wrong."),
57
+ ("debug", ". debug trace (only shown if you ask)"),
58
+ ]
59
+
60
+ # Inline-markup samples to demonstrate the Level 2 color remap.
61
+ # These mirror the kind of hardcoded tags scattered through the renderer.
62
+ THEMES_PER_PAGE = 5
63
+
64
+ INLINE_MARKUP_SAMPLES = [
65
+ "[bold cyan]bold cyan headline[/bold cyan]",
66
+ "[dim cyan]dim cyan detail[/dim cyan]",
67
+ "[bold blue]bold blue label[/bold blue]",
68
+ "[magenta]magenta accent[/magenta]",
69
+ ]
70
+
71
+
72
+ def _render_preview(theme_name: str, surprise_seed: int) -> ANSI:
73
+ """Render a full-color preview of the theme using Rich -> ANSI.
74
+
75
+ ``surprise_seed`` makes the "Surprise Me" preview stable while highlighted
76
+ (otherwise it would re-roll on every redraw - dizzying).
77
+ """
78
+ buffer = io.StringIO()
79
+ console = Console(
80
+ file=buffer,
81
+ force_terminal=True,
82
+ width=70,
83
+ legacy_windows=False,
84
+ color_system="truecolor",
85
+ no_color=False,
86
+ force_interactive=True,
87
+ )
88
+
89
+ rng = random.Random(surprise_seed) if theme_name == "surprise" else None
90
+ banner_mapping = colors_for(theme_name, rng=rng)
91
+ content_mapping = content_styles_for(theme_name, rng=rng)
92
+ color_remap = color_remap_for(theme_name, rng=rng)
93
+ theme = dict(MENU)[theme_name]
94
+
95
+ # Apply the Level 2 remap to *this preview console only* so users see
96
+ # exactly what the inline markup will look like.
97
+ from . import rich_themes as rt
98
+
99
+ if color_remap:
100
+ rt._install_patch(console, color_remap)
101
+
102
+ console.print("[bold]" + "=" * 60 + "[/bold]")
103
+ console.print(
104
+ f"[bold cyan] {theme['icon']} {theme['label']}[/bold cyan] "
105
+ f"[dim]- {theme['blurb']}[/dim]"
106
+ )
107
+ console.print("[bold]" + "=" * 60 + "[/bold]")
108
+ console.print()
109
+
110
+ # Banner samples
111
+ for banner in PREVIEW_BANNERS:
112
+ if banner not in banner_mapping:
113
+ continue
114
+ display, icon = BANNER_DISPLAY_INFO[banner]
115
+ color = banner_mapping[banner]
116
+ icon_str = f" {icon}" if icon else ""
117
+ console.print(
118
+ f"[bold white on {color}] {display} [/bold white on {color}]{icon_str}"
119
+ )
120
+ sample = BANNER_SAMPLE_CONTENT.get(banner, "")
121
+ first_line = sample.split("\n", 1)[0]
122
+ if first_line:
123
+ console.print(f" [dim]{first_line}[/dim]")
124
+ console.print()
125
+
126
+ # Content text samples (the new bit - Level 1 theming)
127
+ console.print("[bold]" + "-" * 60 + "[/bold]")
128
+ console.print("[bold dim]content text styles:[/bold dim]")
129
+ for key, text in CONTENT_SAMPLES:
130
+ style = content_mapping[key]
131
+ console.print(f" [{style}]{text}[/]")
132
+
133
+ # Inline markup samples (Level 2 - remapped colors)
134
+ console.print("[bold dim]inline markup remap:[/bold dim]")
135
+ for sample in INLINE_MARKUP_SAMPLES:
136
+ console.print(" " + sample)
137
+ console.print("[bold]" + "=" * 60 + "[/bold]")
138
+
139
+ if theme_name == "surprise":
140
+ console.print(
141
+ "[dim italic]Every apply re-rolls a fresh random palette.[/dim italic]"
142
+ )
143
+ elif theme_name == "default":
144
+ console.print(
145
+ "[dim italic]Resets banners + content to Code Puppy defaults.[/dim italic]"
146
+ )
147
+
148
+ # Terminal-palette note (Level 3 - OSC sequences recolor the whole window)
149
+ tp = terminal_palette_for(theme_name)
150
+ if tp:
151
+ bg = tp.get("bg", "?")
152
+ fg = tp.get("fg", "?")
153
+ ansi = tp.get("ansi") or []
154
+ ansi_note = f" + {len(ansi)}-color ANSI palette" if ansi else ""
155
+
156
+ # Preview the bg/fg combo without firing OSC live; arrow-key previews
157
+ # must not flicker the terminal.
158
+ console.print("[bold dim]terminal palette preview:[/bold dim]")
159
+ sample_bg = bg if bg.startswith("#") else "#000000"
160
+ sample_fg = fg if fg.startswith("#") else "#ffffff"
161
+ # Two rows of the bg/fg combo with real text on top for readability check.
162
+ console.print(
163
+ f" [{sample_fg} on {sample_bg}]"
164
+ f" the quick brown puppy jumps over a sleepy log [/]"
165
+ )
166
+ console.print(
167
+ f" [{sample_fg} on {sample_bg}]"
168
+ f" bg={bg} fg={fg}{' ' * max(0, 18 - len(bg) - len(fg))} [/]"
169
+ )
170
+
171
+ # ANSI palette: 16 swatches in 2 rows of 8 so users see the rainbow.
172
+ if ansi:
173
+ console.print("[bold dim]ANSI palette (slots 0-15):[/bold dim]")
174
+ for row_start in (0, 8):
175
+ line = " "
176
+ for slot in range(row_start, min(row_start + 8, len(ansi))):
177
+ swatch_color = (
178
+ ansi[slot] if ansi[slot].startswith("#") else "#888888"
179
+ )
180
+ line += f"[on {swatch_color}] [/]"
181
+ console.print(line)
182
+
183
+ console.print(
184
+ f"[bold yellow]\u26a1[/bold yellow] [dim]Enter applies these to the whole terminal"
185
+ f"{ansi_note}.[/dim]"
186
+ )
187
+ elif theme_name == "default":
188
+ console.print(
189
+ "[bold yellow]\u26a1[/bold yellow] [dim]Resets terminal bg/fg/ANSI palette too.[/dim]"
190
+ )
191
+ return ANSI(buffer.getvalue())
192
+
193
+
194
+ def _total_pages() -> int:
195
+ return max(1, (len(MENU) + THEMES_PER_PAGE - 1) // THEMES_PER_PAGE)
196
+
197
+
198
+ def _page_for_index(selected_index: int) -> int:
199
+ return selected_index // THEMES_PER_PAGE
200
+
201
+
202
+ def _move_page(selected_index: int, delta: int) -> int:
203
+ """Move one page while retaining the selected row where possible."""
204
+ return max(0, min(selected_index + delta * THEMES_PER_PAGE, len(MENU) - 1))
205
+
206
+
207
+ def _format_menu(selected_index: int) -> FormattedText:
208
+ """Build the current page of the left-hand menu."""
209
+ page = _page_for_index(selected_index)
210
+ page_start = page * THEMES_PER_PAGE
211
+ page_end = min(page_start + THEMES_PER_PAGE, len(MENU))
212
+ lines: list[tuple[str, str]] = [
213
+ ("class:tui.header", "Pick a Theme"),
214
+ ("class:tui.muted", f" Page {page + 1}/{_total_pages()}"),
215
+ ("", "\n\n"),
216
+ ]
217
+ for i in range(page_start, page_end):
218
+ _, theme = MENU[i]
219
+ prefix = "> " if i == selected_index else " "
220
+ style = "class:tui.selected" if i == selected_index else "class:tui.body"
221
+ line = f"{prefix}{i + 1}. {theme['icon']} {theme['label']}"
222
+ lines.append((style, line))
223
+ lines.append(("", "\n"))
224
+ lines.append(("class:tui.muted", f" {theme['blurb']}"))
225
+ lines.append(("", "\n\n"))
226
+
227
+ lines.append(("", "\n"))
228
+ lines.extend(
229
+ [
230
+ ("class:tui.help-key", "Up/Down"),
231
+ ("class:tui.help", " Navigate | "),
232
+ ("class:tui.help-key", "PgUp/PgDn"),
233
+ ("class:tui.help", " Page\n"),
234
+ ("class:tui.help-key", "Enter"),
235
+ ("class:tui.help", " Apply | "),
236
+ ("class:tui.help-key", "Esc / Ctrl-C"),
237
+ ("class:tui.help", " Cancel"),
238
+ ]
239
+ )
240
+ return FormattedText(lines)
241
+
242
+
243
+ async def interactive_theme_picker() -> Optional[str]:
244
+ """Show the full-screen theme picker.
245
+
246
+ Returns:
247
+ The selected theme key (e.g. ``"ocean"``) or ``None`` if cancelled.
248
+ """
249
+ from code_puppy.tools.command_runner import set_awaiting_user_input
250
+
251
+ selected = [0]
252
+ result: list[Optional[str]] = [None]
253
+ # Stable seed for "Surprise Me" preview per highlight; bumps on each focus.
254
+ surprise_seed = [random.randint(0, 1_000_000)]
255
+
256
+ set_awaiting_user_input(True)
257
+ sys.stdout.write("\033[?1049h\033[2J\033[H")
258
+ sys.stdout.flush()
259
+ await asyncio.sleep(0.05)
260
+
261
+ kb = KeyBindings()
262
+
263
+ def _refresh_surprise_seed_if_focused() -> None:
264
+ name, _ = MENU[selected[0]]
265
+ if name == "surprise":
266
+ surprise_seed[0] = random.randint(0, 1_000_000)
267
+
268
+ @kb.add("up")
269
+ @kb.add("c-p")
270
+ def _(event):
271
+ selected[0] = (selected[0] - 1) % len(MENU)
272
+ _refresh_surprise_seed_if_focused()
273
+ event.app.invalidate()
274
+
275
+ @kb.add("down")
276
+ @kb.add("c-n")
277
+ def _(event):
278
+ selected[0] = (selected[0] + 1) % len(MENU)
279
+ _refresh_surprise_seed_if_focused()
280
+ event.app.invalidate()
281
+
282
+ @kb.add("pageup")
283
+ def _(event):
284
+ selected[0] = _move_page(selected[0], -1)
285
+ _refresh_surprise_seed_if_focused()
286
+ event.app.invalidate()
287
+
288
+ @kb.add("pagedown")
289
+ def _(event):
290
+ selected[0] = _move_page(selected[0], 1)
291
+ _refresh_surprise_seed_if_focused()
292
+ event.app.invalidate()
293
+
294
+ @kb.add("enter")
295
+ def _(event):
296
+ result[0] = MENU[selected[0]][0]
297
+ event.app.exit()
298
+
299
+ @kb.add("escape")
300
+ @kb.add("c-c")
301
+ def _(event):
302
+ result[0] = None
303
+ event.app.exit()
304
+
305
+ def _current_preview_style() -> str:
306
+ """Dynamic prompt_toolkit style for the preview pane.
307
+
308
+ Paints the WHOLE right pane background with the selected theme's bg,
309
+ and picks a readable fg, so the user instantly sees the new color.
310
+ Updates every render via prompt_toolkit's dynamic-style support.
311
+ """
312
+ name, _ = MENU[selected[0]]
313
+ try:
314
+ tp = terminal_palette_for(name)
315
+ except Exception:
316
+ tp = None
317
+ if not tp:
318
+ return ""
319
+ bg = tp.get("bg")
320
+ fg = tp.get("fg", "")
321
+ parts = []
322
+ if bg:
323
+ parts.append(f"bg:{bg}")
324
+ if fg:
325
+ parts.append(f"fg:{fg}")
326
+ return " ".join(parts)
327
+
328
+ left = Window(
329
+ content=FormattedTextControl(lambda: _format_menu(selected[0])),
330
+ width=40,
331
+ )
332
+ right = Window(
333
+ content=FormattedTextControl(
334
+ lambda: _render_preview(MENU[selected[0]][0], surprise_seed[0])
335
+ ),
336
+ style=_current_preview_style,
337
+ )
338
+
339
+ layout = Layout(
340
+ VSplit([Frame(left, title="Themes"), Frame(right, title="Live Preview")])
341
+ )
342
+ app = Application(
343
+ layout=layout,
344
+ key_bindings=kb,
345
+ full_screen=False,
346
+ mouse_support=False,
347
+ color_depth="DEPTH_24_BIT",
348
+ style=on_prompt_toolkit_style(),
349
+ )
350
+
351
+ try:
352
+ await app.run_async()
353
+ finally:
354
+ set_awaiting_user_input(False)
355
+ sys.stdout.write("\033[?1049l")
356
+ sys.stdout.flush()
357
+
358
+ return result[0]
@@ -0,0 +1,113 @@
1
+ """Central prompt-toolkit adapter for the active Code Puppy theme.
2
+
3
+ TUI applications pass their local style through the ``prompt_toolkit_style``
4
+ hook. The theme plugin layers this semantic base underneath it, so local menu
5
+ rules retain precedence and legacy fragments such as ``bold`` inherit a
6
+ readable foreground.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from typing import Any
12
+
13
+ from prompt_toolkit.styles import BaseStyle, Style, merge_styles
14
+
15
+ from . import osc_palette
16
+
17
+
18
+ def _active_palette() -> dict[str, Any] | None:
19
+ palette = osc_palette.get_saved_palette()
20
+ ansi = palette.get("ansi") if palette else None
21
+ if not palette or not isinstance(ansi, list) or len(ansi) < 16:
22
+ return None
23
+ return palette
24
+
25
+
26
+ def _relative_luminance(color: str) -> float:
27
+ """Return WCAG relative luminance for a ``#rrggbb`` color."""
28
+ channels = [int(color[index : index + 2], 16) / 255 for index in (1, 3, 5)]
29
+ linear = [
30
+ value / 12.92 if value <= 0.04045 else ((value + 0.055) / 1.055) ** 2.4
31
+ for value in channels
32
+ ]
33
+ return 0.2126 * linear[0] + 0.7152 * linear[1] + 0.0722 * linear[2]
34
+
35
+
36
+ def _contrast_ratio(first: str, second: str) -> float:
37
+ lighter, darker = sorted(
38
+ (_relative_luminance(first), _relative_luminance(second)), reverse=True
39
+ )
40
+ return (lighter + 0.05) / (darker + 0.05)
41
+
42
+
43
+ def _muted_foreground(ansi: list[str], foreground: str, background: str) -> str:
44
+ """Choose the least-prominent candidate that still meets WCAG AA."""
45
+ candidates = (ansi[8], ansi[14], ansi[15], foreground)
46
+ readable = [
47
+ color for color in candidates if _contrast_ratio(color, background) >= 4.5
48
+ ]
49
+ return min(
50
+ readable,
51
+ key=lambda color: _contrast_ratio(color, background),
52
+ default=foreground,
53
+ )
54
+
55
+
56
+ def get_style_rules() -> dict[str, str]:
57
+ """Return semantic prompt-toolkit rules for the active theme."""
58
+ palette = _active_palette()
59
+ if palette is None:
60
+ return {}
61
+
62
+ ansi = palette["ansi"]
63
+ foreground = palette.get("fg", ansi[7])
64
+ background = palette.get("bg", ansi[0])
65
+ muted = _muted_foreground(ansi, foreground, background)
66
+ return {
67
+ "": f"fg:{foreground} bg:{background}",
68
+ "tui": f"fg:{foreground} bg:{background}",
69
+ "tui.header": f"fg:{ansi[12]} bold",
70
+ "tui.title": f"fg:{ansi[14]} bold",
71
+ "tui.body": f"fg:{foreground}",
72
+ "tui.label": f"fg:{foreground} bold",
73
+ "tui.muted": f"fg:{muted}",
74
+ "tui.border": f"fg:{ansi[12]}",
75
+ "tui.selected": f"fg:{background} bg:{ansi[12]} bold noreverse",
76
+ "tui.help": f"fg:{muted}",
77
+ "tui.help-key": f"fg:{ansi[10]} bold",
78
+ "tui.success": f"fg:{ansi[10]} bold",
79
+ "tui.warning": f"fg:{ansi[11]} bold",
80
+ "tui.error": f"fg:{ansi[9]} bold",
81
+ "tui.input": f"fg:{foreground}",
82
+ "tui.input.focused": f"fg:{background} bg:{ansi[12]} bold noreverse",
83
+ # Override prompt_toolkit's more-specific grey-on-white completion rules
84
+ # so the shared theme applies to menus too.
85
+ "completion-menu": f"fg:{muted} bg:{background} noreverse",
86
+ "completion-menu.completion": f"fg:{muted} bg:{background} noreverse",
87
+ "completion-menu.completion.current": (
88
+ f"fg:{ansi[12]} bg:{background} bold noreverse"
89
+ ),
90
+ "completion-menu.meta.completion": (
91
+ f"fg:{muted} bg:{background} italic noreverse"
92
+ ),
93
+ "completion-menu.meta.completion.current": (
94
+ f"fg:{ansi[14]} bg:{background} italic noreverse"
95
+ ),
96
+ "completion-menu.multi-column-meta": f"bg:{background}",
97
+ "scrollbar.background": f"fg:{muted} bg:{background}",
98
+ "scrollbar.button": f"fg:{muted} bg:{background}",
99
+ }
100
+
101
+
102
+ def get_style() -> Style:
103
+ """Build the active semantic style, or an empty style without a theme."""
104
+ return Style.from_dict(get_style_rules())
105
+
106
+
107
+ def merge_with_active_style(style: BaseStyle | None) -> BaseStyle:
108
+ """Layer a menu's specialized style over the shared theme base."""
109
+ themed = get_style()
110
+ return merge_styles([themed, style]) if style is not None else themed
111
+
112
+
113
+ __all__ = ["get_style", "get_style_rules", "merge_with_active_style"]