From 10d93f310ebabff53da3c25e2b14d2d3efbde672 Mon Sep 17 00:00:00 2001 From: Dennis Date: Tue, 4 Aug 2026 15:18:04 +0800 Subject: [PATCH] fix(schema): restore chat compatibility gates --- internal/cli/schema_catalog/catalog.json | 2 +- internal/cli/schema_catalog/tools/chat.json | 54 +++------------------ internal/shortcut/smart/chat_messages.go | 2 +- internal/shortcut/smart/thread_replies.go | 2 +- skills/multi/dingtalk-chat/SKILL.md | 12 ++--- 5 files changed, 15 insertions(+), 57 deletions(-) diff --git a/internal/cli/schema_catalog/catalog.json b/internal/cli/schema_catalog/catalog.json index 6522390c..8a48a67d 100644 --- a/internal/cli/schema_catalog/catalog.json +++ b/internal/cli/schema_catalog/catalog.json @@ -1,7 +1,7 @@ { "version": 1, "surface_hash": "sha256:ae4288a29f237ab41d080695d94794133143ad1efc0899f71f05047443ab09c0", - "source_hash": "sha256:1e467b051dec8cd208e3787820a528c2b6ff5ae3f2fa286c8f56fced3e2f2477", + "source_hash": "sha256:939b7fecb8c1e96d48a642ddbb2b76e3260acdda93b471bd2c2f33125009845f", "catalog": { "agent_metadata": { "products_with_metadata": 26, diff --git a/internal/cli/schema_catalog/tools/chat.json b/internal/cli/schema_catalog/tools/chat.json index 028c35b1..15edaad2 100644 --- a/internal/cli/schema_catalog/tools/chat.json +++ b/internal/cli/schema_catalog/tools/chat.json @@ -67449,7 +67449,7 @@ "type": "integer" }, "time": { - "description": "时间边界;--time 必须是 RFC3339、YYYY-MM-DD HH:mm:ss 或 YYYY-MM-DD;省略时从当前时间向前读取最近消息", + "description": "时间边界,如 \"2025-03-01 00:00:00\";省略时从当前时间向前读取最近消息", "field_provenance": { "description": { "candidates": [ @@ -67457,7 +67457,7 @@ "precedence": "cobra_contract", "selected": true, "source": "cobra_usage", - "value": "时间边界;--time 必须是 RFC3339、YYYY-MM-DD HH:mm:ss 或 YYYY-MM-DD;省略时从当前时间向前读取最近消息" + "value": "时间边界,如 \"2025-03-01 00:00:00\";省略时从当前时间向前读取最近消息" }, { "precedence": "default", @@ -67469,27 +67469,7 @@ "precedence": "cobra_contract", "resolution": "highest_precedence", "source": "cobra_usage", - "value": "时间边界;--time 必须是 RFC3339、YYYY-MM-DD HH:mm:ss 或 YYYY-MM-DD;省略时从当前时间向前读取最近消息" - }, - "format": { - "candidates": [ - { - "precedence": "inference", - "selected": true, - "source": "usage_format_inference", - "value": "date-time" - }, - { - "precedence": "default", - "selected": false, - "source": "default", - "value": "" - } - ], - "precedence": "inference", - "resolution": "highest_precedence", - "source": "usage_format_inference", - "value": "date-time" + "value": "时间边界,如 \"2025-03-01 00:00:00\";省略时从当前时间向前读取最近消息" }, "property": { "candidates": [ @@ -67548,7 +67528,6 @@ "value": "string" } }, - "format": "date-time", "property": "time", "required": false, "type": "string" @@ -116465,7 +116444,7 @@ "type": "string" }, "time": { - "description": "起始时间;--time 必须是 RFC3339、YYYY-MM-DD HH:mm:ss 或 YYYY-MM-DD", + "description": "起始时间,如 \"2025-03-01 00:00:00\"(可选)", "field_provenance": { "description": { "candidates": [ @@ -116473,7 +116452,7 @@ "precedence": "cobra_contract", "selected": true, "source": "cobra_usage", - "value": "起始时间;--time 必须是 RFC3339、YYYY-MM-DD HH:mm:ss 或 YYYY-MM-DD" + "value": "起始时间,如 \"2025-03-01 00:00:00\"(可选)" }, { "precedence": "default", @@ -116485,27 +116464,7 @@ "precedence": "cobra_contract", "resolution": "highest_precedence", "source": "cobra_usage", - "value": "起始时间;--time 必须是 RFC3339、YYYY-MM-DD HH:mm:ss 或 YYYY-MM-DD" - }, - "format": { - "candidates": [ - { - "precedence": "inference", - "selected": true, - "source": "usage_format_inference", - "value": "date-time" - }, - { - "precedence": "default", - "selected": false, - "source": "default", - "value": "" - } - ], - "precedence": "inference", - "resolution": "highest_precedence", - "source": "usage_format_inference", - "value": "date-time" + "value": "起始时间,如 \"2025-03-01 00:00:00\"(可选)" }, "property": { "candidates": [ @@ -116564,7 +116523,6 @@ "value": "string" } }, - "format": "date-time", "property": "time", "required": false, "type": "string" diff --git a/internal/shortcut/smart/chat_messages.go b/internal/shortcut/smart/chat_messages.go index ac22993c..2b6bde3c 100644 --- a/internal/shortcut/smart/chat_messages.go +++ b/internal/shortcut/smart/chat_messages.go @@ -63,7 +63,7 @@ var ChatMessages = shortcut.Shortcut{ {Name: "user", Type: shortcut.FlagString, Desc: "单聊对方的 userId,与 --group 互斥"}, {Name: "user-query", Type: shortcut.FlagString, Desc: "按姓名解析唯一 openDingTalkId"}, {Name: "open-dingtalk-id", Type: shortcut.FlagString, Desc: "单聊对方的 openDingTalkId,与 --group/--user 互斥"}, - {Name: "time", Type: shortcut.FlagString, Desc: "时间边界;--time 必须是 RFC3339、YYYY-MM-DD HH:mm:ss 或 YYYY-MM-DD;省略时从当前时间向前读取最近消息"}, + {Name: "time", Type: shortcut.FlagString, Desc: "时间边界,如 \"2025-03-01 00:00:00\";省略时从当前时间向前读取最近消息"}, {Name: "limit", Type: shortcut.FlagInt, Desc: "每页拉取的消息条数;显式页大小必须大于 0"}, {Name: "size", Type: shortcut.FlagInt, Desc: "--limit 的旧版别名", Hidden: true}, {Name: "page-size", Type: shortcut.FlagInt, Desc: "--limit 的兼容别名", Hidden: true}, diff --git a/internal/shortcut/smart/thread_replies.go b/internal/shortcut/smart/thread_replies.go index 09618086..304dceaf 100644 --- a/internal/shortcut/smart/thread_replies.go +++ b/internal/shortcut/smart/thread_replies.go @@ -50,7 +50,7 @@ var ThreadReplies = shortcut.Shortcut{ {Name: "group", Type: shortcut.FlagString, Desc: "群会话 ID(openConversationId,必填)", Required: true}, {Name: "thread-id", Type: shortcut.FlagString, Desc: "话题/线程 ID(可直接使用消息列表返回的 threadId)"}, {Name: "topic-id", Type: shortcut.FlagString, Desc: "--thread-id 的兼容别名"}, - {Name: "time", Type: shortcut.FlagString, Desc: "起始时间;--time 必须是 RFC3339、YYYY-MM-DD HH:mm:ss 或 YYYY-MM-DD"}, + {Name: "time", Type: shortcut.FlagString, Desc: "起始时间,如 \"2025-03-01 00:00:00\"(可选)"}, {Name: "limit", Type: shortcut.FlagInt, Desc: "每页拉取的回复条数;--limit 必须大于 0"}, {Name: "no-reactions", Type: shortcut.FlagBool, Desc: "不输出回复 reaction(默认输出)"}, }, chatshortcut.MessageResourceDownloadFlags()...), diff --git a/skills/multi/dingtalk-chat/SKILL.md b/skills/multi/dingtalk-chat/SKILL.md index 134d7b47..d8822fd0 100644 --- a/skills/multi/dingtalk-chat/SKILL.md +++ b/skills/multi/dingtalk-chat/SKILL.md @@ -41,9 +41,9 @@ metadata: |---|---|---| | 按姓名发简单文本或 Markdown | `dws chat +dm --to <姓名> --text <内容>` | CLI 解析唯一用户;多候选时停止,不先手工查 ID | | 按群名或 ID 发简单文本或 Markdown | `dws chat +send-to-group --group <群名或ID> --text <内容>` | 稳定 ID 直接使用;群名多候选时停止 | -| 文件、Bot、Webhook、复杂 @、已知 ID 或自然目标的高级发送 | `dws chat +messages-send` | user 可用自然目标;Bot 多群用 `--groups/--groups-file` 并检查逐项 ledger | -| 读取一个指定群聊或单聊 | `dws chat +chat-messages` | 群聊 `--group` 可传群名或 ID;全量加 `--page-all`,检查完整性 ledger | -| 跨会话、多维过滤或自动翻页搜索 | `dws chat +search-msg` | 内容用 `--query`,自然目标用 `--chat-query` / `--sender-query`;检查 `complete` | +| 文件、Bot、Webhook、复杂 @ 或高级发送 | `dws chat +messages-send` | Bot 多群用 `--groups/--groups-file` 并检查逐项 ledger | +| 读取指定群聊或单聊 | `dws chat +chat-messages` | 全量加 `--page-all`,检查完整性 ledger | +| 跨会话多维搜索 | `dws chat +search-msg` | 内容用 `--query`;检查 `complete` | | 查看指定群成员(用户/机器人) | `dws chat +chat-members-list --group <群名或ID>` | 唯一解析并全量读取 | | 获取群邀请链接 | `dws chat +chat-invite-url --group <群名或ID>` | 多候选时停止 | | 查看群机器人 | `dws chat +chat-bots --group <群名或ID>` | 返回稳定 `bots[]` | @@ -77,10 +77,10 @@ metadata: ## 关键结果语义 -- 发送成功返回的 `openTaskId` 是发送任务 ID,可查询投递状态,但不是回复或撤回使用的消息 ID;需要消息 ID 时从真实消息查询结果取得。 -- `+chat-messages`、`+search-msg`、`+messages-mget` 默认保留 `messageId`、conversation/thread、sender、文本、时间、reaction、引用、转发和 `resourceRefs`;`--no-reactions` 可关闭 reaction。 +- `openTaskId` 是发送任务 ID,不是回复或撤回所需的消息 ID;消息 ID 必须来自真实查询结果。 +- 消息查询默认保留稳定 ID、会话/thread、发送者、文本、时间、reaction、引用、转发和 `resourceRefs`;`--no-reactions` 可关闭 reaction。 - 查询结果必须检查 `complete`、`hasMore`、`failures` 和资源下载 ledger;partial result 不得表述为完整成功。 -- 引用、转发或合并消息中的子消息使用子消息自己的 `messageId`;只有子消息缺会话 ID 时才继承父消息的 `conversationId`。 +- 子消息使用自己的 `messageId`;仅缺会话 ID 时继承父消息的 `conversationId`。 - 下载只允许工作目录内安全相对路径,默认不覆盖并原子落盘;覆盖必须由用户显式传 `--overwrite`。读取和下载不需要 `--yes`。 - Favorite、消息 Pin、消息 Top、会话 Top 是不同对象层级,不能互换。