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

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,4 +1,4 @@
1
- import { $ as isTrustedSender, c as classifySignalContent, x as retryTransient } from "./repeats-Dj_o6c-X-BLUY-8zn.js";
1
+ import { T as retryTransient, _ as isTrustedSender, c as classifySignalContent } from "./repeats-Dj_o6c-X-b-Y0Ejun.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 { An as listSentEmails, Wt as getEmail, Zn as sendEmail, bt as createEndpoint, h as sendPreparedSignal, p as prepareSignalEmail, v as describeApiFailure } from "./repeats-Dj_o6c-X-BLUY-8zn.js";
2
- import { M as bareAddress, ft as classifySendError, kt as successfulSendOutcome, s as extractErrorPayload } from "./api-command-D1LX7Tjj.js";
1
+ import { Bt as getEmail, Gn as sendEmail, S as describeApiFailure, gt as createEndpoint, h as sendPreparedSignal, p as prepareSignalEmail, wn as listSentEmails } from "./repeats-Dj_o6c-X-b-Y0Ejun.js";
2
+ import { M as bareAddress, ft as classifySendError, kt as successfulSendOutcome, s as extractErrorPayload } from "./api-command-BlfqpBjp.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-CrQpmC0K.js";
5
+ import { i as readApiBeforeDeadline, n as isPlainChatReply, o as scopedChatSenderTrust } from "./scoped-chat-CaiJJRMA.js";
6
6
  import { n as tryOwnSharedMail, r as waitForSharedMailChange, t as readSharedMailOwner } from "./shared-mail-watch-BAPMsFNv.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-mtCxA8lC.js
12
+ // ../sdk-node/dist/api-BrSHlYS2.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;
@@ -1831,6 +1831,10 @@ async function openSharedMailStore(options) {
1831
1831
  /** The API's code for an account credential creating a pull subscription. */
1832
1832
  const AGENT_CONNECTION_REQUIRED = "pull_subscription_requires_agent_connection";
1833
1833
  const AGENT_CONNECTION_REQUIRED_MESSAGE = "primitive listen needs a connected agent credential, which limits the subscription to one address. Connect one with primitive agent connect and select its profile. With an account API key, watch mail with primitive emails watch or receive it at an HTTP webhook endpoint instead.";
1834
+ /** The API's code for a full API key that was revoked. */
1835
+ const KEY_REVOKED = "key_revoked";
1836
+ /** What a listener says when its agent's key was revoked: connect again, as signing in cannot bring it back. */
1837
+ const KEY_REVOKED_MESSAGE = "This agent's key was revoked, so it no longer works. Connect the agent again for a new one; signing in does not bring it back.";
1834
1838
  /** Connected-agent API keys are the only credentials that can create pull subscriptions. */
1835
1839
  function isConnectedAgentKey(apiKey) {
1836
1840
  return apiKey?.startsWith("pconn_") === true;
@@ -1855,7 +1859,9 @@ async function ensureSharedMailSubscription(options) {
1855
1859
  responseStyle: "fields"
1856
1860
  });
1857
1861
  if (result.error || !result.data?.data) {
1858
- if (result.error?.error?.code === "pull_subscription_requires_agent_connection") throw new EventReceiverError(AGENT_CONNECTION_REQUIRED_MESSAGE, AGENT_CONNECTION_REQUIRED, 403);
1862
+ const error = result.error;
1863
+ if (error?.error?.code === "pull_subscription_requires_agent_connection") throw new EventReceiverError(AGENT_CONNECTION_REQUIRED_MESSAGE, AGENT_CONNECTION_REQUIRED, 403);
1864
+ if (error?.error?.code === "key_revoked") throw new EventReceiverError(KEY_REVOKED_MESSAGE, KEY_REVOKED, 401);
1859
1865
  throw new EventReceiverError("Could not open the shared inbound subscription.", "subscription_failed", result.response?.status ?? 0);
1860
1866
  }
1861
1867
  const created = result.data.data;
@@ -2338,4 +2344,4 @@ async function sendSignal(context, options) {
2338
2344
  release();
2339
2345
  }
2340
2346
  }
2341
- export { ensureSharedMailSubscription as a, isConnectedAgentKey as c, reserveSharedMailSubscription as d, followEmailConversation as f, EventReceiverError as g, EventConnection as h, sharedMailScope as i, createSharedMailWaiter as l, otherParticipants as m, reconcileChatSend as n, AGENT_CONNECTION_REQUIRED as o, readConversationFollow as p, openSharedMailReceiver as r, AGENT_CONNECTION_REQUIRED_MESSAGE as s, sendSignal as t, openSharedMailStore as u };
2347
+ export { EventConnection as _, ensureSharedMailSubscription as a, KEY_REVOKED as c, createSharedMailWaiter as d, openSharedMailStore as f, otherParticipants as g, readConversationFollow as h, sharedMailScope as i, KEY_REVOKED_MESSAGE as l, followEmailConversation as m, reconcileChatSend as n, AGENT_CONNECTION_REQUIRED as o, reserveSharedMailSubscription as p, openSharedMailReceiver as r, AGENT_CONNECTION_REQUIRED_MESSAGE as s, sendSignal as t, isConnectedAgentKey as u, EventReceiverError as v };
package/man/primitive.1 CHANGED
@@ -35,17 +35,20 @@ array; a failure adds
35
35
  .B error
36
36
  and
37
37
  .BR exit_code .
38
- Generated API commands keep their usual stdout shape with
38
+ Generated API commands print the API's response body with
39
39
  .BR --json :
40
- the data payload only. They do not print the
41
- .B next cursor:
42
- line then; add
43
- .B --envelope
44
- to get the full response envelope, with the pagination cursor in
40
+ .BR data ,
41
+ and
42
+ .B meta
43
+ with the pagination cursor in
45
44
  .B meta.cursor
46
- and, in
47
- .BR summary ,
48
- empty-result hints and what a list's default filters left out.
45
+ where the route sends it, plus the CLI's own
46
+ .BR summary .
47
+ Without
48
+ .BR --json ,
49
+ stdout is the data payload and the
50
+ .B next cursor:
51
+ line goes to stderr.
49
52
  .B primitive listen
50
53
  streams JSONL and is not covered by this rule.
51
54
  .SH LOCAL WEBHOOK EVENTS
@@ -320,6 +323,11 @@ Manage the repeating sends you created.
320
323
  As the recipient, stop a repeat. ID is the repeat id from the message footer
321
324
  or the id of a received message of the repeat.
322
325
  .TP
326
+ .B primitive skills install [NAME] --runtime claude|codex
327
+ Install the skills bundled with this CLI, or only NAME, into the runtime's
328
+ skills folder (--project for the current directory's). A copy already at the
329
+ bundled version is left unchanged.
330
+ .TP
323
331
  .B primitive list-operations
324
332
  Print the generated API operation manifest.
325
333
  .TP
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitivedotdev/cli",
3
- "version": "3.0.0-preview.16",
3
+ "version": "3.0.0-preview.18",
4
4
  "publishConfig": {
5
5
  "tag": "preview"
6
6
  },
@@ -73,6 +73,9 @@
73
73
  "machine": {
74
74
  "description": "Check and repair this machine's setup for coding agents. Use `primitive machine doctor --json` to inspect and `--fix` to repair."
75
75
  },
76
+ "skills": {
77
+ "description": "Install the agent skills bundled with this CLI. Use `primitive skills install --runtime claude` to install them all."
78
+ },
76
79
  "agent-connections": {
77
80
  "description": "Create, list, invite, revoke, and remove connected agents; claim private invitations through stdin."
78
81
  },