@primitivedotdev/cli 3.0.0-preview.16 → 3.0.0-preview.17

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 { $t as getOwnGrant, B as awaitingRejectedError, G as isAwaitingRejectedError, J as EMAIL_RULE_OBJECTION_EVENT_TYPES, R as ReplyStateUnsupportedError, V as ensureSearchReportsReplyState, Wt as getEmail, X as SENT_EMAIL_EVENT_TYPES, Y as EMAIL_RULE_REQUEST_EVENT_TYPES, Z as WEBHOOK_EVENT_TYPES, at as AutomatedFilterUnsupportedError, ct as automatedSurfaceForOperation, ft as isAutomatedRejectedError, lt as ensureSearchReportsAutomated, ot as assertAutomatedVerdict, q as replyStateSurfaceForOperation, qn as sdk_gen_exports, rn as getThread, st as automatedRejectedError, ut as expectedAutomatedVerdicts, y as parseRetryAfter, yn as listEndpoints, z as assertAwaitingFilterRows } from "./repeats-Dj_o6c-X-BLUY-8zn.js";
1
+ import { $t as getOwnGrant, B as awaitingRejectedError, G as isAwaitingRejectedError, J as EMAIL_RULE_OBJECTION_EVENT_TYPES, R as ReplyStateUnsupportedError, V as ensureSearchReportsReplyState, Wt as getEmail, X as SENT_EMAIL_EVENT_TYPES, Y as EMAIL_RULE_REQUEST_EVENT_TYPES, Z as WEBHOOK_EVENT_TYPES, at as AutomatedFilterUnsupportedError, ct as automatedSurfaceForOperation, ft as isAutomatedRejectedError, lt as ensureSearchReportsAutomated, ot as assertAutomatedVerdict, q as replyStateSurfaceForOperation, qn as sdk_gen_exports, rn as getThread, st as automatedRejectedError, ut as expectedAutomatedVerdicts, y as parseRetryAfter, yn as listEndpoints, z as assertAwaitingFilterRows } from "./repeats-Dj_o6c-X-DlfpQiUq.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. 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, saved a new version, or changed who receives its matches 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. Notices are written by a periodic job and can lag: until the notices record a rule starting to cover you, the first page lists that rule as pending (pending_complete says whether that check finished), and as_of says about when the notices last looked. For what covers you now, read GET /email-rules/covering-me.",
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, saved a new version while covering it, or stopped 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. Notices are written by a periodic job and can lag: until the notices record a rule starting to cover you, the first page lists that rule as pending (pending_complete says whether that check finished), and as_of says about when the notices last looked. For what covers you now, read GET /email-rules/covering-me.",
784
784
  "hasJsonBody": false,
785
785
  "method": "GET",
786
786
  "operationId": "listActivityObjects",
@@ -858,12 +858,12 @@ const operationManifest = [
858
858
  },
859
859
  "id": { "type": "string" },
860
860
  "name": {
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.",
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 (for a stopped notice, when you were last told of it, or while it last covered you). Never a webhook URL and never mail content.",
862
862
  "type": ["string", "null"]
863
863
  },
864
864
  "state": {
865
865
  "type": "string",
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 was made or turned active over your mailboxes, or an active rule came to reach you; once per rule, not per mailbox), new_version, receivers_changed (who receives an active rule's matches changed: its keys, webhooks or share), or baseline (it already covered you when notices began). pending: a rule started covering your mailbox and the notices have not recorded that start yet (a restart within an hour of the last start notice is recorded without a new one); its id is then the rule's, and created_at when the rule last changed."
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; an objection may also be amended), and for a coverage notice what it told: started (a rule was made or turned active over your mailboxes, or an active rule came to reach you; once per rule, not per mailbox), new_version, stopped (it no longer covers you, why in stop_reason), or baseline (it already covered you when notices began). pending: a rule started covering your mailbox and the notices have not recorded that start yet (a restart within an hour of the last start notice, or within 5 minutes of the notices finding the rule stopped, is recorded without a new one, unless you were told it stopped since); its id is then the rule's, and created_at when the rule last changed."
867
867
  },
868
868
  "created_at": {
869
869
  "type": "string",
@@ -872,7 +872,7 @@ const operationManifest = [
872
872
  "ended_at": {
873
873
  "type": ["string", "null"],
874
874
  "format": "date-time",
875
- "description": "When it was deleted, replaced or revoked, when an API key expired, when a repeating send stopped, or when a rule request or objection was decided (accepted, declined or withdrawn); null otherwise, as on every coverage notice (rule_now marks one whose rule was deleted)."
875
+ "description": "When it was deleted, replaced or revoked, when an API key expired, when a repeating send stopped, or when a rule request or objection was decided (accepted, declined, withdrawn or, for an objection, amended); null otherwise, as on every coverage notice (rule_now marks one whose rule was deleted)."
876
876
  },
877
877
  "owned_now": {
878
878
  "type": "string",
@@ -973,6 +973,15 @@ const operationManifest = [
973
973
  }
974
974
  },
975
975
  "required": ["before", "after"]
976
+ },
977
+ "stop_reason": {
978
+ "description": "For a stopped notice: deleted, turned_off (no longer active), or no_longer_covers (active, reaching none of your mailboxes now).",
979
+ "type": "string",
980
+ "enum": [
981
+ "deleted",
982
+ "turned_off",
983
+ "no_longer_covers"
984
+ ]
976
985
  }
977
986
  },
978
987
  "required": [
@@ -1019,7 +1028,7 @@ const operationManifest = [
1019
1028
  "as_of": {
1020
1029
  "type": ["string", "null"],
1021
1030
  "format": "date-time",
1022
- "description": "With relation=concerning only: about when the notices last looked at your organization; null if never or unread. Coverage since may have no notice yet. They look only while one of its rules could cover someone, so this stops moving while none could."
1031
+ "description": "With relation=concerning only: about when the notices last looked at your organization; null if never or unread. Coverage since may have no notice yet. They look only while one of its rules could cover someone, or a stopped notice is still to be told, so this stops moving while neither."
1023
1032
  },
1024
1033
  "pending_complete": {
1025
1034
  "description": "With relation=concerning, on the first page only: whether the check for rules that started covering you without their start notice (state pending, listed ahead of the notices and beyond limit) was finished. false: some may be missing. Absent where there is nothing to check.",
@@ -9366,6 +9375,7 @@ const operationManifest = [
9366
9375
  "items": { "type": "string" }
9367
9376
  },
9368
9377
  "rules": {
9378
+ "description": "Email rule ids: the key also reads the emails these rules granted. An address listed beside them is read in full, so rules beside a domain, a retired address or the address of a member other than the key's holder (its creator, or whoever it was transferred to) are refused (400 validation_error, details.reason rules_beside_domain or rules_beside_personal_mailbox). A rule shared with you goes here by its share's id, from your dashboard session only.",
9369
9379
  "maxItems": 20,
9370
9380
  "type": "array",
9371
9381
  "items": { "type": "string" }
@@ -11238,6 +11248,7 @@ const operationManifest = [
11238
11248
  "items": { "type": "string" }
11239
11249
  },
11240
11250
  "rules": {
11251
+ "description": "Email rule ids: the key also reads the emails these rules granted. An address listed beside them is read in full, so rules beside a domain, a retired address or the address of a member other than the key's holder (its creator, or whoever it was transferred to) are refused (400 validation_error, details.reason rules_beside_domain or rules_beside_personal_mailbox). A rule shared with you goes here by its share's id, from your dashboard session only.",
11241
11252
  "maxItems": 20,
11242
11253
  "type": "array",
11243
11254
  "items": { "type": "string" }
@@ -13607,9 +13618,10 @@ const operationManifest = [
13607
13618
  "pending",
13608
13619
  "accepted",
13609
13620
  "declined",
13610
- "withdrawn"
13621
+ "withdrawn",
13622
+ "amended"
13611
13623
  ],
13612
- "description": "pending until the rule's author accepts it (turning the rule off) or declines it, or the member who made it withdraws it; never changes after."
13624
+ "description": "pending until the rule's author accepts it (turning the rule off), declines it, or answers it amended (they saved a newer version of the rule), or the member who made it withdraws it; never changes after."
13613
13625
  },
13614
13626
  "rule": {
13615
13627
  "type": "object",
@@ -13622,9 +13634,22 @@ const operationManifest = [
13622
13634
  "name": {
13623
13635
  "type": "string",
13624
13636
  "description": "Its name when the objection was made."
13637
+ },
13638
+ "objected_version": {
13639
+ "type": ["integer", "null"],
13640
+ "description": "The rule's version when the objection was made; null when it could not be told for an older objection."
13641
+ },
13642
+ "amended_version": {
13643
+ "type": ["integer", "null"],
13644
+ "description": "The rule's version when its author answered amended; null otherwise."
13625
13645
  }
13626
13646
  },
13627
- "required": ["id", "name"]
13647
+ "required": [
13648
+ "id",
13649
+ "name",
13650
+ "objected_version",
13651
+ "amended_version"
13652
+ ]
13628
13653
  },
13629
13654
  "objector": {
13630
13655
  "type": "object",
@@ -13680,6 +13705,10 @@ const operationManifest = [
13680
13705
  "description": "The author's answer when declining, which the objector sees; null when none was given.",
13681
13706
  "type": ["string", "null"]
13682
13707
  },
13708
+ "amend_note": {
13709
+ "description": "The author's note when answering amended, which the objector sees; null when none was given.",
13710
+ "type": ["string", "null"]
13711
+ },
13683
13712
  "created_at": {
13684
13713
  "type": "string",
13685
13714
  "format": "date-time"
@@ -13703,6 +13732,7 @@ const operationManifest = [
13703
13732
  "is_author",
13704
13733
  "message",
13705
13734
  "decline_reason",
13735
+ "amend_note",
13706
13736
  "created_at",
13707
13737
  "decided_at",
13708
13738
  "decided_by_user_id"
@@ -13713,11 +13743,185 @@ const operationManifest = [
13713
13743
  "tag": "Email Rule Oversight",
13714
13744
  "tagCommand": "email-rule-oversight"
13715
13745
  },
13746
+ {
13747
+ "binaryResponse": false,
13748
+ "bodyRequired": false,
13749
+ "command": "amend-email-rule-objection",
13750
+ "description": "Answers a pending objection to a rule you wrote by saying you changed the rule: save a new version first (PATCH /email-rules/{id}), then answer amended, optionally with a note the member who objected sees. Records the version the rule has now (rule.amended_version). Refused unless the rule's current version is newer than when the objection was made (rule.objected_version). Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
13751
+ "hasJsonBody": true,
13752
+ "method": "POST",
13753
+ "operationId": "amendEmailRuleObjection",
13754
+ "path": "/email-rule-objections/{id}/amend",
13755
+ "pathParams": [{
13756
+ "description": "The objection id.",
13757
+ "enum": null,
13758
+ "name": "id",
13759
+ "required": true,
13760
+ "type": "string"
13761
+ }],
13762
+ "queryParams": [],
13763
+ "headerParams": [{
13764
+ "description": "Optional, and not used to deduplicate: this operation stores no result by the key, so a retry with the same key runs the request again. Operations that need a credential refuse a key that is empty, longer than 255 characters or not printable ASCII with 400 `validation_error` and echo a valid one in the Idempotency-Key response header; operations that need none ignore it.",
13765
+ "enum": null,
13766
+ "name": "Idempotency-Key",
13767
+ "required": false,
13768
+ "type": "string"
13769
+ }],
13770
+ "permissions": ["mail:read"],
13771
+ "access": null,
13772
+ "requestSchema": {
13773
+ "type": "object",
13774
+ "properties": { "note": {
13775
+ "type": ["string", "null"],
13776
+ "minLength": 1,
13777
+ "maxLength": 500,
13778
+ "description": "What you changed, up to 500 characters; null or absent for none. The member who objected sees it."
13779
+ } },
13780
+ "additionalProperties": false
13781
+ },
13782
+ "responseSchema": {
13783
+ "type": "object",
13784
+ "properties": {
13785
+ "id": {
13786
+ "type": "string",
13787
+ "format": "uuid"
13788
+ },
13789
+ "status": {
13790
+ "type": "string",
13791
+ "enum": [
13792
+ "pending",
13793
+ "accepted",
13794
+ "declined",
13795
+ "withdrawn",
13796
+ "amended"
13797
+ ],
13798
+ "description": "pending until the rule's author accepts it (turning the rule off), declines it, or answers it amended (they saved a newer version of the rule), or the member who made it withdraws it; never changes after."
13799
+ },
13800
+ "rule": {
13801
+ "type": "object",
13802
+ "properties": {
13803
+ "id": {
13804
+ "type": ["string", "null"],
13805
+ "format": "uuid",
13806
+ "description": "Null once the rule was deleted outright."
13807
+ },
13808
+ "name": {
13809
+ "type": "string",
13810
+ "description": "Its name when the objection was made."
13811
+ },
13812
+ "objected_version": {
13813
+ "type": ["integer", "null"],
13814
+ "description": "The rule's version when the objection was made; null when it could not be told for an older objection."
13815
+ },
13816
+ "amended_version": {
13817
+ "type": ["integer", "null"],
13818
+ "description": "The rule's version when its author answered amended; null otherwise."
13819
+ }
13820
+ },
13821
+ "required": [
13822
+ "id",
13823
+ "name",
13824
+ "objected_version",
13825
+ "amended_version"
13826
+ ]
13827
+ },
13828
+ "objector": {
13829
+ "type": "object",
13830
+ "properties": {
13831
+ "user_id": {
13832
+ "type": "string",
13833
+ "format": "uuid"
13834
+ },
13835
+ "name": { "type": ["string", "null"] },
13836
+ "email": {
13837
+ "description": "Sign-in email; null unless you can list member emails or this is you.",
13838
+ "type": ["string", "null"]
13839
+ }
13840
+ },
13841
+ "required": [
13842
+ "user_id",
13843
+ "name",
13844
+ "email"
13845
+ ]
13846
+ },
13847
+ "author": {
13848
+ "type": "object",
13849
+ "properties": {
13850
+ "user_id": {
13851
+ "type": "string",
13852
+ "format": "uuid"
13853
+ },
13854
+ "name": { "type": ["string", "null"] },
13855
+ "email": {
13856
+ "description": "Sign-in email; null unless you can list member emails or this is you.",
13857
+ "type": ["string", "null"]
13858
+ }
13859
+ },
13860
+ "required": [
13861
+ "user_id",
13862
+ "name",
13863
+ "email"
13864
+ ]
13865
+ },
13866
+ "is_objector": {
13867
+ "type": "boolean",
13868
+ "description": "Whether you made it, in your current membership."
13869
+ },
13870
+ "is_author": {
13871
+ "type": "boolean",
13872
+ "description": "Whether it is to a rule you wrote, in your current membership."
13873
+ },
13874
+ "message": {
13875
+ "description": "Why they object and what they ask (to turn the rule off, narrow it, or explain who receives it); null when none was given, or once withdrawn.",
13876
+ "type": ["string", "null"]
13877
+ },
13878
+ "decline_reason": {
13879
+ "description": "The author's answer when declining, which the objector sees; null when none was given.",
13880
+ "type": ["string", "null"]
13881
+ },
13882
+ "amend_note": {
13883
+ "description": "The author's note when answering amended, which the objector sees; null when none was given.",
13884
+ "type": ["string", "null"]
13885
+ },
13886
+ "created_at": {
13887
+ "type": "string",
13888
+ "format": "date-time"
13889
+ },
13890
+ "decided_at": {
13891
+ "type": ["string", "null"],
13892
+ "format": "date-time"
13893
+ },
13894
+ "decided_by_user_id": {
13895
+ "type": ["string", "null"],
13896
+ "format": "uuid"
13897
+ }
13898
+ },
13899
+ "required": [
13900
+ "id",
13901
+ "status",
13902
+ "rule",
13903
+ "objector",
13904
+ "author",
13905
+ "is_objector",
13906
+ "is_author",
13907
+ "message",
13908
+ "decline_reason",
13909
+ "amend_note",
13910
+ "created_at",
13911
+ "decided_at",
13912
+ "decided_by_user_id"
13913
+ ]
13914
+ },
13915
+ "sdkName": "amendEmailRuleObjection",
13916
+ "summary": "Answer an objection to your rule as amended",
13917
+ "tag": "Email Rule Oversight",
13918
+ "tagCommand": "email-rule-oversight"
13919
+ },
13716
13920
  {
13717
13921
  "binaryResponse": false,
13718
13922
  "bodyRequired": true,
13719
13923
  "command": "create-email-rule-objection",
13720
- "description": "Objects to a rule that covers one of your own mailboxes now: say in the message what you ask its author, to turn it off, narrow it, or explain who receives what it matches. The author answers by accepting, which turns it off, or by declining, optionally with a reason you see; the rule keeps running unless they accept. Only a rule that covers you now: one you see only because it once decided on your mail cannot be objected to. An objection is seen by the member who made it, the rule's author and the organization's owners and admins. It stays pending until the rule's author accepts it, turning the rule off, or declines it (optionally with a reason the objector sees), or the member who made it withdraws it, which clears its message. It never changes after that. You may have one pending objection per rule and 50 in all, and object to the same rule again only 10 minutes after you last did, whatever became of it. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
13924
+ "description": "Objects to a rule that covers one of your own mailboxes now: say in the message what you ask its author, to turn it off, narrow it, or explain who receives what it matches. The author answers by accepting, which turns it off, or by declining, optionally with a reason you see; the rule keeps running unless they accept. Only a rule that covers you now: one you see only because it once decided on your mail cannot be objected to. An objection is seen by the member who made it, the rule's author and the organization's owners and admins. It stays pending until the rule's author accepts it, turning the rule off, declines it (optionally with a reason the objector sees), or answers it amended once they have saved a newer version of the rule, or the member who made it withdraws it, which clears its message (not from an email to the author already sent or being sent). It never changes after that. You may have one pending objection per rule and 50 in all, and object to the same rule again only 10 minutes after you last did, whatever became of it. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
13721
13925
  "hasJsonBody": true,
13722
13926
  "method": "POST",
13723
13927
  "operationId": "createEmailRuleObjection",
@@ -13745,7 +13949,7 @@ const operationManifest = [
13745
13949
  "type": ["string", "null"],
13746
13950
  "minLength": 1,
13747
13951
  "maxLength": 500,
13748
- "description": "Why you object and what you ask, up to 500 characters: to turn the rule off, to narrow it, or to explain who receives what it matches. Null or absent for none. The rule's author and the organization's owners and admins see it while it stands; withdrawing clears it."
13952
+ "description": "Why you object and what you ask, up to 500 characters: to turn the rule off, to narrow it, or to explain who receives what it matches. Null or absent for none. The rule's author and the organization's owners and admins see it while it stands, and an email to the author about the objection quotes it. Withdrawing clears it from the objection, not from an email already sent or being sent."
13749
13953
  }
13750
13954
  },
13751
13955
  "required": ["rule_id"],
@@ -13764,9 +13968,10 @@ const operationManifest = [
13764
13968
  "pending",
13765
13969
  "accepted",
13766
13970
  "declined",
13767
- "withdrawn"
13971
+ "withdrawn",
13972
+ "amended"
13768
13973
  ],
13769
- "description": "pending until the rule's author accepts it (turning the rule off) or declines it, or the member who made it withdraws it; never changes after."
13974
+ "description": "pending until the rule's author accepts it (turning the rule off), declines it, or answers it amended (they saved a newer version of the rule), or the member who made it withdraws it; never changes after."
13770
13975
  },
13771
13976
  "rule": {
13772
13977
  "type": "object",
@@ -13779,9 +13984,22 @@ const operationManifest = [
13779
13984
  "name": {
13780
13985
  "type": "string",
13781
13986
  "description": "Its name when the objection was made."
13987
+ },
13988
+ "objected_version": {
13989
+ "type": ["integer", "null"],
13990
+ "description": "The rule's version when the objection was made; null when it could not be told for an older objection."
13991
+ },
13992
+ "amended_version": {
13993
+ "type": ["integer", "null"],
13994
+ "description": "The rule's version when its author answered amended; null otherwise."
13782
13995
  }
13783
13996
  },
13784
- "required": ["id", "name"]
13997
+ "required": [
13998
+ "id",
13999
+ "name",
14000
+ "objected_version",
14001
+ "amended_version"
14002
+ ]
13785
14003
  },
13786
14004
  "objector": {
13787
14005
  "type": "object",
@@ -13837,6 +14055,10 @@ const operationManifest = [
13837
14055
  "description": "The author's answer when declining, which the objector sees; null when none was given.",
13838
14056
  "type": ["string", "null"]
13839
14057
  },
14058
+ "amend_note": {
14059
+ "description": "The author's note when answering amended, which the objector sees; null when none was given.",
14060
+ "type": ["string", "null"]
14061
+ },
13840
14062
  "created_at": {
13841
14063
  "type": "string",
13842
14064
  "format": "date-time"
@@ -13860,6 +14082,7 @@ const operationManifest = [
13860
14082
  "is_author",
13861
14083
  "message",
13862
14084
  "decline_reason",
14085
+ "amend_note",
13863
14086
  "created_at",
13864
14087
  "decided_at",
13865
14088
  "decided_by_user_id"
@@ -13874,7 +14097,7 @@ const operationManifest = [
13874
14097
  "binaryResponse": false,
13875
14098
  "bodyRequired": false,
13876
14099
  "command": "decline-email-rule-objection",
13877
- "description": "Declines a pending objection to a rule you wrote, optionally saying why (reason), which the member who objected sees; the rule stays as it is. When its message asks you to narrow the rule or explain who receives it, the reason is your answer; narrow it with a new version as well if you agree. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
14100
+ "description": "Declines a pending objection to a rule you wrote, optionally saying why (reason), which the member who objected sees; the rule stays as it is. When its message asks you to explain who receives what the rule matches, the reason is your answer. If you changed the rule instead, answer amended. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
13878
14101
  "hasJsonBody": true,
13879
14102
  "method": "POST",
13880
14103
  "operationId": "declineEmailRuleObjection",
@@ -13902,7 +14125,7 @@ const operationManifest = [
13902
14125
  "type": ["string", "null"],
13903
14126
  "minLength": 1,
13904
14127
  "maxLength": 500,
13905
- "description": "Why you are declining, up to 500 characters; null or absent for none. The member who objected sees it: it is how to answer one that asks you to narrow the rule or explain who receives it."
14128
+ "description": "Why you are declining, up to 500 characters; null or absent for none. The member who objected sees it: it is how to answer one that asks you to explain who receives it. If you changed the rule instead, answer amended."
13906
14129
  } },
13907
14130
  "additionalProperties": false
13908
14131
  },
@@ -13919,9 +14142,10 @@ const operationManifest = [
13919
14142
  "pending",
13920
14143
  "accepted",
13921
14144
  "declined",
13922
- "withdrawn"
14145
+ "withdrawn",
14146
+ "amended"
13923
14147
  ],
13924
- "description": "pending until the rule's author accepts it (turning the rule off) or declines it, or the member who made it withdraws it; never changes after."
14148
+ "description": "pending until the rule's author accepts it (turning the rule off), declines it, or answers it amended (they saved a newer version of the rule), or the member who made it withdraws it; never changes after."
13925
14149
  },
13926
14150
  "rule": {
13927
14151
  "type": "object",
@@ -13934,9 +14158,22 @@ const operationManifest = [
13934
14158
  "name": {
13935
14159
  "type": "string",
13936
14160
  "description": "Its name when the objection was made."
14161
+ },
14162
+ "objected_version": {
14163
+ "type": ["integer", "null"],
14164
+ "description": "The rule's version when the objection was made; null when it could not be told for an older objection."
14165
+ },
14166
+ "amended_version": {
14167
+ "type": ["integer", "null"],
14168
+ "description": "The rule's version when its author answered amended; null otherwise."
13937
14169
  }
13938
14170
  },
13939
- "required": ["id", "name"]
14171
+ "required": [
14172
+ "id",
14173
+ "name",
14174
+ "objected_version",
14175
+ "amended_version"
14176
+ ]
13940
14177
  },
13941
14178
  "objector": {
13942
14179
  "type": "object",
@@ -13992,6 +14229,10 @@ const operationManifest = [
13992
14229
  "description": "The author's answer when declining, which the objector sees; null when none was given.",
13993
14230
  "type": ["string", "null"]
13994
14231
  },
14232
+ "amend_note": {
14233
+ "description": "The author's note when answering amended, which the objector sees; null when none was given.",
14234
+ "type": ["string", "null"]
14235
+ },
13995
14236
  "created_at": {
13996
14237
  "type": "string",
13997
14238
  "format": "date-time"
@@ -14015,6 +14256,7 @@ const operationManifest = [
14015
14256
  "is_author",
14016
14257
  "message",
14017
14258
  "decline_reason",
14259
+ "amend_note",
14018
14260
  "created_at",
14019
14261
  "decided_at",
14020
14262
  "decided_by_user_id"
@@ -14579,7 +14821,7 @@ const operationManifest = [
14579
14821
  "binaryResponse": false,
14580
14822
  "bodyRequired": false,
14581
14823
  "command": "get-email-rule-objection",
14582
- "description": "One objection you can see. An objection is seen by the member who made it, the rule's author and the organization's owners and admins. It stays pending until the rule's author accepts it, turning the rule off, or declines it (optionally with a reason the objector sees), or the member who made it withdraws it, which clears its message. It never changes after that. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
14824
+ "description": "One objection you can see. An objection is seen by the member who made it, the rule's author and the organization's owners and admins. It stays pending until the rule's author accepts it, turning the rule off, declines it (optionally with a reason the objector sees), or answers it amended once they have saved a newer version of the rule, or the member who made it withdraws it, which clears its message (not from an email to the author already sent or being sent). It never changes after that. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
14583
14825
  "hasJsonBody": false,
14584
14826
  "method": "GET",
14585
14827
  "operationId": "getEmailRuleObjection",
@@ -14609,9 +14851,10 @@ const operationManifest = [
14609
14851
  "pending",
14610
14852
  "accepted",
14611
14853
  "declined",
14612
- "withdrawn"
14854
+ "withdrawn",
14855
+ "amended"
14613
14856
  ],
14614
- "description": "pending until the rule's author accepts it (turning the rule off) or declines it, or the member who made it withdraws it; never changes after."
14857
+ "description": "pending until the rule's author accepts it (turning the rule off), declines it, or answers it amended (they saved a newer version of the rule), or the member who made it withdraws it; never changes after."
14615
14858
  },
14616
14859
  "rule": {
14617
14860
  "type": "object",
@@ -14624,9 +14867,22 @@ const operationManifest = [
14624
14867
  "name": {
14625
14868
  "type": "string",
14626
14869
  "description": "Its name when the objection was made."
14870
+ },
14871
+ "objected_version": {
14872
+ "type": ["integer", "null"],
14873
+ "description": "The rule's version when the objection was made; null when it could not be told for an older objection."
14874
+ },
14875
+ "amended_version": {
14876
+ "type": ["integer", "null"],
14877
+ "description": "The rule's version when its author answered amended; null otherwise."
14627
14878
  }
14628
14879
  },
14629
- "required": ["id", "name"]
14880
+ "required": [
14881
+ "id",
14882
+ "name",
14883
+ "objected_version",
14884
+ "amended_version"
14885
+ ]
14630
14886
  },
14631
14887
  "objector": {
14632
14888
  "type": "object",
@@ -14682,6 +14938,10 @@ const operationManifest = [
14682
14938
  "description": "The author's answer when declining, which the objector sees; null when none was given.",
14683
14939
  "type": ["string", "null"]
14684
14940
  },
14941
+ "amend_note": {
14942
+ "description": "The author's note when answering amended, which the objector sees; null when none was given.",
14943
+ "type": ["string", "null"]
14944
+ },
14685
14945
  "created_at": {
14686
14946
  "type": "string",
14687
14947
  "format": "date-time"
@@ -14705,6 +14965,7 @@ const operationManifest = [
14705
14965
  "is_author",
14706
14966
  "message",
14707
14967
  "decline_reason",
14968
+ "amend_note",
14708
14969
  "created_at",
14709
14970
  "decided_at",
14710
14971
  "decided_by_user_id"
@@ -14795,7 +15056,7 @@ const operationManifest = [
14795
15056
  "question_answers": {
14796
15057
  "type": "array",
14797
15058
  "items": {},
14798
- "description": "The answers to the rule's own questions, when they were asked."
15059
+ "description": "The answers to the rule's own questions, when they were asked: each with question, answer, confidence, the deprecated probability and, when unanswered, error_class, as a test gives them."
14799
15060
  },
14800
15061
  "detail_withheld": {
14801
15062
  "description": "Present, as true, when the email's content cannot be read: matched still says what the rule decided, and parts and question_answers are empty.",
@@ -14842,7 +15103,7 @@ const operationManifest = [
14842
15103
  "binaryResponse": false,
14843
15104
  "bodyRequired": false,
14844
15105
  "command": "list-email-rule-objections",
14845
- "description": "Objections you made and objections to rules you wrote (by default), only one of the two, or every objection you can see, newest first. An objection is seen by the member who made it, the rule's author and the organization's owners and admins. It stays pending until the rule's author accepts it, turning the rule off, or declines it (optionally with a reason the objector sees), or the member who made it withdraws it, which clears its message. It never changes after that. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
15106
+ "description": "Objections you made and objections to rules you wrote (by default), only one of the two, or every objection you can see, newest first. An objection is seen by the member who made it, the rule's author and the organization's owners and admins. It stays pending until the rule's author accepts it, turning the rule off, declines it (optionally with a reason the objector sees), or answers it amended once they have saved a newer version of the rule, or the member who made it withdraws it, which clears its message (not from an email to the author already sent or being sent). It never changes after that. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
14846
15107
  "hasJsonBody": false,
14847
15108
  "method": "GET",
14848
15109
  "operationId": "listEmailRuleObjections",
@@ -14911,9 +15172,10 @@ const operationManifest = [
14911
15172
  "pending",
14912
15173
  "accepted",
14913
15174
  "declined",
14914
- "withdrawn"
15175
+ "withdrawn",
15176
+ "amended"
14915
15177
  ],
14916
- "description": "pending until the rule's author accepts it (turning the rule off) or declines it, or the member who made it withdraws it; never changes after."
15178
+ "description": "pending until the rule's author accepts it (turning the rule off), declines it, or answers it amended (they saved a newer version of the rule), or the member who made it withdraws it; never changes after."
14917
15179
  },
14918
15180
  "rule": {
14919
15181
  "type": "object",
@@ -14926,9 +15188,22 @@ const operationManifest = [
14926
15188
  "name": {
14927
15189
  "type": "string",
14928
15190
  "description": "Its name when the objection was made."
15191
+ },
15192
+ "objected_version": {
15193
+ "type": ["integer", "null"],
15194
+ "description": "The rule's version when the objection was made; null when it could not be told for an older objection."
15195
+ },
15196
+ "amended_version": {
15197
+ "type": ["integer", "null"],
15198
+ "description": "The rule's version when its author answered amended; null otherwise."
14929
15199
  }
14930
15200
  },
14931
- "required": ["id", "name"]
15201
+ "required": [
15202
+ "id",
15203
+ "name",
15204
+ "objected_version",
15205
+ "amended_version"
15206
+ ]
14932
15207
  },
14933
15208
  "objector": {
14934
15209
  "type": "object",
@@ -14984,6 +15259,10 @@ const operationManifest = [
14984
15259
  "description": "The author's answer when declining, which the objector sees; null when none was given.",
14985
15260
  "type": ["string", "null"]
14986
15261
  },
15262
+ "amend_note": {
15263
+ "description": "The author's note when answering amended, which the objector sees; null when none was given.",
15264
+ "type": ["string", "null"]
15265
+ },
14987
15266
  "created_at": {
14988
15267
  "type": "string",
14989
15268
  "format": "date-time"
@@ -15007,6 +15286,7 @@ const operationManifest = [
15007
15286
  "is_author",
15008
15287
  "message",
15009
15288
  "decline_reason",
15289
+ "amend_note",
15010
15290
  "created_at",
15011
15291
  "decided_at",
15012
15292
  "decided_by_user_id"
@@ -15625,7 +15905,7 @@ const operationManifest = [
15625
15905
  "binaryResponse": false,
15626
15906
  "bodyRequired": false,
15627
15907
  "command": "withdraw-email-rule-objection",
15628
- "description": "Withdraws a pending objection you made, and clears its message. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
15908
+ "description": "Withdraws a pending objection you made, and clears its message; an email to the rule's author already sent or being sent keeps it. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
15629
15909
  "hasJsonBody": false,
15630
15910
  "method": "POST",
15631
15911
  "operationId": "withdrawEmailRuleObjection",
@@ -15661,9 +15941,10 @@ const operationManifest = [
15661
15941
  "pending",
15662
15942
  "accepted",
15663
15943
  "declined",
15664
- "withdrawn"
15944
+ "withdrawn",
15945
+ "amended"
15665
15946
  ],
15666
- "description": "pending until the rule's author accepts it (turning the rule off) or declines it, or the member who made it withdraws it; never changes after."
15947
+ "description": "pending until the rule's author accepts it (turning the rule off), declines it, or answers it amended (they saved a newer version of the rule), or the member who made it withdraws it; never changes after."
15667
15948
  },
15668
15949
  "rule": {
15669
15950
  "type": "object",
@@ -15676,9 +15957,22 @@ const operationManifest = [
15676
15957
  "name": {
15677
15958
  "type": "string",
15678
15959
  "description": "Its name when the objection was made."
15960
+ },
15961
+ "objected_version": {
15962
+ "type": ["integer", "null"],
15963
+ "description": "The rule's version when the objection was made; null when it could not be told for an older objection."
15964
+ },
15965
+ "amended_version": {
15966
+ "type": ["integer", "null"],
15967
+ "description": "The rule's version when its author answered amended; null otherwise."
15679
15968
  }
15680
15969
  },
15681
- "required": ["id", "name"]
15970
+ "required": [
15971
+ "id",
15972
+ "name",
15973
+ "objected_version",
15974
+ "amended_version"
15975
+ ]
15682
15976
  },
15683
15977
  "objector": {
15684
15978
  "type": "object",
@@ -15734,6 +16028,10 @@ const operationManifest = [
15734
16028
  "description": "The author's answer when declining, which the objector sees; null when none was given.",
15735
16029
  "type": ["string", "null"]
15736
16030
  },
16031
+ "amend_note": {
16032
+ "description": "The author's note when answering amended, which the objector sees; null when none was given.",
16033
+ "type": ["string", "null"]
16034
+ },
15737
16035
  "created_at": {
15738
16036
  "type": "string",
15739
16037
  "format": "date-time"
@@ -15757,6 +16055,7 @@ const operationManifest = [
15757
16055
  "is_author",
15758
16056
  "message",
15759
16057
  "decline_reason",
16058
+ "amend_note",
15760
16059
  "created_at",
15761
16060
  "decided_at",
15762
16061
  "decided_by_user_id"
@@ -16369,6 +16668,44 @@ const operationManifest = [
16369
16668
  "description": "True when the rule is active and the share live but new email is not being shared now (what was shared stays visible); false when new email is shared. Null when it does not apply (share not live, rule not active, or you are not on the share) or could not be read.",
16370
16669
  "type": ["boolean", "null"]
16371
16670
  },
16671
+ "activity": {
16672
+ "description": "For the member it is shared with, on the dashboard or the Primitive CLI, while it is live and their access reads content: whether it is working, so a quiet mailbox can be told from a stopped share. Null otherwise.",
16673
+ "anyOf": [{
16674
+ "type": "object",
16675
+ "properties": {
16676
+ "rule_active": {
16677
+ "type": "boolean",
16678
+ "description": "Whether the rule is active now: only an active rule shares."
16679
+ },
16680
+ "last_decided_at": {
16681
+ "type": ["string", "null"],
16682
+ "format": "date-time",
16683
+ "description": "The start of the hour in which the rule last decided on any email in the sharing member's mailboxes since the share began, counting only hours that have ended and the hour of the newest email shared; null if none, or not read."
16684
+ },
16685
+ "shared_emails": {
16686
+ "type": ["integer", "null"],
16687
+ "minimum": 0,
16688
+ "description": "Emails this share has shared, counted up to 10,000; null when these could not be read."
16689
+ },
16690
+ "shared_emails_more": {
16691
+ "description": "Present when it has shared more than 10,000.",
16692
+ "type": "boolean",
16693
+ "const": true
16694
+ },
16695
+ "last_shared_at": {
16696
+ "type": ["string", "null"],
16697
+ "format": "date-time",
16698
+ "description": "When it last shared one; null if it has not, or not read."
16699
+ }
16700
+ },
16701
+ "required": [
16702
+ "rule_active",
16703
+ "last_decided_at",
16704
+ "shared_emails",
16705
+ "last_shared_at"
16706
+ ]
16707
+ }, { "type": "null" }]
16708
+ },
16372
16709
  "is_granter": {
16373
16710
  "type": "boolean",
16374
16711
  "description": "Whether you are the member sharing their mail."
@@ -16458,7 +16795,7 @@ const operationManifest = [
16458
16795
  "rule_id": {
16459
16796
  "type": ["string", "null"],
16460
16797
  "format": "uuid",
16461
- "description": "The rule itself. Only for the member sharing their mail; null for anyone else."
16798
+ "description": "The rule itself. Only for the member sharing their mail; null for anyone else. The member it is shared with lists this share's id in a key's grant.rules instead (from the dashboard), and their own webhooks receive what it shares."
16462
16799
  }
16463
16800
  },
16464
16801
  "required": [
@@ -19049,7 +19386,15 @@ const operationManifest = [
19049
19386
  "properties": {
19050
19387
  "question": { "type": "string" },
19051
19388
  "answer": { "type": ["boolean", "null"] },
19052
- "probability": { "type": ["number", "null"] },
19389
+ "confidence": {
19390
+ "description": "How sure the answer is, from 0 to 1: the chance of the answer given, as webhook payloads carry it. Null when unanswered.",
19391
+ "type": ["number", "null"]
19392
+ },
19393
+ "probability": {
19394
+ "deprecated": true,
19395
+ "description": "Deprecated: read confidence. The chance the answer is yes.",
19396
+ "type": ["number", "null"]
19397
+ },
19053
19398
  "error_class": { "type": "string" }
19054
19399
  },
19055
19400
  "required": [
@@ -19916,6 +20261,44 @@ const operationManifest = [
19916
20261
  "description": "True when the rule is active and the share live but new email is not being shared now (what was shared stays visible); false when new email is shared. Null when it does not apply (share not live, rule not active, or you are not on the share) or could not be read.",
19917
20262
  "type": ["boolean", "null"]
19918
20263
  },
20264
+ "activity": {
20265
+ "description": "For the member it is shared with, on the dashboard or the Primitive CLI, while it is live and their access reads content: whether it is working, so a quiet mailbox can be told from a stopped share. Null otherwise.",
20266
+ "anyOf": [{
20267
+ "type": "object",
20268
+ "properties": {
20269
+ "rule_active": {
20270
+ "type": "boolean",
20271
+ "description": "Whether the rule is active now: only an active rule shares."
20272
+ },
20273
+ "last_decided_at": {
20274
+ "type": ["string", "null"],
20275
+ "format": "date-time",
20276
+ "description": "The start of the hour in which the rule last decided on any email in the sharing member's mailboxes since the share began, counting only hours that have ended and the hour of the newest email shared; null if none, or not read."
20277
+ },
20278
+ "shared_emails": {
20279
+ "type": ["integer", "null"],
20280
+ "minimum": 0,
20281
+ "description": "Emails this share has shared, counted up to 10,000; null when these could not be read."
20282
+ },
20283
+ "shared_emails_more": {
20284
+ "description": "Present when it has shared more than 10,000.",
20285
+ "type": "boolean",
20286
+ "const": true
20287
+ },
20288
+ "last_shared_at": {
20289
+ "type": ["string", "null"],
20290
+ "format": "date-time",
20291
+ "description": "When it last shared one; null if it has not, or not read."
20292
+ }
20293
+ },
20294
+ "required": [
20295
+ "rule_active",
20296
+ "last_decided_at",
20297
+ "shared_emails",
20298
+ "last_shared_at"
20299
+ ]
20300
+ }, { "type": "null" }]
20301
+ },
19919
20302
  "is_granter": {
19920
20303
  "type": "boolean",
19921
20304
  "description": "Whether you are the member sharing their mail."
@@ -20005,7 +20388,7 @@ const operationManifest = [
20005
20388
  "rule_id": {
20006
20389
  "type": ["string", "null"],
20007
20390
  "format": "uuid",
20008
- "description": "The rule itself. Only for the member sharing their mail; null for anyone else."
20391
+ "description": "The rule itself. Only for the member sharing their mail; null for anyone else. The member it is shared with lists this share's id in a key's grant.rules instead (from the dashboard), and their own webhooks receive what it shares."
20009
20392
  }
20010
20393
  },
20011
20394
  "required": [
@@ -20285,7 +20668,7 @@ const operationManifest = [
20285
20668
  "question_answers": {
20286
20669
  "type": "array",
20287
20670
  "items": {},
20288
- "description": "The answers to the rule's own questions, when they were asked."
20671
+ "description": "The answers to the rule's own questions, when they were asked: each with question, answer, confidence, the deprecated probability and, when unanswered, error_class, as a test gives them."
20289
20672
  },
20290
20673
  "detail_withheld": {
20291
20674
  "description": "Present, as true, on a decision about an email whose content cannot be read (withheld, failed to parse, discarded, or still awaiting sender authentication): matched still says what the rule decided, but how it got there was read from that content, so parts and question_answers are empty and near_miss is false. Discarding an email's content normally removes its decisions. Absent otherwise.",
@@ -20735,7 +21118,15 @@ const operationManifest = [
20735
21118
  "properties": {
20736
21119
  "question": { "type": "string" },
20737
21120
  "answer": { "type": ["boolean", "null"] },
20738
- "probability": { "type": ["number", "null"] },
21121
+ "confidence": {
21122
+ "description": "How sure the answer is, from 0 to 1: the chance of the answer given, as webhook payloads carry it. Null when unanswered.",
21123
+ "type": ["number", "null"]
21124
+ },
21125
+ "probability": {
21126
+ "deprecated": true,
21127
+ "description": "Deprecated: read confidence. The chance the answer is yes.",
21128
+ "type": ["number", "null"]
21129
+ },
20739
21130
  "error_class": { "type": "string" }
20740
21131
  },
20741
21132
  "required": [
@@ -21643,6 +22034,44 @@ const operationManifest = [
21643
22034
  "description": "True when the rule is active and the share live but new email is not being shared now (what was shared stays visible); false when new email is shared. Null when it does not apply (share not live, rule not active, or you are not on the share) or could not be read.",
21644
22035
  "type": ["boolean", "null"]
21645
22036
  },
22037
+ "activity": {
22038
+ "description": "For the member it is shared with, on the dashboard or the Primitive CLI, while it is live and their access reads content: whether it is working, so a quiet mailbox can be told from a stopped share. Null otherwise.",
22039
+ "anyOf": [{
22040
+ "type": "object",
22041
+ "properties": {
22042
+ "rule_active": {
22043
+ "type": "boolean",
22044
+ "description": "Whether the rule is active now: only an active rule shares."
22045
+ },
22046
+ "last_decided_at": {
22047
+ "type": ["string", "null"],
22048
+ "format": "date-time",
22049
+ "description": "The start of the hour in which the rule last decided on any email in the sharing member's mailboxes since the share began, counting only hours that have ended and the hour of the newest email shared; null if none, or not read."
22050
+ },
22051
+ "shared_emails": {
22052
+ "type": ["integer", "null"],
22053
+ "minimum": 0,
22054
+ "description": "Emails this share has shared, counted up to 10,000; null when these could not be read."
22055
+ },
22056
+ "shared_emails_more": {
22057
+ "description": "Present when it has shared more than 10,000.",
22058
+ "type": "boolean",
22059
+ "const": true
22060
+ },
22061
+ "last_shared_at": {
22062
+ "type": ["string", "null"],
22063
+ "format": "date-time",
22064
+ "description": "When it last shared one; null if it has not, or not read."
22065
+ }
22066
+ },
22067
+ "required": [
22068
+ "rule_active",
22069
+ "last_decided_at",
22070
+ "shared_emails",
22071
+ "last_shared_at"
22072
+ ]
22073
+ }, { "type": "null" }]
22074
+ },
21646
22075
  "is_granter": {
21647
22076
  "type": "boolean",
21648
22077
  "description": "Whether you are the member sharing their mail."
@@ -21732,7 +22161,7 @@ const operationManifest = [
21732
22161
  "rule_id": {
21733
22162
  "type": ["string", "null"],
21734
22163
  "format": "uuid",
21735
- "description": "The rule itself. Only for the member sharing their mail; null for anyone else."
22164
+ "description": "The rule itself. Only for the member sharing their mail; null for anyone else. The member it is shared with lists this share's id in a key's grant.rules instead (from the dashboard), and their own webhooks receive what it shares."
21736
22165
  }
21737
22166
  },
21738
22167
  "required": [
@@ -22158,6 +22587,44 @@ const operationManifest = [
22158
22587
  "description": "True when the rule is active and the share live but new email is not being shared now (what was shared stays visible); false when new email is shared. Null when it does not apply (share not live, rule not active, or you are not on the share) or could not be read.",
22159
22588
  "type": ["boolean", "null"]
22160
22589
  },
22590
+ "activity": {
22591
+ "description": "For the member it is shared with, on the dashboard or the Primitive CLI, while it is live and their access reads content: whether it is working, so a quiet mailbox can be told from a stopped share. Null otherwise.",
22592
+ "anyOf": [{
22593
+ "type": "object",
22594
+ "properties": {
22595
+ "rule_active": {
22596
+ "type": "boolean",
22597
+ "description": "Whether the rule is active now: only an active rule shares."
22598
+ },
22599
+ "last_decided_at": {
22600
+ "type": ["string", "null"],
22601
+ "format": "date-time",
22602
+ "description": "The start of the hour in which the rule last decided on any email in the sharing member's mailboxes since the share began, counting only hours that have ended and the hour of the newest email shared; null if none, or not read."
22603
+ },
22604
+ "shared_emails": {
22605
+ "type": ["integer", "null"],
22606
+ "minimum": 0,
22607
+ "description": "Emails this share has shared, counted up to 10,000; null when these could not be read."
22608
+ },
22609
+ "shared_emails_more": {
22610
+ "description": "Present when it has shared more than 10,000.",
22611
+ "type": "boolean",
22612
+ "const": true
22613
+ },
22614
+ "last_shared_at": {
22615
+ "type": ["string", "null"],
22616
+ "format": "date-time",
22617
+ "description": "When it last shared one; null if it has not, or not read."
22618
+ }
22619
+ },
22620
+ "required": [
22621
+ "rule_active",
22622
+ "last_decided_at",
22623
+ "shared_emails",
22624
+ "last_shared_at"
22625
+ ]
22626
+ }, { "type": "null" }]
22627
+ },
22161
22628
  "is_granter": {
22162
22629
  "type": "boolean",
22163
22630
  "description": "Whether you are the member sharing their mail."
@@ -22247,7 +22714,7 @@ const operationManifest = [
22247
22714
  "rule_id": {
22248
22715
  "type": ["string", "null"],
22249
22716
  "format": "uuid",
22250
- "description": "The rule itself. Only for the member sharing their mail; null for anyone else."
22717
+ "description": "The rule itself. Only for the member sharing their mail; null for anyone else. The member it is shared with lists this share's id in a key's grant.rules instead (from the dashboard), and their own webhooks receive what it shares."
22251
22718
  }
22252
22719
  },
22253
22720
  "required": [
@@ -22812,7 +23279,15 @@ const operationManifest = [
22812
23279
  "properties": {
22813
23280
  "question": { "type": "string" },
22814
23281
  "answer": { "type": ["boolean", "null"] },
22815
- "probability": { "type": ["number", "null"] },
23282
+ "confidence": {
23283
+ "description": "How sure the answer is, from 0 to 1: the chance of the answer given, as webhook payloads carry it. Null when unanswered.",
23284
+ "type": ["number", "null"]
23285
+ },
23286
+ "probability": {
23287
+ "deprecated": true,
23288
+ "description": "Deprecated: read confidence. The chance the answer is yes.",
23289
+ "type": ["number", "null"]
23290
+ },
22816
23291
  "error_class": { "type": "string" }
22817
23292
  },
22818
23293
  "required": [
@@ -23097,7 +23572,15 @@ const operationManifest = [
23097
23572
  "properties": {
23098
23573
  "question": { "type": "string" },
23099
23574
  "answer": { "type": ["boolean", "null"] },
23100
- "probability": { "type": ["number", "null"] },
23575
+ "confidence": {
23576
+ "description": "How sure the answer is, from 0 to 1: the chance of the answer given, as webhook payloads carry it. Null when unanswered.",
23577
+ "type": ["number", "null"]
23578
+ },
23579
+ "probability": {
23580
+ "deprecated": true,
23581
+ "description": "Deprecated: read confidence. The chance the answer is yes.",
23582
+ "type": ["number", "null"]
23583
+ },
23101
23584
  "error_class": { "type": "string" }
23102
23585
  },
23103
23586
  "required": [
@@ -23462,7 +23945,15 @@ const operationManifest = [
23462
23945
  "properties": {
23463
23946
  "question": { "type": "string" },
23464
23947
  "answer": { "type": ["boolean", "null"] },
23465
- "probability": { "type": ["number", "null"] },
23948
+ "confidence": {
23949
+ "description": "How sure the answer is, from 0 to 1: the chance of the answer given, as webhook payloads carry it. Null when unanswered.",
23950
+ "type": ["number", "null"]
23951
+ },
23952
+ "probability": {
23953
+ "deprecated": true,
23954
+ "description": "Deprecated: read confidence. The chance the answer is yes.",
23955
+ "type": ["number", "null"]
23956
+ },
23466
23957
  "error_class": { "type": "string" }
23467
23958
  },
23468
23959
  "required": [
@@ -41346,6 +41837,7 @@ const operationManifest = [
41346
41837
  "items": { "type": "string" }
41347
41838
  },
41348
41839
  "rules": {
41840
+ "description": "Email rule ids: the key also reads the emails these rules granted. An address listed beside them is read in full, so rules beside a domain, a retired address or the address of a member other than the key's holder (its creator, or whoever it was transferred to) are refused (400 validation_error, details.reason rules_beside_domain or rules_beside_personal_mailbox). A rule shared with you goes here by its share's id, from your dashboard session only.",
41349
41841
  "maxItems": 20,
41350
41842
  "type": "array",
41351
41843
  "items": { "type": "string" }
@@ -52648,7 +53140,7 @@ const operationManifest = [
52648
53140
  "attempt_count": { "type": "integer" },
52649
53141
  "duration_ms": { "type": ["integer", "null"] },
52650
53142
  "last_error": {
52651
- "description": "Why the last attempt failed, or null. A webhook's answer is quoted after its status (HTTP 404: ...) only for a caller who can read the webhook (GET /endpoints/{id}; a deleted webhook only for a caller who reads every webhook); anyone else gets the status and a note. Text the platform writes (a redirect not followed, a network error) is shown to everyone.",
53143
+ "description": "Why the last attempt failed, or null. A webhook's answer follows its status (HTTP 404: ...) as plain text, at most 300 characters (response_body has more); older attempts can quote more. It is quoted only for a caller who can read the webhook (GET /endpoints/{id}; a deleted webhook only for a caller who reads every webhook); anyone else gets the status and a note. Text the platform writes (a redirect not followed, a network error) is shown to everyone.",
52652
53144
  "type": ["string", "null"]
52653
53145
  },
52654
53146
  "last_error_code": {
@@ -52901,7 +53393,7 @@ const operationManifest = [
52901
53393
  "duration_ms": { "type": ["integer", "null"] },
52902
53394
  "last_error": {
52903
53395
  "type": ["string", "null"],
52904
- "description": "Why the last attempt failed, or null. A webhook's answer is quoted after its status (HTTP 404: ...) only for a caller who can read the webhook (GET /endpoints/{id}; a deleted webhook only for a caller who reads every webhook); anyone else gets the status and a note. Text the platform writes (a redirect not followed, a network error) is shown to everyone."
53396
+ "description": "Why the last attempt failed, or null. A webhook's answer follows its status (HTTP 404: ...) as plain text, at most 300 characters (response_body has more); older attempts can quote more. It is quoted only for a caller who can read the webhook (GET /endpoints/{id}; a deleted webhook only for a caller who reads every webhook); anyone else gets the status and a note. Text the platform writes (a redirect not followed, a network error) is shown to everyone."
52905
53397
  },
52906
53398
  "created_at": {
52907
53399
  "type": "string",
@@ -54910,6 +55402,7 @@ function sameEmailsBodyFields(flags) {
54910
55402
  const file = flags[SAME_EMAILS_FLAG];
54911
55403
  if (typeof file !== "string") return [];
54912
55404
  const saved = readJsonFileFlag(file, `--${SAME_EMAILS_FLAG}`);
55405
+ SAVED_ANSWERS.set(flags, saved);
54913
55406
  const answer = isRecord(saved) && isRecord(saved.data) ? saved.data : saved;
54914
55407
  const results = isRecord(answer) && Array.isArray(answer.results) ? answer.results : null;
54915
55408
  if (!results) throw usageError(`--${SAME_EMAILS_FLAG} ${file} is not a saved test-email-rule answer: it has no results. Save one with test-email-rule --json > answer.json.`);
@@ -54990,6 +55483,20 @@ function scopeWarningLine(warning) {
54990
55483
  function scopeWarningLines(warnings) {
54991
55484
  return Array.isArray(warnings) ? warnings.filter(isRecord).map(scopeWarningLine) : [];
54992
55485
  }
55486
+ const unitInterval = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 1;
55487
+ /**
55488
+ * How sure an answer is, from 0 to 1: the answer's `confidence`, the number
55489
+ * a webhook payload carries for it, when the answer has one; otherwise the
55490
+ * chance of the answer given, worked out from `probability`, the chance of
55491
+ * yes. Null for an unanswered question.
55492
+ */
55493
+ function answerConfidence(answer) {
55494
+ if (typeof answer.answer !== "boolean") return null;
55495
+ if (unitInterval(answer.confidence)) return answer.confidence;
55496
+ const p = answer.probability;
55497
+ if (!unitInterval(p)) return null;
55498
+ return answer.answer ? p : 1 - p;
55499
+ }
54993
55500
  const UNCLASSIFIED_REASONS = {
54994
55501
  pending: {
54995
55502
  why: "not classified yet",
@@ -55046,9 +55553,10 @@ function undecidedNote(reason) {
55046
55553
  }
55047
55554
  function answerText(answer) {
55048
55555
  const verdict = answer.answer === true ? "yes" : answer.answer === false ? "no" : "unanswered";
55049
- const probability = typeof answer.probability === "number" ? ` at ${confidence(answer.probability)}` : "";
55556
+ const sure = answerConfidence(answer);
55557
+ const at = sure === null ? "" : ` at ${confidence(sure)}`;
55050
55558
  const error = answer.error_class ? ` (${answer.error_class})` : "";
55051
- return `"${answer.question}" ${verdict}${probability}${error}`;
55559
+ return `"${answer.question}" ${verdict}${at}${error}`;
55052
55560
  }
55053
55561
  function conditionLines(summary) {
55054
55562
  const conditions = Array.isArray(summary?.conditions) ? summary.conditions : [];
@@ -55179,14 +55687,17 @@ function notMatchedLine(result) {
55179
55687
  const BIDI_CONTROLS = /[\u200e\u200f\u202a-\u202e\u2066-\u2069]/g;
55180
55688
  /** The longest a sender's subject or file name is shown in a report line. */
55181
55689
  const SHOWN_TEXT_MAX = 100;
55690
+ /** Text from outside the CLI on one report line: no terminal control sequences or reordering marks, and uncut. */
55691
+ function shownLine(value) {
55692
+ if (typeof value !== "string") return "";
55693
+ return sanitizeForTerminal(value).replace(BIDI_CONTROLS, "").replaceAll(/\s+/g, " ").trim();
55694
+ }
55182
55695
  /**
55183
55696
  * Text a sender wrote (a subject, an address, a file name), as a report
55184
- * line shows it: no terminal control sequences or reordering marks, on one
55185
- * line, cut at SHOWN_TEXT_MAX.
55697
+ * line shows it: shownLine, cut at SHOWN_TEXT_MAX.
55186
55698
  */
55187
55699
  function shownText(value) {
55188
- if (typeof value !== "string") return "";
55189
- const line = sanitizeForTerminal(value).replace(BIDI_CONTROLS, "").replaceAll(/\s+/g, " ").trim();
55700
+ const line = shownLine(value);
55190
55701
  return line.length > SHOWN_TEXT_MAX ? `${line.slice(0, 97)}...` : line;
55191
55702
  }
55192
55703
  /**
@@ -55290,7 +55801,7 @@ function expectationsOutcome(expectations, testResults = [], name = sampleNamer(
55290
55801
  /** A time an answer gives, to the minute, in UTC. */
55291
55802
  function minuteUtc(value) {
55292
55803
  const at = new Date(value);
55293
- return Number.isNaN(at.getTime()) ? value : `${at.toISOString().slice(0, 16).replace("T", " ")} UTC`;
55804
+ return Number.isNaN(at.getTime()) ? shownLine(value) : `${at.toISOString().slice(0, 16).replace("T", " ")} UTC`;
55294
55805
  }
55295
55806
  /**
55296
55807
  * The first line of a test report: which mail was tested. A test of recent
@@ -55305,6 +55816,248 @@ function windowLine(data, tested) {
55305
55816
  const span = `Tested ${plural$1(tested, "email", "emails")} received ${minuteUtc(oldest)} to ${minuteUtc(newest)}.`;
55306
55817
  return window.mode === "recent" ? [`${span} A later test of recent mail covers what has arrived since: to compare two trees, test the second with --${SAME_EMAILS_FLAG} <this answer, saved with --json>.`] : [span];
55307
55818
  }
55819
+ /** How many of the emails still matched the comparison names. */
55820
+ const STILL_MATCHED_NAMED = 5;
55821
+ /** Outcomes decided on a rule's conditions: only these carry parts. */
55822
+ const DECIDED = /* @__PURE__ */ new Set([
55823
+ "matched",
55824
+ "near_miss",
55825
+ "no_match"
55826
+ ]);
55827
+ /** Every outcome a test answer gives, in the order the comparison shows them; any other reads as unknown. */
55828
+ const OUTCOMES = [
55829
+ "matched",
55830
+ "near_miss",
55831
+ "no_match",
55832
+ "unclassified",
55833
+ "skipped",
55834
+ "not_found",
55835
+ "unknown"
55836
+ ];
55837
+ /** The answer a saved file holds, as --json printed it or with --envelope. */
55838
+ function savedAnswer(saved) {
55839
+ const answer = isRecord(saved) && isRecord(saved.data) ? saved.data : saved;
55840
+ return isRecord(answer) ? answer : null;
55841
+ }
55842
+ /** An answer's results by email id, in lower case. Null when it holds none. */
55843
+ function resultsById(answer) {
55844
+ if (!answer || !Array.isArray(answer.results)) return null;
55845
+ const byId = /* @__PURE__ */ new Map();
55846
+ for (const result of answer.results) if (isRecord(result) && typeof result.email_id === "string") byId.set(result.email_id.toLowerCase(), result);
55847
+ return byId;
55848
+ }
55849
+ /** An outcome as the comparison names it: one a test gives, or unknown. */
55850
+ function outcomeOf(result) {
55851
+ const outcome = result?.outcome;
55852
+ return typeof outcome === "string" && OUTCOMES.includes(outcome) ? outcome : "unknown";
55853
+ }
55854
+ /** Which conditions held on an email, by parts index. */
55855
+ function heldParts(result) {
55856
+ const parts = Array.isArray(result?.parts) ? result.parts : [];
55857
+ return new Map(parts.flatMap((part) => isRecord(part) && typeof part.index === "number" ? [[part.index, part.matched === true]] : []));
55858
+ }
55859
+ /**
55860
+ * Decided on its conditions, with the parts that say how, and no fact the rule
55861
+ * reads left out: what the summary's own counts cover.
55862
+ */
55863
+ function decidedOnConditions(result) {
55864
+ const missing = result?.missing_facts;
55865
+ return DECIDED.has(outcomeOf(result)) && Array.isArray(result?.parts) && result.parts.length > 0 && !(Array.isArray(missing) && missing.length > 0);
55866
+ }
55867
+ /** A tree's top-level conditions, by index, with their text: from the summary, or the parts the results name. */
55868
+ function conditionsOf(answer, results) {
55869
+ const texts = /* @__PURE__ */ new Map();
55870
+ const summary = answer?.summary;
55871
+ if (isRecord(summary) && Array.isArray(summary.conditions)) {
55872
+ for (const c of summary.conditions) if (isRecord(c) && typeof c.index === "number") texts.set(c.index, typeof c.text === "string" ? c.text : "");
55873
+ }
55874
+ for (const result of results) for (const index of heldParts(result).keys()) if (!texts.has(index)) texts.set(index, "");
55875
+ return [...texts.entries()].sort(([a], [b]) => a - b).map(([index, text]) => ({
55876
+ index,
55877
+ text: text || `condition ${index}`
55878
+ }));
55879
+ }
55880
+ /**
55881
+ * The comparison of `now` with `earlier`, the answer --same-emails-as named
55882
+ * (saved at `against`). Null when the saved answer holds no results.
55883
+ */
55884
+ function compareSameEmails(earlier, now, against) {
55885
+ const earlierAnswer = savedAnswer(earlier);
55886
+ const nowAnswer = savedAnswer(now);
55887
+ const before = resultsById(earlierAnswer);
55888
+ const after = resultsById(nowAnswer);
55889
+ if (!before || !after) return null;
55890
+ const both = [...after.keys()].filter((id) => before.has(id));
55891
+ const tally = (byId) => {
55892
+ const counts = /* @__PURE__ */ new Map();
55893
+ for (const id of both) {
55894
+ const outcome = outcomeOf(byId.get(id));
55895
+ counts.set(outcome, (counts.get(outcome) ?? 0) + 1);
55896
+ }
55897
+ return Object.fromEntries(counts);
55898
+ };
55899
+ const decided = both.filter((id) => decidedOnConditions(before.get(id)) && decidedOnConditions(after.get(id)));
55900
+ const heldBefore = new Map(decided.map((id) => [id, heldParts(before.get(id))]));
55901
+ const heldAfter = new Map(decided.map((id) => [id, heldParts(after.get(id))]));
55902
+ const heldOn = (held, index) => decided.filter((id) => held.get(id)?.get(index) === true).length;
55903
+ const earlierConditions = conditionsOf(earlierAnswer, before.values()).map((c) => ({
55904
+ ...c,
55905
+ held: heldOn(heldBefore, c.index)
55906
+ }));
55907
+ const nowConditions = conditionsOf(nowAnswer, after.values()).map((c) => ({
55908
+ ...c,
55909
+ held: heldOn(heldAfter, c.index)
55910
+ }));
55911
+ const pairs = [];
55912
+ const leftNow = [...nowConditions];
55913
+ const leftEarlier = [];
55914
+ for (const condition of earlierConditions) {
55915
+ const same = leftNow.findIndex((c) => c.text === condition.text);
55916
+ const match = same >= 0 ? leftNow.splice(same, 1)[0] : void 0;
55917
+ if (match) pairs.push({
55918
+ earlier: condition,
55919
+ now: match
55920
+ });
55921
+ else leftEarlier.push(condition);
55922
+ }
55923
+ if (leftEarlier.length === leftNow.length) {
55924
+ leftEarlier.forEach((condition, i) => {
55925
+ const match = leftNow[i];
55926
+ if (match) pairs.push({
55927
+ earlier: condition,
55928
+ now: match
55929
+ });
55930
+ });
55931
+ leftEarlier.length = 0;
55932
+ leftNow.length = 0;
55933
+ }
55934
+ const moved = (e, n) => {
55935
+ let lost = 0;
55936
+ let gained = 0;
55937
+ for (const id of decided) {
55938
+ const was = heldBefore.get(id)?.get(e.index) === true;
55939
+ const is = heldAfter.get(id)?.get(n.index) === true;
55940
+ if (was && !is) lost += 1;
55941
+ if (!was && is) gained += 1;
55942
+ }
55943
+ return {
55944
+ lost,
55945
+ gained
55946
+ };
55947
+ };
55948
+ const conditions = [
55949
+ ...pairs.sort((a, b) => a.earlier.index - b.earlier.index).map((pair) => ({
55950
+ ...pair,
55951
+ ...moved(pair.earlier, pair.now)
55952
+ })),
55953
+ ...leftEarlier.map((e) => ({
55954
+ earlier: e,
55955
+ now: null,
55956
+ lost: null,
55957
+ gained: null
55958
+ })),
55959
+ ...leftNow.map((n) => ({
55960
+ earlier: null,
55961
+ now: n,
55962
+ lost: null,
55963
+ gained: null
55964
+ }))
55965
+ ];
55966
+ const subjectOf = (result) => typeof result?.subject === "string" ? result.subject : null;
55967
+ const changed = both.filter((id) => outcomeOf(before.get(id)) !== outcomeOf(after.get(id))).map((id) => ({
55968
+ email_id: id,
55969
+ subject: subjectOf(after.get(id)) ?? subjectOf(before.get(id)),
55970
+ earlier: outcomeOf(before.get(id)),
55971
+ now: outcomeOf(after.get(id))
55972
+ }));
55973
+ const still = both.filter((id) => outcomeOf(before.get(id)) === "matched" && outcomeOf(after.get(id)) === "matched");
55974
+ return {
55975
+ against,
55976
+ emails: both.length,
55977
+ only_earlier: [...before.keys()].filter((id) => !after.has(id)).length,
55978
+ only_now: [...after.keys()].filter((id) => !before.has(id)).length,
55979
+ decided: decided.length,
55980
+ unchanged: both.length > 0 && changed.length === 0 && (conditions.length === 0 || decided.length > 0 && conditions.every((c) => c.lost === 0 && c.gained === 0)),
55981
+ tree_changed: conditions.some((c) => !c.earlier || !c.now || c.earlier.text !== c.now.text),
55982
+ outcomes: {
55983
+ earlier: tally(before),
55984
+ now: tally(after)
55985
+ },
55986
+ conditions,
55987
+ changed,
55988
+ still_matched: {
55989
+ count: still.length,
55990
+ emails: still.slice(0, STILL_MATCHED_NAMED).map((id) => ({
55991
+ email_id: id,
55992
+ subject: subjectOf(after.get(id))
55993
+ }))
55994
+ }
55995
+ };
55996
+ }
55997
+ /** A subject as the comparison quotes it, or that it has none. */
55998
+ function quotedSubject(subject) {
55999
+ const shown = shownText(subject);
56000
+ return shown ? `"${shown}"` : "(no subject)";
56001
+ }
56002
+ /** One condition of a comparison as a report line. */
56003
+ function comparedConditionLine(x) {
56004
+ if (x.earlier && x.now) {
56005
+ const at = x.earlier.index === x.now.index ? `${x.now.index}` : `${x.earlier.index} -> ${x.now.index}`;
56006
+ const text = x.earlier.text === x.now.text ? shownLine(x.now.text) : `earlier "${shownLine(x.earlier.text)}", now "${shownLine(x.now.text)}"`;
56007
+ const moved = x.lost === 0 && x.gained === 0 ? "the same emails" : `lost ${x.lost}, gained ${x.gained}`;
56008
+ return ` ${at}. ${text}: ${x.earlier.held} -> ${x.now.held} (${moved})`;
56009
+ }
56010
+ if (x.earlier) return ` removed, earlier ${x.earlier.index}. ${shownLine(x.earlier.text)}: held on ${x.earlier.held}`;
56011
+ return ` added, now ${x.now?.index}. ${shownLine(x.now?.text)}: holds on ${x.now?.held}`;
56012
+ }
56013
+ /** The comparison as report lines, after the rest of the report. */
56014
+ function comparisonLines(c) {
56015
+ const left = [c.only_earlier > 0 ? `${c.only_earlier} only in the earlier answer` : "", c.only_now > 0 ? `${c.only_now} only in this one` : ""].filter(Boolean);
56016
+ const lines = [`Compared with ${shownLine(c.against)}, over the ${plural$1(c.emails, "email", "emails")} both tested${left.length > 0 ? ` (left out: ${left.join(", ")})` : ""}:`];
56017
+ if (c.emails === 0) return [...lines, " None to compare."];
56018
+ lines.push(c.unchanged ? c.tree_changed ? " Nothing changed on these emails: the tree changed, but every email has the same outcome and each condition holds on the same emails as before." : c.conditions.length === 0 ? " Nothing changed: every email has the same outcome." : " Nothing changed: every email has the same outcome, and each condition holds on the same emails as before." : c.changed.length === 0 ? " No email changed outcome." : ` ${plural$1(c.changed.length, "email changed outcome", "emails changed outcome")}.`);
56019
+ const outcomes = OUTCOMES.filter((o) => (c.outcomes.earlier[o] ?? 0) + (c.outcomes.now[o] ?? 0) > 0).map((o) => `${o} ${c.outcomes.earlier[o] ?? 0} -> ${c.outcomes.now[o] ?? 0}`);
56020
+ lines.push(` Outcomes, earlier -> now: ${outcomes.join(", ")}.`);
56021
+ if (c.conditions.length > 0 && c.decided === 0) lines.push(" Conditions: no email was decided on its conditions in both answers, so they are not compared.");
56022
+ else if (c.conditions.length > 0) lines.push(` Conditions, how many of the ${plural$1(c.decided, "email", "emails")} decided in both each held on, earlier -> now:`, ...c.conditions.map(comparedConditionLine));
56023
+ if (c.changed.length > 0) {
56024
+ const shown = c.changed.slice(0, 25);
56025
+ lines.push(shown.length < c.changed.length ? ` Changed outcome (${shown.length} of ${c.changed.length} shown; with --json, comparison.changed has every one):` : ` Changed outcome (${c.changed.length}):`, ...shown.map((x) => ` ${x.email_id} ${quotedSubject(x.subject)}: ${x.earlier} -> ${x.now}`));
56026
+ }
56027
+ const named = c.still_matched.emails.map((x) => quotedSubject(x.subject));
56028
+ const more = c.still_matched.count - named.length;
56029
+ lines.push(c.still_matched.count === 0 ? " Matched before and still matched: none." : ` Matched before and still matched: ${c.still_matched.count}, such as ${named.join(", ")}${more > 0 ? `, and ${more} more` : ""}.`);
56030
+ return lines;
56031
+ }
56032
+ /**
56033
+ * The earlier answers --same-emails-as read, by the parsed flags they came
56034
+ * with: the file is read once, so one that can be read only once (a pipe, a
56035
+ * process substitution) is compared too, and one rewritten meanwhile is
56036
+ * compared as it was sent.
56037
+ */
56038
+ const SAVED_ANSWERS = /* @__PURE__ */ new WeakMap();
56039
+ /** The comparison --same-emails-as asks for; when there can be none, a line and an error saying why. */
56040
+ function sameEmailsComparison(data, flags) {
56041
+ const file = flags?.[SAME_EMAILS_FLAG];
56042
+ if (typeof file !== "string") return { lines: [] };
56043
+ const failed = (why) => ({
56044
+ json: { comparison: {
56045
+ against: file,
56046
+ error: why
56047
+ } },
56048
+ lines: [`Not compared with ${shownLine(file)}: ${shownLine(why)}`]
56049
+ });
56050
+ try {
56051
+ const comparison = compareSameEmails(flags && SAVED_ANSWERS.has(flags) ? SAVED_ANSWERS.get(flags) : readJsonFileFlag(file, `--${SAME_EMAILS_FLAG}`), data, file);
56052
+ if (!comparison) return failed("it holds no results.");
56053
+ return {
56054
+ json: { comparison },
56055
+ lines: comparisonLines(comparison)
56056
+ };
56057
+ } catch (error) {
56058
+ return failed(error instanceof Error ? error.message : String(error));
56059
+ }
56060
+ }
55308
56061
  /** The stderr report and exit code of a test-email-rule answer. */
55309
56062
  function testEmailRuleReport(data, request) {
55310
56063
  if (!isRecord(data)) return { lines: [] };
@@ -55313,17 +56066,20 @@ function testEmailRuleReport(data, request) {
55313
56066
  const results = Array.isArray(result.results) ? result.results : [];
55314
56067
  const summary = isRecord(result.summary) ? result.summary : void 0;
55315
56068
  const counts = isRecord(data.counts) ? data.counts : void 0;
56069
+ const lines = [
56070
+ ...windowLine(data, (typeof counts?.emails === "number" ? counts.emails : results.length) - (typeof counts?.not_found === "number" ? counts.not_found : 0)),
56071
+ ...(Array.isArray(summary?.warnings) ? summary.warnings : []).map((warning) => `Warning: ${warning}`),
56072
+ ...scopeWarningLines(result.scope_warnings),
56073
+ ...conditionLines(summary),
56074
+ ...questionLines(summary, results),
56075
+ ...expectationsLines(result.expectations, results, name),
56076
+ ...matchedLines(results, result.expectations),
56077
+ ...notMatchedLines(results, result.expectations)
56078
+ ];
56079
+ const compared = sameEmailsComparison(data, request?.flags);
55316
56080
  return {
55317
- lines: [
55318
- ...windowLine(data, (typeof counts?.emails === "number" ? counts.emails : results.length) - (typeof counts?.not_found === "number" ? counts.not_found : 0)),
55319
- ...(Array.isArray(summary?.warnings) ? summary.warnings : []).map((warning) => `Warning: ${warning}`),
55320
- ...scopeWarningLines(result.scope_warnings),
55321
- ...conditionLines(summary),
55322
- ...questionLines(summary, results),
55323
- ...expectationsLines(result.expectations, results, name),
55324
- ...matchedLines(results, result.expectations),
55325
- ...notMatchedLines(results, result.expectations)
55326
- ],
56081
+ lines: [...lines, ...compared.lines],
56082
+ ...compared.json ? { json: compared.json } : {},
55327
56083
  ...expectationsOutcome(result.expectations, results, name)
55328
56084
  };
55329
56085
  }
@@ -55844,6 +56600,33 @@ function endEmailRuleShareReport(data) {
55844
56600
  return { lines: note ? [note] : [] };
55845
56601
  }
55846
56602
  /**
56603
+ * Whether a share made with you is working, from its `activity`, as one line:
56604
+ * the last hour that has ended (or in which an email was shared with you) in
56605
+ * which its rule looked at an email in the sharing member's mailboxes, how
56606
+ * many emails it has shared and when it last did, and whether the rule is
56607
+ * active. Nothing for a share without it: one you are not the person it is
56608
+ * shared with, one not live, or a server that predates the field.
56609
+ */
56610
+ function shareActivityLines(share) {
56611
+ if (!isRecord(share) || !isRecord(share.activity)) return [];
56612
+ const activity = share.activity;
56613
+ const id = typeof share.id === "string" ? share.id : "<share-id>";
56614
+ const rule = isRecord(share.rule) && typeof share.rule.name === "string" ? shownLine(share.rule.name) : "";
56615
+ const granter = isRecord(share.granter) ? share.granter : {};
56616
+ const person = shownLine(granter.name) || shownLine(granter.email) || "the member sharing";
56617
+ const head = `Share ${id}${rule ? ` (${rule})` : ""}:`;
56618
+ const count = activity.shared_emails;
56619
+ const sharedAt = typeof activity.last_shared_at === "string" ? activity.last_shared_at : null;
56620
+ const unread = `${head} whether it is working could not be read just now; try again.`;
56621
+ if (typeof count !== "number") return [unread];
56622
+ if (typeof activity.last_decided_at !== "string" && (count > 0 || sharedAt)) return [unread];
56623
+ if (count > 0 !== (sharedAt !== null)) return [unread];
56624
+ const decided = typeof activity.last_decided_at === "string" ? `its rule last looked at an email in ${person}'s mailboxes in the hour starting ${minuteUtc(activity.last_decided_at)}` : `its rule has not looked at an email in ${person}'s mailboxes in any hour that has ended since it was shared with you`;
56625
+ const more = activity.shared_emails_more === true;
56626
+ const many = `${more ? "more than " : ""}${count.toLocaleString("en-US")}`;
56627
+ return [`${head} ${decided}; ${count === 0 ? "nothing has been shared with you yet" : `it has shared ${many} ${count === 1 && !more ? "email" : "emails"} with you${sharedAt ? `, the last at ${minuteUtc(sharedAt)}` : ""}`}.${activity.rule_active === false ? " The rule is not active, so nothing new is shared until it is." : share.delivery_paused === true ? " New email is not being shared with you right now; what was shared stays visible." : ""}`];
56628
+ }
56629
+ /**
55847
56630
  * accept-email-rule-request without --json: the answer's notice, then the
55848
56631
  * rule as it was agreed, since the answer's request block holds the rule as
55849
56632
  * it was asked and reads like what was accepted.
@@ -55881,7 +56664,7 @@ const EMAIL_RULE_OPERATION_EXTENSIONS = {
55881
56664
  }),
55882
56665
  [EXPECT_SAMPLES_FILE_FLAG]: Flags.string({ description: `${SAMPLES_FILE_SHAPE} Sets expect.samples (at most 20), beside any emails by id; the answer judges each in expectations.samples (index from 0 over those sent), and the report names each by its number in the file. Like any expect, it replaces a saved rule's own expectations and samples for this test. ${EXPECTATION_FLAG_NOTE}` }),
55883
56666
  [PICK_FLAG]: Flags.string({ description: pickFlagHelp([EXPECT_SAMPLES_FILE_FLAG]) }),
55884
- [SAME_EMAILS_FLAG]: Flags.string({ description: `Test the same emails as an earlier test: a file holding what test-email-rule --json printed. Sets email_ids to its results' email_id, over any in --body-file or --raw-body, so two trees are compared over the same mail; a test of recent mail covers the newest emails, which move on as mail arrives. At most ${EMAIL_IDS_MAX} emails, counting the expected ones a test adds (a saved rule's own, with --rule-id).` }),
56667
+ [SAME_EMAILS_FLAG]: Flags.string({ description: `Test the same emails as an earlier test: a file holding what test-email-rule --json printed. Sets email_ids to its results' email_id, over any in --body-file or --raw-body, so two trees are compared over the same mail; a test of recent mail covers the newest emails, which move on as mail arrives. At most ${EMAIL_IDS_MAX} emails, counting the expected ones a test adds (a saved rule's own, with --rule-id). The report then ends with what changed against that answer, over the emails both tested: the emails whose outcome changed; each top-level condition's count, earlier and now, of the emails both decided on their conditions that it held on, with how many it lost and gained (conditions pair by their text, then in order; one left over shows as added or removed); and the emails matched before and still matched. It says so when nothing changed. With --json, the document gains a comparison key beside the answer's own, which the CLI works out from the two answers; when it cannot compare them, comparison holds only against and error.` }),
55885
56668
  ...scopeSelectionFlags()
55886
56669
  },
55887
56670
  bodyFields: (flags, base) => {
@@ -55987,6 +56770,14 @@ const EMAIL_RULE_OPERATION_EXTENSIONS = {
55987
56770
  flags: {},
55988
56771
  report: endEmailRuleShareReport
55989
56772
  },
56773
+ getEmailRuleShare: {
56774
+ flags: {},
56775
+ report: (data) => ({ lines: shareActivityLines(data) })
56776
+ },
56777
+ listEmailRuleShares: {
56778
+ flags: {},
56779
+ report: (data) => ({ lines: (Array.isArray(data) ? data : []).flatMap(shareActivityLines) })
56780
+ },
55990
56781
  getEmailRule: {
55991
56782
  flags: {},
55992
56783
  report: getEmailRuleReport
@@ -57269,7 +58060,7 @@ function buildThrownSendFailureEnvelope(params) {
57269
58060
  return {
57270
58061
  outcome,
57271
58062
  exit_code: params.requestStarted ? sendOutcomeExitCode("uncertain") : thrownErrorExitCode(params.error),
57272
- outcome_message: formatSendFailureSummary(params.noun, outcome, void 0),
58063
+ outcome_message: formatSendFailureSummary(params.noun, outcome, void 0, params.requestStarted ? void 0 : sendErrorMessage(thrownErrorBody(params.error))),
57273
58064
  ...sendIdentityFields({
57274
58065
  idempotencyKey: params.idempotencyKey,
57275
58066
  sent: null
@@ -58169,7 +58960,7 @@ function savedConnectedProfiles(configDir, exclude) {
58169
58960
  */
58170
58961
  async function otherProfiles(configDir, session, current) {
58171
58962
  if (session) try {
58172
- const { connectedProfilesForSession } = await import("./machine-session-DJoBSWTy.js").then((n) => n.s);
58963
+ const { connectedProfilesForSession } = await import("./machine-session-CSqj4DmF.js").then((n) => n.s);
58173
58964
  return {
58174
58965
  inSession: true,
58175
58966
  profiles: connectedProfilesForSession(configDir, session, current)
@@ -58675,10 +59466,19 @@ const API_ERROR_CODES = {
58675
59466
  forbidden: "forbidden",
58676
59467
  grantForbidden: "grant_forbidden",
58677
59468
  invalidDeviceCode: "invalid_device_code",
59469
+ keyRevoked: "key_revoked",
58678
59470
  notFound: "not_found",
58679
59471
  slowDown: "slow_down",
58680
59472
  unauthorized: "unauthorized"
58681
59473
  };
59474
+ /**
59475
+ * Whether an error code says the credential itself is not accepted: unknown
59476
+ * or invalid (`unauthorized`), or a full API key that was revoked
59477
+ * (`key_revoked`, which carries its own message and gets no sign-in hint).
59478
+ */
59479
+ function refusesCredential(code) {
59480
+ return code === API_ERROR_CODES.unauthorized || code === API_ERROR_CODES.keyRevoked;
59481
+ }
58682
59482
  function flagName(parameterName) {
58683
59483
  return parameterName.replace(/_/g, "-");
58684
59484
  }
@@ -58876,7 +59676,8 @@ function extractBodyFields(schema) {
58876
59676
  kind,
58877
59677
  ...enumValues && enumValues.length > 0 ? { enumValues } : {},
58878
59678
  ...typeof propSchema.maximum === "number" ? { maximum: propSchema.maximum } : {},
58879
- ...typeof propSchema.minimum === "number" ? { minimum: propSchema.minimum } : {}
59679
+ ...typeof propSchema.minimum === "number" ? { minimum: propSchema.minimum } : {},
59680
+ ...typeof propSchema.maxLength === "number" && propSchema.pattern === void 0 && propSchema.format === void 0 ? { maxLength: propSchema.maxLength } : {}
58880
59681
  });
58881
59682
  }
58882
59683
  return fields.sort((a, b) => {
@@ -59180,8 +59981,24 @@ function bodyFieldFlag(field, aliases) {
59180
59981
  ...common,
59181
59982
  options: field.enumValues
59182
59983
  });
59183
- return Flags.string(common);
59984
+ return Flags.string({
59985
+ ...common,
59986
+ description: withLengthLimit(field.description, field.maxLength) || field.name
59987
+ });
59184
59988
  }
59989
+ /**
59990
+ * A text flag's help with the most characters it takes, when the schema has
59991
+ * a limit its description does not already give so a long
59992
+ * message is cut to fit before it is written rather than refused after.
59993
+ */
59994
+ function withLengthLimit(description, max) {
59995
+ if (max === void 0 || SAYS_A_LIMIT.test(description)) return description;
59996
+ if (new RegExp(`\\b${max}\\b`).test(description)) return description;
59997
+ const limit = `At most ${max} characters.`;
59998
+ return description.trim() ? `${sentence(description)} ${limit}` : limit;
59999
+ }
60000
+ /** A description that already states a size limit of its own, in any unit. */
60001
+ const SAYS_A_LIMIT = /\b(?:up to|at most|no more than)\b|\b[KMG]i?B\b|\bbytes?\b/i;
59185
60002
  function buildFlags(operation) {
59186
60003
  const flags = {
59187
60004
  "api-key": Flags.string({
@@ -59356,8 +60173,9 @@ const OPERATION_HINTS = {
59356
60173
  deleteMemory: "Tip: prefer `primitive memories delete <key> [--function <function-id>]` for the common delete path.",
59357
60174
  searchMemories: "Tip: prefer `primitive memories search [prefix] [--metadata-only] [--function <function-id>]` for the common search path.",
59358
60175
  listEmails: "Tip: for a one-line-per-email table, `primitive emails latest --limit 100`.",
59359
- createEmailRuleObjection: "Tip: say in --message (up to 500 characters) what you want. It can ask for less than turning the rule off: ask the author to narrow the rule, or to explain where its matches go (its receivers). The author accepts, which turns the rule off, or declines, optionally giving a reason, which you see in `primitive email-rule-oversight get-email-rule-objection <objection-id>`. You can withdraw it with `primitive email-rule-oversight withdraw-email-rule-objection <objection-id>`. Objecting does not change the rule.",
59360
- declineEmailRuleObjection: "Tip: the member who objected sees --reason (up to 500 characters). If you narrow the rule instead of turning it off, decline with a reason saying what you changed: accepting turns the rule off, and the member sees the reason on the objection. When the objection asked you to explain a receiver, the reason can say what the receiver is for.",
60176
+ createEmailRuleObjection: "Tip: say in --message (up to 500 characters) what you want. It can ask for less than turning the rule off: ask the author to narrow the rule, or to explain where its matches go (its receivers). The author accepts, which turns the rule off; declines, optionally giving a reason; or answers amended once they have saved a new version of the rule, optionally with a note. You see the answer in `primitive email-rule-oversight get-email-rule-objection <objection-id>`. You can withdraw it with `primitive email-rule-oversight withdraw-email-rule-objection <objection-id>`. Objecting does not change the rule.",
60177
+ declineEmailRuleObjection: "Tip: the member who objected sees --reason (up to 500 characters). When the objection asked you to explain a receiver, the reason can say what the receiver is for. If you changed the rule instead of turning it off, do not decline: save the new version with `primitive email-rules update-email-rule`, then answer with `primitive email-rule-oversight amend-email-rule-objection <objection-id>`.",
60178
+ amendEmailRuleObjection: "Tip: save the new version first with `primitive email-rules update-email-rule`; until the rule's version is newer than when the objection was made, this answers 409 no_new_version. The member who objected sees --note (up to 500 characters) and both version numbers.",
59361
60179
  listEndpoints: "Tip: without --json, a table on stderr after the JSON shows each endpoint's ENABLED and DELIVERING. DELIVERING is read from delivery.delivering, whether a webhook is being sent mail at all, not from enabled: an endpoint can be enabled and still not be delivering (its owner's key revoked, say), shown as no with the reason codes in parentheses. A webhook whose delivery could not be checked shows unknown, and a Function or pull endpoint shows -.",
59362
60180
  startAgentSignup: "Tip: pass --terms-accepted. Capture the signup_token from the response and feed it to `primitive agent verify-agent-signup --signup-token <token> --verification-code <6-digit-code>` (the verify flag accepts --code as an alias). The high-level `primitive signup <email>` command walks an interactive user through both steps with friendlier prompts.",
59363
60181
  testEmailRule: "Tip: --expect-match and --expect-no-match (or --expect-file) set expect, the emails the rule must match and must not. When no expect is sent, by these flags or in the body, a saved rule's saved expectations are judged instead. Either way, the answer reports the expectations it judged in expectations: passed, counts and per-email results. (create-email-rule and update-email-rule instead judge the rule's saved expectations on the version they save, in expectations_check: passed, decided, failed and undecided.) The exit code follows that report: 1 when one failed; 1 when one is undecided and testing again will not decide it (its email cannot be found or read, cannot be classified, or cannot be tested: skipped); 3 when the only undecided ones can be decided later (not classified yet, or a question unanswered), so test again later. Exit 1 also means the request failed. With --json, error.code tells these apart: expectations_failed, expectations_unresolvable, expectations_undecided (exit 3), or the API's own code. Without --json a readable report follows the JSON on stderr: warnings, how each condition held, the expectations, and the values each email that did not match was compared on.",
@@ -59776,6 +60594,13 @@ function createOperationCommand(operation) {
59776
60594
  ...printed,
59777
60595
  error: report.error
59778
60596
  };
60597
+ if (jsonOutput && report?.json && printed !== null && typeof printed === "object" && !Array.isArray(printed)) {
60598
+ const answer = printed;
60599
+ printed = {
60600
+ ...answer,
60601
+ ...Object.fromEntries(Object.entries(report.json).filter(([key]) => !Object.hasOwn(answer, key)))
60602
+ };
60603
+ }
59779
60604
  this.log(JSON.stringify(printed, null, 2));
59780
60605
  if (reportError !== void 0) process.stderr.write(`Warning: ${operation.sdkName} succeeded but its report could not be built (${reportError}). The JSON above is the full answer; read it rather than the exit code.\n`);
59781
60606
  if (report && !jsonOutput) for (const line of report.lines) process.stderr.write(`${line}\n`);
@@ -59810,4 +60635,4 @@ function emptyDeliveriesHint(sdkName, query) {
59810
60635
  function canonicalizeCliReferences(description) {
59811
60636
  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'`");
59812
60637
  }
59813
- export { interactionNextActions as $, withAttachmentWait as $t, openBrowser as A, thrownErrorExitCode as At, serverRelationship as B, detectRuntimeSession as Bt, approveThenRerunHint as C, sendErrorMessage as Ct, canOfferCopyHotkey as D, sentHistoryWindowStart as Dt, withApproval as E, sendWaitClampNotice as Et, formatMailWakeLine as F, generatedAgentName as Ft, claimPendingMail as G, mailReach as Gt, wakeReadCommand as H, formatAlreadySentNotice as Ht, latestOwnOutbound as I, identitySuggestions as It, pendingMailPath as J, classificationOf as Jt, clearConsumedPendingMail as K, readCallerMailFor as Kt, readThreadContext as L, loadSkillLine as Lt, bareAddress$1 as M, cliInvocation as Mt, describeWake as N, connectNextSteps as Nt, formatBrowserLoginInstructions as O, serializeErrorPayload as Ot, displayAddress as P, defaultConnectionName as Pt, interactionHumanLine as Q, ATTACHMENT_WAIT_MAX_MS as Qt, sentInThread as R, currentMailSessionKey as Rt, STEP_UP_TOKEN_FLAG_DESCRIPTION as S, reportSendCommandResult as St, terminalApprovalIo as T, sendOutcomeExitCode as Tt, wakeRecipientField as U, withFlagSuggestion as Ut, skillFirstLine as V, runtimeSessionVariableList as Vt, wakeRelationship as W, emptyEmailListHint as Wt, recordPendingMail as X, noFactsMessage as Xt, readPendingMail as Y, isEmailId as Yt, removePendingMail as Z, ATTACHMENT_WAIT_FLAG_DESCRIPTION as Zt, surfaceUnauthorizedHint as _, routeWarningLines as _n, formatPriorRepliesCheckSkipped as _t, createOperationCommand as a, refuseOrgSelectionForProfile as an, MAX_SEND_WAIT_TIMEOUT_MS as at, BROWSER_FLAG_DESCRIPTION as b, operationManifest as bn, formatSendRecordFailureSummary as bt, formatErrorPayload as c, CliOrgRefusedError as cn, assertValidIdempotencyKey as ct, isGrantRefusal as d, fetchCliOrgs as dn, checkPriorReplies as dt, ConnectedAgentKeyRequiredError as en, readEmailInteraction as et, networkErrorHint as f, isBuiltInRoleKey as fn, classifySendError as ft, runWithTiming as g, switchCurrentOrg as gn, formatDeletedEarlierSendNotice as gt, refusalDetails as h, roleKeyText as hn, followUpCommandPrefix as ht, TIME_FLAG_DESCRIPTION as i, refreshStoredCliCredentials as in, IDEMPOTENCY_KEY_FLAG_DESCRIPTION as it, explainPendingMailNotFound as j, DEFAULT_ENROLL_NAME as jt, listenForCopyHotkey as k, successfulSendOutcome as kt, hasControlCharacter as l, RESTRICTED_ROLE_NOTE as ln, buildFollowUpCommand as lt, readTextFileFlag as m, roleKeyLabel as mn, excludeSignalReplies as mt, API_ERROR_CODES as n, createAuthenticatedCliApiClient as nn, replyInteractionWarning as nt, extractErrorCode as o, resolveCliApiRequestConfig as on, SEND_OUTCOME_HELP as ot, parameterFlagName as p, revokeUserLogin as pn, deriveSendIdempotencyKey as pt, clearReadPendingMail as q, classificationFactLines as qt, OPERATION_PATH_FLAGS as r, createCliApiClient as rn, wakeInteractionSentence as rt, extractErrorPayload as s, selectedOrgFromEnv as sn, apiResultHttpStatus as st, API_BASE_URL_FLAG_DESCRIPTION as t, SAVED_CLI_OAUTH_SESSION_EXPIRED_MESSAGE as tn, replyExpectation as tt, headerFlagName as u, credentialsFromUserLogin as un, buildThrownSendFailureEnvelope as ut, takesStepUp as v, sanitizeForTerminal as vn, formatPriorRepliesWarning as vt, promptLine as w, sendIdentityFields as wt, STEP_UP_HEADER as x, priorRepliesThatWentOut as xt, writeErrorWithHints as y, setKnownCommands as yn, formatSendFailureSummary as yt, serverMuted as z, detectAgentRuntime as zt };
60638
+ export { interactionHumanLine as $, ATTACHMENT_WAIT_MAX_MS as $t, listenForCopyHotkey as A, successfulSendOutcome as At, serverMuted as B, detectAgentRuntime as Bt, STEP_UP_TOKEN_FLAG_DESCRIPTION as C, reportSendCommandResult as Ct, withApproval as D, sendWaitClampNotice as Dt, terminalApprovalIo as E, sendOutcomeExitCode as Et, displayAddress as F, defaultConnectionName as Ft, wakeRelationship as G, emptyEmailListHint as Gt, skillFirstLine as H, runtimeSessionVariableList as Ht, formatMailWakeLine as I, generatedAgentName as It, clearReadPendingMail as J, classificationFactLines as Jt, claimPendingMail as K, mailReach as Kt, latestOwnOutbound as L, identitySuggestions as Lt, explainPendingMailNotFound as M, DEFAULT_ENROLL_NAME as Mt, bareAddress$1 as N, cliInvocation as Nt, canOfferCopyHotkey as O, sentHistoryWindowStart as Ot, describeWake as P, connectNextSteps as Pt, removePendingMail as Q, ATTACHMENT_WAIT_FLAG_DESCRIPTION as Qt, readThreadContext as R, loadSkillLine as Rt, STEP_UP_HEADER as S, priorRepliesThatWentOut as St, promptLine as T, sendIdentityFields as Tt, wakeReadCommand as U, formatAlreadySentNotice as Ut, serverRelationship as V, detectRuntimeSession as Vt, wakeRecipientField as W, withFlagSuggestion as Wt, readPendingMail as X, isEmailId as Xt, pendingMailPath as Y, classificationOf as Yt, recordPendingMail as Z, noFactsMessage as Zt, runWithTiming as _, switchCurrentOrg as _n, formatDeletedEarlierSendNotice as _t, createOperationCommand as a, refreshStoredCliCredentials as an, IDEMPOTENCY_KEY_FLAG_DESCRIPTION as at, writeErrorWithHints as b, setKnownCommands as bn, formatSendFailureSummary as bt, formatErrorPayload as c, selectedOrgFromEnv as cn, apiResultHttpStatus as ct, isGrantRefusal as d, credentialsFromUserLogin as dn, buildThrownSendFailureEnvelope as dt, withAttachmentWait as en, interactionNextActions as et, networkErrorHint as f, fetchCliOrgs as fn, checkPriorReplies as ft, refusesCredential as g, roleKeyText as gn, followUpCommandPrefix as gt, refusalDetails as h, roleKeyLabel as hn, excludeSignalReplies as ht, TIME_FLAG_DESCRIPTION as i, createCliApiClient as in, wakeInteractionSentence as it, openBrowser as j, thrownErrorExitCode as jt, formatBrowserLoginInstructions as k, serializeErrorPayload as kt, hasControlCharacter as l, CliOrgRefusedError as ln, assertValidIdempotencyKey as lt, readTextFileFlag as m, revokeUserLogin as mn, deriveSendIdempotencyKey as mt, API_ERROR_CODES as n, SAVED_CLI_OAUTH_SESSION_EXPIRED_MESSAGE as nn, replyExpectation as nt, extractErrorCode as o, refuseOrgSelectionForProfile as on, MAX_SEND_WAIT_TIMEOUT_MS as ot, parameterFlagName as p, isBuiltInRoleKey as pn, classifySendError as pt, clearConsumedPendingMail as q, readCallerMailFor as qt, OPERATION_PATH_FLAGS as r, createAuthenticatedCliApiClient as rn, replyInteractionWarning as rt, extractErrorPayload as s, resolveCliApiRequestConfig as sn, SEND_OUTCOME_HELP as st, API_BASE_URL_FLAG_DESCRIPTION as t, ConnectedAgentKeyRequiredError as tn, readEmailInteraction as tt, headerFlagName as u, RESTRICTED_ROLE_NOTE as un, buildFollowUpCommand as ut, surfaceUnauthorizedHint as v, routeWarningLines as vn, formatPriorRepliesCheckSkipped as vt, approveThenRerunHint as w, sendErrorMessage as wt, BROWSER_FLAG_DESCRIPTION as x, operationManifest as xn, formatSendRecordFailureSummary as xt, takesStepUp as y, sanitizeForTerminal as yn, formatPriorRepliesWarning as yt, sentInThread as z, currentMailSessionKey as zt };