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,278 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Publishes the reflexio openclaw integration as a single ClawHub skill.
|
|
3
|
+
#
|
|
4
|
+
# Two modes:
|
|
5
|
+
# 1) CLI publish — stages into a temp dir, generates top-level SKILL.md,
|
|
6
|
+
# runs `bun clawhub skill publish`. Requires bun + an authed session.
|
|
7
|
+
# 2) Stage-only — same staging + SKILL.md generation, but skips publish
|
|
8
|
+
# and prints the staged path so you can drop it onto the web form at
|
|
9
|
+
# https://clawhub.ai/publish-skill.
|
|
10
|
+
#
|
|
11
|
+
# Usage:
|
|
12
|
+
# ./publish_clawhub.sh <semver> [changelog] # CLI publish
|
|
13
|
+
# ./publish_clawhub.sh --stage-only # produce folder for web upload
|
|
14
|
+
#
|
|
15
|
+
# Prereqs:
|
|
16
|
+
# - CLI mode: `bun clawhub login` done, `bun` on PATH
|
|
17
|
+
# - Stage-only mode: just `rsync` and `python3` on PATH
|
|
18
|
+
|
|
19
|
+
set -euo pipefail
|
|
20
|
+
|
|
21
|
+
STAGE_ONLY=0
|
|
22
|
+
if [[ "${1:-}" == "--stage-only" ]]; then
|
|
23
|
+
STAGE_ONLY=1
|
|
24
|
+
VERSION="0.0.0-staged"
|
|
25
|
+
CHANGELOG=""
|
|
26
|
+
else
|
|
27
|
+
VERSION="${1:?usage: publish_clawhub.sh <semver> [changelog] | --stage-only}"
|
|
28
|
+
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][A-Za-z0-9.-]+)?$ ]]; then
|
|
29
|
+
echo "error: version must be semver (got: $VERSION)" >&2
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
CHANGELOG="${2:-Release $VERSION}"
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
SRC="$(cd "$(dirname "$0")" && pwd)"
|
|
36
|
+
STAGE="$(mktemp -d -t reflexio-clawhub-XXXXXX)"
|
|
37
|
+
if (( STAGE_ONLY == 0 )); then
|
|
38
|
+
trap 'rm -rf "$STAGE"' EXIT
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
if (( STAGE_ONLY == 0 )); then
|
|
42
|
+
if ! command -v bun >/dev/null 2>&1; then
|
|
43
|
+
echo "error: bun not found on PATH (install from https://bun.sh)" >&2
|
|
44
|
+
exit 1
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
if ! bun clawhub whoami >/dev/null 2>&1; then
|
|
48
|
+
echo "error: not logged in to clawhub. run: bun clawhub login" >&2
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
echo "staging bundle → $STAGE"
|
|
54
|
+
# Prune everything that shouldn't be in the published bundle. The web
|
|
55
|
+
# uploader at clawhub.ai/publish-skill does NOT read .clawhubignore
|
|
56
|
+
# (that's a CLI-only feature), so we pre-filter here and the same stage
|
|
57
|
+
# dir works for both CLI publish and web drag-drop.
|
|
58
|
+
rsync -a \
|
|
59
|
+
--exclude='node_modules/' \
|
|
60
|
+
--exclude='package-lock.json' \
|
|
61
|
+
--exclude='.DS_Store' \
|
|
62
|
+
--exclude='eval/' \
|
|
63
|
+
--exclude='TESTING.md' \
|
|
64
|
+
--exclude='publish_clawhub.sh' \
|
|
65
|
+
--exclude='.clawhubignore' \
|
|
66
|
+
"$SRC"/ "$STAGE"/
|
|
67
|
+
|
|
68
|
+
echo "generating top-level SKILL.md from skill/SKILL.md"
|
|
69
|
+
python3 - "$STAGE" <<'PY'
|
|
70
|
+
import re
|
|
71
|
+
import sys
|
|
72
|
+
from pathlib import Path
|
|
73
|
+
|
|
74
|
+
stage = Path(sys.argv[1])
|
|
75
|
+
src_skill = stage / "skill" / "SKILL.md"
|
|
76
|
+
body = src_skill.read_text()
|
|
77
|
+
|
|
78
|
+
m = re.match(r"^---\n(.*?)\n---\n(.*)$", body, re.DOTALL)
|
|
79
|
+
if not m:
|
|
80
|
+
sys.exit(f"error: {src_skill} has no YAML frontmatter")
|
|
81
|
+
orig_frontmatter, orig_body = m.group(1), m.group(2)
|
|
82
|
+
|
|
83
|
+
# Pull the original description verbatim (multi-line safe).
|
|
84
|
+
desc_match = re.search(
|
|
85
|
+
r'^description:\s*"((?:[^"\\]|\\.)*)"', orig_frontmatter, re.MULTILINE
|
|
86
|
+
)
|
|
87
|
+
if not desc_match:
|
|
88
|
+
sys.exit("error: could not find description in skill/SKILL.md frontmatter")
|
|
89
|
+
description = desc_match.group(1)
|
|
90
|
+
|
|
91
|
+
frontmatter = (
|
|
92
|
+
"---\n"
|
|
93
|
+
"name: reflexio\n"
|
|
94
|
+
f'description: "{description}"\n'
|
|
95
|
+
"metadata:\n"
|
|
96
|
+
" openclaw:\n"
|
|
97
|
+
" homepage: https://github.com/reflexio-ai/reflexio/tree/main/reflexio/integrations/openclaw\n"
|
|
98
|
+
" emoji: 🧠\n"
|
|
99
|
+
" requires:\n"
|
|
100
|
+
" bins: [reflexio]\n"
|
|
101
|
+
"---\n"
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
privacy = """
|
|
105
|
+
## Privacy & Data Collection — Read This First
|
|
106
|
+
|
|
107
|
+
**This skill causes the agent to automatically capture conversations and
|
|
108
|
+
forward them to a local Reflexio server for LLM-based extraction.** Read this
|
|
109
|
+
before enabling — there are two distinct network hops and you need to
|
|
110
|
+
understand both.
|
|
111
|
+
|
|
112
|
+
### Credential requirement (not declared in skill metadata)
|
|
113
|
+
|
|
114
|
+
The skill's registry metadata declares no required environment variables and
|
|
115
|
+
the hook reads none. **But the end-to-end system does require an LLM provider
|
|
116
|
+
API key**, and you WILL be asked for one during First-Use Setup.
|
|
117
|
+
|
|
118
|
+
- Step 2 of First-Use Setup below runs `reflexio setup openclaw`, which opens
|
|
119
|
+
an **interactive wizard** prompting you to choose an LLM provider (OpenAI,
|
|
120
|
+
Anthropic, Gemini, DeepSeek, OpenRouter, and several others) and paste an
|
|
121
|
+
API key.
|
|
122
|
+
- The key is stored in `~/.reflexio/.env` and read by the local Reflexio
|
|
123
|
+
server during extraction. **The hook itself never reads the key** (the hook
|
|
124
|
+
has no environment variable access and no filesystem config reads — both
|
|
125
|
+
enforced in `handler.js`).
|
|
126
|
+
- If you want fully offline operation, point the wizard at a local LLM
|
|
127
|
+
(Ollama at `http://127.0.0.1:11434`, LM Studio, vLLM, etc.) instead of a
|
|
128
|
+
hosted provider — the wizard accepts any LiteLLM-compatible base URL.
|
|
129
|
+
|
|
130
|
+
**Why the metadata doesn't declare it:** ClawHub's `metadata.openclaw.requires.env`
|
|
131
|
+
describes environment variables the hook's own code path reads. The hook is
|
|
132
|
+
deliberately stateless at the credential level, so listing anything there
|
|
133
|
+
would be inaccurate. The dependency is at the *backend server* level, one
|
|
134
|
+
hop away. This disclosure is here instead of in the metadata because prose
|
|
135
|
+
is the right place to explain the distinction.
|
|
136
|
+
|
|
137
|
+
### Network hops — two of them
|
|
138
|
+
|
|
139
|
+
**Hop 1: the hook → the local Reflexio server (always localhost).**
|
|
140
|
+
The hook is hard-pinned to `http://127.0.0.1:8081`. It communicates via native
|
|
141
|
+
`fetch()` with no configuration knobs; the destination is a hardcoded constant
|
|
142
|
+
in `handler.js`. It reads zero environment variables and zero configuration
|
|
143
|
+
files. This hop cannot leave your machine.
|
|
144
|
+
|
|
145
|
+
**Hop 2: the local Reflexio server → an LLM provider (may leave your
|
|
146
|
+
machine).** The server uses an LLM provider (OpenAI, Anthropic, Gemini,
|
|
147
|
+
DeepSeek, etc.) to extract playbooks and profiles from captured conversations.
|
|
148
|
+
That provider is configured in `~/.reflexio/.env`. **If you configured an
|
|
149
|
+
external provider, excerpts of your conversations will be sent to that
|
|
150
|
+
provider** as part of extraction — trigger text, sample content, and enough
|
|
151
|
+
context for the extractor to produce a useful summary. The primary full
|
|
152
|
+
conversation text stays in your local SQLite database at `~/.reflexio/`, but
|
|
153
|
+
the extracted summaries and illustrative excerpts traverse whatever the LLM
|
|
154
|
+
provider's network path is.
|
|
155
|
+
|
|
156
|
+
**If you want fully offline operation**, configure the local server to use a
|
|
157
|
+
local LLM (Ollama, LM Studio, vLLM, etc.) before enabling this skill. Do not
|
|
158
|
+
rely on the hook's localhost pinning as a privacy guarantee for the system as
|
|
159
|
+
a whole — that only bounds the hook, not the server behind it.
|
|
160
|
+
|
|
161
|
+
**What is captured:** full user and assistant messages; every tool call, input,
|
|
162
|
+
and output (including failed tool calls and exact error strings); self-correction
|
|
163
|
+
text from the assistant's own output. None of this is scrubbed for PII,
|
|
164
|
+
credentials, file paths, or API outputs. If you work on sensitive tasks,
|
|
165
|
+
disable the hook before starting them, or tell the agent mid-task.
|
|
166
|
+
|
|
167
|
+
**How to disable:**
|
|
168
|
+
|
|
169
|
+
- Per-session, stop automatic capture: `openclaw hooks disable reflexio-context`
|
|
170
|
+
- Remove the integration entirely: `reflexio setup openclaw --uninstall`
|
|
171
|
+
- Search-only mode (keep retrieval, drop auto-publish): edit `hook/handler.js`,
|
|
172
|
+
remove the `command:stop` handler, and reinstall
|
|
173
|
+
- Sensitive task: tell the agent "don't log this" — the workspace rule instructs
|
|
174
|
+
it to stop all capture and search calls for the rest of the session
|
|
175
|
+
|
|
176
|
+
**Transparency contract:** the agent is instructed to tell you Reflexio is
|
|
177
|
+
active on the first turn of each session, disclose what is captured AND
|
|
178
|
+
mention that the local server may forward excerpts to an LLM provider, and
|
|
179
|
+
honor session-level opt-outs. This is enforced by
|
|
180
|
+
`~/.openclaw/workspace/reflexio.md`. Edit that file if your deployment needs
|
|
181
|
+
different rules (require explicit approval before every publish, offline-only,
|
|
182
|
+
etc).
|
|
183
|
+
|
|
184
|
+
Full data-handling details live in the **Privacy & Data Collection** section
|
|
185
|
+
further down in this SKILL.md.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
"""
|
|
190
|
+
|
|
191
|
+
first_use = """
|
|
192
|
+
## First-Use Setup
|
|
193
|
+
|
|
194
|
+
Run these commands the first time this skill is invoked. They are idempotent —
|
|
195
|
+
skip if `reflexio` is already on PATH, the local Reflexio server is responding
|
|
196
|
+
at `http://127.0.0.1:8081/health`, and `openclaw hooks list` shows
|
|
197
|
+
`reflexio-context` as `ready`. **Only run them after reading the privacy
|
|
198
|
+
disclosure above, and be aware that step 2 is interactive — it will prompt
|
|
199
|
+
you to pick an LLM provider and paste an API key for the local server's
|
|
200
|
+
extraction pipeline.**
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# 1. Install the reflexio CLI (pipx preferred; pip as fallback).
|
|
204
|
+
command -v reflexio >/dev/null 2>&1 \\
|
|
205
|
+
|| pipx install reflexio-ai 2>/dev/null \\
|
|
206
|
+
|| pip install --user reflexio-ai
|
|
207
|
+
|
|
208
|
+
# 2. INTERACTIVE: activates the hook, slash commands, and workspace rule in
|
|
209
|
+
# OpenClaw. Also prompts you to choose an LLM provider and paste an API key,
|
|
210
|
+
# which gets written to ~/.reflexio/.env. That key is what the local server
|
|
211
|
+
# uses to extract playbooks from captured conversations. Point at a local LLM
|
|
212
|
+
# (Ollama / LM Studio / vLLM) here if you want fully offline operation.
|
|
213
|
+
# Before running this, tell the user what will be asked and why.
|
|
214
|
+
reflexio setup openclaw
|
|
215
|
+
|
|
216
|
+
# 3. Start the local Reflexio backend in the background. The hook talks to
|
|
217
|
+
# this server via HTTP on 127.0.0.1:8081 — it will NOT start the server for
|
|
218
|
+
# you. Tell the user you are doing this before running it.
|
|
219
|
+
curl -sf --max-time 2 http://127.0.0.1:8081/health >/dev/null 2>&1 \\
|
|
220
|
+
|| (nohup reflexio services start --only backend --no-reload \\
|
|
221
|
+
>> ~/.reflexio/logs/server.log 2>&1 & \\
|
|
222
|
+
sleep 5)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
This installs:
|
|
226
|
+
|
|
227
|
+
- `reflexio-context` hook — HTTP-only capture + per-message playbook
|
|
228
|
+
injection (communicates only with `http://127.0.0.1:8081`)
|
|
229
|
+
- `/reflexio-extract` slash command — publish session learnings mid-session
|
|
230
|
+
- `/reflexio-aggregate` slash command — consolidate user playbooks into
|
|
231
|
+
shared agent playbooks
|
|
232
|
+
- `~/.openclaw/workspace/reflexio.md` — always-active behavioral rule
|
|
233
|
+
(transparency + opt-out handling)
|
|
234
|
+
|
|
235
|
+
If the local server is unreachable, the hook logs the error and the agent
|
|
236
|
+
continues the user's task without Reflexio context that session.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
"""
|
|
241
|
+
|
|
242
|
+
(stage / "SKILL.md").write_text(frontmatter + privacy + first_use + orig_body)
|
|
243
|
+
print(f"wrote {stage / 'SKILL.md'}")
|
|
244
|
+
PY
|
|
245
|
+
|
|
246
|
+
if (( STAGE_ONLY == 1 )); then
|
|
247
|
+
cat <<EOF
|
|
248
|
+
|
|
249
|
+
─────────────────────────────────────────────────────────────
|
|
250
|
+
Stage ready. Upload via web at https://clawhub.ai/publish-skill
|
|
251
|
+
|
|
252
|
+
Drag this folder onto the drop zone:
|
|
253
|
+
$STAGE
|
|
254
|
+
|
|
255
|
+
Form values to use:
|
|
256
|
+
Slug: reflexio
|
|
257
|
+
Display name: Reflexio
|
|
258
|
+
Version: <pick a semver, e.g. 1.0.0>
|
|
259
|
+
Tags: latest
|
|
260
|
+
Changelog: Initial release
|
|
261
|
+
|
|
262
|
+
When done, delete the temp folder: rm -rf $STAGE
|
|
263
|
+
─────────────────────────────────────────────────────────────
|
|
264
|
+
EOF
|
|
265
|
+
exit 0
|
|
266
|
+
fi
|
|
267
|
+
|
|
268
|
+
echo "publishing to clawhub: slug=reflexio version=$VERSION"
|
|
269
|
+
(
|
|
270
|
+
cd "$STAGE"
|
|
271
|
+
bun clawhub skill publish . \
|
|
272
|
+
--slug reflexio \
|
|
273
|
+
--version "$VERSION" \
|
|
274
|
+
--tags latest \
|
|
275
|
+
--changelog "$CHANGELOG"
|
|
276
|
+
)
|
|
277
|
+
|
|
278
|
+
echo "done. verify at https://clawhub.ai/skill/reflexio"
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reflexio-federated-plugin
|
|
3
|
+
description: "Automatically capture conversations and inject cross-session context before every response"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "🧠"
|
|
7
|
+
hooks: ["before_prompt_build", "message_sent", "before_compaction", "before_reset", "session_end"]
|
|
8
|
+
requires:
|
|
9
|
+
bins: ["reflexio"]
|
|
10
|
+
env: ["REFLEXIO_USER_ID", "REFLEXIO_AGENT_VERSION"]
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Reflexio Federated Plugin
|
|
14
|
+
|
|
15
|
+
The plugin is the core component that enables automatic conversation capture and cross-session context injection. It is implemented against the **Openclaw Plugin SDK** (`openclaw/plugin-sdk`) and runs on every agent session, persisting data to a local SQLite buffer.
|
|
16
|
+
|
|
17
|
+
## Plugin SDK Hooks
|
|
18
|
+
|
|
19
|
+
The plugin registers the following hooks via `api.on(...)` in the Plugin SDK:
|
|
20
|
+
|
|
21
|
+
### `before_prompt_build` (before each response)
|
|
22
|
+
|
|
23
|
+
Fires before the agent builds its next response. This is the primary hook — it handles:
|
|
24
|
+
|
|
25
|
+
1. **First-use setup check** — detects whether the `reflexio` CLI is installed and configured. If setup is needed, injects a setup instruction into the system context.
|
|
26
|
+
2. **Server auto-start** — checks if the local Reflexio server is healthy via a health check; if not, spawns `reflexio services start --only backend` in the background.
|
|
27
|
+
3. **Retry unpublished turns** — publishes any buffered turns from previous sessions that failed to reach the server.
|
|
28
|
+
4. **Search injection** — runs `reflexio search` on the user's message and, if results are found, prepends them as system context before the agent responds. Skips search for trivial/short inputs to reduce noise. Times out after `search.timeout_ms` (default: 5 000 ms) — never blocks the response.
|
|
29
|
+
|
|
30
|
+
### `message_sent` (each turn)
|
|
31
|
+
|
|
32
|
+
Fires after the agent sends a response. Buffers the (user message, agent response) pair into local SQLite at `~/.reflexio/sessions.db`. Lightweight local write — no network calls. If the buffer exceeds `publish.batch_size * 2` unpublished turns, triggers an incremental publish to the server.
|
|
33
|
+
|
|
34
|
+
### `before_compaction` (before transcript compaction)
|
|
35
|
+
|
|
36
|
+
Fires before Openclaw compacts the transcript. Flushes all unpublished buffered turns to the Reflexio server so no data is lost when the compaction discards history.
|
|
37
|
+
|
|
38
|
+
### `before_reset` (before transcript wipe)
|
|
39
|
+
|
|
40
|
+
Fires before Openclaw wipes the transcript (e.g., `/reset`). Same as `before_compaction` — flushes all remaining unpublished turns.
|
|
41
|
+
|
|
42
|
+
### `session_end` (session end)
|
|
43
|
+
|
|
44
|
+
Fires when the session ends. Performs a final flush of all remaining buffered turns to the Reflexio server.
|
|
45
|
+
|
|
46
|
+
## Tool: `reflexio_publish`
|
|
47
|
+
|
|
48
|
+
In addition to hooks, the plugin registers one agent-invocable tool:
|
|
49
|
+
|
|
50
|
+
- **`reflexio_publish`** — immediately flushes all buffered conversation turns to the Reflexio server. Useful after user corrections or high-signal moments when automatic session-end flushing would be too late.
|
|
51
|
+
|
|
52
|
+
> **Single-session limitation:** The `execute` callback in the Plugin SDK does not receive session context, so this tool always targets the most recently active session. Concurrent multi-session use is not supported.
|
|
53
|
+
|
|
54
|
+
## Prerequisites
|
|
55
|
+
|
|
56
|
+
1. **`reflexio` CLI on PATH** — `pipx install reflexio-ai` or `pip install --user reflexio-ai`. The plugin shells out to this CLI to start the backend server and publish conversations.
|
|
57
|
+
|
|
58
|
+
2. **Node.js 18+** — Required to run the plugin.
|
|
59
|
+
|
|
60
|
+
3. **An LLM provider API key in `~/.reflexio/.env`** — Required for the backend server to extract playbooks and profiles. The first-use setup wizard prompts you to configure this on the first agent session.
|
|
61
|
+
|
|
62
|
+
## Configuration
|
|
63
|
+
|
|
64
|
+
All settings are optional and defined in `plugin/openclaw.plugin.json` under the `configSchema`:
|
|
65
|
+
|
|
66
|
+
### `publish` — Conversation capture and publish behavior
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
"publish": {
|
|
70
|
+
"batch_size": 10, // Number of turns to buffer before mid-session publish
|
|
71
|
+
"max_retries": 3, // Retry count for failed publish attempts
|
|
72
|
+
"max_content_length": 10000 // Max characters per turn (prevents oversized payloads)
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `search` — Context injection before each response
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
"search": {
|
|
80
|
+
"timeout_ms": 5000, // Max time to wait for search results
|
|
81
|
+
"top_k": 5, // Number of playbooks to return per search
|
|
82
|
+
"min_prompt_length": 5 // Skip search for inputs shorter than this
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### `server` — Reflexio server health and startup
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
"server": {
|
|
90
|
+
"health_check_timeout_ms": 3000, // Time limit for health checks
|
|
91
|
+
"stale_flag_ms": 120000 // Flag file age before retry (2 minutes)
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Security and Privacy
|
|
96
|
+
|
|
97
|
+
### What the plugin reads
|
|
98
|
+
|
|
99
|
+
- **Environment variables**: `REFLEXIO_USER_ID` (overrides auto-derived user ID) and `REFLEXIO_AGENT_VERSION` (overrides agent version label). Both are optional.
|
|
100
|
+
- **`~/.openclaw/openclaw.json`**: read by the Openclaw host process to load the plugin; the plugin itself does not read this file directly.
|
|
101
|
+
- **`~/.reflexio/.env`**: read to resolve `REFLEXIO_URL` if the env var is not set in the process environment.
|
|
102
|
+
|
|
103
|
+
### What the plugin shells out to
|
|
104
|
+
|
|
105
|
+
The plugin spawns the `reflexio` CLI for:
|
|
106
|
+
- `reflexio services start --only backend` — starts the local server if not running
|
|
107
|
+
- `reflexio search <query>` — fetches context from the local server
|
|
108
|
+
- `reflexio interactions publish --file <payload.json>` — publishes buffered turns
|
|
109
|
+
|
|
110
|
+
All spawned processes use the binary on your `PATH`. If `reflexio` is not found, the `error` event on the child process is caught, the affected turns are marked for retry, and the plugin continues working without blocking the agent.
|
|
111
|
+
|
|
112
|
+
### Network destinations
|
|
113
|
+
|
|
114
|
+
The plugin communicates only with the Reflexio server at the URL resolved from `REFLEXIO_URL` / `~/.reflexio/.env` / default `http://127.0.0.1:8081`. Local-server detection uses exact hostname matching (`127.0.0.1` or `localhost`); only local servers are auto-started.
|
|
115
|
+
|
|
116
|
+
**The local Reflexio server makes outbound LLM API calls** for profile/playbook extraction. The destination depends on your `~/.reflexio/.env` configuration (OpenAI, Anthropic, Gemini, or a local LLM). For a fully offline setup, configure a local LLM provider (Ollama, LM Studio, vLLM) during first-use setup.
|
|
117
|
+
|
|
118
|
+
## Buffering and Retry
|
|
119
|
+
|
|
120
|
+
The plugin uses SQLite to buffer conversations locally:
|
|
121
|
+
|
|
122
|
+
- **Location**: `~/.reflexio/sessions.db`
|
|
123
|
+
- **Retention**: Buffered turns are kept until successfully published to the server
|
|
124
|
+
- **Retry logic**: On every `before_prompt_build`, the plugin retries any unpublished sessions from previous runs (up to `max_retries`)
|
|
125
|
+
- **Graceful degradation**: If the server is down, the agent works normally and buffers persist
|
|
126
|
+
|
|
127
|
+
## Lifecycle Summary
|
|
128
|
+
|
|
129
|
+
| Hook | Trigger | Actions |
|
|
130
|
+
|------|---------|---------|
|
|
131
|
+
| `before_prompt_build` | Before each agent response | Setup check, server auto-start, retry old sessions, search injection |
|
|
132
|
+
| `message_sent` | After each agent response | Buffer turn to SQLite, incremental publish if batch threshold exceeded |
|
|
133
|
+
| `before_compaction` | Before transcript compaction | Flush all unpublished turns |
|
|
134
|
+
| `before_reset` | Before transcript wipe | Flush all unpublished turns |
|
|
135
|
+
| `session_end` | Session ends | Final flush of all remaining turns |
|
|
136
|
+
|
|
137
|
+
## Implementation
|
|
138
|
+
|
|
139
|
+
The plugin is implemented in TypeScript in `plugin/`:
|
|
140
|
+
|
|
141
|
+
- **`index.ts`** — SDK wiring: `definePluginEntry`, hook registration, tool registration
|
|
142
|
+
- **`hook/handler.ts`** — Core logic: `handleBeforePromptBuild`, `handleMessageSent`, `handleSessionFlush`, `handleToolPublish`
|
|
143
|
+
- **`hook/setup.ts`** — First-use setup: CLI detection, LLM provider prompt, server start
|
|
144
|
+
|
|
145
|
+
Supporting libraries in `plugin/lib/`:
|
|
146
|
+
|
|
147
|
+
- **`server.ts`** — URL resolution, health check, auto-start
|
|
148
|
+
- **`user-id.ts`** — User identity and agent version resolution from env vars / session key
|
|
149
|
+
- **`sqlite-buffer.ts`** — Turn buffering, retry management
|
|
150
|
+
- **`publish.ts`** — Payload construction, CLI spawn with error handling
|
|
151
|
+
- **`search.ts`** — Search invocation, result formatting, trivial-input filtering
|
|
152
|
+
|
|
153
|
+
## Debugging
|
|
154
|
+
|
|
155
|
+
All plugin log lines are prefixed with `[reflexio]` for easy filtering:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Option A: capture stderr to file and tail it
|
|
159
|
+
openclaw chat 2>reflexio-plugin.log
|
|
160
|
+
tail -f reflexio-plugin.log | grep "\[reflexio\]"
|
|
161
|
+
|
|
162
|
+
# Option B: watch inline
|
|
163
|
+
openclaw chat 2>&1 | grep "\[reflexio\]"
|
|
164
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# reflexio-federated install.sh — plugin installation.
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
PLUGIN_DIR="$(cd "$(dirname "$0")/../plugin" && pwd)"
|
|
6
|
+
OPENCLAW_HOME="${OPENCLAW_HOME:-$HOME/.openclaw}"
|
|
7
|
+
|
|
8
|
+
die() { echo "error: $*" >&2; exit 1; }
|
|
9
|
+
info() { echo "==> $*"; }
|
|
10
|
+
|
|
11
|
+
# 1. Prereq checks
|
|
12
|
+
info "Checking prerequisites..."
|
|
13
|
+
command -v openclaw >/dev/null || die "openclaw CLI required but not found on PATH"
|
|
14
|
+
command -v node >/dev/null || die "node required but not found on PATH"
|
|
15
|
+
|
|
16
|
+
# 2. Install the plugin
|
|
17
|
+
info "Installing plugin..."
|
|
18
|
+
openclaw plugins uninstall --force reflexio-federated 2>/dev/null || true
|
|
19
|
+
rm -rf "$OPENCLAW_HOME/extensions/reflexio-federated"
|
|
20
|
+
openclaw plugins install "$PLUGIN_DIR"
|
|
21
|
+
openclaw plugins enable reflexio-federated 2>/dev/null || true
|
|
22
|
+
|
|
23
|
+
# 3. Restart gateway
|
|
24
|
+
info "Restarting openclaw gateway..."
|
|
25
|
+
openclaw gateway restart
|
|
26
|
+
|
|
27
|
+
# 4. Verify
|
|
28
|
+
info "Verification:"
|
|
29
|
+
if openclaw plugins inspect reflexio-federated 2>/dev/null | grep -q "Status: loaded"; then
|
|
30
|
+
info " ✓ plugin registered and loaded"
|
|
31
|
+
else
|
|
32
|
+
die "Plugin did not reach 'loaded' status. Run 'openclaw plugins inspect reflexio-federated' to debug."
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
info "Installation complete."
|
|
36
|
+
info "Reflexio setup (CLI install, storage config, server start) happens automatically on first agent session."
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# reflexio-federated uninstall.sh — reverses install.sh.
|
|
3
|
+
# Leaves ~/.reflexio/ user data intact unless --purge is passed.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
OPENCLAW_HOME="${OPENCLAW_HOME:-$HOME/.openclaw}"
|
|
7
|
+
PURGE_DATA="${1:-}"
|
|
8
|
+
|
|
9
|
+
info() { echo "==> $*"; }
|
|
10
|
+
|
|
11
|
+
info "Disabling plugin..."
|
|
12
|
+
openclaw plugins disable reflexio-federated 2>/dev/null || echo "(already disabled)"
|
|
13
|
+
|
|
14
|
+
info "Uninstalling plugin..."
|
|
15
|
+
openclaw plugins uninstall --force reflexio-federated 2>/dev/null || echo "(already uninstalled)"
|
|
16
|
+
rm -rf "$OPENCLAW_HOME/extensions/reflexio-federated"
|
|
17
|
+
|
|
18
|
+
info "Cleaning up state files..."
|
|
19
|
+
rm -f "$HOME/.reflexio/sessions.db"
|
|
20
|
+
rm -f "$HOME/.reflexio/logs/.server-starting"
|
|
21
|
+
|
|
22
|
+
# Remove setup markers
|
|
23
|
+
find "$HOME/.reflexio/" -name ".setup_complete_*" -delete 2>/dev/null || true
|
|
24
|
+
|
|
25
|
+
if [[ "$PURGE_DATA" == "--purge" ]]; then
|
|
26
|
+
info "Purging ~/.reflexio/ user data per --purge flag..."
|
|
27
|
+
rm -rf "$HOME/.reflexio"
|
|
28
|
+
else
|
|
29
|
+
info "User data at ~/.reflexio/ preserved. Use --purge to delete it too."
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
info "Restarting openclaw gateway..."
|
|
33
|
+
openclaw gateway restart || echo "warning: gateway restart failed — you may need to restart manually"
|
|
34
|
+
|
|
35
|
+
info "Uninstall complete."
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { buildPayload } from "../plugin/lib/publish.ts";
|
|
3
|
+
import type { Turn } from "../plugin/lib/sqlite-buffer.ts";
|
|
4
|
+
|
|
5
|
+
describe("buildPayload", () => {
|
|
6
|
+
it("builds correct JSON structure", () => {
|
|
7
|
+
const turns: Turn[] = [
|
|
8
|
+
{ id: 1, session_id: "s1", role: "user", content: "hello", timestamp: "2026-01-01T00:00:00Z", published: 0, retry_count: 0 },
|
|
9
|
+
{ id: 2, session_id: "s1", role: "assistant", content: "hi", timestamp: "2026-01-01T00:00:01Z", published: 0, retry_count: 0 },
|
|
10
|
+
];
|
|
11
|
+
const payload = buildPayload(turns, "user1", "openclaw-agent", "sess1");
|
|
12
|
+
const parsed = JSON.parse(payload);
|
|
13
|
+
expect(parsed.user_id).toBe("user1");
|
|
14
|
+
expect(parsed.source).toBe("openclaw");
|
|
15
|
+
expect(parsed.agent_version).toBe("openclaw-agent");
|
|
16
|
+
expect(parsed.session_id).toBe("sess1");
|
|
17
|
+
expect(parsed.interactions).toHaveLength(2);
|
|
18
|
+
expect(parsed.interactions[0].role).toBe("user");
|
|
19
|
+
expect(parsed.interactions[0].content).toBe("hello");
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("returns empty interactions for empty turns", () => {
|
|
23
|
+
const payload = buildPayload([], "user1", "openclaw-agent", "sess1");
|
|
24
|
+
const parsed = JSON.parse(payload);
|
|
25
|
+
expect(parsed.interactions).toHaveLength(0);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { shouldSkipSearch, formatSearchContext } from "../plugin/lib/search.ts";
|
|
3
|
+
|
|
4
|
+
describe("shouldSkipSearch", () => {
|
|
5
|
+
it("skips short messages", () => {
|
|
6
|
+
expect(shouldSkipSearch("hi", 5)).toBe(true);
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it("skips trivial responses", () => {
|
|
10
|
+
expect(shouldSkipSearch("yes", 5)).toBe(true);
|
|
11
|
+
expect(shouldSkipSearch("ok", 5)).toBe(true);
|
|
12
|
+
expect(shouldSkipSearch("thanks", 5)).toBe(true);
|
|
13
|
+
expect(shouldSkipSearch("Sure", 5)).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("does not skip real messages", () => {
|
|
17
|
+
expect(shouldSkipSearch("Write a Python function to sort a list", 5)).toBe(false);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe("formatSearchContext", () => {
|
|
22
|
+
it("returns null for empty results", () => {
|
|
23
|
+
expect(formatSearchContext("")).toBeNull();
|
|
24
|
+
expect(formatSearchContext("Found 0 profiles, 0 playbooks")).toBeNull();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("returns trimmed content for real results", () => {
|
|
28
|
+
const result = formatSearchContext("## Playbooks\n- Use type hints");
|
|
29
|
+
expect(result).toBe("## Playbooks\n- Use type hints");
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import { resolveServerUrl, isLocalServer } from "../plugin/lib/server.ts";
|
|
3
|
+
|
|
4
|
+
describe("resolveServerUrl", () => {
|
|
5
|
+
const originalEnv = process.env;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
process.env = { ...originalEnv };
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
afterEach(() => {
|
|
12
|
+
process.env = originalEnv;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("returns REFLEXIO_URL env var when set", () => {
|
|
16
|
+
process.env.REFLEXIO_URL = "https://custom.server:9090";
|
|
17
|
+
expect(resolveServerUrl()).toBe("https://custom.server:9090");
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("returns default when no env var and no .env file", () => {
|
|
21
|
+
delete process.env.REFLEXIO_URL;
|
|
22
|
+
expect(resolveServerUrl()).toBe("http://127.0.0.1:8081");
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe("isLocalServer", () => {
|
|
27
|
+
it("returns true for localhost", () => {
|
|
28
|
+
expect(isLocalServer("http://localhost:8081")).toBe(true);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("returns true for 127.0.0.1", () => {
|
|
32
|
+
expect(isLocalServer("http://127.0.0.1:8081")).toBe(true);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("returns false for remote URL", () => {
|
|
36
|
+
expect(isLocalServer("https://reflexio.ai:8081")).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("returns false for localhost.evil.com", () => {
|
|
40
|
+
expect(isLocalServer("https://localhost.evil.com")).toBe(false);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
|
+
import * as os from "node:os";
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
import {
|
|
6
|
+
isSetupComplete,
|
|
7
|
+
markSetupComplete,
|
|
8
|
+
checkReflexioInstalled,
|
|
9
|
+
checkReflexioConfigured,
|
|
10
|
+
} from "../plugin/hook/setup.ts";
|
|
11
|
+
|
|
12
|
+
describe("isSetupComplete", () => {
|
|
13
|
+
let tmpDir: string;
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "reflexio-setup-test-"));
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("returns false when marker does not exist", () => {
|
|
24
|
+
expect(isSetupComplete(tmpDir, "main")).toBe(false);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("returns true after markSetupComplete", () => {
|
|
28
|
+
markSetupComplete(tmpDir, "main");
|
|
29
|
+
expect(isSetupComplete(tmpDir, "main")).toBe(true);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("is per-agent", () => {
|
|
33
|
+
markSetupComplete(tmpDir, "main");
|
|
34
|
+
expect(isSetupComplete(tmpDir, "work")).toBe(false);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe("checkReflexioInstalled", () => {
|
|
39
|
+
it("returns a boolean", async () => {
|
|
40
|
+
const result = await checkReflexioInstalled();
|
|
41
|
+
expect(typeof result).toBe("boolean");
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
describe("checkReflexioConfigured", () => {
|
|
46
|
+
it("returns false for nonexistent directory", () => {
|
|
47
|
+
expect(checkReflexioConfigured("/tmp/nonexistent-reflexio-dir-" + Date.now())).toBe(false);
|
|
48
|
+
});
|
|
49
|
+
});
|