claude-smart 0.2.44 → 0.2.46

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 (323) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/README.md +34 -5
  3. package/bin/claude-smart.js +295 -5
  4. package/package.json +22 -3
  5. package/plugin/.claude-plugin/plugin.json +4 -2
  6. package/plugin/.codex-plugin/plugin.json +1 -1
  7. package/plugin/README.md +22 -2
  8. package/plugin/commands/clear-all.md +1 -0
  9. package/plugin/commands/dashboard.md +1 -0
  10. package/plugin/commands/learn.md +1 -0
  11. package/plugin/commands/restart.md +1 -0
  12. package/plugin/commands/show.md +1 -0
  13. package/plugin/dashboard/app/configure/env/page.tsx +40 -14
  14. package/plugin/dashboard/app/configure/server/page.tsx +51 -1
  15. package/plugin/dashboard/app/preferences/[id]/page.tsx +8 -8
  16. package/plugin/dashboard/app/skills/project/[id]/page.tsx +7 -3
  17. package/plugin/dashboard/app/skills/shared/[id]/page.tsx +10 -3
  18. package/plugin/dashboard/lib/claude-settings-file.ts +20 -10
  19. package/plugin/dashboard/lib/reflexio-client.ts +16 -0
  20. package/plugin/dashboard/lib/status.ts +10 -3
  21. package/plugin/dashboard/lib/types.ts +18 -6
  22. package/plugin/hooks/codex-hooks.json +0 -1
  23. package/plugin/opencode/assistant-buffer.ts +108 -0
  24. package/plugin/opencode/dist/assistant-buffer.js +96 -0
  25. package/plugin/opencode/dist/internal.js +12 -0
  26. package/plugin/opencode/dist/payload.js +85 -0
  27. package/plugin/opencode/dist/server.mjs +158 -0
  28. package/plugin/opencode/internal.ts +18 -0
  29. package/plugin/opencode/package.json +3 -0
  30. package/plugin/opencode/payload.ts +90 -0
  31. package/plugin/opencode/server.mts +174 -0
  32. package/plugin/opencode/tsconfig.json +13 -0
  33. package/plugin/pyproject.toml +20 -3
  34. package/plugin/scripts/_lib.sh +77 -29
  35. package/plugin/scripts/backend-service.sh +27 -5
  36. package/plugin/scripts/dashboard-service.sh +7 -5
  37. package/plugin/scripts/ensure-plugin-root.sh +4 -4
  38. package/plugin/scripts/hook_entry.sh +3 -3
  39. package/plugin/scripts/opencode-claude-compat +4 -0
  40. package/plugin/scripts/opencode-claude-compat.cmd +3 -0
  41. package/plugin/scripts/opencode-claude-compat.js +225 -0
  42. package/plugin/scripts/smart-install.sh +10 -8
  43. package/plugin/src/README.md +1 -1
  44. package/plugin/src/claude_smart/cli.py +304 -6
  45. package/plugin/src/claude_smart/env_config.py +12 -4
  46. package/plugin/src/claude_smart/events/session_start.py +26 -7
  47. package/plugin/src/claude_smart/events/stop.py +1 -1
  48. package/plugin/src/claude_smart/ids.py +1 -1
  49. package/plugin/src/claude_smart/reflexio_adapter.py +5 -5
  50. package/plugin/src/claude_smart/runtime.py +7 -1
  51. package/plugin/uv.lock +1 -1
  52. package/plugin/vendor/reflexio/.env.example +54 -30
  53. package/plugin/vendor/reflexio/README.md +14 -8
  54. package/plugin/vendor/reflexio/pyproject.toml +13 -1
  55. package/plugin/vendor/reflexio/reflexio/README.md +1 -0
  56. package/plugin/vendor/reflexio/reflexio/cli/README.md +9 -7
  57. package/plugin/vendor/reflexio/reflexio/cli/__main__.py +10 -1
  58. package/plugin/vendor/reflexio/reflexio/cli/bootstrap_config.py +22 -5
  59. package/plugin/vendor/reflexio/reflexio/cli/commands/interactions.py +34 -4
  60. package/plugin/vendor/reflexio/reflexio/cli/commands/profiles.py +12 -7
  61. package/plugin/vendor/reflexio/reflexio/cli/commands/services.py +13 -6
  62. package/plugin/vendor/reflexio/reflexio/cli/commands/setup_cmd.py +210 -50
  63. package/plugin/vendor/reflexio/reflexio/cli/commands/shortcuts.py +15 -2
  64. package/plugin/vendor/reflexio/reflexio/cli/env_loader.py +292 -22
  65. package/plugin/vendor/reflexio/reflexio/cli/log_format.py +29 -4
  66. package/plugin/vendor/reflexio/reflexio/cli/run_services.py +17 -8
  67. package/plugin/vendor/reflexio/reflexio/cli/stop_services.py +13 -10
  68. package/plugin/vendor/reflexio/reflexio/client/client.py +57 -13
  69. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/README.md +135 -257
  70. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/npm/openclaw-smart/bin/openclaw-smart.js +13 -0
  71. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/npm/openclaw-smart/package.json +15 -0
  72. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/README.md +38 -0
  73. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/index.ts +151 -110
  74. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/openclaw.plugin.json +20 -10
  75. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/package.json +28 -6
  76. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/pyproject.toml +42 -0
  77. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/_lib.sh +371 -0
  78. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/backend-log-runner.sh +33 -0
  79. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/backend-service.sh +271 -0
  80. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/cli.sh +68 -0
  81. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/dashboard-open.sh +15 -0
  82. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/ensure-plugin-root.sh +84 -0
  83. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/hook_entry.sh +106 -0
  84. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/npm-cli.js +219 -0
  85. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/smart-install.sh +269 -0
  86. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/clear-all/SKILL.md +8 -0
  87. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/dashboard/SKILL.md +8 -0
  88. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/learn/SKILL.md +10 -0
  89. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/reflexio/SKILL.md +15 -44
  90. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/restart/SKILL.md +6 -0
  91. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/show/SKILL.md +8 -0
  92. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/cli.py +634 -0
  93. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/context_format.py +224 -0
  94. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/context_inject.py +79 -0
  95. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/__init__.py +0 -0
  96. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/after_tool_call.py +160 -0
  97. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/agent_end.py +187 -0
  98. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/before_prompt_build.py +69 -0
  99. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/before_tool_call.py +30 -0
  100. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/session_end.py +36 -0
  101. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/session_start.py +130 -0
  102. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/hook.py +131 -0
  103. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/ids.py +94 -0
  104. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/internal_call.py +75 -0
  105. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/oc_cite.py +196 -0
  106. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/optimizer_assistant.py +272 -0
  107. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/publish.py +96 -0
  108. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/query_compose.py +66 -0
  109. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/reflexio_adapter.py +336 -0
  110. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/runtime.py +47 -0
  111. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/stall_banner.py +61 -0
  112. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/state.py +323 -0
  113. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/__init__.py +0 -0
  114. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/__init__.py +0 -0
  115. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/test_e2e_session_loop.py +190 -0
  116. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/test_publish_to_local_reflexio_integration.py +112 -0
  117. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/test_recursion_guard_integration.py +86 -0
  118. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/test_search_inject_integration.py +144 -0
  119. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_cli.py +184 -0
  120. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_after_tool_call.py +142 -0
  121. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_agent_end.py +233 -0
  122. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_before_prompt_build.py +116 -0
  123. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_before_tool_call.py +35 -0
  124. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_session_end.py +47 -0
  125. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_session_start.py +109 -0
  126. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_hook_dispatch.py +117 -0
  127. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_ids.py +41 -0
  128. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_internal_call.py +50 -0
  129. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_oc_cite.py +88 -0
  130. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_publish.py +48 -0
  131. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_query_compose.py +48 -0
  132. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_reflexio_adapter.py +188 -0
  133. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_runtime.py +41 -0
  134. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_state.py +235 -0
  135. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests-ts/__mocks__/plugin-entry-stub.ts +6 -0
  136. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests-ts/test_npm_cli.test.ts +56 -0
  137. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests-ts/test_shim_dispatch.test.ts +171 -0
  138. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tsconfig.build.json +18 -0
  139. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/{tsconfig.json → plugin/tsconfig.json} +2 -2
  140. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/uv.lock +3835 -0
  141. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/vitest.config.ts +18 -0
  142. package/plugin/vendor/reflexio/reflexio/lib/_agent_playbook.py +238 -10
  143. package/plugin/vendor/reflexio/reflexio/lib/_config.py +11 -4
  144. package/plugin/vendor/reflexio/reflexio/lib/_generation.py +16 -5
  145. package/plugin/vendor/reflexio/reflexio/lib/_lineage_parity_readers.py +187 -0
  146. package/plugin/vendor/reflexio/reflexio/lib/_profiles.py +198 -6
  147. package/plugin/vendor/reflexio/reflexio/lib/_reflection.py +1 -1
  148. package/plugin/vendor/reflexio/reflexio/lib/_search.py +29 -20
  149. package/plugin/vendor/reflexio/reflexio/lib/_user_playbook.py +2 -1
  150. package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/entities.py +127 -38
  151. package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/enums.py +4 -0
  152. package/plugin/vendor/reflexio/reflexio/models/api_schema/eval_overview_schema.py +64 -41
  153. package/plugin/vendor/reflexio/reflexio/models/api_schema/internal_schema.py +19 -0
  154. package/plugin/vendor/reflexio/reflexio/models/api_schema/pending_tool_call_schema.py +12 -5
  155. package/plugin/vendor/reflexio/reflexio/models/api_schema/retriever_schema.py +52 -0
  156. package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/converters.py +5 -1
  157. package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/entities.py +5 -1
  158. package/plugin/vendor/reflexio/reflexio/models/config_schema.py +88 -7
  159. package/plugin/vendor/reflexio/reflexio/models/structured_output.py +148 -0
  160. package/plugin/vendor/reflexio/reflexio/server/OVERVIEW.md +3 -3
  161. package/plugin/vendor/reflexio/reflexio/server/README.md +45 -32
  162. package/plugin/vendor/reflexio/reflexio/server/__init__.py +29 -5
  163. package/plugin/vendor/reflexio/reflexio/server/__main__.py +2 -2
  164. package/plugin/vendor/reflexio/reflexio/server/_auth.py +65 -2
  165. package/plugin/vendor/reflexio/reflexio/server/api.py +734 -85
  166. package/plugin/vendor/reflexio/reflexio/server/api_endpoints/precondition_checks.py +7 -0
  167. package/plugin/vendor/reflexio/reflexio/server/api_endpoints/request_context.py +3 -1
  168. package/plugin/vendor/reflexio/reflexio/server/billing_meter.py +173 -0
  169. package/plugin/vendor/reflexio/reflexio/server/billing_signals.py +64 -0
  170. package/plugin/vendor/reflexio/reflexio/server/cache/reflexio_cache.py +46 -16
  171. package/plugin/vendor/reflexio/reflexio/server/env_utils.py +65 -0
  172. package/plugin/vendor/reflexio/reflexio/server/llm/embedding_service.py +19 -4
  173. package/plugin/vendor/reflexio/reflexio/server/llm/litellm_client.py +264 -77
  174. package/plugin/vendor/reflexio/reflexio/server/llm/llm_utils.py +69 -7
  175. package/plugin/vendor/reflexio/reflexio/server/llm/providers/embedding_service_provider.py +75 -16
  176. package/plugin/vendor/reflexio/reflexio/server/llm/providers/openclaw_provider.py +280 -0
  177. package/plugin/vendor/reflexio/reflexio/server/llm/token_accounting.py +48 -0
  178. package/plugin/vendor/reflexio/reflexio/server/llm/tools.py +107 -17
  179. package/plugin/vendor/reflexio/reflexio/server/operation_limiter.py +360 -4
  180. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.6.0.prompt.md +1 -1
  181. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.7.0.prompt.md +85 -0
  182. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_aggregation/v2.2.0.prompt.md +1 -1
  183. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_aggregation/v2.3.0.prompt.md +253 -0
  184. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.3.2.prompt.md +1 -1
  185. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.3.3.prompt.md +74 -0
  186. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.2.3.prompt.md +1 -1
  187. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.3.0.prompt.md +266 -0
  188. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.4.0.prompt.md +266 -0
  189. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.3.0.prompt.md +1 -1
  190. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.4.0.prompt.md +137 -0
  191. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.2.0.prompt.md +1 -1
  192. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.3.0.prompt.md +34 -0
  193. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.0.0.prompt.md +5 -12
  194. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.1.0.prompt.md +5 -12
  195. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.2.0.prompt.md +155 -0
  196. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/tagging/v1.0.0.prompt.md +23 -0
  197. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_manager.py +89 -32
  198. package/plugin/vendor/reflexio/reflexio/server/services/README.md +26 -11
  199. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/README.md +22 -0
  200. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/__init__.py +1 -0
  201. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_constants.py +4 -2
  202. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_utils.py +1 -0
  203. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/components/__init__.py +7 -0
  204. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/{agent_success_evaluator.py → components/evaluator.py} +3 -16
  205. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/regen_jobs.py +28 -72
  206. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/{group_evaluation_runner.py → runner.py} +12 -10
  207. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/{delayed_group_evaluator.py → scheduler.py} +10 -2
  208. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/{agent_success_evaluation_service.py → service.py} +36 -1
  209. package/plugin/vendor/reflexio/reflexio/server/services/base_generation_service.py +160 -0
  210. package/plugin/vendor/reflexio/reflexio/server/services/configurator/base_configurator.py +5 -0
  211. package/plugin/vendor/reflexio/reflexio/server/services/deduplication_utils.py +1 -1
  212. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/README.md +9 -0
  213. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/components/__init__.py +0 -0
  214. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/{rule_attribution.py → components/rule_attribution.py} +10 -9
  215. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/eval_sampler.py +15 -24
  216. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/service.py +238 -164
  217. package/plugin/vendor/reflexio/reflexio/server/services/extraction/README.md +31 -0
  218. package/plugin/vendor/reflexio/reflexio/server/services/extraction/outcome.py +13 -3
  219. package/plugin/vendor/reflexio/reflexio/server/services/extraction/pending_tool_call_dispatch.py +3 -2
  220. package/plugin/vendor/reflexio/reflexio/server/services/extraction/resumable_agent.py +32 -118
  221. package/plugin/vendor/reflexio/reflexio/server/services/extraction/resume_worker.py +39 -16
  222. package/plugin/vendor/reflexio/reflexio/server/services/generation_service.py +105 -23
  223. package/plugin/vendor/reflexio/reflexio/server/services/lineage/__init__.py +0 -0
  224. package/plugin/vendor/reflexio/reflexio/server/services/lineage/gc_scheduler.py +193 -0
  225. package/plugin/vendor/reflexio/reflexio/server/services/lineage/resolve.py +98 -0
  226. package/plugin/vendor/reflexio/reflexio/server/services/operation_state_utils.py +26 -0
  227. package/plugin/vendor/reflexio/reflexio/server/services/playbook/README.md +11 -12
  228. package/plugin/vendor/reflexio/reflexio/server/services/playbook/components/__init__.py +5 -0
  229. package/plugin/vendor/reflexio/reflexio/server/services/playbook/{playbook_aggregator.py → components/aggregator.py} +316 -178
  230. package/plugin/vendor/reflexio/reflexio/server/services/playbook/{playbook_consolidator.py → components/consolidator.py} +168 -62
  231. package/plugin/vendor/reflexio/reflexio/server/services/playbook/{playbook_extractor.py → components/extractor.py} +5 -1
  232. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_edit_apply.py +74 -0
  233. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_service_utils.py +33 -3
  234. package/plugin/vendor/reflexio/reflexio/server/services/playbook/{playbook_generation_service.py → service.py} +121 -19
  235. package/plugin/vendor/reflexio/reflexio/server/services/playbook/user_detail_stripping.py +84 -0
  236. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/README.md +10 -0
  237. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/models.py +2 -1
  238. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/optimizer.py +178 -30
  239. package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/README.md +9 -0
  240. package/plugin/vendor/reflexio/reflexio/server/services/profile/components/__init__.py +17 -0
  241. package/plugin/vendor/reflexio/reflexio/server/services/profile/{profile_deduplicator.py → components/consolidator.py} +7 -6
  242. package/plugin/vendor/reflexio/reflexio/server/services/profile/{profile_extractor.py → components/extractor.py} +30 -22
  243. package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_generation_service_utils.py +6 -13
  244. package/plugin/vendor/reflexio/reflexio/server/services/profile/{profile_generation_service.py → service.py} +32 -50
  245. package/plugin/vendor/reflexio/reflexio/server/services/reflection/__init__.py +4 -8
  246. package/plugin/vendor/reflexio/reflexio/server/services/reflection/components/__init__.py +7 -0
  247. package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_service_utils.py +12 -1
  248. package/plugin/vendor/reflexio/reflexio/server/services/reflection/{reflection_service.py → service.py} +36 -16
  249. package/plugin/vendor/reflexio/reflexio/server/services/retrieval/relevance_floor.py +83 -6
  250. package/plugin/vendor/reflexio/reflexio/server/services/service_utils.py +36 -1
  251. package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/README.md +8 -0
  252. package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/outcome.py +1 -2
  253. package/plugin/vendor/reflexio/reflexio/server/services/storage/error.py +27 -0
  254. package/plugin/vendor/reflexio/reflexio/server/services/storage/retention.py +9 -9
  255. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/__init__.py +2 -0
  256. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_agent_run.py +4 -1
  257. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_base.py +642 -197
  258. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_extras.py +61 -104
  259. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_lineage.py +628 -0
  260. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_operations.py +38 -6
  261. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_playbook.py +978 -184
  262. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_profiles.py +519 -128
  263. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_requests.py +77 -3
  264. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_shadow_verdicts.py +23 -9
  265. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_stall_state.py +5 -2
  266. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/__init__.py +131 -20
  267. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_agent_run.py +2 -8
  268. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_base.py +5 -0
  269. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_extras.py +36 -53
  270. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_lineage.py +215 -0
  271. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_operations.py +20 -0
  272. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_playbook.py +243 -7
  273. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_profiles.py +121 -1
  274. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_requests.py +60 -0
  275. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_retrieval_log.py +51 -0
  276. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_shadow_verdicts.py +17 -0
  277. package/plugin/vendor/reflexio/reflexio/server/services/tagging/README.md +8 -0
  278. package/plugin/vendor/reflexio/reflexio/server/services/tagging/__init__.py +1 -0
  279. package/plugin/vendor/reflexio/reflexio/server/services/tagging/service.py +200 -0
  280. package/plugin/vendor/reflexio/reflexio/server/services/tagging/tagging_scheduler.py +149 -0
  281. package/plugin/vendor/reflexio/reflexio/server/services/unified_search_service.py +229 -32
  282. package/plugin/vendor/reflexio/reflexio/server/site_var/README.md +2 -1
  283. package/plugin/vendor/reflexio/reflexio/server/site_var/feature_flags.py +120 -1
  284. package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/feature_flags.json +4 -0
  285. package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/search_settings.json +5 -0
  286. package/plugin/vendor/reflexio/reflexio/server/tracing.py +30 -0
  287. package/plugin/vendor/reflexio/reflexio/server/usage_metrics.py +18 -0
  288. package/plugin/vendor/reflexio/reflexio/test_support/llm_mock.py +61 -26
  289. package/plugin/vendor/reflexio/reflexio/test_support/llm_model_registry.py +41 -4
  290. package/scripts/setup-claude-smart.sh +8 -3
  291. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/TESTING.md +0 -517
  292. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/hook/handler.js +0 -473
  293. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package-lock.json +0 -2156
  294. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package.json +0 -18
  295. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/handler.ts +0 -241
  296. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/setup.ts +0 -140
  297. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/publish.ts +0 -113
  298. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/search.ts +0 -52
  299. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/server.ts +0 -103
  300. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/sqlite-buffer.ts +0 -156
  301. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/user-id.ts +0 -134
  302. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/rules/reflexio.md +0 -24
  303. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/publish_clawhub.sh +0 -278
  304. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/references/HOOK.md +0 -164
  305. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/install.sh +0 -36
  306. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/uninstall.sh +0 -35
  307. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/publish.test.ts +0 -27
  308. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/search.test.ts +0 -31
  309. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/server.test.ts +0 -42
  310. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/setup.test.ts +0 -49
  311. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/sqlite-buffer.test.ts +0 -91
  312. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/user-id.test.ts +0 -50
  313. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/vitest.config.ts +0 -13
  314. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/group_aggregation.py +0 -192
  315. package/plugin/vendor/reflexio/reflexio/server/services/extraction/invariants.py +0 -303
  316. package/plugin/vendor/reflexio/reflexio/server/services/extraction/plan.py +0 -138
  317. package/plugin/vendor/reflexio/reflexio/server/services/extraction/tools.py +0 -1125
  318. /package/plugin/vendor/reflexio/reflexio/integrations/{__init__.py → openclaw/plugin/src/openclaw_smart/__init__.py} +0 -0
  319. /package/plugin/vendor/reflexio/reflexio/integrations/openclaw/{types → plugin/types}/openclaw.d.ts +0 -0
  320. /package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/{distribution.py → components/distribution.py} +0 -0
  321. /package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/{hero_state.py → components/hero_state.py} +0 -0
  322. /package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/{shadow_aggregation.py → components/shadow_aggregation.py} +0 -0
  323. /package/plugin/vendor/reflexio/reflexio/server/services/reflection/{reflection_extractor.py → components/extractor.py} +0 -0
@@ -0,0 +1,269 @@
1
+ #!/usr/bin/env bash
2
+ # Run once on plugin install. Syncs the Python env and flips on the
3
+ # openclaw LiteLLM provider in reflexio's .env so extraction works with no
4
+ # external API key.
5
+ #
6
+ # On failure, writes the reason to ~/.openclaw-smart/install-failed so
7
+ # hook_entry.sh can short-circuit and surface a user-visible message
8
+ # instead of silently no-op'ing every session.
9
+ #
10
+ # Dashboard: openclaw-smart shares claude-smart's dashboard at
11
+ # http://localhost:3001. We do not build a dashboard here.
12
+ set -eu
13
+
14
+ HERE="$(cd "$(dirname "$0")" && pwd)"
15
+ # shellcheck source=_lib.sh
16
+ . "$HERE/_lib.sh"
17
+ openclaw_smart_source_login_path
18
+ openclaw_smart_prepend_astral_bins
19
+
20
+ PLUGIN_ROOT="$(cd "$HERE/.." && pwd)"
21
+
22
+ MARKER_DIR="$HOME/.openclaw-smart"
23
+ FAILURE_MARKER="$MARKER_DIR/install-failed"
24
+ SUCCESS_MARKER="$MARKER_DIR/install-complete"
25
+ INSTALL_LOCK="$MARKER_DIR/install.lock"
26
+ INSTALL_REAP_LOCK="$MARKER_DIR/install.lock.reap"
27
+ mkdir -p "$MARKER_DIR"
28
+
29
+ remove_stale_install_lock() {
30
+ local expected current
31
+
32
+ expected="$1"
33
+ if ! mkdir "$INSTALL_REAP_LOCK" 2>/dev/null; then
34
+ sleep 1
35
+ return 0
36
+ fi
37
+ current="$(cat "$INSTALL_LOCK" 2>/dev/null || true)"
38
+ if [ "$current" = "$expected" ]; then
39
+ rm -f "$INSTALL_LOCK"
40
+ fi
41
+ rmdir "$INSTALL_REAP_LOCK" 2>/dev/null || true
42
+ }
43
+
44
+ acquire_install_lock() {
45
+ local lock_pid
46
+
47
+ if command -v flock >/dev/null 2>&1; then
48
+ exec 9>"$INSTALL_LOCK"
49
+ if flock 9; then
50
+ return 0
51
+ fi
52
+ # flock unexpectedly failed (rare; usually a malformed lockfile fd
53
+ # rather than a busy lock). Fall through to the portable lockfile
54
+ # path below instead of bailing out — the installer must still run.
55
+ echo "[openclaw-smart] flock failed; falling back to lockfile serialization" >&2
56
+ fi
57
+
58
+ while ! ( set -C; printf '%s\n' "$$" > "$INSTALL_LOCK" ) 2>/dev/null; do
59
+ lock_pid="$(cat "$INSTALL_LOCK" 2>/dev/null || true)"
60
+ case "$lock_pid" in
61
+ ''|*[!0-9]*)
62
+ remove_stale_install_lock "$lock_pid"
63
+ ;;
64
+ *)
65
+ if kill -0 "$lock_pid" 2>/dev/null; then
66
+ sleep 1
67
+ else
68
+ remove_stale_install_lock "$lock_pid"
69
+ fi
70
+ ;;
71
+ esac
72
+ done
73
+ trap '[ "$(cat "$INSTALL_LOCK" 2>/dev/null || true)" = "$$" ] && rm -f "$INSTALL_LOCK" || true' EXIT
74
+ }
75
+
76
+ # Serialize concurrent installer runs (SessionStart hook + slash-command
77
+ # self-heal can both invoke this script). Wait for the active installer
78
+ # rather than returning early, otherwise callers can re-check uv before
79
+ # the first install has finished and report a false missing-dependency error.
80
+ acquire_install_lock
81
+
82
+ rm -f "$FAILURE_MARKER"
83
+
84
+ write_failure() {
85
+ local reason
86
+ reason="$1"
87
+ printf '%s\n' "$reason" > "$FAILURE_MARKER"
88
+ rm -f "$SUCCESS_MARKER"
89
+ echo "[openclaw-smart] install failed: $reason" >&2
90
+ echo ''
91
+ exit 0
92
+ }
93
+
94
+ fingerprint_file() {
95
+ local path
96
+ path="$1"
97
+ if [ -f "$path" ]; then
98
+ cksum "$path" 2>/dev/null | awk '{print $1 ":" $2}'
99
+ else
100
+ printf 'missing\n'
101
+ fi
102
+ }
103
+
104
+ install_fingerprint() {
105
+ printf 'plugin_root=%s\n' "$PLUGIN_ROOT"
106
+ printf 'smart_install=%s\n' "$(fingerprint_file "$HERE/smart-install.sh")"
107
+ printf 'pyproject=%s\n' "$(fingerprint_file "$PLUGIN_ROOT/pyproject.toml")"
108
+ printf 'uv_lock=%s\n' "$(fingerprint_file "$PLUGIN_ROOT/uv.lock")"
109
+ # Resolved python interpreter — catches a system upgrade (3.12.4 → 3.12.5)
110
+ # that would otherwise let install_complete return true against a venv
111
+ # built against a now-deleted interpreter.
112
+ if command -v uv >/dev/null 2>&1; then
113
+ printf 'python=%s\n' "$(uv python find 3.12 2>/dev/null || echo missing)"
114
+ else
115
+ printf 'python=no-uv\n'
116
+ fi
117
+ }
118
+
119
+ install_complete() {
120
+ [ -f "$SUCCESS_MARKER" ] || return 1
121
+ [ "$(cat "$SUCCESS_MARKER" 2>/dev/null || true)" = "$(install_fingerprint)" ] || return 1
122
+ command -v uv >/dev/null 2>&1 || return 1
123
+ [ -d "$PLUGIN_ROOT/.venv" ] || return 1
124
+ [ -f "$HOME/.reflexio/.env" ] || return 1
125
+ grep -q '^OPENCLAW_SMART_USE_LOCAL_CLI=' "$HOME/.reflexio/.env" || return 1
126
+ grep -q '^OPENCLAW_SMART_USE_LOCAL_EMBEDDING=' "$HOME/.reflexio/.env" || return 1
127
+ return 0
128
+ }
129
+
130
+ write_success_marker() {
131
+ install_fingerprint > "$SUCCESS_MARKER"
132
+ }
133
+
134
+ preflight_supported_runtime_platform() {
135
+ local os_name machine darwin_major
136
+ os_name="$(uname -s 2>/dev/null || echo unknown)"
137
+ machine="$(uname -m 2>/dev/null || echo unknown)"
138
+ case "$os_name" in
139
+ Darwin*)
140
+ if [ "$machine" != "arm64" ]; then
141
+ write_failure "openclaw-smart currently supports Apple Silicon macOS 14+ only; Intel Mac is not supported because native ML wheels are unavailable."
142
+ fi
143
+ darwin_major="$(uname -r 2>/dev/null | awk -F. '{print $1}')"
144
+ case "$darwin_major" in
145
+ ''|*[!0-9]*)
146
+ write_failure "openclaw-smart could not determine the macOS version; Apple Silicon macOS 14+ is required."
147
+ ;;
148
+ esac
149
+ if [ "$darwin_major" -lt 23 ]; then
150
+ write_failure "openclaw-smart currently supports macOS 14+ on Apple Silicon; macOS 13 and older are not supported because native ML wheels are unavailable."
151
+ fi
152
+ ;;
153
+ MINGW*|MSYS*|CYGWIN*)
154
+ case "$machine" in
155
+ x86_64|amd64) : ;;
156
+ *)
157
+ write_failure "openclaw-smart currently supports Windows x64 only; Windows ARM is not supported because native ML wheels are unavailable."
158
+ ;;
159
+ esac
160
+ ;;
161
+ Linux*)
162
+ : # Existing Linux installs remain supported when package wheels are available.
163
+ ;;
164
+ *)
165
+ write_failure "openclaw-smart currently supports Apple Silicon macOS 14+, Windows x64, and Linux for vanilla installs."
166
+ ;;
167
+ esac
168
+ }
169
+
170
+ preflight_supported_runtime_platform
171
+
172
+ if install_complete; then
173
+ echo ''
174
+ exit 0
175
+ fi
176
+
177
+ if ! command -v uv >/dev/null 2>&1; then
178
+ echo "[openclaw-smart] uv not found — installing from astral.sh..." >&2
179
+ # The astral.sh bash installer downloads a zip and unzips it. On
180
+ # Windows-flavoured bash (Git Bash / MSYS) the bundled `unzip` corrupts
181
+ # the Windows uv binary (bad CRC on the inflated uv.exe), leaving the
182
+ # install half-finished. Use the official PowerShell installer
183
+ # (install.ps1) on Windows, which writes uv.exe to ~/.local/bin
184
+ # natively — same destination the bash installer targets on POSIX, so
185
+ # openclaw_smart_prepend_astral_bins picks it up uniformly afterwards.
186
+ if openclaw_smart_is_windows; then
187
+ if ! command -v powershell >/dev/null 2>&1; then
188
+ write_failure "uv install needs PowerShell on Windows but powershell is not on PATH — install uv manually from https://docs.astral.sh/uv/"
189
+ fi
190
+ if ! powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://astral.sh/uv/install.ps1 | iex" >&2; then
191
+ write_failure "uv install via PowerShell failed — install manually from https://docs.astral.sh/uv/"
192
+ fi
193
+ else
194
+ UV_INSTALLER="$MARKER_DIR/uv-install.sh"
195
+ if ! openclaw_smart_download https://astral.sh/uv/install.sh "$UV_INSTALLER"; then
196
+ write_failure "uv installer download failed — install manually from https://docs.astral.sh/uv/"
197
+ fi
198
+ if ! sh "$UV_INSTALLER" >&2; then
199
+ write_failure "uv install failed — install manually from https://docs.astral.sh/uv/"
200
+ fi
201
+ fi
202
+ openclaw_smart_prepend_astral_bins
203
+ if ! command -v uv >/dev/null 2>&1; then
204
+ UV_FOUND=""
205
+ for candidate in "$HOME/.local/bin/uv" "$HOME/.local/bin/uv.exe" "$HOME/.cargo/bin/uv" "$HOME/bin/uv"; do
206
+ if [ -x "$candidate" ]; then
207
+ UV_FOUND="$candidate"
208
+ break
209
+ fi
210
+ done
211
+ if [ -n "$UV_FOUND" ]; then
212
+ write_failure "uv installed at $UV_FOUND — add its parent directory to PATH in your shell rc"
213
+ else
214
+ write_failure "uv install reported success but binary not found — install manually from https://docs.astral.sh/uv/"
215
+ fi
216
+ fi
217
+ fi
218
+
219
+ cd "$PLUGIN_ROOT"
220
+ echo "[openclaw-smart] running uv sync..." >&2
221
+ if ! uv sync --locked --python 3.12 --quiet >&2; then
222
+ write_failure "uv sync failed in $PLUGIN_ROOT — run 'uv sync --locked --python 3.12' there to diagnose"
223
+ fi
224
+
225
+ # Compile the TS shim to ./dist/index.js. openClaw 2026.5.12+ requires
226
+ # compiled JS at the path declared in package.json's openclaw.extensions.
227
+ # Source checkouts ship dist/ via the publisher; in dev mode (or when a
228
+ # user installs from a fresh git clone) we (re)build here so the loader
229
+ # can find ./dist/index.js. Skip silently when npm or the script is
230
+ # missing; the dashboard/install banner will surface the resulting load
231
+ # failure to the user.
232
+ if [ ! -f "$PLUGIN_ROOT/dist/index.js" ] && command -v npm >/dev/null 2>&1; then
233
+ if [ -f "$PLUGIN_ROOT/package.json" ]; then
234
+ echo "[openclaw-smart] compiling TS shim to dist/..." >&2
235
+ (cd "$PLUGIN_ROOT" && npm install --silent && npm run build --silent) >&2 || \
236
+ echo "[openclaw-smart] WARNING: npm install / build failed; openClaw may refuse to load the plugin" >&2
237
+ fi
238
+ fi
239
+
240
+ # Reflexio's CLI reads ~/.reflexio/.env (see reflexio/cli/env_loader.py);
241
+ # append our two opt-in flags there so `reflexio services start` picks
242
+ # them up regardless of which directory the user runs it from. Keep
243
+ # claude-smart's flags intact if it is also installed.
244
+ REFLEXIO_ENV="$HOME/.reflexio/.env"
245
+ mkdir -p "$(dirname "$REFLEXIO_ENV")"
246
+ touch "$REFLEXIO_ENV"
247
+ if ! grep -q '^OPENCLAW_SMART_USE_LOCAL_CLI=' "$REFLEXIO_ENV"; then
248
+ printf '\n# Route reflexio generation through the local openClaw CLI\nOPENCLAW_SMART_USE_LOCAL_CLI=1\n' >> "$REFLEXIO_ENV"
249
+ echo "[openclaw-smart] appended OPENCLAW_SMART_USE_LOCAL_CLI=1 to $REFLEXIO_ENV" >&2
250
+ fi
251
+ if ! grep -q '^OPENCLAW_SMART_USE_LOCAL_EMBEDDING=' "$REFLEXIO_ENV"; then
252
+ printf '# Use the in-process ONNX embedder (chromadb) — no API key for semantic search\nOPENCLAW_SMART_USE_LOCAL_EMBEDDING=1\n' >> "$REFLEXIO_ENV"
253
+ echo "[openclaw-smart] appended OPENCLAW_SMART_USE_LOCAL_EMBEDDING=1 to $REFLEXIO_ENV" >&2
254
+ fi
255
+
256
+ if ! command -v openclaw >/dev/null 2>&1; then
257
+ echo "[openclaw-smart] WARNING: 'openclaw' CLI not on PATH — reflexio extractors will have no LLM until it's installed" >&2
258
+ fi
259
+
260
+ # Point ~/.reflexio/openclaw-plugin-root at this install so slash commands
261
+ # can reference one stable short path regardless of which openClaw
262
+ # marketplace loaded us.
263
+ if ! bash "$HERE/ensure-plugin-root.sh" "$PLUGIN_ROOT"; then
264
+ echo "[openclaw-smart] WARNING: failed to set ~/.reflexio/openclaw-plugin-root symlink — slash commands may not resolve" >&2
265
+ fi
266
+
267
+ write_success_marker
268
+ echo "[openclaw-smart] install complete. Backend auto-starts on session start." >&2
269
+ echo ''
@@ -0,0 +1,8 @@
1
+ # clear-all
2
+
3
+ **When to use:** The user explicitly asks to delete all locally-stored skills/preferences. This is destructive and unrecoverable.
4
+
5
+ ## What to do
6
+ First confirm with the user: "This will delete ALL locally-learned skills and preferences. Are you sure?" If they confirm with yes/y, run:
7
+
8
+ `bash "$OPENCLAW_PLUGIN_ROOT/scripts/cli.sh" clear-all --yes`
@@ -0,0 +1,8 @@
1
+ # dashboard
2
+
3
+ **When to use:** The user wants to open the reflexio web UI to manage skills/preferences.
4
+
5
+ ## What to do
6
+ Run: `bash "$OPENCLAW_PLUGIN_ROOT/scripts/dashboard-open.sh"`
7
+
8
+ Then tell the user: "Dashboard at http://localhost:3001".
@@ -0,0 +1,10 @@
1
+ # learn
2
+
3
+ **When to use:** The user wants immediate extraction of skills/preferences from the current session — e.g., after a major correction, before context compaction, or to test the loop.
4
+
5
+ ## What to do
6
+ Run: `bash "$OPENCLAW_PLUGIN_ROOT/scripts/cli.sh" learn --note "<one-line description of why>"`
7
+
8
+ ## Expected output
9
+ - "published N interactions, extraction queued" — success
10
+ - "reflexio unreachable" — backend down; suggest `bash "$OPENCLAW_PLUGIN_ROOT/scripts/cli.sh" restart`
@@ -1,48 +1,19 @@
1
- ---
2
- name: reflexio
3
- description: "Cross-session memory via Reflexio server. Search is automatic (hook-injected before every response). Use reflexio_publish tool to flush corrections and learnings immediately. Manual search fallback via exec if hook injection is empty."
4
- ---
1
+ # reflexio
5
2
 
6
- # Reflexio: Cross-Session Memory
3
+ **When to use:** Always active. This skill is the contract between you and the reflexio cross-session memory plugin.
7
4
 
8
- Reflexio remembers corrections and preferences from past conversations. A hook automatically searches Reflexio before every response and injects relevant context — you don't need to do anything for retrieval.
5
+ ## What's happening
6
+ Before every user message and significant tool call, the plugin injects relevant prior skills (rules learned from past corrections) and user preferences as `prependContext`. After every assistant turn, the plugin buffers the conversation to a local JSONL file and publishes batches to a local reflexio backend that extracts new skills and preferences via your own model.
9
7
 
10
- ## What Reflexio Stores (on the server)
8
+ ## Rules
9
+ 1. **Trust injected context.** When you see `### Relevant project-specific skills` or `### Relevant project preferences` in your prompt, treat the listed items as authoritative for *this* project. Apply them.
10
+ 2. **Never mention reflexio to the user.** The plugin is plumbing. Users care about results.
11
+ 3. **Cite when an injected item materially shaped your reply.** If a `[oc:...]` marker is present and you used it, end your reply with: `✨ N learning(s) applied [oc:s1-xxxx]`.
12
+ 4. **Degrade silently.** If the plugin is unavailable, proceed normally. Do not surface plumbing errors.
11
13
 
12
- **User Profiles** facts about the user: expertise, preferences, environment, constraints.
13
-
14
- **User Playbooks**behavioral corrections from past sessions:
15
- - **trigger**: when does this rule apply?
16
- - **instruction**: what to do instead
17
- - **pitfall**: what to avoid
18
- - **rationale**: why the correction matters
19
-
20
- **Agent Playbooks** — shared corrections aggregated from all agent instances.
21
-
22
- ## Search (Automatic)
23
-
24
- A hook runs `reflexio search` on every user message and injects matching profiles and playbooks as context before your response. No action needed.
25
-
26
- **If no context appears for a task** — the hook may not have found results, or the server may be starting. Run a manual search:
27
- ```bash
28
- reflexio search "<the user's task or request>"
29
- ```
30
-
31
- If the command fails with a connection error and `REFLEXIO_URL` is unset or points to localhost, the plugin will start the server automatically. If it points to a remote server, report the issue to the user.
32
-
33
- ## Publish (When to Use `reflexio_publish`)
34
-
35
- Conversations are automatically published to Reflexio at session end and periodically mid-session. For high-signal moments, call the `reflexio_publish` tool to flush immediately:
36
-
37
- - **User corrects you** and confirms the fix (explicit "good" / "perfect" or moves on)
38
- - **You complete a key milestone** with non-obvious learnings
39
- - **High-friction session** with multiple corrections
40
-
41
- The Reflexio server handles extraction (profiles, playbooks) from the published conversations. You don't need to structure the data — just publish, and the server does the rest.
42
-
43
- ## Infrastructure
44
-
45
- - The plugin checks and starts the Reflexio server automatically
46
- - **Never ask the user** to start, stop, or manage the server
47
- - **Never mention Reflexio** to the user unless they ask
48
- - If Reflexio is unavailable, proceed normally — it enhances but never blocks
14
+ ## Skill commands (invokable by the user)
15
+ - "use the learn skill" — force-publish the current session for immediate extraction
16
+ - "use the show skill" print currently-known skills and preferences for this project
17
+ - "use the dashboard skill" open the local web UI
18
+ - "use the restart skill" — restart the local reflexio backend
19
+ - "use the clear-all skill" — delete all locally-stored skills (destructive)
@@ -0,0 +1,6 @@
1
+ # restart
2
+
3
+ **When to use:** The user is hitting "reflexio unreachable" errors or wants to restart the local backend cleanly.
4
+
5
+ ## What to do
6
+ Run: `bash "$OPENCLAW_PLUGIN_ROOT/scripts/cli.sh" restart`
@@ -0,0 +1,8 @@
1
+ # show
2
+
3
+ **When to use:** The user wants to see what reflexio currently knows about this project.
4
+
5
+ ## What to do
6
+ Run: `bash "$OPENCLAW_PLUGIN_ROOT/scripts/cli.sh" show`
7
+
8
+ Output is markdown listing user playbooks (project skills), agent playbooks (shared skills), and profiles (user preferences). Render it as-is in your reply.