dingtalk-pingo 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dingtalk-pingo",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Send text and Markdown messages from your terminal, scripts, or AI coding agents to your phone through a DingTalk robot.",
5
5
  "keywords": [
6
6
  "dingtalk",
@@ -45,8 +45,8 @@ pingo send --message "x" --json # machine-readable result
45
45
  ## Three usage patterns
46
46
 
47
47
  1. **Send now.** The user asks for an immediate message (e.g. a
48
- screenshot description or a quick status). Send it right away and
49
- report the result.
48
+ screenshot or a quick status). Send it right away and report the
49
+ result.
50
50
  2. **Send once when the current task finishes.** The user asks to be
51
51
  notified "when done". This is a one-time promise scoped to the
52
52
  current session, not a persistent background job: if you exit or your
@@ -65,16 +65,48 @@ pingo send --message "x" --json # machine-readable result
65
65
  - Never put secrets, access tokens, card numbers, or long raw logs in a
66
66
  message body.
67
67
 
68
- ## Screenshots and images
68
+ ## Screenshots, images and videos
69
69
 
70
- The `pingo` CLI does not currently support sending images — sending an
71
- image is not supported yet. If the user asks to send a screenshot:
70
+ `pingo` can attach local images and one mp4 video to a message:
72
71
 
73
- 1. You may capture the screenshot with whatever tooling you already have
74
- and inspect or describe its contents.
75
- 2. Send a text/Markdown description instead of the image.
76
- 3. Clearly tell the user that the image itself was **not sent** — image
77
- support is not implemented yet. Do not imply the picture went through.
72
+ ```bash
73
+ pingo send --title "Checkout page" --message "Current layout after the fix" --image ./shot.png
74
+ pingo send --message "Repro recording" --video ./repro.mp4 [--cover ./frame.jpg]
75
+ ```
76
+
77
+ - `--image` accepts png / jpg / gif / bmp, up to 5 images, each up to 10 MiB.
78
+ The file content must match its extension.
79
+ - `--video` accepts one `.mp4` up to 19 MiB. It is sent as a separate video
80
+ message right after the main message. Without `--cover`, Pingo grabs a frame
81
+ with `ffmpeg` if it is installed, otherwise it generates a plain cover.
82
+ - `--image` and `--video` do not replace the text: always pass `--message` or
83
+ `--markdown` with a short explanation.
84
+
85
+ To send a screenshot: capture it with whatever tooling you already have, save
86
+ it to a file, then pass the file with `--image`.
87
+
88
+ **Before sending any screenshot or recording, check it for sensitive
89
+ content** — secrets, access tokens, passwords, customer data, private
90
+ messages, or anything else visible on screen that should not leave the
91
+ machine. A screenshot can capture far more than intended. If you are not
92
+ sure it is safe, ask the user first instead of sending it.
93
+
94
+ ## Links and cards
95
+
96
+ - Add buttons with `--link "Text=https://..."` (up to 3, http(s) only), for
97
+ example a PR, a CI log or a deployment URL.
98
+ - If the user's config has a card template (`card.templateId`), messages are
99
+ sent as cards automatically: the sender (machine, agent, project) is shown at
100
+ the top. You do not need to choose a format; if the card is rejected, Pingo
101
+ falls back to Markdown on its own and says so in its output.
102
+ - Card-only extras: `--date "<text>"` sets the card's time line, and
103
+ `--chart <file.json>` adds a chart (`type` is `lineChart`, `histogram` or
104
+ `pieChart`; `data` is a non-empty array). Both only work with cards, not
105
+ Markdown/text.
106
+ - For tabular data, put a Markdown table in `--message` or `--markdown`
107
+ (`| a | b |` rows with a `| :- | -: |` separator row).
108
+ - `pingo send --json` returns a `cardId` for card messages. One-off sends do not
109
+ need it; `pingo-follow` uses it to update a card in place.
78
110
 
79
111
  ## Handling failures
80
112
 
@@ -84,6 +116,9 @@ image is not supported yet. If the user asks to send a screenshot:
84
116
  - Exit code `6` means the result is unknown — the message **may have
85
117
  already been sent**. Do not retry; tell the user to check their phone
86
118
  instead.
119
+ - A send with images or a video can be partly delivered: the output (and
120
+ `--json` `sent` / `failed`) lists what went out and what did not. Do not
121
+ resend the parts that were already sent; tell the user what is missing.
87
122
  - If sending keeps failing, suggest the user run `pingo doctor` to check
88
123
  configuration, permissions, and whether a token can be obtained.
89
124
 
@@ -81,6 +81,25 @@ Before sending, ask:
81
81
  - Do not let a general "avoid repeat notifications" habit suppress a
82
82
  genuinely new request for human approval — those always go through.
83
83
 
84
+ ## One card per followed task
85
+
86
+ When the user's Pingo config sends cards, keep a followed task to a single
87
+ card where it makes sense:
88
+
89
+ 1. The first time something is worth notifying, send it with
90
+ `pingo send --json ...` and keep the returned `cardId` in this
91
+ conversation (never write it to a file).
92
+ 2. For later progress milestones of the same task, update that card in place
93
+ instead of sending another message:
94
+ `pingo update <cardId> --type info --title "Tests passing" --message "..."`.
95
+ `--message` / `--markdown` replace the whole body, so pass the full text.
96
+ 3. **Always send a new message** (not an update) when the user's approval or
97
+ decision is needed (`--action-required`) and for the final completion
98
+ report — these must reach the user's phone as a fresh notification.
99
+ 4. If `pingo send --json` returned no `cardId` (the message fell back to
100
+ Markdown or text), keep sending new messages as usual.
101
+ 5. If `pingo update` fails, report it; do not silently send a duplicate.
102
+
84
103
  ## Turning it off and session boundaries
85
104
 
86
105
  - Turning follow off stops proactive notifications for the current