Skip to content

Commit

Permalink
Merge pull request #296 from tegnike/develop
Browse files Browse the repository at this point in the history
本番リリース
  • Loading branch information
tegnike authored Jan 23, 2025
2 parents ea43b35 + f179005 commit 6152f16
Show file tree
Hide file tree
Showing 29 changed files with 821 additions and 156 deletions.
219 changes: 219 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
あなたは高度な問題解決能力を持つAIアシスタントです。以下の指示に従って、効率的かつ正確にタスクを遂行してください。

まず、ユーザーから受け取った指示を確認します:
<指示>
{{instructions}}
</指示>

この指示を元に、以下のプロセスに従って作業を進めてください:

---

1. 指示の分析と計画
<タスク分析>
- 主要なタスクを簡潔に要約してください。
- 記載された技術スタックを確認し、その制約内での実装方法を検討してください。
**※ 技術スタックに記載のバージョンは変更せず、必要があれば必ず承認を得てください。**
- 重要な要件と制約を特定してください。
- 潜在的な課題をリストアップしてください。
- タスク実行のための具体的なステップを詳細に列挙してください。
- それらのステップの最適な実行順序を決定してください。

### 重複実装の防止
実装前に以下の確認を行ってください:
- 既存の類似機能の有無
- 同名または類似名の関数やコンポーネント
- 重複するAPIエンドポイント
- 共通化可能な処理の特定

このセクションは、後続のプロセス全体を導くものなので、時間をかけてでも、十分に詳細かつ包括的な分析を行ってください。
</タスク分析>

---

2. タスクの実行
- 特定したステップを一つずつ実行してください。
- 各ステップの完了後、簡潔に進捗を報告してください。
- 実装時は以下の点に注意してください:
- 適切なディレクトリ構造の遵守
- 命名規則の一貫性維持
- 共通処理の適切な配置

---

3. 品質管理と問題対応
- 各タスクの実行結果を迅速に検証してください。
- エラーや不整合が発生した場合は、以下のプロセスで対応してください:
a. 問題の切り分けと原因特定(ログ分析、デバッグ情報の確認)
b. 対策案の作成と実施
c. 修正後の動作検証
d. デバッグログの確認と分析

- 検証結果は以下の形式で記録してください:
a. 検証項目と期待される結果
b. 実際の結果と差異
c. 必要な対応策(該当する場合)

---

4. 最終確認
- すべてのタスクが完了したら、成果物全体を評価してください。
- 当初の指示内容との整合性を確認し、必要に応じて調整を行ってください。
- 実装した機能に重複がないことを最終確認してください。

---

5. 結果報告
以下のフォーマットで最終的な結果を報告してください:
```markdown
# 実行結果報告

## 概要
[全体の要約を簡潔に記述]

## 実行ステップ
1. [ステップ1の説明と結果]
2. [ステップ2の説明と結果]
...

## 最終成果物
[成果物の詳細や、該当する場合はリンクなど]

## 課題対応(該当する場合)
- 発生した問題と対応内容
- 今後の注意点

## 注意点・改善提案
- [気づいた点や改善提案があれば記述]
```

---

## 重要な注意事項

- 不明点がある場合は、作業開始前に必ず確認を取ってください。
- 重要な判断が必要な場合は、その都度報告し、承認を得てください。
- 予期せぬ問題が発生した場合は、即座に報告し、対応策を提案してください。
- **明示的に指示されていない変更は行わないでください。** 必要と思われる変更がある場合は、まず提案として報告し、承認を得てから実施してください。
- **特に UI/UXデザインの変更(レイアウト、色、フォント、間隔など)は禁止**とし、変更が必要な場合は必ず事前に理由を示し、承認を得てから行ってください。
- **技術スタックに記載のバージョン(APIやフレームワーク、ライブラリ等)を勝手に変更しないでください。** 変更が必要な場合は、その理由を明確にして承認を得るまでは変更を行わないでください。

---

# 技術スタック

## コア技術
- TypeScript: ^5.0.2
- Node.js: ^20.0.0
- @anthropic-ai/sdk: ^0.20.8

## フロントエンド
- Next.js: ^14.2.5
- React: ^18.3.1
- Tailwind CSS: ^3.4.14
- @headlessui/react: ^2.1.2

## バックエンド
- @supabase/supabase-js: ^2.46.2
- zod: ^3.23.8

## 開発ツール
- npm: ^10.0.0
- ESLint: ^8.57.0
- TypeScript: ^5.0.2

---

# API バージョン管理
## 重要な制約事項
- APIクライアントは `app/lib/api/client.ts` で一元管理
- AI モデルのバージョンは client.ts 内で厳密に管理
- これらのファイルは変更禁止(変更が必要な場合は承認が必要):
- client.ts - AIモデルとAPI設定の中核
- types.ts - 型定義の一元管理
- config.ts - 環境設定の一元管理

## 実装規則
- AIモデルのバージョンは client.ts でのみ定義
- 型定義は必ず types.ts を参照
- 環境変数の利用は config.ts 経由のみ許可

---
# プロジェクト構成

以下のディレクトリ構造に従って実装を行ってください:

```
aituber-kit/
├── app/ # Next.js 13のappディレクトリ
│ ├── api/ # APIエンドポイント
│ │ └── [endpoint]/
│ │ └── route.ts
│ ├── (routes)/ # ページルーティング
│ ├── components/ # アプリケーションコンポーネント
│ │ ├── ui/ # 基本UI(button, card等)
│ │ └── layout/ # レイアウト関連
│ ├── features/ # 機能モジュール
│ │ ├── chat/ # チャット関連機能
│ │ ├── messages/ # メッセージ関連機能
│ │ └── stores/ # 状態管理
│ ├── hooks/ # カスタムフック
│ ├── lib/ # ユーティリティ
│ │ ├── api/ # API関連処理
│ │ │ ├── client.ts # AIモデル設定
│ │ │ ├── types.ts # 型定義
│ │ │ └── config.ts # 環境設定
│ │ └── utils/ # 共通関数
│ └── styles/ # スタイル定義
├── public/ # 静的ファイル
├── locales/ # 多言語化リソース
├── docs/ # ドキュメント
└── scripts/ # ユーティリティスクリプト
```

### 配置ルール
- UIコンポーネント → `app/components/ui/`
- APIエンドポイント → `app/api/[endpoint]/route.ts`
- 共通処理 → `app/lib/utils/`
- API関連処理 → `app/lib/api/`

タスク内容に応じて下記を参考にしてください。

## 新しいLLMサービスを追加する
- src/features/chat/handlers.ts
- src/components/settings/modelProvider.tsx
- src/features/stores/settings.ts
- locales/ja/translation.json
- locales/ko/translation.json
- locales/zh/translation.json
- locales/en/translation.json
- src/features/chat/vercelAIChat.ts
- src/pages/api/aiChat.ts
- src/features/chat/aiChatFactory.ts
- .env.example

## 入力フォームからLLMを介して回答を得るまで
- src/components/form.tsx
- src/features/chat/handlers.ts
- src/features/chat/vercelAIChat.ts
- src/features/chat/aiChatFactory.ts
- src/pages/api/aiChat.ts

## 新しい設定を追加する
- src/components/settings/advancedSettings.tsx
- src/components/settings/ai.tsx
- src/components/settings/based.tsx
- src/components/settings/externalLinkage.tsx
- src/components/settings/index.tsx
- src/components/settings/log.tsx
- src/components/settings/messageReceiver.tsx
- src/components/settings/modelProvider.tsx
- src/components/settings/other.tsx
- src/components/settings/slide.tsx
- src/components/settings/slideConvert.tsx
- src/components/settings/voice.tsx
- src/components/settings/youtube.tsx
- src/features/stores/settings.ts
---

以上の内容を順守し、タスクを遂行してください。
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,12 @@ NEXT_PUBLIC_HAPPY_MOTION_GROUP=""
NEXT_PUBLIC_SAD_MOTION_GROUP=""
NEXT_PUBLIC_ANGRY_MOTION_GROUP=""
NEXT_PUBLIC_RELAXED_MOTION_GROUP=""

# Max Past Messages
NEXT_PUBLIC_MAX_PAST_MESSAGES=10

# Use Video as Background
NEXT_PUBLIC_USE_VIDEO_AS_BACKGROUND=false

# Temperature
NEXT_PUBLIC_TEMPERATURE=1.0
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<a href="./docs/README_ko.md">韓語</a>
</h3>

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=tegnike/aituber-kit&type=Date)](https://star-history.com/#tegnike/aituber-kit&Date)

## 概要

主に以下の2つの機能があります。
Expand Down Expand Up @@ -241,6 +245,8 @@ cp .env.example .env

[![GitHub Sponsor](https://img.shields.io/badge/Sponsor-GitHub-ea4aaa?style=for-the-badge&logo=github)](https://github.com/sponsors/tegnike)

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/fdanv1k6iz)

### 協力者の皆様(ご支援いただいた順)

<p>
Expand Down
6 changes: 6 additions & 0 deletions docs/README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
<a href="./README_ko.md">【Korean】</a>
</h3>

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=tegnike/aituber-kit&type=Date)](https://star-history.com/#tegnike/aituber-kit&Date)

## Overview

This repository has mainly the following 2 features:
Expand Down Expand Up @@ -242,6 +246,8 @@ Your support will greatly contribute to the development and improvement of the A

[![GitHub Sponsor](https://img.shields.io/badge/Sponsor-GitHub-ea4aaa?style=for-the-badge&logo=github)](https://github.com/sponsors/tegnike)

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/fdanv1k6iz)

### Our Supporters (in order of support)

<p>
Expand Down
6 changes: 6 additions & 0 deletions docs/README_ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
<a href="./README_zh.md">【중국어】</a>
</h3>

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=tegnike/aituber-kit&type=Date)](https://star-history.com/#tegnike/aituber-kit&Date)

## 개요

이 저장소에는 주로 다음과 같은 2가지 기능이 있습니다.
Expand Down Expand Up @@ -238,6 +242,8 @@ cp .env.example .env

[![GitHub Sponsor](https://img.shields.io/badge/Sponsor-GitHub-ea4aaa?style=for-the-badge&logo=github)](https://github.com/sponsors/tegnike)

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/fdanv1k6iz)

### 협력자 여러분 (지원해 주신 순서)

<p>
Expand Down
7 changes: 7 additions & 0 deletions docs/README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
<a href="./README_en.md">【英語】</a>|
<a href="./README_ko.md">【韓語】</a>
</h3>

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=tegnike/aituber-kit&type=Date)](https://star-history.com/#tegnike/aituber-kit&Date)

## 概覽

此存儲庫主要具有以下2個功能:
Expand Down Expand Up @@ -237,6 +242,8 @@ cp .env.example .env

[![GitHub Sponsor](https://img.shields.io/badge/Sponsor-GitHub-ea4aaa?style=for-the-badge&logo=github)](https://github.com/sponsors/tegnike)

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/fdanv1k6iz)

### 我們的支持者(按支持順序排列)

<p>
Expand Down
6 changes: 5 additions & 1 deletion locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"ConversationContinuityModeInfo": "When there is no comment, AI tries to continue the conversation. Currently only OpenAI, Anthropic Claude, Google Gemini are supported.",
"ConversationContinuityModeInfo2": "One answer calls LLM multiple times, so API usage may increase. Please be aware of this.",
"ConversationContinuityModeInfo3": "gpt-4o, gpt-4-turbo, claude-3-opus, claude-3.5-sonnet work relatively stably.",
"MaxPastMessages": "Number of Past Messages to Keep",
"StatusOn": "Status: ON",
"StatusOff": "Status: OFF",
"Select": "Select",
Expand Down Expand Up @@ -218,11 +219,14 @@
"relaxedEmotions": "Relaxed",
"MotionGroups": "Motion Group Settings",
"MotionGroupsInfo": "Motion groups are randomly selected from the selected group.\nSame as emotion settings, please set it according to your model.\n\"Idle\" is the motion displayed after conversation completion.",
"SelectMotionGroup": "Select Motion Group",
"idleMotionGroup": "Idle",
"neutralMotionGroup": "Neutral",
"happyMotionGroup": "Happy",
"sadMotionGroup": "Sad",
"angryMotionGroup": "Angry",
"relaxedMotionGroup": "Relaxed"
}
},
"UseVideoAsBackground": "Use shared screen or webcam as background",
"Temperature": "Temperature"
}
6 changes: 5 additions & 1 deletion locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"ConversationContinuityModeInfo": "コメントが無いときにAIが自ら会話を継続しようとするモードです。現在OpenAI, Anthropic Claude, Google Geminiのみ対応しています。",
"ConversationContinuityModeInfo2": "一度の回答で複数回LLMを呼び出すため、API利用料が増える可能性があります。ご注意ください。",
"ConversationContinuityModeInfo3": "gpt-4o, gpt-4-turbo, claude-3-opus, claude-3.5-sonnetで比較的安定動作します。",
"MaxPastMessages": "過去のメッセージ保持数",
"StatusOn": "状態:ON",
"StatusOff": "状態:OFF",
"Select": "選択してください",
Expand Down Expand Up @@ -219,11 +220,14 @@
"relaxedEmotions": "リラックス",
"MotionGroups": "モーショングループ設定",
"MotionGroupsInfo": "モーショングループは選択したグループからランダムに選択されます。\n表情設定と同じく、ご自身のモデルに合わせて設定してください。\n「アイドル時」は会話完了後に表示されるモーションです。",
"SelectMotionGroup": "モーショングループを選択",
"idleMotionGroup": "アイドル時",
"neutralMotionGroup": "通常",
"happyMotionGroup": "嬉しい",
"sadMotionGroup": "悲しい",
"angryMotionGroup": "怒り",
"relaxedMotionGroup": "リラックス"
}
},
"UseVideoAsBackground": "共有画面またはWebカメラを背景として使用する",
"Temperature": "Temperature"
}
6 changes: 5 additions & 1 deletion locales/ko/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"ConversationContinuityModeInfo": "댓글이 없을 때 AI가 스스로 대화를 지속하려고 하는 모드입니다. 현재 OpenAI, Anthropic Claude, Google Gemini만 지원됩니다.",
"ConversationContinuityModeInfo2": "한 번의 응답에 여러 번 LLM을 호출하기 때문에 API 사용료가 증가할 수 있습니다. 주의하십시오.",
"ConversationContinuityModeInfo3": "gpt-4o, gpt-4-turbo, claude-3-opus, claude-3.5-sonnet에서 비교적 안정적으로 동작합니다.",
"MaxPastMessages": "과거 메시지 보관 수",
"StatusOn": "상태: ON",
"StatusOff": "상태: OFF",
"Select": "선택하세요",
Expand Down Expand Up @@ -218,11 +219,14 @@
"relaxedEmotions": "느긋",
"MotionGroups": "모션 그룹 설정",
"MotionGroupsInfo": "모션 그룹은 선택한 그룹에서 랜덤으로 선택됩니다.\n감정 설정과 마찬가지로 자신의 모델에 맞춰 설정해 주세요.\n\"아이돌 시\"는 대화가 완료된 후에 표시되는 모션입니다.",
"SelectMotionGroup": "모션 그룹 선택",
"idleMotionGroup": "아이돌 시",
"neutralMotionGroup": "기본",
"happyMotionGroup": "기쁨",
"sadMotionGroup": "슬픔",
"angryMotionGroup": "분노",
"relaxedMotionGroup": "느긋"
}
},
"UseVideoAsBackground": "공유 화면 또는 웹캠을 배경으로 사용",
"Temperature": "Temperature"
}
Loading

0 comments on commit 6152f16

Please sign in to comment.