5 Commits

Author SHA1 Message Date
wyuc
e76d510009
feat(home): badge Deep-Interactive classrooms on card thumbnails (#478)
* feat(stage): add optional Stage.interactiveMode flag

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(db): add optional interactiveMode column on StageRecord

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(stage-storage): pass interactiveMode through save/list

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(generation): persist interactiveMode when creating a classroom

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* i18n: add classroom.deepInteractive across all locales

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(home): show Deep Interactive badge on classroom cards

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(home): move Deep Interactive badge into thumbnail corner

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* refactor(home): slim Deep Interactive badge to icon-only chip

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(home): use Tooltip component for Deep Interactive badge

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* refactor(home): move Deep Interactive badge to bottom-left corner

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(home): tighten Deep Interactive tooltip placement

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(home): close gap between Deep Interactive tooltip and badge

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(home): edge-align Deep Interactive tooltip without overlap

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* refactor: address code review

- Reuse toolbar.interactiveModeLabel instead of adding a duplicate
  classroom.deepInteractive i18n key (was identical to the existing
  label in zh-CN and semantically the same in the other 4 locales).
- Drop the v0.2.0 version tag from comments (will go stale at release).
- Document on ManifestStage that omitting interactiveMode is intentional
  — imports can't faithfully reproduce the original generation branch.
- Add a brief comment on the Tooltip's negative sideOffset explaining
  why the standard positive offset does not visually close the gap here.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 22:27:21 +08:00
杨慎
470aa5e42e
feat: inline language inference for outline and PBL generation (#412)
* feat: inline language inference in outline generation

Replace manual language selection with automatic inference from user
requirement text. The outline generator now produces a languageDirective
that propagates through the entire generation pipeline.

Key changes:
- Rewrite Language Inference section in outline prompt with decision
  rules for foreign language learning, cross-language PDF, proxy
  requests, and terminology handling
- Reorder pipeline: outlines before agents, so agent profiles can
  use the inferred languageDirective
- Pass languageDirective through scene content/actions generation
- Add SSE streaming of languageDirective from outline generation
- Remove manual language selection UI

Eval test suite:
- 50 test cases covering 9 scenario types: single-language, language
  learning, immersive, explicit instruction, code-switching, minimal
  input, user profiles, cross-language PDF, locale mismatch
- LLM-as-judge evaluation with configurable inference/judge models
- 50/50 pass rate with gemini-3-flash-preview + gpt-4o judge
- Excluded from CI (requires LLM API keys)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: remove useless attributes in test case

* feat: pass languageDirective to PBL, remove hardcoded zh-CN/en-US

- Remove pblConfig.language field, use languageDirective from outline
  inference instead
- Delete all Chinese prompt duplicates in pbl-system-prompt.ts,
  agent-templates.ts; keep English templates with languageDirective
  injection
- Remove zh-CN/en-US branches in generate-pbl.ts (initial prompt,
  post-process context, welcome message)
- Pipe languageDirective through scene-generator → generatePBLContent
  → IssueboardMCP → agent templates
- Remove i18n template wrapping from PBL welcome messages in
  pbl-renderer.tsx and use-pbl-chat.ts; use LLM-generated content
  directly to avoid language mismatch when UI locale ≠ course language
- Update pblConfig schema in outline prompt (remove language field)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: clean up legacy language fields, pass languageDirective through buildSceneFromOutline

- Add languageDirective param to buildSceneFromOutline, combining with
  outline.languageNote via buildLanguageText
- Remove dead types: AudienceProfile, StylePreferences, LegacyUserRequirements,
  SceneOutline.language
- Remove Stage.language and all its propagation (storage, stageInfo, prompt-builder fallback)
- Remove GenerateClassroomInput.language and job store inputSummary.language
- Remove unused pdfLanguageSample from outline SSE route

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: persist languageDirective to IndexedDB, fix TTS preview and dead refs

- Add languageDirective to StageRecord and stage-storage write path
- Add DB v9 migration: convert legacy language locale codes to directives
- Use voice.language for TTS preview text instead of dead localStorage key
- Omit empty ## Language section in PBL agent prompts
- Use JSON.parse for extractLanguageDirective unescape (\uXXXX support)
- Remove dead i18n keys: toolbar.languageHint, pbl.chat.welcomeMessage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 21:49:56 +08:00
杨慎
6a3bd06dec
fix: preserve preset agent selection when switching classrooms (#241)
* fix: preserve preset agent selection when switching classrooms

When switching from an auto-agent classroom to a preset classroom,
the stale generated agent IDs remained in selectedAgentIds because
the load path skipped setSelectedAgentIds when no generated agents
were found. Add a dedicated presetSelectedAgentIds field to persist
the user's preset preference separately from the runtime selection,
so auto classrooms never corrupt the user's saved preset choice.

Closes #239

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: format settings.ts with prettier

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: persist agent IDs in stage instead of global settings

Replace the global presetSelectedAgentIds approach with per-stage
agent storage. Each classroom now saves its selected agent IDs into
stage.agentIds at creation time, and restores them when the classroom
is loaded. This makes agent selection a per-classroom property rather
than a global setting that can be corrupted by auto classrooms.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* ci: retrigger CodeQL analysis

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 22:08:36 +08:00
wyuc
843d33e5cc chore: enforce Prettier formatting and fix lint issues
- Add .prettierignore to exclude vendor packages, lock files, markdown, and YAML
- Update .prettierrc: printWidth 100, singleQuote, trailingComma "all"
- Run Prettier across all source files for consistent formatting
- Fix unused imports (UserRequirements, setTTSProvider)
- Fix eslint-disable comment placement after Prettier reformat

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 16:09:45 +08:00
wyuc
0d20abfed9 Initial commit: OpenMAIC AI classroom platform
Next.js 16 App Router application with:
- AI-powered interactive classroom generation from PDF/text requirements
- Multi-agent discussion system (teacher, students, assistant roles)
- Provider abstraction for LLM, TTS, ASR, image, video, web search
- Local-first data architecture (IndexedDB/Dexie)
- i18n support (zh-CN/en-US)
- Structured logger, SSRF guard, lint/build passing (0 errors)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 16:41:07 +08:00