Dingtalk Event logo

Dingtalk Event

OrganizationPopular
DingTalk-Real-AI
dingtalk-event

钉钉个人 IM、OA 审批、VoIP 通话邀请、待办与互动卡片回调事件长连接监听。Use when 用户说监听消息/@我/某人/某群/全部消息、已读/撤回/reaction、群成员加入/群成员退出/群状态变化,监听审批任务创建/完成/转交、审批实例发起/抄送/终止/完成、VoIP 通话邀请、待办创建/更新/删除,或互动卡片回调。命令前缀:dws event。

Overview

PublisherDingTalk-Real-AI
Repositorydingtalk-workspace-cli
Skill namedingtalk-event
Stars
3.1K
Forks
242
Bundled files
9
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 9 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by DingTalk-Real-AI on GitHub. Read the source before you install it.

Installation

Install the Dingtalk Event AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/DingTalk-Real-AI/dingtalk-workspace-cli.git /tmp/dingtalk-workspace-cli
mkdir -p .claude/skills
cp -r /tmp/dingtalk-workspace-cli/skills/multi/dingtalk-event .claude/skills/dingtalk-event
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Dingtalk Event in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Dingtalk Event on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Dingtalk Event is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

钉钉个人 IM、OA 审批、VoIP、待办与互动卡片事件

**前置:执行 dws 前必须完整读取 dingtalk-shared。**Shared references 仅按需加载。

本 Skill 只负责实时个人事件;发送/历史消息、审批处理、待办操作分别走 dingtalk-chatdingtalk-miscdingtalk-todo。IM 优先 +listen-im;OA、VoIP、Todo、互动卡片使用 event consume,不用列表轮询模拟事件。

只有群生命周期、Filter DSL、原始 envelope 或底层订阅控制才使用 event consume fallback。

Golden Route

用户意图唯一推荐入口
监听 @我的消息dws event +listen-im --kind at-me
监听某人发来的消息dws event +listen-im --kind sender --user-query <姓名>
监听指定群消息dws event +listen-im --kind group --chat-query <群名>
同一人/群的消息、表情、已读或撤回`dws event +listen-im --kind <sender
监听全部单聊或全部群消息`dws event +listen-im --kind <all-direct
群改名、成员进退、群解散读取 EventKey 索引,使用精确 event consume EventKey
OA 审批任务或实例事件读取 OA 事件参考,使用精确 event consume EventKey
查看 OA 事件目录dws event list --category oa
VoIP 通话邀请读取 VoIP 事件参考,使用精确 event consume EventKey
待办创建、更新或删除事件读取 Todo 事件参考,使用精确 event consume EventKey 与 --role-types
查看 Todo 事件目录dws event list --category todo
互动卡片回调读取 互动卡片事件参考,使用 dws event consume user_card_action_triggered --flatten -f ndjson
查看互动卡片事件目录dws event list --category card
已知 EventKey 或需要底层订阅控制dws event consume;参数与约束以 leaf Schema 为准
查看状态 / 停止dws event status / dws event stop <subscribe_id> --dry-run,确认后再 --yes

默认 --events message。可选事件为 messagereactionreadrecall

  • at-meall-directall-group 只支持 message,且不接受目标。
  • sender 必须且只能传 --user--open-dingtalk-id--user-query 之一。
  • group 必须且只能传 --chat-id--chat-query 之一。
  • --query 只用于纯 message 监听;混入 reaction/read/recall 时不得使用。

OA 七个 EventKey 使用 ruleType=allfilterRule={},不接受目标或消息过滤;Todo 三个 EventKey 仅接受 --role-types creator,executor,participant,省略时取并集。每项独立订阅并共享 bus。

姓名/群名必须唯一解析,零命中或多候选在创建订阅前停止。解析、监听、状态、停止使用同一 --profile,不得跨组织搬运 ID;--dry-run 走同一解析链。

EventKey 索引

16 个 EventKey 及目标约束见 索引,含 user_im_message_receive_o2o_alluser_im_message_receive_group_alluser_im_group_updateduser_im_group_member_addeduser_im_group_member_exiteduser_im_group_disbanded;群输出可含 operator_open_dingtalk_idmembers[].open_dingtalk_id。其它类别见下方 Reference。

运行与结果契约

  • 正常消费使用当前用户 OAuth、--flatten 和 NDJSON;stdout 仅事件,stderr 为生命周期状态。
  • 单事件 ready:[event] ready event_key=<key> bus_pid=<pid> subscribe_id=<id>
  • 多事件先逐条输出 subscription,全部就绪后输出 [event] ready event_count=<n> bus_pid=<pid>。必须等待 ready,不用 sleep 猜测。
  • 有界任务用 --max-events N/--duration 10m;干净退出会取消本次新建订阅。无界任务由宿主管理并持续读 stdout;用 SIGTERM 或受控 stdin/bounded exit,不用 kill -9
  • 自发消息会被 self-loop 过滤。回复时把真实 conversation_id/sender_open_dingtalk_id 交给 dws chat +messages-send,不从显示名猜 ID。
  • 扁平消息/动作字段按事件类型读取:已读为 reader_open_dingtalk_id,撤回为 recaller_open_dingtalk_id,回应为 reaction_nameoperation_type。媒体优先通过聊天读取命令加 --download-resources;已知消息 ID 的底层降级入口是 dws chat message download-media
  • OA 扁平事件提供审批实例、任务和状态字段;字段差异、原始回退条件及与 OA 命令的稳定 ID 交接以 OA 事件参考 为准。
  • Todo 扁平事件提供 task_id、标题、角色、状态阶段和时间字段;用真实 task_id 交给 dws todo,字段差异见 Todo 事件参考
  • 互动卡片输出 type/event_id/timestamp/subscribe_id/payload。在 payload.body.actionData.contextquestions[].id 关联 answers[question_id],按选项 ID 读 selected;空数组合法。操作者是 operatorDTO.uid;分别保留 timestampevent_timetriggerTimestamp。其它字段与回退见 互动卡片参考

安全与失败处理

开源 normal 获取缺失 AppKey,无需 AppSecret;custom/定制版除外。排障

  • event stop 会取消订阅并影响本地 consumer:先 --dry-run,用户确认后再加 --yes
  • 多事件属于一次原始操作;任一订阅启动失败时 Runtime 回滚本次已创建项,不拆成新命令绕过重试预算。
  • 全部 28 个公开个人 EventKey(16 IM + 7 OA + 1 VoIP + 3 Todo + 1 卡片)遵循 Agent/host 0/2/1retryable=falsemax_additional_attempts=0retryable=truemax_additional_attempts=2retryable=unknownmax_additional_attempts=1。它不是 CLI 持久化硬总次数上限;进程内不会自动重试,CLI 不持久化或计算跨调用的 Agent/host 尝试次数。
  • 遵守 retry_after_seconds/next_retry_atin_flightcooldownterminal_hold 时不并发或换 subscribe_id/trace_id 绕过。
  • 认证、profile、订阅保护状态和 bus 排障按失败类型读取 订阅运维,不要在正常路径预加载完整运维手册。

本地订阅保护

状态在 ~/.dws/events/open/personal_stream/<identity_hash>/personal_subscription_attempts.jsonDWS_CONFIG_DIR 改根);目录 0700personal_subscription_attempts.jsonpersonal_subscription_attempts.lock0600。连续 24h 无失败后重置,terminal_hold1h。紧急恢复只删除 personal_subscription_attempts.json,不要删除 lock 文件;这会清空该 identity 的全部保护记录。

何时查询 Schema

  • 已知 Golden Route 时直接执行,不先跑 event list
  • 只有解析业务字段时才用 dws event schema <event_key> --flatten
  • 只有参数或安全不确定时才用 dws schema --cli-path "event +listen-im" --compact 或对应 compact leaf。
  • event schema 描述事件 payload;顶层 dws schema 描述 CLI 命令,两者不要混用。

Reference

TopicReference何时读取
任务索引event-im.md还不能判断应该加载哪一个子 reference
EventKey、目标规则与底层 consumeevent-im-keys.md群生命周期、显式 EventKey 或多事件组合
ready、bounded consume 与退出清理event-im-lifecycle.md启动/托管/关闭 consumer
扁平字段与事件到 Chat 交接event-im-output.md解析事件或自动回复
Filter、status/stop、重试与排障event-im-operations.md订阅控制或失败恢复
OA 审批事件event-oa.md选择七个 OA EventKey、组合消费或解析审批字段
VoIP 通话邀请事件event-voip.md选择 VoIP EventKey、解析邀请字段或检查敏感输出边界
Todo 待办事件event-todo.md选择三个 Todo EventKey、设置角色范围或解析待办字段
互动卡片回调事件event-card.md订阅互动卡片回调、解析开放 payload 或检查空过滤规则

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Dingtalk Event AI skill do?

钉钉个人 IM、OA 审批、VoIP 通话邀请、待办与互动卡片回调事件长连接监听。Use when 用户说监听消息/@我/某人/某群/全部消息、已读/撤回/reaction、群成员加入/群成员退出/群状态变化,监听审批任务创建/完成/转交、审批实例发起/抄送/终止/完成、VoIP 通话邀请、待办创建/更新/删除,或互动卡片回调。命令前缀:dws event。

Why use Dingtalk Event on TypingMind?

Because you install it once and use it with any model. Dingtalk Event is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Dingtalk Event in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/DingTalk-Real-AI/dingtalk-workspace-cli/tree/main/skills/multi/dingtalk-event. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Dingtalk Event?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Dingtalk Event?

As many as you like. As long as a model supports skills, you can use Dingtalk Event with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Dingtalk Event AI skill free?

Yes. It is published on GitHub by DingTalk-Real-AI under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇