@yasaswy.nagavolu/agents 0.35.0 → 0.36.1

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 (401) hide show
  1. package/README.md +41 -2
  2. package/bin/cli.js +135 -17
  3. package/content/agents/idea-agent/council_fanout.py +3 -3
  4. package/content/agents/lib/council_common.py +7 -0
  5. package/content/agents/lib/test_council_common.py +10 -0
  6. package/content/agents/plan-agent/plan_council_fanout.py +3 -3
  7. package/content/agents/review-agent/architecture_diagram_council_fanout.py +1 -1
  8. package/content/agents/review-agent/review_council_fanout.py +3 -3
  9. package/content/agents/review-agent/test_visual_diagnosis_review_agent.py +6 -3
  10. package/content/agents/review-agent/visual_diagnosis.py +1 -10
  11. package/content/agents/review-agent/visual_review_council_fanout.py +4 -27
  12. package/content/agents/scribe-agent/SKILL.md +1 -1
  13. package/content/agents/scribe-agent/scribe_runner.py +2 -2
  14. package/content/agents/visual-review-council/test_visual_diagnosis_vrc.py +6 -3
  15. package/content/agents/visual-review-council/visual_diagnosis.py +1 -10
  16. package/content/global/CLAUDE.md +4 -4
  17. package/content/global/hooks/project_hook.sh +0 -0
  18. package/content/global/hooks/pyrun.js +65 -6
  19. package/content/global/rules/ui-table-layout.md +41 -0
  20. package/content/hooks/conclusion-scribe/README.md +3 -3
  21. package/content/hooks/conclusion-scribe/conclusion-scribe.env.example +1 -1
  22. package/content/hooks/conclusion-scribe/conclusion_scribe_hook.py +1 -1
  23. package/content/hooks/conclusion-scribe/test_conclusion_scribe_hook.py +1 -1
  24. package/content/hooks/worktree-registry/test_worktree_registry.py +8 -5
  25. package/content/manifest.json +525 -32
  26. package/content/manifest.schema.json +31 -2
  27. package/content/mcps/chrome_devtools_final_actions.json +35 -0
  28. package/content/mcps/chrome_devtools_gate.js +204 -32
  29. package/content/mcps/chrome_devtools_policy.js +268 -0
  30. package/content/mcps/chrome_devtools_rules.json +77 -0
  31. package/content/mcps/mcps.json +5 -5
  32. package/content/packages/cli/templates/start-litellm.sh +0 -0
  33. package/content/proxy/README.md +7 -7
  34. package/content/proxy/agents_env.py +1 -1
  35. package/content/proxy/chat_ledger.py +124 -3
  36. package/content/proxy/chrome_devtools_guard.py +100 -23
  37. package/content/proxy/chrome_profile_lock.py +8 -0
  38. package/content/proxy/claude_router.py +6 -4
  39. package/content/proxy/dev_root.py +67 -0
  40. package/content/proxy/headless_launch.py +78 -0
  41. package/content/proxy/headless_launch_rules.py +361 -0
  42. package/content/proxy/headless_scan.py +309 -0
  43. package/content/proxy/headless_spawn_guard.py +94 -6
  44. package/content/proxy/litellm/smoke_test.py +6 -17
  45. package/content/proxy/litellm/start.ps1 +1 -1
  46. package/content/proxy/log_retention.py +48 -0
  47. package/content/proxy/mem_sampler.py +55 -2
  48. package/content/proxy/memory_first_hook.py +2 -1
  49. package/content/proxy/portal/README.md +20 -0
  50. package/content/proxy/portal/aggregator.py +50 -16
  51. package/content/proxy/portal/portal_service.py +95 -0
  52. package/content/proxy/proc_policy.py +8 -4
  53. package/content/proxy/project_resolver.py +3 -3
  54. package/content/proxy/publish_guard.py +2 -2
  55. package/content/proxy/push_hold.py +240 -0
  56. package/content/proxy/route_lock.py +1 -1
  57. package/content/proxy/shell_parse.py +3 -3
  58. package/content/proxy/web_search_guard.py +4 -16
  59. package/content/scripts/_vlm.py +5 -24
  60. package/content/scripts/backfill_armed_repos.py +3 -2
  61. package/content/scripts/prd_registry.py +1 -1
  62. package/content/scripts/review_pass.py +1 -1
  63. package/content/scripts/test_review_pass.py +1 -1
  64. package/content/skills/README.md +1 -1
  65. package/content/skills/android-emulator/emulator_launch.py +6 -1
  66. package/content/skills/android-emulator/tests/test_emulator_launch.py +13 -0
  67. package/content/skills/code-is-law/lint_skill.py +11 -5
  68. package/content/skills/code-is-law/tests/test_lint_skill.py +13 -0
  69. package/content/skills/disk-cleanup/SKILL.md +16 -3
  70. package/content/skills/disk-cleanup/disk_scan.py +179 -0
  71. package/content/skills/disk-cleanup/known_patterns.macos.json +31 -0
  72. package/content/skills/disk-cleanup/space_core.py +387 -0
  73. package/content/skills/disk-cleanup/tests/conftest.py +12 -0
  74. package/content/skills/disk-cleanup/tests/macsupport.py +56 -0
  75. package/content/skills/disk-cleanup/tests/test_disk_scan_mac.py +172 -0
  76. package/content/skills/disk-cleanup/tests/test_make_space_mac.py +362 -0
  77. package/content/skills/disk-cleanup/tests/test_space_core.py +222 -0
  78. package/content/skills/disk-cleanup/worktree_audit.py +175 -0
  79. package/content/skills/edit-videos/SKILL.md +5 -5
  80. package/content/skills/edit-videos/actions.json +24 -9
  81. package/content/skills/edit-videos/engine/actions_catalog.py +19 -6
  82. package/content/skills/edit-videos/engine/ffmpeg_io.py +2 -2
  83. package/content/skills/edit-videos/exit_codes.py +4 -0
  84. package/content/skills/edit-videos/pyproject.toml +1 -0
  85. package/content/skills/edit-videos/resolve_ui/__main__.py +13 -0
  86. package/content/skills/edit-videos/resolve_ui/flows.py +1 -0
  87. package/content/skills/edit-videos/resolve_ui/locate.py +5 -2
  88. package/content/skills/edit-videos/tests/conftest.py +3 -0
  89. package/content/skills/edit-videos/tests/test_actions_catalog.py +16 -0
  90. package/content/skills/edit-videos/tests/test_workspace.py +11 -0
  91. package/content/skills/edit-videos/uv.lock +2 -0
  92. package/content/skills/edit-videos/workspace.py +9 -1
  93. package/content/skills/expo-release/expo_release.py +80 -25
  94. package/content/skills/expo-release/tests/test_expo_release.py +148 -0
  95. package/content/skills/gmail-reader/README.md +2 -0
  96. package/content/skills/gmail-reader/SKILL.md +2 -0
  97. package/content/skills/gmail-reader/gmail_reader/purchases/parse.py +107 -0
  98. package/content/skills/gmail-reader/gmail_reader/version.py +1 -1
  99. package/content/skills/gmail-reader/tests/test_charges.py +75 -0
  100. package/content/skills/gmail-reader/tests/test_zero_prices.py +39 -0
  101. package/content/skills/graphic-novel-pipeline/scripts/generate_art_gemini.py +1 -1
  102. package/content/skills/graphic-novel-pipeline/scripts/gn_common.py +11 -2
  103. package/content/skills/graphic-novel-pipeline/scripts/pipeline.py +4 -2
  104. package/content/skills/graphic-novel-pipeline/scripts/synth_audit.py +4 -1
  105. package/content/skills/heavy-gate-runner/heavy_gate_runner.py +1 -1
  106. package/content/skills/html-mocker/SKILL.md +2 -0
  107. package/content/skills/html-mocker/audit.js +73 -0
  108. package/content/skills/html-mocker/tests/test_audit.py +30 -0
  109. package/content/skills/launch-litellm/SKILL.md +39 -18
  110. package/content/skills/launch-litellm/launch_litellm.ps1 +14 -2
  111. package/content/skills/launch-litellm/launch_litellm.py +111 -0
  112. package/content/skills/launch-litellm/litellm_docker.py +168 -0
  113. package/content/skills/low-ram-advisor/SKILL.md +8 -0
  114. package/content/skills/low-ram-advisor/advisor.py +26 -1
  115. package/content/skills/low-ram-advisor/deep_report.py +4 -13
  116. package/content/skills/low-ram-advisor/macmem.py +173 -0
  117. package/content/skills/low-ram-advisor/ram_optimize.py +34 -7
  118. package/content/skills/low-ram-advisor/ram_thresholds.py +2 -0
  119. package/content/skills/low-ram-advisor/ramstatus.py +16 -4
  120. package/content/skills/low-ram-advisor/restart_verdict.py +23 -0
  121. package/content/skills/low-ram-advisor/tests/test_advisor.py +13 -0
  122. package/content/skills/low-ram-advisor/tests/test_deep_report.py +3 -2
  123. package/content/skills/low-ram-advisor/tests/test_macmem.py +221 -0
  124. package/content/skills/make-space/SKILL.md +50 -2
  125. package/content/skills/make-space/allowlist.macos.json +79 -0
  126. package/content/skills/make-space/make_space.py +282 -0
  127. package/content/skills/make-space/scratch_guard.py +227 -0
  128. package/content/skills/mcp-oauth-connector/README.md +2 -2
  129. package/content/skills/mcp-oauth-connector/SKILL.md +2 -2
  130. package/content/skills/mcp-oauth-connector/get-connector-values.ps1 +2 -2
  131. package/content/skills/onebrain-connector/SKILL.md +4 -4
  132. package/content/skills/onebrain-connector/get-connector-values.ps1 +2 -1
  133. package/content/skills/publish-article/SKILL.md +4 -4
  134. package/content/skills/publish-article/architecture_review.py +1 -1
  135. package/content/skills/publish-article/companion_repo_checklist.py +1 -1
  136. package/content/skills/publish-article/lint_article.py +8 -6
  137. package/content/skills/publish-article/publish_article.py +64 -34
  138. package/content/skills/publish-article/released_bundles.py +6 -2
  139. package/content/skills/publish-article/repo_locate.py +4 -1
  140. package/content/skills/publish-article/tests/test_dev_root_defaults.py +37 -0
  141. package/content/skills/publish-article/tests/test_fresh_worktree_layout.py +2 -0
  142. package/content/skills/publish-article/tests/test_publish_article.py +131 -14
  143. package/content/skills/ram/SKILL.md +15 -5
  144. package/content/skills/read-reddit-post/session_probe.py +3 -9
  145. package/content/skills/read-reddit-post/tests/test_session_probe.py +19 -0
  146. package/content/skills/resale/CONTRACTS.md +102 -12
  147. package/content/skills/resale/README.md +145 -13
  148. package/content/skills/resale/SKILL.md +22 -12
  149. package/content/skills/resale/prompts/comps_review.md +4 -2
  150. package/content/skills/resale/resale/__init__.py +1 -1
  151. package/content/skills/resale/resale/analysis/bundle.py +43 -19
  152. package/content/skills/resale/resale/analysis/gather.py +4 -2
  153. package/content/skills/resale/resale/analysis/paid_check.py +47 -0
  154. package/content/skills/resale/resale/analysis/runner.py +16 -2
  155. package/content/skills/resale/resale/analysis/stats.py +22 -5
  156. package/content/skills/resale/resale/comps/market_value.py +18 -7
  157. package/content/skills/resale/resale/comps/review_runner.py +16 -6
  158. package/content/skills/resale/resale/comps/specs.py +38 -2
  159. package/content/skills/resale/resale/conditions.py +13 -0
  160. package/content/skills/resale/resale/contracts/__init__.py +6 -2
  161. package/content/skills/resale/resale/contracts/comp_decisions.schema.json +2 -2
  162. package/content/skills/resale/resale/contracts/event.schema.json +1 -1
  163. package/content/skills/resale/resale/contracts/inquiry_batch.schema.json +34 -0
  164. package/content/skills/resale/resale/contracts/item_specs.schema.json +19 -1
  165. package/content/skills/resale/resale/contracts/reader_targets.schema.json +17 -1
  166. package/content/skills/resale/resale/db/migrations/0018_unproven_zero_paid.sql +12 -0
  167. package/content/skills/resale/resale/db/migrations/0019_equivalent_comps.sql +17 -0
  168. package/content/skills/resale/resale/db/migrations/0020_selling_notes.sql +1 -0
  169. package/content/skills/resale/resale/db/migrations/0021_paid_incl_tax.sql +5 -0
  170. package/content/skills/resale/resale/db/migrations/0022_draft_filled.sql +2 -0
  171. package/content/skills/resale/resale/db/migrations/0023_purchased_source.sql +1 -0
  172. package/content/skills/resale/resale/db/migrations/0024_buyer_inquiries.sql +44 -0
  173. package/content/skills/resale/resale/db/migrations/0025_listing_copy.sql +7 -0
  174. package/content/skills/resale/resale/db/migrations/0026_selling_lifecycle.sql +6 -0
  175. package/content/skills/resale/resale/db/migrations/0027_own_listing_alias.sql +1 -0
  176. package/content/skills/resale/resale/inquiries/__init__.py +1 -0
  177. package/content/skills/resale/resale/inquiries/commands.py +28 -0
  178. package/content/skills/resale/resale/inquiries/match.py +85 -0
  179. package/content/skills/resale/resale/inquiries/parse.py +156 -0
  180. package/content/skills/resale/resale/inquiries/queries.py +24 -0
  181. package/content/skills/resale/resale/inquiries/refs.py +63 -0
  182. package/content/skills/resale/resale/inquiries/rules.py +84 -0
  183. package/content/skills/resale/resale/inquiries/scan.py +124 -0
  184. package/content/skills/resale/resale/inquiries/store.py +90 -0
  185. package/content/skills/resale/resale/inventory/bundles.py +9 -0
  186. package/content/skills/resale/resale/inventory/paid.py +65 -0
  187. package/content/skills/resale/resale/portal/bundles.py +32 -10
  188. package/content/skills/resale/resale/portal/layout.py +59 -18
  189. package/content/skills/resale/resale/portal/market_cells.py +2 -1
  190. package/content/skills/resale/resale/portal/paid_cells.py +78 -0
  191. package/content/skills/resale/resale/portal/panel.py +3 -3
  192. package/content/skills/resale/resale/portal/tablesort.py +1 -1
  193. package/content/skills/resale/resale/portal/views_analysis.py +45 -18
  194. package/content/skills/resale/resale/portal/views_conditions.py +121 -0
  195. package/content/skills/resale/resale/portal/views_inquiries.py +72 -0
  196. package/content/skills/resale/resale/portal/views_items.py +75 -24
  197. package/content/skills/resale/resale/portal/views_postkit.py +44 -9
  198. package/content/skills/resale/resale/portal/views_selling.py +132 -0
  199. package/content/skills/resale/resale/poster/__init__.py +1 -0
  200. package/content/skills/resale/resale/poster/adapters.py +238 -0
  201. package/content/skills/resale/resale/poster/commands.py +173 -0
  202. package/content/skills/resale/resale/poster/driver.py +409 -0
  203. package/content/skills/resale/resale/poster/review_window.py +210 -0
  204. package/content/skills/resale/resale/poster/rules.py +121 -0
  205. package/content/skills/resale/resale/poster/runner.py +236 -0
  206. package/content/skills/resale/resale/poster/specs.py +31 -0
  207. package/content/skills/resale/resale/postkit/drafts.py +157 -41
  208. package/content/skills/resale/resale/postkit/fill.py +77 -0
  209. package/content/skills/resale/resale/postkit/health.py +71 -0
  210. package/content/skills/resale/resale/postkit/lint.py +111 -0
  211. package/content/skills/resale/resale/postkit/platforms.py +27 -2
  212. package/content/skills/resale/resale/postkit/post_id.py +55 -0
  213. package/content/skills/resale/resale/postkit/posting.py +3 -0
  214. package/content/skills/resale/resale/postkit/pricing.py +15 -4
  215. package/content/skills/resale/resale/postkit/selling.py +112 -0
  216. package/content/skills/resale/resale/postkit/specs.py +29 -0
  217. package/content/skills/resale/resale/postkit/text.py +118 -26
  218. package/content/skills/resale/resale/price_rule.py +40 -0
  219. package/content/skills/resale/resale/publisher/allowlist.py +2 -2
  220. package/content/skills/resale/resale/publisher/chrome_profile_lock.py +8 -0
  221. package/content/skills/resale/resale/publisher/commands.py +2 -2
  222. package/content/skills/resale/resale/publisher/pricing.py +14 -4
  223. package/content/skills/resale/resale/publisher/proposals.py +3 -0
  224. package/content/skills/resale/resale/publisher/review.py +5 -3
  225. package/content/skills/resale/resale/receipts/amazon_history.py +43 -9
  226. package/content/skills/resale/resale/receipts/charges.py +192 -0
  227. package/content/skills/resale/resale/receipts/commands.py +54 -0
  228. package/content/skills/resale/resale/receipts/intake.py +1 -0
  229. package/content/skills/resale/resale/receipts/reader_link.py +1 -1
  230. package/content/skills/resale/resale/receipts/store.py +98 -13
  231. package/content/skills/resale/resale/service/app.py +13 -1
  232. package/content/skills/resale/resale/service/commands.py +31 -3
  233. package/content/skills/resale/resale/service/comp_gate.py +13 -6
  234. package/content/skills/resale/resale/service/comps_review.py +17 -12
  235. package/content/skills/resale/resale/service/comps_service.py +25 -7
  236. package/content/skills/resale/resale/service/condition_refresh.py +34 -0
  237. package/content/skills/resale/resale/service/copy_plan.py +92 -0
  238. package/content/skills/resale/resale/service/drafts.py +23 -11
  239. package/content/skills/resale/resale/service/inventory_ops.py +141 -6
  240. package/content/skills/resale/resale/service/market.py +30 -10
  241. package/content/skills/resale/resale/service/queries.py +12 -3
  242. package/content/skills/resale/resale/service/round_prices.py +82 -0
  243. package/content/skills/resale/resale/service/scheduler.py +14 -0
  244. package/content/skills/resale/resale/service/server.py +136 -3
  245. package/content/skills/resale/resale/service/store.py +2 -2
  246. package/content/skills/resale/resale/settings.py +6 -0
  247. package/content/skills/resale/resale/sources/__init__.py +1 -0
  248. package/content/skills/resale/resale/sources/amazon_orders.py +35 -10
  249. package/content/skills/resale/resale/sources/amazon_reader.py +37 -4
  250. package/content/skills/resale/resale/sources/astromart.py +25 -2
  251. package/content/skills/resale/resale/sources/browser_audit.py +122 -0
  252. package/content/skills/resale/resale/sources/chrome_paths.py +18 -0
  253. package/content/skills/resale/resale/sources/client.py +45 -1
  254. package/content/skills/resale/resale/sources/commands.py +79 -2
  255. package/content/skills/resale/resale/sources/listing_page.py +52 -0
  256. package/content/skills/resale/resale/sources/login_window.py +19 -4
  257. package/content/skills/resale/resale/sources/model.py +3 -2
  258. package/content/skills/resale/resale/sources/notify.py +47 -6
  259. package/content/skills/resale/resale/sources/own_check.py +70 -0
  260. package/content/skills/resale/resale/sources/runner.py +20 -0
  261. package/content/skills/resale/settings.example.env +8 -0
  262. package/content/skills/resale/tasks/reader_task.py +22 -5
  263. package/content/skills/resale/tests/conftest.py +11 -0
  264. package/content/skills/resale/tests/fixtures/amazon/order_real_cancelled.html +10 -0
  265. package/content/skills/resale/tests/fixtures/amazon/order_real_coupon.html +12 -0
  266. package/content/skills/resale/tests/fixtures/amazon/order_real_layout.html +15 -0
  267. package/content/skills/resale/tests/inquiry_fixtures.py +115 -0
  268. package/content/skills/resale/tests/test_amazon_history.py +30 -2
  269. package/content/skills/resale/tests/test_amazon_orders_parse.py +18 -0
  270. package/content/skills/resale/tests/test_amazon_reader.py +64 -0
  271. package/content/skills/resale/tests/test_analysis_stats.py +9 -0
  272. package/content/skills/resale/tests/test_astromart_live_ads.py +138 -0
  273. package/content/skills/resale/tests/test_browser_audit.py +115 -0
  274. package/content/skills/resale/tests/test_bundle.py +92 -2
  275. package/content/skills/resale/tests/test_comps_review.py +1 -1
  276. package/content/skills/resale/tests/test_condition_refresh.py +146 -0
  277. package/content/skills/resale/tests/test_conditions.py +9 -0
  278. package/content/skills/resale/tests/test_conditions_page.py +258 -0
  279. package/content/skills/resale/tests/test_equivalent_comps.py +309 -0
  280. package/content/skills/resale/tests/test_inquiries_parse.py +94 -0
  281. package/content/skills/resale/tests/test_inquiries_scan.py +168 -0
  282. package/content/skills/resale/tests/test_inquiries_service.py +280 -0
  283. package/content/skills/resale/tests/test_listing_copy.py +357 -0
  284. package/content/skills/resale/tests/test_lock_priority.py +40 -0
  285. package/content/skills/resale/tests/test_market_service.py +51 -0
  286. package/content/skills/resale/tests/test_market_trust.py +8 -1
  287. package/content/skills/resale/tests/test_market_value.py +19 -0
  288. package/content/skills/resale/tests/test_own_check.py +123 -0
  289. package/content/skills/resale/tests/test_paid_incl_tax.py +257 -0
  290. package/content/skills/resale/tests/test_paid_incl_tax_views.py +132 -0
  291. package/content/skills/resale/tests/test_paid_proof.py +152 -0
  292. package/content/skills/resale/tests/test_portal_bundles.py +2 -2
  293. package/content/skills/resale/tests/test_portal_inplace.py +12 -12
  294. package/content/skills/resale/tests/test_portal_layout.py +79 -29
  295. package/content/skills/resale/tests/test_portal_market.py +15 -0
  296. package/content/skills/resale/tests/test_portal_postkit.py +23 -3
  297. package/content/skills/resale/tests/test_portal_split.py +15 -7
  298. package/content/skills/resale/tests/test_post_id.py +118 -0
  299. package/content/skills/resale/tests/test_poster.py +710 -0
  300. package/content/skills/resale/tests/test_poster_review_window.py +367 -0
  301. package/content/skills/resale/tests/test_poster_specs.py +41 -0
  302. package/content/skills/resale/tests/test_postkit.py +123 -11
  303. package/content/skills/resale/tests/test_postkit_fill.py +147 -0
  304. package/content/skills/resale/tests/test_publisher_allowlist.py +5 -0
  305. package/content/skills/resale/tests/test_publisher_api.py +3 -3
  306. package/content/skills/resale/tests/test_publisher_apply.py +3 -3
  307. package/content/skills/resale/tests/test_publisher_commands.py +14 -6
  308. package/content/skills/resale/tests/test_publisher_pricing.py +3 -3
  309. package/content/skills/resale/tests/test_publisher_proposals.py +2 -2
  310. package/content/skills/resale/tests/test_publisher_review.py +3 -3
  311. package/content/skills/resale/tests/test_reader_notify.py +68 -1
  312. package/content/skills/resale/tests/test_reader_parsers.py +10 -2
  313. package/content/skills/resale/tests/test_round_prices.py +217 -0
  314. package/content/skills/resale/tests/test_selling.py +349 -0
  315. package/content/skills/resale/tests/test_selling_notes.py +129 -0
  316. package/content/skills/resale/tests/test_service_comps.py +31 -0
  317. package/content/skills/resale/tests/test_service_http.py +2 -2
  318. package/content/skills/resale/tests/test_service_ingest.py +25 -0
  319. package/content/skills/resale/tests/test_zero_paid.py +67 -0
  320. package/content/skills/resume-session/SKILL.md +25 -20
  321. package/content/skills/resume-session/resume_session.ps1 +2 -497
  322. package/content/skills/resume-session/resume_session.py +469 -0
  323. package/content/skills/resume-session/tests/test_resume_session.py +248 -0
  324. package/content/skills/session-trace/trace.py +1 -1
  325. package/content/skills/ship-the-code/SKILL.md +2 -1
  326. package/content/skills/ship-the-code/ship.py +135 -39
  327. package/content/skills/ship-the-code/tests/test_ship.py +36 -0
  328. package/content/skills/ship-the-code/tests/test_ship_manifest_lint.py +110 -0
  329. package/content/skills/ship-the-code/tests/test_ship_push_hold.py +122 -0
  330. package/content/skills/switch-model/README.md +2 -0
  331. package/content/skills/switch-model/SKILL.md +2 -0
  332. package/content/skills/visual-check/compare.py +4 -23
  333. package/content/skills/visual-gen/scripts/visualgen/keys.py +12 -2
  334. package/content/skills/web-search/search.py +4 -23
  335. package/content/statusline/statusline-command.ps1 +4 -2
  336. package/content/statusline/statusline-command.py +117 -4
  337. package/lib/bootstrap/index.js +191 -0
  338. package/lib/bootstrap/probe.js +94 -0
  339. package/lib/bootstrap/tools.js +116 -0
  340. package/lib/bundleRuntime.js +12 -11
  341. package/lib/bundleRuntimeStep.js +1 -1
  342. package/lib/claims.js +64 -7
  343. package/lib/codex-lifecycle.js +2 -1
  344. package/lib/codex.js +1 -1
  345. package/lib/components.js +2 -1
  346. package/lib/containerItems.js +5 -2
  347. package/lib/deployment.js +1 -0
  348. package/lib/devRoot.js +50 -0
  349. package/lib/devRootHooks.js +49 -0
  350. package/lib/doctor.js +59 -7
  351. package/lib/fsutil.js +14 -1
  352. package/lib/install-state.js +3 -1
  353. package/lib/install.js +28 -14
  354. package/lib/itemKinds.js +12 -1
  355. package/lib/ledger.js +5 -2
  356. package/lib/litellmHealth.js +38 -0
  357. package/lib/manifest.js +4 -0
  358. package/lib/memSafety.js +55 -22
  359. package/lib/migrate/container.js +92 -0
  360. package/lib/migrate/context.js +67 -0
  361. package/lib/migrate/crypto.js +153 -0
  362. package/lib/migrate/envStores.js +135 -0
  363. package/lib/migrate/export.js +146 -0
  364. package/lib/migrate/fsScan.js +80 -0
  365. package/lib/migrate/git.js +28 -0
  366. package/lib/migrate/import.js +397 -0
  367. package/lib/migrate/index.js +94 -0
  368. package/lib/migrate/installSet.js +100 -0
  369. package/lib/migrate/localList.js +50 -0
  370. package/lib/migrate/passphrase.js +59 -0
  371. package/lib/migrate/place.js +64 -0
  372. package/lib/migrate/plan.js +113 -0
  373. package/lib/migrate/projectMcp.js +88 -0
  374. package/lib/migrate/repoRestore.js +241 -0
  375. package/lib/migrate/repoScan.js +216 -0
  376. package/lib/migrate/safe.js +129 -0
  377. package/lib/migrate/sources.js +257 -0
  378. package/lib/osStamp.js +87 -0
  379. package/lib/ownership.js +42 -0
  380. package/lib/plist.js +49 -0
  381. package/lib/portalHealth.js +29 -13
  382. package/lib/prepack.js +25 -4
  383. package/lib/prerequisites.js +36 -7
  384. package/lib/pyDeps.js +401 -0
  385. package/lib/pyenv.js +11 -6
  386. package/lib/pyenv.lock.txt +808 -0
  387. package/lib/runner/index.js +5 -0
  388. package/lib/runner/janitorTask.js +69 -5
  389. package/lib/runner/profiles/macosShell.js +1 -37
  390. package/lib/runner/stableCli.js +1 -1
  391. package/lib/selfProfile.js +7 -2
  392. package/lib/shellProfile.js +140 -0
  393. package/lib/taskBackend/index.js +21 -0
  394. package/lib/taskBackend/launchd.js +230 -0
  395. package/lib/taskGuard.js +127 -0
  396. package/lib/taskItems.js +87 -10
  397. package/lib/uninstall.js +38 -15
  398. package/lib/update.js +75 -37
  399. package/lib/wiring.js +79 -27
  400. package/package.json +1 -1
  401. package/templates/start-litellm.sh +0 -0
package/README.md CHANGED
@@ -124,6 +124,11 @@ agents-cli install
124
124
  token (the Microsoft Store stub makes it fail), a missing `hooks/pyrun.js` launcher, an unresolvable interpreter, and a
125
125
  WindowsApps python stub ahead of a real interpreter on PATH; `--fix` rewrites the bare tokens to
126
126
  `node <target>/hooks/pyrun.js <script>` and never edits PATH or App Execution Aliases.
127
+ It also checks every installed bundle's `pythonDeps` (manifest.json): the Python floor and each required package
128
+ against the interpreter the hooks use, listing what is missing with the exact fix commands for the platform
129
+ (uv install, then `doctor --fix`, or `uv pip install --python <env>`); optional packages are only listed.
130
+ `install`, `update` and `doctor --fix` build one managed environment in `<target>/pyenv` (uv, else venv + pip) only when
131
+ that interpreter does not already satisfy them, and never install into the system Python (see `global/hooks/README.md`).
127
132
  On Windows it also warns (report only, never changes the exit code) when the shell hosting the chat, `pwsh` first on PATH,
128
133
  a visible Windows Terminal profile, or a `Claude*`/`LiteLLM*` scheduled task points at the Microsoft Store (MSIX)
129
134
  PowerShell, because a Store update force-closes running chats. Fix with `tools/pwsh_msi_cutover.ps1` in the my-agents repo.
@@ -146,7 +151,9 @@ agents-cli install
146
151
  dropped, a committed `settings.json` is reported and never edited, bare `Write`/`NotebookEdit` are left alone.
147
152
  - `agents-cli update --repair` — also restores files whose source did not change but whose deployed copy differs from the install record (update otherwise keeps those as local edits, even with `--theirs`; Codex update names them and points here). Covers the Claude and Codex targets.
148
153
  - `agents-cli release-lock <status|acquire|phase|release> [--pid N] [--phase P]` — the lock `tools/release.ps1` holds from its first gate to its end (`~/.claude/state/release.lock`: pid, start time, phase). While a live lock exists, `update` into the default `~/.claude` (no `--target-dir`/`--codex-dir`) and `ship.py`'s global sync refuse with exit 3, because the release's dogfood gate fails on any write into the real `~/.claude`. A lock whose pid is dead, or older than 6 hours, is stale and ignored. Skipped under `NODE_ENV=test` unless `AGENTS_CLI_RELEASE_LOCK_CHECK=1`.
149
- - `agents-cli sampler <status|register|unregister> [--dry-run] [--target-dir <path>]` — the hidden `ClaudeMemSampler` Windows logon task of the memory-safety stack. `install` and `update` register or start it on their own when the stack is installed (idempotent, hidden, default `~/.claude` install only, skipped under `NODE_ENV=test`; `--no-scheduled-tasks` or `AGENTS_CLI_NO_SCHEDULED_TASKS=1` skips it). `--dry-run` runs `register_mem_sampler.ps1` with `-WhatIf` and changes nothing. `doctor` adds a "Memory-safety stack" block (task, wired hooks, budget file, newest sample in `logs/mem-samples.jsonl`) and exits 1 on a missing task, an unwired hook, an invalid budget file or a stale sample. See [`docs/memory-safety.md`](../../docs/memory-safety.md).
154
+ - `agents-cli sampler <status|register|unregister> [--dry-run] [--target-dir <path>]` — the hidden `ClaudeMemSampler` task of the memory-safety stack (a Windows logon task, a per-user LaunchAgent on macOS). `install` and `update` register or start it on their own when the stack is installed (idempotent, hidden, default `~/.claude` install only, skipped under `NODE_ENV=test`; `--no-scheduled-tasks` or `AGENTS_CLI_NO_SCHEDULED_TASKS=1` skips it). `--dry-run` runs `register_mem_sampler.ps1` with `-WhatIf` and changes nothing. `doctor` adds a "Memory-safety stack" block (task, wired hooks, budget file, newest sample in `logs/mem-samples.jsonl`) and exits 1 on a missing task, an unwired hook, an invalid budget file or a stale sample. See [`docs/memory-safety.md`](../../docs/memory-safety.md).
155
+ - `agents-cli bootstrap [--check] [--json] [--skip <tool>]` — new-Mac setup, run after Homebrew and Node (the two manual commands). Installs or verifies git, uv, Python 3.12 (through uv), Docker Desktop, ffmpeg, OpenTofu, AWS CLI, Claude Code, Codex and Google Chrome, plus the optional PowerShell 7 and Expo EAS CLI, through Homebrew, npm or uv only (never a piped script), creates the dev folder (`~/dev`, or `MY_AGENTS_DEV_ROOT`) and prints the next commands. Idempotent: a second run installs nothing. A step that needs a click or an Apple ID (Xcode command line tools, Docker Desktop first launch, Android Studio, DaVinci Resolve) is listed as a manual step with one line of instruction; the command opens no window. `--check` changes nothing and lists present, missing and version per tool; on Windows and Linux the command only ever runs `--check`. `--json` prints the same table as JSON. Exit codes: 0 every required tool ready, 1 something required is missing or failed, 2 usage error. The Python packages and the Playwright browser are not bootstrap's job: `install` builds one locked managed environment (`~/.claude/pyenv`) when the Mac's Python does not satisfy the installed bundles, and installs the browser that matches its locked playwright. Runbook: [`docs/mac-setup.md`](../../docs/mac-setup.md).
156
+ - `agents-cli migrate plan | export --out <file> | import <file> [--dry-run] [--force]` — carry the secrets, personal data and unpushed repo work that a public package cannot hold to a new machine in one passphrase-encrypted archive; `plan` is read-only. Details and the file list: [`docs/mac-setup.md`](../../docs/mac-setup.md).
150
157
  - `agents-cli --help` — show usage
151
158
 
152
159
  ### The interactive menu
@@ -222,6 +229,14 @@ Every installed file's hash is recorded in `<target-dir>/agents-ledger.json`.
222
229
  Re-running `install` with unchanged source files is a no-op; changed or
223
230
  missing files are re-copied and the ledger updated.
224
231
 
232
+ Several bundles can ship the same file (for example `proxy/agents_env.py`).
233
+ Each ledger entry lists every installed bundle that wants it in `owners`
234
+ (`bundle` stays the first owner), whatever the install order. `update` and
235
+ `doctor` read the same list. A ledger written before `owners` existed is
236
+ upgraded once, on the next `install`, `update` or `uninstall`, from the
237
+ manifest's claims of the bundles it records as installed (a bundle that owns no
238
+ file and wired nothing cannot be seen that way; run `update` once to record it).
239
+
225
240
  ## Hook wiring
226
241
 
227
242
  Hook items that carry `wiring` data in `manifest.json` (event, matcher, type,
@@ -241,6 +256,16 @@ install.
241
256
  your settings.json, it's copied to `settings.json.bak-<timestamp>` — a
242
257
  marker on the ledger means this only ever happens once, not on every
243
258
  install.
259
+ - **`if` lives on the handler.** A wiring's `if` (one permission rule, for
260
+ example `Bash(git commit *)`, valid on tool events only) is written inside
261
+ the hook handler, where Claude Code reads it; on the matcher group it is
262
+ silently ignored. `update` moves an `if` that 0.17.0-0.17.2 wrote on the
263
+ group onto its handler without adding a second hook, and `manifest-lint`
264
+ rejects the group shape.
265
+ - **One shell word per path.** Hook commands run through `sh -c` (Git Bash on
266
+ Windows). Each `~/.claude` path is written as one correctly quoted word:
267
+ bare when nothing in it is shell-significant, double-quoted when it has
268
+ spaces, single-quoted when it has `$`, quotes, backslashes or backticks.
244
269
  - **Multi-registration hooks.** An item's `wiring` field can be a single
245
270
  object or an array of objects, for a hook that needs registering under more
246
271
  than one tool matcher (e.g. `html_mocker_subagent_guard.py` under both
@@ -427,6 +452,15 @@ is the `AGENTS_ENV_DIR` environment variable if set, else `~/.claude`. A real
427
452
  environment variable always wins, so exporting a secret in your shell (or CI)
428
453
  works with no `agents.env` file at all.
429
454
 
455
+ ## Same setup on Windows and macOS
456
+
457
+ One package state produces the same working setup on both systems. Four pieces are written for the host system at `install`, `update` and `doctor --fix`.
458
+
459
+ - **Shell profile commands.** On macOS and Linux, `resume` (resume-session skill) and `litellm [start|restart|status|watch]` (launch-litellm skill) are written as marker-guarded blocks (`# --- <name> (BEGIN) ---` ... `(END) ---`) into `~/.zshrc` (macOS default, or when `$SHELL` is zsh; `$ZDOTDIR` honoured) and into `~/.bash_profile` (macOS) or `~/.bashrc` (Linux) when `$SHELL` is bash. A block exists only while its skill is installed: `uninstall` removes it, `doctor` reports a missing, outdated or orphan block, and `doctor --fix` repairs it. A first change to an existing profile keeps a `.bak-<date>` copy; an unknown login shell (cron, CI) writes nothing. Not ported: the PowerShell `claude` launcher, which follows the Windows npm shim to the newest `claude.exe`; npm links `claude` straight into `PATH` on macOS and Linux, so nothing needs following. The Git `PATH` and tmux lines on the Windows PC are hand-made and not package state.
460
+ - **one-brain recall hook.** The `self-skills` bundle wires `recall_hook.py` from the separate one-brain repo on `UserPromptSubmit` and `PreCompact`. `~/dev` in a wiring command resolves to the dev root at install time (`MY_AGENTS_DEV_ROOT`, else the `dev` folder on the system drive on Windows, `~/dev` elsewhere), and the hook runs through `pyrun.js`. `wiring.requires` names a file that must exist first, so a Mac without the clone gets no hook that fails on every prompt; `doctor` says `one-brain is not cloned ... clone it, then run agents-cli update`, and `update` wires the hook once the clone is there. An existing hand-made entry with the same command (or the same script through a bare `python`) is adopted in place, never duplicated. `doctor` fails when a wired hook's script has disappeared.
461
+ - **Operating-system wording in `CLAUDE.md`.** Rules that name a Windows tool carry a macOS variant in `<!--os:name-->windows text<!--os:darwin-->macOS text<!--/os:name-->` fragments inside `global/CLAUDE.md`. Items with `"osStamp": true` are rendered for the host before they are hashed and copied: Windows receives today's text byte for byte, macOS and Linux receive the zsh, `kill -9`/`launchctl` and no-popup wording. The CLI test `osStamp.test.js` fails when a fragment lacks either variant, when one variant names the other system's tools, or when Windows-only or macOS-only wording sits outside a fragment.
462
+ - **One secret store.** Every packaged consumer of `LITELLM_MASTER_KEY` and `GEMINI_API_KEY` (council fan-outs and visual diagnosis, web search and its guard hook, visual check, the vision helper, the LiteLLM smoke test, the retired router, the scribe runner, visual-gen and graphic-novel image generation) reads it through `proxy/agents_env.py`, so a value that exists only in `~/.claude/agents.env` works. `migrate export` folds the user environment and `settings.json` env secrets into `agents.env`, drops the retired OpenRouter API key (either spelling) and says so in the plan, and `migrate import` never writes a secret-named key into `settings.json`.
463
+
430
464
  ## Bundle runtime: containers, scheduled tasks, settings, file secrets
431
465
 
432
466
  A bundle can run something after install, not only copy files. All four pieces
@@ -435,7 +469,7 @@ are declared in `manifest.json` and work for any bundle:
435
469
  | Declaration | What `install` / `update` does | Uninstall | `doctor` |
436
470
  |---|---|---|---|
437
471
  | `kind: "container"` item, wiring `{project, containers[], envFile?, healthTimeoutS?}` | `docker compose -p <project> -f <deployed compose file> up -d --build`, then waits for the named containers to be running and healthy. The compose file must set `restart: unless-stopped` (or `always`) so Docker brings it back after a reboot. | `docker compose down` first, named volumes kept | docker engine, Docker Desktop start-at-sign-in, per container state, health and restart policy |
438
- | `kind: "task"` item, wiring `{name, exe, args[], workingDirectory?, description?, logonDelay?, repeat?, keepRunning?}` | Registers a hidden Windows logon task (no elevation, `conhost --headless`, never a window) through `lib/hiddenTask/register_hidden_task.ps1`. A task with `repeat` gets a logon trigger plus a time trigger that starts at registration, so the repeat runs at once and not only after the next sign-in; `doctor` flags a task without the time trigger and `install`/`update` re-register it. Idempotent; windows and the default `~/.claude` install only. | task removed | task exists, enabled, same command line, running when `keepRunning` |
472
+ | `kind: "task"` item, wiring `{name, exe, args[], workingDirectory?, description?, logonDelay?, repeat?, keepRunning?}` | Registers a hidden logon task. Windows: no elevation, `conhost --headless`, never a window, through `lib/hiddenTask/register_hidden_task.ps1`. macOS: a per-user LaunchAgent `com.agents.task.<name>` (`~/Library/LaunchAgents`, run at login, `repeat` becomes `StartInterval`, `keepRunning` becomes `KeepAlive`, output in `~/.claude/logs/<name>.out.log` and `.err.log`, no Terminal, no Dock icon; `pythonw` and `python` run the interpreter the hooks resolve), through `lib/taskBackend/launchd.js`; `logonDelay` has no launchd form. A task with `repeat` gets a logon trigger plus a time trigger that starts at registration, so the repeat runs at once and not only after the next sign-in; `doctor` flags a task without the time trigger and `install`/`update` re-register it. Idempotent; Windows, macOS and the default `~/.claude` install only; Linux skips tasks. | task removed | task exists, enabled, same command line, running when `keepRunning` |
439
473
  | bundle `settings: {example, target}` | The shipped example file (`KEY=default`, the comment above a key is its prompt, `(optional)` in it marks the key optional) is copied to `<target-dir>/<target>` once, each value is prompted in a terminal (Enter keeps), new example keys are appended on later runs, values you set are never overwritten. `--no-secrets` skips the prompts. | file kept | file exists, required keys have a value |
440
474
  | secret `type: "file"` (plus `fileName`, `required`) | You give a path; a copy is stored owner-only in `<target-dir>/secret-files/` and its path is recorded under the secret name in `agents.env`. Non-interactive: pipe the path into `agents-cli secrets --set <NAME>`. | `secrets --remove <NAME>` also deletes the stored copy | listed in `secrets --list` and doctor, file existence checked |
441
475
 
@@ -478,6 +512,8 @@ If Docker is missing, stopped or not set to start at sign-in, the install and
478
512
  `doctor` say so in plain words (with the Docker Desktop download link or the
479
513
  setting to tick) instead of failing with a Docker error.
480
514
 
515
+ **Where tasks may be registered.** Background tasks (Windows scheduled tasks, macOS LaunchAgents: the memory sampler, a bundle's `task` items, the CI janitor) are machine-wide, so install and update register them only when the target is the signed-in account's own `~/.claude`, resolved from the operating system account and not from `HOME` or `USERPROFILE`. Any other target, or a run whose home is redirected by an environment variable, registers nothing and prints one line. A task that already runs from another install still on disk is reported (task name, current install, requested install) and left alone; `--takeover-tasks` re-points it. `doctor` flags a task whose action names a path that no longer exists.
516
+
481
517
  ## Updating
482
518
 
483
519
  ```bash
@@ -559,6 +595,9 @@ Removes everything `install` put down for that bundle:
559
595
  edited since install is **left in place** with a warning — uninstall never
560
596
  discards your changes — but its ledger entry is still dropped, since the
561
597
  bundle is no longer tracked.
598
+ - A file another installed bundle also owns stays on disk and in the ledger;
599
+ the bundle you remove is dropped from its `owners`, and the output lists
600
+ these as kept shared files. The last owner to go deletes the file.
562
601
  - Exactly the settings.json hook entries this bundle wired (tracked
563
602
  per-bundle on the ledger) are removed — nothing belonging to any other
564
603
  bundle is touched. Now-empty hook blocks/events are pruned.
package/bin/cli.js CHANGED
@@ -46,10 +46,14 @@ const pyrun = require('../lib/pyrun');
46
46
  const { checkModVersions } = require('../lib/claudeVersion');
47
47
  const memSafety = require('../lib/memSafety');
48
48
  const portalHealth = require('../lib/portalHealth');
49
+ const litellmHealth = require('../lib/litellmHealth');
50
+ const pyDeps = require('../lib/pyDeps');
49
51
  const pwshStore = require('../lib/pwshStore');
50
52
  const { staleCheckoutGate } = require('../lib/staleCheckout');
51
53
  const releaseLock = require('../lib/releaseLock');
52
54
  const claudeProfile = require('../lib/claudeProfile');
55
+ const shellProfile = require('../lib/shellProfile');
56
+ const devRootHooks = require('../lib/devRootHooks');
53
57
  const { promptBundleSettingsStep, activateBundlesStep } = require('../lib/bundleRuntimeStep');
54
58
  const secretFiles = require('../lib/secretFiles');
55
59
  const { declaredSecrets } = require('../lib/secretsSet');
@@ -95,8 +99,15 @@ Usage:
95
99
  agents-cli secrets --list Show which secrets are set/missing (names only — never values)
96
100
  agents-cli doctor [--fix] [--scan-root <dir>] Report orphaned/missing/drifted files under the install target
97
101
  and project hooks that would brick a session if their file went missing
98
- agents-cli sampler <status|register|unregister> [--dry-run] [--target-dir <path>]
99
- The hidden ClaudeMemSampler task of the memory-safety stack (Windows).
102
+ agents-cli migrate plan | export --out <file> | import <file> [--dry-run] [--force]
103
+ Carry secrets, personal data and unpushed repo work to a new machine in one
104
+ encrypted archive (plan is read-only; the passphrase is prompted)
105
+ agents-cli bootstrap [--check] [--json] [--skip <tool>]
106
+ New Mac: install or verify git, uv, Python 3.12, Docker Desktop, ffmpeg, OpenTofu, AWS CLI,
107
+ Claude Code, Codex and Chrome through Homebrew, create ~/dev and print the
108
+ next commands (--check changes nothing; on Windows and Linux it only reports)
109
+ agents-cli sampler <status|register|unregister> [--dry-run] [--takeover-tasks] [--target-dir <path>]
110
+ The hidden ClaudeMemSampler task of the memory-safety stack (Windows task, macOS LaunchAgent).
100
111
  install/update register it on their own for the default ~/.claude install;
101
112
  --dry-run runs the registration script with -WhatIf and changes nothing
102
113
  agents-cli release-lock <status|acquire|phase|release> [--pid N] [--phase P]
@@ -113,6 +124,8 @@ Flags for install:
113
124
  --bundle <key> Bundle to install non-interactively — run "install" with no flags to list keys
114
125
  --yes Required with --bundle: confirms the non-interactive install
115
126
  --no-scheduled-tasks Skip registering the hidden ClaudeMemSampler task (also on update)
127
+ --takeover-tasks Re-point a background task that already runs from another install still on disk
128
+ (without it install and update report the conflict and leave the task alone)
116
129
  --advanced Interactive menu: show every bundle (incl. advanced) and pick items within one
117
130
  --profile <public|self> Which bundles the menu/listing offers (default: public). "self" adds this
118
131
  repo's maintainer-only bundles (self-infra, self-skills, ...) on top of the
@@ -165,7 +178,10 @@ diff and a keep/overwrite/backup prompt per file, otherwise pass --theirs or
165
178
  --keep-mine (plain --yes does not resolve conflicts on its own; with neither
166
179
  a strategy nor a TTY, conflicts are listed and the command exits 2, leaving
167
180
  those files untouched). A file the manifest no longer ships is removed if
168
- untouched, or kept-but-untracked with a warning if you'd edited it. Hook and
181
+ untouched, or kept-but-untracked with a warning if you'd edited it. A file an
182
+ installed bundle ships that is already on disk without a ledger entry is adopted
183
+ (recorded, bytes left as they are) when it matches the source ignoring line endings;
184
+ if it differs it is a conflict like any other. Hook and
169
185
  MCP wiring are refreshed to match the current manifest on every update.
170
186
 
171
187
  Secrets are prompted per bundle at install time (masked input, every prompt
@@ -205,8 +221,8 @@ Flags for runner:
205
221
  Exit codes: 0 ok, 1 a step failed, 2 usage error.
206
222
 
207
223
  Memory-safety stack: the agent-orchestration bundle carries the chat ledger, the idle-process reclaimer, the
208
- reaper_kill recorder, the heavy gate runner and the sampler. On Windows, install/update register the hidden
209
- ClaudeMemSampler logon task (idempotent, never a visible window, only for the default ~/.claude install, never
224
+ reaper_kill recorder, the heavy gate runner and the sampler. On Windows and macOS, install/update register the hidden
225
+ ClaudeMemSampler logon task (a per-user LaunchAgent on macOS) (idempotent, never a visible window, only for the default ~/.claude install, never
210
226
  under NODE_ENV=test). doctor reports the task, the wired hooks, the budget file and the newest memory sample.
211
227
 
212
228
  Flags for doctor:
@@ -247,6 +263,8 @@ by a renamed/retired item), missing (a ledger-tracked file no longer on disk), a
247
263
  drifted (a ledger-tracked file whose on-disk hash no longer matches what was installed).
248
264
  It never scans anywhere the manifest doesn't declare a file/directory item into, so the
249
265
  rest of <target> (Claude Code's own state, caches, logs, your own files) is left alone.
266
+ A folder Claude Code itself writes (skills/synced, the claude.ai skills sync) is named
267
+ as managed by Claude Code, not listed as an orphan.
250
268
  It also compares the local "claude --version" with each installed mod's minClaudeCodeVersion:
251
269
  a too-old Claude Code is a finding (exit 1); a missing claude binary only warns.
252
270
  Exit code is 0 when clean, 1 otherwise — safe to use as a CI/scripted gate. It never
@@ -425,6 +443,9 @@ function installOneBundle({ bundleKey, bundleTitle, targetDir, targetConfig, ite
425
443
  if (result.hooksWired.length > 0) {
426
444
  console.log(` ${mark('ok')} wired ${result.hooksWired.length} hook(s) into ${result.targetBase}/settings.json`);
427
445
  }
446
+ for (const s of result.hooksSkipped || []) {
447
+ console.log(` ${mark('skip')} ${s.event} hook not wired: ${s.requires} is not on this machine yet; clone that repo, then run \`agents-cli update\``);
448
+ }
428
449
  printKeybindingReport(result);
429
450
  printModelsReport(result.models);
430
451
  if (result.settingsBackupFile) {
@@ -468,6 +489,7 @@ function installOneBundle({ bundleKey, bundleTitle, targetDir, targetConfig, ite
468
489
  // missing-uv/failed are surfaced once more at the very end (see
469
490
  // printPythonSyncIssues), not just here among the per-bundle bullets.
470
491
  }
492
+ for (const line of pyDeps.describeSync(result.pythonDeps).ok) console.log(` ${mark('ok')} ${line}`);
471
493
  return result;
472
494
  }
473
495
 
@@ -544,11 +566,13 @@ function printModVersionWarnings(bundleKeys, targetBase) {
544
566
  */
545
567
  function printPythonSyncIssues(results) {
546
568
  const issues = results.flatMap((r) => (r.pythonSync || []).filter((p) => p.status !== 'synced'));
547
- if (issues.length === 0) return;
569
+ const depProblems = [...new Set(results.flatMap((r) => pyDeps.describeSync(r.pythonDeps).problems))];
570
+ if (issues.length === 0 && depProblems.length === 0) return;
548
571
  console.log(`\n${ansi.bold('Python environments needing attention')}`);
549
572
  for (const p of issues) {
550
573
  console.log(` ${mark('fail')} "${p.item}": ${p.message}`);
551
574
  }
575
+ for (const line of depProblems) console.log(` ${mark('fail')} ${line}`);
552
576
  }
553
577
 
554
578
 
@@ -854,10 +878,11 @@ async function runUninstall(argv) {
854
878
  `${result.filesKeptUserEdited.join(', ')}`
855
879
  );
856
880
  }
881
+ printShellProfileReport(shellProfileStep(result.targetBase, true), { fixRequested: true });
857
882
  if (result.filesKeptShared.length > 0) {
858
883
  console.log(
859
884
  ` Kept ${result.filesKeptShared.length} shared file(s) still claimed by other installed bundles: ` +
860
- `${result.filesKeptShared.map((f) => `${f.file} (now owned by ${f.owner})`).join(', ')}`
885
+ `${result.filesKeptShared.map((f) => `${f.file} (still owned by ${f.owner})`).join(', ')}`
861
886
  );
862
887
  }
863
888
  if (result.mcpKeptUserEdited.length > 0) {
@@ -1161,6 +1186,7 @@ function summarizeBundleUpdate(b) {
1161
1186
  return `Bundle "${b.bundle}": already up to date (${b.upToDate.length} file(s) unchanged).`;
1162
1187
  }
1163
1188
  const parts = [];
1189
+ if (b.adopted.length) parts.push(`${b.adopted.length} adopted into the ledger (on disk already; bytes left as they are${b.adoptedLineEndingsOnly.length ? `, ${b.adoptedLineEndingsOnly.length} differ from the source only by line endings` : ''})`);
1164
1190
  if (b.overwritten.length) parts.push(`${b.overwritten.length} overwritten`);
1165
1191
  if (b.reinstalled.length) parts.push(`${b.reinstalled.length} reinstalled`);
1166
1192
  if (b.kept.length) parts.push(`${b.kept.length} kept (locally edited, no upstream change; update --repair restores the source copy)`);
@@ -1171,6 +1197,7 @@ function summarizeBundleUpdate(b) {
1171
1197
  if (b.conflictsResolved.length) parts.push(`${b.conflictsResolved.length} conflict(s) resolved`);
1172
1198
  if (b.unresolvedConflicts.length) parts.push(`${b.unresolvedConflicts.length} conflict(s) unresolved`);
1173
1199
  if (b.hooksWired.length) parts.push(`${b.hooksWired.length} hook(s) rewired`);
1200
+ if ((b.hooksSkipped || []).length) parts.push(`${b.hooksSkipped.length} hook(s) waiting for a repo clone (${[...new Set(b.hooksSkipped.map((s) => s.requires))].join(', ')})`);
1174
1201
  if (b.mcpWired.length) parts.push(`${b.mcpWired.length} MCP server(s) rewired`);
1175
1202
  if ((b.keybindingsWired || []).length) parts.push(`${b.keybindingsWired.length} keybinding(s) bound`);
1176
1203
  if ((b.keybindingsKept || []).length) parts.push(`${b.keybindingsKept.length} keybinding(s) kept (yours differ)`);
@@ -1182,6 +1209,7 @@ function summarizeComponentUpdate(c) {
1182
1209
  return `Component "${c.component}": already up to date (${c.upToDate.length} file(s) unchanged).`;
1183
1210
  }
1184
1211
  const parts = [];
1212
+ if (c.adopted.length) parts.push(`${c.adopted.length} adopted into the ledger (on disk already; bytes left as they are${c.adoptedLineEndingsOnly.length ? `, ${c.adoptedLineEndingsOnly.length} differ from the source only by line endings` : ''})`);
1185
1213
  if (c.overwritten.length) parts.push(`${c.overwritten.length} overwritten`);
1186
1214
  if (c.reinstalled.length) parts.push(`${c.reinstalled.length} reinstalled`);
1187
1215
  if (c.kept.length) parts.push(`${c.kept.length} kept (locally edited, no upstream change)`);
@@ -1273,13 +1301,14 @@ async function runUpdate(argv) {
1273
1301
 
1274
1302
  if (!['skipped', 'blocked'].includes(result.memSampler.action)) console.log(`Memory sampler: ${result.memSampler.message}`);
1275
1303
  printModelsReport(result.models);
1276
- printPythonSyncIssues(result.bundles);
1304
+ for (const line of pyDeps.describeSync(result.pythonDeps).ok) console.log(` ${mark('ok')} ${line}`);
1305
+ printPythonSyncIssues([...result.bundles, { pythonDeps: result.pythonDeps }]);
1277
1306
  printModVersionWarnings(result.bundles.map((b) => b.bundle), result.targetBase);
1278
1307
 
1279
1308
  if (result.exitCode !== 0) {
1280
1309
  console.error(
1281
1310
  `\n${result.unresolvedConflicts.length} file(s) have unresolved conflicts (edited locally AND changed ` +
1282
- 'upstream) — nothing was changed for them. Re-run with --theirs (take the new version) or --keep-mine ' +
1311
+ 'upstream, or on disk without an install record and different from the new source) — nothing was changed for them. Re-run with --theirs (take the new version) or --keep-mine ' +
1283
1312
  '(keep your version) to resolve non-interactively, or run this in a terminal to be prompted per file.'
1284
1313
  );
1285
1314
  }
@@ -1384,6 +1413,11 @@ function parseDoctorArgs(argv) {
1384
1413
  return args;
1385
1414
  }
1386
1415
 
1416
+ function ownerLabel(finding) {
1417
+ const owners = finding.owners && finding.owners.length > 0 ? finding.owners : [finding.bundle];
1418
+ return `${owners.length > 1 ? 'bundles' : 'bundle'}: ${owners.join(', ')}`;
1419
+ }
1420
+
1387
1421
  function describeOrphan(o) {
1388
1422
  return o.type === 'dir' ? `${o.relTarget}/ (directory)` : o.relTarget;
1389
1423
  }
@@ -1427,6 +1461,20 @@ function claudeProfileStep(targetBase, fix) {
1427
1461
  return claudeProfile.checkClaudeProfile({ home: path.dirname(targetBase), fix });
1428
1462
  }
1429
1463
 
1464
+ function printShellProfileReport(report, { fixRequested }) {
1465
+ for (const f of report.fixed) console.log(`
1466
+ Updated the zsh/bash profile ${f.file}${f.backup ? ` (backup: ${f.backup})` : ''}; open a new terminal tab or run \`source ${f.file}\` to load it.`);
1467
+ if (report.findings.length === 0 || report.fixed.length > 0) return;
1468
+ console.log(`
1469
+ Shell profile commands (${report.findings.length} finding(s)):`);
1470
+ for (const f of report.findings) console.log(` ${shellProfile.describeShellFinding(f)}`);
1471
+ if (!fixRequested) console.log(` Fix: ${shellProfile.FIX_COMMAND}`);
1472
+ }
1473
+
1474
+ function shellProfileStep(targetBase, fix) {
1475
+ return shellProfile.checkShellProfile({ targetBase, home: path.dirname(targetBase), fix });
1476
+ }
1477
+
1430
1478
  function printPythonLaunchReport(py) {
1431
1479
  if (py.fixed.length > 0) {
1432
1480
  console.log(`\nRewrote ${py.fixed.length} bare python hook command(s) to the pyrun launcher:`);
@@ -1511,6 +1559,7 @@ async function withProjectHookStep(argv, run, { healBypass = false } = {}) {
1511
1559
  printProjectHookReport(step, { fixRequested: opts.fix });
1512
1560
  const targetBase = opts.targetDir || defaultTargetBase();
1513
1561
  printClaudeProfileReport(claudeProfileStep(targetBase, healBypass || opts.fix), { fixRequested: opts.fix });
1562
+ printShellProfileReport(shellProfileStep(targetBase, healBypass || opts.fix), { fixRequested: opts.fix });
1514
1563
  printBypassOnlyReport(bypassOnly.checkBypassOnly({ targetBase, fix: healBypass || opts.fix }));
1515
1564
  printModeDriftReport(
1516
1565
  modeDrift.checkModeDrift({
@@ -1544,6 +1593,24 @@ function fixBundleRuntimes(result, { json }) {
1544
1593
  return broken;
1545
1594
  }
1546
1595
 
1596
+ /** Prints what a Python dependency sync did: the quiet outcomes print nothing. */
1597
+ function printPythonDepsSync(res, { json } = {}) {
1598
+ if (json) return;
1599
+ const { ok, problems } = pyDeps.describeSync(res);
1600
+ for (const line of ok) console.log(` ${mark('ok')} ${line}`);
1601
+ for (const line of problems) console.log(` ${mark('fail')} ${line}`);
1602
+ }
1603
+
1604
+ /** doctor --fix: builds or repairs the managed Python environment when a bundle's declared dependencies are not satisfied. */
1605
+ function fixPythonDeps(result, { json }) {
1606
+ if (!result.pythonDeps || result.pythonDeps.healthy) return null;
1607
+ const { manifest } = loadManifest(PACKAGE_ROOT);
1608
+ const ledger = loadLedger(result.targetBase);
1609
+ const res = pyDeps.syncPythonDeps({ manifest, bundleKeys: bundleKeysInLedger(ledger), targetBase: result.targetBase });
1610
+ printPythonDepsSync(res, { json });
1611
+ return res;
1612
+ }
1613
+
1547
1614
  function runDoctor(argv) {
1548
1615
  let args;
1549
1616
  try {
@@ -1558,10 +1625,13 @@ function runDoctor(argv) {
1558
1625
  packageRoot: PACKAGE_ROOT,
1559
1626
  targetBase: args.targetDir,
1560
1627
  });
1628
+ const fixedPython = args.fix ? fixPythonDeps(result, { json: args.json }) : null;
1629
+ if (fixedPython) result = checkHealth({ packageRoot: PACKAGE_ROOT, targetBase: args.targetDir });
1561
1630
  const fixedRuntimes = args.fix ? fixBundleRuntimes(result, { json: args.json }) : [];
1562
- if (fixedRuntimes.length > 0) {
1631
+ if (fixedRuntimes.length > 0 || fixedPython) {
1563
1632
  result = checkHealth({ packageRoot: PACKAGE_ROOT, targetBase: args.targetDir });
1564
- result.runtimeFixed = fixedRuntimes;
1633
+ if (fixedRuntimes.length > 0) result.runtimeFixed = fixedRuntimes;
1634
+ if (fixedPython) result.pythonDepsFixed = fixedPython;
1565
1635
  }
1566
1636
 
1567
1637
  const scope = {
@@ -1591,14 +1661,18 @@ function runDoctor(argv) {
1591
1661
  return 1;
1592
1662
  }
1593
1663
  const profileStep = claudeProfileStep(scope.targetBase, args.fix);
1664
+ const shellStep = shellProfileStep(scope.targetBase, args.fix);
1665
+ const devHooks = devRootHooks.checkDevRootHooks({ manifest, targetBase: scope.targetBase, cliVersion: pkg.version });
1594
1666
  const { fixed } = hooks;
1595
1667
  result.claudeProfile = profileStep;
1668
+ result.shellProfile = shellStep;
1669
+ result.devRootHooks = devHooks.findings;
1596
1670
  result.projectHooks = { repos: hooks.repos, findings: hooks.findings, fixed };
1597
1671
  result.modeDrift = { globalMode: modes.globalMode, findings: modes.findings, fixed: modes.fixed };
1598
1672
  result.bypassOnly = { file: bypass.file, findings: bypass.findings, fixed: bypass.fixed, error: bypass.error };
1599
1673
  result.permissionRules = { findings: rules.findings, fixed: rules.fixed };
1600
1674
  result.pythonLaunch = { files: py.files, findings: py.findings, fixed: py.fixed, missingLaunchers: py.missingLaunchers, interpreter: py.interpreter, stubs: py.stubs };
1601
- result.healthy = result.healthy && hooks.findings.length === 0 && bypass.findings.length === 0 && !bypass.error && modes.findings.length === 0 && rules.findings.length === 0 && py.healthy && (profileStep.findings.length === 0 || profileStep.fixed.length > 0);
1675
+ result.healthy = result.healthy && hooks.findings.length === 0 && bypass.findings.length === 0 && !bypass.error && modes.findings.length === 0 && rules.findings.length === 0 && py.healthy && (profileStep.findings.length === 0 || profileStep.fixed.length > 0) && (shellStep.findings.length === 0 || shellStep.fixed.length > 0) && devHooks.broken.length === 0;
1602
1676
 
1603
1677
  if (args.json) {
1604
1678
  console.log(JSON.stringify(result, null, 2));
@@ -1608,6 +1682,12 @@ function runDoctor(argv) {
1608
1682
  const printProjectHooks = () => printProjectHookReport(hooks, { fixRequested: args.fix });
1609
1683
  const printModeDrift = () => {
1610
1684
  printClaudeProfileReport(profileStep, { fixRequested: args.fix });
1685
+ printShellProfileReport(shellStep, { fixRequested: args.fix });
1686
+ if (devHooks.findings.length > 0) {
1687
+ console.log(`
1688
+ Hooks that run a script from another repo (${devHooks.findings.length} finding(s)):`);
1689
+ for (const f of devHooks.findings) console.log(` ${devRootHooks.describeDevRootHook(f)}`);
1690
+ }
1611
1691
  printBypassOnlyReport(bypass);
1612
1692
  printModeDriftReport(modes);
1613
1693
  printRuleMigrationReport(rules);
@@ -1653,6 +1733,14 @@ function runDoctor(argv) {
1653
1733
  for (const f of p.findings) console.log(` ${mark('fail')} ${f}`);
1654
1734
  };
1655
1735
 
1736
+ const printLiteLLM = () => {
1737
+ const l = result.litellm;
1738
+ if (!l) return;
1739
+ console.log('\nLiteLLM (Docker):');
1740
+ for (const line of litellmHealth.describeLiteLLM(l)) console.log(` ${line}`);
1741
+ for (const f of l.findings) console.log(` ${mark('fail')} ${f}`);
1742
+ };
1743
+
1656
1744
  const printPwshStore = () => {
1657
1745
  const p = result.pwshStore;
1658
1746
  if (!p) return;
@@ -1668,7 +1756,7 @@ function runDoctor(argv) {
1668
1756
  for (const sec of b.secrets) console.log(` secret ${sec.name} (${sec.type}${sec.required ? ', required' : ''}): ${sec.status}`);
1669
1757
  if (b.settings) console.log(` settings ${b.settings.file}: ${b.settings.status}${b.settings.missing.length ? ` (missing ${b.settings.missing.join(', ')})` : ''}`);
1670
1758
  for (const c of b.containers) {
1671
- console.log(` container project ${c.project}: docker ${c.docker.state}, start at sign-in ${c.autostart.status}`);
1759
+ console.log(` container project ${c.project}: docker ${c.docker.state}, start at sign-in ${c.autostart.status}${c.autostart.status === 'n/a' ? ` (${c.autostart.detail})` : ''}`);
1672
1760
  for (const k of c.containers) console.log(` ${k.name}: ${k.state}${k.health ? `/${k.health}` : ''}, restart ${k.restart || 'no'}`);
1673
1761
  }
1674
1762
  for (const t of b.tasks) console.log(` task ${t.name}: ${t.state}${t.reason ? ` (${t.reason})` : ''}${t.matches === false ? ' (differs from the manifest)' : ''}`);
@@ -1677,6 +1765,18 @@ function runDoctor(argv) {
1677
1765
  }
1678
1766
  };
1679
1767
 
1768
+ const printPythonDeps = () => {
1769
+ const lines = pyDeps.describeCheck(result.pythonDeps);
1770
+ if (lines.length === 0) return;
1771
+ console.log('\nPython dependencies (declared per bundle in manifest.json pythonDeps):');
1772
+ for (const line of lines) console.log(` ${line}`);
1773
+ };
1774
+
1775
+ const printClaudeManaged = () => {
1776
+ for (const m of result.claudeManaged || []) console.log(`
1777
+ Managed by Claude Code, not an orphan: ${m.relTarget}/ (${m.note}).`);
1778
+ };
1779
+
1680
1780
  const printRoutingMod = () => {
1681
1781
  if (!result.routingMod) return;
1682
1782
  console.log('\nModel routing:');
@@ -1687,14 +1787,17 @@ function runDoctor(argv) {
1687
1787
  if (result.healthy) {
1688
1788
  printPythonLaunchReport(py);
1689
1789
  console.log(`${result.targetBase}: healthy — no orphans, no missing files, no drift.`);
1790
+ printClaudeManaged();
1690
1791
  printModVersions();
1691
1792
  printModValidation();
1692
1793
  printMemoryIndex();
1693
1794
  printRoutingMod();
1694
1795
  printMemorySafety();
1695
1796
  printPortal();
1797
+ printLiteLLM();
1696
1798
  printPwshStore();
1697
1799
  printBundleRuntimes();
1800
+ printPythonDeps();
1698
1801
  printModeDrift();
1699
1802
  return 0;
1700
1803
  }
@@ -1706,20 +1809,23 @@ function runDoctor(argv) {
1706
1809
  }
1707
1810
  if (result.missing.length > 0) {
1708
1811
  console.log(`\nMissing (ledger-tracked, not on disk, ${result.missing.length}):`);
1709
- for (const m of result.missing) console.log(` ${m.relTarget} (bundle: ${m.bundle})`);
1812
+ for (const m of result.missing) console.log(` ${m.relTarget} (${ownerLabel(m)}${m.untracked ? '; shipped by an installed bundle, not tracked - run update' : ''})`);
1710
1813
  }
1711
1814
  if (result.drifted.length > 0) {
1712
1815
  console.log(`\nDrifted (on-disk hash no longer matches the ledger, ${result.drifted.length}):`);
1713
- for (const d of result.drifted) console.log(` ${d.relTarget} (bundle: ${d.bundle})`);
1816
+ for (const d of result.drifted) console.log(` ${d.relTarget} (${ownerLabel(d)})`);
1714
1817
  }
1818
+ printClaudeManaged();
1715
1819
  printModVersions();
1716
1820
  printModValidation();
1717
1821
  printMemoryIndex();
1718
1822
  printRoutingMod();
1719
1823
  printMemorySafety();
1720
1824
  printPortal();
1825
+ printLiteLLM();
1721
1826
  printPwshStore();
1722
1827
  printBundleRuntimes();
1828
+ printPythonDeps();
1723
1829
  printProjectHooks();
1724
1830
  printPythonLaunchReport(py);
1725
1831
  printModeDrift();
@@ -1761,15 +1867,19 @@ function runSampler(argv) {
1761
1867
  return report.healthy ? 0 : 1;
1762
1868
  }
1763
1869
  if (sub === 'register' || sub === 'unregister') {
1764
- const result = sub === 'register' ? memSafety.ensureSampler({ targetBase, dryRun, force: !!targetDir }) : memSafety.unregisterSampler({ targetBase, dryRun });
1870
+ const result = sub === 'register' ? memSafety.ensureSampler({ targetBase, dryRun }) : memSafety.unregisterSampler({ targetBase, dryRun });
1765
1871
  console.log(result.message);
1766
1872
  return result.action === 'failed' ? 1 : 0;
1767
1873
  }
1768
- console.error('Usage: agents-cli sampler <status|register|unregister> [--dry-run] [--target-dir <path>]');
1874
+ console.error('Usage: agents-cli sampler <status|register|unregister> [--dry-run] [--takeover-tasks] [--target-dir <path>]');
1769
1875
  return 1;
1770
1876
  }
1771
1877
 
1772
1878
  async function main(argv, { captureSelection = false } = {}) {
1879
+ if (argv.includes('--takeover-tasks')) {
1880
+ process.env.AGENTS_CLI_TAKEOVER_TASKS = '1';
1881
+ argv = argv.filter((a) => a !== '--takeover-tasks');
1882
+ }
1773
1883
  const [command, ...rest] = argv;
1774
1884
  if (command === 'update' && !rest.includes('--target-dir') && !rest.includes('--codex-dir')) {
1775
1885
  const refused = releaseLock.releaseLockGate({ action: 'update' });
@@ -1834,6 +1944,14 @@ async function main(argv, { captureSelection = false } = {}) {
1834
1944
  return require('../lib/runner').runRunnerCommand(rest);
1835
1945
  }
1836
1946
 
1947
+ if (command === 'bootstrap') {
1948
+ return require('../lib/bootstrap').runBootstrap(rest);
1949
+ }
1950
+
1951
+ if (command === 'migrate') {
1952
+ return require('../lib/migrate').runMigrate(rest, { packageRoot: PACKAGE_ROOT });
1953
+ }
1954
+
1837
1955
  console.error(`Unknown command: ${command}`);
1838
1956
  printHelp();
1839
1957
  return 1;
@@ -2,7 +2,7 @@
2
2
  """
3
3
  council_fanout.py — Parallel fan-out to Gemini, DeepSeek, Qwen, and GLM via local LiteLLM proxy.
4
4
  Usage: python3 council_fanout.py "raw user goal" ["project context (facts only, no opinions)"]
5
- Reads: LITELLM_MASTER_KEY from env.
5
+ Reads: LITELLM_MASTER_KEY from the environment or ~/.claude/agents.env.
6
6
  Prints: labeled panel results to stdout.
7
7
 
8
8
  Panels receive the raw goal and neutral context — never Claude's reframing.
@@ -29,7 +29,7 @@ except Exception:
29
29
  # Shared preflight + failure-policy (fail-fast down-proxy detection, unmistakable
30
30
  # panel-failure rendering, and the exit code contract) — see agents/lib/council_common.py.
31
31
  sys.path.insert(0, str(_pathlib.Path(__file__).resolve().parents[1] / "lib"))
32
- from council_common import PanelResult, preflight_proxy, render_and_exit # noqa: E402
32
+ from council_common import PanelResult, litellm_master_key, preflight_proxy, render_and_exit # noqa: E402
33
33
 
34
34
 
35
35
  def _log_panel_call(model, duration, usage, error=None):
@@ -197,7 +197,7 @@ def main():
197
197
  context = sys.argv[2] if len(sys.argv) > 2 else ""
198
198
  prompt = build_prompt(goal, context)
199
199
 
200
- or_key = os.environ.get("LITELLM_MASTER_KEY", "")
200
+ or_key = litellm_master_key()
201
201
  if not or_key:
202
202
  render_and_exit([], key_missing=True,
203
203
  usage_msg="Usage: council_fanout.py 'raw goal' ['context']")
@@ -62,6 +62,13 @@ def _feed_call(caller, model, status, duration, error=None):
62
62
 
63
63
  PROXY_URL = "http://127.0.0.1:4000/chat/completions"
64
64
 
65
+
66
+ def litellm_master_key() -> str:
67
+ """LITELLM_MASTER_KEY through the shared secret helper (process env, ~/.claude/agents.env, then the cwd .env); '' when unset."""
68
+ sys.path.insert(0, str(_pathlib.Path(__file__).resolve().parents[2] / "proxy"))
69
+ from agents_env import get_secret
70
+ return get_secret("LITELLM_MASTER_KEY", default="", project_root=_pathlib.Path.cwd()) or ""
71
+
65
72
  LAUNCH_HINT = (
66
73
  "LiteLLM proxy is unreachable at 127.0.0.1:4000. Run the global "
67
74
  "'launch-litellm' skill to bring it up in a visible window, then retry."
@@ -207,3 +207,13 @@ def test_preflight_proxy_missing_call_log_never_raises(monkeypatch):
207
207
  monkeypatch.setattr(cc.urllib.request, "urlopen", lambda *a, **k: (_ for _ in ()).throw(
208
208
  urllib.error.URLError("down")))
209
209
  assert cc.preflight_proxy("fake-key", timeout=1) is not None # still works
210
+
211
+
212
+ def test_litellm_master_key_reads_agents_env_when_the_environment_has_none(tmp_path, monkeypatch):
213
+ monkeypatch.delenv("LITELLM_MASTER_KEY", raising=False)
214
+ monkeypatch.setenv("AGENTS_ENV_DIR", str(tmp_path))
215
+ assert cc.litellm_master_key() == ""
216
+ (tmp_path / "agents.env").write_text("LITELLM_MASTER_KEY=from-agents-env\n", encoding="utf-8")
217
+ assert cc.litellm_master_key() == "from-agents-env"
218
+ monkeypatch.setenv("LITELLM_MASTER_KEY", "from-process-env")
219
+ assert cc.litellm_master_key() == "from-process-env"
@@ -2,7 +2,7 @@
2
2
  """
3
3
  plan_council_fanout.py — Parallel fan-out to Gemini, DeepSeek, Qwen, and GLM via LiteLLM.
4
4
  Usage: python3 plan_council_fanout.py "raw user goal" ["project context (facts only, no opinions)"]
5
- Reads: LITELLM_MASTER_KEY from env.
5
+ Reads: LITELLM_MASTER_KEY from the environment or ~/.claude/agents.env.
6
6
  Prints: labeled panel results to stdout.
7
7
 
8
8
  Panels receive the raw goal and neutral context — never Claude's reframing.
@@ -21,7 +21,7 @@ except Exception:
21
21
  # Shared preflight + failure-policy (fail-fast down-proxy detection, unmistakable
22
22
  # panel-failure rendering, and the exit code contract) — see agents/lib/council_common.py.
23
23
  sys.path.insert(0, str(_pathlib.Path(__file__).resolve().parents[1] / "lib"))
24
- from council_common import PanelResult, preflight_proxy, render_and_exit # noqa: E402
24
+ from council_common import PanelResult, litellm_master_key, preflight_proxy, render_and_exit # noqa: E402
25
25
 
26
26
  GEMINI_MODEL = "litellm_gemini"
27
27
  DEEPSEEK_MODEL = "litellm_deepseek"
@@ -170,7 +170,7 @@ def main():
170
170
  context = sys.argv[2] if len(sys.argv) > 2 else ""
171
171
  prompt = build_prompt(goal, context)
172
172
 
173
- or_key = os.environ.get("LITELLM_MASTER_KEY", "")
173
+ or_key = litellm_master_key()
174
174
  if not or_key:
175
175
  render_and_exit([], key_missing=True,
176
176
  usage_msg="Usage: plan_council_fanout.py 'raw goal' ['context']")
@@ -14,7 +14,7 @@ edge at 512px (tuned for square 3D-render comparisons), so a single tall
14
14
  multi-frame collage gets crushed to an illegible ~180px width and vision models
15
15
  reliably misread it. Sending each frame as its own image avoids that entirely.
16
16
 
17
- Reads: LITELLM_MASTER_KEY from env.
17
+ Reads: LITELLM_MASTER_KEY from the environment or ~/.claude/agents.env.
18
18
  Prints: labeled panel results to stdout, one COUNCIL_VERDICT line per panel.
19
19
  """
20
20
  import sys
@@ -2,7 +2,7 @@
2
2
  """
3
3
  review_council_fanout.py — Parallel fan-out to Gemini, DeepSeek, Qwen, and GLM via LiteLLM.
4
4
  Usage: python3 review_council_fanout.py "review goal" "path/to/diff_file"
5
- Reads: LITELLM_MASTER_KEY from env.
5
+ Reads: LITELLM_MASTER_KEY from the environment or ~/.claude/agents.env.
6
6
  Prints: labeled panel results to stdout.
7
7
 
8
8
  Panels receive the raw diff and review goal — never Claude's assessment.
@@ -29,7 +29,7 @@ except Exception:
29
29
  # Shared preflight + failure-policy (fail-fast down-proxy detection, unmistakable
30
30
  # panel-failure rendering, and the exit code contract) — see agents/lib/council_common.py.
31
31
  sys.path.insert(0, str(_pathlib.Path(__file__).resolve().parents[1] / "lib"))
32
- from council_common import PanelResult, preflight_proxy, render_and_exit # noqa: E402
32
+ from council_common import PanelResult, litellm_master_key, preflight_proxy, render_and_exit # noqa: E402
33
33
 
34
34
 
35
35
  def _log_panel_call(model, duration, usage, error=None):
@@ -206,7 +206,7 @@ def main():
206
206
 
207
207
  prompt = build_prompt(goal, diff)
208
208
 
209
- litellm_key = os.environ.get("LITELLM_MASTER_KEY", "")
209
+ litellm_key = litellm_master_key()
210
210
  if not litellm_key:
211
211
  render_and_exit([], key_missing=True,
212
212
  usage_msg="Usage: review_council_fanout.py 'review goal' 'path/to/diff_file'")