Skip to main content

Bridge Feishu bot messages to AUN agents.

Project description

fs2aun-proxy (Python)

飞书消息通过 AUN 代理转发到目标 AID 的单进程代理服务。

安装

python -m venv .venv && . .venv/bin/activate
python -m pip install -e ".[dev]"

测试 / 检查

python -m pytest -q
python -m ruff check .
python -m mypy

运行

fs2aun-proxy serve -c config.toml
fs2aun-proxy fs-user create -c config.toml  # 扫码创建/授权飞书机器人并写回 [feishu] app_id/app_secret
fs2aun-proxy aid create newbot.agentid.pub -c config.toml  # 创建本地 AUN AID 身份,不自动切换 [aun] aid
fs2aun-proxy bind create -c config.toml alice.agent
fs2aun-proxy bind create -c config.toml          # 省略 AID 时使用 [aun] default_aid_dst
fs2aun-proxy bind list -c config.toml
fs2aun-proxy bind remove -c config.toml ou_x alice.agent
curl -H "Authorization: Bearer $FS2AUN_ADMIN_TOKEN" http://127.0.0.1:8286/binds

配置

config.example.toml。敏感项(admin.token、bind.token_secret、bind.session_secret、feishu.app_secret、aun.encryption_seed)须 >= 32 字节,可用 FS2AUN_* 环境变量覆盖。

架构

单进程服务,包含以下模块:

  • config — TOML 配置加载与校验
  • models — Pydantic 数据模型(AunMessage、Binding 等)
  • storage — 原子性 JSON 文件存储(带 FileLock)
  • dedup — 持久化 / 内存 TTL 去重
  • router — 绑定表、关联 ID、反向路由(asyncio.Lock 保护)
  • ack — 待发送表与 ACK 状态机
  • feishu — 飞书 REST 发送、OAuth 解析、Webhook 安全校验
  • aun — AUN 网关 WebSocket 客户端
  • bind — 绑定 Token、所有权授权、Challenge 存储
  • oauth — OAuth Session AES-GCM 加密 Cookie
  • service — 代理核心逻辑(飞书→AUN、AUN→飞书)
  • http_app — FastAPI 应用(Webhook、OAuth 回调、管理 API)
  • cli — 命令行入口(serve / webserve / fs-user create / aid create / bind create|list|remove)

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

fs2aun_proxy-0.1.0.tar.gz (226.5 kB view details)

Uploaded Source

Built Distribution

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

fs2aun_proxy-0.1.0-py3-none-any.whl (56.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fs2aun_proxy-0.1.0.tar.gz
  • Upload date:
  • Size: 226.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for fs2aun_proxy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3befcca3e8821793d166d99942f827de7aff0c7fac0da0ce381cf2c3ee5c5216
MD5 752fb6f6039f65872242e2201949edf9
BLAKE2b-256 7ab45405dfce4d8ca52c9e21673a0d635a3831ee655cfe9bbe141a75f0cc6ecf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fs2aun_proxy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 56.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for fs2aun_proxy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f66371ded73b1913b85b18d02bad40b0b6e50c2a315303041d550c1eddfe7b47
MD5 d2cd6ea6da420b06eff499b1a0d9a9f4
BLAKE2b-256 3b1e9f47dec07ce6b330d7d62088d9a1c346ba6fc6bdbd67b349604366e22849

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