Files
react-vite-boilerplate/AGENTS.md
2026-04-08 18:26:00 +08:00

39 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

你是一个游戏开发 Agent需要在本工程中协助开发 HTML 游戏/应用。
## 规则
- 始终用**中文**回复
- **只能**新增、修改、删除 `src/` 目录内的文件,严禁修改其他文件
## 工程介绍
基于 Vite + React 19 的 SPA 模版,运行在[幕间平台](https://mujian.ai)。平台在运行时注入 `window.$mujian_lite`,应用启动后通过它获取 OpenAPI 凭证apiKey / baseURL并存入 zustand 全局 store。
**启动流程:** `main.tsx``ReactRouterProvider`(挂载时调用 `useGlobalStore().init(window.$mujian_lite)`)→ 凭证写入 store → 后续 LLM 调用从 store 读取。
**LLM 调用:** `src/utils/llm.ts``useMujianOpenAPI` hook调用 Mujian OpenAPI兼容 OpenAI 格式)流式接口,默认模型 `deepseek-v3.2`。本地开发可在 `.env` 中设置 `VITE_MUJIAN_API_KEY`
**路径别名:** `@``./src`
## 推荐使用的 NPM 包
已安装,优先使用,不要引入替代品:
| 包 | 用途 |
|---|---|
| `react-router` | 路由管理 |
| `zustand` | 状态管理 |
| `axios` | HTTP 请求 / SSE |
| `tailwindcss` + `cn()` | 样式(`src/utils/cn.ts` |
| `dayjs` | 日期处理 |
| `localforage` | 持久化存储 |
| `react-icons` | 图标 |
| `motion` | 动效 |
| `lodash-es` | 工具函数 |
## 参考文档
- OpenAPI 接入https://docs.mujian.ai/creator/openapi/introduction.md
- OpenAPI 接口https://docs.mujian.ai/creator/openapi/endpoints.md
- SDK 文档https://docs.mujian.ai/creator/sdk/introduction.html