poe-code 3.0.423-beta.2 → 3.0.423-beta.3

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.
@@ -109,7 +109,7 @@ export declare class StreamableHttpTransport {
109
109
  private handleDelete;
110
110
  private handleOptions;
111
111
  private readSessionId;
112
- private hasProtocolVersion;
112
+ private acceptsProtocolVersion;
113
113
  private readRequestId;
114
114
  private readOrigin;
115
115
  private readToolName;
@@ -208,7 +208,7 @@ export class StreamableHttpTransport {
208
208
  }
209
209
  sessionId = headerSessionId;
210
210
  this.touchSession(sessionId);
211
- if (session?.protocolVersion !== undefined && !this.hasProtocolVersion(req, session.protocolVersion)) {
211
+ if (session?.protocolVersion !== undefined && !this.acceptsProtocolVersion(req, session.protocolVersion)) {
212
212
  this.respondWithStatus(res, 400);
213
213
  return;
214
214
  }
@@ -355,7 +355,7 @@ export class StreamableHttpTransport {
355
355
  this.touchSession(sessionId);
356
356
  if (session.initialized
357
357
  && session.protocolVersion !== undefined
358
- && !this.hasProtocolVersion(req, session.protocolVersion)) {
358
+ && !this.acceptsProtocolVersion(req, session.protocolVersion)) {
359
359
  this.respondWithStatus(res, 400);
360
360
  return;
361
361
  }
@@ -414,7 +414,7 @@ export class StreamableHttpTransport {
414
414
  return;
415
415
  }
416
416
  const session = this.getActiveSession(sessionId);
417
- if (session?.protocolVersion !== undefined && !this.hasProtocolVersion(req, session.protocolVersion)) {
417
+ if (session?.protocolVersion !== undefined && !this.acceptsProtocolVersion(req, session.protocolVersion)) {
418
418
  this.respondWithStatus(res, 400);
419
419
  return;
420
420
  }
@@ -448,10 +448,10 @@ export class StreamableHttpTransport {
448
448
  const id = Array.isArray(value) ? value[0] : value;
449
449
  return id !== undefined && id.length > 0 ? id : undefined;
450
450
  }
451
- hasProtocolVersion(req, protocolVersion) {
451
+ acceptsProtocolVersion(req, protocolVersion) {
452
452
  const value = req.headers["mcp-protocol-version"];
453
453
  const header = Array.isArray(value) ? value[0] : value;
454
- return header === protocolVersion;
454
+ return header === undefined || header === protocolVersion;
455
455
  }
456
456
  readRequestId(req) {
457
457
  const value = req.headers["x-request-id"];
@@ -830,6 +830,12 @@ function appendHelpMetadata(description, metadata) {
830
830
  function formatHelpFieldDescription(field) {
831
831
  const description = field.description ?? field.displayPath;
832
832
  const metadata = [];
833
+ if (field.schema.kind === "enum" && field.schema.values.length <= 8) {
834
+ const values = field.schema.values.map((value) => String(value)).join(", ");
835
+ if (values.length <= 120) {
836
+ metadata.push(`values: ${values}`);
837
+ }
838
+ }
833
839
  if (!field.optional && !field.hasDefault) {
834
840
  metadata.push("required");
835
841
  }