primcli 3.0.0-preview.23 → 3.0.0-preview.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { F as agentProfileName, M as AGENT_PROFILE_ENV, P as agentProfileDirectory, at as detectAgentRuntime, z as loadConnectedAgentProfile } from "../cli-config-DUQEYQ42.js";
1
+ import { F as agentProfileName, M as AGENT_PROFILE_ENV, P as agentProfileDirectory, at as detectAgentRuntime, z as loadConnectedAgentProfile } from "../cli-config-D2MU7PiU.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-Dx54UpkT.js";
3
+ import { d as SESSION_UUID, t as notificationScope } from "../notify-session-DrgOcIT6.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,4 +1,4 @@
1
- import { S as normalizeApiBaseUrl, i as loadCliConfig, l as resolveConfigEnvironment } from "../cli-config-DUQEYQ42.js";
1
+ import { S as normalizeApiBaseUrl, i as loadCliConfig, l as resolveConfigEnvironment } from "../cli-config-D2MU7PiU.js";
2
2
  import { existsSync, readFileSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  import { homedir } from "node:os";
@@ -65,6 +65,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
65
65
  createAgentAccount: () => createAgentAccount,
66
66
  createAgentClaimLink: () => createAgentClaimLink,
67
67
  createAgentConnection: () => createAgentConnection,
68
+ createEmailActivity: () => createEmailActivity,
68
69
  createEmailRule: () => createEmailRule,
69
70
  createEmailRuleObjection: () => createEmailRuleObjection,
70
71
  createEmailRuleRequest: () => createEmailRuleRequest,
@@ -78,6 +79,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
78
79
  createProject: () => createProject,
79
80
  createRole: () => createRole,
80
81
  createRoute: () => createRoute,
82
+ createThreadActivity: () => createThreadActivity,
81
83
  createWakeAuthorization: () => createWakeAuthorization,
82
84
  createWakeSchedule: () => createWakeSchedule,
83
85
  decideAccessMode: () => decideAccessMode,
@@ -183,6 +185,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
183
185
  getTemplate: () => getTemplate,
184
186
  getTemplateInstall: () => getTemplateInstall,
185
187
  getThread: () => getThread,
188
+ getThreadTimeline: () => getThreadTimeline,
186
189
  getWakeSchedule: () => getWakeSchedule,
187
190
  getWebhookDeliveryStats: () => getWebhookDeliveryStats,
188
191
  getWebhookSecret: () => getWebhookSecret,
@@ -235,6 +238,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
235
238
  listGroups: () => listGroups,
236
239
  listInteractions: () => listInteractions,
237
240
  listKeys: () => listKeys,
241
+ listMailActivityActors: () => listMailActivityActors,
238
242
  listMailRouting: () => listMailRouting,
239
243
  listMailTopicEdits: () => listMailTopicEdits,
240
244
  listMailTopicGenerations: () => listMailTopicGenerations,
@@ -242,6 +246,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
242
246
  listMutedThreads: () => listMutedThreads,
243
247
  listMyGrants: () => listMyGrants,
244
248
  listOAuthGrants: () => listOAuthGrants,
249
+ listOrgMailActivity: () => listOrgMailActivity,
245
250
  listOrgSecrets: () => listOrgSecrets,
246
251
  listOrganizationInvitations: () => listOrganizationInvitations,
247
252
  listOrganizationPeople: () => listOrganizationPeople,
@@ -364,6 +369,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
364
369
  updateRole: () => updateRole,
365
370
  updateRoute: () => updateRoute,
366
371
  updateSearchSettings: () => updateSearchSettings,
372
+ updateThreadActivity: () => updateThreadActivity,
367
373
  updateWakeAuthorization: () => updateWakeAuthorization,
368
374
  updateWakeSchedule: () => updateWakeSchedule,
369
375
  verifyAgentClaim: () => verifyAgentClaim,
@@ -5984,6 +5990,128 @@ const sendMailBatch = (options) => (options.client ?? client).post({
5984
5990
  ...options.headers
5985
5991
  }
5986
5992
  });
5993
+ /**
5994
+ * Record or upsert an agent work activity on a thread
5995
+ *
5996
+ * Records an agent-reported note, external action outcome (such as
5997
+ * uploading an invoice to Brex or creating a CRM record), or human
5998
+ * handoff on a thread. Supplying `idempotency_key` (or an
5999
+ * `Idempotency-Key` header) upserts the calling actor's existing
6000
+ * activity on that thread in place, advancing `revision` and appending
6001
+ * to `status_history`. Requires `mail.activity:write` and mail scope
6002
+ * covering the thread.
6003
+ *
6004
+ */
6005
+ const createThreadActivity = (options) => (options.client ?? client).post({
6006
+ security: [{
6007
+ scheme: "bearer",
6008
+ type: "http"
6009
+ }],
6010
+ url: "/threads/{id}/activities",
6011
+ ...options,
6012
+ headers: {
6013
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
6014
+ ...options.headers
6015
+ }
6016
+ });
6017
+ /**
6018
+ * Record or upsert an agent work activity anchored to an inbound email
6019
+ *
6020
+ * Convenience alias for `POST /v1/threads/{id}/activities` that resolves
6021
+ * the thread from an inbound email id and anchors the activity to both
6022
+ * the thread and that email. Requires `mail.activity:write` and mail
6023
+ * scope covering the email.
6024
+ *
6025
+ */
6026
+ const createEmailActivity = (options) => (options.client ?? client).post({
6027
+ security: [{
6028
+ scheme: "bearer",
6029
+ type: "http"
6030
+ }],
6031
+ url: "/emails/{id}/activities",
6032
+ ...options,
6033
+ headers: {
6034
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
6035
+ ...options.headers
6036
+ }
6037
+ });
6038
+ /**
6039
+ * Update an existing thread activity
6040
+ *
6041
+ * Updates the status, summary, detail, external_ref, data, run_id,
6042
+ * trace_url, or visibility of a thread activity. The creating actor may
6043
+ * update any field; an organization member with `mail.activity:write`
6044
+ * covering the thread may resolve a `needs_review` or `handoff` activity.
6045
+ *
6046
+ */
6047
+ const updateThreadActivity = (options) => (options.client ?? client).patch({
6048
+ security: [{
6049
+ scheme: "bearer",
6050
+ type: "http"
6051
+ }],
6052
+ url: "/threads/{id}/activities/{activity_id}",
6053
+ ...options,
6054
+ headers: {
6055
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
6056
+ ...options.headers
6057
+ }
6058
+ });
6059
+ /**
6060
+ * Read the unified timeline of verified mail actions and agent work on a thread
6061
+ *
6062
+ * Returns a cursor-paginated timeline for a thread combining
6063
+ * system-verified Primitive actions (`source: "primitive"`, such as
6064
+ * `email.read`, `email.replied`, `email.sent`, `email.attachment_read`,
6065
+ * along with any `X-Primitive-Reason` and `X-Primitive-Run-Id` headers)
6066
+ * and agent-reported work records (`source: "agent"`). Strictly filtered
6067
+ * by the caller's mail scope; `actor_only` activities are hidden from
6068
+ * other callers unless `include_private=true` is passed with
6069
+ * `activity:read`.
6070
+ *
6071
+ */
6072
+ const getThreadTimeline = (options) => (options.client ?? client).get({
6073
+ security: [{
6074
+ scheme: "bearer",
6075
+ type: "http"
6076
+ }],
6077
+ url: "/threads/{id}/timeline",
6078
+ ...options
6079
+ });
6080
+ /**
6081
+ * Search verified mail actions and agent work across the organization
6082
+ *
6083
+ * Returns a cursor-paginated feed (JSON by default, or CSV when
6084
+ * `format=csv`) of verified Primitive mail actions and agent-reported
6085
+ * thread activities across all threads within the caller's mail scope.
6086
+ * Filter by actor, human owner of a key or personal agent, OAuth client,
6087
+ * action, status, run_id, or time window.
6088
+ *
6089
+ */
6090
+ const listOrgMailActivity = (options) => (options?.client ?? client).get({
6091
+ security: [{
6092
+ scheme: "bearer",
6093
+ type: "http"
6094
+ }],
6095
+ url: "/activity/mail",
6096
+ ...options
6097
+ });
6098
+ /**
6099
+ * List deployed agents, keys, functions, and apps with mail activity rollups
6100
+ *
6101
+ * Returns per-actor rollups (threads touched, verified mail actions, and
6102
+ * agent work outcomes by status) for every agent, API key, Function,
6103
+ * connected app, or member that touched mail within the caller's mail
6104
+ * scope. Requires `mail.activity:read`.
6105
+ *
6106
+ */
6107
+ const listMailActivityActors = (options) => (options?.client ?? client).get({
6108
+ security: [{
6109
+ scheme: "bearer",
6110
+ type: "http"
6111
+ }],
6112
+ url: "/activity/mail/actors",
6113
+ ...options
6114
+ });
5987
6115
  // src/oclif/automated-filter.ts
5988
6116
  /**
5989
6117
  * The server-side `automated` verdict on inbound email: `automated`
@@ -1,4 +1,4 @@
1
- import { T as retryTransient, _ as isTrustedSender, c as classifySignalContent } from "./repeats-Dj_o6c-X-x61TNLz-.js";
1
+ import { T as retryTransient, _ as isTrustedSender, c as classifySignalContent } from "./repeats-Dj_o6c-X-CK1wU9lP.js";
2
2
  // src/oclif/presence-provenance.ts
3
3
  function readPresenceProjection(detail) {
4
4
  if (!detail || typeof detail !== "object") return null;
@@ -1,15 +1,15 @@
1
- import { 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-x61TNLz-.js";
2
- import { Et as successfulSendOutcome, k as bareAddress, lt as classifySendError, s as extractErrorPayload } from "./api-command-CP8ir5Pv.js";
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 { Et as successfulSendOutcome, k as bareAddress, lt as classifySendError, s as extractErrorPayload } from "./api-command-DhY2wrh5.js";
3
3
  import { recordSentSignal } from "./oclif/auto-signals.js";
4
4
  import { _ as acquireListenLock, c as mailTime, d as readMailJson, f as removeMailFile, h as writeMailJson, i as mailId, l as privateMailDirectory, m as withMailLock, n as invalidSharedMail, o as mailObject, p as syncMailDirectory, r as mailAddress, s as mailString, t as SharedMailStateError, v as compareListenProcessIdentity, x as listenProcessIdentity, y as listenIdentity } from "./shared-mail-files-BAQSGxxz.js";
5
- import { i as readApiBeforeDeadline, n as isPlainChatReply, o as scopedChatSenderTrust } from "./scoped-chat-Bss3OjFI.js";
5
+ import { i as readApiBeforeDeadline, n as isPlainChatReply, o as scopedChatSenderTrust } from "./scoped-chat-DN0qj4AY.js";
6
6
  import { n as tryOwnSharedMail, r as waitForSharedMailChange, t as readSharedMailOwner } from "./shared-mail-watch-DdtgJOrV.js";
7
7
  import { Errors } from "@oclif/core";
8
8
  import { opendirSync } from "node:fs";
9
9
  import { createHash, randomUUID, scryptSync } from "node:crypto";
10
10
  import { dirname, join } from "node:path";
11
11
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
12
- // ../sdk-node/dist/api-DNVymWBY.js
12
+ // ../sdk-node/dist/api-sF0Y4T7Y.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": "3.0.0-preview.23",
3
+ "version": "3.0.0-preview.25",
4
4
  "publishConfig": {
5
5
  "tag": "preview"
6
6
  },
@@ -190,7 +190,7 @@
190
190
  "description": "Received and sent mail per hour, and how webhook deliveries ended"
191
191
  },
192
192
  "activity": {
193
- "description": "Where you learn what others asked of you and did to your mail: `primitive activity asked` (rule requests for your mail and objections to your rules), `primitive activity concerning` (other members' rules that started covering your mail or changed), and `primitive activity created` (what you created, including your requests and how they were decided)."
193
+ "description": "Where you learn what others asked of you and did to your mail (`primitive activity asked`, `primitive activity concerning`, `primitive activity created`), and record or inspect verified mail activity events and shared agent work logs (`primitive activity log`, `update`, `timeline`, `list`, `agents`)."
194
194
  },
195
195
  "email-rules": {
196
196
  "description": "Rules written in plain English that pick out received mail"
@@ -233,6 +233,9 @@
233
233
  },
234
234
  "agent:runtime": {
235
235
  "description": "One private line in the AGENT_RUNTIME address note saying where an agent runs and what it is, such as `Claude Code on my-laptop in app`. Use set to write it (a default is computed when --value is omitted) and get to read it; offer it to the owner before writing."
236
+ },
237
+ "skill": {
238
+ "description": "Fetch, verify, and install the live Primitive skill tailored to your credential's permissions, entitlements, and policies. Use `primitive skill` to print SKILL.md and `primitive skill install` to write it into local agent directories."
236
239
  }
237
240
  },
238
241
  "topicSeparator": " "