@primitivedotdev/cli 3.0.0-preview.15 → 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,7 +1,7 @@
1
1
  import { N as agentProfileDirectory, P as agentProfileName, R as loadConnectedAgentProfile, j as AGENT_PROFILE_ENV } from "../cli-config-Ms_0vNjq.js";
2
2
  import { a as backgroundListenStatus, i as backgroundListenRestartable, s as claimBackgroundListenRestart, t as BACKGROUND_LISTEN_RELAUNCH_ENV } from "../listen-background-DyBYca28.js";
3
- import { d as SESSION_UUID, t as notificationScope } from "../notify-session-B64Lgv6Z.js";
4
- import { Rt as detectAgentRuntime } from "../api-command-D5Nbd6Pq.js";
3
+ import { d as SESSION_UUID, t as notificationScope } from "../notify-session-Pt4oRh0I.js";
4
+ import { Bt as detectAgentRuntime } from "../api-command-CgBNtNyD.js";
5
5
  import { d as readMailJson } from "../shared-mail-files-BAQSGxxz.js";
6
6
  import { join } from "node:path";
7
7
  import { spawn } from "node:child_process";
@@ -48,6 +48,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
48
48
  agentWorkProposeDeadline: () => agentWorkProposeDeadline,
49
49
  agentWorkReportStatus: () => agentWorkReportStatus,
50
50
  agentWorkWithdrawDeadline: () => agentWorkWithdrawDeadline,
51
+ amendEmailRuleObjection: () => amendEmailRuleObjection,
51
52
  awaitReply: () => awaitReply,
52
53
  cancelSentEmail: () => cancelSentEmail,
53
54
  cancelSentEmailByIdempotencyKey: () => cancelSentEmailByIdempotencyKey,
@@ -3616,7 +3617,7 @@ const getWebhookDeliveryStats = (options) => (options?.client ?? client).get({
3616
3617
  /**
3617
3618
  * List what you created, or what you were asked
3618
3619
  *
3619
- * 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.
3620
+ * 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.
3620
3621
  */
3621
3622
  const listActivityObjects = (options) => (options?.client ?? client).get({
3622
3623
  security: [{
@@ -3766,7 +3767,7 @@ const getEmailRule = (options) => (options.client ?? client).get({
3766
3767
  /**
3767
3768
  * Change a rule
3768
3769
  *
3769
- * Renames the rule, saves a new version (english and tree together; earlier versions stay) or restores one (restore_version), changes its state (draft is off; observe; active), its scope (evaluation_scope, with scope_selection when selected) or its saved expectations (judged in expectations_check). Anyone but its author who sees it may only set state draft, and while it is shared only if they manage members from the dashboard. A scope change saves a new version; a shared rule keeps its scope, and a kind never changes. A saved version takes effect at once. if_version refuses a write once a version was saved since you read it; if_revision, once anything changed. Without if_expectations_pass a version is saved even when its expectations fail, except on an active rule keys or webhooks read: that write is checked first unless if_expectations_pass is false. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token).
3770
+ * Renames the rule, saves a new version (english and tree together; earlier versions stay) or restores one (restore_version), changes its state (draft is off; observe; active), its scope (evaluation_scope, with scope_selection when selected) or its saved expectations (judged in expectations_check). Anyone but its author who sees it may only set state draft, and while it is shared only if they manage members from the dashboard. A scope change saves a new version; a shared rule keeps its scope, and a kind never changes. A saved version takes effect at once, on the rule's share too, which goes on under it. if_version refuses a write once a version was saved since you read it; if_revision, once anything changed. Without if_expectations_pass a version is saved even when its expectations fail, except on an active rule keys, webhooks or a share read: that write is checked first unless if_expectations_pass is false. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token).
3770
3771
  */
3771
3772
  const updateEmailRule = (options) => (options.client ?? client).patch({
3772
3773
  security: [{
@@ -3796,7 +3797,7 @@ const listEmailRuleDecisions = (options) => (options.client ?? client).get({
3796
3797
  /**
3797
3798
  * List every rule's result on an email
3798
3799
  *
3799
- * What each rule you can see decided about this email (matched, not matched, or not run), in the words of the deciding version. A do_not_share rule that matched it blocks sharing while active; earlier shares stay. Only a caller who can read the email gets an answer. classification is every fact the classifier read, as rule conditions read it. At most 50 rules are listed, results first; not_listed counts the rest. Another member's rule that decided on your own mail is listed read_only (dashboard and CLI only), with who receives what it shares (receivers) while it covers you; hidden counts deciding rules you cannot see. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token).
3800
+ * What each rule you can see decided about this email (matched, not matched, or not run), in the words of the deciding version. A do_not_share rule that matched it blocks sharing while active; earlier shares stay. Only a caller who can read the email gets an answer. classification is every fact the classifier read, as rule conditions read it. At most 50 rules are listed, results first; not_listed counts the rest. Another member's rule that decided on your own mail is listed read_only (dashboard and CLI only), with who receives what it shares (receivers) while it covers you; hidden counts deciding rules you cannot see. Whether a rule delivered the email by webhook is not in the rule results: on your own mail, rule_deliveries on GET /v1/emails/{id} (primitive emails get <email-id> --json) counts each rule's webhook deliveries; on another member's mail, GET /v1/webhooks/deliveries?email_id=<email-id> (primitive webhook-deliveries list --email-id <email-id>, with webhooks:read) lists them. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token).
3800
3801
  */
3801
3802
  const listEmailRuleResults = (options) => (options.client ?? client).get({
3802
3803
  security: [{
@@ -4033,7 +4034,7 @@ const listEmailRuleShareEmails = (options) => (options.client ?? client).get({
4033
4034
  /**
4034
4035
  * List the rules over your mail
4035
4036
  *
4036
- * Every email rule that covers one of your own mailboxes now, yours included, newest first, in any state. A rule covers you when the scope it runs with now reaches one of your own mailboxes (your member mailbox, or a personal agent's address): one whose author reads all your mail (author scope, for an author who reads the organization's mail or holds an access entry for your mailbox), or one that names your mailbox or its domain (selected). Another member's own_mailboxes rule never covers you. You see its name, wording, current tree, state, kind and author, and which of your own mailboxes it reaches. Its wording and tree are shown as written, so they can name other addresses (a condition on who an email is from or to). While it covers you, you also see who receives what it matches (receivers): how many API keys, webhooks and shares, the member each belongs to (or the organization), and the sites the webhooks deliver to. You do not see which keys, webhooks or shares they are (no ids, names, prefixes, or URLs beyond the site), the other inboxes and domains its scope names, or its saved expectations. A page can hold fewer rules than limit, or none, and still carry a cursor (one request reads a bounded number of rules): keep reading until meta.cursor is null. For what happened to one email of yours, every rule's decision on it and, for another member's rule covering you, who receives what it shares: GET /v1/emails/{id}/rule-results (primitive email-rules list-email-rule-results --email-id <email-id>). 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.
4037
+ * Every email rule that covers one of your own mailboxes now, yours included, newest first, in any state. A rule covers you when the scope it runs with now reaches one of your own mailboxes (your member mailbox, or a personal agent's address), and covers.via says how: author_reach, it runs over everything its author can read, which includes your mail (an author who reads the organization's mail or holds an access entry for your mailbox); selected, it names your mailbox or its domain; own_mailboxes, it is your own rule over your own mail. Another member's own_mailboxes rule never covers you. You see its name, wording, current tree, state, kind and author, and which of your own mailboxes it reaches. Its wording and tree are shown as written, so they can name other addresses (a condition on who an email is from or to). While it covers you, you also see who receives what it matches (receivers): how many API keys, webhooks and shares, the member each belongs to (or the organization), and the sites the webhooks deliver to. You do not see which keys, webhooks or shares they are (no ids, names, prefixes, or URLs beyond the site), the other inboxes and domains its scope names, or its saved expectations. Each listed rule carries its current version's english and explanation; its tree is on GET /v1/email-rules/covering-me/{id}. A page can hold fewer rules than limit, or none, and still carry a cursor (one request reads a bounded number of rules): keep reading until meta.cursor is null. For what happened to one email of yours, every rule's decision on it and, for another member's rule covering you, who receives what it shares: GET /v1/emails/{id}/rule-results (primitive email-rules list-email-rule-results --email-id <email-id>). Whether a rule delivered the email by webhook is not in the rule results: on your own mail, rule_deliveries on GET /v1/emails/{id} (primitive emails get <email-id> --json) counts each rule's webhook deliveries; on another member's mail, GET /v1/webhooks/deliveries?email_id=<email-id> (primitive webhook-deliveries list --email-id <email-id>, with webhooks:read) lists them. 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.
4037
4038
  */
4038
4039
  const listEmailRulesCoveringMe = (options) => (options?.client ?? client).get({
4039
4040
  security: [{
@@ -4046,7 +4047,7 @@ const listEmailRulesCoveringMe = (options) => (options?.client ?? client).get({
4046
4047
  /**
4047
4048
  * Get a rule over your mail
4048
4049
  *
4049
- * One rule that covers one of your own mailboxes, read-only, with its current version; or one that no longer does but decided on mail at your own mailbox (covers_now false), shown as the version that last decided on your mail, without its current name. You see its name, wording, current tree, state, kind and author, and which of your own mailboxes it reaches. Its wording and tree are shown as written, so they can name other addresses (a condition on who an email is from or to). While it covers you, you also see who receives what it matches (receivers): how many API keys, webhooks and shares, the member each belongs to (or the organization), and the sites the webhooks deliver to. You do not see which keys, webhooks or shares they are (no ids, names, prefixes, or URLs beyond the site), the other inboxes and domains its scope names, or its saved expectations. For what happened to one email of yours, every rule's decision on it and, for another member's rule covering you, who receives what it shares: GET /v1/emails/{id}/rule-results (primitive email-rules list-email-rule-results --email-id <email-id>). 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.
4050
+ * One rule that covers one of your own mailboxes, read-only, with its current version; or one that no longer does but decided on mail at your own mailbox (covers_now false), shown as the version that last decided on your mail, without its current name. You see its name, wording, current tree, state, kind and author, and which of your own mailboxes it reaches. Its wording and tree are shown as written, so they can name other addresses (a condition on who an email is from or to). While it covers you, you also see who receives what it matches (receivers): how many API keys, webhooks and shares, the member each belongs to (or the organization), and the sites the webhooks deliver to. You do not see which keys, webhooks or shares they are (no ids, names, prefixes, or URLs beyond the site), the other inboxes and domains its scope names, or its saved expectations. For what happened to one email of yours, every rule's decision on it and, for another member's rule covering you, who receives what it shares: GET /v1/emails/{id}/rule-results (primitive email-rules list-email-rule-results --email-id <email-id>). Whether a rule delivered the email by webhook is not in the rule results: on your own mail, rule_deliveries on GET /v1/emails/{id} (primitive emails get <email-id> --json) counts each rule's webhook deliveries; on another member's mail, GET /v1/webhooks/deliveries?email_id=<email-id> (primitive webhook-deliveries list --email-id <email-id>, with webhooks:read) lists them. 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.
4050
4051
  */
4051
4052
  const getEmailRuleCoveringMe = (options) => (options.client ?? client).get({
4052
4053
  security: [{
@@ -4085,7 +4086,7 @@ const listEmailRuleVersionsCoveringMe = (options) => (options.client ?? client).
4085
4086
  /**
4086
4087
  * List objections
4087
4088
  *
4088
- * 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.
4089
+ * 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.
4089
4090
  */
4090
4091
  const listEmailRuleObjections = (options) => (options?.client ?? client).get({
4091
4092
  security: [{
@@ -4098,7 +4099,7 @@ const listEmailRuleObjections = (options) => (options?.client ?? client).get({
4098
4099
  /**
4099
4100
  * Object to a rule over your mail
4100
4101
  *
4101
- * 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.
4102
+ * 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.
4102
4103
  */
4103
4104
  const createEmailRuleObjection = (options) => (options.client ?? client).post({
4104
4105
  security: [{
@@ -4115,7 +4116,7 @@ const createEmailRuleObjection = (options) => (options.client ?? client).post({
4115
4116
  /**
4116
4117
  * Get an objection
4117
4118
  *
4118
- * 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.
4119
+ * 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.
4119
4120
  */
4120
4121
  const getEmailRuleObjection = (options) => (options.client ?? client).get({
4121
4122
  security: [{
@@ -4128,7 +4129,7 @@ const getEmailRuleObjection = (options) => (options.client ?? client).get({
4128
4129
  /**
4129
4130
  * Withdraw an objection
4130
4131
  *
4131
- * 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.
4132
+ * 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.
4132
4133
  */
4133
4134
  const withdrawEmailRuleObjection = (options) => (options.client ?? client).post({
4134
4135
  security: [{
@@ -4141,7 +4142,7 @@ const withdrawEmailRuleObjection = (options) => (options.client ?? client).post(
4141
4142
  /**
4142
4143
  * Decline an objection to your rule
4143
4144
  *
4144
- * 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.
4145
+ * 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.
4145
4146
  */
4146
4147
  const declineEmailRuleObjection = (options) => (options.client ?? client).post({
4147
4148
  security: [{
@@ -4169,6 +4170,23 @@ const acceptEmailRuleObjection = (options) => (options.client ?? client).post({
4169
4170
  ...options
4170
4171
  });
4171
4172
  /**
4173
+ * Answer an objection to your rule as amended
4174
+ *
4175
+ * 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.
4176
+ */
4177
+ const amendEmailRuleObjection = (options) => (options.client ?? client).post({
4178
+ security: [{
4179
+ scheme: "bearer",
4180
+ type: "http"
4181
+ }],
4182
+ url: "/email-rule-objections/{id}/amend",
4183
+ ...options,
4184
+ headers: {
4185
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
4186
+ ...options.headers
4187
+ }
4188
+ });
4189
+ /**
4172
4190
  * Get a domain's Agent Authorization status
4173
4191
  *
4174
4192
  * Whether the domain publishes an Agent Authorization (`_agents`) TXT record that lets agents on Primitive email it, read from DNS with the same engine the send path uses (an answer may be up to five minutes old): published (a record authorizes them), published_unauthorized (a record exists but does not), not_set_up (no record, the default) or inconclusive (the lookup could not tell; retry). The domain is one of the organization's, verified or pending; a credential confined to some mailboxes sees only the domains its scope covers. Needs domains:read.
@@ -25934,4 +25952,4 @@ function repeatStopCommand(emailId) {
25934
25952
  if (!UUID.test(emailId)) throw new TypeError("emailId must be an email UUID");
25935
25953
  return `primitive repeat stop --id ${emailId.toLowerCase()}`;
25936
25954
  }
25937
- export { isTrustedSender as $, setMemory as $n, getOwnGrant as $t, filtersFromFlags as A, listWakeAuthorizations as An, deleteWakeAuthorization as At, awaitingRejectedError as B, reorderRoutes as Bn, getContact as Bt, transientFailure as C, listMailboxAccess as Cn, createRoute as Ct, cursorFromAcceptedRows as D, listRoutes as Dn, deleteContact as Dt, collectNewAcceptedEmails as E, listRoles as En, deleteAgentContact as Et, AWAITING_FLAG_DESCRIPTION as F, putAgentContact as Fn, downloadSentAttachmentArchiveMember as Ft, isAwaitingRejectedError as G, runWakeSchedule as Gn, getFunction as Gt, formatAwaitingCell as H, resendAgentSignupVerification as Hn, getCreditBalance as Ht, AWAITING_VALUES as I, putAgentContactPolicy as In, downloadSentAttachmentByFilename as It, EMAIL_RULE_OBJECTION_EVENT_TYPES as J, searchMemories as Jn, getInboxStatus as Jt, queryUsesAwaiting as K, sdk_gen_exports as Kn, getFunctionRouting as Kt, REPLY_STATE_UNSUPPORTED_CODE as L, putContact as Ln, getAccessMode as Lt, quoteDslValue as M, listWakeSchedules as Mn, downloadEmailAttachmentArchiveMember as Mt, sinceFromFlags as N, pollCliLogin as Nn, downloadEmailAttachmentByFilename as Nt, encodeReceivedAtSearchCursor as O, listSentAttachmentArchiveMembers as On, deleteMemory as Ot, sleep as P, pullWebhookEvent as Pn, downloadEmailAttachmentPart as Pt, isEmailReceivedEvent as Q, setFunctionSecret as Qn, getOutboundStatus as Qt, ReplyStateUnsupportedError as R, redeemCreditCode as Rn, getAccount as Rt, retryingOperation as S, listKeys as Sn, createKey as St, SINCE_VALUE_HELP as T, listRepeatingSends as Tn, createWakeSchedule as Tt, formatRepliesCell as U, revokeCredential as Un, getDefaultNetworkAgent as Ut, ensureSearchReportsReplyState as V, replyToEmail as Vn, getConversation as Vt, hasReplyState as W, rotateKey as Wn, getEmail as Wt, SENT_EMAIL_EVENT_TYPES as X, sendEmail as Xn, getMemory as Xt, EMAIL_RULE_REQUEST_EVENT_TYPES as Y, semanticSearch as Yn, getKey as Yt, WEBHOOK_EVENT_TYPES as Z, setFunctionRoute as Zn, getOrgRoutingTopology as Zt, backoffDelay as _, listEmails as _n, __exportAll as _r, checkSendability as _t, REPEAT_IDLE_MAX_MINUTES as a, inviteAgentConnection as an, testFunction as ar, AutomatedFilterUnsupportedError as at, pauseForTransientFailure as b, listFunctions as bn, createEndpoint as bt, classifySignalContent as c, listAgentConnections as cn, updateFunction as cr, automatedSurfaceForOperation as ct, parseRepeatTick as d, listContacts as dn, updateRoute as dr, hasAutomatedVerdict as dt, getRepeatingSend as en, simulateRoute as er, parseWebhookEvent as et, preparePresenceAliveEmail as f, listDefaultNetworkAgents as fn, updateWakeAuthorization as fr, isAutomatedRejectedError as ft, WaitDeadlineReached as g, listEmailRuleResults as gn, whoami as gr, checkDefaultNetworkContactAdmission as gt, sendPreparedSignal as h, listEmailAttachmentArchiveMembers as hn, verifyAgentSignup as hr, cancelSentEmailByIdempotencyKey as ht, REPEAT_EVERY_MAX_MINUTES as i, getWakeSchedule as in, stopRepeatFromEmail as ir, AUTOMATED_VALUES as it, lateMailReread as j, listWakeDispatches as jn, deleteWakeSchedule as jt, fetchEmailSearchPage as k, listSentEmails as kn, deleteRoute as kt, parseInteractionEnvelope as l, listAgentContacts as ln, updateKey as lr, ensureSearchReportsAutomated as lt, repeatStopCommand as m, listDomains as mn, verifyAgentClaim as mr, cancelSentEmail as mt, MAX_PRESENCE_ENVELOPE_BYTES as n, getSentEmail as nn, startAgentSignup as nr, AUTOMATED_FILTER_UNSUPPORTED_CODE as nt, REPEAT_MAX_SENDS_MAX as o, leaveOrganization as on, unsetFunctionRoute as or, assertAutomatedVerdict as ot, prepareSignalEmail as p, listDefaultNetworkMembers as pn, updateWakeSchedule as pr, addDefaultNetworkMember as pt, replyStateSurfaceForOperation as q, searchEmails as qn, getFunctionTestRunTrace as qt, PRESENCE_PROBE_TEXT as r, getThread as rn, startCliLogin as rr, AUTOMATED_FLAG_DESCRIPTION as rt, buildRepeatStopBody as s, listActivityObjects as sn, updateDefaultNetworkMember as sr, automatedRejectedError as st, MAX_INTERACTION_BYTES as t, getSendFrom as tn, startAgentClaim as tr, parseFromHeader as tt, parsePresenceEnvelope as u, listAgentNetworks as un, updateRepeatingSend as ur, expectedAutomatedVerdicts as ut, describeApiFailure as v, listEndpoints as vn, cliLogout as vt, waitOutRetryAfter as w, listOrganizationPeople as wn, createWakeAuthorization as wt, retryTransient as x, listGroups as xn, createFunction as xt, parseRetryAfter as y, listFunctionLogs as yn, completeWebhookEvent as yt, assertAwaitingFilterRows as z, removeDefaultNetworkMember as zn, getAgentContactPolicy as zt };
25955
+ export { isTrustedSender as $, setFunctionSecret as $n, getOwnGrant as $t, filtersFromFlags as A, listSentEmails as An, deleteWakeAuthorization as At, awaitingRejectedError as B, removeDefaultNetworkMember as Bn, getContact as Bt, transientFailure as C, listKeys as Cn, createRoute as Ct, cursorFromAcceptedRows as D, listRoles as Dn, deleteContact as Dt, collectNewAcceptedEmails as E, listRepeatingSends as En, deleteAgentContact as Et, AWAITING_FLAG_DESCRIPTION as F, pullWebhookEvent as Fn, downloadSentAttachmentArchiveMember as Ft, isAwaitingRejectedError as G, rotateKey as Gn, getFunction as Gt, formatAwaitingCell as H, replyToEmail as Hn, getCreditBalance as Ht, AWAITING_VALUES as I, putAgentContact as In, downloadSentAttachmentByFilename as It, EMAIL_RULE_OBJECTION_EVENT_TYPES as J, searchEmails as Jn, getInboxStatus as Jt, queryUsesAwaiting as K, runWakeSchedule as Kn, getFunctionRouting as Kt, REPLY_STATE_UNSUPPORTED_CODE as L, putAgentContactPolicy as Ln, getAccessMode as Lt, quoteDslValue as M, listWakeDispatches as Mn, downloadEmailAttachmentArchiveMember as Mt, sinceFromFlags as N, listWakeSchedules as Nn, downloadEmailAttachmentByFilename as Nt, encodeReceivedAtSearchCursor as O, listRoutes as On, deleteMemory as Ot, sleep as P, pollCliLogin as Pn, downloadEmailAttachmentPart as Pt, isEmailReceivedEvent as Q, setFunctionRoute as Qn, getOutboundStatus as Qt, ReplyStateUnsupportedError as R, putContact as Rn, getAccount as Rt, retryingOperation as S, listGroups as Sn, createKey as St, SINCE_VALUE_HELP as T, listOrganizationPeople as Tn, createWakeSchedule as Tt, formatRepliesCell as U, resendAgentSignupVerification as Un, getDefaultNetworkAgent as Ut, ensureSearchReportsReplyState as V, reorderRoutes as Vn, getConversation as Vt, hasReplyState as W, revokeCredential as Wn, getEmail as Wt, SENT_EMAIL_EVENT_TYPES as X, semanticSearch as Xn, getMemory as Xt, EMAIL_RULE_REQUEST_EVENT_TYPES as Y, searchMemories as Yn, getKey as Yt, WEBHOOK_EVENT_TYPES as Z, sendEmail as Zn, getOrgRoutingTopology as Zt, backoffDelay as _, listEmailRulesCoveringMe as _n, whoami as _r, checkSendability as _t, REPEAT_IDLE_MAX_MINUTES as a, inviteAgentConnection as an, stopRepeatFromEmail as ar, AutomatedFilterUnsupportedError as at, pauseForTransientFailure as b, listFunctionLogs as bn, createEndpoint as bt, classifySignalContent as c, listAgentConnections as cn, updateDefaultNetworkMember as cr, automatedSurfaceForOperation as ct, parseRepeatTick as d, listContacts as dn, updateRepeatingSend as dr, hasAutomatedVerdict as dt, getRepeatingSend as en, setMemory as er, parseWebhookEvent as et, preparePresenceAliveEmail as f, listDefaultNetworkAgents as fn, updateRoute as fr, isAutomatedRejectedError as ft, WaitDeadlineReached as g, listEmailRuleResults as gn, verifyAgentSignup as gr, checkDefaultNetworkContactAdmission as gt, sendPreparedSignal as h, listEmailAttachmentArchiveMembers as hn, verifyAgentClaim as hr, cancelSentEmailByIdempotencyKey as ht, REPEAT_EVERY_MAX_MINUTES as i, getWakeSchedule as in, startCliLogin as ir, AUTOMATED_VALUES as it, lateMailReread as j, listWakeAuthorizations as jn, deleteWakeSchedule as jt, fetchEmailSearchPage as k, listSentAttachmentArchiveMembers as kn, deleteRoute as kt, parseInteractionEnvelope as l, listAgentContacts as ln, updateFunction as lr, ensureSearchReportsAutomated as lt, repeatStopCommand as m, listDomains as mn, updateWakeSchedule as mr, cancelSentEmail as mt, MAX_PRESENCE_ENVELOPE_BYTES as n, getSentEmail as nn, startAgentClaim as nr, AUTOMATED_FILTER_UNSUPPORTED_CODE as nt, REPEAT_MAX_SENDS_MAX as o, leaveOrganization as on, testFunction as or, assertAutomatedVerdict as ot, prepareSignalEmail as p, listDefaultNetworkMembers as pn, updateWakeAuthorization as pr, addDefaultNetworkMember as pt, replyStateSurfaceForOperation as q, sdk_gen_exports as qn, getFunctionTestRunTrace as qt, PRESENCE_PROBE_TEXT as r, getThread as rn, startAgentSignup as rr, AUTOMATED_FLAG_DESCRIPTION as rt, buildRepeatStopBody as s, listActivityObjects as sn, unsetFunctionRoute as sr, automatedRejectedError as st, MAX_INTERACTION_BYTES as t, getSendFrom as tn, simulateRoute as tr, parseFromHeader as tt, parsePresenceEnvelope as u, listAgentNetworks as un, updateKey as ur, expectedAutomatedVerdicts as ut, describeApiFailure as v, listEmails as vn, __exportAll as vr, cliLogout as vt, waitOutRetryAfter as w, listMailboxAccess as wn, createWakeAuthorization as wt, retryTransient as x, listFunctions as xn, createFunction as xt, parseRetryAfter as y, listEndpoints as yn, completeWebhookEvent as yt, assertAwaitingFilterRows as z, redeemCreditCode as zn, getAgentContactPolicy as zt };
@@ -1,4 +1,4 @@
1
- import { $ as isTrustedSender, c as classifySignalContent, x as retryTransient } from "./repeats-Dj_o6c-X-C1y88ZwJ.js";
1
+ import { $ as isTrustedSender, c as classifySignalContent, x as retryTransient } from "./repeats-Dj_o6c-X-DlfpQiUq.js";
2
2
  // src/oclif/presence-provenance.ts
3
3
  function readPresenceProjection(detail) {
4
4
  if (!detail || typeof detail !== "object") return null;
@@ -1,15 +1,15 @@
1
- import { Wt as getEmail, Xn as sendEmail, bt as createEndpoint, h as sendPreparedSignal, kn as listSentEmails, p as prepareSignalEmail, v as describeApiFailure } from "./repeats-Dj_o6c-X-C1y88ZwJ.js";
2
- import { M as bareAddress, Ot as successfulSendOutcome, ft as classifySendError, s as extractErrorPayload } from "./api-command-D5Nbd6Pq.js";
1
+ import { An as listSentEmails, Wt as getEmail, Zn as sendEmail, bt as createEndpoint, h as sendPreparedSignal, p as prepareSignalEmail, v as describeApiFailure } from "./repeats-Dj_o6c-X-DlfpQiUq.js";
2
+ import { At as successfulSendOutcome, N as bareAddress, pt as classifySendError, s as extractErrorPayload } from "./api-command-CgBNtNyD.js";
3
3
  import { recordSentSignal } from "./oclif/auto-signals.js";
4
4
  import { _ as acquireListenLock, c as mailTime, d as readMailJson, f as removeMailFile, h as writeMailJson, i as mailId, l as privateMailDirectory, m as withMailLock, n as invalidSharedMail, o as mailObject, p as syncMailDirectory, r as mailAddress, s as mailString, t as SharedMailStateError, v as compareListenProcessIdentity, x as listenProcessIdentity, y as listenIdentity } from "./shared-mail-files-BAQSGxxz.js";
5
- import { i as readApiBeforeDeadline, n as isPlainChatReply, o as scopedChatSenderTrust } from "./scoped-chat-CocomDwR.js";
5
+ import { i as readApiBeforeDeadline, n as isPlainChatReply, o as scopedChatSenderTrust } from "./scoped-chat-Du-Bi0tC.js";
6
6
  import { n as tryOwnSharedMail, r as waitForSharedMailChange, t as readSharedMailOwner } from "./shared-mail-watch-BAPMsFNv.js";
7
7
  import { Errors } from "@oclif/core";
8
8
  import { opendirSync } from "node:fs";
9
9
  import { createHash, randomUUID, scryptSync } from "node:crypto";
10
10
  import { dirname, join } from "node:path";
11
11
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
12
- // ../sdk-node/dist/api-L6Tdi4am.js
12
+ // ../sdk-node/dist/api-Bm-YOKa1.js
13
13
  const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
14
14
  function createSseClient({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) {
15
15
  let lastEventId;
@@ -1831,6 +1831,10 @@ async function openSharedMailStore(options) {
1831
1831
  /** The API's code for an account credential creating a pull subscription. */
1832
1832
  const AGENT_CONNECTION_REQUIRED = "pull_subscription_requires_agent_connection";
1833
1833
  const AGENT_CONNECTION_REQUIRED_MESSAGE = "primitive listen needs a connected agent credential, which limits the subscription to one address. Connect one with primitive agent connect and select its profile. With an account API key, watch mail with primitive emails watch or receive it at an HTTP webhook endpoint instead.";
1834
+ /** The API's code for a full API key that was revoked. */
1835
+ const KEY_REVOKED = "key_revoked";
1836
+ /** What a listener says when its agent's key was revoked: connect again, as signing in cannot bring it back. */
1837
+ const KEY_REVOKED_MESSAGE = "This agent's key was revoked, so it no longer works. Connect the agent again for a new one; signing in does not bring it back.";
1834
1838
  /** Connected-agent API keys are the only credentials that can create pull subscriptions. */
1835
1839
  function isConnectedAgentKey(apiKey) {
1836
1840
  return apiKey?.startsWith("pconn_") === true;
@@ -1855,7 +1859,9 @@ async function ensureSharedMailSubscription(options) {
1855
1859
  responseStyle: "fields"
1856
1860
  });
1857
1861
  if (result.error || !result.data?.data) {
1858
- if (result.error?.error?.code === "pull_subscription_requires_agent_connection") throw new EventReceiverError(AGENT_CONNECTION_REQUIRED_MESSAGE, AGENT_CONNECTION_REQUIRED, 403);
1862
+ const error = result.error;
1863
+ if (error?.error?.code === "pull_subscription_requires_agent_connection") throw new EventReceiverError(AGENT_CONNECTION_REQUIRED_MESSAGE, AGENT_CONNECTION_REQUIRED, 403);
1864
+ if (error?.error?.code === "key_revoked") throw new EventReceiverError(KEY_REVOKED_MESSAGE, KEY_REVOKED, 401);
1859
1865
  throw new EventReceiverError("Could not open the shared inbound subscription.", "subscription_failed", result.response?.status ?? 0);
1860
1866
  }
1861
1867
  const created = result.data.data;
@@ -2338,4 +2344,4 @@ async function sendSignal(context, options) {
2338
2344
  release();
2339
2345
  }
2340
2346
  }
2341
- export { ensureSharedMailSubscription as a, isConnectedAgentKey as c, reserveSharedMailSubscription as d, followEmailConversation as f, EventReceiverError as g, EventConnection as h, sharedMailScope as i, createSharedMailWaiter as l, otherParticipants as m, reconcileChatSend as n, AGENT_CONNECTION_REQUIRED as o, readConversationFollow as p, openSharedMailReceiver as r, AGENT_CONNECTION_REQUIRED_MESSAGE as s, sendSignal as t, openSharedMailStore as u };
2347
+ export { EventConnection as _, ensureSharedMailSubscription as a, KEY_REVOKED as c, createSharedMailWaiter as d, openSharedMailStore as f, otherParticipants as g, readConversationFollow as h, sharedMailScope as i, KEY_REVOKED_MESSAGE as l, followEmailConversation as m, reconcileChatSend as n, AGENT_CONNECTION_REQUIRED as o, reserveSharedMailSubscription as p, openSharedMailReceiver as r, AGENT_CONNECTION_REQUIRED_MESSAGE as s, sendSignal as t, isConnectedAgentKey as u, EventReceiverError as v };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitivedotdev/cli",
3
- "version": "3.0.0-preview.15",
3
+ "version": "3.0.0-preview.17",
4
4
  "publishConfig": {
5
5
  "tag": "preview"
6
6
  },
@@ -95,7 +95,7 @@
95
95
  "description": "Check inbound email setup and readiness, and work through mail awaiting your reply. Prefer `primitive inbox setup` for a guided setup path, `primitive inbox status` for the readiness table, and `primitive inbox next` for the oldest email awaiting your reply."
96
96
  },
97
97
  "emails": {
98
- "description": "List, inspect, and wait for received emails, and see what the classifier read from one. Prefer task aliases like `primitive emails list`, `primitive emails get`, `primitive emails latest`, `primitive emails facts`, `primitive emails wait`, and `primitive emails watch`; generated API names remain available for compatibility."
98
+ "description": "List, inspect, and wait for received emails, and see what the classifier read from one. Prefer task aliases like `primitive emails list`, `primitive emails get`, `primitive emails latest`, `primitive emails facts`, `primitive emails wait`, and `primitive emails watch`; generated API names remain available for compatibility. For a one-line-per-email table, `primitive emails latest --limit 100`."
99
99
  },
100
100
  "search": {
101
101
  "description": "Cross-corpus semantic search. Prefer `primitive search <query>` for lexical inbound search and `primitive semantic-search <query>` for meaning-aware ranking across inbound and outbound.",
@@ -186,7 +186,7 @@
186
186
  "description": "Received and sent mail per hour, and how webhook deliveries ended"
187
187
  },
188
188
  "activity": {
189
- "description": "What you created, what other members asked of you, and what their rules did to your mail, with where each stands now (ids, names and states only)"
189
+ "description": "Where you learn what others asked of you and did to your mail: `primitive activity asked` (rule requests for your mail and objections to your rules), `primitive activity concerning` (other members' rules that started covering your mail or changed), and `primitive activity created` (what you created, including your requests and how they were decided). `primitive doctor` sums up what is waiting for you."
190
190
  },
191
191
  "email-rules": {
192
192
  "description": "Rules written in plain English that pick out received mail"