From 1e5481f0a68955fdd8453906e152ca9e6f0c6fa7 Mon Sep 17 00:00:00 2001 From: RainbowBird Date: Sun, 30 Mar 2025 03:16:53 +0800 Subject: [PATCH] feat: airi card (#98) --- apps/stage-web/locales/en.yml | 21 ++ apps/stage-web/locales/zh-CN.yml | 98 +++--- apps/stage-web/package.json | 1 + .../src/components/Settings/Section.vue | 9 +- .../airi-card/components/AiriCardView.vue | 296 ++++++++++++++++++ .../src/pages/settings/airi-card/index.vue | 153 +++++++++ apps/stage-web/src/pages/settings/index.vue | 6 + packages/ccc/README.md | 2 +- packages/ccc/src/define/card.ts | 40 ++- packages/ccc/src/export/json.ts | 12 +- packages/stage-ui/package.json | 2 + .../stage-ui/src/components/Button/Button.vue | 2 - .../components/Form/Radio/RadioCardDetail.vue | 2 +- .../Form/RadioCardDetailManySelect.vue | 4 +- packages/stage-ui/src/stores/chat.ts | 17 +- .../stage-ui/src/stores/modules/airi-card.ts | 242 ++++++++++++++ packages/stage-ui/src/stores/modules/index.ts | 1 + pnpm-lock.yaml | 39 ++- 18 files changed, 870 insertions(+), 77 deletions(-) create mode 100644 apps/stage-web/src/pages/settings/airi-card/components/AiriCardView.vue create mode 100644 apps/stage-web/src/pages/settings/airi-card/index.vue create mode 100644 packages/stage-ui/src/stores/modules/airi-card.ts diff --git a/apps/stage-web/locales/en.yml b/apps/stage-web/locales/en.yml index 06fcf447d..acaea67ea 100644 --- a/apps/stage-web/locales/en.yml +++ b/apps/stage-web/locales/en.yml @@ -70,6 +70,27 @@ settings: microphone: Microphone models: Model pages: + card: + title: Airi Card + description: Use Airi character card presets + upload: Upload + delete: Delete + active: Active + activate: Activate + delete_card: Delete Card + delete_confirmation: Are you sure you want to delete this card? + card_not_found: Card not found + created_by: created by + creator_notes: Creator Notes + description_label: Description + character: Character + personality: Personality + scenario: Scenario + systemprompt: System Prompt + posthistoryinstructions: Post-History Instructions + modules: Modules + voice_id: Voice ID + cancel: Cancel memory: description: Where memories got stored, and organized title: Memory diff --git a/apps/stage-web/locales/zh-CN.yml b/apps/stage-web/locales/zh-CN.yml index 068405eb2..5a4540130 100644 --- a/apps/stage-web/locales/zh-CN.yml +++ b/apps/stage-web/locales/zh-CN.yml @@ -56,6 +56,27 @@ settings: microphone: 麦克风 models: 模型 pages: + card: + title: Airi 角色卡 + description: 使用 Airi 角色卡预设 + voice_id: 声音 ID + upload: 上传 + delete: 删除 + active: 已激活 + activate: 激活 + delete_card: 删除角色卡 + delete_confirmation: 确定要删除这张角色卡吗? + card_not_found: 未找到角色卡 + created_by: 创建者 + creator_notes: 创建者笔记 + description_label: 描述 + character: 角色设定 + personality: 性格 + scenario: 场景 + systemprompt: 系统提示词 + posthistoryinstructions: 历史提示指令 + modules: 模块 + cancel: 取消 memory: description: 存放记忆的地方,以及策略 title: 记忆体 @@ -294,51 +315,51 @@ settings: presets: - colors: - Airi 绿 - description: The default greenish theme color, brought by Airi to you! + description: 默认的绿色主题,由 Airi 为您带来! title: 默认颜色 - colors: - - Taupe - - Beige - - Ash Grey - - Light Taupe - - Ivory - - Olive Grey - - Sand - - Warm Grey - description: Soft, muted tones inspired by Giorgio Morandi's paintings + - 灰褐色 + - 米色 + - 灰白色 + - 浅灰褐色 + - 象牙色 + - 橄榄灰 + - 沙色 + - 暖灰色 + description: 受乔治·莫兰迪绘画启发的柔和、低调的色调 title: Morandi 颜色 - colors: - - Sky Blue - - Mist - - Sand - - Moss Green - - Water Lily - - Wheat - - Slate Blue - - Sage - description: Impressionist palette inspired by Claude Monet's works + - 天蓝色 + - 薄雾色 + - 沙色 + - 苔藓绿 + - 睡莲色 + - 小麦色 + - 板岩蓝 + - 鼠尾草色 + description: 受克劳德·莫奈作品启发的印象派调色板 title: 莫奈颜色 - colors: - - Tan - - Warm Taupe - - Umber - - Coffee - - Bronze - - Gold - - Mustard - - Amber - description: Traditional Japanese color palette + - 棕褐色 + - 暖灰褐色 + - 赭色 + - 咖啡色 + - 青铜色 + - 金色 + - 芥末色 + - 琥珀色 + description: 传统日本色彩调色板 title: 日本颜色 - colors: - - Nordic Blue - - Ice - - Fjord - - Steel - - Glacier - - Slate - - Cloud - - Stone - description: Scandinavian minimalist color scheme + - 北欧蓝 + - 冰色 + - 峡湾色 + - 钢铁色 + - 冰川色 + - 板岩色 + - 云色 + - 石头色 + description: 北欧极简主义配色方案 title: 北欧颜色 - colors: - 霞光红 @@ -349,7 +370,8 @@ settings: - 缃色 - 青冥 - 赭石 - description: Traditional Chinese colors, derived from ancient textiles, porcelain and paintings + description: >- + 中国传统色彩,源自古代纺织品、瓷器和绘画 title: 中国传统颜色 title: 预设 title: 外观 diff --git a/apps/stage-web/package.json b/apps/stage-web/package.json index bc7a8fcff..e71423e3c 100644 --- a/apps/stage-web/package.json +++ b/apps/stage-web/package.json @@ -36,6 +36,7 @@ "@pixiv/three-vrm": "^3.3.6", "@pixiv/three-vrm-animation": "^3.3.6", "@pixiv/three-vrm-core": "^3.3.6", + "@proj-airi/ccc": "workspace:^", "@proj-airi/drizzle-duckdb-wasm": "workspace:^", "@proj-airi/elevenlabs": "workspace:^", "@proj-airi/provider-transformers": "workspace:^", diff --git a/apps/stage-web/src/components/Settings/Section.vue b/apps/stage-web/src/components/Settings/Section.vue index 80214e500..e9f945caa 100644 --- a/apps/stage-web/src/components/Settings/Section.vue +++ b/apps/stage-web/src/components/Settings/Section.vue @@ -1,15 +1,18 @@