{
  "agent_summary": "按身份和目标统一发送消息，Bot 多群返回逐目标 ledger",
  "availability": "available",
  "avoid_when": [
    "Bot 原生音视频、Webhook 富媒体及任意 Lark Card JSON 未接入；Thread 直接回复使用 +messages-reply --reply-in-thread，A2UI 创建可用 --a2ui-messages，更新仍用 chat message update-a2ui-card"
  ],
  "canonical_path": "chat.shortcut_messages_send",
  "cli_path": "chat +messages-send",
  "confirmation": "user_required",
  "constraints": {
    "mutually_exclusive": [
      [
        "text",
        "markdown",
        "media-id",
        "file",
        "file-path",
        "image-url",
        "contact-id",
        "share-chat-id",
        "a2ui-messages"
      ],
      [
        "identity",
        "as"
      ],
      [
        "group",
        "chat-id"
      ],
      [
        "user",
        "open-dingtalk-id"
      ],
      [
        "uuid",
        "idempotency-key"
      ]
    ],
    "require_one_of": [
      [
        "text",
        "markdown",
        "media-id",
        "file",
        "file-path",
        "image-url",
        "contact-id",
        "share-chat-id",
        "a2ui-messages"
      ]
    ]
  },
  "description": "按身份发送消息；user 的 Markdown 可内联本地图片，先上传并以单条富文本发送。bot/webhook 不支持本地 Markdown 图片。\n\n参数约束：\n  - --text、--markdown、--media-id、--file、--file-path、--image-url、--contact-id、--share-chat-id、--a2ui-messages 至少指定一个\n  - --text、--markdown、--media-id、--file、--file-path、--image-url、--contact-id、--share-chat-id、--a2ui-messages 互斥，最多指定一个\n  - --identity、--as 互斥，最多指定一个\n  - --group、--chat-id 互斥，最多指定一个\n  - --user、--open-dingtalk-id 互斥，最多指定一个\n  - --uuid、--idempotency-key 互斥，最多指定一个\n  - 目标、凭据和幂等参数受发送身份能力矩阵约束：user 必须指定一个群聊或单聊目标；bot 必须指定 robot-code 和一类目标，多群最多 100 个并逐项返回 ledger；webhook 必须指定 webhook-token；幂等键仅 user 支持",
  "effect": "write",
  "examples": [
    "dws chat +messages-send --as user --chat-id <openConversationId> --markdown \"## 周报\" --idempotency-key <key>",
    "dws chat +messages-send --as user --chat-id <openConversationId> --markdown \"结果：![截图](./console.png)\""
  ],
  "idempotency": "unknown",
  "interface_mode": "composite",
  "interface_reason": "Reviewed composite send adapter: it selects current-user, bot, or webhook transport; current-user additionally supports live-compatible contact search with exact userId matching, mediaId images, and the native init/upload/commit local-file flow.",
  "parameters": {
    "a2ui-messages": {
      "description": "user 的 A2UI JSON 字符串数组；与正文/媒体互斥，不接受 Lark Card JSON",
      "required": false,
      "type": "string"
    },
    "ai-tag": {
      "default": "true",
      "description": "消息是否带 AI 发送角标（默认 true）",
      "required": false,
      "type": "boolean"
    },
    "as": {
      "description": "--identity 的 lark-cli 对齐别名；受发送身份能力矩阵约束（可选值: user, bot, webhook）",
      "enum": [
        "user",
        "bot",
        "webhook"
      ],
      "required": false,
      "type": "string"
    },
    "at-all": {
      "description": "@所有人",
      "required": false,
      "type": "boolean"
    },
    "at-mobiles": {
      "description": "@ 的手机号（webhook）",
      "required": false,
      "type": "array"
    },
    "at-open-dingtalk-ids": {
      "description": "@ 的 openDingTalkId（user/bot 群聊）",
      "required": false,
      "type": "array"
    },
    "at-user-ids": {
      "description": "@ 的 userId（bot/webhook）",
      "required": false,
      "type": "array"
    },
    "biz-card-id": {
      "description": "A2UI 业务标识，省略生成；不承诺消息幂等",
      "required": false,
      "type": "string"
    },
    "body-stdin": {
      "description": "从 stdin 读取最多 256 KiB 正文；选中的正文参数必须为 -，不改变默认字面量行为",
      "required": false,
      "type": "boolean"
    },
    "card-summary": {
      "description": "A2UI 降级摘要；省略使用 A2UI 消息文本",
      "required": false,
      "type": "string"
    },
    "chat-id": {
      "description": "--group 的 lark-cli 对齐别名；受发送身份能力矩阵约束",
      "required": false,
      "type": "string"
    },
    "chat-query": {
      "description": "按群名解析唯一群聊（仅 user 的高级发送场景）；受发送身份能力矩阵约束",
      "required": false,
      "type": "string"
    },
    "contact-id": {
      "description": "user 发送名片的 openDingTalkId",
      "required": false,
      "type": "string"
    },
    "employee-context": {
      "description": "已绑定宿主的 JSON 元数据（agentUuid/channel/bindingRevision）；发送前校验绑定，私聊仅限固定主管；必须配合 body-stdin、wait-delivery 和幂等键，仍须用户确认",
      "required": false,
      "type": "string"
    },
    "expires-seconds": {
      "description": "群邀请有效期秒数，0 为永久；仅 share-chat 使用",
      "required": false,
      "type": "integer"
    },
    "file": {
      "description": "工作目录内安全相对文件路径（user 的 file/audio/video；bot 仅单目标 file）",
      "required": false,
      "type": "string"
    },
    "file-path": {
      "description": "--file 的兼容别名",
      "required": false,
      "type": "string"
    },
    "group": {
      "description": "群 openConversationId（user/bot 群聊）；受发送身份能力矩阵约束",
      "required": false,
      "type": "string"
    },
    "groups": {
      "description": "多个群 openConversationId（仅 bot；受发送身份能力矩阵约束，逐群返回 typed ledger，最多 100 个）",
      "required": false,
      "type": "array"
    },
    "groups-file": {
      "description": "工作目录内相对文本文件（仅 bot；受发送身份能力矩阵约束），每行或逗号分隔一个群 openConversationId",
      "required": false,
      "type": "string"
    },
    "idempotency-key": {
      "description": "--uuid 的 lark-cli 对齐别名（仅 user）；受发送身份能力矩阵约束",
      "required": false,
      "type": "string"
    },
    "identity": {
      "default": "user",
      "description": "发送身份；目标、凭据和幂等参数受发送身份能力矩阵约束（可选值: user, bot, webhook）",
      "enum": [
        "user",
        "bot",
        "webhook"
      ],
      "required": false,
      "type": "string"
    },
    "image-url": {
      "description": "Bot 图片的 HTTP(S) URL（不接受已有 mediaId）",
      "required": false,
      "type": "string"
    },
    "markdown": {
      "description": "Markdown 正文；user 可用 ![说明](./image.png) 内联本地图片（不支持引用式图片，dry-run 仅脱敏预览）；bot/webhook 不支持本地图片",
      "required": false,
      "type": "string"
    },
    "media-id": {
      "description": "已有图片 mediaId（仅 user 的 image）",
      "required": false,
      "type": "string"
    },
    "msg-type": {
      "description": "内容类型；省略时根据正文、--media-id 或 --file 自动推断（可选值: text, markdown, image, file, audio, video, profile, share-chat, a2ui）",
      "enum": [
        "text",
        "markdown",
        "image",
        "file",
        "audio",
        "video",
        "profile",
        "share-chat",
        "a2ui"
      ],
      "required": false,
      "type": "string"
    },
    "open-dingtalk-id": {
      "description": "单聊接收者 openDingTalkId（user）；受发送身份能力矩阵约束",
      "required": false,
      "type": "string"
    },
    "open-dingtalk-ids": {
      "description": "批量单聊接收者 openDingTalkId（bot）；受发送身份能力矩阵约束",
      "required": false,
      "type": "array"
    },
    "request-id": {
      "description": "A2UI 链路追踪标识，省略生成；不是幂等键",
      "required": false,
      "type": "string"
    },
    "robot-code": {
      "description": "机器人 Code（identity=bot 时使用）；受发送身份能力矩阵约束",
      "required": false,
      "type": "string"
    },
    "share-chat-id": {
      "description": "user 分享的源群 openConversationId；发送群邀请链接，不是 Lark share_chat 对象",
      "required": false,
      "type": "string"
    },
    "text": {
      "description": "纯文本正文",
      "required": false,
      "type": "string"
    },
    "title": {
      "description": "消息标题（不传则从正文生成）",
      "required": false,
      "type": "string"
    },
    "user": {
      "description": "单聊接收者 userId（user；包括 --dry-run 也会先通过通讯录搜索精确匹配 openDingTalkId）；受发送身份能力矩阵约束",
      "required": false,
      "type": "string"
    },
    "user-query": {
      "description": "按姓名解析唯一 openDingTalkId（仅 user 的高级发送场景）；受发送身份能力矩阵约束",
      "required": false,
      "type": "string"
    },
    "users": {
      "description": "批量单聊接收者 userId（bot）；受发送身份能力矩阵约束",
      "required": false,
      "type": "array"
    },
    "uuid": {
      "description": "幂等键（仅 user）；受发送身份能力矩阵约束",
      "required": false,
      "type": "string"
    },
    "wait-delivery": {
      "description": "仅个人文本/Markdown 发送或普通引用回复：查询发送回执并输出标准回执字段；未知状态不得重发",
      "required": false,
      "type": "boolean"
    },
    "webhook-token": {
      "description": "自定义机器人 Webhook token（identity=webhook 时使用）；受发送身份能力矩阵约束",
      "required": false,
      "type": "string"
    }
  },
  "risk": "medium",
  "use_when": [
    "以 user、bot 或 webhook 身份发送消息；user 的 Markdown 正文需要内联本地图片时先上传并发送单条富文本"
  ]
}
