foxclaw 0.1.0 → 0.1.3
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 +4 -10
- package/package.json +46 -38
- package/python/.dockerignore +35 -0
- package/python/.env.example +173 -0
- package/python/.gitattributes +46 -0
- package/python/.github/workflows/ci.yml +167 -0
- package/python/.github/workflows/release.yml +183 -0
- package/python/CHANGELOG.md +57 -0
- package/python/CHANGELOG_CN.md +57 -0
- package/python/Dockerfile +64 -0
- package/python/LICENSE +21 -0
- package/python/MANIFEST.in +14 -0
- package/python/README.md +201 -0
- package/python/README_CN.md +336 -0
- package/python/bench/bm25_audit.py +186 -0
- package/python/bench/bm25_regression.py +177 -0
- package/python/bench/bm25_stress.py +155 -0
- package/python/bench/cd_audit.py +215 -0
- package/python/bench/chaos.py +140 -0
- package/python/bench/concurrency.py +103 -0
- package/python/bench/e2e_real_models.py +94 -0
- package/python/bench/llm_retry_test.py +241 -0
- package/python/bench/load_test.py +193 -0
- package/python/bench/vector_ivf_upgrade.py +128 -0
- package/python/docs/CHANNELS.md +195 -0
- package/python/docs/GOVERNANCE.md +164 -0
- package/python/docs/RELEASE.md +110 -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 +115 -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 +368 -0
- package/python/examples/governance_middleware_demo.py +72 -0
- package/python/examples/langgraph_governance_demo.py +104 -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 +408 -0
- package/python/foxclaw/agents/__init__.py +12 -0
- package/python/foxclaw/agents/agents.py +35 -0
- package/python/foxclaw/agents/base.py +794 -0
- package/python/foxclaw/agents/impl/__init__.py +1 -0
- package/python/foxclaw/agents/impl/_helpers.py +70 -0
- package/python/foxclaw/agents/impl/finance.py +231 -0
- package/python/foxclaw/agents/impl/office.py +350 -0
- package/python/foxclaw/agents/impl/supervisor.py +592 -0
- package/python/foxclaw/agents/mixins/_context.py +128 -0
- package/python/foxclaw/agents/mixins/augment.py +143 -0
- package/python/foxclaw/agents/mixins/llm.py +67 -0
- package/python/foxclaw/agents/mixins/memory.py +41 -0
- package/python/foxclaw/agents/mixins/preference.py +131 -0
- package/python/foxclaw/agents/mixins/prompt.py +71 -0
- package/python/foxclaw/agents/mixins/skillbox.py +58 -0
- package/python/foxclaw/agents/mixins/tool_exec.py +417 -0
- package/python/foxclaw/api/__init__.py +224 -0
- package/python/foxclaw/api/_state.py +43 -0
- package/python/foxclaw/api/bootstrap.py +96 -0
- package/python/foxclaw/api/middleware.py +294 -0
- package/python/foxclaw/api/routes/ahs.py +404 -0
- package/python/foxclaw/api/routes/attachments.py +116 -0
- package/python/foxclaw/api/routes/browser.py +35 -0
- package/python/foxclaw/api/routes/domain.py +306 -0
- package/python/foxclaw/api/routes/knowledge.py +145 -0
- package/python/foxclaw/api/routes/llm_admin.py +449 -0
- package/python/foxclaw/api/routes/memory.py +105 -0
- package/python/foxclaw/api/routes/orchestration.py +39 -0
- package/python/foxclaw/api/routes/recovery.py +44 -0
- package/python/foxclaw/api/routes/review.py +266 -0
- package/python/foxclaw/api/routes/search.py +33 -0
- package/python/foxclaw/api/routes/system.py +311 -0
- package/python/foxclaw/api/routes/task.py +263 -0
- package/python/foxclaw/api/routes/ws.py +64 -0
- package/python/foxclaw/api/spine.py +52 -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 +50 -0
- package/python/foxclaw/browser/action/action_types.py +44 -0
- package/python/foxclaw/browser/action/action_verifier.py +68 -0
- package/python/foxclaw/browser/action/url_policy.py +143 -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 +170 -0
- package/python/foxclaw/browser/perception/__init__.py +1 -0
- package/python/foxclaw/browser/perception/dom_extractor.py +42 -0
- package/python/foxclaw/browser/perception/element_indexer.py +56 -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 +144 -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 +65 -0
- package/python/foxclaw/channels/__init__.py +138 -0
- package/python/foxclaw/channels/discord.py +175 -0
- package/python/foxclaw/channels/dispatcher.py +179 -0
- package/python/foxclaw/channels/feishu.py +215 -0
- package/python/foxclaw/channels/openclaw_bridge.py +151 -0
- package/python/foxclaw/channels/signing.py +187 -0
- package/python/foxclaw/channels/telegram.py +120 -0
- package/python/foxclaw/channels/weixin.py +215 -0
- package/python/foxclaw/cli.py +183 -0
- package/python/foxclaw/cognitive/__init__.py +4 -0
- package/python/foxclaw/cognitive/reasoner.py +81 -0
- package/python/foxclaw/cognitive/state.py +141 -0
- package/python/foxclaw/core/__init__.py +9 -0
- package/python/foxclaw/core/audit_chain.py +131 -0
- package/python/foxclaw/core/audit_sink.py +100 -0
- package/python/foxclaw/core/compaction.py +265 -0
- package/python/foxclaw/core/config.py +65 -0
- package/python/foxclaw/core/confirm_nonce.py +151 -0
- package/python/foxclaw/core/dispatch.py +27 -0
- package/python/foxclaw/core/envfile.py +48 -0
- package/python/foxclaw/core/failure_policy.py +142 -0
- package/python/foxclaw/core/gateway.py +81 -0
- package/python/foxclaw/core/governance_audit.py +171 -0
- package/python/foxclaw/core/idempotency.py +282 -0
- package/python/foxclaw/core/injection_guard.py +202 -0
- package/python/foxclaw/core/memory_adapter.py +489 -0
- package/python/foxclaw/core/metrics.py +88 -0
- package/python/foxclaw/core/model_router.py +985 -0
- package/python/foxclaw/core/paths.py +103 -0
- package/python/foxclaw/core/recovery.py +349 -0
- package/python/foxclaw/core/scheduler.py +141 -0
- package/python/foxclaw/core/secrets.py +131 -0
- package/python/foxclaw/core/sessions.py +155 -0
- package/python/foxclaw/core/settings.py +414 -0
- package/python/foxclaw/core/shared_write.py +186 -0
- package/python/foxclaw/core/steering_queue.py +154 -0
- package/python/foxclaw/core/system_bus.py +84 -0
- package/python/foxclaw/core/thought_chain.py +316 -0
- package/python/foxclaw/core/token_meter.py +231 -0
- package/python/foxclaw/core/tools.py +164 -0
- package/python/foxclaw/core/tracing.py +375 -0
- package/python/foxclaw/core/truth_pipeline.py +110 -0
- package/python/foxclaw/core/update_check.py +149 -0
- package/python/foxclaw/core/vec_recall_adapter.py +477 -0
- package/python/foxclaw/core/verify.py +173 -0
- package/python/foxclaw/core/web_search.py +218 -0
- package/python/foxclaw/finance/__init__.py +15 -0
- package/python/foxclaw/finance/evidence.py +149 -0
- package/python/foxclaw/finance/fx.py +98 -0
- package/python/foxclaw/finance/graph.py +179 -0
- package/python/foxclaw/finance/models.py +146 -0
- package/python/foxclaw/finance/nlparse.py +515 -0
- package/python/foxclaw/finance/policy.py +301 -0
- package/python/foxclaw/finance/reasoner.py +121 -0
- package/python/foxclaw/finance/reasoning.py +319 -0
- package/python/foxclaw/finance/reconcile.py +175 -0
- package/python/foxclaw/finance/runtime.py +500 -0
- package/python/foxclaw/governance/__init__.py +24 -0
- package/python/foxclaw/governance/middleware.py +176 -0
- package/python/foxclaw/harness/__init__.py +17 -0
- package/python/foxclaw/harness/_base.py +66 -0
- package/python/foxclaw/harness/_policy.py +340 -0
- package/python/foxclaw/harness/drift.py +77 -0
- package/python/foxclaw/harness/event_bus.py +28 -0
- package/python/foxclaw/harness/harness.py +358 -0
- package/python/foxclaw/harness/loop_detection.py +145 -0
- package/python/foxclaw/itinerary/__init__.py +10 -0
- package/python/foxclaw/itinerary/amap_client.py +114 -0
- package/python/foxclaw/itinerary/models.py +80 -0
- package/python/foxclaw/itinerary/reasoner.py +96 -0
- package/python/foxclaw/itinerary/reasoning.py +168 -0
- package/python/foxclaw/itinerary/runtime.py +144 -0
- package/python/foxclaw/kernel/__init__.py +13 -0
- package/python/foxclaw/kernel/capabilities.py +72 -0
- package/python/foxclaw/kernel/policy_gate.py +108 -0
- package/python/foxclaw/kernel/process_manager.py +186 -0
- package/python/foxclaw/kernel/scheduler.py +125 -0
- package/python/foxclaw/kernel/sentinel.py +443 -0
- package/python/foxclaw/kernel/sentinel_client.py +243 -0
- package/python/foxclaw/kernel/spine.py +97 -0
- package/python/foxclaw/knowledge/__init__.py +360 -0
- package/python/foxclaw/knowledge/truth_crystallizer.py +89 -0
- package/python/foxclaw/learning/__init__.py +12 -0
- package/python/foxclaw/learning/knowledge_graph.py +144 -0
- package/python/foxclaw/learning/models.py +93 -0
- package/python/foxclaw/learning/reasoner.py +67 -0
- package/python/foxclaw/learning/runtime.py +351 -0
- package/python/foxclaw/learning/spaced_repetition.py +91 -0
- package/python/foxclaw/mcp_server.py +188 -0
- package/python/foxclaw/orchestration/__init__.py +167 -0
- package/python/foxclaw/pipeline/__init__.py +23 -0
- package/python/foxclaw/pipeline/cognitive_pipeline.py +429 -0
- package/python/foxclaw/pipeline/stage_meta.py +21 -0
- package/python/foxclaw/pipeline/supervisor_stages.py +201 -0
- package/python/foxclaw/planning/__init__.py +17 -0
- package/python/foxclaw/planning/llm_planner.py +232 -0
- package/python/foxclaw/planning/planner.py +94 -0
- package/python/foxclaw/search/__init__.py +24 -0
- package/python/foxclaw/search/agent_port.py +190 -0
- package/python/foxclaw/search/evidence.py +109 -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 +71 -0
- package/python/foxclaw/search/models.py +127 -0
- package/python/foxclaw/search/planner.py +44 -0
- package/python/foxclaw/search/retriever.py +39 -0
- package/python/foxclaw/search/runtime.py +127 -0
- package/python/foxclaw/search/strategy.py +44 -0
- package/python/foxclaw/skills/__init__.py +559 -0
- package/python/foxclaw/skills/archive.py +111 -0
- package/python/foxclaw/skills/fetch.py +226 -0
- package/python/foxclaw/skills/hooks_spec.py +69 -0
- package/python/foxclaw/skills/install_cmd.py +216 -0
- package/python/foxclaw/skills/lifecycle.py +252 -0
- package/python/foxclaw/skills/markdown_skill.py +175 -0
- package/python/foxclaw/skills/markdown_store.py +39 -0
- package/python/foxclaw/skills/mcp_client.py +184 -0
- package/python/foxclaw/skills/mcp_store.py +40 -0
- package/python/foxclaw/skills/permission.py +145 -0
- package/python/foxclaw/skills/pipeline.py +354 -0
- package/python/foxclaw/skills/policy.py +74 -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 +25 -0
- package/python/frontend/deck/chat_model_picker.js +483 -0
- package/python/frontend/deck/domain.js +276 -0
- package/python/frontend/deck/main.js +1806 -0
- package/python/frontend/deck/markdown.js +44 -0
- package/python/frontend/deck/settings.js +307 -0
- package/python/frontend/deck/state.js +5 -0
- package/python/frontend/deck/util.js +4 -0
- package/python/frontend/deck/visuals.js +190 -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 +1436 -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-CQSBdxk4.js +34 -0
- package/python/frontend/v3/assets/index-D5nIsjms.css +1 -0
- package/python/frontend/v3/index.html +15 -0
- package/python/frontend/widget_runtime.js +252 -0
- package/python/frontend/widgets.js +639 -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 +58 -0
- package/python/frontend_src/src/api.js +82 -0
- package/python/frontend_src/src/components/ChatDock.vue +365 -0
- package/python/frontend_src/src/components/ComposerMenu.vue +75 -0
- package/python/frontend_src/src/components/DocViewer.vue +162 -0
- package/python/frontend_src/src/components/Inspector.vue +235 -0
- package/python/frontend_src/src/components/LeftRail.vue +415 -0
- package/python/frontend_src/src/components/MenuPopover.vue +128 -0
- package/python/frontend_src/src/components/MessageStream.vue +389 -0
- package/python/frontend_src/src/components/ModelPicker.vue +350 -0
- package/python/frontend_src/src/components/QuickIngest.vue +112 -0
- package/python/frontend_src/src/components/Stage.vue +272 -0
- package/python/frontend_src/src/components/ToolMenu.vue +141 -0
- package/python/frontend_src/src/components/TopBar.vue +118 -0
- package/python/frontend_src/src/components/panels/ActivityPanel.vue +82 -0
- package/python/frontend_src/src/components/panels/AgentsPanel.vue +83 -0
- package/python/frontend_src/src/components/panels/KnowledgePanel.vue +425 -0
- package/python/frontend_src/src/components/panels/MemoryPanel.vue +117 -0
- package/python/frontend_src/src/components/panels/PanelBox.vue +50 -0
- package/python/frontend_src/src/components/panels/ReviewPanel.vue +292 -0
- package/python/frontend_src/src/components/panels/SettingsPanel.vue +358 -0
- package/python/frontend_src/src/components/panels/TasksPanel.vue +73 -0
- package/python/frontend_src/src/components/panels/ToolsPanel.vue +746 -0
- package/python/frontend_src/src/components/panels/UsagePanel.vue +105 -0
- package/python/frontend_src/src/lib/fmt.js +44 -0
- package/python/frontend_src/src/lib/i18n.js +53 -0
- package/python/frontend_src/src/lib/locales/en.js +173 -0
- package/python/frontend_src/src/lib/locales/zh.js +174 -0
- package/python/frontend_src/src/lib/md.js +190 -0
- package/python/frontend_src/src/main.js +9 -0
- package/python/frontend_src/src/stores/app.js +91 -0
- package/python/frontend_src/src/stores/chat.js +450 -0
- package/python/frontend_src/src/stores/model.js +96 -0
- package/python/frontend_src/src/stores/panels.js +289 -0
- package/python/frontend_src/src/stores/profile.js +31 -0
- package/python/frontend_src/src/stores/system.js +25 -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 +39 -0
- package/python/pyproject.toml +268 -0
- package/python/requirements.txt +311 -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 +54 -0
- package/python/tests/run_all.py +200 -0
- package/python/tests/test_agent_lifecycle.py +326 -0
- package/python/tests/test_ahs_p2.py +393 -0
- package/python/tests/test_anthropic_tools.py +192 -0
- package/python/tests/test_api.py +97 -0
- package/python/tests/test_api_auth.py +79 -0
- package/python/tests/test_api_host_guard.py +69 -0
- package/python/tests/test_attachments.py +151 -0
- package/python/tests/test_audit_chain.py +116 -0
- package/python/tests/test_audit_sink.py +130 -0
- package/python/tests/test_browser.py +149 -0
- package/python/tests/test_browser_request_guard.py +180 -0
- package/python/tests/test_capabilities.py +152 -0
- package/python/tests/test_channel_signing.py +185 -0
- package/python/tests/test_channel_trust.py +109 -0
- package/python/tests/test_channels.py +174 -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 +61 -0
- package/python/tests/test_confirm_nonce.py +186 -0
- package/python/tests/test_context_compaction_wiring.py +124 -0
- package/python/tests/test_dispatch.py +89 -0
- package/python/tests/test_domain_evals.py +334 -0
- package/python/tests/test_domain_import.py +72 -0
- package/python/tests/test_domain_reasoners.py +134 -0
- package/python/tests/test_e2e.py +161 -0
- package/python/tests/test_emb_cache.py +97 -0
- package/python/tests/test_embedding_singleton.py +87 -0
- package/python/tests/test_envfile.py +83 -0
- package/python/tests/test_evals_smoke.py +90 -0
- package/python/tests/test_event_spine.py +174 -0
- package/python/tests/test_evidence_semantic.py +88 -0
- package/python/tests/test_evidence_sse.py +94 -0
- package/python/tests/test_file_ingest.py +135 -0
- package/python/tests/test_finance.py +144 -0
- package/python/tests/test_finance_ledger.py +245 -0
- package/python/tests/test_finance_persist.py +174 -0
- package/python/tests/test_gateway.py +125 -0
- package/python/tests/test_governance.py +421 -0
- package/python/tests/test_governance_audit.py +324 -0
- package/python/tests/test_governance_middleware.py +137 -0
- package/python/tests/test_hkc.py +268 -0
- package/python/tests/test_hkc_index_build_manager.py +306 -0
- package/python/tests/test_hkc_manifest_reuse.py +294 -0
- package/python/tests/test_hkc_search_event_sync.py +482 -0
- package/python/tests/test_import_path_guard.py +155 -0
- package/python/tests/test_injection_guard.py +193 -0
- package/python/tests/test_integration.py +117 -0
- package/python/tests/test_itinerary.py +100 -0
- package/python/tests/test_kee_semantic.py +84 -0
- package/python/tests/test_kernel.py +212 -0
- package/python/tests/test_learning.py +101 -0
- package/python/tests/test_llm_admin.py +145 -0
- package/python/tests/test_llm_planner.py +344 -0
- package/python/tests/test_markdown_skills.py +62 -0
- package/python/tests/test_markdown_skills_openclaw.py +66 -0
- package/python/tests/test_mcp_connectors.py +97 -0
- package/python/tests/test_mcp_guardian_discovery.py +87 -0
- package/python/tests/test_mcp_no_memory.py +43 -0
- package/python/tests/test_mcp_policy_gate.py +76 -0
- package/python/tests/test_mcp_server.py +92 -0
- package/python/tests/test_memory_recall.py +92 -0
- package/python/tests/test_metrics.py +58 -0
- package/python/tests/test_multi_chain.py +90 -0
- package/python/tests/test_multimodal.py +122 -0
- package/python/tests/test_negotiation.py +136 -0
- package/python/tests/test_orchestration.py +109 -0
- package/python/tests/test_orchestration_decoupled.py +103 -0
- package/python/tests/test_p3_p5_hardening.py +324 -0
- package/python/tests/test_parallel_dispatch.py +207 -0
- package/python/tests/test_pipeline.py +492 -0
- package/python/tests/test_plan_visible.py +86 -0
- package/python/tests/test_planner.py +88 -0
- package/python/tests/test_policy_gate.py +108 -0
- package/python/tests/test_profile.py +67 -0
- package/python/tests/test_readme_claims.py +163 -0
- package/python/tests/test_reasoner.py +170 -0
- package/python/tests/test_release_check.py +252 -0
- package/python/tests/test_resume_checkpoint.py +148 -0
- package/python/tests/test_routing.py +85 -0
- package/python/tests/test_scheduler.py +138 -0
- package/python/tests/test_search.py +194 -0
- package/python/tests/test_secrets.py +153 -0
- package/python/tests/test_semantic.py +69 -0
- package/python/tests/test_sessions.py +90 -0
- package/python/tests/test_settings.py +265 -0
- package/python/tests/test_shadow_learning.py +290 -0
- package/python/tests/test_shared_write.py +200 -0
- package/python/tests/test_skill_taint_gate.py +145 -0
- package/python/tests/test_skills.py +117 -0
- package/python/tests/test_skills_fetch.py +282 -0
- package/python/tests/test_stats_and_events.py +162 -0
- package/python/tests/test_streaming.py +55 -0
- package/python/tests/test_supervisor_pipeline.py +176 -0
- package/python/tests/test_supervisor_triage.py +102 -0
- package/python/tests/test_taint.py +112 -0
- package/python/tests/test_task_stream.py +74 -0
- package/python/tests/test_thinking_sse.py +66 -0
- package/python/tests/test_thinking_stream.py +76 -0
- package/python/tests/test_tool_center.py +113 -0
- package/python/tests/test_tool_parallel.py +113 -0
- package/python/tests/test_tool_params.py +99 -0
- package/python/tests/test_tool_use.py +229 -0
- package/python/tests/test_toplevel_concurrency.py +116 -0
- package/python/tests/test_tracing.py +256 -0
- package/python/tests/test_truth_crystallizer.py +125 -0
- package/python/tests/test_truth_flow.py +88 -0
- package/python/tests/test_update_check.py +95 -0
- package/python/tests/test_url_policy.py +53 -0
- package/python/tests/test_verify_evidence.py +212 -0
- package/python/tests/test_version_sync.py +100 -0
- package/python/tests/test_web_trigger.py +82 -0
- package/python/tools/check_faiss_type.py +30 -0
- package/python/tools/check_log.ps1 +38 -0
- package/python/tools/ivf_status.py +72 -0
- package/python/tools/mypy_baseline.txt +13 -0
- package/python/tools/mypy_ratchet.py +143 -0
- package/python/tools/pack.py +173 -0
- package/python/tools/release_check.py +349 -0
- package/python/tools/restart_foxclaw.ps1 +71 -0
- package/python/tools/shared_write_audit.py +190 -0
- package/python/tools/size_baseline.txt +28 -0
- package/python/tools/size_check.py +102 -0
- package/python/tools/strip_comments.py +228 -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,289 @@
|
|
|
1
|
+
import { reactive } from 'vue'
|
|
2
|
+
import { getJSON, getRaw, delJSON, patchJSON, postJSON } from '../api.js'
|
|
3
|
+
import { openDoc } from './app.js'
|
|
4
|
+
|
|
5
|
+
const safe = (p) => p.then((v) => v, () => null)
|
|
6
|
+
|
|
7
|
+
export const panels = reactive({
|
|
8
|
+
activity: { state: 'idle', events: [], traces: [], thought: null },
|
|
9
|
+
tasks: { state: 'idle', sched: {}, processes: [], procStats: {} },
|
|
10
|
+
agents: { state: 'idle', list: [], info: null },
|
|
11
|
+
tools: { state: 'idle', skills: [], md: [], breakers: {} },
|
|
12
|
+
usage: { state: 'idle', tokens: null, gateway: {}, metrics: null, slow: [] },
|
|
13
|
+
knowledge: {
|
|
14
|
+
state: 'idle', stats: {}, index: {}, sources: [], abilities: [],
|
|
15
|
+
recent: [], recentTotal: 0,
|
|
16
|
+
ingest: 'idle', ingestMsg: '', ingestErr: '',
|
|
17
|
+
},
|
|
18
|
+
memory: { state: 'idle', stats: {}, recent: [], prefs: [] },
|
|
19
|
+
review: {
|
|
20
|
+
state: 'idle',
|
|
21
|
+
stats: { cards: 0, learned: 0, fresh: 0, due: 0, avg_mastery: 0, load7: {}, risk: [] },
|
|
22
|
+
queue: [],
|
|
23
|
+
index: 0,
|
|
24
|
+
revealed: false,
|
|
25
|
+
session: 'idle',
|
|
26
|
+
lastMsg: '',
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const LOADERS = {
|
|
31
|
+
async activity(p) {
|
|
32
|
+
const [bus, traces, thought] = await Promise.all([
|
|
33
|
+
safe(getJSON('/bus/history?limit=40')),
|
|
34
|
+
safe(getJSON('/traces?limit=25')),
|
|
35
|
+
safe(getJSON('/thoughtchain/supervisor/summary')),
|
|
36
|
+
])
|
|
37
|
+
p.events = bus?.events || []
|
|
38
|
+
p.traces = (traces?.traces || []).slice().sort((a, b) => (b.duration_ms || 0) - (a.duration_ms || 0))
|
|
39
|
+
p.thought = thought
|
|
40
|
+
return !!(bus || traces || thought)
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
async tasks(p) {
|
|
44
|
+
const [sched, proc] = await Promise.all([
|
|
45
|
+
safe(getJSON('/scheduler/stats')),
|
|
46
|
+
safe(getJSON('/processes?limit=30')),
|
|
47
|
+
])
|
|
48
|
+
p.sched = sched || {}
|
|
49
|
+
p.processes = proc?.processes || []
|
|
50
|
+
p.procStats = proc?.stats || {}
|
|
51
|
+
return !!(sched || proc)
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
async agents(p) {
|
|
55
|
+
const [all, info] = await Promise.all([
|
|
56
|
+
safe(getJSON('/status')),
|
|
57
|
+
safe(getJSON('/system/info')),
|
|
58
|
+
])
|
|
59
|
+
p.list = all ? Object.values(all) : []
|
|
60
|
+
p.info = info
|
|
61
|
+
return !!(all || info)
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
async tools(p) {
|
|
65
|
+
const [sk, md, br] = await Promise.all([
|
|
66
|
+
safe(getJSON('/ahs/skills')),
|
|
67
|
+
safe(getJSON('/ahs/md-skills')),
|
|
68
|
+
safe(getJSON('/ahs/breaker')),
|
|
69
|
+
])
|
|
70
|
+
p.skills = sk?.skills || []
|
|
71
|
+
p.md = md?.skills || []
|
|
72
|
+
p.breakers = br?.breakers || {}
|
|
73
|
+
return !!(sk || md || br)
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
async usage(p) {
|
|
77
|
+
const [tk, gw, mt] = await Promise.all([
|
|
78
|
+
safe(getJSON('/tokens')),
|
|
79
|
+
safe(getJSON('/gateway/stats')),
|
|
80
|
+
safe(getJSON('/metrics')),
|
|
81
|
+
])
|
|
82
|
+
p.tokens = tk && !tk.error ? tk : null
|
|
83
|
+
p.gateway = gw || {}
|
|
84
|
+
p.metrics = mt
|
|
85
|
+
p.slow = Object.entries(mt?.endpoints || {})
|
|
86
|
+
.map(([name, v]) => ({ name, ...v }))
|
|
87
|
+
.sort((a, b) => (b.p95_ms || 0) - (a.p95_ms || 0))
|
|
88
|
+
.slice(0, 6)
|
|
89
|
+
return !!(tk || gw || mt)
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
async knowledge(p) {
|
|
93
|
+
const [st, src, ab, rc] = await Promise.all([
|
|
94
|
+
safe(getRaw('/stats')),
|
|
95
|
+
safe(getRaw('/knowledge/sources')),
|
|
96
|
+
safe(getJSON('/knowledge/abilities')),
|
|
97
|
+
safe(getJSON('/knowledge/recent?limit=50')),
|
|
98
|
+
])
|
|
99
|
+
p.stats = st || {}
|
|
100
|
+
p.index = st?.index_build || {}
|
|
101
|
+
p.sources = src?.sources || []
|
|
102
|
+
p.abilities = ab?.abilities || []
|
|
103
|
+
p.recent = rc?.kus || []
|
|
104
|
+
p.recentTotal = rc?.total ?? p.recent.length
|
|
105
|
+
return !!(st || src || ab || rc)
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
async review(p) {
|
|
109
|
+
const [st, q] = await Promise.all([
|
|
110
|
+
safe(getJSON('/review/stats')),
|
|
111
|
+
safe(getJSON('/review/queue?limit=20&fresh_limit=10')),
|
|
112
|
+
])
|
|
113
|
+
if (st) p.stats = { ...p.stats, ...st }
|
|
114
|
+
if (q?.cards && p.session !== 'running') {
|
|
115
|
+
p.queue = q.cards
|
|
116
|
+
p.index = 0
|
|
117
|
+
p.revealed = false
|
|
118
|
+
if (p.session === 'done') p.session = 'idle'
|
|
119
|
+
}
|
|
120
|
+
return !!(st || q)
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
async memory(p) {
|
|
124
|
+
const [st, rc, pf] = await Promise.all([
|
|
125
|
+
safe(getJSON('/memory/stats')),
|
|
126
|
+
safe(getJSON('/memory/recent?limit=12')),
|
|
127
|
+
safe(getJSON('/preferences')),
|
|
128
|
+
])
|
|
129
|
+
p.stats = st || {}
|
|
130
|
+
p.recent = rc?.memories || []
|
|
131
|
+
p.prefs = pf?.preferences || []
|
|
132
|
+
return !!(st || rc || pf)
|
|
133
|
+
},
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export async function loadPanel(id, force = false) {
|
|
137
|
+
const p = panels[id]
|
|
138
|
+
if (!p || !LOADERS[id]) return
|
|
139
|
+
if (!force && p.state !== 'idle' && p.state !== 'error') return
|
|
140
|
+
p.state = 'loading'
|
|
141
|
+
let ok = false
|
|
142
|
+
try { ok = await LOADERS[id](p) } catch { ok = false }
|
|
143
|
+
p.state = ok ? 'ok' : 'error'
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export const refreshPanel = (id) => loadPanel(id, true)
|
|
147
|
+
|
|
148
|
+
export async function toggleMdSkill(id, enabled) {
|
|
149
|
+
await patchJSON(`/ahs/md-skills/${encodeURIComponent(id)}`, { enabled })
|
|
150
|
+
await refreshPanel('tools')
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export async function ingestKnowledge({ text, title = '', domain = '' }) {
|
|
154
|
+
const p = panels.knowledge
|
|
155
|
+
const body = (text || '').trim()
|
|
156
|
+
if (!body) throw new Error('先写点内容再收录')
|
|
157
|
+
|
|
158
|
+
p.ingest = 'busy'
|
|
159
|
+
p.ingestMsg = ''
|
|
160
|
+
p.ingestErr = ''
|
|
161
|
+
try {
|
|
162
|
+
const d = await postJSON('/knowledge/ingest', {
|
|
163
|
+
text: body,
|
|
164
|
+
source_title: (title || '').trim(),
|
|
165
|
+
domain: (domain || '').trim(),
|
|
166
|
+
})
|
|
167
|
+
const counts = Object.entries(d?.counts || {})
|
|
168
|
+
.map(([k, v]) => `${k} ${v}`)
|
|
169
|
+
.join(' · ')
|
|
170
|
+
p.ingest = 'ok'
|
|
171
|
+
const n = d?.ku_count ?? 0
|
|
172
|
+
p.ingestMsg = n
|
|
173
|
+
? `已抽取 ${n} 条知识单元${counts ? ` · ${counts}` : ''}`
|
|
174
|
+
: '模型没从这段文字里抽出知识条目 —— 试试写得更具体(谁 / 是什么 / 为什么)'
|
|
175
|
+
try { await LOADERS.knowledge(p); p.state = 'ok' } catch {}
|
|
176
|
+
return d
|
|
177
|
+
} catch (e) {
|
|
178
|
+
p.ingest = 'error'
|
|
179
|
+
p.ingestErr = String(e?.message || e)
|
|
180
|
+
throw e
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export async function startReview() {
|
|
185
|
+
const p = panels.review
|
|
186
|
+
if (!p.queue.length) await loadPanel('review', true)
|
|
187
|
+
if (!p.queue.length) return
|
|
188
|
+
p.session = 'running'
|
|
189
|
+
p.index = 0
|
|
190
|
+
p.revealed = false
|
|
191
|
+
p.lastMsg = ''
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function revealCard() {
|
|
195
|
+
panels.review.revealed = true
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export async function gradeCard(grade) {
|
|
199
|
+
const p = panels.review
|
|
200
|
+
const card = p.queue[p.index]
|
|
201
|
+
if (!card) return null
|
|
202
|
+
const d = await postJSON('/review/grade', { ku_id: card.ku_id, grade })
|
|
203
|
+
const nd = d?.next_in_days ?? 1
|
|
204
|
+
p.lastMsg = `${card.name} → ${nd > 1 ? `${nd} 天后` : '明天'}再复习`
|
|
205
|
+
p.index += 1
|
|
206
|
+
p.revealed = false
|
|
207
|
+
if (p.index >= p.queue.length) p.session = 'done'
|
|
208
|
+
const st = await getJSON('/review/stats').catch(() => null)
|
|
209
|
+
if (st) p.stats = { ...p.stats, ...st }
|
|
210
|
+
return d
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export async function dropPreference(id) {
|
|
214
|
+
await delJSON(`/preferences/${encodeURIComponent(id)}`)
|
|
215
|
+
await refreshPanel('memory')
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export async function openMdSkill(id) {
|
|
219
|
+
const d = await getJSON(`/ahs/md-skills/${encodeURIComponent(id)}`)
|
|
220
|
+
openDoc({
|
|
221
|
+
id: `skill:${d.id}`,
|
|
222
|
+
kind: 'text',
|
|
223
|
+
lang: 'markdown',
|
|
224
|
+
title: d.name || d.id,
|
|
225
|
+
path: `skills/${d.id}/SKILL.md`,
|
|
226
|
+
meta: `指令技能 · v${d.version || '—'} · trust ${d.trust || '—'}`,
|
|
227
|
+
content: d.body || d.description || '(正文为空)',
|
|
228
|
+
})
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const KU_FIELDS = [
|
|
232
|
+
['statement', '陈述'],
|
|
233
|
+
['definition', '定义'],
|
|
234
|
+
['summary', '摘要'],
|
|
235
|
+
['description', '描述'],
|
|
236
|
+
['aliases', '别名'],
|
|
237
|
+
['verifiable', '可验证'],
|
|
238
|
+
['source', '来源'],
|
|
239
|
+
['source_type', '来源类型'],
|
|
240
|
+
['author', '作者'],
|
|
241
|
+
['year', '年份'],
|
|
242
|
+
['page', '页码'],
|
|
243
|
+
['quote', '原文引用'],
|
|
244
|
+
['supports', '支持'],
|
|
245
|
+
['contradicts', '矛盾'],
|
|
246
|
+
]
|
|
247
|
+
|
|
248
|
+
const kuVal = (v) => {
|
|
249
|
+
if (Array.isArray(v)) return v.length ? v.join('、') : ''
|
|
250
|
+
if (typeof v === 'boolean') return v ? '是' : '否'
|
|
251
|
+
return v === 0 || v === '' || v == null ? '' : String(v)
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export async function openKu(id) {
|
|
255
|
+
const d = await getRaw(`/knowledge/ku/${encodeURIComponent(id)}`)
|
|
256
|
+
const extra = d.extra || {}
|
|
257
|
+
|
|
258
|
+
const rows = KU_FIELDS
|
|
259
|
+
.map(([k, label]) => [label, kuVal(extra[k])])
|
|
260
|
+
.filter(([, v]) => v)
|
|
261
|
+
const body = rows.filter(([, v]) => v !== d.summary && v !== d.name)
|
|
262
|
+
|
|
263
|
+
const parts = []
|
|
264
|
+
if (body.length) parts.push(body.map(([k, v]) => `- **${k}**: ${v}`).join('\n'))
|
|
265
|
+
if (extra.source_text) parts.push(`### 出处原文\n\n${extra.source_text}`)
|
|
266
|
+
|
|
267
|
+
openDoc({
|
|
268
|
+
id: `ku:${d.ku_id}`,
|
|
269
|
+
kind: 'text',
|
|
270
|
+
lang: 'markdown',
|
|
271
|
+
title: d.name || d.ku_id,
|
|
272
|
+
path: `knowledge/${d.ku_type}/${d.ku_id}`,
|
|
273
|
+
meta: `${d.ku_type} · ${d.domain || '未分域'} · 置信度 ${Math.round((d.confidence || 0) * 100)}%`,
|
|
274
|
+
content: parts.join('\n\n') || '这条知识单元没有附带正文,只有一个名称。',
|
|
275
|
+
})
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export async function openTokenReport() {
|
|
279
|
+
const d = await getJSON('/tokens/report')
|
|
280
|
+
openDoc({
|
|
281
|
+
id: 'token-report',
|
|
282
|
+
kind: 'code',
|
|
283
|
+
lang: 'text',
|
|
284
|
+
title: 'token-report',
|
|
285
|
+
path: 'foxclaw/api/routes/system.py',
|
|
286
|
+
meta: 'Token 消耗报告 · 实时生成',
|
|
287
|
+
content: d.report || '(暂无报告)',
|
|
288
|
+
})
|
|
289
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { reactive } from 'vue'
|
|
2
|
+
import { getJSON, putJSON } from '../api.js'
|
|
3
|
+
|
|
4
|
+
export const profile = reactive({
|
|
5
|
+
nickname: '',
|
|
6
|
+
loaded: false,
|
|
7
|
+
saving: false,
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export async function loadProfile(force = false) {
|
|
11
|
+
if (profile.loaded && !force) return profile
|
|
12
|
+
try {
|
|
13
|
+
const d = await getJSON('/profile')
|
|
14
|
+
profile.nickname = d.nickname || ''
|
|
15
|
+
profile.loaded = true
|
|
16
|
+
} catch {
|
|
17
|
+
}
|
|
18
|
+
return profile
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function saveNickname(nick) {
|
|
22
|
+
profile.saving = true
|
|
23
|
+
try {
|
|
24
|
+
const d = await putJSON('/profile', { nickname: nick || '' })
|
|
25
|
+
profile.nickname = d.nickname || ''
|
|
26
|
+
profile.loaded = true
|
|
27
|
+
return profile.nickname
|
|
28
|
+
} finally {
|
|
29
|
+
profile.saving = false
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { reactive } from 'vue'
|
|
2
|
+
import { getJSON } from '../api.js'
|
|
3
|
+
|
|
4
|
+
export const system = reactive({
|
|
5
|
+
version: '',
|
|
6
|
+
update: null, // { enabled, current, latest, update_available, checked_at, error }
|
|
7
|
+
loaded: false,
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
let inflight = null
|
|
11
|
+
|
|
12
|
+
export function loadSystemInfo(force = false) {
|
|
13
|
+
if (system.loaded && !force) return Promise.resolve(system)
|
|
14
|
+
if (inflight) return inflight
|
|
15
|
+
inflight = getJSON('/system/info')
|
|
16
|
+
.then((d) => {
|
|
17
|
+
system.version = d.version || ''
|
|
18
|
+
system.update = d.update || null
|
|
19
|
+
system.loaded = true
|
|
20
|
+
return system
|
|
21
|
+
})
|
|
22
|
+
.catch(() => system) // 拿不到就维持旧值:顶栏不显示版本,不显示更新
|
|
23
|
+
.finally(() => { inflight = null })
|
|
24
|
+
return inflight
|
|
25
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
2
|
+
html, body, #app { height: 100%; }
|
|
3
|
+
body {
|
|
4
|
+
font-family: var(--font);
|
|
5
|
+
color: var(--ink);
|
|
6
|
+
background: var(--g-right);
|
|
7
|
+
-webkit-font-smoothing: antialiased;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
}
|
|
10
|
+
button { font-family: inherit; border: 0; background: none; color: inherit; cursor: pointer; }
|
|
11
|
+
input, textarea { font-family: inherit; border: 0; background: none; color: inherit; outline: none; }
|
|
12
|
+
em { font-style: normal; }
|
|
13
|
+
|
|
14
|
+
.app { height: 100vh; display: grid; grid-template-rows: 56px 1fr; min-height: 0; }
|
|
15
|
+
|
|
16
|
+
/* ═══ 三栏:一条色带 + 三片玻璃膜 ═══ */
|
|
17
|
+
.workspace {
|
|
18
|
+
--rail-w: 344px;
|
|
19
|
+
display: grid;
|
|
20
|
+
grid-template-columns: 296px minmax(0, 1fr) var(--rail-w);
|
|
21
|
+
gap: var(--gap);
|
|
22
|
+
padding: var(--pad);
|
|
23
|
+
min-height: 0;
|
|
24
|
+
background: var(--band);
|
|
25
|
+
transition: grid-template-columns 0.24s ease;
|
|
26
|
+
}
|
|
27
|
+
.workspace.is-collapsed { --rail-w: 0px; }
|
|
28
|
+
|
|
29
|
+
.col {
|
|
30
|
+
position: relative;
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
min-height: 0;
|
|
34
|
+
min-width: 0;
|
|
35
|
+
border-radius: var(--r-card);
|
|
36
|
+
border: 1px solid rgba(255, 255, 255, 0.55);
|
|
37
|
+
background: var(--veil-left);
|
|
38
|
+
-webkit-backdrop-filter: blur(16px) saturate(150%);
|
|
39
|
+
backdrop-filter: blur(16px) saturate(150%);
|
|
40
|
+
box-shadow: var(--sh-card);
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
}
|
|
43
|
+
.col--mid { background: var(--veil-mid); }
|
|
44
|
+
.col--right {
|
|
45
|
+
/* 右栏是纸的那一块,和中间的淡绿形成对比 */
|
|
46
|
+
background: var(--right-panel);
|
|
47
|
+
/* 暖纸面上换一套墨色:同一条 --ink/--dim/--faint 变量,右栏内部所有组件
|
|
48
|
+
(Inspector / QuickIngest / 文档大纲)自动跟着变,不用逐个改色值。 */
|
|
49
|
+
--ink: var(--w-ink);
|
|
50
|
+
--dim: var(--w-dim);
|
|
51
|
+
--faint: var(--w-faint);
|
|
52
|
+
--line: var(--w-line);
|
|
53
|
+
--line-soft: var(--w-line-soft);
|
|
54
|
+
--surface-2: var(--w-surface-2);
|
|
55
|
+
--surface-3: var(--w-surface-3);
|
|
56
|
+
transition: opacity 0.18s ease;
|
|
57
|
+
}
|
|
58
|
+
/* 滚动条也换暖灰,否则绿灰的滑块压在纸面上像贴错了一张 */
|
|
59
|
+
.col--right .scroll::-webkit-scrollbar-thumb { background: rgba(64, 50, 32, 0.16); }
|
|
60
|
+
.workspace.is-collapsed .col--right { opacity: 0; pointer-events: none; }
|
|
61
|
+
|
|
62
|
+
/* 中间栏:上方舞台 + 底部指令条
|
|
63
|
+
columns 必须显式 minmax(0,1fr):grid 默认列宽是 auto,子项的 min-content(面板里
|
|
64
|
+
不换行的行内标签/按钮)会把列撑到比栏还宽 —— 420px 窗口实测栏 128px、内容 372px,
|
|
65
|
+
右侧整块被视口裁掉(技能行的「测试」「删除」根本点不到)。 */
|
|
66
|
+
.mid {
|
|
67
|
+
display: grid;
|
|
68
|
+
grid-template-columns: minmax(0, 1fr);
|
|
69
|
+
grid-template-rows: minmax(0, 1fr) auto;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* 滚动区 */
|
|
73
|
+
.scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
|
|
74
|
+
.scroll::-webkit-scrollbar { width: 8px; height: 8px; }
|
|
75
|
+
.scroll::-webkit-scrollbar-thumb { background: rgba(23, 32, 26, 0.14); border-radius: 99px; }
|
|
76
|
+
.scroll::-webkit-scrollbar-track { background: transparent; }
|
|
77
|
+
|
|
78
|
+
.empty {
|
|
79
|
+
padding: 28px 12px;
|
|
80
|
+
text-align: center;
|
|
81
|
+
font-size: 12.5px;
|
|
82
|
+
color: var(--faint);
|
|
83
|
+
line-height: 1.7;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
|
|
87
|
+
|
|
88
|
+
/* 右栏收合后的拉手 */
|
|
89
|
+
.rail-handle {
|
|
90
|
+
position: fixed;
|
|
91
|
+
right: 0;
|
|
92
|
+
top: 50%;
|
|
93
|
+
transform: translateY(-50%);
|
|
94
|
+
z-index: var(--z-menu);
|
|
95
|
+
padding: 16px 6px;
|
|
96
|
+
font-size: 11px;
|
|
97
|
+
letter-spacing: 0.04em;
|
|
98
|
+
color: var(--dim);
|
|
99
|
+
background: rgba(255, 255, 255, 0.86);
|
|
100
|
+
border: 1px solid var(--line);
|
|
101
|
+
border-right: 0;
|
|
102
|
+
border-radius: 12px 0 0 12px;
|
|
103
|
+
box-shadow: var(--sh-card);
|
|
104
|
+
writing-mode: vertical-rl;
|
|
105
|
+
}
|
|
106
|
+
.rail-handle:hover { color: var(--ink); }
|
|
107
|
+
|
|
108
|
+
@media (prefers-reduced-motion: reduce) {
|
|
109
|
+
.workspace, .col--right { transition: none; }
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* 窄窗(<1180):右栏从「第三列」改成覆盖式抽屉。
|
|
113
|
+
三栏时中栏被压到 252px(900px 窗口实测),扣掉 + 与模型胶囊,textarea 只剩 115px,
|
|
114
|
+
基本没法打字。抽屉默认收起(App.vue 里按同一断点自动设 railOpen=false),
|
|
115
|
+
点右侧「检视」拉手展开,盖在中栏上而不是把正文列切走。 */
|
|
116
|
+
@media (max-width: 1180px) {
|
|
117
|
+
.workspace { grid-template-columns: 248px minmax(0, 1fr); }
|
|
118
|
+
|
|
119
|
+
.col--right {
|
|
120
|
+
position: fixed;
|
|
121
|
+
top: calc(56px + var(--pad));
|
|
122
|
+
right: var(--pad);
|
|
123
|
+
bottom: var(--pad);
|
|
124
|
+
width: 344px;
|
|
125
|
+
z-index: 60;
|
|
126
|
+
box-shadow: var(--sh-pop);
|
|
127
|
+
transition: transform 0.2s ease, opacity 0.18s ease;
|
|
128
|
+
}
|
|
129
|
+
.workspace.is-collapsed .col--right { transform: translateX(calc(100% + var(--pad))); }
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* 抽屉展开时的遮罩:点空白处收起 */
|
|
133
|
+
.rail-scrim {
|
|
134
|
+
position: fixed;
|
|
135
|
+
inset: 56px 0 0;
|
|
136
|
+
z-index: 59;
|
|
137
|
+
background: rgba(23, 32, 26, 0.16);
|
|
138
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/* ── 菜单面板通用样式 ─────────────────────────────────────────
|
|
2
|
+
7 个模块面板共用一套「KPI 卡 + 行列表 + 区块标题」的骨架,
|
|
3
|
+
避免每个组件复制一遍同样的 CSS 又各偏几个像素。 */
|
|
4
|
+
|
|
5
|
+
.pn-sec { margin-bottom: 18px; }
|
|
6
|
+
.pn-sec:last-child { margin-bottom: 0; }
|
|
7
|
+
|
|
8
|
+
.pn-h {
|
|
9
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
10
|
+
margin-bottom: 8px;
|
|
11
|
+
font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em;
|
|
12
|
+
color: var(--dim); text-transform: uppercase;
|
|
13
|
+
}
|
|
14
|
+
/* 标签本身大写,但 em 里的值是状态名/版本,不能被 uppercase 改样 */
|
|
15
|
+
.pn-h em {
|
|
16
|
+
font-style: normal; font-family: var(--mono);
|
|
17
|
+
font-size: 11.5px; font-weight: 700; color: var(--ink); text-transform: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* 用 flex 而不是 grid:换行后的最后一行也会等分铺满,
|
|
21
|
+
grid 的 auto-fit 会让落单的那个卡停在窄宽度上 */
|
|
22
|
+
.pn-kpi {
|
|
23
|
+
display: flex; flex-wrap: wrap;
|
|
24
|
+
gap: 8px; margin-bottom: 16px;
|
|
25
|
+
}
|
|
26
|
+
.pn-kpi > div {
|
|
27
|
+
flex: 1 1 104px;
|
|
28
|
+
padding: 10px 11px; border-radius: var(--r-sm);
|
|
29
|
+
background: rgba(255, 255, 255, 0.78);
|
|
30
|
+
border: 1px solid var(--line-soft);
|
|
31
|
+
}
|
|
32
|
+
.pn-kpi b {
|
|
33
|
+
display: block; font-size: 18px; font-weight: 650;
|
|
34
|
+
letter-spacing: -0.02em; line-height: 1.25;
|
|
35
|
+
}
|
|
36
|
+
.pn-kpi span { font-size: 11.5px; font-weight: 500; color: var(--dim); }
|
|
37
|
+
|
|
38
|
+
.pn-row {
|
|
39
|
+
width: 100%; text-align: left;
|
|
40
|
+
display: flex; align-items: center; gap: 10px;
|
|
41
|
+
padding: 9px 10px; border-radius: var(--r-sm);
|
|
42
|
+
border: 1px solid transparent;
|
|
43
|
+
transition: background 0.14s, border-color 0.14s;
|
|
44
|
+
}
|
|
45
|
+
.pn-row + .pn-row { margin-top: 2px; }
|
|
46
|
+
.pn-row:hover { background: rgba(255, 255, 255, 0.72); }
|
|
47
|
+
.pn-row.clickable:hover { border-color: var(--line); background: #fff; }
|
|
48
|
+
.pn-row .m { flex: 1; min-width: 0; }
|
|
49
|
+
.pn-row b {
|
|
50
|
+
display: block; font-size: 13.5px; font-weight: 600; color: var(--ink);
|
|
51
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
52
|
+
}
|
|
53
|
+
.pn-row span.s { display: block; margin-top: 2px; font-size: 11.5px; color: var(--dim); }
|
|
54
|
+
.pn-row .r { flex-shrink: 0; font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
|
|
55
|
+
|
|
56
|
+
.pn-tag {
|
|
57
|
+
display: inline-block; flex-shrink: 0;
|
|
58
|
+
padding: 3px 8px; border-radius: var(--r-pill);
|
|
59
|
+
font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
|
|
60
|
+
background: var(--surface-2); color: var(--dim);
|
|
61
|
+
}
|
|
62
|
+
.pn-tag.green { background: rgba(26, 157, 95, 0.12); color: var(--green); }
|
|
63
|
+
.pn-tag.amber { background: rgba(199, 116, 0, 0.13); color: var(--amber); }
|
|
64
|
+
.pn-tag.red { background: rgba(229, 72, 77, 0.12); color: var(--red); }
|
|
65
|
+
|
|
66
|
+
.pn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
67
|
+
.pn-chip {
|
|
68
|
+
padding: 5px 10px; border-radius: var(--r-pill);
|
|
69
|
+
font-family: var(--mono); font-size: 11.5px; color: var(--dim);
|
|
70
|
+
background: rgba(255, 255, 255, 0.78); border: 1px solid var(--line-soft);
|
|
71
|
+
transition: color 0.13s, border-color 0.13s, background 0.13s;
|
|
72
|
+
}
|
|
73
|
+
/* 可点的 chip(能力清单):原来全是 <span>,点了没反应 */
|
|
74
|
+
button.pn-chip:hover {
|
|
75
|
+
color: var(--green); background: #fff;
|
|
76
|
+
border-color: rgba(26, 157, 95, 0.35);
|
|
77
|
+
}
|
|
78
|
+
button.pn-chip.on {
|
|
79
|
+
color: var(--green); background: rgba(26, 157, 95, 0.1);
|
|
80
|
+
border-color: rgba(26, 157, 95, 0.4);
|
|
81
|
+
}
|
|
82
|
+
.pn-chip.warn {
|
|
83
|
+
color: var(--amber); background: rgba(199, 116, 0, 0.09);
|
|
84
|
+
border-color: rgba(199, 116, 0, 0.24);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.pn-empty {
|
|
88
|
+
padding: 16px 12px; border-radius: var(--r-sm);
|
|
89
|
+
font-size: 12px; line-height: 1.7; color: var(--dim);
|
|
90
|
+
background: rgba(255, 255, 255, 0.6); border: 1px dashed var(--line);
|
|
91
|
+
}
|
|
92
|
+
.pn-st { padding: 14px 4px; font-size: 12px; color: var(--dim); }
|
|
93
|
+
.pn-st.err { color: var(--amber); }
|
|
94
|
+
|
|
95
|
+
/* 两列布局:宽屏时让列表不拉成一条长带。
|
|
96
|
+
断点必须看「面板容器宽度」而不是视口 —— 中栏只占视口一半宽,
|
|
97
|
+
1440 的窗口里中栏也只有 ~560px,按视口判断会永远两列挤成两条窄条。 */
|
|
98
|
+
.pn-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
|
|
99
|
+
.panel > .pb { container-type: inline-size; }
|
|
100
|
+
@container (max-width: 660px) {
|
|
101
|
+
.pn-cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
|
|
102
|
+
}
|
|
103
|
+
/* 极窄(窗口拉到四五百像素、中栏只剩一百多):行内「名字 + 信任标签 + 按钮」横向放不下,
|
|
104
|
+
flex-shrink:0 的标签会把名字挤成几个字。改成名字独占一行、标签与按钮折到第二行。 */
|
|
105
|
+
@container (max-width: 300px) {
|
|
106
|
+
.pn-row { flex-wrap: wrap; row-gap: 6px; }
|
|
107
|
+
.pn-row .m { flex: 1 1 100%; }
|
|
108
|
+
.pn-h { flex-wrap: wrap; gap: 6px; }
|
|
109
|
+
.pn-kpi > div { flex: 1 1 76px; }
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.pn-note {
|
|
113
|
+
font-size: 11.5px; line-height: 1.65; color: var(--dim);
|
|
114
|
+
padding: 8px 10px; border-radius: var(--r-sm);
|
|
115
|
+
background: rgba(255, 255, 255, 0.6); border: 1px solid var(--line-soft);
|
|
116
|
+
}
|
|
117
|
+
.pn-note code { font-family: var(--mono); font-size: 11px; color: var(--ink); word-break: break-all; }
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* ── 三栏相邻色带:左淡绿(深) → 中淡绿(浅) → 右暖纸 ──
|
|
3
|
+
只在 .workspace 上铺「一条」渐变,三栏底色透明。
|
|
4
|
+
若每栏各写一个渐变,接缝处必然断层 —— 一条色带切三段才是真正的"相邻色"。
|
|
5
|
+
色带右端跟右栏取同一个暖纸色,否则右栏卡片与它周围 14px 的缝会两种白。 */
|
|
6
|
+
--g-left: #d7e8d0;
|
|
7
|
+
--g-mid: #eef7e8;
|
|
8
|
+
--g-right: #f8f3e9;
|
|
9
|
+
--band: linear-gradient(100deg, var(--g-left) 0%, var(--g-mid) 46%, var(--g-right) 100%);
|
|
10
|
+
|
|
11
|
+
/* 栏面玻璃膜:左最薄 → 右最厚,强化「浅 → 更浅」的层次感 */
|
|
12
|
+
--veil-left: rgba(255, 255, 255, 0.28);
|
|
13
|
+
--veil-mid: rgba(236, 246, 228, 0.9);
|
|
14
|
+
--veil-right: rgba(251, 247, 239, 0.92);
|
|
15
|
+
|
|
16
|
+
/* 中间主舞台:淡绿;右栏:暖纸 —— 主体是绿的那一块 */
|
|
17
|
+
--mid-panel: rgba(238, 247, 232, 0.95);
|
|
18
|
+
--right-panel: #fbf7ef;
|
|
19
|
+
|
|
20
|
+
/* 文字 / 分隔线(带一点绿调的墨色,避免暖灰与淡绿打架)
|
|
21
|
+
三档都过 WCAG AA 4.5:1(底色 #eef7e8 / #fbf7ef 上实测):
|
|
22
|
+
ink 13:1、dim 8.4:1、faint 4.7:1。
|
|
23
|
+
原来的 faint #9aa79b 只有 2.4:1 —— 提示文字、计数、二次说明在
|
|
24
|
+
淡绿底上几乎要凑近看,用户反馈「看不清」。别再往浅了调。 */
|
|
25
|
+
--ink: #17201a;
|
|
26
|
+
--dim: #3f4c42;
|
|
27
|
+
--faint: #65716a;
|
|
28
|
+
--line: rgba(23, 32, 26, 0.1);
|
|
29
|
+
--line-soft: rgba(23, 32, 26, 0.06);
|
|
30
|
+
|
|
31
|
+
/* ── 右栏的暖墨色(取自 OpenClaw 右栏:纸面底 + 炭墨字 + 极淡暖线) ──
|
|
32
|
+
只由 .col--right 覆写进去,左/中的绿调墨色不受影响 —— 两个色系各自成套,
|
|
33
|
+
不要混着用,否则绿灰的浅字压在暖纸上会发脏。 */
|
|
34
|
+
--w-ink: #211d17;
|
|
35
|
+
--w-dim: #4a4237;
|
|
36
|
+
--w-faint: #776d5c;
|
|
37
|
+
--w-line: rgba(64, 50, 32, 0.12);
|
|
38
|
+
--w-line-soft: rgba(64, 50, 32, 0.06);
|
|
39
|
+
--w-surface-2: #f3ede1;
|
|
40
|
+
--w-surface-3: #e9e1d2;
|
|
41
|
+
|
|
42
|
+
/* 强调与状态 */
|
|
43
|
+
--accent: #0a84ff;
|
|
44
|
+
--accent-soft: rgba(10, 132, 255, 0.1);
|
|
45
|
+
--green: #1a9d5f;
|
|
46
|
+
--amber: #c77400;
|
|
47
|
+
--red: #e5484d;
|
|
48
|
+
|
|
49
|
+
/* 栏内白卡 */
|
|
50
|
+
--surface: #ffffff;
|
|
51
|
+
--surface-2: #f1f4ef;
|
|
52
|
+
--surface-3: #e4eae2;
|
|
53
|
+
--r-card: 20px;
|
|
54
|
+
--r-mid: 14px;
|
|
55
|
+
--r-sm: 10px;
|
|
56
|
+
--r-pill: 999px;
|
|
57
|
+
--sh-card: 0 1px 2px rgba(23, 32, 26, 0.04), 0 10px 26px rgba(23, 32, 26, 0.07);
|
|
58
|
+
--sh-pop: 0 14px 40px rgba(23, 32, 26, 0.18), 0 2px 10px rgba(23, 32, 26, 0.08);
|
|
59
|
+
--gap: 14px;
|
|
60
|
+
--pad: 14px;
|
|
61
|
+
|
|
62
|
+
/* ── CLI 皮肤:只给「代码正文块」用,不给整栏用 ──
|
|
63
|
+
整栏反黑会跟三栏渐变链断裂,而且常在的进度面板也得跟着暗,得不偿失。 */
|
|
64
|
+
--cli-bg: #11160f;
|
|
65
|
+
--cli-bg-2: #0b0f0a;
|
|
66
|
+
--cli-ink: #d9e6d2;
|
|
67
|
+
--cli-dim: #849480;
|
|
68
|
+
--cli-line: rgba(255, 255, 255, 0.07);
|
|
69
|
+
--cli-acc: #7fe08c;
|
|
70
|
+
--cli-warn: #e2c07a;
|
|
71
|
+
|
|
72
|
+
--font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
|
|
73
|
+
--mono: ui-monospace, SFMono-Regular, "JetBrains Mono", "Cascadia Code", Consolas, monospace;
|
|
74
|
+
--serif: "Songti SC", "Noto Serif SC", Georgia, serif;
|
|
75
|
+
|
|
76
|
+
--z-menu: 100;
|
|
77
|
+
--z-top: 500;
|
|
78
|
+
}
|