feat(chat): 补齐文字表情原地更新契约(风险:低)

基于 PR #621 现有 update-text-emotion 实现,补齐七参数 RPC 映射、Cobra/Schema 必填约束、mono Skill、CHANGELOG 与别名/缺参回归测试。
This commit is contained in:
chichuan
2026-07-29 14:17:03 +08:00
parent 6b99685594
commit c3dbe866c4
13 changed files with 1271 additions and 734 deletions
+4
View File
@@ -6,6 +6,10 @@ The format is inspired by [Keep a Changelog](https://keepachangelog.com/) and th
## [Unreleased]
### Added
- **In-place text-emotion updates** — adds `dws chat message update-text-emotion`, mapping the seven required conversation, message, old/new emotion, name, text, and background parameters to Wukong's proven `im/update_text_emotion` capability so status transitions can avoid remove-then-add flicker and duplicate network calls ([hugozhu/dingtalk-opencode-tag#85](https://github.com/hugozhu/dingtalk-opencode-tag/issues/85)).
### Fixed
- **Name→ID resolution kept external contacts** — the shared contact resolver (`chat +dm`, `+broadcast`, …) no longer drops `search_contact_by_key_word` rows that carry only an `openDingTalkId` (external / cross-org contacts have an empty `userId`), so those people are found instead of reported missing or collapsed into a wrong single match; the display name also falls back through `nick`/`showName`/`flowerName`/`staffName`/`userName`.
+74 -42
View File
@@ -30788,32 +30788,33 @@
]
},
"chat message update-text-emotion": {
"agent_summary": "更新消息上已有的文字表情回应",
"agent_summary": "把消息上已有的文字表情原地替换为新的文字表情",
"agent_summary_source": "dws-agent-selection/chat",
"availability": "available",
"avoid_when": [
"新增用 add-text-emotion;移除用 remove-text-emotion"
"消息上还没有文字表情时使用 chat message add-text-emotion",
"只需清除文字表情时使用 chat message remove-text-emotion"
],
"confirmation": "not_required",
"effect": "write",
"effect_source": "agent-hint",
"examples": [
"dws chat message update-text-emotion --conversation-id \u003ccid\u003e --msg-id \u003cmid\u003e --old-emotion-id \u003cold\u003e --emotion-id \u003cnew\u003e --emotion-name \"赞\" --text \"nice\" --background-id im_bg_5 --format json"
"dws chat message update-text-emotion --conversation-id \u003copenConversationId\u003e --msg-id \u003copenMessageId\u003e --old-emotion-id \u003coldEmotionId\u003e --emotion-id \u003cemotionId\u003e --emotion-name \"处理中\" --text \"处理中 2 分钟\" --background-id im_bg_5"
],
"field_provenance": {
"agent_summary": {
"value": "更新消息上已有的文字表情回应",
"value": "把消息上已有的文字表情原地替换为新的文字表情",
"source": "internal/cli/schema_hints/selection/chat.json",
"precedence": "reviewed_explicit",
"resolution": "highest_precedence",
"review_reason": "人工审阅:对照悟空 develop 同名命令实现、Cobra Long/Example 与 Runtime 确认门禁移植;不改变命令身份、参数契约或接口绑定。",
"review_reason": "依据 issue #85 的原地状态更新场景、Wukong 30f13f02 的真实 Cobra/MCP 映射和开源实现复核;选择语义不改变执行、安全或参数事实。",
"candidates": [
{
"value": "更新消息上已有的文字表情回应",
"value": "把消息上已有的文字表情原地替换为新的文字表情",
"source": "internal/cli/schema_hints/selection/chat.json",
"precedence": "reviewed_explicit",
"selected": true,
"review_reason": "人工审阅:对照悟空 develop 同名命令实现、Cobra Long/Example 与 Runtime 确认门禁移植;不改变命令身份、参数契约或接口绑定。"
"review_reason": "依据 issue #85 的原地状态更新场景、Wukong 30f13f02 的真实 Cobra/MCP 映射和开源实现复核;选择语义不改变执行、安全或参数事实。"
}
]
},
@@ -30822,34 +30823,36 @@
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"resolution": "highest_precedence",
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed",
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call.",
"candidates": [
{
"value": "available",
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"selected": true,
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed"
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call."
}
]
},
"avoid_when": {
"value": [
"新增用 add-text-emotion;移除用 remove-text-emotion"
"消息上还没有文字表情时使用 chat message add-text-emotion",
"只需清除文字表情时使用 chat message remove-text-emotion"
],
"source": "internal/cli/schema_hints/selection/chat.json",
"precedence": "reviewed_explicit",
"resolution": "highest_precedence",
"review_reason": "人工审阅:对照悟空 develop 同名命令实现、Cobra Long/Example 与 Runtime 确认门禁移植;不改变命令身份、参数契约或接口绑定。",
"review_reason": "依据 issue #85 的原地状态更新场景、Wukong 30f13f02 的真实 Cobra/MCP 映射和开源实现复核;选择语义不改变执行、安全或参数事实。",
"candidates": [
{
"value": [
"新增用 add-text-emotion;移除用 remove-text-emotion"
"消息上还没有文字表情时使用 chat message add-text-emotion",
"只需清除文字表情时使用 chat message remove-text-emotion"
],
"source": "internal/cli/schema_hints/selection/chat.json",
"precedence": "reviewed_explicit",
"selected": true,
"review_reason": "人工审阅:对照悟空 develop 同名命令实现、Cobra Long/Example 与 Runtime 确认门禁移植;不改变命令身份、参数契约或接口绑定。"
"review_reason": "依据 issue #85 的原地状态更新场景、Wukong 30f13f02 的真实 Cobra/MCP 映射和开源实现复核;选择语义不改变执行、安全或参数事实。"
}
]
},
@@ -30858,14 +30861,20 @@
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"resolution": "highest_precedence",
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed",
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call.",
"candidates": [
{
"value": "not_required",
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"selected": true,
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed"
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call."
},
{
"value": "not_required",
"source": "risk-default",
"precedence": "inference_or_default",
"selected": false
}
]
},
@@ -30874,34 +30883,40 @@
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"resolution": "highest_precedence",
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed",
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call.",
"candidates": [
{
"value": "write",
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"selected": true,
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed"
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call."
},
{
"value": "write",
"source": "command-verb",
"precedence": "inference_or_default",
"selected": false
}
]
},
"examples": {
"value": [
"dws chat message update-text-emotion --conversation-id \u003ccid\u003e --msg-id \u003cmid\u003e --old-emotion-id \u003cold\u003e --emotion-id \u003cnew\u003e --emotion-name \"赞\" --text \"nice\" --background-id im_bg_5 --format json"
"dws chat message update-text-emotion --conversation-id \u003copenConversationId\u003e --msg-id \u003copenMessageId\u003e --old-emotion-id \u003coldEmotionId\u003e --emotion-id \u003cemotionId\u003e --emotion-name \"处理中\" --text \"处理中 2 分钟\" --background-id im_bg_5"
],
"source": "internal/cli/schema_hints/selection/chat.json",
"precedence": "reviewed_explicit",
"resolution": "highest_precedence",
"review_reason": "人工审阅:对照悟空 develop 同名命令实现、Cobra Long/Example 与 Runtime 确认门禁移植;不改变命令身份、参数契约或接口绑定。",
"review_reason": "依据 issue #85 的原地状态更新场景、Wukong 30f13f02 的真实 Cobra/MCP 映射和开源实现复核;选择语义不改变执行、安全或参数事实。",
"candidates": [
{
"value": [
"dws chat message update-text-emotion --conversation-id \u003ccid\u003e --msg-id \u003cmid\u003e --old-emotion-id \u003cold\u003e --emotion-id \u003cnew\u003e --emotion-name \"赞\" --text \"nice\" --background-id im_bg_5 --format json"
"dws chat message update-text-emotion --conversation-id \u003copenConversationId\u003e --msg-id \u003copenMessageId\u003e --old-emotion-id \u003coldEmotionId\u003e --emotion-id \u003cemotionId\u003e --emotion-name \"处理中\" --text \"处理中 2 分钟\" --background-id im_bg_5"
],
"source": "internal/cli/schema_hints/selection/chat.json",
"precedence": "reviewed_explicit",
"selected": true,
"review_reason": "人工审阅:对照悟空 develop 同名命令实现、Cobra Long/Example 与 Runtime 确认门禁移植;不改变命令身份、参数契约或接口绑定。"
"review_reason": "依据 issue #85 的原地状态更新场景、Wukong 30f13f02 的真实 Cobra/MCP 映射和开源实现复核;选择语义不改变执行、安全或参数事实。"
}
]
},
@@ -30910,14 +30925,20 @@
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"resolution": "highest_precedence",
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed",
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call.",
"candidates": [
{
"value": "idempotent",
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"selected": true,
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed"
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call."
},
{
"value": "unknown",
"source": "effect-default",
"precedence": "inference_or_default",
"selected": false
}
]
},
@@ -30926,30 +30947,30 @@
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"resolution": "highest_precedence",
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed",
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call.",
"candidates": [
{
"value": "composite",
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"selected": true,
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed"
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call."
}
]
},
"interface_reason": {
"value": "Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command.",
"value": "Reviewed unpinned remote adapter: the executable CLI calls im/update_text_emotion, which is proven by dws-wukong develop@30f13f02 but absent from the pinned MCP metadata snapshot; no pinned interface_ref can represent the command yet.",
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"resolution": "highest_precedence",
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed",
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call.",
"candidates": [
{
"value": "Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command.",
"value": "Reviewed unpinned remote adapter: the executable CLI calls im/update_text_emotion, which is proven by dws-wukong develop@30f13f02 but absent from the pinned MCP metadata snapshot; no pinned interface_ref can represent the command yet.",
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"selected": true,
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed"
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call."
}
]
},
@@ -30974,21 +30995,21 @@
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"resolution": "highest_precedence",
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed",
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call.",
"candidates": [
{
"value": true,
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"selected": true,
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed"
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call."
},
{
"value": true,
"source": "internal/cli/schema_hints/selection/chat.json",
"precedence": "reviewed_explicit",
"selected": false,
"review_reason": "人工审阅:对照悟空 develop 同名命令实现、Cobra Long/Example 与 Runtime 确认门禁移植;不改变命令身份、参数契约或接口绑定。"
"review_reason": "依据 issue #85 的原地状态更新场景、Wukong 30f13f02 的真实 Cobra/MCP 映射和开源实现复核;选择语义不改变执行、安全或参数事实。"
}
]
},
@@ -30997,52 +31018,63 @@
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"resolution": "highest_precedence",
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed",
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call.",
"candidates": [
{
"value": "low",
"source": "internal/cli/schema_hints/metadata/chat.json",
"precedence": "reviewed_explicit",
"selected": true,
"review_reason": "dws-tool-metadata/chat marks this tool as reviewed"
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call."
},
{
"value": "medium",
"source": "effect-default",
"precedence": "inference_or_default",
"selected": false
}
]
},
"use_when": {
"value": [
"用户说 改一下消息上的文字表情"
"需要更新消息的状态文字或表情,并避免先移除再添加造成闪烁和两次网络调用时"
],
"source": "internal/cli/schema_hints/selection/chat.json",
"precedence": "reviewed_explicit",
"resolution": "highest_precedence",
"review_reason": "人工审阅:对照悟空 develop 同名命令实现、Cobra Long/Example 与 Runtime 确认门禁移植;不改变命令身份、参数契约或接口绑定。",
"review_reason": "依据 issue #85 的原地状态更新场景、Wukong 30f13f02 的真实 Cobra/MCP 映射和开源实现复核;选择语义不改变执行、安全或参数事实。",
"candidates": [
{
"value": [
"用户说 改一下消息上的文字表情"
"需要更新消息的状态文字或表情,并避免先移除再添加造成闪烁和两次网络调用时"
],
"source": "internal/cli/schema_hints/selection/chat.json",
"precedence": "reviewed_explicit",
"selected": true,
"review_reason": "人工审阅:对照悟空 develop 同名命令实现、Cobra Long/Example 与 Runtime 确认门禁移植;不改变命令身份、参数契约或接口绑定。"
"review_reason": "依据 issue #85 的原地状态更新场景、Wukong 30f13f02 的真实 Cobra/MCP 映射和开源实现复核;选择语义不改变执行、安全或参数事实。"
}
]
}
},
"idempotency": "idempotent",
"interface_mode": "composite",
"interface_reason": "Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command.",
"interface_reason": "Reviewed unpinned remote adapter: the executable CLI calls im/update_text_emotion, which is proven by dws-wukong develop@30f13f02 but absent from the pinned MCP metadata snapshot; no pinned interface_ref can represent the command yet.",
"reviewed": true,
"risk": "low",
"source_refs": [
"CommandRegistry:canonical_path=chat.update_text_emotion",
"cobra-help:dws chat message update-text-emotion",
"dws-wukong:30f13f02",
"dws-wukong:bcf56ccf",
"dws-wukong:d6831318",
"github:hugozhu/dingtalk-opencode-tag#85",
"internal/cli/schema_command_registry/products/chat.json#chat.update_text_emotion",
"internal/cli/schema_hints/metadata/chat.json",
"internal/cli/schema_hints/selection/chat.json",
"wukong-develop:wukong/products"
"live-dws-schema:im.update_text_emotion#FAILED_NOT_AUTHENTICATED",
"skills/mono/references/products/chat.md"
],
"use_when": [
"用户说 改一下消息上的文字表情"
"需要更新消息的状态文字或表情,并避免先移除再添加造成闪烁和两次网络调用时"
]
},
"chat mute": {
@@ -1,6 +1,6 @@
{
"version": 1,
"source_hash": "sha256:ced34d4510fddb0b0cd02478f0f5051b0de0aab3d6bc7e1e43aaa1a12717d3b7",
"source_hash": "sha256:334b39376cb6fb3de8461b89e8cfb4fb6c69f40ad92e38ba5a8e971a64301bb2",
"surface_hash": "sha256:674e6c00efb4d7f4c177ec0a1c4c097c8fb48b0045d1787c0ed001c32c51f20a",
"coverage": {
"surface_products": 26,
File diff suppressed because it is too large Load Diff
+7 -6
View File
@@ -1,12 +1,12 @@
{
"version": 1,
"surface_hash": "sha256:674e6c00efb4d7f4c177ec0a1c4c097c8fb48b0045d1787c0ed001c32c51f20a",
"source_hash": "sha256:f2cf7fcd3a70748029688ef5653386d9b503ef898bf763acb1da04a0b150d483",
"source_hash": "sha256:c8e5313acea3e819656786a5abc9d03e23dcc19da2302d24ad13c183f23c14ea",
"catalog": {
"agent_metadata": {
"products_with_metadata": 26,
"source": "embedded-skill-metadata",
"source_hash": "sha256:ced34d4510fddb0b0cd02478f0f5051b0de0aab3d6bc7e1e43aaa1a12717d3b7",
"source_hash": "sha256:334b39376cb6fb3de8461b89e8cfb4fb6c69f40ad92e38ba5a8e971a64301bb2",
"surface_hash": "sha256:674e6c00efb4d7f4c177ec0a1c4c097c8fb48b0045d1787c0ed001c32c51f20a",
"surface_products": 26,
"surface_tools": 839,
@@ -11249,11 +11249,12 @@
},
{
"agent_metadata_source": "embedded-skill-metadata",
"agent_summary": "更新消息上已有的文字表情回应",
"agent_summary": "把消息上已有的文字表情原地替换为新的文字表情",
"agent_summary_source": "dws-agent-selection/chat",
"availability": "available",
"avoid_when": [
"新增用 add-text-emotion;移除用 remove-text-emotion"
"消息上还没有文字表情时使用 chat message add-text-emotion",
"只需清除文字表情时使用 chat message remove-text-emotion"
],
"canonical_path": "chat.update_text_emotion",
"cli_name": "update-text-emotion",
@@ -11264,14 +11265,14 @@
"group": "message",
"idempotency": "idempotent",
"interface_mode": "composite",
"interface_reason": "Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command.",
"interface_reason": "Reviewed unpinned remote adapter: the executable CLI calls im/update_text_emotion, which is proven by dws-wukong develop@30f13f02 but absent from the pinned MCP metadata snapshot; no pinned interface_ref can represent the command yet.",
"name": "update_text_emotion",
"primary_cli_path": "chat message update-text-emotion",
"reviewed": true,
"risk": "low",
"title": "更新消息的文字表情回应",
"use_when": [
"用户说 改一下消息上的文字表情"
"需要更新消息的状态文字或表情,并避免先移除再添加造成闪烁和两次网络调用时"
]
},
{
File diff suppressed because it is too large Load Diff
@@ -40,6 +40,7 @@ func init() {
registerExclusiveOneOf("chat.create_and_send_card", "group", "receiver")
registerRequireOneOf("chat.add_emoji_reaction", "conversation-id", "group", "id", "chat")
registerRequireOneOf("chat.add_text_emotion", "conversation-id", "group", "id", "chat")
registerRequireOneOf("chat.update_text_emotion", "conversation-id", "group", "id", "chat")
registerExclusiveOneOf("chat.get_conversation_info", "group", "user", "open-dingtalk-id")
registerExclusiveOneOf("chat.list_conversation_message_v2", "group", "user", "open-dingtalk-id")
registerExclusiveOneOf("chat.list_individual_chat_message", "user", "open-dingtalk-id")
+52 -1
View File
@@ -1354,8 +1354,59 @@
"idempotency": "idempotent",
"interface_mode": "composite",
"availability": "available",
"interface_reason": "Reviewed unpinned remote adapter: this executable CLI wrapper calls a remote helper that is absent from the pinned MCP metadata snapshot; no single pinned semantically equivalent interface_ref can represent the command.",
"interface_reason": "Reviewed unpinned remote adapter: the executable CLI calls im/update_text_emotion, which is proven by dws-wukong develop@30f13f02 but absent from the pinned MCP metadata snapshot; no pinned interface_ref can represent the command yet.",
"reviewed": true,
"parameters": {
"background-id": {
"property": "backgroundId",
"description": "新文字表情的背景 ID",
"required": true
},
"chat": {
"property": "openConversationId",
"required": false
},
"conversation-id": {
"property": "openConversationId",
"description": "会话 openConversationId;与 --group、--id、--chat 四选一",
"required": false
},
"emotion-id": {
"property": "emotionId",
"description": "新的文字表情 ID,可通过 create-text-emotion 获取",
"required": true
},
"emotion-name": {
"property": "emotionName",
"description": "新的文字表情名称",
"required": true
},
"group": {
"property": "openConversationId",
"required": false
},
"id": {
"property": "openConversationId",
"required": false
},
"msg-id": {
"property": "openMsgId",
"description": "需要原地更新文字表情的消息 openMsgId",
"required": true
},
"old-emotion-id": {
"property": "oldEmotionId",
"description": "消息上当前文字表情的 emotionId",
"required": true
},
"text": {
"property": "text",
"description": "新的文字表情内容",
"required": true
}
},
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call.",
"cli_path": "chat message update-text-emotion",
"runtime_gate": "none"
},
"chat.get_group_mute_config": {
+12 -7
View File
@@ -2399,22 +2399,27 @@
]
},
"chat.update_text_emotion": {
"agent_summary": "更新消息上已有的文字表情回应",
"agent_summary": "把消息上已有的文字表情原地替换为新的文字表情",
"use_when": [
"用户说 改一下消息上的文字表情"
"需要更新消息的状态文字或表情,并避免先移除再添加造成闪烁和两次网络调用时"
],
"avoid_when": [
"新增用 add-text-emotion;移除用 remove-text-emotion"
"消息上还没有文字表情时使用 chat message add-text-emotion",
"只需清除文字表情时使用 chat message remove-text-emotion"
],
"examples": [
"dws chat message update-text-emotion --conversation-id <cid> --msg-id <mid> --old-emotion-id <old> --emotion-id <new> --emotion-name \"赞\" --text \"nice\" --background-id im_bg_5 --format json"
"dws chat message update-text-emotion --conversation-id <openConversationId> --msg-id <openMessageId> --old-emotion-id <oldEmotionId> --emotion-id <emotionId> --emotion-name \"处理中\" --text \"处理中 2 分钟\" --background-id im_bg_5"
],
"reviewed": true,
"review_reason": "人工审阅:对照悟空 develop 同名命令实现、Cobra Long/Example 与 Runtime 确认门禁移植;不改变命令身份、参数契约或接口绑定。",
"review_reason": "依据 issue #85 的原地状态更新场景、Wukong 30f13f02 的真实 Cobra/MCP 映射和开源实现复核;选择语义不改变执行、安全或参数事实。",
"source_refs": [
"CommandRegistry:canonical_path=chat.update_text_emotion",
"internal/cli/schema_command_registry/products/chat.json#chat.update_text_emotion",
"cobra-help:dws chat message update-text-emotion",
"wukong-develop:wukong/products"
"dws-wukong:d6831318",
"dws-wukong:bcf56ccf",
"dws-wukong:30f13f02",
"github:hugozhu/dingtalk-opencode-tag#85",
"live-dws-schema:im.update_text_emotion#FAILED_NOT_AUTHENTICATED"
]
},
"chat.get_group_mute_config": {
@@ -1900,16 +1900,6 @@
"chat.batch_query_group_chat_settings --groups": "Reviewed unpinned adapter: chat.batch_query_group_chat_settings has no singular pinned interface_ref; --groups is a CLI wrapper input and does not publish a direct interface property.",
"chat.batch_update_group_chat_settings --items": "Reviewed unpinned adapter: chat.batch_update_group_chat_settings has no singular pinned interface_ref; --items is a CLI wrapper input and does not publish a direct interface property.",
"chat.get_group_mute_config --group": "Reviewed unpinned adapter: chat.get_group_mute_config has no singular pinned interface_ref; --group is a CLI wrapper input and does not publish a direct interface property.",
"chat.update_text_emotion --background-id": "Reviewed unpinned adapter: chat.update_text_emotion has no singular pinned interface_ref; --background-id is a CLI wrapper input and does not publish a direct interface property.",
"chat.update_text_emotion --chat": "Reviewed unpinned adapter: chat.update_text_emotion has no singular pinned interface_ref; --chat is a CLI wrapper input and does not publish a direct interface property.",
"chat.update_text_emotion --conversation-id": "Reviewed unpinned adapter: chat.update_text_emotion has no singular pinned interface_ref; --conversation-id is a CLI wrapper input and does not publish a direct interface property.",
"chat.update_text_emotion --emotion-id": "Reviewed unpinned adapter: chat.update_text_emotion has no singular pinned interface_ref; --emotion-id is a CLI wrapper input and does not publish a direct interface property.",
"chat.update_text_emotion --emotion-name": "Reviewed unpinned adapter: chat.update_text_emotion has no singular pinned interface_ref; --emotion-name is a CLI wrapper input and does not publish a direct interface property.",
"chat.update_text_emotion --group": "Reviewed unpinned adapter: chat.update_text_emotion has no singular pinned interface_ref; --group is a CLI wrapper input and does not publish a direct interface property.",
"chat.update_text_emotion --id": "Reviewed unpinned adapter: chat.update_text_emotion has no singular pinned interface_ref; --id is a CLI wrapper input and does not publish a direct interface property.",
"chat.update_text_emotion --msg-id": "Reviewed unpinned adapter: chat.update_text_emotion has no singular pinned interface_ref; --msg-id is a CLI wrapper input and does not publish a direct interface property.",
"chat.update_text_emotion --old-emotion-id": "Reviewed unpinned adapter: chat.update_text_emotion has no singular pinned interface_ref; --old-emotion-id is a CLI wrapper input and does not publish a direct interface property.",
"chat.update_text_emotion --text": "Reviewed unpinned adapter: chat.update_text_emotion has no singular pinned interface_ref; --text is a CLI wrapper input and does not publish a direct interface property.",
"doc.get_document_style --node": "Reviewed unpinned adapter: doc.get_document_style has no singular pinned interface_ref; --node is a CLI wrapper input and does not publish a direct interface property.",
"doc.style_background_clear --node": "Reviewed unpinned adapter: doc.style_background_clear has no singular pinned interface_ref; --node is a CLI wrapper input and does not publish a direct interface property.",
"doc.style_background_set --color": "Reviewed unpinned adapter: doc.style_background_set has no singular pinned interface_ref; --color is a CLI wrapper input and does not publish a direct interface property.",
+4
View File
@@ -3218,6 +3218,10 @@ func newChatCommand() *cobra.Command {
chatMessageUpdateTextEmotionCmd.Flags().String("emotion-name", "", "新表情名称 (必填)")
chatMessageUpdateTextEmotionCmd.Flags().String("text", "", "新文字内容 (必填)")
chatMessageUpdateTextEmotionCmd.Flags().String("background-id", "", "新背景 ID (必填)")
chatMessageUpdateTextEmotionCmd.MarkFlagsOneRequired("conversation-id", "group", "id", "chat")
for _, name := range []string{"msg-id", "old-emotion-id", "emotion-id", "emotion-name", "text", "background-id"} {
_ = chatMessageUpdateTextEmotionCmd.MarkFlagRequired(name)
}
// ── 创建文字表情(获取 emotionId)──────────────────────
@@ -0,0 +1,86 @@
// Copyright 2026 Alibaba Group
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package helpers
import (
"strings"
"testing"
)
func TestChatMessageUpdateTextEmotionMapsReplacementTemplate(t *testing.T) {
for _, locator := range []string{"conversation-id", "group", "id", "chat"} {
t.Run(locator, func(t *testing.T) {
caller := &wukongWeeklySyncCaller{}
_, _, err := executeWukongWeeklySyncCommand(t, "chat", caller, newChatCommand,
"message", "update-text-emotion",
"--"+locator, "cid",
"--msg-id", "mid",
"--old-emotion-id", "old-emotion",
"--emotion-id", "new-emotion",
"--emotion-name", "赞",
"--text", "nice",
"--background-id", "im_bg_5",
)
if err != nil {
t.Fatalf("update-text-emotion returned error: %v", err)
}
requireWukongWeeklySyncCall(t, caller, wukongWeeklySyncCall{
server: "im",
tool: "update_text_emotion",
args: map[string]any{
"openConversationId": "cid",
"openMsgId": "mid",
"oldEmotionId": "old-emotion",
"emotionId": "new-emotion",
"emotionName": "赞",
"text": "nice",
"backgroundId": "im_bg_5",
},
})
})
}
}
func TestChatMessageUpdateTextEmotionRequiresEveryBusinessParameter(t *testing.T) {
required := []struct {
name string
args []string
}{
{name: "conversation-id", args: []string{"--group", "cid"}},
{name: "msg-id", args: []string{"--msg-id", "mid"}},
{name: "old-emotion-id", args: []string{"--old-emotion-id", "old-emotion"}},
{name: "emotion-id", args: []string{"--emotion-id", "new-emotion"}},
{name: "emotion-name", args: []string{"--emotion-name", "赞"}},
{name: "text", args: []string{"--text", "nice"}},
{name: "background-id", args: []string{"--background-id", "im_bg_5"}},
}
for omitted := range required {
t.Run("missing-"+required[omitted].name, func(t *testing.T) {
args := []string{"message", "update-text-emotion"}
for i, parameter := range required {
if i != omitted {
args = append(args, parameter.args...)
}
}
caller := &wukongWeeklySyncCaller{}
_, _, err := executeWukongWeeklySyncCommand(t, "chat", caller, newChatCommand, args...)
if err == nil || !strings.Contains(err.Error(), required[omitted].name) {
t.Fatalf("missing %s error = %v", required[omitted].name, err)
}
requireWukongWeeklySyncNoCalls(t, caller)
})
}
}
+18 -1
View File
@@ -1060,6 +1060,22 @@ Flags:
--background-id string 背景 ID (必填)
```
#### 原地更新消息的文字表情回应
```
Usage:
dws chat message update-text-emotion [flags]
Example:
dws chat message update-text-emotion --conversation-id <openConversationId> --msg-id <openMsgId> --old-emotion-id <oldEmotionId> --emotion-id <emotionId> --emotion-name "处理中" --text "处理中 2 分钟" --background-id im_bg_5
Flags:
--conversation-id string 会话 openConversationId (必填,支持单聊/群聊,别名: --group / --id / --chat)
--msg-id string 消息 openMsgId (必填)
--old-emotion-id string 待替换的原表情 ID (必填)
--emotion-id string 新表情 ID (必填,通过 create-text-emotion 获取)
--emotion-name string 新表情名称 (必填)
--text string 新文字内容 (必填)
--background-id string 新背景 ID (必填)
```
#### 移除消息的文字表情回应
```
Usage:
@@ -1911,6 +1927,7 @@ Flags:
用户说"emoji回应/表情回应/给消息加表情" → `chat message add-emoji`
用户说"取消emoji回应/移除表情回应" → `chat message remove-emoji`
用户说"文字表情回应/添加文字表情" → `chat message add-text-emotion`
用户说"修改文字表情回应/更新消息状态文字" → `chat message update-text-emotion`
用户说"取消文字表情回应/移除文字表情" → `chat message remove-text-emotion`
用户说"创建文字表情/新建文字表情" → `chat message create-text-emotion`
用户说"免打扰/消息免打扰/静音/开启免打扰/关闭免打扰" → `chat mute`
@@ -1973,7 +1990,7 @@ Flags:
- `chat message list-by-ids` — 根据消息 ID 批量查询消息(最多 50 条)
- `chat message add-emoji` / `remove-emoji` — 对消息添加/移除 emoji 表情回应
- `chat message list-emotion-replies` — 批量拉取消息的表情回复和文字回复
- `chat message add-text-emotion` / `remove-text-emotion` — 对消息添加/移除文字表情回应
- `chat message add-text-emotion` / `update-text-emotion` / `remove-text-emotion` — 对消息添加、原地更新或移除文字表情回应
- `chat message create-text-emotion` — 创建文字表情模板,返回 emotionId 供 add-text-emotion 使用
- `chat category list` — 获取用户自定义会话分组列表
- `chat category list-conversations` — 拉取指定分组下的会话列表