foxclaw 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -29
- package/bin/foxclaw.cjs +51 -0
- package/index.js +11 -10
- package/package.json +46 -38
- package/python/.dockerignore +35 -0
- package/python/.env.example +165 -0
- package/python/.gitattributes +46 -0
- package/python/.github/workflows/ci.yml +122 -0
- package/python/.github/workflows/release.yml +183 -0
- package/python/Dockerfile +64 -0
- package/python/LICENSE +21 -0
- package/python/MANIFEST.in +14 -0
- package/python/README.md +192 -0
- package/python/README_CN.md +324 -0
- package/python/bench/bm25_audit.py +199 -0
- package/python/bench/bm25_regression.py +178 -0
- package/python/bench/bm25_stress.py +159 -0
- package/python/bench/cd_audit.py +238 -0
- package/python/bench/chaos.py +142 -0
- package/python/bench/concurrency.py +103 -0
- package/python/bench/e2e_real_models.py +95 -0
- package/python/bench/llm_retry_test.py +248 -0
- package/python/bench/load_test.py +196 -0
- package/python/bench/vector_ivf_upgrade.py +134 -0
- package/python/docs/CHANNELS.md +195 -0
- package/python/docs/GOVERNANCE.md +164 -0
- package/python/docs/RELEASE.md +109 -0
- package/python/docs/RUN.md +75 -0
- package/python/docs/RUN_CN.md +121 -0
- package/python/docs//351/205/215/347/275/256/346/214/207/345/215/227.md +152 -0
- package/python/evals/__init__.py +0 -0
- package/python/evals/governance/README.md +61 -0
- package/python/evals/governance/__init__.py +0 -0
- package/python/evals/governance/cases.py +152 -0
- package/python/evals/governance/compare_embeddings.py +94 -0
- package/python/evals/governance/convergence.svg +11 -0
- package/python/evals/governance/report.json +371 -0
- package/python/evals/governance/run_evals.py +400 -0
- package/python/examples/governance_middleware_demo.py +77 -0
- package/python/examples/langgraph_governance_demo.py +108 -0
- package/python/examples/sample_itinerary.csv +6 -0
- package/python/examples/sample_knowledge.csv +9 -0
- package/python/examples/sample_transactions.csv +14 -0
- package/python/foxclaw/__init__.py +526 -0
- package/python/foxclaw/agents/__init__.py +12 -0
- package/python/foxclaw/agents/agents.py +35 -0
- package/python/foxclaw/agents/base.py +865 -0
- package/python/foxclaw/agents/impl/__init__.py +1 -0
- package/python/foxclaw/agents/impl/_helpers.py +78 -0
- package/python/foxclaw/agents/impl/finance.py +248 -0
- package/python/foxclaw/agents/impl/office.py +367 -0
- package/python/foxclaw/agents/impl/supervisor.py +659 -0
- package/python/foxclaw/agents/mixins/_context.py +151 -0
- package/python/foxclaw/agents/mixins/augment.py +149 -0
- package/python/foxclaw/agents/mixins/llm.py +66 -0
- package/python/foxclaw/agents/mixins/memory.py +35 -0
- package/python/foxclaw/agents/mixins/preference.py +81 -0
- package/python/foxclaw/agents/mixins/prompt.py +77 -0
- package/python/foxclaw/agents/mixins/skillbox.py +58 -0
- package/python/foxclaw/agents/mixins/tool_exec.py +443 -0
- package/python/foxclaw/api/__init__.py +283 -0
- package/python/foxclaw/api/app.py +123 -0
- package/python/foxclaw/api/middleware.py +317 -0
- package/python/foxclaw/api/routes/ahs.py +417 -0
- package/python/foxclaw/api/routes/attachments.py +117 -0
- package/python/foxclaw/api/routes/browser.py +39 -0
- package/python/foxclaw/api/routes/domain.py +314 -0
- package/python/foxclaw/api/routes/knowledge.py +163 -0
- package/python/foxclaw/api/routes/llm_admin.py +461 -0
- package/python/foxclaw/api/routes/memory.py +89 -0
- package/python/foxclaw/api/routes/orchestration.py +41 -0
- package/python/foxclaw/api/routes/recovery.py +43 -0
- package/python/foxclaw/api/routes/review.py +275 -0
- package/python/foxclaw/api/routes/search.py +37 -0
- package/python/foxclaw/api/routes/system.py +327 -0
- package/python/foxclaw/api/routes/task.py +281 -0
- package/python/foxclaw/api/routes/ws.py +68 -0
- package/python/foxclaw/api/spine.py +55 -0
- package/python/foxclaw/browser/__init__.py +13 -0
- package/python/foxclaw/browser/action/__init__.py +1 -0
- package/python/foxclaw/browser/action/action_executor.py +54 -0
- package/python/foxclaw/browser/action/action_types.py +45 -0
- package/python/foxclaw/browser/action/action_verifier.py +68 -0
- package/python/foxclaw/browser/action/url_policy.py +147 -0
- package/python/foxclaw/browser/adapter/__init__.py +1 -0
- package/python/foxclaw/browser/adapter/base_adapter.py +23 -0
- package/python/foxclaw/browser/adapter/web_adapter.py +46 -0
- package/python/foxclaw/browser/driver/__init__.py +1 -0
- package/python/foxclaw/browser/driver/base_driver.py +61 -0
- package/python/foxclaw/browser/driver/playwright_driver.py +166 -0
- package/python/foxclaw/browser/perception/__init__.py +1 -0
- package/python/foxclaw/browser/perception/dom_extractor.py +43 -0
- package/python/foxclaw/browser/perception/element_indexer.py +57 -0
- package/python/foxclaw/browser/perception/semantic_reducer.py +33 -0
- package/python/foxclaw/browser/perception/snapshot.py +29 -0
- package/python/foxclaw/browser/service.py +148 -0
- package/python/foxclaw/browser/session/__init__.py +1 -0
- package/python/foxclaw/browser/session/session_manager.py +57 -0
- package/python/foxclaw/capability/__init__.py +12 -0
- package/python/foxclaw/capability/embedding_service.py +67 -0
- package/python/foxclaw/channels/__init__.py +140 -0
- package/python/foxclaw/channels/discord.py +184 -0
- package/python/foxclaw/channels/dispatcher.py +204 -0
- package/python/foxclaw/channels/feishu.py +225 -0
- package/python/foxclaw/channels/openclaw_bridge.py +156 -0
- package/python/foxclaw/channels/signing.py +187 -0
- package/python/foxclaw/channels/telegram.py +121 -0
- package/python/foxclaw/channels/weixin.py +225 -0
- package/python/foxclaw/cli.py +154 -0
- package/python/foxclaw/cognitive/__init__.py +4 -0
- package/python/foxclaw/cognitive/reasoner.py +82 -0
- package/python/foxclaw/cognitive/state.py +147 -0
- package/python/foxclaw/core/__init__.py +9 -0
- package/python/foxclaw/core/audit_chain.py +133 -0
- package/python/foxclaw/core/audit_sink.py +100 -0
- package/python/foxclaw/core/compaction.py +283 -0
- package/python/foxclaw/core/config.py +65 -0
- package/python/foxclaw/core/confirm_nonce.py +157 -0
- package/python/foxclaw/core/dispatch.py +27 -0
- package/python/foxclaw/core/envfile.py +48 -0
- package/python/foxclaw/core/failure_policy.py +151 -0
- package/python/foxclaw/core/gateway.py +85 -0
- package/python/foxclaw/core/governance_audit.py +175 -0
- package/python/foxclaw/core/idempotency.py +289 -0
- package/python/foxclaw/core/injection_guard.py +221 -0
- package/python/foxclaw/core/memory_adapter.py +516 -0
- package/python/foxclaw/core/metrics.py +89 -0
- package/python/foxclaw/core/model_router.py +1097 -0
- package/python/foxclaw/core/paths.py +103 -0
- package/python/foxclaw/core/recovery.py +362 -0
- package/python/foxclaw/core/scheduler.py +144 -0
- package/python/foxclaw/core/secrets.py +134 -0
- package/python/foxclaw/core/sessions.py +157 -0
- package/python/foxclaw/core/settings.py +430 -0
- package/python/foxclaw/core/shared_write.py +198 -0
- package/python/foxclaw/core/steering_queue.py +153 -0
- package/python/foxclaw/core/system_bus.py +84 -0
- package/python/foxclaw/core/thought_chain.py +318 -0
- package/python/foxclaw/core/token_meter.py +235 -0
- package/python/foxclaw/core/tools.py +172 -0
- package/python/foxclaw/core/tracing.py +390 -0
- package/python/foxclaw/core/truth_pipeline.py +114 -0
- package/python/foxclaw/core/vec_recall_adapter.py +503 -0
- package/python/foxclaw/core/verify.py +181 -0
- package/python/foxclaw/core/web_search.py +242 -0
- package/python/foxclaw/finance/__init__.py +15 -0
- package/python/foxclaw/finance/evidence.py +153 -0
- package/python/foxclaw/finance/fx.py +100 -0
- package/python/foxclaw/finance/graph.py +188 -0
- package/python/foxclaw/finance/models.py +150 -0
- package/python/foxclaw/finance/nlparse.py +575 -0
- package/python/foxclaw/finance/policy.py +329 -0
- package/python/foxclaw/finance/reasoner.py +129 -0
- package/python/foxclaw/finance/reasoning.py +340 -0
- package/python/foxclaw/finance/reconcile.py +180 -0
- package/python/foxclaw/finance/runtime.py +527 -0
- package/python/foxclaw/governance/__init__.py +24 -0
- package/python/foxclaw/governance/middleware.py +184 -0
- package/python/foxclaw/harness/__init__.py +17 -0
- package/python/foxclaw/harness/_base.py +72 -0
- package/python/foxclaw/harness/_policy.py +359 -0
- package/python/foxclaw/harness/drift.py +89 -0
- package/python/foxclaw/harness/event_bus.py +31 -0
- package/python/foxclaw/harness/harness.py +446 -0
- package/python/foxclaw/harness/loop_detection.py +152 -0
- package/python/foxclaw/itinerary/__init__.py +10 -0
- package/python/foxclaw/itinerary/amap_client.py +117 -0
- package/python/foxclaw/itinerary/models.py +80 -0
- package/python/foxclaw/itinerary/reasoner.py +101 -0
- package/python/foxclaw/itinerary/reasoning.py +174 -0
- package/python/foxclaw/itinerary/runtime.py +148 -0
- package/python/foxclaw/kernel/__init__.py +13 -0
- package/python/foxclaw/kernel/capabilities.py +73 -0
- package/python/foxclaw/kernel/policy_gate.py +114 -0
- package/python/foxclaw/kernel/process_manager.py +205 -0
- package/python/foxclaw/kernel/scheduler.py +131 -0
- package/python/foxclaw/kernel/sentinel.py +453 -0
- package/python/foxclaw/kernel/sentinel_client.py +246 -0
- package/python/foxclaw/kernel/spine.py +97 -0
- package/python/foxclaw/knowledge/__init__.py +376 -0
- package/python/foxclaw/knowledge/truth_crystallizer.py +92 -0
- package/python/foxclaw/learning/__init__.py +12 -0
- package/python/foxclaw/learning/knowledge_graph.py +149 -0
- package/python/foxclaw/learning/models.py +93 -0
- package/python/foxclaw/learning/reasoner.py +70 -0
- package/python/foxclaw/learning/runtime.py +363 -0
- package/python/foxclaw/learning/spaced_repetition.py +96 -0
- package/python/foxclaw/mcp_server.py +189 -0
- package/python/foxclaw/orchestration/__init__.py +184 -0
- package/python/foxclaw/pipeline/__init__.py +23 -0
- package/python/foxclaw/pipeline/cognitive_pipeline.py +481 -0
- package/python/foxclaw/pipeline/supervisor_stages.py +230 -0
- package/python/foxclaw/planning/__init__.py +17 -0
- package/python/foxclaw/planning/llm_planner.py +232 -0
- package/python/foxclaw/planning/planner.py +99 -0
- package/python/foxclaw/search/__init__.py +24 -0
- package/python/foxclaw/search/agent_port.py +194 -0
- package/python/foxclaw/search/evidence.py +113 -0
- package/python/foxclaw/search/external_search.py +50 -0
- package/python/foxclaw/search/hkc_read_port.py +60 -0
- package/python/foxclaw/search/internal_search.py +73 -0
- package/python/foxclaw/search/models.py +129 -0
- package/python/foxclaw/search/planner.py +44 -0
- package/python/foxclaw/search/retriever.py +39 -0
- package/python/foxclaw/search/runtime.py +134 -0
- package/python/foxclaw/search/strategy.py +44 -0
- package/python/foxclaw/skills/__init__.py +613 -0
- package/python/foxclaw/skills/hooks_spec.py +73 -0
- package/python/foxclaw/skills/lifecycle.py +278 -0
- package/python/foxclaw/skills/markdown_skill.py +174 -0
- package/python/foxclaw/skills/markdown_store.py +39 -0
- package/python/foxclaw/skills/mcp_client.py +190 -0
- package/python/foxclaw/skills/mcp_store.py +43 -0
- package/python/foxclaw/skills/permission.py +180 -0
- package/python/foxclaw/skills/pipeline.py +386 -0
- package/python/foxclaw/skills/policy.py +80 -0
- package/python/foxclaw/skills/review.py +72 -0
- package/python/foxclaw/skills/store.py +57 -0
- package/python/frontend/assets/core_bg.jpg +0 -0
- package/python/frontend/deck/auth.js +32 -0
- package/python/frontend/deck/chat_model_picker.js +537 -0
- package/python/frontend/deck/domain.js +296 -0
- package/python/frontend/deck/main.js +1950 -0
- package/python/frontend/deck/markdown.js +48 -0
- package/python/frontend/deck/settings.js +324 -0
- package/python/frontend/deck/state.js +6 -0
- package/python/frontend/deck/util.js +6 -0
- package/python/frontend/deck/visuals.js +212 -0
- package/python/frontend/deck.css +855 -0
- package/python/frontend/deck.html +686 -0
- package/python/frontend/deck_v2.html +341 -0
- package/python/frontend/planet/index.html +266 -0
- package/python/frontend/planet/planet.css +579 -0
- package/python/frontend/planet/planet.js +1637 -0
- package/python/frontend/planet/vendor/three.core.min.js +6 -0
- package/python/frontend/planet/vendor/three.module.min.js +6 -0
- package/python/frontend/v3/assets/index-BD7VPbMV.js +33 -0
- package/python/frontend/v3/assets/index-CAvnYWGH.css +1 -0
- package/python/frontend/v3/index.html +15 -0
- package/python/frontend/widget_runtime.js +295 -0
- package/python/frontend/widgets.js +696 -0
- package/python/frontend_src/index.html +14 -0
- package/python/frontend_src/package-lock.json +1376 -0
- package/python/frontend_src/package.json +19 -0
- package/python/frontend_src/src/App.vue +62 -0
- package/python/frontend_src/src/api.js +89 -0
- package/python/frontend_src/src/components/ChatDock.vue +377 -0
- package/python/frontend_src/src/components/ComposerMenu.vue +75 -0
- package/python/frontend_src/src/components/DocViewer.vue +171 -0
- package/python/frontend_src/src/components/Inspector.vue +241 -0
- package/python/frontend_src/src/components/LeftRail.vue +394 -0
- package/python/frontend_src/src/components/MenuPopover.vue +130 -0
- package/python/frontend_src/src/components/MessageStream.vue +401 -0
- package/python/frontend_src/src/components/ModelPicker.vue +355 -0
- package/python/frontend_src/src/components/QuickIngest.vue +118 -0
- package/python/frontend_src/src/components/Stage.vue +226 -0
- package/python/frontend_src/src/components/ToolMenu.vue +144 -0
- package/python/frontend_src/src/components/TopBar.vue +90 -0
- package/python/frontend_src/src/components/panels/ActivityPanel.vue +84 -0
- package/python/frontend_src/src/components/panels/AgentsPanel.vue +86 -0
- package/python/frontend_src/src/components/panels/KnowledgePanel.vue +441 -0
- package/python/frontend_src/src/components/panels/MemoryPanel.vue +118 -0
- package/python/frontend_src/src/components/panels/PanelBox.vue +51 -0
- package/python/frontend_src/src/components/panels/ReviewPanel.vue +308 -0
- package/python/frontend_src/src/components/panels/SettingsPanel.vue +254 -0
- package/python/frontend_src/src/components/panels/TasksPanel.vue +74 -0
- package/python/frontend_src/src/components/panels/ToolsPanel.vue +640 -0
- package/python/frontend_src/src/components/panels/UsagePanel.vue +105 -0
- package/python/frontend_src/src/lib/fmt.js +48 -0
- package/python/frontend_src/src/lib/md.js +204 -0
- package/python/frontend_src/src/main.js +7 -0
- package/python/frontend_src/src/stores/app.js +106 -0
- package/python/frontend_src/src/stores/chat.js +484 -0
- package/python/frontend_src/src/stores/model.js +104 -0
- package/python/frontend_src/src/stores/panels.js +330 -0
- package/python/frontend_src/src/styles/base.css +138 -0
- package/python/frontend_src/src/styles/panel.css +117 -0
- package/python/frontend_src/src/styles/tokens.css +78 -0
- package/python/frontend_src/vite.config.js +46 -0
- package/python/pyproject.toml +265 -0
- package/python/skills/README.md +123 -0
- package/python/skills/execution-contract/SKILL.md +30 -0
- package/python/skills/general-assistant/SKILL.md +34 -0
- package/python/skills/planner/SKILL.md +33 -0
- package/python/skills/schedule-itinerary/SKILL.md +35 -0
- package/python/skills/skill-composition/SKILL.md +31 -0
- package/python/skills/skill-guard/SKILL.md +67 -0
- package/python/skills/skill-memory/SKILL.md +50 -0
- package/python/skills/skill-router/SKILL.md +35 -0
- package/python/tests/conftest.py +76 -0
- package/python/tests/run_all.py +263 -0
- package/python/tests/test_agent_lifecycle.py +360 -0
- package/python/tests/test_ahs_p2.py +414 -0
- package/python/tests/test_anthropic_tools.py +206 -0
- package/python/tests/test_api.py +87 -0
- package/python/tests/test_api_auth.py +83 -0
- package/python/tests/test_api_host_guard.py +69 -0
- package/python/tests/test_attachments.py +167 -0
- package/python/tests/test_audit_chain.py +121 -0
- package/python/tests/test_audit_sink.py +136 -0
- package/python/tests/test_browser.py +153 -0
- package/python/tests/test_browser_request_guard.py +184 -0
- package/python/tests/test_capabilities.py +158 -0
- package/python/tests/test_channel_signing.py +192 -0
- package/python/tests/test_channel_trust.py +109 -0
- package/python/tests/test_channels.py +184 -0
- package/python/tests/test_cli.py +46 -0
- package/python/tests/test_compaction_toolpair.py +119 -0
- package/python/tests/test_config_layering.py +65 -0
- package/python/tests/test_confirm_nonce.py +197 -0
- package/python/tests/test_context_compaction_wiring.py +130 -0
- package/python/tests/test_dispatch.py +95 -0
- package/python/tests/test_domain_evals.py +403 -0
- package/python/tests/test_domain_import.py +78 -0
- package/python/tests/test_domain_reasoners.py +148 -0
- package/python/tests/test_e2e.py +178 -0
- package/python/tests/test_emb_cache.py +107 -0
- package/python/tests/test_embedding_singleton.py +89 -0
- package/python/tests/test_envfile.py +83 -0
- package/python/tests/test_evals_smoke.py +114 -0
- package/python/tests/test_event_spine.py +182 -0
- package/python/tests/test_evidence_semantic.py +101 -0
- package/python/tests/test_evidence_sse.py +97 -0
- package/python/tests/test_file_ingest.py +146 -0
- package/python/tests/test_finance.py +153 -0
- package/python/tests/test_finance_ledger.py +252 -0
- package/python/tests/test_finance_persist.py +178 -0
- package/python/tests/test_gateway.py +144 -0
- package/python/tests/test_governance.py +468 -0
- package/python/tests/test_governance_audit.py +359 -0
- package/python/tests/test_governance_middleware.py +143 -0
- package/python/tests/test_hkc.py +286 -0
- package/python/tests/test_hkc_index_build_manager.py +339 -0
- package/python/tests/test_hkc_manifest_reuse.py +317 -0
- package/python/tests/test_hkc_search_event_sync.py +533 -0
- package/python/tests/test_import_path_guard.py +161 -0
- package/python/tests/test_injection_guard.py +211 -0
- package/python/tests/test_integration.py +141 -0
- package/python/tests/test_itinerary.py +103 -0
- package/python/tests/test_kee_semantic.py +89 -0
- package/python/tests/test_kernel.py +222 -0
- package/python/tests/test_learning.py +110 -0
- package/python/tests/test_llm_admin.py +160 -0
- package/python/tests/test_llm_planner.py +366 -0
- package/python/tests/test_markdown_skills.py +73 -0
- package/python/tests/test_markdown_skills_openclaw.py +71 -0
- package/python/tests/test_mcp_connectors.py +109 -0
- package/python/tests/test_mcp_guardian_discovery.py +91 -0
- package/python/tests/test_mcp_no_memory.py +43 -0
- package/python/tests/test_mcp_policy_gate.py +77 -0
- package/python/tests/test_mcp_server.py +95 -0
- package/python/tests/test_memory_recall.py +95 -0
- package/python/tests/test_metrics.py +66 -0
- package/python/tests/test_multi_chain.py +102 -0
- package/python/tests/test_multimodal.py +135 -0
- package/python/tests/test_negotiation.py +146 -0
- package/python/tests/test_orchestration.py +119 -0
- package/python/tests/test_orchestration_decoupled.py +109 -0
- package/python/tests/test_p3_p5_hardening.py +338 -0
- package/python/tests/test_parallel_dispatch.py +215 -0
- package/python/tests/test_pipeline.py +533 -0
- package/python/tests/test_plan_visible.py +86 -0
- package/python/tests/test_planner.py +95 -0
- package/python/tests/test_policy_gate.py +109 -0
- package/python/tests/test_reasoner.py +185 -0
- package/python/tests/test_release_check.py +263 -0
- package/python/tests/test_resume_checkpoint.py +156 -0
- package/python/tests/test_routing.py +95 -0
- package/python/tests/test_scheduler.py +141 -0
- package/python/tests/test_search.py +204 -0
- package/python/tests/test_secrets.py +159 -0
- package/python/tests/test_semantic.py +78 -0
- package/python/tests/test_sessions.py +91 -0
- package/python/tests/test_settings.py +281 -0
- package/python/tests/test_shadow_learning.py +330 -0
- package/python/tests/test_shared_write.py +207 -0
- package/python/tests/test_skill_taint_gate.py +154 -0
- package/python/tests/test_skills.py +133 -0
- package/python/tests/test_stats_and_events.py +165 -0
- package/python/tests/test_streaming.py +60 -0
- package/python/tests/test_supervisor_pipeline.py +177 -0
- package/python/tests/test_supervisor_triage.py +108 -0
- package/python/tests/test_taint.py +117 -0
- package/python/tests/test_task_stream.py +85 -0
- package/python/tests/test_thinking_sse.py +67 -0
- package/python/tests/test_thinking_stream.py +76 -0
- package/python/tests/test_tool_center.py +129 -0
- package/python/tests/test_tool_parallel.py +113 -0
- package/python/tests/test_tool_params.py +103 -0
- package/python/tests/test_tool_use.py +242 -0
- package/python/tests/test_toplevel_concurrency.py +117 -0
- package/python/tests/test_tracing.py +290 -0
- package/python/tests/test_truth_crystallizer.py +127 -0
- package/python/tests/test_truth_flow.py +93 -0
- package/python/tests/test_url_policy.py +53 -0
- package/python/tests/test_verify_evidence.py +225 -0
- package/python/tests/test_version_sync.py +71 -0
- package/python/tests/test_web_trigger.py +99 -0
- package/python/tools/check_faiss_type.py +31 -0
- package/python/tools/check_log.ps1 +46 -0
- package/python/tools/ivf_status.py +72 -0
- package/python/tools/mypy_baseline.txt +5 -0
- package/python/tools/mypy_ratchet.py +97 -0
- package/python/tools/pack.py +178 -0
- package/python/tools/release_check.py +349 -0
- package/python/tools/restart_foxclaw.ps1 +74 -0
- package/python/tools/shared_write_audit.py +204 -0
- package/python/tools/size_baseline.txt +28 -0
- package/python/tools/size_check.py +102 -0
- package/python/tools/verify_env.bat +2 -0
- package/python/tools/verify_env.py +25 -0
- package/python/vendor/HMR_LICENSE +37 -0
- package/python/vendor/HMR_README.md +65 -0
- package/python/vendor/hkc/LICENSE +37 -0
- package/python/vendor/hkc/hkc_ace/__init__.py +0 -0
- package/python/vendor/hkc/hkc_ace/ace.py +457 -0
- package/python/vendor/hkc/hkc_ace/skill_taxonomy.json +465 -0
- package/python/vendor/hkc/hkc_api/__init__.py +0 -0
- package/python/vendor/hkc/hkc_api/container.py +416 -0
- package/python/vendor/hkc/hkc_api/ingest_jobs.py +103 -0
- package/python/vendor/hkc/hkc_api/main.py +157 -0
- package/python/vendor/hkc/hkc_api/routes/__init__.py +0 -0
- package/python/vendor/hkc/hkc_api/routes/ability.py +151 -0
- package/python/vendor/hkc/hkc_api/routes/config.py +51 -0
- package/python/vendor/hkc/hkc_api/routes/knowledge.py +630 -0
- package/python/vendor/hkc/hkc_api/routes/search.py +88 -0
- package/python/vendor/hkc/hkc_api/schemas.py +153 -0
- package/python/vendor/hkc/hkc_api/synthesis.py +179 -0
- package/python/vendor/hkc/hkc_core/__init__.py +0 -0
- package/python/vendor/hkc/hkc_core/graph/__init__.py +0 -0
- package/python/vendor/hkc/hkc_core/graph/base.py +188 -0
- package/python/vendor/hkc/hkc_core/graph/sqlite_store.py +789 -0
- package/python/vendor/hkc/hkc_core/models/__init__.py +0 -0
- package/python/vendor/hkc/hkc_core/models/enums.py +65 -0
- package/python/vendor/hkc/hkc_core/models/ku.py +307 -0
- package/python/vendor/hkc/hkc_core/utils/__init__.py +0 -0
- package/python/vendor/hkc/hkc_core/utils/id_gen.py +113 -0
- package/python/vendor/hkc/hkc_crystallizer/__init__.py +44 -0
- package/python/vendor/hkc/hkc_crystallizer/adapters.py +94 -0
- package/python/vendor/hkc/hkc_crystallizer/candidate.py +145 -0
- package/python/vendor/hkc/hkc_crystallizer/crystallizer.py +179 -0
- package/python/vendor/hkc/hkc_crystallizer/ingress.py +90 -0
- package/python/vendor/hkc/hkc_kde/__init__.py +0 -0
- package/python/vendor/hkc/hkc_kde/chunker.py +197 -0
- package/python/vendor/hkc/hkc_kde/extractor.py +623 -0
- package/python/vendor/hkc/hkc_kde/kde.py +298 -0
- package/python/vendor/hkc/hkc_kde/loaders/__init__.py +0 -0
- package/python/vendor/hkc/hkc_kde/loaders/ebook_loader.py +153 -0
- package/python/vendor/hkc/hkc_kde/loaders/office_loader.py +194 -0
- package/python/vendor/hkc/hkc_kde/loaders/pdf_loader.py +162 -0
- package/python/vendor/hkc/hkc_kde/loaders/text_loader.py +157 -0
- package/python/vendor/hkc/hkc_kde/loaders/web_loader.py +91 -0
- package/python/vendor/hkc/hkc_kde/models.py +74 -0
- package/python/vendor/hkc/hkc_kde/packager.py +329 -0
- package/python/vendor/hkc/hkc_kde/relation_disc.py +151 -0
- package/python/vendor/hkc/hkc_kee/__init__.py +0 -0
- package/python/vendor/hkc/hkc_kee/dedup.py +227 -0
- package/python/vendor/hkc/hkc_kee/fingerprint.py +106 -0
- package/python/vendor/hkc/hkc_kee/kee.py +541 -0
- package/python/vendor/hkc/hkc_kep/__init__.py +0 -0
- package/python/vendor/hkc/hkc_kep/event_bus.py +205 -0
- package/python/vendor/hkc/hkc_sdk/__init__.py +63 -0
- package/python/vendor/hkc/hkc_sdk/base.py +151 -0
- package/python/vendor/hkc/hkc_sdk/direct_client.py +153 -0
- package/python/vendor/hkc/hkc_sdk/exceptions.py +39 -0
- package/python/vendor/hkc/hkc_sdk/http_client.py +166 -0
- package/python/vendor/hkc/hkc_sdk/models.py +171 -0
- package/python/vendor/hkc/hkc_search/__init__.py +0 -0
- package/python/vendor/hkc/hkc_search/bm25.py +325 -0
- package/python/vendor/hkc/hkc_search/embedding_backends.py +374 -0
- package/python/vendor/hkc/hkc_search/graph_search.py +132 -0
- package/python/vendor/hkc/hkc_search/hybrid.py +331 -0
- package/python/vendor/hkc/hkc_search/index_build_manager.py +378 -0
- package/python/vendor/hkc/hkc_search/vector_search.py +484 -0
- package/python/vendor/hmr/__init__.py +0 -0
- package/python/vendor/hmr/core/__init__.py +0 -0
- package/python/vendor/hmr/core/hmr.py +684 -0
- package/python/vendor/hmr/core/models.py +310 -0
- package/python/vendor/hmr/engines/__init__.py +0 -0
- package/python/vendor/hmr/engines/evolution.py +710 -0
- package/python/vendor/hmr/engines/jit_compiler.py +472 -0
- package/python/vendor/hmr/engines/lifecycle.py +264 -0
- package/python/vendor/hmr/engines/policy.py +625 -0
- package/python/vendor/hmr/engines/recall.py +260 -0
- package/python/vendor/hmr/engines/runtime_state.py +158 -0
- package/python/vendor/hmr/engines/scheduler.py +323 -0
- package/python/vendor/hmr/engines/semantic.py +150 -0
- package/python/vendor/hmr/engines/temporal.py +261 -0
- package/python/vendor/hmr/engines/thought_chain.py +635 -0
- package/python/vendor/hmr/graph/__init__.py +0 -0
- package/python/vendor/hmr/graph/cwg.py +338 -0
- package/python/vendor/hmr/graph/memory_graph.py +530 -0
- package/python/vendor/hmr/storage/__init__.py +0 -0
- package/python/vendor/hmr/storage/memory_fs.py +300 -0
- package/python/vendor/hmr/storage/vector_store.py +520 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { mdToHTML } from '../lib/md.js'
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
doc: { type: Object, required: true },
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
const lines = computed(() =>
|
|
10
|
+
(props.doc.content || '').replace(/\n$/, '').split('\n')
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
/* 文字版正文走 lib/md.js 的共用渲染器:技能 SKILL.md 与记忆摘要都带
|
|
14
|
+
# / ** / - / > / ```,这里原来自带一套只认前四样,代码块原样倒出来。 */
|
|
15
|
+
const readHTML = computed(() => mdToHTML(props.doc.content))
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<!-- 代码 → CLI 皮肤:暗色、等宽、行号、横向滚动。整栏不变暗,只有正文块变暗。 -->
|
|
20
|
+
<div v-if="doc.kind === 'code'" class="cli">
|
|
21
|
+
<div class="term-bar">
|
|
22
|
+
<span class="tl" /><span class="tl" /><span class="tl" />
|
|
23
|
+
<code class="path">{{ doc.path }}</code>
|
|
24
|
+
<span class="lang">{{ doc.lang }}</span>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="term-body scroll">
|
|
27
|
+
<div v-for="(l, i) in lines" :key="i" class="row">
|
|
28
|
+
<span class="no">{{ i + 1 }}</span>
|
|
29
|
+
<span class="code">{{ l || ' ' }}</span>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<!-- 文字 → 阅读版:衬线正文、68ch 行宽、留白优先 -->
|
|
35
|
+
<article v-else class="read scroll">
|
|
36
|
+
<header class="read-head">
|
|
37
|
+
<h2>{{ doc.title }}</h2>
|
|
38
|
+
<div class="read-meta">
|
|
39
|
+
<span v-if="doc.meta">{{ doc.meta }}</span>
|
|
40
|
+
<code v-if="doc.path">{{ doc.path }}</code>
|
|
41
|
+
</div>
|
|
42
|
+
</header>
|
|
43
|
+
<div class="read-body md" v-html="readHTML" />
|
|
44
|
+
</article>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<style scoped>
|
|
48
|
+
/* ═══ CLI 皮肤 ═══ */
|
|
49
|
+
.cli {
|
|
50
|
+
flex: 1; min-width: 0; display: flex; flex-direction: column;
|
|
51
|
+
margin: 8px; border-radius: var(--r-mid); overflow: hidden;
|
|
52
|
+
background: var(--cli-bg);
|
|
53
|
+
border: 1px solid rgba(255, 255, 255, 0.06);
|
|
54
|
+
box-shadow: 0 18px 44px rgba(11, 15, 10, 0.34);
|
|
55
|
+
}
|
|
56
|
+
.term-bar {
|
|
57
|
+
display: flex; align-items: center; gap: 6px; flex-shrink: 0;
|
|
58
|
+
padding: 9px 12px;
|
|
59
|
+
background: var(--cli-bg-2);
|
|
60
|
+
border-bottom: 1px solid var(--cli-line);
|
|
61
|
+
}
|
|
62
|
+
.tl { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
|
|
63
|
+
.tl:first-child { background: rgba(255, 104, 92, 0.62); }
|
|
64
|
+
.tl:nth-child(2) { background: rgba(226, 192, 122, 0.62); }
|
|
65
|
+
.tl:nth-child(3) { background: rgba(127, 224, 140, 0.58); }
|
|
66
|
+
.term-bar .path {
|
|
67
|
+
margin-left: 8px; font-family: var(--mono); font-size: 11.5px;
|
|
68
|
+
color: var(--cli-dim);
|
|
69
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
70
|
+
}
|
|
71
|
+
.term-bar .lang {
|
|
72
|
+
margin-left: auto; flex-shrink: 0;
|
|
73
|
+
font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
|
|
74
|
+
color: var(--cli-bg); background: var(--cli-acc);
|
|
75
|
+
padding: 2px 8px; border-radius: var(--r-pill);
|
|
76
|
+
}
|
|
77
|
+
.term-body {
|
|
78
|
+
flex: 1; overflow: auto; padding: 10px 0 16px;
|
|
79
|
+
font-family: var(--mono); font-size: 12.5px; line-height: 1.72;
|
|
80
|
+
}
|
|
81
|
+
.term-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); }
|
|
82
|
+
.row { display: flex; white-space: pre; }
|
|
83
|
+
.row:hover { background: rgba(255, 255, 255, 0.035); }
|
|
84
|
+
.no {
|
|
85
|
+
flex-shrink: 0; width: 48px; text-align: right; padding-right: 14px;
|
|
86
|
+
color: rgba(255, 255, 255, 0.42); user-select: none;
|
|
87
|
+
}
|
|
88
|
+
.code { color: var(--cli-ink); padding-right: 24px; }
|
|
89
|
+
|
|
90
|
+
/* ═══ 阅读皮肤 ═══ */
|
|
91
|
+
.read { flex: 1; overflow-y: auto; padding: 34px 8px 60px; }
|
|
92
|
+
.read-head, .read-body { max-width: 68ch; margin: 0 auto; }
|
|
93
|
+
.read-head { padding: 0 20px 18px; border-bottom: 1px solid var(--line-soft); }
|
|
94
|
+
.read-head h2 {
|
|
95
|
+
font-family: var(--serif);
|
|
96
|
+
font-size: 23px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.4;
|
|
97
|
+
}
|
|
98
|
+
.read-meta {
|
|
99
|
+
display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
|
|
100
|
+
margin-top: 8px; font-size: 11.5px; color: var(--dim);
|
|
101
|
+
}
|
|
102
|
+
.read-meta code { font-family: var(--mono); font-size: 11.5px; color: var(--ink); }
|
|
103
|
+
.read-body { padding: 20px 20px 0; }
|
|
104
|
+
/* 正文是 v-html 生成的,没有 scoped 属性,必须 :deep */
|
|
105
|
+
.read-body :deep(p) {
|
|
106
|
+
font-family: var(--serif);
|
|
107
|
+
font-size: 15px; line-height: 1.92; color: #24302a;
|
|
108
|
+
margin-bottom: 15px;
|
|
109
|
+
text-align: justify;
|
|
110
|
+
}
|
|
111
|
+
.read-body :deep(h3),
|
|
112
|
+
.read-body :deep(h4),
|
|
113
|
+
.read-body :deep(h5) {
|
|
114
|
+
font-family: var(--serif);
|
|
115
|
+
color: var(--ink); line-height: 1.5;
|
|
116
|
+
margin: 22px 0 8px;
|
|
117
|
+
}
|
|
118
|
+
.read-body :deep(h3) { font-size: 18px; font-weight: 650; }
|
|
119
|
+
.read-body :deep(h4) { font-size: 15.5px; font-weight: 600; }
|
|
120
|
+
.read-body :deep(h5) {
|
|
121
|
+
font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
|
|
122
|
+
color: var(--dim); text-transform: uppercase;
|
|
123
|
+
}
|
|
124
|
+
.read-body :deep(ul) { margin: 0 0 15px; padding-left: 18px; }
|
|
125
|
+
.read-body :deep(li) {
|
|
126
|
+
font-family: var(--serif);
|
|
127
|
+
font-size: 14.5px; line-height: 1.85; color: #24302a;
|
|
128
|
+
margin-bottom: 5px;
|
|
129
|
+
}
|
|
130
|
+
.read-body :deep(li::marker) { color: var(--faint); }
|
|
131
|
+
.read-body :deep(blockquote) {
|
|
132
|
+
margin: 0 0 15px; padding: 8px 14px;
|
|
133
|
+
border-left: 2px solid var(--line);
|
|
134
|
+
font-family: var(--serif); font-size: 14px; line-height: 1.85; color: var(--dim);
|
|
135
|
+
}
|
|
136
|
+
.read-body :deep(hr) { margin: 20px 0; border: 0; border-top: 1px solid var(--line-soft); }
|
|
137
|
+
.read-body :deep(strong) { font-weight: 650; color: #16201b; }
|
|
138
|
+
.read-body :deep(code) {
|
|
139
|
+
font-family: var(--mono); font-size: 12px;
|
|
140
|
+
padding: 1px 5px; border-radius: 4px;
|
|
141
|
+
background: rgba(26, 157, 95, 0.09); color: var(--green);
|
|
142
|
+
}
|
|
143
|
+
.read-body :deep(a) { color: var(--green); border-bottom: 1px solid rgba(26, 157, 95, 0.3); }
|
|
144
|
+
.read-body :deep(ol) { margin: 0 0 15px; padding-left: 20px; }
|
|
145
|
+
.read-body :deep(h2) {
|
|
146
|
+
font-family: var(--serif);
|
|
147
|
+
font-size: 20px; font-weight: 650; line-height: 1.5;
|
|
148
|
+
color: var(--ink);
|
|
149
|
+
margin: 26px 0 10px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* 代码块:md.js 现在真会把 ``` 渲染成 <pre><code>,以前是整段原样倒出来 */
|
|
153
|
+
.read-body :deep(pre) {
|
|
154
|
+
margin: 0 0 15px; padding: 11px 13px;
|
|
155
|
+
background: var(--cli-bg); border-radius: var(--r-sm);
|
|
156
|
+
overflow-x: auto;
|
|
157
|
+
}
|
|
158
|
+
.read-body :deep(pre code) {
|
|
159
|
+
padding: 0; background: none; color: var(--cli-ink);
|
|
160
|
+
font-size: 12px; line-height: 1.72;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* 表格 */
|
|
164
|
+
.read-body :deep(table) { width: 100%; border-collapse: collapse; margin: 0 0 15px; }
|
|
165
|
+
.read-body :deep(th),
|
|
166
|
+
.read-body :deep(td) {
|
|
167
|
+
padding: 6px 10px; border-bottom: 1px solid var(--line-soft);
|
|
168
|
+
font-size: 13px; text-align: left; vertical-align: top;
|
|
169
|
+
}
|
|
170
|
+
.read-body :deep(th) { font-size: 11.5px; font-weight: 600; color: var(--dim); }
|
|
171
|
+
</style>
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, onMounted } from 'vue'
|
|
3
|
+
import QuickIngest from './QuickIngest.vue'
|
|
4
|
+
import { state, loadProgress, closeDoc, setModule } from '../stores/app.js'
|
|
5
|
+
import { panels, loadPanel, openKu, startReview } from '../stores/panels.js'
|
|
6
|
+
import { fmtTime } from '../lib/fmt.js'
|
|
7
|
+
|
|
8
|
+
/* 右栏三块数据与对应面板共用同一份,进来就保证已加载 */
|
|
9
|
+
onMounted(() => {
|
|
10
|
+
loadProgress()
|
|
11
|
+
loadPanel('knowledge')
|
|
12
|
+
loadPanel('review')
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const doc = computed(() => state.doc)
|
|
16
|
+
const kb = panels.knowledge
|
|
17
|
+
const rv = panels.review
|
|
18
|
+
|
|
19
|
+
/* 今日待办 = 到期 + 新卡(SM-2 队列就是这个口径) */
|
|
20
|
+
const reviewTodo = computed(() => (rv.stats.due || 0) + (rv.stats.fresh || 0))
|
|
21
|
+
const masteryPct = computed(() => Math.round((rv.stats.avg_mastery || 0) * 100))
|
|
22
|
+
|
|
23
|
+
function goReview() {
|
|
24
|
+
state.railMode = 'progress'
|
|
25
|
+
setModule('review')
|
|
26
|
+
startReview()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* 右栏只留 10 条,多的走「更多」到知识库面板看全量 */
|
|
30
|
+
const LIMIT = 10
|
|
31
|
+
const recentKb = computed(() => kb.recent.slice(0, LIMIT))
|
|
32
|
+
const kbMore = computed(() => kb.recentTotal > recentKb.value.length)
|
|
33
|
+
|
|
34
|
+
function moreKb() {
|
|
35
|
+
state.railMode = 'progress'
|
|
36
|
+
setModule('knowledge')
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* 大纲:代码取顶层定义,文字取段落首句。P2 换成真解析 */
|
|
40
|
+
const outline = computed(() => {
|
|
41
|
+
const d = doc.value
|
|
42
|
+
if (!d) return []
|
|
43
|
+
const src = d.content || ''
|
|
44
|
+
if (d.kind === 'code') {
|
|
45
|
+
return src
|
|
46
|
+
.split('\n')
|
|
47
|
+
.filter((l) => /^(def |class |async def |function |export )/.test(l))
|
|
48
|
+
.map((l) => l.replace(/\s*[({].*$/, '').trim())
|
|
49
|
+
.slice(0, 12)
|
|
50
|
+
}
|
|
51
|
+
return src
|
|
52
|
+
.split(/\n{2,}/)
|
|
53
|
+
.map((s) => s.trim())
|
|
54
|
+
.filter(Boolean)
|
|
55
|
+
.slice(0, 6)
|
|
56
|
+
.map((s) => (s.length > 26 ? s.slice(0, 26) + '…' : s))
|
|
57
|
+
})
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<template>
|
|
61
|
+
<aside class="col col--right rail-right">
|
|
62
|
+
<div class="head">
|
|
63
|
+
<div class="seg">
|
|
64
|
+
<button :class="{ on: state.railMode === 'progress' }" @click="state.railMode = 'progress'">进度</button>
|
|
65
|
+
<button :class="{ on: state.railMode === 'context' }" @click="state.railMode = 'context'">
|
|
66
|
+
上下文<span v-if="doc" class="pip" />
|
|
67
|
+
</button>
|
|
68
|
+
</div>
|
|
69
|
+
<button class="collapse" title="收起检视栏" @click="state.railOpen = false">⟩</button>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div v-if="state.railMode === 'progress'" class="body scroll">
|
|
73
|
+
<QuickIngest />
|
|
74
|
+
|
|
75
|
+
<section class="sec">
|
|
76
|
+
<div class="sec-h">学习 <em>SM-2</em></div>
|
|
77
|
+
<div class="kpi">
|
|
78
|
+
<div><b>{{ rv.stats.due }}</b><span>今日到期</span></div>
|
|
79
|
+
<div><b>{{ rv.stats.fresh }}</b><span>新卡</span></div>
|
|
80
|
+
<div><b>{{ masteryPct }}%</b><span>平均掌握</span></div>
|
|
81
|
+
<div><b>{{ rv.stats.risk.length }}</b><span>遗忘风险</span></div>
|
|
82
|
+
</div>
|
|
83
|
+
<div v-if="rv.state === 'error'" class="empty">后端未连接</div>
|
|
84
|
+
<template v-else>
|
|
85
|
+
<button class="go" :disabled="!reviewTodo" @click="goReview">
|
|
86
|
+
{{ reviewTodo ? `开始复习 ${reviewTodo} 张` : '今天没有要复习的' }}
|
|
87
|
+
</button>
|
|
88
|
+
<div v-if="!rv.stats.cards" class="empty">录入的知识会自动变成复习卡</div>
|
|
89
|
+
</template>
|
|
90
|
+
</section>
|
|
91
|
+
<section class="sec">
|
|
92
|
+
<div class="sec-h">办公 <em>OfficeAgent</em></div>
|
|
93
|
+
<div class="kpi">
|
|
94
|
+
<div><b>{{ state.officeStats.waypoints }}</b><span>行程点</span></div>
|
|
95
|
+
<div><b>{{ state.officeStats.conflicts }}</b><span>行程冲突</span></div>
|
|
96
|
+
<div><b>{{ state.officeStats.alerts }}</b><span>告警</span></div>
|
|
97
|
+
<div><b>{{ state.officeStats.active }}</b><span>进行中</span></div>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="sub-h">最近知识 <em>{{ kb.recentTotal }}</em></div>
|
|
100
|
+
<div v-if="kb.state === 'error'" class="empty">后端未连接</div>
|
|
101
|
+
<template v-else>
|
|
102
|
+
<button v-for="k in recentKb" :key="k.ku_id" class="row" :title="k.summary || k.name" @click="openKu(k.ku_id)">
|
|
103
|
+
<b>{{ k.name }}</b><span>{{ k.ku_type }} · {{ fmtTime(k.created_at) }}</span>
|
|
104
|
+
</button>
|
|
105
|
+
<div v-if="!recentKb.length" class="empty">
|
|
106
|
+
还没有录入知识。到「学习库」写一句就能收录,长文档走知识星球。
|
|
107
|
+
</div>
|
|
108
|
+
<button v-if="kbMore" class="more" title="到学习库看全部" @click="moreKb">
|
|
109
|
+
<span class="bars"><i /><i /><i /></span>更多 {{ kb.recentTotal }} 条
|
|
110
|
+
</button>
|
|
111
|
+
</template>
|
|
112
|
+
</section>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<div v-else class="body scroll">
|
|
116
|
+
<template v-if="doc">
|
|
117
|
+
<div class="doc-head">
|
|
118
|
+
<div class="kind" :class="doc.kind">{{ doc.kind === 'code' ? 'CLI' : 'TEXT' }}</div>
|
|
119
|
+
<h3>{{ doc.title }}</h3>
|
|
120
|
+
<code class="path">{{ doc.path }}</code>
|
|
121
|
+
<div v-if="doc.meta" class="meta">{{ doc.meta }}</div>
|
|
122
|
+
</div>
|
|
123
|
+
<section class="sec">
|
|
124
|
+
<div class="sec-h">大纲</div>
|
|
125
|
+
<div v-if="!outline.length" class="empty">无可提取的结构</div>
|
|
126
|
+
<div v-for="(o, i) in outline" :key="i" class="out-line"><span class="n">{{ i + 1 }}</span>{{ o }}</div>
|
|
127
|
+
</section>
|
|
128
|
+
<div class="acts"><button @click="closeDoc()">关闭文档</button></div>
|
|
129
|
+
</template>
|
|
130
|
+
<div v-else class="empty">在中间舞台点开一份文件<br />这里会显示它的上下文与大纲</div>
|
|
131
|
+
</div>
|
|
132
|
+
</aside>
|
|
133
|
+
</template>
|
|
134
|
+
|
|
135
|
+
<style scoped>
|
|
136
|
+
.rail-right { padding: 0; }
|
|
137
|
+
.head {
|
|
138
|
+
display: flex; align-items: center; gap: 8px; flex-shrink: 0;
|
|
139
|
+
padding: 10px 12px 9px; border-bottom: 1px solid var(--line-soft);
|
|
140
|
+
}
|
|
141
|
+
.seg { display: flex; gap: 2px; padding: 2px; border-radius: var(--r-sm); background: rgba(64, 50, 32, 0.055); }
|
|
142
|
+
.seg button {
|
|
143
|
+
display: flex; align-items: center; gap: 4px;
|
|
144
|
+
padding: 4px 11px; border-radius: 7px;
|
|
145
|
+
font-size: 11.5px; color: var(--dim);
|
|
146
|
+
transition: background 0.15s, color 0.15s;
|
|
147
|
+
}
|
|
148
|
+
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(64, 50, 32, 0.09); }
|
|
149
|
+
.seg .pip { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
|
|
150
|
+
.collapse { margin-left: auto; font-size: 13px; color: var(--faint); padding: 2px 5px; }
|
|
151
|
+
.collapse:hover { color: var(--ink); }
|
|
152
|
+
|
|
153
|
+
.body { flex: 1; padding: 12px; }
|
|
154
|
+
.sec { margin-bottom: 20px; }
|
|
155
|
+
.sec-h {
|
|
156
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
157
|
+
font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em;
|
|
158
|
+
color: var(--dim); text-transform: uppercase; margin-bottom: 8px;
|
|
159
|
+
}
|
|
160
|
+
.sec-h em { font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--ink); }
|
|
161
|
+
.kpi {
|
|
162
|
+
display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
|
|
163
|
+
margin-bottom: 8px;
|
|
164
|
+
}
|
|
165
|
+
.kpi div {
|
|
166
|
+
padding: 8px 9px; border-radius: var(--r-sm);
|
|
167
|
+
/* 纸面上要的是「白卡」而不是「更浅的纸」:0.72 的白压在暖底上几乎看不出边界 */
|
|
168
|
+
background: rgba(255, 255, 255, 0.9);
|
|
169
|
+
border: 1px solid var(--line);
|
|
170
|
+
}
|
|
171
|
+
.kpi b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--w-ink); }
|
|
172
|
+
.kpi span { font-size: 11.5px; font-weight: 500; color: var(--w-dim); }
|
|
173
|
+
.go {
|
|
174
|
+
width: 100%; padding: 8px; border-radius: var(--r-sm);
|
|
175
|
+
font-size: 12px; font-weight: 600; color: #fff;
|
|
176
|
+
background: var(--green);
|
|
177
|
+
transition: opacity 0.15s;
|
|
178
|
+
}
|
|
179
|
+
.go:disabled { color: var(--w-dim); background: rgba(64, 50, 32, 0.07); font-weight: 600; border: 1px solid var(--line-soft); }
|
|
180
|
+
.go:not(:disabled):hover { opacity: 0.9; }
|
|
181
|
+
|
|
182
|
+
.sub-h {
|
|
183
|
+
display: flex; justify-content: space-between;
|
|
184
|
+
padding: 5px 2px 6px;
|
|
185
|
+
font-size: 11px; font-weight: 600; color: var(--w-dim);
|
|
186
|
+
}
|
|
187
|
+
.sub-h em { font-style: normal; font-family: var(--mono); }
|
|
188
|
+
|
|
189
|
+
.row {
|
|
190
|
+
width: 100%; text-align: left;
|
|
191
|
+
display: flex; flex-direction: column; gap: 2px;
|
|
192
|
+
padding: 8px 9px; border-radius: var(--r-sm); margin-bottom: 2px;
|
|
193
|
+
transition: background 0.14s;
|
|
194
|
+
}
|
|
195
|
+
.row:hover { background: rgba(255, 255, 255, 0.75); }
|
|
196
|
+
.row b { font-size: 13px; font-weight: 600; color: var(--w-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
197
|
+
.row span { font-size: 11.5px; color: var(--w-dim); }
|
|
198
|
+
|
|
199
|
+
/* 「更多」:三条杠 + 文字,点进知识库看全量 */
|
|
200
|
+
.more {
|
|
201
|
+
width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
|
|
202
|
+
margin-top: 4px; padding: 7px 9px;
|
|
203
|
+
border-radius: var(--r-sm);
|
|
204
|
+
font-size: 12px; font-weight: 600; color: var(--w-dim);
|
|
205
|
+
border: 1px dashed var(--line);
|
|
206
|
+
transition: color 0.15s, border-color 0.15s, background 0.15s;
|
|
207
|
+
}
|
|
208
|
+
.more:hover {
|
|
209
|
+
color: var(--green); border-color: rgba(26, 157, 95, 0.32);
|
|
210
|
+
background: rgba(26, 157, 95, 0.05);
|
|
211
|
+
}
|
|
212
|
+
.bars { display: flex; flex-direction: column; gap: 2px; }
|
|
213
|
+
.bars i { display: block; width: 10px; height: 1.5px; border-radius: 1px; background: currentColor; opacity: 0.75; }
|
|
214
|
+
|
|
215
|
+
.doc-head { padding: 0 4px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 12px; }
|
|
216
|
+
.kind {
|
|
217
|
+
display: inline-block; margin-bottom: 7px;
|
|
218
|
+
padding: 3px 8px; border-radius: var(--r-pill);
|
|
219
|
+
font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
|
|
220
|
+
}
|
|
221
|
+
.kind.code { background: var(--cli-bg); color: var(--cli-acc); }
|
|
222
|
+
.kind.text { background: var(--surface-2); color: var(--w-ink); }
|
|
223
|
+
.doc-head h3 { font-size: 15px; font-weight: 650; line-height: 1.45; color: var(--w-ink); }
|
|
224
|
+
.path { display: block; margin-top: 6px; font-family: var(--mono); font-size: 11px; color: var(--w-dim); word-break: break-all; }
|
|
225
|
+
.meta { margin-top: 5px; font-size: 11.5px; color: var(--w-dim); }
|
|
226
|
+
|
|
227
|
+
.out-line {
|
|
228
|
+
display: flex; gap: 7px; padding: 6px 7px; border-radius: 7px;
|
|
229
|
+
font-size: 12px; color: var(--w-ink); line-height: 1.55;
|
|
230
|
+
}
|
|
231
|
+
.out-line:hover { background: rgba(255, 255, 255, 0.7); color: var(--w-ink); }
|
|
232
|
+
.out-line .n { font-family: var(--mono); font-size: 10.5px; color: var(--w-dim); padding-top: 2px; }
|
|
233
|
+
|
|
234
|
+
.acts { padding-top: 6px; }
|
|
235
|
+
.acts button {
|
|
236
|
+
width: 100%; padding: 8px; border-radius: var(--r-sm);
|
|
237
|
+
font-size: 12.5px; font-weight: 600; color: var(--w-ink);
|
|
238
|
+
background: rgba(255, 255, 255, 0.8); border: 1px solid var(--line);
|
|
239
|
+
}
|
|
240
|
+
.acts button:hover { color: var(--ink); background: #fff; }
|
|
241
|
+
</style>
|