primcli 3.0.0-preview.6 → 3.0.0-preview.8

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.
@@ -145,11 +145,18 @@ function errorExitCode(error) {
145
145
  function isExitSignal(error) {
146
146
  return error?.code === "EEXIT";
147
147
  }
148
+ /**
149
+ * The `error` a `--json` document carries for a thrown error: its message,
150
+ * and its `code` and `details` when it has them (a refusal the CLI makes in
151
+ * an API error's shape, such as a send without mail:send).
152
+ */
148
153
  function thrownErrorBody(error) {
149
154
  if (error instanceof Error) {
150
155
  const body = { message: error.message };
151
156
  const code = error.code;
152
157
  if (typeof code === "string" && code !== "EEXIT") body.code = code;
158
+ const details = error.details;
159
+ if (isPlainObject(details)) body.details = details;
153
160
  return body;
154
161
  }
155
162
  return { message: String(error) };
@@ -324,4 +331,4 @@ function guardJsonOutputCommands(commands) {
324
331
  if (flags && "json" in flags || enableJsonFlag === true) guardJsonOutput(command);
325
332
  }
326
333
  }
327
- export { runStreamingJson as i, guardJsonOutputCommands as n, jsonOutputRequested as r, JSON_OUTPUT_FLAG as t };
334
+ export { thrownErrorBody as a, runStreamingJson as i, guardJsonOutputCommands as n, jsonOutputRequested as r, JSON_OUTPUT_FLAG as t };
@@ -1,19 +1,19 @@
1
1
  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, b as loadCliCredentials, j as AGENT_PROFILE_ENV, z as parseConnectedAgentProfile } from "./cli-config-Ms_0vNjq.js";
2
- import { Dn as listSentEmails, Fn as putContact, Gn as searchEmails, Ht as getEmail, Jn as sendEmail, Lt as getAgentContactPolicy, Nn as putAgentContact, Pn as putAgentContactPolicy, Rt as getContact, Tt as deleteContact, fn as listDomains, hr as __exportAll, ln as listContacts, on as listAgentConnections, rn as inviteAgentConnection, sn as listAgentContacts, wt as deleteAgentContact } from "./repeats-Dj_o6c-X-CP0h4alF.js";
3
- import { It as detectAgentRuntime, en as refreshStoredCliCredentials, jt as defaultConnectionName, kt as cliInvocation, tn as refuseOrgSelectionForProfile } from "./api-command-CRjIK1QL.js";
2
+ import { Dn as listSentEmails, Fn as putContact, Gn as searchEmails, Ht as getEmail, Jn as sendEmail, Lt as getAgentContactPolicy, Nn as putAgentContact, Pn as putAgentContactPolicy, Rt as getContact, Tt as deleteContact, fn as listDomains, hr as __exportAll, ln as listContacts, on as listAgentConnections, rn as inviteAgentConnection, sn as listAgentContacts, wt as deleteAgentContact } from "./repeats-Dj_o6c-X-DNbrLjEF.js";
3
+ import { At as cliInvocation, Lt as detectAgentRuntime, Mt as defaultConnectionName, nn as refreshStoredCliCredentials, rn as refuseOrgSelectionForProfile } from "./api-command-TUwewvqZ.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 { S as readBundledConnectSkill, a as NotificationRetryError, d as SESSION_UUID, f as connectNativeSession, m as NativeSessionDisconnectedError, p as defaultSessionSocket, t as notificationScope, y as installConnectSkill } from "./notify-session-DTyg-sfS.js";
5
+ import { S as readBundledConnectSkill, a as NotificationRetryError, d as SESSION_UUID, f as connectNativeSession, m as NativeSessionDisconnectedError, p as defaultSessionSocket, t as notificationScope, y as installConnectSkill } from "./notify-session-CeIflLIX.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-BAPMsFNv.js";
8
8
  import { withoutOrgSelection } from "./oclif/global-org-flag.js";
9
- import { o as scopedChatSenderTrust } from "./scoped-chat-CvqdlWuX.js";
9
+ import { o as scopedChatSenderTrust } from "./scoped-chat-Dd3P8Q-m.js";
10
10
  import { accessSync, chmodSync, closeSync, constants, copyFileSync, existsSync, fsyncSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, rmdirSync, statSync, unlinkSync, writeFileSync } from "node:fs";
11
11
  import { createHash, randomUUID } from "node:crypto";
12
12
  import { basename, delimiter, dirname, isAbsolute, join, resolve } from "node:path";
13
13
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
14
14
  import { execFile, execFileSync, spawn } from "node:child_process";
15
- import { homedir } from "node:os";
16
15
  import { promisify } from "node:util";
16
+ import { homedir } from "node:os";
17
17
  import { createConnection } from "node:net";
18
18
  // src/oclif/owner-member-address.ts
19
19
  const REFRESH_TIMEOUT_MS = 5e3;
@@ -1,13 +1,13 @@
1
- import { Mt as downloadEmailAttachmentPart, Q as parseWebhookEvent, X as isEmailReceivedEvent, Z as isTrustedSender, c as classifySignalContent } from "./repeats-Dj_o6c-X-CP0h4alF.js";
2
- import { B as wakeReadCommand, tt as wakeInteractionSentence, z as skillFirstLine } from "./api-command-CRjIK1QL.js";
1
+ import { Mt as downloadEmailAttachmentPart, Q as parseWebhookEvent, X as isEmailReceivedEvent, Z as isTrustedSender, c as classifySignalContent } from "./repeats-Dj_o6c-X-DNbrLjEF.js";
2
+ import { B as skillFirstLine, V as wakeReadCommand, nt as wakeInteractionSentence } from "./api-command-TUwewvqZ.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";
6
6
  import { dirname, isAbsolute, join, normalize, resolve } from "node:path";
7
7
  import { spawn } from "node:child_process";
8
+ import { isDeepStrictEqual } from "node:util";
8
9
  import { homedir } from "node:os";
9
10
  import { lstat, realpath } from "node:fs/promises";
10
- import { isDeepStrictEqual } from "node:util";
11
11
  import WebSocket from "ws";
12
12
  import { request } from "node:http";
13
13
  import { request as request$1 } from "node:https";
@@ -1,8 +1,8 @@
1
- import { en as getSentEmail } from "../repeats-Dj_o6c-X-CP0h4alF.js";
2
- import { F as readThreadContext, Qt as createAuthenticatedCliApiClient } from "../api-command-CRjIK1QL.js";
1
+ import { en as getSentEmail } from "../repeats-Dj_o6c-X-DNbrLjEF.js";
2
+ import { I as readThreadContext, en as createAuthenticatedCliApiClient } from "../api-command-TUwewvqZ.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-CPxRPbHK.js";
5
+ import { t as sendSignal } from "../signal-command-DZQemE9I.js";
6
6
  import { join } from "node:path";
7
7
  import { homedir } from "node:os";
8
8
  // src/oclif/auto-signal-worker.ts
@@ -1,4 +1,4 @@
1
- import { n as isPlainChatReply, o as scopedChatSenderTrust } from "../scoped-chat-CvqdlWuX.js";
1
+ import { n as isPlainChatReply, o as scopedChatSenderTrust } from "../scoped-chat-Dd3P8Q-m.js";
2
2
  import { d as readMailJson, h as writeMailJson, i as mailId, l as privateMailDirectory, r as mailAddress } from "../shared-mail-files-BAQSGxxz.js";
3
3
  import { existsSync, readFileSync, readdirSync, unlinkSync, writeFileSync } from "node:fs";
4
4
  import { randomUUID } from "node:crypto";
@@ -1,4 +1,4 @@
1
- import { r as jsonOutputRequested } from "../json-output-DWrJMakZ.js";
1
+ import { r as jsonOutputRequested } from "../json-output-ch756TXV.js";
2
2
  // src/oclif/command-not-found.ts
3
3
  /**
4
4
  * What to say for an id no command has. oclif joins every word before the