@primitivedotdev/cli 3.0.0-preview.21 → 3.0.0-preview.22

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 { r as jsonOutputRequested } from "../json-output-xgN0ZLWP.js";
1
+ import { i as jsonOutputRequested } from "../json-output-BMZrLH47.js";
2
2
  import { spawnSync } from "node:child_process";
3
3
  // src/oclif/proxy-auto-detect.ts
4
4
  const PROXY_ENV_VARS = [
@@ -1,7 +1,7 @@
1
1
  import { N as agentProfileDirectory, P as agentProfileName, R as loadConnectedAgentProfile, j as AGENT_PROFILE_ENV } from "../cli-config-Ms_0vNjq.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-BRK9_xSb.js";
4
- import { Ft as detectAgentRuntime } from "../api-command-Bab30eNp.js";
3
+ import { d as SESSION_UUID, t as notificationScope } from "../notify-session-DHQbjXOq.js";
4
+ import { It as detectAgentRuntime } from "../api-command-Dm1BKxOr.js";
5
5
  import { d as readMailJson } from "../shared-mail-files-BAQSGxxz.js";
6
6
  import { join } from "node:path";
7
7
  import { spawn } from "node:child_process";
@@ -7967,7 +7967,7 @@ function parseFromHeader(header) {
7967
7967
  value: { address: address.toLowerCase() }
7968
7968
  };
7969
7969
  }
7970
- // ../sdk-node/dist/understanding-BKr4J0fq.js
7970
+ // ../sdk-node/dist/understanding-DPQq-3nO.js
7971
7971
  /**
7972
7972
  * AUTO-GENERATED - DO NOT EDIT
7973
7973
  * Run `pnpm generate:validator` to regenerate.
@@ -13790,6 +13790,42 @@ const schema48 = {
13790
13790
  },
13791
13791
  "required": ["value"]
13792
13792
  };
13793
+ const schema49 = {
13794
+ "type": "object",
13795
+ "description": "A rule that matched the email and granted this delivery.",
13796
+ "properties": {
13797
+ "id": {
13798
+ "type": "string",
13799
+ "description": "Rule id, as the email rules API returns it."
13800
+ },
13801
+ "version": {
13802
+ "type": "integer",
13803
+ "description": "Rule version that matched."
13804
+ },
13805
+ "name": {
13806
+ "type": "string",
13807
+ "description": "Rule name."
13808
+ },
13809
+ "description": {
13810
+ "type": "string",
13811
+ "description": "The plain-English description the rule was written from."
13812
+ },
13813
+ "explanation": {
13814
+ "type": "string",
13815
+ "description": "What the rule matches, in plain English."
13816
+ },
13817
+ "questions": {
13818
+ "type": "array",
13819
+ "items": { "$ref": "#/definitions/UnderstandingRuleQuestion" },
13820
+ "description": "The rule's questions and their answers."
13821
+ },
13822
+ "through_share": {
13823
+ "type": ["string", "null"],
13824
+ "description": "The id of the share a colleague made with you that this rule reached you through; null when the receiving key lists the rule itself."
13825
+ }
13826
+ },
13827
+ "required": ["id"]
13828
+ };
13793
13829
  function validate39(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
13794
13830
  let vErrors = null;
13795
13831
  let errors = 0;
@@ -13964,16 +14000,31 @@ function validate39(data, { instancePath = "", parentData, parentDataProperty, r
13964
14000
  errors++;
13965
14001
  }
13966
14002
  }
14003
+ if (data.through_share !== void 0) {
14004
+ let data10 = data.through_share;
14005
+ if (typeof data10 !== "string" && data10 !== null) {
14006
+ const err12 = {
14007
+ instancePath: instancePath + "/through_share",
14008
+ schemaPath: "#/properties/through_share/type",
14009
+ keyword: "type",
14010
+ params: { type: schema49.properties.through_share.type },
14011
+ message: "must be string,null"
14012
+ };
14013
+ if (vErrors === null) vErrors = [err12];
14014
+ else vErrors.push(err12);
14015
+ errors++;
14016
+ }
14017
+ }
13967
14018
  } else {
13968
- const err12 = {
14019
+ const err13 = {
13969
14020
  instancePath,
13970
14021
  schemaPath: "#/type",
13971
14022
  keyword: "type",
13972
14023
  params: { type: "object" },
13973
14024
  message: "must be object"
13974
14025
  };
13975
- if (vErrors === null) vErrors = [err12];
13976
- else vErrors.push(err12);
14026
+ if (vErrors === null) vErrors = [err13];
14027
+ else vErrors.push(err13);
13977
14028
  errors++;
13978
14029
  }
13979
14030
  validate39.errors = vErrors;
@@ -1,4 +1,4 @@
1
- import { T as retryTransient, _ as isTrustedSender, c as classifySignalContent } from "./repeats-Dj_o6c-X-CraZzs4t.js";
1
+ import { T as retryTransient, _ as isTrustedSender, c as classifySignalContent } from "./repeats-Dj_o6c-X-x61TNLz-.js";
2
2
  // src/oclif/presence-provenance.ts
3
3
  function readPresenceProjection(detail) {
4
4
  if (!detail || typeof detail !== "object") return null;
@@ -57,6 +57,17 @@ function tryOwnSharedMail(store) {
57
57
  lastMailCheckAt: null
58
58
  };
59
59
  let closed = false;
60
+ const status = () => {
61
+ if (closed) return null;
62
+ const raw = readMailJson(path);
63
+ if (raw === null) throw invalidSharedMail();
64
+ const saved = ownerRecord(raw);
65
+ if (saved.generation !== current.generation || saved.pid !== current.pid || saved.identity !== current.identity || saved.ready !== current.ready || saved.gapCount !== current.gapCount || saved.lastGapReason !== current.lastGapReason || saved.lastMailCheckAt !== current.lastMailCheckAt) throw invalidSharedMail();
66
+ return {
67
+ ...current,
68
+ alive: true
69
+ };
70
+ };
60
71
  try {
61
72
  writeMailJson(path, current);
62
73
  } catch (error) {
@@ -77,6 +88,7 @@ function tryOwnSharedMail(store) {
77
88
  };
78
89
  return {
79
90
  generation: current.generation,
91
+ status,
80
92
  markReady(status = {}) {
81
93
  markStatus({
82
94
  ...status,
@@ -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-CraZzs4t.js";
2
- import { O as bareAddress, Tt as successfulSendOutcome, ct as classifySendError, o as extractErrorPayload } from "./api-command-Bab30eNp.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-x61TNLz-.js";
2
+ import { Et as successfulSendOutcome, k as bareAddress, lt as classifySendError, s as extractErrorPayload } from "./api-command-Dm1BKxOr.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-YucNhX6U.js";
6
- import { n as tryOwnSharedMail, r as waitForSharedMailChange, t as readSharedMailOwner } from "./shared-mail-watch-BAPMsFNv.js";
5
+ import { i as readApiBeforeDeadline, n as isPlainChatReply, o as scopedChatSenderTrust } from "./scoped-chat-Bss3OjFI.js";
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-fm03G7A3.js
12
+ // ../sdk-node/dist/api-DNVymWBY.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;
@@ -1999,13 +1999,16 @@ async function openSharedMailReceiver(options) {
1999
1999
  let failure;
2000
2000
  let cleanupFailure;
2001
2001
  let active;
2002
+ let owned = null;
2002
2003
  function ensureOwner() {
2003
2004
  signal.throwIfAborted();
2004
2005
  if (failure !== void 0) throw failure;
2006
+ if (owned) return owned.status();
2005
2007
  const current = readSharedMailOwner(store);
2006
2008
  if (current?.alive || active) return current;
2007
2009
  const owner = tryOwnSharedMail(store);
2008
2010
  if (!owner) return readSharedMailOwner(store);
2011
+ owned = owner;
2009
2012
  active = runSharedMailTransport({
2010
2013
  apiClient: options.apiClient,
2011
2014
  subscription: store.subscriptionName,
@@ -2032,10 +2035,11 @@ async function openSharedMailReceiver(options) {
2032
2035
  cleanupFailure = error;
2033
2036
  failure ??= error;
2034
2037
  } finally {
2038
+ owned = null;
2035
2039
  active = void 0;
2036
2040
  }
2037
2041
  });
2038
- return readSharedMailOwner(store);
2042
+ return owner.status();
2039
2043
  }
2040
2044
  function watch(deadline) {
2041
2045
  const stop = new AbortController();
@@ -2052,7 +2056,7 @@ async function openSharedMailReceiver(options) {
2052
2056
  return {
2053
2057
  store,
2054
2058
  signal,
2055
- status: () => readSharedMailOwner(store),
2059
+ status: () => owned ? owned.status() : readSharedMailOwner(store),
2056
2060
  async ready(deadline) {
2057
2061
  while (deadline == null || Date.now() < deadline) {
2058
2062
  const watching = watch(deadline);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitivedotdev/cli",
3
- "version": "3.0.0-preview.21",
3
+ "version": "3.0.0-preview.22",
4
4
  "publishConfig": {
5
5
  "tag": "preview"
6
6
  },
@@ -99,7 +99,7 @@
99
99
  "description": "Check inbound email setup and readiness, and work through mail awaiting your reply. Prefer `primitive inbox setup` for a guided setup path, `primitive inbox status` for the readiness table, and `primitive inbox next` for the oldest email awaiting your reply."
100
100
  },
101
101
  "emails": {
102
- "description": "List, inspect, and wait for received emails, and see what the classifier read from one. Prefer task aliases like `primitive emails list`, `primitive emails get`, `primitive emails latest`, `primitive emails facts`, `primitive emails wait`, and `primitive emails watch`. For a one-line-per-email table, `primitive emails latest --limit 100`."
102
+ "description": "List, inspect, and wait for received emails, and see what the classifier read from one. Prefer task aliases like `primitive emails list`, `primitive emails get`, `primitive emails latest`, `primitive emails facts`, `primitive emails wait`, and `primitive emails watch`. For a one-line-per-email table, `primitive emails latest --limit 200`; continue with `--cursor <cursor>`."
103
103
  },
104
104
  "search": {
105
105
  "description": "Cross-corpus semantic search. Prefer `primitive search <query>` for lexical inbound search and `primitive semantic-search <query>` for meaning-aware ranking across inbound and outbound.",
@@ -154,7 +154,7 @@
154
154
  "description": "Organization API keys: list and show them (metadata only, never secrets), create, rotate and change them (with browser approval where your organization requires it), and revoke them."
155
155
  },
156
156
  "roles": {
157
- "description": "Read roles, members, groups, mailbox access and the access mode. Use `primitive roles list|members|groups|mailbox-access|access-mode`."
157
+ "description": "Read roles, members, groups, mailbox access and the access mode. Use `primitive roles list|groups|mailbox-access|access-mode` and `primitive members list`."
158
158
  },
159
159
  "projects": {
160
160
  "description": "Organization people, shared projects and project invitations"
@@ -172,7 +172,7 @@
172
172
  "description": "Your connected apps and CLI logins, the organization's connected apps, name, logo, search settings and billing"
173
173
  },
174
174
  "members": {
175
- "description": "List the organization's members and their roles. Use `primitive members list` (the same as `primitive roles members`)."
175
+ "description": "List the organization's members and their roles. Use `primitive members list`."
176
176
  },
177
177
  "roles-and-members": {
178
178
  "description": "Roles, member roles and removal, the mailbox access mode, break-glass, transfers and suspensions, and leaving the organization"
@@ -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). `primitive doctor` sums up what is waiting for you."
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)."
194
194
  },
195
195
  "email-rules": {
196
196
  "description": "Rules written in plain English that pick out received mail"