foxclaw 0.1.0 → 0.1.2
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/README.md +54 -29
- package/bin/foxclaw.cjs +51 -0
- package/index.js +11 -10
- package/package.json +46 -38
- package/python/.dockerignore +35 -0
- package/python/.env.example +165 -0
- package/python/.gitattributes +46 -0
- package/python/.github/workflows/ci.yml +122 -0
- package/python/.github/workflows/release.yml +183 -0
- package/python/Dockerfile +64 -0
- package/python/LICENSE +21 -0
- package/python/MANIFEST.in +14 -0
- package/python/README.md +192 -0
- package/python/README_CN.md +324 -0
- package/python/bench/bm25_audit.py +199 -0
- package/python/bench/bm25_regression.py +178 -0
- package/python/bench/bm25_stress.py +159 -0
- package/python/bench/cd_audit.py +238 -0
- package/python/bench/chaos.py +142 -0
- package/python/bench/concurrency.py +103 -0
- package/python/bench/e2e_real_models.py +95 -0
- package/python/bench/llm_retry_test.py +248 -0
- package/python/bench/load_test.py +196 -0
- package/python/bench/vector_ivf_upgrade.py +134 -0
- package/python/docs/CHANNELS.md +195 -0
- package/python/docs/GOVERNANCE.md +164 -0
- package/python/docs/RELEASE.md +109 -0
- package/python/docs/RUN.md +75 -0
- package/python/docs/RUN_CN.md +121 -0
- package/python/docs//351/205/215/347/275/256/346/214/207/345/215/227.md +152 -0
- package/python/evals/__init__.py +0 -0
- package/python/evals/governance/README.md +61 -0
- package/python/evals/governance/__init__.py +0 -0
- package/python/evals/governance/cases.py +152 -0
- package/python/evals/governance/compare_embeddings.py +94 -0
- package/python/evals/governance/convergence.svg +11 -0
- package/python/evals/governance/report.json +371 -0
- package/python/evals/governance/run_evals.py +400 -0
- package/python/examples/governance_middleware_demo.py +77 -0
- package/python/examples/langgraph_governance_demo.py +108 -0
- package/python/examples/sample_itinerary.csv +6 -0
- package/python/examples/sample_knowledge.csv +9 -0
- package/python/examples/sample_transactions.csv +14 -0
- package/python/foxclaw/__init__.py +526 -0
- package/python/foxclaw/agents/__init__.py +12 -0
- package/python/foxclaw/agents/agents.py +35 -0
- package/python/foxclaw/agents/base.py +865 -0
- package/python/foxclaw/agents/impl/__init__.py +1 -0
- package/python/foxclaw/agents/impl/_helpers.py +78 -0
- package/python/foxclaw/agents/impl/finance.py +248 -0
- package/python/foxclaw/agents/impl/office.py +367 -0
- package/python/foxclaw/agents/impl/supervisor.py +659 -0
- package/python/foxclaw/agents/mixins/_context.py +151 -0
- package/python/foxclaw/agents/mixins/augment.py +149 -0
- package/python/foxclaw/agents/mixins/llm.py +66 -0
- package/python/foxclaw/agents/mixins/memory.py +35 -0
- package/python/foxclaw/agents/mixins/preference.py +81 -0
- package/python/foxclaw/agents/mixins/prompt.py +77 -0
- package/python/foxclaw/agents/mixins/skillbox.py +58 -0
- package/python/foxclaw/agents/mixins/tool_exec.py +443 -0
- package/python/foxclaw/api/__init__.py +283 -0
- package/python/foxclaw/api/app.py +123 -0
- package/python/foxclaw/api/middleware.py +317 -0
- package/python/foxclaw/api/routes/ahs.py +417 -0
- package/python/foxclaw/api/routes/attachments.py +117 -0
- package/python/foxclaw/api/routes/browser.py +39 -0
- package/python/foxclaw/api/routes/domain.py +314 -0
- package/python/foxclaw/api/routes/knowledge.py +163 -0
- package/python/foxclaw/api/routes/llm_admin.py +461 -0
- package/python/foxclaw/api/routes/memory.py +89 -0
- package/python/foxclaw/api/routes/orchestration.py +41 -0
- package/python/foxclaw/api/routes/recovery.py +43 -0
- package/python/foxclaw/api/routes/review.py +275 -0
- package/python/foxclaw/api/routes/search.py +37 -0
- package/python/foxclaw/api/routes/system.py +327 -0
- package/python/foxclaw/api/routes/task.py +281 -0
- package/python/foxclaw/api/routes/ws.py +68 -0
- package/python/foxclaw/api/spine.py +55 -0
- package/python/foxclaw/browser/__init__.py +13 -0
- package/python/foxclaw/browser/action/__init__.py +1 -0
- package/python/foxclaw/browser/action/action_executor.py +54 -0
- package/python/foxclaw/browser/action/action_types.py +45 -0
- package/python/foxclaw/browser/action/action_verifier.py +68 -0
- package/python/foxclaw/browser/action/url_policy.py +147 -0
- package/python/foxclaw/browser/adapter/__init__.py +1 -0
- package/python/foxclaw/browser/adapter/base_adapter.py +23 -0
- package/python/foxclaw/browser/adapter/web_adapter.py +46 -0
- package/python/foxclaw/browser/driver/__init__.py +1 -0
- package/python/foxclaw/browser/driver/base_driver.py +61 -0
- package/python/foxclaw/browser/driver/playwright_driver.py +166 -0
- package/python/foxclaw/browser/perception/__init__.py +1 -0
- package/python/foxclaw/browser/perception/dom_extractor.py +43 -0
- package/python/foxclaw/browser/perception/element_indexer.py +57 -0
- package/python/foxclaw/browser/perception/semantic_reducer.py +33 -0
- package/python/foxclaw/browser/perception/snapshot.py +29 -0
- package/python/foxclaw/browser/service.py +148 -0
- package/python/foxclaw/browser/session/__init__.py +1 -0
- package/python/foxclaw/browser/session/session_manager.py +57 -0
- package/python/foxclaw/capability/__init__.py +12 -0
- package/python/foxclaw/capability/embedding_service.py +67 -0
- package/python/foxclaw/channels/__init__.py +140 -0
- package/python/foxclaw/channels/discord.py +184 -0
- package/python/foxclaw/channels/dispatcher.py +204 -0
- package/python/foxclaw/channels/feishu.py +225 -0
- package/python/foxclaw/channels/openclaw_bridge.py +156 -0
- package/python/foxclaw/channels/signing.py +187 -0
- package/python/foxclaw/channels/telegram.py +121 -0
- package/python/foxclaw/channels/weixin.py +225 -0
- package/python/foxclaw/cli.py +154 -0
- package/python/foxclaw/cognitive/__init__.py +4 -0
- package/python/foxclaw/cognitive/reasoner.py +82 -0
- package/python/foxclaw/cognitive/state.py +147 -0
- package/python/foxclaw/core/__init__.py +9 -0
- package/python/foxclaw/core/audit_chain.py +133 -0
- package/python/foxclaw/core/audit_sink.py +100 -0
- package/python/foxclaw/core/compaction.py +283 -0
- package/python/foxclaw/core/config.py +65 -0
- package/python/foxclaw/core/confirm_nonce.py +157 -0
- package/python/foxclaw/core/dispatch.py +27 -0
- package/python/foxclaw/core/envfile.py +48 -0
- package/python/foxclaw/core/failure_policy.py +151 -0
- package/python/foxclaw/core/gateway.py +85 -0
- package/python/foxclaw/core/governance_audit.py +175 -0
- package/python/foxclaw/core/idempotency.py +289 -0
- package/python/foxclaw/core/injection_guard.py +221 -0
- package/python/foxclaw/core/memory_adapter.py +516 -0
- package/python/foxclaw/core/metrics.py +89 -0
- package/python/foxclaw/core/model_router.py +1097 -0
- package/python/foxclaw/core/paths.py +103 -0
- package/python/foxclaw/core/recovery.py +362 -0
- package/python/foxclaw/core/scheduler.py +144 -0
- package/python/foxclaw/core/secrets.py +134 -0
- package/python/foxclaw/core/sessions.py +157 -0
- package/python/foxclaw/core/settings.py +430 -0
- package/python/foxclaw/core/shared_write.py +198 -0
- package/python/foxclaw/core/steering_queue.py +153 -0
- package/python/foxclaw/core/system_bus.py +84 -0
- package/python/foxclaw/core/thought_chain.py +318 -0
- package/python/foxclaw/core/token_meter.py +235 -0
- package/python/foxclaw/core/tools.py +172 -0
- package/python/foxclaw/core/tracing.py +390 -0
- package/python/foxclaw/core/truth_pipeline.py +114 -0
- package/python/foxclaw/core/vec_recall_adapter.py +503 -0
- package/python/foxclaw/core/verify.py +181 -0
- package/python/foxclaw/core/web_search.py +242 -0
- package/python/foxclaw/finance/__init__.py +15 -0
- package/python/foxclaw/finance/evidence.py +153 -0
- package/python/foxclaw/finance/fx.py +100 -0
- package/python/foxclaw/finance/graph.py +188 -0
- package/python/foxclaw/finance/models.py +150 -0
- package/python/foxclaw/finance/nlparse.py +575 -0
- package/python/foxclaw/finance/policy.py +329 -0
- package/python/foxclaw/finance/reasoner.py +129 -0
- package/python/foxclaw/finance/reasoning.py +340 -0
- package/python/foxclaw/finance/reconcile.py +180 -0
- package/python/foxclaw/finance/runtime.py +527 -0
- package/python/foxclaw/governance/__init__.py +24 -0
- package/python/foxclaw/governance/middleware.py +184 -0
- package/python/foxclaw/harness/__init__.py +17 -0
- package/python/foxclaw/harness/_base.py +72 -0
- package/python/foxclaw/harness/_policy.py +359 -0
- package/python/foxclaw/harness/drift.py +89 -0
- package/python/foxclaw/harness/event_bus.py +31 -0
- package/python/foxclaw/harness/harness.py +446 -0
- package/python/foxclaw/harness/loop_detection.py +152 -0
- package/python/foxclaw/itinerary/__init__.py +10 -0
- package/python/foxclaw/itinerary/amap_client.py +117 -0
- package/python/foxclaw/itinerary/models.py +80 -0
- package/python/foxclaw/itinerary/reasoner.py +101 -0
- package/python/foxclaw/itinerary/reasoning.py +174 -0
- package/python/foxclaw/itinerary/runtime.py +148 -0
- package/python/foxclaw/kernel/__init__.py +13 -0
- package/python/foxclaw/kernel/capabilities.py +73 -0
- package/python/foxclaw/kernel/policy_gate.py +114 -0
- package/python/foxclaw/kernel/process_manager.py +205 -0
- package/python/foxclaw/kernel/scheduler.py +131 -0
- package/python/foxclaw/kernel/sentinel.py +453 -0
- package/python/foxclaw/kernel/sentinel_client.py +246 -0
- package/python/foxclaw/kernel/spine.py +97 -0
- package/python/foxclaw/knowledge/__init__.py +376 -0
- package/python/foxclaw/knowledge/truth_crystallizer.py +92 -0
- package/python/foxclaw/learning/__init__.py +12 -0
- package/python/foxclaw/learning/knowledge_graph.py +149 -0
- package/python/foxclaw/learning/models.py +93 -0
- package/python/foxclaw/learning/reasoner.py +70 -0
- package/python/foxclaw/learning/runtime.py +363 -0
- package/python/foxclaw/learning/spaced_repetition.py +96 -0
- package/python/foxclaw/mcp_server.py +189 -0
- package/python/foxclaw/orchestration/__init__.py +184 -0
- package/python/foxclaw/pipeline/__init__.py +23 -0
- package/python/foxclaw/pipeline/cognitive_pipeline.py +481 -0
- package/python/foxclaw/pipeline/supervisor_stages.py +230 -0
- package/python/foxclaw/planning/__init__.py +17 -0
- package/python/foxclaw/planning/llm_planner.py +232 -0
- package/python/foxclaw/planning/planner.py +99 -0
- package/python/foxclaw/search/__init__.py +24 -0
- package/python/foxclaw/search/agent_port.py +194 -0
- package/python/foxclaw/search/evidence.py +113 -0
- package/python/foxclaw/search/external_search.py +50 -0
- package/python/foxclaw/search/hkc_read_port.py +60 -0
- package/python/foxclaw/search/internal_search.py +73 -0
- package/python/foxclaw/search/models.py +129 -0
- package/python/foxclaw/search/planner.py +44 -0
- package/python/foxclaw/search/retriever.py +39 -0
- package/python/foxclaw/search/runtime.py +134 -0
- package/python/foxclaw/search/strategy.py +44 -0
- package/python/foxclaw/skills/__init__.py +613 -0
- package/python/foxclaw/skills/hooks_spec.py +73 -0
- package/python/foxclaw/skills/lifecycle.py +278 -0
- package/python/foxclaw/skills/markdown_skill.py +174 -0
- package/python/foxclaw/skills/markdown_store.py +39 -0
- package/python/foxclaw/skills/mcp_client.py +190 -0
- package/python/foxclaw/skills/mcp_store.py +43 -0
- package/python/foxclaw/skills/permission.py +180 -0
- package/python/foxclaw/skills/pipeline.py +386 -0
- package/python/foxclaw/skills/policy.py +80 -0
- package/python/foxclaw/skills/review.py +72 -0
- package/python/foxclaw/skills/store.py +57 -0
- package/python/frontend/assets/core_bg.jpg +0 -0
- package/python/frontend/deck/auth.js +32 -0
- package/python/frontend/deck/chat_model_picker.js +537 -0
- package/python/frontend/deck/domain.js +296 -0
- package/python/frontend/deck/main.js +1950 -0
- package/python/frontend/deck/markdown.js +48 -0
- package/python/frontend/deck/settings.js +324 -0
- package/python/frontend/deck/state.js +6 -0
- package/python/frontend/deck/util.js +6 -0
- package/python/frontend/deck/visuals.js +212 -0
- package/python/frontend/deck.css +855 -0
- package/python/frontend/deck.html +686 -0
- package/python/frontend/deck_v2.html +341 -0
- package/python/frontend/planet/index.html +266 -0
- package/python/frontend/planet/planet.css +579 -0
- package/python/frontend/planet/planet.js +1637 -0
- package/python/frontend/planet/vendor/three.core.min.js +6 -0
- package/python/frontend/planet/vendor/three.module.min.js +6 -0
- package/python/frontend/v3/assets/index-BD7VPbMV.js +33 -0
- package/python/frontend/v3/assets/index-CAvnYWGH.css +1 -0
- package/python/frontend/v3/index.html +15 -0
- package/python/frontend/widget_runtime.js +295 -0
- package/python/frontend/widgets.js +696 -0
- package/python/frontend_src/index.html +14 -0
- package/python/frontend_src/package-lock.json +1376 -0
- package/python/frontend_src/package.json +19 -0
- package/python/frontend_src/src/App.vue +62 -0
- package/python/frontend_src/src/api.js +89 -0
- package/python/frontend_src/src/components/ChatDock.vue +377 -0
- package/python/frontend_src/src/components/ComposerMenu.vue +75 -0
- package/python/frontend_src/src/components/DocViewer.vue +171 -0
- package/python/frontend_src/src/components/Inspector.vue +241 -0
- package/python/frontend_src/src/components/LeftRail.vue +394 -0
- package/python/frontend_src/src/components/MenuPopover.vue +130 -0
- package/python/frontend_src/src/components/MessageStream.vue +401 -0
- package/python/frontend_src/src/components/ModelPicker.vue +355 -0
- package/python/frontend_src/src/components/QuickIngest.vue +118 -0
- package/python/frontend_src/src/components/Stage.vue +226 -0
- package/python/frontend_src/src/components/ToolMenu.vue +144 -0
- package/python/frontend_src/src/components/TopBar.vue +90 -0
- package/python/frontend_src/src/components/panels/ActivityPanel.vue +84 -0
- package/python/frontend_src/src/components/panels/AgentsPanel.vue +86 -0
- package/python/frontend_src/src/components/panels/KnowledgePanel.vue +441 -0
- package/python/frontend_src/src/components/panels/MemoryPanel.vue +118 -0
- package/python/frontend_src/src/components/panels/PanelBox.vue +51 -0
- package/python/frontend_src/src/components/panels/ReviewPanel.vue +308 -0
- package/python/frontend_src/src/components/panels/SettingsPanel.vue +254 -0
- package/python/frontend_src/src/components/panels/TasksPanel.vue +74 -0
- package/python/frontend_src/src/components/panels/ToolsPanel.vue +640 -0
- package/python/frontend_src/src/components/panels/UsagePanel.vue +105 -0
- package/python/frontend_src/src/lib/fmt.js +48 -0
- package/python/frontend_src/src/lib/md.js +204 -0
- package/python/frontend_src/src/main.js +7 -0
- package/python/frontend_src/src/stores/app.js +106 -0
- package/python/frontend_src/src/stores/chat.js +484 -0
- package/python/frontend_src/src/stores/model.js +104 -0
- package/python/frontend_src/src/stores/panels.js +330 -0
- package/python/frontend_src/src/styles/base.css +138 -0
- package/python/frontend_src/src/styles/panel.css +117 -0
- package/python/frontend_src/src/styles/tokens.css +78 -0
- package/python/frontend_src/vite.config.js +46 -0
- package/python/pyproject.toml +265 -0
- package/python/skills/README.md +123 -0
- package/python/skills/execution-contract/SKILL.md +30 -0
- package/python/skills/general-assistant/SKILL.md +34 -0
- package/python/skills/planner/SKILL.md +33 -0
- package/python/skills/schedule-itinerary/SKILL.md +35 -0
- package/python/skills/skill-composition/SKILL.md +31 -0
- package/python/skills/skill-guard/SKILL.md +67 -0
- package/python/skills/skill-memory/SKILL.md +50 -0
- package/python/skills/skill-router/SKILL.md +35 -0
- package/python/tests/conftest.py +76 -0
- package/python/tests/run_all.py +263 -0
- package/python/tests/test_agent_lifecycle.py +360 -0
- package/python/tests/test_ahs_p2.py +414 -0
- package/python/tests/test_anthropic_tools.py +206 -0
- package/python/tests/test_api.py +87 -0
- package/python/tests/test_api_auth.py +83 -0
- package/python/tests/test_api_host_guard.py +69 -0
- package/python/tests/test_attachments.py +167 -0
- package/python/tests/test_audit_chain.py +121 -0
- package/python/tests/test_audit_sink.py +136 -0
- package/python/tests/test_browser.py +153 -0
- package/python/tests/test_browser_request_guard.py +184 -0
- package/python/tests/test_capabilities.py +158 -0
- package/python/tests/test_channel_signing.py +192 -0
- package/python/tests/test_channel_trust.py +109 -0
- package/python/tests/test_channels.py +184 -0
- package/python/tests/test_cli.py +46 -0
- package/python/tests/test_compaction_toolpair.py +119 -0
- package/python/tests/test_config_layering.py +65 -0
- package/python/tests/test_confirm_nonce.py +197 -0
- package/python/tests/test_context_compaction_wiring.py +130 -0
- package/python/tests/test_dispatch.py +95 -0
- package/python/tests/test_domain_evals.py +403 -0
- package/python/tests/test_domain_import.py +78 -0
- package/python/tests/test_domain_reasoners.py +148 -0
- package/python/tests/test_e2e.py +178 -0
- package/python/tests/test_emb_cache.py +107 -0
- package/python/tests/test_embedding_singleton.py +89 -0
- package/python/tests/test_envfile.py +83 -0
- package/python/tests/test_evals_smoke.py +114 -0
- package/python/tests/test_event_spine.py +182 -0
- package/python/tests/test_evidence_semantic.py +101 -0
- package/python/tests/test_evidence_sse.py +97 -0
- package/python/tests/test_file_ingest.py +146 -0
- package/python/tests/test_finance.py +153 -0
- package/python/tests/test_finance_ledger.py +252 -0
- package/python/tests/test_finance_persist.py +178 -0
- package/python/tests/test_gateway.py +144 -0
- package/python/tests/test_governance.py +468 -0
- package/python/tests/test_governance_audit.py +359 -0
- package/python/tests/test_governance_middleware.py +143 -0
- package/python/tests/test_hkc.py +286 -0
- package/python/tests/test_hkc_index_build_manager.py +339 -0
- package/python/tests/test_hkc_manifest_reuse.py +317 -0
- package/python/tests/test_hkc_search_event_sync.py +533 -0
- package/python/tests/test_import_path_guard.py +161 -0
- package/python/tests/test_injection_guard.py +211 -0
- package/python/tests/test_integration.py +141 -0
- package/python/tests/test_itinerary.py +103 -0
- package/python/tests/test_kee_semantic.py +89 -0
- package/python/tests/test_kernel.py +222 -0
- package/python/tests/test_learning.py +110 -0
- package/python/tests/test_llm_admin.py +160 -0
- package/python/tests/test_llm_planner.py +366 -0
- package/python/tests/test_markdown_skills.py +73 -0
- package/python/tests/test_markdown_skills_openclaw.py +71 -0
- package/python/tests/test_mcp_connectors.py +109 -0
- package/python/tests/test_mcp_guardian_discovery.py +91 -0
- package/python/tests/test_mcp_no_memory.py +43 -0
- package/python/tests/test_mcp_policy_gate.py +77 -0
- package/python/tests/test_mcp_server.py +95 -0
- package/python/tests/test_memory_recall.py +95 -0
- package/python/tests/test_metrics.py +66 -0
- package/python/tests/test_multi_chain.py +102 -0
- package/python/tests/test_multimodal.py +135 -0
- package/python/tests/test_negotiation.py +146 -0
- package/python/tests/test_orchestration.py +119 -0
- package/python/tests/test_orchestration_decoupled.py +109 -0
- package/python/tests/test_p3_p5_hardening.py +338 -0
- package/python/tests/test_parallel_dispatch.py +215 -0
- package/python/tests/test_pipeline.py +533 -0
- package/python/tests/test_plan_visible.py +86 -0
- package/python/tests/test_planner.py +95 -0
- package/python/tests/test_policy_gate.py +109 -0
- package/python/tests/test_reasoner.py +185 -0
- package/python/tests/test_release_check.py +263 -0
- package/python/tests/test_resume_checkpoint.py +156 -0
- package/python/tests/test_routing.py +95 -0
- package/python/tests/test_scheduler.py +141 -0
- package/python/tests/test_search.py +204 -0
- package/python/tests/test_secrets.py +159 -0
- package/python/tests/test_semantic.py +78 -0
- package/python/tests/test_sessions.py +91 -0
- package/python/tests/test_settings.py +281 -0
- package/python/tests/test_shadow_learning.py +330 -0
- package/python/tests/test_shared_write.py +207 -0
- package/python/tests/test_skill_taint_gate.py +154 -0
- package/python/tests/test_skills.py +133 -0
- package/python/tests/test_stats_and_events.py +165 -0
- package/python/tests/test_streaming.py +60 -0
- package/python/tests/test_supervisor_pipeline.py +177 -0
- package/python/tests/test_supervisor_triage.py +108 -0
- package/python/tests/test_taint.py +117 -0
- package/python/tests/test_task_stream.py +85 -0
- package/python/tests/test_thinking_sse.py +67 -0
- package/python/tests/test_thinking_stream.py +76 -0
- package/python/tests/test_tool_center.py +129 -0
- package/python/tests/test_tool_parallel.py +113 -0
- package/python/tests/test_tool_params.py +103 -0
- package/python/tests/test_tool_use.py +242 -0
- package/python/tests/test_toplevel_concurrency.py +117 -0
- package/python/tests/test_tracing.py +290 -0
- package/python/tests/test_truth_crystallizer.py +127 -0
- package/python/tests/test_truth_flow.py +93 -0
- package/python/tests/test_url_policy.py +53 -0
- package/python/tests/test_verify_evidence.py +225 -0
- package/python/tests/test_version_sync.py +71 -0
- package/python/tests/test_web_trigger.py +99 -0
- package/python/tools/check_faiss_type.py +31 -0
- package/python/tools/check_log.ps1 +46 -0
- package/python/tools/ivf_status.py +72 -0
- package/python/tools/mypy_baseline.txt +5 -0
- package/python/tools/mypy_ratchet.py +97 -0
- package/python/tools/pack.py +178 -0
- package/python/tools/release_check.py +349 -0
- package/python/tools/restart_foxclaw.ps1 +74 -0
- package/python/tools/shared_write_audit.py +204 -0
- package/python/tools/size_baseline.txt +28 -0
- package/python/tools/size_check.py +102 -0
- package/python/tools/verify_env.bat +2 -0
- package/python/tools/verify_env.py +25 -0
- package/python/vendor/HMR_LICENSE +37 -0
- package/python/vendor/HMR_README.md +65 -0
- package/python/vendor/hkc/LICENSE +37 -0
- package/python/vendor/hkc/hkc_ace/__init__.py +0 -0
- package/python/vendor/hkc/hkc_ace/ace.py +457 -0
- package/python/vendor/hkc/hkc_ace/skill_taxonomy.json +465 -0
- package/python/vendor/hkc/hkc_api/__init__.py +0 -0
- package/python/vendor/hkc/hkc_api/container.py +416 -0
- package/python/vendor/hkc/hkc_api/ingest_jobs.py +103 -0
- package/python/vendor/hkc/hkc_api/main.py +157 -0
- package/python/vendor/hkc/hkc_api/routes/__init__.py +0 -0
- package/python/vendor/hkc/hkc_api/routes/ability.py +151 -0
- package/python/vendor/hkc/hkc_api/routes/config.py +51 -0
- package/python/vendor/hkc/hkc_api/routes/knowledge.py +630 -0
- package/python/vendor/hkc/hkc_api/routes/search.py +88 -0
- package/python/vendor/hkc/hkc_api/schemas.py +153 -0
- package/python/vendor/hkc/hkc_api/synthesis.py +179 -0
- package/python/vendor/hkc/hkc_core/__init__.py +0 -0
- package/python/vendor/hkc/hkc_core/graph/__init__.py +0 -0
- package/python/vendor/hkc/hkc_core/graph/base.py +188 -0
- package/python/vendor/hkc/hkc_core/graph/sqlite_store.py +789 -0
- package/python/vendor/hkc/hkc_core/models/__init__.py +0 -0
- package/python/vendor/hkc/hkc_core/models/enums.py +65 -0
- package/python/vendor/hkc/hkc_core/models/ku.py +307 -0
- package/python/vendor/hkc/hkc_core/utils/__init__.py +0 -0
- package/python/vendor/hkc/hkc_core/utils/id_gen.py +113 -0
- package/python/vendor/hkc/hkc_crystallizer/__init__.py +44 -0
- package/python/vendor/hkc/hkc_crystallizer/adapters.py +94 -0
- package/python/vendor/hkc/hkc_crystallizer/candidate.py +145 -0
- package/python/vendor/hkc/hkc_crystallizer/crystallizer.py +179 -0
- package/python/vendor/hkc/hkc_crystallizer/ingress.py +90 -0
- package/python/vendor/hkc/hkc_kde/__init__.py +0 -0
- package/python/vendor/hkc/hkc_kde/chunker.py +197 -0
- package/python/vendor/hkc/hkc_kde/extractor.py +623 -0
- package/python/vendor/hkc/hkc_kde/kde.py +298 -0
- package/python/vendor/hkc/hkc_kde/loaders/__init__.py +0 -0
- package/python/vendor/hkc/hkc_kde/loaders/ebook_loader.py +153 -0
- package/python/vendor/hkc/hkc_kde/loaders/office_loader.py +194 -0
- package/python/vendor/hkc/hkc_kde/loaders/pdf_loader.py +162 -0
- package/python/vendor/hkc/hkc_kde/loaders/text_loader.py +157 -0
- package/python/vendor/hkc/hkc_kde/loaders/web_loader.py +91 -0
- package/python/vendor/hkc/hkc_kde/models.py +74 -0
- package/python/vendor/hkc/hkc_kde/packager.py +329 -0
- package/python/vendor/hkc/hkc_kde/relation_disc.py +151 -0
- package/python/vendor/hkc/hkc_kee/__init__.py +0 -0
- package/python/vendor/hkc/hkc_kee/dedup.py +227 -0
- package/python/vendor/hkc/hkc_kee/fingerprint.py +106 -0
- package/python/vendor/hkc/hkc_kee/kee.py +541 -0
- package/python/vendor/hkc/hkc_kep/__init__.py +0 -0
- package/python/vendor/hkc/hkc_kep/event_bus.py +205 -0
- package/python/vendor/hkc/hkc_sdk/__init__.py +63 -0
- package/python/vendor/hkc/hkc_sdk/base.py +151 -0
- package/python/vendor/hkc/hkc_sdk/direct_client.py +153 -0
- package/python/vendor/hkc/hkc_sdk/exceptions.py +39 -0
- package/python/vendor/hkc/hkc_sdk/http_client.py +166 -0
- package/python/vendor/hkc/hkc_sdk/models.py +171 -0
- package/python/vendor/hkc/hkc_search/__init__.py +0 -0
- package/python/vendor/hkc/hkc_search/bm25.py +325 -0
- package/python/vendor/hkc/hkc_search/embedding_backends.py +374 -0
- package/python/vendor/hkc/hkc_search/graph_search.py +132 -0
- package/python/vendor/hkc/hkc_search/hybrid.py +331 -0
- package/python/vendor/hkc/hkc_search/index_build_manager.py +378 -0
- package/python/vendor/hkc/hkc_search/vector_search.py +484 -0
- package/python/vendor/hmr/__init__.py +0 -0
- package/python/vendor/hmr/core/__init__.py +0 -0
- package/python/vendor/hmr/core/hmr.py +684 -0
- package/python/vendor/hmr/core/models.py +310 -0
- package/python/vendor/hmr/engines/__init__.py +0 -0
- package/python/vendor/hmr/engines/evolution.py +710 -0
- package/python/vendor/hmr/engines/jit_compiler.py +472 -0
- package/python/vendor/hmr/engines/lifecycle.py +264 -0
- package/python/vendor/hmr/engines/policy.py +625 -0
- package/python/vendor/hmr/engines/recall.py +260 -0
- package/python/vendor/hmr/engines/runtime_state.py +158 -0
- package/python/vendor/hmr/engines/scheduler.py +323 -0
- package/python/vendor/hmr/engines/semantic.py +150 -0
- package/python/vendor/hmr/engines/temporal.py +261 -0
- package/python/vendor/hmr/engines/thought_chain.py +635 -0
- package/python/vendor/hmr/graph/__init__.py +0 -0
- package/python/vendor/hmr/graph/cwg.py +338 -0
- package/python/vendor/hmr/graph/memory_graph.py +530 -0
- package/python/vendor/hmr/storage/__init__.py +0 -0
- package/python/vendor/hmr/storage/memory_fs.py +300 -0
- package/python/vendor/hmr/storage/vector_store.py +520 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
|
3
|
+
import { attachFile, attachImage, chat, ingestFile, ingestFolder, say, setMode, ui } from '../stores/chat.js'
|
|
4
|
+
import { setModule } from '../stores/app.js'
|
|
5
|
+
|
|
6
|
+
const open = ref(false)
|
|
7
|
+
const root = ref(null)
|
|
8
|
+
const inFile = ref(null)
|
|
9
|
+
const inFolder = ref(null)
|
|
10
|
+
const inImg = ref(null)
|
|
11
|
+
const inAttach = ref(null)
|
|
12
|
+
|
|
13
|
+
const rows = computed(() => [
|
|
14
|
+
{
|
|
15
|
+
ic: chat.mode === 'stream' ? '⚡' : '🔧',
|
|
16
|
+
b: chat.mode === 'stream' ? '流式对话' : '编排任务',
|
|
17
|
+
s: '点击切换模式',
|
|
18
|
+
act: () => setMode(chat.mode === 'stream' ? 'orchestrate' : 'stream'),
|
|
19
|
+
},
|
|
20
|
+
{ ic: '📎', b: '上传文件', s: '摄入知识库', act: () => { close(); inFile.value?.click() } },
|
|
21
|
+
{ ic: '📁', b: '导入文件夹', s: '逐个摄入', act: () => { close(); inFolder.value?.click() } },
|
|
22
|
+
{ ic: '🖼', b: '附加图片', s: '发给视觉模型', act: () => { close(); inImg.value?.click() } },
|
|
23
|
+
{ ic: '📄', b: '附件文件', s: '随问题发给 AI', act: () => { close(); inAttach.value?.click() } },
|
|
24
|
+
/* 连接器只有一份实现,在技能面板里。这里不再内嵌一份只读副本(信任档位还是另一套词),
|
|
25
|
+
点进来直接去那个面板,要管 MCP 也只在一个地方管。 */
|
|
26
|
+
{ ic: '🔌', b: '技能 · 连接器', s: '到技能面板看全部', act: () => { close(); setModule('tools') } },
|
|
27
|
+
])
|
|
28
|
+
|
|
29
|
+
function toggle() {
|
|
30
|
+
open.value = !open.value
|
|
31
|
+
}
|
|
32
|
+
function close() {
|
|
33
|
+
open.value = false
|
|
34
|
+
}
|
|
35
|
+
/* 斜杠命令 /摄入 通过 store 信号打到这里,避免把 input 引用抬到全局 */
|
|
36
|
+
watch(() => ui.ingestTick, () => inFile.value?.click())
|
|
37
|
+
|
|
38
|
+
function onDocDown(e) {
|
|
39
|
+
if (root.value && !root.value.contains(e.target)) close()
|
|
40
|
+
}
|
|
41
|
+
onMounted(() => document.addEventListener('mousedown', onDocDown, true))
|
|
42
|
+
onBeforeUnmount(() => document.removeEventListener('mousedown', onDocDown, true))
|
|
43
|
+
|
|
44
|
+
async function onIngest(e) {
|
|
45
|
+
const f = e.target.files && e.target.files[0]
|
|
46
|
+
e.target.value = ''
|
|
47
|
+
if (f) await ingestFile(f)
|
|
48
|
+
}
|
|
49
|
+
async function onFolder(e) {
|
|
50
|
+
const fs = [...(e.target.files || [])]
|
|
51
|
+
e.target.value = ''
|
|
52
|
+
if (fs.length) await ingestFolder(fs)
|
|
53
|
+
}
|
|
54
|
+
function onImage(e) {
|
|
55
|
+
const fs = [...(e.target.files || [])]
|
|
56
|
+
e.target.value = ''
|
|
57
|
+
fs.forEach(attachImage)
|
|
58
|
+
if (fs.length) say(`已附加 ${fs.length} 张图片`)
|
|
59
|
+
}
|
|
60
|
+
async function onAttach(e) {
|
|
61
|
+
const fs = [...(e.target.files || [])]
|
|
62
|
+
e.target.value = ''
|
|
63
|
+
for (const f of fs) await attachFile(f)
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
<div ref="root" class="tm">
|
|
69
|
+
<button class="plus" :class="{ on: open }" title="工具:模式 / 上传 / 文件夹 / 图片 / 附件 / 连接器" @click="toggle">
|
|
70
|
+
+
|
|
71
|
+
</button>
|
|
72
|
+
|
|
73
|
+
<div v-if="open" class="pop">
|
|
74
|
+
<div class="sec">工具</div>
|
|
75
|
+
<button v-for="(r, i) in rows" :key="i" class="it" @click="r.act()">
|
|
76
|
+
<span class="ic">{{ r.ic }}</span>
|
|
77
|
+
<span class="tx"><b>{{ r.b }}</b><span>{{ r.s }}</span></span>
|
|
78
|
+
</button>
|
|
79
|
+
<div class="foot">
|
|
80
|
+
附件 {{ chat.attachments.length }} · 图片 {{ chat.images.length }} ·
|
|
81
|
+
{{ chat.mode === 'stream' ? '流式' : '编排' }}
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<input ref="inFile" type="file" hidden accept=".pdf,.md,.txt,.epub,.mobi,.azw3,.docx,.xlsx" @change="onIngest" />
|
|
86
|
+
<input ref="inFolder" type="file" hidden webkitdirectory directory multiple @change="onFolder" />
|
|
87
|
+
<input ref="inImg" type="file" hidden accept="image/*" multiple @change="onImage" />
|
|
88
|
+
<input ref="inAttach" type="file" hidden multiple @change="onAttach" />
|
|
89
|
+
</div>
|
|
90
|
+
</template>
|
|
91
|
+
|
|
92
|
+
<style scoped>
|
|
93
|
+
.tm { position: relative; flex-shrink: 0; }
|
|
94
|
+
|
|
95
|
+
.plus {
|
|
96
|
+
width: 28px; height: 28px; border-radius: 50%;
|
|
97
|
+
display: grid; place-items: center;
|
|
98
|
+
font-size: 15px; color: var(--dim);
|
|
99
|
+
background: var(--surface-2);
|
|
100
|
+
transition: color 0.15s, background 0.15s;
|
|
101
|
+
}
|
|
102
|
+
.plus:hover, .plus.on { color: var(--ink); background: var(--surface-3); }
|
|
103
|
+
|
|
104
|
+
.pop {
|
|
105
|
+
position: absolute; left: 0; bottom: calc(100% + 8px);
|
|
106
|
+
z-index: var(--z-menu);
|
|
107
|
+
width: 250px; max-height: 54vh;
|
|
108
|
+
display: flex; flex-direction: column;
|
|
109
|
+
padding: 6px;
|
|
110
|
+
border-radius: var(--r-mid);
|
|
111
|
+
background: rgba(255, 255, 255, 0.92);
|
|
112
|
+
-webkit-backdrop-filter: blur(24px) saturate(180%);
|
|
113
|
+
backdrop-filter: blur(24px) saturate(180%);
|
|
114
|
+
border: 1px solid rgba(255, 255, 255, 0.9);
|
|
115
|
+
box-shadow: var(--sh-pop);
|
|
116
|
+
overflow-y: auto;
|
|
117
|
+
animation: tm-in 0.15s ease;
|
|
118
|
+
}
|
|
119
|
+
@keyframes tm-in { from { opacity: 0; transform: translateY(5px); } }
|
|
120
|
+
|
|
121
|
+
.sec {
|
|
122
|
+
padding: 6px 7px 4px;
|
|
123
|
+
font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
|
|
124
|
+
color: var(--dim); text-transform: uppercase;
|
|
125
|
+
}
|
|
126
|
+
.it {
|
|
127
|
+
width: 100%;
|
|
128
|
+
display: flex; align-items: center; gap: 9px;
|
|
129
|
+
padding: 8px; border-radius: var(--r-sm);
|
|
130
|
+
text-align: left;
|
|
131
|
+
transition: background 0.13s;
|
|
132
|
+
}
|
|
133
|
+
.it:hover { background: var(--surface-2); }
|
|
134
|
+
.it .ic { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
|
|
135
|
+
.it .tx { display: flex; flex-direction: column; gap: 2px; }
|
|
136
|
+
.it .tx b { font-size: 13px; font-weight: 600; }
|
|
137
|
+
.it .tx span { font-size: 11px; color: var(--dim); }
|
|
138
|
+
|
|
139
|
+
.foot {
|
|
140
|
+
margin-top: 4px; padding: 7px 7px 3px;
|
|
141
|
+
border-top: 1px solid var(--line-soft);
|
|
142
|
+
font-size: 11px; color: var(--dim); font-family: var(--mono);
|
|
143
|
+
}
|
|
144
|
+
</style>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onMounted, ref } from 'vue'
|
|
3
|
+
import { getJSON } from '../api.js'
|
|
4
|
+
import { state, setModule } from '../stores/app.js'
|
|
5
|
+
|
|
6
|
+
const uplink = ref('···')
|
|
7
|
+
const tone = ref('dim')
|
|
8
|
+
|
|
9
|
+
onMounted(async () => {
|
|
10
|
+
try {
|
|
11
|
+
await getJSON('/status')
|
|
12
|
+
uplink.value = '在线'
|
|
13
|
+
tone.value = 'ok'
|
|
14
|
+
} catch {
|
|
15
|
+
uplink.value = '离线'
|
|
16
|
+
tone.value = 'bad'
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
function openPlanet() {
|
|
21
|
+
window.open('/planet/', '_blank', 'noopener')
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* 这个 ⚙ 一直是死按钮(title 写着「P3 接入」)。设置面板补齐后接上去。 */
|
|
25
|
+
function openSettings() {
|
|
26
|
+
setModule(state.module === 'settings' ? 'overview' : 'settings')
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<header class="topbar">
|
|
32
|
+
<div class="brand">
|
|
33
|
+
<div class="logo">F</div>
|
|
34
|
+
<h1>Foxclaw</h1>
|
|
35
|
+
<span class="ver">v3.0</span>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="spacer" />
|
|
38
|
+
<div class="stat">
|
|
39
|
+
<span class="lbl">系统状态</span>
|
|
40
|
+
<span class="val" :class="tone">{{ uplink }}</span>
|
|
41
|
+
</div>
|
|
42
|
+
<button class="tbtn" title="打开 HKC 知识星球" @click="openPlanet">🌐 知识星球</button>
|
|
43
|
+
<button
|
|
44
|
+
class="tbtn"
|
|
45
|
+
:class="{ on: state.module === 'settings' }"
|
|
46
|
+
title="设置 (Ctrl+,)"
|
|
47
|
+
@click="openSettings"
|
|
48
|
+
>⚙</button>
|
|
49
|
+
</header>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<style scoped>
|
|
53
|
+
.topbar {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 10px;
|
|
57
|
+
padding: 0 16px;
|
|
58
|
+
background: rgba(255, 255, 255, 0.5);
|
|
59
|
+
-webkit-backdrop-filter: blur(18px) saturate(160%);
|
|
60
|
+
backdrop-filter: blur(18px) saturate(160%);
|
|
61
|
+
border-bottom: 1px solid var(--line-soft);
|
|
62
|
+
}
|
|
63
|
+
.brand { display: flex; align-items: center; gap: 9px; }
|
|
64
|
+
.logo {
|
|
65
|
+
width: 28px; height: 28px; border-radius: 9px;
|
|
66
|
+
display: grid; place-items: center;
|
|
67
|
+
background: var(--green); color: #fff; font-weight: 800; font-size: 15px;
|
|
68
|
+
box-shadow: 0 4px 12px rgba(26, 157, 95, 0.32);
|
|
69
|
+
}
|
|
70
|
+
.brand h1 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
|
|
71
|
+
.ver {
|
|
72
|
+
font-size: 11px; font-weight: 600; color: var(--dim);
|
|
73
|
+
padding: 2px 7px; border-radius: var(--r-pill);
|
|
74
|
+
background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line);
|
|
75
|
+
}
|
|
76
|
+
.spacer { flex: 1; }
|
|
77
|
+
.stat { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--dim); }
|
|
78
|
+
.stat .val { font-weight: 700; color: var(--ink); }
|
|
79
|
+
.stat .val.ok { color: var(--green); }
|
|
80
|
+
.stat .val.bad { color: var(--amber); }
|
|
81
|
+
.stat .val.dim { color: var(--dim); }
|
|
82
|
+
.tbtn {
|
|
83
|
+
font-size: 12.5px; font-weight: 600; color: var(--ink);
|
|
84
|
+
padding: 6px 11px; border-radius: var(--r-sm);
|
|
85
|
+
border: 1px solid var(--line); background: rgba(255, 255, 255, 0.7);
|
|
86
|
+
transition: color 0.15s, background 0.15s;
|
|
87
|
+
}
|
|
88
|
+
.tbtn:hover { color: var(--ink); background: #fff; }
|
|
89
|
+
.tbtn.on { color: var(--green); background: #fff; border-color: rgba(26, 157, 95, 0.32); }
|
|
90
|
+
</style>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, onMounted } from 'vue'
|
|
3
|
+
import PanelBox from './PanelBox.vue'
|
|
4
|
+
import { panels, loadPanel, refreshPanel } from '../../stores/panels.js'
|
|
5
|
+
import { fmtAgo, fmtMs, clip } from '../../lib/fmt.js'
|
|
6
|
+
|
|
7
|
+
const p = panels.activity
|
|
8
|
+
onMounted(() => loadPanel('activity'))
|
|
9
|
+
|
|
10
|
+
const ready = computed(() => p.events.length > 0 || p.traces.length > 0 || !!p.thought)
|
|
11
|
+
const events = computed(() => p.events.slice(0, 14))
|
|
12
|
+
const slow = computed(() => p.traces.slice(0, 8))
|
|
13
|
+
|
|
14
|
+
function evText(e) {
|
|
15
|
+
const pl = e.payload || {}
|
|
16
|
+
return pl.task || pl.reason || pl.phase || pl.agent_id || e.topic || e.channel || '(空事件)'
|
|
17
|
+
}
|
|
18
|
+
function evSub(e) {
|
|
19
|
+
const src = e.source ? `来源 ${e.source}` : ''
|
|
20
|
+
return [e.channel, src].filter(Boolean).join(' · ')
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<PanelBox
|
|
26
|
+
title="活动"
|
|
27
|
+
tag="Activity"
|
|
28
|
+
:state="p.state"
|
|
29
|
+
:ready="ready"
|
|
30
|
+
@refresh="refreshPanel('activity')"
|
|
31
|
+
>
|
|
32
|
+
<div class="pn-kpi">
|
|
33
|
+
<div><b>{{ events.length }}</b><span>事件</span></div>
|
|
34
|
+
<div><b>{{ p.traces.length }}</b><span>请求链路</span></div>
|
|
35
|
+
<div><b>{{ p.thought?.total_nodes ?? 0 }}</b><span>思考节点</span></div>
|
|
36
|
+
<div><b>{{ p.thought ? Math.round((p.thought.avg_confidence ?? 0) * 100) + '%' : '—' }}</b><span>平均置信度</span></div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="pn-cols">
|
|
40
|
+
<div class="pn-sec">
|
|
41
|
+
<div class="pn-h">事件总线 <em>{{ p.events.length }}</em></div>
|
|
42
|
+
<div v-if="!events.length" class="pn-empty">
|
|
43
|
+
还没有事件。发一条消息、让 Agent 跑一步,执行 → 审计 → 记忆的流转会记在这里。
|
|
44
|
+
</div>
|
|
45
|
+
<div v-for="(e, i) in events" :key="i" class="pn-row static" :title="evText(e)">
|
|
46
|
+
<span class="m">
|
|
47
|
+
<b>{{ clip(evText(e), 40) }}</b>
|
|
48
|
+
<span class="s">{{ evSub(e) }}</span>
|
|
49
|
+
</span>
|
|
50
|
+
<span class="r">{{ fmtAgo(e.ts) }}</span>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div class="pn-sec">
|
|
55
|
+
<div class="pn-h">最慢请求链路 <em>{{ p.traces.length }}</em></div>
|
|
56
|
+
<div v-if="!slow.length" class="pn-empty">
|
|
57
|
+
还没有链路记录。任何一次 API 调用都会留下 trace。
|
|
58
|
+
</div>
|
|
59
|
+
<div v-for="(t, i) in slow" :key="t.trace_id || i" class="pn-row" :title="t.trace_id">
|
|
60
|
+
<span class="m">
|
|
61
|
+
<b>{{ clip(t.name, 34) }}</b>
|
|
62
|
+
<span class="s">{{ t.span_count || 0 }} span</span>
|
|
63
|
+
</span>
|
|
64
|
+
<span class="r">{{ fmtMs(t.duration_ms) }}</span>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="pn-sec">
|
|
70
|
+
<div class="pn-note">
|
|
71
|
+
思考链健康度:共 {{ p.thought?.total_nodes ?? 0 }} 个节点,阻塞 {{ p.thought?.blocked_nodes ?? 0 }} 个,
|
|
72
|
+
警告 {{ p.thought?.warned_nodes ?? 0 }} 个,阻塞率
|
|
73
|
+
{{ p.thought ? Math.round((p.thought.block_rate ?? 0) * 100) + '%' : '—' }}。
|
|
74
|
+
数据来自 <code>/api/bus/history</code>、<code>/api/traces</code>、<code>/api/thoughtchain/{agent}/summary</code>。
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</PanelBox>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<style scoped>
|
|
81
|
+
/* 事件行是只读快照,没有可点的动作 —— hover 高亮会让人以为点了能看详情。
|
|
82
|
+
之前这里是 <button> 但没绑事件,视觉上"能点"、实际不动。 */
|
|
83
|
+
.pn-row.static:hover { background: transparent; }
|
|
84
|
+
</style>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, onMounted, ref } from 'vue'
|
|
3
|
+
import PanelBox from './PanelBox.vue'
|
|
4
|
+
import { panels, loadPanel, refreshPanel } from '../../stores/panels.js'
|
|
5
|
+
|
|
6
|
+
const p = panels.agents
|
|
7
|
+
const open = ref('')
|
|
8
|
+
onMounted(() => loadPanel('agents'))
|
|
9
|
+
|
|
10
|
+
const ready = computed(() => p.list.length > 0)
|
|
11
|
+
const shadowCount = computed(() => p.list.filter((a) => a.harness?.shadow_mode).length)
|
|
12
|
+
const nodes = computed(() => p.list.reduce((n, a) => n + (a.thought_chain?.total_nodes || 0), 0))
|
|
13
|
+
const blocked = computed(() => p.list.reduce((n, a) => n + (a.thought_chain?.blocked_nodes || 0), 0))
|
|
14
|
+
|
|
15
|
+
function toggle(id) { open.value = open.value === id ? '' : id }
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<PanelBox
|
|
20
|
+
title="代理"
|
|
21
|
+
tag="Agents"
|
|
22
|
+
:state="p.state"
|
|
23
|
+
:ready="ready"
|
|
24
|
+
@refresh="refreshPanel('agents')"
|
|
25
|
+
>
|
|
26
|
+
<div class="pn-kpi">
|
|
27
|
+
<div><b>{{ p.list.length }}</b><span>代理</span></div>
|
|
28
|
+
<div><b>{{ shadowCount }}</b><span>影子模式</span></div>
|
|
29
|
+
<div><b>{{ nodes }}</b><span>思考节点</span></div>
|
|
30
|
+
<div><b>{{ blocked }}</b><span>被拦截</span></div>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="pn-sec">
|
|
34
|
+
<div class="pn-h">代理清单 <em>{{ p.list.length }}</em></div>
|
|
35
|
+
<div v-if="!p.list.length" class="pn-empty">后端没有返回任何 Agent。</div>
|
|
36
|
+
<div v-for="a in p.list" :key="a.agent_id" class="ag">
|
|
37
|
+
<div class="pn-row clickable" @click="toggle(a.agent_id)">
|
|
38
|
+
<span class="m">
|
|
39
|
+
<b>{{ a.agent_name }} <em class="id">{{ a.agent_id }}</em></b>
|
|
40
|
+
<span class="s">
|
|
41
|
+
{{ a.thought_chain?.total_nodes ?? 0 }} 节点 ·
|
|
42
|
+
置信度 {{ Math.round((a.thought_chain?.avg_confidence ?? 0) * 100) }}% ·
|
|
43
|
+
规则 {{ a.harness?.policy?.total_rules ?? 0 }} 条
|
|
44
|
+
</span>
|
|
45
|
+
</span>
|
|
46
|
+
<span class="pn-tag" :class="a.harness?.shadow_mode ? 'amber' : 'green'">
|
|
47
|
+
{{ a.harness?.shadow_mode ? '影子' : '在线' }}
|
|
48
|
+
</span>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div v-if="open === a.agent_id" class="det">
|
|
52
|
+
<div class="kv"><span>拦截阈值</span><b>
|
|
53
|
+
warn {{ a.harness?.thresholds?.warn ?? '—' }} / block {{ a.harness?.thresholds?.block ?? '—' }}
|
|
54
|
+
</b></div>
|
|
55
|
+
<div class="kv"><span>漂移检测</span><b>{{ a.harness?.thresholds?.embedding_mode || '—' }}</b></div>
|
|
56
|
+
<div class="kv"><span>语义维度</span><b>
|
|
57
|
+
{{ a.harness?.thresholds?.semantic_degraded ? '已降级(仅 tool/scope 两维)' : '正常' }}
|
|
58
|
+
</b></div>
|
|
59
|
+
<div class="kv"><span>阻塞 / 警告</span><b>
|
|
60
|
+
{{ a.thought_chain?.blocked_nodes ?? 0 }} / {{ a.thought_chain?.warned_nodes ?? 0 }}
|
|
61
|
+
</b></div>
|
|
62
|
+
<div class="kv"><span>影子轮次</span><b>
|
|
63
|
+
{{ a.harness?.thresholds?.run_count ?? 0 }} / {{ a.harness?.thresholds?.shadow_rounds ?? '—' }}
|
|
64
|
+
</b></div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="pn-note">
|
|
70
|
+
<template v-if="p.info">
|
|
71
|
+
版本 <code>{{ p.info.version }}</code> · 数据目录 <code>{{ p.info.data_dir }}</code>
|
|
72
|
+
</template>
|
|
73
|
+
数据来自 <code>/api/status</code> 与 <code>/api/system/info</code>。
|
|
74
|
+
</div>
|
|
75
|
+
</PanelBox>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<style scoped>
|
|
79
|
+
.id { font-family: var(--mono); font-size: 11px; font-style: normal; color: var(--dim); margin-left: 4px; }
|
|
80
|
+
.det {
|
|
81
|
+
margin: 2px 0 8px 10px; padding: 8px 12px;
|
|
82
|
+
border-left: 2px solid var(--line);
|
|
83
|
+
}
|
|
84
|
+
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 12px; color: var(--dim); }
|
|
85
|
+
.kv b { font-weight: 600; color: var(--ink); font-family: var(--mono); font-size: 11.5px; text-align: right; }
|
|
86
|
+
</style>
|