Commit Graph

273 Commits

Author SHA1 Message Date
Laurens Profittlich 396e7ed2fb
Merge 8dfa7645e6 into 96096ea0ff 2026-06-10 10:13:54 +00:00
profikid 8dfa7645e6 fix: prevent frontend from killing in-progress simulations on view mount
- frontend/src/views/SimulationView.vue: remove onMounted auto-stop of running
  simulations. Step 3's handleGoBack() already stops the sim when the user
  explicitly clicks 'Back', so onMounted only killed sims when users opened
  the sim URL directly or refreshed Step 2 (the 'loading error' symptom).
- backend/scripts/run_parallel_simulation.py: lower OASIS semaphore from 30
  to 8 to fit the 8GB host's memory budget.
- backend/vendor/camel-oasis/oasis/social_agent/agents_generator.py: add
  .get() defaults for mbti/gender/age/country to handle sparse agent
  profiles (KeyError: 'mbti' bug).
2026-06-10 10:13:02 +00:00
Laurens Profittlich 12669495bb
i18n: translate all Chinese in codebase to English; add Dutch locale as default (#1)
Frontend (.vue, .js, .ts):
- All Chinese in HTML comments, JS comments, CSS comments translated
- All hardcoded Chinese UI strings (titles, alerts, console errors) translated
- The few remaining Chinese fragments in Step2EnvSetup.vue (4) and
  Step4Report.vue (77) are intentional: stage-name identifiers that
  must match what the backend emits, and LLM-output parser patterns
  that match Chinese section headers in the LLM response.

Backend (Python):
- All # comments, """ and ''' docstrings translated
- All log/print/raise/error message strings translated
- All LLM system prompts (ONTOLOGY_SYSTEM_PROMPT, _PROMPT, _INSTRUCTION,
  _TEMPLATE, _TASK_PROMPT, _EXTRACTOR, _PLANNER, _REPORTER, _SUMMARY,
  _OUTLINE, _SYNTHESIS, _REWRITE, _SEARCH_PROMPT, _INTERVIEW, _REFLECTION,
  _REACT, _ROLE, _CONTEXT, _GUIDELINES, _AGENT, _MESSAGE, _EXAMPLE,
  _SYNTHESIZER, _WRITER, _CRITIQUE, _REVISION, _FEEDBACK, _PERSONA,
  _FORMAT, _JUDGE, _ROUTER, _SECTION_PLANNER, _PARSER, _EXTRACT,
  _RATIONALE variables) translated
- stage-name string literals in zep_graph_memory_updater.py (return
  values used as Zep episode content) translated
- LLM-output parser patterns in zep_tools.py and report_agent.py
  (e.g. text.match(/分析问题:/) and section headers like
  '### 【关键事实】') kept as Chinese, because they match the
  LLM's output format.

i18n:
- locales/zh.json: kept as source of truth for Chinese strings
- locales/en.json: kept (was already a complete English translation)
- locales/nl.json: NEW — full Dutch (Nederlands) translation of
  en.json (633 leaf keys, all interpolation placeholders preserved)
- locales/languages.json: added 'nl' entry with label 'Nederlands'
  and llmInstruction 'Antwoord in het Nederlands.'

Frontend i18n config:
- frontend/src/i18n/index.js: default locale changed from 'zh' to 'nl',
  fallback locale from 'zh' to 'en'. Dutch is now the default UI
  language; English is the fallback.

Misc:
- package.json: description translated
- docker-compose.yml: inline comment translated
- README.md / README-ZH.md / locales/zh.json / locales/languages.json:
  Chinese content intentionally preserved (bilingual readme pointers
  and language-metadata source of truth)

Files: 59 changed, +6810 / -6102

Co-authored-by: hermes <hermes@profikid.nl>
2026-06-10 12:28:40 +07:00
hermes 62489ad4f9 feat(frontend): add /graph/:id redirect view + merge graph projects into home history
- New GraphView.vue: lightweight page at /graph/<id> that resolves a
  graph_id back to its owning project_id via /api/graph/project/list,
  then router-replaces to /process/<projectId> so the existing project
  page handles the full graph visualisation.
- HistoryDatabase.vue: fetch /api/simulation/history and /api/graph/project/list
  in parallel and merge by project_id (sims win on conflict, project list
  fills the gap so home history is non-empty for users who only built
  graphs). Newest first by created_at.
- frontend/src/api/graph.js: add listProjects(limit) wrapper.
- frontend/src/router/index.js: register /graph/:id route, props: true.
- frontend/src/api/index.js: switch VITE_API_BASE_URL fallback from ||
  to ?? so an empty string is honoured (Vite uses empty to mean 'same
  origin', letting Traefik reverse-proxy /api/* to the backend container
  without an absolute baseURL).
- Dockerfile: VITE_API_BASE_URL="" baked in at build time (default).
- graphiti_service.py: strip lowercase <think> / <antmlthinking> reasoning
  blocks in addition to <think> (M2.7 vs M3/Qwen emit different
  reasoning tags); accept M2.7's 'entity_types' plural list shape in
  _normalize_extraction_payload.
2026-06-10 01:29:30 +00:00
ENI d8643a309a deploy/README: document the companion FalkorDB Browser stack at falkor.agent.profikid.nl
The browser lives at /docker/falkordb-browser/ on the host (separate from
the MiroFish stack so they can be restarted independently). It joins the
mirofish_net bridge network as 'external' and dials the same FalkorDB
sidecar the MiroFish app uses. Users sign in via the browser UI by entering
host=falkordb, port=6379, empty user/pass — the connection is server-side
from inside the browser container, so the user's machine doesn't need
direct access to the Docker network.
2026-06-09 14:14:10 +00:00
ENI ee3609d439 Productionize: add ingest_text one-call API, ontology JSON retry, README fork notice, e2e Dockerfile path fix
- backend/app/api/graph.py: add POST /api/graph/ingest_text
  (one-call: project + ontology + async build + returns project_id/task_id)
  Designed for cron automations that need to ingest a markdown briefing
  without the 3-step project -> ontology -> build dance.

- backend/app/services/ontology_generator.py: bump max_tokens 4096->16384
  and add a retry-with-compact-prompt path on JSON parse failure.
  M3 truncates long entity-attribute arrays; the retry asks for a stripped
  schema (no attributes, 6 entity types max, 6 edge types max).

- deploy/Dockerfile.e2e: build context is the project root, so COPY
  needs the deploy/ prefix; entrypoint uses 'uv run python' because
  the MiroFish image is uv-managed (flask/graphiti/falkordb all live
  under /app/backend/.venv).

- README.md: replace Zep + Qwen references with the Graphiti+FalkorDB
  stack and MiniMax M-series LLMs; add 'About this fork' section
  documenting the deploy overlay, ingest_text API, and cron integration.
2026-06-09 13:58:08 +00:00
ENI 9decc6c6f4 deploy: add agent.profikid.nl overlay (compose + FalkorDB sidecar, e2e one-shot, bootstrap/up/health scripts, README) + gitignore secrets.env 2026-06-09 13:57:34 +00:00
ENI 1b62a3c5b8 Refactor: replace Zep with Graphiti+FalkorDB (FalkorDriver adapter, M3 LLM, deterministic embedder) + add e2e test, docker-compose, e2e one-shot, deploy notes 2026-06-09 13:56:34 +00:00
BaiFu 96096ea0ff
Merge pull request #640 from lllopic/fix/add-type-hints-and-helper-method
refactor: add type hints and FileParser.is_supported() helper
2026-05-25 00:48:57 +08:00
666ghj 3f4d56116c fix(backend): constrain Python version to 3.11-3.12 2026-05-24 22:59:36 +08:00
BaiFu db1bc144ff
Merge pull request #641 from YunyueLi/docs/readme-polish
docs(readme): fix typo in Shanda logo alt text
2026-05-24 02:02:46 +08:00
YunyueLi faa151131c docs(readme): fix typo in Shanda logo alt text
The Shanda sponsor logo's alt text was `666ghj%2MiroFish | Shanda`,
missing the `F` from the URL-encoded `/`. Every other badge in both
READMEs uses the correct `666ghj%2FMiroFish`. Bring this one in line
with the rest.
2026-05-23 16:30:55 +08:00
lllopic daec4b6be4 refactor: add type hints and FileParser.is_supported() helper
- Add return type annotation (list[str]) to Config.validate()
- Add type annotations (msg: str, -> None) to logger convenience functions
- Add FileParser.is_supported() classmethod for checking file format support
2026-05-23 14:57:46 +08:00
666ghj fa0f6519b1 docs: rename README-EN.md to README.md as default English documentation 2026-04-02 16:52:29 +08:00
666ghj 0e9420e0f8 docs: rename README.md to README-ZH.md for Chinese documentation 2026-04-02 16:52:29 +08:00
BaiFu 7d07fb7f03
Merge pull request #440 from Ghostubborn/fix/security-deps
fix(security): 修复前端 3 个高危依赖漏洞
2026-04-02 15:17:46 +08:00
ghostubborn 223b283da7 fix(security): upgrade axios, rollup, picomatch to fix 3 high severity vulnerabilities 2026-04-02 15:00:33 +08:00
BaiFu af71244974
Merge pull request #428 from Ghostubborn/feat/i18n
feat(i18n): 添加多语言切换功能,支持中英文
2026-04-02 14:27:04 +08:00
ghostubborn ed465908db fix(i18n): set HTML lang attribute before Vue mounts via inline script 2026-04-02 14:21:09 +08:00
ghostubborn 65df257e19 chore(deps): upgrade vue-i18n from v9 to v11 2026-04-02 14:20:50 +08:00
ghostubborn f2404903d6 fix(i18n): validate Accept-Language header against registered locales 2026-04-02 14:20:15 +08:00
ghostubborn 2421010fe1 fix(i18n): fix English workflow desc font size with correct CSS selectors 2026-04-01 19:11:22 +08:00
ghostubborn 3929c3ade2 fix(i18n): further shorten English metrics and improve workflow layout 2026-04-01 19:07:19 +08:00
ghostubborn 21922da6cc fix(i18n): improve English layout for homepage left-pane and report title
- Add sans-serif font for English left-pane (status, workflow sections)
- Shorten English workflow step descriptions
- Reduce English report title font-size from 36px to 28px
2026-04-01 19:04:38 +08:00
ghostubborn c6cafdd532 fix(i18n): translate world1/world2 platform labels in interview tool display 2026-04-01 18:38:22 +08:00
ghostubborn 5072a2eaa8 feat(i18n): replace Chinese UI text in Step4Report.vue render functions
Only UI display text is replaced. Regex parsing patterns are kept as-is
since they match the backend output format.
2026-04-01 18:35:18 +08:00
ghostubborn 6db3f98a48 fix(i18n): fix English homepage layout with proper font and shorter copy
- Use sans-serif font for English titles, descriptions and navbar
- Shorten English hero text to avoid overflow
- Fix :global() scoped CSS issue that was setting root font-size to 3.5rem
- Use separate unscoped style block for html[lang] selectors
2026-04-01 18:04:05 +08:00
ghostubborn 24e9bee5be feat(i18n): replace all user-visible Chinese logger messages in zep_tools.py
These are shown to users via ConsoleLogger in the report page.
2026-04-01 17:46:39 +08:00
ghostubborn e79569ab4f feat(i18n): replace all user-visible Chinese in report_agent.py
Covers ReportLogger message fields and logger messages shown via ConsoleLogger.
2026-04-01 17:44:52 +08:00
ghostubborn 1d358fc492 feat(i18n): replace expand/collapse Chinese text in Step4Report.vue 2026-04-01 17:44:45 +08:00
666ghj e3350a919d fix(graph): enforce PascalCase for entity names and SCREAMING_SNAKE_CASE for edge names in ontology validation 2026-04-01 17:42:27 +08:00
ghostubborn 380e456d41 fix(i18n): replace hardcoded Chinese stage names in simulation prepare SSE 2026-04-01 17:31:00 +08:00
ghostubborn 3a8451c119 feat(i18n): replace remaining hardcoded Chinese in frontend addLog calls 2026-04-01 17:21:55 +08:00
ghostubborn 0e55e4cf6b feat(i18n): replace remaining Chinese in config generator and profile generator
Also update simulation prompts to be locale-neutral for timezone/schedule.
2026-04-01 17:19:12 +08:00
ghostubborn 7c07237544 fix(i18n): pass locale to background threads via thread-local storage
Background threads (graph building, simulation prep, report generation,
profile generation) now inherit the requesting user's locale preference.
Previously these fell back to 'zh' because Flask request context was
unavailable in spawned threads.
2026-04-01 16:55:51 +08:00
ghostubborn 592ee52f59 feat(i18n): replace remaining hardcoded Chinese in progress callbacks 2026-04-01 16:53:29 +08:00
ghostubborn da2490ec31 fix(i18n): protect JSON field values from language instruction in config generator
Ensure poster_type stays PascalCase English and stance stays English enum
values regardless of language setting. Only natural language fields follow
the user's language preference.
2026-04-01 16:41:22 +08:00
ghostubborn 97aa58384e fix(i18n): ensure ontology names stay PascalCase regardless of language setting
The language instruction was causing LLM to change entity/relation naming
conventions. Now explicitly enforce PascalCase/UPPER_SNAKE_CASE for technical
identifiers while only applying language preference to description fields.
2026-04-01 16:40:17 +08:00
ghostubborn e1db8bacc2 feat(i18n): replace hardcoded Chinese in frontend addLog() messages 2026-04-01 16:35:35 +08:00
ghostubborn 9d43b77511 feat(i18n): replace hardcoded Chinese in backend SSE progress messages 2026-04-01 16:32:10 +08:00
ghostubborn ffe6369c52 fix(i18n): fix curly quotes in Home.vue and remove unused dark theme from LanguageSwitcher 2026-04-01 16:23:52 +08:00
ghostubborn f75c6487b3 fix(i18n): replace remaining hardcoded language directives in LLM prompts
- oasis_profile_generator: replace hardcoded "使用中文" with dynamic get_language_instruction()
- ontology_generator: remove hardcoded "(中文)" from schema annotation
- report_agent: replace Chinese-specific language consistency rules with language-neutral ones
- zep_tools: dynamically select quote style based on locale
2026-04-01 15:55:04 +08:00
ghostubborn fbaa3dbbeb fix(i18n): fix curly quotes and missing @ alias in vite config 2026-04-01 15:45:43 +08:00
ghostubborn fc47ae81b5 feat(i18n): replace hardcoded Chinese in frontend components with i18n calls
Replace all user-visible hardcoded Chinese strings in 7 component files
with $t() / t() calls using vue-i18n:

- Step1GraphBuild: ontology generation, graph build, status badges
- Step2EnvSetup: simulation setup, agent personas, platform config,
  time config, initial activation, modal profile details
- Step3Simulation: report generation button
- Step4Report: section loading text, interaction button
- Step5Interaction: chat interface, survey UI, tool descriptions,
  error messages, agent selection
- GraphPanel: graph status hints, loading states, tooltips
- HistoryDatabase: history cards, modal, replay buttons

Added missing translation keys to both zh.json and en.json locale files.
Added useI18n imports to components that need script-level translations.
2026-04-01 15:43:11 +08:00
ghostubborn 70833821a2 feat(i18n): replace hardcoded Chinese in frontend views with i18n calls 2026-04-01 15:36:29 +08:00
ghostubborn 74f673a238 feat(i18n): replace hardcoded Chinese in backend API responses with t() calls 2026-04-01 15:32:24 +08:00
ghostubborn 3d5e5d024d feat(i18n): add language switcher component to navigation 2026-04-01 15:24:58 +08:00
ghostubborn 8f6110df0f feat(i18n): inject language instruction into LLM system prompts 2026-04-01 15:24:12 +08:00
ghostubborn 22bf50f877 feat(i18n): set up vue-i18n with dynamic locale loading 2026-04-01 15:22:14 +08:00
ghostubborn 0c18e1aeca feat(i18n): add backend translation utility with shared locale files 2026-04-01 15:22:14 +08:00