Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
207dc46
ConfigBase and Test
UnCLAS-Prommer Jan 12, 2026
5352f67
System Not Ready
UnCLAS-Prommer Jan 12, 2026
072939e
remove uvlock
UnCLAS-Prommer Jan 12, 2026
afb993e
remove webui
UnCLAS-Prommer Jan 12, 2026
13f095f
使用Sourcery的Test,修复测出来的Bug
UnCLAS-Prommer Jan 12, 2026
fd46d8a
Merge branch 'dev' into r-dev
UnCLAS-Prommer Jan 12, 2026
9186d14
解决ConfigBase问题,更严格测试,实际测试
UnCLAS-Prommer Jan 15, 2026
7c23c64
怎么重复了一块配置
UnCLAS-Prommer Jan 15, 2026
b6fb74e
补上webui config
UnCLAS-Prommer Jan 15, 2026
0cf17bc
Merge branch 'dev' into r-dev
UnCLAS-Prommer Jan 15, 2026
c8b4366
忘了引入webui了
UnCLAS-Prommer Jan 15, 2026
77725ba
逐步适配新的config
UnCLAS-Prommer Jan 15, 2026
7bdd394
将PFC加回来,修复一大堆PFC的神秘报错
DrSmoothl Jan 15, 2026
4855cbc
group_generator适配
UnCLAS-Prommer Jan 16, 2026
3a66bfe
恢复可用性
UnCLAS-Prommer Jan 16, 2026
c15b779
Prompt管理器与测试;调整部分方法名称
UnCLAS-Prommer Jan 20, 2026
761e4c8
PromptManager再修改,测试更新;将主程序的prompt独立到文件(部分)
UnCLAS-Prommer Jan 20, 2026
433a455
移除gitignore中的lib文件夹,上传被排除掉的前端lib文件
DrSmoothl Jan 21, 2026
21bca6b
更多的prompt独立
UnCLAS-Prommer Jan 21, 2026
1a1edde
Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev
UnCLAS-Prommer Jan 21, 2026
f44598a
全部prompt独立
UnCLAS-Prommer Jan 21, 2026
17aff36
新数据库模型
UnCLAS-Prommer Jan 31, 2026
54a760b
Merge branch 'dev' of github.com:Mai-with-u/MaiBot into r-dev
UnCLAS-Prommer Jan 31, 2026
1e3dfb9
数据库微调
UnCLAS-Prommer Feb 2, 2026
0d0f5a9
TODO 更新
UnCLAS-Prommer Feb 2, 2026
b793a3d
更好的Prompt管理系统,增加用户自定义Prompt与覆盖功能
UnCLAS-Prommer Feb 2, 2026
74b852d
根据开发组建议重命名,移除多余的Prompt后缀
UnCLAS-Prommer Feb 2, 2026
b3697de
小工具
UnCLAS-Prommer Feb 2, 2026
d27d73f
移除多余文件;更好的注释
UnCLAS-Prommer Feb 4, 2026
4ff070c
新表情包系统;对应的测试;TODO更新;Prompt拆分;工具拆分
UnCLAS-Prommer Feb 4, 2026
e2c6716
重命名防止混乱
UnCLAS-Prommer Feb 4, 2026
4edb287
移除多余文件;更改命名
UnCLAS-Prommer Feb 5, 2026
54e9007
合并tcp_connector,移除多余的toml_utils.py
UnCLAS-Prommer Feb 5, 2026
4dbe919
移除.env文件
UnCLAS-Prommer Feb 5, 2026
049027a
maim_message强制版本要求;忽略APIServer下乱七八糟的类型注解和Patch
UnCLAS-Prommer Feb 5, 2026
3a5fd9d
feat:自动检测并升级旧版配置文件
SengokuCola Feb 6, 2026
bf46d54
Update .gitignore
SengokuCola Feb 6, 2026
60f76e4
添加对 peewee 的旧数据库的兼容层,初步重构插件的 database API
DrSmoothl Feb 9, 2026
b9f3c17
合并到远程
UnCLAS-Prommer Feb 13, 2026
14f6fdb
解决潜在的存储错误
UnCLAS-Prommer Feb 13, 2026
e6e0a57
修复导入路径:将服务器模块的导入路径更改为正确的消息服务器路径
DrSmoothl Feb 13, 2026
26b8f56
移除不必要属性,修改一个方法为非协程
UnCLAS-Prommer Feb 13, 2026
9a3e888
Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev
UnCLAS-Prommer Feb 13, 2026
b80b5af
先推上去
UnCLAS-Prommer Feb 13, 2026
c14736f
更好更规范的类型注解;AGENTSMD试作
UnCLAS-Prommer Feb 13, 2026
16b16d2
重构绝大部分模块以适配新版本的数据库和数据模型,修复缺少依赖问题,更新 pyproject
DrSmoothl Feb 13, 2026
c0c003a
更舒适的颜色配置方案,真彩色支持
UnCLAS-Prommer Feb 14, 2026
daad0ba
从maim_message的序列化和反序列化;更多消息组件
UnCLAS-Prommer Feb 14, 2026
dc36542
添加文件监视器地基模块,重构模型请求模块使用新版本的配置热重载模块,新增watchfiles依赖
DrSmoothl Feb 14, 2026
6db8895
方便消息格式检查的property
UnCLAS-Prommer Feb 14, 2026
6dc33e9
提取一些公共方法
UnCLAS-Prommer Feb 14, 2026
5799ce7
新功能
UnCLAS-Prommer Feb 15, 2026
0dccc23
更新 GitHub Actions 工作流,统一使用 ubuntu-24.04 作为运行环境;新增发布 WebUI 产物的工作流
DrSmoothl Feb 15, 2026
63c27aa
test WebUI CI
DrSmoothl Feb 15, 2026
692b57f
更新发布工作流以支持 dev 和 r-dev 分支,并修复版本号生成逻辑
DrSmoothl Feb 15, 2026
a19b9b2
test WebUI CI x2
DrSmoothl Feb 15, 2026
15ab134
更新工作流以使用 Bun 替代 Node 进行构建
DrSmoothl Feb 15, 2026
c3adc68
test WebUI CI x3
DrSmoothl Feb 15, 2026
3db97a6
修复 pyproject.toml 文件的 EOF 语法,确保正确生成版本信息
DrSmoothl Feb 15, 2026
ba10124
test WebUI CI x4
DrSmoothl Feb 15, 2026
a832f7d
修复版本号格式,移除 WEBUI_VERSION 中的点分隔符
DrSmoothl Feb 15, 2026
275608a
test WebUI CI x5
DrSmoothl Feb 15, 2026
c834f8c
优化 pyproject.toml 文件,调整 setuptools 配置以正确包含和排除包
DrSmoothl Feb 15, 2026
b6441ea
更新 WebUI 版本
DrSmoothl Feb 15, 2026
75e1547
方法名调整;确保公共属性被定义
UnCLAS-Prommer Feb 15, 2026
545e3b4
Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev
UnCLAS-Prommer Feb 15, 2026
5838dda
feat(dashboard): add UI metadata fields to FieldSchema type
DrSmoothl Feb 17, 2026
e530ee8
feat(dashboard): create FieldHookRegistry for dynamic form hooks
DrSmoothl Feb 17, 2026
1631774
feat(config): add UI metadata to ChatConfig sample fields
DrSmoothl Feb 17, 2026
19c9c5a
feat(webui): use get_class_field_docs for schema field descriptions
DrSmoothl Feb 17, 2026
278a084
feat(webui): enhance ConfigSchemaGenerator with field_docs and UI met…
DrSmoothl Feb 17, 2026
5879164
feat(config): add UI metadata to remaining ChatConfig fields (Wave 2)
DrSmoothl Feb 17, 2026
2962a95
feat(dashboard): create DynamicField renderer component
DrSmoothl Feb 17, 2026
4e5d091
test(webui): add unit tests for ConfigSchemaGenerator
DrSmoothl Feb 17, 2026
449e2f4
feat(dashboard): create DynamicConfigForm component with Hook integra…
DrSmoothl Feb 17, 2026
b1c01d0
feat: add .sisyphus/ to .gitignore
DrSmoothl Feb 17, 2026
bae87d1
feat(config): add UI metadata to ModelConfig fields
DrSmoothl Feb 17, 2026
ed27217
feat(config): add UI metadata to all Bot config sections
DrSmoothl Feb 17, 2026
b382747
feat(dashboard): convert ChatSection to Hook component
DrSmoothl Feb 17, 2026
3fcf028
feat(dashboard): export ChatSectionHook in hooks index
DrSmoothl Feb 17, 2026
c58ad64
feat(dashboard): integrate DynamicConfigForm for ChatSection POC
DrSmoothl Feb 17, 2026
69dfd0c
test(dashboard): add unit tests for dynamic form components
DrSmoothl Feb 17, 2026
fa15fef
feat(dashboard): convert 4 Sections to Hook components
DrSmoothl Feb 17, 2026
2de6184
docs(dashboard): add comprehensive dynamic form system documentation
DrSmoothl Feb 17, 2026
6bb0bc9
feat(dashboard): integrate DynamicConfigForm in model config page
DrSmoothl Feb 17, 2026
760561f
fix(version): update APP_VERSION to 1.0.0
DrSmoothl Feb 17, 2026
0ea18a4
fix minssing files
DrSmoothl Feb 17, 2026
7da0811
refactor(webui): migrate emoji routes from Peewee to SQLModel
DrSmoothl Feb 17, 2026
390d1da
refactor(webui): migrate jargon routes from Peewee to SQLModel
DrSmoothl Feb 17, 2026
7255cc5
fix(webui): remove references to deleted Expression fields
DrSmoothl Feb 17, 2026
f97c24b
test(webui): add pytest tests for emoji, jargon, expression routes
DrSmoothl Feb 17, 2026
f66e25b
fix(webui): fix missing imports and create toml_utils module
DrSmoothl Feb 17, 2026
c9f72f7
修改部分字段含义,维护缓存
UnCLAS-Prommer Feb 18, 2026
ccd1be7
Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev
UnCLAS-Prommer Feb 18, 2026
537b24c
获取和注册一体化修正
UnCLAS-Prommer Feb 18, 2026
0a57251
表情管理器调整,减少计算
UnCLAS-Prommer Feb 18, 2026
6aa1132
feat(theme): add design token schema, palette derivation, CSS sanitiz…
DrSmoothl Feb 19, 2026
8fb137a
feat(theme): add CSS injection pipeline, presets, rewrite ThemeProvid…
DrSmoothl Feb 19, 2026
b5088fa
feat(theme): migrate CSS variables and Tailwind config, refactor sett…
DrSmoothl Feb 19, 2026
06a88a8
refactor(theme): migrate all CSS variable references and adapt third-…
DrSmoothl Feb 19, 2026
bb556dc
feat(theme): extend settings UI with token controls and custom CSS ed…
DrSmoothl Feb 19, 2026
7987110
feat(theme): add theme import/export and cleanup legacy code
DrSmoothl Feb 19, 2026
6a54a79
修复 build 问题
DrSmoothl Feb 19, 2026
1c0580c
ImageManager及测试
UnCLAS-Prommer Feb 19, 2026
6bcd7cb
Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev
UnCLAS-Prommer Feb 19, 2026
6fcc53a
feat(plugin-system): add workflow pipeline and cross-plugin service r…
DrSmoothl Feb 20, 2026
119241f
PersonInfoModel; 修改部分方法参数和部分文件位置;移除多余文件;炸毁可启动性
UnCLAS-Prommer Feb 21, 2026
6d19645
Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev
UnCLAS-Prommer Feb 21, 2026
2cb5121
feat(plugin-system): harden P0 safety with workflow timeout, service …
DrSmoothl Feb 21, 2026
eaef7f0
Ruff Format
DrSmoothl Feb 21, 2026
6378bb2
fix Ruff
DrSmoothl Feb 21, 2026
8674f50
PersonInfo相关提交,添加注释,重命名文件
UnCLAS-Prommer Feb 21, 2026
04a5bf3
Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev
UnCLAS-Prommer Feb 21, 2026
37f8c92
ChatSession(原ChatStream)与ChatManager;由于功能简单,测试略
UnCLAS-Prommer Feb 22, 2026
698b835
移除旧文件;补充chat_manager方法
UnCLAS-Prommer Feb 22, 2026
1fec4c3
feat(dashboard): add background customization system
DrSmoothl Feb 23, 2026
0d07e85
全新的process方法完成(Message其他部分仍未完成);对应测试;调整部分注释;数据库检索优化
UnCLAS-Prommer Feb 23, 2026
12d4f23
Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev
UnCLAS-Prommer Feb 23, 2026
a8e8f6b
HFC对应修改(部分)
UnCLAS-Prommer Feb 24, 2026
7ef21c5
一点注释和渲染修改
UnCLAS-Prommer Feb 24, 2026
e253a2e
分离提及和at必回复
UnCLAS-Prommer Feb 27, 2026
b9faed4
拆分新的utils
UnCLAS-Prommer Feb 27, 2026
78983c4
expression
UnCLAS-Prommer Feb 28, 2026
c58da95
链式调用构建消息
UnCLAS-Prommer Feb 28, 2026
5f5bdab
补全 WebUI 缺失文件
DrSmoothl Feb 28, 2026
a39cced
应要求提交上未完成的HFC, expression部分
UnCLAS-Prommer Feb 28, 2026
1e917cc
Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev
UnCLAS-Prommer Feb 28, 2026
416bf36
refactor(database_model): replace Literal with Enum for modified_by f…
DrSmoothl Feb 28, 2026
f9dd197
refactor(types): add unified API response types and error helpers
DrSmoothl Mar 1, 2026
1533ec5
chore(deps): remove unused Jotai dependency
DrSmoothl Mar 1, 2026
e1c8a30
refactor(lib): unify WebSocket utilities into ws-utils
DrSmoothl Mar 1, 2026
3680009
chore(config): tighten tsconfig and eslint strictness
DrSmoothl Mar 1, 2026
5f211f2
refactor(css): clean up Tailwind base layers and CSS variables
DrSmoothl Mar 1, 2026
7e93d88
refactor(types): eliminate any types in DynamicField icon lookup
DrSmoothl Mar 1, 2026
c863d5a
refactor(components): split layout.tsx into layout/ directory
DrSmoothl Mar 1, 2026
88e1570
refactor(api): migrate expression-api to ApiResponse pattern
DrSmoothl Mar 1, 2026
d4bfc95
refactor(api): migrate config-api to ApiResponse pattern
DrSmoothl Mar 1, 2026
dc7e037
refactor(dashboard): migrate plugin-api HTTP functions to ApiResponse…
DrSmoothl Mar 1, 2026
bddc608
refactor(T11): split settings.tsx into settings/ directory
DrSmoothl Mar 1, 2026
34b05e4
fix(hooks): remove duplicate save calls in useAutoSave legacy
DrSmoothl Mar 1, 2026
f334d98
refactor(dashboard): split chat.tsx into modular chat/ directory
DrSmoothl Mar 1, 2026
feb2b89
refactor(routes): split plugins.tsx into modular plugins/ directory
DrSmoothl Mar 1, 2026
c538400
refactor(lib): split plugin-api.ts into plugin-api/ directory
DrSmoothl Mar 1, 2026
b800011
refactor(config): split ChatSection.tsx into sub-components
DrSmoothl Mar 1, 2026
e1f9936
refactor(config): split modelProvider.tsx into modular directory
DrSmoothl Mar 1, 2026
e9a081d
refactor(react19): replace Context.Provider with Context value={}
DrSmoothl Mar 1, 2026
7866443
refactor(routes): modernize auth, setup, person routes
DrSmoothl Mar 1, 2026
bacb5b1
refactor(routes): split expression.tsx into modular expression/ direc…
DrSmoothl Mar 1, 2026
3185642
refactor(routes): split jargon.tsx into modular jargon/ directory (T19b)
DrSmoothl Mar 1, 2026
c8e93d4
refactor(routes): split emoji.tsx into modular emoji/ directory (T19c)
DrSmoothl Mar 1, 2026
763412e
refactor(routes): split knowledge-graph.tsx into modular knowledge-gr…
DrSmoothl Mar 1, 2026
c45ee1a
refactor(routes): review and fix config/bot/ directory (T16)
DrSmoothl Mar 1, 2026
ba47069
refactor(types): eliminate all as any type assertions (30 → 0)
DrSmoothl Mar 1, 2026
e200b5b
给Expression系统的一些准备文件
UnCLAS-Prommer Mar 2, 2026
0751ac5
Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev
UnCLAS-Prommer Mar 2, 2026
3f93d93
补上default
UnCLAS-Prommer Mar 2, 2026
c16ced7
适配db的修改;MessageComponent更新
UnCLAS-Prommer Mar 2, 2026
9176540
修复脚本注释,添加macOS支持,重构依赖管理和服务控制逻辑
BBleae Mar 2, 2026
e6862e2
feat(electron): scaffold electron-vite project structure
DrSmoothl Mar 2, 2026
b5cc361
feat(electron): add main process, preload, store, protocol, and type …
DrSmoothl Mar 2, 2026
fc394f4
feat(electron): adapt renderer API and WebSocket layer for dynamic ba…
DrSmoothl Mar 2, 2026
65774f3
feat(electron): add Electron UI components and layout integration
DrSmoothl Mar 2, 2026
c6545af
fix(package): format target configurations and update electron-store …
DrSmoothl Mar 2, 2026
efaff7a
实现追踪检查逻辑,添加消息数量和LLM判断,更新表达并持久化到数据库
BBleae Mar 2, 2026
71a5acb
优化ReflectTracker逻辑,确保在追踪时表达不为None,简化代码并增强可读性
BBleae Mar 2, 2026
46babf7
添加TODO注释以提醒测试trigger_tracker方法
BBleae Mar 2, 2026
4561cd9
fix(electron): use named Schema import from electron-store v8+
DrSmoothl Mar 2, 2026
5cc34f2
fix(.gitignore): add dist-electron and .sisyphus to ignored files
DrSmoothl Mar 2, 2026
a65a40f
feat(dashboard): add i18n support with zh/en/ja/ko locales
DrSmoothl Mar 3, 2026
d03dc36
消息构建器:将消息转换为可读消息;其对应的测试文件
UnCLAS-Prommer Mar 4, 2026
81bc25d
Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev
UnCLAS-Prommer Mar 4, 2026
5cccdf6
feat(llm): 添加响应格式转换功能,支持JSON_SCHEMA输出
DrSmoothl Mar 4, 2026
b3a8175
feat(config): harden file watcher hot-reload flow and add test coverage
DrSmoothl Mar 4, 2026
2a33fd1
refactor(llm): enable hot-reload for model config and client runtime
DrSmoothl Mar 4, 2026
34bd115
efactor(network): centralize port validation and enforce strict confi…
DrSmoothl Mar 4, 2026
c12d1ca
feat(a11y): add a11y infrastructure — skip-nav, announcer, touch CSS,…
DrSmoothl Mar 5, 2026
c658b23
feat(a11y): apply ARIA roles, landmarks, focus management, touch targ…
DrSmoothl Mar 5, 2026
e3cfca1
chore: add bunfig.toml and remove package-lock.json
DrSmoothl Mar 5, 2026
8f41e25
fix(dashboard): resolve TS build errors in a11y changes
DrSmoothl Mar 5, 2026
10d5c81
feat: 添加 .coderabbit.yaml 配置文件以支持代码检查和格式化
DrSmoothl Mar 5, 2026
61dc15a
feat(plugin-runtime): add plugin isolation IPC infrastructure
DrSmoothl Mar 5, 2026
2f21cd0
feat: Enhance plugin runtime with new component registry and workflow…
DrSmoothl Mar 6, 2026
1cd366b
refactor: 优化代码结构,简化条件判断和异常处理
DrSmoothl Mar 6, 2026
c6afa97
补全新版插件系统的类型注解
DrSmoothl Mar 6, 2026
d5cf4c9
refactor: 添加类型注解以增强代码可读性和类型安全
DrSmoothl Mar 6, 2026
baae2df
feat: 集成新版本插件运行时,支持事件桥接与命令处理
DrSmoothl Mar 6, 2026
c2b75a0
数据库模型字段添加;数据模型添加;utils_message传参控制
UnCLAS-Prommer Mar 6, 2026
8712fc0
移除多余内容
UnCLAS-Prommer Mar 6, 2026
2e3dd44
Refactor chat stream handling to use BotChatSession
DrSmoothl Mar 6, 2026
ce8d8df
重构整个插件系统,尝试恢复可启动性,新增插件系统maibot-plugin-sdk依赖
DrSmoothl Mar 7, 2026
3bbd812
feat: 新增消息转发和混合发送能力,扩展数据库操作能力
DrSmoothl Mar 7, 2026
fe5cab9
修复 webui 明暗切换问题
DrSmoothl Mar 7, 2026
4565bd9
修复统计数据 API 中的数据库查询方法,优化性能和准确性
DrSmoothl Mar 7, 2026
2e4be9b
为 WebUI 首页支持 i18n
DrSmoothl Mar 7, 2026
0451a7f
优化认证检查逻辑,确保加载状态显示在正确位置;更新配置验证逻辑,使用深拷贝确保数据完整性
DrSmoothl Mar 7, 2026
d3a4e3f
feat: 优先读取插件的 config_schema.json,提供富 UI 元数据支持
DrSmoothl Mar 7, 2026
b056ad2
feat: 添加动态 Tab 分组支持,优化配置界面 UI 元数据
DrSmoothl Mar 7, 2026
186073f
feat: 添加递归转换函数以处理 TOML 文档,优化配置数据验证
DrSmoothl Mar 7, 2026
d0840db
refactor: remove RuleEditor, RuleList, RulePreview, TimeRangePicker, …
DrSmoothl Mar 7, 2026
fbf946b
更严厉测试
UnCLAS-Prommer Mar 8, 2026
5b7945a
feat: 添加 _wait_for 辅助函数以优化测试中的等待逻辑,调整 FileWatcher 的防抖设置
DrSmoothl Mar 9, 2026
426cbc6
feat(test): 在 FileWatcher 中添加 force_polling 参数以增强文件监控功能
DrSmoothl Mar 9, 2026
7e2ab0d
feat(test): 移除 FileWatcher 中的 force_polling 参数,并添加等待时间以确保 watcher 建立基线
DrSmoothl Mar 9, 2026
dfa944b
feat: 添加 _ready_event 以确保文件监视器在启动时准备就绪,优化监控逻辑
DrSmoothl Mar 9, 2026
3ea14a8
测试简化
UnCLAS-Prommer Mar 9, 2026
cd81f94
炸掉
UnCLAS-Prommer Mar 8, 2026
aaf1c9e
更严厉测试
UnCLAS-Prommer Mar 8, 2026
e437468
final commit
UnCLAS-Prommer Mar 9, 2026
7f1e79e
feat: 添加旧版插件兼容性支持,确保旧版插件能够正常加载
DrSmoothl Mar 10, 2026
69219e3
Refactor protocol and transport modules to use type hints for improve…
DrSmoothl Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
49 changes: 49 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

language: "zh-CN"

reviews:
profile: "chill"
request_changes_workflow: false
high_level_summary: true
high_level_summary_placeholder: "@coderabbitai summary"
poem: false
review_status: true
commit_status: true
collapse_walkthrough: false
auto_review:
enabled: true
drafts: false
base_branches:
- "main"
- "dev"
path_filters:
- "!logs/**"
- "!data/**"
- "!depends-data/**"
- "!dashboard/dist-electron/**"
- "!dashboard/node_modules/**"
- "!**/*.log"
- "!**/*.jsonl"
- "!**/*.db"
- "!**/*.db-shm"
- "!**/*.db-wal"
- "!**/*.bak"
path_instructions:
- path: "src/**/*.py"
instructions: |
本项目使用 Ruff 进行代码检查与格式化,行宽限制为 120 字符,字符串使用双引号。
请重点关注以下方面:
- 异步代码的正确性(async/await 使用是否合理)
- 异常处理是否覆盖了边界情况
- import 顺序需遵循项目规范:标准库/第三方库在前,本地模块在后;本地同级模块使用相对导入,跨目录使用以 `from src` 开头的绝对导入
- 避免硬编码的敏感信息(API Key、密码等)
- path: "plugins/**/*.py"
instructions: |
插件目录,请关注插件接口的规范使用以及与核心模块的依赖隔离性。
- path: "*.toml"
instructions: |
配置文件,请检查字段合法性和格式规范,注意不要泄露敏感默认值。

chat:
auto_reply: true
4 changes: 2 additions & 2 deletions .github/workflows/precheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request]

jobs:
conflict-check:
runs-on: [self-hosted, Windows, X64]
runs-on: ubuntu-24.04
outputs:
conflict: ${{ steps.check-conflicts.outputs.conflict }}
steps:
Expand All @@ -25,7 +25,7 @@ jobs:
}
shell: pwsh
labeler:
runs-on: [self-hosted, Windows, X64]
runs-on: ubuntu-24.04
needs: conflict-check
if: needs.conflict-check.outputs.conflict == 'true'
steps:
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/publish-webui-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Publish WebUI Dist

on:
push:
branches:
- main
- dev
- r-dev
paths:
- "dashboard/**"
workflow_dispatch:

permissions:
contents: read

jobs:
build-and-publish:
runs-on: ubuntu-24.04
environment: webui
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.2.0"

- name: Build dashboard
working-directory: dashboard
run: |
bun install
bun run build

- name: Prepare dist package
run: |
rm -rf .webui_dist_pkg
mkdir -p .webui_dist_pkg/maibot_dashboard/dist
BASE_VERSION=$(python -c "import json; print(json.load(open('dashboard/package.json'))['version'])")
if [ "${GITHUB_REF_NAME}" = "main" ]; then
WEBUI_VERSION="${BASE_VERSION}"
else
TODAY=$(date -u +%Y%m%d)
WEBUI_VERSION="${BASE_VERSION}.dev${TODAY}${GITHUB_RUN_NUMBER}"
fi
cat > .webui_dist_pkg/pyproject.toml <<EOF
[project]
name = "maibot-dashboard"
version = "${WEBUI_VERSION}"
description = "MaiBot WebUI static assets"
readme = "README.md"
requires-python = ">=3.10"

[build-system]
requires = ["setuptools>=80.9.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
where = ["."]
include = ["maibot_dashboard"]
exclude = ["maibot_dashboard.dist*"]

[tool.setuptools.package-data]
maibot_dashboard = ["dist/**"]
EOF
cat > .webui_dist_pkg/README.md <<'EOF'
# MaiBot WebUI Dist

该包仅包含 MaiBot WebUI 的前端构建产物(dist)。
EOF
cat > .webui_dist_pkg/maibot_dashboard/__init__.py <<'EOF'
from .resources import get_dist_path

__all__ = ["get_dist_path"]
EOF
cat > .webui_dist_pkg/maibot_dashboard/resources.py <<'EOF'
from pathlib import Path

def get_dist_path() -> Path:
return Path(__file__).parent / "dist"
EOF
cp -a dashboard/dist/. .webui_dist_pkg/maibot_dashboard/dist/

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Build and publish
working-directory: .webui_dist_pkg
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m pip install --upgrade build twine
python -m build
python -m twine upload -u __token__ -p "$PYPI_API_TOKEN" dist/*
2 changes: 1 addition & 1 deletion .github/workflows/ruff-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Ruff PR Check
on: [ pull_request ]
jobs:
ruff:
runs-on: [self-hosted, Windows, X64]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ on:
# - dev-refactor # 例如:匹配所有以 feature/ 开头的分支
# # 添加你希望触发此 workflow 的其他分支
workflow_dispatch: # 允许手动触发工作流
branches:
- main
- dev
- dev-refactor

permissions:
contents: write

jobs:
ruff:
runs-on: [self-hosted, Windows, X64]
runs-on: ubuntu-24.04
# 关键修改:添加条件判断
# 确保只有在 event_name 是 'push' 且不是由 Pull Request 引起的 push 时才运行
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/pull/')
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ queue_update.txt
.env
.env.*
.cursor
start_all.bat
config/bot_config_dev.toml
config/bot_config.toml
config/bot_config.toml.bak
Expand Down Expand Up @@ -91,7 +92,6 @@ develop-eggs/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
Expand Down Expand Up @@ -353,3 +353,6 @@ interested_rates.txt
MaiBot.code-workspace
*.lock
actionlint
.sisyphus/
dist-electron/
packages/
21 changes: 21 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# import 规范
在从外部库进行导入时候,请遵循以下顺序:
1. 对于标准库和第三方库的导入,请按照如下顺序:
- 需要使用`from ... import ...`语法的导入放在前面。
- 直接使用`import ...`语法的导入放在后面。
- 对于使用`from ... import ...`导入的多个项,请**在保证不会引起import错误的前提下**,按照**字母顺序**排列。
- 对于使用`import ...`导入的多个项,请**在保证不会引起import错误的前提下**,按照**字母顺序**排列。
2. 对于本地模块的导入,请按照如下顺序:
- 对于同一个文件夹下的模块导入,使用相对导入,排列顺序按照**不发生import错误的前提下**,随便排列。
- 对于不同文件夹下的模块导入,使用绝对导入。这些导入应该以`from src`开头,并且按照**不发生import错误的前提下**,尽量使得第二层的文件夹名称相同的导入放在一起;第二层文件夹名称排列随机。
3. 标准库和第三方库的导入应该放在本地模块导入的前面。
4. 各个导入块之间应该使用一个空行进行分隔。

# 代码规范
## 注释规范
1. 尽量保持良好的注释
2. 如果原来的代码中有注释,则重构的时候,除非这部分代码被删除,否则相同功能的代码应该保留注释(可以对注释进行修改以保持准确性,但不应该删除注释)。
3. 如果原来的代码中没有注释,则重构的时候,如果某个功能块的代码较长或者逻辑较为复杂,则应该添加注释来解释这部分代码的功能和逻辑。
## 类型注解规范
1. 重构代码时,如果原来的代码中有类型注解,则相同功能的代码应该保留类型注解(可以对类型注解进行修改以保持准确性,但不应该删除类型注解)。
2. 重构代码时,如果原来的代码中没有类型注解,则重构的时候,如果某个函数的功能较为复杂或者参数较多,则应该添加类型注解来提高代码的可读性和可维护性。(对于简单的变量,可以不添加类型注解)
30 changes: 20 additions & 10 deletions bot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# raise RuntimeError("System Not Ready")
import asyncio
import hashlib
import os
Expand Down Expand Up @@ -43,6 +44,11 @@

# 定义重启退出码
RESTART_EXIT_CODE = 42
print("-----------------------------------------")
print("\n\n\n\n\n")
print("警告:Dev进入不稳定开发状态,任何插件与WebUI均可能无法正常工作!")
print("\n\n\n\n\n")
print("-----------------------------------------")


def run_runner_process():
Expand Down Expand Up @@ -180,20 +186,24 @@ async def graceful_shutdown(): # sourcery skip: use-named-expression
logger.info("正在优雅关闭麦麦...")

# 关闭 WebUI 服务器
try:
from src.webui.webui_server import get_webui_server
# try:
# from src.webui.webui_server import get_webui_server

webui_server = get_webui_server()
if webui_server and webui_server._server:
await webui_server.shutdown()
except Exception as e:
logger.warning(f"关闭 WebUI 服务器时出错: {e}")
# webui_server = get_webui_server()
# if webui_server and webui_server._server:
# await webui_server.shutdown()
# except Exception as e:
# logger.warning(f"关闭 WebUI 服务器时出错: {e}")

from src.plugin_system.core.events_manager import events_manager
from src.plugin_system.base.component_types import EventType
from src.core.event_bus import event_bus
from src.core.types import EventType

# 触发 ON_STOP 事件
await events_manager.handle_mai_events(event_type=EventType.ON_STOP)
await event_bus.emit(event_type=EventType.ON_STOP)

# 停止新版本插件运行时
from src.plugin_runtime.integration import get_plugin_runtime_manager
await get_plugin_runtime_manager().stop()

# 停止所有异步任务
await async_task_manager.stop_and_wait_all_tasks()
Expand Down
Loading