primcli 3.0.0-preview.10 → 3.0.0-preview.11

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.
@@ -1,4 +1,4 @@
1
- import { B as ensureSearchReportsReplyState, Ht as getEmail, J as SENT_EMAIL_EVENT_TYPES, K as replyStateSurfaceForOperation, L as ReplyStateUnsupportedError, R as assertAwaitingFilterRows, W as isAwaitingRejectedError, Wn as sdk_gen_exports, Y as WEBHOOK_EVENT_TYPES, Zt as getOwnGrant, at as automatedRejectedError, ct as expectedAutomatedVerdicts, gn as listEndpoints, it as assertAutomatedVerdict, ot as automatedSurfaceForOperation, q as EMAIL_RULE_REQUEST_EVENT_TYPES, rt as AutomatedFilterUnsupportedError, st as ensureSearchReportsAutomated, tn as getThread, ut as isAutomatedRejectedError, v as parseRetryAfter, z as awaitingRejectedError } from "./repeats-Dj_o6c-X-CDaE-kdZ.js";
1
+ import { B as ensureSearchReportsReplyState, Gn as sdk_gen_exports, J as EMAIL_RULE_REQUEST_EVENT_TYPES, K as replyStateSurfaceForOperation, L as ReplyStateUnsupportedError, Qt as getOwnGrant, R as assertAwaitingFilterRows, Ut as getEmail, W as isAwaitingRejectedError, X as WEBHOOK_EVENT_TYPES, Y as SENT_EMAIL_EVENT_TYPES, _n as listEndpoints, at as assertAutomatedVerdict, ct as ensureSearchReportsAutomated, dt as isAutomatedRejectedError, it as AutomatedFilterUnsupportedError, lt as expectedAutomatedVerdicts, nn as getThread, ot as automatedRejectedError, q as EMAIL_RULE_OBJECTION_EVENT_TYPES, st as automatedSurfaceForOperation, v as parseRetryAfter, z as awaitingRejectedError } from "./repeats-Dj_o6c-X-ChTwFlyB.js";
2
2
  import { C as saveCliCredentials, F as agentProfilesDirectory, H as requireDefaultLoginProfile, N as agentProfileDirectory, R as loadConnectedAgentProfile, S as resolveCliAuth, W as PrimitiveApiClient, _ as deleteCliCredentials, b as loadCliCredentials, c as resolveConfigEnvironment, d as validateCliHeaderName, f as validateCliHeaderValue, i as loadCliConfig, j as AGENT_PROFILE_ENV, m as cliAccessTokenExpiresAt, p as acquireCliCredentialsLock, w as saveSignupCredentials, x as normalizeApiBaseUrl, y as detectPrimitiveKeyEnvMisname } from "./cli-config-Ms_0vNjq.js";
3
3
  import "./oclif/global-org-flag.js";
4
4
  import { a as thrownErrorBody } from "./json-output-ch756TXV.js";
@@ -780,7 +780,7 @@ const operationManifest = [
780
780
  "binaryResponse": false,
781
781
  "bodyRequired": false,
782
782
  "command": "list-activity-objects",
783
- "description": "The objects the caller created, newest first, each with where it stands now, including ones since disabled, deleted or revoked where the object keeps a row: Functions, endpoints, Function triggers, pull subscriptions, recipient routes, filters, wake schedules, repeating sends and scheduled sends. An API key, an app or an agent sees what it created itself; a webhook given to an API key lists under that key. A person (a dashboard session, or their own Primitive CLI or app login) sees what they created through any credential of theirs, each item naming it, and also their API keys, personal agents, email rules, rule requests and objections to rules over their mail (objections only on the dashboard or the Primitive CLI). Each kind is listed only if the caller could list it through that kind's own route; a kind it could not is named in withheld, with no count. Ids, names and states only: never a webhook URL or mail content. Needs activity:read_self. With relation=asked it lists instead what other members asked of the person, open or answered: the rule requests made to them, and the objections to rules they wrote, under their current membership, each naming the member who asked or objected in created_through. A key, an app or an agent has none, and gets both kinds in withheld.",
783
+ "description": "The objects the caller created, newest first, each with where it stands now, including ones since disabled, deleted or revoked where the object keeps a row: Functions, endpoints, Function triggers, pull subscriptions, recipient routes, filters, wake schedules, repeating sends and scheduled sends. An API key, an app or an agent sees what it created itself; a webhook given to an API key lists under that key. A person (a dashboard session, or their own Primitive CLI or app login) sees what they created through any credential of theirs, each item naming it, and also their API keys, personal agents, email rules, rule requests and objections to rules over their mail (objections only on the dashboard or the Primitive CLI). Each kind is listed only if the caller could list it through that kind's own route; a kind it could not is named in withheld, with no count. Ids, names and states only: never a webhook URL or mail content. Needs activity:read_self. With relation=asked it lists instead what other members asked of the person, open or answered: the rule requests made to them, and the objections to rules they wrote, under their current membership, each naming the member who asked or objected in created_through. A key, an app or an agent has none, and gets both kinds in withheld. With relation=concerning it lists instead what other members did that concerns the person's own mail: each time a rule started covering one of their mailboxes or saved a new version while covering it, named as the rule was then, naming its author in created_through, under their current membership; only on the dashboard or the Primitive CLI. A key, an app or an agent has none, and gets email_rule_coverage in withheld. A notice never reads as ended.",
784
784
  "hasJsonBody": false,
785
785
  "method": "GET",
786
786
  "operationId": "listActivityObjects",
@@ -789,14 +789,18 @@ const operationManifest = [
789
789
  "queryParams": [
790
790
  {
791
791
  "default": "created",
792
- "description": "created (the default) or asked.",
793
- "enum": ["created", "asked"],
792
+ "description": "created (the default), asked or concerning.",
793
+ "enum": [
794
+ "created",
795
+ "asked",
796
+ "concerning"
797
+ ],
794
798
  "name": "relation",
795
799
  "required": false,
796
800
  "type": "string"
797
801
  },
798
802
  {
799
- "description": "Only these kinds, comma-separated: function, endpoint, function_trigger, pull_subscription, recipient_route, filter_rule, wake_schedule, repeating_send, scheduled_send, api_key, agent_connection, email_rule, email_rule_request, email_rule_objection. Defaults to every kind the caller can have created (a person's own kinds only for a person). With relation=asked, only email_rule_request and email_rule_objection, which are also the default.",
803
+ "description": "Only these kinds, comma-separated: function, endpoint, function_trigger, pull_subscription, recipient_route, filter_rule, wake_schedule, repeating_send, scheduled_send, api_key, agent_connection, email_rule, email_rule_request, email_rule_objection, email_rule_coverage. Defaults to every kind the caller can have created (a person's own kinds only for a person). With relation=asked, only email_rule_request and email_rule_objection, which are also the default; with relation=concerning, only email_rule_coverage, the default. email_rule_coverage is listed only with relation=concerning.",
800
804
  "enum": null,
801
805
  "name": "kind",
802
806
  "required": false,
@@ -850,16 +854,16 @@ const operationManifest = [
850
854
  "properties": {
851
855
  "kind": {
852
856
  "type": "string",
853
- "description": "One of: function, endpoint, function_trigger, pull_subscription, recipient_route, filter_rule, wake_schedule, repeating_send, scheduled_send, api_key, agent_connection, email_rule, email_rule_request, email_rule_objection."
857
+ "description": "One of: function, endpoint, function_trigger, pull_subscription, recipient_route, filter_rule, wake_schedule, repeating_send, scheduled_send, api_key, agent_connection, email_rule, email_rule_request, email_rule_objection, email_rule_coverage."
854
858
  },
855
859
  "id": { "type": "string" },
856
860
  "name": {
857
- "description": "The name the object is known by: an endpoint's display name, a route's or filter's pattern, a Function's name, a send's From address, a wake schedule's command and the address it wakes, an API key's name, an agent's address, a rule's or rule request's name, and for an objection the name its rule had when the objection was made. Never a webhook URL and never mail content.",
861
+ "description": "The name the object is known by: an endpoint's display name, a route's or filter's pattern, a Function's name, a send's From address, a wake schedule's command and the address it wakes, an API key's name, an agent's address, a rule's or rule request's name, and for an objection or a coverage notice the name its rule had then. Never a webhook URL and never mail content.",
858
862
  "type": ["string", "null"]
859
863
  },
860
864
  "state": {
861
865
  "type": "string",
862
- "description": "Where it stands now: enabled, disabled, deleted or replaced (endpoints and routes), enabled or disabled (filters, wake schedules), live, suspended or deleted (Functions), active, paused or ended (repeating sends), scheduled (scheduled sends), active, suspended, expired or revoked (API keys), pending, claimed, connected or revoked (agents), draft, observe or active (email rules), pending, accepted, declined or withdrawn (rule requests and objections)."
866
+ "description": "Where it stands now: enabled, disabled, deleted or replaced (endpoints and routes), enabled or disabled (filters, wake schedules), live, suspended or deleted (Functions), active, paused or ended (repeating sends), scheduled (scheduled sends), active, suspended, expired or revoked (API keys), pending, claimed, connected or revoked (agents), draft, observe or active (email rules), pending, accepted, declined or withdrawn (rule requests and objections), and for a coverage notice what it told: started (a rule began covering your mailbox), new_version, or baseline (it already covered you when notices began)."
863
867
  },
864
868
  "created_at": {
865
869
  "type": "string",
@@ -873,21 +877,21 @@ const operationManifest = [
873
877
  "owned_now": {
874
878
  "type": "string",
875
879
  "enum": ["you", "someone_else"],
876
- "description": "you: it is still yours: never transferred, or transferred back to you. someone_else: it was transferred and another person holds it now, or, with relation=asked, another member made it."
880
+ "description": "you: it is still yours: never transferred, or transferred back to you. someone_else: it was transferred and another person holds it now, or, with relation=asked or concerning, another member made it."
877
881
  },
878
882
  "created_through": {
879
883
  "type": "object",
880
884
  "properties": {
881
885
  "kind": {
882
886
  "type": "string",
883
- "description": "The kind of credential it was created through: org_key, function_key, connected_key, oauth, agent_delegate or member (the person themselves). With relation=asked, member: the member who asked or objected."
887
+ "description": "The kind of credential it was created through: org_key, function_key, connected_key, oauth, agent_delegate or member (the person themselves). With relation=asked, member: the member who asked or objected; with relation=concerning, member: the rule's author."
884
888
  },
885
889
  "id": {
886
- "description": "In a person's view, the person's own user id for member, and an API key's id where they may read their keys (for a person limited to their own keys, only a key they still hold). Null otherwise, and always null in one credential's view, where it is the calling credential itself. With relation=asked, the user id of the member who asked or objected.",
890
+ "description": "In a person's view, the person's own user id for member, and an API key's id where they may read their keys (for a person limited to their own keys, only a key they still hold). Null otherwise, and always null in one credential's view, where it is the calling credential itself. With relation=asked, the user id of the member who asked or objected; with relation=concerning, of the rule's author.",
887
891
  "type": ["string", "null"]
888
892
  },
889
893
  "name": {
890
- "description": "In a person's view, what that credential of theirs is called: an app login by its app, an API key by its name, an agent's key by its address. Null otherwise, and for the person themselves. With relation=asked, the name of the member who asked or objected.",
894
+ "description": "In a person's view, what that credential of theirs is called: an app login by its app, an API key by its name, an agent's key by its address. Null otherwise, and for the person themselves. With relation=asked, the name of the member who asked or objected; with relation=concerning, of the rule's author.",
891
895
  "type": ["string", "null"]
892
896
  }
893
897
  },
@@ -13382,7 +13386,7 @@ const operationManifest = [
13382
13386
  "binaryResponse": false,
13383
13387
  "bodyRequired": false,
13384
13388
  "command": "get-email-rule-covering-me",
13385
- "description": "One rule that covers one of your own mailboxes, read-only, with its current version; or one that no longer does but decided on mail at your own mailbox (covers_now false), shown as the version that last decided on your mail, without its current name. You see its name, wording, current tree, state, kind and author, and which of your own mailboxes it reaches. Its wording and tree are shown as written, so they can name other addresses (a condition on who an email is from or to). You do not see the other inboxes and domains its scope names, its saved expectations, or the keys, shares and webhooks that use it. Needs mail:read, a member's own credential with their full access (not an API key, agent key or narrowed token), and the email rules feature. Only on your own dashboard session or the Primitive CLI.",
13389
+ "description": "One rule that covers one of your own mailboxes, read-only, with its current version; or one that no longer does but decided on mail at your own mailbox (covers_now false), shown as the version that last decided on your mail, without its current name. You see its name, wording, current tree, state, kind and author, and which of your own mailboxes it reaches. Its wording and tree are shown as written, so they can name other addresses (a condition on who an email is from or to). While it covers you, you also see who receives what it matches (receivers): how many API keys, webhooks and shares, and the member each belongs to, or the organization. You do not see which keys, webhooks or shares they are (no ids, names, prefixes or URLs), the other inboxes and domains its scope names, or its saved expectations. Needs mail:read, a member's own credential with their full access (not an API key, agent key or narrowed token), and the email rules feature. Only on your own dashboard session or the Primitive CLI.",
13386
13390
  "hasJsonBody": false,
13387
13391
  "method": "GET",
13388
13392
  "operationId": "getEmailRuleCoveringMe",
@@ -13478,6 +13482,147 @@ const operationManifest = [
13478
13482
  "exclusiveMinimum": 0,
13479
13483
  "description": "Null when covers_now is false."
13480
13484
  },
13485
+ "receivers": {
13486
+ "description": "Null when covers_now is false (who receives it now is not about your mail), or when it could not be read in time.",
13487
+ "anyOf": [{
13488
+ "type": "object",
13489
+ "properties": {
13490
+ "keys": {
13491
+ "type": "array",
13492
+ "items": {
13493
+ "type": "object",
13494
+ "properties": {
13495
+ "owner": { "anyOf": [{
13496
+ "type": "object",
13497
+ "properties": {
13498
+ "kind": {
13499
+ "type": "string",
13500
+ "const": "member"
13501
+ },
13502
+ "user_id": {
13503
+ "type": "string",
13504
+ "description": "The member's user id.",
13505
+ "format": "uuid"
13506
+ },
13507
+ "name": {
13508
+ "description": "Their name; null when they have none set.",
13509
+ "type": ["string", "null"]
13510
+ }
13511
+ },
13512
+ "required": [
13513
+ "kind",
13514
+ "user_id",
13515
+ "name"
13516
+ ]
13517
+ }, {
13518
+ "type": "object",
13519
+ "properties": { "kind": {
13520
+ "type": "string",
13521
+ "const": "organization",
13522
+ "description": "Held by no member: an organization key, or one whose holder has left."
13523
+ } },
13524
+ "required": ["kind"]
13525
+ }] },
13526
+ "count": {
13527
+ "type": "integer",
13528
+ "exclusiveMinimum": 0
13529
+ }
13530
+ },
13531
+ "required": ["owner", "count"]
13532
+ },
13533
+ "description": "API keys that work now (not revoked, expired or suspended) whose access lists the rule, or its live share: they read what it matches. Owner: the member who holds each, or the organization."
13534
+ },
13535
+ "webhooks": {
13536
+ "type": "array",
13537
+ "items": {
13538
+ "type": "object",
13539
+ "properties": {
13540
+ "owner": { "anyOf": [{
13541
+ "type": "object",
13542
+ "properties": {
13543
+ "kind": {
13544
+ "type": "string",
13545
+ "const": "member"
13546
+ },
13547
+ "user_id": {
13548
+ "type": "string",
13549
+ "description": "The member's user id.",
13550
+ "format": "uuid"
13551
+ },
13552
+ "name": {
13553
+ "description": "Their name; null when they have none set.",
13554
+ "type": ["string", "null"]
13555
+ }
13556
+ },
13557
+ "required": [
13558
+ "kind",
13559
+ "user_id",
13560
+ "name"
13561
+ ]
13562
+ }, {
13563
+ "type": "object",
13564
+ "properties": { "kind": {
13565
+ "type": "string",
13566
+ "const": "organization",
13567
+ "description": "Held by no member: an organization key, or one whose holder has left."
13568
+ } },
13569
+ "required": ["kind"]
13570
+ }] },
13571
+ "count": {
13572
+ "type": "integer",
13573
+ "exclusiveMinimum": 0
13574
+ }
13575
+ },
13576
+ "required": ["owner", "count"]
13577
+ },
13578
+ "description": "Webhooks that are sent what it matches: those whose key, as delivery acts as it, lists the rule or its live share (owner: the member who holds that key, or the organization), and the webhooks of the member the rule is shared with (owner: that member)."
13579
+ },
13580
+ "shares": {
13581
+ "type": "array",
13582
+ "items": {
13583
+ "type": "object",
13584
+ "properties": {
13585
+ "beneficiary": {
13586
+ "type": "object",
13587
+ "properties": {
13588
+ "kind": {
13589
+ "type": "string",
13590
+ "const": "member"
13591
+ },
13592
+ "user_id": {
13593
+ "type": "string",
13594
+ "description": "The member's user id.",
13595
+ "format": "uuid"
13596
+ },
13597
+ "name": {
13598
+ "description": "Their name; null when they have none set.",
13599
+ "type": ["string", "null"]
13600
+ }
13601
+ },
13602
+ "required": [
13603
+ "kind",
13604
+ "user_id",
13605
+ "name"
13606
+ ]
13607
+ },
13608
+ "count": {
13609
+ "type": "integer",
13610
+ "exclusiveMinimum": 0
13611
+ }
13612
+ },
13613
+ "required": ["beneficiary", "count"]
13614
+ },
13615
+ "description": "The rule's live share, if it has one (a rule is shared at most once): the member it gives what it matches to."
13616
+ }
13617
+ },
13618
+ "required": [
13619
+ "keys",
13620
+ "webhooks",
13621
+ "shares"
13622
+ ],
13623
+ "description": "Who receives what the rule shares now, by person and count; empty unless it is an active grant rule."
13624
+ }, { "type": "null" }]
13625
+ },
13481
13626
  "created_at": {
13482
13627
  "type": "string",
13483
13628
  "format": "date-time"
@@ -13570,6 +13715,7 @@ const operationManifest = [
13570
13715
  "is_author",
13571
13716
  "covers",
13572
13717
  "current_version",
13718
+ "receivers",
13573
13719
  "created_at",
13574
13720
  "covers_now",
13575
13721
  "current"
@@ -14008,7 +14154,7 @@ const operationManifest = [
14008
14154
  "binaryResponse": false,
14009
14155
  "bodyRequired": false,
14010
14156
  "command": "list-email-rules-covering-me",
14011
- "description": "Every email rule that covers one of your own mailboxes now, yours included, newest first, in any state. A rule covers you when the scope it runs with now reaches one of your own mailboxes (your member mailbox, or a personal agent's address): one whose author reads all your mail (author scope, for an author who reads the organization's mail or holds an access entry for your mailbox), or one that names your mailbox or its domain (selected). Another member's own_mailboxes rule never covers you. You see its name, wording, current tree, state, kind and author, and which of your own mailboxes it reaches. Its wording and tree are shown as written, so they can name other addresses (a condition on who an email is from or to). You do not see the other inboxes and domains its scope names, its saved expectations, or the keys, shares and webhooks that use it. A page can hold fewer rules than limit, or none, and still carry a cursor (one request reads a bounded number of rules): keep reading until meta.cursor is null. Needs mail:read, a member's own credential with their full access (not an API key, agent key or narrowed token), and the email rules feature. Only on your own dashboard session or the Primitive CLI.",
14157
+ "description": "Every email rule that covers one of your own mailboxes now, yours included, newest first, in any state. A rule covers you when the scope it runs with now reaches one of your own mailboxes (your member mailbox, or a personal agent's address): one whose author reads all your mail (author scope, for an author who reads the organization's mail or holds an access entry for your mailbox), or one that names your mailbox or its domain (selected). Another member's own_mailboxes rule never covers you. You see its name, wording, current tree, state, kind and author, and which of your own mailboxes it reaches. Its wording and tree are shown as written, so they can name other addresses (a condition on who an email is from or to). While it covers you, you also see who receives what it matches (receivers): how many API keys, webhooks and shares, and the member each belongs to, or the organization. You do not see which keys, webhooks or shares they are (no ids, names, prefixes or URLs), the other inboxes and domains its scope names, or its saved expectations. A page can hold fewer rules than limit, or none, and still carry a cursor (one request reads a bounded number of rules): keep reading until meta.cursor is null. Needs mail:read, a member's own credential with their full access (not an API key, agent key or narrowed token), and the email rules feature. Only on your own dashboard session or the Primitive CLI.",
14012
14158
  "hasJsonBody": false,
14013
14159
  "method": "GET",
14014
14160
  "operationId": "listEmailRulesCoveringMe",
@@ -14108,6 +14254,147 @@ const operationManifest = [
14108
14254
  "type": ["integer", "null"],
14109
14255
  "exclusiveMinimum": 0
14110
14256
  },
14257
+ "receivers": {
14258
+ "description": "Null when it could not be read in time; try again.",
14259
+ "anyOf": [{
14260
+ "type": "object",
14261
+ "properties": {
14262
+ "keys": {
14263
+ "type": "array",
14264
+ "items": {
14265
+ "type": "object",
14266
+ "properties": {
14267
+ "owner": { "anyOf": [{
14268
+ "type": "object",
14269
+ "properties": {
14270
+ "kind": {
14271
+ "type": "string",
14272
+ "const": "member"
14273
+ },
14274
+ "user_id": {
14275
+ "type": "string",
14276
+ "description": "The member's user id.",
14277
+ "format": "uuid"
14278
+ },
14279
+ "name": {
14280
+ "description": "Their name; null when they have none set.",
14281
+ "type": ["string", "null"]
14282
+ }
14283
+ },
14284
+ "required": [
14285
+ "kind",
14286
+ "user_id",
14287
+ "name"
14288
+ ]
14289
+ }, {
14290
+ "type": "object",
14291
+ "properties": { "kind": {
14292
+ "type": "string",
14293
+ "const": "organization",
14294
+ "description": "Held by no member: an organization key, or one whose holder has left."
14295
+ } },
14296
+ "required": ["kind"]
14297
+ }] },
14298
+ "count": {
14299
+ "type": "integer",
14300
+ "exclusiveMinimum": 0
14301
+ }
14302
+ },
14303
+ "required": ["owner", "count"]
14304
+ },
14305
+ "description": "API keys that work now (not revoked, expired or suspended) whose access lists the rule, or its live share: they read what it matches. Owner: the member who holds each, or the organization."
14306
+ },
14307
+ "webhooks": {
14308
+ "type": "array",
14309
+ "items": {
14310
+ "type": "object",
14311
+ "properties": {
14312
+ "owner": { "anyOf": [{
14313
+ "type": "object",
14314
+ "properties": {
14315
+ "kind": {
14316
+ "type": "string",
14317
+ "const": "member"
14318
+ },
14319
+ "user_id": {
14320
+ "type": "string",
14321
+ "description": "The member's user id.",
14322
+ "format": "uuid"
14323
+ },
14324
+ "name": {
14325
+ "description": "Their name; null when they have none set.",
14326
+ "type": ["string", "null"]
14327
+ }
14328
+ },
14329
+ "required": [
14330
+ "kind",
14331
+ "user_id",
14332
+ "name"
14333
+ ]
14334
+ }, {
14335
+ "type": "object",
14336
+ "properties": { "kind": {
14337
+ "type": "string",
14338
+ "const": "organization",
14339
+ "description": "Held by no member: an organization key, or one whose holder has left."
14340
+ } },
14341
+ "required": ["kind"]
14342
+ }] },
14343
+ "count": {
14344
+ "type": "integer",
14345
+ "exclusiveMinimum": 0
14346
+ }
14347
+ },
14348
+ "required": ["owner", "count"]
14349
+ },
14350
+ "description": "Webhooks that are sent what it matches: those whose key, as delivery acts as it, lists the rule or its live share (owner: the member who holds that key, or the organization), and the webhooks of the member the rule is shared with (owner: that member)."
14351
+ },
14352
+ "shares": {
14353
+ "type": "array",
14354
+ "items": {
14355
+ "type": "object",
14356
+ "properties": {
14357
+ "beneficiary": {
14358
+ "type": "object",
14359
+ "properties": {
14360
+ "kind": {
14361
+ "type": "string",
14362
+ "const": "member"
14363
+ },
14364
+ "user_id": {
14365
+ "type": "string",
14366
+ "description": "The member's user id.",
14367
+ "format": "uuid"
14368
+ },
14369
+ "name": {
14370
+ "description": "Their name; null when they have none set.",
14371
+ "type": ["string", "null"]
14372
+ }
14373
+ },
14374
+ "required": [
14375
+ "kind",
14376
+ "user_id",
14377
+ "name"
14378
+ ]
14379
+ },
14380
+ "count": {
14381
+ "type": "integer",
14382
+ "exclusiveMinimum": 0
14383
+ }
14384
+ },
14385
+ "required": ["beneficiary", "count"]
14386
+ },
14387
+ "description": "The rule's live share, if it has one (a rule is shared at most once): the member it gives what it matches to."
14388
+ }
14389
+ },
14390
+ "required": [
14391
+ "keys",
14392
+ "webhooks",
14393
+ "shares"
14394
+ ],
14395
+ "description": "Who receives what the rule shares now, by person and count; empty unless it is an active grant rule."
14396
+ }, { "type": "null" }]
14397
+ },
14111
14398
  "created_at": {
14112
14399
  "type": "string",
14113
14400
  "format": "date-time"
@@ -14122,6 +14409,7 @@ const operationManifest = [
14122
14409
  "is_author",
14123
14410
  "covers",
14124
14411
  "current_version",
14412
+ "receivers",
14125
14413
  "created_at"
14126
14414
  ]
14127
14415
  }
@@ -14356,7 +14644,7 @@ const operationManifest = [
14356
14644
  }
14357
14645
  },
14358
14646
  "warnings": {
14359
- "description": "The compile response's warnings. Stored as sent.",
14647
+ "description": "The compile response's warnings. Stored as sent, then any server note they lack on an address or domain the description names that the rule does not test (on a rule request, every compiler note on the rule).",
14360
14648
  "maxItems": 10,
14361
14649
  "type": "array",
14362
14650
  "items": {
@@ -14558,7 +14846,16 @@ const operationManifest = [
14558
14846
  "warnings": {
14559
14847
  "type": "array",
14560
14848
  "items": { "type": "string" },
14561
- "description": "As the member who asked sent them, normally from their compile. The compiler's note that the rule matches nearly everything, in its own wording, counted that member's recent mail: anyone else reads it naming them."
14849
+ "description": "As the member who asked sent them, normally from their compile, then every compiler note on the rule's tree and words they lack. The compiler's note that the rule matches nearly everything, in its own wording, counted that member's recent mail: anyone else reads it naming them."
14850
+ },
14851
+ "server_explanation": {
14852
+ "description": "What the rule as asked actually does: Primitive's own reading of the request's tree, never the words of the member who asked or of a model. Null when the tree no longer reads as one.",
14853
+ "type": ["string", "null"]
14854
+ },
14855
+ "server_notes": {
14856
+ "description": "Primitive's own notes on the rule as asked, worked out from its tree and description each time the request is read, and to the member asked while pending, how to test it on look-alikes. Unlike warnings, never written by the member who asked, though a note can quote their words or tree values.",
14857
+ "type": "array",
14858
+ "items": { "type": "string" }
14562
14859
  },
14563
14860
  "compiled_by": { "type": "string" },
14564
14861
  "vocabulary": { "type": "string" },
@@ -14655,7 +14952,7 @@ const operationManifest = [
14655
14952
  "type": ["boolean", "null"]
14656
14953
  },
14657
14954
  "notice": {
14658
- "description": "For the member asked, while pending: what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
14955
+ "description": "For the member asked, while pending: what the rule actually does (server_explanation), Primitive's warnings, then what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
14659
14956
  "type": ["string", "null"]
14660
14957
  }
14661
14958
  },
@@ -15539,7 +15836,7 @@ const operationManifest = [
15539
15836
  }
15540
15837
  },
15541
15838
  "warnings": {
15542
- "description": "The compile response's warnings. Stored as sent.",
15839
+ "description": "The compile response's warnings. Stored as sent, then any server note they lack on an address or domain the description names that the rule does not test (on a rule request, every compiler note on the rule).",
15543
15840
  "maxItems": 10,
15544
15841
  "type": "array",
15545
15842
  "items": {
@@ -16114,7 +16411,7 @@ const operationManifest = [
16114
16411
  }
16115
16412
  },
16116
16413
  "warnings": {
16117
- "description": "The compile response's warnings. Stored as sent.",
16414
+ "description": "The compile response's warnings. Stored as sent, then any server note they lack on an address or domain the description names that the rule does not test (on a rule request, every compiler note on the rule).",
16118
16415
  "maxItems": 10,
16119
16416
  "type": "array",
16120
16417
  "items": {
@@ -16212,7 +16509,16 @@ const operationManifest = [
16212
16509
  "warnings": {
16213
16510
  "type": "array",
16214
16511
  "items": { "type": "string" },
16215
- "description": "As the member who asked sent them, normally from their compile. The compiler's note that the rule matches nearly everything, in its own wording, counted that member's recent mail: anyone else reads it naming them."
16512
+ "description": "As the member who asked sent them, normally from their compile, then every compiler note on the rule's tree and words they lack. The compiler's note that the rule matches nearly everything, in its own wording, counted that member's recent mail: anyone else reads it naming them."
16513
+ },
16514
+ "server_explanation": {
16515
+ "description": "What the rule as asked actually does: Primitive's own reading of the request's tree, never the words of the member who asked or of a model. Null when the tree no longer reads as one.",
16516
+ "type": ["string", "null"]
16517
+ },
16518
+ "server_notes": {
16519
+ "description": "Primitive's own notes on the rule as asked, worked out from its tree and description each time the request is read, and to the member asked while pending, how to test it on look-alikes. Unlike warnings, never written by the member who asked, though a note can quote their words or tree values.",
16520
+ "type": "array",
16521
+ "items": { "type": "string" }
16216
16522
  },
16217
16523
  "compiled_by": { "type": "string" },
16218
16524
  "vocabulary": { "type": "string" },
@@ -16309,7 +16615,7 @@ const operationManifest = [
16309
16615
  "type": ["boolean", "null"]
16310
16616
  },
16311
16617
  "notice": {
16312
- "description": "For the member asked, while pending: what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
16618
+ "description": "For the member asked, while pending: what the rule actually does (server_explanation), Primitive's warnings, then what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
16313
16619
  "type": ["string", "null"]
16314
16620
  },
16315
16621
  "target_can_accept": {
@@ -16441,7 +16747,16 @@ const operationManifest = [
16441
16747
  "warnings": {
16442
16748
  "type": "array",
16443
16749
  "items": { "type": "string" },
16444
- "description": "As the member who asked sent them, normally from their compile. The compiler's note that the rule matches nearly everything, in its own wording, counted that member's recent mail: anyone else reads it naming them."
16750
+ "description": "As the member who asked sent them, normally from their compile, then every compiler note on the rule's tree and words they lack. The compiler's note that the rule matches nearly everything, in its own wording, counted that member's recent mail: anyone else reads it naming them."
16751
+ },
16752
+ "server_explanation": {
16753
+ "description": "What the rule as asked actually does: Primitive's own reading of the request's tree, never the words of the member who asked or of a model. Null when the tree no longer reads as one.",
16754
+ "type": ["string", "null"]
16755
+ },
16756
+ "server_notes": {
16757
+ "description": "Primitive's own notes on the rule as asked, worked out from its tree and description each time the request is read, and to the member asked while pending, how to test it on look-alikes. Unlike warnings, never written by the member who asked, though a note can quote their words or tree values.",
16758
+ "type": "array",
16759
+ "items": { "type": "string" }
16445
16760
  },
16446
16761
  "compiled_by": { "type": "string" },
16447
16762
  "vocabulary": { "type": "string" },
@@ -16538,7 +16853,7 @@ const operationManifest = [
16538
16853
  "type": ["boolean", "null"]
16539
16854
  },
16540
16855
  "notice": {
16541
- "description": "For the member asked, while pending: what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
16856
+ "description": "For the member asked, while pending: what the rule actually does (server_explanation), Primitive's warnings, then what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
16542
16857
  "type": ["string", "null"]
16543
16858
  }
16544
16859
  },
@@ -17457,7 +17772,16 @@ const operationManifest = [
17457
17772
  "warnings": {
17458
17773
  "type": "array",
17459
17774
  "items": { "type": "string" },
17460
- "description": "As the member who asked sent them, normally from their compile. The compiler's note that the rule matches nearly everything, in its own wording, counted that member's recent mail: anyone else reads it naming them."
17775
+ "description": "As the member who asked sent them, normally from their compile, then every compiler note on the rule's tree and words they lack. The compiler's note that the rule matches nearly everything, in its own wording, counted that member's recent mail: anyone else reads it naming them."
17776
+ },
17777
+ "server_explanation": {
17778
+ "description": "What the rule as asked actually does: Primitive's own reading of the request's tree, never the words of the member who asked or of a model. Null when the tree no longer reads as one.",
17779
+ "type": ["string", "null"]
17780
+ },
17781
+ "server_notes": {
17782
+ "description": "Primitive's own notes on the rule as asked, worked out from its tree and description each time the request is read, and to the member asked while pending, how to test it on look-alikes. Unlike warnings, never written by the member who asked, though a note can quote their words or tree values.",
17783
+ "type": "array",
17784
+ "items": { "type": "string" }
17461
17785
  },
17462
17786
  "compiled_by": { "type": "string" },
17463
17787
  "vocabulary": { "type": "string" },
@@ -17554,7 +17878,7 @@ const operationManifest = [
17554
17878
  "type": ["boolean", "null"]
17555
17879
  },
17556
17880
  "notice": {
17557
- "description": "For the member asked, while pending: what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
17881
+ "description": "For the member asked, while pending: what the rule actually does (server_explanation), Primitive's warnings, then what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
17558
17882
  "type": ["string", "null"]
17559
17883
  }
17560
17884
  },
@@ -18347,7 +18671,16 @@ const operationManifest = [
18347
18671
  "warnings": {
18348
18672
  "type": "array",
18349
18673
  "items": { "type": "string" },
18350
- "description": "As the member who asked sent them, normally from their compile. The compiler's note that the rule matches nearly everything, in its own wording, counted that member's recent mail: anyone else reads it naming them."
18674
+ "description": "As the member who asked sent them, normally from their compile, then every compiler note on the rule's tree and words they lack. The compiler's note that the rule matches nearly everything, in its own wording, counted that member's recent mail: anyone else reads it naming them."
18675
+ },
18676
+ "server_explanation": {
18677
+ "description": "What the rule as asked actually does: Primitive's own reading of the request's tree, never the words of the member who asked or of a model. Null when the tree no longer reads as one.",
18678
+ "type": ["string", "null"]
18679
+ },
18680
+ "server_notes": {
18681
+ "description": "Primitive's own notes on the rule as asked, worked out from its tree and description each time the request is read, and to the member asked while pending, how to test it on look-alikes. Unlike warnings, never written by the member who asked, though a note can quote their words or tree values.",
18682
+ "type": "array",
18683
+ "items": { "type": "string" }
18351
18684
  },
18352
18685
  "compiled_by": { "type": "string" },
18353
18686
  "vocabulary": { "type": "string" },
@@ -18444,7 +18777,7 @@ const operationManifest = [
18444
18777
  "type": ["boolean", "null"]
18445
18778
  },
18446
18779
  "notice": {
18447
- "description": "For the member asked, while pending: what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
18780
+ "description": "For the member asked, while pending: what the rule actually does (server_explanation), Primitive's warnings, then what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
18448
18781
  "type": ["string", "null"]
18449
18782
  }
18450
18783
  },
@@ -18481,7 +18814,7 @@ const operationManifest = [
18481
18814
  "binaryResponse": false,
18482
18815
  "bodyRequired": false,
18483
18816
  "command": "list-email-rule-results",
18484
- "description": "What each rule you can see decided about this email (matched, not matched, or not run), in the words of the deciding version. A do_not_share rule that matched it blocks sharing while active; earlier shares stay. Only a caller who can read the email gets an answer. classification is every fact the classifier read, as rule conditions read it. At most 50 rules are listed, results first; not_listed counts the rest. Another member's rule that decided on your own mail is listed read_only (dashboard and CLI only); hidden counts deciding rules you cannot see. Needs mail:read, a member's own credential with their full access (not an API key, agent key or narrowed token), and the email rules feature.",
18817
+ "description": "What each rule you can see decided about this email (matched, not matched, or not run), in the words of the deciding version. A do_not_share rule that matched it blocks sharing while active; earlier shares stay. Only a caller who can read the email gets an answer. classification is every fact the classifier read, as rule conditions read it. At most 50 rules are listed, results first; not_listed counts the rest. Another member's rule that decided on your own mail is listed read_only (dashboard and CLI only), with who receives what it shares (receivers) while it covers you; hidden counts deciding rules you cannot see. Needs mail:read, a member's own credential with their full access (not an API key, agent key or narrowed token), and the email rules feature.",
18485
18818
  "hasJsonBody": false,
18486
18819
  "method": "GET",
18487
18820
  "operationId": "listEmailRuleResults",
@@ -18734,6 +19067,147 @@ const operationManifest = [
18734
19067
  "name",
18735
19068
  "email"
18736
19069
  ]
19070
+ },
19071
+ "receivers": {
19072
+ "description": "With read_only: who receives what it shares; null unless it covers you now.",
19073
+ "anyOf": [{
19074
+ "type": "object",
19075
+ "properties": {
19076
+ "keys": {
19077
+ "type": "array",
19078
+ "items": {
19079
+ "type": "object",
19080
+ "properties": {
19081
+ "owner": { "anyOf": [{
19082
+ "type": "object",
19083
+ "properties": {
19084
+ "kind": {
19085
+ "type": "string",
19086
+ "const": "member"
19087
+ },
19088
+ "user_id": {
19089
+ "type": "string",
19090
+ "description": "The member's user id.",
19091
+ "format": "uuid"
19092
+ },
19093
+ "name": {
19094
+ "description": "Their name; null when they have none set.",
19095
+ "type": ["string", "null"]
19096
+ }
19097
+ },
19098
+ "required": [
19099
+ "kind",
19100
+ "user_id",
19101
+ "name"
19102
+ ]
19103
+ }, {
19104
+ "type": "object",
19105
+ "properties": { "kind": {
19106
+ "type": "string",
19107
+ "const": "organization",
19108
+ "description": "Held by no member: an organization key, or one whose holder has left."
19109
+ } },
19110
+ "required": ["kind"]
19111
+ }] },
19112
+ "count": {
19113
+ "type": "integer",
19114
+ "exclusiveMinimum": 0
19115
+ }
19116
+ },
19117
+ "required": ["owner", "count"]
19118
+ },
19119
+ "description": "API keys that work now (not revoked, expired or suspended) whose access lists the rule, or its live share: they read what it matches. Owner: the member who holds each, or the organization."
19120
+ },
19121
+ "webhooks": {
19122
+ "type": "array",
19123
+ "items": {
19124
+ "type": "object",
19125
+ "properties": {
19126
+ "owner": { "anyOf": [{
19127
+ "type": "object",
19128
+ "properties": {
19129
+ "kind": {
19130
+ "type": "string",
19131
+ "const": "member"
19132
+ },
19133
+ "user_id": {
19134
+ "type": "string",
19135
+ "description": "The member's user id.",
19136
+ "format": "uuid"
19137
+ },
19138
+ "name": {
19139
+ "description": "Their name; null when they have none set.",
19140
+ "type": ["string", "null"]
19141
+ }
19142
+ },
19143
+ "required": [
19144
+ "kind",
19145
+ "user_id",
19146
+ "name"
19147
+ ]
19148
+ }, {
19149
+ "type": "object",
19150
+ "properties": { "kind": {
19151
+ "type": "string",
19152
+ "const": "organization",
19153
+ "description": "Held by no member: an organization key, or one whose holder has left."
19154
+ } },
19155
+ "required": ["kind"]
19156
+ }] },
19157
+ "count": {
19158
+ "type": "integer",
19159
+ "exclusiveMinimum": 0
19160
+ }
19161
+ },
19162
+ "required": ["owner", "count"]
19163
+ },
19164
+ "description": "Webhooks that are sent what it matches: those whose key, as delivery acts as it, lists the rule or its live share (owner: the member who holds that key, or the organization), and the webhooks of the member the rule is shared with (owner: that member)."
19165
+ },
19166
+ "shares": {
19167
+ "type": "array",
19168
+ "items": {
19169
+ "type": "object",
19170
+ "properties": {
19171
+ "beneficiary": {
19172
+ "type": "object",
19173
+ "properties": {
19174
+ "kind": {
19175
+ "type": "string",
19176
+ "const": "member"
19177
+ },
19178
+ "user_id": {
19179
+ "type": "string",
19180
+ "description": "The member's user id.",
19181
+ "format": "uuid"
19182
+ },
19183
+ "name": {
19184
+ "description": "Their name; null when they have none set.",
19185
+ "type": ["string", "null"]
19186
+ }
19187
+ },
19188
+ "required": [
19189
+ "kind",
19190
+ "user_id",
19191
+ "name"
19192
+ ]
19193
+ },
19194
+ "count": {
19195
+ "type": "integer",
19196
+ "exclusiveMinimum": 0
19197
+ }
19198
+ },
19199
+ "required": ["beneficiary", "count"]
19200
+ },
19201
+ "description": "The rule's live share, if it has one (a rule is shared at most once): the member it gives what it matches to."
19202
+ }
19203
+ },
19204
+ "required": [
19205
+ "keys",
19206
+ "webhooks",
19207
+ "shares"
19208
+ ],
19209
+ "description": "Who receives what the rule shares now, by person and count; empty unless it is an active grant rule."
19210
+ }, { "type": "null" }]
18737
19211
  }
18738
19212
  },
18739
19213
  "required": [
@@ -21142,7 +21616,7 @@ const operationManifest = [
21142
21616
  }
21143
21617
  },
21144
21618
  "warnings": {
21145
- "description": "The compile response's warnings. Stored as sent.",
21619
+ "description": "The compile response's warnings. Stored as sent, then any server note they lack on an address or domain the description names that the rule does not test (on a rule request, every compiler note on the rule).",
21146
21620
  "maxItems": 10,
21147
21621
  "type": "array",
21148
21622
  "items": {
@@ -21986,7 +22460,16 @@ const operationManifest = [
21986
22460
  "warnings": {
21987
22461
  "type": "array",
21988
22462
  "items": { "type": "string" },
21989
- "description": "As the member who asked sent them, normally from their compile. The compiler's note that the rule matches nearly everything, in its own wording, counted that member's recent mail: anyone else reads it naming them."
22463
+ "description": "As the member who asked sent them, normally from their compile, then every compiler note on the rule's tree and words they lack. The compiler's note that the rule matches nearly everything, in its own wording, counted that member's recent mail: anyone else reads it naming them."
22464
+ },
22465
+ "server_explanation": {
22466
+ "description": "What the rule as asked actually does: Primitive's own reading of the request's tree, never the words of the member who asked or of a model. Null when the tree no longer reads as one.",
22467
+ "type": ["string", "null"]
22468
+ },
22469
+ "server_notes": {
22470
+ "description": "Primitive's own notes on the rule as asked, worked out from its tree and description each time the request is read, and to the member asked while pending, how to test it on look-alikes. Unlike warnings, never written by the member who asked, though a note can quote their words or tree values.",
22471
+ "type": "array",
22472
+ "items": { "type": "string" }
21990
22473
  },
21991
22474
  "compiled_by": { "type": "string" },
21992
22475
  "vocabulary": { "type": "string" },
@@ -22083,7 +22566,7 @@ const operationManifest = [
22083
22566
  "type": ["boolean", "null"]
22084
22567
  },
22085
22568
  "notice": {
22086
- "description": "For the member asked, while pending: what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
22569
+ "description": "For the member asked, while pending: what the rule actually does (server_explanation), Primitive's warnings, then what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
22087
22570
  "type": ["string", "null"]
22088
22571
  }
22089
22572
  },
@@ -26627,8 +27110,8 @@ const operationManifest = [
26627
27110
  "description": "HTTP status code returned by the endpoint"
26628
27111
  },
26629
27112
  "body": {
26630
- "type": "string",
26631
- "description": "Response body (truncated to 1000 characters)"
27113
+ "description": "The receiver response text, only with organization-wide mail.raw:read. Null without that access because a receiver can echo a raw download link.",
27114
+ "type": ["string", "null"]
26632
27115
  },
26633
27116
  "signature": {
26634
27117
  "type": "string",
@@ -52645,18 +53128,19 @@ function emptyEmailListHint(input) {
52645
53128
  }
52646
53129
  // src/oclif/endpoint-event-types.ts
52647
53130
  const EVENT_TYPES_FLAG_OPERATIONS = /* @__PURE__ */ new Set(["createEndpoint", "updateEndpoint"]);
52648
- const EVENT_TYPES_FLAG_DESCRIPTION = "Event types this endpoint subscribes to, comma separated or repeated (sets rules.event_types). Omitting the subscription means every event type except the opt-in sent_email.* and email_rule_request.* events, which an endpoint receives only when it lists them; sent_email.* and email_rule_request.* each expand to all four. Rule request events can be listed only when the webhook is created, signed in as yourself; such a webhook is yours and always a route target. Keep email.received in the list if the endpoint also handles inbound mail. On update, the endpoint's other rules are kept.";
53131
+ const EVENT_TYPES_FLAG_DESCRIPTION = "Event types this endpoint subscribes to, comma separated or repeated (sets rules.event_types). Omitting the subscription means every event type except the opt-in sent_email.*, email_rule_request.* and email_rule_objection.* events, which an endpoint receives only when it lists them; each of those shorthands expands to all four. Rule request and objection events can be listed only when the webhook is created, signed in as yourself; such a webhook is yours and always a route target. Keep email.received in the list if the endpoint also handles inbound mail. On update, the endpoint's other rules are kept.";
52649
53132
  /** Shorthands the CLI expands, since the server would store them as literals that match nothing. */
52650
53133
  const WILDCARDS = {
52651
53134
  "sent_email.*": SENT_EMAIL_EVENT_TYPES,
52652
- "email_rule_request.*": EMAIL_RULE_REQUEST_EVENT_TYPES
53135
+ "email_rule_request.*": EMAIL_RULE_REQUEST_EVENT_TYPES,
53136
+ "email_rule_objection.*": EMAIL_RULE_OBJECTION_EVENT_TYPES
52653
53137
  };
52654
53138
  const KNOWN_EVENT_TYPES = new Set(WEBHOOK_EVENT_TYPES);
52655
53139
  var EventTypesFlagError = class extends Error {};
52656
53140
  /**
52657
53141
  * Turn the raw `--event-types` values into the list to store: split on
52658
- * commas, trim, expand `sent_email.*` and `email_rule_request.*`, and drop duplicates while keeping the
52659
- * order the caller gave.
53142
+ * commas, trim, expand the shorthands in WILDCARDS, and drop duplicates while
53143
+ * keeping the order the caller gave.
52660
53144
  */
52661
53145
  function parseEventTypesFlag(values) {
52662
53146
  const out = [];
@@ -52671,7 +53155,7 @@ function parseEventTypesFlag(values) {
52671
53155
  out.push(entry);
52672
53156
  }
52673
53157
  }
52674
- if (out.length === 0) throw new EventTypesFlagError("--event-types needs at least one event type. To receive every event type except the opt-in sent_email.* and email_rule_request.* events, omit the subscription instead.");
53158
+ if (out.length === 0) throw new EventTypesFlagError("--event-types needs at least one event type. To receive every event type except the opt-in sent_email.*, email_rule_request.* and email_rule_objection.* events, omit the subscription instead.");
52675
53159
  if (out.length > 50) throw new EventTypesFlagError(`--event-types accepts at most 50 event types (got ${out.length}).`);
52676
53160
  return out;
52677
53161
  }
@@ -54574,7 +55058,7 @@ function savedConnectedProfiles(configDir, exclude) {
54574
55058
  */
54575
55059
  async function otherProfiles(configDir, session, current) {
54576
55060
  if (session) try {
54577
- const { connectedProfilesForSession } = await import("./machine-session-CI8tnGzz.js").then((n) => n.s);
55061
+ const { connectedProfilesForSession } = await import("./machine-session-D39TUEGF.js").then((n) => n.s);
54578
55062
  return {
54579
55063
  inSession: true,
54580
55064
  profiles: connectedProfilesForSession(configDir, session, current)
@@ -54648,24 +55132,25 @@ async function explainPendingMailNotFound(configDir, emailId, write = (line) =>
54648
55132
  if (outcome.kind === "dropped") write(`Dropped the pending notice for ${id} from profile ${current.profile} after ${outcome.reads} consecutive not_found reads; the email is no longer visible to this profile.\n`);
54649
55133
  } catch {}
54650
55134
  }
54651
- const RULE_REQUEST_WEBHOOK_CREATE_HINT = "Hint: a webhook for rule request events is made by the person it is for, signed in as themself: after `primitive login`, run this without --api-key, PRIMITIVE_API_KEY or PRIMITIVE_AGENT_PROFILE set, or create it in the dashboard. An API key, another app or an agent cannot make one. If you are already signed in as yourself, try again. It is a route target whatever your access, so it never takes a domain's or the organization's default slot.";
54652
- const RULE_REQUEST_WEBHOOK_HTTP_HINT = "Hint: rule request events go only to an http webhook (kind http).";
54653
- const RULE_REQUEST_WEBHOOK_SUBSCRIBE_HINT = "Hint: rule request events go only to a webhook made for them. If this webhook does not list them yet, it cannot be given them: create a new one with `--event-types 'email_rule_request.*'`, signed in as yourself. If it does, only its maker, signed in as themself, can change it.";
54654
- const RULE_REQUEST_WEBHOOK_KEY_HINT = "Hint: a webhook for rule request events is made by the person it is for, signed in as themself, and stays theirs: it cannot be given to an API key.";
54655
- const RULE_REQUEST_WEBHOOK_CHANGE_HINT = "Hint: only the person who made a webhook for rule request events, signed in as themself (not with an API key, another app or an agent), can change it. It can be deleted as any other webhook can.";
54656
- const RULE_REQUEST_WEBHOOK_DEFAULT_HINT = "Hint: a webhook for rule request events is always a route target. Leave out --no-is-route-target, --takeover and --no-takeover (is_route_target: false and takeover in a raw body).";
54657
- const RULE_REQUEST_EVENT_PREFIX = "email_rule_request.";
55135
+ const RULE_REQUEST_WEBHOOK_CREATE_HINT = "Hint: a webhook for rule request or objection events is made by the person it is for, signed in as themself: after `primitive login`, run this without --api-key, PRIMITIVE_API_KEY or PRIMITIVE_AGENT_PROFILE set, or create it in the dashboard. An API key, another app or an agent cannot make one. If you are already signed in as yourself, try again. It is a route target whatever your access, so it never takes a domain's or the organization's default slot.";
55136
+ const RULE_REQUEST_WEBHOOK_HTTP_HINT = "Hint: rule request and objection events go only to an http webhook (kind http).";
55137
+ const RULE_REQUEST_WEBHOOK_SUBSCRIBE_HINT = "Hint: rule request and objection events go only to a webhook made for them. If this webhook does not list them yet, it cannot be given them: create a new one with `--event-types` naming them (such as 'email_rule_request.*' or 'email_rule_objection.*'), signed in as yourself. If it does, only its maker, signed in as themself, can change it.";
55138
+ const RULE_REQUEST_WEBHOOK_KEY_HINT = "Hint: a webhook for rule request or objection events is made by the person it is for, signed in as themself, and stays theirs: it cannot be given to an API key.";
55139
+ const RULE_REQUEST_WEBHOOK_CHANGE_HINT = "Hint: only the person who made a webhook for rule request or objection events, signed in as themself (not with an API key, another app or an agent), can change it. It can be deleted as any other webhook can.";
55140
+ const RULE_REQUEST_WEBHOOK_DEFAULT_HINT = "Hint: a webhook for rule request or objection events is always a route target. Leave out --no-is-route-target, --takeover and --no-takeover (is_route_target: false and takeover in a raw body).";
55141
+ /** The event families, of those this CLI lists, that the API keeps to a webhook its person made for them, matched by prefix as the API matches them. */
55142
+ const MEMBER_EVENT_PREFIXES = ["email_rule_request.", "email_rule_objection."];
54658
55143
  function record(value) {
54659
55144
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
54660
55145
  }
54661
55146
  /**
54662
- * Whether a create or update body lists any rule request event. Matched by
54663
- * prefix, as the API matches it, so a raw body's literal
54664
- * `email_rule_request.*` counts too.
55147
+ * Whether a create or update body lists any rule request or objection
55148
+ * event. Matched by prefix, as the API matches it, so a raw body's
55149
+ * literal `email_rule_request.*` counts too.
54665
55150
  */
54666
55151
  function listsRuleRequestEvents(body) {
54667
55152
  const types = record(record(body)?.rules)?.event_types;
54668
- return Array.isArray(types) && types.some((t) => typeof t === "string" && t.startsWith(RULE_REQUEST_EVENT_PREFIX));
55153
+ return Array.isArray(types) && types.some((t) => typeof t === "string" && MEMBER_EVENT_PREFIXES.some((prefix) => t.startsWith(prefix)));
54669
55154
  }
54670
55155
  function refusalReason(payload) {
54671
55156
  const top = record(payload);
@@ -55971,7 +56456,7 @@ function createOperationCommand(operation) {
55971
56456
  ...tail ? { pastFlag: "--since" } : query.cursor !== void 0 ? { pastFlag: "--cursor" } : {},
55972
56457
  nextCursor: tail ? null : more,
55973
56458
  caller: tail || more ? null : await readCallerMailFor(auth, apiClient.client)
55974
- }) : emptyRuleListHint(operation.sdkName, query) ?? EMPTY_RESULT_HINTS[operation.sdkName];
56459
+ }) : emptyRuleListHint(operation.sdkName, query) ?? emptyDeliveriesHint(operation.sdkName, query) ?? EMPTY_RESULT_HINTS[operation.sdkName];
55975
56460
  if (hint && jsonOutput) summary.push(hint);
55976
56461
  else if (hint) process.stderr.write(`${hint}\n`);
55977
56462
  }
@@ -56078,6 +56563,20 @@ function emptyRuleListHint(sdkName, query) {
56078
56563
  return said("objections", box && status ? "pending objections you made" : box ? "objections you made" : status ? "pending objections" : null, [...box ? ["--box all"] : [], ...status ? ["--status any"] : []]);
56079
56564
  }
56080
56565
  }
56566
+ /**
56567
+ * An empty delivery list narrowed by a filter (--endpoint-id, --status,
56568
+ * --event-type and the rest) names the filters given, in place of the general
56569
+ * hint, which reads as if nothing was ever delivered, and keeps its point that
56570
+ * test fires are not logged. Undefined for any other list, or when no filter
56571
+ * was given.
56572
+ */
56573
+ function emptyDeliveriesHint(sdkName, query) {
56574
+ if (sdkName !== "listDeliveries") return void 0;
56575
+ const flags = listFilters(query).map((name) => `--${parameterFlagName(sdkName, name)}`);
56576
+ if (flags.length === 0) return void 0;
56577
+ if (query.cursor !== void 0) return "(no results) No more deliveries match these filters.";
56578
+ return `(no results) No deliveries match ${flags.length === 1 ? flags[0] : `${flags.slice(0, -1).join(", ")} and ${flags[flags.length - 1]}`}. Test fires from \`primitive endpoints test\` are not logged here; real deliveries are, when an event fans out to the endpoint. Leave out ${flags.length === 1 ? flags[0] : "a filter"} to list more.`;
56579
+ }
56081
56580
  function canonicalizeCliReferences(description) {
56082
56581
  return description.replaceAll("`primitive emails:latest`", "`primitive emails latest`").replaceAll("`primitive describe emails:get-email | jq '.responseSchema.properties'`", "`primitive describe emails:get | jq '.responseSchema.properties'`");
56083
56582
  }