diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 8c4fa710d..0ed5cc2df 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -8,9 +8,10 @@ "name": "frontend", "version": "0.1.0", "dependencies": { - "axios": "^1.13.2", + "axios": "1.13.2", "d3": "^7.9.0", "vue": "^3.5.24", + "vue-i18n": "^9.14.5", "vue-router": "^4.6.3" }, "devDependencies": { @@ -506,6 +507,50 @@ "node": ">=18" } }, + "node_modules/@intlify/core-base": { + "version": "9.14.5", + "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.14.5.tgz", + "integrity": "sha512-5ah5FqZG4pOoHjkvs8mjtv+gPKYU0zCISaYNjBNNqYiaITxW8ZtVih3GS/oTOqN8d9/mDLyrjD46GBApNxmlsA==", + "license": "MIT", + "dependencies": { + "@intlify/message-compiler": "9.14.5", + "@intlify/shared": "9.14.5" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, + "node_modules/@intlify/message-compiler": { + "version": "9.14.5", + "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.14.5.tgz", + "integrity": "sha512-IHzgEu61/YIpQV5Pc3aRWScDcnFKWvQA9kigcINcCBXN8mbW+vk9SK+lDxA6STzKQsVJxUPg9ACC52pKKo3SVQ==", + "license": "MIT", + "dependencies": { + "@intlify/shared": "9.14.5", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, + "node_modules/@intlify/shared": { + "version": "9.14.5", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.14.5.tgz", + "integrity": "sha512-9gB+E53BYuAEMhbCAxVgG38EZrk59sxBtv3jSizNL2hEWlgjBjAw1AwpLHtNaeda12pe6W20OGEa0TwuMSRbyQ==", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", @@ -1331,7 +1376,6 @@ "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", "license": "ISC", - "peer": true, "engines": { "node": ">=12" } @@ -1809,7 +1853,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -1943,7 +1986,6 @@ "integrity": "sha512-ITcnkFeR3+fI8P1wMgItjGrR10170d8auB4EpMLPqmx6uxElH3a/hHGQabSHKdqd4FXWO1nFIp9rRn7JQ34ACQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -2018,7 +2060,6 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.25.tgz", "integrity": "sha512-YLVdgv2K13WJ6n+kD5owehKtEXwdwXuj2TTyJMsO7pSeKw2bfRNZGjhB7YzrpbMYj5b5QsUebHpOqR3R3ziy/g==", "license": "MIT", - "peer": true, "dependencies": { "@vue/compiler-dom": "3.5.25", "@vue/compiler-sfc": "3.5.25", @@ -2035,6 +2076,27 @@ } } }, + "node_modules/vue-i18n": { + "version": "9.14.5", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.14.5.tgz", + "integrity": "sha512-0jQ9Em3ymWngyiIkj0+c/k7WgaPO+TNzjKSNq9BvBQaKJECqn9cd9fL4tkDhB5G1QBskGl9YxxbDAhgbFtpe2g==", + "deprecated": "v9 and v10 no longer supported. please migrate to v11. about maintenance status, see https://vue-i18n.intlify.dev/guide/maintenance.html", + "license": "MIT", + "dependencies": { + "@intlify/core-base": "9.14.5", + "@intlify/shared": "9.14.5", + "@vue/devtools-api": "^6.5.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + }, + "peerDependencies": { + "vue": "^3.0.0" + } + }, "node_modules/vue-router": { "version": "4.6.3", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.6.3.tgz", diff --git a/frontend/package.json b/frontend/package.json index 5af29f761..4d75f8ef0 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,6 +12,7 @@ "axios": "1.13.2", "d3": "^7.9.0", "vue": "^3.5.24", + "vue-i18n": "^9.14.5", "vue-router": "^4.6.3" }, "devDependencies": { diff --git a/frontend/src/components/HistoryDatabase.vue b/frontend/src/components/HistoryDatabase.vue index edc73f46b..5b5e1e090 100644 --- a/frontend/src/components/HistoryDatabase.vue +++ b/frontend/src/components/HistoryDatabase.vue @@ -10,10 +10,10 @@
- +
- 推演记录 + {{ t('components.history.title') }}
@@ -33,20 +33,20 @@
{{ formatSimulationId(project.simulation_id) }}
- - - + + +
@@ -99,10 +99,10 @@ - +
- 加载中... + {{ t('common.loading') }}
@@ -193,10 +193,12 @@ + + diff --git a/frontend/src/i18n.js b/frontend/src/i18n.js new file mode 100644 index 000000000..ed7e656e6 --- /dev/null +++ b/frontend/src/i18n.js @@ -0,0 +1,15 @@ +import { createI18n } from 'vue-i18n' +import en from './locales/en' +import zh from './locales/zh' + +const i18n = createI18n({ + legacy: false, + locale: 'zh', // Default to Chinese (original language) + fallbackLocale: 'zh', + messages: { + en, + zh + } +}) + +export default i18n diff --git a/frontend/src/locales/en.js b/frontend/src/locales/en.js new file mode 100644 index 000000000..2dd08b521 --- /dev/null +++ b/frontend/src/locales/en.js @@ -0,0 +1,170 @@ +export default { + common: { + start: 'Start', + back: 'Back', + next: 'Next', + cancel: 'Cancel', + confirm: 'Confirm', + upload: 'Upload', + download: 'Download', + delete: 'Delete', + save: 'Save', + edit: 'Edit', + view: 'View', + loading: 'Loading...', + processing: 'Processing', + completed: 'Completed', + error: 'Error', + success: 'Success', + status: 'Status', + settings: 'Settings', + help: 'Help', + about: 'About' + }, + home: { + nav: { + github: 'Visit our GitHub page' + }, + hero: { + tag: 'Simple and Universal Swarm Intelligence Engine', + version: '/ v0.1-beta', + title: 'Upload Any Report', + titleHighlight: 'Predict the Future Instantly', + desc: 'Even with just a piece of text, MiroFish can automatically generate a parallel world with up to millions of Agents based on the real-world seeds it contains. Inject variables from a god\'s-eye view and find "local optimal solutions" in complex group interactions.', + slogan: 'Rehearse the future in Agent groups, win decisions after hundreds of battles_' + }, + systemStatus: { + title: 'System Status', + ready: 'Ready', + readyDesc: 'Prediction engine on standby, ready to upload multiple unstructured data to initialize simulation sequence', + metrics: { + lowCost: 'Low Cost', + lowCostDesc: 'Average $5 per simulation', + highAvailability: 'High Availability', + highAvailabilityDesc: 'Up to millions of Agent simulations' + } + }, + workflow: { + title: 'Workflow Sequence', + steps: [ + { + title: 'Graph Construction', + desc: 'Real-world seed extraction & individual and group memory injection & GraphRAG construction' + }, + { + title: 'Environment Setup', + desc: 'Entity relationship extraction & persona generation & environment configuration Agent injection simulation parameters' + }, + { + title: 'Start Simulation', + desc: 'Dual platform parallel simulation & automatic parsing of prediction requirements & dynamic update of temporal memory' + }, + { + title: 'Report Generation', + desc: 'Report Agent has rich toolset for deep interaction with post-simulation environment' + }, + { + title: 'Deep Interaction', + desc: 'Chat with anyone in the simulated world & interact with Report Agent' + } + ] + }, + console: { + upload: { + label: '01 / Real-world Seeds', + formats: 'Supported formats: PDF, MD, TXT', + dragTitle: 'Drag files to upload', + dragHint: 'Or click to browse file system', + uploadedFiles: 'Uploaded files' + }, + input: { + label: '>_ 02 / Simulation Prompt', + placeholder: '// Enter simulation or prediction requirements in natural language (e.g. What public opinion trend would be triggered if Wuhan University announces revoking Xiao\'s punishment)', + engine: 'Engine: MiroFish-V1.0' + }, + button: { + start: 'Start Engine', + initializing: 'Initializing...' + } + } + }, + main: { + viewModes: { + graph: 'Graph', + split: 'Split', + workbench: 'Workbench' + }, + steps: [ + 'Graph Construction', + 'Environment Setup', + 'Start Simulation', + 'Report Generation', + 'Deep Interaction' + ], + status: { + ready: 'Ready', + error: 'Error', + building: 'Building Graph', + generating: 'Generating Ontology', + initializing: 'Initializing' + } + }, + components: { + step1: { + title: 'Graph Construction', + status: { + initializing: 'Initializing...', + uploading: 'Uploading and analyzing documents...', + generating: 'Generating ontology...', + building: 'Building knowledge graph...', + completed: 'Graph construction completed', + failed: 'Graph construction failed' + }, + buttons: { + nextStep: 'Next Step: Environment Setup' + } + }, + step2: { + title: 'Environment Setup', + description: 'Configure simulation environment and agent personas', + buttons: { + startSimulation: 'Start Simulation', + goBack: 'Go Back' + } + }, + step3: { + title: 'Start Simulation', + description: 'Run multi-agent simulation', + buttons: { + nextStep: 'Next Step: Report Generation' + } + }, + step4: { + title: 'Report Generation', + description: 'Generate analysis report from simulation results', + buttons: { + nextStep: 'Next Step: Deep Interaction' + } + }, + step5: { + title: 'Deep Interaction', + description: 'Chat with agents and explore the simulated world', + buttons: { + chat: 'Start Chat' + } + }, + history: { + title: 'Project History', + empty: 'No projects yet', + open: 'Open Project', + delete: 'Delete Project' + } + }, + errors: { + noFiles: 'No files selected', + noPrompt: 'Please enter simulation requirements', + uploadFailed: 'File upload failed', + networkError: 'Network error, please try again', + unknownError: 'Unknown error occurred' + } +} diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js new file mode 100644 index 000000000..8534b891b --- /dev/null +++ b/frontend/src/locales/zh.js @@ -0,0 +1,170 @@ +export default { + common: { + start: '开始', + back: '返回', + next: '下一步', + cancel: '取消', + confirm: '确认', + upload: '上传', + download: '下载', + delete: '删除', + save: '保存', + edit: '编辑', + view: '查看', + loading: '加载中...', + processing: '处理中', + completed: '已完成', + error: '错误', + success: '成功', + status: '状态', + settings: '设置', + help: '帮助', + about: '关于' + }, + home: { + nav: { + github: '访问我们的Github主页' + }, + hero: { + tag: '简洁通用的群体智能引擎', + version: '/ v0.1-预览版', + title: '上传任意报告', + titleHighlight: '即刻推演未来', + desc: '即使只有一段文字,MiroFish 也能基于其中的现实种子,全自动生成与之对应的至多百万级Agent构成的平行世界。通过上帝视角注入变量,在复杂的群体交互中寻找动态环境下的"局部最优解"', + slogan: '让未来在 Agent 群中预演,让决策在百战后胜出_' + }, + systemStatus: { + title: '系统状态', + ready: '准备就绪', + readyDesc: '预测引擎待命中,可上传多份非结构化数据以初始化模拟序列', + metrics: { + lowCost: '低成本', + lowCostDesc: '常规模拟平均5$/次', + highAvailability: '高可用', + highAvailabilityDesc: '最多百万级Agent模拟' + } + }, + workflow: { + title: '工作流序列', + steps: [ + { + title: '图谱构建', + desc: '现实种子提取 & 个体与群体记忆注入 & GraphRAG构建' + }, + { + title: '环境搭建', + desc: '实体关系抽取 & 人设生成 & 环境配置Agent注入仿真参数' + }, + { + title: '开始模拟', + desc: '双平台并行模拟 & 自动解析预测需求 & 动态更新时序记忆' + }, + { + title: '报告生成', + desc: 'ReportAgent拥有丰富的工具集与模拟后环境进行深度交互' + }, + { + title: '深度互动', + desc: '与模拟世界中的任意一位进行对话 & 与ReportAgent进行对话' + } + ] + }, + console: { + upload: { + label: '01 / 现实种子', + formats: '支持格式: PDF, MD, TXT', + dragTitle: '拖拽文件上传', + dragHint: '或点击浏览文件系统', + uploadedFiles: '已上传文件' + }, + input: { + label: '>_ 02 / 模拟提示词', + placeholder: '// 用自然语言输入模拟或预测需求(例.武大若发布撤销肖某处分的公告,会引发什么舆情走向)', + engine: '引擎: MiroFish-V1.0' + }, + button: { + start: '启动引擎', + initializing: '初始化中...' + } + } + }, + main: { + viewModes: { + graph: '图谱', + split: '双栏', + workbench: '工作台' + }, + steps: [ + '图谱构建', + '环境搭建', + '开始模拟', + '报告生成', + '深度互动' + ], + status: { + ready: '准备就绪', + error: '错误', + building: '构建图谱中', + generating: '生成本体中', + initializing: '初始化中' + } + }, + components: { + step1: { + title: '图谱构建', + status: { + initializing: '初始化中...', + uploading: '上传和分析文档中...', + generating: '生成本体中...', + building: '构建知识图谱中...', + completed: '图谱构建完成', + failed: '图谱构建失败' + }, + buttons: { + nextStep: '下一步: 环境搭建' + } + }, + step2: { + title: '环境搭建', + description: '配置模拟环境和智能体人设', + buttons: { + startSimulation: '开始模拟', + goBack: '返回' + } + }, + step3: { + title: '开始模拟', + description: '运行多智能体模拟', + buttons: { + nextStep: '下一步: 报告生成' + } + }, + step4: { + title: '报告生成', + description: '从模拟结果生成分析报告', + buttons: { + nextStep: '下一步: 深度互动' + } + }, + step5: { + title: '深度互动', + description: '与智能体对话,探索模拟世界', + buttons: { + chat: '开始对话' + } + }, + history: { + title: '项目历史', + empty: '暂无项目', + open: '打开项目', + delete: '删除项目' + } + }, + errors: { + noFiles: '未选择文件', + noPrompt: '请输入模拟需求', + uploadFailed: '文件上传失败', + networkError: '网络错误,请重试', + unknownError: '发生未知错误' + } +} diff --git a/frontend/src/main.js b/frontend/src/main.js index c8e37b03b..cc3d101e4 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -1,9 +1,11 @@ import { createApp } from 'vue' import App from './App.vue' import router from './router' +import i18n from './i18n' const app = createApp(App) app.use(router) +app.use(i18n) app.mount('#app') diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue index afe01a0c4..6872e1dc9 100644 --- a/frontend/src/views/Home.vue +++ b/frontend/src/views/Home.vue @@ -4,8 +4,9 @@ @@ -15,33 +16,30 @@
- 简洁通用的群体智能引擎 - / v0.1-预览版 + {{ t('home.hero.tag') }} + {{ t('home.hero.version') }}
- +

- 上传任意报告
- 即刻推演未来 + {{ t('home.hero.title') }}
+ {{ t('home.hero.titleHighlight') }}

- +
-

- 即使只有一段文字,MiroFish 也能基于其中的现实种子,全自动生成与之对应的至多百万级Agent构成的平行世界。通过上帝视角注入变量,在复杂的群体交互中寻找动态环境下的“局部最优解” -

-

- 让未来在 Agent 群中预演,让决策在百战后胜出_ +

+

- +
- +
- +
- + @@ -50,85 +48,57 @@
- +
- 系统状态 + {{ t('home.systemStatus.title') }}
- -

准备就绪

+ +

{{ t('home.systemStatus.ready') }}

- 预测引擎待命中,可上传多份非结构化数据以初始化模拟序列 + {{ t('home.systemStatus.readyDesc') }}

- - + +
-
低成本
-
常规模拟平均5$/次
+
{{ t('home.systemStatus.metrics.lowCost') }}
+
{{ t('home.systemStatus.metrics.lowCostDesc') }}
-
高可用
-
最多百万级Agent模拟
+
{{ t('home.systemStatus.metrics.highAvailability') }}
+
{{ t('home.systemStatus.metrics.highAvailabilityDesc') }}
- +
- 工作流序列 + {{ t('home.workflow.title') }}
-
- 01 -
-
图谱构建
-
现实种子提取 & 个体与群体记忆注入 & GraphRAG构建
-
-
-
- 02 +
+ {{ String(index + 1).padStart(2, '0') }}
-
环境搭建
-
实体关系抽取 & 人设生成 & 环境配置Agent注入仿真参数
-
-
-
- 03 -
-
开始模拟
-
双平台并行模拟 & 自动解析预测需求 & 动态更新时序记忆
-
-
-
- 04 -
-
报告生成
-
ReportAgent拥有丰富的工具集与模拟后环境进行深度交互
-
-
-
- 05 -
-
深度互动
-
与模拟世界中的任意一位进行对话 & 与ReportAgent进行对话
+
{{ step.title }}
+
{{ step.desc }}
- +
- +
- 01 / 现实种子 - 支持格式: PDF, MD, TXT + {{ t('home.console.upload.label') }} + {{ t('home.console.upload.formats') }}
- - - +
- 输入参数 + Input Parameters
- +
- >_ 02 / 模拟提示词 + {{ t('home.console.input.label') }}
-
引擎: MiroFish-V1.0
+
{{ t('home.console.input.engine') }}
- +
-
@@ -209,9 +179,12 @@