primitive 1.72.0 → 1.72.2

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.
@@ -47286,7 +47286,7 @@ async function clearPendingAfterRead(configDir, emailId, known) {
47286
47286
  } : null);
47287
47287
  } catch {}
47288
47288
  }
47289
- const NO_SIGNAL_DESCRIPTION = "With --context, do not report working to the sender, and stop a working report an earlier read of this email started; nothing is sent. By default, reading mail from the verified owner or a same-organization member (not another agent) that a receiver surfaced to this session reports working in the background until you answer (also disabled by PRIMITIVE_NO_AUTO_SIGNALS=1).";
47289
+ const NO_SIGNAL_DESCRIPTION = "Do not report working to the sender, and stop a working report an earlier read of this email started; nothing is sent. Only a --context read reports working; on any other read this flag just stops the earlier report. By default, reading mail from the verified owner or a same-organization member (not another agent) that a receiver surfaced to this session reports working in the background until you answer (also disabled by PRIMITIVE_NO_AUTO_SIGNALS=1).";
47290
47290
  /**
47291
47291
  * The line a brief ends with once it has started reporting working: the
47292
47292
  * agent only knows whether it will act after reading, so the way out has to
@@ -47438,10 +47438,7 @@ function createEmailsGetCommand(base) {
47438
47438
  description: LINKS_DESCRIPTION,
47439
47439
  dependsOn: ["compact"]
47440
47440
  }),
47441
- "no-signal": Flags.boolean({
47442
- description: NO_SIGNAL_DESCRIPTION,
47443
- dependsOn: ["context"]
47444
- })
47441
+ "no-signal": Flags.boolean({ description: NO_SIGNAL_DESCRIPTION })
47445
47442
  };
47446
47443
  async run() {
47447
47444
  if (this.argv.includes("--brief")) {
@@ -47459,11 +47456,13 @@ function createEmailsGetCommand(base) {
47459
47456
  await runBrief(this, parsed);
47460
47457
  return;
47461
47458
  }
47459
+ if (parsed["no-signal"]) await haltAutoWorking(this.config.configDir, { emailIds: [parsed.id] }, "not_acting");
47462
47460
  if (parsed.links !== void 0 && !validLinksValue(parsed.links)) throw new Errors.CLIError("--links must be `all` or a comma list of link numbers, for example 1,2,3.", { exit: 2 });
47463
47461
  if (parsed.compact) {
47464
47462
  await runCompact(this, parsed);
47465
47463
  return;
47466
47464
  }
47465
+ this.argv = this.argv.filter((arg) => arg !== "--no-signal");
47467
47466
  const before = process.exitCode;
47468
47467
  await base.prototype.run.call(this);
47469
47468
  if (process.exitCode === before || process.exitCode === 0) await clearPendingAfterRead(this.config.configDir, parsed.id);
@@ -49156,7 +49155,7 @@ const PRIMITIVE_TEAM_AUTHOR = {
49156
49155
  url: "https://primitive.dev"
49157
49156
  };
49158
49157
  const SDK_VERSION_RANGE = "^2.0.0";
49159
- const CLI_VERSION_RANGE = "^1.72.0";
49158
+ const CLI_VERSION_RANGE = "^1.72.2";
49160
49159
  const ESBUILD_VERSION_RANGE = "^0.27.0";
49161
49160
  function renderHandler() {
49162
49161
  return `// env.PRIMITIVE_API_KEY, env.PRIMITIVE_WEBHOOK_SECRET, and
@@ -62966,7 +62965,9 @@ function dropContained(candidates) {
62966
62965
  const MIN_CODE_SCORE = 8;
62967
62966
  /**
62968
62967
  * 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.
62968
+ * between digit groups removed ("123 456" -> "123456") and a dashed
62969
+ * letter-and-digit code kept as written ("4K7-P2Q"), or null when none is
62970
+ * found.
62970
62971
  */
62971
62972
  function extractVerificationCode(email) {
62972
62973
  const fromText = email.text?.trim() ? codeInBody(email.subject, email.text) : null;
@@ -62981,8 +62982,9 @@ function codeInBody(subject, body) {
62981
62982
  for (const { form, regex } of CODE_PATTERNS) for (const match of line.matchAll(regex)) {
62982
62983
  const start = match.index ?? 0;
62983
62984
  const raw = match[0];
62984
- const value = raw.replace(/[ -]/g, "");
62985
- if (value.length < 4 || value.length > 10) continue;
62985
+ const joined = raw.replace(/[ -]/g, "");
62986
+ const value = form === "dashed" ? raw : joined;
62987
+ if (joined.length < 4 || joined.length > 10) continue;
62986
62988
  found.push({
62987
62989
  value,
62988
62990
  raw,
@@ -63262,6 +63264,11 @@ function formatWaitEmail(email, bin) {
63262
63264
  lines.push("", `Reply: ${bin} reply --id ${email.id} --body "..."`);
63263
63265
  return sanitizeForTerminal(lines.join("\n"));
63264
63266
  }
63267
+ function setupChallengeIds(configDir, agent) {
63268
+ if (!agent) return [];
63269
+ const id = savedSetupChallengeId(agentProfileDirectory(configDir, agent.profileName));
63270
+ return id ? [id] : [];
63271
+ }
63265
63272
  async function listRows(apiClient, query) {
63266
63273
  const result = await listEmails({
63267
63274
  client: apiClient.client,
@@ -63311,7 +63318,7 @@ function arrivedSince(row, threshold) {
63311
63318
  */
63312
63319
  async function waitForEmail(params) {
63313
63320
  const { apiClient, filters, deadline } = params;
63314
- const seen = /* @__PURE__ */ new Set();
63321
+ const seen = new Set(params.skipIds ?? []);
63315
63322
  let since = await baselineCursor({ apiClient });
63316
63323
  const recent = await listRows(apiClient, { limit: EXISTING_PAGE_SIZE });
63317
63324
  const early = await firstMatch(apiClient, recent.rows.filter((row) => arrivedSince(row, params.startedAt)).reverse(), filters, seen);
@@ -63440,7 +63447,8 @@ Exit codes:
63440
63447
  filters,
63441
63448
  includeExisting: flags["include-existing"],
63442
63449
  deadline,
63443
- startedAt
63450
+ startedAt,
63451
+ skipIds: setupChallengeIds(this.config.configDir, auth.connectedAgent)
63444
63452
  });
63445
63453
  } catch (error) {
63446
63454
  if (!(error instanceof InboxNextApiError)) throw error;
package/man/primitive.1 CHANGED
@@ -335,7 +335,7 @@ Signal failures never delay or fail the wake or the read. Renewal runs in a
335
335
  detached process; if the runtime ends it, the next primitive command restarts
336
336
  it. Set PRIMITIVE_NO_AUTO_SIGNALS=1 to turn all of this off, or pass
337
337
  .B --no-signal
338
- to one brief read.
338
+ to a read of that email.
339
339
 
340
340
  .SH GLOBAL OPTIONS
341
341
  .TP
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primitive",
3
- "version": "1.72.0",
3
+ "version": "1.72.2",
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,