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,249 @@
1
+ """Register callbacks for the ``context_indicator`` plugin.
2
+
3
+ Hooks:
4
+
5
+ * ``startup`` — wraps the bottom bar's token-summary writer so the status
6
+ row shows a colored circle reflecting current context-window usage,
7
+ e.g. ``80.7k/500k tokens (16%)`` gains a green/yellow/red badge.
8
+ * ``custom_command`` / ``custom_command_help`` — exposes ``/context`` for a
9
+ detailed token-usage breakdown.
10
+
11
+ Idempotent: re-installing the status patch is a no-op.
12
+ """
13
+
14
+ from __future__ import annotations
15
+
16
+ from typing import List, Tuple
17
+
18
+ from code_puppy.callbacks import register_callback
19
+ from code_puppy.token_usage import (
20
+ ContextUsage,
21
+ get_current_usage,
22
+ )
23
+
24
+ _COMMAND_NAME = "context"
25
+ _PATCH_ATTR = "_context_indicator_original"
26
+
27
+
28
+ # ---------------------------------------------------------------------------
29
+ # Messaging helpers (lazy-imported to dodge circular imports at boot)
30
+ # ---------------------------------------------------------------------------
31
+ def _emit_info(message: str) -> None:
32
+ from code_puppy.messaging import emit_info
33
+
34
+ emit_info(message)
35
+
36
+
37
+ def _emit_system_message(message: str) -> None:
38
+ from code_puppy.messaging import emit_system_message
39
+
40
+ emit_system_message(message)
41
+
42
+
43
+ def _emit_error(message: str) -> None:
44
+ from code_puppy.messaging import emit_error
45
+
46
+ emit_error(message)
47
+
48
+
49
+ # ---------------------------------------------------------------------------
50
+ # Status-line patching
51
+ # ---------------------------------------------------------------------------
52
+ def _decorate_status(info: str) -> str:
53
+ """Prepend the usage light to a non-empty token summary.
54
+
55
+ Empty strings pass through untouched: those are "clear the row" calls
56
+ and must stay empty so the idle prompt isn't haunted by a lone circle.
57
+ """
58
+ if not info:
59
+ return info
60
+ usage = get_current_usage()
61
+ if usage is None:
62
+ return info
63
+ return f"{usage.indicator} {info}"
64
+
65
+
66
+ def _install_status_patch() -> None:
67
+ """Monkey-patch ``_compaction.update_spinner_context`` once.
68
+
69
+ The token summary on the bottom bar's status row is written by
70
+ ``agents._compaction`` through its import-time binding of
71
+ ``update_spinner_context`` — so that binding (not the ``spinner``
72
+ module attribute) is the seam we wrap. The badge rides the status
73
+ row, next to the numbers it describes, instead of the prompt line.
74
+ """
75
+ from code_puppy.agents import _compaction
76
+
77
+ if getattr(_compaction, _PATCH_ATTR, None) is not None:
78
+ return # Already patched
79
+
80
+ original = _compaction.update_spinner_context
81
+ setattr(_compaction, _PATCH_ATTR, original)
82
+
83
+ def patched(info: str) -> None:
84
+ original(_decorate_status(info))
85
+
86
+ _compaction.update_spinner_context = patched
87
+
88
+
89
+ _LEGEND_TEXT = (
90
+ "Context indicator: 🟢 <30% 🟡 30–<65% 🔴 ≥65% "
91
+ "(use /context for a detailed breakdown)"
92
+ )
93
+
94
+
95
+ def _announce_legend() -> None:
96
+ try:
97
+ _emit_system_message(_LEGEND_TEXT)
98
+ except Exception:
99
+ # Never crash startup over a banner line — fail gracefully per plugin rules.
100
+ pass
101
+
102
+
103
+ def _on_startup() -> None:
104
+ try:
105
+ _install_status_patch()
106
+ except Exception as exc:
107
+ _emit_error(f"context_indicator: failed to install status patch — {exc}")
108
+ _announce_legend()
109
+
110
+
111
+ # ---------------------------------------------------------------------------
112
+ # /context slash command
113
+ # ---------------------------------------------------------------------------
114
+ def _custom_help() -> List[Tuple[str, str]]:
115
+ return [
116
+ (
117
+ _COMMAND_NAME,
118
+ "Show context-window usage (tokens used vs. model capacity)",
119
+ )
120
+ ]
121
+
122
+
123
+ # Bar glyphs — kept as module constants so the legend stays DRY.
124
+ _BAR_GLYPH_OVERHEAD = "▒" # system prompt + tool schema baseline
125
+ _BAR_GLYPH_MESSAGES = "█" # conversation tokens
126
+ _BAR_GLYPH_EMPTY = "░" # unused capacity
127
+ _BAR_GLYPH_THRESHOLD = "┃" # vertical marker for compaction trigger
128
+ _BAR_WIDTH = 30
129
+
130
+
131
+ def _render_usage_bar(usage: ContextUsage, threshold: float) -> str:
132
+ """Render the ASCII usage bar with three zones + a compaction marker.
133
+
134
+ Zones: overhead | messages | empty. The compaction-threshold marker
135
+ overwrites whichever cell it lands on (cosmetic; the underlying token
136
+ counts are unchanged).
137
+ """
138
+ capacity = max(1, usage.capacity)
139
+ overhead_cells = min(
140
+ _BAR_WIDTH, int(round(usage.overhead_tokens / capacity * _BAR_WIDTH))
141
+ )
142
+ total_cells = min(
143
+ _BAR_WIDTH, int(round(usage.total_tokens / capacity * _BAR_WIDTH))
144
+ )
145
+ # Guarantee messages cells start strictly after overhead cells.
146
+ message_cells = max(0, total_cells - overhead_cells)
147
+ empty_cells = _BAR_WIDTH - overhead_cells - message_cells
148
+
149
+ cells = (
150
+ [_BAR_GLYPH_OVERHEAD] * overhead_cells
151
+ + [_BAR_GLYPH_MESSAGES] * message_cells
152
+ + [_BAR_GLYPH_EMPTY] * empty_cells
153
+ )
154
+
155
+ threshold_clamped = max(0.0, min(1.0, threshold))
156
+ marker_idx = min(_BAR_WIDTH - 1, int(round(threshold_clamped * _BAR_WIDTH)))
157
+ cells[marker_idx] = _BAR_GLYPH_THRESHOLD
158
+ return "".join(cells)
159
+
160
+
161
+ def _get_compaction_threshold() -> float:
162
+ """Fetch compaction threshold defensively; fall back to 0.85 on any error."""
163
+ try:
164
+ from code_puppy.config import get_compaction_threshold
165
+
166
+ return float(get_compaction_threshold())
167
+ except Exception:
168
+ return 0.85
169
+
170
+
171
+ def _format_overhead_breakdown(usage: ContextUsage) -> str:
172
+ """Render the per-bucket overhead breakdown.
173
+
174
+ Each non-zero bucket gets its own indented line. Zero-valued buckets are
175
+ hidden so users with no MCP servers / no AGENTS.md aren't staring at
176
+ noise. We *always* show the aggregate ``Overhead`` line so the report
177
+ structure stays consistent.
178
+ """
179
+ # (label, token_count) — order matters for readability.
180
+ rows = (
181
+ ("System prompt", usage.system_prompt_tokens),
182
+ ("AGENTS.md ", usage.agents_md_tokens),
183
+ ("Kennel memory", usage.kennel_memory_tokens),
184
+ ("Pydantic tools", usage.pydantic_tools_tokens),
185
+ ("MCP toolsets ", usage.mcp_tokens),
186
+ )
187
+ lines = [
188
+ f" └─ {label}: {tokens:,} tokens" for label, tokens in rows if tokens > 0
189
+ ]
190
+ return "\n".join(lines)
191
+
192
+
193
+ def _format_usage_report(usage: ContextUsage) -> str:
194
+ threshold = _get_compaction_threshold()
195
+ bar = _render_usage_bar(usage, threshold)
196
+ legend = (
197
+ f" Legend : {_BAR_GLYPH_OVERHEAD} overhead "
198
+ f"{_BAR_GLYPH_MESSAGES} messages "
199
+ f"{_BAR_GLYPH_EMPTY} free "
200
+ f"{_BAR_GLYPH_THRESHOLD} compaction @ {threshold:.0%}"
201
+ )
202
+ breakdown = _format_overhead_breakdown(usage)
203
+ breakdown_block = f"\n{breakdown}" if breakdown else ""
204
+ return (
205
+ f"{usage.indicator} Context usage: {usage.percent:.1f}%\n"
206
+ f" [{bar}]\n"
207
+ f"{legend}\n"
208
+ f" Messages : {usage.used_tokens:,} tokens\n"
209
+ f" Overhead : {usage.overhead_tokens:,} tokens (system prompt + AGENTS.md + kennel memory + tools + MCP)"
210
+ f"{breakdown_block}\n"
211
+ f" Total : {usage.total_tokens:,} / {usage.capacity:,} tokens\n"
212
+ f" Buckets : 🟢 <30% 🟡 30–65% 🔴 ≥65%"
213
+ )
214
+
215
+
216
+ def _handle_context_command(command: str) -> bool:
217
+ usage = get_current_usage()
218
+ if usage is None:
219
+ _emit_info("🐶 No context info yet — load an agent and send a message first.")
220
+ return True
221
+ _emit_info(_format_usage_report(usage))
222
+ return True
223
+
224
+
225
+ def _handle_custom_command(command: str, name: str):
226
+ if name != _COMMAND_NAME:
227
+ return None
228
+ return _handle_context_command(command)
229
+
230
+
231
+ # ---------------------------------------------------------------------------
232
+ # Registration
233
+ # ---------------------------------------------------------------------------
234
+ register_callback("startup", _on_startup)
235
+ register_callback("custom_command", _handle_custom_command)
236
+ register_callback("custom_command_help", _custom_help)
237
+
238
+
239
+ __all__ = [
240
+ "_announce_legend",
241
+ "_custom_help",
242
+ "_decorate_status",
243
+ "_format_overhead_breakdown",
244
+ "_format_usage_report",
245
+ "_handle_context_command",
246
+ "_handle_custom_command",
247
+ "_install_status_patch",
248
+ "_on_startup",
249
+ ]
@@ -0,0 +1,40 @@
1
+ """Compatibility shim for the relocated token-usage module.
2
+
3
+ Token accounting moved from this plugin into the core module
4
+ ``code_puppy.token_usage`` so that more than one consumer (the
5
+ ``context_indicator`` plugin, the ``statusline`` plugin, and the ``herdr``
6
+ integration) can share it without cross-plugin imports.
7
+
8
+ This module remains as a thin re-export so existing import sites and tests
9
+ that reference ``code_puppy_core_plugins.context_indicator.usage`` keep working
10
+ and observe the *same* objects as the core module (identity is preserved).
11
+ New code should import from :mod:`code_puppy.token_usage` directly.
12
+ """
13
+
14
+ from __future__ import annotations
15
+
16
+ from code_puppy.token_usage import (
17
+ GREEN_CIRCLE,
18
+ GREEN_THRESHOLD,
19
+ RED_CIRCLE,
20
+ YELLOW_CIRCLE,
21
+ YELLOW_THRESHOLD,
22
+ ContextUsage,
23
+ OverheadBreakdown,
24
+ compute_overhead_breakdown,
25
+ get_current_usage,
26
+ pick_indicator,
27
+ )
28
+
29
+ __all__ = [
30
+ "ContextUsage",
31
+ "OverheadBreakdown",
32
+ "get_current_usage",
33
+ "compute_overhead_breakdown",
34
+ "pick_indicator",
35
+ "GREEN_THRESHOLD",
36
+ "YELLOW_THRESHOLD",
37
+ "GREEN_CIRCLE",
38
+ "YELLOW_CIRCLE",
39
+ "RED_CIRCLE",
40
+ ]
@@ -0,0 +1,11 @@
1
+ """GitHub Copilot auth plugin for Code Puppy.
2
+
3
+ Authenticates with GitHub (or GitHub Enterprise) via the browser-based
4
+ Device Flow and exchanges the resulting OAuth token for a short-lived
5
+ Copilot session token to access the Copilot API.
6
+
7
+ Commands:
8
+ - ``/copilot-login`` — authenticate via browser
9
+ - ``/copilot-status`` — show auth & model status
10
+ - ``/copilot-logout`` — remove tokens and registered models
11
+ """
@@ -0,0 +1,93 @@
1
+ """Configuration constants for the GitHub Copilot auth plugin."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pathlib import Path
6
+ from typing import Any, Dict
7
+
8
+ from code_puppy import config
9
+
10
+ # GitHub Copilot auth configuration
11
+ COPILOT_AUTH_CONFIG: Dict[str, Any] = {
12
+ # Copilot session-token endpoints
13
+ "github_token_url": "https://api.github.com/copilot_internal/v2/token",
14
+ # GHE template: replace {host}
15
+ "ghe_token_url_template": "https://{host}/api/v3/copilot_internal/v2/token",
16
+ # OpenAI-compatible Copilot chat API (default; overridden per-host at runtime)
17
+ "api_base_url": "https://api.githubcopilot.com",
18
+ # Model prefix in Code Puppy
19
+ "prefix": "copilot-",
20
+ "default_context_length": 128000,
21
+ # Headers expected by the Copilot API
22
+ "editor_version": "JetBrains-IU/2024.3",
23
+ "editor_plugin_version": "copilot/2.0.0",
24
+ "copilot_integration_id": "vscode-chat",
25
+ "openai_intent": "conversation-panel",
26
+ }
27
+
28
+ # GitHub Device Flow configuration — browser-based auth with no IDE required.
29
+ # Uses the VS Code Copilot extension's public client ID which supports Device Flow.
30
+ DEVICE_FLOW_CONFIG: Dict[str, Any] = {
31
+ "client_id": "Iv1.b507a08c87ecfe98",
32
+ "scope": "read:user",
33
+ # Endpoint templates — {host} is replaced at runtime
34
+ "device_code_url": "https://{host}/login/device/code",
35
+ "access_token_url": "https://{host}/login/oauth/access_token",
36
+ # Polling defaults (server may override via response)
37
+ "default_poll_interval": 5,
38
+ "grant_type": "urn:ietf:params:oauth:grant-type:device_code",
39
+ }
40
+
41
+ # Models known to be available via Copilot (costs are $0 via Copilot).
42
+ # The /copilot-login flow will also try to fetch the live model list.
43
+ DEFAULT_COPILOT_MODELS = [
44
+ "gpt-4o",
45
+ "gpt-4.1",
46
+ "gpt-4.1-mini",
47
+ "o4-mini",
48
+ "o3",
49
+ "claude-opus-4.6",
50
+ "claude-opus-4",
51
+ "claude-sonnet-4",
52
+ "claude-sonnet-4.5",
53
+ "claude-haiku-4.5",
54
+ "gemini-2.5-pro",
55
+ "gemini-2.5-flash",
56
+ ]
57
+
58
+ # Per-model context-length overrides (tokens).
59
+ COPILOT_MODEL_CONTEXT_LENGTHS: Dict[str, int] = {
60
+ "gpt-4o": 64000,
61
+ "gpt-4.1": 128000,
62
+ "gpt-4.1-mini": 128000,
63
+ "o4-mini": 128000,
64
+ "o3": 128000,
65
+ "claude-opus-4.6": 200000,
66
+ "claude-opus-4": 200000,
67
+ "claude-sonnet-4": 128000,
68
+ "claude-sonnet-4.5": 128000,
69
+ "claude-haiku-4.5": 128000,
70
+ "gemini-2.5-pro": 128000,
71
+ "gemini-2.5-flash": 128000,
72
+ }
73
+
74
+
75
+ def get_copilot_models_path() -> Path:
76
+ """Return path for persisted copilot_models.json (XDG_DATA_HOME)."""
77
+ data_dir = Path(config.DATA_DIR)
78
+ data_dir.mkdir(parents=True, exist_ok=True, mode=0o700)
79
+ return data_dir / "copilot_models.json"
80
+
81
+
82
+ def get_session_cache_path() -> Path:
83
+ """Return path for caching the short-lived Copilot session token."""
84
+ data_dir = Path(config.DATA_DIR)
85
+ data_dir.mkdir(parents=True, exist_ok=True, mode=0o700)
86
+ return data_dir / "copilot_session.json"
87
+
88
+
89
+ def get_device_token_storage_path() -> Path:
90
+ """Return path for storing tokens obtained via the GitHub Device Flow."""
91
+ data_dir = Path(config.DATA_DIR)
92
+ data_dir.mkdir(parents=True, exist_ok=True, mode=0o700)
93
+ return data_dir / "copilot_device_tokens.json"