@primitivedotdev/sdk 0.18.0 → 0.20.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.
@@ -80,7 +80,7 @@
80
80
  ],
81
81
  "flags": {
82
82
  "api-key": {
83
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
83
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
84
84
  "env": "PRIMITIVE_API_KEY",
85
85
  "name": "api-key",
86
86
  "hasDynamicHelp": false,
@@ -168,6 +168,82 @@
168
168
  "summary": "Send an email (simplified, agent-friendly)",
169
169
  "enableJsonFlag": false
170
170
  },
171
+ "login": {
172
+ "aliases": [],
173
+ "args": {},
174
+ "description": "Log in by opening Primitive in your browser and saving an org-scoped CLI API key locally.",
175
+ "examples": [
176
+ "<%= config.bin %> login",
177
+ "<%= config.bin %> login --device-name work-laptop",
178
+ "<%= config.bin %> login --force"
179
+ ],
180
+ "flags": {
181
+ "base-url": {
182
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
183
+ "env": "PRIMITIVE_API_URL",
184
+ "name": "base-url",
185
+ "hasDynamicHelp": false,
186
+ "multiple": false,
187
+ "type": "option"
188
+ },
189
+ "device-name": {
190
+ "description": "Device name shown in the browser approval screen",
191
+ "name": "device-name",
192
+ "hasDynamicHelp": false,
193
+ "multiple": false,
194
+ "type": "option"
195
+ },
196
+ "no-browser": {
197
+ "description": "Do not attempt to open the browser automatically",
198
+ "name": "no-browser",
199
+ "allowNo": false,
200
+ "type": "boolean"
201
+ },
202
+ "force": {
203
+ "char": "f",
204
+ "description": "Replace saved credentials without first verifying the existing login",
205
+ "name": "force",
206
+ "allowNo": false,
207
+ "type": "boolean"
208
+ }
209
+ },
210
+ "hasDynamicHelp": false,
211
+ "hiddenAliases": [],
212
+ "id": "login",
213
+ "pluginAlias": "@primitivedotdev/sdk",
214
+ "pluginName": "@primitivedotdev/sdk",
215
+ "pluginType": "core",
216
+ "strict": true,
217
+ "summary": "Log in with browser approval",
218
+ "enableJsonFlag": false
219
+ },
220
+ "logout": {
221
+ "aliases": [],
222
+ "args": {},
223
+ "description": "Log out by revoking the saved Primitive CLI API key and deleting local credentials.",
224
+ "examples": [
225
+ "<%= config.bin %> logout"
226
+ ],
227
+ "flags": {
228
+ "base-url": {
229
+ "description": "Override the API base URL used for key revocation",
230
+ "env": "PRIMITIVE_API_URL",
231
+ "name": "base-url",
232
+ "hasDynamicHelp": false,
233
+ "multiple": false,
234
+ "type": "option"
235
+ }
236
+ },
237
+ "hasDynamicHelp": false,
238
+ "hiddenAliases": [],
239
+ "id": "logout",
240
+ "pluginAlias": "@primitivedotdev/sdk",
241
+ "pluginName": "@primitivedotdev/sdk",
242
+ "pluginType": "core",
243
+ "strict": true,
244
+ "summary": "Log out and revoke the saved CLI key",
245
+ "enableJsonFlag": false
246
+ },
171
247
  "whoami": {
172
248
  "aliases": [],
173
249
  "args": {},
@@ -178,7 +254,7 @@
178
254
  ],
179
255
  "flags": {
180
256
  "api-key": {
181
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
257
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
182
258
  "env": "PRIMITIVE_API_KEY",
183
259
  "name": "api-key",
184
260
  "hasDynamicHelp": false,
@@ -222,7 +298,7 @@
222
298
  ],
223
299
  "flags": {
224
300
  "api-key": {
225
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
301
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
226
302
  "env": "PRIMITIVE_API_KEY",
227
303
  "name": "api-key",
228
304
  "hasDynamicHelp": false,
@@ -268,13 +344,143 @@
268
344
  "summary": "Show the most recent inbound emails as a compact table",
269
345
  "enableJsonFlag": false
270
346
  },
347
+ "functions:deploy": {
348
+ "aliases": [],
349
+ "args": {},
350
+ "description": "Deploy a new function from a bundled handler file. Agent-grade shortcut for functions:create-function.\n\n Reads the bundle off disk (--file) instead of forcing the caller to\n serialize the source into a JSON body. Use the underlying operation\n `functions:create-function` if you need the full flag surface\n (raw-body JSON, etc.).",
351
+ "examples": [
352
+ "<%= config.bin %> functions:deploy --name forwarder --file ./bundle.js",
353
+ "<%= config.bin %> functions:deploy --name forwarder --file ./bundle.js --source-map-file ./bundle.js.map"
354
+ ],
355
+ "flags": {
356
+ "api-key": {
357
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
358
+ "env": "PRIMITIVE_API_KEY",
359
+ "name": "api-key",
360
+ "hasDynamicHelp": false,
361
+ "multiple": false,
362
+ "type": "option"
363
+ },
364
+ "base-url": {
365
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
366
+ "env": "PRIMITIVE_API_URL",
367
+ "name": "base-url",
368
+ "hasDynamicHelp": false,
369
+ "multiple": false,
370
+ "type": "option"
371
+ },
372
+ "name": {
373
+ "description": "Slug-style name. Lowercase letters, digits, hyphens, underscores. 1-64 chars. Must be unique within the org.",
374
+ "name": "name",
375
+ "required": true,
376
+ "hasDynamicHelp": false,
377
+ "multiple": false,
378
+ "type": "option"
379
+ },
380
+ "file": {
381
+ "description": "Path to the bundled ESM handler file (single self-contained module). Loaded as the `code` body field.",
382
+ "name": "file",
383
+ "required": true,
384
+ "hasDynamicHelp": false,
385
+ "multiple": false,
386
+ "type": "option"
387
+ },
388
+ "source-map-file": {
389
+ "description": "Optional path to a source map for the bundle. Stored only on the runtime side and used to symbolicate stack traces.",
390
+ "name": "source-map-file",
391
+ "hasDynamicHelp": false,
392
+ "multiple": false,
393
+ "type": "option"
394
+ },
395
+ "time": {
396
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
397
+ "name": "time",
398
+ "allowNo": false,
399
+ "type": "boolean"
400
+ }
401
+ },
402
+ "hasDynamicHelp": false,
403
+ "hiddenAliases": [],
404
+ "id": "functions:deploy",
405
+ "pluginAlias": "@primitivedotdev/sdk",
406
+ "pluginName": "@primitivedotdev/sdk",
407
+ "pluginType": "core",
408
+ "strict": true,
409
+ "summary": "Deploy a new function from a bundled handler file",
410
+ "enableJsonFlag": false
411
+ },
412
+ "functions:redeploy": {
413
+ "aliases": [],
414
+ "args": {},
415
+ "description": "Update or redeploy a function from a bundled handler file. Agent-grade shortcut for functions:update-function.\n\n Use to push a new bundle OR to refresh secret bindings into the\n running handler. The same file is fine for both: the deploy reads\n the bindings table fresh on every call, so passing the existing\n bundle picks up any secret writes since the last deploy.",
416
+ "examples": [
417
+ "<%= config.bin %> functions:redeploy --id <fn-id> --file ./bundle.js",
418
+ "<%= config.bin %> functions:redeploy --id <fn-id> --file ./bundle.js --source-map-file ./bundle.js.map"
419
+ ],
420
+ "flags": {
421
+ "api-key": {
422
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
423
+ "env": "PRIMITIVE_API_KEY",
424
+ "name": "api-key",
425
+ "hasDynamicHelp": false,
426
+ "multiple": false,
427
+ "type": "option"
428
+ },
429
+ "base-url": {
430
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
431
+ "env": "PRIMITIVE_API_URL",
432
+ "name": "base-url",
433
+ "hasDynamicHelp": false,
434
+ "multiple": false,
435
+ "type": "option"
436
+ },
437
+ "id": {
438
+ "description": "Function id (UUID). The function must already exist.",
439
+ "name": "id",
440
+ "required": true,
441
+ "hasDynamicHelp": false,
442
+ "multiple": false,
443
+ "type": "option"
444
+ },
445
+ "file": {
446
+ "description": "Path to the bundled ESM handler file. Loaded as the `code` body field.",
447
+ "name": "file",
448
+ "required": true,
449
+ "hasDynamicHelp": false,
450
+ "multiple": false,
451
+ "type": "option"
452
+ },
453
+ "source-map-file": {
454
+ "description": "Optional path to a source map for the bundle. Used to symbolicate stack traces in the function's logs.",
455
+ "name": "source-map-file",
456
+ "hasDynamicHelp": false,
457
+ "multiple": false,
458
+ "type": "option"
459
+ },
460
+ "time": {
461
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
462
+ "name": "time",
463
+ "allowNo": false,
464
+ "type": "boolean"
465
+ }
466
+ },
467
+ "hasDynamicHelp": false,
468
+ "hiddenAliases": [],
469
+ "id": "functions:redeploy",
470
+ "pluginAlias": "@primitivedotdev/sdk",
471
+ "pluginName": "@primitivedotdev/sdk",
472
+ "pluginType": "core",
473
+ "strict": true,
474
+ "summary": "Redeploy a function from a bundled handler file",
475
+ "enableJsonFlag": false
476
+ },
271
477
  "account:get-account": {
272
478
  "aliases": [],
273
479
  "args": {},
274
480
  "description": "GET /account",
275
481
  "flags": {
276
482
  "api-key": {
277
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
483
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
278
484
  "env": "PRIMITIVE_API_KEY",
279
485
  "name": "api-key",
280
486
  "hasDynamicHelp": false,
@@ -312,7 +518,7 @@
312
518
  "description": "GET /account/storage",
313
519
  "flags": {
314
520
  "api-key": {
315
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
521
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
316
522
  "env": "PRIMITIVE_API_KEY",
317
523
  "name": "api-key",
318
524
  "hasDynamicHelp": false,
@@ -350,7 +556,7 @@
350
556
  "description": "Returns the webhook signing secret for your account. If no\nsecret exists yet, one is generated automatically on first\naccess.\n\nSigning is account-scoped, not per-endpoint. Every webhook\ndelivery from any of your registered endpoints is signed\nwith this single secret. Rotate via\n`POST /account/webhook-secret/rotate`.\n\n**Secret format**: the returned string looks base64-shaped\n(e.g. `XNHBBW8VqoBjRfNs1tkZj11jTk...`) but is NOT base64.\nUse it AS-IS as a UTF-8 string when computing HMAC over a\ndelivery body. Base64-decoding before HMAC will silently\nproduce mismatched signatures.\n\nSee the API-level \"Webhook signing\" section for the full\nwire format (header name, signed string shape, hash algo,\ntolerance) including a language-agnostic verification\nrecipe.\n",
351
557
  "flags": {
352
558
  "api-key": {
353
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
559
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
354
560
  "env": "PRIMITIVE_API_KEY",
355
561
  "name": "api-key",
356
562
  "hasDynamicHelp": false,
@@ -388,7 +594,7 @@
388
594
  "description": "Generates a new webhook signing secret, replacing the current one.\nRate limited to once per 60 minutes.\n",
389
595
  "flags": {
390
596
  "api-key": {
391
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
597
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
392
598
  "env": "PRIMITIVE_API_KEY",
393
599
  "name": "api-key",
394
600
  "hasDynamicHelp": false,
@@ -426,7 +632,7 @@
426
632
  "description": "PATCH /account",
427
633
  "flags": {
428
634
  "api-key": {
429
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
635
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
430
636
  "env": "PRIMITIVE_API_KEY",
431
637
  "name": "api-key",
432
638
  "hasDynamicHelp": false,
@@ -485,13 +691,13 @@
485
691
  "summary": "Update account settings",
486
692
  "enableJsonFlag": false
487
693
  },
488
- "domains:add-domain": {
694
+ "cli:cli-logout": {
489
695
  "aliases": [],
490
696
  "args": {},
491
- "description": "Creates an unverified domain claim. You will receive a\n`verification_token` to add as a DNS TXT record before\ncalling the verify endpoint.\n",
697
+ "description": "Revokes the API key used to authenticate the request. CLI clients use\nthis endpoint during `primitive logout` before removing local credentials.\n",
492
698
  "flags": {
493
699
  "api-key": {
494
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
700
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
495
701
  "env": "PRIMITIVE_API_KEY",
496
702
  "name": "api-key",
497
703
  "hasDynamicHelp": false,
@@ -526,9 +732,9 @@
526
732
  "multiple": false,
527
733
  "type": "option"
528
734
  },
529
- "domain": {
530
- "description": "The domain name to claim (e.g. \"example.com\")",
531
- "name": "domain",
735
+ "key-id": {
736
+ "description": "Optional key id guard; when provided it must match the authenticated API key",
737
+ "name": "key-id",
532
738
  "hasDynamicHelp": false,
533
739
  "multiple": false,
534
740
  "type": "option"
@@ -536,21 +742,21 @@
536
742
  },
537
743
  "hasDynamicHelp": false,
538
744
  "hiddenAliases": [],
539
- "id": "domains:add-domain",
745
+ "id": "cli:cli-logout",
540
746
  "pluginAlias": "@primitivedotdev/sdk",
541
747
  "pluginName": "@primitivedotdev/sdk",
542
748
  "pluginType": "core",
543
749
  "strict": true,
544
- "summary": "Claim a new domain",
750
+ "summary": "Revoke the current CLI API key",
545
751
  "enableJsonFlag": false
546
752
  },
547
- "domains:delete-domain": {
753
+ "cli:poll-cli-login": {
548
754
  "aliases": [],
549
755
  "args": {},
550
- "description": "Deletes a verified or unverified domain claim.",
756
+ "description": "Polls a CLI login session until the browser approval either succeeds,\nis denied, expires, or is polled too quickly. The API key is generated\nonly after approval and is returned exactly once.\n",
551
757
  "flags": {
552
758
  "api-key": {
553
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
759
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
554
760
  "env": "PRIMITIVE_API_KEY",
555
761
  "name": "api-key",
556
762
  "hasDynamicHelp": false,
@@ -571,10 +777,23 @@
571
777
  "allowNo": false,
572
778
  "type": "boolean"
573
779
  },
574
- "id": {
575
- "description": "Resource UUID",
576
- "name": "id",
577
- "required": true,
780
+ "raw-body": {
781
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
782
+ "name": "raw-body",
783
+ "hasDynamicHelp": false,
784
+ "multiple": false,
785
+ "type": "option"
786
+ },
787
+ "body-file": {
788
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
789
+ "name": "body-file",
790
+ "hasDynamicHelp": false,
791
+ "multiple": false,
792
+ "type": "option"
793
+ },
794
+ "device-code": {
795
+ "description": "device_code",
796
+ "name": "device-code",
578
797
  "hasDynamicHelp": false,
579
798
  "multiple": false,
580
799
  "type": "option"
@@ -582,21 +801,21 @@
582
801
  },
583
802
  "hasDynamicHelp": false,
584
803
  "hiddenAliases": [],
585
- "id": "domains:delete-domain",
804
+ "id": "cli:poll-cli-login",
586
805
  "pluginAlias": "@primitivedotdev/sdk",
587
806
  "pluginName": "@primitivedotdev/sdk",
588
807
  "pluginType": "core",
589
808
  "strict": true,
590
- "summary": "Delete a domain",
809
+ "summary": "Poll CLI browser login",
591
810
  "enableJsonFlag": false
592
811
  },
593
- "domains:list-domains": {
812
+ "cli:start-cli-login": {
594
813
  "aliases": [],
595
814
  "args": {},
596
- "description": "Returns all verified and unverified domains for your organization,\nsorted by creation date (newest first). Each domain includes a\n`verified` boolean to distinguish between the two states.\n",
815
+ "description": "Starts a browser-assisted CLI login session. The response includes a\ndevice code for polling and a user code that the user approves in the\nbrowser. This endpoint does not require an API key.\n\n\nBody fields requiring --raw-body JSON (these are not exposed as flags):\n metadata object Optional client metadata stored with the login session; serialized JSON mus...\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
597
816
  "flags": {
598
817
  "api-key": {
599
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
818
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
600
819
  "env": "PRIMITIVE_API_KEY",
601
820
  "name": "api-key",
602
821
  "hasDynamicHelp": false,
@@ -616,25 +835,46 @@
616
835
  "name": "time",
617
836
  "allowNo": false,
618
837
  "type": "boolean"
838
+ },
839
+ "raw-body": {
840
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
841
+ "name": "raw-body",
842
+ "hasDynamicHelp": false,
843
+ "multiple": false,
844
+ "type": "option"
845
+ },
846
+ "body-file": {
847
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
848
+ "name": "body-file",
849
+ "hasDynamicHelp": false,
850
+ "multiple": false,
851
+ "type": "option"
852
+ },
853
+ "device-name": {
854
+ "description": "Human-readable device name shown during browser approval",
855
+ "name": "device-name",
856
+ "hasDynamicHelp": false,
857
+ "multiple": false,
858
+ "type": "option"
619
859
  }
620
860
  },
621
861
  "hasDynamicHelp": false,
622
862
  "hiddenAliases": [],
623
- "id": "domains:list-domains",
863
+ "id": "cli:start-cli-login",
624
864
  "pluginAlias": "@primitivedotdev/sdk",
625
865
  "pluginName": "@primitivedotdev/sdk",
626
866
  "pluginType": "core",
627
867
  "strict": true,
628
- "summary": "List all domains",
868
+ "summary": "Start CLI browser login",
629
869
  "enableJsonFlag": false
630
870
  },
631
- "domains:update-domain": {
871
+ "domains:add-domain": {
632
872
  "aliases": [],
633
873
  "args": {},
634
- "description": "Update a verified domain's settings. Only verified domains can be\nupdated. Per-domain spam thresholds require a Pro plan.\n",
874
+ "description": "Creates an unverified domain claim. You will receive a\n`verification_token` to add as a DNS TXT record before\ncalling the verify endpoint.\n",
635
875
  "flags": {
636
876
  "api-key": {
637
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
877
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
638
878
  "env": "PRIMITIVE_API_KEY",
639
879
  "name": "api-key",
640
880
  "hasDynamicHelp": false,
@@ -655,14 +895,6 @@
655
895
  "allowNo": false,
656
896
  "type": "boolean"
657
897
  },
658
- "id": {
659
- "description": "Resource UUID",
660
- "name": "id",
661
- "required": true,
662
- "hasDynamicHelp": false,
663
- "multiple": false,
664
- "type": "option"
665
- },
666
898
  "raw-body": {
667
899
  "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
668
900
  "name": "raw-body",
@@ -677,15 +909,9 @@
677
909
  "multiple": false,
678
910
  "type": "option"
679
911
  },
680
- "is-active": {
681
- "description": "Whether the domain accepts incoming emails",
682
- "name": "is-active",
683
- "allowNo": false,
684
- "type": "boolean"
685
- },
686
- "spam-threshold": {
687
- "description": "Per-domain spam threshold override (Pro plan required)",
688
- "name": "spam-threshold",
912
+ "domain": {
913
+ "description": "The domain name to claim (e.g. \"example.com\")",
914
+ "name": "domain",
689
915
  "hasDynamicHelp": false,
690
916
  "multiple": false,
691
917
  "type": "option"
@@ -693,21 +919,21 @@
693
919
  },
694
920
  "hasDynamicHelp": false,
695
921
  "hiddenAliases": [],
696
- "id": "domains:update-domain",
922
+ "id": "domains:add-domain",
697
923
  "pluginAlias": "@primitivedotdev/sdk",
698
924
  "pluginName": "@primitivedotdev/sdk",
699
925
  "pluginType": "core",
700
926
  "strict": true,
701
- "summary": "Update domain settings",
927
+ "summary": "Claim a new domain",
702
928
  "enableJsonFlag": false
703
929
  },
704
- "domains:verify-domain": {
930
+ "domains:delete-domain": {
705
931
  "aliases": [],
706
932
  "args": {},
707
- "description": "Checks DNS records (MX and TXT) to verify domain ownership.\nOn success, the domain is promoted from unverified to verified.\nOn failure, returns which checks passed and which failed.\n",
933
+ "description": "Deletes a verified or unverified domain claim.",
708
934
  "flags": {
709
935
  "api-key": {
710
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
936
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
711
937
  "env": "PRIMITIVE_API_KEY",
712
938
  "name": "api-key",
713
939
  "hasDynamicHelp": false,
@@ -739,21 +965,21 @@
739
965
  },
740
966
  "hasDynamicHelp": false,
741
967
  "hiddenAliases": [],
742
- "id": "domains:verify-domain",
968
+ "id": "domains:delete-domain",
743
969
  "pluginAlias": "@primitivedotdev/sdk",
744
970
  "pluginName": "@primitivedotdev/sdk",
745
971
  "pluginType": "core",
746
972
  "strict": true,
747
- "summary": "Verify domain ownership",
973
+ "summary": "Delete a domain",
748
974
  "enableJsonFlag": false
749
975
  },
750
- "emails:delete-email": {
976
+ "domains:list-domains": {
751
977
  "aliases": [],
752
978
  "args": {},
753
- "description": "DELETE /emails/{id}",
979
+ "description": "Returns all verified and unverified domains for your organization,\nsorted by creation date (newest first). Each domain includes a\n`verified` boolean to distinguish between the two states.\n",
754
980
  "flags": {
755
981
  "api-key": {
756
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
982
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
757
983
  "env": "PRIMITIVE_API_KEY",
758
984
  "name": "api-key",
759
985
  "hasDynamicHelp": false,
@@ -773,33 +999,190 @@
773
999
  "name": "time",
774
1000
  "allowNo": false,
775
1001
  "type": "boolean"
776
- },
777
- "id": {
778
- "description": "Resource UUID",
779
- "name": "id",
780
- "required": true,
781
- "hasDynamicHelp": false,
782
- "multiple": false,
783
- "type": "option"
784
1002
  }
785
1003
  },
786
1004
  "hasDynamicHelp": false,
787
1005
  "hiddenAliases": [],
788
- "id": "emails:delete-email",
1006
+ "id": "domains:list-domains",
789
1007
  "pluginAlias": "@primitivedotdev/sdk",
790
1008
  "pluginName": "@primitivedotdev/sdk",
791
1009
  "pluginType": "core",
792
1010
  "strict": true,
793
- "summary": "Delete an email",
1011
+ "summary": "List all domains",
1012
+ "enableJsonFlag": false
1013
+ },
1014
+ "domains:update-domain": {
1015
+ "aliases": [],
1016
+ "args": {},
1017
+ "description": "Update a verified domain's settings. Only verified domains can be\nupdated. Per-domain spam thresholds require a Pro plan.\n",
1018
+ "flags": {
1019
+ "api-key": {
1020
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1021
+ "env": "PRIMITIVE_API_KEY",
1022
+ "name": "api-key",
1023
+ "hasDynamicHelp": false,
1024
+ "multiple": false,
1025
+ "type": "option"
1026
+ },
1027
+ "base-url": {
1028
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
1029
+ "env": "PRIMITIVE_API_URL",
1030
+ "name": "base-url",
1031
+ "hasDynamicHelp": false,
1032
+ "multiple": false,
1033
+ "type": "option"
1034
+ },
1035
+ "time": {
1036
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
1037
+ "name": "time",
1038
+ "allowNo": false,
1039
+ "type": "boolean"
1040
+ },
1041
+ "id": {
1042
+ "description": "Resource UUID",
1043
+ "name": "id",
1044
+ "required": true,
1045
+ "hasDynamicHelp": false,
1046
+ "multiple": false,
1047
+ "type": "option"
1048
+ },
1049
+ "raw-body": {
1050
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
1051
+ "name": "raw-body",
1052
+ "hasDynamicHelp": false,
1053
+ "multiple": false,
1054
+ "type": "option"
1055
+ },
1056
+ "body-file": {
1057
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
1058
+ "name": "body-file",
1059
+ "hasDynamicHelp": false,
1060
+ "multiple": false,
1061
+ "type": "option"
1062
+ },
1063
+ "is-active": {
1064
+ "description": "Whether the domain accepts incoming emails",
1065
+ "name": "is-active",
1066
+ "allowNo": false,
1067
+ "type": "boolean"
1068
+ },
1069
+ "spam-threshold": {
1070
+ "description": "Per-domain spam threshold override (Pro plan required)",
1071
+ "name": "spam-threshold",
1072
+ "hasDynamicHelp": false,
1073
+ "multiple": false,
1074
+ "type": "option"
1075
+ }
1076
+ },
1077
+ "hasDynamicHelp": false,
1078
+ "hiddenAliases": [],
1079
+ "id": "domains:update-domain",
1080
+ "pluginAlias": "@primitivedotdev/sdk",
1081
+ "pluginName": "@primitivedotdev/sdk",
1082
+ "pluginType": "core",
1083
+ "strict": true,
1084
+ "summary": "Update domain settings",
1085
+ "enableJsonFlag": false
1086
+ },
1087
+ "domains:verify-domain": {
1088
+ "aliases": [],
1089
+ "args": {},
1090
+ "description": "Checks DNS records (MX and TXT) to verify domain ownership.\nOn success, the domain is promoted from unverified to verified.\nOn failure, returns which checks passed and which failed.\n",
1091
+ "flags": {
1092
+ "api-key": {
1093
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1094
+ "env": "PRIMITIVE_API_KEY",
1095
+ "name": "api-key",
1096
+ "hasDynamicHelp": false,
1097
+ "multiple": false,
1098
+ "type": "option"
1099
+ },
1100
+ "base-url": {
1101
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
1102
+ "env": "PRIMITIVE_API_URL",
1103
+ "name": "base-url",
1104
+ "hasDynamicHelp": false,
1105
+ "multiple": false,
1106
+ "type": "option"
1107
+ },
1108
+ "time": {
1109
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
1110
+ "name": "time",
1111
+ "allowNo": false,
1112
+ "type": "boolean"
1113
+ },
1114
+ "id": {
1115
+ "description": "Resource UUID",
1116
+ "name": "id",
1117
+ "required": true,
1118
+ "hasDynamicHelp": false,
1119
+ "multiple": false,
1120
+ "type": "option"
1121
+ }
1122
+ },
1123
+ "hasDynamicHelp": false,
1124
+ "hiddenAliases": [],
1125
+ "id": "domains:verify-domain",
1126
+ "pluginAlias": "@primitivedotdev/sdk",
1127
+ "pluginName": "@primitivedotdev/sdk",
1128
+ "pluginType": "core",
1129
+ "strict": true,
1130
+ "summary": "Verify domain ownership",
1131
+ "enableJsonFlag": false
1132
+ },
1133
+ "emails:delete-email": {
1134
+ "aliases": [],
1135
+ "args": {},
1136
+ "description": "DELETE /emails/{id}",
1137
+ "flags": {
1138
+ "api-key": {
1139
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1140
+ "env": "PRIMITIVE_API_KEY",
1141
+ "name": "api-key",
1142
+ "hasDynamicHelp": false,
1143
+ "multiple": false,
1144
+ "type": "option"
1145
+ },
1146
+ "base-url": {
1147
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
1148
+ "env": "PRIMITIVE_API_URL",
1149
+ "name": "base-url",
1150
+ "hasDynamicHelp": false,
1151
+ "multiple": false,
1152
+ "type": "option"
1153
+ },
1154
+ "time": {
1155
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
1156
+ "name": "time",
1157
+ "allowNo": false,
1158
+ "type": "boolean"
1159
+ },
1160
+ "id": {
1161
+ "description": "Resource UUID",
1162
+ "name": "id",
1163
+ "required": true,
1164
+ "hasDynamicHelp": false,
1165
+ "multiple": false,
1166
+ "type": "option"
1167
+ }
1168
+ },
1169
+ "hasDynamicHelp": false,
1170
+ "hiddenAliases": [],
1171
+ "id": "emails:delete-email",
1172
+ "pluginAlias": "@primitivedotdev/sdk",
1173
+ "pluginName": "@primitivedotdev/sdk",
1174
+ "pluginType": "core",
1175
+ "strict": true,
1176
+ "summary": "Delete an email",
794
1177
  "enableJsonFlag": false
795
1178
  },
796
1179
  "emails:discard-email-content": {
797
1180
  "aliases": [],
798
1181
  "args": {},
799
- "description": "Permanently deletes the email's raw bytes, parsed body (text + HTML),\nand attachments while preserving metadata (sender, recipient,\nsubject, timestamps, hashes, attachment manifest) for audit logs.\nIdempotent: a second call returns success with\n`already_discarded: true` and does no work.\n\n**Gated** on the customer's discard-content opt-in (managed in the\ndashboard at Settings > Webhooks). When the toggle is off, this\nendpoint returns `403` with code `discard_not_enabled` and a\nmessage pointing the human at the dashboard. There is intentionally\nno API to flip this toggle opting in to a destructive,\nnon-reversible operation must be a deliberate human click in the\nUI.\n",
1182
+ "description": "Permanently deletes the email's raw bytes, parsed body (text + HTML),\nand attachments while preserving metadata (sender, recipient,\nsubject, timestamps, hashes, attachment manifest) for audit logs.\nIdempotent: a second call returns success with\n`already_discarded: true` and does no work.\n\n**Gated** on the customer's discard-content opt-in (managed in the\ndashboard at Settings > Webhooks). When the toggle is off, this\nendpoint returns `403` with code `discard_not_enabled` and a\nmessage pointing the human at the dashboard. There is intentionally\nno API to flip this toggle. Opting in to a destructive,\nnon-reversible operation must be a deliberate human click in the\nUI.\n",
800
1183
  "flags": {
801
1184
  "api-key": {
802
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1185
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
803
1186
  "env": "PRIMITIVE_API_KEY",
804
1187
  "name": "api-key",
805
1188
  "hasDynamicHelp": false,
@@ -845,7 +1228,7 @@
845
1228
  "description": "Downloads all attachments as a gzip-compressed tar archive.\nAuthenticates via a signed download token (provided in webhook\npayloads) or a valid session.\n",
846
1229
  "flags": {
847
1230
  "api-key": {
848
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1231
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
849
1232
  "env": "PRIMITIVE_API_KEY",
850
1233
  "name": "api-key",
851
1234
  "hasDynamicHelp": false,
@@ -906,7 +1289,7 @@
906
1289
  "description": "Downloads the raw RFC 822 email file (.eml). Authenticates via\na signed download token (provided in webhook payloads) or a\nvalid session.\n",
907
1290
  "flags": {
908
1291
  "api-key": {
909
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1292
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
910
1293
  "env": "PRIMITIVE_API_KEY",
911
1294
  "name": "api-key",
912
1295
  "hasDynamicHelp": false,
@@ -967,7 +1350,7 @@
967
1350
  "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",
968
1351
  "flags": {
969
1352
  "api-key": {
970
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1353
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
971
1354
  "env": "PRIMITIVE_API_KEY",
972
1355
  "name": "api-key",
973
1356
  "hasDynamicHelp": false,
@@ -1013,7 +1396,7 @@
1013
1396
  "description": "Returns a paginated list of INBOUND emails received at your\nverified domains. Outbound messages sent via /send-mail are\nnot included; this endpoint is the inbox view, not a\nunified send/receive history.\n\nSupports filtering by domain, status, date range, and\nfree-text search across subject, sender, and recipient\nfields.\n\nFor a compact text-table summary of the most recent N\ninbounds (no filters, no cursor pagination), the CLI ships\n`primitive emails:latest` as a one-line-per-email shortcut.\nIt's TTY-aware so id columns are full UUIDs when piped, and\na `--json` flag returns the same envelope this endpoint\ndoes. Use whichever fits the call site.\n",
1014
1397
  "flags": {
1015
1398
  "api-key": {
1016
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1399
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1017
1400
  "env": "PRIMITIVE_API_KEY",
1018
1401
  "name": "api-key",
1019
1402
  "hasDynamicHelp": false,
@@ -1107,7 +1490,7 @@
1107
1490
  "description": "Re-delivers the webhook payload for this email to all active\nendpoints matching the email's domain. Rate limited per-email\n(short cooldown between successive replays of the same email)\nand per-org (burst + sustained windows), sharing an org-wide\nbudget with delivery replays.\n",
1108
1491
  "flags": {
1109
1492
  "api-key": {
1110
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1493
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1111
1494
  "env": "PRIMITIVE_API_KEY",
1112
1495
  "name": "api-key",
1113
1496
  "hasDynamicHelp": false,
@@ -1153,7 +1536,7 @@
1153
1536
  "description": "Creates a new webhook endpoint. If a deactivated endpoint\nwith the same URL and domain exists, it is reactivated\ninstead. Subject to plan limits on the number of active\nendpoints.\n\n**Signing is account-scoped, not per-endpoint.** This call\ndoes not return any signing material; every endpoint on the\naccount uses the same webhook secret, fetched via\n`GET /account/webhook-secret`. See the API-level \"Webhook\nsigning\" section for the full wire format (header name,\nsigned string, hash algo, secret format, tolerance) and a\nlanguage-agnostic verification recipe.\n\nAfter creating the endpoint, fire a test delivery against\nit via `POST /endpoints/{id}/test` to confirm your verifier\naccepts the signature.\n\n\nBody fields requiring --raw-body JSON (these are not exposed as flags):\n rules object Endpoint-specific filtering rules\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
1154
1537
  "flags": {
1155
1538
  "api-key": {
1156
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1539
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1157
1540
  "env": "PRIMITIVE_API_KEY",
1158
1541
  "name": "api-key",
1159
1542
  "hasDynamicHelp": false,
@@ -1225,7 +1608,7 @@
1225
1608
  "description": "Soft-deletes a webhook endpoint. The endpoint will no longer\nreceive webhook deliveries.\n",
1226
1609
  "flags": {
1227
1610
  "api-key": {
1228
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1611
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1229
1612
  "env": "PRIMITIVE_API_KEY",
1230
1613
  "name": "api-key",
1231
1614
  "hasDynamicHelp": false,
@@ -1271,7 +1654,7 @@
1271
1654
  "description": "Returns all active (non-deleted) webhook endpoints.",
1272
1655
  "flags": {
1273
1656
  "api-key": {
1274
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1657
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1275
1658
  "env": "PRIMITIVE_API_KEY",
1276
1659
  "name": "api-key",
1277
1660
  "hasDynamicHelp": false,
@@ -1309,7 +1692,7 @@
1309
1692
  "description": "Sends a sample `email.received` event to the endpoint. The request\nincludes SSRF protection (private IP rejection and DNS pinning).\nRate limited to 4 per minute and 30 per hour (non-exempt).\nSuccessful deliveries and verified-domain endpoints are exempt\nfrom the rate limit.\n",
1310
1693
  "flags": {
1311
1694
  "api-key": {
1312
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1695
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1313
1696
  "env": "PRIMITIVE_API_KEY",
1314
1697
  "name": "api-key",
1315
1698
  "hasDynamicHelp": false,
@@ -1355,7 +1738,7 @@
1355
1738
  "description": "Updates an active webhook endpoint. If the URL is changed, the old\nendpoint is deactivated and a new one is created (or an existing\ndeactivated endpoint with the new URL is reactivated).\n\n\nBody fields requiring --raw-body JSON (these are not exposed as flags):\n rules object\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
1356
1739
  "flags": {
1357
1740
  "api-key": {
1358
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1741
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1359
1742
  "env": "PRIMITIVE_API_KEY",
1360
1743
  "name": "api-key",
1361
1744
  "hasDynamicHelp": false,
@@ -1435,7 +1818,7 @@
1435
1818
  "description": "Creates a new whitelist or blocklist filter. Per-domain filters\nrequire a Pro plan. Patterns are stored as lowercase.\n",
1436
1819
  "flags": {
1437
1820
  "api-key": {
1438
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1821
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1439
1822
  "env": "PRIMITIVE_API_KEY",
1440
1823
  "name": "api-key",
1441
1824
  "hasDynamicHelp": false,
@@ -1512,7 +1895,7 @@
1512
1895
  "description": "DELETE /filters/{id}",
1513
1896
  "flags": {
1514
1897
  "api-key": {
1515
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1898
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1516
1899
  "env": "PRIMITIVE_API_KEY",
1517
1900
  "name": "api-key",
1518
1901
  "hasDynamicHelp": false,
@@ -1558,7 +1941,7 @@
1558
1941
  "description": "Returns all whitelist and blocklist filter rules.",
1559
1942
  "flags": {
1560
1943
  "api-key": {
1561
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1944
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1562
1945
  "env": "PRIMITIVE_API_KEY",
1563
1946
  "name": "api-key",
1564
1947
  "hasDynamicHelp": false,
@@ -1596,7 +1979,7 @@
1596
1979
  "description": "Toggle a filter's enabled state.",
1597
1980
  "flags": {
1598
1981
  "api-key": {
1599
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1982
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1600
1983
  "env": "PRIMITIVE_API_KEY",
1601
1984
  "name": "api-key",
1602
1985
  "hasDynamicHelp": false,
@@ -1656,13 +2039,585 @@
1656
2039
  "summary": "Update a filter rule",
1657
2040
  "enableJsonFlag": false
1658
2041
  },
2042
+ "functions:create-function": {
2043
+ "aliases": [],
2044
+ "args": {},
2045
+ "description": "Creates and deploys a new function. The handler must be a single\nESM module that exports a default async function receiving the\n`email.received` event (see the Webhook payload section for the\nfull schema). Code is bundled before being uploaded; ship a\nsingle self-contained file rather than relying on external\nimports.\n\n**Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`\n(optional) is capped at 5 MiB UTF-8 and is stored only on the\nedge runtime side; it is not persisted in Primitive's database.\n\n**Auto-wiring.** On successful deploy, Primitive automatically\ncreates a webhook endpoint that delivers inbound mail to the\nfunction. There is nothing to configure on the Endpoints API\nfor this to work; the gateway URL returned here is for\nreference only and is not directly callable from outside.\n\n**Secrets.** New functions ship with the managed secrets\n(`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`) already\nbound. Add user-set secrets via\n`POST /functions/{id}/secrets`; secret writes only land in the\nrunning handler on the next redeploy.\n",
2046
+ "flags": {
2047
+ "api-key": {
2048
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
2049
+ "env": "PRIMITIVE_API_KEY",
2050
+ "name": "api-key",
2051
+ "hasDynamicHelp": false,
2052
+ "multiple": false,
2053
+ "type": "option"
2054
+ },
2055
+ "base-url": {
2056
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
2057
+ "env": "PRIMITIVE_API_URL",
2058
+ "name": "base-url",
2059
+ "hasDynamicHelp": false,
2060
+ "multiple": false,
2061
+ "type": "option"
2062
+ },
2063
+ "time": {
2064
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
2065
+ "name": "time",
2066
+ "allowNo": false,
2067
+ "type": "boolean"
2068
+ },
2069
+ "raw-body": {
2070
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
2071
+ "name": "raw-body",
2072
+ "hasDynamicHelp": false,
2073
+ "multiple": false,
2074
+ "type": "option"
2075
+ },
2076
+ "body-file": {
2077
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
2078
+ "name": "body-file",
2079
+ "hasDynamicHelp": false,
2080
+ "multiple": false,
2081
+ "type": "option"
2082
+ },
2083
+ "code": {
2084
+ "description": "Bundled handler as a single ESM module. Up to 1 MiB UTF-8. Must export a default `{ async fetch(req, env, ctx) { ... } }` object.",
2085
+ "name": "code",
2086
+ "hasDynamicHelp": false,
2087
+ "multiple": false,
2088
+ "type": "option"
2089
+ },
2090
+ "name": {
2091
+ "description": "Slug-style name. Lowercase letters, digits, hyphens, and underscores. 1 to 64 characters. Must be unique within the org; a 409 is returned on collision.",
2092
+ "name": "name",
2093
+ "hasDynamicHelp": false,
2094
+ "multiple": false,
2095
+ "type": "option"
2096
+ },
2097
+ "sourceMap": {
2098
+ "description": "Optional source map for the bundle. Up to 5 MiB UTF-8. Stored only on the runtime side (not in Primitive's database) and used to symbolicate stack traces in the function's logs.",
2099
+ "name": "sourceMap",
2100
+ "hasDynamicHelp": false,
2101
+ "multiple": false,
2102
+ "type": "option"
2103
+ }
2104
+ },
2105
+ "hasDynamicHelp": false,
2106
+ "hiddenAliases": [],
2107
+ "id": "functions:create-function",
2108
+ "pluginAlias": "@primitivedotdev/sdk",
2109
+ "pluginName": "@primitivedotdev/sdk",
2110
+ "pluginType": "core",
2111
+ "strict": true,
2112
+ "summary": "Deploy a function",
2113
+ "enableJsonFlag": false
2114
+ },
2115
+ "functions:create-function-secret": {
2116
+ "aliases": [],
2117
+ "args": {},
2118
+ "description": "Idempotent insert-or-update keyed on `(function_id, key)`.\nReturns 201 the first time the key is set, 200 on subsequent\nupdates. Values are encrypted at rest and only become visible\nto the running handler on the next deploy (`PUT /functions/{id}`\nwith the existing code is sufficient to refresh bindings).\n\nKeys must match `^[A-Z_][A-Z0-9_]*$` (uppercase letters,\ndigits, underscores; first character is a letter or\nunderscore). Values are at most 4096 UTF-8 bytes. System-\nmanaged keys are reserved and rejected.\n",
2119
+ "flags": {
2120
+ "api-key": {
2121
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
2122
+ "env": "PRIMITIVE_API_KEY",
2123
+ "name": "api-key",
2124
+ "hasDynamicHelp": false,
2125
+ "multiple": false,
2126
+ "type": "option"
2127
+ },
2128
+ "base-url": {
2129
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
2130
+ "env": "PRIMITIVE_API_URL",
2131
+ "name": "base-url",
2132
+ "hasDynamicHelp": false,
2133
+ "multiple": false,
2134
+ "type": "option"
2135
+ },
2136
+ "time": {
2137
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
2138
+ "name": "time",
2139
+ "allowNo": false,
2140
+ "type": "boolean"
2141
+ },
2142
+ "id": {
2143
+ "description": "Resource UUID",
2144
+ "name": "id",
2145
+ "required": true,
2146
+ "hasDynamicHelp": false,
2147
+ "multiple": false,
2148
+ "type": "option"
2149
+ },
2150
+ "raw-body": {
2151
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
2152
+ "name": "raw-body",
2153
+ "hasDynamicHelp": false,
2154
+ "multiple": false,
2155
+ "type": "option"
2156
+ },
2157
+ "body-file": {
2158
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
2159
+ "name": "body-file",
2160
+ "hasDynamicHelp": false,
2161
+ "multiple": false,
2162
+ "type": "option"
2163
+ },
2164
+ "key": {
2165
+ "description": "Uppercase letters, digits, and underscores. Must start with a letter or underscore. System-managed keys (e.g. PRIMITIVE_WEBHOOK_SECRET) are reserved.",
2166
+ "name": "key",
2167
+ "hasDynamicHelp": false,
2168
+ "multiple": false,
2169
+ "type": "option"
2170
+ },
2171
+ "value": {
2172
+ "description": "Secret value, up to 4096 UTF-8 bytes. Encrypted at rest. Never returned by any read endpoint.",
2173
+ "name": "value",
2174
+ "hasDynamicHelp": false,
2175
+ "multiple": false,
2176
+ "type": "option"
2177
+ }
2178
+ },
2179
+ "hasDynamicHelp": false,
2180
+ "hiddenAliases": [],
2181
+ "id": "functions:create-function-secret",
2182
+ "pluginAlias": "@primitivedotdev/sdk",
2183
+ "pluginName": "@primitivedotdev/sdk",
2184
+ "pluginType": "core",
2185
+ "strict": true,
2186
+ "summary": "Create or update a secret",
2187
+ "enableJsonFlag": false
2188
+ },
2189
+ "functions:delete-function": {
2190
+ "aliases": [],
2191
+ "args": {},
2192
+ "description": "Soft-deletes the function row, removes the script from the edge\nruntime, and deactivates the auto-wired webhook endpoint so no\nfurther inbound mail is delivered. Past deploy history,\ninvocations, and logs are retained.\n\nReturns 502 if the runtime delete fails partway; the function\nrow stays in place and the call is safe to retry until it\nsucceeds.\n",
2193
+ "flags": {
2194
+ "api-key": {
2195
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
2196
+ "env": "PRIMITIVE_API_KEY",
2197
+ "name": "api-key",
2198
+ "hasDynamicHelp": false,
2199
+ "multiple": false,
2200
+ "type": "option"
2201
+ },
2202
+ "base-url": {
2203
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
2204
+ "env": "PRIMITIVE_API_URL",
2205
+ "name": "base-url",
2206
+ "hasDynamicHelp": false,
2207
+ "multiple": false,
2208
+ "type": "option"
2209
+ },
2210
+ "time": {
2211
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
2212
+ "name": "time",
2213
+ "allowNo": false,
2214
+ "type": "boolean"
2215
+ },
2216
+ "id": {
2217
+ "description": "Resource UUID",
2218
+ "name": "id",
2219
+ "required": true,
2220
+ "hasDynamicHelp": false,
2221
+ "multiple": false,
2222
+ "type": "option"
2223
+ }
2224
+ },
2225
+ "hasDynamicHelp": false,
2226
+ "hiddenAliases": [],
2227
+ "id": "functions:delete-function",
2228
+ "pluginAlias": "@primitivedotdev/sdk",
2229
+ "pluginName": "@primitivedotdev/sdk",
2230
+ "pluginType": "core",
2231
+ "strict": true,
2232
+ "summary": "Delete a function",
2233
+ "enableJsonFlag": false
2234
+ },
2235
+ "functions:delete-function-secret": {
2236
+ "aliases": [],
2237
+ "args": {},
2238
+ "description": "Removes the secret. The binding stays live in the running\nhandler until the next deploy refreshes the binding set\n(`PUT /functions/{id}` with the existing code is sufficient).\nReturns 404 if the key did not exist. Managed system keys\ncannot be deleted.\n",
2239
+ "flags": {
2240
+ "api-key": {
2241
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
2242
+ "env": "PRIMITIVE_API_KEY",
2243
+ "name": "api-key",
2244
+ "hasDynamicHelp": false,
2245
+ "multiple": false,
2246
+ "type": "option"
2247
+ },
2248
+ "base-url": {
2249
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
2250
+ "env": "PRIMITIVE_API_URL",
2251
+ "name": "base-url",
2252
+ "hasDynamicHelp": false,
2253
+ "multiple": false,
2254
+ "type": "option"
2255
+ },
2256
+ "time": {
2257
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
2258
+ "name": "time",
2259
+ "allowNo": false,
2260
+ "type": "boolean"
2261
+ },
2262
+ "id": {
2263
+ "description": "Resource UUID",
2264
+ "name": "id",
2265
+ "required": true,
2266
+ "hasDynamicHelp": false,
2267
+ "multiple": false,
2268
+ "type": "option"
2269
+ },
2270
+ "key": {
2271
+ "description": "Secret key. Must match `^[A-Z_][A-Z0-9_]*$`.",
2272
+ "name": "key",
2273
+ "required": true,
2274
+ "hasDynamicHelp": false,
2275
+ "multiple": false,
2276
+ "type": "option"
2277
+ }
2278
+ },
2279
+ "hasDynamicHelp": false,
2280
+ "hiddenAliases": [],
2281
+ "id": "functions:delete-function-secret",
2282
+ "pluginAlias": "@primitivedotdev/sdk",
2283
+ "pluginName": "@primitivedotdev/sdk",
2284
+ "pluginType": "core",
2285
+ "strict": true,
2286
+ "summary": "Delete a secret",
2287
+ "enableJsonFlag": false
2288
+ },
2289
+ "functions:get-function": {
2290
+ "aliases": [],
2291
+ "args": {},
2292
+ "description": "Returns the full record for a function, including its current\nsource code and the deploy status / error from the most recent\ndeploy attempt.\n",
2293
+ "flags": {
2294
+ "api-key": {
2295
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
2296
+ "env": "PRIMITIVE_API_KEY",
2297
+ "name": "api-key",
2298
+ "hasDynamicHelp": false,
2299
+ "multiple": false,
2300
+ "type": "option"
2301
+ },
2302
+ "base-url": {
2303
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
2304
+ "env": "PRIMITIVE_API_URL",
2305
+ "name": "base-url",
2306
+ "hasDynamicHelp": false,
2307
+ "multiple": false,
2308
+ "type": "option"
2309
+ },
2310
+ "time": {
2311
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
2312
+ "name": "time",
2313
+ "allowNo": false,
2314
+ "type": "boolean"
2315
+ },
2316
+ "id": {
2317
+ "description": "Resource UUID",
2318
+ "name": "id",
2319
+ "required": true,
2320
+ "hasDynamicHelp": false,
2321
+ "multiple": false,
2322
+ "type": "option"
2323
+ }
2324
+ },
2325
+ "hasDynamicHelp": false,
2326
+ "hiddenAliases": [],
2327
+ "id": "functions:get-function",
2328
+ "pluginAlias": "@primitivedotdev/sdk",
2329
+ "pluginName": "@primitivedotdev/sdk",
2330
+ "pluginType": "core",
2331
+ "strict": true,
2332
+ "summary": "Get a function",
2333
+ "enableJsonFlag": false
2334
+ },
2335
+ "functions:list-function-secrets": {
2336
+ "aliases": [],
2337
+ "args": {},
2338
+ "description": "Returns metadata for every secret bound to the function, with\nmanaged entries (provisioned by Primitive) listed first and\nuser-set entries listed alphabetically after. **Values are\nnever returned.** Secret writes are write-only.\n\nManaged entries (e.g. `PRIMITIVE_WEBHOOK_SECRET`,\n`PRIMITIVE_API_KEY`) carry a `description` instead of\n`created_at` / `updated_at`. They cannot be created, updated,\nor deleted via this API.\n",
2339
+ "flags": {
2340
+ "api-key": {
2341
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
2342
+ "env": "PRIMITIVE_API_KEY",
2343
+ "name": "api-key",
2344
+ "hasDynamicHelp": false,
2345
+ "multiple": false,
2346
+ "type": "option"
2347
+ },
2348
+ "base-url": {
2349
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
2350
+ "env": "PRIMITIVE_API_URL",
2351
+ "name": "base-url",
2352
+ "hasDynamicHelp": false,
2353
+ "multiple": false,
2354
+ "type": "option"
2355
+ },
2356
+ "time": {
2357
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
2358
+ "name": "time",
2359
+ "allowNo": false,
2360
+ "type": "boolean"
2361
+ },
2362
+ "id": {
2363
+ "description": "Resource UUID",
2364
+ "name": "id",
2365
+ "required": true,
2366
+ "hasDynamicHelp": false,
2367
+ "multiple": false,
2368
+ "type": "option"
2369
+ }
2370
+ },
2371
+ "hasDynamicHelp": false,
2372
+ "hiddenAliases": [],
2373
+ "id": "functions:list-function-secrets",
2374
+ "pluginAlias": "@primitivedotdev/sdk",
2375
+ "pluginName": "@primitivedotdev/sdk",
2376
+ "pluginType": "core",
2377
+ "strict": true,
2378
+ "summary": "List a function's secrets",
2379
+ "enableJsonFlag": false
2380
+ },
2381
+ "functions:list-functions": {
2382
+ "aliases": [],
2383
+ "args": {},
2384
+ "description": "Returns every active (non-deleted) function in the org, newest\nfirst. Each entry carries the deploy status and the gateway URL\nthat the platform's webhook delivery loop posts to. To inspect\nthe source code or deploy errors, use `GET /functions/{id}`.\n",
2385
+ "flags": {
2386
+ "api-key": {
2387
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
2388
+ "env": "PRIMITIVE_API_KEY",
2389
+ "name": "api-key",
2390
+ "hasDynamicHelp": false,
2391
+ "multiple": false,
2392
+ "type": "option"
2393
+ },
2394
+ "base-url": {
2395
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
2396
+ "env": "PRIMITIVE_API_URL",
2397
+ "name": "base-url",
2398
+ "hasDynamicHelp": false,
2399
+ "multiple": false,
2400
+ "type": "option"
2401
+ },
2402
+ "time": {
2403
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
2404
+ "name": "time",
2405
+ "allowNo": false,
2406
+ "type": "boolean"
2407
+ }
2408
+ },
2409
+ "hasDynamicHelp": false,
2410
+ "hiddenAliases": [],
2411
+ "id": "functions:list-functions",
2412
+ "pluginAlias": "@primitivedotdev/sdk",
2413
+ "pluginName": "@primitivedotdev/sdk",
2414
+ "pluginType": "core",
2415
+ "strict": true,
2416
+ "summary": "List functions",
2417
+ "enableJsonFlag": false
2418
+ },
2419
+ "functions:set-function-secret": {
2420
+ "aliases": [],
2421
+ "args": {},
2422
+ "description": "Path-keyed companion to `POST /functions/{id}/secrets`.\nIdempotent: returns 201 the first time the key is set, 200 on\nsubsequent updates. Same validation rules and same write-only\nguarantees as the POST verb; the new value lands in the running\nhandler on the next deploy.\n",
2423
+ "flags": {
2424
+ "api-key": {
2425
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
2426
+ "env": "PRIMITIVE_API_KEY",
2427
+ "name": "api-key",
2428
+ "hasDynamicHelp": false,
2429
+ "multiple": false,
2430
+ "type": "option"
2431
+ },
2432
+ "base-url": {
2433
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
2434
+ "env": "PRIMITIVE_API_URL",
2435
+ "name": "base-url",
2436
+ "hasDynamicHelp": false,
2437
+ "multiple": false,
2438
+ "type": "option"
2439
+ },
2440
+ "time": {
2441
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
2442
+ "name": "time",
2443
+ "allowNo": false,
2444
+ "type": "boolean"
2445
+ },
2446
+ "id": {
2447
+ "description": "Resource UUID",
2448
+ "name": "id",
2449
+ "required": true,
2450
+ "hasDynamicHelp": false,
2451
+ "multiple": false,
2452
+ "type": "option"
2453
+ },
2454
+ "key": {
2455
+ "description": "Secret key. Must match `^[A-Z_][A-Z0-9_]*$`.",
2456
+ "name": "key",
2457
+ "required": true,
2458
+ "hasDynamicHelp": false,
2459
+ "multiple": false,
2460
+ "type": "option"
2461
+ },
2462
+ "raw-body": {
2463
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
2464
+ "name": "raw-body",
2465
+ "hasDynamicHelp": false,
2466
+ "multiple": false,
2467
+ "type": "option"
2468
+ },
2469
+ "body-file": {
2470
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
2471
+ "name": "body-file",
2472
+ "hasDynamicHelp": false,
2473
+ "multiple": false,
2474
+ "type": "option"
2475
+ },
2476
+ "value": {
2477
+ "description": "value",
2478
+ "name": "value",
2479
+ "hasDynamicHelp": false,
2480
+ "multiple": false,
2481
+ "type": "option"
2482
+ }
2483
+ },
2484
+ "hasDynamicHelp": false,
2485
+ "hiddenAliases": [],
2486
+ "id": "functions:set-function-secret",
2487
+ "pluginAlias": "@primitivedotdev/sdk",
2488
+ "pluginName": "@primitivedotdev/sdk",
2489
+ "pluginType": "core",
2490
+ "strict": true,
2491
+ "summary": "Set a secret by key",
2492
+ "enableJsonFlag": false
2493
+ },
2494
+ "functions:test-function": {
2495
+ "aliases": [],
2496
+ "args": {},
2497
+ "description": "Sends a real test email from a Primitive-controlled sender to a\nsynthetic local-part on one of the org's verified inbound\ndomains. The function fires through the normal MX delivery\npath, so reply / send-mail calls from inside the handler\nagainst the inbound's `email.id` work the same as in\nproduction. Returns immediately after the send is queued; the\ninvocation appears on the function's invocations list within a\nfew seconds.\n\nRequires that the function is currently `deployed`. Returns 422\nif the function is in `pending` or `failed` state, or if the\norg has no verified inbound domain to receive the test mail.\n",
2498
+ "flags": {
2499
+ "api-key": {
2500
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
2501
+ "env": "PRIMITIVE_API_KEY",
2502
+ "name": "api-key",
2503
+ "hasDynamicHelp": false,
2504
+ "multiple": false,
2505
+ "type": "option"
2506
+ },
2507
+ "base-url": {
2508
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
2509
+ "env": "PRIMITIVE_API_URL",
2510
+ "name": "base-url",
2511
+ "hasDynamicHelp": false,
2512
+ "multiple": false,
2513
+ "type": "option"
2514
+ },
2515
+ "time": {
2516
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
2517
+ "name": "time",
2518
+ "allowNo": false,
2519
+ "type": "boolean"
2520
+ },
2521
+ "id": {
2522
+ "description": "Resource UUID",
2523
+ "name": "id",
2524
+ "required": true,
2525
+ "hasDynamicHelp": false,
2526
+ "multiple": false,
2527
+ "type": "option"
2528
+ }
2529
+ },
2530
+ "hasDynamicHelp": false,
2531
+ "hiddenAliases": [],
2532
+ "id": "functions:test-function",
2533
+ "pluginAlias": "@primitivedotdev/sdk",
2534
+ "pluginName": "@primitivedotdev/sdk",
2535
+ "pluginType": "core",
2536
+ "strict": true,
2537
+ "summary": "Send a test invocation",
2538
+ "enableJsonFlag": false
2539
+ },
2540
+ "functions:update-function": {
2541
+ "aliases": [],
2542
+ "args": {},
2543
+ "description": "Replaces the function's source code with the body's `code` and\ntriggers a redeploy. Same size limits as `POST /functions`.\nUse this verb to push secret writes into the running handler:\npassing the same `code` re-runs the deploy and refreshes the\nbinding set with the latest values from the secrets table.\n\nOn a 502 deploy failure, the previously-deployed code stays\nlive; the runtime never serves a half-built bundle. The\n`deploy_error` field on the returned record carries the error\nthat came back from the runtime so you can surface it to users\nwithout polling.\n",
2544
+ "flags": {
2545
+ "api-key": {
2546
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
2547
+ "env": "PRIMITIVE_API_KEY",
2548
+ "name": "api-key",
2549
+ "hasDynamicHelp": false,
2550
+ "multiple": false,
2551
+ "type": "option"
2552
+ },
2553
+ "base-url": {
2554
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
2555
+ "env": "PRIMITIVE_API_URL",
2556
+ "name": "base-url",
2557
+ "hasDynamicHelp": false,
2558
+ "multiple": false,
2559
+ "type": "option"
2560
+ },
2561
+ "time": {
2562
+ "description": "Print the wall-clock duration of this command to stderr after it completes (e.g. `[time: 1.34s]`). Useful for measuring `--wait` send latency, comparing CLI overhead, or capturing timing in scripts.",
2563
+ "name": "time",
2564
+ "allowNo": false,
2565
+ "type": "boolean"
2566
+ },
2567
+ "id": {
2568
+ "description": "Resource UUID",
2569
+ "name": "id",
2570
+ "required": true,
2571
+ "hasDynamicHelp": false,
2572
+ "multiple": false,
2573
+ "type": "option"
2574
+ },
2575
+ "raw-body": {
2576
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
2577
+ "name": "raw-body",
2578
+ "hasDynamicHelp": false,
2579
+ "multiple": false,
2580
+ "type": "option"
2581
+ },
2582
+ "body-file": {
2583
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
2584
+ "name": "body-file",
2585
+ "hasDynamicHelp": false,
2586
+ "multiple": false,
2587
+ "type": "option"
2588
+ },
2589
+ "code": {
2590
+ "description": "New bundled handler. Same rules as CreateFunctionInput.code.",
2591
+ "name": "code",
2592
+ "hasDynamicHelp": false,
2593
+ "multiple": false,
2594
+ "type": "option"
2595
+ },
2596
+ "sourceMap": {
2597
+ "description": "sourceMap",
2598
+ "name": "sourceMap",
2599
+ "hasDynamicHelp": false,
2600
+ "multiple": false,
2601
+ "type": "option"
2602
+ }
2603
+ },
2604
+ "hasDynamicHelp": false,
2605
+ "hiddenAliases": [],
2606
+ "id": "functions:update-function",
2607
+ "pluginAlias": "@primitivedotdev/sdk",
2608
+ "pluginName": "@primitivedotdev/sdk",
2609
+ "pluginType": "core",
2610
+ "strict": true,
2611
+ "summary": "Update and redeploy a function",
2612
+ "enableJsonFlag": false
2613
+ },
1659
2614
  "sending:get-send-permissions": {
1660
2615
  "aliases": [],
1661
2616
  "args": {},
1662
2617
  "description": "Returns a flat list of rules describing every recipient the\ncaller may send to. Each rule has a `type`, a kind-specific\npayload, and a human-readable `description`. If any rule\nmatches the recipient, /send-mail will accept the send under\nthe recipient-scope check.\n\nThe endpoint is the answer to \"where can I send\" without\nexposing internal entitlement names. Agents that don't\nrecognize a `type` can still read the `description` prose\nand act on it.\n\nRule kinds, ordered broadest-first so an agent can stop\nscanning at the first match:\n\n 1. `any_recipient` (one entry, only when the org can send\n anywhere): every other rule below it is redundant.\n 2. `managed_zone` (always emitted, one per Primitive-managed\n zone): sends to any address at *.primitive.email or\n *.email.works always succeed; no entitlement required.\n 3. `your_domain` (one per active verified outbound domain\n owned by the org): sends to that domain are approved.\n 4. `address` (one per address that has authenticated\n inbound mail to the org, capped at `meta.address_cap`):\n sends to that exact address are approved.\n\nThe list is informational, not an authorization check.\n/send-mail remains the source of truth on whether an\nindividual send will succeed (it also enforces the\nfrom-address and the `send_mail` entitlement, which are\nnot recipient-scope concerns and are not represented here).\n",
1663
2618
  "flags": {
1664
2619
  "api-key": {
1665
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
2620
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1666
2621
  "env": "PRIMITIVE_API_KEY",
1667
2622
  "name": "api-key",
1668
2623
  "hasDynamicHelp": false,
@@ -1700,7 +2655,7 @@
1700
2655
  "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",
1701
2656
  "flags": {
1702
2657
  "api-key": {
1703
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
2658
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1704
2659
  "env": "PRIMITIVE_API_KEY",
1705
2660
  "name": "api-key",
1706
2661
  "hasDynamicHelp": false,
@@ -1746,7 +2701,7 @@
1746
2701
  "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",
1747
2702
  "flags": {
1748
2703
  "api-key": {
1749
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
2704
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1750
2705
  "env": "PRIMITIVE_API_KEY",
1751
2706
  "name": "api-key",
1752
2707
  "hasDynamicHelp": false,
@@ -1840,7 +2795,7 @@
1840
2795
  "description": "Sends an outbound reply to the inbound email identified by `id`.\nThreading headers (`In-Reply-To`, `References`), recipient\nderivation (Reply-To, then From, then bare sender), and the\n`Re:` subject prefix are all derived server-side from the\nstored inbound row. The request body carries only the message\nbody and optional `wait` flag; passing any header or recipient\noverride is rejected by the schema (`additionalProperties:\nfalse`).\n\nForwards through the same gates as `/send-mail`: the response\nstatus, error envelope, and `idempotent_replay` flag mirror\nthe send-mail contract verbatim.\n",
1841
2796
  "flags": {
1842
2797
  "api-key": {
1843
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
2798
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1844
2799
  "env": "PRIMITIVE_API_KEY",
1845
2800
  "name": "api-key",
1846
2801
  "hasDynamicHelp": false,
@@ -1927,7 +2882,7 @@
1927
2882
  "description": "Sends an outbound email through Primitive's outbound relay. By default\nthe request returns once the relay accepts the message for delivery.\nSet `wait: true` to wait for the first downstream SMTP delivery outcome.\n\n\nBody fields requiring --raw-body JSON (these are not exposed as flags):\n references array<string> Full ordered message-id chain for the thread.\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
1928
2883
  "flags": {
1929
2884
  "api-key": {
1930
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
2885
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
1931
2886
  "env": "PRIMITIVE_API_KEY",
1932
2887
  "name": "api-key",
1933
2888
  "hasDynamicHelp": false,
@@ -2034,7 +2989,7 @@
2034
2989
  "description": "Returns a paginated list of webhook delivery attempts. Each delivery\nincludes a nested `email` object with sender, recipient, and subject.\n",
2035
2990
  "flags": {
2036
2991
  "api-key": {
2037
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
2992
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
2038
2993
  "env": "PRIMITIVE_API_KEY",
2039
2994
  "name": "api-key",
2040
2995
  "hasDynamicHelp": false,
@@ -2126,7 +3081,7 @@
2126
3081
  "description": "Re-sends the stored webhook payload from a previous delivery attempt.\nIf the original endpoint is still active, it is targeted. If the\noriginal endpoint was deleted, the oldest active endpoint is used.\nDeactivated endpoints cannot be replayed to. Rate limited per-org,\nsharing an org-wide budget with email replays.\n",
2127
3082
  "flags": {
2128
3083
  "api-key": {
2129
- "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
3084
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY or saved `primitive login` credentials)",
2130
3085
  "env": "PRIMITIVE_API_KEY",
2131
3086
  "name": "api-key",
2132
3087
  "hasDynamicHelp": false,
@@ -2167,5 +3122,5 @@
2167
3122
  "enableJsonFlag": false
2168
3123
  }
2169
3124
  },
2170
- "version": "0.18.0"
3125
+ "version": "0.20.0"
2171
3126
  }