@mcpjam/cli 6.4.1 → 6.4.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/dist/index.js CHANGED
@@ -30,12 +30,12 @@ import { applyVisibilityPolicyAndCountSignals, isAppOnlyTool, extractHostExecuti
30
30
  import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
31
31
  import { McpServer } from '@modelcontextprotocol/server';
32
32
  import { z } from 'zod';
33
- import { generateWebhookSecret, isValidWebhookSecret, DRAFT_PROFILE_ID, CHATGPT_PROFILE_ID, getEventsProfile, CHATGPT_2026_09_30_PROFILE_ID, selectDeliveryMode, MemoryEventInbox, computeBindingKey, EventsCoordinator, EventsPushRuntime, createManagerPushPort, applySubscriptionPatch, IDLE_NEXT_ACTION_AT, MAX_DELIVERY_BODY_BYTES } from '@mcpjam/sdk/events';
33
+ import { generateWebhookSecret, isValidWebhookSecret, BETA_PROFILE_ID, DRAFT_PROFILE_ID, CHATGPT_PROFILE_ID, getEventsProfile, CHATGPT_2026_09_30_PROFILE_ID, selectDeliveryMode, MemoryEventInbox, computeBindingKey, EventsCoordinator, EventsPushRuntime, hasEventsProfileCapability, createManagerPushPort, applySubscriptionPatch, IDLE_NEXT_ACTION_AT, MAX_DELIVERY_BODY_BYTES } from '@mcpjam/sdk/events';
34
34
  import { selectPluginMcpServerMap, detectPluginMcpTransport } from '@mcpjam/sdk/plugin-bundle';
35
35
 
36
36
  // package.json
37
37
  var package_default = {
38
- version: "6.4.1"};
38
+ version: "6.4.2"};
39
39
 
40
40
  // src/lib/command-outcome.ts
41
41
  var UNKNOWN_COMMAND = "(unknown)";
@@ -24962,6 +24962,8 @@ function writeTelemetryStatus(status, format) {
24962
24962
  );
24963
24963
  }
24964
24964
  var EVENTS_PROFILE_ALIASES = {
24965
+ beta: BETA_PROFILE_ID,
24966
+ [BETA_PROFILE_ID]: BETA_PROFILE_ID,
24965
24967
  draft: DRAFT_PROFILE_ID,
24966
24968
  chatgpt: CHATGPT_PROFILE_ID,
24967
24969
  [DRAFT_PROFILE_ID]: DRAFT_PROFILE_ID,
@@ -24973,7 +24975,7 @@ function parseEventsProfile(value) {
24973
24975
  const id = EVENTS_PROFILE_ALIASES[key];
24974
24976
  if (!id) {
24975
24977
  throw usageError(
24976
- `Unknown --profile "${key}". Use "draft" (${DRAFT_PROFILE_ID}) or "chatgpt" (${CHATGPT_PROFILE_ID}).`
24978
+ `Unknown --profile "${key}". Use "beta" (${BETA_PROFILE_ID}), "draft" (${DRAFT_PROFILE_ID}) or "chatgpt" (${CHATGPT_PROFILE_ID}).`
24977
24979
  );
24978
24980
  }
24979
24981
  return getEventsProfile(id);
@@ -25006,8 +25008,8 @@ function applyEventsProtocolVersion(config, options) {
25006
25008
  }
25007
25009
  return { ...config, mcpProtocolVersion: version };
25008
25010
  }
25009
- function eventsNotDeclaredError(support, serverLabel) {
25010
- const reason = support.handshakeObserved ? "the server did not declare `capabilities.events` in its handshake" : "the server's handshake was not observed on this connection, so its events capability is unknown";
25011
+ function eventsNotDeclaredError(support, serverLabel, placement = "capabilities.events") {
25012
+ const reason = support.handshakeObserved ? `the server did not declare \`${placement}\` in its handshake` : "the server's handshake was not observed on this connection, so its events capability is unknown";
25011
25013
  return cliError(
25012
25014
  "EVENTS_NOT_DECLARED",
25013
25015
  `Refusing to send events/* to ${serverLabel}: ${reason}. Pass --force to send it anyway (a conformance probe of an undeclared server).`,
@@ -25017,10 +25019,11 @@ function eventsNotDeclaredError(support, serverLabel) {
25017
25019
  }
25018
25020
  function assertEventsDeclaredOrForced(manager, serverId, args) {
25019
25021
  const support = manager.getEventsSupport(serverId);
25020
- if (!support.declared) {
25021
- if (!args.force) throw eventsNotDeclaredError(support, args.serverLabel);
25022
+ if (!hasEventsProfileCapability(support, args.profile.id)) {
25023
+ const placement = args.profile.capabilityPlacement.value;
25024
+ if (!args.force) throw eventsNotDeclaredError(support, args.serverLabel, placement);
25022
25025
  args.warn(
25023
- "Warning: the server did not declare `capabilities.events`; sending events/* anyway because of --force."
25026
+ `Warning: the server did not declare \`${placement}\`; sending events/* anyway because of --force.`
25024
25027
  );
25025
25028
  }
25026
25029
  return support;
@@ -25301,6 +25304,7 @@ async function withEventsConnection(options, ctx, fn) {
25301
25304
  return withEphemeralManager(
25302
25305
  config,
25303
25306
  async (manager, serverId) => {
25307
+ if (!options.profile && manager.getEventsSupport(serverId).beta) ctx.profile = parseEventsProfile("beta");
25304
25308
  notePeerProtocol(manager, serverId, ctx);
25305
25309
  return fn(manager, serverId);
25306
25310
  },
@@ -25334,8 +25338,7 @@ function addEventsTargetOptions(command) {
25334
25338
  addSharedServerOptions(
25335
25339
  command.option(
25336
25340
  "--profile <profile>",
25337
- 'Events profile the run is judged by: "draft" (draft@28ec35e) or "chatgpt" (chatgpt@2026-11-05)',
25338
- "draft"
25341
+ 'Events profile the run is judged by: "beta", "draft" or "chatgpt" (default: negotiated Events version)'
25339
25342
  ).option(
25340
25343
  "--protocol-version <version>",
25341
25344
  "Pin the MCP protocol version (e.g. 2026-07-28). HTTP targets only."
@@ -25856,6 +25859,7 @@ function registerWatch(events) {
25856
25859
  const plan = planWatchReceiver(options);
25857
25860
  const result = await withEventsConnection(options, ctx, async (manager, serverId) => {
25858
25861
  assertEventsDeclaredOrForced(manager, serverId, {
25862
+ profile: ctx.profile,
25859
25863
  force: options.force,
25860
25864
  serverLabel: ctx.target,
25861
25865
  warn: ctx.warn
@@ -25910,7 +25914,7 @@ function registerWatch(events) {
25910
25914
  ctx.warn(insecureModeWarning("--insecure-local-receiver", publicOrigin));
25911
25915
  }
25912
25916
  }
25913
- const inbox = new MemoryEventInbox({ publicOrigin });
25917
+ const inbox = new MemoryEventInbox({ publicOrigin, independentWebhookIds: ctx.profile.id === BETA_PROFILE_ID });
25914
25918
  receiver?.attach(inbox);
25915
25919
  const record = {
25916
25920
  id: `esub_cli_${randomBytes(8).toString("hex")}`,
@@ -26033,6 +26037,7 @@ function registerList(events) {
26033
26037
  const ctx = buildContext(options, command);
26034
26038
  const result = await withEventsConnection(options, ctx, async (manager, serverId) => {
26035
26039
  const support = assertEventsDeclaredOrForced(manager, serverId, {
26040
+ profile: ctx.profile,
26036
26041
  force: options.force,
26037
26042
  serverLabel: ctx.target,
26038
26043
  warn: ctx.warn
@@ -26074,6 +26079,7 @@ function registerPoll(events) {
26074
26079
  }
26075
26080
  const result = await withEventsConnection(options, ctx, async (manager, serverId) => {
26076
26081
  assertEventsDeclaredOrForced(manager, serverId, {
26082
+ profile: ctx.profile,
26077
26083
  force: options.force,
26078
26084
  serverLabel: ctx.target,
26079
26085
  warn: ctx.warn
@@ -26181,6 +26187,7 @@ function registerSubscribe(events) {
26181
26187
  const secret = resolveSecret(options.secretFile, ctx);
26182
26188
  const result = await withEventsConnection(options, ctx, async (manager, serverId) => {
26183
26189
  assertEventsDeclaredOrForced(manager, serverId, {
26190
+ profile: ctx.profile,
26184
26191
  force: options.force,
26185
26192
  serverLabel: ctx.target,
26186
26193
  warn: ctx.warn
@@ -26226,6 +26233,7 @@ function registerUnsubscribe(events) {
26226
26233
  }
26227
26234
  const outcome = await withEventsConnection(options, ctx, async (manager, serverId) => {
26228
26235
  assertEventsDeclaredOrForced(manager, serverId, {
26236
+ profile: ctx.profile,
26229
26237
  force: options.force,
26230
26238
  serverLabel: ctx.target,
26231
26239
  warn: ctx.warn
@@ -26253,8 +26261,7 @@ function registerConformance(events) {
26253
26261
  "Run the profile-aware MCP Events conformance checks (MUST fails, SHOULD warns). Result JSON on stdout, a table on stderr. Exit 0 passed, 1 failed, 3 incomplete."
26254
26262
  ).option(
26255
26263
  "--profile <profile>",
26256
- 'Profile to judge by: "draft" (draft@28ec35e) or "chatgpt" (chatgpt@2026-11-05)',
26257
- "draft"
26264
+ 'Profile to judge by: "beta", "draft" or "chatgpt" (default: negotiated Events version)'
26258
26265
  ).option(
26259
26266
  "--protocol-version <version>",
26260
26267
  "Pin the MCP protocol version (e.g. 2026-07-28). HTTP targets only."
@@ -26352,7 +26359,7 @@ function registerConformance(events) {
26352
26359
  }
26353
26360
  function registerEventsCommands(program) {
26354
26361
  const events = program.command("events").description(
26355
- "List, poll, watch, subscribe to and conformance-check MCP Events (triggers, draft@28ec35e)"
26362
+ "List, poll, watch, subscribe to and conformance-check MCP Events (poll, push and webhook)"
26356
26363
  );
26357
26364
  registerList(events);
26358
26365
  registerPoll(events);
@@ -26497,7 +26504,14 @@ async function runTaskAugmentedToolCall(args) {
26497
26504
  request: { signal }
26498
26505
  });
26499
26506
  } catch (error) {
26500
- if (!signal.aborted) throw error;
26507
+ if (!signal.aborted) {
26508
+ if (isMCPTasksWireError(error)) {
26509
+ throw cliError("TASKS_UNSUPPORTED", error.message, 1, {
26510
+ wire: error.wire
26511
+ });
26512
+ }
26513
+ throw error;
26514
+ }
26501
26515
  return {
26502
26516
  aborted: { wire: support.wire, phase: "create" },
26503
26517
  created: null,