claude-smart 0.2.41 → 0.2.43

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 (396) hide show
  1. package/.claude-plugin/marketplace.json +17 -0
  2. package/README.md +1 -1
  3. package/bin/claude-smart.js +86 -48
  4. package/package.json +10 -3
  5. package/plugin/.claude-plugin/plugin.json +9 -3
  6. package/plugin/.codex-plugin/plugin.json +1 -1
  7. package/plugin/README.md +2 -2
  8. package/plugin/dashboard/next.config.ts +9 -1
  9. package/plugin/pyproject.toml +2 -2
  10. package/plugin/scripts/_lib.sh +91 -0
  11. package/plugin/scripts/backend-service.sh +46 -15
  12. package/plugin/scripts/cli.sh +29 -1
  13. package/plugin/scripts/codex-hook.js +72 -4
  14. package/plugin/scripts/dashboard-build.sh +1 -0
  15. package/plugin/scripts/dashboard-service.sh +1 -0
  16. package/plugin/scripts/ensure-plugin-root.sh +7 -14
  17. package/plugin/scripts/hook_entry.sh +1 -0
  18. package/plugin/scripts/smart-install.sh +18 -2
  19. package/plugin/src/claude_smart/cli.py +72 -38
  20. package/plugin/src/claude_smart/context_format.py +11 -12
  21. package/plugin/src/claude_smart/cs_cite.py +26 -12
  22. package/plugin/src/claude_smart/ids.py +13 -5
  23. package/plugin/uv.lock +1 -1
  24. package/plugin/vendor/reflexio/.env.example +53 -0
  25. package/plugin/vendor/reflexio/LICENSE +201 -0
  26. package/plugin/vendor/reflexio/README.md +338 -0
  27. package/plugin/vendor/reflexio/pyproject.toml +271 -0
  28. package/plugin/vendor/reflexio/reflexio/README.md +184 -0
  29. package/plugin/vendor/reflexio/reflexio/__init__.py +166 -0
  30. package/plugin/vendor/reflexio/reflexio/benchmarks/__init__.py +1 -0
  31. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/README.md +109 -0
  32. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/__init__.py +1 -0
  33. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/backends.py +175 -0
  34. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/bench.py +642 -0
  35. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/embed_cache.py +330 -0
  36. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/report.py +317 -0
  37. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/results/report.md +43 -0
  38. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/results/results.json +4478 -0
  39. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/scenarios.py +134 -0
  40. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/seed.py +255 -0
  41. package/plugin/vendor/reflexio/reflexio/cli/README.md +287 -0
  42. package/plugin/vendor/reflexio/reflexio/cli/__init__.py +0 -0
  43. package/plugin/vendor/reflexio/reflexio/cli/__main__.py +56 -0
  44. package/plugin/vendor/reflexio/reflexio/cli/_client.py +86 -0
  45. package/plugin/vendor/reflexio/reflexio/cli/app.py +127 -0
  46. package/plugin/vendor/reflexio/reflexio/cli/bootstrap_config.py +266 -0
  47. package/plugin/vendor/reflexio/reflexio/cli/codex_auth.py +503 -0
  48. package/plugin/vendor/reflexio/reflexio/cli/commands/__init__.py +0 -0
  49. package/plugin/vendor/reflexio/reflexio/cli/commands/admin_cmd.py +65 -0
  50. package/plugin/vendor/reflexio/reflexio/cli/commands/agent_playbooks.py +503 -0
  51. package/plugin/vendor/reflexio/reflexio/cli/commands/api.py +114 -0
  52. package/plugin/vendor/reflexio/reflexio/cli/commands/auth.py +109 -0
  53. package/plugin/vendor/reflexio/reflexio/cli/commands/config_cmd.py +511 -0
  54. package/plugin/vendor/reflexio/reflexio/cli/commands/doctor.py +127 -0
  55. package/plugin/vendor/reflexio/reflexio/cli/commands/embeddings.py +53 -0
  56. package/plugin/vendor/reflexio/reflexio/cli/commands/interactions.py +478 -0
  57. package/plugin/vendor/reflexio/reflexio/cli/commands/profiles.py +303 -0
  58. package/plugin/vendor/reflexio/reflexio/cli/commands/services.py +289 -0
  59. package/plugin/vendor/reflexio/reflexio/cli/commands/setup_cmd.py +961 -0
  60. package/plugin/vendor/reflexio/reflexio/cli/commands/shortcuts.py +285 -0
  61. package/plugin/vendor/reflexio/reflexio/cli/commands/status_cmd.py +143 -0
  62. package/plugin/vendor/reflexio/reflexio/cli/commands/user_playbooks.py +373 -0
  63. package/plugin/vendor/reflexio/reflexio/cli/env_loader.py +284 -0
  64. package/plugin/vendor/reflexio/reflexio/cli/errors.py +217 -0
  65. package/plugin/vendor/reflexio/reflexio/cli/log_format.py +247 -0
  66. package/plugin/vendor/reflexio/reflexio/cli/output.py +867 -0
  67. package/plugin/vendor/reflexio/reflexio/cli/paths.py +41 -0
  68. package/plugin/vendor/reflexio/reflexio/cli/run_services.py +391 -0
  69. package/plugin/vendor/reflexio/reflexio/cli/state.py +204 -0
  70. package/plugin/vendor/reflexio/reflexio/cli/stop_services.py +96 -0
  71. package/plugin/vendor/reflexio/reflexio/cli/utils.py +329 -0
  72. package/plugin/vendor/reflexio/reflexio/client/__init__.py +3 -0
  73. package/plugin/vendor/reflexio/reflexio/client/cache.py +150 -0
  74. package/plugin/vendor/reflexio/reflexio/client/client.py +2613 -0
  75. package/plugin/vendor/reflexio/reflexio/defaults.py +23 -0
  76. package/plugin/vendor/reflexio/reflexio/integrations/__init__.py +0 -0
  77. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/.clawhubignore +7 -0
  78. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/README.md +274 -0
  79. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/TESTING.md +517 -0
  80. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/hook/handler.js +473 -0
  81. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package-lock.json +2156 -0
  82. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package.json +18 -0
  83. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/handler.ts +241 -0
  84. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/setup.ts +140 -0
  85. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/index.ts +130 -0
  86. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/publish.ts +113 -0
  87. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/search.ts +52 -0
  88. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/server.ts +103 -0
  89. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/sqlite-buffer.ts +156 -0
  90. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/user-id.ts +134 -0
  91. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/openclaw.plugin.json +41 -0
  92. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/package.json +17 -0
  93. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/rules/reflexio.md +24 -0
  94. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/reflexio/SKILL.md +48 -0
  95. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/publish_clawhub.sh +278 -0
  96. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/references/HOOK.md +164 -0
  97. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/install.sh +36 -0
  98. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/uninstall.sh +35 -0
  99. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/publish.test.ts +27 -0
  100. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/search.test.ts +31 -0
  101. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/server.test.ts +42 -0
  102. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/setup.test.ts +49 -0
  103. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/sqlite-buffer.test.ts +91 -0
  104. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/user-id.test.ts +50 -0
  105. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tsconfig.json +16 -0
  106. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/types/openclaw.d.ts +230 -0
  107. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/vitest.config.ts +13 -0
  108. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/README.md +120 -0
  109. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/TESTING.md +168 -0
  110. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/package-lock.json +1657 -0
  111. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/package.json +16 -0
  112. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/HEARTBEAT.md +6 -0
  113. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/README.md +84 -0
  114. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/SKILL.md +194 -0
  115. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/_meta.json +6 -0
  116. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/agents/reflexio-extractor.md +45 -0
  117. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/hook/handler.ts +214 -0
  118. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/hook/setup.ts +55 -0
  119. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/index.ts +327 -0
  120. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/consolidate.ts +233 -0
  121. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/dedup.ts +80 -0
  122. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/io.ts +155 -0
  123. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/openclaw-cli.ts +67 -0
  124. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/search.ts +33 -0
  125. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/write-playbook.ts +76 -0
  126. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/write-profile.ts +79 -0
  127. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/openclaw.plugin.json +46 -0
  128. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/package.json +18 -0
  129. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/README.md +36 -0
  130. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/full_consolidation.md +56 -0
  131. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/playbook_extraction.md +217 -0
  132. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/profile_extraction.md +132 -0
  133. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/skills/reflexio-consolidate/SKILL.md +33 -0
  134. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/skills/reflexio-embedded/SKILL.md +194 -0
  135. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/HOOK.md +18 -0
  136. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/architecture.md +49 -0
  137. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/comparison.md +31 -0
  138. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/future-work.md +47 -0
  139. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/porting-notes.md +52 -0
  140. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/scripts/install.sh +52 -0
  141. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/scripts/uninstall.sh +36 -0
  142. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/consolidate.test.ts +135 -0
  143. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/dedup.test.ts +104 -0
  144. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/io.test.ts +175 -0
  145. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/search.test.ts +66 -0
  146. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/smoke-test.ts +140 -0
  147. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/write-playbook.test.ts +93 -0
  148. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/write-profile.test.ts +174 -0
  149. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tsconfig.json +16 -0
  150. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/types/openclaw.d.ts +230 -0
  151. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/vitest.config.ts +7 -0
  152. package/plugin/vendor/reflexio/reflexio/lib/__init__.py +23 -0
  153. package/plugin/vendor/reflexio/reflexio/lib/_agent_playbook.py +310 -0
  154. package/plugin/vendor/reflexio/reflexio/lib/_base.py +225 -0
  155. package/plugin/vendor/reflexio/reflexio/lib/_config.py +83 -0
  156. package/plugin/vendor/reflexio/reflexio/lib/_dashboard.py +266 -0
  157. package/plugin/vendor/reflexio/reflexio/lib/_generation.py +176 -0
  158. package/plugin/vendor/reflexio/reflexio/lib/_interactions.py +334 -0
  159. package/plugin/vendor/reflexio/reflexio/lib/_operations.py +153 -0
  160. package/plugin/vendor/reflexio/reflexio/lib/_profiles.py +545 -0
  161. package/plugin/vendor/reflexio/reflexio/lib/_reflection.py +52 -0
  162. package/plugin/vendor/reflexio/reflexio/lib/_search.py +167 -0
  163. package/plugin/vendor/reflexio/reflexio/lib/_storage_labels.py +103 -0
  164. package/plugin/vendor/reflexio/reflexio/lib/_user_playbook.py +288 -0
  165. package/plugin/vendor/reflexio/reflexio/lib/reflexio_lib.py +27 -0
  166. package/plugin/vendor/reflexio/reflexio/models/__init__.py +0 -0
  167. package/plugin/vendor/reflexio/reflexio/models/api_schema/__init__.py +0 -0
  168. package/plugin/vendor/reflexio/reflexio/models/api_schema/braintrust_schema.py +141 -0
  169. package/plugin/vendor/reflexio/reflexio/models/api_schema/common.py +41 -0
  170. package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/__init__.py +3 -0
  171. package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/entities.py +1103 -0
  172. package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/enums.py +63 -0
  173. package/plugin/vendor/reflexio/reflexio/models/api_schema/eval_overview_schema.py +487 -0
  174. package/plugin/vendor/reflexio/reflexio/models/api_schema/internal_schema.py +28 -0
  175. package/plugin/vendor/reflexio/reflexio/models/api_schema/pending_tool_call_schema.py +83 -0
  176. package/plugin/vendor/reflexio/reflexio/models/api_schema/retriever_schema.py +766 -0
  177. package/plugin/vendor/reflexio/reflexio/models/api_schema/service_schemas.py +9 -0
  178. package/plugin/vendor/reflexio/reflexio/models/api_schema/stall_state_schema.py +32 -0
  179. package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/__init__.py +3 -0
  180. package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/converters.py +177 -0
  181. package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/entities.py +129 -0
  182. package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/enums.py +25 -0
  183. package/plugin/vendor/reflexio/reflexio/models/api_schema/validators.py +280 -0
  184. package/plugin/vendor/reflexio/reflexio/models/config_schema.py +908 -0
  185. package/plugin/vendor/reflexio/reflexio/models/py.typed +0 -0
  186. package/plugin/vendor/reflexio/reflexio/server/OVERVIEW.md +90 -0
  187. package/plugin/vendor/reflexio/reflexio/server/README.md +616 -0
  188. package/plugin/vendor/reflexio/reflexio/server/__init__.py +210 -0
  189. package/plugin/vendor/reflexio/reflexio/server/__main__.py +132 -0
  190. package/plugin/vendor/reflexio/reflexio/server/_auth.py +25 -0
  191. package/plugin/vendor/reflexio/reflexio/server/api.py +2714 -0
  192. package/plugin/vendor/reflexio/reflexio/server/api_endpoints/account_api.py +143 -0
  193. package/plugin/vendor/reflexio/reflexio/server/api_endpoints/health_api.py +91 -0
  194. package/plugin/vendor/reflexio/reflexio/server/api_endpoints/pending_tool_call_api.py +572 -0
  195. package/plugin/vendor/reflexio/reflexio/server/api_endpoints/precondition_checks.py +66 -0
  196. package/plugin/vendor/reflexio/reflexio/server/api_endpoints/publisher_api.py +540 -0
  197. package/plugin/vendor/reflexio/reflexio/server/api_endpoints/request_context.py +50 -0
  198. package/plugin/vendor/reflexio/reflexio/server/api_endpoints/stall_state_api.py +100 -0
  199. package/plugin/vendor/reflexio/reflexio/server/cache/__init__.py +15 -0
  200. package/plugin/vendor/reflexio/reflexio/server/cache/reflexio_cache.py +208 -0
  201. package/plugin/vendor/reflexio/reflexio/server/correlation.py +46 -0
  202. package/plugin/vendor/reflexio/reflexio/server/llm/__init__.py +30 -0
  203. package/plugin/vendor/reflexio/reflexio/server/llm/embedding_service.py +110 -0
  204. package/plugin/vendor/reflexio/reflexio/server/llm/image_utils.py +55 -0
  205. package/plugin/vendor/reflexio/reflexio/server/llm/litellm_client.py +1595 -0
  206. package/plugin/vendor/reflexio/reflexio/server/llm/llm_utils.py +112 -0
  207. package/plugin/vendor/reflexio/reflexio/server/llm/model_defaults.py +469 -0
  208. package/plugin/vendor/reflexio/reflexio/server/llm/providers/__init__.py +1 -0
  209. package/plugin/vendor/reflexio/reflexio/server/llm/providers/claude_code_provider.py +1122 -0
  210. package/plugin/vendor/reflexio/reflexio/server/llm/providers/claude_code_stream_parser.py +197 -0
  211. package/plugin/vendor/reflexio/reflexio/server/llm/providers/embedding_service_provider.py +210 -0
  212. package/plugin/vendor/reflexio/reflexio/server/llm/providers/local_embedding_provider.py +213 -0
  213. package/plugin/vendor/reflexio/reflexio/server/llm/providers/nomic_embedding_provider.py +255 -0
  214. package/plugin/vendor/reflexio/reflexio/server/llm/rerank/__init__.py +6 -0
  215. package/plugin/vendor/reflexio/reflexio/server/llm/rerank/cross_encoder_reranker.py +177 -0
  216. package/plugin/vendor/reflexio/reflexio/server/llm/rerank/llm_reranker.py +148 -0
  217. package/plugin/vendor/reflexio/reflexio/server/llm/tools.py +699 -0
  218. package/plugin/vendor/reflexio/reflexio/server/operation_limiter.py +179 -0
  219. package/plugin/vendor/reflexio/reflexio/server/prompt/__init__.py +0 -0
  220. package/plugin/vendor/reflexio/reflexio/server/prompt/_dispatchers.py +54 -0
  221. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/README.md +121 -0
  222. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/agent_success_evaluation/v1.0.0.prompt.md +58 -0
  223. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/agent_success_evaluation_with_comparison/v1.0.0.prompt.md +76 -0
  224. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/answer_synthesis/v1.5.2.prompt.md +88 -0
  225. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/compress_session_for_query/v1.3.0.prompt.md +31 -0
  226. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/document_expansion/v1.0.0.prompt.md +20 -0
  227. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.0.0.prompt.md +53 -0
  228. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.1.0.prompt.md +57 -0
  229. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.2.0.prompt.md +68 -0
  230. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.3.0.prompt.md +70 -0
  231. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.4.0.prompt.md +77 -0
  232. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.5.0.prompt.md +82 -0
  233. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.6.0.prompt.md +83 -0
  234. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_aggregation/v2.1.0.prompt.md +193 -0
  235. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_aggregation/v2.2.0.prompt.md +206 -0
  236. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v1.0.0-deprecated.prompt.md +66 -0
  237. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v1.0.0.prompt.md +43 -0
  238. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v1.1.0.prompt.md +46 -0
  239. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.0.0-deprecated.prompt.md +64 -0
  240. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.0.0.prompt.md +39 -0
  241. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.1.0.prompt.md +39 -0
  242. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.2.0.prompt.md +47 -0
  243. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.3.0.prompt.md +58 -0
  244. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.0.2.prompt.md +254 -0
  245. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.1.0.prompt.md +274 -0
  246. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.2.0.prompt.md +279 -0
  247. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v1.0.0.prompt.md +73 -0
  248. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v2.0.0.prompt.md +86 -0
  249. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.0.0.prompt.md +97 -0
  250. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.1.0.prompt.md +119 -0
  251. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.2.0.prompt.md +123 -0
  252. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.3.0.prompt.md +127 -0
  253. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.0.0.prompt.md +14 -0
  254. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.1.0.prompt.md +24 -0
  255. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.2.0.prompt.md +29 -0
  256. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main_expert/v1.0.0.prompt.md +11 -0
  257. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main_expert/v1.1.0.prompt.md +21 -0
  258. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main_expert/v1.2.0.prompt.md +25 -0
  259. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_optimizer_judge/v1.0.0.prompt.md +37 -0
  260. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_optimizer_judge/v1.1.0.prompt.md +40 -0
  261. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_optimizer_judge/v1.2.0.prompt.md +36 -0
  262. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate/v1.0.0.prompt.md +45 -0
  263. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate/v2.0.0.prompt.md +81 -0
  264. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate/v3.0.0.prompt.md +80 -0
  265. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate_expert/v1.0.0.prompt.md +34 -0
  266. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_deduplication/v1.0.0.prompt.md +116 -0
  267. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_should_generate/v1.0.0.prompt.md +33 -0
  268. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_should_generate_override/v1.0.0.prompt.md +16 -0
  269. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.0.0.prompt.md +140 -0
  270. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.1.0.prompt.md +160 -0
  271. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_main/v1.0.0.prompt.md +14 -0
  272. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/query_reformulation/v1.0.0.prompt.md +19 -0
  273. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/rerank_relevance/v1.1.0.prompt.md +44 -0
  274. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/shadow_comparison/v1.0.0.prompt.md +43 -0
  275. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/shadow_content_evaluation/v1.0.0.prompt.md +33 -0
  276. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_evaluation/prompt_evaluation_dataset/feedback_extraction_main_v1.jsonl +10 -0
  277. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_evaluation/prompt_evaluation_dataset/profile_update_main_v1.jsonl +10 -0
  278. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_manager.py +280 -0
  279. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_schema.py +11 -0
  280. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/_eval_health.py +131 -0
  281. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_constants.py +60 -0
  282. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_service.py +228 -0
  283. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_utils.py +87 -0
  284. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluator.py +372 -0
  285. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/delayed_group_evaluator.py +156 -0
  286. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/group_evaluation_runner.py +340 -0
  287. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/regen_jobs.py +471 -0
  288. package/plugin/vendor/reflexio/reflexio/server/services/base_generation_service.py +1626 -0
  289. package/plugin/vendor/reflexio/reflexio/server/services/braintrust/__init__.py +0 -0
  290. package/plugin/vendor/reflexio/reflexio/server/services/braintrust/_cron.py +196 -0
  291. package/plugin/vendor/reflexio/reflexio/server/services/braintrust/_encryption.py +101 -0
  292. package/plugin/vendor/reflexio/reflexio/server/services/braintrust/client.py +167 -0
  293. package/plugin/vendor/reflexio/reflexio/server/services/braintrust/service.py +281 -0
  294. package/plugin/vendor/reflexio/reflexio/server/services/configurator/base_configurator.py +179 -0
  295. package/plugin/vendor/reflexio/reflexio/server/services/configurator/config_storage.py +62 -0
  296. package/plugin/vendor/reflexio/reflexio/server/services/configurator/configurator.py +87 -0
  297. package/plugin/vendor/reflexio/reflexio/server/services/configurator/local_file_config_storage.py +187 -0
  298. package/plugin/vendor/reflexio/reflexio/server/services/configurator/test_config_storage.py +162 -0
  299. package/plugin/vendor/reflexio/reflexio/server/services/deduplication_utils.py +112 -0
  300. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/__init__.py +0 -0
  301. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/distribution.py +33 -0
  302. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/eval_sampler.py +126 -0
  303. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/group_aggregation.py +192 -0
  304. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/hero_state.py +75 -0
  305. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/rule_attribution.py +97 -0
  306. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/service.py +515 -0
  307. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/shadow_aggregation.py +90 -0
  308. package/plugin/vendor/reflexio/reflexio/server/services/extraction/__init__.py +0 -0
  309. package/plugin/vendor/reflexio/reflexio/server/services/extraction/agent_run_records.py +91 -0
  310. package/plugin/vendor/reflexio/reflexio/server/services/extraction/invariants.py +303 -0
  311. package/plugin/vendor/reflexio/reflexio/server/services/extraction/outcome.py +25 -0
  312. package/plugin/vendor/reflexio/reflexio/server/services/extraction/pending_tool_call_dispatch.py +351 -0
  313. package/plugin/vendor/reflexio/reflexio/server/services/extraction/plan.py +138 -0
  314. package/plugin/vendor/reflexio/reflexio/server/services/extraction/prior_answer_search.py +217 -0
  315. package/plugin/vendor/reflexio/reflexio/server/services/extraction/resumable_agent.py +468 -0
  316. package/plugin/vendor/reflexio/reflexio/server/services/extraction/resume_scheduler.py +171 -0
  317. package/plugin/vendor/reflexio/reflexio/server/services/extraction/resume_worker.py +777 -0
  318. package/plugin/vendor/reflexio/reflexio/server/services/extraction/tools.py +1125 -0
  319. package/plugin/vendor/reflexio/reflexio/server/services/extractor_config_utils.py +91 -0
  320. package/plugin/vendor/reflexio/reflexio/server/services/extractor_interaction_utils.py +251 -0
  321. package/plugin/vendor/reflexio/reflexio/server/services/generation_service.py +689 -0
  322. package/plugin/vendor/reflexio/reflexio/server/services/operation_state_utils.py +835 -0
  323. package/plugin/vendor/reflexio/reflexio/server/services/playbook/README.md +89 -0
  324. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_aggregator.py +1388 -0
  325. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_consolidator.py +960 -0
  326. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_extractor.py +436 -0
  327. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_generation_service.py +808 -0
  328. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_service_constants.py +28 -0
  329. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_service_utils.py +362 -0
  330. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/__init__.py +24 -0
  331. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/assistant_webhook.py +246 -0
  332. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/gepa_adapter.py +291 -0
  333. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/judge.py +97 -0
  334. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/models.py +96 -0
  335. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/optimizer.py +645 -0
  336. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/rollout.py +35 -0
  337. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/scenario_resolver.py +93 -0
  338. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/scheduler.py +174 -0
  339. package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/__init__.py +26 -0
  340. package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/_document_expander.py +179 -0
  341. package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/_query_reformulator.py +297 -0
  342. package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_deduplicator.py +741 -0
  343. package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_extractor.py +462 -0
  344. package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_generation_service.py +734 -0
  345. package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_generation_service_utils.py +290 -0
  346. package/plugin/vendor/reflexio/reflexio/server/services/reflection/__init__.py +17 -0
  347. package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_extractor.py +247 -0
  348. package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_service.py +800 -0
  349. package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_service_utils.py +146 -0
  350. package/plugin/vendor/reflexio/reflexio/server/services/retrieval/__init__.py +0 -0
  351. package/plugin/vendor/reflexio/reflexio/server/services/retrieval/relevance_floor.py +70 -0
  352. package/plugin/vendor/reflexio/reflexio/server/services/search/__init__.py +0 -0
  353. package/plugin/vendor/reflexio/reflexio/server/services/service_utils.py +671 -0
  354. package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/__init__.py +1 -0
  355. package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/judge.py +184 -0
  356. package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/outcome.py +81 -0
  357. package/plugin/vendor/reflexio/reflexio/server/services/storage/constants.py +2 -0
  358. package/plugin/vendor/reflexio/reflexio/server/services/storage/error.py +11 -0
  359. package/plugin/vendor/reflexio/reflexio/server/services/storage/retention.py +154 -0
  360. package/plugin/vendor/reflexio/reflexio/server/services/storage/retention_mixin.py +155 -0
  361. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/__init__.py +59 -0
  362. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_agent_run.py +1253 -0
  363. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_base.py +1945 -0
  364. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_extras.py +600 -0
  365. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_operations.py +346 -0
  366. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_playbook.py +1378 -0
  367. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_profiles.py +747 -0
  368. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_requests.py +263 -0
  369. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_shadow_verdicts.py +193 -0
  370. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_share_links.py +166 -0
  371. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_stall_state.py +217 -0
  372. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/__init__.py +153 -0
  373. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_agent_run.py +372 -0
  374. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_base.py +71 -0
  375. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_extras.py +235 -0
  376. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_operations.py +170 -0
  377. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_playbook.py +677 -0
  378. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_profiles.py +250 -0
  379. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_requests.py +154 -0
  380. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_shadow_verdicts.py +130 -0
  381. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_share_links.py +93 -0
  382. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_stall_state.py +76 -0
  383. package/plugin/vendor/reflexio/reflexio/server/services/unified_search_service.py +568 -0
  384. package/plugin/vendor/reflexio/reflexio/server/site_var/README.md +77 -0
  385. package/plugin/vendor/reflexio/reflexio/server/site_var/feature_flags.py +116 -0
  386. package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_manager.py +263 -0
  387. package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/feature_flags.json +13 -0
  388. package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/llm_model_setting.json +7 -0
  389. package/plugin/vendor/reflexio/reflexio/server/tracing.py +158 -0
  390. package/plugin/vendor/reflexio/reflexio/server/usage_metrics.py +113 -0
  391. package/plugin/vendor/reflexio/reflexio/server/uvicorn_logging.py +76 -0
  392. package/plugin/vendor/reflexio/reflexio/test_support/__init__.py +1 -0
  393. package/plugin/vendor/reflexio/reflexio/test_support/llm_fixtures.py +62 -0
  394. package/plugin/vendor/reflexio/reflexio/test_support/llm_mock.py +242 -0
  395. package/plugin/vendor/reflexio/reflexio/test_support/llm_model_registry.py +129 -0
  396. package/plugin/vendor/reflexio/reflexio/test_support/skip_decorators.py +43 -0
@@ -89,14 +89,82 @@ function appendLog(name, line) {
89
89
  trimLog(file);
90
90
  }
91
91
 
92
+ function realDir(dir) {
93
+ try {
94
+ if (!fs.statSync(dir).isDirectory()) return null;
95
+ return fs.realpathSync(dir);
96
+ } catch {
97
+ return null;
98
+ }
99
+ }
100
+
101
+ function isInsideDir(parent, child) {
102
+ const rel = path.relative(parent, child);
103
+ return rel && !rel.startsWith("..") && !path.isAbsolute(rel);
104
+ }
105
+
106
+ function isPluginLikeRoot(root) {
107
+ return fs.existsSync(path.join(root, "pyproject.toml")) && fs.existsSync(path.join(root, "scripts"));
108
+ }
109
+
110
+ function isReflexioStrayPluginCopy(root) {
111
+ if (!isPluginLikeRoot(root)) return false;
112
+ const rootReal = realDir(root);
113
+ const reflexioReal = realDir(REFLEXIO_DIR);
114
+ if (!rootReal || !reflexioReal) return false;
115
+ return isInsideDir(reflexioReal, rootReal);
116
+ }
117
+
118
+ function stablePluginRootForStrayCopy(root) {
119
+ if (!isReflexioStrayPluginCopy(root)) return null;
120
+ const rootReal = realDir(root);
121
+ const candidates = [
122
+ path.join(REFLEXIO_DIR, "plugin-root"),
123
+ path.join(HOME, ".claude", "plugins", "marketplaces", "reflexioai", "plugin"),
124
+ path.join(HOME, ".codex", "plugins", "cache", "reflexioai", "claude-smart", "current"),
125
+ ];
126
+ for (const cacheRoot of [
127
+ path.join(HOME, ".claude", "plugins", "cache", "reflexioai", "claude-smart"),
128
+ path.join(HOME, ".codex", "plugins", "cache", "reflexioai", "claude-smart"),
129
+ ]) {
130
+ try {
131
+ const versions = fs
132
+ .readdirSync(cacheRoot, { withFileTypes: true })
133
+ .filter((entry) => entry.isDirectory())
134
+ .map((entry) => path.join(cacheRoot, entry.name))
135
+ .sort((a, b) => fs.statSync(b).mtimeMs - fs.statSync(a).mtimeMs);
136
+ candidates.push(...versions);
137
+ } catch {
138
+ // Missing cache roots are fine; try the next candidate family.
139
+ }
140
+ }
141
+ for (const candidate of candidates) {
142
+ if (!isPluginLikeRoot(candidate)) continue;
143
+ const candidateReal = realDir(candidate);
144
+ if (!candidateReal || candidateReal === rootReal) continue;
145
+ if (isReflexioStrayPluginCopy(candidateReal)) continue;
146
+ return candidateReal;
147
+ }
148
+ return null;
149
+ }
150
+
151
+ function stablePluginRoot(root) {
152
+ const stable = stablePluginRootForStrayCopy(root);
153
+ if (stable) {
154
+ appendLog("backend.log", `[claude-smart] redirecting stray plugin copy under ~/.reflexio (${root}) to stable root ${stable}`);
155
+ return stable;
156
+ }
157
+ return root;
158
+ }
159
+
92
160
  function pluginRoot() {
93
161
  for (const value of [process.env.CLAUDE_PLUGIN_ROOT, process.env.PLUGIN_ROOT]) {
94
162
  if (value && fs.existsSync(path.join(value, "pyproject.toml"))) {
95
- return path.resolve(value);
163
+ return stablePluginRoot(path.resolve(value));
96
164
  }
97
165
  }
98
166
  const fromScript = path.resolve(__dirname, "..");
99
- if (fs.existsSync(path.join(fromScript, "pyproject.toml"))) return fromScript;
167
+ if (fs.existsSync(path.join(fromScript, "pyproject.toml"))) return stablePluginRoot(fromScript);
100
168
  const cacheRoot = path.join(HOME, ".codex", "plugins", "cache", "reflexioai", "claude-smart");
101
169
  try {
102
170
  const versions = fs
@@ -105,12 +173,12 @@ function pluginRoot() {
105
173
  .map((entry) => path.join(cacheRoot, entry.name))
106
174
  .sort((a, b) => fs.statSync(b).mtimeMs - fs.statSync(a).mtimeMs);
107
175
  for (const candidate of versions) {
108
- if (fs.existsSync(path.join(candidate, "pyproject.toml"))) return candidate;
176
+ if (fs.existsSync(path.join(candidate, "pyproject.toml"))) return stablePluginRoot(candidate);
109
177
  }
110
178
  } catch {
111
179
  // Fall through to the stable plugin-root link.
112
180
  }
113
- return path.join(REFLEXIO_DIR, "plugin-root");
181
+ return stablePluginRoot(path.join(REFLEXIO_DIR, "plugin-root"));
114
182
  }
115
183
 
116
184
  function prependRuntimePath() {
@@ -27,6 +27,7 @@ claude_smart_source_login_path
27
27
  claude_smart_prepend_node_bins
28
28
 
29
29
  PLUGIN_ROOT="$(cd "$HERE/.." && pwd)"
30
+ claude_smart_reexec_stable_plugin_root_if_needed "$PLUGIN_ROOT" "dashboard-build.sh" "$@"
30
31
  DASHBOARD_DIR="$PLUGIN_ROOT/dashboard"
31
32
 
32
33
  STATE_DIR="$HOME/.claude-smart"
@@ -29,6 +29,7 @@ CMD="${1:-start}"
29
29
  PORT=3001
30
30
 
31
31
  PLUGIN_ROOT="$(cd "$HERE/.." && pwd)"
32
+ claude_smart_reexec_stable_plugin_root_if_needed "$PLUGIN_ROOT" "dashboard-service.sh" "$@"
32
33
  DASHBOARD_DIR="$PLUGIN_ROOT/dashboard"
33
34
  WORKSPACE_CWD="${PWD:-}"
34
35
 
@@ -1,11 +1,9 @@
1
1
  #!/usr/bin/env bash
2
2
  # Maintain ~/.reflexio/plugin-root as a symlink to the active plugin
3
- # install dir so slash commands can reference one short path regardless
4
- # of whether the user is on the remote marketplace (reflexioai) or the
5
- # local-dev marketplace (reflexioai-local).
3
+ # install dir so slash commands can reference one short path.
6
4
  #
7
5
  # Usage: ensure-plugin-root.sh <target-dir> [--force]
8
- # --force overwrite any existing link (used by setup-local-dev.sh)
6
+ # --force overwrite any existing link
9
7
  # default self-heal only if the link is missing or points at an
10
8
  # invalid target
11
9
  set -eu
@@ -34,8 +32,7 @@ fi
34
32
 
35
33
  # Opt-in: when CLAUDE_SMART_PLUGIN_ROOT_FOLLOW_SESSION=1 (set in the
36
34
  # environment or in ~/.reflexio/.env), always relink to $TARGET so the
37
- # symlink tracks the currently loaded plugin. Off by default to preserve
38
- # a pinned local-dev link across sessions that load the remote plugin.
35
+ # symlink tracks the currently loaded plugin.
39
36
  FOLLOW="${CLAUDE_SMART_PLUGIN_ROOT_FOLLOW_SESSION:-}"
40
37
  if [ -z "$FOLLOW" ] && [ -f "$HOME/.reflexio/.env" ]; then
41
38
  FOLLOW="$(grep -E '^CLAUDE_SMART_PLUGIN_ROOT_FOLLOW_SESSION=' "$HOME/.reflexio/.env" \
@@ -52,11 +49,9 @@ fi
52
49
 
53
50
  # Cache-tracking: if the link currently resolves to a path under the
54
51
  # managed plugin cache (~/.claude/plugins/cache/ or ~/.codex/plugins/cache/),
55
- # always retarget it to
56
- # $TARGET. Plugin updates leave old version directories behind, so a
57
- # valid pyproject.toml at the stale target is not proof the link is
58
- # fresh. Links pointing outside the cache (e.g., a user's local-dev
59
- # checkout) are left alone here and handled by the self-heal below.
52
+ # always retarget it to $TARGET. Plugin updates leave old version
53
+ # directories behind, so a valid pyproject.toml at the stale target is
54
+ # not proof the link is fresh.
60
55
  if [ -L "$LINK" ]; then
61
56
  # Literal target string, not realpath: we compare against what was written by ln -s.
62
57
  CURRENT="$(readlink "$LINK" 2>/dev/null || true)"
@@ -74,9 +69,7 @@ if [ -L "$LINK" ]; then
74
69
  fi
75
70
 
76
71
  # Self-heal path: only rewrite the link if it's missing or its target is
77
- # gone/invalid. This preserves a valid local-dev symlink set earlier by
78
- # setup-local-dev.sh, so SessionStart hooks on the local install don't
79
- # clobber the user's repo-pointing link.
72
+ # gone/invalid.
80
73
  if [ -f "$LINK/pyproject.toml" ]; then
81
74
  exit 0
82
75
  fi
@@ -46,6 +46,7 @@ claude_smart_prepend_astral_bins
46
46
  claude_smart_source_reflexio_env
47
47
 
48
48
  PLUGIN_ROOT="$(cd "$HERE/.." && pwd)"
49
+ claude_smart_reexec_stable_plugin_root_if_needed "$PLUGIN_ROOT" "hook_entry.sh" "$@"
49
50
 
50
51
  FAILURE_MARKER="$HOME/.claude-smart/install-failed"
51
52
  STATE_DIR="$HOME/.claude-smart"
@@ -17,6 +17,7 @@ claude_smart_prepend_node_bins
17
17
  claude_smart_source_reflexio_env
18
18
 
19
19
  PLUGIN_ROOT="$(cd "$HERE/.." && pwd)"
20
+ claude_smart_reexec_stable_plugin_root_if_needed "$PLUGIN_ROOT" "smart-install.sh" "$@"
20
21
  REPO_ROOT="$(cd "$HERE/../.." && pwd)"
21
22
 
22
23
  MARKER_DIR="$HOME/.claude-smart"
@@ -446,6 +447,22 @@ if ! command -v uv >/dev/null 2>&1; then
446
447
  fi
447
448
 
448
449
  cd "$PLUGIN_ROOT"
450
+ # Self-heal a corrupt .venv before uv sync. uv refuses to reuse a venv that
451
+ # exists but has no python executable (e.g. partial cleanup of an npm/npx
452
+ # tree, an interrupted earlier install, or the underlying interpreter being
453
+ # uninstalled) — it errors with "not a valid Python environment" instead of
454
+ # rebuilding. Pre-clearing lets uv recreate it cleanly.
455
+ if [ -d "$PLUGIN_ROOT/.venv" ]; then
456
+ if claude_smart_is_windows; then
457
+ plugin_python_path="$PLUGIN_ROOT/.venv/Scripts/python.exe"
458
+ else
459
+ plugin_python_path="$PLUGIN_ROOT/.venv/bin/python"
460
+ fi
461
+ if [ ! -x "$plugin_python_path" ]; then
462
+ echo "[claude-smart] .venv at $PLUGIN_ROOT/.venv has no python executable; recreating" >&2
463
+ rm -rf "$PLUGIN_ROOT/.venv"
464
+ fi
465
+ fi
449
466
  echo "[claude-smart] running uv sync..." >&2
450
467
  if ! uv sync --locked --python 3.12 --quiet >&2; then
451
468
  write_failure "uv sync failed in $PLUGIN_ROOT — run 'uv sync --locked --python 3.12' there to diagnose"
@@ -626,8 +643,7 @@ elif [ -d "$DASHBOARD_DIR" ]; then
626
643
  fi
627
644
 
628
645
  # Point ~/.reflexio/plugin-root at this install so slash commands can
629
- # reference one stable short path regardless of which marketplace
630
- # (reflexioai or reflexioai-local) loaded us.
646
+ # reference one stable short path regardless of which install loaded us.
631
647
  if ! bash "$HERE/ensure-plugin-root.sh" "$PLUGIN_ROOT"; then
632
648
  echo "[claude-smart] WARNING: failed to set ~/.reflexio/plugin-root symlink — slash commands may not resolve" >&2
633
649
  fi
@@ -38,7 +38,6 @@ from claude_smart.reflexio_adapter import Adapter
38
38
 
39
39
  _REFLEXIO_ENV_PATH = env_config.REFLEXIO_ENV_PATH
40
40
  _MANAGED_REFLEXIO_URL = env_config.MANAGED_REFLEXIO_URL
41
- _DEFAULT_MARKETPLACE_SOURCE = "ReflexioAI/claude-smart"
42
41
  _PLUGIN_SPEC = "claude-smart@reflexioai"
43
42
  _CODEX_MARKETPLACE_NAME = "reflexioai"
44
43
  _CODEX_MARKETPLACE_DISPLAY_NAME = "ReflexioAI"
@@ -803,6 +802,23 @@ def _install_codex_plugin_cache(plugin_root: Path) -> tuple[bool, str]:
803
802
  return True, f"installed Codex plugin cache at {cache_dir}"
804
803
 
805
804
 
805
+ def _find_codex_plugin_root() -> Path | None:
806
+ """Locate the latest installed Codex plugin cache root."""
807
+ candidates = (
808
+ [
809
+ child
810
+ for child in _CODEX_PLUGIN_CACHE_DIR.iterdir()
811
+ if child.is_dir()
812
+ and (child / "pyproject.toml").is_file()
813
+ and (child / "scripts" / "smart-install.sh").is_file()
814
+ ]
815
+ if _CODEX_PLUGIN_CACHE_DIR.is_dir()
816
+ else []
817
+ )
818
+ candidates.sort(key=_installed_plugin_sort_key, reverse=True)
819
+ return candidates[0] if candidates else None
820
+
821
+
806
822
  def _cleanup_codex_install_state() -> bool:
807
823
  """Remove Codex's local install artifacts while preserving shared learning data.
808
824
 
@@ -1055,13 +1071,13 @@ def cmd_install_codex(args: argparse.Namespace) -> int:
1055
1071
  def cmd_install(args: argparse.Namespace) -> int:
1056
1072
  """Install claude-smart into Claude Code via the native plugin CLI.
1057
1073
 
1058
- Runs ``claude plugin marketplace add`` followed by ``claude plugin install``,
1059
- then appends the local-provider flags to ``~/.reflexio/.env`` so reflexio
1060
- can route generation through the local Claude Code CLI.
1074
+ Runs ``claude plugin marketplace add`` (pointed at the bundled marketplace
1075
+ at ``_REPO_ROOT``) followed by ``claude plugin install``, then appends the
1076
+ local-provider flags to ``~/.reflexio/.env`` so reflexio can route
1077
+ generation through the local Claude Code CLI.
1061
1078
 
1062
1079
  Args:
1063
- args (argparse.Namespace): Parsed CLI args. Uses ``args.source`` as the
1064
- marketplace ref (``owner/repo`` on GitHub, or a local directory).
1080
+ args (argparse.Namespace): Parsed CLI args.
1065
1081
 
1066
1082
  Returns:
1067
1083
  int: 0 on success, non-zero if the ``claude`` CLI is missing or fails.
@@ -1077,13 +1093,27 @@ def cmd_install(args: argparse.Namespace) -> int:
1077
1093
  return 1
1078
1094
  read_only = _configure_reflexio_setup()
1079
1095
 
1096
+ refresh_existing = bool(getattr(args, "refresh_existing", False))
1080
1097
  for cmd in (
1081
- ["claude", "plugin", "marketplace", "add", args.source],
1098
+ ["claude", "plugin", "marketplace", "add", str(_REPO_ROOT)],
1082
1099
  ["claude", "plugin", "install", _PLUGIN_SPEC],
1083
1100
  ):
1084
1101
  try:
1085
1102
  subprocess.run(cmd, check=True)
1086
1103
  except subprocess.CalledProcessError as exc:
1104
+ if refresh_existing and cmd[1:3] == ["plugin", "install"]:
1105
+ sys.stderr.write(
1106
+ f"warning: {' '.join(cmd)} failed (exit {exc.returncode}); "
1107
+ f"retrying after uninstalling {_PLUGIN_SPEC}\n"
1108
+ )
1109
+ subprocess.run(
1110
+ ["claude", "plugin", "uninstall", _PLUGIN_SPEC], check=False
1111
+ )
1112
+ try:
1113
+ subprocess.run(cmd, check=True)
1114
+ continue
1115
+ except subprocess.CalledProcessError as retry_exc:
1116
+ exc = retry_exc
1087
1117
  sys.stderr.write(f"error: {' '.join(cmd)} failed (exit {exc.returncode})\n")
1088
1118
  return exc.returncode or 1
1089
1119
 
@@ -1112,41 +1142,44 @@ def cmd_install(args: argparse.Namespace) -> int:
1112
1142
 
1113
1143
 
1114
1144
  def cmd_update(args: argparse.Namespace) -> int:
1115
- """Update claude-smart to the latest version via the native plugin CLI.
1145
+ """Update claude-smart by reinstalling from this package.
1116
1146
 
1117
- Runs ``claude plugin update claude-smart@reflexioai``.
1147
+ The simplified install path registers the bundled package root as the
1148
+ marketplace, so update is a stop + reinstall instead of
1149
+ ``claude plugin update``.
1118
1150
 
1119
1151
  Args:
1120
- args (argparse.Namespace): Parsed CLI args (unused).
1152
+ args (argparse.Namespace): Parsed CLI args.
1121
1153
 
1122
1154
  Returns:
1123
- int: 0 on success, non-zero if the ``claude`` CLI is missing or fails.
1155
+ int: 0 on success, non-zero if the host CLI is missing or install fails.
1124
1156
  """
1125
- if not shutil.which("claude"):
1126
- sys.stderr.write(
1127
- "error: 'claude' CLI not found on PATH. "
1128
- "Install Claude Code first: https://claude.com/claude-code\n"
1129
- )
1130
- return 1
1157
+ if getattr(args, "host", "claude-code") == "codex":
1158
+ return cmd_update_codex(args)
1131
1159
 
1132
- read_only = _configure_reflexio_setup()
1133
- cmd = ["claude", "plugin", "update", _PLUGIN_SPEC]
1134
- try:
1135
- subprocess.run(cmd, check=True)
1136
- except subprocess.CalledProcessError as exc:
1137
- sys.stderr.write(f"error: {' '.join(cmd)} failed (exit {exc.returncode})\n")
1138
- return exc.returncode or 1
1160
+ _run_service(_DASHBOARD_SCRIPT, "stop")
1161
+ _run_service(_BACKEND_SCRIPT, "stop")
1162
+ sys.stdout.write("Updating claude-smart by reinstalling from this package...\n")
1163
+ install_args = argparse.Namespace(**vars(args), refresh_existing=True)
1164
+ install_args.host = "claude-code"
1165
+ return cmd_install(install_args)
1139
1166
 
1140
- sys.stdout.write("\nclaude-smart updated. Restart Claude Code to apply.\n")
1141
- plugin_root = _find_claude_code_plugin_root()
1167
+
1168
+ def cmd_update_codex(_args: argparse.Namespace) -> int:
1169
+ """Update Codex support by refreshing its marketplace/cache install."""
1170
+ plugin_root = _find_codex_plugin_root()
1142
1171
  if plugin_root is not None:
1143
- _restore_publish_hooks_from_source(plugin_root)
1144
- if read_only:
1145
- _prune_publish_hooks_for_read_only(plugin_root)
1146
- sys.stdout.write(
1147
- "Installed read-only hook manifest; publish interactions hooks are disabled.\n"
1148
- )
1149
- return 0
1172
+ _run_service(plugin_root / "scripts" / "dashboard-service.sh", "stop")
1173
+ _run_service(plugin_root / "scripts" / "backend-service.sh", "stop")
1174
+ else:
1175
+ _run_service(_DASHBOARD_SCRIPT, "stop")
1176
+ _run_service(_BACKEND_SCRIPT, "stop")
1177
+ sys.stdout.write(
1178
+ "Updating claude-smart Codex support by reinstalling from this package...\n"
1179
+ )
1180
+ install_args = argparse.Namespace(**vars(_args))
1181
+ install_args.host = "codex"
1182
+ return cmd_install_codex(install_args)
1150
1183
 
1151
1184
 
1152
1185
  def cmd_uninstall(_args: argparse.Namespace) -> int:
@@ -1952,14 +1985,15 @@ def _build_parser() -> argparse.ArgumentParser:
1952
1985
  default="claude-code",
1953
1986
  help="Install target host",
1954
1987
  )
1955
- inst.add_argument(
1956
- "--source",
1957
- default=_DEFAULT_MARKETPLACE_SOURCE,
1958
- help="Marketplace ref — GitHub owner/repo, or a local directory path",
1959
- )
1960
1988
  inst.set_defaults(func=cmd_install)
1961
1989
 
1962
1990
  upd = sub.add_parser("update", help="Update claude-smart to the latest version")
1991
+ upd.add_argument(
1992
+ "--host",
1993
+ choices=("claude-code", "codex"),
1994
+ default="claude-code",
1995
+ help="Update target host",
1996
+ )
1963
1997
  upd.set_defaults(func=cmd_update)
1964
1998
 
1965
1999
  uni = sub.add_parser("uninstall", help="Remove claude-smart")
@@ -266,6 +266,7 @@ def render_inline_compact_with_registry(
266
266
  def _compact_citation_instruction(marker_parts: list[str] | None = None) -> str:
267
267
  if os.environ.get("CLAUDE_SMART_CITATIONS", "on") == "off":
268
268
  return ""
269
+ gate = cs_cite.WHEN_TO_CITE_COMPACT
269
270
  link_style = os.environ.get(_CITATION_LINK_STYLE_ENV, "markdown")
270
271
  if link_style == "osc8" and marker_parts:
271
272
  marker = f"✨ claude-smart rule applied: {' | '.join(marker_parts)}"
@@ -275,15 +276,14 @@ def _compact_citation_instruction(marker_parts: list[str] | None = None) -> str:
275
276
  else ""
276
277
  )
277
278
  return _remoteize_citation_instruction(
278
- f"If used, copy this final marker exactly, preserving its hidden "
279
- f"OSC 8 terminal link: `{marker}`.{separator_instruction} "
280
- f"Skip when unrelated."
279
+ f"{gate} If you do, copy this final marker exactly, preserving its "
280
+ f"hidden OSC 8 terminal link: `{marker}`.{separator_instruction}"
281
281
  )
282
282
  if link_style == "osc8":
283
283
  return _remoteize_citation_instruction(
284
- "If used, end with `✨ claude-smart rule applied:` followed by "
285
- "the same linked memory text; keep the link, but do not show the "
286
- "URL. Skip when unrelated."
284
+ f"{gate} If you do, end with `✨ claude-smart rule applied:` "
285
+ "followed by the same linked memory text; keep the link, but do "
286
+ "not show the URL."
287
287
  )
288
288
  if marker_parts:
289
289
  marker = f"✨ claude-smart rule applied: {' | '.join(marker_parts)}"
@@ -293,14 +293,13 @@ def _compact_citation_instruction(marker_parts: list[str] | None = None) -> str:
293
293
  else ""
294
294
  )
295
295
  return _remoteize_citation_instruction(
296
- f"If used, copy this final marker exactly with markdown links: "
297
- f"`{marker}`.{separator_instruction} Skip when unrelated."
296
+ f"{gate} If you do, copy this final marker exactly with markdown "
297
+ f"links: `{marker}`.{separator_instruction}"
298
298
  )
299
299
  return _remoteize_citation_instruction(
300
- "Only if a listed [cs:...] item materially changes your answer, end "
301
- "with one final marker like `✨ claude-smart rule applied: "
302
- "[verify process state](http://localhost:3001/rules/s1-123)` using "
303
- "the shown rule URL; skip the marker when unrelated."
300
+ f"{gate} If you do, end with one final marker like `✨ claude-smart "
301
+ "rule applied: [verify process state](http://localhost:3001/rules/"
302
+ "s1-123)` using the shown rule URL."
304
303
  )
305
304
 
306
305
 
@@ -55,9 +55,7 @@ _APPLIED_LINK_LINE_RE = re.compile(
55
55
  r"(?im)^\s*✨\s+(?:Applied|claude-smart rules? applied):\s+(?P<body>.+?)\s*$"
56
56
  )
57
57
  _MARKDOWN_LINK_RE = re.compile(r"\[[^\]]+\]\((?P<url>[^)]+)\)")
58
- _OSC8_URL_RE = re.compile(
59
- r"\x1b\]8;[^\x07\x1b]*;(?P<url>[^\x07\x1b]+)(?:\x07|\x1b\\)"
60
- )
58
+ _OSC8_URL_RE = re.compile(r"\x1b\]8;[^\x07\x1b]*;(?P<url>[^\x07\x1b]+)(?:\x07|\x1b\\)")
61
59
  _RAW_DASHBOARD_URL_RE = re.compile(
62
60
  r"(?P<url>(?:https?://[^\s),\x1b\\]+)?/"
63
61
  r"(?:skills/(?:project|shared)/[^\s),\x1b\\]+|"
@@ -65,14 +63,31 @@ _RAW_DASHBOARD_URL_RE = re.compile(
65
63
  r"rules/[^\s),\x1b\\]+))"
66
64
  )
67
65
 
68
- _COMPACT_INTRO = (
69
- "_If you use any listed `[cs:…]` item to answer and it materially changes "
70
- "your answer, you must end with one final marker line. Skip the marker "
71
- "only when no listed item affected the answer."
66
+ # The single "when to cite" decision, shared across every render path so the
67
+ # bar can't drift between markdown / OSC8 / compact-Codex variants. The
68
+ # counterfactual is the deciding test; relatedness alone is not enough.
69
+ WHEN_TO_CITE = (
70
+ "When to cite: add a marker only when a listed `[cs:…]` item materially "
71
+ "and meaningfully changed your response — it must be clearly related to "
72
+ "what you actually did, and your answer would be substantively different "
73
+ "if the item had not been shown. The counterfactual is the deciding test: "
74
+ "if your response would be essentially the same without the item, omit the "
75
+ "marker."
76
+ )
77
+
78
+ # One-line form of WHEN_TO_CITE for the compact Codex path, which renders the
79
+ # whole context block as a single logical line.
80
+ WHEN_TO_CITE_COMPACT = (
81
+ "Cite only if a listed memory materially and meaningfully changed your "
82
+ "response — counterfactual: the answer would be substantively different "
83
+ "without it; otherwise omit."
72
84
  )
73
85
 
86
+ _COMPACT_INTRO = f"_{WHEN_TO_CITE}"
87
+
74
88
  _MARKDOWN_MARKER_PARAGRAPH = (
75
- "Use human-readable linked titles, not raw ids. Format for one item: "
89
+ "How to format: use human-readable linked titles, not raw ids. "
90
+ "Format for one item: "
76
91
  "`✨ claude-smart rule applied: "
77
92
  "[verify process state](http://localhost:3001/rules/s1-123)`. "
78
93
  "For multiple items: "
@@ -102,14 +117,13 @@ _OSC8_EXAMPLE_MULTI = (
102
117
  "\x1b]8;;\x1b\\"
103
118
  )
104
119
  _OSC8_MARKER_PARAGRAPH = (
105
- "Use human-readable OSC 8 terminal hyperlinks, not raw ids or visible "
106
- "URLs. Format for one item: "
120
+ "How to format: use human-readable OSC 8 terminal hyperlinks, not raw ids "
121
+ "or visible URLs. Format for one item: "
107
122
  f"`{_OSC8_EXAMPLE_ONE}`. For multiple items: "
108
123
  f"`{_OSC8_EXAMPLE_MULTI}`. Use the dashboard URL shown beside each cited "
109
124
  "item; do not invent URLs. Separate multiple linked memories with the "
110
125
  "visible ` | ` separator. If OSC 8 is unavailable, use markdown links. "
111
- "Do not include `[cs:…]` ids in the marker line. Do not omit the marker "
112
- "after using listed memory._"
126
+ "Do not include `[cs:…]` ids in the marker line._"
113
127
  )
114
128
 
115
129
  CITATION_MODES = ("on", "auto", "marker-only", "off")
@@ -19,7 +19,7 @@ from __future__ import annotations
19
19
  import logging
20
20
  import os
21
21
  import subprocess # noqa: S404 — git invocation with a fixed flag set.
22
- from pathlib import Path
22
+ from pathlib import Path, PureWindowsPath
23
23
 
24
24
  from claude_smart import env_config
25
25
 
@@ -28,6 +28,14 @@ _LOGGER = logging.getLogger(__name__)
28
28
  _USER_ID_OVERRIDE_ENV = "REFLEXIO_USER_ID"
29
29
 
30
30
 
31
+ def _basename(path: str | os.PathLike[str]) -> str:
32
+ """Return a cwd basename, including native Windows paths under Git Bash."""
33
+ text = os.fspath(path)
34
+ if "\\" in text or (len(text) >= 2 and text[0].isalpha() and text[1] == ":"):
35
+ return PureWindowsPath(text).name or "unknown-project"
36
+ return Path(path).name or "unknown-project"
37
+
38
+
31
39
  def resolve_project_id(cwd: str | os.PathLike[str] | None = None) -> str:
32
40
  """Return a stable project identifier for the given working directory.
33
41
 
@@ -47,7 +55,7 @@ def resolve_project_id(cwd: str | os.PathLike[str] | None = None) -> str:
47
55
  base = Path(cwd) if cwd is not None else Path.cwd()
48
56
  try:
49
57
  result = subprocess.run( # noqa: S603, S607 — fixed argv, cwd is a Path.
50
- ["git", "rev-parse", "--show-toplevel"],
58
+ ["git", "rev-parse", "--show-toplevel"], # noqa: S607
51
59
  cwd=base,
52
60
  capture_output=True,
53
61
  text=True,
@@ -57,10 +65,10 @@ def resolve_project_id(cwd: str | os.PathLike[str] | None = None) -> str:
57
65
  if result.returncode == 0:
58
66
  toplevel = result.stdout.strip()
59
67
  if toplevel:
60
- return Path(toplevel).name
61
- except (FileNotFoundError, subprocess.TimeoutExpired) as exc:
68
+ return _basename(toplevel)
69
+ except (FileNotFoundError, OSError, subprocess.TimeoutExpired) as exc:
62
70
  _LOGGER.debug("git toplevel resolution failed: %s", exc)
63
- return base.name or "unknown-project"
71
+ return _basename(cwd) if cwd is not None else _basename(base)
64
72
 
65
73
 
66
74
  def resolve_user_id(cwd: str | os.PathLike[str] | None = None) -> str:
package/plugin/uv.lock CHANGED
@@ -419,7 +419,7 @@ wheels = [
419
419
 
420
420
  [[package]]
421
421
  name = "claude-smart"
422
- version = "0.2.41"
422
+ version = "0.2.43"
423
423
  source = { editable = "." }
424
424
  dependencies = [
425
425
  { name = "chromadb" },
@@ -0,0 +1,53 @@
1
+ # .env
2
+
3
+ # ====================
4
+ # LLM API Keys
5
+ # ====================
6
+ # Set at least one API key. The system auto-detects available providers and
7
+ # selects appropriate default models per role (generation, evaluation, should_run,
8
+ # pre_retrieval, embedding). Provider priority when multiple keys are set:
9
+ # Anthropic > Gemini > OpenRouter > DeepSeek > MiniMax > DashScope > xAI > Moonshot > ZAI > OpenAI
10
+ # For the embedding role, if the top-priority provider has no embedding support,
11
+ # the next embedding-capable provider is used (currently OpenAI or Gemini).
12
+ # Model resolution order (highest priority first):
13
+ # 1. Org-level LLMConfig override
14
+ # 2. Non-empty values in reflexio/server/site_var/site_var_sources/llm_model_setting.json
15
+ # 3. Auto-detected default for the primary available provider
16
+ OPENAI_API_KEY=
17
+ ANTHROPIC_API_KEY=
18
+ OPENROUTER_API_KEY=
19
+ GEMINI_API_KEY=
20
+ MINIMAX_API_KEY=
21
+ DEEPSEEK_API_KEY=
22
+ DASHSCOPE_API_KEY=
23
+ ZAI_API_KEY=
24
+ MOONSHOT_API_KEY=
25
+ XAI_API_KEY=
26
+
27
+ # ====================
28
+ # Observability (Optional)
29
+ # ====================
30
+ # Set to enable Braintrust LLM observability (https://www.braintrust.dev)
31
+ # BRAINTRUST_API_KEY=
32
+ # BRAINTRUST_PROJECT_NAME=reflexio
33
+
34
+ # ====================
35
+ # Local Storage Configuration
36
+ # ====================
37
+ # Local storage directory — houses disk-storage artifacts and the SQLite
38
+ # database file (reflexio.db). Defaults to ~/.reflexio/data/.
39
+ LOCAL_STORAGE_PATH=
40
+
41
+ # ====================
42
+ # Testing & Logging
43
+ # ====================
44
+ # Set to true to enable test environment mode
45
+ IS_TEST_ENV=true
46
+ # Set to enable debug logging to console
47
+ DEBUG_LOG_TO_CONSOLE=true
48
+ # Mock LLM call response
49
+ MOCK_LLM_RESPONSE=false
50
+ # Override the base directory for log files. The .reflexio/logs suffix is
51
+ # always preserved, so e.g. REFLEXIO_LOG_DIR=/tmp/foo writes logs to
52
+ # /tmp/foo/.reflexio/logs/. Defaults to $HOME (i.e. ~/.reflexio/logs/).
53
+ REFLEXIO_LOG_DIR=