Skip to content

Commit 35feedd

Browse files
committed
Squashed 'astrbot-sdk/' changes from 378257db7..9724f6230
9724f6230 chore: refresh vendor snapshot [skip ci] 87dd4d31f Merge pull request #103 from united-pooh:dev 816732c52 Merge branch 'dev' of https://github.com/united-pooh/astrbot-sdk into dev 740f497fb feat: 引入线程安全机制,优化插件加载和组件实例化过程 1c2c451b9 Merge pull request #102 from united-pooh/docs/72 dad29d656 docs: 翻译预期外的英文注释 0688d335f Merge pull request #101 from united-pooh/fix-96-init-gitignore-template b7b3e6bc5 feat: generate plugin gitignore during init REVERT: 378257db7 chore: refresh vendor snapshot [skip ci] git-subtree-dir: astrbot-sdk git-subtree-split: 9724f6230147d6101cc4c6493d3d6b7b8e1d4f33
1 parent e150325 commit 35feedd

3 files changed

Lines changed: 371 additions & 194 deletions

File tree

src/astrbot_sdk/cli.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,56 @@ def _render_init_readme(*, plugin_name: str) -> str:
749749
)
750750

751751

752+
def _render_init_gitignore() -> str:
753+
return dedent(
754+
"""\
755+
# Python
756+
__pycache__/
757+
*.py[cod]
758+
*.pyo
759+
*.egg-info/
760+
dist/
761+
build/
762+
*.egg
763+
764+
# 虚拟环境
765+
.venv/
766+
venv/
767+
env/
768+
769+
# IDE
770+
.idea/
771+
.vscode/
772+
*.swp
773+
*.swo
774+
*~
775+
776+
# OS
777+
.DS_Store
778+
Thumbs.db
779+
desktop.ini
780+
781+
# 测试 / 检查缓存
782+
.pytest_cache/
783+
.ruff_cache/
784+
.mypy_cache/
785+
.coverage
786+
htmlcov/
787+
788+
# 开发/构建工具
789+
/.claude/
790+
/.agents/
791+
/.opencode/
792+
793+
# 图床配置(含 API 密钥等敏感信息)
794+
/image_host/config.json
795+
796+
# 插件测试产物
797+
/.astrbot_sdk_testing/
798+
"""
799+
)
800+
801+
752802
def _render_init_test_py(*, plugin_name: str) -> str:
753803
class_name = _class_name_for_plugin(plugin_name)
754804
return dedent(
@@ -1013,6 +1063,10 @@ def _init_plugin(name: str | None, agents: tuple[str, ...] = ()) -> None:
10131063
_render_init_readme(plugin_name=plugin_name),
10141064
encoding="utf-8",
10151065
)
1066+
(target_dir / ".gitignore").write_text(
1067+
_render_init_gitignore(),
1068+
encoding="utf-8",
1069+
)
10161070
(target_dir / "tests" / "test_plugin.py").write_text(
10171071
_render_init_test_py(plugin_name=plugin_name),
10181072
encoding="utf-8",

src/astrbot_sdk/clients/__init__.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
"""Native v4 capability clients.
1+
"""原生v4能力客户端
22
3-
These clients provide the narrow, typed surface exposed by `Context` for
4-
calling remote capabilities. They handle capability names, payload shaping,
5-
and result decoding, without exposing protocol or transport details.
3+
这些客户端为 Context 提供了用于调用远程能力的狭窄且具类型化 (typed) 的接口。
4+
它们负责处理能力名称、载荷格式化(payload shaping)以及结果解码,且不会暴露协议或传输层的具体细节。
65
7-
Migration shims and higher-level orchestration stay outside these native
8-
capability clients so `Context` keeps a narrow, stable surface.
6+
为了保持 Context 接口的精简与稳定,迁移适配层 (Migration shims) 以及高层级编排逻辑 (higher-level orchestration) 均不包含在这些原生能力客户端之内。
97
108
当前公开客户端:
119
- LLMClient: 文本/结构化/流式 LLM 调用

0 commit comments

Comments
 (0)