primitive 1.72.0 → 1.72.1

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.
package/README.md CHANGED
@@ -160,7 +160,8 @@ connected agent profile's own address, or any inbound mail for a member login)
160
160
  and prints it: sender, subject, time, the start of its text and its ID, ready
161
161
  for `primitive reply --id <id>`. Only mail that arrives after the command starts
162
162
  matches; `--include-existing` also lets one of the newest 50 emails match, for
163
- a code that arrived before you started waiting.
163
+ a code that arrived before you started waiting. Presence probes and the connected
164
+ profile's own setup email are never matched, as in `agent check-mail`.
164
165
 
165
166
  - `--from` takes an address or a bare domain; `github.com` matches any sender at
166
167
  it or its subdomains. It narrows the wait; it does not authenticate the sender.
@@ -170,7 +171,8 @@ a code that arrived before you started waiting.
170
171
  forever).
171
172
  - `--code` prints only the one-time code, preferring numbers next to words like
172
173
  code, verification or passcode and ignoring years, phone numbers, prices and
173
- order numbers. A code split as `123 456` prints as `123456`.
174
+ order numbers. A code split as `123 456` prints as `123456`; a letter-and-digit
175
+ code with a dash, such as `4K7-P2Q`, prints as written.
174
176
  - `--link` prints only the most likely verify, confirm, sign-in, magic or reset
175
177
  link, skipping unsubscribe, privacy, help and social links and removing an
176
178
  obvious click-tracking wrapper.
@@ -49156,7 +49156,7 @@ const PRIMITIVE_TEAM_AUTHOR = {
49156
49156
  url: "https://primitive.dev"
49157
49157
  };
49158
49158
  const SDK_VERSION_RANGE = "^2.0.0";
49159
- const CLI_VERSION_RANGE = "^1.72.0";
49159
+ const CLI_VERSION_RANGE = "^1.72.1";
49160
49160
  const ESBUILD_VERSION_RANGE = "^0.27.0";
49161
49161
  function renderHandler() {
49162
49162
  return `// env.PRIMITIVE_API_KEY, env.PRIMITIVE_WEBHOOK_SECRET, and
@@ -62966,7 +62966,9 @@ function dropContained(candidates) {
62966
62966
  const MIN_CODE_SCORE = 8;
62967
62967
  /**
62968
62968
  * The verification or one-time code in an email, with spaces and dashes
62969
- * between groups removed ("123 456" -> "123456"), or null when none is found.
62969
+ * between digit groups removed ("123 456" -> "123456") and a dashed
62970
+ * letter-and-digit code kept as written ("4K7-P2Q"), or null when none is
62971
+ * found.
62970
62972
  */
62971
62973
  function extractVerificationCode(email) {
62972
62974
  const fromText = email.text?.trim() ? codeInBody(email.subject, email.text) : null;
@@ -62981,8 +62983,9 @@ function codeInBody(subject, body) {
62981
62983
  for (const { form, regex } of CODE_PATTERNS) for (const match of line.matchAll(regex)) {
62982
62984
  const start = match.index ?? 0;
62983
62985
  const raw = match[0];
62984
- const value = raw.replace(/[ -]/g, "");
62985
- if (value.length < 4 || value.length > 10) continue;
62986
+ const joined = raw.replace(/[ -]/g, "");
62987
+ const value = form === "dashed" ? raw : joined;
62988
+ if (joined.length < 4 || joined.length > 10) continue;
62986
62989
  found.push({
62987
62990
  value,
62988
62991
  raw,
@@ -63262,6 +63265,11 @@ function formatWaitEmail(email, bin) {
63262
63265
  lines.push("", `Reply: ${bin} reply --id ${email.id} --body "..."`);
63263
63266
  return sanitizeForTerminal(lines.join("\n"));
63264
63267
  }
63268
+ function setupChallengeIds(configDir, agent) {
63269
+ if (!agent) return [];
63270
+ const id = savedSetupChallengeId(agentProfileDirectory(configDir, agent.profileName));
63271
+ return id ? [id] : [];
63272
+ }
63265
63273
  async function listRows(apiClient, query) {
63266
63274
  const result = await listEmails({
63267
63275
  client: apiClient.client,
@@ -63311,7 +63319,7 @@ function arrivedSince(row, threshold) {
63311
63319
  */
63312
63320
  async function waitForEmail(params) {
63313
63321
  const { apiClient, filters, deadline } = params;
63314
- const seen = /* @__PURE__ */ new Set();
63322
+ const seen = new Set(params.skipIds ?? []);
63315
63323
  let since = await baselineCursor({ apiClient });
63316
63324
  const recent = await listRows(apiClient, { limit: EXISTING_PAGE_SIZE });
63317
63325
  const early = await firstMatch(apiClient, recent.rows.filter((row) => arrivedSince(row, params.startedAt)).reverse(), filters, seen);
@@ -63440,7 +63448,8 @@ Exit codes:
63440
63448
  filters,
63441
63449
  includeExisting: flags["include-existing"],
63442
63450
  deadline,
63443
- startedAt
63451
+ startedAt,
63452
+ skipIds: setupChallengeIds(this.config.configDir, auth.connectedAgent)
63444
63453
  });
63445
63454
  } catch (error) {
63446
63455
  if (!(error instanceof InboxNextApiError)) throw error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primitive",
3
- "version": "1.72.0",
3
+ "version": "1.72.1",
4
4
  "description": "Official Primitive CLI: deploy Primitive Functions, send and inspect mail, manage endpoints, all from the terminal. Wraps the @primitivedotdev/sdk runtime client with one-shot commands.",
5
5
  "type": "module",
6
6
  "sideEffects": false,