Commit Graph

173 Commits

Author SHA1 Message Date
whatevertogo
d078e51051 feat: refactor injected parameter handling and introduce is_framework_injected_parameter utility 2026-03-19 09:33:47 +08:00
whatevertogo
461f72764a Merge branch 'dev' of https://github.com/united-pooh/astrbot-sdk into dev 2026-03-19 09:02:06 +08:00
Lishiling
5ead59c40a fix(runtime): avoid virtual dispatch in Star.on_error fallback 2026-03-19 08:58:25 +08:00
Lishiling
d2382858d2 fix(runtime): avoid creating Star instance in on_error fallback 2026-03-19 08:58:25 +08:00
whatevertogo
e961e36170 feat: add session and system capabilities for plugin management and event handling
- Implemented SessionCapabilityMixin with methods to manage session-level plugin states and handlers.
- Added SystemCapabilityMixin to handle system-level functionalities including file management, event handling, and dynamic command registration.
- Introduced methods for enabling/disabling plugins, filtering handlers, and managing LLM and TTS service states.
- Registered various system capabilities for data directory access, HTML rendering, and event streaming.
2026-03-19 08:57:56 +08:00
whatevertogo
5a46321a04 Refactor tool call handling in SdkPluginBridge
- Introduced a dictionary to map tool call IDs to tool names for better clarity and efficiency.
- Enhanced the extraction of tool call information from raw results, ensuring compatibility with both dictionary and object formats.
- Updated the logic to retrieve tool names based on tool call IDs, improving the robustness of the tool calls result processing.
2026-03-19 08:57:56 +08:00
whatevertogo
47698448dd feat: add conversation.get_current capability and related schemas
- Introduced CONVERSATION_GET_CURRENT_INPUT_SCHEMA and CONVERSATION_GET_CURRENT_OUTPUT_SCHEMA for handling current conversation requests.
- Implemented _conversation_get_current method in BuiltinCapabilityRouterMixin to manage current conversation retrieval and creation.
- Registered the new capability in CoreCapabilityBridge.
- Enhanced HandlerDispatcher to inject provider request, LLM response, and event result payloads into the event handling process.
- Updated tests to validate the new functionality and ensure proper payload handling.
2026-03-19 08:57:56 +08:00
whatevertogo
9b35bec827 feat: 增强装饰器功能,添加会话命令支持及相关权限和限流装饰器 2026-03-19 08:57:56 +08:00
whatevertogo
48a20240c9 feat: enhance SDK plugin configuration handling and logging 2026-03-19 08:57:56 +08:00
whatevertogo
cb593a539f docs: remove redundant testing instructions from AGENTS.md 2026-03-19 08:57:56 +08:00
whatevertogo
f494207666 feat(tests): 添加测试用例以验证平台和消息类型过滤器的冲突处理 2026-03-19 08:57:56 +08:00
whatevertogo
b0f8b2d60f feat(tests): 添加测试用例以验证 register_task 的行为并更新测试运行说明 2026-03-19 08:57:56 +08:00
letr
6e417c6d3b feat(sdk): add merged provider config bridge and client
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-19 08:57:55 +08:00
letr
659eabce75 feat(sdk): add merged provider config capability support
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-19 08:57:55 +08:00
whatevertogo
09beabeb62 feat(tests): 添加测试用例以验证平台和消息类型过滤器的冲突处理 2026-03-19 02:25:04 +08:00
whatevertogo
85342f149b feat(tests): 添加测试用例以验证 register_task 的行为并更新测试运行说明 2026-03-19 02:18:58 +08:00
whatevertogo
fdffc09b89 Merge pull request #26 from united-pooh/fix/fix-star-on-error-fallback
fix(runtime): avoid instantiating Star in on_error fallback
2026-03-19 02:13:49 +08:00
united_pooh
3b09747cc1 feat: 完善 memory 向量检索与索引统计 (#28)
Co-authored-by: united_pooh <united_pooh@outlook.com>
2026-03-19 02:06:09 +08:00
whatevertogo
7dda607737 chore: sync subtree from AstrBot 2026-03-19 01:27:23 +08:00
letr
c7d47add23 fix: simplify register_task completion handling (#27)
* fix: simplify register_task completion handling

Remove duplicated cancellation logging in Context.register_task while keeping Future inputs compatible with asyncio.create_task semantics. Add regression coverage for coroutine, Future, cancellation, and failure paths.

* fix: prioritize local src in tests_v4

Ensure tests_v4 always imports the working tree package by moving src to sys.path[0] even when another checkout or installed copy is already present.
2026-03-19 00:22:35 +08:00
Li-shi-ling
e76a588818 refactor(runtime): unify command matching logic (#25)
* refactor(testing): share command matching with handler dispatcher

* fix:添加公共函数文件
2026-03-19 00:19:52 +08:00
Lishiling
665c9c69ae fix(runtime): avoid virtual dispatch in Star.on_error fallback 2026-03-18 23:21:27 +08:00
Lishiling
200559a580 fix(runtime): avoid creating Star instance in on_error fallback 2026-03-18 23:05:40 +08:00
whatevertogo
6449167726 Remove obsolete test files for testing module, top-level modules, transport, and wire codecs
- Deleted `test_testing_module.py` as it is no longer needed.
- Removed `test_top_level_modules.py` which had no content.
- Eliminated `test_transport.py` due to redundancy.
- Cleared out `test_wire_codecs.py` as part of the cleanup.
2026-03-17 21:57:14 +08:00
whatevertogo
b0e4d038ef delete: remove hello_plugin example and its related files 2026-03-17 21:21:03 +08:00
whatevertogo
6d00add2ed Merge branch 'dev' of https://github.com/united-pooh/astrbot-sdk into dev 2026-03-17 20:53:04 +08:00
whatevertogo
c55c89a464 feat: add Star plugin base class and StarTools utility class
- Introduced `Star` class as a base for v4 native plugins, providing lifecycle methods and context management.
- Added `StarTools` class for accessing runtime context and managing LLM tools.
- Implemented `PluginHarness` for local development and testing of plugins, allowing for message dispatching and lifecycle management.
- Created `GreedyStr` type for enhanced command parameter parsing, enabling the capture of remaining command text as a single argument.
- Added testing utilities and mock capabilities for plugin development.
2026-03-17 20:53:00 +08:00
whatevertogo
693b46ac93 delete again 2026-03-17 20:32:10 +08:00
whatevertogo
39a15bfa86 delete no need thing 2026-03-17 20:32:02 +08:00
whatevertogo
aa0d9ed4be change location 2026-03-17 20:24:49 +08:00
whatevertogo
821c10d176 feat: 增强过滤器类型和能力路由文档,添加 Provider 和会话管理功能 2026-03-17 13:47:17 +08:00
whatevertogo
f8db7ef440 feat: 添加高级方法和辅助函数文档,增强消息组件和事件处理功能 2026-03-17 02:14:16 +08:00
whatevertogo
a6acc3df36 Add comprehensive API documentation for types and utilities in AstrBot SDK
- Introduced `types.md` detailing type aliases, generics, and Pydantic models used in the SDK.
- Added `utils.md` covering utility classes and functions including CancelToken, MessageSession, command groups, and session management.
- Included usage examples and detailed descriptions for each component to enhance developer understanding and ease of use.
2026-03-17 02:06:18 +08:00
whatevertogo
780580bc3d feat: 大幅增强 SDK 核心功能和文档
新增模块:
- clients/files.py: 文件上传/下载客户端
- clients/managers.py: 会话/LLM/Provider 管理器
- clients/provider.py: LLM Provider 客户端
- conversation.py: 对话上下文管理
- plugin_kv.py: 插件 KV 存储辅助
- runtime/limiter.py: 限流器
- star_tools.py: Star 工具函数
- docs/: 完整的 SDK 使用文档 (01-05)

功能增强:
- Context 大幅扩展,增加 reply/send_image/typing 等便捷方法
- 装饰器增强,支持 on_llm_request/on_provider_request 等
- 内置 schemas 扩展,覆盖更多 capability 定义
- capability_router_builtins 大幅扩展内置能力实现
- handler_dispatcher 增强参数注入和错误处理
- Star 基类增加生命周期钩子和工具方法
2026-03-17 01:15:29 +08:00
whatevertogo
6d60e0f66b feat: 添加 LLM 工具管理和会话级别状态管理能力
- 新增 llm/ 模块,包含 LLMToolSpec、ProviderRequest、AgentSpec 等实体
- 新增 LLMToolManager 用于管理 LLM 工具注册和激活状态
- 新增 SessionPluginManager 用于会话级别的插件启用状态管理
- 新增 SessionServiceManager 用于会话级别的 LLM/TTS 服务状态管理
- 新增 RegistryClient 用于查询 handler 元数据和设置白名单
- 扩展 CapabilityRouter 内置能力,支持 session.* 和 registry.* 命名空间
- 增强描述符和装饰器以支持新的 trigger 类型
2026-03-16 17:53:07 +08:00
whatevertogo
ce8f29953d Merge branch 'refact1/refactsome' into dev 2026-03-16 02:01:38 +08:00
whatevertogo
e2e38bb3b2 Refactor worker initialization and remove unused codec parameters; add schedule and session waiter modules
- Simplified `GroupWorkerRuntime` and `PluginWorkerRuntime` constructors by removing the codec parameter and related logic.
- Introduced `schedule.py` to define `ScheduleContext` for managing scheduled tasks with a clear structure and payload handling.
- Added `session_waiter.py` for session-based conversational flow management, including `SessionController` and `SessionWaiterManager` for handling multi-turn dialogues.
- Enhanced testing utilities in `testing.py` by removing unused classes and streamlining the structure.
- Created `types.py` to introduce `GreedyStr` for improved command parameter parsing.
2026-03-16 01:58:52 +08:00
whatevertogo
06f4536851 fix(test): 更新 init_plugin 测试以匹配新的目录命名规范
CLI 的 _normalize_init_plugin_name 函数现在自动添加 astrbot_plugin_ 前缀,
测试期望的目录名从 demo_plugin 更新为 astrbot_plugin_demo_plugin。
2026-03-15 01:33:28 +08:00
whatevertogo
a10a7c87a6 merge: 合并 dev 分支的 msgpack wire codec 等更新 2026-03-15 01:29:09 +08:00
whatevertogo
e3395cc454 feat: 添加 AGENTS.md 文档,描述 v4 架构约束和开发命令
refactor: 更新 HandlerDispatcher 和 WorkerSession,增强参数处理和结果汇总逻辑
2026-03-15 01:26:51 +08:00
united_pooh
ff55f4d0d0 Merge pull request #10 from united-pooh/feat/msgpack-wire-codec
feat(runtime): add configurable msgpack worker transport support
2026-03-15 01:11:28 +08:00
letr
5bcf259fb6 fix(cli): scope worker wire codec option 2026-03-15 00:54:56 +08:00
letr
a979e92568 fix(runtime): preserve json transport compatibility 2026-03-15 00:54:38 +08:00
letr
98a5eddfcb fix(runtime): align msgpack framing with transport defaults 2026-03-15 00:54:37 +08:00
letr
0d7c4994aa feat(runtime): add configurable msgpack wire codec support 2026-03-15 00:54:37 +08:00
united_pooh
fc7ede9d42 Merge branch 'refact1/refactsome' into dev
# Conflicts:
#	src-new/astrbot_sdk/cli.py
#	tests_v4/test_top_level_modules.py
2026-03-15 00:41:38 +08:00
whatevertogo
84184c4c0a feat(errors): Enhance AstrBotError with detailed documentation and examples
feat(events): Expand MessageEvent with reply capabilities and detailed docstrings

fix(loader): Ensure plugin path is correctly managed in sys.path

feat(star): Improve Star class documentation and lifecycle method descriptions

feat(testing): Add plugin metadata handling in MockContext and enhance PluginHarness

feat(hello): Refactor HelloPlugin to utilize new reply methods and structured capabilities

test(decorators): Add tests for input/output model support in provide_capability

test(events): Implement tests for reply_image and reply_chain methods in MessageEvent

test(http): Validate API registration with capability handler references and error handling

test(tests): Enhance tests for plugin harness and directory handling in dev commands
2026-03-14 23:37:09 +08:00
whatevertogo
6bab178d6f refactor: 更新项目架构文档,增强能力客户端和执行边界的描述,移除兼容层设计章节 2026-03-14 23:08:49 +08:00
whatevertogo
6a0f33a3fb refactor: 更新兼容层弃用通知,优化文档结构和可读性 2026-03-14 23:05:10 +08:00
whatevertogo
fc93450bba refactor: 删除过时的架构文档、变更日志和兼容矩阵文件 2026-03-14 23:02:09 +08:00