@pingroom/cli 0.7.2 → 0.7.4

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/README.md CHANGED
@@ -6,11 +6,6 @@ from CI, scripts, and agents. Delivered as push straight to your phone.
6
6
  One dependency (`qrcode-terminal`, used only to draw the pairing QR). Works
7
7
  anywhere Node ≥ 20 runs.
8
8
 
9
- > **Release status:** 0.7.2 is prepared for publish — the room grant, the
10
- > `attachments:write` scope `--attach` always needed, and actionable text on the
11
- > refusals you can fix. The GitHub Action pins 0.7.2, so publish before relying
12
- > on it.
13
-
14
9
  ## Install and first run
15
10
 
16
11
  Install globally, then connect:
@@ -106,8 +101,9 @@ Approving on the phone grants two separate things, and both are enforced:
106
101
  `handoffs:create`, `live:write`. Nothing widens them later; a command needing
107
102
  one you did not approve returns `403 insufficient_scope`.
108
103
  - **Rooms** — one room, several, or all of them. A room outside that grant
109
- returns `403 room_not_granted` on any write, including pings, questions and
110
- live streams. Widen it under Connected Agents in the app.
104
+ returns `403 room_not_granted` on every room-scoped call writes such as
105
+ pings, questions and live streams, and reads such as listing a room's quick
106
+ actions or webhooks. Widen it under Connected Agents in the app.
111
107
 
112
108
  Both refusals print the fix, not just the code. A credential paired by an older
113
109
  CLI carries the scope set that version asked for — reconnect to re-approve if a
@@ -157,7 +153,7 @@ URL (it embeds its own secret — treat it like a password and store it as a CI
157
153
  ```
158
154
  pingroom ping [options]
159
155
 
160
- -m, --message <text> Ping body text (required)
156
+ -m, --message <text> Ping body (required; <= 120 private / <= 160 public)
161
157
  -t, --title <text> Ping title (<= 40 chars)
162
158
  -a, --action <1-4> Quick-action slot to attribute the ping to
163
159
  -d, --data <json> Extra JSON data, e.g. '{"commit":"abc123"}'
@@ -173,6 +169,11 @@ pingroom ping [options]
173
169
  --json Print the raw JSON response
174
170
  ```
175
171
 
172
+ Ping titles are limited to 40 characters. Bodies are limited to 120 characters
173
+ in private rooms and 160 in public rooms. A room code or webhook URL does not
174
+ reveal room visibility, so the CLI rejects only bodies over 160 locally; the
175
+ server applies the tighter 120-character private-room limit.
176
+
176
177
  To make the ping actionable, add `--require-ack`. The first eligible recipient to
177
178
  acknowledge it wins; `--ack-timeout` optionally expires it if nobody responds:
178
179
 
@@ -205,8 +206,9 @@ pingroom ping --token "$PINGROOM_TOKEN" --room AB12 -m "Nightly report" \
205
206
  --attach ./report.pdf --attach ./summary.md
206
207
  ```
207
208
 
208
- Accepted types are `md`, `pdf`, `html`, `txt`, `jpg`, `jpeg`, `png`, up to
209
- 5 MiB each and at most 4 per Ping. `--attach` needs an agent token a webhook ping
209
+ Accepted types are `md`, `pdf`, `html`, `txt`, `jpg`, `jpeg`, `png`, `zip`, up to
210
+ 5 MiB each and at most 4 per Ping. A `.zip` must be a real archive starting at
211
+ byte zero — the server rejects one with any payload prefixed to it. `--attach` needs an agent token — a webhook ping
210
212
  has no uploader identity to bind private files to — and the bound account must
211
213
  hold Pro (otherwise the upload fails with `pro_required`). An upload that never
212
214
  reaches a ping expires by itself after 24 hours.
@@ -364,15 +366,55 @@ Full protocol: <https://pingroom.io/liveactivities.md>
364
366
  message: 'Ship ${{ github.sha }} to production?'
365
367
  handoff: 'true'
366
368
  question: 'true'
367
- options: 'deploy:Deploy,hold:Hold'
369
+ options: |
370
+ deploy:Deploy
371
+ hold:Hold
368
372
  idempotency-key: 'deploy-${{ github.run_id }}'
369
373
  wait: 'true'
370
374
  - if: steps.gate.outputs.answer == 'deploy'
371
375
  run: ./deploy-prod.sh
376
+
377
+ # Or ask the whole room instead of one person. Same outputs, plus question-id.
378
+ # Requires v0.7.3 or newer — see the note below before copying this block.
379
+ - id: env
380
+ uses: pingroom/cli@v0.7.3
381
+ with:
382
+ token: ${{ secrets.PINGROOM_TOKEN }}
383
+ room: ab12cd
384
+ ask: 'true'
385
+ message: 'Which environment?'
386
+ context: 'build ${{ github.run_number }}'
387
+ options: |
388
+ prod:Production
389
+ staging:Staging
390
+ wait: 'true'
372
391
  ```
373
392
 
393
+ ### Version requirements
394
+
395
+ `ask`, `context`, `timeout`, `api` and the `question-id` output were added in
396
+ **v0.7.3**. Pin at least `pingroom/cli@v0.7.3` to use them. On an older pin —
397
+ including `@v0` before it is moved to v0.7.3 — GitHub treats them as unexpected
398
+ inputs, warns, and drops them; the step then falls through to the plain `ping`
399
+ path, `outputs.answer` is never set, and any job gated on it silently proceeds.
400
+
401
+ `urgent` was added in **v0.7.4** and has the same failure mode on an older pin:
402
+ GitHub drops the unknown input and the Ping goes out at normal priority, which
403
+ looks like it worked. `require-ack` is not a substitute — as of the same release
404
+ it opens the acknowledgement lifecycle without raising the interruption level,
405
+ so a workflow that used it to break through Focus needs `urgent: true`.
406
+
407
+ Everything else on this page (ping, `require-ack`, and the whole `handoff`
408
+ family) works on `@v0`.
409
+
410
+ `options` is one `value:label` per line. Trailing newlines are ignored first, so
411
+ a value that is a single line after trimming — including a one-line `options: |`
412
+ block — still splits on commas. A label that contains a comma must therefore be
413
+ written one-per-line.
414
+
374
415
  The handoff action exposes outputs `handoff-id`, `state`, `acknowledged-by`,
375
- `answer`, and `delivery-state`.
416
+ `answer`, and `delivery-state`; the ask action exposes `question-id`, `state`,
417
+ and `answer`. `api` overrides the API base URL for every mode.
376
418
 
377
419
  ## GitLab CI
378
420