@primitivedotdev/sdk 0.13.0 → 0.15.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.
@@ -30,7 +30,7 @@
30
30
  "list-operations": {
31
31
  "aliases": [],
32
32
  "args": {},
33
- "description": "List all generated API operations",
33
+ "description": "List all generated API operations as JSON. Useful for piping to `jq` to discover available commands, their request/response schemas, and per-field descriptions. For inspecting a single operation in detail, prefer `primitive describe <command>`.",
34
34
  "flags": {},
35
35
  "hasDynamicHelp": false,
36
36
  "hiddenAliases": [],
@@ -39,7 +39,32 @@
39
39
  "pluginName": "@primitivedotdev/sdk",
40
40
  "pluginType": "core",
41
41
  "strict": true,
42
- "summary": "List all generated API operations",
42
+ "summary": "List all generated API operations (JSON)",
43
+ "enableJsonFlag": false
44
+ },
45
+ "describe": {
46
+ "aliases": [],
47
+ "args": {
48
+ "command": {
49
+ "description": "Command id to describe, in `<topic>:<command>` form (e.g. `emails:get-email`). Run `primitive list-operations | jq -r '.[] | \"\\(.tagCommand):\\(.command)\"'` to enumerate.",
50
+ "name": "command",
51
+ "required": true
52
+ }
53
+ },
54
+ "description": "Print the full operation manifest entry for a single API command, including the path, request schema, response schema, and per-field descriptions sourced from the OpenAPI spec.\n\n The manifest entry's `responseSchema` carries the inlined JSON Schema for the operation's 200/201 `data` envelope contents (`$ref`s resolved). Use it to look up what specific response fields mean. Examples:\n\n # Which of EmailDetail's sender-shaped fields is canonical?\n primitive describe emails:get-email | jq '.responseSchema.properties | keys'\n primitive describe emails:get-email | jq -r '.responseSchema.properties.from_email.description'\n\n # What does each value of SentEmailStatus mean?\n primitive describe sending:get-sent-email | jq -r '.responseSchema.properties.status.description'\n\n `requestSchema` is the same shape for the request body when one exists. For a single field across many operations at once, use `primitive list-operations | jq` instead.",
55
+ "examples": [
56
+ "<%= config.bin %> describe emails:get-email",
57
+ "<%= config.bin %> describe sending:send-email"
58
+ ],
59
+ "flags": {},
60
+ "hasDynamicHelp": false,
61
+ "hiddenAliases": [],
62
+ "id": "describe",
63
+ "pluginAlias": "@primitivedotdev/sdk",
64
+ "pluginName": "@primitivedotdev/sdk",
65
+ "pluginType": "core",
66
+ "strict": true,
67
+ "summary": "Describe a single API operation in detail",
43
68
  "enableJsonFlag": false
44
69
  },
45
70
  "send": {
@@ -50,7 +75,8 @@
50
75
  "<%= config.bin %> send --to alice@example.com --body 'Hi Alice!'",
51
76
  "<%= config.bin %> send --to alice@example.com --from support@yourcompany.com --subject 'Quick question' --body 'Are you free Thursday?'",
52
77
  "<%= config.bin %> send --to alice@example.com --html '<p>Hello!</p>'",
53
- "<%= config.bin %> send --to alice@example.com --body 'Confirmed' --wait"
78
+ "<%= config.bin %> send --to alice@example.com --body 'Confirmed' --wait",
79
+ "<%= config.bin %> send --to inbox@your-managed-domain.primitive.email --body 'self-loop smoke test' --wait # any *.primitive.email address routes back to the sending account; useful for proving outbound + inbound work end-to-end"
54
80
  ],
55
81
  "flags": {
56
82
  "api-key": {
@@ -172,6 +198,57 @@
172
198
  "summary": "Print the authenticated account (credentials smoke test)",
173
199
  "enableJsonFlag": false
174
200
  },
201
+ "emails:latest": {
202
+ "aliases": [],
203
+ "args": {},
204
+ "description": "Print the N most recent inbound emails as a one-line-per-row text table. Designed for quick triage and visual scanning. For programmatic access, use `primitive emails:list-emails` (full JSON envelope, cursor pagination, filters) or pass `--json` here for the same raw shape without pagination/filters.\n\n The default text table truncates each row's id to the first 8 characters for readability. Operations that take an id (`emails:get-email`, `emails:delete-email`, etc.) require the full UUID, so pass `--json` or use `emails:list-emails` when you need to feed an id back into another command.\n\n Output streams: the column header line is written to STDERR so the row data on STDOUT stays grep/awk-friendly. `--json` writes everything (including the envelope) to STDOUT.",
205
+ "examples": [
206
+ "<%= config.bin %> emails:latest",
207
+ "<%= config.bin %> emails:latest --limit 25",
208
+ "<%= config.bin %> emails:latest --json | jq '.data[0].id'"
209
+ ],
210
+ "flags": {
211
+ "api-key": {
212
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
213
+ "env": "PRIMITIVE_API_KEY",
214
+ "name": "api-key",
215
+ "hasDynamicHelp": false,
216
+ "multiple": false,
217
+ "type": "option"
218
+ },
219
+ "base-url": {
220
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
221
+ "env": "PRIMITIVE_API_URL",
222
+ "name": "base-url",
223
+ "hasDynamicHelp": false,
224
+ "multiple": false,
225
+ "type": "option"
226
+ },
227
+ "limit": {
228
+ "description": "Number of rows to print (1-100, default 10).",
229
+ "name": "limit",
230
+ "default": 10,
231
+ "hasDynamicHelp": false,
232
+ "multiple": false,
233
+ "type": "option"
234
+ },
235
+ "json": {
236
+ "description": "Print the raw response envelope (with full UUIDs and meta) as JSON on STDOUT instead of the text table. Useful for piping into `jq`, capturing ids for follow-up commands, or scripting.",
237
+ "name": "json",
238
+ "allowNo": false,
239
+ "type": "boolean"
240
+ }
241
+ },
242
+ "hasDynamicHelp": false,
243
+ "hiddenAliases": [],
244
+ "id": "emails:latest",
245
+ "pluginAlias": "@primitivedotdev/sdk",
246
+ "pluginName": "@primitivedotdev/sdk",
247
+ "pluginType": "core",
248
+ "strict": true,
249
+ "summary": "Show the most recent inbound emails as a compact table",
250
+ "enableJsonFlag": false
251
+ },
175
252
  "account:get-account": {
176
253
  "aliases": [],
177
254
  "args": {},
@@ -744,7 +821,7 @@
744
821
  "emails:get-email": {
745
822
  "aliases": [],
746
823
  "args": {},
747
- "description": "GET /emails/{id}",
824
+ "description": "Returns the full record for an inbound email received at one\nof your verified domains, including the parsed text and HTML\nbodies, threading metadata, SMTP envelope detail, webhook\ndelivery state, and a `replies` array for any outbound sends\nrecorded as replies to this inbound.\n\nFor listing inbound emails (with cursor pagination, status\nand date filters, and free-text search), use\n`/emails`. Outbound (sent) email records are NOT returned\nhere; use `/sent-emails/{id}` for those.\n\nThe response carries four sender-shaped fields whose\nmeanings overlap. `from_email` is the canonical \"who sent\nthis\" field for most use cases (parsed bare address from\nthe `From:` header, with a `sender` fallback). `from_header`\nis the raw header including any display name. `sender` and\n`smtp_mail_from` both carry the SMTP envelope MAIL FROM\n(return-path) and are equal by construction; `sender` is\nthe older field name retained for compatibility. See\n`primitive describe emails:get-email | jq '.responseSchema.properties'`\nfor per-field detail.\n",
748
825
  "flags": {
749
826
  "api-key": {
750
827
  "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
@@ -778,7 +855,7 @@
778
855
  "pluginName": "@primitivedotdev/sdk",
779
856
  "pluginType": "core",
780
857
  "strict": true,
781
- "summary": "Get email details",
858
+ "summary": "Get inbound email by id",
782
859
  "enableJsonFlag": false
783
860
  },
784
861
  "emails:list-emails": {
@@ -827,17 +904,11 @@
827
904
  "type": "option"
828
905
  },
829
906
  "status": {
830
- "description": "Filter by email status",
907
+ "description": "Filter inbound rows by lifecycle status. See `EmailStatus`\nfor what each value means. Note that the webhook delivery\nstate is a SEPARATE lifecycle on the same row; filter by\n`webhook_status` semantics is not currently supported on\nthis endpoint.\n",
831
908
  "name": "status",
832
909
  "required": false,
833
910
  "hasDynamicHelp": false,
834
911
  "multiple": false,
835
- "options": [
836
- "pending",
837
- "accepted",
838
- "completed",
839
- "rejected"
840
- ],
841
912
  "type": "option"
842
913
  },
843
914
  "search": {
@@ -1402,6 +1473,134 @@
1402
1473
  "summary": "List send-permission rules",
1403
1474
  "enableJsonFlag": false
1404
1475
  },
1476
+ "sending:get-sent-email": {
1477
+ "aliases": [],
1478
+ "args": {},
1479
+ "description": "Returns the full sent-email record by id, including\n`body_text` and `body_html` (omitted from the listing\nendpoint to keep paginated responses small). Use this when\ndiagnosing a specific send, e.g. inspecting the receiver's\nSMTP response on a `bounced` row or pulling the gate\ndenial detail on a `gate_denied` row.\n",
1480
+ "flags": {
1481
+ "api-key": {
1482
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1483
+ "env": "PRIMITIVE_API_KEY",
1484
+ "name": "api-key",
1485
+ "hasDynamicHelp": false,
1486
+ "multiple": false,
1487
+ "type": "option"
1488
+ },
1489
+ "base-url": {
1490
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
1491
+ "env": "PRIMITIVE_API_URL",
1492
+ "name": "base-url",
1493
+ "hasDynamicHelp": false,
1494
+ "multiple": false,
1495
+ "type": "option"
1496
+ },
1497
+ "id": {
1498
+ "description": "Resource UUID",
1499
+ "name": "id",
1500
+ "required": true,
1501
+ "hasDynamicHelp": false,
1502
+ "multiple": false,
1503
+ "type": "option"
1504
+ }
1505
+ },
1506
+ "hasDynamicHelp": false,
1507
+ "hiddenAliases": [],
1508
+ "id": "sending:get-sent-email",
1509
+ "pluginAlias": "@primitivedotdev/sdk",
1510
+ "pluginName": "@primitivedotdev/sdk",
1511
+ "pluginType": "core",
1512
+ "strict": true,
1513
+ "summary": "Get a sent email by id",
1514
+ "enableJsonFlag": false
1515
+ },
1516
+ "sending:list-sent-emails": {
1517
+ "aliases": [],
1518
+ "args": {},
1519
+ "description": "Returns a paginated list of OUTBOUND emails the caller's\norg has sent via /send-mail (and /emails/{id}/reply, which\nforwards through /send-mail). Includes every recorded\nattempt, including gate-denied attempts that the agent\nnever called and rows still in `queued` state.\n\nFor inbound mail received at your verified domains, see\n/emails. There is no unified send/receive history endpoint;\nthe two surfaces are intentionally separate because the\nunderlying tables, statuses, and lifecycle differ.\n\nEmail bodies (`body_text`, `body_html`) are NOT included on\nlist rows so a 50-row page can't balloon into a multi-MB\nresponse when sends are near the 5MB body cap. Use\n/sent-emails/{id} to fetch a single row with bodies, or\ncross-reference by `client_idempotency_key` if the caller\nalready has the body locally.\n",
1520
+ "flags": {
1521
+ "api-key": {
1522
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1523
+ "env": "PRIMITIVE_API_KEY",
1524
+ "name": "api-key",
1525
+ "hasDynamicHelp": false,
1526
+ "multiple": false,
1527
+ "type": "option"
1528
+ },
1529
+ "base-url": {
1530
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
1531
+ "env": "PRIMITIVE_API_URL",
1532
+ "name": "base-url",
1533
+ "hasDynamicHelp": false,
1534
+ "multiple": false,
1535
+ "type": "option"
1536
+ },
1537
+ "cursor": {
1538
+ "description": "Pagination cursor from a previous response's `meta.cursor` field.\nFormat: `{ISO-datetime}|{id}`\n",
1539
+ "name": "cursor",
1540
+ "required": false,
1541
+ "hasDynamicHelp": false,
1542
+ "multiple": false,
1543
+ "type": "option"
1544
+ },
1545
+ "limit": {
1546
+ "description": "Number of results per page",
1547
+ "name": "limit",
1548
+ "required": false,
1549
+ "hasDynamicHelp": false,
1550
+ "multiple": false,
1551
+ "type": "option"
1552
+ },
1553
+ "status": {
1554
+ "description": "Filter to rows in this status. Useful for polling\nqueued rows that haven't transitioned, auditing\ngate-denied attempts, or listing only successful\ndeliveries.\n",
1555
+ "name": "status",
1556
+ "required": false,
1557
+ "hasDynamicHelp": false,
1558
+ "multiple": false,
1559
+ "type": "option"
1560
+ },
1561
+ "request-id": {
1562
+ "description": "Filter to the row matching a specific server-issued\n`request_id`. The /send-mail response surfaces\n`request_id` on every send; this lookup lets the\ncaller find the historical row for a given live call\nwithout remembering its `id`.\n",
1563
+ "name": "request-id",
1564
+ "required": false,
1565
+ "hasDynamicHelp": false,
1566
+ "multiple": false,
1567
+ "type": "option"
1568
+ },
1569
+ "idempotency-key": {
1570
+ "description": "Filter to rows with the given `client_idempotency_key`.\nMultiple rows can share a key (a retry that hit the\nidempotent-replay path returns the same row, but a\nretry with a DIFFERENT canonical payload under the\nsame key is rejected by /send-mail before the row is\nwritten, so duplicates are bounded).\n",
1571
+ "name": "idempotency-key",
1572
+ "required": false,
1573
+ "hasDynamicHelp": false,
1574
+ "multiple": false,
1575
+ "type": "option"
1576
+ },
1577
+ "date-from": {
1578
+ "description": "Inclusive lower bound on `created_at`.",
1579
+ "name": "date-from",
1580
+ "required": false,
1581
+ "hasDynamicHelp": false,
1582
+ "multiple": false,
1583
+ "type": "option"
1584
+ },
1585
+ "date-to": {
1586
+ "description": "Inclusive upper bound on `created_at`.",
1587
+ "name": "date-to",
1588
+ "required": false,
1589
+ "hasDynamicHelp": false,
1590
+ "multiple": false,
1591
+ "type": "option"
1592
+ }
1593
+ },
1594
+ "hasDynamicHelp": false,
1595
+ "hiddenAliases": [],
1596
+ "id": "sending:list-sent-emails",
1597
+ "pluginAlias": "@primitivedotdev/sdk",
1598
+ "pluginName": "@primitivedotdev/sdk",
1599
+ "pluginType": "core",
1600
+ "strict": true,
1601
+ "summary": "List outbound sent emails",
1602
+ "enableJsonFlag": false
1603
+ },
1405
1604
  "sending:reply-to-email": {
1406
1605
  "aliases": [],
1407
1606
  "args": {},
@@ -1711,5 +1910,5 @@
1711
1910
  "enableJsonFlag": false
1712
1911
  }
1713
1912
  },
1714
- "version": "0.13.0"
1913
+ "version": "0.15.0"
1715
1914
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitivedotdev/sdk",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "Official Primitive Node.js SDK — webhook, api, openapi, contract, and parser modules",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -66,10 +66,10 @@
66
66
  "description": "Claim, verify, and manage email domains"
67
67
  },
68
68
  "emails": {
69
- "description": "List, inspect, and manage received emails"
69
+ "description": "List, inspect, and manage received emails. Use `primitive emails:latest` for a one-line-per-email summary of recent inbound mail."
70
70
  },
71
71
  "sending": {
72
- "description": "Send outbound emails through the Primitive API"
72
+ "description": "Send outbound emails. For replies to inbound mail, use `sending:reply-to-email --id <inbound-id>` (threading and Re: subject derived server-side); for fresh sends, use `sending:send-email` or the `primitive send` shortcut."
73
73
  },
74
74
  "endpoints": {
75
75
  "description": "Manage webhook endpoints that receive email events"