@samva/cli 0.12.0 → 0.14.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 +28 -4
  2. package/dist/bin.mjs +51891 -49650
  3. package/package.json +8 -7
package/AGENTS.md CHANGED
@@ -8,6 +8,29 @@ Machine-readable results go to stdout; warnings and typed errors go to stderr. E
8
8
  fields. Follow `next` and fix `details.fields` before retrying. API 401 and 403 exit with code `4`;
9
9
  other operational failures exit with code `1`. Human mode prints the same message and recovery step.
10
10
 
11
+ `samva api <path>` is the floor under every command: it calls any public endpoint with the CLI's
12
+ credentials (`SAMVA_API_KEY`, or the signed-in profile and its organization) and prints the API
13
+ response as returned, not the `{schemaVersion,...}` envelope, so `--json` and `--jsonl` are refused
14
+ (exit `2`). The path is relative to the API URL (`email/domains` and `/v1/email/domains` are the same
15
+ request); a full URL is refused so credentials reach only the selected API URL, and redirects are not
16
+ followed. The method is `GET`, or `POST` once a field or `--input` is given. `-f` adds a string field,
17
+ `-F` a typed one (`true`, `false`, `null`, integers, `@file`, `@-`), `a[b]=v` nests, `a[]=v` appends;
18
+ on a `GET` or with `--input` fields go to the query string. `--paginate` follows `nextCursor` through
19
+ the `cursor` query parameter and prints one page per line, `--slurp` one JSON array. A non-2xx
20
+ response writes its body to stderr and exits `4` for 401 and 403, otherwise `1`. Pipe to `jq`; there
21
+ is no built-in filter.
22
+
23
+ `samva api-keys` manages the organization's keys: `list`, `get`, `create`, `update`, `rotate`, and
24
+ `revoke`. `create` takes `--name` and exactly one of `--full-access` or repeatable `--grant
25
+ <resource>=read|write` (neither or both exits `2`), plus optional `--description` and `--expires-at`;
26
+ mailbox and namespace scope go through `samva api`. The API refuses a key with more access than the
27
+ caller holds. `create` and `rotate` return the secret once: `--json` carries `{apiKey, key,
28
+ displayOnce, warning}`, so `samva api-keys create ... --json | jq -r .data.key` yields the key, and
29
+ human mode prints it to stdout with the warning on stderr. `rotate` and `revoke` require
30
+ confirmation (`--yes` outside a terminal), and every mutation supports `--dry-run`. Under
31
+ `SAMVA_API_KEY`, `samva org current` asks the API who the key is (`GET /v1/whoami`) and reports its
32
+ organization and key; with OAuth it reports the profile's selected organization.
33
+
11
34
  `samva templates export --out <dir>` renders every local template's fixtures to HTML
12
35
  and text with the asset manifest, needing a Samva credential only to resolve a live `samva:brand`; `--asset-base <origin>` is for an
13
36
  export that will be delivered, which cannot carry a relative reference.
@@ -109,10 +132,11 @@ calls to you, rather than to an installation. Read what exists with `list`, `ver
109
132
  `--cursor`, and `--all --jsonl`.
110
133
 
111
134
  `samva mailboxes` reads and sends as a mailbox: `list` pages with `--limit`, `--cursor`, `--after`,
112
- and `--before`. `create --address <address> --name <name>` makes a mailbox with one address; the
135
+ and `--before`. `create --address <address> --name <name>` makes a mailbox with one email endpoint; the
113
136
  slug defaults to the address's local part, and a collision asks for `--slug` rather than suffixing.
114
137
  `get <id>` inspects a mailbox; `update <id> --data <JSON-or-@file>` changes
115
- `name`, `defaultFrom`, or `metadata` (merges by key, `null` deletes a key). `pause <id>`
138
+ `name` or `metadata` (merges by key, `null` deletes a key); a mailbox's endpoints, their
139
+ sender names, and its default are `endpoints add|update|remove`. `pause <id>`
116
140
  stops sending and receiving, and `resume <id>` resumes without backfilling mail received while
117
141
  paused. These mutations support `--dry-run`. `remove <id>` deletes a mailbox (`--yes` outside a terminal, `--dry-run` to
118
142
  preview), `threads` searches, `read` prints a message (human output marks the body as
@@ -124,8 +148,8 @@ held; `release` and `discard` take the held message's `id` and require a person
124
148
  `--all --jsonl`. `actions approve <action-id> --mailbox <id>` and `actions deny <action-id>
125
149
  --mailbox <id> [--reason <text>]` require a person different from the proposer, confirmation
126
150
  (`--yes` outside a terminal), and offer `--dry-run`.
127
- Human mailbox and extension results retain the same facts as JSON: mailbox addresses and sending
128
- identity, thread state and activity, message bodies, attachments, authentication and actor,
151
+ Human mailbox and extension results retain the same facts as JSON: mailbox endpoints (channel, address,
152
+ sender name, default), thread state and activity, message bodies, attachments, authentication and actor,
129
153
  receipt waits and skipped recipients, held-mail results, and installation/run details.
130
154
  `samva mailboxes events` reads the SDK event stream with reconnects off and prints
131
155
  one record per event, `{cursor, id, event}` (`--jsonl` wraps each in a result envelope, `--quiet`