ForcePilot/backend/package/yuxi/channels/plugins/wechat_ilink/manifest.json
Kris 2a2385bacc refactor(wechat-ilink): 重构微信iLink插件代码,统一常量与缓存键格式
本次重构对微信iLink渠道插件进行了全面整理:
1.  新增共享常量模块`_constants.py`,集中管理所有跨模块共享配置与标识,对齐manifest单真相源
2.  统一缓存键格式为`wechat_ilink:{account_id}:{key}`,修复白名单存储键顺序错误
3.  重构登录适配器,移除不必要的account_id参数,简化接口调用
4.  重构生命周期相关代码,新增缓存清理逻辑,支持按账户清理孤儿缓存
5.  移除冗余重复定义的常量与配置默认值,统一从常量模块导入
6.  更新manifest配置,补充传输模式与能力要求声明
7.  优化出站适配器,新增续传支持与分片发送逻辑
2026-07-08 22:56:45 +08:00

96 lines
4.4 KiB
JSON

{
"id": "com.yuxi.channels.wechat_ilink",
"name": "微信iLink",
"version": "1.0.0",
"channel_type": "wechat_ilink",
"icon": "smartphone",
"entry_module": "yuxi.channels.plugins.wechat_ilink.entry",
"provides": ["wechat_ilink"],
"lifecycle": ["init", "start", "stop", "pause", "resume", "unload", "reconfigure", "fail"],
"compatibility": {
"min_host_version": "1.0.0",
"ilink_api_version": "2.0.0"
},
"failure_policy": "degrade",
"depends": [],
"critical": false,
"requires_dm_pairing": true,
"requires_outbound_delivery": true,
"credential_strategy": {
"type": "dynamic",
"acquire_method": "qr_login",
"required_fields": ["bot_token", "ilink_bot_id", "ilink_user_id", "baseurl"],
"optional_fields": [],
"supports_rotation": false,
"supports_revocation": false
},
"max_message_length": 4000,
"supports_credential_cloning": false,
"transport_mode": "pull",
"capabilities": {
"rich_message": false,
"streaming": false,
"typing_indicator": false,
"message_edit": false,
"message_recall": false,
"supports_reaction": false,
"supports_pin": false,
"supports_card_update": false,
"supports_card_update_streaming": false,
"supports_image_inbound": true,
"supports_video_inbound": true,
"supports_image_outbound": true,
"supports_video_outbound": true,
"mention": false,
"command": false,
"directory": false,
"doctor": true,
"whitelist": true,
"wizard": true,
"tools": false,
"status": false,
"probeable": true,
"identity_resolver": false,
"lifecycle": true,
"supports_qr_login": true,
"agent_collaboration": false
},
"capability_requirements": [
["supports_image_inbound", ["bot_token", "ilink_bot_id", "ilink_user_id", "baseurl"]],
["supports_video_inbound", ["bot_token", "ilink_bot_id", "ilink_user_id", "baseurl"]],
["supports_image_outbound", ["bot_token", "ilink_bot_id", "ilink_user_id", "baseurl"]],
["supports_video_outbound", ["bot_token", "ilink_bot_id", "ilink_user_id", "baseurl"]],
["doctor", ["bot_token", "ilink_bot_id", "ilink_user_id", "baseurl"]],
["whitelist", ["bot_token", "ilink_bot_id", "ilink_user_id", "baseurl"]],
["wizard", ["bot_token", "ilink_bot_id", "ilink_user_id", "baseurl"]],
["probeable", []],
["lifecycle", []],
["supports_qr_login", ["bot_token", "ilink_bot_id", "ilink_user_id", "baseurl"]]
],
"resource_quota": {
"max_cpu": "15.0",
"max_memory": "128MB",
"max_connections": 10,
"max_calls_per_sec": 20
},
"accessible_ports": [
"ConfigPort",
"LoggerPort",
"PersistencePort",
"CachePort"
],
"injectable_pipelines": ["inbound", "outbound"],
"config_schema": [
{"key": "bot_token", "type": "string", "required": true, "default": null, "hot_reloadable": false, "sensitive": true, "scope": "account", "constraints": {}},
{"key": "ilink_bot_id", "type": "string", "required": true, "default": null, "hot_reloadable": false, "scope": "account", "constraints": {}},
{"key": "ilink_user_id", "type": "string", "required": true, "default": null, "hot_reloadable": false, "scope": "account", "constraints": {}},
{"key": "baseurl", "type": "string", "required": false, "default": "https://ilinkai.weixin.qq.com", "hot_reloadable": false, "scope": "channel", "constraints": {"pattern": "^https?://"}},
{"key": "channel_version", "type": "string", "required": false, "default": "2.0.0", "hot_reloadable": true, "scope": "channel", "constraints": {}},
{"key": "cdn_url", "type": "string", "required": false, "default": "https://novac2c.cdn.weixin.qq.com/c2c", "hot_reloadable": true, "scope": "channel", "constraints": {"pattern": "^https?://"}},
{"key": "long_poll_timeout_ms", "type": "integer", "required": false, "default": 35000, "hot_reloadable": true, "scope": "channel", "constraints": {"min": 10000, "max": 60000}},
{"key": "qr_poll_interval_ms", "type": "integer", "required": false, "default": 2000, "hot_reloadable": true, "scope": "channel", "constraints": {"min": 1000, "max": 5000}},
{"key": "qr_timeout_ms", "type": "integer", "required": false, "default": 120000, "hot_reloadable": true, "scope": "channel", "constraints": {"min": 30000, "max": 300000}},
{"key": "max_message_length", "type": "integer", "required": false, "default": 4000, "hot_reloadable": true, "scope": "channel", "constraints": {"min": 500, "max": 10000}}
]
}