ErisPulse 2.7.1.dev4__tar.gz → 2.8.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/.gitignore +2 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/PKG-INFO +12 -32
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/README.pypi.md +3 -3
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/pyproject.toml +30 -8
- erispulse-2.8.0/src/ErisPulse/CLI/commands/config.py +208 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/commands/create.py +156 -13
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/commands/init.py +53 -163
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/commands/install.py +68 -93
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/commands/run.py +13 -3
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/constants.py +6 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/i18n/locales/en.py +74 -1
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/i18n/locales/ja.py +74 -1
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/i18n/locales/ru.py +74 -1
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/i18n/locales/zh_cn.py +74 -1
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/i18n/locales/zh_tw.py +74 -1
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/utils/__init__.py +2 -0
- erispulse-2.8.0/src/ErisPulse/CLI/utils/config_wizard.py +881 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/utils/scaffold_text.py +110 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Bases/__init__.py +38 -3
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Bases/adapter.py +639 -149
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Bases/client.py +5 -1
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Bases/config_schema.py +336 -79
- erispulse-2.8.0/src/ErisPulse/Core/Bases/errors.py +328 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Bases/i18n_schema.py +1 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Bases/kv_builder.py +28 -22
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Bases/module.py +140 -5
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Bases/router.py +3 -1
- erispulse-2.8.0/src/ErisPulse/Core/Bases/sql_base.py +1612 -0
- erispulse-2.8.0/src/ErisPulse/Core/Bases/storage.py +1171 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Event/__init__.py +21 -0
- erispulse-2.8.0/src/ErisPulse/Core/Event/base.py +522 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Event/command.py +387 -160
- erispulse-2.8.0/src/ErisPulse/Core/Event/interaction.py +924 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Event/message.py +45 -8
- erispulse-2.8.0/src/ErisPulse/Core/Event/overrides.py +831 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Event/session_type.py +45 -1
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Event/wrapper.py +600 -25
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/__init__.py +54 -7
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/adapter.py +777 -47
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/client.py +41 -12
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/config.py +334 -71
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/constants.py +346 -18
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/i18n/__init__.py +35 -6
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/i18n/locales/en.py +146 -2
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/i18n/locales/ja.py +146 -2
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/i18n/locales/ru.py +146 -2
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/i18n/locales/zh_cn.py +146 -2
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/i18n/locales/zh_tw.py +146 -2
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/lifecycle.py +179 -33
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/logger.py +301 -23
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/master.py +143 -13
- erispulse-2.8.0/src/ErisPulse/Core/module.py +2212 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/router.py +142 -11
- erispulse-2.8.0/src/ErisPulse/Core/scope.py +1307 -0
- erispulse-2.8.0/src/ErisPulse/Core/storage/__init__.py +89 -0
- erispulse-2.8.0/src/ErisPulse/Core/storage/mysql.py +279 -0
- erispulse-2.8.0/src/ErisPulse/Core/storage/postgres.py +282 -0
- erispulse-2.8.0/src/ErisPulse/Core/storage/sqlite.py +261 -0
- erispulse-2.8.0/src/ErisPulse/Core/text_match.py +195 -0
- erispulse-2.8.0/src/ErisPulse/Core/transcript.py +375 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/__init__.py +5 -2
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/loaders/adapter.py +8 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/loaders/module.py +911 -61
- erispulse-2.8.0/src/ErisPulse/loaders/plugin_folder.py +298 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/loaders/strict.py +1 -17
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/runtime/__init__.py +37 -1
- erispulse-2.8.0/src/ErisPulse/runtime/context.py +200 -0
- erispulse-2.8.0/src/ErisPulse/runtime/example_config.py +266 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/runtime/frame_config.py +151 -19
- erispulse-2.8.0/src/ErisPulse/runtime/owner_cleanup.py +171 -0
- erispulse-2.8.0/src/ErisPulse/runtime/plugin_reload.py +182 -0
- erispulse-2.8.0/src/ErisPulse/runtime/tasks.py +253 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/sdk.py +282 -8
- erispulse-2.7.1.dev4/src/ErisPulse/Core/Bases/errors.py +0 -137
- erispulse-2.7.1.dev4/src/ErisPulse/Core/Bases/storage.py +0 -534
- erispulse-2.7.1.dev4/src/ErisPulse/Core/Event/base.py +0 -384
- erispulse-2.7.1.dev4/src/ErisPulse/Core/module.py +0 -1125
- erispulse-2.7.1.dev4/src/ErisPulse/Core/storage.py +0 -1520
- erispulse-2.7.1.dev4/src/ErisPulse/runtime/context.py +0 -51
- erispulse-2.7.1.dev4/src/ErisPulse/runtime/tasks.py +0 -109
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/LICENSE +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/__init__.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/base.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/cli.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/commands/__init__.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/commands/doctor.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/commands/language.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/commands/list.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/commands/list_remote.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/commands/self_update.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/commands/types.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/commands/uninstall.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/commands/upgrade.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/console.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/hints.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/i18n/__init__.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/i18n/locales/__init__.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/registry.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/utils/display.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/utils/file_watcher.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/CLI/utils/package_manager.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Bases/converter.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Bases/manager.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Bases/send_builder.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Bases/send_rules.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Bases/websocket.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Event/message_builder.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Event/meta.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Event/notice.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/Event/request.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/assets/__init__.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/assets/error.css +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/assets/error.html +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/assets/root.css +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/assets/root.html +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/i18n/constants.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/Core/i18n/locales/__init__.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/__main__.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/finders/__init__.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/finders/adapter.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/finders/bases/__init__.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/finders/bases/finder.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/finders/module.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/loaders/__init__.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/loaders/bases/__init__.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/loaders/bases/loader.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/loaders/strategy.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/py.typed +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/runtime/config_schema.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/runtime/diagnostics.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/runtime/exceptions.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/runtime/hints.py +0 -0
- {erispulse-2.7.1.dev4 → erispulse-2.8.0}/src/ErisPulse/runtime/memory.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: ErisPulse
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.8.0
|
|
4
4
|
Summary: Event-driven modular async bot framework — write once, deploy to any platform | 事件驱动的模块化异步机器人框架,一次编写,多平台部署
|
|
5
5
|
Project-URL: Homepage, https://github.com/ErisPulse/ErisPulse
|
|
6
6
|
Project-URL: Documentation, https://www.erisdev.com#docs
|
|
@@ -10,27 +10,7 @@ Project-URL: Bug Tracker, https://github.com/ErisPulse/ErisPulse/blob/main/docs/
|
|
|
10
10
|
Project-URL: Changelog, https://github.com/ErisPulse/ErisPulse/blob/main/CHANGELOG.md
|
|
11
11
|
Author: ErisDev
|
|
12
12
|
Maintainer-email: "艾莉丝·格雷拉特(WSu2059)" <wsu2059@qq.com>
|
|
13
|
-
License: MIT
|
|
14
|
-
|
|
15
|
-
Copyright (c) 2025-2026 ErisPulse
|
|
16
|
-
|
|
17
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
19
|
-
in the Software without restriction, including without limitation the rights
|
|
20
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
22
|
-
furnished to do so, subject to the following conditions:
|
|
23
|
-
|
|
24
|
-
The above copyright notice and this permission notice shall be included in all
|
|
25
|
-
copies or substantial portions of the Software.
|
|
26
|
-
|
|
27
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
|
-
SOFTWARE.
|
|
13
|
+
License-Expression: MIT
|
|
34
14
|
License-File: LICENSE
|
|
35
15
|
Keywords: async,asyncio,bot,bot-framework,chatbot,email,extensible,framework,instant-messaging,kook,matrix,modular,multi-platform,onebot,onebot12,qq,robot,sdk,telegram,yunhu
|
|
36
16
|
Classifier: Development Status :: 4 - Beta
|
|
@@ -49,16 +29,16 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
49
29
|
Classifier: Typing :: Typed
|
|
50
30
|
Requires-Python: >=3.10
|
|
51
31
|
Requires-Dist: aiohttp>=3.9.0
|
|
32
|
+
Requires-Dist: aiosqlite>=0.20.0
|
|
52
33
|
Requires-Dist: fastapi>=0.116.1
|
|
53
34
|
Requires-Dist: rich>=13.0.0
|
|
54
|
-
Requires-Dist:
|
|
35
|
+
Requires-Dist: tomlkit>=0.15.1
|
|
55
36
|
Requires-Dist: uvicorn>=0.30.0
|
|
56
37
|
Requires-Dist: websockets>=12.0
|
|
57
|
-
Provides-Extra:
|
|
58
|
-
Requires-Dist:
|
|
59
|
-
|
|
60
|
-
Requires-Dist:
|
|
61
|
-
Requires-Dist: typing-extensions>=4.7.0; (python_version < '3.11') and extra == 'dev'
|
|
38
|
+
Provides-Extra: mysql
|
|
39
|
+
Requires-Dist: aiomysql>=0.2.0; extra == 'mysql'
|
|
40
|
+
Provides-Extra: postgres
|
|
41
|
+
Requires-Dist: asyncpg>=0.29.0; extra == 'postgres'
|
|
62
42
|
Provides-Extra: test
|
|
63
43
|
Requires-Dist: httpx>=0.24.0; extra == 'test'
|
|
64
44
|
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'test'
|
|
@@ -69,8 +49,6 @@ Requires-Dist: pytest-xdist>=3.0.0; extra == 'test'
|
|
|
69
49
|
Requires-Dist: pytest>=7.0.0; extra == 'test'
|
|
70
50
|
Description-Content-Type: text/markdown
|
|
71
51
|
|
|
72
|
-

|
|
73
|
-
|
|
74
52
|
# ErisPulse
|
|
75
53
|
|
|
76
54
|
**Write once, deploy on multiple platforms.**
|
|
@@ -99,7 +77,9 @@ It ships with a flexible plugin system, hot reload, a visual Dashboard, an AI Bu
|
|
|
99
77
|
- **Event-driven architecture** — Clear event model based on OneBot12, making message handling intuitive and consistent across platforms.
|
|
100
78
|
- **Cross-platform compatibility** — Write handlers once, deploy to 15+ platforms without rewriting business logic.
|
|
101
79
|
- **Modular design** — Flexible plugin system with hot-plug module management and per-module configuration.
|
|
102
|
-
- **Hot reload** —
|
|
80
|
+
- **Hot reload** — Local plugins reload on save; any module (including PyPI-installed ones) hot-reloads via a single `sdk.reload_module()` call — no process restart, even after pip upgrades.
|
|
81
|
+
- **Unified Event Overrides** — Override message triggers, command params and user permissions for *every* event type with a single config — no module code changes, takes effect instantly.
|
|
82
|
+
- **Scope Control** — Three-dimensional scope (module availability / event admission / outbound limits) with runtime-adjustable fine-grained control.
|
|
103
83
|
- **Chainable SendDSL** — Express `@mention`, reply, retry, timeout, progress hook and bulk send as a single fluent chain.
|
|
104
84
|
- **Complete toolchain** — `epsdk` CLI, visual Dashboard, AI Builder and Module Market included out of the box.
|
|
105
85
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-

|
|
2
|
-
|
|
3
1
|
# ErisPulse
|
|
4
2
|
|
|
5
3
|
**Write once, deploy on multiple platforms.**
|
|
@@ -28,7 +26,9 @@ It ships with a flexible plugin system, hot reload, a visual Dashboard, an AI Bu
|
|
|
28
26
|
- **Event-driven architecture** — Clear event model based on OneBot12, making message handling intuitive and consistent across platforms.
|
|
29
27
|
- **Cross-platform compatibility** — Write handlers once, deploy to 15+ platforms without rewriting business logic.
|
|
30
28
|
- **Modular design** — Flexible plugin system with hot-plug module management and per-module configuration.
|
|
31
|
-
- **Hot reload** —
|
|
29
|
+
- **Hot reload** — Local plugins reload on save; any module (including PyPI-installed ones) hot-reloads via a single `sdk.reload_module()` call — no process restart, even after pip upgrades.
|
|
30
|
+
- **Unified Event Overrides** — Override message triggers, command params and user permissions for *every* event type with a single config — no module code changes, takes effect instantly.
|
|
31
|
+
- **Scope Control** — Three-dimensional scope (module availability / event admission / outbound limits) with runtime-adjustable fine-grained control.
|
|
32
32
|
- **Chainable SendDSL** — Express `@mention`, reply, retry, timeout, progress hook and bulk send as a single fluent chain.
|
|
33
33
|
- **Complete toolchain** — `epsdk` CLI, visual Dashboard, AI Builder and Module Market included out of the box.
|
|
34
34
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["hatchling"]
|
|
2
|
+
requires = ["hatchling>=1.26"]
|
|
3
3
|
build-backend = "hatchling.build"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ErisPulse"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.8.0"
|
|
8
8
|
description = "Event-driven modular async bot framework — write once, deploy to any platform | 事件驱动的模块化异步机器人框架,一次编写,多平台部署"
|
|
9
9
|
readme = "README.pypi.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
|
-
license =
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
12
13
|
|
|
13
14
|
authors = [
|
|
14
15
|
{ name = "ErisDev" }
|
|
@@ -60,13 +61,14 @@ classifiers = [
|
|
|
60
61
|
|
|
61
62
|
dependencies = [
|
|
62
63
|
"rich>=13.0.0",
|
|
63
|
-
"
|
|
64
|
-
|
|
64
|
+
"tomlkit>=0.15.1",
|
|
65
65
|
# network 相关
|
|
66
66
|
"websockets>=12.0",
|
|
67
67
|
"aiohttp>=3.9.0",
|
|
68
68
|
"fastapi>=0.116.1",
|
|
69
69
|
"uvicorn>=0.30.0",
|
|
70
|
+
# storage 相关(默认 SQLite 后端异步驱动,开箱即用)
|
|
71
|
+
"aiosqlite>=0.20.0",
|
|
70
72
|
]
|
|
71
73
|
|
|
72
74
|
[project.urls]
|
|
@@ -78,6 +80,13 @@ Issues = "https://github.com/ErisPulse/ErisPulse/issues"
|
|
|
78
80
|
Changelog = "https://github.com/ErisPulse/ErisPulse/blob/main/CHANGELOG.md"
|
|
79
81
|
|
|
80
82
|
[project.optional-dependencies]
|
|
83
|
+
# 存储后端可选驱动:pip install ErisPulse[mysql] / ErisPulse[postgres]
|
|
84
|
+
mysql = [
|
|
85
|
+
"aiomysql>=0.2.0",
|
|
86
|
+
]
|
|
87
|
+
postgres = [
|
|
88
|
+
"asyncpg>=0.29.0",
|
|
89
|
+
]
|
|
81
90
|
test = [
|
|
82
91
|
"pytest>=7.0.0",
|
|
83
92
|
"pytest-cov>=4.0.0",
|
|
@@ -87,11 +96,14 @@ test = [
|
|
|
87
96
|
"pytest-benchmark>=4.0.0",
|
|
88
97
|
"httpx>=0.24.0",
|
|
89
98
|
]
|
|
99
|
+
|
|
100
|
+
[dependency-groups]
|
|
90
101
|
dev = [
|
|
91
102
|
"pyclean>=3.6.0",
|
|
92
103
|
"ruff>=0.1.7",
|
|
93
104
|
"basedpyright>=1.20.0",
|
|
94
|
-
"typing_extensions>=4.7.0; python_version < '3.11'"
|
|
105
|
+
"typing_extensions>=4.7.0; python_version < '3.11'",
|
|
106
|
+
]
|
|
95
107
|
|
|
96
108
|
[project.scripts]
|
|
97
109
|
ep-init = "ErisPulse.__init__:init_sync"
|
|
@@ -118,7 +130,7 @@ include = [
|
|
|
118
130
|
target-version = "py310"
|
|
119
131
|
line-length = 120
|
|
120
132
|
|
|
121
|
-
include = ["src/**/*.py"]
|
|
133
|
+
include = ["src/**/*.py", "tests/**/*.py"]
|
|
122
134
|
|
|
123
135
|
extend-exclude = [
|
|
124
136
|
"__pycache__",
|
|
@@ -161,6 +173,7 @@ ignore = [
|
|
|
161
173
|
"PLR0912", # too-many-branches
|
|
162
174
|
"PLR0913", # too-many-arguments
|
|
163
175
|
"PLR0915", # too-many-statements
|
|
176
|
+
"PLR0917", # too-many-positional-arguments —— 同 PLR0913,既有公共 API 签名不可破坏
|
|
164
177
|
"PLR2004", # magic-value-comparison —— 数值阈值判定过于严格
|
|
165
178
|
"PLR1714", # repeated-equality-comparison
|
|
166
179
|
"PLW0602", # global-variable-not-assigned
|
|
@@ -169,6 +182,7 @@ ignore = [
|
|
|
169
182
|
"PERF203", # try-except-in-loop —— 异步轮询/重试场景的常见且必要写法,性能影响极小
|
|
170
183
|
"RUF012", # mutable-class-default —— 类属性容器(handlers/事件表)是项目既有 API
|
|
171
184
|
"RUF005", # collection-literal-concatenation —— `list + list` 有时比 unpack 更清晰
|
|
185
|
+
"RUF022", # unsorted-dunder-all —— __all__ 常按语义分组并附加注释,强制排序破坏可读性
|
|
172
186
|
"RET504", # unnecessary-assign —— “先 assign 再 return”有时更易调试
|
|
173
187
|
|
|
174
188
|
# 风格偏好(不强加于现有代码)
|
|
@@ -194,7 +208,15 @@ ignore = [
|
|
|
194
208
|
|
|
195
209
|
[tool.ruff.lint.per-file-ignores]
|
|
196
210
|
"__init__.py" = ["F401", "PLC0415", "I001"] # 导出式 __init__ 经常按需导入
|
|
197
|
-
"tests/**/*.py" = [
|
|
211
|
+
"tests/**/*.py" = [
|
|
212
|
+
# 断言/夹具相关(测试代码天然模式)
|
|
213
|
+
"S101", "PLR2004", "SLF001", "ARG", "ANN", "PTH",
|
|
214
|
+
"E712", "B011", "B017", "B018", "RUF043",
|
|
215
|
+
# 测试内常见的宽松写法
|
|
216
|
+
"E702", "E402", "F841", "RUF059", "PLW0108",
|
|
217
|
+
"UP031", "N814", "PERF401", "PLR0917", "RUF015",
|
|
218
|
+
"B007", "PIE810", "PLR0124", "PLW1510", "SIM118",
|
|
219
|
+
]
|
|
198
220
|
|
|
199
221
|
[tool.ruff.lint.pep8-naming]
|
|
200
222
|
# 装饰器方法、classmethod 的首参数名允许保留
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Config 命令实现
|
|
3
|
+
|
|
4
|
+
交互式配置适配器/模块(schema 驱动向导,含适配器多账户管理)
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
from argparse import ArgumentParser
|
|
9
|
+
|
|
10
|
+
from rich.box import SIMPLE
|
|
11
|
+
from rich.prompt import Prompt
|
|
12
|
+
from rich.table import Table
|
|
13
|
+
|
|
14
|
+
from ..base import Command
|
|
15
|
+
from ..console import console
|
|
16
|
+
from ..i18n import i18n
|
|
17
|
+
from ..utils import config_wizard
|
|
18
|
+
from ..utils.config_wizard import (
|
|
19
|
+
STATUS_INCOMPLETE,
|
|
20
|
+
STATUS_NONE,
|
|
21
|
+
STATUS_OK,
|
|
22
|
+
STATUS_UNCONFIGURED,
|
|
23
|
+
)
|
|
24
|
+
from ..utils.display import section_header
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ConfigCommand(Command):
|
|
28
|
+
"""
|
|
29
|
+
config 命令
|
|
30
|
+
|
|
31
|
+
交互式配置适配器/模块;适配器支持多账户(bot 账户)管理
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
name = "config"
|
|
35
|
+
description = i18n.t("cli.config.description")
|
|
36
|
+
aliases = ["cfg", "conf"]
|
|
37
|
+
|
|
38
|
+
def add_arguments(self, parser: ArgumentParser):
|
|
39
|
+
parser.add_argument(
|
|
40
|
+
"name",
|
|
41
|
+
nargs="?",
|
|
42
|
+
help=i18n.t("cli.config.name_help"),
|
|
43
|
+
)
|
|
44
|
+
parser.add_argument(
|
|
45
|
+
"--list",
|
|
46
|
+
"-l",
|
|
47
|
+
action="store_true",
|
|
48
|
+
help=i18n.t("cli.config.list_help"),
|
|
49
|
+
)
|
|
50
|
+
parser.add_argument(
|
|
51
|
+
"--json",
|
|
52
|
+
action="store_true",
|
|
53
|
+
help=i18n.t("cli.config.json_help"),
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
def execute(self, args):
|
|
57
|
+
from ErisPulse import config
|
|
58
|
+
|
|
59
|
+
targets = config_wizard.load_config_targets()
|
|
60
|
+
if not targets:
|
|
61
|
+
console.print(f"[dim] {i18n.t('cli.config.no_targets')}[/]")
|
|
62
|
+
console.print(f"[dim] {i18n.t('cli.config.install_hint')}[/]")
|
|
63
|
+
return
|
|
64
|
+
|
|
65
|
+
if getattr(args, "json", False):
|
|
66
|
+
self._print_status_json(targets, config)
|
|
67
|
+
return
|
|
68
|
+
|
|
69
|
+
if args.name:
|
|
70
|
+
self._run_named(targets, args.name, config)
|
|
71
|
+
return
|
|
72
|
+
|
|
73
|
+
self._print_status_table(targets, config)
|
|
74
|
+
|
|
75
|
+
if args.list:
|
|
76
|
+
return
|
|
77
|
+
|
|
78
|
+
if not config_wizard.is_interactive():
|
|
79
|
+
console.print(f"[dim] {i18n.t('cli.config.non_interactive_hint')}[/]")
|
|
80
|
+
return
|
|
81
|
+
|
|
82
|
+
self._interactive_select(targets, config)
|
|
83
|
+
|
|
84
|
+
def _print_status_json(self, targets, config):
|
|
85
|
+
"""
|
|
86
|
+
以 JSON 输出全部目标及其配置状态(供 CI / 脚本消费)
|
|
87
|
+
|
|
88
|
+
:param targets: ConfigTarget 列表
|
|
89
|
+
:param config: ConfigManager 实例
|
|
90
|
+
"""
|
|
91
|
+
result = {}
|
|
92
|
+
for target in sorted(targets, key=lambda t: (t.kind != "adapter", t.name.lower())):
|
|
93
|
+
status, errors = config_wizard.get_target_status(target, config)
|
|
94
|
+
result[target.name] = {
|
|
95
|
+
"kind": target.kind,
|
|
96
|
+
"config_key": target.config_key,
|
|
97
|
+
"status": status,
|
|
98
|
+
"errors": errors,
|
|
99
|
+
}
|
|
100
|
+
console.print_json(json.dumps(result, ensure_ascii=False, indent=2))
|
|
101
|
+
|
|
102
|
+
def _run_named(self, targets, name: str, config):
|
|
103
|
+
"""
|
|
104
|
+
按名称定位目标并直接进入向导
|
|
105
|
+
|
|
106
|
+
:param targets: ConfigTarget 列表
|
|
107
|
+
:param name: 目标名(适配器平台名/模块名,或适配器配置键)
|
|
108
|
+
:param config: ConfigManager 实例
|
|
109
|
+
"""
|
|
110
|
+
for target in targets:
|
|
111
|
+
if target.name == name or target.config_key == name:
|
|
112
|
+
if not target.configurable:
|
|
113
|
+
console.print(f"[warning] {i18n.t('cli.config.no_declaration', name=target.name)}[/]")
|
|
114
|
+
return
|
|
115
|
+
config_wizard.run_wizard(target, config)
|
|
116
|
+
return
|
|
117
|
+
console.print(f"[error] {i18n.t('cli.config.not_found', name=name)}[/]")
|
|
118
|
+
|
|
119
|
+
def _status_text(self, status: str) -> str:
|
|
120
|
+
"""
|
|
121
|
+
将状态常量渲染为带颜色的显示文本
|
|
122
|
+
|
|
123
|
+
:param status: get_target_status 返回的状态常量
|
|
124
|
+
:return: rich 标记的状态文本
|
|
125
|
+
"""
|
|
126
|
+
mapping = {
|
|
127
|
+
STATUS_OK: ("cli.config.status_ok", "green"),
|
|
128
|
+
STATUS_INCOMPLETE: ("cli.config.status_incomplete", "yellow"),
|
|
129
|
+
STATUS_UNCONFIGURED: ("cli.config.status_unconfigured", "cyan"),
|
|
130
|
+
STATUS_NONE: ("cli.config.status_none", "dim"),
|
|
131
|
+
}
|
|
132
|
+
key, style = mapping.get(status, ("cli.config.status_none", "dim"))
|
|
133
|
+
return f"[{style}]{i18n.t(key)}[/]"
|
|
134
|
+
|
|
135
|
+
def _print_status_table(self, targets, config):
|
|
136
|
+
"""
|
|
137
|
+
打印全部目标及其配置状态表
|
|
138
|
+
|
|
139
|
+
:param targets: ConfigTarget 列表
|
|
140
|
+
:param config: ConfigManager 实例
|
|
141
|
+
"""
|
|
142
|
+
table = Table(box=SIMPLE, show_lines=False, header_style="bold", pad_edge=False)
|
|
143
|
+
table.add_column(i18n.t("cli.config.header_kind"), width=8)
|
|
144
|
+
table.add_column(i18n.t("cli.config.header_name"), min_width=12)
|
|
145
|
+
table.add_column(i18n.t("cli.config.header_status"), width=10)
|
|
146
|
+
table.add_column(i18n.t("cli.config.header_detail"))
|
|
147
|
+
|
|
148
|
+
for target in sorted(targets, key=lambda t: (t.kind != "adapter", t.name.lower())):
|
|
149
|
+
status, errors = config_wizard.get_target_status(target, config)
|
|
150
|
+
detail = ";".join(errors[:3])
|
|
151
|
+
if len(errors) > 3:
|
|
152
|
+
detail += f" (+{len(errors) - 3})"
|
|
153
|
+
kind_style = "adapter" if target.kind == "adapter" else "module"
|
|
154
|
+
table.add_row(
|
|
155
|
+
f"[{kind_style}]{target.kind_label}[/]",
|
|
156
|
+
target.name,
|
|
157
|
+
self._status_text(status),
|
|
158
|
+
detail,
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
console.print(table)
|
|
162
|
+
|
|
163
|
+
def _interactive_select(self, targets, config):
|
|
164
|
+
"""
|
|
165
|
+
交互式选择目标并进入向导(可连续配置多个)
|
|
166
|
+
|
|
167
|
+
:param targets: ConfigTarget 列表
|
|
168
|
+
:param config: ConfigManager 实例
|
|
169
|
+
"""
|
|
170
|
+
selectable = [t for t in targets if t.configurable]
|
|
171
|
+
if not selectable:
|
|
172
|
+
console.print(f"[dim] {i18n.t('cli.config.no_configurable')}[/]")
|
|
173
|
+
return
|
|
174
|
+
|
|
175
|
+
selectable.sort(key=lambda t: (t.kind != "adapter", t.name.lower()))
|
|
176
|
+
|
|
177
|
+
while True:
|
|
178
|
+
section_header(i18n.t("cli.config.select_section"))
|
|
179
|
+
for idx, target in enumerate(selectable, 1):
|
|
180
|
+
status, _ = config_wizard.get_target_status(target, config)
|
|
181
|
+
kind_style = "adapter" if target.kind == "adapter" else "module"
|
|
182
|
+
console.print(f" [bold]{idx}.[/] [{kind_style}]{target.name}[/] {self._status_text(status)}")
|
|
183
|
+
|
|
184
|
+
try:
|
|
185
|
+
raw = Prompt.ask(
|
|
186
|
+
f" {i18n.t('cli.config.select_prompt')}",
|
|
187
|
+
default="",
|
|
188
|
+
show_default=False,
|
|
189
|
+
)
|
|
190
|
+
except (EOFError, KeyboardInterrupt):
|
|
191
|
+
break
|
|
192
|
+
|
|
193
|
+
raw = raw.strip()
|
|
194
|
+
if not raw:
|
|
195
|
+
break
|
|
196
|
+
|
|
197
|
+
try:
|
|
198
|
+
idx = int(raw)
|
|
199
|
+
except ValueError:
|
|
200
|
+
console.print(f"[warning] {i18n.t('cli.config.invalid_index', idx=raw)}[/]")
|
|
201
|
+
continue
|
|
202
|
+
|
|
203
|
+
if not 1 <= idx <= len(selectable):
|
|
204
|
+
console.print(f"[warning] {i18n.t('cli.config.invalid_index', idx=idx)}[/]")
|
|
205
|
+
continue
|
|
206
|
+
|
|
207
|
+
config_wizard.run_wizard(selectable[idx - 1], config)
|
|
208
|
+
# 向导结束后回到选择菜单(状态重新刷新),支持连续配置多个目标
|