foxclaw 0.1.2 → 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/index.js +1 -8
- package/package.json +1 -1
- package/python/.env.example +8 -0
- package/python/.github/workflows/ci.yml +47 -2
- package/python/CHANGELOG.md +57 -0
- package/python/CHANGELOG_CN.md +57 -0
- package/python/README.md +11 -2
- package/python/README_CN.md +32 -20
- package/python/bench/bm25_audit.py +1 -14
- package/python/bench/bm25_regression.py +0 -1
- package/python/bench/bm25_stress.py +0 -4
- package/python/bench/cd_audit.py +0 -23
- package/python/bench/chaos.py +6 -8
- package/python/bench/e2e_real_models.py +0 -1
- package/python/bench/llm_retry_test.py +2 -9
- package/python/bench/load_test.py +5 -8
- package/python/bench/vector_ivf_upgrade.py +1 -7
- package/python/docs/RELEASE.md +4 -3
- package/python/docs/RUN_CN.md +2 -2
- package/python/evals/governance/cases.py +0 -37
- package/python/evals/governance/run_evals.py +5 -37
- package/python/examples/governance_middleware_demo.py +1 -6
- package/python/examples/langgraph_governance_demo.py +7 -11
- package/python/foxclaw/__init__.py +34 -152
- package/python/foxclaw/agents/base.py +65 -136
- package/python/foxclaw/agents/impl/_helpers.py +2 -10
- package/python/foxclaw/agents/impl/finance.py +4 -21
- package/python/foxclaw/agents/impl/office.py +7 -24
- package/python/foxclaw/agents/impl/supervisor.py +12 -79
- package/python/foxclaw/agents/mixins/_context.py +0 -23
- package/python/foxclaw/agents/mixins/augment.py +10 -16
- package/python/foxclaw/agents/mixins/llm.py +7 -6
- package/python/foxclaw/agents/mixins/memory.py +7 -1
- package/python/foxclaw/agents/mixins/preference.py +58 -8
- package/python/foxclaw/agents/mixins/prompt.py +0 -6
- package/python/foxclaw/agents/mixins/skillbox.py +6 -6
- package/python/foxclaw/agents/mixins/tool_exec.py +16 -42
- package/python/foxclaw/api/__init__.py +18 -77
- package/python/foxclaw/api/_state.py +43 -0
- package/python/foxclaw/api/{app.py → bootstrap.py} +5 -32
- package/python/foxclaw/api/middleware.py +5 -28
- package/python/foxclaw/api/routes/ahs.py +60 -73
- package/python/foxclaw/api/routes/attachments.py +5 -6
- package/python/foxclaw/api/routes/browser.py +7 -11
- package/python/foxclaw/api/routes/domain.py +18 -26
- package/python/foxclaw/api/routes/knowledge.py +3 -21
- package/python/foxclaw/api/routes/llm_admin.py +21 -33
- package/python/foxclaw/api/routes/memory.py +28 -12
- package/python/foxclaw/api/routes/orchestration.py +3 -5
- package/python/foxclaw/api/routes/recovery.py +4 -3
- package/python/foxclaw/api/routes/review.py +2 -11
- package/python/foxclaw/api/routes/search.py +3 -7
- package/python/foxclaw/api/routes/system.py +33 -49
- package/python/foxclaw/api/routes/task.py +31 -49
- package/python/foxclaw/api/routes/ws.py +2 -6
- package/python/foxclaw/api/spine.py +1 -4
- package/python/foxclaw/browser/action/action_executor.py +1 -5
- package/python/foxclaw/browser/action/action_types.py +0 -1
- package/python/foxclaw/browser/action/url_policy.py +1 -5
- package/python/foxclaw/browser/adapter/web_adapter.py +1 -1
- package/python/foxclaw/browser/driver/playwright_driver.py +20 -16
- package/python/foxclaw/browser/perception/dom_extractor.py +0 -1
- package/python/foxclaw/browser/perception/element_indexer.py +1 -2
- package/python/foxclaw/browser/service.py +7 -11
- package/python/foxclaw/capability/embedding_service.py +4 -6
- package/python/foxclaw/channels/__init__.py +9 -11
- package/python/foxclaw/channels/discord.py +4 -13
- package/python/foxclaw/channels/dispatcher.py +2 -27
- package/python/foxclaw/channels/feishu.py +10 -20
- package/python/foxclaw/channels/openclaw_bridge.py +4 -9
- package/python/foxclaw/channels/signing.py +9 -9
- package/python/foxclaw/channels/telegram.py +3 -4
- package/python/foxclaw/channels/weixin.py +7 -17
- package/python/foxclaw/cli.py +42 -13
- package/python/foxclaw/cognitive/reasoner.py +9 -10
- package/python/foxclaw/cognitive/state.py +18 -24
- package/python/foxclaw/core/audit_chain.py +1 -3
- package/python/foxclaw/core/audit_sink.py +3 -3
- package/python/foxclaw/core/compaction.py +8 -26
- package/python/foxclaw/core/config.py +2 -2
- package/python/foxclaw/core/confirm_nonce.py +6 -12
- package/python/foxclaw/core/envfile.py +2 -2
- package/python/foxclaw/core/failure_policy.py +17 -26
- package/python/foxclaw/core/gateway.py +6 -10
- package/python/foxclaw/core/governance_audit.py +3 -7
- package/python/foxclaw/core/idempotency.py +15 -22
- package/python/foxclaw/core/injection_guard.py +10 -29
- package/python/foxclaw/core/memory_adapter.py +30 -57
- package/python/foxclaw/core/metrics.py +4 -5
- package/python/foxclaw/core/model_router.py +36 -148
- package/python/foxclaw/core/paths.py +1 -1
- package/python/foxclaw/core/recovery.py +21 -34
- package/python/foxclaw/core/scheduler.py +23 -26
- package/python/foxclaw/core/secrets.py +0 -3
- package/python/foxclaw/core/sessions.py +4 -6
- package/python/foxclaw/core/settings.py +16 -32
- package/python/foxclaw/core/shared_write.py +11 -23
- package/python/foxclaw/core/steering_queue.py +12 -11
- package/python/foxclaw/core/system_bus.py +1 -1
- package/python/foxclaw/core/thought_chain.py +30 -32
- package/python/foxclaw/core/token_meter.py +9 -13
- package/python/foxclaw/core/tools.py +4 -12
- package/python/foxclaw/core/tracing.py +25 -40
- package/python/foxclaw/core/truth_pipeline.py +5 -9
- package/python/foxclaw/core/update_check.py +149 -0
- package/python/foxclaw/core/vec_recall_adapter.py +11 -37
- package/python/foxclaw/core/verify.py +6 -14
- package/python/foxclaw/core/web_search.py +4 -28
- package/python/foxclaw/finance/evidence.py +14 -18
- package/python/foxclaw/finance/fx.py +1 -3
- package/python/foxclaw/finance/graph.py +9 -18
- package/python/foxclaw/finance/models.py +20 -24
- package/python/foxclaw/finance/nlparse.py +12 -72
- package/python/foxclaw/finance/policy.py +8 -36
- package/python/foxclaw/finance/reasoner.py +3 -11
- package/python/foxclaw/finance/reasoning.py +13 -34
- package/python/foxclaw/finance/reconcile.py +5 -10
- package/python/foxclaw/finance/runtime.py +19 -46
- package/python/foxclaw/governance/middleware.py +13 -21
- package/python/foxclaw/harness/_base.py +2 -8
- package/python/foxclaw/harness/_policy.py +19 -38
- package/python/foxclaw/harness/drift.py +1 -13
- package/python/foxclaw/harness/event_bus.py +2 -5
- package/python/foxclaw/harness/harness.py +9 -97
- package/python/foxclaw/harness/loop_detection.py +11 -18
- package/python/foxclaw/itinerary/amap_client.py +2 -5
- package/python/foxclaw/itinerary/models.py +7 -7
- package/python/foxclaw/itinerary/reasoner.py +1 -6
- package/python/foxclaw/itinerary/reasoning.py +15 -21
- package/python/foxclaw/itinerary/runtime.py +8 -12
- package/python/foxclaw/kernel/capabilities.py +5 -6
- package/python/foxclaw/kernel/policy_gate.py +4 -10
- package/python/foxclaw/kernel/process_manager.py +17 -36
- package/python/foxclaw/kernel/scheduler.py +3 -9
- package/python/foxclaw/kernel/sentinel.py +13 -23
- package/python/foxclaw/kernel/sentinel_client.py +12 -15
- package/python/foxclaw/kernel/spine.py +9 -9
- package/python/foxclaw/knowledge/__init__.py +4 -20
- package/python/foxclaw/knowledge/truth_crystallizer.py +5 -8
- package/python/foxclaw/learning/knowledge_graph.py +4 -9
- package/python/foxclaw/learning/models.py +13 -13
- package/python/foxclaw/learning/reasoner.py +1 -4
- package/python/foxclaw/learning/runtime.py +19 -31
- package/python/foxclaw/learning/spaced_repetition.py +2 -7
- package/python/foxclaw/mcp_server.py +2 -3
- package/python/foxclaw/orchestration/__init__.py +16 -33
- package/python/foxclaw/pipeline/cognitive_pipeline.py +45 -97
- package/python/foxclaw/pipeline/stage_meta.py +21 -0
- package/python/foxclaw/pipeline/supervisor_stages.py +13 -42
- package/python/foxclaw/planning/llm_planner.py +3 -3
- package/python/foxclaw/planning/planner.py +6 -11
- package/python/foxclaw/search/agent_port.py +7 -11
- package/python/foxclaw/search/evidence.py +0 -4
- package/python/foxclaw/search/internal_search.py +3 -5
- package/python/foxclaw/search/models.py +11 -13
- package/python/foxclaw/search/planner.py +3 -3
- package/python/foxclaw/search/retriever.py +1 -1
- package/python/foxclaw/search/runtime.py +1 -8
- package/python/foxclaw/skills/__init__.py +46 -100
- package/python/foxclaw/skills/archive.py +111 -0
- package/python/foxclaw/skills/fetch.py +226 -0
- package/python/foxclaw/skills/hooks_spec.py +21 -25
- package/python/foxclaw/skills/install_cmd.py +216 -0
- package/python/foxclaw/skills/lifecycle.py +16 -42
- package/python/foxclaw/skills/markdown_skill.py +10 -9
- package/python/foxclaw/skills/mcp_client.py +5 -11
- package/python/foxclaw/skills/mcp_store.py +0 -3
- package/python/foxclaw/skills/permission.py +13 -48
- package/python/foxclaw/skills/pipeline.py +21 -53
- package/python/foxclaw/skills/policy.py +4 -10
- package/python/foxclaw/skills/review.py +3 -3
- package/python/frontend/deck/auth.js +0 -7
- package/python/frontend/deck/chat_model_picker.js +0 -54
- package/python/frontend/deck/domain.js +0 -20
- package/python/frontend/deck/main.js +0 -144
- package/python/frontend/deck/markdown.js +0 -4
- package/python/frontend/deck/settings.js +1 -18
- package/python/frontend/deck/state.js +0 -1
- package/python/frontend/deck/util.js +0 -2
- package/python/frontend/deck/visuals.js +0 -22
- package/python/frontend/planet/planet.js +0 -201
- 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 +3 -3
- package/python/frontend/widget_runtime.js +0 -43
- package/python/frontend/widgets.js +0 -57
- package/python/frontend_src/index.html +1 -1
- package/python/frontend_src/package-lock.json +2 -2
- package/python/frontend_src/package.json +1 -1
- package/python/frontend_src/src/App.vue +3 -7
- package/python/frontend_src/src/api.js +0 -7
- package/python/frontend_src/src/components/ChatDock.vue +27 -39
- package/python/frontend_src/src/components/DocViewer.vue +0 -9
- package/python/frontend_src/src/components/Inspector.vue +0 -6
- package/python/frontend_src/src/components/LeftRail.vue +60 -39
- package/python/frontend_src/src/components/MenuPopover.vue +9 -11
- package/python/frontend_src/src/components/MessageStream.vue +18 -30
- package/python/frontend_src/src/components/ModelPicker.vue +0 -5
- package/python/frontend_src/src/components/QuickIngest.vue +0 -6
- package/python/frontend_src/src/components/Stage.vue +71 -25
- package/python/frontend_src/src/components/ToolMenu.vue +0 -3
- package/python/frontend_src/src/components/TopBar.vue +38 -10
- package/python/frontend_src/src/components/panels/ActivityPanel.vue +0 -2
- package/python/frontend_src/src/components/panels/AgentsPanel.vue +2 -5
- package/python/frontend_src/src/components/panels/KnowledgePanel.vue +0 -16
- package/python/frontend_src/src/components/panels/MemoryPanel.vue +0 -1
- package/python/frontend_src/src/components/panels/PanelBox.vue +6 -7
- package/python/frontend_src/src/components/panels/ReviewPanel.vue +0 -16
- package/python/frontend_src/src/components/panels/SettingsPanel.vue +142 -38
- package/python/frontend_src/src/components/panels/TasksPanel.vue +0 -1
- package/python/frontend_src/src/components/panels/ToolsPanel.vue +125 -19
- package/python/frontend_src/src/lib/fmt.js +0 -4
- 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 +0 -14
- package/python/frontend_src/src/main.js +2 -0
- package/python/frontend_src/src/stores/app.js +17 -32
- package/python/frontend_src/src/stores/chat.js +0 -34
- package/python/frontend_src/src/stores/model.js +0 -8
- package/python/frontend_src/src/stores/panels.js +0 -41
- package/python/frontend_src/src/stores/profile.js +31 -0
- package/python/frontend_src/src/stores/system.js +25 -0
- package/python/frontend_src/vite.config.js +0 -7
- package/python/pyproject.toml +6 -3
- package/python/requirements.txt +311 -0
- package/python/tests/conftest.py +0 -22
- package/python/tests/run_all.py +3 -66
- package/python/tests/test_agent_lifecycle.py +4 -38
- package/python/tests/test_ahs_p2.py +4 -25
- package/python/tests/test_anthropic_tools.py +1 -15
- package/python/tests/test_api.py +19 -9
- package/python/tests/test_api_auth.py +1 -5
- package/python/tests/test_attachments.py +9 -25
- package/python/tests/test_audit_chain.py +2 -7
- package/python/tests/test_audit_sink.py +0 -6
- package/python/tests/test_browser.py +2 -6
- package/python/tests/test_browser_request_guard.py +0 -4
- package/python/tests/test_capabilities.py +0 -6
- package/python/tests/test_channel_signing.py +2 -9
- package/python/tests/test_channels.py +1 -11
- package/python/tests/test_config_layering.py +0 -4
- package/python/tests/test_confirm_nonce.py +1 -12
- package/python/tests/test_context_compaction_wiring.py +1 -7
- package/python/tests/test_dispatch.py +0 -6
- package/python/tests/test_domain_evals.py +11 -80
- package/python/tests/test_domain_import.py +0 -6
- package/python/tests/test_domain_reasoners.py +0 -14
- package/python/tests/test_e2e.py +0 -17
- package/python/tests/test_emb_cache.py +7 -17
- package/python/tests/test_embedding_singleton.py +1 -3
- package/python/tests/test_evals_smoke.py +0 -24
- package/python/tests/test_event_spine.py +10 -18
- package/python/tests/test_evidence_semantic.py +1 -14
- package/python/tests/test_evidence_sse.py +3 -6
- package/python/tests/test_file_ingest.py +0 -11
- package/python/tests/test_finance.py +0 -9
- package/python/tests/test_finance_ledger.py +5 -12
- package/python/tests/test_finance_persist.py +8 -12
- package/python/tests/test_gateway.py +3 -22
- package/python/tests/test_governance.py +5 -52
- package/python/tests/test_governance_audit.py +4 -39
- package/python/tests/test_governance_middleware.py +1 -7
- package/python/tests/test_hkc.py +6 -24
- package/python/tests/test_hkc_index_build_manager.py +0 -33
- package/python/tests/test_hkc_manifest_reuse.py +4 -27
- package/python/tests/test_hkc_search_event_sync.py +3 -54
- package/python/tests/test_import_path_guard.py +0 -6
- package/python/tests/test_injection_guard.py +18 -36
- package/python/tests/test_integration.py +5 -29
- package/python/tests/test_itinerary.py +0 -3
- package/python/tests/test_kee_semantic.py +0 -5
- package/python/tests/test_kernel.py +1 -11
- package/python/tests/test_learning.py +3 -12
- package/python/tests/test_llm_admin.py +4 -19
- package/python/tests/test_llm_planner.py +1 -23
- package/python/tests/test_markdown_skills.py +3 -14
- package/python/tests/test_markdown_skills_openclaw.py +4 -9
- package/python/tests/test_mcp_connectors.py +3 -15
- package/python/tests/test_mcp_guardian_discovery.py +2 -6
- package/python/tests/test_mcp_no_memory.py +3 -3
- package/python/tests/test_mcp_policy_gate.py +0 -1
- package/python/tests/test_mcp_server.py +6 -9
- package/python/tests/test_memory_recall.py +1 -4
- package/python/tests/test_metrics.py +0 -8
- package/python/tests/test_multi_chain.py +1 -13
- package/python/tests/test_multimodal.py +5 -18
- package/python/tests/test_negotiation.py +3 -13
- package/python/tests/test_orchestration.py +1 -11
- package/python/tests/test_orchestration_decoupled.py +0 -6
- package/python/tests/test_p3_p5_hardening.py +3 -17
- package/python/tests/test_parallel_dispatch.py +4 -12
- package/python/tests/test_pipeline.py +17 -58
- package/python/tests/test_plan_visible.py +4 -4
- package/python/tests/test_planner.py +0 -7
- package/python/tests/test_policy_gate.py +2 -3
- package/python/tests/test_profile.py +67 -0
- package/python/tests/test_readme_claims.py +163 -0
- package/python/tests/test_reasoner.py +2 -17
- package/python/tests/test_release_check.py +2 -13
- package/python/tests/test_resume_checkpoint.py +7 -15
- package/python/tests/test_routing.py +2 -12
- package/python/tests/test_scheduler.py +7 -10
- package/python/tests/test_search.py +1 -11
- package/python/tests/test_secrets.py +4 -10
- package/python/tests/test_semantic.py +1 -10
- package/python/tests/test_sessions.py +3 -4
- package/python/tests/test_settings.py +2 -18
- package/python/tests/test_shadow_learning.py +3 -43
- package/python/tests/test_shared_write.py +0 -7
- package/python/tests/test_skill_taint_gate.py +1 -10
- package/python/tests/test_skills.py +2 -18
- package/python/tests/test_skills_fetch.py +282 -0
- package/python/tests/test_stats_and_events.py +2 -5
- package/python/tests/test_streaming.py +2 -7
- package/python/tests/test_supervisor_pipeline.py +4 -5
- package/python/tests/test_supervisor_triage.py +4 -10
- package/python/tests/test_taint.py +2 -7
- package/python/tests/test_task_stream.py +1 -12
- package/python/tests/test_thinking_sse.py +0 -1
- package/python/tests/test_tool_center.py +1 -17
- package/python/tests/test_tool_parallel.py +2 -2
- package/python/tests/test_tool_params.py +1 -5
- package/python/tests/test_tool_use.py +0 -13
- package/python/tests/test_toplevel_concurrency.py +3 -4
- package/python/tests/test_tracing.py +7 -41
- package/python/tests/test_truth_crystallizer.py +4 -6
- package/python/tests/test_truth_flow.py +2 -7
- package/python/tests/test_update_check.py +95 -0
- package/python/tests/test_verify_evidence.py +8 -21
- package/python/tests/test_version_sync.py +35 -6
- package/python/tests/test_web_trigger.py +0 -17
- package/python/tools/check_faiss_type.py +0 -1
- package/python/tools/check_log.ps1 +0 -8
- package/python/tools/mypy_baseline.txt +12 -4
- package/python/tools/mypy_ratchet.py +52 -6
- package/python/tools/pack.py +0 -5
- package/python/tools/release_check.py +7 -7
- package/python/tools/restart_foxclaw.ps1 +5 -8
- package/python/tools/shared_write_audit.py +1 -15
- package/python/tools/size_check.py +1 -1
- package/python/tools/strip_comments.py +228 -0
- package/python/frontend/v3/assets/index-BD7VPbMV.js +0 -33
- package/python/frontend/v3/assets/index-CAvnYWGH.css +0 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { reactive } from 'vue'
|
|
2
|
+
import zh from './locales/zh.js'
|
|
3
|
+
import en from './locales/en.js'
|
|
4
|
+
|
|
5
|
+
const DICTS = { zh, en }
|
|
6
|
+
const STORE_KEY = 'foxclawLang'
|
|
7
|
+
|
|
8
|
+
export const LOCALES = [
|
|
9
|
+
{ id: 'zh', label: '中文', tag: 'Chinese', htmlLang: 'zh-CN', locale: 'zh-CN' },
|
|
10
|
+
{ id: 'en', label: 'English', tag: 'English', htmlLang: 'en', locale: 'en-US' },
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
const stored = (() => {
|
|
14
|
+
try {
|
|
15
|
+
return localStorage.getItem(STORE_KEY)
|
|
16
|
+
} catch {
|
|
17
|
+
return null
|
|
18
|
+
}
|
|
19
|
+
})()
|
|
20
|
+
|
|
21
|
+
export const i18n = reactive({ locale: DICTS[stored] ? stored : 'zh' })
|
|
22
|
+
|
|
23
|
+
export const currentLocale = () => LOCALES.find((l) => l.id === i18n.locale) || LOCALES[0]
|
|
24
|
+
|
|
25
|
+
/** 数字/日期格式化用的 BCP-47 标签,跟随界面语言 */
|
|
26
|
+
export const numberLocale = () => currentLocale().locale
|
|
27
|
+
|
|
28
|
+
export function applyLangTag() {
|
|
29
|
+
document.documentElement.lang = currentLocale().htmlLang
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function setLocale(id) {
|
|
33
|
+
if (!DICTS[id] || id === i18n.locale) return
|
|
34
|
+
i18n.locale = id
|
|
35
|
+
try {
|
|
36
|
+
localStorage.setItem(STORE_KEY, id)
|
|
37
|
+
} catch {
|
|
38
|
+
/* 隐私模式下写不进去,不影响本次会话 */
|
|
39
|
+
}
|
|
40
|
+
applyLangTag()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** 取文案。读 i18n.locale 使其在模板中被 Vue 追踪,切换语言即时生效。 */
|
|
44
|
+
export function t(key, vars) {
|
|
45
|
+
const dict = DICTS[i18n.locale] || DICTS.zh
|
|
46
|
+
let s = dict[key]
|
|
47
|
+
if (s === undefined) s = DICTS.zh[key]
|
|
48
|
+
if (s === undefined) return key
|
|
49
|
+
if (vars) {
|
|
50
|
+
for (const k of Object.keys(vars)) s = s.split(`{${k}}`).join(String(vars[k]))
|
|
51
|
+
}
|
|
52
|
+
return s
|
|
53
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'nav.overview': 'Overview',
|
|
3
|
+
'nav.activity': 'Activity',
|
|
4
|
+
'nav.tasks': 'Scheduled',
|
|
5
|
+
'nav.agents': 'Agents',
|
|
6
|
+
'nav.tools': 'Skills · Connectors',
|
|
7
|
+
'nav.usage': 'Usage',
|
|
8
|
+
'nav.knowledge': 'Library',
|
|
9
|
+
'nav.review': 'Review',
|
|
10
|
+
'nav.memory': 'Memory',
|
|
11
|
+
'nav.settings': 'Settings',
|
|
12
|
+
|
|
13
|
+
'group.workspace': 'Workspace',
|
|
14
|
+
'group.capability': 'Capability',
|
|
15
|
+
'group.knowledge': 'Knowledge',
|
|
16
|
+
'group.system': 'System',
|
|
17
|
+
|
|
18
|
+
'common.refresh': 'Refresh',
|
|
19
|
+
'common.loading': 'Loading…',
|
|
20
|
+
'common.offline': 'Backend offline',
|
|
21
|
+
'common.offlinePanel': 'Backend offline — this panel cannot load data right now',
|
|
22
|
+
'common.online': 'Online',
|
|
23
|
+
'common.offlineShort': 'Offline',
|
|
24
|
+
'common.save': 'Save',
|
|
25
|
+
'common.notSet': 'Not set',
|
|
26
|
+
'common.count': '{n}',
|
|
27
|
+
|
|
28
|
+
'rail.newSession': 'Start a new session',
|
|
29
|
+
'rail.newSessionBtn': '+ New session',
|
|
30
|
+
'rail.more': 'More',
|
|
31
|
+
'menu.title': 'More features',
|
|
32
|
+
'menu.close': 'Close (Esc)',
|
|
33
|
+
'rail.otherFeatures': 'Other features',
|
|
34
|
+
'rail.history': 'Sessions',
|
|
35
|
+
'rail.empty': 'No sessions yet · send a message to start',
|
|
36
|
+
'rail.untitled': 'New session',
|
|
37
|
+
'rail.rename': 'Rename session',
|
|
38
|
+
'rail.delete': 'Delete session',
|
|
39
|
+
'rail.sessionTitle': 'Session title',
|
|
40
|
+
'rail.open': 'Open {label}',
|
|
41
|
+
'rail.deleteConfirm': 'Delete session "{name}"?\nIts conversation history will be removed permanently.',
|
|
42
|
+
|
|
43
|
+
'app.expandInspector': 'Expand inspector',
|
|
44
|
+
'app.inspector': 'Inspect',
|
|
45
|
+
|
|
46
|
+
'topbar.systemStatus': 'Status',
|
|
47
|
+
'topbar.newVersion': 'Version {latest} available (current {current}) — open settings',
|
|
48
|
+
'topbar.planet': 'Open HKC Knowledge Planet',
|
|
49
|
+
'topbar.planetBtn': '🌐 Planet',
|
|
50
|
+
'topbar.settings': 'Settings (Ctrl+,)',
|
|
51
|
+
|
|
52
|
+
'settings.title': 'Settings',
|
|
53
|
+
'settings.tag': 'Settings',
|
|
54
|
+
'settings.groupModel': 'Model',
|
|
55
|
+
'settings.modelProvider': 'Model & provider',
|
|
56
|
+
'settings.modelProviderSub': 'Takes effect server-side immediately, no restart',
|
|
57
|
+
'settings.current': 'Active',
|
|
58
|
+
'settings.unconfigured': 'No key',
|
|
59
|
+
'settings.providerNote': '“No key” means the backend has no credential for that vendor. Custom model keys and base URLs go in the model capsule left of the composer.',
|
|
60
|
+
'settings.usage': 'Usage',
|
|
61
|
+
'settings.usageSub': 'Tokens, calls, balance',
|
|
62
|
+
'settings.groupChat': 'Chat',
|
|
63
|
+
'settings.mode': 'Mode',
|
|
64
|
+
'settings.modeSub': 'Token-by-token streaming / plan first, then execute',
|
|
65
|
+
'settings.stream': 'Stream',
|
|
66
|
+
'settings.orchestrate': 'Orchestrate',
|
|
67
|
+
'settings.nickname': 'Nickname',
|
|
68
|
+
'settings.nicknameSub': 'How the model addresses you',
|
|
69
|
+
'settings.nicknamePh': 'e.g. snow',
|
|
70
|
+
'settings.nicknameNote': 'Stored as a preference and attached to every turn; save empty to clear.',
|
|
71
|
+
'settings.shortcuts': 'Shortcuts',
|
|
72
|
+
'settings.shortcutsSub': 'Keys inside the composer',
|
|
73
|
+
'settings.groupSystem': 'System',
|
|
74
|
+
'settings.backend': 'Backend',
|
|
75
|
+
'settings.probing': 'probing…',
|
|
76
|
+
'settings.ok': 'OK',
|
|
77
|
+
'settings.retry': 'Retry',
|
|
78
|
+
'settings.updates': 'Updates',
|
|
79
|
+
'settings.groupUi': 'Interface',
|
|
80
|
+
'settings.language': 'Language',
|
|
81
|
+
'settings.languageSub': 'Switches interface copy instantly',
|
|
82
|
+
'settings.languageNote': 'Interface only — it does not change the language the model replies in.',
|
|
83
|
+
|
|
84
|
+
'settings.updNotEnabled': 'Off',
|
|
85
|
+
'settings.updAvailable': '{v} available',
|
|
86
|
+
'settings.updLatest': 'Up to date',
|
|
87
|
+
'settings.updFailed': 'Check failed',
|
|
88
|
+
'settings.updPending': 'Pending',
|
|
89
|
+
'settings.updHintOff': 'Off by default · set FOXCLAW_UPDATE_CHECK=1 to enable',
|
|
90
|
+
'settings.updHintError': 'Check failed (usage unaffected): {msg}',
|
|
91
|
+
'settings.updHintNew': 'Current v{cur} · latest v{latest}',
|
|
92
|
+
'settings.updHintOk': 'Current v{cur} · checked every 24h',
|
|
93
|
+
'settings.buildLocal': 'local build',
|
|
94
|
+
'settings.buildToday': 'today',
|
|
95
|
+
'settings.buildDays': '{n} days ago',
|
|
96
|
+
|
|
97
|
+
'settings.errSaveNick': 'Save failed: {msg}',
|
|
98
|
+
'settings.errSwitch': 'Switch failed: {msg}',
|
|
99
|
+
'settings.saidNick': 'I will call you {name} from now on',
|
|
100
|
+
'settings.saidNickCleared': 'Nickname cleared',
|
|
101
|
+
'settings.saidSwitched': 'Model switched to {label}',
|
|
102
|
+
'settings.saidStream': 'Streaming: token by token',
|
|
103
|
+
'settings.saidOrchestrate': 'Orchestrate: plan first, then execute step by step',
|
|
104
|
+
'settings.saidLang': 'Interface language set to {name}',
|
|
105
|
+
|
|
106
|
+
'chat.cmd.new': 'Start a new session',
|
|
107
|
+
'chat.cmd.stream': 'Switch to streaming chat',
|
|
108
|
+
'chat.cmd.orchestrate': 'Switch to plan-and-execute',
|
|
109
|
+
'chat.cmd.search': 'Search memory / knowledge / web: /search <query>',
|
|
110
|
+
'chat.cmd.ingest': 'Pick files to ingest into the library',
|
|
111
|
+
'chat.cmd.settings': 'Open settings',
|
|
112
|
+
'chat.cmd.stop': 'Stop the current generation',
|
|
113
|
+
'chat.cmd.clear': 'Clear this view only, backend untouched',
|
|
114
|
+
'chat.cmd.help': 'List all commands',
|
|
115
|
+
'chat.saidStream': 'Switched to streaming chat',
|
|
116
|
+
'chat.saidOrchestrate': 'Switched to plan-and-execute',
|
|
117
|
+
'chat.hintSlash': 'Commands',
|
|
118
|
+
'chat.hintAt': 'Mention a skill',
|
|
119
|
+
'chat.tagArg': 'takes an argument',
|
|
120
|
+
'chat.tagSkill': 'skill',
|
|
121
|
+
'chat.tagTool': 'tool',
|
|
122
|
+
'chat.unknownCmd': 'Unknown command: {head}',
|
|
123
|
+
'chat.ingestFailed': 'failed',
|
|
124
|
+
'chat.placeholder': 'Tell me what you need… / commands · @ skills · Enter to send',
|
|
125
|
+
'chat.send': 'Send',
|
|
126
|
+
'chat.stopGen': 'Stop generating',
|
|
127
|
+
|
|
128
|
+
'hero.title': 'Ask me anything',
|
|
129
|
+
'hero.cap': 'The supervisor agent dispatches sub-agents on demand; ask directly if you want it to read your library',
|
|
130
|
+
'hero.askName': 'What should I call you?',
|
|
131
|
+
'hero.namePh': 'e.g. snow',
|
|
132
|
+
'hero.confirm': 'Call me that',
|
|
133
|
+
'hero.skip': 'Skip',
|
|
134
|
+
'hero.skipTip': 'You can change this later in settings',
|
|
135
|
+
'hero.close': 'Close',
|
|
136
|
+
'hero.resume': 'Resume',
|
|
137
|
+
'hero.untitled': 'Untitled session',
|
|
138
|
+
'hero.msgs': '{n} messages',
|
|
139
|
+
'hero.recentKnowledge': 'Recent knowledge',
|
|
140
|
+
'hero.saidNick': 'Got it, I will call you {name}',
|
|
141
|
+
'hero.errSave': 'Save failed: {msg}',
|
|
142
|
+
'hero.q1': 'What skills are available right now?',
|
|
143
|
+
'hero.q2': 'Help me prioritise what I need to do today',
|
|
144
|
+
'hero.q3': 'Describe in one sentence what you can do for me',
|
|
145
|
+
|
|
146
|
+
'msg.supervisor': 'Supervisor',
|
|
147
|
+
'msg.generating': 'generating',
|
|
148
|
+
'msg.reasoning': 'Reasoning',
|
|
149
|
+
'msg.chars': '{n} chars',
|
|
150
|
+
'msg.plan': 'Plan',
|
|
151
|
+
'msg.steps': '{n} steps',
|
|
152
|
+
'msg.confidence': 'Confidence {n}%',
|
|
153
|
+
'msg.iterations': '{n} iterations',
|
|
154
|
+
'msg.evidence': 'Evidence',
|
|
155
|
+
'msg.items': '{n} items',
|
|
156
|
+
'msg.tool': 'tool',
|
|
157
|
+
'msg.copied': 'Copied',
|
|
158
|
+
'msg.copy': 'Copy',
|
|
159
|
+
'msg.retry': 'Retry',
|
|
160
|
+
'msg.srcMemory': 'memory',
|
|
161
|
+
'msg.srcKnowledge': 'knowledge',
|
|
162
|
+
'msg.srcWeb': 'web',
|
|
163
|
+
'msg.srcAgent': 'agent',
|
|
164
|
+
'msg.srcEvidence': 'evidence',
|
|
165
|
+
|
|
166
|
+
'key.enter': 'Send',
|
|
167
|
+
'key.shiftEnter': 'New line',
|
|
168
|
+
'key.slash': 'Command completion (e.g. /search)',
|
|
169
|
+
'key.at': 'Skill completion',
|
|
170
|
+
'key.arrows': 'Pick from the completion list',
|
|
171
|
+
'key.esc': 'Close completion / overlay',
|
|
172
|
+
'key.ctrlComma': 'Open settings',
|
|
173
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'nav.overview': '概览',
|
|
3
|
+
'nav.activity': '活动',
|
|
4
|
+
'nav.tasks': '定时任务',
|
|
5
|
+
'nav.agents': '代理',
|
|
6
|
+
'nav.tools': '技能·连接器',
|
|
7
|
+
'nav.usage': '使用情况',
|
|
8
|
+
'nav.knowledge': '学习库',
|
|
9
|
+
'nav.review': '复习',
|
|
10
|
+
'nav.memory': '记忆中心',
|
|
11
|
+
'nav.settings': '设置',
|
|
12
|
+
|
|
13
|
+
'group.workspace': '工作台',
|
|
14
|
+
'group.capability': '能力',
|
|
15
|
+
'group.knowledge': '知识',
|
|
16
|
+
'group.system': '系统',
|
|
17
|
+
|
|
18
|
+
'common.refresh': '刷新',
|
|
19
|
+
'common.loading': '加载中…',
|
|
20
|
+
'common.offline': '后端未连接',
|
|
21
|
+
'common.offlinePanel': '后端未连接,这个面板暂时拉不到数据',
|
|
22
|
+
'common.online': '在线',
|
|
23
|
+
'common.offlineShort': '离线',
|
|
24
|
+
'common.save': '保存',
|
|
25
|
+
'common.notSet': '未设置',
|
|
26
|
+
'common.count': '{n} 条',
|
|
27
|
+
|
|
28
|
+
'rail.newSession': '开一个新会话',
|
|
29
|
+
'rail.newSessionBtn': '+ 新会话',
|
|
30
|
+
'rail.more': '更多',
|
|
31
|
+
'menu.title': '更多功能',
|
|
32
|
+
'menu.close': '关闭 (Esc)',
|
|
33
|
+
'rail.otherFeatures': '其它功能',
|
|
34
|
+
'rail.history': '会话历史',
|
|
35
|
+
'rail.empty': '还没有会话 · 发一条消息即开始',
|
|
36
|
+
'rail.untitled': '新会话',
|
|
37
|
+
'rail.rename': '重命名会话',
|
|
38
|
+
'rail.delete': '删除会话',
|
|
39
|
+
'rail.sessionTitle': '会话标题',
|
|
40
|
+
'rail.open': '打开{label}',
|
|
41
|
+
'rail.deleteConfirm': '删除会话「{name}」?\n对话历史会一起删掉,不可恢复。',
|
|
42
|
+
|
|
43
|
+
'app.expandInspector': '展开检视栏',
|
|
44
|
+
'app.inspector': '检视',
|
|
45
|
+
|
|
46
|
+
'topbar.systemStatus': '系统状态',
|
|
47
|
+
'topbar.newVersion': '有新版本 {latest}(当前 {current}),点这里看设置',
|
|
48
|
+
'topbar.planet': '打开 HKC 知识星球',
|
|
49
|
+
'topbar.planetBtn': '🌐 知识星球',
|
|
50
|
+
'topbar.settings': '设置 (Ctrl+,)',
|
|
51
|
+
|
|
52
|
+
'settings.title': '设置',
|
|
53
|
+
'settings.tag': 'Settings',
|
|
54
|
+
'settings.groupModel': '模型',
|
|
55
|
+
'settings.modelProvider': '模型与供应商',
|
|
56
|
+
'settings.modelProviderSub': '切换后服务端立即生效,不用重启',
|
|
57
|
+
'settings.current': '当前',
|
|
58
|
+
'settings.unconfigured': '未配置',
|
|
59
|
+
'settings.providerNote': '「未配置」= 后端缺该厂商的 Key。自定义模型的 Key / Base URL 在输入框左侧的模型胶囊里加。',
|
|
60
|
+
'settings.usage': '使用情况',
|
|
61
|
+
'settings.usageSub': 'token、调用次数、余额',
|
|
62
|
+
'settings.groupChat': '对话',
|
|
63
|
+
'settings.mode': '模式',
|
|
64
|
+
'settings.modeSub': '逐字流式 / 先出计划再逐步执行',
|
|
65
|
+
'settings.stream': '流式',
|
|
66
|
+
'settings.orchestrate': '编排',
|
|
67
|
+
'settings.nickname': '称呼',
|
|
68
|
+
'settings.nicknameSub': '模型会这么叫你',
|
|
69
|
+
'settings.nicknamePh': '例如:snow',
|
|
70
|
+
'settings.nicknameNote': '存成一条偏好,每轮对话都会带上;留空保存 = 清除。',
|
|
71
|
+
'settings.shortcuts': '快捷键',
|
|
72
|
+
'settings.shortcutsSub': '输入框里的键位',
|
|
73
|
+
'settings.groupSystem': '系统',
|
|
74
|
+
'settings.backend': '后端连接',
|
|
75
|
+
'settings.probing': '探测中…',
|
|
76
|
+
'settings.ok': '正常',
|
|
77
|
+
'settings.retry': '重试',
|
|
78
|
+
'settings.reprobe': '再探一次',
|
|
79
|
+
'settings.updates': '新版本',
|
|
80
|
+
'settings.groupUi': '界面',
|
|
81
|
+
'settings.language': '语言',
|
|
82
|
+
'settings.languageSub': '切换界面文案,立即生效',
|
|
83
|
+
'settings.languageNote': '只影响界面文字,不影响模型回复的语言。',
|
|
84
|
+
|
|
85
|
+
'settings.updNotEnabled': '未开启',
|
|
86
|
+
'settings.updAvailable': '新版本 {v}',
|
|
87
|
+
'settings.updLatest': '已是最新',
|
|
88
|
+
'settings.updFailed': '检查失败',
|
|
89
|
+
'settings.updPending': '待检查',
|
|
90
|
+
'settings.updHintOff': '默认关闭 · 设 FOXCLAW_UPDATE_CHECK=1 开启',
|
|
91
|
+
'settings.updHintError': '检查失败(不影响使用):{msg}',
|
|
92
|
+
'settings.updHintNew': '当前 v{cur} · 最新 v{latest}',
|
|
93
|
+
'settings.updHintOk': '当前 v{cur} · 24 小时查一次',
|
|
94
|
+
'settings.buildLocal': '本地构建',
|
|
95
|
+
'settings.buildToday': '今天',
|
|
96
|
+
'settings.buildDays': '{n} 天前',
|
|
97
|
+
|
|
98
|
+
'settings.errSaveNick': '保存失败:{msg}',
|
|
99
|
+
'settings.errSwitch': '切换失败:{msg}',
|
|
100
|
+
'settings.saidNick': '以后称呼你为 {name}',
|
|
101
|
+
'settings.saidNickCleared': '已清除称呼',
|
|
102
|
+
'settings.saidSwitched': '模型已切到 {label}',
|
|
103
|
+
'settings.saidStream': '流式:逐字输出',
|
|
104
|
+
'settings.saidOrchestrate': '编排:先出计划再逐步执行',
|
|
105
|
+
'settings.saidLang': '界面语言已切换为{name}',
|
|
106
|
+
|
|
107
|
+
'chat.cmd.new': '开一个新会话',
|
|
108
|
+
'chat.cmd.stream': '切到流式对话',
|
|
109
|
+
'chat.cmd.orchestrate': '切到编排任务',
|
|
110
|
+
'chat.cmd.search': '检索记忆/知识/联网:/搜索 关键词',
|
|
111
|
+
'chat.cmd.ingest': '选文件摄入知识库',
|
|
112
|
+
'chat.cmd.settings': '打开设置面板',
|
|
113
|
+
'chat.cmd.stop': '停止当前生成',
|
|
114
|
+
'chat.cmd.clear': '只清空当前显示,不动后端',
|
|
115
|
+
'chat.cmd.help': '列出全部命令',
|
|
116
|
+
'chat.saidStream': '已切到流式对话',
|
|
117
|
+
'chat.saidOrchestrate': '已切到编排任务',
|
|
118
|
+
'chat.hintSlash': '命令',
|
|
119
|
+
'chat.hintAt': '提及技能',
|
|
120
|
+
'chat.tagArg': '带参数',
|
|
121
|
+
'chat.tagSkill': '技能',
|
|
122
|
+
'chat.tagTool': '工具',
|
|
123
|
+
'chat.unknownCmd': '未知命令:{head}',
|
|
124
|
+
'chat.ingestFailed': '失败',
|
|
125
|
+
'chat.placeholder': '告诉我你想做什么… / 命令 · @ 技能 · Enter 发送',
|
|
126
|
+
'chat.send': '发送',
|
|
127
|
+
'chat.stopGen': '停止生成',
|
|
128
|
+
|
|
129
|
+
'hero.title': '问我任何事',
|
|
130
|
+
'hero.cap': '主管 Agent 会按需调度子 Agent;想让它读你的知识库,直接问就行',
|
|
131
|
+
'hero.askName': '我该怎么称呼你?',
|
|
132
|
+
'hero.namePh': '例如:snow',
|
|
133
|
+
'hero.confirm': '就这么叫',
|
|
134
|
+
'hero.skip': '跳过',
|
|
135
|
+
'hero.skipTip': '以后在设置里也能填',
|
|
136
|
+
'hero.close': '关闭',
|
|
137
|
+
'hero.resume': '继续上次',
|
|
138
|
+
'hero.untitled': '未命名会话',
|
|
139
|
+
'hero.msgs': '{n} 条消息',
|
|
140
|
+
'hero.recentKnowledge': '最近知识',
|
|
141
|
+
'hero.saidNick': '记住了,以后称呼你为 {name}',
|
|
142
|
+
'hero.errSave': '保存失败:{msg}',
|
|
143
|
+
'hero.q1': '现在系统里有哪些技能可以用?',
|
|
144
|
+
'hero.q2': '帮我把今天要做的事排个优先级',
|
|
145
|
+
'hero.q3': '用一句话说清你能帮我做什么',
|
|
146
|
+
|
|
147
|
+
'msg.supervisor': '主管 Agent',
|
|
148
|
+
'msg.generating': '生成中',
|
|
149
|
+
'msg.reasoning': '推理过程',
|
|
150
|
+
'msg.chars': '{n} 字',
|
|
151
|
+
'msg.plan': '执行计划',
|
|
152
|
+
'msg.steps': '{n} 步',
|
|
153
|
+
'msg.confidence': '置信度 {n}%',
|
|
154
|
+
'msg.iterations': '{n} 轮迭代',
|
|
155
|
+
'msg.evidence': '执行证据',
|
|
156
|
+
'msg.items': '{n} 项',
|
|
157
|
+
'msg.tool': '工具',
|
|
158
|
+
'msg.copied': '已复制',
|
|
159
|
+
'msg.copy': '复制',
|
|
160
|
+
'msg.retry': '重试',
|
|
161
|
+
'msg.srcMemory': '记忆',
|
|
162
|
+
'msg.srcKnowledge': '知识',
|
|
163
|
+
'msg.srcWeb': '联网',
|
|
164
|
+
'msg.srcAgent': '态势',
|
|
165
|
+
'msg.srcEvidence': '证据',
|
|
166
|
+
|
|
167
|
+
'key.enter': '发送',
|
|
168
|
+
'key.shiftEnter': '换行',
|
|
169
|
+
'key.slash': '命令补全(如 /搜索)',
|
|
170
|
+
'key.at': '技能补全',
|
|
171
|
+
'key.arrows': '在补全列表里选',
|
|
172
|
+
'key.esc': '关闭补全 / 浮层',
|
|
173
|
+
'key.ctrlComma': '打开设置',
|
|
174
|
+
}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/* 极简 Markdown → HTML。对话气泡与文档阅读共用这一份渲染器。
|
|
2
|
-
*
|
|
3
|
-
* 之前是两套:DocViewer 自带 readHTML/inl(支持标题、列表、行内代码、粗体、链接,
|
|
4
|
-
* 但**不支持 ``` 代码块**),而 MessageStream 直接 {{ m.content }} 原样输出 ——
|
|
5
|
-
* 于是模型的 `## 标题`、`**粗体**`、`- 列表`、反引号代码块在对话里全是原文。
|
|
6
|
-
*
|
|
7
|
-
* 安全边界:先全量转义 & < > ",之后只把识别到的标记换成标签;
|
|
8
|
-
* 所有标签都由本文件产出,链接只放行 http(s)。
|
|
9
|
-
*/
|
|
10
1
|
|
|
11
2
|
const esc = (s) =>
|
|
12
3
|
String(s ?? '')
|
|
@@ -71,8 +62,6 @@ function renderTable(rows) {
|
|
|
71
62
|
return `<table><thead><tr>${th}</tr></thead>${body.length ? `<tbody>${trs}</tbody>` : ''}</table>`
|
|
72
63
|
}
|
|
73
64
|
|
|
74
|
-
/* src 为空 → 空串。流式时最后一段代码块可能还没闭合,
|
|
75
|
-
* 这里把它当"开着"的代码块渲染,而不是把三个反引号当正文甩出来。 */
|
|
76
65
|
export function mdToHTML(src) {
|
|
77
66
|
const text = String(src ?? '').replace(/\r\n?/g, '\n').replace(/\n$/, '')
|
|
78
67
|
if (!text.trim()) return ''
|
|
@@ -114,7 +103,6 @@ export function mdToHTML(src) {
|
|
|
114
103
|
continue
|
|
115
104
|
}
|
|
116
105
|
|
|
117
|
-
/* 围栏代码块 —— 对话里最常出现,优先级最高 */
|
|
118
106
|
const fence = RE_FENCE.exec(line)
|
|
119
107
|
if (fence) {
|
|
120
108
|
flush()
|
|
@@ -137,7 +125,6 @@ export function mdToHTML(src) {
|
|
|
137
125
|
continue
|
|
138
126
|
}
|
|
139
127
|
|
|
140
|
-
/* 表格:当前行是 | ... | 且下一行是分隔行 */
|
|
141
128
|
if (RE_TABLE_ROW.test(line) && i + 1 < lines.length && RE_TABLE_SEP.test(lines[i + 1]) && lines[i + 1].includes('-')) {
|
|
142
129
|
flush()
|
|
143
130
|
const rows = [splitRow(line)]
|
|
@@ -154,7 +141,6 @@ export function mdToHTML(src) {
|
|
|
154
141
|
const h = RE_HEADING.exec(line)
|
|
155
142
|
if (h) {
|
|
156
143
|
flush()
|
|
157
|
-
/* # → h2, #### 及以下 → h5,不再往下掉(对话里 h6 太小) */
|
|
158
144
|
const lv = Math.min(h[1].length + 1, 5)
|
|
159
145
|
out.push(`<h${lv}>${inline(h[2])}</h${lv}>`)
|
|
160
146
|
i += 1
|
|
@@ -1,52 +1,44 @@
|
|
|
1
1
|
import { reactive } from 'vue'
|
|
2
2
|
import { getJSON } from '../api.js'
|
|
3
|
+
import { t } from '../lib/i18n.js'
|
|
3
4
|
|
|
4
|
-
/* 单一状态源:所有栏只读这一份,不再有 _syncNav 那类「三个入口各改一遍」的补丁。 */
|
|
5
5
|
export const state = reactive({
|
|
6
|
-
/* 左栏 */
|
|
7
6
|
sessions: [],
|
|
8
7
|
sessionsState: 'idle', // idle | loading | error
|
|
9
8
|
sessionId: null,
|
|
10
9
|
|
|
11
|
-
/* 中间舞台 */
|
|
12
10
|
module: 'overview',
|
|
13
11
|
doc: null, // { id, title, kind:'text'|'code', lang, path, content, meta }
|
|
14
12
|
|
|
15
|
-
/* 右栏 Inspector:双内容态,同一栏 */
|
|
16
13
|
railOpen: true,
|
|
17
14
|
railMode: 'progress', // 'progress' | 'context'
|
|
18
15
|
|
|
19
|
-
/* 办公进度(OfficeAgent 的态势与进程);学习账本在 panels.review 里 */
|
|
20
16
|
officeStats: { waypoints: 0, conflicts: 0, alerts: 0, active: 0, total: 0 },
|
|
21
17
|
})
|
|
22
18
|
|
|
23
19
|
export const MODULES = [
|
|
24
|
-
{ id: 'overview', label: '概览', tag: 'Overview', group: '' },
|
|
25
|
-
{ id: 'activity', label: '活动', tag: 'Activity', group: '工作台' },
|
|
26
|
-
{ id: 'tasks', label: '定时任务', tag: 'Tasks', group: '工作台', icon: 'clock' },
|
|
27
|
-
{ id: 'agents', label: '代理', tag: 'Agents', group: '工作台', icon: 'bot', beta: true },
|
|
28
|
-
{ id: 'tools', label: '技能·连接器', tag: 'Tools', group: '能力', icon: 'plug' },
|
|
29
|
-
{ id: 'usage', label: '使用情况', tag: 'Usage', group: '能力' },
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{ id: '
|
|
33
|
-
{ id: '
|
|
34
|
-
{ id: 'memory', label: '记忆中心', tag: 'Memory', group: '知识', icon: 'memory' },
|
|
35
|
-
/* 设置不是"干活的地方",所以不进常驻栏;顶栏 ⚙ 与「更多」都能到,
|
|
36
|
-
顶栏那个 ⚙ 之前是死按钮(title 写着 P3 接入)。 */
|
|
37
|
-
/* 设置落在「更多」里,那里不画图标;之前挂的 icon:'gear' 在 LeftRail 的 ICONS 里
|
|
38
|
-
并不存在(只有 book/clock/plug/bot/more/review/memory/dot),是个死字段。 */
|
|
39
|
-
{ id: 'settings', label: '设置', tag: 'Settings', group: '系统' },
|
|
20
|
+
{ id: 'overview', label: '概览', tag: 'Overview', group: '', groupKey: '' },
|
|
21
|
+
{ id: 'activity', label: '活动', tag: 'Activity', group: '工作台', groupKey: 'group.workspace' },
|
|
22
|
+
{ id: 'tasks', label: '定时任务', tag: 'Tasks', group: '工作台', groupKey: 'group.workspace', icon: 'clock' },
|
|
23
|
+
{ id: 'agents', label: '代理', tag: 'Agents', group: '工作台', groupKey: 'group.workspace', icon: 'bot', beta: true },
|
|
24
|
+
{ id: 'tools', label: '技能·连接器', tag: 'Tools', group: '能力', groupKey: 'group.capability', icon: 'plug' },
|
|
25
|
+
{ id: 'usage', label: '使用情况', tag: 'Usage', group: '能力', groupKey: 'group.capability' },
|
|
26
|
+
{ id: 'knowledge', label: '学习库', tag: 'Knowledge', group: '知识', groupKey: 'group.knowledge', icon: 'book', quick: ['review', 'memory'] },
|
|
27
|
+
{ id: 'review', label: '复习', tag: 'Review', group: '知识', groupKey: 'group.knowledge', icon: 'review' },
|
|
28
|
+
{ id: 'memory', label: '记忆中心', tag: 'Memory', group: '知识', groupKey: 'group.knowledge', icon: 'memory' },
|
|
29
|
+
{ id: 'settings', label: '设置', tag: 'Settings', group: '系统', groupKey: 'group.system', icon: 'gear' },
|
|
40
30
|
]
|
|
41
31
|
|
|
42
|
-
/* 左栏常驻的功能入口(顺序即渲染顺序)。不进这个数组的模块全部落进底部「更多」浮层。
|
|
43
|
-
常驻项恒可见 = 不用先点开菜单才知道有什么功能;代价是列高固定,所以只放四个。 */
|
|
44
32
|
export const RAIL = ['knowledge', 'tasks', 'tools', 'agents']
|
|
45
33
|
|
|
34
|
+
// 设置是侧栏底部的固定入口,不参与主导航与「更多」弹层
|
|
35
|
+
export const PINNED = ['settings']
|
|
36
|
+
|
|
46
37
|
export const railItems = () => RAIL.map((id) => MODULES.find((m) => m.id === id)).filter(Boolean)
|
|
47
|
-
export const moreItems = () => MODULES.filter((m) => !RAIL.includes(m.id))
|
|
38
|
+
export const moreItems = () => MODULES.filter((m) => !RAIL.includes(m.id) && !PINNED.includes(m.id))
|
|
48
39
|
|
|
49
|
-
export const moduleLabel = (id) => MODULES.
|
|
40
|
+
export const moduleLabel = (id) => (MODULES.some((m) => m.id === id) ? t(`nav.${id}`) : id)
|
|
41
|
+
export const groupLabel = (key) => (key ? t(key) : '')
|
|
50
42
|
export const moduleIcon = (id) => MODULES.find((m) => m.id === id)?.icon ?? 'dot'
|
|
51
43
|
|
|
52
44
|
export async function loadSessions() {
|
|
@@ -68,13 +60,7 @@ export function openSession(s) {
|
|
|
68
60
|
}
|
|
69
61
|
|
|
70
62
|
export async function loadProgress() {
|
|
71
|
-
/* 学习账本已改由 panels.review(/api/review/*)提供 —— SM-2 状态写在 KU.extra 里,
|
|
72
|
-
和知识库是同一份数据;/learning/analysis 只统计 learning_note 一类条目,
|
|
73
|
-
两套口径并存会让右栏数字和复习面板对不上。 */
|
|
74
63
|
|
|
75
|
-
/* 办公 = OfficeAgent(行政职责已并入它)的全局态势 + 进程。
|
|
76
|
-
「已摄入资料」已挪到右栏的「最近知识」(读 /api/knowledge/recent),
|
|
77
|
-
书籍级列表留在知识库面板,这里不再重复拉 /knowledge/sources。 */
|
|
78
64
|
const [sit, proc] = await Promise.all([
|
|
79
65
|
getJSON('/orchestration/situation').catch(() => null),
|
|
80
66
|
getJSON('/processes?limit=5').catch(() => null),
|
|
@@ -93,7 +79,6 @@ export function setModule(id) {
|
|
|
93
79
|
state.doc = null
|
|
94
80
|
}
|
|
95
81
|
|
|
96
|
-
/* 打开一份文件 → 正文进中间舞台(宽度够读代码),右栏同步切到检视态并自动展开 */
|
|
97
82
|
export function openDoc(doc) {
|
|
98
83
|
state.doc = doc
|
|
99
84
|
state.railMode = 'context'
|