$npx -y skills add agentscope-ai/QwenPaw --skill dingtalk_channel-enUse a headed browser to automatically complete DingTalk channel integration for QwenPaw. Applicable when the user mentions DingTalk, developer console, Client ID, Client Secret, bot, Stream mode, binding or configuring a channel. Supports pausing when a login page is detected and
| 1 | # DingTalk Channel Auto-Connect (Headed Browser) |
| 2 | |
| 3 | This skill automates the creation of a DingTalk application and the binding of a QwenPaw channel using a headed browser. |
| 4 | |
| 5 | ## Mandatory Rules |
| 6 | |
| 7 | 1. Must launch in headed browser mode: |
| 8 | |
| 9 | ```json |
| 10 | {"action": "start", "headed": true} |
| 11 | ``` |
| 12 | |
| 13 | 2. Must pause when a login gate is encountered: |
| 14 | - If the page displays a login screen (e.g., login prompt, QR code login, phone/password login), stop automated operations immediately. |
| 15 | - Clearly prompt the user to log in manually first, then wait for the user to reply with "logged in / continue". |
| 16 | - Do not proceed with subsequent steps until the user confirms. |
| 17 | |
| 18 | 3. Any application configuration change only takes effect after creating a new version and publishing: |
| 19 | - After configuring bot-related information, **you must publish the bot**. |
| 20 | - Whether creating a new application or modifying application information (name, description, icon, bot configuration, etc.), you **must perform "create new version + publish"** at the end. |
| 21 | - Do not claim the configuration is active if publishing has not been completed. |
| 22 | |
| 23 | ## Pre-Execution Confirmation (Must Do First) |
| 24 | |
| 25 | Before starting automated clicks, initiate a "configuration confirmation" with the user, clearly informing them of customizable fields, image specifications, and default values. Use the following structured confirmation: |
| 26 | |
| 27 | 1. Allow the user to customize the following fields: |
| 28 | - Application name |
| 29 | - Application description |
| 30 | - Bot icon image URL or local path |
| 31 | - Bot message preview image URL or local path |
| 32 | |
| 33 | 2. Clearly state the image specifications (prominently): |
| 34 | - Bot icon: JPG/PNG only, `240*240px` or larger, `1:1` ratio, under `2MB`, no rounded corners. |
| 35 | - Bot message preview image: format `png/jpeg/jpg`, no more than `2MB`. |
| 36 | |
| 37 | 3. Clearly state the default values (used automatically if the user does not specify): |
| 38 | - Application name: `QwenPaw` |
| 39 | - Application description: `Your personal assistant` |
| 40 | - Bot icon: `https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png` |
| 41 | - Bot message preview image: `https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png` |
| 42 | |
| 43 | 4. If the user provides no custom values, you must first explicitly reply: |
| 44 | - "All default settings will be used (QwenPaw / Your personal assistant / default images). Proceeding now." |
| 45 | |
| 46 | ## Image Upload Strategy (Both link and path are supported) |
| 47 | |
| 48 | 1. If the user provides a local path, use it directly for upload. |
| 49 | 2. If the user provides an image link, download it to a local temporary file first, then upload. |
| 50 | 3. The upload action sequence must be: |
| 51 | - First click the page upload entry (to trigger the chooser) |
| 52 | - Then call `file_upload` with the local path array (`paths_json`) |
| 53 | 4. If the upload fails due to image specification mismatch (dimensions, ratio, size, format): |
| 54 | - Immediately pause automation |
| 55 | - Clearly ask the user to manually upload a compliant image |
| 56 | - After the user confirms "uploaded / continue", resume from the current step |
| 57 | |
| 58 | ### Practical Upload Tips |
| 59 | |
| 60 | 1. The `paths_json` of `file_upload` must be a "JSON string array" -- note the escaping: |
| 61 | |
| 62 | ```json |
| 63 | { |
| 64 | "action": "file_upload", |
| 65 | "paths_json": "[\"xxx.png\"]", |
| 66 | "frame_selector": "iframe[src*=\"/fe/app?isHideOuterFrame=true\"]" |
| 67 | } |
| 68 | ``` |
| 69 | |
| 70 | 2. If the page is within an iframe, prefer including `frame_selector`; otherwise the upload control may not be found or the chooser may not trigger. |
| 71 | |
| 72 | 3. You must click the upload entry before calling `file_upload`; calling it directly will result in: |
| 73 | - `No chooser. Click upload then file_upload.` |
| 74 | |
| 75 | 4. Common structural features of the bot icon area that can be used for locating elements (examples; these may appear as Chinese UI labels in the DingTalk console): |
| 76 | - `text: "* 机器人图标"` (Bot Icon) |
| 77 | - `button: "使用应用图标"` (Use App Icon) |
| 78 | - `button: "avatar"` (usually contains `img "avatar"` inside) |
| 79 | |
| 80 | 5. When the snapshot shows both "使用应用图标" ("Use App Icon") and "avatar", prefer clicking the `avatar` button to trigger the upload, then call `file_upload`. |
| 81 | |
| 82 | ## Automation Flow |
| 83 | |
| 84 | ### Step 1: Open the DingTalk Developer Console |
| 85 | |
| 86 | 1. Launch the browser in headed mode (`headed: true`) |
| 87 | 2. Navigate to `https://open-dev.dingtalk.com/` |
| 88 | 3. Call `snapshot` to check if login is required |
| 89 | |
| 90 | If login is required, pause with the following message: |
| 91 | |
| 92 | > Login to the DingTalk Developer Console is required. I have paused automated operations. Please complete the login in the opened browser. Reply "continue" when done, |