primcli 1.64.0 → 1.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/{api-command-C3XihKH7.js → api-command-0u5Qd_a-.js} +84 -10
- package/dist/{machine-session-B3JznlvO.js → machine-session-Bmv7ZOQh.js} +2 -2
- package/dist/{notify-session-Bzcs3VBe.js → notify-session-BaS84f3y.js} +1 -1
- package/dist/oclif/auto-signal-worker.js +2 -2
- package/dist/oclif/index.js +172 -14
- package/dist/oclif/receiver-heal.js +1 -1
- package/dist/{signal-command-CgNIftzG.js → signal-command-CwIFkT9e.js} +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -324,6 +324,23 @@ still goes out, and different replies to the same email are separate sends. To
|
|
|
324
324
|
retry an uncertain send after the window, pass the key it reported with
|
|
325
325
|
`--idempotency-key`.
|
|
326
326
|
|
|
327
|
+
When a send is answered with an earlier one, nothing goes out and the stderr
|
|
328
|
+
notice says which send answered it and why:
|
|
329
|
+
|
|
330
|
+
| Why | Notice |
|
|
331
|
+
|---|---|
|
|
332
|
+
| The same content inside the five-minute window, with no key of your own | `Not sent: identical to <id> sent 42s ago (status delivered). Pass --idempotency-key with a new key to send again.` |
|
|
333
|
+
| A key you passed that was already used | `Not sent: idempotency key <key> was already used for <id> sent 3h ago (status delivered). A key you pass never expires. Use a different key only for a different message.` |
|
|
334
|
+
| A Function sending again for the email or event that invoked it | `Not sent: this Function already sent this message as <id> sent 2m ago (status delivered), for the same email or event that invoked it. A Function that runs again for one trigger sends once.` |
|
|
335
|
+
| A reply with no key to an email that already has a reply | `Not sent: the email already has a reply, <id> sent 5m ago (status delivered). Pass an idempotency key to send another reply.` |
|
|
336
|
+
|
|
337
|
+
The notice goes to stderr only, so stdout stays parseable. With `--json` it is
|
|
338
|
+
the envelope's `outcome_message`, and `sent.idempotency` carries the same facts
|
|
339
|
+
as fields (`key_source`, `original_sent_email_id`, `original_created_at`,
|
|
340
|
+
`window_seconds`). The outcome is `already_sent` and the exit code is 0 in every
|
|
341
|
+
case. An API response without the `idempotency` object gets the general notice,
|
|
342
|
+
`Already sent: this exact message went out earlier (...). Nothing new was sent.`
|
|
343
|
+
|
|
327
344
|
Without `--json`, `send` and `reply` keep printing the send record on stdout exactly
|
|
328
345
|
as before and add a one-line stderr summary such as `Reply sent (queued for
|
|
329
346
|
delivery, id X). Do not resend.` Before sending, `primitive reply` (and
|
|
@@ -3894,22 +3894,93 @@ function withFlagSuggestion(error, valid) {
|
|
|
3894
3894
|
//#region src/oclif/idempotent-replay-banner.ts
|
|
3895
3895
|
/**
|
|
3896
3896
|
* If `data` carries `idempotent_replay: true`, write a stderr notice
|
|
3897
|
-
* that
|
|
3898
|
-
* Otherwise no-op.
|
|
3899
|
-
*
|
|
3900
|
-
* The notice deliberately gives no advice on how to force a fresh
|
|
3901
|
-
* copy. Whoever sees a replay has already sent this message; telling
|
|
3902
|
-
* them to vary the content is an instruction to double-send.
|
|
3897
|
+
* that nothing new was sent and why. Otherwise no-op.
|
|
3903
3898
|
*/
|
|
3904
3899
|
function writeIdempotentReplayBannerIfReplay(data, options) {
|
|
3905
3900
|
if (!isReplay(data)) return;
|
|
3906
|
-
|
|
3901
|
+
const { write, ...notice } = options;
|
|
3902
|
+
write(`${formatAlreadySentNotice(data, notice)}\n`);
|
|
3907
3903
|
}
|
|
3908
3904
|
function isReplay(data) {
|
|
3909
3905
|
if (data === null || typeof data !== "object") return false;
|
|
3910
3906
|
return data.idempotent_replay === true;
|
|
3911
3907
|
}
|
|
3912
|
-
function
|
|
3908
|
+
function nonEmptyString(value) {
|
|
3909
|
+
return typeof value === "string" && value ? value : null;
|
|
3910
|
+
}
|
|
3911
|
+
/**
|
|
3912
|
+
* Read the API's `idempotency` object. Null when it is absent or names
|
|
3913
|
+
* a key source this CLI does not know, so the general notice is used
|
|
3914
|
+
* and nothing is claimed about a case it cannot describe.
|
|
3915
|
+
*/
|
|
3916
|
+
function readReplayDetail(sent, keyOrigin) {
|
|
3917
|
+
const raw = sent.idempotency;
|
|
3918
|
+
if (raw === null || typeof raw !== "object") return null;
|
|
3919
|
+
const object = raw;
|
|
3920
|
+
const source = object.key_source;
|
|
3921
|
+
let kind;
|
|
3922
|
+
if (sent.dedup_reason === "parent_already_replied") kind = "parent_already_replied";
|
|
3923
|
+
else if (source === "auto_content" || source === "function_trigger") kind = source;
|
|
3924
|
+
else if (source === "explicit") kind = keyOrigin === "cli_derived" ? "auto_content" : "explicit";
|
|
3925
|
+
else return null;
|
|
3926
|
+
return {
|
|
3927
|
+
kind,
|
|
3928
|
+
originalId: nonEmptyString(object.original_sent_email_id) ?? nonEmptyString(sent.id),
|
|
3929
|
+
originalCreatedAt: nonEmptyString(object.original_created_at)
|
|
3930
|
+
};
|
|
3931
|
+
}
|
|
3932
|
+
/** "12s ago", "4m ago", "3h ago", "9d ago"; null when the time is unusable. */
|
|
3933
|
+
function formatReplayAge(createdAt, now) {
|
|
3934
|
+
if (createdAt === null) return null;
|
|
3935
|
+
const created = Date.parse(createdAt);
|
|
3936
|
+
if (Number.isNaN(created)) return null;
|
|
3937
|
+
const seconds = Math.max(0, Math.round((now - created) / 1e3));
|
|
3938
|
+
if (seconds < 120) return `${seconds}s ago`;
|
|
3939
|
+
const minutes = Math.round(seconds / 60);
|
|
3940
|
+
if (minutes < 120) return `${minutes}m ago`;
|
|
3941
|
+
const hours = Math.round(minutes / 60);
|
|
3942
|
+
if (hours < 48) return `${hours}h ago`;
|
|
3943
|
+
return `${Math.round(hours / 24)}d ago`;
|
|
3944
|
+
}
|
|
3945
|
+
function statusSuffix(sent) {
|
|
3946
|
+
const status = nonEmptyString(sent.status);
|
|
3947
|
+
const deliveryStatus = nonEmptyString(sent.delivery_status);
|
|
3948
|
+
const details = [];
|
|
3949
|
+
if (status) details.push(`status ${status}`);
|
|
3950
|
+
if (deliveryStatus && deliveryStatus !== status) details.push(`delivery status ${deliveryStatus}`);
|
|
3951
|
+
return details.length > 0 ? ` (${details.join(", ")})` : "";
|
|
3952
|
+
}
|
|
3953
|
+
function formatSpecificNotice(sent, detail, options) {
|
|
3954
|
+
const age = formatReplayAge(detail.originalCreatedAt, options.now ?? Date.now());
|
|
3955
|
+
const when = age ? ` sent ${age}` : "";
|
|
3956
|
+
const id = detail.originalId ?? "an earlier send";
|
|
3957
|
+
const state = statusSuffix(sent);
|
|
3958
|
+
const advise = options.advise !== false;
|
|
3959
|
+
const keyHint = options.keyHint ?? "an idempotency key";
|
|
3960
|
+
switch (detail.kind) {
|
|
3961
|
+
case "auto_content": return `Not sent: identical to ${id}${when}${state}.${advise ? ` Pass ${keyHint} to send again.` : ""}`;
|
|
3962
|
+
case "explicit": {
|
|
3963
|
+
const key = nonEmptyString(sent.client_idempotency_key);
|
|
3964
|
+
return `Not sent: ${key ? `idempotency key ${key}` : "this idempotency key"} was already used for ${id}${when}${state}. A key you pass never expires.${advise ? " Use a different key only for a different message." : ""}`;
|
|
3965
|
+
}
|
|
3966
|
+
case "function_trigger": return `Not sent: this Function already sent this message as ${id}${when}${state}, for the same email or event that invoked it. A Function that runs again for one trigger sends once.`;
|
|
3967
|
+
case "parent_already_replied": return `Not sent: the email already has a reply, ${id}${when}${state}.${advise ? ` Pass ${keyHint} to send another reply.` : ""}`;
|
|
3968
|
+
}
|
|
3969
|
+
}
|
|
3970
|
+
/**
|
|
3971
|
+
* The notice for a send that was answered with an existing send. Worded
|
|
3972
|
+
* from the API's `idempotency` object when the response carries one;
|
|
3973
|
+
* the general "already sent" notice otherwise.
|
|
3974
|
+
*
|
|
3975
|
+
* The advice never says to change the message. Whoever sees this has a
|
|
3976
|
+
* send on record already, and varying the content to get past it is how
|
|
3977
|
+
* a retry becomes a double send. Sending the same thing again on
|
|
3978
|
+
* purpose is a different request, and an idempotency key is how the API
|
|
3979
|
+
* is told so.
|
|
3980
|
+
*/
|
|
3981
|
+
function formatAlreadySentNotice(sent, options = {}) {
|
|
3982
|
+
const detail = readReplayDetail(sent, options.keyOrigin ?? "caller");
|
|
3983
|
+
if (detail) return formatSpecificNotice(sent, detail, options);
|
|
3913
3984
|
const details = [];
|
|
3914
3985
|
if (typeof sent.id === "string" && sent.id) details.push(`sent id ${sent.id}`);
|
|
3915
3986
|
const status = typeof sent.status === "string" && sent.status ? sent.status : null;
|
|
@@ -4378,7 +4449,10 @@ function reportSendCommandResult(params) {
|
|
|
4378
4449
|
errorPayload = { message: "The API returned no send record." };
|
|
4379
4450
|
} else {
|
|
4380
4451
|
outcome = successfulSendOutcome(sent);
|
|
4381
|
-
outcomeMessage = outcome === "not_sent" || outcome === "uncertain" ? formatSendRecordFailureSummary(params.noun, outcome, sent) : outcome === "already_sent" ? formatAlreadySentNotice(sent
|
|
4452
|
+
outcomeMessage = outcome === "not_sent" || outcome === "uncertain" ? formatSendRecordFailureSummary(params.noun, outcome, sent) : outcome === "already_sent" ? formatAlreadySentNotice(sent, {
|
|
4453
|
+
keyOrigin: params.idempotencyKeyOrigin ?? "caller",
|
|
4454
|
+
keyHint: "--idempotency-key with a new key"
|
|
4455
|
+
}) : formatSentSummary(params.noun, sent);
|
|
4382
4456
|
}
|
|
4383
4457
|
if (!params.json) params.writeStderr(`${outcomeMessage}\n`);
|
|
4384
4458
|
}
|
|
@@ -5225,7 +5299,7 @@ function savedConnectedProfiles(configDir, exclude) {
|
|
|
5225
5299
|
*/
|
|
5226
5300
|
async function otherProfiles(configDir, session, current) {
|
|
5227
5301
|
if (session) try {
|
|
5228
|
-
const { connectedProfilesForSession } = await import("./machine-session-
|
|
5302
|
+
const { connectedProfilesForSession } = await import("./machine-session-Bmv7ZOQh.js").then((n) => n.s);
|
|
5229
5303
|
return {
|
|
5230
5304
|
inSession: true,
|
|
5231
5305
|
profiles: connectedProfilesForSession(configDir, session, current)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { S as __exportAll } from "./repeats-BL7ZC-_6-Dzangtkf.js";
|
|
2
2
|
import { B as parseOwnerMemberAddress, F as agentProfilesDirectory, I as connectedAgentIdentity, L as connectedApiBaseUrl, M as AgentConnectionSetupError, N as agentProfileDirectory, P as agentProfileName, R as loadConnectedAgentProfile, U as saveConnectedAgentProfile, V as profileAlreadyConnectedMessage, W as PrimitiveApiClient, j as AGENT_PROFILE_ENV, x as loadCliCredentials, z as parseConnectedAgentProfile } from "./cli-config-DMszFbGn.js";
|
|
3
|
-
import { Ct as cliInvocation, Jn as putAgentContactPolicy, Jt as refreshStoredCliCredentials, Pn as listDomains, Tt as defaultConnectionName, Vn as listSentEmails, Yn as putContact, an as deleteAgentContact, ar as sendEmail, jn as listContacts, kn as listAgentContacts, mn as getContact, nr as searchEmails, on as deleteContact, pn as getAgentContactPolicy, qn as putAgentContact, vn as getEmail } from "./api-command-
|
|
3
|
+
import { Ct as cliInvocation, Jn as putAgentContactPolicy, Jt as refreshStoredCliCredentials, Pn as listDomains, Tt as defaultConnectionName, Vn as listSentEmails, Yn as putContact, an as deleteAgentContact, ar as sendEmail, jn as listContacts, kn as listAgentContacts, mn as getContact, nr as searchEmails, on as deleteContact, pn as getAgentContactPolicy, qn as putAgentContact, vn as getEmail } from "./api-command-0u5Qd_a-.js";
|
|
4
4
|
import { _ as acquireListenLock, c as mailTime, d as readMailJson, f as removeMailFile, g as ListenStateError, h as writeMailJson, i as mailId, l as privateMailDirectory, o as mailObject, r as mailAddress, s as mailString } from "./shared-mail-files-MwlVE90c.js";
|
|
5
|
-
import { _ as detectAgentRuntime, a as NotificationRetryError, d as defaultSessionSocket, f as NativeSessionDisconnectedError, l as SESSION_UUID, t as notificationScope, u as connectNativeSession, v as installConnectSkill, x as readBundledConnectSkill } from "./notify-session-
|
|
5
|
+
import { _ as detectAgentRuntime, a as NotificationRetryError, d as defaultSessionSocket, f as NativeSessionDisconnectedError, l as SESSION_UUID, t as notificationScope, u as connectNativeSession, v as installConnectSkill, x as readBundledConnectSkill } from "./notify-session-BaS84f3y.js";
|
|
6
6
|
import { a as scopedChatSenderTrust } from "./scoped-chat-BW041zEY.js";
|
|
7
7
|
import { l as stopBackgroundListen, r as backgroundListenStatus } from "./listen-background--0peztKE.js";
|
|
8
8
|
import { t as readSharedMailOwner } from "./shared-mail-watch-DtKpsgg8.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as parseWebhookEvent, c as classifySignalContent, v as isEmailReceivedEvent, y as isTrustedSender } from "./repeats-BL7ZC-_6-Dzangtkf.js";
|
|
2
|
-
import { F as wakeReadCommand, P as skillFirstLine, Y as wakeInteractionSentence, dn as downloadEmailAttachmentPart } from "./api-command-
|
|
2
|
+
import { F as wakeReadCommand, P as skillFirstLine, Y as wakeInteractionSentence, dn as downloadEmailAttachmentPart } from "./api-command-0u5Qd_a-.js";
|
|
3
3
|
import { _ as acquireListenLock, g as ListenStateError, y as listenIdentity } from "./shared-mail-files-MwlVE90c.js";
|
|
4
4
|
import { closeSync, copyFileSync, existsSync, fsyncSync, lstatSync, mkdirSync, openSync, opendirSync, readFileSync, readdirSync, readlinkSync, renameSync, rmSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { createHash, randomUUID, scryptSync } from "node:crypto";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as readThreadContext, En as getSentEmail, Kt as createAuthenticatedCliApiClient } from "../api-command-
|
|
1
|
+
import { A as readThreadContext, En as getSentEmail, Kt as createAuthenticatedCliApiClient } from "../api-command-0u5Qd_a-.js";
|
|
2
2
|
import { _ as acquireListenLock } from "../shared-mail-files-MwlVE90c.js";
|
|
3
|
-
import { t as sendSignal } from "../signal-command-
|
|
3
|
+
import { t as sendSignal } from "../signal-command-CwIFkT9e.js";
|
|
4
4
|
import { AUTO_SIGNAL_KIND_ENV, AUTO_WORKING_RENEW_MS, autoSignalsDisabled, clearWorkingSending, markWorkingSending, readAutoClaim, readWorkingLease, recordRenewer, stopWorkingLease, writeWorkingLease } from "./auto-signals.js";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { homedir } from "node:os";
|
package/dist/oclif/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { a as REPEAT_IDLE_MAX_MINUTES, b as parseWebhookEvent, d as parseRepeatTick, f as preparePresenceAliveEmail, i as REPEAT_EVERY_MAX_MINUTES, l as parseInteractionEnvelope$1, m as repeatStopCommand, o as REPEAT_MAX_SENDS_MAX, p as prepareSignalEmail, s as buildRepeatStopBody, u as parsePresenceEnvelope, v as isEmailReceivedEvent, x as parseFromHeader } from "../repeats-BL7ZC-_6-Dzangtkf.js";
|
|
2
2
|
import { A as saveActiveChatState, C as resolveCliAuth, D as deleteChatState, E as chatStatePath, F as agentProfilesDirectory, H as requireDefaultLoginProfile, M as AgentConnectionSetupError, N as agentProfileDirectory, O as loadActiveChatState, P as agentProfileName, R as loadConnectedAgentProfile, T as saveSignupCredentials, W as PrimitiveApiClient, _ as deleteCliCredentials, a as normalizeCliEnvironmentName, b as hasStoredCliLogin, c as resolveConfigEnvironment, g as credentialsPath, h as credentialsLockPath, i as loadCliConfig, j as AGENT_PROFILE_ENV, k as loadChatConversationByLocalId, 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 saveCliCredentials, x as loadCliCredentials, y as detectPrimitiveKeyEnvMisname } from "../cli-config-DMszFbGn.js";
|
|
3
|
-
import { $ as apiResultHttpStatus, $n as replyToEmail, $t as completeWebhookEvent, A as readThreadContext, An as listAgentNetworks, At as formatAlreadySentNotice, B as pendingMailPath, Bn as listRoutes, Bt as expectedAutomatedVerdicts, C as queryUsesAwaiting, Cn as getMemory, Cr as verifyAgentSignup, Ct as cliInvocation, D as displayAddress, Dn as getThread, Dt as identitySuggestions, E as describeWake, En as getSentEmail, Et as generatedAgentName, F as wakeReadCommand, Fn as listEmails, Ft as AUTOMATED_VALUES, G as interactionNextActions, Gn as pollCliLogin, H as recordPendingMail, Hn as listWakeAuthorizations, Ht as isAutomatedRejectedError, I as wakeRecipientField, In as listEndpoints, It as AutomatedFilterUnsupportedError, J as replyInteractionWarning, Jt as refreshStoredCliCredentials, K as readEmailInteraction, Kn as pullWebhookEvent, Kt as createAuthenticatedCliApiClient, L as wakeRelationship, Ln as listFunctionLogs, Lt as assertAutomatedVerdict, M as serverMuted, Mn as listDefaultNetworkAgents, Mt as withFlagSuggestion, N as serverRelationship, Nn as listDefaultNetworkMembers, Nt as AUTOMATED_FILTER_UNSUPPORTED_CODE, O as formatMailWakeLine, On as getWakeSchedule, Ot as loadSkillLine, Pn as listDomains, Pt as AUTOMATED_FLAG_DESCRIPTION, Q as SEND_OUTCOME_HELP, Qn as reorderRoutes, Qt as cliLogout, R as clearConsumedPendingMail, Rn as listFunctions, Rt as automatedRejectedError, S as isAwaitingRejectedError, Sn as getInboxStatus, Sr as verifyAgentClaim, T as bareAddress, Tn as getRepeatingSend, U as removePendingMail, Un as listWakeDispatches, Ut as queryUsesAutomated, V as readPendingMail, Vn as listSentEmails, Vt as hasAutomatedVerdict, W as interactionHumanLine, Wn as listWakeSchedules, Wt as ConnectedAgentKeyRequiredError, X as IDEMPOTENCY_KEY_FLAG_DESCRIPTION, Xn as redeemCreditCode, Xt as addDefaultNetworkMember, Yt as resolveCliApiRequestConfig, Z as MAX_SEND_WAIT_TIMEOUT_MS, Zn as removeDefaultNetworkMember, Zt as checkDefaultNetworkContactAdmission, _ as awaitingRejectedError, _n as getDefaultNetworkAgent, _r as updateFunction, _t as sendWaitClampNotice, a as extractErrorCode, ar as sendEmail, at as deriveSendIdempotencyKey, b as formatRepliesCell, bn as getFunctionRouting, br as updateWakeAuthorization, bt as successfulSendOutcome, c as readTextFileFlag, cn as deleteRoute, cr as setMemory, ct as formatDeletedEarlierSendNotice, d as writeErrorWithHints, dr as startAgentSignup, dt as formatSendFailureSummary, en as createEndpoint, er as resendAgentSignupVerification, et as assertValidIdempotencyKey, f as AWAITING_FLAG_DESCRIPTION, fn as getAccount, fr as startCliLogin, ft as formatSendRecordFailureSummary, g as assertAwaitingFilterRows, gn as getCreditBalance, gr as updateDefaultNetworkMember, gt as sendOutcomeExitCode, h as ReplyStateUnsupportedError, hn as getConversation, hr as unsetFunctionRoute, ht as sendIdentityFields, i as createOperationCommand, in as createWakeSchedule, ir as semanticSearch, it as classifySendError, j as sentInThread, jt as writeIdempotentReplayBannerIfReplay, k as latestOwnOutbound, kn as listAgentContacts, kt as currentMailSessionKey, l as runWithTiming, ln as deleteWakeAuthorization, lr as simulateRoute, lt as formatPriorRepliesCheckSkipped, m as REPLY_STATE_UNSUPPORTED_CODE, mr as testFunction, mt as reportSendCommandResult, n as API_ERROR_CODES, nn as createRoute, nr as searchEmails, nt as buildThrownSendFailureEnvelope, o as extractErrorPayload, or as setFunctionRoute, ot as excludeSignalReplies, p as AWAITING_VALUES, pn as getAgentContactPolicy, pr as stopRepeatFromEmail, pt as priorRepliesThatWentOut, q as replyExpectation, qt as createCliApiClient, r as TIME_FLAG_DESCRIPTION, rn as createWakeAuthorization, rr as searchMemories, rt as checkPriorReplies, s as formatErrorPayload, sn as deleteMemory, sr as setFunctionSecret, st as followUpCommandPrefix, t as API_BASE_URL_FLAG_DESCRIPTION, tn as createFunction, tr as runWakeSchedule, tt as buildFollowUpCommand, u as surfaceUnauthorizedHint, un as deleteWakeSchedule, ur as startAgentClaim, ut as formatPriorRepliesWarning, v as ensureSearchReportsReplyState, vn as getEmail, vr as updateRepeatingSend, vt as sentHistoryWindowStart, w as explainPendingMailNotFound, wn as getOrgRoutingTopology, wt as connectNextSteps, x as hasReplyState, xn as getFunctionTestRunTrace, xr as updateWakeSchedule, xt as thrownErrorExitCode, y as formatAwaitingCell, yn as getFunction, yr as updateRoute, yt as serializeErrorPayload, z as clearReadPendingMail, zn as listRepeatingSends, zt as ensureSearchReportsAutomated } from "../api-command-
|
|
3
|
+
import { $ as apiResultHttpStatus, $n as replyToEmail, $t as completeWebhookEvent, A as readThreadContext, An as listAgentNetworks, At as formatAlreadySentNotice, B as pendingMailPath, Bn as listRoutes, Bt as expectedAutomatedVerdicts, C as queryUsesAwaiting, Cn as getMemory, Cr as verifyAgentSignup, Ct as cliInvocation, D as displayAddress, Dn as getThread, Dt as identitySuggestions, E as describeWake, En as getSentEmail, Et as generatedAgentName, F as wakeReadCommand, Fn as listEmails, Ft as AUTOMATED_VALUES, G as interactionNextActions, Gn as pollCliLogin, H as recordPendingMail, Hn as listWakeAuthorizations, Ht as isAutomatedRejectedError, I as wakeRecipientField, In as listEndpoints, It as AutomatedFilterUnsupportedError, J as replyInteractionWarning, Jt as refreshStoredCliCredentials, K as readEmailInteraction, Kn as pullWebhookEvent, Kt as createAuthenticatedCliApiClient, L as wakeRelationship, Ln as listFunctionLogs, Lt as assertAutomatedVerdict, M as serverMuted, Mn as listDefaultNetworkAgents, Mt as withFlagSuggestion, N as serverRelationship, Nn as listDefaultNetworkMembers, Nt as AUTOMATED_FILTER_UNSUPPORTED_CODE, O as formatMailWakeLine, On as getWakeSchedule, Ot as loadSkillLine, Pn as listDomains, Pt as AUTOMATED_FLAG_DESCRIPTION, Q as SEND_OUTCOME_HELP, Qn as reorderRoutes, Qt as cliLogout, R as clearConsumedPendingMail, Rn as listFunctions, Rt as automatedRejectedError, S as isAwaitingRejectedError, Sn as getInboxStatus, Sr as verifyAgentClaim, T as bareAddress, Tn as getRepeatingSend, U as removePendingMail, Un as listWakeDispatches, Ut as queryUsesAutomated, V as readPendingMail, Vn as listSentEmails, Vt as hasAutomatedVerdict, W as interactionHumanLine, Wn as listWakeSchedules, Wt as ConnectedAgentKeyRequiredError, X as IDEMPOTENCY_KEY_FLAG_DESCRIPTION, Xn as redeemCreditCode, Xt as addDefaultNetworkMember, Yt as resolveCliApiRequestConfig, Z as MAX_SEND_WAIT_TIMEOUT_MS, Zn as removeDefaultNetworkMember, Zt as checkDefaultNetworkContactAdmission, _ as awaitingRejectedError, _n as getDefaultNetworkAgent, _r as updateFunction, _t as sendWaitClampNotice, a as extractErrorCode, ar as sendEmail, at as deriveSendIdempotencyKey, b as formatRepliesCell, bn as getFunctionRouting, br as updateWakeAuthorization, bt as successfulSendOutcome, c as readTextFileFlag, cn as deleteRoute, cr as setMemory, ct as formatDeletedEarlierSendNotice, d as writeErrorWithHints, dr as startAgentSignup, dt as formatSendFailureSummary, en as createEndpoint, er as resendAgentSignupVerification, et as assertValidIdempotencyKey, f as AWAITING_FLAG_DESCRIPTION, fn as getAccount, fr as startCliLogin, ft as formatSendRecordFailureSummary, g as assertAwaitingFilterRows, gn as getCreditBalance, gr as updateDefaultNetworkMember, gt as sendOutcomeExitCode, h as ReplyStateUnsupportedError, hn as getConversation, hr as unsetFunctionRoute, ht as sendIdentityFields, i as createOperationCommand, in as createWakeSchedule, ir as semanticSearch, it as classifySendError, j as sentInThread, jt as writeIdempotentReplayBannerIfReplay, k as latestOwnOutbound, kn as listAgentContacts, kt as currentMailSessionKey, l as runWithTiming, ln as deleteWakeAuthorization, lr as simulateRoute, lt as formatPriorRepliesCheckSkipped, m as REPLY_STATE_UNSUPPORTED_CODE, mr as testFunction, mt as reportSendCommandResult, n as API_ERROR_CODES, nn as createRoute, nr as searchEmails, nt as buildThrownSendFailureEnvelope, o as extractErrorPayload, or as setFunctionRoute, ot as excludeSignalReplies, p as AWAITING_VALUES, pn as getAgentContactPolicy, pr as stopRepeatFromEmail, pt as priorRepliesThatWentOut, q as replyExpectation, qt as createCliApiClient, r as TIME_FLAG_DESCRIPTION, rn as createWakeAuthorization, rr as searchMemories, rt as checkPriorReplies, s as formatErrorPayload, sn as deleteMemory, sr as setFunctionSecret, st as followUpCommandPrefix, t as API_BASE_URL_FLAG_DESCRIPTION, tn as createFunction, tr as runWakeSchedule, tt as buildFollowUpCommand, u as surfaceUnauthorizedHint, un as deleteWakeSchedule, ur as startAgentClaim, ut as formatPriorRepliesWarning, v as ensureSearchReportsReplyState, vn as getEmail, vr as updateRepeatingSend, vt as sentHistoryWindowStart, w as explainPendingMailNotFound, wn as getOrgRoutingTopology, wt as connectNextSteps, x as hasReplyState, xn as getFunctionTestRunTrace, xr as updateWakeSchedule, xt as thrownErrorExitCode, y as formatAwaitingCell, yn as getFunction, yr as updateRoute, yt as serializeErrorPayload, z as clearReadPendingMail, zn as listRepeatingSends, zt as ensureSearchReportsAutomated } from "../api-command-0u5Qd_a-.js";
|
|
4
4
|
import { S as resolveListenSubscription, _ 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, x as normalizeListenOrigin, y as listenIdentity } from "../shared-mail-files-MwlVE90c.js";
|
|
5
|
-
import { _ as detectAgentRuntime, a as NotificationRetryError, b as installedVersion, c as readConversationStatusContent, d as defaultSessionSocket, f as NativeSessionDisconnectedError, g as connectSkillTarget, h as NotificationOutcomeUnknownError, i as notificationReceiptPage, l as SESSION_UUID$1, m as NativeSessionNotLoadedError, n as notificationSenders, o as isRoutineNotificationContent, p as NativeSessionError, r as openSessionNotifications, s as notificationPartReader, t as notificationScope, v as installConnectSkill, x as readBundledConnectSkill, y as installedConnectSkillFile } from "../notify-session-
|
|
6
|
-
import { $ as boundSessionProfiles, A as AgentDisconnectError, B as runContactRequest, C as verificationReplySubmitted, D as createNotificationContactPolicy, E as NetworkAdmissionPendingError, F as addressNoteTarget, G as receiverStatusCommand, H as agentInvitationHash, I as runAddressNotesRequest, J as savedReceiver, K as refusalAfterReplacement, L as ContactsApiError, M as clearRevokedAddresses, N as disconnectAgent, O as evaluateContactPolicy, P as AddressNotesApiError, Q as recordHookMailCheck, R as contactAddress, S as externalReceivingState, T as NETWORK_ADMISSION_PENDING_RETRY_MS, U as connectAgent, V as agentConnectionStatus, W as readAgentInvitation, X as releaseRegistrationsForProfile, Y as MACHINE_RUNTIMES, Z as installClaudeWakeHook, _ as defaultAgentProfileName, _t as upsertManagedBlock, a as endSession, at as ephemeralCliReason, b as runAgentConnect, bt as refreshOwnerMemberAddressPeriodically, c as pendingSessionDisconnects, ct as inspectClaudeHooks, d as registerSession, dt as samePath, et as claudeConfigDir, f as retryPendingDisconnects, ft as writeClaudeSettings, g as connectWarnings, gt as readManagedFile, h as enrollmentResumes, ht as jsonIndentation, i as connectedProfilesForSession, it as ensureHookLauncher, j as claimOverRevokedSetup, k as canonicalContactSelector, l as psProcessInfo, lt as readClaudeSettings, m as enrollAgent, mt as inspectManagedBlock, n as OMP_MAIN, nt as describeSessionHookChange, o as headlessClaudeRun, ot as findOnPath, p as runDetached, pt as MachineFileError, q as saveConnectionName, r as agentConnectionState, rt as describeSessionHookItem, st as hasMachineSessionHooks, t as HOOK_END_GRACE_MS, tt as currentCliLocation, u as readClaudeHookInput, ut as repairClaudeHooks, v as invitationProfileName, vt as writeManagedFile, w as ContactPolicyReadRetryError, x as RECEIVER_MODES, xt as withOwnerMemberAddress, y as pollCheckCommand, yt as readHookLauncherWarning, z as contactAgentAddress } from "../machine-session-
|
|
5
|
+
import { _ as detectAgentRuntime, a as NotificationRetryError, b as installedVersion, c as readConversationStatusContent, d as defaultSessionSocket, f as NativeSessionDisconnectedError, g as connectSkillTarget, h as NotificationOutcomeUnknownError, i as notificationReceiptPage, l as SESSION_UUID$1, m as NativeSessionNotLoadedError, n as notificationSenders, o as isRoutineNotificationContent, p as NativeSessionError, r as openSessionNotifications, s as notificationPartReader, t as notificationScope, v as installConnectSkill, x as readBundledConnectSkill, y as installedConnectSkillFile } from "../notify-session-BaS84f3y.js";
|
|
6
|
+
import { $ as boundSessionProfiles, A as AgentDisconnectError, B as runContactRequest, C as verificationReplySubmitted, D as createNotificationContactPolicy, E as NetworkAdmissionPendingError, F as addressNoteTarget, G as receiverStatusCommand, H as agentInvitationHash, I as runAddressNotesRequest, J as savedReceiver, K as refusalAfterReplacement, L as ContactsApiError, M as clearRevokedAddresses, N as disconnectAgent, O as evaluateContactPolicy, P as AddressNotesApiError, Q as recordHookMailCheck, R as contactAddress, S as externalReceivingState, T as NETWORK_ADMISSION_PENDING_RETRY_MS, U as connectAgent, V as agentConnectionStatus, W as readAgentInvitation, X as releaseRegistrationsForProfile, Y as MACHINE_RUNTIMES, Z as installClaudeWakeHook, _ as defaultAgentProfileName, _t as upsertManagedBlock, a as endSession, at as ephemeralCliReason, b as runAgentConnect, bt as refreshOwnerMemberAddressPeriodically, c as pendingSessionDisconnects, ct as inspectClaudeHooks, d as registerSession, dt as samePath, et as claudeConfigDir, f as retryPendingDisconnects, ft as writeClaudeSettings, g as connectWarnings, gt as readManagedFile, h as enrollmentResumes, ht as jsonIndentation, i as connectedProfilesForSession, it as ensureHookLauncher, j as claimOverRevokedSetup, k as canonicalContactSelector, l as psProcessInfo, lt as readClaudeSettings, m as enrollAgent, mt as inspectManagedBlock, n as OMP_MAIN, nt as describeSessionHookChange, o as headlessClaudeRun, ot as findOnPath, p as runDetached, pt as MachineFileError, q as saveConnectionName, r as agentConnectionState, rt as describeSessionHookItem, st as hasMachineSessionHooks, t as HOOK_END_GRACE_MS, tt as currentCliLocation, u as readClaudeHookInput, ut as repairClaudeHooks, v as invitationProfileName, vt as writeManagedFile, w as ContactPolicyReadRetryError, x as RECEIVER_MODES, xt as withOwnerMemberAddress, y as pollCheckCommand, yt as readHookLauncherWarning, z as contactAgentAddress } from "../machine-session-Bmv7ZOQh.js";
|
|
7
7
|
import { a as scopedChatSenderTrust, i as readBeforeDeadline, n as isPlainChatReply, o as presenceDisposition, r as isScopedChatReply, s as readPresenceProjection, t as isConnectedChatCredential } from "../scoped-chat-BW041zEY.js";
|
|
8
8
|
import { c as startBackgroundListen, i as backgroundListenToken, l as stopBackgroundListen, o as runBackgroundListen, r as backgroundListenStatus, u as verifyBackgroundListenTarget } from "../listen-background--0peztKE.js";
|
|
9
|
-
import { a as ensureSharedMailSubscription, c as isConnectedAgentKey, d as reserveSharedMailSubscription, f as followEmailConversation, g as EventReceiverError, h as EventConnection, i as sharedMailScope, l as createSharedMailWaiter, m as otherParticipants, n as reconcileChatSend, p as readConversationFollow, r as openSharedMailReceiver, s as AGENT_CONNECTION_REQUIRED_MESSAGE, t as sendSignal, u as openSharedMailStore } from "../signal-command-
|
|
9
|
+
import { a as ensureSharedMailSubscription, c as isConnectedAgentKey, d as reserveSharedMailSubscription, f as followEmailConversation, g as EventReceiverError, h as EventConnection, i as sharedMailScope, l as createSharedMailWaiter, m as otherParticipants, n as reconcileChatSend, p as readConversationFollow, r as openSharedMailReceiver, s as AGENT_CONNECTION_REQUIRED_MESSAGE, t as sendSignal, u as openSharedMailStore } from "../signal-command-CwIFkT9e.js";
|
|
10
10
|
import { autoSignalEligible, dispatchAutoRead, dispatchAutoWorking, haltAutoWorking, isSentSignal, readWorkingLease, restoreAutoWorking } from "./auto-signals.js";
|
|
11
11
|
import { t as guardJsonOutputCommands } from "../json-output-CEskSQJi.js";
|
|
12
12
|
import { Args, Command, Errors, Flags, ux } from "@oclif/core";
|
|
@@ -1651,7 +1651,8 @@ const openapiDocument = {
|
|
|
1651
1651
|
},
|
|
1652
1652
|
"responses": {
|
|
1653
1653
|
"200": {
|
|
1654
|
-
"description": "Outbound relay result",
|
|
1654
|
+
"description": "Outbound relay result. When the request was answered with an\nexisting send instead of making a new one, the response carries\n`Idempotent-Replayed: true` and `data.idempotency`, and nothing\nwas sent for this request.\n",
|
|
1655
|
+
"headers": { "Idempotent-Replayed": { "$ref": "#/components/headers/IdempotentReplayed" } },
|
|
1655
1656
|
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
1656
1657
|
"type": "object",
|
|
1657
1658
|
"properties": { "data": { "$ref": "#/components/schemas/SendMailResult" } }
|
|
@@ -2575,7 +2576,8 @@ const openapiDocument = {
|
|
|
2575
2576
|
},
|
|
2576
2577
|
"responses": {
|
|
2577
2578
|
"200": {
|
|
2578
|
-
"description": "Outbound relay result",
|
|
2579
|
+
"description": "Outbound relay result. When the request was answered with an\nexisting send instead of making a new one, the response carries\n`Idempotent-Replayed: true` and `data.idempotency`, and nothing\nwas sent for this request.\n",
|
|
2580
|
+
"headers": { "Idempotent-Replayed": { "$ref": "#/components/headers/IdempotentReplayed" } },
|
|
2579
2581
|
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
2580
2582
|
"type": "object",
|
|
2581
2583
|
"properties": { "data": { "$ref": "#/components/schemas/SendMailResult" } }
|
|
@@ -8295,6 +8297,20 @@ const openapiDocument = {
|
|
|
8295
8297
|
}
|
|
8296
8298
|
}
|
|
8297
8299
|
},
|
|
8300
|
+
"headers": {
|
|
8301
|
+
"IdempotentReplayed": {
|
|
8302
|
+
"description": "Set to `true` when the request was answered with an existing send\ninstead of making a new one. Absent on a request that sent. On a\nbatch it means at least one message replayed; see\n`Idempotent-Replayed-Count`.\n",
|
|
8303
|
+
"schema": { "type": "string" },
|
|
8304
|
+
"example": "true"
|
|
8305
|
+
},
|
|
8306
|
+
"IdempotentReplayedCount": {
|
|
8307
|
+
"description": "Batch sends only: how many messages were answered with an existing\nsend instead of being sent. Absent when every message sent.\n",
|
|
8308
|
+
"schema": {
|
|
8309
|
+
"type": "integer",
|
|
8310
|
+
"minimum": 1
|
|
8311
|
+
}
|
|
8312
|
+
}
|
|
8313
|
+
},
|
|
8298
8314
|
"responses": {
|
|
8299
8315
|
"AttachmentPart": {
|
|
8300
8316
|
"description": "Original attachment bytes; never a JSON envelope or a base64 string",
|
|
@@ -13749,6 +13765,46 @@ const openapiDocument = {
|
|
|
13749
13765
|
"reply_sent_email_id"
|
|
13750
13766
|
]
|
|
13751
13767
|
},
|
|
13768
|
+
"SendMailIdempotencyReplay": {
|
|
13769
|
+
"type": "object",
|
|
13770
|
+
"description": "Present only when the request was answered with an existing send\ninstead of making a new one (`idempotent_replay: true`). Nothing\nwas sent for this request. Says how the idempotency key was\nderived and which send the request collapsed onto. On the replay\nof a stored failure the same object is under `error.details`.\n",
|
|
13771
|
+
"properties": {
|
|
13772
|
+
"replayed": {
|
|
13773
|
+
"type": "boolean",
|
|
13774
|
+
"description": "Always `true`. The object is absent on a request that made a send of its own."
|
|
13775
|
+
},
|
|
13776
|
+
"key_source": {
|
|
13777
|
+
"type": "string",
|
|
13778
|
+
"enum": [
|
|
13779
|
+
"explicit",
|
|
13780
|
+
"auto_content",
|
|
13781
|
+
"function_trigger"
|
|
13782
|
+
],
|
|
13783
|
+
"description": "`explicit`: the request carried an `Idempotency-Key` header.\n`auto_content`: no header was sent, so the key was derived\nfrom the canonical request content (recipients included) and\na fixed 5-minute window; an identical send inside the same\nwindow was not sent again. `function_trigger`: no header on a\nsend made by a Function, so the key was derived from the\ncontent, the Function and the inbound email (or event) that\ninvoked it.\n"
|
|
13784
|
+
},
|
|
13785
|
+
"original_sent_email_id": {
|
|
13786
|
+
"type": "string",
|
|
13787
|
+
"format": "uuid",
|
|
13788
|
+
"description": "The send this request collapsed onto. Same value as `id`."
|
|
13789
|
+
},
|
|
13790
|
+
"original_created_at": {
|
|
13791
|
+
"type": ["string", "null"],
|
|
13792
|
+
"format": "date-time",
|
|
13793
|
+
"description": "When that send was created."
|
|
13794
|
+
},
|
|
13795
|
+
"window_seconds": {
|
|
13796
|
+
"type": ["integer", "null"],
|
|
13797
|
+
"description": "Length of the content window (300) when an `auto_content`\nkey matched on content. Null for `explicit` and\n`function_trigger` keys, which have no window, and for a\nkeyless reply matched because its parent already has a reply\n(`dedup_reason: parent_already_replied`).\n"
|
|
13798
|
+
}
|
|
13799
|
+
},
|
|
13800
|
+
"required": [
|
|
13801
|
+
"replayed",
|
|
13802
|
+
"key_source",
|
|
13803
|
+
"original_sent_email_id",
|
|
13804
|
+
"original_created_at",
|
|
13805
|
+
"window_seconds"
|
|
13806
|
+
]
|
|
13807
|
+
},
|
|
13752
13808
|
"SendMailResult": {
|
|
13753
13809
|
"type": "object",
|
|
13754
13810
|
"properties": {
|
|
@@ -13805,6 +13861,11 @@ const openapiDocument = {
|
|
|
13805
13861
|
"type": "boolean",
|
|
13806
13862
|
"description": "True when the response replays a previously-recorded send\nkeyed by `client_idempotency_key` (same key, same canonical\npayload). False on a fresh send and on gate-denied\nresponses. Lets callers branch on cache state without\ndiffing fields.\n"
|
|
13807
13863
|
},
|
|
13864
|
+
"dedup_reason": {
|
|
13865
|
+
"type": ["string", "null"],
|
|
13866
|
+
"description": "Why the response was a replay; null or absent on a fresh\nsend. `content_hash_match`: the idempotency key matched an\nearlier send. `parent_already_replied`: a reply sent without\nan `Idempotency-Key` header was matched to the reply its\nparent email already has. Pass an `Idempotency-Key` to send\nanother reply to the same email.\n"
|
|
13867
|
+
},
|
|
13868
|
+
"idempotency": { "$ref": "#/components/schemas/SendMailIdempotencyReplay" },
|
|
13808
13869
|
"scheduled_at": {
|
|
13809
13870
|
"type": "string",
|
|
13810
13871
|
"format": "date-time",
|
|
@@ -33074,6 +33135,50 @@ const operationManifest = [
|
|
|
33074
33135
|
"type": "boolean",
|
|
33075
33136
|
"description": "True when the response replays a previously-recorded send\nkeyed by `client_idempotency_key` (same key, same canonical\npayload). False on a fresh send and on gate-denied\nresponses. Lets callers branch on cache state without\ndiffing fields.\n"
|
|
33076
33137
|
},
|
|
33138
|
+
"dedup_reason": {
|
|
33139
|
+
"type": ["string", "null"],
|
|
33140
|
+
"description": "Why the response was a replay; null or absent on a fresh\nsend. `content_hash_match`: the idempotency key matched an\nearlier send. `parent_already_replied`: a reply sent without\nan `Idempotency-Key` header was matched to the reply its\nparent email already has. Pass an `Idempotency-Key` to send\nanother reply to the same email.\n"
|
|
33141
|
+
},
|
|
33142
|
+
"idempotency": {
|
|
33143
|
+
"type": "object",
|
|
33144
|
+
"description": "Present only when the request was answered with an existing send\ninstead of making a new one (`idempotent_replay: true`). Nothing\nwas sent for this request. Says how the idempotency key was\nderived and which send the request collapsed onto. On the replay\nof a stored failure the same object is under `error.details`.\n",
|
|
33145
|
+
"properties": {
|
|
33146
|
+
"replayed": {
|
|
33147
|
+
"type": "boolean",
|
|
33148
|
+
"description": "Always `true`. The object is absent on a request that made a send of its own."
|
|
33149
|
+
},
|
|
33150
|
+
"key_source": {
|
|
33151
|
+
"type": "string",
|
|
33152
|
+
"enum": [
|
|
33153
|
+
"explicit",
|
|
33154
|
+
"auto_content",
|
|
33155
|
+
"function_trigger"
|
|
33156
|
+
],
|
|
33157
|
+
"description": "`explicit`: the request carried an `Idempotency-Key` header.\n`auto_content`: no header was sent, so the key was derived\nfrom the canonical request content (recipients included) and\na fixed 5-minute window; an identical send inside the same\nwindow was not sent again. `function_trigger`: no header on a\nsend made by a Function, so the key was derived from the\ncontent, the Function and the inbound email (or event) that\ninvoked it.\n"
|
|
33158
|
+
},
|
|
33159
|
+
"original_sent_email_id": {
|
|
33160
|
+
"type": "string",
|
|
33161
|
+
"format": "uuid",
|
|
33162
|
+
"description": "The send this request collapsed onto. Same value as `id`."
|
|
33163
|
+
},
|
|
33164
|
+
"original_created_at": {
|
|
33165
|
+
"type": ["string", "null"],
|
|
33166
|
+
"format": "date-time",
|
|
33167
|
+
"description": "When that send was created."
|
|
33168
|
+
},
|
|
33169
|
+
"window_seconds": {
|
|
33170
|
+
"type": ["integer", "null"],
|
|
33171
|
+
"description": "Length of the content window (300) when an `auto_content`\nkey matched on content. Null for `explicit` and\n`function_trigger` keys, which have no window, and for a\nkeyless reply matched because its parent already has a reply\n(`dedup_reason: parent_already_replied`).\n"
|
|
33172
|
+
}
|
|
33173
|
+
},
|
|
33174
|
+
"required": [
|
|
33175
|
+
"replayed",
|
|
33176
|
+
"key_source",
|
|
33177
|
+
"original_sent_email_id",
|
|
33178
|
+
"original_created_at",
|
|
33179
|
+
"window_seconds"
|
|
33180
|
+
]
|
|
33181
|
+
},
|
|
33077
33182
|
"scheduled_at": {
|
|
33078
33183
|
"type": "string",
|
|
33079
33184
|
"format": "date-time",
|
|
@@ -33847,6 +33952,50 @@ const operationManifest = [
|
|
|
33847
33952
|
"type": "boolean",
|
|
33848
33953
|
"description": "True when the response replays a previously-recorded send\nkeyed by `client_idempotency_key` (same key, same canonical\npayload). False on a fresh send and on gate-denied\nresponses. Lets callers branch on cache state without\ndiffing fields.\n"
|
|
33849
33954
|
},
|
|
33955
|
+
"dedup_reason": {
|
|
33956
|
+
"type": ["string", "null"],
|
|
33957
|
+
"description": "Why the response was a replay; null or absent on a fresh\nsend. `content_hash_match`: the idempotency key matched an\nearlier send. `parent_already_replied`: a reply sent without\nan `Idempotency-Key` header was matched to the reply its\nparent email already has. Pass an `Idempotency-Key` to send\nanother reply to the same email.\n"
|
|
33958
|
+
},
|
|
33959
|
+
"idempotency": {
|
|
33960
|
+
"type": "object",
|
|
33961
|
+
"description": "Present only when the request was answered with an existing send\ninstead of making a new one (`idempotent_replay: true`). Nothing\nwas sent for this request. Says how the idempotency key was\nderived and which send the request collapsed onto. On the replay\nof a stored failure the same object is under `error.details`.\n",
|
|
33962
|
+
"properties": {
|
|
33963
|
+
"replayed": {
|
|
33964
|
+
"type": "boolean",
|
|
33965
|
+
"description": "Always `true`. The object is absent on a request that made a send of its own."
|
|
33966
|
+
},
|
|
33967
|
+
"key_source": {
|
|
33968
|
+
"type": "string",
|
|
33969
|
+
"enum": [
|
|
33970
|
+
"explicit",
|
|
33971
|
+
"auto_content",
|
|
33972
|
+
"function_trigger"
|
|
33973
|
+
],
|
|
33974
|
+
"description": "`explicit`: the request carried an `Idempotency-Key` header.\n`auto_content`: no header was sent, so the key was derived\nfrom the canonical request content (recipients included) and\na fixed 5-minute window; an identical send inside the same\nwindow was not sent again. `function_trigger`: no header on a\nsend made by a Function, so the key was derived from the\ncontent, the Function and the inbound email (or event) that\ninvoked it.\n"
|
|
33975
|
+
},
|
|
33976
|
+
"original_sent_email_id": {
|
|
33977
|
+
"type": "string",
|
|
33978
|
+
"format": "uuid",
|
|
33979
|
+
"description": "The send this request collapsed onto. Same value as `id`."
|
|
33980
|
+
},
|
|
33981
|
+
"original_created_at": {
|
|
33982
|
+
"type": ["string", "null"],
|
|
33983
|
+
"format": "date-time",
|
|
33984
|
+
"description": "When that send was created."
|
|
33985
|
+
},
|
|
33986
|
+
"window_seconds": {
|
|
33987
|
+
"type": ["integer", "null"],
|
|
33988
|
+
"description": "Length of the content window (300) when an `auto_content`\nkey matched on content. Null for `explicit` and\n`function_trigger` keys, which have no window, and for a\nkeyless reply matched because its parent already has a reply\n(`dedup_reason: parent_already_replied`).\n"
|
|
33989
|
+
}
|
|
33990
|
+
},
|
|
33991
|
+
"required": [
|
|
33992
|
+
"replayed",
|
|
33993
|
+
"key_source",
|
|
33994
|
+
"original_sent_email_id",
|
|
33995
|
+
"original_created_at",
|
|
33996
|
+
"window_seconds"
|
|
33997
|
+
]
|
|
33998
|
+
},
|
|
33850
33999
|
"scheduled_at": {
|
|
33851
34000
|
"type": "string",
|
|
33852
34001
|
"format": "date-time",
|
|
@@ -39641,6 +39790,10 @@ function chatFailureText(message) {
|
|
|
39641
39790
|
function chatHeading(text) {
|
|
39642
39791
|
return chatColor("bold", text);
|
|
39643
39792
|
}
|
|
39793
|
+
const CHAT_REPLAY_NOTICE = {
|
|
39794
|
+
keyOrigin: "cli_derived",
|
|
39795
|
+
advise: false
|
|
39796
|
+
};
|
|
39644
39797
|
function chatNoticeText(message) {
|
|
39645
39798
|
return chatColor("yellow", message);
|
|
39646
39799
|
}
|
|
@@ -39940,7 +40093,7 @@ function chatNoun(context) {
|
|
|
39940
40093
|
return context.parentReply === void 0 ? "Message" : "Reply";
|
|
39941
40094
|
}
|
|
39942
40095
|
function formatChatRepliedMessage(context, outcome) {
|
|
39943
|
-
if (outcome === "already_sent") return `${formatAlreadySentNotice(context.sent)} Its existing reply from ${context.reply.from_email} is shown.`;
|
|
40096
|
+
if (outcome === "already_sent") return `${formatAlreadySentNotice(context.sent, CHAT_REPLAY_NOTICE)} Its existing reply from ${context.reply.from_email} is shown.`;
|
|
39944
40097
|
return `${chatNoun(context)} sent (id ${context.sent.id}) and a reply arrived from ${context.reply.from_email}.`;
|
|
39945
40098
|
}
|
|
39946
40099
|
function buildChatJsonEnvelope(context, outcome = "replied") {
|
|
@@ -40004,7 +40157,7 @@ function formatChatAwaitingReplyMessage(context, options) {
|
|
|
40004
40157
|
const [next] = buildChatExistingReplyCommands(context, options.existingReplyId);
|
|
40005
40158
|
const status = options.waitError === void 0 ? "No reply to it yet." : `Loading its reply failed: ${options.waitError}.`;
|
|
40006
40159
|
const action = next.kind === "inspect_reply" ? "read the reply with" : next.kind === "inspect_inbox" ? "inspect the inbox with" : "wait with";
|
|
40007
|
-
return `${formatAlreadySentNotice(context.sent)} ${status} Do NOT resend; ${action}: ${next.command}`;
|
|
40160
|
+
return `${formatAlreadySentNotice(context.sent, CHAT_REPLAY_NOTICE)} ${status} Do NOT resend; ${action}: ${next.command}`;
|
|
40008
40161
|
}
|
|
40009
40162
|
const [wait] = buildChatRecoveryCommands(context);
|
|
40010
40163
|
const status = options.waitError === void 0 ? `No reply yet after ${context.timeoutSeconds}s.` : `Waiting for the reply failed: ${options.waitError}`;
|
|
@@ -40807,7 +40960,7 @@ var ChatCommand = class ChatCommand extends Command {
|
|
|
40807
40960
|
await connectedWait?.bind(sent.id);
|
|
40808
40961
|
if (flags.async) {
|
|
40809
40962
|
const outcome = sent.idempotent_replay ? "already_sent" : "sent";
|
|
40810
|
-
const message = sent.idempotent_replay ? `${formatAlreadySentNotice(sent)} This conversation remains bound to this session; inspect it if the answer may have arrived already.` : `${chatNoun(baseContext)} sent (id ${sent.id}). This conversation is bound to this session for status and later replies. Keep its configured receiver active.`;
|
|
40963
|
+
const message = sent.idempotent_replay ? `${formatAlreadySentNotice(sent, CHAT_REPLAY_NOTICE)} This conversation remains bound to this session; inspect it if the answer may have arrived already.` : `${chatNoun(baseContext)} sent (id ${sent.id}). This conversation is bound to this session for status and later replies. Keep its configured receiver active.`;
|
|
40811
40964
|
const result = {
|
|
40812
40965
|
outcome,
|
|
40813
40966
|
exit_code: sendOutcomeExitCode(outcome),
|
|
@@ -41006,7 +41159,7 @@ var ChatCommand = class ChatCommand extends Command {
|
|
|
41006
41159
|
}
|
|
41007
41160
|
reportReplied(context, outcome) {
|
|
41008
41161
|
this.chatProgress.outcomeReported = true;
|
|
41009
|
-
if (outcome === "already_sent") process.stderr.write(`${chatNoticeText(formatAlreadySentNotice(context.sent))}\n`);
|
|
41162
|
+
if (outcome === "already_sent") process.stderr.write(`${chatNoticeText(formatAlreadySentNotice(context.sent, CHAT_REPLAY_NOTICE))}\n`);
|
|
41010
41163
|
if (context.json) this.log(JSON.stringify(buildChatJsonEnvelope(context, outcome), null, 2));
|
|
41011
41164
|
else this.log(formatChatResponse(context));
|
|
41012
41165
|
}
|
|
@@ -44755,7 +44908,7 @@ const PRIMITIVE_TEAM_AUTHOR = {
|
|
|
44755
44908
|
url: "https://primitive.dev"
|
|
44756
44909
|
};
|
|
44757
44910
|
const SDK_VERSION_RANGE = "^2.0.0";
|
|
44758
|
-
const CLI_VERSION_RANGE = "^1.
|
|
44911
|
+
const CLI_VERSION_RANGE = "^1.65.0";
|
|
44759
44912
|
const ESBUILD_VERSION_RANGE = "^0.27.0";
|
|
44760
44913
|
function renderHandler() {
|
|
44761
44914
|
return `// env.PRIMITIVE_API_KEY, env.PRIMITIVE_WEBHOOK_SECRET, and
|
|
@@ -55141,9 +55294,12 @@ var PaymentsPayEmailCommand = class PaymentsPayEmailCommand extends Command {
|
|
|
55141
55294
|
}
|
|
55142
55295
|
const sent = result.data?.data ?? null;
|
|
55143
55296
|
const replayed = sent?.idempotent_replay === true;
|
|
55144
|
-
if (replayed) writeIdempotentReplayBannerIfReplay(sent, {
|
|
55145
|
-
|
|
55146
|
-
|
|
55297
|
+
if (replayed) writeIdempotentReplayBannerIfReplay(sent, {
|
|
55298
|
+
advise: false,
|
|
55299
|
+
write: (chunk) => {
|
|
55300
|
+
process.stderr.write(chunk);
|
|
55301
|
+
}
|
|
55302
|
+
});
|
|
55147
55303
|
let settlement = null;
|
|
55148
55304
|
if (flags["wait-settle"] && !replayed && payeeTo) {
|
|
55149
55305
|
process.stderr.write("Payment sent. Waiting for the x402 settlement interaction email (settlement is async)...\n");
|
|
@@ -56018,6 +56174,7 @@ var ReplyCommand = class ReplyCommand extends Command {
|
|
|
56018
56174
|
const outcome = reportSendCommandResult({
|
|
56019
56175
|
attemptStartedAtIso,
|
|
56020
56176
|
idempotencyKey,
|
|
56177
|
+
idempotencyKeyOrigin: flags["idempotency-key"] === void 0 ? "cli_derived" : "caller",
|
|
56021
56178
|
extraEnvelopeFields: {
|
|
56022
56179
|
...priorRepliesEnvelopeFields(priorRepliesCheck),
|
|
56023
56180
|
...replyTargetEnvelopeFields(flags, this.replyTarget),
|
|
@@ -57144,6 +57301,7 @@ var SendCommand = class SendCommand extends Command {
|
|
|
57144
57301
|
attemptStartedAtIso,
|
|
57145
57302
|
...this.waitNotice ? { extraEnvelopeFields: { wait_notice: this.waitNotice } } : {},
|
|
57146
57303
|
idempotencyKey,
|
|
57304
|
+
idempotencyKeyOrigin: flags["idempotency-key"] === void 0 ? "cli_derived" : "caller",
|
|
57147
57305
|
json: flags.json,
|
|
57148
57306
|
log: (line) => this.log(line),
|
|
57149
57307
|
noun: "Message",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { N as agentProfileDirectory, P as agentProfileName, R as loadConnectedAgentProfile, j as AGENT_PROFILE_ENV } from "../cli-config-DMszFbGn.js";
|
|
2
2
|
import { d as readMailJson } from "../shared-mail-files-MwlVE90c.js";
|
|
3
|
-
import { _ as detectAgentRuntime, l as SESSION_UUID, t as notificationScope } from "../notify-session-
|
|
3
|
+
import { _ as detectAgentRuntime, l as SESSION_UUID, t as notificationScope } from "../notify-session-BaS84f3y.js";
|
|
4
4
|
import { a as claimBackgroundListenRestart, n as backgroundListenRestartable, r as backgroundListenStatus } from "../listen-background--0peztKE.js";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as sendPreparedSignal, p as prepareSignalEmail } from "./repeats-BL7ZC-_6-Dzangtkf.js";
|
|
2
|
-
import { T as bareAddress, Vn as listSentEmails, ar as sendEmail, bt as successfulSendOutcome, en as createEndpoint, it as classifySendError, o as extractErrorPayload, vn as getEmail } from "./api-command-
|
|
2
|
+
import { T as bareAddress, Vn as listSentEmails, ar as sendEmail, bt as successfulSendOutcome, en as createEndpoint, it as classifySendError, o as extractErrorPayload, vn as getEmail } from "./api-command-0u5Qd_a-.js";
|
|
3
3
|
import { _ as acquireListenLock, b as listenProcessIdentity, c as mailTime, d as readMailJson, f as removeMailFile, h as writeMailJson, i as mailId, l as privateMailDirectory, m as withMailLock, n as invalidSharedMail, o as mailObject, p as syncMailDirectory, r as mailAddress, s as mailString, t as SharedMailStateError, v as compareListenProcessIdentity, y as listenIdentity } from "./shared-mail-files-MwlVE90c.js";
|
|
4
4
|
import { a as scopedChatSenderTrust, i as readBeforeDeadline, n as isPlainChatReply } from "./scoped-chat-BW041zEY.js";
|
|
5
5
|
import { n as tryOwnSharedMail, r as waitForSharedMailChange, t as readSharedMailOwner } from "./shared-mail-watch-DtKpsgg8.js";
|
|
@@ -9,7 +9,7 @@ import { opendirSync } from "node:fs";
|
|
|
9
9
|
import { createHash, randomUUID, scryptSync } from "node:crypto";
|
|
10
10
|
import { dirname, join } from "node:path";
|
|
11
11
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
12
|
-
//#region ../sdk-node/dist/api-
|
|
12
|
+
//#region ../sdk-node/dist/api-UuhZ15CF.js
|
|
13
13
|
const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
|
|
14
14
|
function createSseClient({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) {
|
|
15
15
|
let lastEventId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "primcli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.65.0",
|
|
4
4
|
"description": "Official Primitive CLI: deploy Primitive Functions, send and inspect mail, manage endpoints, all from the terminal. Wraps the @primitivedotdev/sdk runtime client with one-shot commands.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|