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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
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";
1
+ import { $ as interactionHumanLine, $t as ATTACHMENT_WAIT_MAX_MS, A as listenForCopyHotkey, At as successfulSendOutcome, B as serverMuted, Bt as detectAgentRuntime, C as STEP_UP_TOKEN_FLAG_DESCRIPTION, Ct as reportSendCommandResult, D as withApproval, Dt as sendWaitClampNotice, E as terminalApprovalIo, Et as sendOutcomeExitCode, F as displayAddress, G as wakeRelationship, Gt as emptyEmailListHint, Ht as runtimeSessionVariableList, I as formatMailWakeLine, It as generatedAgentName, J as clearReadPendingMail, Jt as classificationFactLines, K as claimPendingMail, Kt as mailReach, L as latestOwnOutbound, Lt as identitySuggestions, M as explainPendingMailNotFound, N as bareAddress, Nt as cliInvocation, O as canOfferCopyHotkey, Ot as sentHistoryWindowStart, P as describeWake, Pt as connectNextSteps, Q as removePendingMail, Qt as ATTACHMENT_WAIT_FLAG_DESCRIPTION, R as readThreadContext, Rt as loadSkillLine, S as STEP_UP_HEADER$1, St as priorRepliesThatWentOut, T as promptLine$2, Tt as sendIdentityFields, U as wakeReadCommand, Ut as formatAlreadySentNotice, V as serverRelationship, Vt as detectRuntimeSession, W as wakeRecipientField, Wt as withFlagSuggestion, X as readPendingMail, Xt as isEmailId, Y as pendingMailPath, Yt as classificationOf, Z as recordPendingMail, Zt as noFactsMessage, _ as runWithTiming, _n as switchCurrentOrg, _t as formatDeletedEarlierSendNotice, a as createOperationCommand, an as refreshStoredCliCredentials, at as IDEMPOTENCY_KEY_FLAG_DESCRIPTION, b as writeErrorWithHints, bn as setKnownCommands, bt as formatSendFailureSummary, c as formatErrorPayload, cn as selectedOrgFromEnv, ct as apiResultHttpStatus, d as isGrantRefusal, dn as credentialsFromUserLogin, dt as buildThrownSendFailureEnvelope, en as withAttachmentWait, et as interactionNextActions, f as networkErrorHint, fn as fetchCliOrgs, ft as checkPriorReplies, g as refusesCredential, gn as roleKeyText, gt as followUpCommandPrefix, h as refusalDetails, hn as roleKeyLabel, ht as excludeSignalReplies, i as TIME_FLAG_DESCRIPTION, in as createCliApiClient, j as openBrowser, jt as thrownErrorExitCode, k as formatBrowserLoginInstructions, kt as serializeErrorPayload, l as hasControlCharacter$1, ln as CliOrgRefusedError, lt as assertValidIdempotencyKey, m as readTextFileFlag, mn as revokeUserLogin, mt as deriveSendIdempotencyKey, n as API_ERROR_CODES, nt as replyExpectation, o as extractErrorCode, on as refuseOrgSelectionForProfile, ot as MAX_SEND_WAIT_TIMEOUT_MS, p as parameterFlagName, pn as isBuiltInRoleKey, pt as classifySendError, q as clearConsumedPendingMail, qt as readCallerMailFor, r as OPERATION_PATH_FLAGS, rn as createAuthenticatedCliApiClient, rt as replyInteractionWarning, s as extractErrorPayload, sn as resolveCliApiRequestConfig, st as SEND_OUTCOME_HELP, t as API_BASE_URL_FLAG_DESCRIPTION, tn as ConnectedAgentKeyRequiredError, tt as readEmailInteraction, u as headerFlagName, un as RESTRICTED_ROLE_NOTE, ut as buildFollowUpCommand, v as surfaceUnauthorizedHint, vn as routeWarningLines, vt as formatPriorRepliesCheckSkipped, w as approveThenRerunHint, wt as sendErrorMessage, x as BROWSER_FLAG_DESCRIPTION, xn as operationManifest, xt as formatSendRecordFailureSummary, y as takesStepUp, yn as sanitizeForTerminal, yt as formatPriorRepliesWarning, z as sentInThread, zt as currentMailSessionKey } from "../api-command-CgBNtNyD.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-DlfpQiUq.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-Pt4oRh0I.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-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";
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-CSqj4DmF.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-Du-Bi0tC.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-Bkr_XwLC.js";
9
+ import { _ as EventConnection, a as ensureSharedMailSubscription, d as createSharedMailWaiter, f as openSharedMailStore, g as otherParticipants, h as readConversationFollow, i as sharedMailScope, l as KEY_REVOKED_MESSAGE, m as followEmailConversation, n as reconcileChatSend, p as reserveSharedMailSubscription, r as openSharedMailReceiver, s as AGENT_CONNECTION_REQUIRED_MESSAGE, t as sendSignal, u as isConnectedAgentKey, v as EventReceiverError } from "../signal-command-DZuZbt-_.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";
@@ -21779,7 +21779,7 @@ const openapiDocument = {
21779
21779
  "/activity/objects": { "get": {
21780
21780
  "operationId": "listActivityObjects",
21781
21781
  "summary": "List what you created, or what you were asked",
21782
- "description": "The objects the caller created, newest first, each with where it stands now, including ones since disabled, deleted or revoked where the object keeps a row: Functions, endpoints, Function triggers, pull subscriptions, recipient routes, filters, wake schedules, repeating sends and scheduled sends. An API key, an app or an agent sees what it created itself; a webhook given to an API key lists under that key. A person (a dashboard session, or their own Primitive CLI or app login) sees what they created through any credential of theirs, each item naming it, and also their API keys, personal agents, email rules, rule requests and objections to rules over their mail (objections only on the dashboard or the Primitive CLI). Each kind is listed only if the caller could list it through that kind's own route; a kind it could not is named in withheld, with no count. Ids, names and states only: never a webhook URL or mail content. Needs activity:read_self. With relation=asked it lists instead what other members asked of the person, open or answered: the rule requests made to them, and the objections to rules they wrote, under their current membership, each naming the member who asked or objected in created_through. A key, an app or an agent has none, and gets both kinds in withheld. With relation=concerning it lists instead what other members did that concerns the person's own mail: each time a rule started covering one of their mailboxes, saved a new version, or changed who receives its matches while covering it, named as the rule was then, naming its author in created_through, under their current membership; only on the dashboard or the Primitive CLI. A key, an app or an agent has none, and gets email_rule_coverage in withheld. A notice never reads as ended. Notices are written by a periodic job and can lag: until the notices record a rule starting to cover you, the first page lists that rule as pending (pending_complete says whether that check finished), and as_of says about when the notices last looked. For what covers you now, read GET /email-rules/covering-me.",
21782
+ "description": "The objects the caller created, newest first, each with where it stands now, including ones since disabled, deleted or revoked where the object keeps a row: Functions, endpoints, Function triggers, pull subscriptions, recipient routes, filters, wake schedules, repeating sends and scheduled sends. An API key, an app or an agent sees what it created itself; a webhook given to an API key lists under that key. A person (a dashboard session, or their own Primitive CLI or app login) sees what they created through any credential of theirs, each item naming it, and also their API keys, personal agents, email rules, rule requests and objections to rules over their mail (objections only on the dashboard or the Primitive CLI). Each kind is listed only if the caller could list it through that kind's own route; a kind it could not is named in withheld, with no count. Ids, names and states only: never a webhook URL or mail content. Needs activity:read_self. With relation=asked it lists instead what other members asked of the person, open or answered: the rule requests made to them, and the objections to rules they wrote, under their current membership, each naming the member who asked or objected in created_through. A key, an app or an agent has none, and gets both kinds in withheld. With relation=concerning it lists instead what other members did that concerns the person's own mail: each time a rule started covering one of their mailboxes, saved a new version while covering it, or stopped covering it, named as the rule was then, naming its author in created_through, under their current membership; only on the dashboard or the Primitive CLI. A key, an app or an agent has none, and gets email_rule_coverage in withheld. A notice never reads as ended. Notices are written by a periodic job and can lag: until the notices record a rule starting to cover you, the first page lists that rule as pending (pending_complete says whether that check finished), and as_of says about when the notices last looked. For what covers you now, read GET /email-rules/covering-me.",
21783
21783
  "tags": ["Activity"],
21784
21784
  "security": [{ "BearerAuth": [] }],
21785
21785
  "parameters": [
@@ -21790,7 +21790,7 @@ const openapiDocument = {
21790
21790
  "description": "created (the default), asked or concerning.",
21791
21791
  "schema": {
21792
21792
  "default": "created",
21793
- "description": "created (the default): what you created. asked: what other members asked of you, open or answered: rule requests made to you, and objections to rules you wrote; kind may then name only email_rule_request and email_rule_objection. concerning: what other members did that concerns your own mail: an active rule that started covering one of your mailboxes, saved a new version, or changed who receives its matches while covering it (email_rule_coverage, the only kind it takes). A rule in draft or observe is not told of; GET /v1/email-rules/covering-me lists it. asked and concerning are for a person's own view only.",
21793
+ "description": "created (the default): what you created. asked: what other members asked of you, open or answered: rule requests made to you, and objections to rules you wrote; kind may then name only email_rule_request and email_rule_objection. concerning: what other members did that concerns your own mail: an active rule that started covering one of your mailboxes, saved a new version while covering it, or stopped covering it (email_rule_coverage, the only kind it takes). A rule in draft or observe is not told of; GET /v1/email-rules/covering-me lists it. asked and concerning are for a person's own view only.",
21794
21794
  "type": "string",
21795
21795
  "enum": [
21796
21796
  "created",
@@ -25318,7 +25318,7 @@ const openapiDocument = {
25318
25318
  "post": {
25319
25319
  "operationId": "createEmailRuleObjection",
25320
25320
  "summary": "Object to a rule over your mail",
25321
- "description": "Objects to a rule that covers one of your own mailboxes now: say in the message what you ask its author, to turn it off, narrow it, or explain who receives what it matches. The author answers by accepting, which turns it off, or by declining, optionally with a reason you see; the rule keeps running unless they accept. Only a rule that covers you now: one you see only because it once decided on your mail cannot be objected to. An objection is seen by the member who made it, the rule's author and the organization's owners and admins. It stays pending until the rule's author accepts it, turning the rule off, or declines it (optionally with a reason the objector sees), or the member who made it withdraws it, which clears its message. It never changes after that. You may have one pending objection per rule and 50 in all, and object to the same rule again only 10 minutes after you last did, whatever became of it. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
25321
+ "description": "Objects to a rule that covers one of your own mailboxes now: say in the message what you ask its author, to turn it off, narrow it, or explain who receives what it matches. The author answers by accepting, which turns it off, or by declining, optionally with a reason you see; the rule keeps running unless they accept. Only a rule that covers you now: one you see only because it once decided on your mail cannot be objected to. An objection is seen by the member who made it, the rule's author and the organization's owners and admins. It stays pending until the rule's author accepts it, turning the rule off, declines it (optionally with a reason the objector sees), or answers it amended once they have saved a newer version of the rule, or the member who made it withdraws it, which clears its message (not from an email to the author already sent or being sent). It never changes after that. You may have one pending objection per rule and 50 in all, and object to the same rule again only 10 minutes after you last did, whatever became of it. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
25322
25322
  "tags": ["Email Rule Oversight"],
25323
25323
  "security": [{ "BearerAuth": [] }],
25324
25324
  "requestBody": {
@@ -25419,7 +25419,7 @@ const openapiDocument = {
25419
25419
  "get": {
25420
25420
  "operationId": "listEmailRuleObjections",
25421
25421
  "summary": "List objections",
25422
- "description": "Objections you made and objections to rules you wrote (by default), only one of the two, or every objection you can see, newest first. An objection is seen by the member who made it, the rule's author and the organization's owners and admins. It stays pending until the rule's author accepts it, turning the rule off, or declines it (optionally with a reason the objector sees), or the member who made it withdraws it, which clears its message. It never changes after that. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
25422
+ "description": "Objections you made and objections to rules you wrote (by default), only one of the two, or every objection you can see, newest first. An objection is seen by the member who made it, the rule's author and the organization's owners and admins. It stays pending until the rule's author accepts it, turning the rule off, declines it (optionally with a reason the objector sees), or answers it amended once they have saved a newer version of the rule, or the member who made it withdraws it, which clears its message (not from an email to the author already sent or being sent). It never changes after that. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
25423
25423
  "tags": ["Email Rule Oversight"],
25424
25424
  "security": [{ "BearerAuth": [] }],
25425
25425
  "parameters": [
@@ -25553,7 +25553,7 @@ const openapiDocument = {
25553
25553
  "/email-rule-objections/{id}": { "get": {
25554
25554
  "operationId": "getEmailRuleObjection",
25555
25555
  "summary": "Get an objection",
25556
- "description": "One objection you can see. An objection is seen by the member who made it, the rule's author and the organization's owners and admins. It stays pending until the rule's author accepts it, turning the rule off, or declines it (optionally with a reason the objector sees), or the member who made it withdraws it, which clears its message. It never changes after that. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
25556
+ "description": "One objection you can see. An objection is seen by the member who made it, the rule's author and the organization's owners and admins. It stays pending until the rule's author accepts it, turning the rule off, declines it (optionally with a reason the objector sees), or answers it amended once they have saved a newer version of the rule, or the member who made it withdraws it, which clears its message (not from an email to the author already sent or being sent). It never changes after that. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
25557
25557
  "tags": ["Email Rule Oversight"],
25558
25558
  "security": [{ "BearerAuth": [] }],
25559
25559
  "parameters": [{
@@ -25637,7 +25637,7 @@ const openapiDocument = {
25637
25637
  "/email-rule-objections/{id}/withdraw": { "post": {
25638
25638
  "operationId": "withdrawEmailRuleObjection",
25639
25639
  "summary": "Withdraw an objection",
25640
- "description": "Withdraws a pending objection you made, and clears its message. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
25640
+ "description": "Withdraws a pending objection you made, and clears its message; an email to the rule's author already sent or being sent keeps it. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
25641
25641
  "tags": ["Email Rule Oversight"],
25642
25642
  "security": [{ "BearerAuth": [] }],
25643
25643
  "parameters": [{
@@ -25735,7 +25735,7 @@ const openapiDocument = {
25735
25735
  "/email-rule-objections/{id}/decline": { "post": {
25736
25736
  "operationId": "declineEmailRuleObjection",
25737
25737
  "summary": "Decline an objection to your rule",
25738
- "description": "Declines a pending objection to a rule you wrote, optionally saying why (reason), which the member who objected sees; the rule stays as it is. When its message asks you to narrow the rule or explain who receives it, the reason is your answer; narrow it with a new version as well if you agree. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
25738
+ "description": "Declines a pending objection to a rule you wrote, optionally saying why (reason), which the member who objected sees; the rule stays as it is. When its message asks you to explain who receives what the rule matches, the reason is your answer. If you changed the rule instead, answer amended. Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
25739
25739
  "tags": ["Email Rule Oversight"],
25740
25740
  "security": [{ "BearerAuth": [] }],
25741
25741
  "parameters": [{
@@ -25945,6 +25945,121 @@ const openapiDocument = {
25945
25945
  },
25946
25946
  "x-primitive-permission": ["mail:read"]
25947
25947
  } },
25948
+ "/email-rule-objections/{id}/amend": { "post": {
25949
+ "operationId": "amendEmailRuleObjection",
25950
+ "summary": "Answer an objection to your rule as amended",
25951
+ "description": "Answers a pending objection to a rule you wrote by saying you changed the rule: save a new version first (PATCH /email-rules/{id}), then answer amended, optionally with a note the member who objected sees. Records the version the rule has now (rule.amended_version). Refused unless the rule's current version is newer than when the objection was made (rule.objected_version). Needs mail:read, the email rules feature, and a member's own full-access credential (no API key, agent key or narrowed token). Only on your own dashboard session or the Primitive CLI.",
25952
+ "tags": ["Email Rule Oversight"],
25953
+ "security": [{ "BearerAuth": [] }],
25954
+ "parameters": [{
25955
+ "name": "id",
25956
+ "in": "path",
25957
+ "required": true,
25958
+ "description": "The objection id.",
25959
+ "schema": {
25960
+ "type": "string",
25961
+ "format": "uuid"
25962
+ }
25963
+ }, {
25964
+ "name": "Idempotency-Key",
25965
+ "in": "header",
25966
+ "required": false,
25967
+ "description": "Optional, and not used to deduplicate: this operation stores no result by the key, so a retry with the same key runs the request again. Operations that need a credential refuse a key that is empty, longer than 255 characters or not printable ASCII with 400 `validation_error` and echo a valid one in the Idempotency-Key response header; operations that need none ignore it.",
25968
+ "schema": {
25969
+ "type": "string",
25970
+ "minLength": 1,
25971
+ "maxLength": 255
25972
+ }
25973
+ }],
25974
+ "requestBody": {
25975
+ "required": false,
25976
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AmendEmailRuleObjectionRequest" } } }
25977
+ },
25978
+ "responses": {
25979
+ "200": {
25980
+ "description": "Answer an objection to your rule as amended",
25981
+ "content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
25982
+ "type": "object",
25983
+ "required": ["data"],
25984
+ "properties": { "data": { "$ref": "#/components/schemas/AmendEmailRuleObjectionResult" } }
25985
+ }] } } },
25986
+ "headers": {
25987
+ "ratelimit-limit": { "$ref": "#/components/headers/ratelimit-limit" },
25988
+ "ratelimit-remaining": { "$ref": "#/components/headers/ratelimit-remaining" },
25989
+ "ratelimit-reset": { "$ref": "#/components/headers/ratelimit-reset" },
25990
+ "ratelimit-policy": { "$ref": "#/components/headers/ratelimit-policy" }
25991
+ }
25992
+ },
25993
+ "400": {
25994
+ "description": "Invalid request parameters",
25995
+ "content": { "application/json": {
25996
+ "schema": { "$ref": "#/components/schemas/ErrorResponse" },
25997
+ "example": {
25998
+ "success": false,
25999
+ "error": {
26000
+ "code": "validation_error",
26001
+ "message": "Invalid domain format"
26002
+ }
26003
+ }
26004
+ } }
26005
+ },
26006
+ "401": {
26007
+ "description": "Invalid or missing API key",
26008
+ "content": { "application/json": {
26009
+ "schema": { "$ref": "#/components/schemas/ErrorResponse" },
26010
+ "example": {
26011
+ "success": false,
26012
+ "error": {
26013
+ "code": "unauthorized",
26014
+ "message": "Invalid or missing API key"
26015
+ }
26016
+ }
26017
+ } },
26018
+ "headers": {
26019
+ "ratelimit-limit": { "$ref": "#/components/headers/ratelimit-limit-unauthenticated" },
26020
+ "ratelimit-remaining": { "$ref": "#/components/headers/ratelimit-remaining-unauthenticated" },
26021
+ "ratelimit-reset": { "$ref": "#/components/headers/ratelimit-reset-unauthenticated" },
26022
+ "ratelimit-policy": { "$ref": "#/components/headers/ratelimit-policy-unauthenticated" }
26023
+ }
26024
+ },
26025
+ "403": {
26026
+ "description": "feature_not_enabled: this organization lacks the email rules feature; permission refusals answer forbidden or grant_forbidden; details.reason first_party_required means this credential is not your dashboard session or the Primitive CLI. forbidden with details.reason author_only: only the rule's author can answer it.",
26027
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
26028
+ },
26029
+ "404": {
26030
+ "description": "not_found: no objection with this id that you can see.",
26031
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
26032
+ },
26033
+ "409": {
26034
+ "description": "not_pending: it was already decided or withdrawn (details.status). conflict with details.reason no_new_version: the rule has no version newer than details.objected_version (details.current_version is its version now); rule_deleted: the rule was deleted.",
26035
+ "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
26036
+ },
26037
+ "429": {
26038
+ "description": "Rate limit exceeded. The `ratelimit-*` headers describe the limiter that rejected this request, with its own limit and window, not the API budget that successful responses report. A limiter that reports only a wait sends `Retry-After` alone.",
26039
+ "headers": {
26040
+ "Retry-After": {
26041
+ "schema": { "type": "integer" },
26042
+ "description": "Seconds to wait before retrying"
26043
+ },
26044
+ "ratelimit-limit": { "$ref": "#/components/headers/ratelimit-limit-429" },
26045
+ "ratelimit-remaining": { "$ref": "#/components/headers/ratelimit-remaining-429" },
26046
+ "ratelimit-reset": { "$ref": "#/components/headers/ratelimit-reset" },
26047
+ "ratelimit-policy": { "$ref": "#/components/headers/ratelimit-policy-429" }
26048
+ },
26049
+ "content": { "application/json": {
26050
+ "schema": { "$ref": "#/components/schemas/ErrorResponse" },
26051
+ "example": {
26052
+ "success": false,
26053
+ "error": {
26054
+ "code": "rate_limit_exceeded",
26055
+ "message": "Rate limit exceeded"
26056
+ }
26057
+ }
26058
+ } }
26059
+ }
26060
+ },
26061
+ "x-primitive-permission": ["mail:read"]
26062
+ } },
25948
26063
  "/domains/{id}/agent-authorization": { "get": {
25949
26064
  "operationId": "getDomainAgentAuthorization",
25950
26065
  "summary": "Get a domain's Agent Authorization status",
@@ -41297,6 +41412,7 @@ const openapiDocument = {
41297
41412
  "keep_refused",
41298
41413
  "key_change_superseded",
41299
41414
  "key_recently_created",
41415
+ "key_revoked",
41300
41416
  "last_owner",
41301
41417
  "latest_message_mismatch",
41302
41418
  "latest_message_thread_unresolved",
@@ -48393,7 +48509,7 @@ const openapiDocument = {
48393
48509
  "duration_ms": { "type": ["integer", "null"] },
48394
48510
  "last_error": {
48395
48511
  "type": ["string", "null"],
48396
- "description": "Why the last attempt failed, or null. A webhook's answer is quoted after its status (HTTP 404: ...) only for a caller who can read the webhook (GET /endpoints/{id}; a deleted webhook only for a caller who reads every webhook); anyone else gets the status and a note. Text the platform writes (a redirect not followed, a network error) is shown to everyone."
48512
+ "description": "Why the last attempt failed, or null. A webhook's answer follows its status (HTTP 404: ...) as plain text, at most 300 characters (response_body has more); older attempts can quote more. It is quoted only for a caller who can read the webhook (GET /endpoints/{id}; a deleted webhook only for a caller who reads every webhook); anyone else gets the status and a note. Text the platform writes (a redirect not followed, a network error) is shown to everyone."
48397
48513
  },
48398
48514
  "created_at": {
48399
48515
  "type": "string",
@@ -51374,12 +51490,12 @@ const openapiDocument = {
51374
51490
  },
51375
51491
  "id": { "type": "string" },
51376
51492
  "name": {
51377
- "description": "The name the object is known by: an endpoint's display name, a route's or filter's pattern, a Function's name, a send's From address, a wake schedule's command and the address it wakes, an API key's name, an agent's address, a rule's or rule request's name, and for an objection or a coverage notice the name its rule had then. Never a webhook URL and never mail content.",
51493
+ "description": "The name the object is known by: an endpoint's display name, a route's or filter's pattern, a Function's name, a send's From address, a wake schedule's command and the address it wakes, an API key's name, an agent's address, a rule's or rule request's name, and for an objection or a coverage notice the name its rule had then (for a stopped notice, when you were last told of it, or while it last covered you). Never a webhook URL and never mail content.",
51378
51494
  "type": ["string", "null"]
51379
51495
  },
51380
51496
  "state": {
51381
51497
  "type": "string",
51382
- "description": "Where it stands now: enabled, disabled, deleted or replaced (endpoints and routes), enabled or disabled (filters, wake schedules), live, suspended or deleted (Functions), active, paused or ended (repeating sends), scheduled (scheduled sends), active, suspended, expired or revoked (API keys), pending, claimed, connected or revoked (agents), draft, observe or active (email rules), pending, accepted, declined or withdrawn (rule requests and objections), and for a coverage notice what it told: started (a rule was made or turned active over your mailboxes, or an active rule came to reach you; once per rule, not per mailbox), new_version, receivers_changed (who receives an active rule's matches changed: its keys, webhooks or share), or baseline (it already covered you when notices began). pending: a rule started covering your mailbox and the notices have not recorded that start yet (a restart within an hour of the last start notice is recorded without a new one); its id is then the rule's, and created_at when the rule last changed."
51498
+ "description": "Where it stands now: enabled, disabled, deleted or replaced (endpoints and routes), enabled or disabled (filters, wake schedules), live, suspended or deleted (Functions), active, paused or ended (repeating sends), scheduled (scheduled sends), active, suspended, expired or revoked (API keys), pending, claimed, connected or revoked (agents), draft, observe or active (email rules), pending, accepted, declined or withdrawn (rule requests and objections; an objection may also be amended), and for a coverage notice what it told: started (a rule was made or turned active over your mailboxes, or an active rule came to reach you; once per rule, not per mailbox), new_version, stopped (it no longer covers you, why in stop_reason), or baseline (it already covered you when notices began). pending: a rule started covering your mailbox and the notices have not recorded that start yet (a restart within an hour of the last start notice, or within 5 minutes of the notices finding the rule stopped, is recorded without a new one, unless you were told it stopped since); its id is then the rule's, and created_at when the rule last changed."
51383
51499
  },
51384
51500
  "created_at": {
51385
51501
  "type": "string",
@@ -51388,7 +51504,7 @@ const openapiDocument = {
51388
51504
  "ended_at": {
51389
51505
  "type": ["string", "null"],
51390
51506
  "format": "date-time",
51391
- "description": "When it was deleted, replaced or revoked, when an API key expired, when a repeating send stopped, or when a rule request or objection was decided (accepted, declined or withdrawn); null otherwise, as on every coverage notice (rule_now marks one whose rule was deleted)."
51507
+ "description": "When it was deleted, replaced or revoked, when an API key expired, when a repeating send stopped, or when a rule request or objection was decided (accepted, declined, withdrawn or, for an objection, amended); null otherwise, as on every coverage notice (rule_now marks one whose rule was deleted)."
51392
51508
  },
51393
51509
  "owned_now": {
51394
51510
  "type": "string",
@@ -51489,6 +51605,15 @@ const openapiDocument = {
51489
51605
  }
51490
51606
  },
51491
51607
  "required": ["before", "after"]
51608
+ },
51609
+ "stop_reason": {
51610
+ "description": "For a stopped notice: deleted, turned_off (no longer active), or no_longer_covers (active, reaching none of your mailboxes now).",
51611
+ "type": "string",
51612
+ "enum": [
51613
+ "deleted",
51614
+ "turned_off",
51615
+ "no_longer_covers"
51616
+ ]
51492
51617
  }
51493
51618
  },
51494
51619
  "required": [
@@ -51535,7 +51660,7 @@ const openapiDocument = {
51535
51660
  "as_of": {
51536
51661
  "type": ["string", "null"],
51537
51662
  "format": "date-time",
51538
- "description": "With relation=concerning only: about when the notices last looked at your organization; null if never or unread. Coverage since may have no notice yet. They look only while one of its rules could cover someone, so this stops moving while none could."
51663
+ "description": "With relation=concerning only: about when the notices last looked at your organization; null if never or unread. Coverage since may have no notice yet. They look only while one of its rules could cover someone, or a stopped notice is still to be told, so this stops moving while neither."
51539
51664
  },
51540
51665
  "pending_complete": {
51541
51666
  "description": "With relation=concerning, on the first page only: whether the check for rules that started covering you without their start notice (state pending, listed ahead of the notices and beyond limit) was finished. false: some may be missing. Absent where there is nothing to check.",
@@ -52016,7 +52141,15 @@ const openapiDocument = {
52016
52141
  "properties": {
52017
52142
  "question": { "type": "string" },
52018
52143
  "answer": { "type": ["boolean", "null"] },
52019
- "probability": { "type": ["number", "null"] },
52144
+ "confidence": {
52145
+ "description": "How sure the answer is, from 0 to 1: the chance of the answer given, as webhook payloads carry it. Null when unanswered.",
52146
+ "type": ["number", "null"]
52147
+ },
52148
+ "probability": {
52149
+ "deprecated": true,
52150
+ "description": "Deprecated: read confidence. The chance the answer is yes.",
52151
+ "type": ["number", "null"]
52152
+ },
52020
52153
  "error_class": { "type": "string" }
52021
52154
  },
52022
52155
  "required": [
@@ -52474,7 +52607,15 @@ const openapiDocument = {
52474
52607
  "properties": {
52475
52608
  "question": { "type": "string" },
52476
52609
  "answer": { "type": ["boolean", "null"] },
52477
- "probability": { "type": ["number", "null"] },
52610
+ "confidence": {
52611
+ "description": "How sure the answer is, from 0 to 1: the chance of the answer given, as webhook payloads carry it. Null when unanswered.",
52612
+ "type": ["number", "null"]
52613
+ },
52614
+ "probability": {
52615
+ "deprecated": true,
52616
+ "description": "Deprecated: read confidence. The chance the answer is yes.",
52617
+ "type": ["number", "null"]
52618
+ },
52478
52619
  "error_class": { "type": "string" }
52479
52620
  },
52480
52621
  "required": [
@@ -52799,7 +52940,15 @@ const openapiDocument = {
52799
52940
  "properties": {
52800
52941
  "question": { "type": "string" },
52801
52942
  "answer": { "type": ["boolean", "null"] },
52802
- "probability": { "type": ["number", "null"] },
52943
+ "confidence": {
52944
+ "description": "How sure the answer is, from 0 to 1: the chance of the answer given, as webhook payloads carry it. Null when unanswered.",
52945
+ "type": ["number", "null"]
52946
+ },
52947
+ "probability": {
52948
+ "deprecated": true,
52949
+ "description": "Deprecated: read confidence. The chance the answer is yes.",
52950
+ "type": ["number", "null"]
52951
+ },
52803
52952
  "error_class": { "type": "string" }
52804
52953
  },
52805
52954
  "required": [
@@ -53160,7 +53309,15 @@ const openapiDocument = {
53160
53309
  "properties": {
53161
53310
  "question": { "type": "string" },
53162
53311
  "answer": { "type": ["boolean", "null"] },
53163
- "probability": { "type": ["number", "null"] },
53312
+ "confidence": {
53313
+ "description": "How sure the answer is, from 0 to 1: the chance of the answer given, as webhook payloads carry it. Null when unanswered.",
53314
+ "type": ["number", "null"]
53315
+ },
53316
+ "probability": {
53317
+ "deprecated": true,
53318
+ "description": "Deprecated: read confidence. The chance the answer is yes.",
53319
+ "type": ["number", "null"]
53320
+ },
53164
53321
  "error_class": { "type": "string" }
53165
53322
  },
53166
53323
  "required": [
@@ -54246,7 +54403,7 @@ const openapiDocument = {
54246
54403
  "question_answers": {
54247
54404
  "type": "array",
54248
54405
  "items": {},
54249
- "description": "The answers to the rule's own questions, when they were asked."
54406
+ "description": "The answers to the rule's own questions, when they were asked: each with question, answer, confidence, the deprecated probability and, when unanswered, error_class, as a test gives them."
54250
54407
  },
54251
54408
  "detail_withheld": {
54252
54409
  "description": "Present, as true, on a decision about an email whose content cannot be read (withheld, failed to parse, discarded, or still awaiting sender authentication): matched still says what the rule decided, but how it got there was read from that content, so parts and question_answers are empty and near_miss is false. Discarding an email's content normally removes its decisions. Absent otherwise.",
@@ -54583,7 +54740,15 @@ const openapiDocument = {
54583
54740
  "properties": {
54584
54741
  "question": { "type": "string" },
54585
54742
  "answer": { "type": ["boolean", "null"] },
54586
- "probability": { "type": ["number", "null"] },
54743
+ "confidence": {
54744
+ "description": "How sure the answer is, from 0 to 1: the chance of the answer given, as webhook payloads carry it. Null when unanswered.",
54745
+ "type": ["number", "null"]
54746
+ },
54747
+ "probability": {
54748
+ "deprecated": true,
54749
+ "description": "Deprecated: read confidence. The chance the answer is yes.",
54750
+ "type": ["number", "null"]
54751
+ },
54587
54752
  "error_class": { "type": "string" }
54588
54753
  },
54589
54754
  "required": [
@@ -55444,6 +55609,10 @@ const openapiDocument = {
55444
55609
  "description": "True when the rule is active and the share live but new email is not being shared now (what was shared stays visible); false when new email is shared. Null when it does not apply (share not live, rule not active, or you are not on the share) or could not be read.",
55445
55610
  "type": ["boolean", "null"]
55446
55611
  },
55612
+ "activity": {
55613
+ "description": "For the member it is shared with, on the dashboard or the Primitive CLI, while it is live and their access reads content: whether it is working, so a quiet mailbox can be told from a stopped share. Null otherwise.",
55614
+ "anyOf": [{ "$ref": "#/components/schemas/EmailRuleShareActivity" }, { "type": "null" }]
55615
+ },
55447
55616
  "is_granter": {
55448
55617
  "type": "boolean",
55449
55618
  "description": "Whether you are the member sharing their mail."
@@ -55487,7 +55656,7 @@ const openapiDocument = {
55487
55656
  "rule_id": {
55488
55657
  "type": ["string", "null"],
55489
55658
  "format": "uuid",
55490
- "description": "The rule itself. Only for the member sharing their mail; null for anyone else."
55659
+ "description": "The rule itself. Only for the member sharing their mail; null for anyone else. The member it is shared with lists this share's id in a key's grant.rules instead (from the dashboard), and their own webhooks receive what it shares."
55491
55660
  }
55492
55661
  },
55493
55662
  "required": [
@@ -55508,6 +55677,41 @@ const openapiDocument = {
55508
55677
  "rule_id"
55509
55678
  ]
55510
55679
  },
55680
+ "EmailRuleShareActivity": {
55681
+ "type": "object",
55682
+ "properties": {
55683
+ "rule_active": {
55684
+ "type": "boolean",
55685
+ "description": "Whether the rule is active now: only an active rule shares."
55686
+ },
55687
+ "last_decided_at": {
55688
+ "type": ["string", "null"],
55689
+ "format": "date-time",
55690
+ "description": "The start of the hour in which the rule last decided on any email in the sharing member's mailboxes since the share began, counting only hours that have ended and the hour of the newest email shared; null if none, or not read."
55691
+ },
55692
+ "shared_emails": {
55693
+ "type": ["integer", "null"],
55694
+ "minimum": 0,
55695
+ "description": "Emails this share has shared, counted up to 10,000; null when these could not be read."
55696
+ },
55697
+ "shared_emails_more": {
55698
+ "description": "Present when it has shared more than 10,000.",
55699
+ "type": "boolean",
55700
+ "const": true
55701
+ },
55702
+ "last_shared_at": {
55703
+ "type": ["string", "null"],
55704
+ "format": "date-time",
55705
+ "description": "When it last shared one; null if it has not, or not read."
55706
+ }
55707
+ },
55708
+ "required": [
55709
+ "rule_active",
55710
+ "last_decided_at",
55711
+ "shared_emails",
55712
+ "last_shared_at"
55713
+ ]
55714
+ },
55511
55715
  "EmailRuleShareGranter": {
55512
55716
  "type": "object",
55513
55717
  "properties": {
@@ -56232,7 +56436,7 @@ const openapiDocument = {
56232
56436
  "question_answers": {
56233
56437
  "type": "array",
56234
56438
  "items": {},
56235
- "description": "The answers to the rule's own questions, when they were asked."
56439
+ "description": "The answers to the rule's own questions, when they were asked: each with question, answer, confidence, the deprecated probability and, when unanswered, error_class, as a test gives them."
56236
56440
  },
56237
56441
  "detail_withheld": {
56238
56442
  "description": "Present, as true, when the email's content cannot be read: matched still says what the rule decided, and parts and question_answers are empty.",
@@ -56290,9 +56494,10 @@ const openapiDocument = {
56290
56494
  "pending",
56291
56495
  "accepted",
56292
56496
  "declined",
56293
- "withdrawn"
56497
+ "withdrawn",
56498
+ "amended"
56294
56499
  ],
56295
- "description": "pending until the rule's author accepts it (turning the rule off) or declines it, or the member who made it withdraws it; never changes after."
56500
+ "description": "pending until the rule's author accepts it (turning the rule off), declines it, or answers it amended (they saved a newer version of the rule), or the member who made it withdraws it; never changes after."
56296
56501
  },
56297
56502
  "rule": {
56298
56503
  "type": "object",
@@ -56305,9 +56510,22 @@ const openapiDocument = {
56305
56510
  "name": {
56306
56511
  "type": "string",
56307
56512
  "description": "Its name when the objection was made."
56513
+ },
56514
+ "objected_version": {
56515
+ "type": ["integer", "null"],
56516
+ "description": "The rule's version when the objection was made; null when it could not be told for an older objection."
56517
+ },
56518
+ "amended_version": {
56519
+ "type": ["integer", "null"],
56520
+ "description": "The rule's version when its author answered amended; null otherwise."
56308
56521
  }
56309
56522
  },
56310
- "required": ["id", "name"]
56523
+ "required": [
56524
+ "id",
56525
+ "name",
56526
+ "objected_version",
56527
+ "amended_version"
56528
+ ]
56311
56529
  },
56312
56530
  "objector": {
56313
56531
  "description": "Who objected.",
@@ -56333,6 +56551,10 @@ const openapiDocument = {
56333
56551
  "description": "The author's answer when declining, which the objector sees; null when none was given.",
56334
56552
  "type": ["string", "null"]
56335
56553
  },
56554
+ "amend_note": {
56555
+ "description": "The author's note when answering amended, which the objector sees; null when none was given.",
56556
+ "type": ["string", "null"]
56557
+ },
56336
56558
  "created_at": {
56337
56559
  "type": "string",
56338
56560
  "format": "date-time"
@@ -56356,6 +56578,7 @@ const openapiDocument = {
56356
56578
  "is_author",
56357
56579
  "message",
56358
56580
  "decline_reason",
56581
+ "amend_note",
56359
56582
  "created_at",
56360
56583
  "decided_at",
56361
56584
  "decided_by_user_id"
@@ -56392,7 +56615,7 @@ const openapiDocument = {
56392
56615
  "type": ["string", "null"],
56393
56616
  "minLength": 1,
56394
56617
  "maxLength": 500,
56395
- "description": "Why you object and what you ask, up to 500 characters: to turn the rule off, to narrow it, or to explain who receives what it matches. Null or absent for none. The rule's author and the organization's owners and admins see it while it stands; withdrawing clears it."
56618
+ "description": "Why you object and what you ask, up to 500 characters: to turn the rule off, to narrow it, or to explain who receives what it matches. Null or absent for none. The rule's author and the organization's owners and admins see it while it stands, and an email to the author about the objection quotes it. Withdrawing clears it from the objection, not from an email already sent or being sent."
56396
56619
  }
56397
56620
  },
56398
56621
  "required": ["rule_id"],
@@ -56411,12 +56634,23 @@ const openapiDocument = {
56411
56634
  "type": ["string", "null"],
56412
56635
  "minLength": 1,
56413
56636
  "maxLength": 500,
56414
- "description": "Why you are declining, up to 500 characters; null or absent for none. The member who objected sees it: it is how to answer one that asks you to narrow the rule or explain who receives it."
56637
+ "description": "Why you are declining, up to 500 characters; null or absent for none. The member who objected sees it: it is how to answer one that asks you to explain who receives it. If you changed the rule instead, answer amended."
56415
56638
  } },
56416
56639
  "additionalProperties": false
56417
56640
  },
56418
56641
  "DeclineEmailRuleObjectionResult": { "$ref": "#/components/schemas/EmailRuleObjection" },
56419
56642
  "AcceptEmailRuleObjectionResult": { "$ref": "#/components/schemas/EmailRuleObjection" },
56643
+ "AmendEmailRuleObjectionRequest": {
56644
+ "type": "object",
56645
+ "properties": { "note": {
56646
+ "type": ["string", "null"],
56647
+ "minLength": 1,
56648
+ "maxLength": 500,
56649
+ "description": "What you changed, up to 500 characters; null or absent for none. The member who objected sees it."
56650
+ } },
56651
+ "additionalProperties": false
56652
+ },
56653
+ "AmendEmailRuleObjectionResult": { "$ref": "#/components/schemas/EmailRuleObjection" },
56420
56654
  "GetDomainAgentAuthorizationResult": {
56421
56655
  "type": "object",
56422
56656
  "properties": {
@@ -58443,7 +58677,7 @@ const openapiDocument = {
58443
58677
  "attempt_count": { "type": "integer" },
58444
58678
  "duration_ms": { "type": ["integer", "null"] },
58445
58679
  "last_error": {
58446
- "description": "Why the last attempt failed, or null. A webhook's answer is quoted after its status (HTTP 404: ...) only for a caller who can read the webhook (GET /endpoints/{id}; a deleted webhook only for a caller who reads every webhook); anyone else gets the status and a note. Text the platform writes (a redirect not followed, a network error) is shown to everyone.",
58680
+ "description": "Why the last attempt failed, or null. A webhook's answer follows its status (HTTP 404: ...) as plain text, at most 300 characters (response_body has more); older attempts can quote more. It is quoted only for a caller who can read the webhook (GET /endpoints/{id}; a deleted webhook only for a caller who reads every webhook); anyone else gets the status and a note. Text the platform writes (a redirect not followed, a network error) is shown to everyone.",
58447
58681
  "type": ["string", "null"]
58448
58682
  },
58449
58683
  "last_error_code": {
@@ -61080,6 +61314,7 @@ const openapiDocument = {
61080
61314
  "items": { "type": "string" }
61081
61315
  },
61082
61316
  "rules": {
61317
+ "description": "Email rule ids: the key also reads the emails these rules granted. An address listed beside them is read in full, so rules beside a domain, a retired address or the address of a member other than the key's holder (its creator, or whoever it was transferred to) are refused (400 validation_error, details.reason rules_beside_domain or rules_beside_personal_mailbox). A rule shared with you goes here by its share's id, from your dashboard session only.",
61083
61318
  "maxItems": 20,
61084
61319
  "type": "array",
61085
61320
  "items": { "type": "string" }
@@ -61365,6 +61600,7 @@ const openapiDocument = {
61365
61600
  "items": { "type": "string" }
61366
61601
  },
61367
61602
  "rules": {
61603
+ "description": "Email rule ids: the key also reads the emails these rules granted. An address listed beside them is read in full, so rules beside a domain, a retired address or the address of a member other than the key's holder (its creator, or whoever it was transferred to) are refused (400 validation_error, details.reason rules_beside_domain or rules_beside_personal_mailbox). A rule shared with you goes here by its share's id, from your dashboard session only.",
61368
61604
  "maxItems": 20,
61369
61605
  "type": "array",
61370
61606
  "items": { "type": "string" }
@@ -63355,6 +63591,7 @@ const openapiDocument = {
63355
63591
  "items": { "type": "string" }
63356
63592
  },
63357
63593
  "rules": {
63594
+ "description": "Email rule ids: the key also reads the emails these rules granted. An address listed beside them is read in full, so rules beside a domain, a retired address or the address of a member other than the key's holder (its creator, or whoever it was transferred to) are refused (400 validation_error, details.reason rules_beside_domain or rules_beside_personal_mailbox). A rule shared with you goes here by its share's id, from your dashboard session only.",
63358
63595
  "maxItems": 20,
63359
63596
  "type": "array",
63360
63597
  "items": { "type": "string" }
@@ -65544,6 +65781,8 @@ function receiverTotals(value) {
65544
65781
  * or, when the totals are equal (an owner or a webhook site changed), that
65545
65782
  * they are. Null for any other notice, and for one whose totals are missing
65546
65783
  * or not counts (an older server).
65784
+ * The API no longer sends these notices; this only reads one written before,
65785
+ * should an answer still carry it, so the help and the table promise none.
65547
65786
  */
65548
65787
  function receiversChangeText(item) {
65549
65788
  if (item.state !== "receivers_changed") return null;
@@ -65579,14 +65818,14 @@ function stoppedText(item) {
65579
65818
  /** Where to see what covers you now, whatever the notices have caught up with. */
65580
65819
  const COVERING_NOW = `\`primitive email-rule-oversight list-email-rules-covering-me\` shows what covers you now.`;
65581
65820
  /**
65582
- * One line per coverage notice: what it told (started, new_version,
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,
65585
- * each rule that covers you now whose notice is not written yet (pending,
65586
- * dated when the rule last changed), then the rule's id (rule_id; a pending
65587
- * row's own id is the rule's), never the notice's own id, which no command
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).
65821
+ * One line per coverage notice: what it told (started, new_version, stopped,
65822
+ * or baseline for a rule that already covered you when notices began), when,
65823
+ * the rule's name then, and its author; and, first, each rule that covers you
65824
+ * now whose notice is not written yet (pending, dated when the rule last
65825
+ * changed), then the rule's id (rule_id; a pending row's own id is the
65826
+ * rule's), never the notice's own id, which no command takes; and, when any
65827
+ * row is a stopped notice with its reason (or an older receivers_changed
65828
+ * notice with its totals), what changed (CHANGE).
65590
65829
  * `complete` says the listing is the whole of it (from the first page to the
65591
65830
  * last, nothing withheld). Even then an empty one is no promise that nothing
65592
65831
  * covers you: notices can lag, so it
@@ -65617,13 +65856,11 @@ function formatConcerningRows(items, complete = false, asOf, pendingComplete) {
65617
65856
  const line = (cells) => cells.map((cell, i) => i === cells.length - 1 ? cell : cell.padEnd(widths[i] ?? 0)).join(" ").trimEnd();
65618
65857
  const pending = items.some((item) => item.state === "pending") ? ["", `pending: the rule covers you now and its notice is not written yet. ${COVERING_NOW}`] : [];
65619
65858
  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."] : [];
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."] : [];
65621
65859
  return [
65622
65860
  line(header),
65623
65861
  ...rows.map(line),
65624
65862
  ...pending,
65625
65863
  ...baseline,
65626
- ...receivers,
65627
65864
  ...unfinished ? ["", pending.length > 0 ? unfinished : `${unfinished} ${COVERING_NOW}`] : []
65628
65865
  ].join("\n");
65629
65866
  }
@@ -65826,7 +66063,7 @@ var ActivityAskedCommand = class ActivityAskedCommand extends Command {
65826
66063
  }
65827
66064
  };
65828
66065
  var ActivityConcerningCommand = class ActivityConcerningCommand extends Command {
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.
66066
+ 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), or saved a new version while covering it (new_version), 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. 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, and neither is a change in who receives the rule's matches (its keys, webhooks or share): \`primitive email-rule-oversight get-email-rule-covering-me <rule-id>\` shows who receives them now, by owner, while the rule covers you.
65830
66067
 
65831
66068
  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.
65832
66069
 
@@ -69973,12 +70210,26 @@ async function sendableDomains(apiClient) {
69973
70210
  return Array.isArray(domains) ? domains.filter((domain) => typeof domain === "string") : [];
69974
70211
  }
69975
70212
  /**
70213
+ * The code on a refusal for a send with no --from that has no default From
70214
+ * (several addresses it may send from, say), so a caller reading --json can
70215
+ * tell it from a failed request.
70216
+ */
70217
+ const NO_DEFAULT_FROM_CODE = "no_default_from";
70218
+ /**
70219
+ * The code on a refusal for a credential that lists no address or domain it
70220
+ * can send from (one that lists only email rules, say): no --from helps.
70221
+ */
70222
+ const NO_SEND_ADDRESS_CODE = "no_send_address";
70223
+ /**
69976
70224
  * The refusal for a credential with no From to default to: why, the
69977
70225
  * addresses and domains it may send from as far as the CLI can tell, and how
69978
70226
  * to pass --from. Never a guess: the CLI does not pick one of them.
69979
70227
  */
69980
70228
  async function noDefaultFrom(apiClient, grant, reason, options = {}) {
69981
- if (!grantSends(grant)) return new Errors.CLIError("This credential cannot send mail from any address, so --from has no default.", { exit: 1 });
70229
+ if (!grantSends(grant)) return new Errors.CLIError("This credential cannot send mail from any address, so --from has no default.", {
70230
+ exit: 1,
70231
+ code: NO_SEND_ADDRESS_CODE
70232
+ });
69982
70233
  const { exclude } = options;
69983
70234
  const reach = grantSendReach(grant);
69984
70235
  const addresses = (reach?.addresses ?? []).filter((address) => address.toLowerCase() !== exclude?.toLowerCase());
@@ -69988,7 +70239,10 @@ async function noDefaultFrom(apiClient, grant, reason, options = {}) {
69988
70239
  if (domains.length > 0) parts.push(`${addresses.length > 0 ? "Also any" : "Any"} address at: ${domains.join(", ")}.`);
69989
70240
  const example = options.example === false ? null : addresses[0] ?? (domains[0] ? `<name>@${domains[0]}` : null);
69990
70241
  parts.push(example ? `Pass the one to use with --from, for example --from ${example}.` : "Pass the address to send from with --from <address>.");
69991
- return new Errors.CLIError(`${reason} ${parts.join(" ")}`, { exit: 1 });
70242
+ return new Errors.CLIError(`${reason} ${parts.join(" ")}`, {
70243
+ exit: 1,
70244
+ code: reach !== null && addresses.length === 0 && domains.length === 0 ? NO_SEND_ADDRESS_CODE : NO_DEFAULT_FROM_CODE
70245
+ });
69992
70246
  }
69993
70247
  /**
69994
70248
  * Why the API would refuse a send from `from` to `to`, or null when it would
@@ -70023,7 +70277,7 @@ function unauthorizedRefusal(errorPayload, authFailureContext) {
70023
70277
  ...authFailureContext,
70024
70278
  payload: errorPayload
70025
70279
  });
70026
- return new Errors.CLIError("Cannot send: CLI auth is missing or invalid (see hint above).", { exit: 1 });
70280
+ return new Errors.CLIError(extractErrorCode(errorPayload) === API_ERROR_CODES.keyRevoked ? "Cannot send: this API key was revoked (see the message above)." : "Cannot send: CLI auth is missing or invalid (see the hint).", { exit: 1 });
70027
70281
  }
70028
70282
  /**
70029
70283
  * The From a send uses when --from is left out. A connected agent sends as
@@ -70049,7 +70303,10 @@ async function resolveDefaultFrom(apiClient, authFailureContext, options = {}) {
70049
70303
  address: authFailureContext.auth.connectedAgent.agentAddress,
70050
70304
  source: "agent"
70051
70305
  };
70052
- if (isConnectedChatCredential(authFailureContext.auth.apiKey)) throw new Errors.CLIError("Connected agents must pass --from with their connected email address.", { exit: 1 });
70306
+ if (isConnectedChatCredential(authFailureContext.auth.apiKey)) throw new Errors.CLIError("Connected agents must pass --from with their connected email address.", {
70307
+ exit: 1,
70308
+ code: NO_DEFAULT_FROM_CODE
70309
+ });
70053
70310
  const answered = await sendFromAnswer(apiClient, authFailureContext, options.purpose ?? "send");
70054
70311
  if (answered) return answered;
70055
70312
  const own = await getOwnGrant({
@@ -70058,7 +70315,7 @@ async function resolveDefaultFrom(apiClient, authFailureContext, options = {}) {
70058
70315
  });
70059
70316
  if (own.error) {
70060
70317
  const errorPayload = extractErrorPayload(own.error);
70061
- if (extractErrorCode(errorPayload) === API_ERROR_CODES.unauthorized) throw unauthorizedRefusal(errorPayload, authFailureContext);
70318
+ if (refusesCredential(extractErrorCode(errorPayload))) throw unauthorizedRefusal(errorPayload, authFailureContext);
70062
70319
  throw new Errors.CLIError(`Could not tell which addresses this credential may send from, so --from has no default. Pass --from <address>. Underlying error: ${formatErrorPayload(errorPayload)}`, { exit: 1 });
70063
70320
  }
70064
70321
  const grant = own.data?.data?.grant ?? null;
@@ -70189,7 +70446,7 @@ async function sendFromAnswer(apiClient, authFailureContext, purpose) {
70189
70446
  if (result.error) {
70190
70447
  const errorPayload = extractErrorPayload(result.error);
70191
70448
  const code = extractErrorCode(errorPayload);
70192
- if (code === API_ERROR_CODES.unauthorized) throw unauthorizedRefusal(errorPayload, authFailureContext);
70449
+ if (refusesCredential(code)) throw unauthorizedRefusal(errorPayload, authFailureContext);
70193
70450
  if (code === "not_found" || code === "function_scope_forbidden") return void 0;
70194
70451
  throw new Errors.CLIError(`Could not tell which address this credential may send from, so --from has no default. Pass --from <address>. Underlying error: ${formatErrorPayload(errorPayload)}`, { exit: 1 });
70195
70452
  }
@@ -70215,7 +70472,10 @@ async function sendFromAnswer(apiClient, authFailureContext, purpose) {
70215
70472
  if (domains.length > 0) parts.push(`${addresses.length > 0 ? "Also any" : "Any"} address at: ${domains.join(", ")}.`);
70216
70473
  parts.push(await claimHint(apiClient));
70217
70474
  if (!nothingListed) parts.push("Pass the address to use with --from <address>.");
70218
- throw new Errors.CLIError(parts.filter((part) => part).join(" "), { exit: 1 });
70475
+ throw new Errors.CLIError(parts.filter((part) => part).join(" "), {
70476
+ exit: 1,
70477
+ code: nothingListed ? NO_SEND_ADDRESS_CODE : NO_DEFAULT_FROM_CODE
70478
+ });
70219
70479
  }
70220
70480
  /** The address of resolveDefaultFrom. */
70221
70481
  async function pickDefaultFromAddress(apiClient, authFailureContext, options = {}) {
@@ -70238,7 +70498,7 @@ async function legacyDefaultFromAddress(apiClient) {
70238
70498
  });
70239
70499
  if (result.error) {
70240
70500
  const payload = extractErrorPayload(result.error);
70241
- if (extractErrorCode(payload) === API_ERROR_CODES.unauthorized) return { kind: "unauthorized" };
70501
+ if (refusesCredential(extractErrorCode(payload))) return { kind: "unauthorized" };
70242
70502
  if (!isGrantRefusal(payload)) return { kind: "unknown" };
70243
70503
  const own = await getOwnGrant({
70244
70504
  client: apiClient.client,
@@ -73001,7 +73261,7 @@ async function checkAskedOfYou(client, now = Date.now()) {
73001
73261
  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")] : []];
73002
73262
  const items = concerning?.items ?? [];
73003
73263
  const pending = items.filter((item) => item.state === "pending").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;
73264
+ const notices = items.filter((item) => (item.state === "started" || item.state === "new_version" || item.state === "stopped") && Date.parse(item.created_at) >= since).length;
73005
73265
  const parts = [
73006
73266
  ...waiting.length > 0 ? [`${waiting.join(" and ")} waiting for you`] : [],
73007
73267
  ...ASKED_KINDS.filter((kind) => hidden.has(kind)).map((kind) => `${kind === "email_rule_request" ? "rule requests" : "objections"} not shown to this credential`),
@@ -73064,7 +73324,7 @@ var DoctorCommand = class DoctorCommand extends Command {
73064
73324
  env: "PRIMITIVE_API_BASE_URL",
73065
73325
  hidden: true
73066
73326
  }),
73067
- json: Flags.boolean({ description: "Accepted for consistency: stdout is always the JSON summary, and the readable checklist goes to stderr" })
73327
+ json: Flags.boolean({ description: "Print the checks as one JSON document on stdout (ok, warnings and each check's label, status, message and hint) instead of the readable checklist" })
73068
73328
  };
73069
73329
  async run() {
73070
73330
  const { flags } = await this.parse(DoctorCommand);
@@ -73125,21 +73385,24 @@ var DoctorCommand = class DoctorCommand extends Command {
73125
73385
  }
73126
73386
  }
73127
73387
  }
73128
- for (const row of rows) {
73129
- process.stderr.write(`${renderRow(row)}\n`);
73130
- if ("hint" in row.outcome && row.outcome.hint) process.stderr.write(` hint: ${row.outcome.hint}\n`);
73388
+ if (flags.json) {
73389
+ const failed = rows.filter((row) => row.outcome.status === "fail");
73390
+ const summary = {
73391
+ ok: failed.length === 0,
73392
+ warnings: rows.filter((row) => row.outcome.status === "warn").length,
73393
+ checks: rows.map(({ label, outcome }) => ({
73394
+ label,
73395
+ status: outcome.status,
73396
+ message: outcome.message,
73397
+ ..."hint" in outcome && outcome.hint ? { hint: outcome.hint } : {}
73398
+ })),
73399
+ ...failed.length > 0 ? { error: { message: `${failed.length} ${failed.length === 1 ? "check" : "checks"} failed: ${failed.map((row) => row.label).join(", ")}.` } } : {}
73400
+ };
73401
+ this.log(JSON.stringify(summary, null, 2));
73402
+ } else for (const row of rows) {
73403
+ this.log(renderRow(row));
73404
+ if ("hint" in row.outcome && row.outcome.hint) this.log(` hint: ${row.outcome.hint}`);
73131
73405
  }
73132
- const summary = {
73133
- ok: rows.every((row) => row.outcome.status !== "fail"),
73134
- warnings: rows.filter((row) => row.outcome.status === "warn").length,
73135
- checks: rows.map(({ label, outcome }) => ({
73136
- label,
73137
- status: outcome.status,
73138
- message: outcome.message,
73139
- ..."hint" in outcome && outcome.hint ? { hint: outcome.hint } : {}
73140
- }))
73141
- };
73142
- this.log(JSON.stringify(summary, null, 2));
73143
73406
  if (rows.some((row) => row.outcome.status === "fail")) process.exitCode = 1;
73144
73407
  }
73145
73408
  };
@@ -76151,8 +76414,8 @@ const PRIMITIVE_TEAM_AUTHOR = {
76151
76414
  name: "Primitive Team",
76152
76415
  url: "https://primitive.dev"
76153
76416
  };
76154
- const SDK_VERSION_RANGE = "^3.0.0-preview.16";
76155
- const CLI_VERSION_RANGE = "^3.0.0-preview.16";
76417
+ const SDK_VERSION_RANGE = "^3.0.0-preview.17";
76418
+ const CLI_VERSION_RANGE = "^3.0.0-preview.17";
76156
76419
  const ESBUILD_VERSION_RANGE = "^0.27.0";
76157
76420
  function renderHandler() {
76158
76421
  return `// env.PRIMITIVE_API_KEY, env.PRIMITIVE_WEBHOOK_SECRET, and
@@ -79558,9 +79821,9 @@ function wholeMailboxAddresses(notes) {
79558
79821
  }
79559
79822
  /**
79560
79823
  * What a key create or update says when the key reads whole mailboxes beside
79561
- * its email rules: on stderr as a Warning line, or under --json in the
79562
- * document's whole_mailbox_warning (the JSON guard keeps stderr empty, and the
79563
- * answer's warnings are the server's objects). Null when it does not. The
79824
+ * its email rules: first, on stderr as a Warning line, or under --json as the
79825
+ * document's first field, whole_mailbox_warning, and the first entry of its
79826
+ * warnings (the JSON guard keeps stderr empty). Null when it does not. The
79564
79827
  * exit code is not changed: the key is made or changed as asked.
79565
79828
  */
79566
79829
  function wholeMailboxWarning(keyId, notes) {
@@ -79568,6 +79831,27 @@ function wholeMailboxWarning(keyId, notes) {
79568
79831
  const addresses = wholeMailboxAddresses(notes);
79569
79832
  return `This key reads ${addresses.length > 0 ? `every email at ${addresses.join(", ")}` : "every email at an address or domain it lists"}, not only the emails its rules grant. An address or domain listed beside a rule is read in full. To limit a key to the rules' emails, create one with the same permissions and only --rule for its mail (no --address or --domain), then revoke this one with \`primitive keys revoke ${keyId}\`.`;
79570
79833
  }
79834
+ /**
79835
+ * A --json document led by the whole-mailbox warning: whole_mailbox_warning
79836
+ * as its first field, and the warning first in its warnings, before the
79837
+ * server's own, as an object with a description as theirs have (reason
79838
+ * whole_mailbox, with the addresses and domains read in full). Unchanged when
79839
+ * there is no warning.
79840
+ */
79841
+ function ledByWholeMailboxWarning(document, whole, notes) {
79842
+ if (!whole) return document;
79843
+ const { whole_mailbox_warning: _shown, ...rest } = document;
79844
+ const warnings = Array.isArray(rest.warnings) ? rest.warnings : [];
79845
+ return {
79846
+ whole_mailbox_warning: whole,
79847
+ ...rest,
79848
+ warnings: [{
79849
+ reason: "whole_mailbox",
79850
+ addresses: wholeMailboxAddresses(notes),
79851
+ description: whole
79852
+ }, ...warnings]
79853
+ };
79854
+ }
79571
79855
  /** The notes other than whole_mailbox, which wholeMailboxWarning says instead. */
79572
79856
  function otherNotes(notes) {
79573
79857
  if (!Array.isArray(notes)) return [];
@@ -79639,6 +79923,10 @@ function buildCreateGrant(choice) {
79639
79923
  ...choice.domains.length > 0 ? { domains: choice.domains } : {},
79640
79924
  ...choice.rules.length > 0 ? { rules: choice.rules } : {}
79641
79925
  };
79926
+ const domainBesideRule = choice.rules.length > 0 && choice.domains.length > 0 ? {
79927
+ ok: false,
79928
+ message: `--rule cannot be combined with --domain: the key would read every email on ${choice.domains.join(", ")}, not only what the rules granted. Create a key with --rule alone, or one with --domain alone.`
79929
+ } : null;
79642
79930
  if (choice.permissions.length > 0) {
79643
79931
  if (choice.preset) return {
79644
79932
  ok: false,
@@ -79648,6 +79936,7 @@ function buildCreateGrant(choice) {
79648
79936
  ok: false,
79649
79937
  message: choice.allMailboxes ? "--all-mailboxes reaches every mailbox, so it cannot be combined with --address, --domain or --rule." : "Say which mail the key reaches: --address, --domain or --rule (each repeatable), or --all-mailboxes."
79650
79938
  };
79939
+ if (domainBesideRule) return domainBesideRule;
79651
79940
  return {
79652
79941
  ok: true,
79653
79942
  grant: {
@@ -79680,6 +79969,7 @@ function buildCreateGrant(choice) {
79680
79969
  ok: false,
79681
79970
  message: `${choice.preset} needs --address, --domain or --rule.`
79682
79971
  };
79972
+ if (domainBesideRule) return domainBesideRule;
79683
79973
  return {
79684
79974
  ok: true,
79685
79975
  grant: {
@@ -79973,7 +80263,7 @@ var KeysCreateCommand = class KeysCreateCommand extends Command {
79973
80263
 
79974
80264
  The secret is printed once, on its own line on stdout (in the JSON with --json). Store it right away: it is not shown again and the CLI does not save it.
79975
80265
 
79976
- A key limited to email rules (--rule, repeatable) reaches only the mail those rules match. Give it mail:read with --permission, or use --preset own_addresses_read_only. An --address or --domain given beside --rule is read in full, every email there and not only what the rules match: the key is still made, and the command warns on stderr, or in whole_mailbox_warning with --json.
80266
+ A key limited to email rules (--rule, repeatable) reaches only the mail those rules match. Give it mail:read with --permission, or use --preset own_addresses_read_only. A key reads every email at an address or domain it lists, not only what the rules match, so --domain cannot be given beside --rule, and the API refuses an --address beside it that is another member's mailbox, a former member's included, or a retired address. Your own address, an agent's or a shared one may be given beside --rule, for example so the key reads your own mail beside a share, or replies from an agent's address; each is read in full, and the command says so first: on stderr, or with --json in whole_mailbox_warning.
79977
80267
 
79978
80268
  ${keyPermissionsHelp()}`;
79979
80269
  static summary = "Create an API key";
@@ -80004,7 +80294,7 @@ var KeysCreateCommand = class KeysCreateCommand extends Command {
80004
80294
  multiple: true
80005
80295
  }),
80006
80296
  rule: Flags.string({
80007
- description: "An email rule id whose matching mail the key reaches (repeatable). An --address or --domain given beside it is read in full, not only the rule's mail.",
80297
+ description: "An email rule id whose matching mail the key reaches (repeatable). Not with --domain, nor with an --address that is another member's or a former member's mailbox, or a retired address; any other --address beside it (your own, an agent's, a shared one) is read in full, not only the rule's mail. A rule a colleague shares with you goes on a key by the share's id, from your own dashboard session only (the dashboard's API keys page), not through the CLI; your own webhooks receive what a share gives you without a key.",
80008
80298
  multiple: true
80009
80299
  }),
80010
80300
  "all-mailboxes": Flags.boolean({ description: "A key with --permission that reaches every mailbox." }),
@@ -80051,15 +80341,13 @@ var KeysCreateCommand = class KeysCreateCommand extends Command {
80051
80341
  return;
80052
80342
  }
80053
80343
  const key = result.data;
80344
+ const whole = wholeMailboxWarning(key.id, key.address_warnings);
80054
80345
  if (!flags.json) {
80346
+ if (whole) process.stderr.write(`Warning: ${whole}\n\n`);
80055
80347
  writeWarnings(key.warnings);
80056
80348
  writeWarnings(otherNotes(key.address_warnings));
80057
80349
  }
80058
- const whole = wholeMailboxWarning(key.id, key.address_warnings);
80059
- printSecret(this, Boolean(flags.json), whole ? {
80060
- ...key,
80061
- whole_mailbox_warning: whole
80062
- } : key, key.key, [
80350
+ printSecret(this, Boolean(flags.json), ledByWholeMailboxWarning(key, whole, key.address_warnings), key.key, [
80063
80351
  `Created API key ${key.name ?? "(unnamed)"} (${key.id}), prefix ${key.key_prefix}.`,
80064
80352
  `Permissions: ${describePermissions({
80065
80353
  template: key.grant.template,
@@ -80073,7 +80361,6 @@ var KeysCreateCommand = class KeysCreateCommand extends Command {
80073
80361
  })}`,
80074
80362
  `Expires: ${key.expires_at ?? "never"}`
80075
80363
  ].join("\n"));
80076
- if (whole && !flags.json) process.stderr.write(`Warning: ${whole}\n`);
80077
80364
  }
80078
80365
  };
80079
80366
  var KeysRotateCommand = class KeysRotateCommand extends Command {
@@ -80136,7 +80423,7 @@ var KeysRotateCommand = class KeysRotateCommand extends Command {
80136
80423
  var KeysUpdateCommand = class KeysUpdateCommand extends Command {
80137
80424
  static description = `Change an API key's permissions, email rules, name or expiry. It keeps its id and secret.
80138
80425
 
80139
- --add and --remove take permissions (repeatable, or comma-separated); \`primitive keys create --help-full\` lists the permissions a key can hold. --add-rule and --remove-rule add email rules to the key or take them off, and keep its other rules. --rule replaces every rule the key has with the ones given, so pass all the rules it should keep; it cannot be combined with --add-rule or --remove-rule. --expires-at gives it a new expiry: a later one extends it, within your organization's credential policy, and is how to keep a key working past its expiry (rotating keeps the expiry). --no-expiry removes it where the policy allows. An expired key cannot be extended. Everything else about the key stays as it is, and the output lists any rules a change took off. When the key's grant is written and it lists an address or domain beside its rules, which it reads in full, the command warns on stderr, or in whole_mailbox_warning with --json.
80426
+ --add and --remove take permissions (repeatable, or comma-separated); \`primitive keys create --help-full\` lists the permissions a key can hold. --add-rule and --remove-rule add email rules to the key or take them off, and keep its other rules. --rule replaces every rule the key has with the ones given, so pass all the rules it should keep; it cannot be combined with --add-rule or --remove-rule. A change to the permissions or rules of a key that lists a share made with you (--add, --remove, --rule, --add-rule) is refused through the CLI unless it takes the share off; make it from your own dashboard session. --name, --expires-at and --no-expiry work as usual. --expires-at gives it a new expiry: a later one extends it, within your organization's credential policy, and is how to keep a key working past its expiry (rotating keeps the expiry). --no-expiry removes it where the policy allows. An expired key cannot be extended. Everything else about the key stays as it is, and the output lists any rules a change took off. A rule cannot be added to a key that lists a domain. The API refuses a rule added beside a retired address or the mailbox of a member other than the key's holder (its creator, or whoever it was transferred to), a former member's included, and a permission added to a key that already lists rules beside such an address or a domain. It judges this by the key's holder, not by whoever makes the change. When the key's grant is written and it lists an address or domain beside its rules, which it reads in full, the command says so before the result: on stderr, or with --json in whole_mailbox_warning.
80140
80427
 
80141
80428
  The change runs directly; if your organization requires approval, the command prints the approval link and takes --step-up-token, as for a new key. A key never holds more than you do.
80142
80429
 
@@ -80171,7 +80458,7 @@ var KeysUpdateCommand = class KeysUpdateCommand extends Command {
80171
80458
  exclusive: ["add-rule", "remove-rule"]
80172
80459
  }),
80173
80460
  "add-rule": Flags.string({
80174
- description: "An email rule id to add to the key (repeatable, or comma-separated). Its other rules stay.",
80461
+ description: "An email rule id to add to the key (repeatable, or comma-separated). Its other rules stay. A rule shared with you is added by its share's id from your own dashboard session only, not through the CLI.",
80175
80462
  multiple: true
80176
80463
  }),
80177
80464
  "remove-rule": Flags.string({
@@ -80235,6 +80522,8 @@ var KeysUpdateCommand = class KeysUpdateCommand extends Command {
80235
80522
  ...ruleChange
80236
80523
  });
80237
80524
  if (!next.ok) this.error(next.message.replace("<key-id>", args.id), { exit: 2 });
80525
+ const listedDomains = stringList(next.grant.domains ?? []) ?? [];
80526
+ if ((stringList(next.grant.rules ?? []) ?? []).filter((r) => !rulesBefore.some((k) => k.toLowerCase() === r.toLowerCase())).length > 0 && listedDomains.length > 0) this.error(`Key ${args.id} lists ${listedDomains.join(", ")}, so a rule cannot be added to it: the key would read every email on that domain, not only what the rule granted. Create a key with --rule alone for the rule's mail.`, { exit: 2 });
80238
80527
  rulesNotOnKey = removeRules.filter((r) => !rulesBefore.some((k) => k.toLowerCase() === r.toLowerCase()));
80239
80528
  if (rulesNotOnKey.length > 0 && !flags.json) process.stderr.write(`Not on this key, so nothing to take off: ${rulesNotOnKey.join(", ")}.\n`);
80240
80529
  const sentRules = stringList(next.grant.rules ?? []) ?? [];
@@ -80276,18 +80565,18 @@ var KeysUpdateCommand = class KeysUpdateCommand extends Command {
80276
80565
  const standingNotes = after?.ok ? after.data.address_warnings : void 0;
80277
80566
  const whole = grantChanged ? wholeMailboxWarning(args.id, result.data.address_warnings) : null;
80278
80567
  if (flags.json) {
80279
- this.log(JSON.stringify({
80568
+ this.log(JSON.stringify(ledByWholeMailboxWarning({
80280
80569
  ...after?.ok ? after.data : {},
80281
80570
  ...result.data,
80282
80571
  ...!grantChanged && Array.isArray(standingNotes) ? { address_warnings: standingNotes } : {},
80283
80572
  ...grantChanged ? { notice: HELD_REQUEST_NOTICE } : {},
80284
80573
  ...grantChanged && rulesRemoved.length > 0 ? { rules_removed: rulesRemoved } : {},
80285
80574
  ...rulesNotOnKey.length > 0 ? { rules_not_on_key: rulesNotOnKey } : {},
80286
- ...after && !after.ok ? { key_error: after.payload } : {},
80287
- ...whole ? { whole_mailbox_warning: whole } : {}
80288
- }, null, 2));
80575
+ ...after && !after.ok ? { key_error: after.payload } : {}
80576
+ }, whole, result.data.address_warnings), null, 2));
80289
80577
  return;
80290
80578
  }
80579
+ if (whole) process.stderr.write(`Warning: ${whole}\n\n`);
80291
80580
  writeWarnings(result.data.warnings);
80292
80581
  writeWarnings(whole ? otherNotes(result.data.address_warnings) : result.data.address_warnings);
80293
80582
  const changed = result.data.changed;
@@ -80299,7 +80588,6 @@ var KeysUpdateCommand = class KeysUpdateCommand extends Command {
80299
80588
  if (grantChanged && rulesRemoved.length > 0) this.log(`Rules taken off: ${rulesRemoved.join(", ")}`);
80300
80589
  if (changed.includes("expires_at")) this.log(`Expires: ${expiry.expiresAt ?? "never"}`);
80301
80590
  if (grantChanged) process.stderr.write(`${HELD_REQUEST_NOTICE}\n`);
80302
- if (whole) process.stderr.write(`Warning: ${whole}\n`);
80303
80591
  }
80304
80592
  };
80305
80593
  /**
@@ -81509,7 +81797,7 @@ var RequestFailure = class extends ListenError {
81509
81797
  code;
81510
81798
  retryAfter;
81511
81799
  constructor(status, code, retryAfter) {
81512
- super(code === "pull_subscription_requires_agent_connection" ? AGENT_CONNECTION_REQUIRED_MESSAGE : code === "agent_connection_scope_forbidden" ? "This operation is outside the connected address grant. Use inbound email events and this credential’s own subscription." : status === 401 || status === 403 ? "Listener authorization failed. Run primitive signin or check your API key and account permissions." : status === 409 && code === "subscription_conflict" ? "This subscription has different event filters. Omit --events to resume it, or use primitive listen --subscription new-subscription (add your --events selection)." : `Listener API request failed (HTTP ${status || "transport"}, ${code}).`);
81800
+ super(code === "pull_subscription_requires_agent_connection" ? AGENT_CONNECTION_REQUIRED_MESSAGE : code === "agent_connection_scope_forbidden" ? "This operation is outside the connected address grant. Use inbound email events and this credential’s own subscription." : code === "key_revoked" ? KEY_REVOKED_MESSAGE : status === 401 || status === 403 ? "Listener authorization failed. Run primitive signin or check your API key and account permissions." : status === 409 && code === "subscription_conflict" ? "This subscription has different event filters. Omit --events to resume it, or use primitive listen --subscription new-subscription (add your --events selection)." : `Listener API request failed (HTTP ${status || "transport"}, ${code}).`);
81513
81801
  this.status = status;
81514
81802
  this.code = code;
81515
81803
  this.retryAfter = retryAfter;
@@ -82732,7 +83020,7 @@ var ListenCommand = class ListenCommand extends Command {
82732
83020
  process.exitCode = 1;
82733
83021
  return;
82734
83022
  }
82735
- throw new Errors.CLIError(error instanceof ListenError || error instanceof ListenStateError ? error.message : error?.code === "pull_subscription_requires_agent_connection" ? AGENT_CONNECTION_REQUIRED_MESSAGE : "The listener stopped because of a local state or connection error.");
83023
+ throw new Errors.CLIError(error instanceof ListenError || error instanceof ListenStateError ? error.message : error?.code === "pull_subscription_requires_agent_connection" ? AGENT_CONNECTION_REQUIRED_MESSAGE : error?.code === "key_revoked" ? KEY_REVOKED_MESSAGE : "The listener stopped because of a local state or connection error.");
82736
83024
  } finally {
82737
83025
  await wake?.close();
82738
83026
  clearTimeout(timer);