dingtalk_channel_connect
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese钉钉 Channel 自动连接(可视浏览器)
DingTalk Channel Auto Connection (Visual Browser)
此 skill 用于通过可视浏览器自动化完成钉钉应用创建与 CoPaw channel 绑定。
This skill is used to automate the creation of DingTalk applications and binding with CoPaw channels via a visual browser.
强制规则
Mandatory Rules
- 必须使用可视浏览器模式启动:
json
{"action": "start", "headed": true}-
遇到登录关卡必须暂停:
- 若页面出现登录界面(如 、扫码登录、手机号/密码登录),立即停止自动操作。
登录 - 明确提示用户先手动登录,再等待用户回复“登录好了/继续”。
- 未收到用户确认前,不得继续执行后续步骤。
- 若页面出现登录界面(如
-
任何应用配置变更都必须新建版本并发布后才生效:
- 配置完机器人相关信息后一定要发布机器人
- 不论是新建应用还是修改应用信息(名称、描述、图标、机器人配置等),最终都必须执行“创建新版本 + 发布”。
- 若未完成发布,不得宣称配置已生效。
- Must start in visual browser mode:
json
{"action": "start", "headed": true}-
Must pause when encountering login barriers:
- If a login interface appears on the page (such as "Login", QR code login, phone number/password login), stop automatic operations immediately.
- Clearly prompt the user to log in manually first, then wait for the user to reply "Logged in/Continue".
- Do not proceed with subsequent steps until receiving user confirmation.
-
Any application configuration changes must take effect only after creating a new version and publishing it:
- Be sure to publish the bot after configuring the bot-related information
- Whether creating a new application or modifying application information (name, description, icon, bot configuration, etc.), you must finally execute "Create new version + Publish".
- Do not claim that the configuration has taken effect if publishing is not completed.
执行前显著确认(必须先做)
Pre-execution Confirmation (Mandatory)
在开始自动化点击前,先向用户发起一次“配置确认”,明确告知可自定义项、图片规范、默认值。建议使用如下结构化确认:
-
让用户可自定义以下字段:
- 应用名称
- 应用描述
- 机器人图标图片链接或本地路径
- 机器人消息预览图链接或本地路径
-
明确告知图片规范(显著提示):
- 机器人图标:仅支持 JPG/PNG,以上,
240*240px,1:1以内,无圆角。2MB - 机器人消息预览图:格式 ,不超过
png/jpeg/jpg。2MB
- 机器人图标:仅支持 JPG/PNG,
-
明确告知默认值(用户不指定时自动采用):
- 应用名称:
CoPaw - 应用描述:
Your personal assistant - 机器人图标:
https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png - 机器人消息预览图:
https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png
- 应用名称:
-
若用户未给任何自定义值,必须先明确回复:
- “将全部采用默认设置(CoPaw / Your personal assistant / 默认图片)后继续执行。”
Before starting automated clicks, initiate a "configuration confirmation" to the user, clearly informing them of customizable items, image specifications, and default values. It is recommended to use the following structured confirmation:
-
Allow users to customize the following fields:
- Application name
- Application description
- Bot icon image link or local path
- Bot message preview image link or local path
-
Clearly inform of image specifications (prominent prompt):
- Bot icon: Only JPG/PNG supported, above ,
240*240pxaspect ratio, within1:1, no rounded corners.2MB - Bot message preview image: Format , no larger than
png/jpeg/jpg.2MB
- Bot icon: Only JPG/PNG supported, above
-
Clearly inform of default values (automatically adopted if user does not specify):
- Application name:
CoPaw - Application description:
Your personal assistant - Bot icon:
https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png - Bot message preview image:
https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png
- Application name:
-
If the user does not provide any custom values, must clearly reply:
- "Will continue with all default settings (CoPaw / Your personal assistant / default images)."
图片上传策略(link/path 都支持)
Image Upload Strategy (Both link/path Supported)
- 若用户提供本地路径,直接用于上传。
- 若用户提供图片 link,先下载到本地临时文件,再执行上传。
- 上传动作顺序必须是:
- 先点击页面上传入口(触发 chooser)
- 再调用 传入本地路径数组(
file_upload)paths_json
- 若上传报错且判断为图片规格不符合(尺寸、比例、大小、格式):
- 立即暂停自动化
- 明确让用户手动上传符合规范的图片
- 用户确认“已上传/继续”后,从当前步骤继续后续流程
- If the user provides a local path, use it directly for upload.
- If the user provides an image link, first download it to a local temporary file, then perform the upload.
- The upload action sequence must be:
- First click the page upload entry (trigger chooser)
- Then call with the local path array (
file_upload)paths_json
- If upload fails and it is judged to be due to non-compliant image specifications (size, aspect ratio, file size, format):
- Immediately pause automation
- Clearly ask the user to manually upload a compliant image
- After the user confirms "Uploaded/Continue", resume the process from the current step
上传动作实战经验
Practical Experience with Upload Actions
- 的
file_upload必须是“JSON 字符串数组”,注意转义:paths_json
json
{
"action": "file_upload",
"paths_json": "[\"xxx.png\"]",
"frame_selector": "iframe[src*=\"/fe/app?isHideOuterFrame=true\"]"
}-
若页面在 iframe 内,建议优先带上,否则可能出现找不到上传控件或 chooser 未触发。
frame_selector -
上传前必须先点击上传入口;若直接会报:
file_uploadNo chooser. Click upload then file_upload.
-
机器人图标区域的常见结构特征可用于定位(示例):
text: "* 机器人图标"button: "使用应用图标"- (通常内部有
button: "avatar")img "avatar"
-
当 snapshot 中同时出现“使用应用图标”和“avatar”时,优先点击按钮触发上传,再执行
avatar。file_upload
- The of
paths_jsonmust be a "JSON string array", note the escaping:file_upload
json
{
"action": "file_upload",
"paths_json": "[\"xxx.png\"]",
"frame_selector": "iframe[src*=\"/fe/app?isHideOuterFrame=true\"]"
}-
If the page is within an iframe, it is recommended to includefirst, otherwise the upload control may not be found or the chooser may not be triggered.
frame_selector -
Must click the upload entry before uploading; if directly using, the following error will be reported:
file_uploadNo chooser. Click upload then file_upload.
-
Common structural features of the bot icon area can be used for positioning (example):
text: "* Bot Icon"button: "Use Application Icon"- (usually contains
button: "avatar"internally)img "avatar"
-
When both "Use Application Icon" and "avatar" appear in the snapshot, prioritize clicking thebutton to trigger upload, then execute
avatar.file_upload
自动化流程
Automation Workflow
步骤 1:打开钉钉开发者后台
Step 1: Open DingTalk Developer Backend
- 可视模式启动浏览器()
headed: true - 打开
https://open-dev.dingtalk.com/ - 调用 判断是否需要登录
snapshot
若需要登录,使用如下话术暂停:
检测到需要登录钉钉开发者后台。我已暂停自动操作,请先在弹出的浏览器中完成登录。完成后回复“继续”,我再从当前页面接着执行。
- Start the browser in visual mode ()
headed: true - Open
https://open-dev.dingtalk.com/ - Call to determine if login is required
snapshot
If login is required, pause with the following message:
Detected that login to DingTalk Developer Backend is required. I have paused automatic operations. Please complete login in the popped-up browser first. Reply "Continue" after completion, and I will proceed from the current page.
步骤 2:创建企业内部应用
Step 2: Create Internal Enterprise Application
用户确认登录后继续:
- 进入创建路径:
- 应用开发 -> 企业内部应用 -> 钉钉应用 -> 创建应用
- 填写应用信息(优先使用用户自定义,否则使用默认值):
- 应用名称:默认
CoPaw - 应用描述:默认
Your personal assistant
- 应用名称:默认
- 保存并创建应用
若页面文案或结构与预期不一致,重新 ,按可见文本语义重新定位元素。
snapshotContinue after user confirms login:
- Enter the creation path:
- Application Development -> Internal Enterprise Applications -> DingTalk Applications -> Create Application
- Fill in application information (prioritize user-defined values, otherwise use defaults):
- Application name: Default
CoPaw - Application description: Default
Your personal assistant
- Application name: Default
- Save and create the application
If the page copy or structure is inconsistent with expectations, re-call and re-locate elements based on visible text semantics.
snapshot步骤 3:添加机器人能力并发布
Step 3: Add Bot Capabilities and Publish
- 点击应用能力中的添加应用能力,找到机器人并添加
- 将机器人配置右侧的switch按钮切换为打开
- 填写机器人名称,机器人简介和机器人描述
- 上传机器人图标(用户自定义或默认图):
- 点击机器人图标下面的图片
- 默认图链接:
https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png - 若为 link,先下载到本地再上传
- 若提示图片不合规,暂停并让用户手动上传合规图片后继续
- 上传机器人消息预览图(用户自定义或默认图):
- 点击机器人消息预览图下面的图片
- 默认图链接:
https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png - 若为 link,先下载到本地再上传
- 若提示图片不合规,暂停并让用户手动上传合规图片后继续
- 确认消息接收模式设置为
Stream 模式 - 选择发布,此时会有进一步弹出的确认页面,选择发布。注意:一定要发布机器人之后再进行下一步
- Click Add Application Capabilities in Application Capabilities, find Bot and add it
- Toggle the switch button on the right of Bot Configuration to on
- Fill in Bot Name, Bot Introduction and Bot Description
- Upload Bot Icon (user-defined or default image):
- Click the image below the bot icon
- Default image link:
https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png - If it is a link, download to local first then upload
- If prompted with non-compliant image, pause and ask user to manually upload a compliant image before continuing
- Upload Bot Message Preview Image (user-defined or default image):
- Click the image below the bot message preview image
- Default image link:
https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png - If it is a link, download to local first then upload
- If prompted with non-compliant image, pause and ask user to manually upload a compliant image before continuing
- Confirm that the message receiving mode is set to
Stream mode - Select Publish, a further confirmation page will pop up, select Publish. Note: Be sure to publish the bot before proceeding to the next step
步骤 4:创建版本并发布
Step 4: Create and Publish Version
- 打开
应用发布 -> 版本管理与发布 - 创建新版本(每次配置变更后都要创建)
- 填写版本描述,应用可见范围选择全部员工
- 按页面提示完成发布,此时会有新的弹窗出现,选择确认发布
- 只有看到发布成功状态,才可继续执行后续步骤/给用户“已生效”结论
- Open
Application Release -> Version Management and Release - Create a new version (must be created after each configuration change)
- Fill in the version description, select all employees for application visibility scope
- Complete the release as prompted by the page, a new pop-up will appear, select Confirm Publish
- Only proceed to subsequent steps/give the user the "effective" conclusion after seeing the release success status
步骤 5:获取凭证
Step 5: Obtain Credentials
- 打开
基础信息 -> 凭证与基础信息 - 告知用户(AppKey)和
Client ID(AppSecret)在该页面上。不主动进行修改,引导用户自行绑定Client Secret
- Open
Basic Information -> Credentials and Basic Information - Inform the user that (AppKey) and
Client ID(AppSecret) are on this page. Do not modify them actively, guide the user to bind them on their ownClient Secret
CoPaw 绑定方式
CoPaw Binding Methods
拿到凭证后,引导用户选择以下任一方式:
-
控制台前端配置:
- CoPaw console 中进入
控制 -> 频道 -> DingTalk - 填入 与
Client IDClient Secret
- CoPaw console 中进入
-
配置文件方式:
json
"dingtalk": {
"enabled": true,
"bot_prefix": "[BOT]",
"client_id": "你的 Client ID",
"client_secret": "你的 Client Secret"
}路径:,位于 下。
~/.copaw/config.jsonchannels.dingtalkAfter obtaining the credentials, guide the user to choose one of the following methods:
-
Console front-end configuration:
- Enter in CoPaw console
Control -> Channels -> DingTalk - Fill in and
Client IDClient Secret
- Enter
-
Configuration file method:
json
"dingtalk": {
"enabled": true,
"bot_prefix": "[BOT]",
"client_id": "Your Client ID",
"client_secret": "Your Client Secret"
}Path: , under .
~/.copaw/config.jsonchannels.dingtalk凭证交付要求(强制)
Credential Delivery Requirements (Mandatory)
- agent 只负责引导用户进入凭证页、获取并展示 与真实
Client ID。Client Secret - agent 不主动改 配置、不主动改
console。~/.copaw/config.json - 必须提示用户按以下两种方式之一手动填写:
- 控制台前端:
控制 -> 频道 -> DingTalk - 配置文件:编辑 的
~/.copaw/config.json字段channels.dingtalk
- 控制台前端:
- The agent is only responsible for guiding the user to the credential page, obtaining and displaying and the real
Client ID.Client Secret - The agent shall not modify the configuration or
consoleactively.~/.copaw/config.json - Must prompt the user to fill in manually in one of the following two ways:
- Console front-end:
Control -> Channels -> DingTalk - Configuration file: Edit the field in
channels.dingtalk~/.copaw/config.json
- Console front-end:
Browser 工具调用模式
Browser Tool Calling Mode
默认按以下顺序执行:
- with
startheaded: true opensnapshot- /
click/type/select_optionas neededpress_key - frequent after page transitions
snapshot - when done
stop
Execute in the following order by default:
- with
startheaded: true opensnapshot- /
click/type/select_optionas neededpress_key - frequent after page transitions
snapshot - when done
stop
稳定性与恢复策略
Stability and Recovery Strategy
- 优先使用最新 的
snapshot;仅在必要时使用ref。selector - 每次关键点击或跳转后,使用短等待()并立即重新
wait_for。snapshot - 若中途会话失效或要求重新登录,必须再次暂停,待用户登录后从当前步骤继续。
- 若因租户权限、管理员审批等阻塞自动化,明确说明卡点,并请用户手动完成该步骤后再续跑。
- Prioritize using the from the latest
ref; usesnapshotonly when necessary.selector - After each critical click or jump, use a short wait () and immediately re-call
wait_for.snapshot - If the session expires or re-login is required midway, must pause again, and resume from the current step after the user logs in.
- If automation is blocked due to tenant permissions, administrator approval, etc., clearly explain the bottleneck, and ask the user to complete the step manually before resuming.