claude-smart 0.2.42 → 0.2.44

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 (402) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/README.md +1 -1
  3. package/bin/claude-smart.js +2 -2
  4. package/package.json +9 -3
  5. package/plugin/.claude-plugin/plugin.json +9 -3
  6. package/plugin/.codex-plugin/plugin.json +1 -1
  7. package/plugin/README.md +23 -3
  8. package/plugin/pyproject.toml +3 -3
  9. package/plugin/scripts/_lib.sh +91 -0
  10. package/plugin/scripts/backend-service.sh +51 -4
  11. package/plugin/scripts/cli.sh +3 -1
  12. package/plugin/scripts/codex-hook.js +72 -4
  13. package/plugin/scripts/dashboard-build.sh +1 -0
  14. package/plugin/scripts/dashboard-service.sh +1 -0
  15. package/plugin/scripts/ensure-plugin-root.sh +1 -0
  16. package/plugin/scripts/hook_entry.sh +6 -3
  17. package/plugin/scripts/smart-install.sh +3 -2
  18. package/plugin/src/README.md +57 -0
  19. package/plugin/src/claude_smart/context_format.py +11 -12
  20. package/plugin/src/claude_smart/cs_cite.py +26 -12
  21. package/plugin/src/claude_smart/ids.py +13 -5
  22. package/plugin/uv.lock +126 -5
  23. package/plugin/vendor/reflexio/.env.example +62 -0
  24. package/plugin/vendor/reflexio/LICENSE +201 -0
  25. package/plugin/vendor/reflexio/README.md +338 -0
  26. package/plugin/vendor/reflexio/pyproject.toml +274 -0
  27. package/plugin/vendor/reflexio/reflexio/README.md +184 -0
  28. package/plugin/vendor/reflexio/reflexio/__init__.py +166 -0
  29. package/plugin/vendor/reflexio/reflexio/benchmarks/__init__.py +1 -0
  30. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/README.md +109 -0
  31. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/__init__.py +1 -0
  32. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/backends.py +175 -0
  33. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/bench.py +642 -0
  34. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/embed_cache.py +330 -0
  35. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/report.py +317 -0
  36. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/results/report.md +43 -0
  37. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/results/results.json +4478 -0
  38. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/scenarios.py +134 -0
  39. package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/seed.py +255 -0
  40. package/plugin/vendor/reflexio/reflexio/cli/README.md +287 -0
  41. package/plugin/vendor/reflexio/reflexio/cli/__init__.py +0 -0
  42. package/plugin/vendor/reflexio/reflexio/cli/__main__.py +56 -0
  43. package/plugin/vendor/reflexio/reflexio/cli/_client.py +86 -0
  44. package/plugin/vendor/reflexio/reflexio/cli/app.py +127 -0
  45. package/plugin/vendor/reflexio/reflexio/cli/bootstrap_config.py +265 -0
  46. package/plugin/vendor/reflexio/reflexio/cli/codex_auth.py +503 -0
  47. package/plugin/vendor/reflexio/reflexio/cli/commands/__init__.py +0 -0
  48. package/plugin/vendor/reflexio/reflexio/cli/commands/admin_cmd.py +65 -0
  49. package/plugin/vendor/reflexio/reflexio/cli/commands/agent_playbooks.py +503 -0
  50. package/plugin/vendor/reflexio/reflexio/cli/commands/api.py +114 -0
  51. package/plugin/vendor/reflexio/reflexio/cli/commands/auth.py +109 -0
  52. package/plugin/vendor/reflexio/reflexio/cli/commands/config_cmd.py +511 -0
  53. package/plugin/vendor/reflexio/reflexio/cli/commands/doctor.py +127 -0
  54. package/plugin/vendor/reflexio/reflexio/cli/commands/embeddings.py +53 -0
  55. package/plugin/vendor/reflexio/reflexio/cli/commands/interactions.py +478 -0
  56. package/plugin/vendor/reflexio/reflexio/cli/commands/profiles.py +303 -0
  57. package/plugin/vendor/reflexio/reflexio/cli/commands/services.py +289 -0
  58. package/plugin/vendor/reflexio/reflexio/cli/commands/setup_cmd.py +964 -0
  59. package/plugin/vendor/reflexio/reflexio/cli/commands/shortcuts.py +285 -0
  60. package/plugin/vendor/reflexio/reflexio/cli/commands/status_cmd.py +143 -0
  61. package/plugin/vendor/reflexio/reflexio/cli/commands/user_playbooks.py +373 -0
  62. package/plugin/vendor/reflexio/reflexio/cli/env_loader.py +284 -0
  63. package/plugin/vendor/reflexio/reflexio/cli/errors.py +217 -0
  64. package/plugin/vendor/reflexio/reflexio/cli/log_format.py +247 -0
  65. package/plugin/vendor/reflexio/reflexio/cli/output.py +867 -0
  66. package/plugin/vendor/reflexio/reflexio/cli/paths.py +41 -0
  67. package/plugin/vendor/reflexio/reflexio/cli/run_services.py +391 -0
  68. package/plugin/vendor/reflexio/reflexio/cli/state.py +204 -0
  69. package/plugin/vendor/reflexio/reflexio/cli/stop_services.py +96 -0
  70. package/plugin/vendor/reflexio/reflexio/cli/utils.py +329 -0
  71. package/plugin/vendor/reflexio/reflexio/client/__init__.py +3 -0
  72. package/plugin/vendor/reflexio/reflexio/client/cache.py +150 -0
  73. package/plugin/vendor/reflexio/reflexio/client/client.py +2613 -0
  74. package/plugin/vendor/reflexio/reflexio/defaults.py +23 -0
  75. package/plugin/vendor/reflexio/reflexio/integrations/__init__.py +0 -0
  76. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/.clawhubignore +7 -0
  77. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/README.md +274 -0
  78. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/TESTING.md +517 -0
  79. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/hook/handler.js +473 -0
  80. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package-lock.json +2156 -0
  81. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package.json +18 -0
  82. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/handler.ts +241 -0
  83. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/setup.ts +140 -0
  84. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/index.ts +130 -0
  85. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/publish.ts +113 -0
  86. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/search.ts +52 -0
  87. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/server.ts +103 -0
  88. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/sqlite-buffer.ts +156 -0
  89. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/user-id.ts +134 -0
  90. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/openclaw.plugin.json +41 -0
  91. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/package.json +17 -0
  92. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/rules/reflexio.md +24 -0
  93. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/reflexio/SKILL.md +48 -0
  94. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/publish_clawhub.sh +278 -0
  95. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/references/HOOK.md +164 -0
  96. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/install.sh +36 -0
  97. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/uninstall.sh +35 -0
  98. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/publish.test.ts +27 -0
  99. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/search.test.ts +31 -0
  100. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/server.test.ts +42 -0
  101. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/setup.test.ts +49 -0
  102. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/sqlite-buffer.test.ts +91 -0
  103. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/user-id.test.ts +50 -0
  104. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tsconfig.json +16 -0
  105. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/types/openclaw.d.ts +230 -0
  106. package/plugin/vendor/reflexio/reflexio/integrations/openclaw/vitest.config.ts +13 -0
  107. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/README.md +120 -0
  108. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/TESTING.md +168 -0
  109. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/package-lock.json +1657 -0
  110. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/package.json +16 -0
  111. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/HEARTBEAT.md +6 -0
  112. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/README.md +84 -0
  113. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/SKILL.md +194 -0
  114. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/_meta.json +6 -0
  115. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/agents/reflexio-extractor.md +45 -0
  116. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/hook/handler.ts +214 -0
  117. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/hook/setup.ts +55 -0
  118. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/index.ts +327 -0
  119. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/consolidate.ts +233 -0
  120. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/dedup.ts +80 -0
  121. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/io.ts +155 -0
  122. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/openclaw-cli.ts +67 -0
  123. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/search.ts +33 -0
  124. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/write-playbook.ts +76 -0
  125. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/write-profile.ts +79 -0
  126. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/openclaw.plugin.json +46 -0
  127. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/package.json +18 -0
  128. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/README.md +36 -0
  129. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/full_consolidation.md +56 -0
  130. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/playbook_extraction.md +217 -0
  131. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/profile_extraction.md +132 -0
  132. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/skills/reflexio-consolidate/SKILL.md +33 -0
  133. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/skills/reflexio-embedded/SKILL.md +194 -0
  134. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/HOOK.md +18 -0
  135. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/architecture.md +49 -0
  136. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/comparison.md +31 -0
  137. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/future-work.md +47 -0
  138. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/porting-notes.md +52 -0
  139. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/scripts/install.sh +52 -0
  140. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/scripts/uninstall.sh +36 -0
  141. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/consolidate.test.ts +135 -0
  142. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/dedup.test.ts +104 -0
  143. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/io.test.ts +175 -0
  144. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/search.test.ts +66 -0
  145. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/smoke-test.ts +140 -0
  146. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/write-playbook.test.ts +93 -0
  147. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/write-profile.test.ts +174 -0
  148. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tsconfig.json +16 -0
  149. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/types/openclaw.d.ts +230 -0
  150. package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/vitest.config.ts +7 -0
  151. package/plugin/vendor/reflexio/reflexio/lib/__init__.py +23 -0
  152. package/plugin/vendor/reflexio/reflexio/lib/_agent_playbook.py +310 -0
  153. package/plugin/vendor/reflexio/reflexio/lib/_base.py +225 -0
  154. package/plugin/vendor/reflexio/reflexio/lib/_config.py +83 -0
  155. package/plugin/vendor/reflexio/reflexio/lib/_dashboard.py +266 -0
  156. package/plugin/vendor/reflexio/reflexio/lib/_generation.py +176 -0
  157. package/plugin/vendor/reflexio/reflexio/lib/_interactions.py +334 -0
  158. package/plugin/vendor/reflexio/reflexio/lib/_operations.py +153 -0
  159. package/plugin/vendor/reflexio/reflexio/lib/_profiles.py +545 -0
  160. package/plugin/vendor/reflexio/reflexio/lib/_reflection.py +52 -0
  161. package/plugin/vendor/reflexio/reflexio/lib/_search.py +167 -0
  162. package/plugin/vendor/reflexio/reflexio/lib/_storage_labels.py +103 -0
  163. package/plugin/vendor/reflexio/reflexio/lib/_user_playbook.py +288 -0
  164. package/plugin/vendor/reflexio/reflexio/lib/reflexio_lib.py +27 -0
  165. package/plugin/vendor/reflexio/reflexio/models/__init__.py +0 -0
  166. package/plugin/vendor/reflexio/reflexio/models/api_schema/__init__.py +0 -0
  167. package/plugin/vendor/reflexio/reflexio/models/api_schema/braintrust_schema.py +141 -0
  168. package/plugin/vendor/reflexio/reflexio/models/api_schema/common.py +41 -0
  169. package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/__init__.py +3 -0
  170. package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/entities.py +1112 -0
  171. package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/enums.py +63 -0
  172. package/plugin/vendor/reflexio/reflexio/models/api_schema/eval_overview_schema.py +487 -0
  173. package/plugin/vendor/reflexio/reflexio/models/api_schema/internal_schema.py +28 -0
  174. package/plugin/vendor/reflexio/reflexio/models/api_schema/pending_tool_call_schema.py +83 -0
  175. package/plugin/vendor/reflexio/reflexio/models/api_schema/retriever_schema.py +768 -0
  176. package/plugin/vendor/reflexio/reflexio/models/api_schema/service_schemas.py +9 -0
  177. package/plugin/vendor/reflexio/reflexio/models/api_schema/stall_state_schema.py +32 -0
  178. package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/__init__.py +3 -0
  179. package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/converters.py +177 -0
  180. package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/entities.py +129 -0
  181. package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/enums.py +25 -0
  182. package/plugin/vendor/reflexio/reflexio/models/api_schema/validators.py +333 -0
  183. package/plugin/vendor/reflexio/reflexio/models/config_schema.py +908 -0
  184. package/plugin/vendor/reflexio/reflexio/models/py.typed +0 -0
  185. package/plugin/vendor/reflexio/reflexio/server/OVERVIEW.md +90 -0
  186. package/plugin/vendor/reflexio/reflexio/server/README.md +622 -0
  187. package/plugin/vendor/reflexio/reflexio/server/__init__.py +210 -0
  188. package/plugin/vendor/reflexio/reflexio/server/__main__.py +132 -0
  189. package/plugin/vendor/reflexio/reflexio/server/_auth.py +25 -0
  190. package/plugin/vendor/reflexio/reflexio/server/api.py +2868 -0
  191. package/plugin/vendor/reflexio/reflexio/server/api_endpoints/README.md +34 -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 +562 -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 +359 -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 +1871 -0
  206. package/plugin/vendor/reflexio/reflexio/server/llm/llm_utils.py +140 -0
  207. package/plugin/vendor/reflexio/reflexio/server/llm/model_defaults.py +479 -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 +338 -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 +288 -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 +187 -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 +716 -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_consolidation/v2.3.1.prompt.md +69 -0
  245. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.3.2.prompt.md +71 -0
  246. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.0.2.prompt.md +254 -0
  247. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.1.0.prompt.md +274 -0
  248. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.2.0.prompt.md +283 -0
  249. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.2.2.prompt.md +234 -0
  250. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.2.3.prompt.md +244 -0
  251. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v1.0.0.prompt.md +73 -0
  252. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v2.0.0.prompt.md +86 -0
  253. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.0.0.prompt.md +97 -0
  254. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.1.0.prompt.md +119 -0
  255. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.2.0.prompt.md +123 -0
  256. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.3.0.prompt.md +137 -0
  257. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.0.0.prompt.md +14 -0
  258. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.1.0.prompt.md +24 -0
  259. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.2.0.prompt.md +29 -0
  260. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main_expert/v1.0.0.prompt.md +11 -0
  261. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main_expert/v1.1.0.prompt.md +21 -0
  262. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main_expert/v1.2.0.prompt.md +25 -0
  263. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_optimizer_judge/v1.0.0.prompt.md +37 -0
  264. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_optimizer_judge/v1.1.0.prompt.md +40 -0
  265. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_optimizer_judge/v1.2.0.prompt.md +36 -0
  266. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate/v1.0.0.prompt.md +45 -0
  267. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate/v2.0.0.prompt.md +81 -0
  268. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate/v3.0.0.prompt.md +80 -0
  269. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate_expert/v1.0.0.prompt.md +34 -0
  270. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_deduplication/v1.0.0.prompt.md +116 -0
  271. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_should_generate/v1.0.0.prompt.md +33 -0
  272. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_should_generate_override/v1.0.0.prompt.md +16 -0
  273. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.0.0.prompt.md +140 -0
  274. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.1.0.prompt.md +160 -0
  275. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_main/v1.0.0.prompt.md +14 -0
  276. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/query_reformulation/v1.0.0.prompt.md +19 -0
  277. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/rerank_relevance/v1.1.0.prompt.md +44 -0
  278. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/shadow_comparison/v1.0.0.prompt.md +43 -0
  279. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/shadow_content_evaluation/v1.0.0.prompt.md +33 -0
  280. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_evaluation/prompt_evaluation_dataset/feedback_extraction_main_v1.jsonl +10 -0
  281. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_evaluation/prompt_evaluation_dataset/profile_update_main_v1.jsonl +10 -0
  282. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_manager.py +280 -0
  283. package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_schema.py +11 -0
  284. package/plugin/vendor/reflexio/reflexio/server/services/README.md +58 -0
  285. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/_eval_health.py +131 -0
  286. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_constants.py +60 -0
  287. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_service.py +228 -0
  288. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_utils.py +87 -0
  289. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluator.py +372 -0
  290. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/delayed_group_evaluator.py +156 -0
  291. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/group_evaluation_runner.py +336 -0
  292. package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/regen_jobs.py +471 -0
  293. package/plugin/vendor/reflexio/reflexio/server/services/base_generation_service.py +1668 -0
  294. package/plugin/vendor/reflexio/reflexio/server/services/braintrust/__init__.py +0 -0
  295. package/plugin/vendor/reflexio/reflexio/server/services/braintrust/_cron.py +196 -0
  296. package/plugin/vendor/reflexio/reflexio/server/services/braintrust/_encryption.py +101 -0
  297. package/plugin/vendor/reflexio/reflexio/server/services/braintrust/client.py +167 -0
  298. package/plugin/vendor/reflexio/reflexio/server/services/braintrust/service.py +281 -0
  299. package/plugin/vendor/reflexio/reflexio/server/services/configurator/base_configurator.py +179 -0
  300. package/plugin/vendor/reflexio/reflexio/server/services/configurator/config_storage.py +62 -0
  301. package/plugin/vendor/reflexio/reflexio/server/services/configurator/configurator.py +87 -0
  302. package/plugin/vendor/reflexio/reflexio/server/services/configurator/local_file_config_storage.py +187 -0
  303. package/plugin/vendor/reflexio/reflexio/server/services/configurator/test_config_storage.py +162 -0
  304. package/plugin/vendor/reflexio/reflexio/server/services/deduplication_utils.py +112 -0
  305. package/plugin/vendor/reflexio/reflexio/server/services/embedding_text.py +62 -0
  306. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/__init__.py +0 -0
  307. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/distribution.py +33 -0
  308. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/eval_sampler.py +126 -0
  309. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/group_aggregation.py +192 -0
  310. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/hero_state.py +75 -0
  311. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/rule_attribution.py +97 -0
  312. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/service.py +515 -0
  313. package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/shadow_aggregation.py +90 -0
  314. package/plugin/vendor/reflexio/reflexio/server/services/extraction/__init__.py +0 -0
  315. package/plugin/vendor/reflexio/reflexio/server/services/extraction/agent_run_records.py +91 -0
  316. package/plugin/vendor/reflexio/reflexio/server/services/extraction/invariants.py +303 -0
  317. package/plugin/vendor/reflexio/reflexio/server/services/extraction/outcome.py +25 -0
  318. package/plugin/vendor/reflexio/reflexio/server/services/extraction/pending_tool_call_dispatch.py +358 -0
  319. package/plugin/vendor/reflexio/reflexio/server/services/extraction/plan.py +138 -0
  320. package/plugin/vendor/reflexio/reflexio/server/services/extraction/prior_answer_search.py +217 -0
  321. package/plugin/vendor/reflexio/reflexio/server/services/extraction/resumable_agent.py +535 -0
  322. package/plugin/vendor/reflexio/reflexio/server/services/extraction/resume_scheduler.py +171 -0
  323. package/plugin/vendor/reflexio/reflexio/server/services/extraction/resume_worker.py +779 -0
  324. package/plugin/vendor/reflexio/reflexio/server/services/extraction/tools.py +1125 -0
  325. package/plugin/vendor/reflexio/reflexio/server/services/extractor_config_utils.py +94 -0
  326. package/plugin/vendor/reflexio/reflexio/server/services/extractor_interaction_utils.py +251 -0
  327. package/plugin/vendor/reflexio/reflexio/server/services/generation_service.py +702 -0
  328. package/plugin/vendor/reflexio/reflexio/server/services/operation_state_utils.py +835 -0
  329. package/plugin/vendor/reflexio/reflexio/server/services/playbook/README.md +89 -0
  330. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_aggregator.py +1388 -0
  331. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_consolidator.py +1045 -0
  332. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_extractor.py +436 -0
  333. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_generation_service.py +808 -0
  334. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_service_constants.py +28 -0
  335. package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_service_utils.py +362 -0
  336. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/__init__.py +24 -0
  337. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/assistant_webhook.py +246 -0
  338. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/gepa_adapter.py +291 -0
  339. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/judge.py +97 -0
  340. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/models.py +96 -0
  341. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/optimizer.py +645 -0
  342. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/rollout.py +35 -0
  343. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/scenario_resolver.py +93 -0
  344. package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/scheduler.py +174 -0
  345. package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/__init__.py +26 -0
  346. package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/_document_expander.py +179 -0
  347. package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/_query_reformulator.py +297 -0
  348. package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_deduplicator.py +772 -0
  349. package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_extractor.py +462 -0
  350. package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_generation_service.py +737 -0
  351. package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_generation_service_utils.py +290 -0
  352. package/plugin/vendor/reflexio/reflexio/server/services/reflection/__init__.py +17 -0
  353. package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_extractor.py +247 -0
  354. package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_service.py +803 -0
  355. package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_service_utils.py +146 -0
  356. package/plugin/vendor/reflexio/reflexio/server/services/retrieval/__init__.py +0 -0
  357. package/plugin/vendor/reflexio/reflexio/server/services/retrieval/relevance_floor.py +80 -0
  358. package/plugin/vendor/reflexio/reflexio/server/services/search/__init__.py +0 -0
  359. package/plugin/vendor/reflexio/reflexio/server/services/service_utils.py +756 -0
  360. package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/__init__.py +1 -0
  361. package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/judge.py +184 -0
  362. package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/outcome.py +81 -0
  363. package/plugin/vendor/reflexio/reflexio/server/services/storage/constants.py +2 -0
  364. package/plugin/vendor/reflexio/reflexio/server/services/storage/error.py +11 -0
  365. package/plugin/vendor/reflexio/reflexio/server/services/storage/retention.py +154 -0
  366. package/plugin/vendor/reflexio/reflexio/server/services/storage/retention_mixin.py +155 -0
  367. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/__init__.py +59 -0
  368. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_agent_run.py +1298 -0
  369. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_base.py +1945 -0
  370. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_extras.py +600 -0
  371. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_operations.py +346 -0
  372. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_playbook.py +1378 -0
  373. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_profiles.py +747 -0
  374. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_requests.py +263 -0
  375. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_shadow_verdicts.py +193 -0
  376. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_share_links.py +166 -0
  377. package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_stall_state.py +217 -0
  378. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/__init__.py +153 -0
  379. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_agent_run.py +384 -0
  380. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_base.py +71 -0
  381. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_extras.py +235 -0
  382. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_operations.py +170 -0
  383. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_playbook.py +677 -0
  384. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_profiles.py +250 -0
  385. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_requests.py +154 -0
  386. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_shadow_verdicts.py +130 -0
  387. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_share_links.py +93 -0
  388. package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_stall_state.py +76 -0
  389. package/plugin/vendor/reflexio/reflexio/server/services/unified_search_service.py +572 -0
  390. package/plugin/vendor/reflexio/reflexio/server/site_var/README.md +77 -0
  391. package/plugin/vendor/reflexio/reflexio/server/site_var/feature_flags.py +116 -0
  392. package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_manager.py +263 -0
  393. package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/feature_flags.json +13 -0
  394. package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/llm_model_setting.json +7 -0
  395. package/plugin/vendor/reflexio/reflexio/server/tracing.py +158 -0
  396. package/plugin/vendor/reflexio/reflexio/server/usage_metrics.py +113 -0
  397. package/plugin/vendor/reflexio/reflexio/server/uvicorn_logging.py +76 -0
  398. package/plugin/vendor/reflexio/reflexio/test_support/__init__.py +1 -0
  399. package/plugin/vendor/reflexio/reflexio/test_support/llm_fixtures.py +62 -0
  400. package/plugin/vendor/reflexio/reflexio/test_support/llm_mock.py +242 -0
  401. package/plugin/vendor/reflexio/reflexio/test_support/llm_model_registry.py +129 -0
  402. package/plugin/vendor/reflexio/reflexio/test_support/skip_decorators.py +43 -0
@@ -0,0 +1,768 @@
1
+ from __future__ import annotations
2
+
3
+ from datetime import datetime
4
+ from typing import Literal, Self
5
+
6
+ from pydantic import BaseModel, Field, model_validator
7
+
8
+ from ..config_schema import SearchMode
9
+ from .service_schemas import (
10
+ AgentPlaybook,
11
+ AgentSuccessEvaluationResult,
12
+ Interaction,
13
+ PlaybookStatus,
14
+ Request,
15
+ Status,
16
+ UserPlaybook,
17
+ UserProfile,
18
+ )
19
+ from .ui.entities import (
20
+ AgentPlaybookView,
21
+ EvaluationResultView,
22
+ InteractionView,
23
+ ProfileChangeLogView,
24
+ ProfileView,
25
+ UserPlaybookView,
26
+ )
27
+ from .validators import (
28
+ NonEmptyStr,
29
+ TimeRangeValidatorMixin,
30
+ )
31
+
32
+
33
+ class SearchInteractionRequest(BaseModel):
34
+ user_id: NonEmptyStr
35
+ request_id: str | None = None
36
+ query: str | None = None
37
+ start_time: datetime | None = None
38
+ end_time: datetime | None = None
39
+ top_k: int | None = Field(default=None, gt=0)
40
+ most_recent_k: int | None = Field(default=None, gt=0)
41
+ search_mode: SearchMode = SearchMode.HYBRID
42
+
43
+ @model_validator(mode="after")
44
+ def check_time_range(self) -> Self:
45
+ """Validate that end_time is after start_time."""
46
+ TimeRangeValidatorMixin.validate_time_range(self.start_time, self.end_time)
47
+ return self
48
+
49
+
50
+ class SearchUserProfileRequest(BaseModel):
51
+ user_id: NonEmptyStr
52
+ generated_from_request_id: str | None = None
53
+ query: str | None = None
54
+ start_time: datetime | None = None
55
+ end_time: datetime | None = None
56
+ top_k: int | None = Field(default=10, gt=0)
57
+ source: str | None = None
58
+ custom_feature: str | None = None
59
+ extractor_name: str | None = (
60
+ None # Deprecated compatibility field; accepted but ignored.
61
+ )
62
+ threshold: float | None = Field(default=0.4, ge=0.0, le=1.0)
63
+ enable_reformulation: bool | None = False
64
+ search_mode: SearchMode = SearchMode.HYBRID
65
+
66
+ @model_validator(mode="after")
67
+ def check_time_range(self) -> Self:
68
+ """Validate that end_time is after start_time."""
69
+ TimeRangeValidatorMixin.validate_time_range(self.start_time, self.end_time)
70
+ return self
71
+
72
+
73
+ class SearchInteractionResponse(BaseModel):
74
+ success: bool
75
+ interactions: list[Interaction]
76
+ msg: str | None = None
77
+
78
+
79
+ class SearchUserProfileResponse(BaseModel):
80
+ success: bool
81
+ user_profiles: list[UserProfile]
82
+ msg: str | None = None
83
+
84
+
85
+ class RerankUserProfilesRequest(BaseModel):
86
+ """Cross-encoder rerank for a list of profile ids.
87
+
88
+ Use after ``search_user_profiles`` (or any other source of candidate ids)
89
+ when initial results are noisy. The server fetches each candidate's full
90
+ content, scores ``(query, content)`` pairs with a CPU cross-encoder, and
91
+ returns the top_k profiles sorted by descending score.
92
+
93
+ Args:
94
+ user_id (str): The user whose profiles to rerank.
95
+ query (str): The reranking query.
96
+ profile_ids (list[str]): Candidate profile ids; ids that don't belong
97
+ to ``user_id`` (or don't exist) are silently dropped.
98
+ top_k (int): Maximum number of profiles to return. Defaults to 10.
99
+ """
100
+
101
+ user_id: NonEmptyStr
102
+ query: NonEmptyStr
103
+ profile_ids: list[str]
104
+ top_k: int = Field(default=10, gt=0)
105
+
106
+
107
+ class RerankUserProfilesResponse(BaseModel):
108
+ """Response from :class:`RerankUserProfilesRequest`.
109
+
110
+ Args:
111
+ success (bool): Whether the rerank call succeeded.
112
+ user_profiles (list[UserProfile]): Profiles sorted by descending
113
+ cross-encoder score, capped at ``top_k``.
114
+ msg (str, optional): Diagnostic message (e.g. how many ids were
115
+ silently dropped because they didn't resolve).
116
+ """
117
+
118
+ success: bool
119
+ user_profiles: list[UserProfile]
120
+ msg: str | None = None
121
+
122
+
123
+ class StorageStatsRequest(BaseModel):
124
+ """Request lightweight metadata about a user's stored profiles + playbooks.
125
+
126
+ Useful before deciding ``top_k`` for retrieval — sized counts and
127
+ timestamp ranges let the agent pick a sensible cap rather than a fixed
128
+ constant.
129
+
130
+ Args:
131
+ user_id (str): The user to inspect.
132
+ """
133
+
134
+ user_id: NonEmptyStr
135
+
136
+
137
+ class StorageStatsResponse(BaseModel):
138
+ """Response from :class:`StorageStatsRequest`.
139
+
140
+ Args:
141
+ profile_count (int): Total number of profiles for the user across
142
+ all statuses.
143
+ playbook_count (int): Total number of user playbooks for the user
144
+ across all statuses.
145
+ oldest_profile_modified (datetime, optional): UTC timestamp of the
146
+ oldest profile's ``last_modified_timestamp``; None when the user
147
+ has no profiles.
148
+ newest_profile_modified (datetime, optional): UTC timestamp of the
149
+ newest profile's ``last_modified_timestamp``; None when the user
150
+ has no profiles.
151
+ success (bool): Whether the lookup succeeded.
152
+ msg (str, optional): Diagnostic message.
153
+ """
154
+
155
+ profile_count: int = Field(default=0, ge=0)
156
+ playbook_count: int = Field(default=0, ge=0)
157
+ oldest_profile_modified: datetime | None = None
158
+ newest_profile_modified: datetime | None = None
159
+ success: bool
160
+ msg: str | None = None
161
+
162
+
163
+ class GetInteractionsRequest(BaseModel):
164
+ user_id: NonEmptyStr
165
+ start_time: datetime | None = None
166
+ end_time: datetime | None = None
167
+ top_k: int | None = Field(default=30, gt=0)
168
+
169
+ @model_validator(mode="after")
170
+ def check_time_range(self) -> Self:
171
+ """Validate that end_time is after start_time."""
172
+ TimeRangeValidatorMixin.validate_time_range(self.start_time, self.end_time)
173
+ return self
174
+
175
+
176
+ class GetInteractionsResponse(BaseModel):
177
+ success: bool
178
+ interactions: list[Interaction]
179
+ msg: str | None = None
180
+
181
+
182
+ class GetUserProfilesRequest(BaseModel):
183
+ user_id: NonEmptyStr
184
+ start_time: datetime | None = None
185
+ end_time: datetime | None = None
186
+ top_k: int | None = Field(default=30, gt=0)
187
+ status_filter: list[Status | None] | None = None
188
+
189
+ @model_validator(mode="after")
190
+ def check_time_range(self) -> Self:
191
+ """Validate that end_time is after start_time."""
192
+ TimeRangeValidatorMixin.validate_time_range(self.start_time, self.end_time)
193
+ return self
194
+
195
+
196
+ class GetUserProfilesResponse(BaseModel):
197
+ success: bool
198
+ user_profiles: list[UserProfile]
199
+ msg: str | None = None
200
+
201
+
202
+ class GetProfileStatisticsResponse(BaseModel):
203
+ success: bool
204
+ current_count: int = 0
205
+ pending_count: int = 0
206
+ archived_count: int = 0
207
+ expiring_soon_count: int = 0
208
+ msg: str | None = None
209
+
210
+
211
+ class SetConfigResponse(BaseModel):
212
+ success: bool
213
+ msg: str | None = None
214
+
215
+
216
+ class GetUserPlaybooksRequest(BaseModel):
217
+ limit: int | None = Field(default=100, gt=0)
218
+ user_id: str | None = None
219
+ playbook_name: str | None = None
220
+ agent_version: str | None = None
221
+ status_filter: list[Status | None] | None = None
222
+
223
+
224
+ class GetUserPlaybooksResponse(BaseModel):
225
+ success: bool
226
+ user_playbooks: list[UserPlaybook]
227
+ msg: str | None = None
228
+
229
+
230
+ class GetAgentPlaybooksRequest(BaseModel):
231
+ limit: int | None = Field(default=100, gt=0)
232
+ playbook_name: str | None = None
233
+ agent_version: str | None = None
234
+ status_filter: list[Status | None] | None = None
235
+ playbook_status_filter: PlaybookStatus | None = None
236
+
237
+
238
+ class GetAgentPlaybooksResponse(BaseModel):
239
+ success: bool
240
+ agent_playbooks: list[AgentPlaybook]
241
+ msg: str | None = None
242
+
243
+
244
+ class SearchUserPlaybookRequest(BaseModel):
245
+ """Request for searching user playbooks with semantic/text search and filtering.
246
+
247
+ Args:
248
+ query (str, optional): Query for semantic/text search
249
+ user_id (str, optional): Filter by user (via request_id linkage to requests table)
250
+ agent_version (str, optional): Filter by agent version
251
+ playbook_name (str, optional): Filter by playbook name
252
+ start_time (datetime, optional): Start time for created_at filter
253
+ end_time (datetime, optional): End time for created_at filter
254
+ status_filter (list[Optional[Status]], optional): Filter by status (None for CURRENT, PENDING, ARCHIVED)
255
+ top_k (int, optional): Maximum number of results to return. Defaults to 10
256
+ threshold (float, optional): Similarity threshold for vector search. Defaults to 0.4
257
+ """
258
+
259
+ query: str | None = None
260
+ user_id: str | None = None
261
+ agent_version: str | None = None
262
+ playbook_name: str | None = None
263
+ start_time: datetime | None = None
264
+ end_time: datetime | None = None
265
+ status_filter: list[Status | None] | None = None
266
+ top_k: int | None = Field(default=10, gt=0)
267
+ threshold: float | None = Field(default=0.4, ge=0.0, le=1.0)
268
+ enable_reformulation: bool | None = False
269
+ search_mode: SearchMode = SearchMode.HYBRID
270
+
271
+ @model_validator(mode="after")
272
+ def check_time_range(self) -> Self:
273
+ """Validate that end_time is after start_time."""
274
+ TimeRangeValidatorMixin.validate_time_range(self.start_time, self.end_time)
275
+ return self
276
+
277
+
278
+ class SearchUserPlaybookResponse(BaseModel):
279
+ """Response for searching user playbooks.
280
+
281
+ Args:
282
+ success (bool): Whether the search was successful
283
+ user_playbooks (list[UserPlaybook]): List of matching user playbooks
284
+ msg (str, optional): Additional message
285
+ """
286
+
287
+ success: bool
288
+ user_playbooks: list[UserPlaybook]
289
+ msg: str | None = None
290
+
291
+
292
+ class SearchAgentPlaybookRequest(BaseModel):
293
+ """Request for searching aggregated agent playbooks with semantic/text search and filtering.
294
+
295
+ Args:
296
+ query (str, optional): Query for semantic/text search
297
+ agent_version (str, optional): Filter by agent version
298
+ playbook_name (str, optional): Filter by playbook name
299
+ start_time (datetime, optional): Start time for created_at filter
300
+ end_time (datetime, optional): End time for created_at filter
301
+ status_filter (list[Optional[Status]], optional): Filter by status (None for CURRENT, PENDING, ARCHIVED)
302
+ playbook_status_filter (PlaybookStatus | list[PlaybookStatus], optional):
303
+ Filter by playbook approval status. Accepts either a single
304
+ ``PlaybookStatus`` (matched with ``=``) or a list (matched with
305
+ ``IN (...)``) so callers can request multiple approval states in
306
+ a single storage query without per-status fan-out. Defaults to
307
+ None (no status predicate).
308
+ top_k (int, optional): Maximum number of results to return. Defaults to 10
309
+ threshold (float, optional): Similarity threshold for vector search. Defaults to 0.4
310
+ """
311
+
312
+ query: str | None = None
313
+ agent_version: str | None = None
314
+ playbook_name: str | None = None
315
+ start_time: datetime | None = None
316
+ end_time: datetime | None = None
317
+ status_filter: list[Status | None] | None = None
318
+ playbook_status_filter: PlaybookStatus | list[PlaybookStatus] | None = None
319
+ top_k: int | None = Field(default=10, gt=0)
320
+ threshold: float | None = Field(default=0.4, ge=0.0, le=1.0)
321
+ enable_reformulation: bool | None = False
322
+ search_mode: SearchMode = SearchMode.HYBRID
323
+
324
+ @model_validator(mode="after")
325
+ def check_time_range(self) -> Self:
326
+ """Validate that end_time is after start_time."""
327
+ TimeRangeValidatorMixin.validate_time_range(self.start_time, self.end_time)
328
+ return self
329
+
330
+
331
+ class SearchAgentPlaybookResponse(BaseModel):
332
+ """Response for searching aggregated agent playbooks.
333
+
334
+ Args:
335
+ success (bool): Whether the search was successful
336
+ agent_playbooks (list[AgentPlaybook]): List of matching agent playbooks
337
+ msg (str, optional): Additional message
338
+ """
339
+
340
+ success: bool
341
+ agent_playbooks: list[AgentPlaybook]
342
+ msg: str | None = None
343
+
344
+
345
+ class GetAgentSuccessEvaluationResultsRequest(BaseModel):
346
+ limit: int | None = Field(default=100, gt=0)
347
+ agent_version: str | None = None
348
+
349
+
350
+ class GetAgentSuccessEvaluationResultsResponse(BaseModel):
351
+ success: bool
352
+ agent_success_evaluation_results: list[AgentSuccessEvaluationResult]
353
+ msg: str | None = None
354
+
355
+
356
+ class GetRequestsRequest(BaseModel):
357
+ user_id: str | None = None
358
+ request_id: str | None = None
359
+ session_id: str | None = None
360
+ start_time: datetime | None = None
361
+ end_time: datetime | None = None
362
+ top_k: int | None = Field(default=30, gt=0)
363
+ offset: int | None = Field(default=0, ge=0)
364
+
365
+ @model_validator(mode="after")
366
+ def check_time_range(self) -> Self:
367
+ """Validate that end_time is after start_time."""
368
+ TimeRangeValidatorMixin.validate_time_range(self.start_time, self.end_time)
369
+ return self
370
+
371
+
372
+ class RequestData(BaseModel):
373
+ request: Request
374
+ interactions: list[Interaction]
375
+
376
+
377
+ class Session(BaseModel):
378
+ session_id: str
379
+ requests: list[RequestData]
380
+
381
+
382
+ class GetRequestsResponse(BaseModel):
383
+ success: bool
384
+ sessions: list[Session]
385
+ has_more: bool = False
386
+ msg: str | None = None
387
+
388
+
389
+ class UpdatePlaybookStatusRequest(BaseModel):
390
+ agent_playbook_id: int = Field(gt=0)
391
+ playbook_status: PlaybookStatus
392
+
393
+
394
+ class UpdatePlaybookStatusResponse(BaseModel):
395
+ success: bool
396
+ msg: str | None = None
397
+
398
+
399
+ class UpdateAgentPlaybookRequest(BaseModel):
400
+ """Generic update for an agent playbook. All fields except ID are optional."""
401
+
402
+ agent_playbook_id: int = Field(gt=0)
403
+ playbook_name: str | None = None
404
+ content: str | None = None
405
+ trigger: str | None = None
406
+ rationale: str | None = None
407
+ playbook_status: PlaybookStatus | None = None
408
+
409
+
410
+ class UpdateAgentPlaybookResponse(BaseModel):
411
+ success: bool
412
+ msg: str | None = None
413
+
414
+
415
+ class UpdateUserPlaybookRequest(BaseModel):
416
+ """Generic update for a user playbook. All fields except ID are optional."""
417
+
418
+ user_playbook_id: int = Field(gt=0)
419
+ playbook_name: str | None = None
420
+ content: str | None = None
421
+ trigger: str | None = None
422
+ rationale: str | None = None
423
+
424
+
425
+ class UpdateUserPlaybookResponse(BaseModel):
426
+ success: bool
427
+ msg: str | None = None
428
+
429
+
430
+ class UpdateUserProfileRequest(BaseModel):
431
+ """Partial update for an existing user profile.
432
+
433
+ Only non-None fields are applied. ``user_id`` and ``profile_id`` are
434
+ required; all other fields are optional, matching the UI edit flow
435
+ where the user typically changes ``content`` and/or ``custom_features``.
436
+ """
437
+
438
+ user_id: str
439
+ profile_id: str
440
+ content: str | None = None
441
+ custom_features: dict[str, object] | None = None
442
+
443
+
444
+ class UpdateUserProfileResponse(BaseModel):
445
+ success: bool
446
+ msg: str | None = None
447
+
448
+
449
+ class TimeSeriesDataPoint(BaseModel):
450
+ """A single data point in a time series."""
451
+
452
+ timestamp: int = Field(gt=0) # Unix timestamp
453
+ value: int = Field(ge=0) # Count or metric value
454
+
455
+
456
+ class PeriodStats(BaseModel):
457
+ """Statistics for a specific time period."""
458
+
459
+ total_profiles: int = Field(ge=0)
460
+ total_interactions: int = Field(ge=0)
461
+ total_playbooks: int = Field(ge=0)
462
+ success_rate: float = Field(ge=0.0, le=100.0) # Percentage (0-100)
463
+
464
+
465
+ class DashboardStats(BaseModel):
466
+ """Comprehensive dashboard statistics including current and previous periods."""
467
+
468
+ current_period: PeriodStats
469
+ previous_period: PeriodStats
470
+ interactions_time_series: list[TimeSeriesDataPoint]
471
+ profiles_time_series: list[TimeSeriesDataPoint]
472
+ playbooks_time_series: list[TimeSeriesDataPoint]
473
+ evaluations_time_series: list[TimeSeriesDataPoint] # Success rate over time
474
+
475
+
476
+ class GetDashboardStatsRequest(BaseModel):
477
+ """Request for dashboard statistics.
478
+
479
+ Args:
480
+ days_back (int): Number of days to include in time series data. Defaults to 30.
481
+ """
482
+
483
+ days_back: int | None = Field(default=30, gt=0)
484
+
485
+
486
+ class GetDashboardStatsResponse(BaseModel):
487
+ """Response containing dashboard statistics."""
488
+
489
+ success: bool
490
+ stats: DashboardStats | None = None
491
+ msg: str | None = None
492
+
493
+
494
+ class PlaybookApplicationStat(BaseModel):
495
+ """Per-rule application stats derived from interaction citations.
496
+
497
+ Aggregates the JSON ``citations`` column on interactions to surface how
498
+ often each individual playbook or profile has been cited by the agent in
499
+ a given time window. Used by the claude-smart dashboard to show users a
500
+ "track record" for each rule so the impact of a learning is visible
501
+ rather than abstract.
502
+
503
+ Args:
504
+ real_id (str): Stable id of the cited item — ``user_playbook_id``,
505
+ ``agent_playbook_id``, or ``profile_id`` (always serialized as a
506
+ string).
507
+ kind (str): ``"playbook"`` or ``"profile"`` — the citation kind, as
508
+ recorded on ``Interaction.citations``.
509
+ title (str): Human-readable label for the rule. Empty string when
510
+ the underlying row has been deleted but old citations remain.
511
+ applied_count (int): Number of interactions in the window whose
512
+ citations referenced this ``(kind, real_id)``.
513
+ last_applied_at (int | None): Unix epoch seconds of the most recent
514
+ interaction citing this rule. ``None`` when no citation matches.
515
+ Matches the int-epoch convention used elsewhere in the dashboard
516
+ (e.g. ``Interaction.created_at``).
517
+ last_interaction_id (int | None): ``interaction_id`` of the most
518
+ recent citing interaction; useful for deep-linking from the
519
+ dashboard.
520
+ """
521
+
522
+ real_id: str
523
+ kind: Literal["playbook", "profile"]
524
+ title: str = ""
525
+ applied_count: int = Field(ge=0)
526
+ last_applied_at: int | None = None
527
+ last_interaction_id: int | None = None
528
+
529
+
530
+ class GetPlaybookApplicationStatsRequest(BaseModel):
531
+ """Request for per-rule application stats.
532
+
533
+ Args:
534
+ days_back (int): Look-back window in days. Defaults to 30; must be
535
+ positive.
536
+ """
537
+
538
+ days_back: int = Field(default=30, gt=0)
539
+
540
+
541
+ class GetPlaybookApplicationStatsResponse(BaseModel):
542
+ """Response containing per-rule application stats.
543
+
544
+ Args:
545
+ success (bool): Whether the call succeeded.
546
+ stats (list[PlaybookApplicationStat]): One row per cited rule, sorted
547
+ by ``applied_count`` descending.
548
+ msg (str | None): Optional error message when ``success`` is False.
549
+ """
550
+
551
+ success: bool
552
+ stats: list[PlaybookApplicationStat] = Field(default_factory=list)
553
+ msg: str | None = None
554
+
555
+
556
+ # ===============================
557
+ # Query Reformulation Models
558
+ # ===============================
559
+
560
+
561
+ class ConversationTurn(BaseModel):
562
+ """A single turn in a conversation history.
563
+
564
+ Args:
565
+ role (str): The role of the speaker (e.g., "user", "agent")
566
+ content (str): The message content
567
+ """
568
+
569
+ role: NonEmptyStr
570
+ content: NonEmptyStr
571
+
572
+
573
+ class ReformulationResult(BaseModel):
574
+ """Output of the query reformulation pipeline.
575
+
576
+ Args:
577
+ standalone_query (str): Clean, normalized natural language query with
578
+ conversation context resolved, abbreviations expanded, grammar fixed.
579
+ """
580
+
581
+ standalone_query: str
582
+
583
+
584
+ # ===============================
585
+ # Unified Search Models
586
+ # ===============================
587
+
588
+
589
+ UnifiedSearchEntityType = Literal["profiles", "user_playbooks", "agent_playbooks"]
590
+
591
+
592
+ class UnifiedSearchRequest(BaseModel):
593
+ """Request for unified search across all entity types.
594
+
595
+ Args:
596
+ query (str): Search query text
597
+ top_k (int, optional): Maximum results per entity type. Defaults to 5
598
+ threshold (float, optional): Similarity threshold for vector search. Defaults to 0.3
599
+ agent_version (str, optional): Filter by agent version (agent_playbooks, user_playbooks)
600
+ playbook_name (str, optional): Filter by playbook name (agent_playbooks, user_playbooks)
601
+ user_id (str, optional): Filter by user ID (profiles, user_playbooks)
602
+ entity_types (list[str], optional): Entity types to search. When omitted,
603
+ searches profiles, user_playbooks, and agent_playbooks.
604
+ agent_playbook_status_filter (list[PlaybookStatus], optional): Approval
605
+ statuses to include for agent_playbooks. When omitted, defaults to
606
+ ``[APPROVED, PENDING]`` so that REJECTED playbooks are suppressed
607
+ from results — a rejection in the dashboard immediately hides the
608
+ playbook. Pass an explicit list to opt into REJECTED items.
609
+ conversation_history (list[ConversationTurn], optional): Prior conversation turns for context-aware query rewriting
610
+ """
611
+
612
+ query: NonEmptyStr
613
+ top_k: int | None = Field(default=5, gt=0)
614
+ threshold: float | None = Field(default=0.3, ge=0.0, le=1.0)
615
+ agent_version: str | None = None
616
+ playbook_name: str | None = None
617
+ user_id: str | None = None
618
+ entity_types: list[UnifiedSearchEntityType] | None = None
619
+ agent_playbook_status_filter: list[PlaybookStatus] | None = None
620
+ conversation_history: list[ConversationTurn] | None = None
621
+ enable_reformulation: bool | None = False
622
+ enable_agent_answer: bool | None = False
623
+ search_mode: SearchMode = SearchMode.HYBRID
624
+
625
+
626
+ class UnifiedSearchResponse(BaseModel):
627
+ """Response containing search results from all entity types.
628
+
629
+ Args:
630
+ success (bool): Whether the search was successful
631
+ profiles (list[UserProfile]): Matching user profiles
632
+ agent_playbooks (list[AgentPlaybook]): Matching aggregated agent playbooks
633
+ user_playbooks (list[UserPlaybook]): Matching user playbooks
634
+ reformulated_query (str, optional): The query used after reformulation (None if reformulation disabled)
635
+ msg (str, optional): Additional message
636
+ agent_answer (str, optional): LLM-synthesised answer populated by the agentic backend;
637
+ None for classic backend.
638
+ """
639
+
640
+ success: bool
641
+ profiles: list[UserProfile] = []
642
+ agent_playbooks: list[AgentPlaybook] = []
643
+ user_playbooks: list[UserPlaybook] = []
644
+ reformulated_query: str | None = None
645
+ msg: str | None = None
646
+ agent_answer: str | None = None
647
+ agent_trace: str | None = None
648
+ rehydrated_text: str | None = None
649
+
650
+
651
+ # ===============================
652
+ # View Response Types (user-facing, without embeddings)
653
+ # ===============================
654
+
655
+
656
+ class GetInteractionsViewResponse(BaseModel):
657
+ """API response for retrieving interactions — uses View types."""
658
+
659
+ success: bool
660
+ interactions: list[InteractionView]
661
+ msg: str | None = None
662
+
663
+
664
+ class GetProfilesViewResponse(BaseModel):
665
+ """API response for retrieving profiles — uses View types."""
666
+
667
+ success: bool
668
+ user_profiles: list[ProfileView]
669
+ msg: str | None = None
670
+
671
+
672
+ class SearchInteractionsViewResponse(BaseModel):
673
+ """API response for searching interactions — uses View types."""
674
+
675
+ success: bool
676
+ interactions: list[InteractionView]
677
+ msg: str | None = None
678
+
679
+
680
+ class SearchProfilesViewResponse(BaseModel):
681
+ """API response for searching profiles — uses View types."""
682
+
683
+ success: bool
684
+ user_profiles: list[ProfileView]
685
+ msg: str | None = None
686
+
687
+
688
+ class GetEvaluationResultsViewResponse(BaseModel):
689
+ """API response for retrieving evaluation results — uses View types."""
690
+
691
+ success: bool
692
+ agent_success_evaluation_results: list[EvaluationResultView]
693
+ msg: str | None = None
694
+
695
+
696
+ class ProfileChangeLogViewResponse(BaseModel):
697
+ """API response for profile change logs — uses View types."""
698
+
699
+ success: bool
700
+ profile_change_logs: list[ProfileChangeLogView]
701
+
702
+
703
+ class RequestDataView(BaseModel):
704
+ """A single request with its interactions, using View types."""
705
+
706
+ request: Request
707
+ interactions: list[InteractionView]
708
+
709
+
710
+ class SessionView(BaseModel):
711
+ """A session containing requests, using View types."""
712
+
713
+ session_id: str
714
+ requests: list[RequestDataView]
715
+
716
+
717
+ class GetRequestsViewResponse(BaseModel):
718
+ """API response for retrieving requests — uses View types."""
719
+
720
+ success: bool
721
+ sessions: list[SessionView]
722
+ has_more: bool = False
723
+ msg: str | None = None
724
+
725
+
726
+ class UnifiedSearchViewResponse(BaseModel):
727
+ """API response for unified search — uses View types."""
728
+
729
+ success: bool
730
+ profiles: list[ProfileView] = []
731
+ agent_playbooks: list[AgentPlaybookView] = []
732
+ user_playbooks: list[UserPlaybookView] = []
733
+ reformulated_query: str | None = None
734
+ msg: str | None = None
735
+ agent_trace: str | None = None
736
+ rehydrated_text: str | None = None
737
+
738
+
739
+ class GetUserPlaybooksViewResponse(BaseModel):
740
+ """API response for retrieving user playbooks — uses View types."""
741
+
742
+ success: bool
743
+ user_playbooks: list[UserPlaybookView]
744
+ msg: str | None = None
745
+
746
+
747
+ class GetAgentPlaybooksViewResponse(BaseModel):
748
+ """API response for retrieving agent playbooks — uses View types."""
749
+
750
+ success: bool
751
+ agent_playbooks: list[AgentPlaybookView]
752
+ msg: str | None = None
753
+
754
+
755
+ class SearchUserPlaybooksViewResponse(BaseModel):
756
+ """API response for searching user playbooks — uses View types."""
757
+
758
+ success: bool
759
+ user_playbooks: list[UserPlaybookView]
760
+ msg: str | None = None
761
+
762
+
763
+ class SearchAgentPlaybooksViewResponse(BaseModel):
764
+ """API response for searching agent playbooks — uses View types."""
765
+
766
+ success: bool
767
+ agent_playbooks: list[AgentPlaybookView]
768
+ msg: str | None = None