Add sent mail listing

RO
2mo ago
+742-10

Summary

  • add first-class hey sent with one latest outbound message per thread, newest first
  • match HEY's compact human recipient summary while returning exact to, cc, and bcc arrays in JSON
  • include thread ID, subject, summary, delivery time, and app URL for reconciliation scripts
  • support --limit, --all, --page, --ids-only, --count, Markdown, and the standard JSON formats
  • document the command and cover its output, pagination, limits, help surface, and smoke contract

Closes #469.

Dependencies

  • haystack#8874 adds recipients, delivery time, and Sent pagination headers
  • hey-sdk#222 models those fields and exposes paginated Sent reads

This branch pins the SDK PR commit with a Go pseudo-version so CI and review are reproducible. It must be changed to the published SDK release before this PR merges.

Tests

  • make test
  • make lint
  • make build
  • go test -c for tests/smoke
  • built ./bin/hey against a real HEY account through a redacting validator: three rows checked; thread ID, subject, sent time, app URL, and array shapes valid; no message content or personal data printed or retained

Production does not expose recipient data until the Haystack dependency deploys, so that real-account check correctly found no populated recipient arrays. Unit and smoke contracts cover the new response shape.


Summary by cubic

Adds hey sent, a first-class command that lists the latest outbound message in each thread, newest first. It provides thread and delivery metadata for scripts while matching HEY's compact human-readable recipient summary. Closes #469.

New Features

  • JSON includes exact to, cc, and bcc arrays, thread ID, subject, summary, delivery time, and app URL; when both delivery and creation times are missing, sent_at reports as null.
  • Supports --limit (reading pages until the requested count is reached), --all, --page, --ids-only, --count, Markdown, and the standard JSON formats.
  • --all follows pagination for up to 100 pages; notices suggest --all when more pages remain and a sanitized --page cursor when the run was truncated.
  • Documentation, API coverage, help output, unit tests, and smoke coverage include the new command and its edge cases.

Dependencies

  • Pins github.com/basecamp/hey-sdk/go to a commit pseudo-version; replace it with the published SDK release before merging.
  • Recipient arrays remain empty until HEY's backend exposes Sent recipient data.