@primitivedotdev/cli 3.0.0-preview.15 → 3.0.0-preview.16
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.
- package/dist/{api-command-D5Nbd6Pq.js → api-command-D1LX7Tjj.js} +811 -435
- package/dist/{machine-session-DyGP7wDs.js → machine-session-DJoBSWTy.js} +4 -4
- package/dist/{notify-session-B64Lgv6Z.js → notify-session-7oM8bkRx.js} +2 -2
- package/dist/oclif/auto-signal-worker.js +3 -3
- package/dist/oclif/auto-signals.js +1 -1
- package/dist/oclif/help.js +5 -2
- package/dist/oclif/index.js +207 -85
- package/dist/oclif/receiver-heal.js +2 -2
- package/dist/{repeats-Dj_o6c-X-C1y88ZwJ.js → repeats-Dj_o6c-X-BLUY-8zn.js} +5 -5
- package/dist/{scoped-chat-CocomDwR.js → scoped-chat-CrQpmC0K.js} +1 -1
- package/dist/{signal-command-lJM0763f.js → signal-command-Bkr_XwLC.js} +4 -4
- package/package.json +3 -3
package/dist/oclif/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { $ as interactionNextActions, $t as
|
|
2
|
-
import { $n as
|
|
3
|
-
import { S as readBundledConnectSkill, _ as NotificationOutcomeUnknownError, a as NotificationRetryError, b as installedConnectSkillFile, c as readConversationStatusContent, d as SESSION_UUID$1, g as NativeSessionNotLoadedError, h as NativeSessionError, i as notificationReceiptPage, l as createListenHandler, m as NativeSessionDisconnectedError, n as notificationSenders, o as isRoutineNotificationContent, p as defaultSessionSocket, r as openSessionNotifications, s as notificationPartReader, t as notificationScope, u as readableDelivery, v as connectSkillTarget, x as installedVersion, y as installConnectSkill } from "../notify-session-
|
|
1
|
+
import { $ as interactionNextActions, $t as withAttachmentWait, A as openBrowser, At as thrownErrorExitCode, B as serverRelationship, Bt as detectRuntimeSession, C as approveThenRerunHint, Ct as sendErrorMessage, D as canOfferCopyHotkey, Dt as sentHistoryWindowStart, E as withApproval, Et as sendWaitClampNotice, F as formatMailWakeLine, Ft as generatedAgentName, G as claimPendingMail, Gt as mailReach, H as wakeReadCommand, Ht as formatAlreadySentNotice, I as latestOwnOutbound, It as identitySuggestions, J as pendingMailPath, Jt as classificationOf, K as clearConsumedPendingMail, Kt as readCallerMailFor, L as readThreadContext, Lt as loadSkillLine, M as bareAddress, Mt as cliInvocation, N as describeWake, Nt as connectNextSteps, O as formatBrowserLoginInstructions, Ot as serializeErrorPayload, P as displayAddress, Q as interactionHumanLine, Qt as ATTACHMENT_WAIT_MAX_MS, R as sentInThread, Rt as currentMailSessionKey, S as STEP_UP_TOKEN_FLAG_DESCRIPTION, St as reportSendCommandResult, T as terminalApprovalIo, Tt as sendOutcomeExitCode, U as wakeRecipientField, Ut as withFlagSuggestion, Vt as runtimeSessionVariableList, W as wakeRelationship, Wt as emptyEmailListHint, X as recordPendingMail, Xt as noFactsMessage, Y as readPendingMail, Yt as isEmailId, Z as removePendingMail, Zt as ATTACHMENT_WAIT_FLAG_DESCRIPTION, _ as surfaceUnauthorizedHint, _n as routeWarningLines, _t as formatPriorRepliesCheckSkipped, a as createOperationCommand, an as refuseOrgSelectionForProfile, at as MAX_SEND_WAIT_TIMEOUT_MS, b as BROWSER_FLAG_DESCRIPTION, bn as operationManifest, bt as formatSendRecordFailureSummary, c as formatErrorPayload, cn as CliOrgRefusedError, ct as assertValidIdempotencyKey, d as isGrantRefusal, dn as fetchCliOrgs, dt as checkPriorReplies, en as ConnectedAgentKeyRequiredError, et as readEmailInteraction, f as networkErrorHint, fn as isBuiltInRoleKey, ft as classifySendError, g as runWithTiming, gn as switchCurrentOrg, gt as formatDeletedEarlierSendNotice, h as refusalDetails, hn as roleKeyText, ht as followUpCommandPrefix, i as TIME_FLAG_DESCRIPTION, in as refreshStoredCliCredentials, it as IDEMPOTENCY_KEY_FLAG_DESCRIPTION, j as explainPendingMailNotFound, k as listenForCopyHotkey, kt as successfulSendOutcome, l as hasControlCharacter$1, ln as RESTRICTED_ROLE_NOTE, lt as buildFollowUpCommand, m as readTextFileFlag, mn as roleKeyLabel, mt as excludeSignalReplies, n as API_ERROR_CODES, nn as createAuthenticatedCliApiClient, nt as replyInteractionWarning, o as extractErrorCode, on as resolveCliApiRequestConfig, ot as SEND_OUTCOME_HELP, p as parameterFlagName, pn as revokeUserLogin, pt as deriveSendIdempotencyKey, q as clearReadPendingMail, qt as classificationFactLines, r as OPERATION_PATH_FLAGS, rn as createCliApiClient, s as extractErrorPayload, sn as selectedOrgFromEnv, st as apiResultHttpStatus, t as API_BASE_URL_FLAG_DESCRIPTION, tt as replyExpectation, u as headerFlagName, un as credentialsFromUserLogin, ut as buildThrownSendFailureEnvelope, v as takesStepUp, vn as sanitizeForTerminal, vt as formatPriorRepliesWarning, w as promptLine$2, wt as sendIdentityFields, x as STEP_UP_HEADER$1, xt as priorRepliesThatWentOut, y as writeErrorWithHints, yn as setKnownCommands, yt as formatSendFailureSummary, z as serverMuted, zt as detectAgentRuntime } from "../api-command-D1LX7Tjj.js";
|
|
2
|
+
import { $n as setFunctionSecret, $t as getOwnGrant, A as filtersFromFlags, An as listSentEmails, At as deleteWakeAuthorization, B as awaitingRejectedError, Bn as removeDefaultNetworkMember, C as transientFailure, Cn as listKeys, Ct as createRoute, D as cursorFromAcceptedRows, Dn as listRoles, E as collectNewAcceptedEmails, En as listRepeatingSends, F as AWAITING_FLAG_DESCRIPTION, Fn as pullWebhookEvent, Ft as downloadSentAttachmentArchiveMember, G as isAwaitingRejectedError, Gn as rotateKey, Gt as getFunction, H as formatAwaitingCell, Hn as replyToEmail, Ht as getCreditBalance, I as AWAITING_VALUES, It as downloadSentAttachmentByFilename, Jn as searchEmails, Jt as getInboxStatus, K as queryUsesAwaiting, Kn as runWakeSchedule, Kt as getFunctionRouting, L as REPLY_STATE_UNSUPPORTED_CODE, Lt as getAccessMode, M as quoteDslValue, Mn as listWakeDispatches, Mt as downloadEmailAttachmentArchiveMember, N as sinceFromFlags, Nn as listWakeSchedules, Nt as downloadEmailAttachmentByFilename, O as encodeReceivedAtSearchCursor, On as listRoutes, Ot as deleteMemory, P as sleep$3, Pn as pollCliLogin, Q as isEmailReceivedEvent, Qn as setFunctionRoute, Qt as getOutboundStatus, R as ReplyStateUnsupportedError, Rt as getAccount, S as retryingOperation, Sn as listGroups, St as createKey, T as SINCE_VALUE_HELP, Tn as listOrganizationPeople, Tt as createWakeSchedule, U as formatRepliesCell, Un as resendAgentSignupVerification, Ut as getDefaultNetworkAgent, V as ensureSearchReportsReplyState, Vn as reorderRoutes, Vt as getConversation, W as hasReplyState, Wn as revokeCredential, Wt as getEmail, Xn as semanticSearch, Xt as getMemory, Yn as searchMemories, Yt as getKey, Zn as sendEmail, Zt as getOrgRoutingTopology, _ as backoffDelay, _n as listEmailRulesCoveringMe, _r as whoami, _t as checkSendability, a as REPEAT_IDLE_MAX_MINUTES, ar as stopRepeatFromEmail, at as AutomatedFilterUnsupportedError, b as pauseForTransientFailure, bn as listFunctionLogs, bt as createEndpoint, cr as updateDefaultNetworkMember, d as parseRepeatTick, dr as updateRepeatingSend, dt as hasAutomatedVerdict, en as getRepeatingSend, er as setMemory, et as parseWebhookEvent, f as preparePresenceAliveEmail, fn as listDefaultNetworkAgents, fr as updateRoute, ft as isAutomatedRejectedError, g as WaitDeadlineReached, gn as listEmailRuleResults, gr as verifyAgentSignup, gt as checkDefaultNetworkContactAdmission, hn as listEmailAttachmentArchiveMembers, hr as verifyAgentClaim, ht as cancelSentEmailByIdempotencyKey, i as REPEAT_EVERY_MAX_MINUTES, in as getWakeSchedule, ir as startCliLogin, it as AUTOMATED_VALUES, j as lateMailReread, jn as listWakeAuthorizations, jt as deleteWakeSchedule, k as fetchEmailSearchPage, kn as listSentAttachmentArchiveMembers, kt as deleteRoute, l as parseInteractionEnvelope, ln as listAgentContacts, lr as updateFunction, m as repeatStopCommand, mn as listDomains, mr as updateWakeSchedule, mt as cancelSentEmail, nn as getSentEmail, nr as startAgentClaim, nt as AUTOMATED_FILTER_UNSUPPORTED_CODE, o as REPEAT_MAX_SENDS_MAX, on as leaveOrganization, or as testFunction, ot as assertAutomatedVerdict, p as prepareSignalEmail, pn as listDefaultNetworkMembers, pr as updateWakeAuthorization, pt as addDefaultNetworkMember, qt as getFunctionTestRunTrace, rn as getThread, rr as startAgentSignup, rt as AUTOMATED_FLAG_DESCRIPTION, s as buildRepeatStopBody, sn as listActivityObjects, sr as unsetFunctionRoute, st as automatedRejectedError, tn as getSendFrom, tr as simulateRoute, tt as parseFromHeader, u as parsePresenceEnvelope, un as listAgentNetworks, ur as updateKey, v as describeApiFailure, vn as listEmails, vt as cliLogout, w as waitOutRetryAfter, wn as listMailboxAccess, wt as createWakeAuthorization, x as retryTransient, xn as listFunctions, xt as createFunction, yn as listEndpoints, yt as completeWebhookEvent, z as assertAwaitingFilterRows, zn as redeemCreditCode, zt as getAgentContactPolicy } from "../repeats-Dj_o6c-X-BLUY-8zn.js";
|
|
3
|
+
import { S as readBundledConnectSkill, _ as NotificationOutcomeUnknownError, a as NotificationRetryError, b as installedConnectSkillFile, c as readConversationStatusContent, d as SESSION_UUID$1, g as NativeSessionNotLoadedError, h as NativeSessionError, i as notificationReceiptPage, l as createListenHandler, m as NativeSessionDisconnectedError, n as notificationSenders, o as isRoutineNotificationContent, p as defaultSessionSocket, r as openSessionNotifications, s as notificationPartReader, t as notificationScope, u as readableDelivery, v as connectSkillTarget, x as installedVersion, y as installConnectSkill } from "../notify-session-7oM8bkRx.js";
|
|
4
4
|
import { A as AGENT_ADDRESS_ENV, C as saveCliCredentials, D as loadActiveChatState, E as deleteChatState, F as agentProfilesDirectory, H as requireDefaultLoginProfile, M as AgentConnectionSetupError, N as agentProfileDirectory, O as loadChatConversationByLocalId, P as agentProfileName, R as loadConnectedAgentProfile, S as resolveCliAuth, T as chatStatePath, W as PrimitiveApiClient, _ as deleteCliCredentials, a as normalizeCliEnvironmentName, b as loadCliCredentials, c as resolveConfigEnvironment, g as credentialsPath, h as credentialsLockPath, i as loadCliConfig, j as AGENT_PROFILE_ENV, k as saveActiveChatState, l as saveCliConfig, m as cliAccessTokenExpiresAt, n as deleteCliConfig, o as redactCliEnvironment, p as acquireCliCredentialsLock, r as emptyCliConfig, s as removeCliEnvironment, u as upsertCliEnvironment, v as deleteCliCredentialsLock, w as saveSignupCredentials, y as detectPrimitiveKeyEnvMisname } from "../cli-config-Ms_0vNjq.js";
|
|
5
5
|
import { C as resolveListenSubscription, S as normalizeListenOrigin, _ as acquireListenLock, a as mailLockBusy, c as mailTime, d as readMailJson, f as removeMailFile, g as ListenStateError, h as writeMailJson, i as mailId, l as privateMailDirectory, m as withMailLock, o as mailObject, u as privateMailPermissions, y as listenIdentity } from "../shared-mail-files-BAQSGxxz.js";
|
|
6
|
-
import { $ as saveConnectionName, A as ContactPolicyReadRetryError, B as AddressNotesApiError, C as RECEIVER_MODES, Ct as upsertManagedBlock, D as registrationSummary, Dt as refreshOwnerMemberAddressPeriodically, E as failedSessionRegistration, Et as addSessionReceiver, F as canonicalContactSelector, G as contactAgentAddress, H as runAddressNotesRequest, I as AgentDisconnectError, J as agentInvitationHash, K as runContactRequest, L as claimOverRevokedSetup, M as NetworkAdmissionPendingError, N as createNotificationContactPolicy, O as registrationSummaryLine, Ot as withOwnerMemberAddress, P as evaluateContactPolicy, Q as refusalAfterReplacement, R as clearRevokedAddresses, S as runAgentConnect, St as readManagedFile, T as verificationReplySubmitted, Tt as readHookLauncherWarning, U as ContactsApiError, V as addressNoteTarget, W as contactAddress, X as readAgentInvitation, Y as connectAgent, Z as receiverStatusCommand, _ as enrollmentResumes, _t as samePath, a as endSession, at as boundSessionProfiles, b as invitationProfileName, bt as inspectManagedBlock, c as pendingSessionDisconnects, ct as describeSessionHookChange, d as registerSession, dt as ephemeralCliReason, et as savedReceiver, f as retryPendingDisconnects, ft as findOnPath, g as enrollAgent, gt as repairClaudeHooks, h as staleSessionAgents, ht as readClaudeSettings, i as connectedProfilesForSession, it as recordHookMailCheck, j as NETWORK_ADMISSION_PENDING_RETRY_MS, k as waitForRegistrations, l as psProcessInfo, lt as describeSessionHookItem, m as runDetached, mt as inspectClaudeHooks, n as OMP_MAIN, nt as releaseRegistrationsForProfile, o as headlessClaudeRun, ot as claudeConfigDir, p as revokeStaleSessionAgents, pt as hasMachineSessionHooks, q as agentConnectionStatus, r as agentConnectionState, rt as installClaudeWakeHook, st as currentCliLocation, t as HOOK_END_GRACE_MS, tt as MACHINE_RUNTIMES, u as readClaudeHookInput, ut as ensureHookLauncher, v as connectWarnings, vt as writeClaudeSettings, w as externalReceivingState, wt as writeManagedFile, x as pollCheckCommand, xt as jsonIndentation, y as defaultAgentProfileName, yt as MachineFileError, z as disconnectAgent } from "../machine-session-
|
|
7
|
-
import { a as readBeforeDeadline, c as readPresenceProjection, i as readApiBeforeDeadline, n as isPlainChatReply, o as scopedChatSenderTrust, r as isScopedChatReply, s as presenceDisposition, t as isConnectedChatCredential } from "../scoped-chat-
|
|
6
|
+
import { $ as saveConnectionName, A as ContactPolicyReadRetryError, B as AddressNotesApiError, C as RECEIVER_MODES, Ct as upsertManagedBlock, D as registrationSummary, Dt as refreshOwnerMemberAddressPeriodically, E as failedSessionRegistration, Et as addSessionReceiver, F as canonicalContactSelector, G as contactAgentAddress, H as runAddressNotesRequest, I as AgentDisconnectError, J as agentInvitationHash, K as runContactRequest, L as claimOverRevokedSetup, M as NetworkAdmissionPendingError, N as createNotificationContactPolicy, O as registrationSummaryLine, Ot as withOwnerMemberAddress, P as evaluateContactPolicy, Q as refusalAfterReplacement, R as clearRevokedAddresses, S as runAgentConnect, St as readManagedFile, T as verificationReplySubmitted, Tt as readHookLauncherWarning, U as ContactsApiError, V as addressNoteTarget, W as contactAddress, X as readAgentInvitation, Y as connectAgent, Z as receiverStatusCommand, _ as enrollmentResumes, _t as samePath, a as endSession, at as boundSessionProfiles, b as invitationProfileName, bt as inspectManagedBlock, c as pendingSessionDisconnects, ct as describeSessionHookChange, d as registerSession, dt as ephemeralCliReason, et as savedReceiver, f as retryPendingDisconnects, ft as findOnPath, g as enrollAgent, gt as repairClaudeHooks, h as staleSessionAgents, ht as readClaudeSettings, i as connectedProfilesForSession, it as recordHookMailCheck, j as NETWORK_ADMISSION_PENDING_RETRY_MS, k as waitForRegistrations, l as psProcessInfo, lt as describeSessionHookItem, m as runDetached, mt as inspectClaudeHooks, n as OMP_MAIN, nt as releaseRegistrationsForProfile, o as headlessClaudeRun, ot as claudeConfigDir, p as revokeStaleSessionAgents, pt as hasMachineSessionHooks, q as agentConnectionStatus, r as agentConnectionState, rt as installClaudeWakeHook, st as currentCliLocation, t as HOOK_END_GRACE_MS, tt as MACHINE_RUNTIMES, u as readClaudeHookInput, ut as ensureHookLauncher, v as connectWarnings, vt as writeClaudeSettings, w as externalReceivingState, wt as writeManagedFile, x as pollCheckCommand, xt as jsonIndentation, y as defaultAgentProfileName, yt as MachineFileError, z as disconnectAgent } from "../machine-session-DJoBSWTy.js";
|
|
7
|
+
import { a as readBeforeDeadline, c as readPresenceProjection, i as readApiBeforeDeadline, n as isPlainChatReply, o as scopedChatSenderTrust, r as isScopedChatReply, s as presenceDisposition, t as isConnectedChatCredential } from "../scoped-chat-CrQpmC0K.js";
|
|
8
8
|
import { autoSignalEligible, dispatchAutoRead, dispatchAutoWorking, haltAutoWorking, isSentSignal, readWorkingLease, restoreAutoWorking } from "./auto-signals.js";
|
|
9
|
-
import { a as ensureSharedMailSubscription, c as isConnectedAgentKey, d as reserveSharedMailSubscription, f as followEmailConversation, g as EventReceiverError, h as EventConnection, i as sharedMailScope, l as createSharedMailWaiter, m as otherParticipants, n as reconcileChatSend, p as readConversationFollow, r as openSharedMailReceiver, s as AGENT_CONNECTION_REQUIRED_MESSAGE, t as sendSignal, u as openSharedMailStore } from "../signal-command-
|
|
9
|
+
import { a as ensureSharedMailSubscription, c as isConnectedAgentKey, d as reserveSharedMailSubscription, f as followEmailConversation, g as EventReceiverError, h as EventConnection, i as sharedMailScope, l as createSharedMailWaiter, m as otherParticipants, n as reconcileChatSend, p as readConversationFollow, r as openSharedMailReceiver, s as AGENT_CONNECTION_REQUIRED_MESSAGE, t as sendSignal, u as openSharedMailStore } from "../signal-command-Bkr_XwLC.js";
|
|
10
10
|
import { a as thrownErrorBody, i as runStreamingJson, n as guardJsonOutputCommands, r as jsonOutputRequested, t as JSON_OUTPUT_FLAG } from "../json-output-ch756TXV.js";
|
|
11
11
|
import { a as backgroundListenStatus, c as runBackgroundListen, d as stopBackgroundListen, f as verifyBackgroundListenTarget, o as backgroundListenToken, r as backgroundListenConfiguration, u as startBackgroundListen } from "../listen-background-DyBYca28.js";
|
|
12
12
|
import { ORG_SELECTION_ENV } from "./global-org-flag.js";
|
|
@@ -22755,7 +22755,7 @@ const openapiDocument = {
|
|
|
22755
22755
|
"patch": {
|
|
22756
22756
|
"operationId": "updateEmailRule",
|
|
22757
22757
|
"summary": "Change a rule",
|
|
22758
|
-
"description": "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
|
|
22758
|
+
"description": "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).",
|
|
22759
22759
|
"tags": ["Email Rules"],
|
|
22760
22760
|
"security": [{ "BearerAuth": [] }],
|
|
22761
22761
|
"parameters": [{
|
|
@@ -22788,7 +22788,7 @@ const openapiDocument = {
|
|
|
22788
22788
|
}
|
|
22789
22789
|
},
|
|
22790
22790
|
"400": {
|
|
22791
|
-
"description": "validation_error: invalid body or tree (details.errors), too large (too_large), a version that no longer renders (version_not_renderable), restore_version names the current version (already_current), over 20 made-up emails (too_many_expectation_samples), or a kind other than the rule's own (kind_mismatch). no_expectations: if_expectations_pass with no expectations to judge, or a write that removes them from an active rule keys or
|
|
22791
|
+
"description": "validation_error: invalid body or tree (details.errors), too large (too_large), a version that no longer renders (version_not_renderable), restore_version names the current version (already_current), over 20 made-up emails (too_many_expectation_samples), or a kind other than the rule's own (kind_mismatch). no_expectations: if_expectations_pass with no expectations to judge, or a write that removes them from an active rule keys, webhooks or a share read; nothing was saved.",
|
|
22792
22792
|
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
22793
22793
|
},
|
|
22794
22794
|
"401": {
|
|
@@ -22811,7 +22811,7 @@ const openapiDocument = {
|
|
|
22811
22811
|
}
|
|
22812
22812
|
},
|
|
22813
22813
|
"403": {
|
|
22814
|
-
"description": "feature_not_enabled: this organization lacks the email rules feature; permission refusals answer forbidden or grant_forbidden. email_rule_author_only: only the rule's author may make this change. forbidden (rule_shared): the rule is shared, so only its author or a member manager can turn it off. email_rule_scope_not_readable: scope_selection names something you cannot read. grant_forbidden (mail_depth): judging a write (if_expectations_pass, or by default) needs content access to mail when it judges emails by id.",
|
|
22814
|
+
"description": "feature_not_enabled: this organization lacks the email rules feature; permission refusals answer forbidden or grant_forbidden. email_rule_author_only: only the rule's author may make this change. forbidden (rule_shared): the rule is shared, so only its author or a member manager can turn it off. forbidden (first_party_required): a new version of a shared rule is saved only by its author on the dashboard or the Primitive CLI, never by an app or agent acting for them. email_rule_scope_not_readable: scope_selection names something you cannot read. grant_forbidden (mail_depth): judging a write (if_expectations_pass, or by default) needs content access to mail when it judges emails by id.",
|
|
22815
22815
|
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
22816
22816
|
},
|
|
22817
22817
|
"404": {
|
|
@@ -22819,7 +22819,7 @@ const openapiDocument = {
|
|
|
22819
22819
|
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
22820
22820
|
},
|
|
22821
22821
|
"409": {
|
|
22822
|
-
"description": "email_rule_conflict: the rule changed (details.reason version_moved with current_version, revision_moved with current_revision, expectations_moved, rule_changed or readers_changed); read it again and retry. email_rule_scope_locked: the rule is shared. email_rule_author_unresolvable: the rule could not run as you over the chosen scope. expectations_failed, expectations_unreadable (details.unreadable) or expectations_undecided, with if_expectations_pass or by default on an active rule keys or
|
|
22822
|
+
"description": "email_rule_conflict: the rule changed (details.reason version_moved with current_version, revision_moved with current_revision, expectations_moved, rule_changed or readers_changed); read it again and retry. email_rule_scope_locked: the rule is shared. email_rule_author_unresolvable: the rule could not run as you over the chosen scope. expectations_failed, expectations_unreadable (details.unreadable) or expectations_undecided, with if_expectations_pass or by default on an active rule keys, webhooks or a share read (details.read_by): nothing was saved; details carries current_version, state and expectations_check.",
|
|
22823
22823
|
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
22824
22824
|
},
|
|
22825
22825
|
"429": {
|
|
@@ -23093,7 +23093,7 @@ const openapiDocument = {
|
|
|
23093
23093
|
"/emails/{id}/rule-results": { "get": {
|
|
23094
23094
|
"operationId": "listEmailRuleResults",
|
|
23095
23095
|
"summary": "List every rule's result on an email",
|
|
23096
|
-
"description": "What each rule you can see decided about this email (matched, not matched, or not run), in the words of the deciding version. A do_not_share rule that matched it blocks sharing while active; earlier shares stay. Only a caller who can read the email gets an answer. classification is every fact the classifier read, as rule conditions read it. At most 50 rules are listed, results first; not_listed counts the rest. Another member's rule that decided on your own mail is listed read_only (dashboard and CLI only), with who receives what it shares (receivers) while it covers you; hidden counts deciding rules you cannot see. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token).",
|
|
23096
|
+
"description": "What each rule you can see decided about this email (matched, not matched, or not run), in the words of the deciding version. A do_not_share rule that matched it blocks sharing while active; earlier shares stay. Only a caller who can read the email gets an answer. classification is every fact the classifier read, as rule conditions read it. At most 50 rules are listed, results first; not_listed counts the rest. Another member's rule that decided on your own mail is listed read_only (dashboard and CLI only), with who receives what it shares (receivers) while it covers you; hidden counts deciding rules you cannot see. 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).",
|
|
23097
23097
|
"tags": ["Email Rules"],
|
|
23098
23098
|
"security": [{ "BearerAuth": [] }],
|
|
23099
23099
|
"parameters": [{
|
|
@@ -24881,7 +24881,7 @@ const openapiDocument = {
|
|
|
24881
24881
|
"/email-rules/covering-me": { "get": {
|
|
24882
24882
|
"operationId": "listEmailRulesCoveringMe",
|
|
24883
24883
|
"summary": "List the rules over your mail",
|
|
24884
|
-
"description": "Every email rule that covers one of your own mailboxes now, yours included, newest first, in any state. A rule covers you when the scope it runs with now reaches one of your own mailboxes (your member mailbox, or a personal agent's address):
|
|
24884
|
+
"description": "Every email rule that covers one of your own mailboxes now, yours included, newest first, in any state. A rule covers you when the scope it runs with now reaches one of your own mailboxes (your member mailbox, or a personal agent's address), 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.",
|
|
24885
24885
|
"tags": ["Email Rule Oversight"],
|
|
24886
24886
|
"security": [{ "BearerAuth": [] }],
|
|
24887
24887
|
"parameters": [{
|
|
@@ -24979,7 +24979,7 @@ const openapiDocument = {
|
|
|
24979
24979
|
"/email-rules/covering-me/{id}": { "get": {
|
|
24980
24980
|
"operationId": "getEmailRuleCoveringMe",
|
|
24981
24981
|
"summary": "Get a rule over your mail",
|
|
24982
|
-
"description": "One rule that covers one of your own mailboxes, read-only, with its current version; or one that no longer does but decided on mail at your own mailbox (covers_now false), shown as the version that last decided on your mail, without its current name. You see its name, wording, current tree, state, kind and author, and which of your own mailboxes it reaches. Its wording and tree are shown as written, so they can name other addresses (a condition on who an email is from or to). While it covers you, you also see who receives what it matches (receivers): how many API keys, webhooks and shares, 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.",
|
|
24982
|
+
"description": "One rule that covers one of your own mailboxes, read-only, with its current version; or one that no longer does but decided on mail at your own mailbox (covers_now false), shown as the version that last decided on your mail, without its current name. You see its name, wording, current tree, state, kind and author, and which of your own mailboxes it reaches. Its wording and tree are shown as written, so they can name other addresses (a condition on who an email is from or to). While it covers you, you also see who receives what it matches (receivers): how many API keys, webhooks and shares, 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.",
|
|
24983
24983
|
"tags": ["Email Rule Oversight"],
|
|
24984
24984
|
"security": [{ "BearerAuth": [] }],
|
|
24985
24985
|
"parameters": [{
|
|
@@ -43257,11 +43257,11 @@ const openapiDocument = {
|
|
|
43257
43257
|
"raw_size_bytes": { "type": ["integer", "null"] },
|
|
43258
43258
|
"webhook_status": {
|
|
43259
43259
|
"$ref": "#/components/schemas/EmailWebhookStatus",
|
|
43260
|
-
"description": "
|
|
43260
|
+
"description": "Only this email's routed delivery (the webhook or Function routing sent it to), never a rule's. On mail routing sent nowhere it stays pending, 0 or null unless the email is sent later (POST /emails/{id}/replay), and says nothing about rule deliveries: those are in `rule_deliveries` on GET /emails/{id}, for the mailbox's owner. Its delivery state. `pending` with 0 attempts can also mean no route webhook took it, and then it changes only if the email is sent again."
|
|
43261
43261
|
},
|
|
43262
43262
|
"webhook_attempt_count": {
|
|
43263
43263
|
"type": "integer",
|
|
43264
|
-
"description": "
|
|
43264
|
+
"description": "Only this email's routed delivery (the webhook or Function routing sent it to), never a rule's. On mail routing sent nowhere it stays pending, 0 or null unless the email is sent later (POST /emails/{id}/replay), and says nothing about rule deliveries: those are in `rule_deliveries` on GET /emails/{id}, for the mailbox's owner. Its attempts."
|
|
43265
43265
|
},
|
|
43266
43266
|
"thread_id": {
|
|
43267
43267
|
"type": ["string", "null"],
|
|
@@ -43762,29 +43762,29 @@ const openapiDocument = {
|
|
|
43762
43762
|
"rejection_reason": { "type": ["string", "null"] },
|
|
43763
43763
|
"webhook_status": {
|
|
43764
43764
|
"$ref": "#/components/schemas/EmailWebhookStatus",
|
|
43765
|
-
"description": "
|
|
43765
|
+
"description": "Only this email's routed delivery (the webhook or Function routing sent it to), never a rule's. On mail routing sent nowhere it stays pending, 0 or null unless the email is sent later (POST /emails/{id}/replay), and says nothing about rule deliveries: those are in `rule_deliveries` on GET /emails/{id}, for the mailbox's owner. Its delivery state. `pending` with 0 attempts can also mean no route webhook took it, and then it changes only if the email is sent again."
|
|
43766
43766
|
},
|
|
43767
43767
|
"webhook_attempt_count": {
|
|
43768
43768
|
"type": "integer",
|
|
43769
|
-
"description": "
|
|
43769
|
+
"description": "Only this email's routed delivery (the webhook or Function routing sent it to), never a rule's. On mail routing sent nowhere it stays pending, 0 or null unless the email is sent later (POST /emails/{id}/replay), and says nothing about rule deliveries: those are in `rule_deliveries` on GET /emails/{id}, for the mailbox's owner. Its attempts."
|
|
43770
43770
|
},
|
|
43771
43771
|
"webhook_last_attempt_at": {
|
|
43772
43772
|
"type": ["string", "null"],
|
|
43773
43773
|
"format": "date-time",
|
|
43774
|
-
"description": "
|
|
43774
|
+
"description": "Only this email's routed delivery (the webhook or Function routing sent it to), never a rule's. On mail routing sent nowhere it stays pending, 0 or null unless the email is sent later (POST /emails/{id}/replay), and says nothing about rule deliveries: those are in `rule_deliveries` on GET /emails/{id}, for the mailbox's owner. Its last attempt."
|
|
43775
43775
|
},
|
|
43776
43776
|
"webhook_last_status_code": {
|
|
43777
43777
|
"type": ["integer", "null"],
|
|
43778
|
-
"description": "
|
|
43778
|
+
"description": "Only this email's routed delivery (the webhook or Function routing sent it to), never a rule's. On mail routing sent nowhere it stays pending, 0 or null unless the email is sent later (POST /emails/{id}/replay), and says nothing about rule deliveries: those are in `rule_deliveries` on GET /emails/{id}, for the mailbox's owner. What it last answered."
|
|
43779
43779
|
},
|
|
43780
43780
|
"webhook_last_error": {
|
|
43781
43781
|
"type": ["string", "null"],
|
|
43782
|
-
"description": "
|
|
43782
|
+
"description": "Only this email's routed delivery (the webhook or Function routing sent it to), never a rule's. On mail routing sent nowhere it stays pending, 0 or null unless the email is sent later (POST /emails/{id}/replay), and says nothing about rule deliveries: those are in `rule_deliveries` on GET /emails/{id}, for the mailbox's owner. Its last error."
|
|
43783
43783
|
},
|
|
43784
43784
|
"webhook_fired_at": {
|
|
43785
43785
|
"type": ["string", "null"],
|
|
43786
43786
|
"format": "date-time",
|
|
43787
|
-
"description": "
|
|
43787
|
+
"description": "Only this email's routed delivery (the webhook or Function routing sent it to), never a rule's. On mail routing sent nowhere it stays pending, 0 or null unless the email is sent later (POST /emails/{id}/replay), and says nothing about rule deliveries: those are in `rule_deliveries` on GET /emails/{id}, for the mailbox's owner. When it was delivered."
|
|
43788
43788
|
},
|
|
43789
43789
|
"smtp_helo": { "type": ["string", "null"] },
|
|
43790
43790
|
"smtp_mail_from": {
|
|
@@ -44051,7 +44051,7 @@ const openapiDocument = {
|
|
|
44051
44051
|
},
|
|
44052
44052
|
"shared_through": {
|
|
44053
44053
|
"type": ["object", "null"],
|
|
44054
|
-
"description": "
|
|
44054
|
+
"description": "Only for a reader who has this email through a colleague's share of their mail, when that share is their only way to it: the share and who gave it. Null for everyone else, including on your own mail when a rule or share of yours gave it to someone: rule_deliveries counts the webhooks rules delivered it to, and GET /v1/email-rule-shares/{id}/emails lists what a share you gave has given.",
|
|
44055
44055
|
"required": [
|
|
44056
44056
|
"share_id",
|
|
44057
44057
|
"rule_name",
|
|
@@ -44080,7 +44080,7 @@ const openapiDocument = {
|
|
|
44080
44080
|
},
|
|
44081
44081
|
"rule_deliveries": {
|
|
44082
44082
|
"type": ["object", "null"],
|
|
44083
|
-
"description": "Where Email Rules delivered this email by webhook, for the owner of the mailbox it is at, on their own dashboard session or the Primitive CLI. Null for everyone else, and when it could not be read in time. A key reading it through a rule is not a delivery.",
|
|
44083
|
+
"description": "Where Email Rules delivered this email by webhook, for the owner of the mailbox it is at, on their own dashboard session or the Primitive CLI. Null for everyone else, including on another member's mail even for an organization owner or admin (GET /v1/webhooks/deliveries?email_id=<email-id> lists its deliveries, a rule's included), and when it could not be read in time. A key reading it through a rule is not a delivery.",
|
|
44084
44084
|
"required": [
|
|
44085
44085
|
"rules",
|
|
44086
44086
|
"hidden",
|
|
@@ -51787,6 +51787,38 @@ const openapiDocument = {
|
|
|
51787
51787
|
},
|
|
51788
51788
|
"required": ["evaluation_scope", "scope_selection"]
|
|
51789
51789
|
},
|
|
51790
|
+
"EmailRuleScopeWarning": {
|
|
51791
|
+
"type": "object",
|
|
51792
|
+
"properties": {
|
|
51793
|
+
"name": {
|
|
51794
|
+
"type": "string",
|
|
51795
|
+
"maxLength": 320
|
|
51796
|
+
},
|
|
51797
|
+
"kind": {
|
|
51798
|
+
"type": "string",
|
|
51799
|
+
"enum": ["address", "domain"]
|
|
51800
|
+
},
|
|
51801
|
+
"reason": {
|
|
51802
|
+
"type": "string",
|
|
51803
|
+
"enum": [
|
|
51804
|
+
"unknown_domain",
|
|
51805
|
+
"inactive_domain",
|
|
51806
|
+
"unknown_address"
|
|
51807
|
+
],
|
|
51808
|
+
"description": "unknown_domain: none of the organization's domains. inactive_domain: one of its domains, not active now, so no new mail arrives. unknown_address: no inbox known as someone's, and no mail has reached it yet."
|
|
51809
|
+
},
|
|
51810
|
+
"message": {
|
|
51811
|
+
"type": "string",
|
|
51812
|
+
"maxLength": 1e3
|
|
51813
|
+
}
|
|
51814
|
+
},
|
|
51815
|
+
"required": [
|
|
51816
|
+
"name",
|
|
51817
|
+
"kind",
|
|
51818
|
+
"reason",
|
|
51819
|
+
"message"
|
|
51820
|
+
]
|
|
51821
|
+
},
|
|
51790
51822
|
"EmailRuleScopeSelection": {
|
|
51791
51823
|
"type": "object",
|
|
51792
51824
|
"properties": {
|
|
@@ -51885,6 +51917,12 @@ const openapiDocument = {
|
|
|
51885
51917
|
"description": "The scope breadth and conditions_breadth are counted over: evaluation_scope as sent, by default own_mailboxes. Not the saved rule's scope, which a write sets with evaluation_scope; writes ignore this, as they ignore breadth.",
|
|
51886
51918
|
"$ref": "#/components/schemas/EmailRuleScopeUsed"
|
|
51887
51919
|
},
|
|
51920
|
+
"scope_warnings": {
|
|
51921
|
+
"description": "Names in the scope_selection sent that match nothing this organization receives mail at (a typo, or an inbox not yet in use), as a test or write would warn of them. Present only when there are some; writes ignore it.",
|
|
51922
|
+
"maxItems": 150,
|
|
51923
|
+
"type": "array",
|
|
51924
|
+
"items": { "$ref": "#/components/schemas/EmailRuleScopeWarning" }
|
|
51925
|
+
},
|
|
51888
51926
|
"sql": {
|
|
51889
51927
|
"description": "Present only when include_sql was true.",
|
|
51890
51928
|
"type": "object",
|
|
@@ -51938,32 +51976,6 @@ const openapiDocument = {
|
|
|
51938
51976
|
"vocabulary"
|
|
51939
51977
|
]
|
|
51940
51978
|
},
|
|
51941
|
-
"EmailRuleScopeWarning": {
|
|
51942
|
-
"type": "object",
|
|
51943
|
-
"properties": {
|
|
51944
|
-
"name": { "type": "string" },
|
|
51945
|
-
"kind": {
|
|
51946
|
-
"type": "string",
|
|
51947
|
-
"enum": ["address", "domain"]
|
|
51948
|
-
},
|
|
51949
|
-
"reason": {
|
|
51950
|
-
"type": "string",
|
|
51951
|
-
"enum": [
|
|
51952
|
-
"unknown_domain",
|
|
51953
|
-
"inactive_domain",
|
|
51954
|
-
"unknown_address"
|
|
51955
|
-
],
|
|
51956
|
-
"description": "unknown_domain: none of the organization's domains. inactive_domain: one of its domains, not active now, so no new mail arrives. unknown_address: no inbox known as someone's, and no mail has reached it yet."
|
|
51957
|
-
},
|
|
51958
|
-
"message": { "type": "string" }
|
|
51959
|
-
},
|
|
51960
|
-
"required": [
|
|
51961
|
-
"name",
|
|
51962
|
-
"kind",
|
|
51963
|
-
"reason",
|
|
51964
|
-
"message"
|
|
51965
|
-
]
|
|
51966
|
-
},
|
|
51967
51979
|
"EmailRuleSampleJudgment": {
|
|
51968
51980
|
"type": "object",
|
|
51969
51981
|
"properties": {
|
|
@@ -52393,6 +52405,11 @@ const openapiDocument = {
|
|
|
52393
52405
|
"type": "string"
|
|
52394
52406
|
},
|
|
52395
52407
|
"subject": { "type": ["string", "null"] },
|
|
52408
|
+
"attachment_names": {
|
|
52409
|
+
"description": "On matched and near_miss: the file names the email lists, in order, at most 10 (the names its questions are given; never what is in the files). Parts with no name are left out; absent when there are none.",
|
|
52410
|
+
"type": "array",
|
|
52411
|
+
"items": { "type": "string" }
|
|
52412
|
+
},
|
|
52396
52413
|
"parts": {
|
|
52397
52414
|
"description": "How each top-level part of the rule decided. Present for matched, near_miss and no_match.",
|
|
52398
52415
|
"type": "array",
|
|
@@ -52592,6 +52609,7 @@ const openapiDocument = {
|
|
|
52592
52609
|
},
|
|
52593
52610
|
"scope_warnings": {
|
|
52594
52611
|
"description": "Names in scope_selection that match nothing this organization receives mail at (a typo, or an inbox not yet in use). Present only when there are some.",
|
|
52612
|
+
"maxItems": 150,
|
|
52595
52613
|
"type": "array",
|
|
52596
52614
|
"items": { "$ref": "#/components/schemas/EmailRuleScopeWarning" }
|
|
52597
52615
|
},
|
|
@@ -53327,6 +53345,7 @@ const openapiDocument = {
|
|
|
53327
53345
|
},
|
|
53328
53346
|
"scope_warnings": {
|
|
53329
53347
|
"description": "Names in scope_selection that match nothing this organization receives mail at (a typo, or an inbox not yet in use). Present only when there are some.",
|
|
53348
|
+
"maxItems": 150,
|
|
53330
53349
|
"type": "array",
|
|
53331
53350
|
"items": { "$ref": "#/components/schemas/EmailRuleScopeWarning" }
|
|
53332
53351
|
},
|
|
@@ -53399,13 +53418,23 @@ const openapiDocument = {
|
|
|
53399
53418
|
}
|
|
53400
53419
|
},
|
|
53401
53420
|
"undecided_samples": {
|
|
53402
|
-
"description": "Made-up emails not decided, by index. Only a write
|
|
53421
|
+
"description": "Made-up emails not decided, by index. Only a write that saves a version or activates the rule, sent with if_expectations_pass or judged by default, judges them.",
|
|
53403
53422
|
"type": "array",
|
|
53404
53423
|
"items": {
|
|
53405
53424
|
"type": "integer",
|
|
53406
53425
|
"minimum": 0
|
|
53407
53426
|
}
|
|
53408
53427
|
},
|
|
53428
|
+
"failed_sample_details": {
|
|
53429
|
+
"description": "failed_samples with each one's label, from a write that judged them before saving (if_expectations_pass, or by default).",
|
|
53430
|
+
"type": "array",
|
|
53431
|
+
"items": { "$ref": "#/components/schemas/EmailRuleSampleDetail" }
|
|
53432
|
+
},
|
|
53433
|
+
"undecided_sample_details": {
|
|
53434
|
+
"description": "undecided_samples with each one's label, as failed_sample_details.",
|
|
53435
|
+
"type": "array",
|
|
53436
|
+
"items": { "$ref": "#/components/schemas/EmailRuleSampleDetail" }
|
|
53437
|
+
},
|
|
53409
53438
|
"note": {
|
|
53410
53439
|
"description": "On an update that saved a version that did not pass, or a do_not_share rule created active: that it was saved anyway, is current, and whether it is live.",
|
|
53411
53440
|
"type": "string"
|
|
@@ -53431,7 +53460,7 @@ const openapiDocument = {
|
|
|
53431
53460
|
"required": ["version", "note"]
|
|
53432
53461
|
},
|
|
53433
53462
|
"affects": {
|
|
53434
|
-
"description": "After an update that saved a version: API keys listing the rule
|
|
53463
|
+
"description": "After an update that saved a version, or turned a grant rule active: API keys listing the rule and the webhooks they own, which read and receive what a grant rule grants from now on. shares_ended is always 0: a new version keeps the rule's share (share_notice says so). Saving a version does not by itself change the rule's state. Absent after any other write, and if not read.",
|
|
53435
53464
|
"type": "object",
|
|
53436
53465
|
"properties": {
|
|
53437
53466
|
"keys": {
|
|
@@ -53454,11 +53483,11 @@ const openapiDocument = {
|
|
|
53454
53483
|
]
|
|
53455
53484
|
},
|
|
53456
53485
|
"notice": {
|
|
53457
|
-
"description": "After a write that saved a version of an active rule keys or
|
|
53486
|
+
"description": "After a write that saved a version of an active rule keys, webhooks or a share read without checking it first: what it changes, and how to have the next one checked.",
|
|
53458
53487
|
"type": "string"
|
|
53459
53488
|
},
|
|
53460
53489
|
"share_notice": {
|
|
53461
|
-
"description": "After a write that
|
|
53490
|
+
"description": "After a write that saved a version of a rule with a live share: that the share goes on under it, given even when affects is not, with whom it is and the version they accepted when those can be read.",
|
|
53462
53491
|
"type": "string"
|
|
53463
53492
|
}
|
|
53464
53493
|
},
|
|
@@ -53592,6 +53621,17 @@ const openapiDocument = {
|
|
|
53592
53621
|
"created_at"
|
|
53593
53622
|
]
|
|
53594
53623
|
},
|
|
53624
|
+
"EmailRuleSampleDetail": {
|
|
53625
|
+
"type": "object",
|
|
53626
|
+
"properties": {
|
|
53627
|
+
"index": {
|
|
53628
|
+
"type": "integer",
|
|
53629
|
+
"minimum": 0
|
|
53630
|
+
},
|
|
53631
|
+
"label": { "type": ["string", "null"] }
|
|
53632
|
+
},
|
|
53633
|
+
"required": ["index", "label"]
|
|
53634
|
+
},
|
|
53595
53635
|
"CreateEmailRuleRequest": {
|
|
53596
53636
|
"type": "object",
|
|
53597
53637
|
"properties": {
|
|
@@ -53708,6 +53748,12 @@ const openapiDocument = {
|
|
|
53708
53748
|
"breadth_scope": {
|
|
53709
53749
|
"description": "Ignored (the compile answer's breadth_scope): set a rule's scope with evaluation_scope.",
|
|
53710
53750
|
"$ref": "#/components/schemas/EmailRuleScopeUsed"
|
|
53751
|
+
},
|
|
53752
|
+
"scope_warnings": {
|
|
53753
|
+
"description": "Ignored (the compile answer's scope_warnings).",
|
|
53754
|
+
"maxItems": 150,
|
|
53755
|
+
"type": "array",
|
|
53756
|
+
"items": { "$ref": "#/components/schemas/EmailRuleScopeWarning" }
|
|
53711
53757
|
}
|
|
53712
53758
|
},
|
|
53713
53759
|
"required": [
|
|
@@ -54017,6 +54063,12 @@ const openapiDocument = {
|
|
|
54017
54063
|
"description": "Ignored (the compile answer's breadth_scope): set a rule's scope with evaluation_scope.",
|
|
54018
54064
|
"$ref": "#/components/schemas/EmailRuleScopeUsed"
|
|
54019
54065
|
},
|
|
54066
|
+
"scope_warnings": {
|
|
54067
|
+
"description": "Ignored (the compile answer's scope_warnings).",
|
|
54068
|
+
"maxItems": 150,
|
|
54069
|
+
"type": "array",
|
|
54070
|
+
"items": { "$ref": "#/components/schemas/EmailRuleScopeWarning" }
|
|
54071
|
+
},
|
|
54020
54072
|
"kind": {
|
|
54021
54073
|
"description": "Must be the rule's own (400 kind_mismatch).",
|
|
54022
54074
|
"type": "string",
|
|
@@ -54080,7 +54132,7 @@ const openapiDocument = {
|
|
|
54080
54132
|
"maximum": 2147483647
|
|
54081
54133
|
},
|
|
54082
54134
|
"if_expectations_pass": {
|
|
54083
|
-
"description": "true: judge the rule as this write leaves it (new tree, restored version, new scope, or the version it activates) against the expectations it leaves, as POST /email-rules/test would, before saving; it can take as long as a test. Failed: 409 expectations_failed; on emails the rule cannot read: 409 expectations_unreadable; undecided: 409 expectations_undecided (each with details.expectations_check); none to judge: 400 no_expectations. Refused writes save nothing; a pass saves unless the rule moved meanwhile (409 email_rule_conflict). Only writes that save a version or activate the rule are judged. Omitted: judged as with true when the write saves a version or changes the scope of an active rule that API keys or
|
|
54135
|
+
"description": "true: judge the rule as this write leaves it (new tree, restored version, new scope, or the version it activates) against the expectations it leaves, as POST /email-rules/test would, before saving; it can take as long as a test. Failed: 409 expectations_failed; on emails the rule cannot read: 409 expectations_unreadable; undecided: 409 expectations_undecided (each with details.expectations_check); none to judge: 400 no_expectations. Refused writes save nothing; a pass saves unless the rule moved meanwhile (409 email_rule_conflict). Only writes that save a version or activate the rule are judged. Omitted: judged as with true when the write saves a version or changes the scope of an active rule that API keys, webhooks or a share read and that has expectations. false: never judged first.",
|
|
54084
54136
|
"type": "boolean"
|
|
54085
54137
|
},
|
|
54086
54138
|
"restore_version": {
|
|
@@ -54308,7 +54360,7 @@ const openapiDocument = {
|
|
|
54308
54360
|
"exclusiveMinimum": 0
|
|
54309
54361
|
},
|
|
54310
54362
|
"reads_in_full": {
|
|
54311
|
-
"description": "On a rule over your mail: how many of these keys also list one of your own mailboxes, or its domain, so they read your mail there beyond what this rule matches.",
|
|
54363
|
+
"description": "On a rule over your mail: how many of these keys also list one of your own mailboxes, or its domain, so they read your mail there beyond what this rule matches. It counts what they can read, not whether any has read an email.",
|
|
54312
54364
|
"type": "integer",
|
|
54313
54365
|
"minimum": 0
|
|
54314
54366
|
},
|
|
@@ -54723,6 +54775,7 @@ const openapiDocument = {
|
|
|
54723
54775
|
},
|
|
54724
54776
|
"scope_warnings": {
|
|
54725
54777
|
"description": "Names in scope_selection that match nothing this organization receives mail at (a typo, or an inbox not yet in use). Present only when there are some.",
|
|
54778
|
+
"maxItems": 150,
|
|
54726
54779
|
"type": "array",
|
|
54727
54780
|
"items": { "$ref": "#/components/schemas/EmailRuleScopeWarning" }
|
|
54728
54781
|
},
|
|
@@ -54920,6 +54973,12 @@ const openapiDocument = {
|
|
|
54920
54973
|
"description": "Ignored (the compile answer's breadth_scope): set a rule's scope with evaluation_scope.",
|
|
54921
54974
|
"$ref": "#/components/schemas/EmailRuleScopeUsed"
|
|
54922
54975
|
},
|
|
54976
|
+
"scope_warnings": {
|
|
54977
|
+
"description": "Ignored (the compile answer's scope_warnings).",
|
|
54978
|
+
"maxItems": 150,
|
|
54979
|
+
"type": "array",
|
|
54980
|
+
"items": { "$ref": "#/components/schemas/EmailRuleScopeWarning" }
|
|
54981
|
+
},
|
|
54923
54982
|
"kind": {
|
|
54924
54983
|
"description": "Only grant.",
|
|
54925
54984
|
"type": "string",
|
|
@@ -54967,7 +55026,7 @@ const openapiDocument = {
|
|
|
54967
55026
|
"type": ["string", "null"]
|
|
54968
55027
|
},
|
|
54969
55028
|
"server_notes": {
|
|
54970
|
-
"description": "Primitive's own notes on the rule as asked, worked out from its tree and description each time the request is read, and to the member asked while pending, how to test it on look-alikes. Unlike warnings, never written by the member who asked, though a note can quote their words or tree values.",
|
|
55029
|
+
"description": "Primitive's own notes on the rule as asked, worked out from its tree and description each time the request is read, and to the member asked while pending, how to test it on look-alikes and that counts the asker quotes came from their own mail. Unlike warnings, never written by the member who asked, though a note can quote their words or tree values.",
|
|
54971
55030
|
"type": "array",
|
|
54972
55031
|
"items": { "type": "string" }
|
|
54973
55032
|
},
|
|
@@ -55016,7 +55075,7 @@ const openapiDocument = {
|
|
|
55016
55075
|
"type": ["boolean", "null"]
|
|
55017
55076
|
},
|
|
55018
55077
|
"notice": {
|
|
55019
|
-
"description": "For the member asked, while pending: what the rule actually does (server_explanation), Primitive's warnings, what accepting would share, then where to see what becomes of one email (rule-results). For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
|
|
55078
|
+
"description": "For the member asked, while pending: who asked (as proposer names them), what the rule actually does (server_explanation), Primitive's warnings, what accepting would share, then where to see what becomes of one email (rule-results and rule_deliveries). For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
|
|
55020
55079
|
"type": ["string", "null"]
|
|
55021
55080
|
},
|
|
55022
55081
|
"target_can_accept": {
|
|
@@ -55147,7 +55206,7 @@ const openapiDocument = {
|
|
|
55147
55206
|
"type": ["string", "null"]
|
|
55148
55207
|
},
|
|
55149
55208
|
"server_notes": {
|
|
55150
|
-
"description": "Primitive's own notes on the rule as asked, worked out from its tree and description each time the request is read, and to the member asked while pending, how to test it on look-alikes. Unlike warnings, never written by the member who asked, though a note can quote their words or tree values.",
|
|
55209
|
+
"description": "Primitive's own notes on the rule as asked, worked out from its tree and description each time the request is read, and to the member asked while pending, how to test it on look-alikes and that counts the asker quotes came from their own mail. Unlike warnings, never written by the member who asked, though a note can quote their words or tree values.",
|
|
55151
55210
|
"type": "array",
|
|
55152
55211
|
"items": { "type": "string" }
|
|
55153
55212
|
},
|
|
@@ -55196,7 +55255,7 @@ const openapiDocument = {
|
|
|
55196
55255
|
"type": ["boolean", "null"]
|
|
55197
55256
|
},
|
|
55198
55257
|
"notice": {
|
|
55199
|
-
"description": "For the member asked, while pending: what the rule actually does (server_explanation), Primitive's warnings, what accepting would share, then where to see what becomes of one email (rule-results). For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
|
|
55258
|
+
"description": "For the member asked, while pending: who asked (as proposer names them), what the rule actually does (server_explanation), Primitive's warnings, what accepting would share, then where to see what becomes of one email (rule-results and rule_deliveries). For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
|
|
55200
55259
|
"type": ["string", "null"]
|
|
55201
55260
|
}
|
|
55202
55261
|
},
|
|
@@ -55367,11 +55426,11 @@ const openapiDocument = {
|
|
|
55367
55426
|
"rule_deleted",
|
|
55368
55427
|
null
|
|
55369
55428
|
],
|
|
55370
|
-
"description": "Why it ended, once it has: stopped_by_granter, removed_by_beneficiary, stopped_by_admin, rule_changed (a new version of the rule was saved) or rule_deleted (the rule was deleted; the share keeps its record, and the rule is no longer shown). Null while it has not."
|
|
55429
|
+
"description": "Why it ended, once it has: stopped_by_granter, removed_by_beneficiary, stopped_by_admin, rule_changed (a new version of the rule was saved, on a share that ended before new versions kept shares) or rule_deleted (the rule was deleted; the share keeps its record, and the rule is no longer shown). Null while it has not."
|
|
55371
55430
|
},
|
|
55372
55431
|
"accepted_rule_version": {
|
|
55373
55432
|
"type": "integer",
|
|
55374
|
-
"description": "The version of the rule that was accepted. A
|
|
55433
|
+
"description": "The version of the rule that was accepted. A later version keeps the share: what each version matches is shared from when it is saved."
|
|
55375
55434
|
},
|
|
55376
55435
|
"edited_on_accept": {
|
|
55377
55436
|
"type": "boolean",
|
|
@@ -55560,6 +55619,12 @@ const openapiDocument = {
|
|
|
55560
55619
|
"description": "Ignored (the compile answer's breadth_scope): set a rule's scope with evaluation_scope.",
|
|
55561
55620
|
"$ref": "#/components/schemas/EmailRuleScopeUsed"
|
|
55562
55621
|
},
|
|
55622
|
+
"scope_warnings": {
|
|
55623
|
+
"description": "Ignored (the compile answer's scope_warnings).",
|
|
55624
|
+
"maxItems": 150,
|
|
55625
|
+
"type": "array",
|
|
55626
|
+
"items": { "$ref": "#/components/schemas/EmailRuleScopeWarning" }
|
|
55627
|
+
},
|
|
55563
55628
|
"kind": {
|
|
55564
55629
|
"description": "Only grant.",
|
|
55565
55630
|
"type": "string",
|
|
@@ -55578,18 +55643,18 @@ const openapiDocument = {
|
|
|
55578
55643
|
"AcceptEmailRuleRequestResult": {
|
|
55579
55644
|
"type": "object",
|
|
55580
55645
|
"properties": {
|
|
55581
|
-
"request": { "$ref": "#/components/schemas/EmailRuleRequest" },
|
|
55582
|
-
"rule": { "$ref": "#/components/schemas/EmailRuleWithVersion" },
|
|
55583
|
-
"share": { "$ref": "#/components/schemas/EmailRuleShare" },
|
|
55584
55646
|
"notice": {
|
|
55585
55647
|
"description": "What is now shared, in words. When you changed the rule and it can now match mail the request left out by who it was sent to (such as mail where an address is only copied), that comes first; when you changed its english, tree or explanation (edited_on_accept; a new name alone is no change), that rule.current is what you agreed to and request what was asked.",
|
|
55586
55648
|
"type": "string"
|
|
55587
|
-
}
|
|
55649
|
+
},
|
|
55650
|
+
"rule": { "$ref": "#/components/schemas/EmailRuleWithVersion" },
|
|
55651
|
+
"share": { "$ref": "#/components/schemas/EmailRuleShare" },
|
|
55652
|
+
"request": { "$ref": "#/components/schemas/EmailRuleRequest" }
|
|
55588
55653
|
},
|
|
55589
55654
|
"required": [
|
|
55590
|
-
"request",
|
|
55591
55655
|
"rule",
|
|
55592
|
-
"share"
|
|
55656
|
+
"share",
|
|
55657
|
+
"request"
|
|
55593
55658
|
]
|
|
55594
55659
|
},
|
|
55595
55660
|
"ListEmailRuleSharesResult": {
|
|
@@ -55961,6 +56026,14 @@ const openapiDocument = {
|
|
|
55961
56026
|
"created_at": {
|
|
55962
56027
|
"type": "string",
|
|
55963
56028
|
"format": "date-time"
|
|
56029
|
+
},
|
|
56030
|
+
"english": {
|
|
56031
|
+
"description": "What its author asked for, in their words, at its current version. Null when it has no version, was deleted after the page was read, or the words could not be read in time; GET /v1/email-rules/covering-me/{id} shows them with its tree.",
|
|
56032
|
+
"type": ["string", "null"]
|
|
56033
|
+
},
|
|
56034
|
+
"explanation": {
|
|
56035
|
+
"description": "What its current version matches, as compiled. Null as english is.",
|
|
56036
|
+
"type": ["string", "null"]
|
|
55964
56037
|
}
|
|
55965
56038
|
},
|
|
55966
56039
|
"required": [
|
|
@@ -65488,17 +65561,32 @@ function receiversChangeText(item) {
|
|
|
65488
65561
|
];
|
|
65489
65562
|
return changed.length > 0 ? changed.join(", ") : "same totals, an owner or webhook site changed";
|
|
65490
65563
|
}
|
|
65564
|
+
const STOP_REASONS = /* @__PURE__ */ new Map([
|
|
65565
|
+
["deleted", "rule deleted"],
|
|
65566
|
+
["turned_off", "turned off"],
|
|
65567
|
+
["no_longer_covers", "no longer reaches your mailboxes"]
|
|
65568
|
+
]);
|
|
65569
|
+
/**
|
|
65570
|
+
* Why a stopped notice says the rule stopped covering you, from its
|
|
65571
|
+
* stop_reason. Null for any other notice, and for one whose reason is
|
|
65572
|
+
* missing or unknown (an older server).
|
|
65573
|
+
*/
|
|
65574
|
+
function stoppedText(item) {
|
|
65575
|
+
if (item.state !== "stopped") return null;
|
|
65576
|
+
const reason = item.stop_reason;
|
|
65577
|
+
return typeof reason === "string" ? STOP_REASONS.get(reason) ?? null : null;
|
|
65578
|
+
}
|
|
65491
65579
|
/** Where to see what covers you now, whatever the notices have caught up with. */
|
|
65492
65580
|
const COVERING_NOW = `\`primitive email-rule-oversight list-email-rules-covering-me\` shows what covers you now.`;
|
|
65493
65581
|
/**
|
|
65494
65582
|
* One line per coverage notice: what it told (started, new_version,
|
|
65495
|
-
* receivers_changed, or baseline for a rule that already covered you
|
|
65496
|
-
* notices began), when, the rule's name then, and its author; and, first,
|
|
65583
|
+
* receivers_changed, stopped, or baseline for a rule that already covered you
|
|
65584
|
+
* when notices began), when, the rule's name then, and its author; and, first,
|
|
65497
65585
|
* each rule that covers you now whose notice is not written yet (pending,
|
|
65498
65586
|
* dated when the rule last changed), then the rule's id (rule_id; a pending
|
|
65499
65587
|
* row's own id is the rule's), never the notice's own id, which no command
|
|
65500
|
-
* takes; and, when any row is a receivers_changed notice with its totals
|
|
65501
|
-
* what changed
|
|
65588
|
+
* takes; and, when any row is a receivers_changed notice with its totals or
|
|
65589
|
+
* a stopped notice with its reason, what changed (CHANGE).
|
|
65502
65590
|
* `complete` says the listing is the whole of it (from the first page to the
|
|
65503
65591
|
* last, nothing withheld). Even then an empty one is no promise that nothing
|
|
65504
65592
|
* covers you: notices can lag, so it
|
|
@@ -65514,7 +65602,7 @@ function formatConcerningRows(items, complete = false, asOf, pendingComplete) {
|
|
|
65514
65602
|
item.created_through.name ?? item.created_through.id ?? "",
|
|
65515
65603
|
item.rule_id ?? (item.state === "pending" ? item.id : "")
|
|
65516
65604
|
]);
|
|
65517
|
-
const changes = items.map((item) => receiversChangeText(item));
|
|
65605
|
+
const changes = items.map((item) => receiversChangeText(item) ?? stoppedText(item));
|
|
65518
65606
|
const withChange = changes.some((change) => change !== null);
|
|
65519
65607
|
if (withChange) for (const [i, row] of rows.entries()) row.push(changes[i] ?? "");
|
|
65520
65608
|
const header = [
|
|
@@ -65528,15 +65616,43 @@ function formatConcerningRows(items, complete = false, asOf, pendingComplete) {
|
|
|
65528
65616
|
const widths = header.map((h, i) => Math.max(h.length, ...rows.map((row) => (row[i] ?? "").length)));
|
|
65529
65617
|
const line = (cells) => cells.map((cell, i) => i === cells.length - 1 ? cell : cell.padEnd(widths[i] ?? 0)).join(" ").trimEnd();
|
|
65530
65618
|
const pending = items.some((item) => item.state === "pending") ? ["", `pending: the rule covers you now and its notice is not written yet. ${COVERING_NOW}`] : [];
|
|
65619
|
+
const baseline = items.some((item) => item.state === "baseline") ? ["", "baseline: the rule already covered you when these notices began, so its start was never told as news."] : [];
|
|
65531
65620
|
const receivers = items.some((item) => item.state === "receivers_changed") ? ["", "receivers_changed: who receives the rule's matches changed, with the totals before and after where the server sends them. `primitive email-rule-oversight get-email-rule-covering-me <rule-id>` shows who receives them now, by owner, while the rule covers you."] : [];
|
|
65532
65621
|
return [
|
|
65533
65622
|
line(header),
|
|
65534
65623
|
...rows.map(line),
|
|
65535
65624
|
...pending,
|
|
65625
|
+
...baseline,
|
|
65536
65626
|
...receivers,
|
|
65537
65627
|
...unfinished ? ["", pending.length > 0 ? unfinished : `${unfinished} ${COVERING_NOW}`] : []
|
|
65538
65628
|
].join("\n");
|
|
65539
65629
|
}
|
|
65630
|
+
async function observingRules(client) {
|
|
65631
|
+
try {
|
|
65632
|
+
const result = await listEmailRulesCoveringMe({
|
|
65633
|
+
client,
|
|
65634
|
+
query: { limit: 100 }
|
|
65635
|
+
});
|
|
65636
|
+
const page = result.data;
|
|
65637
|
+
const status = result.response?.status;
|
|
65638
|
+
if (status === 401 || status === 403) return "refused";
|
|
65639
|
+
if (result.error !== void 0 || !Array.isArray(page?.data)) return null;
|
|
65640
|
+
return {
|
|
65641
|
+
count: page.data.filter((rule) => rule.state === "observe" && rule.is_author === false).length,
|
|
65642
|
+
more: typeof page.meta?.cursor === "string"
|
|
65643
|
+
};
|
|
65644
|
+
} catch {
|
|
65645
|
+
return null;
|
|
65646
|
+
}
|
|
65647
|
+
}
|
|
65648
|
+
const OBSERVE_SAYS = "a rule in observe records a decision on every email it reads and shares or blocks nothing until it is turned active, which is listed here as started. `primitive email-rule-oversight list-email-rules-covering-me` lists them.";
|
|
65649
|
+
/** The footer under `activity concerning` for rules in observe over your mail, or null with none to tell of. */
|
|
65650
|
+
function formatObservingFooter(observing) {
|
|
65651
|
+
if (observing === "refused") return null;
|
|
65652
|
+
if (observing === null) return `Rules in observe can also cover your mail: ${OBSERVE_SAYS}`;
|
|
65653
|
+
if (observing.count === 0) return observing.more ? `Rules in observe can also cover your mail: ${OBSERVE_SAYS}` : null;
|
|
65654
|
+
return `${`${observing.more ? "At least " : ""}${observing.count} ${observing.count === 1 ? "rule" : "rules"} in observe also ${observing.count === 1 ? "covers" : "cover"} your mail`}: ${OBSERVE_SAYS}`;
|
|
65655
|
+
}
|
|
65540
65656
|
/** What was left out, and why: no counts, only the kinds and what would show them. */
|
|
65541
65657
|
function formatWithheld(withheld) {
|
|
65542
65658
|
if (withheld.length === 0) return null;
|
|
@@ -65622,6 +65738,10 @@ async function runActivityList(command, flags, relation) {
|
|
|
65622
65738
|
}
|
|
65623
65739
|
const complete = flags.state === "all" && !flags.cursor && !cursor && withheld.length === 0 && pendingComplete !== false;
|
|
65624
65740
|
command.log(relation === "asked" ? formatAskedRows(items, complete) : relation === "concerning" ? formatConcerningRows(items, complete, asOf, pendingComplete) : formatActivityRows(covers, items));
|
|
65741
|
+
if (relation === "concerning" && !flags.cursor && !withheld.some((w) => w.kind === "email_rule_coverage")) {
|
|
65742
|
+
const observing = formatObservingFooter(await observingRules(auth.apiClient.client));
|
|
65743
|
+
if (observing) command.log(`\n${observing}`);
|
|
65744
|
+
}
|
|
65625
65745
|
const notShown = formatWithheld(withheld);
|
|
65626
65746
|
if (notShown) command.log(`\n${notShown}`);
|
|
65627
65747
|
if (cursor) command.log(`\nMore: ${resumeCommand(command.config.bin, flags, cursor, relation)}`);
|
|
@@ -65669,7 +65789,9 @@ var ActivityCreatedCommand = class ActivityCreatedCommand extends Command {
|
|
|
65669
65789
|
var ActivityAskedCommand = class ActivityAskedCommand extends Command {
|
|
65670
65790
|
static description = `List what other members asked of you, newest first, open or answered: rule requests made to you for an email rule over your own mail, and objections to rules you wrote, each with its kind, where it stands and who asked.
|
|
65671
65791
|
|
|
65672
|
-
Signed in with \`primitive login\`, you see what was asked of you under your current membership. A key, an app or an agent is asked nothing. Read a request (email_rule_request) with \`primitive email-rules get-email-rule-request --id <id>\`, and an objection (email_rule_objection) with \`primitive email-rule-oversight get-email-rule-objection --id <id>\`, then accept or decline it
|
|
65792
|
+
Signed in with \`primitive login\`, you see what was asked of you under your current membership. A key, an app or an agent is asked nothing. Read a request (email_rule_request) with \`primitive email-rules get-email-rule-request --id <id>\`, and an objection (email_rule_objection) with \`primitive email-rule-oversight get-email-rule-objection --id <id>\`, then accept or decline it.
|
|
65793
|
+
|
|
65794
|
+
Requests and objections you made are not here: \`primitive activity created --kind email_rule_request,email_rule_objection\` lists them with where each stands (pending, accepted, declined or withdrawn; with --json, ended_at says when it was decided).`;
|
|
65673
65795
|
static summary = "List what other members asked of you";
|
|
65674
65796
|
static examples = [
|
|
65675
65797
|
"<%= config.bin %> activity asked",
|
|
@@ -65704,12 +65826,12 @@ var ActivityAskedCommand = class ActivityAskedCommand extends Command {
|
|
|
65704
65826
|
}
|
|
65705
65827
|
};
|
|
65706
65828
|
var ActivityConcerningCommand = class ActivityConcerningCommand extends Command {
|
|
65707
|
-
static description = `List what other members did that concerns your own mail, newest first: each time another member's rule started covering your mailboxes, that is, it was made or turned active over them or an active rule came to reach you, once per rule, not per mailbox (started), saved a new version while covering it (new_version), or changed who receives its matches: its keys, webhooks or share (receivers_changed, with the totals before and after in the table, and under receivers_change with --json, at most once every 15 minutes for a rule), named as the rule was then, with its author. A rule that already covered you when these notices began is listed once as baseline. A rule in draft or observe grants and blocks nothing and gets no notice while it stays there, though \`primitive email-rule-oversight list-email-rules-covering-me\` lists it; turning it active is what is listed, and a rule that covers you again within an hour of its last started or baseline notice gets no new one, though a version it saved meanwhile is listed as new_version, and a change in who receives its matches as receivers_changed. A rule that stops covering you and
|
|
65829
|
+
static description = `List what other members did that concerns your own mail, newest first: each time another member's rule started covering your mailboxes, that is, it was made or turned active over them or an active rule came to reach you, once per rule, not per mailbox (started), saved a new version while covering it (new_version), or changed who receives its matches: its keys, webhooks or share (receivers_changed, with the totals before and after in the table, and under receivers_change with --json, at most once every 15 minutes for a rule), named as the rule was then, with its author. A rule that already covered you when these notices began is listed once as baseline. A rule in draft or observe grants and blocks nothing and gets no notice while it stays there, though \`primitive email-rule-oversight list-email-rules-covering-me\` lists it; turning it active is what is listed, and a rule that covers you again within an hour of its last started or baseline notice gets no new one unless you were told it stopped since, though a version it saved meanwhile is listed as new_version, and a change in who receives its matches as receivers_changed. A rule that stops covering you is listed as stopped, with why (rule deleted, turned off, or no longer reaching your mailboxes; stop_reason with --json), about 5 minutes after the notices find it stopped, so one turned off and on again meanwhile is listed neither stopped nor started again. A rename is not listed.
|
|
65708
65830
|
|
|
65709
65831
|
Notices can lag. Until a start is written, a rule that now covers you is listed first as pending, dated when the rule last changed, and with --json its id is the rule's. When the check for such rules did not finish, the listing says so and --json carries pending_complete: false; run it again in a moment.
|
|
65710
65832
|
|
|
65711
65833
|
Signed in with \`primitive login\`, you see the notices about your own mail under your current membership. A key, an app or an agent has none. The rules that cover you now, with their ids, are listed by \`primitive email-rule-oversight list-email-rules-covering-me\`; ask a rule's author to turn it off with \`primitive email-rule-oversight create-email-rule-objection --rule-id <rule-id>\`. The table's RULE ID, and rule_id with --json, is the rule's id, which \`primitive email-rule-oversight get-email-rule-covering-me <rule-id>\` and create-email-rule-objection --rule-id take; with --json each notice's own id is the notice's, not the rule's.`;
|
|
65712
|
-
static summary = "List rules that started covering your mail or
|
|
65834
|
+
static summary = "List rules that started covering your mail, changed or stopped";
|
|
65713
65835
|
static examples = ["<%= config.bin %> activity concerning", "<%= config.bin %> activity concerning --all --json"];
|
|
65714
65836
|
static flags = {
|
|
65715
65837
|
"api-key": API_KEY_FLAG$3,
|
|
@@ -70636,7 +70758,7 @@ function buildChatSendFailureEnvelope(params) {
|
|
|
70636
70758
|
return {
|
|
70637
70759
|
outcome: params.outcome,
|
|
70638
70760
|
exit_code: params.exitCode ?? sendOutcomeExitCode(params.outcome),
|
|
70639
|
-
outcome_message: params.outcomeMessage ?? (params.outcome === "already_sent" ? formatDeletedEarlierSendNotice() : formatSendFailureSummary(params.noun, params.outcome, params.httpStatus)),
|
|
70761
|
+
outcome_message: params.outcomeMessage ?? (params.outcome === "already_sent" ? formatDeletedEarlierSendNotice() : formatSendFailureSummary(params.noun, params.outcome, params.httpStatus, params.httpStatus === void 0 ? void 0 : sendErrorMessage(params.error))),
|
|
70640
70762
|
...sendIdentityFields({
|
|
70641
70763
|
idempotencyKey: params.idempotencyKey,
|
|
70642
70764
|
sent
|
|
@@ -71668,11 +71790,6 @@ var ChatCommand = class ChatCommand extends Command {
|
|
|
71668
71790
|
saveChatReceipt(params.receipt);
|
|
71669
71791
|
}
|
|
71670
71792
|
params.progress?.fail(outcome === "already_sent" ? `${params.noun} already sent earlier.` : `${params.noun} send failed.`);
|
|
71671
|
-
writeErrorWithHints(errorPayload);
|
|
71672
|
-
surfaceUnauthorizedHint({
|
|
71673
|
-
...params.authFailureContext,
|
|
71674
|
-
payload: errorPayload
|
|
71675
|
-
});
|
|
71676
71793
|
const envelope = buildChatSendFailureEnvelope({
|
|
71677
71794
|
error: errorPayload,
|
|
71678
71795
|
httpStatus,
|
|
@@ -71687,6 +71804,11 @@ var ChatCommand = class ChatCommand extends Command {
|
|
|
71687
71804
|
process.stderr.write(`${chatNoticeText(envelope.outcome_message)}\n`);
|
|
71688
71805
|
if (!params.json) this.log(envelope.outcome_message);
|
|
71689
71806
|
} else process.stderr.write(`${chatFailureText(envelope.outcome_message)}\n`);
|
|
71807
|
+
writeErrorWithHints(errorPayload);
|
|
71808
|
+
surfaceUnauthorizedHint({
|
|
71809
|
+
...params.authFailureContext,
|
|
71810
|
+
payload: errorPayload
|
|
71811
|
+
});
|
|
71690
71812
|
if (params.json) this.log(JSON.stringify(envelope, null, 2));
|
|
71691
71813
|
if (envelope.exit_code !== 0) process.exitCode = envelope.exit_code;
|
|
71692
71814
|
}
|
|
@@ -72879,7 +73001,7 @@ async function checkAskedOfYou(client, now = Date.now()) {
|
|
|
72879
73001
|
const waiting = asked.more ? [`at least ${requests + objections} rule requests and objections`] : [...requests > 0 ? [plural$1(requests, "rule request")] : [], ...objections > 0 ? [plural$1(objections, "objection")] : []];
|
|
72880
73002
|
const items = concerning?.items ?? [];
|
|
72881
73003
|
const pending = items.filter((item) => item.state === "pending").length;
|
|
72882
|
-
const notices = items.filter((item) => (item.state === "started" || item.state === "new_version" || item.state === "receivers_changed") && Date.parse(item.created_at) >= since).length;
|
|
73004
|
+
const notices = items.filter((item) => (item.state === "started" || item.state === "new_version" || item.state === "receivers_changed" || item.state === "stopped") && Date.parse(item.created_at) >= since).length;
|
|
72883
73005
|
const parts = [
|
|
72884
73006
|
...waiting.length > 0 ? [`${waiting.join(" and ")} waiting for you`] : [],
|
|
72885
73007
|
...ASKED_KINDS.filter((kind) => hidden.has(kind)).map((kind) => `${kind === "email_rule_request" ? "rule requests" : "objections"} not shown to this credential`),
|
|
@@ -72929,7 +73051,7 @@ function checkReceiverStart(configDir, profileName) {
|
|
|
72929
73051
|
}
|
|
72930
73052
|
}
|
|
72931
73053
|
var DoctorCommand = class DoctorCommand extends Command {
|
|
72932
|
-
static description = `Run a one-shot environment health check: Node version, proxy env, CLI auth resolution, /account reachability, verified-domain status, and, signed in as yourself, the rule requests and objections waiting for you and the rules over your mail that recently started covering it or
|
|
73054
|
+
static description = `Run a one-shot environment health check: Node version, proxy env, CLI auth resolution, /account reachability, verified-domain status, and, signed in as yourself, the rule requests and objections waiting for you and the rules over your mail that recently started covering it, changed or stopped. With PRIMITIVE_AGENT_PROFILE selected, reports saved identity offline and points to whoami and exact listener status instead of account-only checks. Prints actionable hints for each warning or failure.`;
|
|
72933
73055
|
static summary = "Check the local environment and live API for common problems";
|
|
72934
73056
|
static examples = ["<%= config.bin %> doctor", "<%= config.bin %> doctor --api-key prim_..."];
|
|
72935
73057
|
static flags = {
|
|
@@ -76029,8 +76151,8 @@ const PRIMITIVE_TEAM_AUTHOR = {
|
|
|
76029
76151
|
name: "Primitive Team",
|
|
76030
76152
|
url: "https://primitive.dev"
|
|
76031
76153
|
};
|
|
76032
|
-
const SDK_VERSION_RANGE = "^3.0.0-preview.
|
|
76033
|
-
const CLI_VERSION_RANGE = "^3.0.0-preview.
|
|
76154
|
+
const SDK_VERSION_RANGE = "^3.0.0-preview.16";
|
|
76155
|
+
const CLI_VERSION_RANGE = "^3.0.0-preview.16";
|
|
76034
76156
|
const ESBUILD_VERSION_RANGE = "^0.27.0";
|
|
76035
76157
|
function renderHandler() {
|
|
76036
76158
|
return `// env.PRIMITIVE_API_KEY, env.PRIMITIVE_WEBHOOK_SECRET, and
|