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.
- package/.claude-plugin/marketplace.json +3 -3
- package/README.md +1 -1
- package/bin/claude-smart.js +2 -2
- package/package.json +9 -3
- package/plugin/.claude-plugin/plugin.json +9 -3
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/README.md +23 -3
- package/plugin/pyproject.toml +3 -3
- package/plugin/scripts/_lib.sh +91 -0
- package/plugin/scripts/backend-service.sh +51 -4
- package/plugin/scripts/cli.sh +3 -1
- package/plugin/scripts/codex-hook.js +72 -4
- package/plugin/scripts/dashboard-build.sh +1 -0
- package/plugin/scripts/dashboard-service.sh +1 -0
- package/plugin/scripts/ensure-plugin-root.sh +1 -0
- package/plugin/scripts/hook_entry.sh +6 -3
- package/plugin/scripts/smart-install.sh +3 -2
- package/plugin/src/README.md +57 -0
- package/plugin/src/claude_smart/context_format.py +11 -12
- package/plugin/src/claude_smart/cs_cite.py +26 -12
- package/plugin/src/claude_smart/ids.py +13 -5
- package/plugin/uv.lock +126 -5
- package/plugin/vendor/reflexio/.env.example +62 -0
- package/plugin/vendor/reflexio/LICENSE +201 -0
- package/plugin/vendor/reflexio/README.md +338 -0
- package/plugin/vendor/reflexio/pyproject.toml +274 -0
- package/plugin/vendor/reflexio/reflexio/README.md +184 -0
- package/plugin/vendor/reflexio/reflexio/__init__.py +166 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/README.md +109 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/backends.py +175 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/bench.py +642 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/embed_cache.py +330 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/report.py +317 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/results/report.md +43 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/results/results.json +4478 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/scenarios.py +134 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/seed.py +255 -0
- package/plugin/vendor/reflexio/reflexio/cli/README.md +287 -0
- package/plugin/vendor/reflexio/reflexio/cli/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/cli/__main__.py +56 -0
- package/plugin/vendor/reflexio/reflexio/cli/_client.py +86 -0
- package/plugin/vendor/reflexio/reflexio/cli/app.py +127 -0
- package/plugin/vendor/reflexio/reflexio/cli/bootstrap_config.py +265 -0
- package/plugin/vendor/reflexio/reflexio/cli/codex_auth.py +503 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/admin_cmd.py +65 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/agent_playbooks.py +503 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/api.py +114 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/auth.py +109 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/config_cmd.py +511 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/doctor.py +127 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/embeddings.py +53 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/interactions.py +478 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/profiles.py +303 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/services.py +289 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/setup_cmd.py +964 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/shortcuts.py +285 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/status_cmd.py +143 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/user_playbooks.py +373 -0
- package/plugin/vendor/reflexio/reflexio/cli/env_loader.py +284 -0
- package/plugin/vendor/reflexio/reflexio/cli/errors.py +217 -0
- package/plugin/vendor/reflexio/reflexio/cli/log_format.py +247 -0
- package/plugin/vendor/reflexio/reflexio/cli/output.py +867 -0
- package/plugin/vendor/reflexio/reflexio/cli/paths.py +41 -0
- package/plugin/vendor/reflexio/reflexio/cli/run_services.py +391 -0
- package/plugin/vendor/reflexio/reflexio/cli/state.py +204 -0
- package/plugin/vendor/reflexio/reflexio/cli/stop_services.py +96 -0
- package/plugin/vendor/reflexio/reflexio/cli/utils.py +329 -0
- package/plugin/vendor/reflexio/reflexio/client/__init__.py +3 -0
- package/plugin/vendor/reflexio/reflexio/client/cache.py +150 -0
- package/plugin/vendor/reflexio/reflexio/client/client.py +2613 -0
- package/plugin/vendor/reflexio/reflexio/defaults.py +23 -0
- package/plugin/vendor/reflexio/reflexio/integrations/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/.clawhubignore +7 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/README.md +274 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/TESTING.md +517 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/hook/handler.js +473 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package-lock.json +2156 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package.json +18 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/handler.ts +241 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/setup.ts +140 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/index.ts +130 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/publish.ts +113 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/search.ts +52 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/server.ts +103 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/sqlite-buffer.ts +156 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/user-id.ts +134 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/openclaw.plugin.json +41 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/package.json +17 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/rules/reflexio.md +24 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/reflexio/SKILL.md +48 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/publish_clawhub.sh +278 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/references/HOOK.md +164 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/install.sh +36 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/uninstall.sh +35 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/publish.test.ts +27 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/search.test.ts +31 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/server.test.ts +42 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/setup.test.ts +49 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/sqlite-buffer.test.ts +91 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/user-id.test.ts +50 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tsconfig.json +16 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/types/openclaw.d.ts +230 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/vitest.config.ts +13 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/README.md +120 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/TESTING.md +168 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/package-lock.json +1657 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/package.json +16 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/HEARTBEAT.md +6 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/README.md +84 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/SKILL.md +194 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/_meta.json +6 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/agents/reflexio-extractor.md +45 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/hook/handler.ts +214 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/hook/setup.ts +55 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/index.ts +327 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/consolidate.ts +233 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/dedup.ts +80 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/io.ts +155 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/openclaw-cli.ts +67 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/search.ts +33 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/write-playbook.ts +76 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/write-profile.ts +79 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/openclaw.plugin.json +46 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/package.json +18 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/README.md +36 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/full_consolidation.md +56 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/playbook_extraction.md +217 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/profile_extraction.md +132 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/skills/reflexio-consolidate/SKILL.md +33 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/skills/reflexio-embedded/SKILL.md +194 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/HOOK.md +18 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/architecture.md +49 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/comparison.md +31 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/future-work.md +47 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/porting-notes.md +52 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/scripts/install.sh +52 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/scripts/uninstall.sh +36 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/consolidate.test.ts +135 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/dedup.test.ts +104 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/io.test.ts +175 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/search.test.ts +66 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/smoke-test.ts +140 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/write-playbook.test.ts +93 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/write-profile.test.ts +174 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tsconfig.json +16 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/types/openclaw.d.ts +230 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/vitest.config.ts +7 -0
- package/plugin/vendor/reflexio/reflexio/lib/__init__.py +23 -0
- package/plugin/vendor/reflexio/reflexio/lib/_agent_playbook.py +310 -0
- package/plugin/vendor/reflexio/reflexio/lib/_base.py +225 -0
- package/plugin/vendor/reflexio/reflexio/lib/_config.py +83 -0
- package/plugin/vendor/reflexio/reflexio/lib/_dashboard.py +266 -0
- package/plugin/vendor/reflexio/reflexio/lib/_generation.py +176 -0
- package/plugin/vendor/reflexio/reflexio/lib/_interactions.py +334 -0
- package/plugin/vendor/reflexio/reflexio/lib/_operations.py +153 -0
- package/plugin/vendor/reflexio/reflexio/lib/_profiles.py +545 -0
- package/plugin/vendor/reflexio/reflexio/lib/_reflection.py +52 -0
- package/plugin/vendor/reflexio/reflexio/lib/_search.py +167 -0
- package/plugin/vendor/reflexio/reflexio/lib/_storage_labels.py +103 -0
- package/plugin/vendor/reflexio/reflexio/lib/_user_playbook.py +288 -0
- package/plugin/vendor/reflexio/reflexio/lib/reflexio_lib.py +27 -0
- package/plugin/vendor/reflexio/reflexio/models/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/braintrust_schema.py +141 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/common.py +41 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/__init__.py +3 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/entities.py +1112 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/enums.py +63 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/eval_overview_schema.py +487 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/internal_schema.py +28 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/pending_tool_call_schema.py +83 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/retriever_schema.py +768 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/service_schemas.py +9 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/stall_state_schema.py +32 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/__init__.py +3 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/converters.py +177 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/entities.py +129 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/enums.py +25 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/validators.py +333 -0
- package/plugin/vendor/reflexio/reflexio/models/config_schema.py +908 -0
- package/plugin/vendor/reflexio/reflexio/models/py.typed +0 -0
- package/plugin/vendor/reflexio/reflexio/server/OVERVIEW.md +90 -0
- package/plugin/vendor/reflexio/reflexio/server/README.md +622 -0
- package/plugin/vendor/reflexio/reflexio/server/__init__.py +210 -0
- package/plugin/vendor/reflexio/reflexio/server/__main__.py +132 -0
- package/plugin/vendor/reflexio/reflexio/server/_auth.py +25 -0
- package/plugin/vendor/reflexio/reflexio/server/api.py +2868 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/README.md +34 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/account_api.py +143 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/health_api.py +91 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/pending_tool_call_api.py +572 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/precondition_checks.py +66 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/publisher_api.py +562 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/request_context.py +50 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/stall_state_api.py +100 -0
- package/plugin/vendor/reflexio/reflexio/server/cache/__init__.py +15 -0
- package/plugin/vendor/reflexio/reflexio/server/cache/reflexio_cache.py +208 -0
- package/plugin/vendor/reflexio/reflexio/server/correlation.py +46 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/__init__.py +30 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/embedding_service.py +359 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/image_utils.py +55 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/litellm_client.py +1871 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/llm_utils.py +140 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/model_defaults.py +479 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/claude_code_provider.py +1122 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/claude_code_stream_parser.py +197 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/embedding_service_provider.py +338 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/local_embedding_provider.py +213 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/nomic_embedding_provider.py +288 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/rerank/__init__.py +6 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/rerank/cross_encoder_reranker.py +187 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/rerank/llm_reranker.py +148 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/tools.py +716 -0
- package/plugin/vendor/reflexio/reflexio/server/operation_limiter.py +179 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/_dispatchers.py +54 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/README.md +121 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/agent_success_evaluation/v1.0.0.prompt.md +58 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/agent_success_evaluation_with_comparison/v1.0.0.prompt.md +76 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/answer_synthesis/v1.5.2.prompt.md +88 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/compress_session_for_query/v1.3.0.prompt.md +31 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/document_expansion/v1.0.0.prompt.md +20 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.0.0.prompt.md +53 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.1.0.prompt.md +57 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.2.0.prompt.md +68 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.3.0.prompt.md +70 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.4.0.prompt.md +77 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.5.0.prompt.md +82 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.6.0.prompt.md +83 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_aggregation/v2.1.0.prompt.md +193 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_aggregation/v2.2.0.prompt.md +206 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v1.0.0-deprecated.prompt.md +66 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v1.0.0.prompt.md +43 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v1.1.0.prompt.md +46 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.0.0-deprecated.prompt.md +64 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.0.0.prompt.md +39 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.1.0.prompt.md +39 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.2.0.prompt.md +47 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.3.0.prompt.md +58 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.3.1.prompt.md +69 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.3.2.prompt.md +71 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.0.2.prompt.md +254 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.1.0.prompt.md +274 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.2.0.prompt.md +283 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.2.2.prompt.md +234 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.2.3.prompt.md +244 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v1.0.0.prompt.md +73 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v2.0.0.prompt.md +86 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.0.0.prompt.md +97 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.1.0.prompt.md +119 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.2.0.prompt.md +123 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.3.0.prompt.md +137 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.0.0.prompt.md +14 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.1.0.prompt.md +24 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.2.0.prompt.md +29 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main_expert/v1.0.0.prompt.md +11 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main_expert/v1.1.0.prompt.md +21 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main_expert/v1.2.0.prompt.md +25 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_optimizer_judge/v1.0.0.prompt.md +37 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_optimizer_judge/v1.1.0.prompt.md +40 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_optimizer_judge/v1.2.0.prompt.md +36 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate/v1.0.0.prompt.md +45 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate/v2.0.0.prompt.md +81 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate/v3.0.0.prompt.md +80 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate_expert/v1.0.0.prompt.md +34 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_deduplication/v1.0.0.prompt.md +116 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_should_generate/v1.0.0.prompt.md +33 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_should_generate_override/v1.0.0.prompt.md +16 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.0.0.prompt.md +140 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.1.0.prompt.md +160 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_main/v1.0.0.prompt.md +14 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/query_reformulation/v1.0.0.prompt.md +19 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/rerank_relevance/v1.1.0.prompt.md +44 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/shadow_comparison/v1.0.0.prompt.md +43 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/shadow_content_evaluation/v1.0.0.prompt.md +33 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_evaluation/prompt_evaluation_dataset/feedback_extraction_main_v1.jsonl +10 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_evaluation/prompt_evaluation_dataset/profile_update_main_v1.jsonl +10 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_manager.py +280 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_schema.py +11 -0
- package/plugin/vendor/reflexio/reflexio/server/services/README.md +58 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/_eval_health.py +131 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_constants.py +60 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_service.py +228 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_utils.py +87 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluator.py +372 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/delayed_group_evaluator.py +156 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/group_evaluation_runner.py +336 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/regen_jobs.py +471 -0
- package/plugin/vendor/reflexio/reflexio/server/services/base_generation_service.py +1668 -0
- package/plugin/vendor/reflexio/reflexio/server/services/braintrust/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/braintrust/_cron.py +196 -0
- package/plugin/vendor/reflexio/reflexio/server/services/braintrust/_encryption.py +101 -0
- package/plugin/vendor/reflexio/reflexio/server/services/braintrust/client.py +167 -0
- package/plugin/vendor/reflexio/reflexio/server/services/braintrust/service.py +281 -0
- package/plugin/vendor/reflexio/reflexio/server/services/configurator/base_configurator.py +179 -0
- package/plugin/vendor/reflexio/reflexio/server/services/configurator/config_storage.py +62 -0
- package/plugin/vendor/reflexio/reflexio/server/services/configurator/configurator.py +87 -0
- package/plugin/vendor/reflexio/reflexio/server/services/configurator/local_file_config_storage.py +187 -0
- package/plugin/vendor/reflexio/reflexio/server/services/configurator/test_config_storage.py +162 -0
- package/plugin/vendor/reflexio/reflexio/server/services/deduplication_utils.py +112 -0
- package/plugin/vendor/reflexio/reflexio/server/services/embedding_text.py +62 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/distribution.py +33 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/eval_sampler.py +126 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/group_aggregation.py +192 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/hero_state.py +75 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/rule_attribution.py +97 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/service.py +515 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/shadow_aggregation.py +90 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/agent_run_records.py +91 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/invariants.py +303 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/outcome.py +25 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/pending_tool_call_dispatch.py +358 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/plan.py +138 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/prior_answer_search.py +217 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/resumable_agent.py +535 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/resume_scheduler.py +171 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/resume_worker.py +779 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/tools.py +1125 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extractor_config_utils.py +94 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extractor_interaction_utils.py +251 -0
- package/plugin/vendor/reflexio/reflexio/server/services/generation_service.py +702 -0
- package/plugin/vendor/reflexio/reflexio/server/services/operation_state_utils.py +835 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/README.md +89 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_aggregator.py +1388 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_consolidator.py +1045 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_extractor.py +436 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_generation_service.py +808 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_service_constants.py +28 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_service_utils.py +362 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/__init__.py +24 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/assistant_webhook.py +246 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/gepa_adapter.py +291 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/judge.py +97 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/models.py +96 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/optimizer.py +645 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/rollout.py +35 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/scenario_resolver.py +93 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/scheduler.py +174 -0
- package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/__init__.py +26 -0
- package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/_document_expander.py +179 -0
- package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/_query_reformulator.py +297 -0
- package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_deduplicator.py +772 -0
- package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_extractor.py +462 -0
- package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_generation_service.py +737 -0
- package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_generation_service_utils.py +290 -0
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/__init__.py +17 -0
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_extractor.py +247 -0
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_service.py +803 -0
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_service_utils.py +146 -0
- package/plugin/vendor/reflexio/reflexio/server/services/retrieval/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/retrieval/relevance_floor.py +80 -0
- package/plugin/vendor/reflexio/reflexio/server/services/search/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/service_utils.py +756 -0
- package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/judge.py +184 -0
- package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/outcome.py +81 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/constants.py +2 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/error.py +11 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/retention.py +154 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/retention_mixin.py +155 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/__init__.py +59 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_agent_run.py +1298 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_base.py +1945 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_extras.py +600 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_operations.py +346 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_playbook.py +1378 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_profiles.py +747 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_requests.py +263 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_shadow_verdicts.py +193 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_share_links.py +166 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_stall_state.py +217 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/__init__.py +153 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_agent_run.py +384 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_base.py +71 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_extras.py +235 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_operations.py +170 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_playbook.py +677 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_profiles.py +250 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_requests.py +154 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_shadow_verdicts.py +130 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_share_links.py +93 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_stall_state.py +76 -0
- package/plugin/vendor/reflexio/reflexio/server/services/unified_search_service.py +572 -0
- package/plugin/vendor/reflexio/reflexio/server/site_var/README.md +77 -0
- package/plugin/vendor/reflexio/reflexio/server/site_var/feature_flags.py +116 -0
- package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_manager.py +263 -0
- package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/feature_flags.json +13 -0
- package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/llm_model_setting.json +7 -0
- package/plugin/vendor/reflexio/reflexio/server/tracing.py +158 -0
- package/plugin/vendor/reflexio/reflexio/server/usage_metrics.py +113 -0
- package/plugin/vendor/reflexio/reflexio/server/uvicorn_logging.py +76 -0
- package/plugin/vendor/reflexio/reflexio/test_support/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/test_support/llm_fixtures.py +62 -0
- package/plugin/vendor/reflexio/reflexio/test_support/llm_mock.py +242 -0
- package/plugin/vendor/reflexio/reflexio/test_support/llm_model_registry.py +129 -0
- package/plugin/vendor/reflexio/reflexio/test_support/skip_decorators.py +43 -0
|
@@ -0,0 +1,677 @@
|
|
|
1
|
+
from abc import abstractmethod
|
|
2
|
+
|
|
3
|
+
from reflexio.models.api_schema.common import BlockingIssue
|
|
4
|
+
from reflexio.models.api_schema.domain import (
|
|
5
|
+
AgentPlaybook,
|
|
6
|
+
AgentPlaybookSourceWindow,
|
|
7
|
+
AgentSuccessEvaluationResult,
|
|
8
|
+
PlaybookOptimizationCandidate,
|
|
9
|
+
PlaybookOptimizationEvaluation,
|
|
10
|
+
PlaybookOptimizationEvent,
|
|
11
|
+
PlaybookOptimizationJob,
|
|
12
|
+
PlaybookStatus,
|
|
13
|
+
Status,
|
|
14
|
+
UserPlaybook,
|
|
15
|
+
)
|
|
16
|
+
from reflexio.models.api_schema.retriever_schema import (
|
|
17
|
+
SearchAgentPlaybookRequest,
|
|
18
|
+
SearchUserPlaybookRequest,
|
|
19
|
+
)
|
|
20
|
+
from reflexio.models.config_schema import SearchOptions
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class PlaybookMixin:
|
|
24
|
+
"""Mixin for playbook and agent success evaluation methods."""
|
|
25
|
+
|
|
26
|
+
# ==============================
|
|
27
|
+
# User Playbook methods
|
|
28
|
+
# ==============================
|
|
29
|
+
|
|
30
|
+
@abstractmethod
|
|
31
|
+
def save_user_playbooks(self, user_playbooks: list[UserPlaybook]) -> None:
|
|
32
|
+
raise NotImplementedError
|
|
33
|
+
|
|
34
|
+
@abstractmethod
|
|
35
|
+
def get_user_playbooks(
|
|
36
|
+
self,
|
|
37
|
+
limit: int = 100,
|
|
38
|
+
user_id: str | None = None,
|
|
39
|
+
playbook_name: str | None = None,
|
|
40
|
+
agent_version: str | None = None,
|
|
41
|
+
status_filter: list[Status | None] | None = None,
|
|
42
|
+
start_time: int | None = None,
|
|
43
|
+
end_time: int | None = None,
|
|
44
|
+
include_embedding: bool = False,
|
|
45
|
+
) -> list[UserPlaybook]:
|
|
46
|
+
"""Get user playbooks from storage.
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
limit (int): Maximum number of playbooks to return
|
|
50
|
+
user_id (str, optional): The user ID to filter by. If None, returns playbooks for all users.
|
|
51
|
+
playbook_name (str, optional): The playbook name to filter by. If None, returns all user playbooks.
|
|
52
|
+
agent_version (str, optional): The agent version to filter by. If None, returns all agent versions.
|
|
53
|
+
status_filter (list[Optional[Status]], optional): List of status values to filter by.
|
|
54
|
+
Can include None (current), Status.PENDING (from rerun), Status.ARCHIVED (old).
|
|
55
|
+
If None, returns playbooks with all statuses.
|
|
56
|
+
start_time (int, optional): Unix timestamp. Only return playbooks created at or after this time.
|
|
57
|
+
end_time (int, optional): Unix timestamp. Only return playbooks created at or before this time.
|
|
58
|
+
include_embedding (bool): If True, fetch and parse embedding vectors. Defaults to False.
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
list[UserPlaybook]: List of user playbook objects
|
|
62
|
+
"""
|
|
63
|
+
raise NotImplementedError
|
|
64
|
+
|
|
65
|
+
@abstractmethod
|
|
66
|
+
def count_user_playbooks(
|
|
67
|
+
self,
|
|
68
|
+
user_id: str | None = None,
|
|
69
|
+
playbook_name: str | None = None,
|
|
70
|
+
min_user_playbook_id: int | None = None,
|
|
71
|
+
agent_version: str | None = None,
|
|
72
|
+
status_filter: list[Status | None] | None = None,
|
|
73
|
+
) -> int:
|
|
74
|
+
"""Count user playbooks in storage efficiently.
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
user_id (str, optional): The user ID to filter by. If None, counts playbooks for all users.
|
|
78
|
+
playbook_name (str, optional): The playbook name to filter by. If None, counts all user playbooks.
|
|
79
|
+
min_user_playbook_id (int, optional): Only count playbooks with user_playbook_id greater than this value.
|
|
80
|
+
agent_version (str, optional): The agent version to filter by. If None, counts all agent versions.
|
|
81
|
+
status_filter (list[Optional[Status]], optional): List of status values to filter by.
|
|
82
|
+
Can include None (current), Status.PENDING (from rerun), Status.ARCHIVED (old).
|
|
83
|
+
If None, returns playbooks with all statuses.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
int: Count of user playbooks matching the filters
|
|
87
|
+
"""
|
|
88
|
+
raise NotImplementedError
|
|
89
|
+
|
|
90
|
+
@abstractmethod
|
|
91
|
+
def count_user_playbooks_by_session(self, session_id: str) -> int:
|
|
92
|
+
"""Count user playbooks linked to a session via request_id -> requests.session_id.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
session_id (str): The session ID to count user playbooks for
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
int: Count of user playbooks linked to the session
|
|
99
|
+
"""
|
|
100
|
+
raise NotImplementedError
|
|
101
|
+
|
|
102
|
+
@abstractmethod
|
|
103
|
+
def delete_all_user_playbooks(self) -> None:
|
|
104
|
+
"""Delete all user playbooks from storage."""
|
|
105
|
+
raise NotImplementedError
|
|
106
|
+
|
|
107
|
+
@abstractmethod
|
|
108
|
+
def delete_all_user_playbooks_by_playbook_name(
|
|
109
|
+
self, playbook_name: str, agent_version: str | None = None
|
|
110
|
+
) -> None:
|
|
111
|
+
"""Delete all user playbooks by playbook name from storage.
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
playbook_name (str): The playbook name to delete
|
|
115
|
+
agent_version (str, optional): The agent version to filter by. If None, deletes all agent versions.
|
|
116
|
+
"""
|
|
117
|
+
raise NotImplementedError
|
|
118
|
+
|
|
119
|
+
@abstractmethod
|
|
120
|
+
def delete_user_playbook(self, user_playbook_id: int) -> None:
|
|
121
|
+
"""Delete a user playbook by ID.
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
user_playbook_id (int): The ID of the user playbook to delete
|
|
125
|
+
"""
|
|
126
|
+
raise NotImplementedError
|
|
127
|
+
|
|
128
|
+
@abstractmethod
|
|
129
|
+
def update_all_user_playbooks_status(
|
|
130
|
+
self,
|
|
131
|
+
old_status: Status | None,
|
|
132
|
+
new_status: Status | None,
|
|
133
|
+
agent_version: str | None = None,
|
|
134
|
+
playbook_name: str | None = None,
|
|
135
|
+
) -> int:
|
|
136
|
+
"""Update all user playbooks with old_status to new_status atomically.
|
|
137
|
+
|
|
138
|
+
Args:
|
|
139
|
+
old_status: The current status to match (None for CURRENT)
|
|
140
|
+
new_status: The new status to set (None for CURRENT)
|
|
141
|
+
agent_version: Optional filter by agent version
|
|
142
|
+
playbook_name: Optional filter by playbook name
|
|
143
|
+
|
|
144
|
+
Returns:
|
|
145
|
+
int: Number of user playbooks updated
|
|
146
|
+
"""
|
|
147
|
+
raise NotImplementedError
|
|
148
|
+
|
|
149
|
+
@abstractmethod
|
|
150
|
+
def delete_all_user_playbooks_by_status(
|
|
151
|
+
self,
|
|
152
|
+
status: Status,
|
|
153
|
+
agent_version: str | None = None,
|
|
154
|
+
playbook_name: str | None = None,
|
|
155
|
+
) -> int:
|
|
156
|
+
"""Delete all user playbooks with the given status atomically.
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
status: The status of user playbooks to delete
|
|
160
|
+
agent_version: Optional filter by agent version
|
|
161
|
+
playbook_name: Optional filter by playbook name
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
int: Number of user playbooks deleted
|
|
165
|
+
"""
|
|
166
|
+
raise NotImplementedError
|
|
167
|
+
|
|
168
|
+
@abstractmethod
|
|
169
|
+
def delete_user_playbooks_by_ids(self, user_playbook_ids: list[int]) -> int:
|
|
170
|
+
"""Delete user playbooks by their IDs.
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
user_playbook_ids: List of user_playbook_id values to delete
|
|
174
|
+
|
|
175
|
+
Returns:
|
|
176
|
+
int: Number of user playbooks deleted
|
|
177
|
+
"""
|
|
178
|
+
raise NotImplementedError
|
|
179
|
+
|
|
180
|
+
@abstractmethod
|
|
181
|
+
def get_user_playbooks_by_ids(
|
|
182
|
+
self,
|
|
183
|
+
user_id: str,
|
|
184
|
+
user_playbook_ids: list[int],
|
|
185
|
+
status_filter: list[Status | None] | None = None,
|
|
186
|
+
) -> list[UserPlaybook]:
|
|
187
|
+
"""Fetch the subset of a user's playbooks whose ids are in the list.
|
|
188
|
+
|
|
189
|
+
Server-side filter on (``user_id``, ``user_playbook_id IN (...)``)
|
|
190
|
+
so callers (e.g. the reflection service resolving a small set of
|
|
191
|
+
cited playbook ids) avoid scanning every playbook for the user.
|
|
192
|
+
|
|
193
|
+
Args:
|
|
194
|
+
user_id (str): Owning user id.
|
|
195
|
+
user_playbook_ids (list[int]): Playbook ids to fetch. Empty
|
|
196
|
+
list returns ``[]`` without hitting storage.
|
|
197
|
+
status_filter (list[Status | None] | None): Statuses to
|
|
198
|
+
include. ``None`` (default) means CURRENT only — same
|
|
199
|
+
default as ``get_user_playbooks`` for consistency.
|
|
200
|
+
|
|
201
|
+
Returns:
|
|
202
|
+
list[UserPlaybook]: Matching playbooks. Order is unspecified.
|
|
203
|
+
Ids that do not exist (or do not match the user / status
|
|
204
|
+
filter) are silently omitted.
|
|
205
|
+
"""
|
|
206
|
+
raise NotImplementedError
|
|
207
|
+
|
|
208
|
+
@abstractmethod
|
|
209
|
+
def get_user_playbook_by_id(self, user_playbook_id: int) -> UserPlaybook | None:
|
|
210
|
+
"""Fetch one user playbook by id, regardless of owner."""
|
|
211
|
+
raise NotImplementedError
|
|
212
|
+
|
|
213
|
+
@abstractmethod
|
|
214
|
+
def get_user_playbooks_by_ids_any_user(
|
|
215
|
+
self,
|
|
216
|
+
user_playbook_ids: list[int],
|
|
217
|
+
status_filter: list[Status | None] | None = None,
|
|
218
|
+
) -> list[UserPlaybook]:
|
|
219
|
+
"""Fetch user playbooks by ids without requiring a single owner id."""
|
|
220
|
+
raise NotImplementedError
|
|
221
|
+
|
|
222
|
+
@abstractmethod
|
|
223
|
+
def archive_user_playbook_by_id(self, user_id: str, user_playbook_id: int) -> bool:
|
|
224
|
+
"""Atomically archive a single user playbook by id, only if CURRENT.
|
|
225
|
+
|
|
226
|
+
Flips the row's ``status`` from ``None`` (CURRENT) to
|
|
227
|
+
``Status.ARCHIVED``. No-op when the playbook does not exist, has
|
|
228
|
+
a different ``user_id``, or is already non-current.
|
|
229
|
+
|
|
230
|
+
Args:
|
|
231
|
+
user_id (str): Owning user id; used as a guard so callers
|
|
232
|
+
cannot accidentally archive another user's playbook.
|
|
233
|
+
user_playbook_id (int): The user_playbook_id to archive.
|
|
234
|
+
|
|
235
|
+
Returns:
|
|
236
|
+
bool: True if a row was archived; False otherwise.
|
|
237
|
+
"""
|
|
238
|
+
raise NotImplementedError
|
|
239
|
+
|
|
240
|
+
@abstractmethod
|
|
241
|
+
def has_user_playbooks_with_status(
|
|
242
|
+
self,
|
|
243
|
+
status: Status | None,
|
|
244
|
+
agent_version: str | None = None,
|
|
245
|
+
playbook_name: str | None = None,
|
|
246
|
+
) -> bool:
|
|
247
|
+
"""Check if any user playbooks exist with given status and filters.
|
|
248
|
+
|
|
249
|
+
Args:
|
|
250
|
+
status: The status to check for (None for CURRENT)
|
|
251
|
+
agent_version: Optional filter by agent version
|
|
252
|
+
playbook_name: Optional filter by playbook name
|
|
253
|
+
|
|
254
|
+
Returns:
|
|
255
|
+
bool: True if any matching user playbooks exist
|
|
256
|
+
"""
|
|
257
|
+
raise NotImplementedError
|
|
258
|
+
|
|
259
|
+
# ==============================
|
|
260
|
+
# Agent Playbook methods
|
|
261
|
+
# ==============================
|
|
262
|
+
|
|
263
|
+
@abstractmethod
|
|
264
|
+
def save_agent_playbooks(
|
|
265
|
+
self, agent_playbooks: list[AgentPlaybook]
|
|
266
|
+
) -> list[AgentPlaybook]:
|
|
267
|
+
"""Save agent playbooks with embeddings.
|
|
268
|
+
|
|
269
|
+
Args:
|
|
270
|
+
agent_playbooks (list[AgentPlaybook]): List of agent playbook objects to save
|
|
271
|
+
|
|
272
|
+
Returns:
|
|
273
|
+
list[AgentPlaybook]: Saved agent playbooks with agent_playbook_id populated from storage
|
|
274
|
+
"""
|
|
275
|
+
raise NotImplementedError
|
|
276
|
+
|
|
277
|
+
@abstractmethod
|
|
278
|
+
def get_agent_playbooks(
|
|
279
|
+
self,
|
|
280
|
+
limit: int = 100,
|
|
281
|
+
playbook_name: str | None = None,
|
|
282
|
+
agent_version: str | None = None,
|
|
283
|
+
status_filter: list[Status | None] | None = None,
|
|
284
|
+
playbook_status_filter: list[PlaybookStatus] | None = None,
|
|
285
|
+
) -> list[AgentPlaybook]:
|
|
286
|
+
"""Get agent playbooks from storage.
|
|
287
|
+
|
|
288
|
+
Args:
|
|
289
|
+
limit (int): Maximum number of agent playbooks to return
|
|
290
|
+
playbook_name (str, optional): The playbook name to filter by. If None, returns all agent playbooks.
|
|
291
|
+
agent_version (str, optional): The agent version to filter by. If None, returns all versions.
|
|
292
|
+
status_filter (list[Optional[Status]], optional): List of Status values to filter by. None in the list means CURRENT status.
|
|
293
|
+
playbook_status_filter (Optional[list[PlaybookStatus]]): List of PlaybookStatus values to filter by.
|
|
294
|
+
If None, returns all playbook statuses.
|
|
295
|
+
|
|
296
|
+
Returns:
|
|
297
|
+
list[AgentPlaybook]: List of agent playbook objects
|
|
298
|
+
"""
|
|
299
|
+
raise NotImplementedError
|
|
300
|
+
|
|
301
|
+
@abstractmethod
|
|
302
|
+
def get_agent_playbook_by_id(self, agent_playbook_id: int) -> AgentPlaybook | None:
|
|
303
|
+
"""Fetch one agent playbook by id."""
|
|
304
|
+
raise NotImplementedError
|
|
305
|
+
|
|
306
|
+
@abstractmethod
|
|
307
|
+
def delete_all_agent_playbooks(self) -> None:
|
|
308
|
+
"""Delete all agent playbooks from storage."""
|
|
309
|
+
raise NotImplementedError
|
|
310
|
+
|
|
311
|
+
@abstractmethod
|
|
312
|
+
def delete_agent_playbook(self, agent_playbook_id: int) -> None:
|
|
313
|
+
"""Delete an agent playbook by ID.
|
|
314
|
+
|
|
315
|
+
Args:
|
|
316
|
+
agent_playbook_id (int): The ID of the agent playbook to delete
|
|
317
|
+
"""
|
|
318
|
+
raise NotImplementedError
|
|
319
|
+
|
|
320
|
+
@abstractmethod
|
|
321
|
+
def delete_all_agent_playbooks_by_playbook_name(
|
|
322
|
+
self, playbook_name: str, agent_version: str | None = None
|
|
323
|
+
) -> None:
|
|
324
|
+
"""Delete all agent playbooks by playbook name from storage.
|
|
325
|
+
|
|
326
|
+
Args:
|
|
327
|
+
playbook_name (str): The playbook name to delete
|
|
328
|
+
agent_version (str, optional): The agent version to filter by. If None, deletes all agent versions.
|
|
329
|
+
"""
|
|
330
|
+
raise NotImplementedError
|
|
331
|
+
|
|
332
|
+
@abstractmethod
|
|
333
|
+
def update_agent_playbook_status(
|
|
334
|
+
self, agent_playbook_id: int, playbook_status: PlaybookStatus
|
|
335
|
+
) -> None:
|
|
336
|
+
"""Update the status of a specific agent playbook.
|
|
337
|
+
|
|
338
|
+
Args:
|
|
339
|
+
agent_playbook_id (int): The ID of the agent playbook to update
|
|
340
|
+
playbook_status (PlaybookStatus): The new status to set
|
|
341
|
+
|
|
342
|
+
Raises:
|
|
343
|
+
ValueError: If agent playbook with the given ID is not found
|
|
344
|
+
"""
|
|
345
|
+
raise NotImplementedError
|
|
346
|
+
|
|
347
|
+
@abstractmethod
|
|
348
|
+
def update_agent_playbook(
|
|
349
|
+
self,
|
|
350
|
+
agent_playbook_id: int,
|
|
351
|
+
playbook_name: str | None = None,
|
|
352
|
+
content: str | None = None,
|
|
353
|
+
trigger: str | None = None,
|
|
354
|
+
rationale: str | None = None,
|
|
355
|
+
blocking_issue: BlockingIssue | None = None,
|
|
356
|
+
playbook_status: PlaybookStatus | None = None,
|
|
357
|
+
) -> None:
|
|
358
|
+
"""Update editable fields of an agent playbook. Only non-None fields are updated.
|
|
359
|
+
|
|
360
|
+
Args:
|
|
361
|
+
agent_playbook_id (int): The ID of the agent playbook to update
|
|
362
|
+
playbook_name (str, optional): New playbook name
|
|
363
|
+
content (str, optional): New content text
|
|
364
|
+
trigger (str, optional): New trigger text
|
|
365
|
+
rationale (str, optional): New rationale text
|
|
366
|
+
blocking_issue (BlockingIssue, optional): New blocking issue
|
|
367
|
+
playbook_status (PlaybookStatus, optional): New playbook status
|
|
368
|
+
|
|
369
|
+
Raises:
|
|
370
|
+
ValueError: If agent playbook with the given ID is not found
|
|
371
|
+
"""
|
|
372
|
+
raise NotImplementedError
|
|
373
|
+
|
|
374
|
+
@abstractmethod
|
|
375
|
+
def update_user_playbook(
|
|
376
|
+
self,
|
|
377
|
+
user_playbook_id: int,
|
|
378
|
+
playbook_name: str | None = None,
|
|
379
|
+
content: str | None = None,
|
|
380
|
+
trigger: str | None = None,
|
|
381
|
+
rationale: str | None = None,
|
|
382
|
+
blocking_issue: BlockingIssue | None = None,
|
|
383
|
+
) -> None:
|
|
384
|
+
"""Update editable fields of a user playbook. Only non-None fields are updated.
|
|
385
|
+
|
|
386
|
+
Args:
|
|
387
|
+
user_playbook_id (int): The ID of the user playbook to update
|
|
388
|
+
playbook_name (str, optional): New playbook name
|
|
389
|
+
content (str, optional): New content text
|
|
390
|
+
trigger (str, optional): New trigger text
|
|
391
|
+
rationale (str, optional): New rationale text
|
|
392
|
+
blocking_issue (BlockingIssue, optional): New blocking issue
|
|
393
|
+
|
|
394
|
+
Raises:
|
|
395
|
+
ValueError: If user playbook with the given ID is not found
|
|
396
|
+
"""
|
|
397
|
+
raise NotImplementedError
|
|
398
|
+
|
|
399
|
+
@abstractmethod
|
|
400
|
+
def archive_agent_playbooks_by_playbook_name(
|
|
401
|
+
self, playbook_name: str, agent_version: str | None = None
|
|
402
|
+
) -> None:
|
|
403
|
+
"""Archive non-APPROVED agent playbooks by setting their status field to 'archived'.
|
|
404
|
+
APPROVED agent playbooks are left untouched to preserve user-approved playbooks.
|
|
405
|
+
|
|
406
|
+
Args:
|
|
407
|
+
playbook_name (str): The playbook name to archive
|
|
408
|
+
agent_version (str, optional): The agent version to filter by. If None, archives all agent versions.
|
|
409
|
+
"""
|
|
410
|
+
raise NotImplementedError
|
|
411
|
+
|
|
412
|
+
@abstractmethod
|
|
413
|
+
def archive_agent_playbooks_by_ids(self, agent_playbook_ids: list[int]) -> None:
|
|
414
|
+
"""Archive non-APPROVED agent playbooks by IDs, setting their status field to 'archived'.
|
|
415
|
+
APPROVED agent playbooks are left untouched. No-op if agent_playbook_ids is empty.
|
|
416
|
+
|
|
417
|
+
Args:
|
|
418
|
+
agent_playbook_ids (list[int]): List of agent playbook IDs to archive
|
|
419
|
+
"""
|
|
420
|
+
raise NotImplementedError
|
|
421
|
+
|
|
422
|
+
@abstractmethod
|
|
423
|
+
def restore_archived_agent_playbooks_by_playbook_name(
|
|
424
|
+
self, playbook_name: str, agent_version: str | None = None
|
|
425
|
+
) -> None:
|
|
426
|
+
"""Restore archived agent playbooks by setting their status field to null.
|
|
427
|
+
|
|
428
|
+
Args:
|
|
429
|
+
playbook_name (str): The playbook name to restore
|
|
430
|
+
agent_version (str, optional): The agent version to filter by. If None, restores all agent versions.
|
|
431
|
+
"""
|
|
432
|
+
raise NotImplementedError
|
|
433
|
+
|
|
434
|
+
@abstractmethod
|
|
435
|
+
def restore_archived_agent_playbooks_by_ids(
|
|
436
|
+
self, agent_playbook_ids: list[int]
|
|
437
|
+
) -> None:
|
|
438
|
+
"""Restore archived agent playbooks by IDs, setting their status field to null.
|
|
439
|
+
No-op if agent_playbook_ids is empty.
|
|
440
|
+
|
|
441
|
+
Args:
|
|
442
|
+
agent_playbook_ids (list[int]): List of agent playbook IDs to restore
|
|
443
|
+
"""
|
|
444
|
+
raise NotImplementedError
|
|
445
|
+
|
|
446
|
+
# ==============================
|
|
447
|
+
# Playbook optimization methods
|
|
448
|
+
# ==============================
|
|
449
|
+
|
|
450
|
+
@abstractmethod
|
|
451
|
+
def set_source_user_playbook_ids_for_agent_playbook(
|
|
452
|
+
self, agent_playbook_id: int, user_playbook_ids: list[int]
|
|
453
|
+
) -> None:
|
|
454
|
+
"""Persist the source user playbook ids that produced an agent playbook."""
|
|
455
|
+
raise NotImplementedError
|
|
456
|
+
|
|
457
|
+
@abstractmethod
|
|
458
|
+
def get_source_user_playbook_ids_for_agent_playbook(
|
|
459
|
+
self, agent_playbook_id: int
|
|
460
|
+
) -> list[int]:
|
|
461
|
+
"""Return source user playbook ids for an agent playbook."""
|
|
462
|
+
raise NotImplementedError
|
|
463
|
+
|
|
464
|
+
@abstractmethod
|
|
465
|
+
def set_source_windows_for_agent_playbook(
|
|
466
|
+
self,
|
|
467
|
+
agent_playbook_id: int,
|
|
468
|
+
source_windows: list[AgentPlaybookSourceWindow],
|
|
469
|
+
) -> None:
|
|
470
|
+
"""Persist replayable source windows that produced an agent playbook."""
|
|
471
|
+
raise NotImplementedError
|
|
472
|
+
|
|
473
|
+
@abstractmethod
|
|
474
|
+
def get_source_windows_for_agent_playbook(
|
|
475
|
+
self, agent_playbook_id: int
|
|
476
|
+
) -> list[AgentPlaybookSourceWindow]:
|
|
477
|
+
"""Return replayable source windows for an agent playbook."""
|
|
478
|
+
raise NotImplementedError
|
|
479
|
+
|
|
480
|
+
@abstractmethod
|
|
481
|
+
def create_playbook_optimization_job(
|
|
482
|
+
self, job: PlaybookOptimizationJob
|
|
483
|
+
) -> PlaybookOptimizationJob:
|
|
484
|
+
"""Persist a playbook optimization job and return it with id populated."""
|
|
485
|
+
raise NotImplementedError
|
|
486
|
+
|
|
487
|
+
@abstractmethod
|
|
488
|
+
def update_playbook_optimization_job(
|
|
489
|
+
self,
|
|
490
|
+
job_id: int,
|
|
491
|
+
*,
|
|
492
|
+
status: str | None = None,
|
|
493
|
+
best_candidate_id: int | None = None,
|
|
494
|
+
successor_target_id: int | None = None,
|
|
495
|
+
decision_reason: str | None = None,
|
|
496
|
+
metadata_json: str | None = None,
|
|
497
|
+
) -> None:
|
|
498
|
+
"""Update mutable fields on a playbook optimization job."""
|
|
499
|
+
raise NotImplementedError
|
|
500
|
+
|
|
501
|
+
@abstractmethod
|
|
502
|
+
def insert_playbook_optimization_candidate(
|
|
503
|
+
self, candidate: PlaybookOptimizationCandidate
|
|
504
|
+
) -> PlaybookOptimizationCandidate:
|
|
505
|
+
"""Persist an optimizer candidate and return it with id populated."""
|
|
506
|
+
raise NotImplementedError
|
|
507
|
+
|
|
508
|
+
@abstractmethod
|
|
509
|
+
def list_playbook_optimization_candidates(
|
|
510
|
+
self, job_id: int
|
|
511
|
+
) -> list[PlaybookOptimizationCandidate]:
|
|
512
|
+
"""List optimizer candidates for a job."""
|
|
513
|
+
raise NotImplementedError
|
|
514
|
+
|
|
515
|
+
@abstractmethod
|
|
516
|
+
def update_playbook_optimization_candidate(
|
|
517
|
+
self,
|
|
518
|
+
candidate_id: int,
|
|
519
|
+
*,
|
|
520
|
+
aggregate_score: float | None = None,
|
|
521
|
+
is_winner: bool | None = None,
|
|
522
|
+
) -> None:
|
|
523
|
+
"""Update mutable optimizer candidate result fields."""
|
|
524
|
+
raise NotImplementedError
|
|
525
|
+
|
|
526
|
+
@abstractmethod
|
|
527
|
+
def insert_playbook_optimization_evaluation(
|
|
528
|
+
self, evaluation: PlaybookOptimizationEvaluation
|
|
529
|
+
) -> PlaybookOptimizationEvaluation:
|
|
530
|
+
"""Persist an optimizer evaluation and return it with id populated."""
|
|
531
|
+
raise NotImplementedError
|
|
532
|
+
|
|
533
|
+
@abstractmethod
|
|
534
|
+
def list_playbook_optimization_evaluations(
|
|
535
|
+
self, job_id: int
|
|
536
|
+
) -> list[PlaybookOptimizationEvaluation]:
|
|
537
|
+
"""List optimizer evaluations for a job."""
|
|
538
|
+
raise NotImplementedError
|
|
539
|
+
|
|
540
|
+
@abstractmethod
|
|
541
|
+
def insert_playbook_optimization_event(
|
|
542
|
+
self, event: PlaybookOptimizationEvent
|
|
543
|
+
) -> PlaybookOptimizationEvent:
|
|
544
|
+
"""Persist an optimizer callback/event and return it with id populated."""
|
|
545
|
+
raise NotImplementedError
|
|
546
|
+
|
|
547
|
+
@abstractmethod
|
|
548
|
+
def delete_archived_agent_playbooks_by_playbook_name(
|
|
549
|
+
self, playbook_name: str, agent_version: str | None = None
|
|
550
|
+
) -> None:
|
|
551
|
+
"""Permanently delete agent playbooks that have status='archived'.
|
|
552
|
+
|
|
553
|
+
Args:
|
|
554
|
+
playbook_name (str): The playbook name to delete
|
|
555
|
+
agent_version (str, optional): The agent version to filter by. If None, deletes all agent versions.
|
|
556
|
+
"""
|
|
557
|
+
raise NotImplementedError
|
|
558
|
+
|
|
559
|
+
@abstractmethod
|
|
560
|
+
def delete_agent_playbooks_by_ids(self, agent_playbook_ids: list[int]) -> None:
|
|
561
|
+
"""Permanently delete agent playbooks by their IDs.
|
|
562
|
+
No-op if agent_playbook_ids is empty.
|
|
563
|
+
|
|
564
|
+
Args:
|
|
565
|
+
agent_playbook_ids (list[int]): List of agent playbook IDs to delete
|
|
566
|
+
"""
|
|
567
|
+
raise NotImplementedError
|
|
568
|
+
|
|
569
|
+
# ==============================
|
|
570
|
+
# Search methods
|
|
571
|
+
# ==============================
|
|
572
|
+
|
|
573
|
+
@abstractmethod
|
|
574
|
+
def search_user_playbooks(
|
|
575
|
+
self,
|
|
576
|
+
request: SearchUserPlaybookRequest,
|
|
577
|
+
options: SearchOptions | None = None,
|
|
578
|
+
) -> list[UserPlaybook]:
|
|
579
|
+
"""Search user playbooks with advanced filtering including semantic search.
|
|
580
|
+
|
|
581
|
+
Args:
|
|
582
|
+
request (SearchUserPlaybookRequest): Search request with query, filters, and pagination
|
|
583
|
+
options (SearchOptions, optional): Engine-level search parameters (e.g. pre-computed embedding)
|
|
584
|
+
|
|
585
|
+
Returns:
|
|
586
|
+
list[UserPlaybook]: List of matching user playbook objects
|
|
587
|
+
"""
|
|
588
|
+
raise NotImplementedError
|
|
589
|
+
|
|
590
|
+
@abstractmethod
|
|
591
|
+
def search_agent_playbooks(
|
|
592
|
+
self,
|
|
593
|
+
request: SearchAgentPlaybookRequest,
|
|
594
|
+
options: SearchOptions | None = None,
|
|
595
|
+
) -> list[AgentPlaybook]:
|
|
596
|
+
"""Search agent playbooks with advanced filtering including semantic search.
|
|
597
|
+
|
|
598
|
+
Args:
|
|
599
|
+
request (SearchAgentPlaybookRequest): Search request with query, filters, and pagination
|
|
600
|
+
options (SearchOptions, optional): Engine-level search parameters (e.g. pre-computed embedding)
|
|
601
|
+
|
|
602
|
+
Returns:
|
|
603
|
+
list[AgentPlaybook]: List of matching agent playbook objects
|
|
604
|
+
"""
|
|
605
|
+
raise NotImplementedError
|
|
606
|
+
|
|
607
|
+
# ==============================
|
|
608
|
+
# Agent Success Evaluation methods
|
|
609
|
+
# ==============================
|
|
610
|
+
|
|
611
|
+
@abstractmethod
|
|
612
|
+
def save_agent_success_evaluation_results(
|
|
613
|
+
self, results: list[AgentSuccessEvaluationResult]
|
|
614
|
+
) -> None:
|
|
615
|
+
"""Save agent success evaluation results to storage.
|
|
616
|
+
|
|
617
|
+
Args:
|
|
618
|
+
results (list[AgentSuccessEvaluationResult]): List of agent success evaluation results to save
|
|
619
|
+
"""
|
|
620
|
+
raise NotImplementedError
|
|
621
|
+
|
|
622
|
+
@abstractmethod
|
|
623
|
+
def get_agent_success_evaluation_results(
|
|
624
|
+
self, limit: int = 100, agent_version: str | None = None
|
|
625
|
+
) -> list[AgentSuccessEvaluationResult]:
|
|
626
|
+
"""Get agent success evaluation results from storage.
|
|
627
|
+
|
|
628
|
+
Args:
|
|
629
|
+
limit (int): Maximum number of results to return
|
|
630
|
+
agent_version (str, optional): The agent version to filter by. If None, returns all results.
|
|
631
|
+
|
|
632
|
+
Returns:
|
|
633
|
+
list[AgentSuccessEvaluationResult]: List of agent success evaluation result objects
|
|
634
|
+
"""
|
|
635
|
+
raise NotImplementedError
|
|
636
|
+
|
|
637
|
+
@abstractmethod
|
|
638
|
+
def delete_all_agent_success_evaluation_results(self) -> None:
|
|
639
|
+
"""Delete all agent success evaluation results from storage."""
|
|
640
|
+
raise NotImplementedError
|
|
641
|
+
|
|
642
|
+
@abstractmethod
|
|
643
|
+
def delete_agent_success_evaluation_results_for_session(
|
|
644
|
+
self,
|
|
645
|
+
session_id: str,
|
|
646
|
+
evaluation_name: str,
|
|
647
|
+
agent_version: str,
|
|
648
|
+
) -> int:
|
|
649
|
+
"""Delete stored results for (session_id, evaluation_name, agent_version).
|
|
650
|
+
|
|
651
|
+
Args:
|
|
652
|
+
session_id (str): Session whose results to clear.
|
|
653
|
+
evaluation_name (str): Which evaluator's results to clear.
|
|
654
|
+
agent_version (str): Agent version scope.
|
|
655
|
+
|
|
656
|
+
Returns:
|
|
657
|
+
int: Number of rows deleted.
|
|
658
|
+
"""
|
|
659
|
+
raise NotImplementedError
|
|
660
|
+
|
|
661
|
+
@abstractmethod
|
|
662
|
+
def delete_agent_success_evaluation_results_by_ids(
|
|
663
|
+
self, result_ids: list[int]
|
|
664
|
+
) -> int:
|
|
665
|
+
"""Delete agent success eval results matching specific result_ids.
|
|
666
|
+
|
|
667
|
+
Used by the regenerate flow to remove only the prior-run rows after the
|
|
668
|
+
new rows have been saved durably (so an LLM/save failure cannot leave
|
|
669
|
+
the session with zero rows).
|
|
670
|
+
|
|
671
|
+
Args:
|
|
672
|
+
result_ids (list[int]): Primary-key result_ids to delete.
|
|
673
|
+
|
|
674
|
+
Returns:
|
|
675
|
+
int: Number of rows deleted.
|
|
676
|
+
"""
|
|
677
|
+
raise NotImplementedError
|