@prefecthq/fastmcp-ts 0.0.2-alpha.0 → 0.0.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/cli/index.cjs +43 -38
- package/dist/cli/index.cjs.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.js +12 -7
- package/dist/client.js.map +1 -1
- package/dist/server.d.ts +5 -5
- package/dist/server.js +6 -6
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CreateMessageResult, CreateMessageResultWithTools, ContentBlock, CreateMessageRequestParams, LoggingLevel, ElicitRequestParams, ElicitResult, Tool, Resource, Prompt, ResourceTemplate, ResourceContents, GetPromptResult, Root, ModelPreferences, SamplingMessage, ToolChoice } from '@modelcontextprotocol/sdk/types';
|
|
2
|
-
export { ContentBlock, CreateMessageRequestParams, CreateMessageResult, CreateMessageResultWithTools, ElicitRequestParams, ElicitResult, GetPromptResult, LoggingLevel, ModelPreferences, Prompt, PromptArgument, PromptMessage, Resource, ResourceContents, ResourceTemplate, Root, SamplingMessage, Tool, ToolChoice, ToolResultContent, ToolUseContent } from '@modelcontextprotocol/sdk/types';
|
|
1
|
+
import { CreateMessageResult, CreateMessageResultWithTools, ContentBlock, CreateMessageRequestParams, LoggingLevel, ElicitRequestParams, ElicitResult, Tool, Resource, Prompt, ResourceTemplate, ResourceContents, GetPromptResult, Root, ModelPreferences, SamplingMessage, ToolChoice } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
export { ContentBlock, CreateMessageRequestParams, CreateMessageResult, CreateMessageResultWithTools, ElicitRequestParams, ElicitResult, GetPromptResult, LoggingLevel, ModelPreferences, Prompt, PromptArgument, PromptMessage, Resource, ResourceContents, ResourceTemplate, Root, SamplingMessage, Tool, ToolChoice, ToolResultContent, ToolUseContent } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
import { OAuthClientProvider, OAuthDiscoveryState } from '@modelcontextprotocol/sdk/client/auth.js';
|
|
4
4
|
import { OAuthClientMetadata, OAuthClientInformationMixed, OAuthTokens } from '@modelcontextprotocol/sdk/shared/auth.js';
|
|
5
|
-
import { Transport } from '@modelcontextprotocol/sdk/shared/transport';
|
|
5
|
+
import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
6
6
|
import Anthropic from '@anthropic-ai/sdk';
|
|
7
7
|
import OpenAI from 'openai';
|
|
8
8
|
import { GoogleGenAI } from '@google/genai';
|
package/dist/client.js
CHANGED
|
@@ -378,11 +378,10 @@ function openBrowser(url) {
|
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
// src/client/transports.ts
|
|
381
|
-
import {
|
|
382
|
-
import {
|
|
383
|
-
import {
|
|
384
|
-
import {
|
|
385
|
-
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio";
|
|
381
|
+
import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
|
|
382
|
+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
383
|
+
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
384
|
+
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
386
385
|
function isMcpServerLike(value) {
|
|
387
386
|
return typeof value === "object" && value !== null && "connect" in value && typeof value.connect === "function";
|
|
388
387
|
}
|
|
@@ -401,6 +400,12 @@ var StdioTransport = class {
|
|
|
401
400
|
this.cwd = options?.cwd;
|
|
402
401
|
}
|
|
403
402
|
};
|
|
403
|
+
function normalizeHeaders(headers) {
|
|
404
|
+
if (!headers) return {};
|
|
405
|
+
if (headers instanceof Headers) return Object.fromEntries(headers.entries());
|
|
406
|
+
if (Array.isArray(headers)) return Object.fromEntries(headers);
|
|
407
|
+
return { ...headers };
|
|
408
|
+
}
|
|
404
409
|
function isAsyncAuth(auth) {
|
|
405
410
|
return "kind" in auth;
|
|
406
411
|
}
|
|
@@ -531,7 +536,7 @@ import {
|
|
|
531
536
|
ListRootsRequestSchema as ListRootsRequestSchema2,
|
|
532
537
|
LoggingMessageNotificationSchema as LoggingMessageNotificationSchema2,
|
|
533
538
|
ResourceUpdatedNotificationSchema as ResourceUpdatedNotificationSchema2
|
|
534
|
-
} from "@modelcontextprotocol/sdk/types";
|
|
539
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
535
540
|
|
|
536
541
|
// src/client/multi-server.ts
|
|
537
542
|
import { Client as SdkClient } from "@modelcontextprotocol/sdk/client";
|
|
@@ -542,7 +547,7 @@ import {
|
|
|
542
547
|
CreateMessageRequestSchema,
|
|
543
548
|
ElicitRequestSchema,
|
|
544
549
|
ListRootsRequestSchema
|
|
545
|
-
} from "@modelcontextprotocol/sdk/types";
|
|
550
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
546
551
|
var MultiServerClient = class _MultiServerClient {
|
|
547
552
|
_clients = /* @__PURE__ */ new Map();
|
|
548
553
|
_connectPromise = null;
|