diff --git a/.env.example b/.env.example index c9267e9..4d88081 100644 --- a/.env.example +++ b/.env.example @@ -48,6 +48,17 @@ BUB_TAPESTORE_SQLALCHEMY_URL=mysql+oceanbase://user:pass@host:port/database # WeChat channel (optional, bundled) # Run `uv run bub login wechat` to authenticate +# --------------------------------------------------------------------------- +# WeCom channel (optional, bundled) +# --------------------------------------------------------------------------- +# BUB_WECOM_BOT_ID=your-bot-id +# BUB_WECOM_SECRET=your-long-connection-secret +# BUB_WECOM_WEBSOCKET_URL=wss://openws.work.weixin.qq.com +# BUB_WECOM_DM_POLICY=open +# BUB_WECOM_ALLOW_FROM=["alice","bob"] +# BUB_WECOM_GROUP_POLICY=open +# BUB_WECOM_GROUP_ALLOW_FROM=["wrXXX","wrYYY"] + # --------------------------------------------------------------------------- # Discord channel (optional, bundled) # --------------------------------------------------------------------------- diff --git a/README.md b/README.md index 1393a6f..de2f9ee 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A Bub distribution for data-driven insight workflows, powered by [OceanBase seek bubseek packages [Bub](https://github.com/bubbuild/bub) with ready-to-use components for rapid data consumption. It's an attempt to explore a different approach to enterprise data needs: instead of scheduling BI tickets, tell the agent what you want and get insights back. -**Multi-channel entry** — Feishu, DingTalk, WeChat, Discord, Telegram, and a built-in marimo web interface. Configure env vars and enable via gateway. +**Multi-channel entry** — Feishu, DingTalk, WeChat, WeCom, Discord, Telegram, and a built-in marimo web interface. Configure env vars and enable via gateway. **Lightweight data consumption** — marimo notebooks for dashboards, github-repo-cards for generating shareable repo cards, schedule tasks with cron support. Add insights to `insights/` and the agent can work with them dynamically. diff --git a/docs/architecture.md b/docs/architecture.md index 69a4d27..41cd5aa 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -6,7 +6,7 @@ bubseek is an attempt to explore a different approach to enterprise data needs: - Packages Bub with pre-configured dependencies - Provides OceanBase/seekdb storage support via bub-tapestore-sqlalchemy -- Ships builtin channels: Feishu, DingTalk, WeChat, Discord, Telegram, Marimo +- Ships builtin channels: Feishu, DingTalk, WeChat, WeCom, Discord, Telegram, Marimo - Ships builtin skills: github-repo-cards, web-search, schedule - Provides built-in observability: agent's own footprint becomes queryable data diff --git a/docs/configuration.md b/docs/configuration.md index 91c69ac..cd8bb1a 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -71,6 +71,24 @@ uv run bub login wechat # Scan QR code with WeChat app uv run bub gateway --enable-channel wechat ``` +### WeCom + +1. Visit WeCom AI bot admin console and create or select a bot +2. Enable long-connection mode, then get Bot ID and Secret +3. If needed, configure direct-message or group allowlist policies + +```bash +export BUB_WECOM_BOT_ID=your-bot-id +export BUB_WECOM_SECRET=your-long-connection-secret +# optional +# export BUB_WECOM_WEBSOCKET_URL=wss://openws.work.weixin.qq.com +# export BUB_WECOM_DM_POLICY=open +# export BUB_WECOM_ALLOW_FROM='["alice", "bob"]' +# export BUB_WECOM_GROUP_POLICY=open +# export BUB_WECOM_GROUP_ALLOW_FROM='["wrXXX", "wrYYY"]' +uv run bub gateway --enable-channel wecom +``` + ### Marimo (web dashboard) ```bash diff --git a/pyproject.toml b/pyproject.toml index 8f29959..1d6a9c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,7 @@ dependencies = [ "bub-feishu", "bub-dingtalk", "bub-wechat", + "bub-wecom", "bub-discord", "bub-web-search", "bub-tapestore-sqlalchemy", @@ -81,6 +82,7 @@ bub = { git = "https://github.com/bubbuild/bub.git" } bub-dingtalk = { git = "https://github.com/bubbuild/bub-contrib.git", branch = "main", subdirectory = "packages/bub-dingtalk" } bub-feishu = { git = "https://github.com/bubbuild/bub-contrib.git", branch = "main", subdirectory = "packages/bub-feishu" } bub-wechat = { git = "https://github.com/bubbuild/bub-contrib.git", branch = "main", subdirectory = "packages/bub-wechat" } +bub-wecom = { git = "https://github.com/bubbuild/bub-contrib.git", branch = "main", subdirectory = "packages/bub-wecom" } bub-discord = { git = "https://github.com/bubbuild/bub-contrib.git", branch = "main", subdirectory = "packages/bub-discord" } bub-web-search = { git = "https://github.com/bubbuild/bub-contrib.git", branch = "main", subdirectory = "packages/bub-web-search" } bub-tapestore-sqlalchemy = { git = "https://github.com/bubbuild/bub-contrib.git", branch = "main", subdirectory = "packages/bub-tapestore-sqlalchemy" } diff --git a/uv.lock b/uv.lock index f617ea8..b0637fa 100644 --- a/uv.lock +++ b/uv.lock @@ -387,6 +387,14 @@ dependencies = [ { name = "weixin-bot-sdk" }, ] +[[package]] +name = "bub-wecom" +version = "0.1.0" +source = { git = "https://github.com/bubbuild/bub-contrib.git?subdirectory=packages%2Fbub-wecom&branch=main#cbf1ef0e23dc31daaf3ea24038695487ed662f45" } +dependencies = [ + { name = "wecom-aibot-python-sdk" }, +] + [[package]] name = "bubseek" version = "0.1.0" @@ -399,6 +407,7 @@ dependencies = [ { name = "bub-tapestore-sqlalchemy" }, { name = "bub-web-search" }, { name = "bub-wechat" }, + { name = "bub-wecom" }, { name = "bubseek-marimo" }, { name = "bubseek-schedule" }, { name = "pydantic-settings" }, @@ -431,6 +440,7 @@ requires-dist = [ { name = "bub-tapestore-sqlalchemy", git = "https://github.com/bubbuild/bub-contrib.git?subdirectory=packages%2Fbub-tapestore-sqlalchemy&branch=main" }, { name = "bub-web-search", git = "https://github.com/bubbuild/bub-contrib.git?subdirectory=packages%2Fbub-web-search&branch=main" }, { name = "bub-wechat", git = "https://github.com/bubbuild/bub-contrib.git?subdirectory=packages%2Fbub-wechat&branch=main" }, + { name = "bub-wecom", git = "https://github.com/bubbuild/bub-contrib.git?subdirectory=packages%2Fbub-wecom&branch=main" }, { name = "bubseek-marimo", editable = "contrib/bubseek-marimo" }, { name = "bubseek-schedule", editable = "contrib/bubseek-schedule" }, { name = "pydantic-settings", specifier = ">=2.0.0" }, @@ -2104,6 +2114,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/00/4b/ccc026168948fec4f7555b9164c724cf4125eac006e176541483d2c959be/pydantic_settings-2.13.1-py3-none-any.whl", hash = "sha256:d56fd801823dbeae7f0975e1f8c8e25c258eb75d278ea7abb5d9cebb01b56237", size = 58929, upload-time = "2026-02-19T13:45:06.034Z" }, ] +[[package]] +name = "pyee" +version = "13.0.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/8b/04/e7c1fe4dc78a6fdbfd6c337b1c3732ff543b8a397683ab38378447baa331/pyee-13.0.1.tar.gz", hash = "sha256:0b931f7c14535667ed4c7e0d531716368715e860b988770fc7eb8578d1f67fc8", size = 31655, upload-time = "2026-02-14T21:12:28.044Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a0/c4/b4d4827c93ef43c01f599ef31453ccc1c132b353284fc6c87d535c233129/pyee-13.0.1-py3-none-any.whl", hash = "sha256:af2f8fede4171ef667dfded53f96e2ed0d6e6bd7ee3bb46437f77e3b57689228", size = 15659, upload-time = "2026-02-14T21:12:26.263Z" }, +] + [[package]] name = "pygments" version = "2.20.0" @@ -2864,6 +2886,22 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/6f/28/258ebab549c2bf3e64d2b0217b973467394a9cea8c42f70418ca2c5d0d2e/websockets-16.0-py3-none-any.whl", hash = "sha256:1637db62fad1dc833276dded54215f2c7fa46912301a24bd94d45d46a011ceec", size = 171598, upload-time = "2026-01-10T09:23:45.395Z" }, ] +[[package]] +name = "wecom-aibot-python-sdk" +version = "1.0.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "aiohttp" }, + { name = "certifi" }, + { name = "cryptography" }, + { name = "pyee" }, + { name = "websockets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/23/b4/df93b46006e5c1900703aefa59004e6d524a4e73ba56ae73bcce24ff4184/wecom_aibot_python_sdk-1.0.2.tar.gz", hash = "sha256:f8cd9920c0b6cb88bf8a50742fca1e834e5c49e06c3ae861d0f128672c17697b", size = 31706, upload-time = "2026-03-23T07:44:53.949Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ee/39/f2fab475f15d5bf596c4fa998ddd321b1400bcc6ae2e73d3e935db939379/wecom_aibot_python_sdk-1.0.2-py3-none-any.whl", hash = "sha256:03df207c72021157506647cd9f4ee51b865a7f37d3b5df7f7af1b1c7e677db84", size = 23228, upload-time = "2026-03-23T07:44:52.555Z" }, +] + [[package]] name = "weixin-bot-sdk" version = "0.2.0"