claude-smart 0.2.45 → 0.2.47
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 +47 -10
- package/bin/claude-smart.js +535 -23
- package/package.json +22 -3
- package/plugin/.claude-plugin/plugin.json +4 -2
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/README.md +27 -6
- package/plugin/commands/clear-all.md +1 -0
- package/plugin/commands/dashboard.md +1 -0
- package/plugin/commands/learn.md +1 -0
- package/plugin/commands/restart.md +1 -0
- package/plugin/commands/show.md +1 -0
- package/plugin/dashboard/app/configure/env/page.tsx +40 -14
- package/plugin/dashboard/app/configure/server/page.tsx +51 -1
- package/plugin/dashboard/app/layout.tsx +20 -0
- package/plugin/dashboard/app/preferences/[id]/page.tsx +8 -8
- package/plugin/dashboard/app/skills/project/[id]/page.tsx +7 -3
- package/plugin/dashboard/app/skills/shared/[id]/page.tsx +10 -3
- package/plugin/dashboard/lib/claude-settings-file.ts +20 -10
- package/plugin/dashboard/lib/reflexio-client.ts +16 -0
- package/plugin/dashboard/lib/status.ts +10 -3
- package/plugin/dashboard/lib/types.ts +18 -6
- package/plugin/hooks/codex-hooks.json +0 -1
- package/plugin/opencode/assistant-buffer.ts +108 -0
- package/plugin/opencode/dist/assistant-buffer.js +96 -0
- package/plugin/opencode/dist/internal.js +12 -0
- package/plugin/opencode/dist/payload.js +85 -0
- package/plugin/opencode/dist/server.mjs +232 -0
- package/plugin/opencode/internal.ts +18 -0
- package/plugin/opencode/package.json +3 -0
- package/plugin/opencode/payload.ts +90 -0
- package/plugin/opencode/server.mts +251 -0
- package/plugin/opencode/tsconfig.json +13 -0
- package/plugin/pyproject.toml +25 -4
- package/plugin/scripts/_lib.sh +5 -1
- package/plugin/scripts/backend-service.sh +22 -2
- package/plugin/scripts/ensure-plugin-root.sh +4 -4
- package/plugin/scripts/hook_entry.sh +1 -1
- package/plugin/scripts/opencode-claude-compat +4 -0
- package/plugin/scripts/opencode-claude-compat.cmd +3 -0
- package/plugin/scripts/opencode-claude-compat.js +225 -0
- package/plugin/scripts/smart-install.sh +17 -9
- package/plugin/src/README.md +1 -1
- package/plugin/src/claude_smart/cli.py +498 -12
- package/plugin/src/claude_smart/context_format.py +9 -9
- package/plugin/src/claude_smart/cs_cite.py +66 -19
- package/plugin/src/claude_smart/env_config.py +12 -4
- package/plugin/src/claude_smart/events/session_start.py +26 -7
- package/plugin/src/claude_smart/events/stop.py +1 -1
- package/plugin/src/claude_smart/ids.py +1 -1
- package/plugin/src/claude_smart/reflexio_adapter.py +5 -5
- package/plugin/src/claude_smart/runtime.py +7 -1
- package/plugin/uv.lock +5 -5
- package/plugin/vendor/reflexio/.env.example +54 -30
- package/plugin/vendor/reflexio/README.md +17 -11
- package/plugin/vendor/reflexio/pyproject.toml +13 -1
- package/plugin/vendor/reflexio/reflexio/README.md +4 -1
- package/plugin/vendor/reflexio/reflexio/cli/README.md +9 -7
- package/plugin/vendor/reflexio/reflexio/cli/__main__.py +10 -1
- package/plugin/vendor/reflexio/reflexio/cli/bootstrap_config.py +22 -5
- package/plugin/vendor/reflexio/reflexio/cli/commands/interactions.py +34 -4
- package/plugin/vendor/reflexio/reflexio/cli/commands/profiles.py +12 -7
- package/plugin/vendor/reflexio/reflexio/cli/commands/services.py +13 -6
- package/plugin/vendor/reflexio/reflexio/cli/commands/setup_cmd.py +212 -52
- package/plugin/vendor/reflexio/reflexio/cli/commands/shortcuts.py +15 -2
- package/plugin/vendor/reflexio/reflexio/cli/env_loader.py +292 -22
- package/plugin/vendor/reflexio/reflexio/cli/log_format.py +29 -4
- package/plugin/vendor/reflexio/reflexio/cli/run_services.py +17 -8
- package/plugin/vendor/reflexio/reflexio/cli/stop_services.py +13 -10
- package/plugin/vendor/reflexio/reflexio/cli/utils.py +44 -1
- package/plugin/vendor/reflexio/reflexio/client/client.py +154 -13
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/README.md +135 -257
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/npm/openclaw-smart/bin/openclaw-smart.js +13 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/npm/openclaw-smart/package.json +15 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/README.md +38 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/index.ts +151 -110
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/openclaw.plugin.json +20 -10
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/package.json +28 -6
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/pyproject.toml +42 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/_lib.sh +371 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/backend-log-runner.sh +33 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/backend-service.sh +271 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/cli.sh +68 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/dashboard-open.sh +15 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/ensure-plugin-root.sh +84 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/hook_entry.sh +106 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/npm-cli.js +219 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/smart-install.sh +269 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/clear-all/SKILL.md +8 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/dashboard/SKILL.md +8 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/learn/SKILL.md +10 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/reflexio/SKILL.md +15 -44
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/restart/SKILL.md +6 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/show/SKILL.md +8 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/cli.py +634 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/context_format.py +224 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/context_inject.py +79 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/after_tool_call.py +160 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/agent_end.py +187 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/before_prompt_build.py +69 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/before_tool_call.py +30 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/session_end.py +36 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/session_start.py +130 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/hook.py +131 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/ids.py +94 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/internal_call.py +75 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/oc_cite.py +196 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/optimizer_assistant.py +272 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/publish.py +96 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/query_compose.py +66 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/reflexio_adapter.py +336 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/runtime.py +47 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/stall_banner.py +61 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/state.py +323 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/test_e2e_session_loop.py +190 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/test_publish_to_local_reflexio_integration.py +112 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/test_recursion_guard_integration.py +86 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/test_search_inject_integration.py +144 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_cli.py +184 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_after_tool_call.py +142 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_agent_end.py +233 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_before_prompt_build.py +116 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_before_tool_call.py +35 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_session_end.py +47 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_session_start.py +109 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_hook_dispatch.py +117 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_ids.py +41 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_internal_call.py +50 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_oc_cite.py +88 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_publish.py +48 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_query_compose.py +48 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_reflexio_adapter.py +188 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_runtime.py +41 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_state.py +235 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests-ts/__mocks__/plugin-entry-stub.ts +6 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests-ts/test_npm_cli.test.ts +56 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests-ts/test_shim_dispatch.test.ts +171 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tsconfig.build.json +18 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/{tsconfig.json → plugin/tsconfig.json} +2 -2
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/uv.lock +3835 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/vitest.config.ts +18 -0
- package/plugin/vendor/reflexio/reflexio/lib/_agent_playbook.py +246 -10
- package/plugin/vendor/reflexio/reflexio/lib/_base.py +15 -0
- package/plugin/vendor/reflexio/reflexio/lib/_config.py +11 -4
- package/plugin/vendor/reflexio/reflexio/lib/_generation.py +17 -5
- package/plugin/vendor/reflexio/reflexio/lib/_lineage_parity_readers.py +187 -0
- package/plugin/vendor/reflexio/reflexio/lib/_profiles.py +224 -21
- package/plugin/vendor/reflexio/reflexio/lib/_reflection.py +1 -1
- package/plugin/vendor/reflexio/reflexio/lib/_search.py +52 -25
- package/plugin/vendor/reflexio/reflexio/lib/_user_playbook.py +11 -1
- package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/entities.py +127 -38
- package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/enums.py +4 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/governance.py +117 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/eval_overview_schema.py +64 -41
- package/plugin/vendor/reflexio/reflexio/models/api_schema/internal_schema.py +19 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/pending_tool_call_schema.py +12 -5
- package/plugin/vendor/reflexio/reflexio/models/api_schema/retriever_schema.py +97 -3
- package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/converters.py +5 -1
- package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/entities.py +5 -1
- package/plugin/vendor/reflexio/reflexio/models/config_schema.py +104 -7
- package/plugin/vendor/reflexio/reflexio/models/structured_output.py +148 -0
- package/plugin/vendor/reflexio/reflexio/server/OVERVIEW.md +3 -3
- package/plugin/vendor/reflexio/reflexio/server/README.md +58 -33
- package/plugin/vendor/reflexio/reflexio/server/__init__.py +29 -5
- package/plugin/vendor/reflexio/reflexio/server/__main__.py +2 -2
- package/plugin/vendor/reflexio/reflexio/server/api.py +899 -103
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/precondition_checks.py +7 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/request_context.py +4 -2
- package/plugin/vendor/reflexio/reflexio/server/auth.py +90 -0
- package/plugin/vendor/reflexio/reflexio/server/billing_meter.py +173 -0
- package/plugin/vendor/reflexio/reflexio/server/billing_signals.py +64 -0
- package/plugin/vendor/reflexio/reflexio/server/cache/reflexio_cache.py +46 -16
- package/plugin/vendor/reflexio/reflexio/server/env_utils.py +65 -0
- package/plugin/vendor/reflexio/reflexio/server/extensions.py +213 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/embedding_service.py +19 -4
- package/plugin/vendor/reflexio/reflexio/server/llm/litellm_client.py +264 -77
- package/plugin/vendor/reflexio/reflexio/server/llm/llm_utils.py +69 -7
- package/plugin/vendor/reflexio/reflexio/server/llm/model_defaults.py +4 -4
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/claude_code_provider.py +1 -1
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/embedding_service_provider.py +75 -16
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/openclaw_provider.py +280 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/rerank/cross_encoder_reranker.py +12 -1
- package/plugin/vendor/reflexio/reflexio/server/llm/token_accounting.py +48 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/tools.py +107 -17
- package/plugin/vendor/reflexio/reflexio/server/operation_limiter.py +360 -4
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.6.0.prompt.md +1 -1
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.7.0.prompt.md +85 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_aggregation/v2.2.0.prompt.md +1 -1
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_aggregation/v2.3.0.prompt.md +253 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.3.2.prompt.md +1 -1
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.3.3.prompt.md +74 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.2.3.prompt.md +1 -1
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.3.0.prompt.md +266 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.4.0.prompt.md +278 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.3.0.prompt.md +1 -1
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.4.0.prompt.md +137 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.2.0.prompt.md +1 -1
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.3.0.prompt.md +34 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.0.0.prompt.md +5 -12
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.1.0.prompt.md +5 -12
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.2.0.prompt.md +155 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/tagging/v1.0.0.prompt.md +23 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_manager.py +89 -32
- package/plugin/vendor/reflexio/reflexio/server/services/README.md +28 -11
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/README.md +22 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_constants.py +4 -2
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_utils.py +1 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/components/__init__.py +7 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/{agent_success_evaluator.py → components/evaluator.py} +3 -16
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/regen_jobs.py +28 -72
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/{group_evaluation_runner.py → runner.py} +12 -10
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/{delayed_group_evaluator.py → scheduler.py} +10 -2
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/{agent_success_evaluation_service.py → service.py} +36 -1
- package/plugin/vendor/reflexio/reflexio/server/services/base_generation_service.py +160 -0
- package/plugin/vendor/reflexio/reflexio/server/services/configurator/base_configurator.py +5 -0
- package/plugin/vendor/reflexio/reflexio/server/services/deduplication_utils.py +1 -1
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/README.md +9 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/components/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/{rule_attribution.py → components/rule_attribution.py} +10 -9
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/eval_sampler.py +15 -24
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/service.py +238 -164
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/README.md +31 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/outcome.py +13 -3
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/pending_tool_call_dispatch.py +3 -2
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/resumable_agent.py +32 -118
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/resume_worker.py +47 -16
- package/plugin/vendor/reflexio/reflexio/server/services/generation_service.py +105 -23
- package/plugin/vendor/reflexio/reflexio/server/services/governance/config.py +52 -0
- package/plugin/vendor/reflexio/reflexio/server/services/governance/service.py +378 -0
- package/plugin/vendor/reflexio/reflexio/server/services/governance/subject_refs.py +34 -0
- package/plugin/vendor/reflexio/reflexio/server/services/lineage/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/lineage/gc_scheduler.py +219 -0
- package/plugin/vendor/reflexio/reflexio/server/services/lineage/resolve.py +98 -0
- package/plugin/vendor/reflexio/reflexio/server/services/operation_state_utils.py +26 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/README.md +18 -11
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/aggregation_prompt_processing.py +100 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/components/__init__.py +5 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/{playbook_aggregator.py → components/aggregator.py} +334 -178
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/{playbook_consolidator.py → components/consolidator.py} +168 -62
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/{playbook_extractor.py → components/extractor.py} +5 -1
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_edit_apply.py +74 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_service_utils.py +33 -3
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/{playbook_generation_service.py → service.py} +121 -19
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/README.md +10 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/models.py +2 -1
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/optimizer.py +178 -30
- package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/README.md +9 -0
- package/plugin/vendor/reflexio/reflexio/server/services/profile/components/__init__.py +17 -0
- package/plugin/vendor/reflexio/reflexio/server/services/profile/{profile_deduplicator.py → components/consolidator.py} +7 -6
- package/plugin/vendor/reflexio/reflexio/server/services/profile/{profile_extractor.py → components/extractor.py} +31 -22
- package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_generation_service_utils.py +6 -13
- package/plugin/vendor/reflexio/reflexio/server/services/profile/{profile_generation_service.py → service.py} +32 -50
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/__init__.py +4 -8
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/components/__init__.py +7 -0
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_service_utils.py +12 -1
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/{reflection_service.py → service.py} +36 -16
- package/plugin/vendor/reflexio/reflexio/server/services/retrieval/recency.py +211 -0
- package/plugin/vendor/reflexio/reflexio/server/services/retrieval/relevance_floor.py +99 -6
- package/plugin/vendor/reflexio/reflexio/server/services/service_utils.py +36 -1
- package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/README.md +8 -0
- package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/outcome.py +1 -2
- package/plugin/vendor/reflexio/reflexio/server/services/storage/error.py +31 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/governance_validation.py +681 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/retention.py +9 -9
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/__init__.py +16 -2
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_agent_run.py +4 -1
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_base.py +644 -197
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_extras.py +106 -119
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_governance.py +1965 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_lineage.py +630 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_operations.py +38 -6
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_playbook.py +31 -1369
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_profiles.py +756 -210
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_requests.py +148 -34
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_shadow_verdicts.py +23 -9
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_stall_state.py +5 -2
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/playbook/__init__.py +13 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/playbook/_agent.py +952 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/playbook/_eval_results.py +189 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/playbook/_optimization.py +247 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/playbook/_source_linkage.py +145 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/playbook/_user.py +838 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/__init__.py +150 -23
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_agent_run.py +2 -8
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_base.py +5 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_extras.py +40 -57
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_governance.py +148 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_lineage.py +215 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_operations.py +20 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_playbook.py +4 -677
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_profiles.py +134 -1
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_requests.py +62 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_retrieval_log.py +51 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_shadow_verdicts.py +17 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/playbook/__init__.py +13 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/playbook/_agent.py +365 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/playbook/_eval_results.py +124 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/playbook/_optimization.py +85 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/playbook/_source_linkage.py +47 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/playbook/_user.py +333 -0
- package/plugin/vendor/reflexio/reflexio/server/services/tagging/README.md +8 -0
- package/plugin/vendor/reflexio/reflexio/server/services/tagging/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/server/services/tagging/service.py +200 -0
- package/plugin/vendor/reflexio/reflexio/server/services/tagging/tagging_scheduler.py +149 -0
- package/plugin/vendor/reflexio/reflexio/server/services/unified_search_service.py +372 -34
- package/plugin/vendor/reflexio/reflexio/server/site_var/README.md +2 -1
- package/plugin/vendor/reflexio/reflexio/server/site_var/feature_flags.py +120 -1
- package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/feature_flags.json +4 -0
- package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/search_settings.json +5 -0
- package/plugin/vendor/reflexio/reflexio/server/tracing.py +30 -0
- package/plugin/vendor/reflexio/reflexio/server/usage_metrics.py +18 -0
- package/plugin/vendor/reflexio/reflexio/test_support/llm_mock.py +61 -26
- package/plugin/vendor/reflexio/reflexio/test_support/llm_model_registry.py +41 -4
- package/scripts/setup-claude-smart.sh +8 -3
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/TESTING.md +0 -517
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/hook/handler.js +0 -473
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package-lock.json +0 -2156
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package.json +0 -18
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/handler.ts +0 -241
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/setup.ts +0 -140
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/publish.ts +0 -113
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/search.ts +0 -52
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/server.ts +0 -103
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/sqlite-buffer.ts +0 -156
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/user-id.ts +0 -134
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/rules/reflexio.md +0 -24
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/publish_clawhub.sh +0 -278
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/references/HOOK.md +0 -164
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/install.sh +0 -36
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/uninstall.sh +0 -35
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/publish.test.ts +0 -27
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/search.test.ts +0 -31
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/server.test.ts +0 -42
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/setup.test.ts +0 -49
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/sqlite-buffer.test.ts +0 -91
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/user-id.test.ts +0 -50
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/vitest.config.ts +0 -13
- package/plugin/vendor/reflexio/reflexio/server/_auth.py +0 -25
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/group_aggregation.py +0 -192
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/invariants.py +0 -303
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/plan.py +0 -138
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/tools.py +0 -1125
- /package/plugin/vendor/reflexio/reflexio/integrations/{__init__.py → openclaw/plugin/src/openclaw_smart/__init__.py} +0 -0
- /package/plugin/vendor/reflexio/reflexio/integrations/openclaw/{types → plugin/types}/openclaw.d.ts +0 -0
- /package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/{distribution.py → components/distribution.py} +0 -0
- /package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/{hero_state.py → components/hero_state.py} +0 -0
- /package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/{shadow_aggregation.py → components/shadow_aggregation.py} +0 -0
- /package/plugin/vendor/reflexio/reflexio/server/services/reflection/{reflection_extractor.py → components/extractor.py} +0 -0
|
@@ -12,6 +12,7 @@ from urllib.parse import urljoin
|
|
|
12
12
|
|
|
13
13
|
import aiohttp
|
|
14
14
|
import requests
|
|
15
|
+
from pydantic import ConfigDict
|
|
15
16
|
|
|
16
17
|
from reflexio.defaults import DEFAULT_AGENT_VERSION
|
|
17
18
|
from reflexio.models.api_schema.retriever_schema import (
|
|
@@ -119,6 +120,11 @@ from reflexio.models.config_schema import Config
|
|
|
119
120
|
|
|
120
121
|
from .cache import InMemoryCache
|
|
121
122
|
|
|
123
|
+
|
|
124
|
+
class _ClientConfigPayload(Config):
|
|
125
|
+
model_config = ConfigDict(extra="allow")
|
|
126
|
+
|
|
127
|
+
|
|
122
128
|
T = TypeVar("T")
|
|
123
129
|
|
|
124
130
|
logger = logging.getLogger(__name__)
|
|
@@ -150,12 +156,12 @@ class ReflexioClient:
|
|
|
150
156
|
|
|
151
157
|
Args:
|
|
152
158
|
api_key (str): API key for authentication. Falls back to REFLEXIO_API_KEY env var.
|
|
153
|
-
url_endpoint (str): Base URL for the API. Falls back to
|
|
159
|
+
url_endpoint (str): Base URL for the API. Falls back to REFLEXIO_URL env var,
|
|
154
160
|
then to the default backend URL.
|
|
155
161
|
timeout (int): Default request timeout in seconds (default 300)
|
|
156
162
|
"""
|
|
157
163
|
self.base_url = (
|
|
158
|
-
url_endpoint or os.environ.get("
|
|
164
|
+
url_endpoint or os.environ.get("REFLEXIO_URL", "") or BACKEND_URL
|
|
159
165
|
)
|
|
160
166
|
self.api_key = api_key or os.environ.get("REFLEXIO_API_KEY", "")
|
|
161
167
|
self.timeout = timeout
|
|
@@ -391,8 +397,8 @@ class ReflexioClient:
|
|
|
391
397
|
wait_for_response: bool = False,
|
|
392
398
|
skip_aggregation: bool = False,
|
|
393
399
|
force_extraction: bool = False,
|
|
400
|
+
evaluation_only: bool = False,
|
|
394
401
|
override_learning_stall: bool = False,
|
|
395
|
-
metadata: dict[str, Any] | None = None,
|
|
396
402
|
) -> PublishUserInteractionResponse:
|
|
397
403
|
"""Publish user interactions.
|
|
398
404
|
|
|
@@ -418,7 +424,7 @@ class ReflexioClient:
|
|
|
418
424
|
interactions: List of interaction data.
|
|
419
425
|
source: The source of the interaction.
|
|
420
426
|
agent_version: The agent version.
|
|
421
|
-
session_id:
|
|
427
|
+
session_id: Required non-empty session ID for grouping requests.
|
|
422
428
|
wait_for_response: If True, the **server** waits for
|
|
423
429
|
extraction to complete before returning (longer HTTP
|
|
424
430
|
call, response includes real profile/playbook counts).
|
|
@@ -430,15 +436,13 @@ class ReflexioClient:
|
|
|
430
436
|
force_extraction: If True, bypass all extraction gates
|
|
431
437
|
(stride_size, cheap pre-filter, LLM should_run) and
|
|
432
438
|
always run extractors.
|
|
439
|
+
evaluation_only: If True, store the interaction for
|
|
440
|
+
session-level evaluation only and permanently exclude it
|
|
441
|
+
from profile/playbook extraction.
|
|
433
442
|
override_learning_stall: If True, run extraction even when
|
|
434
443
|
Reflexio has recorded a provider auth/billing stall. Keep
|
|
435
444
|
this False for automatic hook publishes; use it only for an
|
|
436
445
|
explicit retry after reauth or limit reset.
|
|
437
|
-
metadata: Optional per-request annotations stamped by the
|
|
438
|
-
customer. Mirrored onto the stored ``Request`` row so the
|
|
439
|
-
eval pipeline can read them back. Conventional key:
|
|
440
|
-
``reflexio_retrieval_enabled`` (bool) for F2 group
|
|
441
|
-
assignment. Values must be JSON-encodable.
|
|
442
446
|
|
|
443
447
|
Returns:
|
|
444
448
|
PublishUserInteractionResponse: Server response. In
|
|
@@ -448,6 +452,9 @@ class ReflexioClient:
|
|
|
448
452
|
mode it includes request_id, storage routing, and
|
|
449
453
|
deltas.
|
|
450
454
|
"""
|
|
455
|
+
if session_id is None or not session_id.strip():
|
|
456
|
+
raise ValueError("session_id is required and cannot be empty")
|
|
457
|
+
|
|
451
458
|
interaction_data_list = [
|
|
452
459
|
(
|
|
453
460
|
InteractionData(**interaction_request)
|
|
@@ -464,8 +471,8 @@ class ReflexioClient:
|
|
|
464
471
|
agent_version=agent_version,
|
|
465
472
|
skip_aggregation=skip_aggregation,
|
|
466
473
|
force_extraction=force_extraction,
|
|
474
|
+
evaluation_only=evaluation_only,
|
|
467
475
|
override_learning_stall=override_learning_stall,
|
|
468
|
-
metadata=metadata or {},
|
|
469
476
|
)
|
|
470
477
|
result = self._publish_interaction_sync(
|
|
471
478
|
request, wait_for_response=wait_for_response
|
|
@@ -534,6 +541,7 @@ class ReflexioClient:
|
|
|
534
541
|
source: str | None = None,
|
|
535
542
|
custom_feature: str | None = None,
|
|
536
543
|
extractor_name: str | None = None,
|
|
544
|
+
tags: list[str] | None = None,
|
|
537
545
|
threshold: float | None = None,
|
|
538
546
|
enable_reformulation: bool | None = None,
|
|
539
547
|
search_mode: SearchMode | None = None,
|
|
@@ -551,6 +559,7 @@ class ReflexioClient:
|
|
|
551
559
|
source (Optional[str]): Filter by source
|
|
552
560
|
custom_feature (Optional[str]): Filter by custom feature
|
|
553
561
|
extractor_name (Optional[str]): Deprecated compatibility field. Accepted but ignored.
|
|
562
|
+
tags (Optional[list[str]]): Match profiles having any of these tags.
|
|
554
563
|
threshold (Optional[float]): Similarity threshold (default: 0.7)
|
|
555
564
|
enable_reformulation (Optional[bool]): Enable LLM query reformulation (default: False)
|
|
556
565
|
|
|
@@ -569,6 +578,7 @@ class ReflexioClient:
|
|
|
569
578
|
source=source,
|
|
570
579
|
custom_feature=custom_feature,
|
|
571
580
|
extractor_name=extractor_name,
|
|
581
|
+
tags=tags,
|
|
572
582
|
threshold=threshold,
|
|
573
583
|
enable_reformulation=enable_reformulation,
|
|
574
584
|
search_mode=search_mode,
|
|
@@ -592,6 +602,7 @@ class ReflexioClient:
|
|
|
592
602
|
source: str | None = None,
|
|
593
603
|
custom_feature: str | None = None,
|
|
594
604
|
extractor_name: str | None = None,
|
|
605
|
+
tags: list[str] | None = None,
|
|
595
606
|
threshold: float | None = None,
|
|
596
607
|
enable_reformulation: bool | None = None,
|
|
597
608
|
search_mode: SearchMode | None = None,
|
|
@@ -614,6 +625,7 @@ class ReflexioClient:
|
|
|
614
625
|
source=source,
|
|
615
626
|
custom_feature=custom_feature,
|
|
616
627
|
extractor_name=extractor_name,
|
|
628
|
+
tags=tags,
|
|
617
629
|
threshold=threshold,
|
|
618
630
|
enable_reformulation=enable_reformulation,
|
|
619
631
|
search_mode=search_mode,
|
|
@@ -690,6 +702,7 @@ class ReflexioClient:
|
|
|
690
702
|
start_time: datetime | None = None,
|
|
691
703
|
end_time: datetime | None = None,
|
|
692
704
|
status_filter: list[Status | None] | None = None,
|
|
705
|
+
tags: list[str] | None = None,
|
|
693
706
|
top_k: int | None = None,
|
|
694
707
|
threshold: float | None = None,
|
|
695
708
|
enable_reformulation: bool | None = None,
|
|
@@ -706,6 +719,7 @@ class ReflexioClient:
|
|
|
706
719
|
start_time (Optional[datetime]): Start time for created_at filter
|
|
707
720
|
end_time (Optional[datetime]): End time for created_at filter
|
|
708
721
|
status_filter (Optional[list[Optional[Status]]]): Filter by status (None for CURRENT, PENDING, ARCHIVED)
|
|
722
|
+
tags (Optional[list[str]]): Match playbooks having any of these tags.
|
|
709
723
|
top_k (Optional[int]): Maximum number of results to return (default: 10)
|
|
710
724
|
threshold (Optional[float]): Similarity threshold for vector search (default: 0.4)
|
|
711
725
|
enable_reformulation (Optional[bool]): Enable LLM query reformulation (default: False)
|
|
@@ -723,6 +737,7 @@ class ReflexioClient:
|
|
|
723
737
|
start_time=start_time,
|
|
724
738
|
end_time=end_time,
|
|
725
739
|
status_filter=status_filter,
|
|
740
|
+
tags=tags,
|
|
726
741
|
top_k=top_k,
|
|
727
742
|
threshold=threshold,
|
|
728
743
|
enable_reformulation=enable_reformulation,
|
|
@@ -744,6 +759,7 @@ class ReflexioClient:
|
|
|
744
759
|
end_time: datetime | None = None,
|
|
745
760
|
status_filter: list[Status | None] | None = None,
|
|
746
761
|
playbook_status_filter: PlaybookStatus | None = None,
|
|
762
|
+
tags: list[str] | None = None,
|
|
747
763
|
top_k: int | None = None,
|
|
748
764
|
threshold: float | None = None,
|
|
749
765
|
enable_reformulation: bool | None = None,
|
|
@@ -760,6 +776,7 @@ class ReflexioClient:
|
|
|
760
776
|
end_time (Optional[datetime]): End time for created_at filter
|
|
761
777
|
status_filter (Optional[list[Optional[Status]]]): Filter by status (None for CURRENT, PENDING, ARCHIVED)
|
|
762
778
|
playbook_status_filter (Optional[PlaybookStatus]): Filter by playbook status (PENDING, APPROVED, REJECTED)
|
|
779
|
+
tags (Optional[list[str]]): Match playbooks having any of these tags.
|
|
763
780
|
top_k (Optional[int]): Maximum number of results to return (default: 10)
|
|
764
781
|
threshold (Optional[float]): Similarity threshold for vector search (default: 0.4)
|
|
765
782
|
enable_reformulation (Optional[bool]): Enable LLM query reformulation (default: False)
|
|
@@ -777,6 +794,7 @@ class ReflexioClient:
|
|
|
777
794
|
end_time=end_time,
|
|
778
795
|
status_filter=status_filter,
|
|
779
796
|
playbook_status_filter=playbook_status_filter,
|
|
797
|
+
tags=tags,
|
|
780
798
|
top_k=top_k,
|
|
781
799
|
threshold=threshold,
|
|
782
800
|
enable_reformulation=enable_reformulation,
|
|
@@ -1136,10 +1154,15 @@ class ReflexioClient:
|
|
|
1136
1154
|
force_refresh: bool = False,
|
|
1137
1155
|
*,
|
|
1138
1156
|
user_id: str | None = None,
|
|
1157
|
+
profile_id: str | None = None,
|
|
1158
|
+
query: str | None = None,
|
|
1139
1159
|
start_time: datetime | None = None,
|
|
1140
1160
|
end_time: datetime | None = None,
|
|
1141
1161
|
top_k: int | None = None,
|
|
1162
|
+
source: str | None = None,
|
|
1163
|
+
profile_time_to_live: str | None = None,
|
|
1142
1164
|
status_filter: list[Status | str | None] | None = None,
|
|
1165
|
+
tags: list[str] | None = None,
|
|
1143
1166
|
) -> GetProfilesViewResponse:
|
|
1144
1167
|
"""Get user profiles.
|
|
1145
1168
|
|
|
@@ -1147,10 +1170,15 @@ class ReflexioClient:
|
|
|
1147
1170
|
request (Optional[GetUserProfilesRequest]): The list request object (alternative to kwargs)
|
|
1148
1171
|
force_refresh (bool, optional): If True, bypass cache and fetch fresh data. Defaults to False.
|
|
1149
1172
|
user_id (str): The user ID to get profiles for
|
|
1173
|
+
profile_id (Optional[str]): Exact profile ID filter.
|
|
1174
|
+
query (Optional[str]): Case-insensitive text filter across visible fields.
|
|
1150
1175
|
start_time (Optional[datetime]): Filter by start time
|
|
1151
1176
|
end_time (Optional[datetime]): Filter by end time
|
|
1152
1177
|
top_k (Optional[int]): Maximum number of results to return (default: 30)
|
|
1178
|
+
source (Optional[str]): Filter by profile source.
|
|
1179
|
+
profile_time_to_live (Optional[str]): Filter by profile TTL value.
|
|
1153
1180
|
status_filter (Optional[list[Optional[Union[Status, str]]]]): Filter by profile status. Accepts Status enum or string values (e.g., "archived", "pending").
|
|
1181
|
+
tags (Optional[list[str]]): Match profiles having any of these tags.
|
|
1154
1182
|
|
|
1155
1183
|
Returns:
|
|
1156
1184
|
GetProfilesViewResponse: Response containing list of profiles
|
|
@@ -1171,10 +1199,15 @@ class ReflexioClient:
|
|
|
1171
1199
|
request,
|
|
1172
1200
|
GetUserProfilesRequest,
|
|
1173
1201
|
user_id=user_id,
|
|
1202
|
+
profile_id=profile_id,
|
|
1203
|
+
query=query,
|
|
1174
1204
|
start_time=start_time,
|
|
1175
1205
|
end_time=end_time,
|
|
1176
1206
|
top_k=top_k,
|
|
1207
|
+
source=source,
|
|
1208
|
+
profile_time_to_live=profile_time_to_live,
|
|
1177
1209
|
status_filter=converted_status_filter,
|
|
1210
|
+
tags=tags,
|
|
1178
1211
|
)
|
|
1179
1212
|
|
|
1180
1213
|
# Check cache if not forcing refresh
|
|
@@ -1182,10 +1215,15 @@ class ReflexioClient:
|
|
|
1182
1215
|
cached_result = self._cache.get(
|
|
1183
1216
|
"get_profiles",
|
|
1184
1217
|
user_id=req.user_id,
|
|
1218
|
+
profile_id=req.profile_id,
|
|
1219
|
+
query=req.query,
|
|
1185
1220
|
start_time=req.start_time,
|
|
1186
1221
|
end_time=req.end_time,
|
|
1187
1222
|
top_k=req.top_k,
|
|
1223
|
+
source=req.source,
|
|
1224
|
+
profile_time_to_live=req.profile_time_to_live,
|
|
1188
1225
|
status_filter=req.status_filter,
|
|
1226
|
+
tags=req.tags,
|
|
1189
1227
|
)
|
|
1190
1228
|
if cached_result is not None:
|
|
1191
1229
|
return cached_result
|
|
@@ -1203,10 +1241,15 @@ class ReflexioClient:
|
|
|
1203
1241
|
"get_profiles",
|
|
1204
1242
|
result,
|
|
1205
1243
|
user_id=req.user_id,
|
|
1244
|
+
profile_id=req.profile_id,
|
|
1245
|
+
query=req.query,
|
|
1206
1246
|
start_time=req.start_time,
|
|
1207
1247
|
end_time=req.end_time,
|
|
1208
1248
|
top_k=req.top_k,
|
|
1249
|
+
source=req.source,
|
|
1250
|
+
profile_time_to_live=req.profile_time_to_live,
|
|
1209
1251
|
status_filter=req.status_filter,
|
|
1252
|
+
tags=req.tags,
|
|
1210
1253
|
)
|
|
1211
1254
|
|
|
1212
1255
|
return result
|
|
@@ -1233,6 +1276,13 @@ class ReflexioClient:
|
|
|
1233
1276
|
self,
|
|
1234
1277
|
limit: int = 100,
|
|
1235
1278
|
status_filter: str | None = None,
|
|
1279
|
+
user_id: str | None = None,
|
|
1280
|
+
profile_id: str | None = None,
|
|
1281
|
+
query: str | None = None,
|
|
1282
|
+
source: str | None = None,
|
|
1283
|
+
profile_time_to_live: str | None = None,
|
|
1284
|
+
start_time: int | None = None,
|
|
1285
|
+
end_time: int | None = None,
|
|
1236
1286
|
) -> GetProfilesViewResponse:
|
|
1237
1287
|
"""Get all user profiles across all users.
|
|
1238
1288
|
|
|
@@ -1241,6 +1291,13 @@ class ReflexioClient:
|
|
|
1241
1291
|
status_filter (str, optional): Filter by profile status. Accepts
|
|
1242
1292
|
``"current"``, ``"pending"``, or ``"archived"``. If ``None``
|
|
1243
1293
|
(the default), profiles with any status are returned.
|
|
1294
|
+
user_id (str, optional): Filter by exact user ID.
|
|
1295
|
+
profile_id (str, optional): Filter by exact profile ID.
|
|
1296
|
+
query (str, optional): Case-insensitive text filter across visible fields.
|
|
1297
|
+
source (str, optional): Filter by exact profile source.
|
|
1298
|
+
profile_time_to_live (str, optional): Filter by profile TTL value.
|
|
1299
|
+
start_time (int, optional): Minimum last-modified epoch seconds.
|
|
1300
|
+
end_time (int, optional): Maximum last-modified epoch seconds.
|
|
1244
1301
|
|
|
1245
1302
|
Returns:
|
|
1246
1303
|
GetProfilesViewResponse: Response containing all user profiles
|
|
@@ -1250,6 +1307,21 @@ class ReflexioClient:
|
|
|
1250
1307
|
params: dict[str, str | int] = {"limit": limit}
|
|
1251
1308
|
if status_filter:
|
|
1252
1309
|
params["status_filter"] = status_filter
|
|
1310
|
+
params.update(
|
|
1311
|
+
{
|
|
1312
|
+
key: value
|
|
1313
|
+
for key, value in {
|
|
1314
|
+
"user_id": user_id,
|
|
1315
|
+
"profile_id": profile_id,
|
|
1316
|
+
"query": query,
|
|
1317
|
+
"source": source,
|
|
1318
|
+
"profile_time_to_live": profile_time_to_live,
|
|
1319
|
+
"start_time": start_time,
|
|
1320
|
+
"end_time": end_time,
|
|
1321
|
+
}.items()
|
|
1322
|
+
if value is not None
|
|
1323
|
+
}
|
|
1324
|
+
)
|
|
1253
1325
|
response = self._make_request(
|
|
1254
1326
|
"GET",
|
|
1255
1327
|
f"/api/get_all_profiles?{urlencode(params)}",
|
|
@@ -1265,7 +1337,10 @@ class ReflexioClient:
|
|
|
1265
1337
|
Returns:
|
|
1266
1338
|
dict: Response containing success status and message
|
|
1267
1339
|
"""
|
|
1268
|
-
config = self._convert_to_model(
|
|
1340
|
+
config = self._convert_to_model( # type: ignore[reportAssignmentType]
|
|
1341
|
+
config,
|
|
1342
|
+
_ClientConfigPayload,
|
|
1343
|
+
)
|
|
1269
1344
|
return self._make_request(
|
|
1270
1345
|
"POST",
|
|
1271
1346
|
"/api/set_config",
|
|
@@ -1287,7 +1362,7 @@ class ReflexioClient:
|
|
|
1287
1362
|
|
|
1288
1363
|
Args:
|
|
1289
1364
|
partial: Top-level fields to overlay on the existing config.
|
|
1290
|
-
Unknown keys are
|
|
1365
|
+
Unknown keys are rejected server-side.
|
|
1291
1366
|
|
|
1292
1367
|
Returns:
|
|
1293
1368
|
dict: ``{"success": bool, "msg": str}`` from the server.
|
|
@@ -1311,7 +1386,7 @@ class ReflexioClient:
|
|
|
1311
1386
|
"GET",
|
|
1312
1387
|
"/api/get_config",
|
|
1313
1388
|
)
|
|
1314
|
-
return
|
|
1389
|
+
return _ClientConfigPayload(**response)
|
|
1315
1390
|
|
|
1316
1391
|
def invalidate_cache(self, org_id: str | None = None) -> dict:
|
|
1317
1392
|
"""Explicitly evict the server-side per-org Reflexio cache entry.
|
|
@@ -1349,20 +1424,32 @@ class ReflexioClient:
|
|
|
1349
1424
|
request: GetUserPlaybooksRequest | dict | None = None,
|
|
1350
1425
|
*,
|
|
1351
1426
|
limit: int | None = None,
|
|
1427
|
+
user_playbook_id: int | None = None,
|
|
1352
1428
|
user_id: str | None = None,
|
|
1429
|
+
request_id: str | None = None,
|
|
1430
|
+
query: str | None = None,
|
|
1353
1431
|
playbook_name: str | None = None,
|
|
1354
1432
|
agent_version: str | None = None,
|
|
1433
|
+
start_time: datetime | None = None,
|
|
1434
|
+
end_time: datetime | None = None,
|
|
1355
1435
|
status_filter: list[Status | None] | None = None,
|
|
1436
|
+
tags: list[str] | None = None,
|
|
1356
1437
|
) -> GetUserPlaybooksViewResponse:
|
|
1357
1438
|
"""Get user playbooks.
|
|
1358
1439
|
|
|
1359
1440
|
Args:
|
|
1360
1441
|
request (Optional[GetUserPlaybooksRequest]): The get request object (alternative to kwargs)
|
|
1361
1442
|
limit (Optional[int]): Maximum number of results to return (default: 100)
|
|
1443
|
+
user_playbook_id (Optional[int]): Exact user playbook ID filter.
|
|
1362
1444
|
user_id (Optional[str]): Filter by user ID
|
|
1445
|
+
request_id (Optional[str]): Filter by generating request ID.
|
|
1446
|
+
query (Optional[str]): Case-insensitive text filter across visible fields.
|
|
1363
1447
|
playbook_name (Optional[str]): Filter by playbook name
|
|
1364
1448
|
agent_version (Optional[str]): Filter by agent version
|
|
1449
|
+
start_time (Optional[datetime]): Filter by start time.
|
|
1450
|
+
end_time (Optional[datetime]): Filter by end time.
|
|
1365
1451
|
status_filter (Optional[list[Optional[Status]]]): Filter by status
|
|
1452
|
+
tags (Optional[list[str]]): Match playbooks having any of these tags.
|
|
1366
1453
|
|
|
1367
1454
|
Returns:
|
|
1368
1455
|
GetUserPlaybooksViewResponse: Response containing user playbooks
|
|
@@ -1371,10 +1458,16 @@ class ReflexioClient:
|
|
|
1371
1458
|
request,
|
|
1372
1459
|
GetUserPlaybooksRequest,
|
|
1373
1460
|
limit=limit,
|
|
1461
|
+
user_playbook_id=user_playbook_id,
|
|
1374
1462
|
user_id=user_id,
|
|
1463
|
+
request_id=request_id,
|
|
1464
|
+
query=query,
|
|
1375
1465
|
playbook_name=playbook_name,
|
|
1376
1466
|
agent_version=agent_version,
|
|
1467
|
+
start_time=start_time,
|
|
1468
|
+
end_time=end_time,
|
|
1377
1469
|
status_filter=status_filter,
|
|
1470
|
+
tags=tags,
|
|
1378
1471
|
)
|
|
1379
1472
|
response = self._make_request(
|
|
1380
1473
|
"POST",
|
|
@@ -1624,10 +1717,15 @@ class ReflexioClient:
|
|
|
1624
1717
|
force_refresh: bool = False,
|
|
1625
1718
|
*,
|
|
1626
1719
|
limit: int | None = None,
|
|
1720
|
+
agent_playbook_id: int | None = None,
|
|
1721
|
+
query: str | None = None,
|
|
1627
1722
|
playbook_name: str | None = None,
|
|
1628
1723
|
agent_version: str | None = None,
|
|
1724
|
+
start_time: datetime | None = None,
|
|
1725
|
+
end_time: datetime | None = None,
|
|
1629
1726
|
status_filter: list[Status | None] | None = None,
|
|
1630
1727
|
playbook_status_filter: PlaybookStatus | None = None,
|
|
1728
|
+
tags: list[str] | None = None,
|
|
1631
1729
|
) -> GetAgentPlaybooksViewResponse:
|
|
1632
1730
|
"""Get agent playbooks.
|
|
1633
1731
|
|
|
@@ -1635,10 +1733,15 @@ class ReflexioClient:
|
|
|
1635
1733
|
request (Optional[GetAgentPlaybooksRequest]): The get request object (alternative to kwargs)
|
|
1636
1734
|
force_refresh (bool, optional): If True, bypass cache and fetch fresh data. Defaults to False.
|
|
1637
1735
|
limit (Optional[int]): Maximum number of results to return (default: 100)
|
|
1736
|
+
agent_playbook_id (Optional[int]): Exact agent playbook ID filter.
|
|
1737
|
+
query (Optional[str]): Case-insensitive text filter across visible fields.
|
|
1638
1738
|
playbook_name (Optional[str]): Filter by playbook name
|
|
1639
1739
|
agent_version (Optional[str]): Filter by agent version
|
|
1740
|
+
start_time (Optional[datetime]): Filter by start time.
|
|
1741
|
+
end_time (Optional[datetime]): Filter by end time.
|
|
1640
1742
|
status_filter (Optional[list[Optional[Status]]]): Filter by status
|
|
1641
1743
|
playbook_status_filter (Optional[PlaybookStatus]): Filter by playbook status (default: APPROVED)
|
|
1744
|
+
tags (Optional[list[str]]): Match playbooks having any of these tags.
|
|
1642
1745
|
|
|
1643
1746
|
Returns:
|
|
1644
1747
|
GetAgentPlaybooksViewResponse: Response containing agent playbooks
|
|
@@ -1647,10 +1750,15 @@ class ReflexioClient:
|
|
|
1647
1750
|
request,
|
|
1648
1751
|
GetAgentPlaybooksRequest,
|
|
1649
1752
|
limit=limit,
|
|
1753
|
+
agent_playbook_id=agent_playbook_id,
|
|
1754
|
+
query=query,
|
|
1650
1755
|
playbook_name=playbook_name,
|
|
1651
1756
|
agent_version=agent_version,
|
|
1757
|
+
start_time=start_time,
|
|
1758
|
+
end_time=end_time,
|
|
1652
1759
|
status_filter=status_filter,
|
|
1653
1760
|
playbook_status_filter=playbook_status_filter,
|
|
1761
|
+
tags=tags,
|
|
1654
1762
|
)
|
|
1655
1763
|
|
|
1656
1764
|
# Check cache if not forcing refresh
|
|
@@ -1658,9 +1766,15 @@ class ReflexioClient:
|
|
|
1658
1766
|
cached_result = self._cache.get(
|
|
1659
1767
|
"get_agent_playbooks",
|
|
1660
1768
|
limit=req.limit,
|
|
1769
|
+
agent_playbook_id=req.agent_playbook_id,
|
|
1770
|
+
query=req.query,
|
|
1661
1771
|
playbook_name=req.playbook_name,
|
|
1772
|
+
agent_version=req.agent_version,
|
|
1773
|
+
start_time=req.start_time,
|
|
1774
|
+
end_time=req.end_time,
|
|
1662
1775
|
status_filter=req.status_filter,
|
|
1663
1776
|
playbook_status_filter=req.playbook_status_filter,
|
|
1777
|
+
tags=req.tags,
|
|
1664
1778
|
)
|
|
1665
1779
|
if cached_result is not None:
|
|
1666
1780
|
return cached_result
|
|
@@ -1678,9 +1792,15 @@ class ReflexioClient:
|
|
|
1678
1792
|
"get_agent_playbooks",
|
|
1679
1793
|
result,
|
|
1680
1794
|
limit=req.limit,
|
|
1795
|
+
agent_playbook_id=req.agent_playbook_id,
|
|
1796
|
+
query=req.query,
|
|
1681
1797
|
playbook_name=req.playbook_name,
|
|
1798
|
+
agent_version=req.agent_version,
|
|
1799
|
+
start_time=req.start_time,
|
|
1800
|
+
end_time=req.end_time,
|
|
1682
1801
|
status_filter=req.status_filter,
|
|
1683
1802
|
playbook_status_filter=req.playbook_status_filter,
|
|
1803
|
+
tags=req.tags,
|
|
1684
1804
|
)
|
|
1685
1805
|
|
|
1686
1806
|
return result
|
|
@@ -1691,6 +1811,8 @@ class ReflexioClient:
|
|
|
1691
1811
|
*,
|
|
1692
1812
|
user_id: str | None = None,
|
|
1693
1813
|
request_id: str | None = None,
|
|
1814
|
+
session_id: str | None = None,
|
|
1815
|
+
source: str | None = None,
|
|
1694
1816
|
start_time: datetime | None = None,
|
|
1695
1817
|
end_time: datetime | None = None,
|
|
1696
1818
|
top_k: int | None = None,
|
|
@@ -1701,6 +1823,8 @@ class ReflexioClient:
|
|
|
1701
1823
|
request (Optional[GetRequestsRequest]): The get request object (alternative to kwargs)
|
|
1702
1824
|
user_id (Optional[str]): Filter by user ID
|
|
1703
1825
|
request_id (Optional[str]): Filter by request ID
|
|
1826
|
+
session_id (Optional[str]): Filter by session ID
|
|
1827
|
+
source (Optional[str]): Filter by request source
|
|
1704
1828
|
start_time (Optional[datetime]): Filter by start time
|
|
1705
1829
|
end_time (Optional[datetime]): Filter by end time
|
|
1706
1830
|
top_k (Optional[int]): Maximum number of results to return (default: 30)
|
|
@@ -1713,6 +1837,8 @@ class ReflexioClient:
|
|
|
1713
1837
|
GetRequestsRequest,
|
|
1714
1838
|
user_id=user_id,
|
|
1715
1839
|
request_id=request_id,
|
|
1840
|
+
session_id=session_id,
|
|
1841
|
+
source=source,
|
|
1716
1842
|
start_time=start_time,
|
|
1717
1843
|
end_time=end_time,
|
|
1718
1844
|
top_k=top_k,
|
|
@@ -1730,6 +1856,8 @@ class ReflexioClient:
|
|
|
1730
1856
|
*,
|
|
1731
1857
|
limit: int | None = None,
|
|
1732
1858
|
agent_version: str | None = None,
|
|
1859
|
+
start_time: datetime | None = None,
|
|
1860
|
+
end_time: datetime | None = None,
|
|
1733
1861
|
) -> GetEvaluationResultsViewResponse:
|
|
1734
1862
|
"""Get agent success evaluation results.
|
|
1735
1863
|
|
|
@@ -1737,6 +1865,8 @@ class ReflexioClient:
|
|
|
1737
1865
|
request (Optional[GetAgentSuccessEvaluationResultsRequest]): The get request object (alternative to kwargs)
|
|
1738
1866
|
limit (Optional[int]): Maximum number of results to return (default: 100)
|
|
1739
1867
|
agent_version (Optional[str]): Filter by agent version
|
|
1868
|
+
start_time (Optional[datetime]): Filter by start time
|
|
1869
|
+
end_time (Optional[datetime]): Filter by end time
|
|
1740
1870
|
|
|
1741
1871
|
Returns:
|
|
1742
1872
|
GetEvaluationResultsViewResponse: Response containing agent success evaluation results
|
|
@@ -1746,6 +1876,8 @@ class ReflexioClient:
|
|
|
1746
1876
|
GetAgentSuccessEvaluationResultsRequest,
|
|
1747
1877
|
limit=limit,
|
|
1748
1878
|
agent_version=agent_version,
|
|
1879
|
+
start_time=start_time,
|
|
1880
|
+
end_time=end_time,
|
|
1749
1881
|
)
|
|
1750
1882
|
response = self._make_request(
|
|
1751
1883
|
"POST",
|
|
@@ -2212,6 +2344,9 @@ class ReflexioClient:
|
|
|
2212
2344
|
enable_agent_answer: bool | None = None,
|
|
2213
2345
|
conversation_history: list[ConversationTurn] | list[dict] | None = None,
|
|
2214
2346
|
search_mode: SearchMode | str | None = None,
|
|
2347
|
+
request_id: str | None = None,
|
|
2348
|
+
session_id: str | None = None,
|
|
2349
|
+
interaction_id: int | None = None,
|
|
2215
2350
|
) -> UnifiedSearchViewResponse:
|
|
2216
2351
|
"""Search across all entity types (profiles, agent playbooks, user playbooks).
|
|
2217
2352
|
|
|
@@ -2235,6 +2370,9 @@ class ReflexioClient:
|
|
|
2235
2370
|
the configured search backend supports it (default: False).
|
|
2236
2371
|
conversation_history (Optional[list[ConversationTurn] | list[dict]]): Prior conversation turns for context-aware query reformulation. Accepts ConversationTurn objects or dicts with "role" and "content" keys.
|
|
2237
2372
|
search_mode (Optional[SearchMode | str]): Search mode to use. Accepts SearchMode enum or string value ("vector", "fts", "hybrid").
|
|
2373
|
+
request_id (Optional[str]): Caller correlation id for the search turn.
|
|
2374
|
+
session_id (Optional[str]): Caller session id for the search turn.
|
|
2375
|
+
interaction_id (Optional[int]): Caller interaction id for the search turn.
|
|
2238
2376
|
|
|
2239
2377
|
Returns:
|
|
2240
2378
|
UnifiedSearchViewResponse: Combined search results from all entity types
|
|
@@ -2254,6 +2392,9 @@ class ReflexioClient:
|
|
|
2254
2392
|
enable_agent_answer=enable_agent_answer,
|
|
2255
2393
|
conversation_history=conversation_history,
|
|
2256
2394
|
search_mode=search_mode,
|
|
2395
|
+
request_id=request_id,
|
|
2396
|
+
session_id=session_id,
|
|
2397
|
+
interaction_id=interaction_id,
|
|
2257
2398
|
)
|
|
2258
2399
|
response = self._make_request("POST", "/api/search", json=req.model_dump())
|
|
2259
2400
|
return UnifiedSearchViewResponse(**response)
|