@primitivedotdev/cli 0.31.8 → 0.32.0

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.
@@ -14560,6 +14560,8 @@ function buildCommand(kind, description, argv, options = {}) {
14560
14560
  }
14561
14561
  function buildChatFollowUpCommands(context) {
14562
14562
  const commands = [];
14563
+ const hasCustomStrictPhase = context.strictPhaseSeconds !== DEFAULT_STRICT_PHASE_SECONDS;
14564
+ const shouldPreferStrictContinuation = context.strictOnly || context.matchStrategy === "strict" && !hasCustomStrictPhase;
14563
14565
  const continueParts = [
14564
14566
  "primitive",
14565
14567
  "chat",
@@ -14575,8 +14577,8 @@ function buildChatFollowUpCommands(context) {
14575
14577
  ];
14576
14578
  if (context.json) continueParts.push("--json");
14577
14579
  if (context.quiet) continueParts.push("--quiet");
14578
- if (context.strictOnly) continueParts.push("--strict-only");
14579
- else if (context.strictPhaseSeconds !== DEFAULT_STRICT_PHASE_SECONDS) continueParts.push("--strict-phase-seconds", String(context.strictPhaseSeconds));
14580
+ if (shouldPreferStrictContinuation) continueParts.push("--strict-only");
14581
+ else if (hasCustomStrictPhase) continueParts.push("--strict-phase-seconds", String(context.strictPhaseSeconds));
14580
14582
  commands.push(buildCommand("continue_chat", "Continue this chat", continueParts, { requiresMessage: true }));
14581
14583
  commands.push(buildCommand("reply_direct", "Reply directly to the inbound email", [
14582
14584
  "primitive",
@@ -14685,7 +14687,7 @@ function formatChatResponse(context) {
14685
14687
  ];
14686
14688
  if (context.reply.reply_to_sent_email_id) lines.push(` Reply to sent email id: ${context.reply.reply_to_sent_email_id}`);
14687
14689
  if (context.reply.message_id) lines.push(` Message-Id: ${context.reply.message_id}`);
14688
- lines.push("", "Helpful follow-up commands", " Replace <message> before running commands that include it.", " Commands are templates; use --json for parse-safe output.");
14690
+ lines.push("", "Helpful follow-up commands", " Replace <message> before running commands that include it.", " Commands are templates; use --json for parse-safe output.", " When shown, --strict-only prefers timing out over matching the wrong reply.");
14689
14691
  for (const { description, command } of buildChatFollowUpCommands(context)) lines.push(` ${description}:`, ` ${command}`);
14690
14692
  lines.push("", `Response body (${responseBody.format}; use --json for parsing)`, "----- BEGIN RESPONSE -----", responseBody.body || "(empty response)", "----- END RESPONSE -----");
14691
14693
  return lines.join("\n");
@@ -14785,9 +14787,10 @@ var ChatCommand = class ChatCommand extends Command {
14785
14787
  --strict-only is not set, it falls back to a weaker sender/time
14786
14788
  window match: from=<recipient>, to=<sender>, and since=<send time>.
14787
14789
  The fallback can catch clients that strip threading headers, but it
14788
- is less exact than strict matching. Progress is written to stderr
14789
- while the CLI waits. Exits non-zero on timeout and prints recovery
14790
- commands when the send succeeded but no reply was returned.`;
14790
+ is less exact than strict matching. Use --strict-only when matching
14791
+ the wrong reply is worse than timing out. Progress is written to
14792
+ stderr while the CLI waits. Exits non-zero on timeout and prints
14793
+ recovery commands when the send succeeded but no reply was returned.`;
14791
14794
  static summary = "Chat with an agent over email (send and wait for the reply)";
14792
14795
  static examples = [
14793
14796
  "<%= config.bin %> chat help@agent.acme.dev 'how do I rotate my API key?'",
@@ -14836,7 +14839,7 @@ var ChatCommand = class ChatCommand extends Command {
14836
14839
  description: "Seconds to wait in strict-threading mode (filter by reply_to_sent_email_id) before falling back to time-window matching. Set to the full --timeout to disable the fallback; --strict-only is the explicit way to do that.",
14837
14840
  min: 1
14838
14841
  }),
14839
- "strict-only": Flags.boolean({ description: "Disable the time-window fallback. Only accept inbounds whose threading headers (In-Reply-To / References) resolve to this send. Recommended when correctness matters more than success rate (e.g. agents talking to agents)." }),
14842
+ "strict-only": Flags.boolean({ description: "Disable the time-window fallback. Only accept inbounds whose threading headers (In-Reply-To / References) resolve to this send. Use when matching the wrong reply is worse than timing out." }),
14840
14843
  interval: Flags.integer({
14841
14844
  default: 2,
14842
14845
  description: "Seconds between polls while waiting for the reply.",
@@ -16765,8 +16768,8 @@ const PRIMITIVE_TEAM_AUTHOR = {
16765
16768
  name: "Primitive Team",
16766
16769
  url: "https://primitive.dev"
16767
16770
  };
16768
- const SDK_VERSION_RANGE = "^0.31.1";
16769
- const CLI_VERSION_RANGE = "^0.31.1";
16771
+ const SDK_VERSION_RANGE = "^0.32.0";
16772
+ const CLI_VERSION_RANGE = "^0.32.0";
16770
16773
  const ESBUILD_VERSION_RANGE = "^0.27.0";
16771
16774
  function renderHandler() {
16772
16775
  return `// env.PRIMITIVE_API_KEY, env.PRIMITIVE_WEBHOOK_SECRET, and
@@ -19955,6 +19958,7 @@ const CANONICAL_OPERATION_ALIASES = {
19955
19958
  "sending:send": "sending:send-email",
19956
19959
  "sent:get": "sending:get-sent-email",
19957
19960
  "sent:list": "sending:list-sent-emails",
19961
+ "threads:get": "threads:get-thread",
19958
19962
  "webhook-deliveries:list": "webhook-deliveries:list-deliveries",
19959
19963
  "webhook-deliveries:replay": "webhook-deliveries:replay-delivery"
19960
19964
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitivedotdev/cli",
3
- "version": "0.31.8",
3
+ "version": "0.32.0",
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,
@@ -67,7 +67,7 @@
67
67
  "description": "Short aliases for outbound sent-email history: `primitive sent list` and `primitive sent get`."
68
68
  },
69
69
  "threads": {
70
- "description": "Inspect conversation threads spanning received and sent emails: `primitive threads get --id <thread-id>`."
70
+ "description": "Inspect conversation threads spanning received and sent emails. Prefer `primitive threads get --id <thread-id>`; generated API name `primitive threads get-thread --id <thread-id>` remains available."
71
71
  },
72
72
  "endpoints": {
73
73
  "description": "Manage webhook endpoints that receive email events"