Add larkx/region.py with per-region endpoints, gateway app id and locale. The region is chosen at login (lark auth qr/import --region, default LARKX_REGION) and persisted in credentials; every request derives its URLs from it. Credentials saved before this change are treated as Feishu. Fixes found while testing with real Lark and Feishu accounts: - search: locale belongs on the request header, not searchContext - storage: drop inline thumbnail bytes so content_data stays valid JSON - send --root: set parentId, plus isReplyInThread for regular groups; topic-mode groups reject that flag, so chat modes are looked up and cached per chat - topic groups (GROUP + chatMode THREAD/THREAD_V2): root messages anchor their own thread, except system notices; push handling and pull_history share decoders.resolve_scope - show media/audio durations in seconds (they are milliseconds) - render @mentions with the mentioned name via AtProperty - lark send stores the server message id so the WS echo fills in the same row instead of inserting a duplicate proto.proto gains isReplyInThread, AtProperty and PutMessageResponse; proto_pb2.py is regenerated with grpcio-tools 1.71 (protoc 5.29.0).
34 lines
1.2 KiB
Plaintext
34 lines
1.2 KiB
Plaintext
# LarkAgentX 配置(全部有默认值,按需修改)
|
|
# 复制为 .env 放在项目根目录即可生效
|
|
|
|
# 区域: feishu(飞书国内版) | lark(Lark 国际版 larksuite.com)
|
|
# 只决定首次登录走哪边;登录后以凭证里记录的区域为准,切换用 lark auth qr --region <feishu|lark>
|
|
LARKX_REGION=feishu
|
|
|
|
# 数据目录(凭证/消息库/agent 会话)
|
|
LARKX_HOME=~/.larkx
|
|
|
|
# 消息存储: 留空 = SQLite(自动存到 LARKX_HOME/messages.db)
|
|
# 用 MySQL 则填: mysql+pymysql://<user>:<password>@<host>:3306/<db>
|
|
LARKX_STORAGE_URL=
|
|
|
|
# agent 上下文边界: anchor(会话+话题) | chat(会话) | global(全部共享)
|
|
LARKX_CONTEXT_SCOPE=global
|
|
|
|
# agent 后端: claude | none
|
|
LARKX_AGENT_BACKEND=claude
|
|
|
|
# 数字人系统提示词(留空用内置默认)
|
|
LARKX_SYSTEM_PROMPT=
|
|
|
|
# 收到消息自动标记已读(默认开;手机端未读角标会清掉)
|
|
LARKX_MARK_READ=true
|
|
|
|
# 触发前缀: 只处理以此前缀开头的消息(留空 = 全部处理)
|
|
# 例: LARKX_TRIGGER_PREFIX=/run
|
|
LARKX_TRIGGER_PREFIX=
|
|
|
|
# 登录凭证不放这里,用命令管理:
|
|
# lark auth qr 扫码登录(推荐)
|
|
# lark auth import --cookie "<cookie>" 手动导入
|