@mcp-ts/sdk 1.1.0 → 1.2.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.
- package/README.md +21 -10
- package/dist/adapters/agui-adapter.js +0 -1
- package/dist/adapters/agui-adapter.js.map +1 -1
- package/dist/adapters/agui-adapter.mjs +0 -1
- package/dist/adapters/agui-adapter.mjs.map +1 -1
- package/dist/adapters/agui-middleware.d.mts +5 -0
- package/dist/adapters/agui-middleware.d.ts +5 -0
- package/dist/adapters/agui-middleware.js +12 -23
- package/dist/adapters/agui-middleware.js.map +1 -1
- package/dist/adapters/agui-middleware.mjs +12 -23
- package/dist/adapters/agui-middleware.mjs.map +1 -1
- package/dist/client/react.d.mts +351 -3
- package/dist/client/react.d.ts +351 -3
- package/dist/client/react.js +308 -6
- package/dist/client/react.js.map +1 -1
- package/dist/client/react.mjs +302 -7
- package/dist/client/react.mjs.map +1 -1
- package/dist/client/vue.js +1 -1
- package/dist/client/vue.js.map +1 -1
- package/dist/client/vue.mjs +1 -1
- package/dist/client/vue.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -1
- package/dist/index.mjs.map +1 -1
- package/dist/shared/index.d.mts +38 -2
- package/dist/shared/index.d.ts +38 -2
- package/dist/shared/index.js +19 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/index.mjs +18 -1
- package/dist/shared/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/adapters/agui-adapter.ts +2 -4
- package/src/adapters/agui-middleware.ts +15 -27
- package/src/client/react/agui-subscriber.ts +275 -0
- package/src/client/react/index.ts +23 -4
- package/src/client/react/use-agui-subscriber.ts +270 -0
- package/src/client/react/{use-mcp-app.ts → use-app-host.ts} +2 -2
- package/src/client/react/use-mcp-app-iframe.ts +164 -0
- package/src/client/react/{useMcp.ts → use-mcp.ts} +2 -2
- package/src/client/vue/index.ts +1 -1
- package/src/shared/index.ts +6 -1
- package/src/shared/tool-utils.ts +61 -0
- /package/src/client/vue/{useMcp.ts → use-mcp.ts} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -3248,6 +3248,23 @@ function isCallToolSuccess(response) {
|
|
|
3248
3248
|
return "content" in response;
|
|
3249
3249
|
}
|
|
3250
3250
|
|
|
3251
|
-
|
|
3251
|
+
// src/shared/tool-utils.ts
|
|
3252
|
+
function getToolUiResourceUri(tool) {
|
|
3253
|
+
const meta = tool._meta;
|
|
3254
|
+
if (!meta?.ui) return void 0;
|
|
3255
|
+
const ui = meta.ui;
|
|
3256
|
+
if (typeof ui !== "object" || !ui) return void 0;
|
|
3257
|
+
if (ui.visibility && !ui.visibility.includes("app")) return void 0;
|
|
3258
|
+
return typeof ui.resourceUri === "string" ? ui.resourceUri : typeof ui.uri === "string" ? ui.uri : void 0;
|
|
3259
|
+
}
|
|
3260
|
+
function findToolByName(connections, toolName) {
|
|
3261
|
+
for (const conn of connections) {
|
|
3262
|
+
const tool = conn.tools.find((t) => t.name === toolName);
|
|
3263
|
+
if (tool) return tool;
|
|
3264
|
+
}
|
|
3265
|
+
return void 0;
|
|
3266
|
+
}
|
|
3267
|
+
|
|
3268
|
+
export { AppHost, AuthenticationError, ConfigurationError, ConnectionError, DEFAULT_CLIENT_NAME, DEFAULT_CLIENT_URI, DEFAULT_HEARTBEAT_INTERVAL_MS, DEFAULT_LOGO_URI, DEFAULT_POLICY_URI, DisposableStore, Emitter, InvalidStateError, MCPClient, MCP_CLIENT_NAME, MCP_CLIENT_VERSION, McpError, MultiSessionClient, NotConnectedError, REDIS_KEY_PREFIX, RpcErrorCodes, SESSION_TTL_SECONDS, SOFTWARE_ID, SOFTWARE_VERSION, SSEClient, SSEConnectionManager, STATE_EXPIRATION_MS, SessionNotFoundError, SessionValidationError, StorageOAuthClientProvider, TOKEN_EXPIRY_BUFFER_MS, ToolExecutionError, UnauthorizedError, createNextMcpHandler, createSSEHandler, findToolByName, getToolUiResourceUri, isCallToolSuccess, isConnectAuthRequired, isConnectError, isConnectSuccess, isListToolsSuccess, sanitizeServerLabel, storage };
|
|
3252
3269
|
//# sourceMappingURL=index.mjs.map
|
|
3253
3270
|
//# sourceMappingURL=index.mjs.map
|