Skip to main content

HITL Server - Human-in-the-Loop 服务端(个人端,iLink + WeCom AI)

Project description

hitl-server — Human-in-the-Loop 服务端

让 AI Agent 在执行关键操作前,先通过微信 / 企业微信向你确认。

AI 把「需要人确认」的请求发给 hitl-serverhitl-server 把消息推到你的手机 (微信 ClawBot / iLink 或企微 AI 机器人),你回复后 AI 拿到结果继续执行。

┌──────────┐  MCP(stdio)  ┌──────────┐  HTTP   ┌────────────┐  长连接   ┌──────────┐
│ AI Agent │ ───────────▶ │ hitl-mcp │ ──────▶ │ hitl-server│ ────────▶ │ 你的手机 │
│ Cursor   │ ◀─────────── │  (npx)   │ ◀────── │  :8081     │ ◀──────── │ 微信/企微 │
└──────────┘              └──────────┘         └────────────┘           └──────────┘

内置引擎

  • ilink:iLink 长轮询,对接个人微信 ClawBot。
  • wecom-aibot:企微 WebSocket,对接企业微信 AI 机器人。

两种部署形态:本地单用户(默认,无需公网服务器)与服务器共享部署(多人共用一个企微 Bot)。

安装

pip install hitl-server
# 或
uvx hitl-server
# 或从源码
uv sync && uv run python -m hitl_server.app

运行

hitl-server                         # 前台运行,默认 :8081
ENABLE_ILINK_ENGINE=true hitl-server  # 启用 iLink 引擎
USE_DATABASE=true hitl-server        # 数据库模式(SQLAlchemy)

管理台:http://localhost:8081/console

关键特性

  • 多会话并发引用回复匹配:[#short_id] 标签 + iLink 出站 message_id L0 精确匹配, 彻底消除并发待回复时的歧义。
  • JSON 文件 / 数据库双存储,接口一致(开发用 SQLite,生产用 MySQL)。
  • Alembic 管理 schema 迁移。
  • 内置 React 管理台(JWT 保护)。

文档

License

MIT

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

hitl_server-2.1.7.tar.gz (188.6 kB view details)

Uploaded Source

Built Distribution

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

hitl_server-2.1.7-py3-none-any.whl (206.0 kB view details)

Uploaded Python 3

File details

Details for the file hitl_server-2.1.7.tar.gz.

File metadata

  • Download URL: hitl_server-2.1.7.tar.gz
  • Upload date:
  • Size: 188.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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 hitl_server-2.1.7.tar.gz
Algorithm Hash digest
SHA256 31e5d7d3a9135e77158a9a85b119b9d20fcaaf44ad267ca72333b889fb0bac32
MD5 766ac6343fe3ee4e12464ed1ed966ba0
BLAKE2b-256 ef09b81b71ab87214dfe2a2bdda8e55f9f2a3c30158edad2920ed03583c230a1

See more details on using hashes here.

File details

Details for the file hitl_server-2.1.7-py3-none-any.whl.

File metadata

  • Download URL: hitl_server-2.1.7-py3-none-any.whl
  • Upload date:
  • Size: 206.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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 hitl_server-2.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 97f04463daae02c586b788443b550d84369c6d21b2c715af8c4336427990f704
MD5 a6b5ab38271a6c4d293f4cc6806e394b
BLAKE2b-256 2d5c30999be25f2f9563a44e65b58beced49f133c985527fa219404b287bfffb

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