feat(rust): initial Rust core runtime with CLI support

- Add Rust orchestrator with async bootstrap pattern
- Implement CLI with clap (start, stats, health subcommands)
- Add protocol stubs (LSP, MCP, ACP, ABP)
- Python bindings via pyo3 (_core module)
- Use maturin as build backend
- Add tombi.toml for schema config
This commit is contained in:
LIghtJUNction
2026-03-25 00:08:04 +08:00
parent ac700c690a
commit 7baff6f255
16 changed files with 793 additions and 150 deletions

View File

@@ -5,6 +5,7 @@ description = "Easy-to-use multi-platform LLM chatbot and development framework"
readme = "README.md"
requires-python = ">=3.12,<3.14"
keywords = ["Astrbot", "Astrbot Module", "Astrbot Plugin"]
dependencies = [
@@ -72,6 +73,9 @@ dependencies = [
"openai-agents>=0.12.5",
"fastapi>=0.135.1",
]
[project.scripts]
astrbot = "astrbot.cli.__main__:cli"
astrbot-rs = "astrbot._internal.runtime._core:cli"
[dependency-groups]
dev = [
@@ -84,8 +88,7 @@ dev = [
"textual-dev>=1.8.0",
]
[project.scripts]
astrbot = "astrbot.cli.__main__:cli"
[tool.ruff]
exclude = ["astrbot/core/utils/t2i/local_strategy.py", "astrbot/api/all.py", "tests"]
@@ -124,14 +127,13 @@ exclude = ["dashboard", "node_modules", "dist", "data", "tests"]
[tool.hatch.metadata]
allow-direct-references = true
# Include bundled dashboard dist even though it is not tracked by VCS.
[tool.hatch.build.targets.wheel]
artifacts = ["astrbot/dashboard/dist/**"]
# Custom build hook: builds the Vue dashboard and copies dist into the package.
[tool.hatch.build.hooks.custom]
path = "scripts/hatch_build.py"
# AstrBot Core Rust extension
#:schema strict = false
[tool.maturin]
manifest-path = "rust/Cargo.toml"
module-name = "astrbot._internal.runtime.rust._core"
build-hook = "buildHooks.custom:pre_build_hook"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
requires = ["maturin>=1.12.0"]
build-backend = "maturin"