primcli 3.0.0-preview.26 → 3.0.0-preview.28

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.
@@ -1068,6 +1068,16 @@ const operationManifest = [
1068
1068
  "maxLength": 255,
1069
1069
  "pattern": "^[!-~]{1,255}$"
1070
1070
  },
1071
+ "if_absent": {
1072
+ "type": "boolean",
1073
+ "description": "When true with idempotency_key, atomically claim work only if no active or completed activity exists for this actor and key (takes over expired started claims; otherwise returns 409 with error.details.activity)."
1074
+ },
1075
+ "claim_ttl_seconds": {
1076
+ "type": "integer",
1077
+ "minimum": 1,
1078
+ "maximum": 86400,
1079
+ "description": "Optional lease duration in seconds (1 to 86400) for status started claims."
1080
+ },
1071
1081
  "visibility": {
1072
1082
  "type": "string",
1073
1083
  "enum": ["thread", "actor_only"],
@@ -1291,6 +1301,11 @@ const operationManifest = [
1291
1301
  "type": ["string", "null"],
1292
1302
  "format": "date-time"
1293
1303
  },
1304
+ "claim_expires_at": {
1305
+ "type": ["string", "null"],
1306
+ "format": "date-time",
1307
+ "description": "Optional expiry timestamp for an active started claim lease."
1308
+ },
1294
1309
  "updated_by": { "oneOf": [{
1295
1310
  "type": "object",
1296
1311
  "additionalProperties": false,
@@ -1456,6 +1471,16 @@ const operationManifest = [
1456
1471
  "maxLength": 255,
1457
1472
  "pattern": "^[!-~]{1,255}$"
1458
1473
  },
1474
+ "if_absent": {
1475
+ "type": "boolean",
1476
+ "description": "When true with idempotency_key, atomically claim work only if no active or completed activity exists for this actor and key (takes over expired started claims; otherwise returns 409 with error.details.activity)."
1477
+ },
1478
+ "claim_ttl_seconds": {
1479
+ "type": "integer",
1480
+ "minimum": 1,
1481
+ "maximum": 86400,
1482
+ "description": "Optional lease duration in seconds (1 to 86400) for status started claims."
1483
+ },
1459
1484
  "visibility": {
1460
1485
  "type": "string",
1461
1486
  "enum": ["thread", "actor_only"],
@@ -1679,6 +1704,11 @@ const operationManifest = [
1679
1704
  "type": ["string", "null"],
1680
1705
  "format": "date-time"
1681
1706
  },
1707
+ "claim_expires_at": {
1708
+ "type": ["string", "null"],
1709
+ "format": "date-time",
1710
+ "description": "Optional expiry timestamp for an active started claim lease."
1711
+ },
1682
1712
  "updated_by": { "oneOf": [{
1683
1713
  "type": "object",
1684
1714
  "additionalProperties": false,
@@ -2167,6 +2197,11 @@ const operationManifest = [
2167
2197
  "type": ["string", "null"],
2168
2198
  "format": "date-time"
2169
2199
  },
2200
+ "claim_expires_at": {
2201
+ "type": ["string", "null"],
2202
+ "format": "date-time",
2203
+ "description": "Optional expiry timestamp for an active started claim lease."
2204
+ },
2170
2205
  "updated_by": { "oneOf": [{
2171
2206
  "type": "object",
2172
2207
  "additionalProperties": false,
@@ -3082,6 +3117,11 @@ const operationManifest = [
3082
3117
  "type": ["string", "null"],
3083
3118
  "format": "date-time"
3084
3119
  },
3120
+ "claim_expires_at": {
3121
+ "type": ["string", "null"],
3122
+ "format": "date-time",
3123
+ "description": "Optional expiry timestamp for an active started claim lease."
3124
+ },
3085
3125
  "updated_by": { "oneOf": [{
3086
3126
  "type": "object",
3087
3127
  "additionalProperties": false,
@@ -3229,6 +3269,17 @@ const operationManifest = [
3229
3269
  "type": "string",
3230
3270
  "enum": ["thread", "actor_only"],
3231
3271
  "description": "Visibility of a thread activity (`thread` is shared with scoped readers; `actor_only` is private to the creating actor unless an auditor passes `include_private=true`)."
3272
+ },
3273
+ "claim_ttl_seconds": {
3274
+ "type": ["integer", "null"],
3275
+ "minimum": 1,
3276
+ "maximum": 86400,
3277
+ "description": "Optional lease duration in seconds (1 to 86400) when status is started (null clears)."
3278
+ },
3279
+ "if_revision": {
3280
+ "type": "integer",
3281
+ "minimum": 1,
3282
+ "description": "Expected current revision for compare-and-set updates (returns 409 with error.details.activity on mismatch)."
3232
3283
  }
3233
3284
  }
3234
3285
  },
@@ -3447,6 +3498,11 @@ const operationManifest = [
3447
3498
  "type": ["string", "null"],
3448
3499
  "format": "date-time"
3449
3500
  },
3501
+ "claim_expires_at": {
3502
+ "type": ["string", "null"],
3503
+ "format": "date-time",
3504
+ "description": "Optional expiry timestamp for an active started claim lease."
3505
+ },
3450
3506
  "updated_by": { "oneOf": [{
3451
3507
  "type": "object",
3452
3508
  "additionalProperties": false,
@@ -28394,6 +28450,11 @@ const operationManifest = [
28394
28450
  "type": ["string", "null"],
28395
28451
  "format": "date-time"
28396
28452
  },
28453
+ "claim_expires_at": {
28454
+ "type": ["string", "null"],
28455
+ "format": "date-time",
28456
+ "description": "Optional expiry timestamp for an active started claim lease."
28457
+ },
28397
28458
  "updated_by": { "oneOf": [{
28398
28459
  "type": "object",
28399
28460
  "additionalProperties": false,
@@ -62599,7 +62660,7 @@ function savedConnectedProfiles(configDir, exclude) {
62599
62660
  */
62600
62661
  async function otherProfiles(configDir, session, current) {
62601
62662
  if (session) try {
62602
- const { connectedProfilesForSession } = await import("./machine-session-1utuweTi.js").then((n) => n.s);
62663
+ const { connectedProfilesForSession } = await import("./machine-session-Bh5Bh4tf.js").then((n) => n.s);
62603
62664
  return {
62604
62665
  inSession: true,
62605
62666
  profiles: connectedProfilesForSession(configDir, session, current)
@@ -1,8 +1,8 @@
1
1
  import { B as agentProfileDirectory, G as loadConnectedAgentProfile, H as agentProfilesDirectory, J as profileAlreadyConnectedMessage, K as parseConnectedAgentProfile, R as AGENT_PROFILE_ENV, S as loadCliCredentials, U as connectedAgentIdentity, V as agentProfileName, W as connectedApiBaseUrl, X as saveConnectedAgentProfile, dt as detectAgentRuntime, mt as PrimitiveApiClient, q as parseOwnerMemberAddress, z as AgentConnectionSetupError } from "./cli-config-CwZJQIcn.js";
2
2
  import { An as putAgentContact, Ft as getContact, Gn as sendEmail, Hn as searchEmails, Mn as putContact, Pt as getAgentContactPolicy, St as deleteContact, an as listAgentContacts, fr as __exportAll, in as listAgentConnections, jn as putAgentContactPolicy, sn as listContacts, tn as inviteAgentConnection, un as listDomains, wn as listSentEmails, xt as deleteAgentContact, zt as getEmail } from "./repeats-Dj_o6c-X-CK1wU9lP.js";
3
- import { At as cliInvocation, Cn as refuseOrgSelectionForProfile, Mt as defaultConnectionName, Sn as refreshStoredCliCredentials } from "./api-command-B-nuABGm.js";
3
+ import { At as cliInvocation, Cn as refuseOrgSelectionForProfile, Mt as defaultConnectionName, Sn as refreshStoredCliCredentials } from "./api-command-DSfZl8fj.js";
4
4
  import { _ as acquireListenLock, b as listenLockHeld, c as mailTime, d as readMailJson, f as removeMailFile, g as ListenStateError, h as writeMailJson, i as mailId, l as privateMailDirectory, o as mailObject, p as syncMailDirectory, r as mailAddress, s as mailString } from "./shared-mail-files-BAQSGxxz.js";
5
- import { a as NotificationRetryError, d as SESSION_UUID, f as connectNativeSession, m as NativeSessionDisconnectedError, p as defaultSessionSocket, t as notificationScope, w as readBundledConnectSkill, x as installSkill } from "./notify-session-CM4_ZYe9.js";
5
+ import { a as NotificationRetryError, d as SESSION_UUID, f as connectNativeSession, m as NativeSessionDisconnectedError, p as defaultSessionSocket, t as notificationScope, w as readBundledConnectSkill, x as installSkill } from "./notify-session-qbfowlNN.js";
6
6
  import { a as backgroundListenStatus, d as stopBackgroundListen } from "./listen-background-DyBYca28.js";
7
7
  import { t as readSharedMailOwner } from "./shared-mail-watch-DdtgJOrV.js";
8
8
  import { withoutOrgSelection } from "./oclif/global-org-flag.js";
@@ -1,5 +1,5 @@
1
1
  import { _ as isTrustedSender, c as classifySignalContent, g as isEmailReceivedEvent, kt as downloadEmailAttachmentPart, v as parseWebhookEvent } from "./repeats-Dj_o6c-X-CK1wU9lP.js";
2
- import { B as wakeReadCommand, tt as wakeInteractionSentence, z as skillFirstLine } from "./api-command-B-nuABGm.js";
2
+ import { B as wakeReadCommand, tt as wakeInteractionSentence, z as skillFirstLine } from "./api-command-DSfZl8fj.js";
3
3
  import { _ as acquireListenLock, g as ListenStateError, y as listenIdentity } from "./shared-mail-files-BAQSGxxz.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,8 +1,8 @@
1
1
  import { Qt as getSentEmail } from "../repeats-Dj_o6c-X-CK1wU9lP.js";
2
- import { F as readThreadContext, yn as createAuthenticatedCliApiClient } from "../api-command-B-nuABGm.js";
2
+ import { F as readThreadContext, yn as createAuthenticatedCliApiClient } from "../api-command-DSfZl8fj.js";
3
3
  import { AUTO_SIGNAL_KIND_ENV, AUTO_WORKING_RENEW_MS, autoSignalsDisabled, clearWorkingSending, markWorkingSending, readAutoClaim, readWorkingLease, recordRenewer, stopWorkingLease, writeWorkingLease } from "./auto-signals.js";
4
4
  import { _ as acquireListenLock } from "../shared-mail-files-BAQSGxxz.js";
5
- import { t as sendSignal } from "../signal-command-D4ZIidPX.js";
5
+ import { t as sendSignal } from "../signal-command-DvIH9E_B.js";
6
6
  import { join } from "node:path";
7
7
  import { homedir } from "node:os";
8
8
  // src/oclif/auto-signal-worker.ts
@@ -1,15 +1,15 @@
1
- import { $ as replyExpectation, $t as readDomainsOrRefusal, A as bareAddress, An as fetchCliOrgs, At as cliInvocation, B as wakeReadCommand, Bn as operationManifest, Bt as NO_FOCUS, C as terminalApprovalIo, Cn as refuseOrgSelectionForProfile, Ct as sendOutcomeExitCode, D as listenForCopyHotkey, Dn as RESTRICTED_ROLE_NOTE, Dt as successfulSendOutcome, E as formatBrowserLoginInstructions, En as CliOrgRefusedError, Et as serializeErrorPayload, F as readThreadContext, Fn as switchCurrentOrg, Ft as loadSkillLine, G as clearReadPendingMail, Gn as validateActivityReason, Gt as focusForCorpus, H as wakeRelationship, Hn as PRIMITIVE_RUN_ID_HEADER, Ht as focusEmptyHint, I as sentInThread, In as routeWarningLines, It as currentMailSessionKey, J as recordPendingMail, Jt as loadSavedFocus, K as pendingMailPath, Kn as validateActivityRunId, Kt as focusProfile, L as serverMuted, Ln as sanitizeForTerminal, Lt as formatAlreadySentNotice, M as displayAddress, Mn as revokeUserLogin, N as formatMailWakeLine, Nn as roleKeyLabel, Nt as generatedAgentName, O as openBrowser, On as credentialsFromUserLogin, Ot as thrownErrorExitCode, P as latestOwnOutbound, Pn as roleKeyText, Pt as identitySuggestions, Q as readEmailInteraction, Qt as queryScopesItself, R as serverRelationship, Rn as shownLine, Rt as FOCUS_ENV, S as promptLine$2, Sn as refreshStoredCliCredentials, St as sendIdentityFields, T as canOfferCopyHotkey, Tn as selectedOrgFromEnv, Tt as sentHistoryWindowStart, U as claimPendingMail, Un as attachActivityContextFlags, Ut as focusFlagValues, V as wakeRecipientField, Vn as PRIMITIVE_REASON_HEADER, Vt as countFromMeta, W as clearConsumedPendingMail, Wn as cliActivityHeadersFromEnv, Wt as focusFlags, X as interactionHumanLine, Xt as normalizeDomainNames, Y as removePendingMail, Yt as manyDomainsSupported, Z as interactionNextActions, Zt as oneDomainAtATimeError, _ as writeErrorWithHints, _n as ConnectedAgentKeyRequiredError, _t as formatSendFailureSummary, a as agentPassErrorHint, an as writeFocusLine, at as apiResultHttpStatus, b as STEP_UP_TOKEN_FLAG_DESCRIPTION, bn as createCliApiClient, bt as reportSendCommandResult, c as extractErrorPayload, cn as mailReach, ct as buildThrownSendFailureEnvelope, d as isGrantRefusal, dn as isEmailId, dt as deriveSendIdempotencyKey, en as resolveDomainNames, et as replyInteractionWarning, f as networkErrorHint, fn as fetchBoundedPages, ft as excludeSignalReplies, g as surfaceUnauthorizedHint, gn as withAttachmentWait, gt as formatPriorRepliesWarning, h as runWithTiming, hn as ATTACHMENT_WAIT_MAX_MS, ht as formatPriorRepliesCheckSkipped, i as TIME_FLAG_DESCRIPTION, in as withoutFocus, it as SEND_OUTCOME_HELP, j as describeWake, jn as isBuiltInRoleKey, jt as connectNextSteps, k as explainPendingMailNotFound, kn as displayedRoleKey, l as formatErrorPayload, ln as readCallerMailFor, lt as checkPriorReplies, m as refusesCredential, mn as ATTACHMENT_WAIT_FLAG_DESCRIPTION, mt as formatDeletedEarlierSendNotice, n as API_ERROR_CODES, nn as saveFocus, nt as IDEMPOTENCY_KEY_FLAG_DESCRIPTION, o as createOperationCommand, on as withFlagSuggestion, ot as assertValidIdempotencyKey, p as readTextFileFlag, pn as withBooleanFlagValues, pt as followUpCommandPrefix, q as readPendingMail, qt as joinNames, r as PAGED_LIMIT_MAX, rn as withFocusMeta, rt as MAX_SEND_WAIT_TIMEOUT_MS, s as extractErrorCode, sn as emptyEmailListHint, st as buildFollowUpCommand, t as API_BASE_URL_FLAG_DESCRIPTION, tn as resolveFocus, u as hasControlCharacter$1, un as formatFact, ut as classifySendError, v as BROWSER_FLAG_DESCRIPTION, vt as formatSendRecordFailureSummary, w as withApproval, wn as resolveCliApiRequestConfig, wt as sendWaitClampNotice, x as approveThenRerunHint, xn as mergeHeadersCaseInsensitive, xt as sendErrorMessage, y as STEP_UP_HEADER$1, yn as createAuthenticatedCliApiClient, yt as priorRepliesThatWentOut, zn as setKnownCommands, zt as FOCUS_SERVER_SUPPORT } from "../api-command-B-nuABGm.js";
1
+ import { $ as replyExpectation, $t as readDomainsOrRefusal, A as bareAddress, An as fetchCliOrgs, At as cliInvocation, B as wakeReadCommand, Bn as operationManifest, Bt as NO_FOCUS, C as terminalApprovalIo, Cn as refuseOrgSelectionForProfile, Ct as sendOutcomeExitCode, D as listenForCopyHotkey, Dn as RESTRICTED_ROLE_NOTE, Dt as successfulSendOutcome, E as formatBrowserLoginInstructions, En as CliOrgRefusedError, Et as serializeErrorPayload, F as readThreadContext, Fn as switchCurrentOrg, Ft as loadSkillLine, G as clearReadPendingMail, Gn as validateActivityReason, Gt as focusForCorpus, H as wakeRelationship, Hn as PRIMITIVE_RUN_ID_HEADER, Ht as focusEmptyHint, I as sentInThread, In as routeWarningLines, It as currentMailSessionKey, J as recordPendingMail, Jt as loadSavedFocus, K as pendingMailPath, Kn as validateActivityRunId, Kt as focusProfile, L as serverMuted, Ln as sanitizeForTerminal, Lt as formatAlreadySentNotice, M as displayAddress, Mn as revokeUserLogin, N as formatMailWakeLine, Nn as roleKeyLabel, Nt as generatedAgentName, O as openBrowser, On as credentialsFromUserLogin, Ot as thrownErrorExitCode, P as latestOwnOutbound, Pn as roleKeyText, Pt as identitySuggestions, Q as readEmailInteraction, Qt as queryScopesItself, R as serverRelationship, Rn as shownLine, Rt as FOCUS_ENV, S as promptLine$2, Sn as refreshStoredCliCredentials, St as sendIdentityFields, T as canOfferCopyHotkey, Tn as selectedOrgFromEnv, Tt as sentHistoryWindowStart, U as claimPendingMail, Un as attachActivityContextFlags, Ut as focusFlagValues, V as wakeRecipientField, Vn as PRIMITIVE_REASON_HEADER, Vt as countFromMeta, W as clearConsumedPendingMail, Wn as cliActivityHeadersFromEnv, Wt as focusFlags, X as interactionHumanLine, Xt as normalizeDomainNames, Y as removePendingMail, Yt as manyDomainsSupported, Z as interactionNextActions, Zt as oneDomainAtATimeError, _ as writeErrorWithHints, _n as ConnectedAgentKeyRequiredError, _t as formatSendFailureSummary, a as agentPassErrorHint, an as writeFocusLine, at as apiResultHttpStatus, b as STEP_UP_TOKEN_FLAG_DESCRIPTION, bn as createCliApiClient, bt as reportSendCommandResult, c as extractErrorPayload, cn as mailReach, ct as buildThrownSendFailureEnvelope, d as isGrantRefusal, dn as isEmailId, dt as deriveSendIdempotencyKey, en as resolveDomainNames, et as replyInteractionWarning, f as networkErrorHint, fn as fetchBoundedPages, ft as excludeSignalReplies, g as surfaceUnauthorizedHint, gn as withAttachmentWait, gt as formatPriorRepliesWarning, h as runWithTiming, hn as ATTACHMENT_WAIT_MAX_MS, ht as formatPriorRepliesCheckSkipped, i as TIME_FLAG_DESCRIPTION, in as withoutFocus, it as SEND_OUTCOME_HELP, j as describeWake, jn as isBuiltInRoleKey, jt as connectNextSteps, k as explainPendingMailNotFound, kn as displayedRoleKey, l as formatErrorPayload, ln as readCallerMailFor, lt as checkPriorReplies, m as refusesCredential, mn as ATTACHMENT_WAIT_FLAG_DESCRIPTION, mt as formatDeletedEarlierSendNotice, n as API_ERROR_CODES, nn as saveFocus, nt as IDEMPOTENCY_KEY_FLAG_DESCRIPTION, o as createOperationCommand, on as withFlagSuggestion, ot as assertValidIdempotencyKey, p as readTextFileFlag, pn as withBooleanFlagValues, pt as followUpCommandPrefix, q as readPendingMail, qt as joinNames, r as PAGED_LIMIT_MAX, rn as withFocusMeta, rt as MAX_SEND_WAIT_TIMEOUT_MS, s as extractErrorCode, sn as emptyEmailListHint, st as buildFollowUpCommand, t as API_BASE_URL_FLAG_DESCRIPTION, tn as resolveFocus, u as hasControlCharacter$1, un as formatFact, ut as classifySendError, v as BROWSER_FLAG_DESCRIPTION, vt as formatSendRecordFailureSummary, w as withApproval, wn as resolveCliApiRequestConfig, wt as sendWaitClampNotice, x as approveThenRerunHint, xn as mergeHeadersCaseInsensitive, xt as sendErrorMessage, y as STEP_UP_HEADER$1, yn as createAuthenticatedCliApiClient, yt as priorRepliesThatWentOut, zn as setKnownCommands, zt as FOCUS_SERVER_SUPPORT } from "../api-command-DSfZl8fj.js";
2
2
  import { a as canonicalCommandId, c as operationCommandId, i as canonicalCliText, l as retiredCommandTarget, n as COMMAND_RENAMES, o as canonicalCommands, s as canonicalOperation, t as COMMAND_PAIR_RENAMES } from "../cli-command-names-no0f7d7s.js";
3
3
  import { ignoreArgumentStdin } from "./command-stdin.js";
4
4
  import { a as runStreamingJson, i as jsonOutputRequested, n as captureOutput, o as thrownErrorBody, r as guardJsonOutputCommands, t as JSON_OUTPUT_FLAG } from "../json-output-BMZrLH47.js";
5
5
  import { $ as AUTOMATED_VALUES, $n as stopRepeatFromEmail, $t as getThread, A as collectNewAcceptedEmails, At as downloadSentAttachmentArchiveMember, B as REPLY_STATE_UNSUPPORTED_CODE, Bn as runWakeSchedule, Cn as listSentAttachmentArchiveMembers, Ct as deleteMemory, D as transientFailure, Dn as listWakeSchedules, Dt as downloadEmailAttachmentArchiveMember, E as retryingOperation, En as listWakeDispatches, Et as deleteWakeSchedule, F as lateMailReread, Fn as reorderRoutes, G as formatAwaitingCell, Gn as sendEmail, Gt as getKey, H as assertAwaitingFilterRows, Hn as searchEmails, Ht as getFunctionRouting, I as sinceFromFlags, In as replyToEmail, It as getConversation, J as isAwaitingRejectedError, Jn as setMemory, Jt as getOutboundStatus, K as formatRepliesCell, Kn as setFunctionRoute, Kt as getMemory, L as sleep$3, Ln as resendAgentSignupVerification, Lt as getCreditBalance, M as encodeReceivedAtSearchCursor, Mt as getAccessMode, N as fetchEmailSearchPage, Nn as redeemCreditCode, Nt as getAccount, O as waitOutRetryAfter, On as pollCliLogin, Ot as downloadEmailAttachmentByFilename, P as filtersFromFlags, Pn as removeDefaultNetworkMember, Pt as getAgentContactPolicy, Q as AUTOMATED_FLAG_DESCRIPTION, Qn as startCliLogin, Qt as getSentEmail, R as AWAITING_FLAG_DESCRIPTION, Rn as revokeCredential, Rt as getDefaultNetworkAgent, S as describeApiFailure, Sn as listRoutes, T as retryTransient, Tn as listWakeAuthorizations, Tt as deleteWakeAuthorization, U as awaitingRejectedError, Un as searchMemories, Ut as getFunctionTestRunTrace, V as ReplyStateUnsupportedError, Vt as getFunction, W as ensureSearchReportsReplyState, Wn as semanticSearch, Wt as getInboxStatus, Xn as startAgentClaim, Xt as getRepeatingSend, Y as queryUsesAwaiting, Yn as simulateRoute, Yt as getOwnGrant, Z as AUTOMATED_FILTER_UNSUPPORTED_CODE, Zn as startAgentSignup, Zt as getSendFrom, _n as listKeys, _t as createKey, a as REPEAT_IDLE_MAX_MINUTES, an as listAgentContacts, ar as updateRepeatingSend, b as WaitDeadlineReached, bn as listRepeatingSends, bt as createWakeSchedule, cn as listDefaultNetworkAgents, cr as updateWakeSchedule, ct as addDefaultNetworkMember, d as parseRepeatTick, dn as listEmailAttachmentArchiveMembers, dr as whoami, dt as checkDefaultNetworkContactAdmission, en as getWakeSchedule, er as testFunction, et as AutomatedFilterUnsupportedError, f as preparePresenceAliveEmail, fn as listEmails, ft as checkSendability, g as isEmailReceivedEvent, gn as listGroups, gt as createFunction, hn as listFunctions, ht as createEndpoint, i as REPEAT_EVERY_MAX_MINUTES, ir as updateKey, j as cursorFromAcceptedRows, jt as downloadSentAttachmentByFilename, k as SINCE_VALUE_HELP, kn as pullWebhookEvent, l as parseInteractionEnvelope, ln as listDefaultNetworkMembers, lr as verifyAgentClaim, lt as cancelSentEmail, m as repeatStopCommand, mn as listFunctionLogs, mt as completeWebhookEvent, nn as leaveOrganization, nr as updateDefaultNetworkMember, nt as automatedRejectedError, o as REPEAT_MAX_SENDS_MAX, on as listAgentNetworks, or as updateRoute, ot as hasAutomatedVerdict, p as prepareSignalEmail, pn as listEndpoints, pt as cliLogout, q as hasReplyState, qn as setFunctionSecret, qt as getOrgRoutingTopology, rn as listActivityObjects, rr as updateFunction, s as buildRepeatStopBody, sr as updateWakeAuthorization, st as isAutomatedRejectedError, tr as unsetFunctionRoute, tt as assertAutomatedVerdict, u as parsePresenceEnvelope, un as listDomains, ur as verifyAgentSignup, ut as cancelSentEmailByIdempotencyKey, v as parseWebhookEvent, vn as listMailboxAccess, vt as createRoute, w as pauseForTransientFailure, wn as listSentEmails, wt as deleteRoute, x as backoffDelay, xn as listRoles, y as parseFromHeader, yn as listOrganizationPeople, yt as createWakeAuthorization, z as AWAITING_VALUES, zn as rotateKey, zt as getEmail } from "../repeats-Dj_o6c-X-CK1wU9lP.js";
6
- import { C as installedVersion, S as installedConnectSkillFile, T as readBundledSkill, _ as NotificationOutcomeUnknownError, a as NotificationRetryError, b as connectSkillTarget, 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 CONNECT_SKILL_NAME, w as readBundledConnectSkill, x as installSkill, y as bundledSkillNames } from "../notify-session-CM4_ZYe9.js";
6
+ import { C as installedVersion, S as installedConnectSkillFile, T as readBundledSkill, _ as NotificationOutcomeUnknownError, a as NotificationRetryError, b as connectSkillTarget, 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 CONNECT_SKILL_NAME, w as readBundledConnectSkill, x as installSkill, y as bundledSkillNames } from "../notify-session-qbfowlNN.js";
7
7
  import { $ as agentPassMetadata, A as removeCliLockState, B as agentProfileDirectory, D as CliAuthLockedError, E as saveSignupCredentials, F as loadChatConversationByLocalId, G as loadConnectedAgentProfile, H as agentProfilesDirectory, I as saveActiveChatState, L as AGENT_ADDRESS_ENV, M as chatStatePath, N as deleteChatState, O as parseUnlockDurationSeconds, P as loadActiveChatState, Q as AgentPassAuthError, R as AGENT_PROFILE_ENV, S as loadCliCredentials, T as saveCliCredentials, V as agentProfileName, Y as requireDefaultLoginProfile, Z as AGENT_PASS_PROFILE_ENV, _ as credentialsPath, a as normalizeCliEnvironmentName, at as parseAccessPassInput, b as detectPrimitiveKeyEnvMisname, c as removeCliEnvironment, ct as revokeAccessPassRemote, d as upsertCliEnvironment, dt as detectAgentRuntime, et as agentPassTokenSha256, ft as detectRuntimeSession, g as credentialsLockPath, h as cliAccessTokenExpiresAt, i as loadCliConfig, it as loadCachedAgentPassByToken, j as writeCliLockState, k as readCliLockState, l as resolveConfigEnvironment, lt as saveAgentPass, m as acquireCliCredentialsLock, mt as PrimitiveApiClient, n as deleteCliConfig, nt as deleteAgentPass, o as parseHeaderAssignment, ot as readAgentPassFile, pt as runtimeSessionVariableList, r as emptyCliConfig, s as redactCliEnvironment, st as resolveAgentPassSlot, tt as claimAccessPassRemote, u as saveCliConfig, ut as syncAgentPassMetadataFromGrant, v as deleteCliCredentials, w as resolveCliAuth, x as hasStoredCliLogin, y as deleteCliCredentialsLock, z as AgentConnectionSetupError } from "../cli-config-CwZJQIcn.js";
8
8
  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";
9
- 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-1utuweTi.js";
9
+ 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-Bh5Bh4tf.js";
10
10
  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-DN0qj4AY.js";
11
11
  import { autoSignalEligible, dispatchAutoRead, dispatchAutoWorking, haltAutoWorking, isSentSignal, readWorkingLease, restoreAutoWorking } from "./auto-signals.js";
12
- 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-D4ZIidPX.js";
12
+ 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-DvIH9E_B.js";
13
13
  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";
14
14
  import { ORG_SELECTION_ENV } from "./global-org-flag.js";
15
15
  import { n as createConfig, t as createClient } from "../client.gen-6rZvmHfx.js";
@@ -7330,6 +7330,7 @@ var ConnectCommand = class ConnectCommand extends Command {
7330
7330
  this.log(JSON.stringify({
7331
7331
  status: "reused",
7332
7332
  pass: meta,
7333
+ skill_command: "primitive skill",
7333
7334
  revoke_command: revokeCommand
7334
7335
  }));
7335
7336
  return;
@@ -7339,6 +7340,7 @@ var ConnectCommand = class ConnectCommand extends Command {
7339
7340
  this.log(`Expires at: ${meta.expires_at}`);
7340
7341
  if (meta.slice_summary) this.log(`Scope: ${meta.slice_summary}`);
7341
7342
  if (meta.manage_url) this.log(`Manage / extend / promote: ${meta.manage_url}`);
7343
+ this.log("Live scoped skill: `primitive skill` (or `primitive skill install`)");
7342
7344
  this.log(`This pass expires automatically. Only run \`${revokeCommand}\` if explicitly asked to revoke access early.`);
7343
7345
  return;
7344
7346
  }
@@ -7378,6 +7380,7 @@ var ConnectCommand = class ConnectCommand extends Command {
7378
7380
  pass: meta,
7379
7381
  preview: claimed.preview,
7380
7382
  guide: claimed.guide,
7383
+ skill_command: "primitive skill",
7381
7384
  revoke_command: revokeCommand
7382
7385
  }));
7383
7386
  return;
@@ -7387,6 +7390,7 @@ var ConnectCommand = class ConnectCommand extends Command {
7387
7390
  this.log(`Expires at: ${meta.expires_at}`);
7388
7391
  if (meta.slice_summary) this.log(`Scope: ${meta.slice_summary}`);
7389
7392
  if (meta.manage_url) this.log(`Manage / extend / promote: ${meta.manage_url}`);
7393
+ this.log("Live scoped skill: `primitive skill` (or `primitive skill install`)");
7390
7394
  if (typeof claimed.guide === "string" && claimed.guide.trim()) {
7391
7395
  this.log("");
7392
7396
  this.log(claimed.guide.trim());
@@ -8919,19 +8923,28 @@ async function callActivityApi(options) {
8919
8923
  if (!response.ok) {
8920
8924
  let message = `Primitive API returned HTTP ${response.status}.`;
8921
8925
  let code;
8926
+ let details;
8922
8927
  try {
8923
8928
  const parsed = JSON.parse(rawText);
8924
8929
  code = parsed.error?.code;
8925
8930
  if (parsed.error?.message) message = parsed.error.message;
8931
+ if (parsed.error?.details && typeof parsed.error.details === "object") details = parsed.error.details;
8926
8932
  } catch {
8927
8933
  const sanitized = sanitizeErrorText(rawText);
8928
8934
  if (sanitized) message = sanitized;
8929
8935
  }
8936
+ const existingActivity = details?.activity && typeof details.activity === "object" ? details.activity : null;
8937
+ const conflictMetaParts = [];
8938
+ if (existingActivity?.started_at) conflictMetaParts.push(`started ${existingActivity.started_at}`);
8939
+ if (existingActivity?.claim_expires_at) conflictMetaParts.push(`claim expires ${existingActivity.claim_expires_at}`);
8940
+ const conflictSummary = response.status === 409 && existingActivity ? ` Existing activity ${existingActivity.id ?? "unknown"} [${existingActivity.status ?? "unknown"}] rev ${existingActivity.revision ?? "?"}${conflictMetaParts.length > 0 ? ` (${conflictMetaParts.join(", ")})` : ""}.` : "";
8930
8941
  const hint = code === "grant_forbidden" ? " Check whether this credential holds mail.activity:read / mail.activity:write." : code === "access_reason_required" ? " Pass --reason \"...\" or set PRIMITIVE_REASON." : code === "feature_not_enabled" ? " Mail activity tracking is not enabled for this organization." : code === "activity_header_invalid" ? " Check --reason / PRIMITIVE_REASON (1-500 printable ASCII) and --run-id / PRIMITIVE_RUN_ID ([A-Za-z0-9._:/-], 1-128 chars)." : "";
8931
- throw new Errors.CLIError(`${message}${hint}`, {
8942
+ const cliErr = new Errors.CLIError(`${message}${conflictSummary}${hint}`, {
8932
8943
  exit: 1,
8933
8944
  ...code ? { code } : {}
8934
8945
  });
8946
+ if (details) cliErr.details = details;
8947
+ throw cliErr;
8935
8948
  }
8936
8949
  if (options.rawText) return {
8937
8950
  data: void 0,
@@ -11822,8 +11835,8 @@ const PRIMITIVE_TEAM_AUTHOR = {
11822
11835
  name: "Primitive Team",
11823
11836
  url: "https://primitive.dev"
11824
11837
  };
11825
- const SDK_VERSION_RANGE = "^3.0.0-preview.26";
11826
- const CLI_VERSION_RANGE = "^3.0.0-preview.26";
11838
+ const SDK_VERSION_RANGE = "^3.0.0-preview.28";
11839
+ const CLI_VERSION_RANGE = "^3.0.0-preview.28";
11827
11840
  const ESBUILD_VERSION_RANGE = "^0.27.0";
11828
11841
  function renderHandler() {
11829
11842
  return `// env.PRIMITIVE_API_KEY, env.PRIMITIVE_WEBHOOK_SECRET, and
@@ -14858,6 +14871,7 @@ var WhoamiCommand = class WhoamiCommand extends Command {
14858
14871
  auth_method: "agent_pass",
14859
14872
  pass,
14860
14873
  grant,
14874
+ skill_command: "primitive skill",
14861
14875
  revoke_command: revokeCommand
14862
14876
  }, null, 2));
14863
14877
  return;
@@ -14870,6 +14884,7 @@ var WhoamiCommand = class WhoamiCommand extends Command {
14870
14884
  if (pass.slice_summary) lines.push(`Scope: ${pass.slice_summary}`);
14871
14885
  if (pass.manage_url) lines.push(`Manage / extend / promote: ${pass.manage_url}`);
14872
14886
  if (perms.length > 0) lines.push(`Permissions: ${perms.join(", ")}`);
14887
+ lines.push("Live scoped skill: `primitive skill`");
14873
14888
  lines.push(`Disconnect and revoke: ${revokeCommand}`);
14874
14889
  this.log(lines.join("\n"));
14875
14890
  return;
@@ -21659,8 +21674,8 @@ const COMMON_API_FLAGS = {
21659
21674
  };
21660
21675
  var ActivityLogCommand = class ActivityLogCommand extends Command {
21661
21676
  static summary = "Log an agent work note, external action outcome, or handoff";
21662
- static description = "Record structured work on a Primitive email or thread so humans and other agents see what already happened. Supply a deterministic --idempotency-key per (thread, action) so retries update the same entry cleanly.";
21663
- static examples = [`<%= config.bin %> activity log --email <email-id> --action brex.upload_invoice --status succeeded --summary "Uploaded Acme invoice #412 to Brex" --ref-system brex --ref-id inv_412 --idempotency-key brex.upload_invoice:v1`, `<%= config.bin %> activity log --thread <thread-id> --kind handoff --status needs_review --summary "Personal invoice detected; needs confirmation"`];
21677
+ static description = "Record structured work on a Primitive email or thread so humans and other agents see what already happened. Without --idempotency-key every call appends a new row. With --idempotency-key (scoped per thread and actor), retries update in place; add --if-absent and --claim-ttl to atomically claim work across replicas.";
21678
+ static examples = [`<%= config.bin %> activity log --email <email-id> --action brex.upload_invoice --status started --summary "Uploading Acme invoice #412 to Brex" --idempotency-key brex.upload_invoice:<email-id> --if-absent --claim-ttl 300`, `<%= config.bin %> activity log --thread <thread-id> --kind handoff --action brex.review_receipt --status needs_review --summary "Personal invoice detected; needs confirmation"`];
21664
21679
  static args = { summary: Args.string({
21665
21680
  description: "Optional positional summary (alternative to --summary)",
21666
21681
  required: false
@@ -21699,7 +21714,9 @@ var ActivityLogCommand = class ActivityLogCommand extends Command {
21699
21714
  env: "PRIMITIVE_RUN_ID"
21700
21715
  }),
21701
21716
  "trace-url": Flags.string({ description: "Optional https:// URL to the agent execution trace" }),
21702
- "idempotency-key": Flags.string({ description: "Deterministic key per (thread, action) so retries upsert in place" }),
21717
+ "idempotency-key": Flags.string({ description: "Optional key scoped per (thread, actor). Reusing it updates in place; omit to append a new row" }),
21718
+ "if-absent": Flags.boolean({ description: "With --idempotency-key: atomically create only if no active/completed activity exists (takes over expired started claims; otherwise exits with 409 conflict)" }),
21719
+ "claim-ttl": Flags.integer({ description: "Claim lease TTL in seconds (1 to 86400) for status=started entries; after expiry, another replica can take over via --if-absent" }),
21703
21720
  visibility: Flags.string({
21704
21721
  description: "Visibility: thread (default, shared) or actor_only (private)",
21705
21722
  options: [...ACTIVITY_VISIBILITIES]
@@ -21719,6 +21736,8 @@ var ActivityLogCommand = class ActivityLogCommand extends Command {
21719
21736
  const sentEmailId = flags["sent-email"] !== void 0 ? assertUuid(flags["sent-email"], "--sent-email") : void 0;
21720
21737
  if (flags.action !== void 0 && !ACTION_SLUG_RE.test(flags.action.trim())) throw new Errors.CLIError("--action must start with a lowercase letter or digit and use only a-z, 0-9, ., _, :, - (max 128 chars).", { exit: 2 });
21721
21738
  if (flags["idempotency-key"] !== void 0 && !IDEMPOTENCY_KEY_RE.test(flags["idempotency-key"].trim())) throw new Errors.CLIError("--idempotency-key must be 1 to 255 printable ASCII characters without spaces.", { exit: 2 });
21739
+ if (flags["if-absent"] && !flags["idempotency-key"]?.trim()) throw new Errors.CLIError("--if-absent requires --idempotency-key <key>.", { exit: 2 });
21740
+ if (flags["claim-ttl"] !== void 0 && (flags["claim-ttl"] < 1 || flags["claim-ttl"] > 86400)) throw new Errors.CLIError("--claim-ttl must be an integer between 1 and 86400 seconds.", { exit: 2 });
21722
21741
  const detail = flags["detail-file"] !== void 0 ? readUtf8File(flags["detail-file"], "--detail-file") : flags.detail;
21723
21742
  if (detail !== void 0 && detail.length > 8e3) throw new Errors.CLIError("Detail must be at most 8000 characters.", { exit: 2 });
21724
21743
  const data = flags["data-file"] !== void 0 ? parseJsonObjectFlag(readUtf8File(flags["data-file"], "--data-file"), "--data-file") : flags.data !== void 0 ? parseJsonObjectFlag(flags.data, "--data") : void 0;
@@ -21737,6 +21756,8 @@ var ActivityLogCommand = class ActivityLogCommand extends Command {
21737
21756
  ...runId ? { run_id: runId } : {},
21738
21757
  ...traceUrl ? { trace_url: traceUrl } : {},
21739
21758
  ...flags["idempotency-key"] ? { idempotency_key: flags["idempotency-key"].trim() } : {},
21759
+ ...flags["if-absent"] ? { if_absent: true } : {},
21760
+ ...flags["claim-ttl"] !== void 0 ? { claim_ttl_seconds: flags["claim-ttl"] } : {},
21740
21761
  ...flags.visibility ? { visibility: flags.visibility } : {}
21741
21762
  };
21742
21763
  const path = threadId ? `/threads/${threadId}/activities` : `/emails/${emailId}/activities`;
@@ -21800,6 +21821,9 @@ var ActivityUpdateCommand = class ActivityUpdateCommand extends Command {
21800
21821
  description: "Updated visibility: thread or actor_only",
21801
21822
  options: [...ACTIVITY_VISIBILITIES]
21802
21823
  }),
21824
+ "claim-ttl": Flags.integer({ description: "Updated claim lease TTL in seconds (1 to 86400) when status is started" }),
21825
+ "clear-claim-ttl": Flags.boolean({ description: "Clear claim_expires_at (sets null)" }),
21826
+ "if-revision": Flags.integer({ description: "Expected current revision for compare-and-set updates (exits with 409 conflict if modified since)" }),
21803
21827
  ...COMMON_API_FLAGS
21804
21828
  };
21805
21829
  async run() {
@@ -21838,7 +21862,17 @@ var ActivityUpdateCommand = class ActivityUpdateCommand extends Command {
21838
21862
  if (flags["clear-trace-url"]) body.trace_url = null;
21839
21863
  else if (flags["trace-url"] !== void 0) body.trace_url = assertHttpUrl(flags["trace-url"], "--trace-url");
21840
21864
  if (flags.visibility) body.visibility = flags.visibility;
21865
+ if (flags["clear-claim-ttl"] && flags["claim-ttl"] !== void 0) throw new Errors.CLIError("--clear-claim-ttl cannot be combined with --claim-ttl.", { exit: 2 });
21866
+ if (flags["clear-claim-ttl"]) body.claim_ttl_seconds = null;
21867
+ else if (flags["claim-ttl"] !== void 0) {
21868
+ if (flags["claim-ttl"] < 1 || flags["claim-ttl"] > 86400) throw new Errors.CLIError("--claim-ttl must be an integer between 1 and 86400 seconds.", { exit: 2 });
21869
+ body.claim_ttl_seconds = flags["claim-ttl"];
21870
+ }
21841
21871
  if (Object.keys(body).length === 0) throw new Errors.CLIError("Provide at least one field to update.", { exit: 2 });
21872
+ if (flags["if-revision"] !== void 0) {
21873
+ if (flags["if-revision"] < 1) throw new Errors.CLIError("--if-revision must be at least 1.", { exit: 2 });
21874
+ body.if_revision = flags["if-revision"];
21875
+ }
21842
21876
  await runWithTiming(flags.time === true, async () => {
21843
21877
  const result = await callActivityApi({
21844
21878
  configDir: this.config.configDir,
@@ -1,6 +1,6 @@
1
1
  import { B as agentProfileDirectory, G as loadConnectedAgentProfile, R as AGENT_PROFILE_ENV, V as agentProfileName, dt as detectAgentRuntime } from "../cli-config-CwZJQIcn.js";
2
2
  import { a as backgroundListenStatus, i as backgroundListenRestartable, s as claimBackgroundListenRestart, t as BACKGROUND_LISTEN_RELAUNCH_ENV } from "../listen-background-DyBYca28.js";
3
- import { d as SESSION_UUID, t as notificationScope } from "../notify-session-CM4_ZYe9.js";
3
+ import { d as SESSION_UUID, t as notificationScope } from "../notify-session-qbfowlNN.js";
4
4
  import { d as readMailJson } from "../shared-mail-files-BAQSGxxz.js";
5
5
  import { join } from "node:path";
6
6
  import { spawn } from "node:child_process";
@@ -1,5 +1,5 @@
1
1
  import { Gn as sendEmail, S as describeApiFailure, h as sendPreparedSignal, ht as createEndpoint, p as prepareSignalEmail, wn as listSentEmails, zt as getEmail } from "./repeats-Dj_o6c-X-CK1wU9lP.js";
2
- import { A as bareAddress, Dt as successfulSendOutcome, c as extractErrorPayload, ut as classifySendError } from "./api-command-B-nuABGm.js";
2
+ import { A as bareAddress, Dt as successfulSendOutcome, c as extractErrorPayload, ut as classifySendError } from "./api-command-DSfZl8fj.js";
3
3
  import { recordSentSignal } from "./oclif/auto-signals.js";
4
4
  import { _ as acquireListenLock, c as mailTime, d as readMailJson, f as removeMailFile, h as writeMailJson, i as mailId, l as privateMailDirectory, m as withMailLock, n as invalidSharedMail, o as mailObject, p as syncMailDirectory, r as mailAddress, s as mailString, t as SharedMailStateError, v as compareListenProcessIdentity, x as listenProcessIdentity, y as listenIdentity } from "./shared-mail-files-BAQSGxxz.js";
5
5
  import { i as readApiBeforeDeadline, n as isPlainChatReply, o as scopedChatSenderTrust } from "./scoped-chat-DN0qj4AY.js";
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: primitive-connect
3
- description: Load before any primitive command or Primitive mail work, including in a session that is already connected. You have your own email address and it is your identity with people, services and other agents. Covers sending, replying, waiting for an answer or for an external service's sign-up verification code or link, reading and searching mail, --fyi acknowledgements, automatic signals, work claims, thread muting and peer agents, plus connecting this agent from a copied setup instruction (npx -y primitive@latest agent connect) or over the HTTP API without a terminal.
3
+ description: Load before any primitive command or Primitive mail work, including in a session that is already connected or using a temporary Access Pass. Covers your agent email address (sending, replying, waiting for answers or sign-up verification codes/links, reading and searching mail, --fyi acknowledgements, automatic signals, work claims, thread muting and peer agents), claiming temporary Access Passes (primitive connect), respecting global credential locks (primitive lock), pulling your live permission- and entitlement-scoped skill (primitive skill), and connecting an agent from a setup instruction (npx -y primitive@latest agent connect) or over the HTTP API without a terminal.
4
4
  ---
5
5
 
6
6
  # Your email address
@@ -26,6 +26,7 @@ session](#connect-this-session). Never send as your owner's own login instead.
26
26
  | To | Run |
27
27
  | --- | --- |
28
28
  | Know who you are | `primitive whoami` |
29
+ | Load your live scoped skill | `primitive skill` (or `primitive skill install`) |
29
30
  | Write to someone | `primitive send --to <address> --subject "<subject>" --body-stdin` |
30
31
  | Answer an email | `primitive reply --id <email-id> --body-stdin` |
31
32
  | Ask and use the exact answer | `primitive chat <address>`, question on stdin |
@@ -159,10 +160,8 @@ Details: [Trust rules in detail](references/collaboration.md#trust-rules-in-deta
159
160
 
160
161
  ## Connect this session
161
162
 
162
- Skip this in a hook-registered Claude Code session: it is already connected. When the owner
163
- pastes a setup instruction from the Primitive app, that request authorizes the
164
- connection; do not ask again. Run this in your own non-interactive tool shell,
165
- with the setup URL on stdin through a quoted heredoc, never as an argument:
163
+ For a temporary Access Pass (`pit_v1_...`), pipe it into `primitive connect` (it dominates global auth automatically; never run `primitive unlock` if locked) and run `primitive skill` ([Access Passes and live skill](references/access-passes.md)).
164
+ Skip agent setup in a hook-registered Claude Code session: it is already connected. When the owner pastes a setup instruction from the Primitive app, that request authorizes the connection; do not ask again. Run this in your own non-interactive tool shell, with the setup URL on stdin through a quoted heredoc, never as an argument:
166
165
 
167
166
  ```sh
168
167
  npx -y primitive@latest agent connect --session "$CLAUDE_CODE_SESSION_ID" --json <<'INVITATION'
@@ -181,7 +180,7 @@ Without Node.js 22 or a terminal: [HTTP API path](references/manual-setup.md#con
181
180
  Read the one a task needs. Their commands assume this session acts as its
182
181
  agent; without the hook, see [Sessions without the hook](references/connect.md#sessions-without-the-hook).
183
182
 
184
- - Identity: [connect and manage](references/connect.md), [external services](references/external-services.md)
183
+ - Identity: [connect and manage](references/connect.md), [access passes and live skill](references/access-passes.md), [external services](references/external-services.md)
185
184
  - Mail: [conversations](references/conversations.md), [collaboration](references/collaboration.md), [contacts](references/contacts.md), [first contact](references/contact-requests.md)
186
185
  - Receiving: [presence](references/presence-and-receiving.md), [native sessions](references/native-session.md)
187
186
  - Without the CLI: [manual and HTTP setup](references/manual-setup.md), [HTTP helper](references/private-api-fallback.md), [mail helpers](references/communication.md)
@@ -0,0 +1,32 @@
1
+ # Temporary Access Passes and Live Scoped Skill
2
+
3
+ ## Claiming a temporary Access Pass
4
+
5
+ When a user shares a temporary Access Pass URL (`https://api.primitive.dev/v1/access/pit_v1_...`) or `pit_v1_...` token, claim it through stdin so the secret stays out of process listings:
6
+
7
+ ```sh
8
+ printf '%s' '<pass-url-or-token>' | primitive connect
9
+ ```
10
+
11
+ - An active Access Pass binds to this agent session (auto-detecting `PRIMITIVE_SESSION_ID`, Claude Code, Codex, Antigravity, Cursor, Windsurf, Gemini CLI, OpenCode, and similar harnesses, or `--profile <name>`) and automatically dominates any global CLI login (`credentials.json`) or ambient `PRIMITIVE_API_KEY`.
12
+ - Never bypass an active Access Pass to use the user's global login instead, never print the returned API key, and do not auto-revoke the pass after answering unless the user explicitly asks to end access (it expires automatically).
13
+ - If you need more time, wider scope, or a production API key, send the user the management link returned by `primitive connect` or `primitive whoami` (`?action=extend&add=4h`, `?action=expand`, or `?action=promote`).
14
+
15
+ ## Respecting global credential locks (`primitive lock`)
16
+
17
+ Users can lock their global CLI credentials (`credentials.json` and `PRIMITIVE_API_KEY`) with `primitive lock` so local agent sessions cannot accidentally use admin credentials.
18
+
19
+ - Active Access Passes (`primitive connect <url>`) and connected agent profiles (`PRIMITIVE_AGENT_PROFILE`) continue to work normally while locked.
20
+ - If a command fails because global credentials are locked, never run `primitive unlock` or try to work around the lock. Ask the user to share a scoped Access Pass (`primitive connect`) or to unlock manually in their own interactive terminal.
21
+
22
+ ## Loading your live permission- and entitlement-scoped skill
23
+
24
+ After connecting (with an Access Pass, connected agent profile, or API key), pull the live skill document tailored to your exact active permissions and organization entitlements:
25
+
26
+ ```sh
27
+ primitive skill # print live scoped SKILL.md to stdout
28
+ primitive skill install # write into local agent skill directories
29
+ primitive skill --check # exits 0 if fresh, 2 if stale
30
+ ```
31
+
32
+ The live skill only includes capabilities both your credential and the organization permit (such as staged reply and standalone drafts, email rules, mail activity coordination, or semantic search). Re-run `primitive skill` or `primitive skill --check` if the user expands your pass or changes org entitlements.
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "primitive-connect",
3
- "version": "a2e1e9de1cb60b4c",
3
+ "version": "c1133484268300c5",
4
4
  "source": {
5
5
  "repository": "https://github.com/primitivedotdev/skills",
6
6
  "path": "skills/primitive-connect",
7
- "commit": "a178a469ed1310b58bf4f5ce2a15c17c30799edc"
7
+ "commit": "03032d11695af6642d7cb1e0ddd7ae4d954c3ca0"
8
8
  },
9
9
  "files": {
10
- "SKILL.md": "37d40b66010319c6a176bc8eb66affd93cab0968c609ad523dac087d3077d29d",
10
+ "SKILL.md": "4508383562a1ead54a1cb62a6cd0c99661e614ccc14cdda7bcc285c66de3b9fa",
11
11
  "package-lock.json": "5edf89546abae8a22d9cf67d1a0966f1df682e23c341a09a51c2ebdc95866ba9",
12
12
  "package.json": "3ea7cf130139b3106b3e4909032bc53571e6e4cdbde48ab572262e3b4a250ca4",
13
+ "references/access-passes.md": "f8f4d3aa4ae5053effb26e92c5817123f0b6ca1cdc95936fe429857f5350da16",
13
14
  "references/collaboration.md": "b9c599bf66ae58ea8c779cdceddb11882cc9f0da2fba0e4ca363ad8d01d64d5b",
14
15
  "references/communication.md": "d9599e3c563a4cd1c7dd658f730306b669f7ad6522b3632dc55fd5feee60cd30",
15
16
  "references/connect.md": "46d3e62e6b021100a0ddf84269bcb59a1725a3da4e360c797f378ce13cf5c4ec",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primcli",
3
- "version": "3.0.0-preview.26",
3
+ "version": "3.0.0-preview.28",
4
4
  "publishConfig": {
5
5
  "tag": "preview"
6
6
  },