Skip to main content

Shared queue and safety primitives for AstrBot proactive chat plugins.

Project description

astrbot_proactive_core

AstrBot 主动消息插件的共享核心库。

这个仓库只放稳定、可复用、跨插件共享的底层能力,不绑定 QQ、Discord、Telegram,也不直接依赖 yurisa-Hermes

当前 v0 能力:

  • SQLite 持久化任务队列。
  • 全局并发、按任务类型并发、按会话串行处理。
  • 任务状态和投递状态分离。
  • 对外安全的失败码和错误脱敏工具。

设计边界:

  • 插件只能通过公开 facade 使用队列。
  • storage、worker、payload 细节先保持内部实现。
  • 后续 astrbot_plugin_proactive_chat、TTS/STT 插件和其他主动行为插件都可以复用这里的协议。

安装

本地开发:

cd /path/to/astrbot_proactive_core
uv sync --extra dev
uv run python scripts/smoke_check.py
uv run --extra dev pytest -q
uv run --extra dev ruff check .

作为依赖安装:

pip install 'astrbot-proactive-core>=0.1.0,<0.2.0'

如果还没有发布到 PyPI,可以先用 Git URL 或本地路径安装,再安装依赖它的 AstrBot 插件。

公共 API

当前对外稳定 API:

  • SQLiteQueue
  • JobState
  • DeliveryState
  • JobRecord
  • safe_failure_code
  • redact_public_detail

SQLiteQueue.status_counts() 可用于管理命令或 WebUI 展示队列状态。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

astrbot_proactive_core-0.1.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

astrbot_proactive_core-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file astrbot_proactive_core-0.1.0.tar.gz.

File metadata

  • Download URL: astrbot_proactive_core-0.1.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for astrbot_proactive_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 076e6db10434ff678f684cce8afa3204654ebd736f9903af8f06b023eb3320a4
MD5 6555936d7d4a9d84def4e2c47c3c225f
BLAKE2b-256 d96086252d93b335faed66a78f74d333e1ae9fcbcda4575d93e115933465a986

See more details on using hashes here.

File details

Details for the file astrbot_proactive_core-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: astrbot_proactive_core-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for astrbot_proactive_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 850d2a5c386330dd5f0ff49363b9c16db94cca775903669551cd0cf55e307228
MD5 7c7f037dbd96ebaa0012ee5e2416912d
BLAKE2b-256 7ea1253e479a6d47ddc0bee11973f167c29bde36fd7d0ebf7a12c93f9c8c441f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page