@samva/cli 0.9.0 → 0.10.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 +27 -3
  2. package/dist/bin.mjs +1289 -312
  3. package/package.json +7 -7
package/AGENTS.md CHANGED
@@ -27,6 +27,13 @@ a template written in a format the compiler rejects. Templates live in `template
27
27
  `emails/`; a template is a `.tsx` file that default-exports `defineTemplate`, and the compiler reads
28
28
  it without running it.
29
29
 
30
+ `samva email send --attach <path>` (repeatable) attaches local files; the filename is the basename and
31
+ the content type comes from the extension (`application/octet-stream` when unknown). The CLI reads
32
+ and budget-checks every file before any request (at most 10 files, 25 MiB each and in total) and
33
+ exits `2` naming the path or limit. Past the 4 MiB inline limit, the largest files upload through
34
+ `/v1/media` first and travel by `mediaId`; the send's retries reuse them, and rerunning the command
35
+ uploads again. `--dry-run` lists each attachment and uploads nothing.
36
+
30
37
  `--publication-id` and `--input-contract-id` on `email send`, `scheduled-messages create`, and
31
38
  `campaigns create`/`update` choose which publication a template send renders: one exact publication,
32
39
  or the newest publication that still validates input identically. They are mutually exclusive and
@@ -90,18 +97,35 @@ Standalone callers supply their own resolver. The README owns resolution order a
90
97
  `dev` handles mailbox events locally, `publish` records an immutable version, and `install` grants
91
98
  that version scoped mailbox permissions. Hosted extensions run on Samva; webhook extensions use
92
99
  the installation credentials returned once at install. Publishing and installation management
93
- require a person signed in with `samva login`. Local development with that login attributes tool
100
+ require a person signed in with `samva login`. `upgrade <installation-id>` selects the latest
101
+ published version, or `--version <version-or-id>` selects one. `--dry-run` asks the API for the
102
+ from/to versions and added/removed grants without changing the installation; the installation
103
+ shown in a preview is its current state. Applying requires confirmation (`--yes` outside a
104
+ terminal) and an exact, repeatable `--accept-permissions` acknowledgement for each added grant,
105
+ such as `permission:send` or `event:mailbox.message.sent`. Local development with that login attributes tool
94
106
  calls to you, rather than to an installation. Read what exists with `list`, `versions <name>`,
95
107
  `version <name> <version>`, `installations`, `installation <id>`, `runs <id>` (outcomes only), and
96
108
  `run <id> <run-id>` (adds the handler's log lines); the list commands page with `--limit`,
97
109
  `--cursor`, and `--all --jsonl`.
98
110
 
99
111
  `samva mailboxes` reads and sends as a mailbox: `list` pages with `--limit`, `--cursor`, `--after`,
100
- and `--before`, `threads` searches, `read` prints a message (human output marks the body as
112
+ and `--before`. `get <id>` inspects a mailbox; `update <id> --data <JSON-or-@file>` changes
113
+ `displayName`, `defaultFrom`, or `metadata` (merges by key, `null` deletes a key). `pause <id>`
114
+ stops sending and receiving, and `resume <id>` resumes without backfilling mail received while
115
+ paused. These mutations support `--dry-run`. `remove <id>` deletes a mailbox (`--yes` outside a terminal, `--dry-run` to
116
+ preview), `threads` searches, `read` prints a message (human output marks the body as
101
117
  untrusted email), and `send` and `reply` take `--idempotency-key` so a retry cannot send twice.
102
118
  Quarantine `list` pages the same way, bounded by `--after` and `--before` on when a message was
103
119
  held; `release` and `discard` take the held message's `id` and require a person signed in with
104
- `samva login`. `samva mailboxes events` reads the SDK event stream with reconnects off and prints
120
+ `samva login`. Discard requires confirmation (`--yes` outside a terminal) and supports `--dry-run`.
121
+ `actions list --mailbox <id>` filters by `--state` and pages with `--limit`, `--cursor`, and
122
+ `--all --jsonl`. `actions approve <action-id> --mailbox <id>` and `actions deny <action-id>
123
+ --mailbox <id> [--reason <text>]` require a person different from the proposer, confirmation
124
+ (`--yes` outside a terminal), and offer `--dry-run`.
125
+ Human mailbox and extension results retain the same facts as JSON: mailbox addresses and sending
126
+ identity, thread state and activity, message bodies, attachments, authentication and actor,
127
+ receipt waits and skipped recipients, held-mail results, and installation/run details.
128
+ `samva mailboxes events` reads the SDK event stream with reconnects off and prints
105
129
  one record per event, `{cursor, id, event}` (`--jsonl` wraps each in a result envelope, `--quiet`
106
130
  prints none, `--json` is refused). A drop or refusal ends the command with the server's `_tag` as
107
131
  the error `reason`, its `status` and `details`, and a `Try:` line; the last handled cursor, which