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,341 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Foxclaw Deck · AI 指挥中枢</title>
|
|
7
|
+
<link rel="stylesheet" href="./deck.css?v=5.34">
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div class="app">
|
|
11
|
+
|
|
12
|
+
<!-- 顶栏 -->
|
|
13
|
+
<div class="topbar">
|
|
14
|
+
<div class="brand">
|
|
15
|
+
<div class="logo">H</div>
|
|
16
|
+
<h1>Foxclaw</h1><span class="ver">v5.34</span>
|
|
17
|
+
</div>
|
|
18
|
+
<!-- Agent 卡片已精简:对话统一走输入框(主管自动分诊);保留「财务/地图/学习」三个有二级面板的入口,移到右侧 -->
|
|
19
|
+
<div class="topright">
|
|
20
|
+
<div class="abtn" data-agent="finance" title="打开财务仪表盘">💰 财务</div>
|
|
21
|
+
<div class="abtn" data-agent="admin" title="打开行程地图">🗺 地图</div>
|
|
22
|
+
<div class="abtn" data-agent="office" title="打开学习面板 · 录入知识点">📚 学习</div>
|
|
23
|
+
<div class="sysstat">系统状态 <div class="bar"><i></i></div> <b id="upStat">···</b> <span id="diagTag" style="font-size:10px;color:var(--amber);margin-left:4px;font-family:ui-monospace,monospace">[DIAG?v5.37]</span></div>
|
|
24
|
+
<div class="model-sel" id="modelSel">
|
|
25
|
+
<div class="pill" id="modelPill">◈ <span id="modelName">AI 中枢</span> <span style="font-size:9px;opacity:.7">▾</span></div>
|
|
26
|
+
<div class="model-menu" id="modelMenu"></div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="planet-launch" id="planetLaunch" title="打开 HKC 知识星球">🌐 知识星球</div>
|
|
29
|
+
<div class="icobtn">◔</div>
|
|
30
|
+
<div class="icobtn" id="settingsBtn" title="设置">⚙</div>
|
|
31
|
+
<div class="avatar-sm"></div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<!-- 主体 -->
|
|
36
|
+
<div class="body">
|
|
37
|
+
|
|
38
|
+
<!-- 左导航:会话历史是主内容(新会话 → 会话列表),功能视图收进底部「菜单」按钮 -->
|
|
39
|
+
<div class="nav">
|
|
40
|
+
<button class="ns-new" id="sessNew" title="开一个新会话(清空上下文)">
|
|
41
|
+
<span class="ns-plus">+</span>新会话
|
|
42
|
+
</button>
|
|
43
|
+
<div class="ns-head">会话历史 <em id="nsCount">—</em></div>
|
|
44
|
+
<div class="ns-list" id="nsList"><div class="kp-empty">加载中…</div></div>
|
|
45
|
+
<button class="nav-menu-btn" id="navMenuBtn" aria-expanded="false" aria-controls="navMenu"
|
|
46
|
+
title="功能菜单:概览 / 工作台 / 能力 / 知识">
|
|
47
|
+
<span class="nm-ic"><svg viewBox="0 0 24 24"><path d="M4 6h16"/><path d="M4 12h16"/><path d="M4 18h16"/></svg></span>
|
|
48
|
+
<b id="navMenuLabel">菜单</b>
|
|
49
|
+
<span class="nm-caret">▴</span>
|
|
50
|
+
</button>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<!-- 功能菜单浮层:原左栏导航整组搬到这里,分组(工作台/能力/知识)原样保留 -->
|
|
54
|
+
<div class="nav-menu" id="navMenu" aria-hidden="true">
|
|
55
|
+
<div class="nav-menu-head">功能 <span class="x" id="navMenuClose" title="关闭 (Esc)">✕</span></div>
|
|
56
|
+
<nav class="nav-list" id="navList">
|
|
57
|
+
<div class="nav-link on" data-module="overview" title="概览">
|
|
58
|
+
<span class="ni"><svg viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/></svg></span><b>概览</b>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="nav-sec">工作台</div>
|
|
61
|
+
<div class="nav-link" data-module="activity" title="系统活动/事件流">
|
|
62
|
+
<span class="ni"><svg viewBox="0 0 24 24"><path d="M22 12h-4l-3 9L9 3l-3 9H2"/></svg></span><b>活动</b>
|
|
63
|
+
</div>
|
|
64
|
+
<div class="nav-link" data-module="tasks" title="任务与推理">
|
|
65
|
+
<span class="ni"><svg viewBox="0 0 24 24"><path d="m3 17 2 2 4-4"/><path d="m3 7 2 2 4-4"/><path d="M13 6h8"/><path d="M13 12h8"/><path d="M13 18h8"/></svg></span><b>任务</b>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="nav-link" data-module="agents" title="五个领域 Agent">
|
|
68
|
+
<span class="ni"><svg viewBox="0 0 24 24"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg></span><b>代理</b>
|
|
69
|
+
</div>
|
|
70
|
+
<div class="nav-sec">能力</div>
|
|
71
|
+
<div class="nav-link" data-module="tools" title="技能 / 工具 / 连接器">
|
|
72
|
+
<span class="ni"><svg viewBox="0 0 24 24"><path d="m12 3-1.9 5.8a2 2 0 0 1-1.3 1.3L3 12l5.8 1.9a2 2 0 0 1 1.3 1.3L12 21l1.9-5.8a2 2 0 0 1 1.3-1.3L21 12l-5.8-1.9a2 2 0 0 1-1.3-1.3Z"/></svg></span><b>技能</b>
|
|
73
|
+
</div>
|
|
74
|
+
<div class="nav-link" data-module="usage" title="用量与成本">
|
|
75
|
+
<span class="ni"><svg viewBox="0 0 24 24"><path d="M3 3v18h18"/><path d="M18 17V9"/><path d="M13 17V5"/><path d="M8 17v-3"/></svg></span><b>使用情况</b>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="nav-sec">知识</div>
|
|
78
|
+
<div class="nav-link" data-module="knowledge" title="知识库">
|
|
79
|
+
<span class="ni"><svg viewBox="0 0 24 24"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/></svg></span><b>知识库</b>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="nav-link" data-module="memory" title="记忆中心">
|
|
82
|
+
<span class="ni"><svg viewBox="0 0 24 24"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5v14a9 3 0 0 0 18 0V5"/><path d="M3 12a9 3 0 0 0 18 0"/></svg></span><b>记忆中心</b>
|
|
83
|
+
</div>
|
|
84
|
+
</nav>
|
|
85
|
+
</div>
|
|
86
|
+
<div class="nav-flyout" id="navFlyout"></div>
|
|
87
|
+
|
|
88
|
+
<!-- 中央列 -->
|
|
89
|
+
<div class="center">
|
|
90
|
+
<canvas id="streamCanvas" class="stream-canvas"></canvas>
|
|
91
|
+
|
|
92
|
+
<!-- 全息核心(中央主体) -->
|
|
93
|
+
<div class="corewrap">
|
|
94
|
+
<canvas id="coreCanvas"></canvas>
|
|
95
|
+
<div class="core-label" id="coreLabel" style="display:none"></div>
|
|
96
|
+
<div class="core-stage" id="coreStage"></div>
|
|
97
|
+
<div class="core-chat" id="coreChat">
|
|
98
|
+
<div class="cc-head"><div class="t"><span class="dot"></span><span id="ccAgent">回复</span></div><span class="x" id="ccClose" title="关闭">✕</span></div>
|
|
99
|
+
<div class="cc-body"><div class="cc-q" id="ccQ"></div><div id="ccReply"></div><div class="cc-status" id="ccStatus"></div></div>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<!-- 底部带:指令栏(占满) -->
|
|
104
|
+
<div class="bottomband">
|
|
105
|
+
<div class="cmdwrap">
|
|
106
|
+
<div class="slash-menu" id="slashMenu"></div>
|
|
107
|
+
<div class="slash-menu" id="atMenu"></div>
|
|
108
|
+
<div class="conn-panel" id="connPanel"></div>
|
|
109
|
+
<div class="img-strip" id="imgStrip"></div>
|
|
110
|
+
<div class="file-strip" id="fileStrip"></div>
|
|
111
|
+
<div class="tool-menu" id="toolMenu"></div>
|
|
112
|
+
<div class="cmdbar">
|
|
113
|
+
<div class="cmdbar-inner">
|
|
114
|
+
<div class="mic" id="cmdMore" title="工具:模式/上传/文件夹/图片/连接器">+</div>
|
|
115
|
+
<!-- 模型选择器(下拉式,图1 风格):点击展开 / "+" 弹添加对话框 / 切完即时生效 -->
|
|
116
|
+
<div class="model-pick" id="chatModelPick" title="选择对话模型(切完即时生效,无需重启)">
|
|
117
|
+
<div class="mp-pill" id="chatModelPill">
|
|
118
|
+
<span class="mp-dot" id="chatModelDot"></span>
|
|
119
|
+
<span class="mp-name" id="chatModelName">Auto</span>
|
|
120
|
+
<span class="mp-caret">▾</span>
|
|
121
|
+
</div>
|
|
122
|
+
<div class="mp-menu" id="chatModelMenu"></div>
|
|
123
|
+
</div>
|
|
124
|
+
<input id="cmd" placeholder="告诉我你想做什么… 主管 Agent 将自动调度">
|
|
125
|
+
<div class="send">➤</div>
|
|
126
|
+
<!-- 工具按钮收进上方弹窗菜单;这些隐藏保留,菜单项点击它们以复用原有逻辑 -->
|
|
127
|
+
<div id="cmdTools" style="display:none">
|
|
128
|
+
<div class="chat-mode" id="chatMode" title="切换:流式对话 / 编排任务">⚡ 流式</div>
|
|
129
|
+
<div class="mic" id="cmdAttach" title="附加文件摄入知识库">📎</div>
|
|
130
|
+
<input type="file" id="cmdFile">
|
|
131
|
+
<div class="mic" id="cmdFolder" title="文件夹摄入">📁</div>
|
|
132
|
+
<input type="file" id="cmdFolderInput" webkitdirectory directory multiple>
|
|
133
|
+
<div class="mic" id="cmdImg" title="附加图片(多模态)">🖼</div>
|
|
134
|
+
<input type="file" id="cmdImgFile" accept="image/*" multiple>
|
|
135
|
+
<div class="mic" id="cmdAttachFile" title="附件文件(随问题发给 AI)">📄</div>
|
|
136
|
+
<input type="file" id="cmdFileUpload" multiple>
|
|
137
|
+
<div class="mic" id="cmdConn" title="连接器/插件">🔌</div>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
<!-- 快捷指令按钮已移除:它们只是把预设文字塞进输入框再发送,与直接在输入框输入等价,冗余 -->
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<!-- 右栏:记忆 + 知识库(全部真数据;已删写死的假任务流与装饰性画布)-->
|
|
148
|
+
<div class="right">
|
|
149
|
+
<div class="panel" id="memPanel">
|
|
150
|
+
<div class="ph">
|
|
151
|
+
<div class="pt"><span class="dot"></span>记忆 <em id="memCount">—</em></div>
|
|
152
|
+
<span class="x" id="memMore" title="打开记忆中心">›</span>
|
|
153
|
+
</div>
|
|
154
|
+
<div class="mem-stats" id="memStats">
|
|
155
|
+
<div class="ms"><b id="msTotal">—</b><span>总数</span></div>
|
|
156
|
+
<div class="ms"><b id="msPrivate">—</b><span>私有</span></div>
|
|
157
|
+
<div class="ms"><b id="msShared">—</b><span>共享</span></div>
|
|
158
|
+
<div class="ms"><b id="msRel">—</b><span>关系</span></div>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<div class="panel" id="knowPanel">
|
|
163
|
+
<div class="ph">
|
|
164
|
+
<div class="pt"><span class="dot" style="background:var(--green)"></span>知识库 <em id="knowCount">—</em></div>
|
|
165
|
+
<span class="x" id="knowMore" title="打开知识库">›</span>
|
|
166
|
+
</div>
|
|
167
|
+
<!-- 知识摄入入口(常驻可见):文件/文件夹进 HKC,或手写知识点 -->
|
|
168
|
+
<div class="ingest-row">
|
|
169
|
+
<button class="ing-btn" id="ingFile" title="导入文件到知识星球(HKC)">📄 导入文件</button>
|
|
170
|
+
<button class="ing-btn" id="ingFolder" title="导入整个文件夹">📁 文件夹</button>
|
|
171
|
+
<button class="ing-btn" id="ingNote" title="手写一条知识点">+ 知识点</button>
|
|
172
|
+
</div>
|
|
173
|
+
<div class="pb info-list" id="knowList"><div class="kp-empty">加载中…</div></div>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<!-- 录入表单弹层 -->
|
|
181
|
+
<!-- 设置:级联悬浮玻璃菜单(hover 逐级展开)-->
|
|
182
|
+
<div class="setmenu" id="setMenu">
|
|
183
|
+
<!-- 一级:三大模块 -->
|
|
184
|
+
<div class="sm-col sm-l1">
|
|
185
|
+
<div class="sm-btn" data-group="foxclaw"><span class="gi">◈</span><b>Foxclaw</b><span class="chev">›</span></div>
|
|
186
|
+
<div class="sm-btn" data-group="agents"><span class="gi">⬡</span><b>Agents</b><span class="chev">›</span></div>
|
|
187
|
+
<div class="sm-btn" data-group="hmr"><span class="gi">❖</span><b>HMR</b><span class="chev">›</span></div>
|
|
188
|
+
</div>
|
|
189
|
+
<!-- 二级:各模块子项(hover 一级时显示对应组)-->
|
|
190
|
+
<div class="sm-col sm-l2" id="smL2"></div>
|
|
191
|
+
</div>
|
|
192
|
+
|
|
193
|
+
<!-- 子菜单详情(点二级项后弹出的玻璃浮窗)-->
|
|
194
|
+
<div class="sd-pop" id="sdPop">
|
|
195
|
+
<div class="sd-pop-head"><b id="sdTitle">详情</b><span class="x" id="sdClose">✕</span></div>
|
|
196
|
+
<div class="sd-body" id="sdBody"></div>
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<div class="entry-mask" id="entryMask">
|
|
200
|
+
<div class="entry-box">
|
|
201
|
+
<h3 id="entryTitle">录入</h3>
|
|
202
|
+
<div class="sub" id="entrySub"></div>
|
|
203
|
+
<div id="entryFields"></div>
|
|
204
|
+
<div class="entry-msg" id="entryMsg"></div>
|
|
205
|
+
<div class="entry-btns">
|
|
206
|
+
<button class="cancel" id="entryCancel">取消</button>
|
|
207
|
+
<button class="ok" id="entrySubmit">录入</button>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
<!-- 「添加自定义模型」对话框(图2 风格:需兼容 OpenAI Chat Completion API) -->
|
|
213
|
+
<div class="cm-mask" id="cmAddMask">
|
|
214
|
+
<div class="cm-modal">
|
|
215
|
+
<div class="cm-head">
|
|
216
|
+
<h3 id="cmAddTitle">添加自定义模型</h3>
|
|
217
|
+
<span class="cm-close" id="cmAddClose" title="关闭 (Esc)">✕</span>
|
|
218
|
+
</div>
|
|
219
|
+
<div class="cm-sub">需兼容 OpenAI Chat Completion 接口;BASE URL 通常以 <code>/v1</code> 结尾<span id="cmAddSubHint" style="color:#e0a45c"></span></div>
|
|
220
|
+
<div class="cm-body">
|
|
221
|
+
<div class="cm-row">
|
|
222
|
+
<label>模型名称 <em>*</em></label>
|
|
223
|
+
<input id="cm_name" placeholder="例:我的 MiniMax-M3" maxlength="40">
|
|
224
|
+
</div>
|
|
225
|
+
<div class="cm-row">
|
|
226
|
+
<label>BASE URL <em>*</em></label>
|
|
227
|
+
<input id="cm_base_url" placeholder="https://api.example.com/v1">
|
|
228
|
+
</div>
|
|
229
|
+
<div class="cm-row cm-pwd">
|
|
230
|
+
<label>API KEY <em>*</em></label>
|
|
231
|
+
<input id="cm_api_key" type="password" placeholder="请输入 API Key">
|
|
232
|
+
<span class="cm-eye" id="cm_eye" title="显示/隐藏">👁</span>
|
|
233
|
+
</div>
|
|
234
|
+
<div class="cm-row">
|
|
235
|
+
<label>模型 ID <em>*</em></label>
|
|
236
|
+
<input id="cm_model" placeholder="例:MiniMax-Text-01">
|
|
237
|
+
</div>
|
|
238
|
+
<details class="cm-extra">
|
|
239
|
+
<summary>高级设置(双 header 鉴权,如 MiniMax Group ID)</summary>
|
|
240
|
+
<div class="cm-row">
|
|
241
|
+
<label>Group ID(可选)</label>
|
|
242
|
+
<input id="cm_group_id" placeholder="例:1234567890">
|
|
243
|
+
</div>
|
|
244
|
+
<div class="cm-row">
|
|
245
|
+
<label>额外 header(JSON object,可选)</label>
|
|
246
|
+
<input id="cm_extra_headers" placeholder='例:{"X-Custom": "value"}'>
|
|
247
|
+
</div>
|
|
248
|
+
<div class="cm-row">
|
|
249
|
+
<label>备注(可选)</label>
|
|
250
|
+
<input id="cm_note" placeholder="例:生产环境 / 备用">
|
|
251
|
+
</div>
|
|
252
|
+
</details>
|
|
253
|
+
<div class="cm-msg" id="cm_msg"></div>
|
|
254
|
+
</div>
|
|
255
|
+
<div class="cm-btns">
|
|
256
|
+
<button class="cm-cancel" id="cm_cancel">取消</button>
|
|
257
|
+
<button class="cm-test" id="cm_test">测试连通性</button>
|
|
258
|
+
<button class="cm-save" id="cm_save">保存</button>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
|
|
263
|
+
<!-- 全屏 overlay 浮层 -->
|
|
264
|
+
<div class="ov-mask" id="ovMask">
|
|
265
|
+
<div class="ov-box">
|
|
266
|
+
<div class="ov-head">
|
|
267
|
+
<div class="ov-title"><span class="dot"></span><span id="ovTitle">全屏</span> <em id="ovTag"></em></div>
|
|
268
|
+
<div class="ov-tools">
|
|
269
|
+
<label class="ov-auto"><input type="checkbox" id="ovAutoMap"> 地图自动全屏</label>
|
|
270
|
+
<span class="ov-close" id="ovClose" title="关闭">✕</span>
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
<div class="ov-body" id="ovBody"></div>
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
<!-- 兜底错误捕获:任何 JS 错误 / Promise reject 都打到 #upStat,便于一眼定位卡死点 -->
|
|
278
|
+
<script>
|
|
279
|
+
(function(){
|
|
280
|
+
function show(msg, color){
|
|
281
|
+
var el = document.getElementById('upStat');
|
|
282
|
+
if(!el) return;
|
|
283
|
+
el.textContent = msg.length>40 ? msg.slice(0,40)+'…' : msg;
|
|
284
|
+
el.style.color = color || 'var(--amber)';
|
|
285
|
+
}
|
|
286
|
+
// 启动超时:3 秒后 loadStatus 还没把 upStat 改成 100%/离线 → 报"启动卡死"
|
|
287
|
+
setTimeout(function(){
|
|
288
|
+
var el = document.getElementById('upStat');
|
|
289
|
+
if(el && el.textContent === '···'){
|
|
290
|
+
show('启动卡死(>3s)', 'var(--amber)');
|
|
291
|
+
}
|
|
292
|
+
}, 3000);
|
|
293
|
+
// 全局同步错误
|
|
294
|
+
window.addEventListener('error', function(e){
|
|
295
|
+
show('JS:' + (e.message||'error').slice(0,32), 'var(--pink)');
|
|
296
|
+
});
|
|
297
|
+
// 未捕获的 Promise 拒绝
|
|
298
|
+
window.addEventListener('unhandledrejection', function(e){
|
|
299
|
+
var r = e.reason && (e.reason.message || String(e.reason)) || 'reject';
|
|
300
|
+
show('PR:' + String(r).slice(0,32), 'var(--pink)');
|
|
301
|
+
});
|
|
302
|
+
// 暴露手动诊断:控制台跑 statusDiag() 看 main.js / loadStatus / API 实际状态
|
|
303
|
+
window.statusDiag = function(){
|
|
304
|
+
return {
|
|
305
|
+
upStat: document.getElementById('upStat')?.textContent,
|
|
306
|
+
mainLoaded: typeof loadStatus === 'function',
|
|
307
|
+
pickerLoaded: typeof window._chatPickerInited !== 'undefined' || !!document.getElementById('chatModelPill'),
|
|
308
|
+
wsReadyState: (function(){try{return (window._ws||{}).readyState}catch(e){return 'n/a'}})(),
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
// DIAG 标记(肉眼可见,确认硬刷是否真生效):注入时间戳。
|
|
312
|
+
// 看不到这行被替换 → 浏览器/foxclaw 缓存了旧 HTML。
|
|
313
|
+
var dt = document.getElementById('diagTag');
|
|
314
|
+
if(dt) dt.textContent = 'DIAG v5.37 @ ' + new Date().toTimeString().slice(0,8);
|
|
315
|
+
})();
|
|
316
|
+
</script>
|
|
317
|
+
<script type="module" src="./deck/main.js?v=5.41"></script>
|
|
318
|
+
|
|
319
|
+
<!-- HKC 知识星球:点右上角「🌐 知识星球」→ 全屏弹出 HKC 原版整页(iframe /planet/)。首开懒加载,首页保持清爽。 -->
|
|
320
|
+
<div class="planet-ov" id="planetOv" aria-hidden="true">
|
|
321
|
+
<div class="wrap">
|
|
322
|
+
<button class="close" id="planetClose" title="关闭 (Esc)">✕</button>
|
|
323
|
+
<iframe id="planetFrame" src="about:blank" title="HKC 知识星球"></iframe>
|
|
324
|
+
</div>
|
|
325
|
+
</div>
|
|
326
|
+
<script>
|
|
327
|
+
(function(){
|
|
328
|
+
const ov=document.getElementById('planetOv'), fr=document.getElementById('planetFrame');
|
|
329
|
+
function openPlanet(){
|
|
330
|
+
if(!fr.src || fr.src==='about:blank') fr.src='/planet/?v=5.30'; // 懒加载:首次打开才载 HKC 原版整页(带版本破缓存)
|
|
331
|
+
ov.classList.add('on'); ov.setAttribute('aria-hidden','false');
|
|
332
|
+
}
|
|
333
|
+
function closePlanet(){ ov.classList.remove('on'); ov.setAttribute('aria-hidden','true'); }
|
|
334
|
+
window.openPlanet=openPlanet; window.closePlanet=closePlanet;
|
|
335
|
+
document.getElementById('planetClose').addEventListener('click', closePlanet);
|
|
336
|
+
document.addEventListener('keydown', e=>{ if(e.key==='Escape' && ov.classList.contains('on')) closePlanet(); });
|
|
337
|
+
const btn=document.getElementById('planetLaunch'); if(btn) btn.addEventListener('click', openPlanet);
|
|
338
|
+
})();
|
|
339
|
+
</script>
|
|
340
|
+
</body>
|
|
341
|
+
</html>
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Foxclaw Knowledge Core</title>
|
|
7
|
+
<script type="module">
|
|
8
|
+
// 预加载 Three.js(ESM)到全局,供主脚本(普通 script)使用
|
|
9
|
+
import('./vendor/three.module.min.js')
|
|
10
|
+
.then(THREE => { window.THREE = THREE; window.dispatchEvent(new Event('three-ready')); })
|
|
11
|
+
.catch(e => { window.__threeLoadError = String(e); console.error('Three.js 加载失败', e); });
|
|
12
|
+
</script>
|
|
13
|
+
<link rel="stylesheet" href="./planet.css?v=1.2">
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div class="layout">
|
|
17
|
+
<!-- ░░ 左栏:功能区(顶部含品牌栏) ░░ -->
|
|
18
|
+
<aside class="col col-left">
|
|
19
|
+
<div class="topbar">
|
|
20
|
+
<div class="brand">
|
|
21
|
+
<div class="mark">H</div>
|
|
22
|
+
<span>Foxclaw Knowledge Core</span>
|
|
23
|
+
<span class="ver" id="app-ver">v1.0</span>
|
|
24
|
+
</div>
|
|
25
|
+
<a class="home-link" href="/" id="btn-home" title="返回 Foxclaw 主界面">
|
|
26
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 12H5"/><path d="m12 19-7-7 7-7"/></svg>
|
|
27
|
+
主界面
|
|
28
|
+
</a>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="side-scroll">
|
|
31
|
+
<!-- 搜索 -->
|
|
32
|
+
<div class="side-block">
|
|
33
|
+
<div class="side-label">搜索</div>
|
|
34
|
+
<div class="search-box">
|
|
35
|
+
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>
|
|
36
|
+
<input id="search-input" placeholder="搜索知识、概念、观点…" autocomplete="off">
|
|
37
|
+
</div>
|
|
38
|
+
<div class="modes" id="modes">
|
|
39
|
+
<button class="mode-btn on" data-mode="hybrid">混合</button>
|
|
40
|
+
<button class="mode-btn" data-mode="bm25">关键词</button>
|
|
41
|
+
<button class="mode-btn" data-mode="vector">语义</button>
|
|
42
|
+
<button class="mode-btn" data-mode="graph">图谱</button>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<!-- 主操作 -->
|
|
47
|
+
<div class="side-block">
|
|
48
|
+
<div class="side-label">知识录入</div>
|
|
49
|
+
<button class="btn btn-primary btn-block" id="btn-ingest">
|
|
50
|
+
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"><path d="M12 5v14M5 12h14"/></svg>
|
|
51
|
+
摄入知识
|
|
52
|
+
</button>
|
|
53
|
+
<button class="btn btn-ghost btn-block" id="btn-books" style="margin-top:8px">
|
|
54
|
+
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14z"/></svg>
|
|
55
|
+
管理书籍
|
|
56
|
+
</button>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<!-- 能力编译(可折叠,默认折叠 —— 把知识编译成 Agent 可调用的能力包 .hkap) -->
|
|
60
|
+
<div class="side-block side-block-grow collapsible collapsed" id="ability-block">
|
|
61
|
+
<div class="side-label collapse-head" onclick="toggleCollapse('ability-block')">
|
|
62
|
+
<span class="collapse-arrow">▸</span>能力编译 <span class="count" id="ability-count">0 项</span>
|
|
63
|
+
</div>
|
|
64
|
+
<div id="ability-body"></div>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<!-- 冲突裁决 -->
|
|
68
|
+
<div class="side-block">
|
|
69
|
+
<div class="side-label">冲突裁决 <span class="count count-alert" id="conflict-count">0</span></div>
|
|
70
|
+
<div id="conflict-body"></div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<!-- 底部设置 -->
|
|
75
|
+
<div class="side-foot">
|
|
76
|
+
<button class="btn btn-ghost-dark" id="btn-settings">
|
|
77
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
|
|
78
|
+
连接设置
|
|
79
|
+
</button>
|
|
80
|
+
<div class="conn-pill demo" id="conn-pill">
|
|
81
|
+
<span class="conn-dot"></span><span id="conn-text">演示模式</span>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</aside>
|
|
85
|
+
|
|
86
|
+
<!-- ░░ 中栏:知识图谱 ░░ -->
|
|
87
|
+
<section class="col col-mid" id="graph-panel">
|
|
88
|
+
<div id="graph-canvas">
|
|
89
|
+
<button class="graph-fit" id="btn-fit" title="适应视图(重置相机)">
|
|
90
|
+
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3m13-5v3a2 2 0 0 1-2 2h-3"/></svg>
|
|
91
|
+
</button>
|
|
92
|
+
<div class="graph-hint">点击节点查看详情 · 悬停放大 · 滚轮缩放</div>
|
|
93
|
+
<div class="graph-legend" id="legend"></div>
|
|
94
|
+
</div>
|
|
95
|
+
</section>
|
|
96
|
+
|
|
97
|
+
<!-- ░░ 右栏:词条详情 ░░ -->
|
|
98
|
+
<aside class="col col-right" id="wiki-panel">
|
|
99
|
+
<div id="wiki-body">
|
|
100
|
+
<div class="wiki-empty">
|
|
101
|
+
<svg width="44" height="44" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg>
|
|
102
|
+
<p>点击图谱中的节点<br>查看知识单元详情</p>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</aside>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<!-- 摄入模态 -->
|
|
109
|
+
<div class="modal-bg" id="ingest-modal">
|
|
110
|
+
<div class="modal">
|
|
111
|
+
<div class="modal-head">
|
|
112
|
+
<h3>摄入知识</h3>
|
|
113
|
+
<button class="icon-btn" data-close><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 6 6 18M6 6l12 12"/></svg></button>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="modal-body">
|
|
116
|
+
<div class="field">
|
|
117
|
+
<label>文本内容</label>
|
|
118
|
+
<textarea id="ingest-text" placeholder="粘贴书籍段落、文章、笔记… 系统会自动拆解为实体、概念、事实、观点,并检测冲突。"></textarea>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<div class="field">
|
|
122
|
+
<label>或上传文件 / 文件夹<span style="color:var(--ink-3);font-weight:400">(支持 .pdf .md .txt .epub .mobi .azw3,可多选)</span></label>
|
|
123
|
+
<div class="upload-row">
|
|
124
|
+
<button type="button" class="btn btn-ghost btn-sm" id="btn-pick-files">
|
|
125
|
+
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/><path d="M13 2v7h7"/></svg>
|
|
126
|
+
选择文件
|
|
127
|
+
</button>
|
|
128
|
+
<button type="button" class="btn btn-ghost btn-sm" id="btn-pick-folder">
|
|
129
|
+
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>
|
|
130
|
+
选择文件夹
|
|
131
|
+
</button>
|
|
132
|
+
<input type="file" id="ingest-files" multiple accept=".pdf,.md,.markdown,.txt,.epub,.mobi,.azw3,.azw" hidden>
|
|
133
|
+
<input type="file" id="ingest-folder" webkitdirectory directory multiple hidden>
|
|
134
|
+
</div>
|
|
135
|
+
<div id="file-list" class="file-list"></div>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<div class="field">
|
|
139
|
+
<label>或摄入网页<span style="color:var(--ink-3);font-weight:400">(填网址,自动抓取正文后抽取)</span></label>
|
|
140
|
+
<input id="ingest-url" placeholder="https://example.com/article">
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
<div class="field">
|
|
144
|
+
<label>来源标题<span style="color:var(--ink-3);font-weight:400">(上传文件时可留空,自动用文件名)</span></label>
|
|
145
|
+
<input id="ingest-title" placeholder="如:穷查理宝典">
|
|
146
|
+
</div>
|
|
147
|
+
<div class="field">
|
|
148
|
+
<label>领域</label>
|
|
149
|
+
<select id="ingest-domain">
|
|
150
|
+
<option value="Investment">投资 Investment</option>
|
|
151
|
+
<option value="Psychology">心理学 Psychology</option>
|
|
152
|
+
<option value="Engineering">工程 Engineering</option>
|
|
153
|
+
<option value="Nutrition">营养 Nutrition</option>
|
|
154
|
+
<option value="">(不指定)</option>
|
|
155
|
+
</select>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
<div class="modal-foot">
|
|
159
|
+
<div id="ingest-status" class="ingest-status"></div>
|
|
160
|
+
<button class="btn btn-ghost" data-close>取消</button>
|
|
161
|
+
<button class="btn btn-primary" id="btn-ingest-submit">开始摄入</button>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
<!-- 设置模态 -->
|
|
167
|
+
<div class="modal-bg" id="settings-modal">
|
|
168
|
+
<div class="modal">
|
|
169
|
+
<div class="modal-head">
|
|
170
|
+
<h3>连接设置</h3>
|
|
171
|
+
<button class="icon-btn" data-close><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 6 6 18M6 6l12 12"/></svg></button>
|
|
172
|
+
</div>
|
|
173
|
+
<div class="modal-body">
|
|
174
|
+
<div class="field">
|
|
175
|
+
<label>HKC API 地址</label>
|
|
176
|
+
<input id="api-url" placeholder="留空=当前站点(同源);或填 http://host:port" value="">
|
|
177
|
+
</div>
|
|
178
|
+
<div class="field">
|
|
179
|
+
<label>API Key<span style="color:var(--ink-3);font-weight:400">(后端设了 FOXCLAW_API_KEY / HKC_API_KEY 时必填,填 .env 里那个鉴权 key)</span></label>
|
|
180
|
+
<input id="api-key" type="password" placeholder="后端无鉴权可留空;设了鉴权则必填" autocomplete="off">
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<div class="field" style="margin-top:14px;padding-top:14px;border-top:1px solid var(--line)">
|
|
184
|
+
<label>知识抽取模型(摄入知识时使用)</label>
|
|
185
|
+
<select id="llm-provider" style="width:100%;padding:9px 11px;border:1px solid var(--line);border-radius:8px;font-size:13px;background:var(--white);color:var(--ink)">
|
|
186
|
+
<option value="deepseek">DeepSeek</option>
|
|
187
|
+
<option value="anthropic">Claude (Anthropic)</option>
|
|
188
|
+
<option value="openai">OpenAI</option>
|
|
189
|
+
<option value="openai-compatible">自定义 / 本地模型 (OpenAI 兼容)</option>
|
|
190
|
+
</select>
|
|
191
|
+
</div>
|
|
192
|
+
<div class="field">
|
|
193
|
+
<label>API Key <span style="color:var(--ink-3);font-weight:400">(记在本浏览器,刷新不丢;换设备需重填)</span></label>
|
|
194
|
+
<input id="llm-key" type="password" placeholder="sk-..." autocomplete="off">
|
|
195
|
+
</div>
|
|
196
|
+
<div class="field" id="llm-model-field">
|
|
197
|
+
<label>模型名称 <span style="color:var(--ink-3);font-weight:400">(留空用默认)</span></label>
|
|
198
|
+
<input id="llm-model" placeholder="deepseek-chat">
|
|
199
|
+
</div>
|
|
200
|
+
<div class="field" id="llm-baseurl-field" style="display:none">
|
|
201
|
+
<label>API 地址 (Base URL)</label>
|
|
202
|
+
<input id="llm-baseurl" placeholder="http://localhost:11434/v1">
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
<p style="font-size:12.5px;color:var(--ink-2);line-height:1.6">
|
|
206
|
+
填入运行中的 <code style="background:var(--canvas);padding:1px 5px;border-radius:4px">hkc-api</code> 地址并连接,使用真实数据。
|
|
207
|
+
连接后会把上面的模型配置发送给后端。连接失败或未填写时,界面使用内置演示数据,可离线预览。
|
|
208
|
+
</p>
|
|
209
|
+
</div>
|
|
210
|
+
<div class="modal-foot">
|
|
211
|
+
<button class="btn btn-ghost" id="btn-use-demo">使用演示数据</button>
|
|
212
|
+
<button class="btn btn-primary" id="btn-connect">连接</button>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<!-- 书籍管理模态 -->
|
|
218
|
+
<div class="modal-bg" id="books-modal">
|
|
219
|
+
<div class="modal">
|
|
220
|
+
<div class="modal-head">
|
|
221
|
+
<h3>书籍管理</h3>
|
|
222
|
+
<button class="icon-btn" data-close><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 6 6 18M6 6l12 12"/></svg></button>
|
|
223
|
+
</div>
|
|
224
|
+
<div class="modal-body">
|
|
225
|
+
<p style="font-size:12.5px;color:var(--ink-2);line-height:1.6;margin:0 0 12px">
|
|
226
|
+
列出已摄入的书籍/来源。删除某本书会移除它及其独占知识;与其他书共享的知识只去掉该书的引用,不会被误删。
|
|
227
|
+
</p>
|
|
228
|
+
<div id="books-list"></div>
|
|
229
|
+
</div>
|
|
230
|
+
<div class="modal-foot">
|
|
231
|
+
<button class="btn btn-ghost" data-close>关闭</button>
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
|
|
236
|
+
<div id="toast-wrap"></div>
|
|
237
|
+
|
|
238
|
+
<script src="./planet.js?v=1.0"></script>
|
|
239
|
+
<script>
|
|
240
|
+
// 返回主界面。三种宿主环境要分别处理,否则会出怪现象:
|
|
241
|
+
// ① 旧界面 deck_v2(/classic)是把星球塞进整页 iframe 浮层 —— 此时 href="/" 会在浮层内部
|
|
242
|
+
// 再套一层主界面,必须让父窗口把浮层关掉。
|
|
243
|
+
// ② 当前主界面 v3 用 window.open 新标签打开星球 —— 能关掉这个标签就回到原来那个主界面。
|
|
244
|
+
// ③ 直接输地址打开 —— 走 href="/" 正常跳转。
|
|
245
|
+
(function () {
|
|
246
|
+
var a = document.getElementById('btn-home');
|
|
247
|
+
if (!a) return;
|
|
248
|
+
a.addEventListener('click', function (e) {
|
|
249
|
+
if (window.self !== window.top) {
|
|
250
|
+
e.preventDefault();
|
|
251
|
+
try {
|
|
252
|
+
if (typeof window.parent.closePlanet === 'function') { window.parent.closePlanet(); return; }
|
|
253
|
+
} catch (err) {}
|
|
254
|
+
try { window.top.location.href = '/'; } catch (err) {}
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
if (window.opener && !window.opener.closed) {
|
|
258
|
+
e.preventDefault();
|
|
259
|
+
try { window.close(); } catch (err) {}
|
|
260
|
+
setTimeout(function () { window.location.href = '/'; }, 80);
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
})();
|
|
264
|
+
</script>
|
|
265
|
+
</body>
|
|
266
|
+
</html>
|