@modelcontextprotocol/sdk
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -0,4 +1,9 @@ | ||
import { type ErrorEvent, type EventSourceInit } from "eventsource"; | ||
import { Transport } from "../shared/transport.js"; | ||
import { JSONRPCMessage } from "../types.js"; | ||
import { type EventSourceInit } from "eventsource"; | ||
export declare class SseError extends Error { | ||
readonly code: number | undefined; | ||
readonly event: ErrorEvent; | ||
constructor(code: number | undefined, message: string | undefined, event: ErrorEvent); | ||
} | ||
/** | ||
@@ -5,0 +10,0 @@ * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SSEClientTransport = void 0; | ||
exports.SSEClientTransport = exports.SseError = void 0; | ||
const eventsource_1 = require("eventsource"); | ||
const types_js_1 = require("../types.js"); | ||
const eventsource_1 = require("eventsource"); | ||
class SseError extends Error { | ||
constructor(code, message, event) { | ||
super(`SSE error: ${message}`); | ||
this.code = code; | ||
this.event = event; | ||
} | ||
} | ||
exports.SseError = SseError; | ||
/** | ||
@@ -25,3 +33,3 @@ * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving | ||
var _a; | ||
const error = new Error(`SSE error: ${JSON.stringify(event)}`); | ||
const error = new SseError(event.code, event.message, event); | ||
reject(error); | ||
@@ -28,0 +36,0 @@ (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); |
@@ -0,4 +1,9 @@ | ||
import { type ErrorEvent, type EventSourceInit } from "eventsource"; | ||
import { Transport } from "../shared/transport.js"; | ||
import { JSONRPCMessage } from "../types.js"; | ||
import { type EventSourceInit } from "eventsource"; | ||
export declare class SseError extends Error { | ||
readonly code: number | undefined; | ||
readonly event: ErrorEvent; | ||
constructor(code: number | undefined, message: string | undefined, event: ErrorEvent); | ||
} | ||
/** | ||
@@ -5,0 +10,0 @@ * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving |
@@ -0,3 +1,10 @@ | ||
import { EventSource } from "eventsource"; | ||
import { JSONRPCMessageSchema } from "../types.js"; | ||
import { EventSource } from "eventsource"; | ||
export class SseError extends Error { | ||
constructor(code, message, event) { | ||
super(`SSE error: ${message}`); | ||
this.code = code; | ||
this.event = event; | ||
} | ||
} | ||
/** | ||
@@ -22,3 +29,3 @@ * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving | ||
var _a; | ||
const error = new Error(`SSE error: ${JSON.stringify(event)}`); | ||
const error = new SseError(event.code, event.message, event); | ||
reject(error); | ||
@@ -25,0 +32,0 @@ (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); |
{ | ||
"name": "@modelcontextprotocol/sdk", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Model Context Protocol implementation for TypeScript", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3353018
63672