@samva/cli 0.14.0 → 0.16.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.
Files changed (3) hide show
  1. package/AGENTS.md +16 -3
  2. package/dist/bin.mjs +31160 -29817
  3. package/package.json +9 -9
package/AGENTS.md CHANGED
@@ -38,6 +38,11 @@ export that will be delivered, which cannot carry a relative reference.
38
38
  machine watch output uses `--jsonl`. `--json` remains one-shot.
39
39
  `samva mailboxes events` is a stream: human mode prints one raw record per line, `--jsonl` one result
40
40
  envelope per event, `--quiet` nothing, and `--json` is refused (exit 2) with a pointer to `--jsonl`.
41
+ A dropped connection reconnects from the last handled cursor, so an event can repeat but none is
42
+ lost; each reconnect is one stderr line in human mode and one `type: "warning"` envelope
43
+ (`reason: "mailbox_events_reconnecting"`, `details.cursor`, `details.attempt`) in `--jsonl`, never a
44
+ stdout record. `--no-reconnect` ends the command on the first drop, exit `1` with the last cursor.
45
+ A close that retrying cannot fix (`4401`, `4403`, an expired cursor) still ends the command.
41
46
 
42
47
  The developer loop for a template project is `samva templates dev` (the local visual editor, no
43
48
  `vite.config.ts`), `check` (type-check, compile, and render every fixture), `render <template>
@@ -141,6 +146,13 @@ stops sending and receiving, and `resume <id>` resumes without backfilling mail
141
146
  paused. These mutations support `--dry-run`. `remove <id>` deletes a mailbox (`--yes` outside a terminal, `--dry-run` to
142
147
  preview), `threads` searches, `read` prints a message (human output marks the body as
143
148
  untrusted email), and `send` and `reply` take `--idempotency-key` so a retry cannot send twice.
149
+ `create`, `endpoints add`, and `send` take `--channel email|whatsapp|sms` (default `email`); on a
150
+ phone channel the address is a connected number in E.164 form, and `send` takes one `--to` number
151
+ with `--text` or, on WhatsApp, an approved `--template <templateId>` with `--data`. `reply` answers a
152
+ WhatsApp or SMS message on its thread; a bare `--text` reply reads the message first to learn its
153
+ channel. Free-form WhatsApp text outside the customer's 24-hour window fails with
154
+ `WhatsAppServiceWindowClosedError`; send a template. These commands call the API directly because the
155
+ public SDK describes email only.
144
156
  Quarantine `list` pages the same way, bounded by `--after` and `--before` on when a message was
145
157
  held; `release` and `discard` take the held message's `id` and require a person signed in with
146
158
  `samva login`. Discard requires confirmation (`--yes` outside a terminal) and supports `--dry-run`.
@@ -151,9 +163,10 @@ held; `release` and `discard` take the held message's `id` and require a person
151
163
  Human mailbox and extension results retain the same facts as JSON: mailbox endpoints (channel, address,
152
164
  sender name, default), thread state and activity, message bodies, attachments, authentication and actor,
153
165
  receipt waits and skipped recipients, held-mail results, and installation/run details.
154
- `samva mailboxes events` reads the SDK event stream with reconnects off and prints
155
- one record per event, `{cursor, id, event}` (`--jsonl` wraps each in a result envelope, `--quiet`
156
- prints none, `--json` is refused). A drop or refusal ends the command with the server's `_tag` as
166
+ `samva mailboxes events` reads the SDK event stream, which reconnects (`--no-reconnect` turns that
167
+ off), and prints one record per event, `{cursor, id, event}` (`--jsonl` wraps each in a result
168
+ envelope, `--quiet` prints none, `--json` is refused). A refusal, or a drop under
169
+ `--no-reconnect`, ends the command with the server's `_tag` as
157
170
  the error `reason`, its `status` and `details`, and a `Try:` line; the last handled cursor, which
158
171
  `--cursor` resumes from, goes to stderr in human mode and into `details.lastCursor` otherwise.
159
172
  `samva extensions dev` follows the same output modes. 401 and 403 exit 4. An expired