@gram-ai/elements 1.16.3 → 1.16.5
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/contexts/ElementsProvider.d.ts +1 -1
- package/dist/elements.cjs +120 -33
- package/dist/elements.css +1 -1
- package/dist/elements.js +28646 -8262
- package/dist/hooks/useMCPTools.d.ts +11 -0
- package/dist/hooks/useSession.d.ts +13 -0
- package/dist/{index-SAJg5Cz7.js → index-Bjdy_BPv.js} +378 -385
- package/dist/{index-C6vUoNWt.cjs → index-CqzaiyM-.cjs} +2 -2
- package/dist/lib/tools.d.ts +6 -0
- package/dist/lib/utils.d.ts +1 -1
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.js +1 -1
- package/dist/server.cjs +1 -29
- package/dist/server.d.ts +32 -4
- package/dist/server.js +21 -4069
- package/dist/types/index.d.ts +23 -11
- package/package.json +3 -1
- package/dist/index-BqoFmyxX.cjs +0 -60
- package/dist/index-CVZt-xeH.js +0 -14913
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GetSessionFn } from '../types';
|
|
2
|
+
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
|
|
3
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
4
|
+
type MCPToolsResult = Awaited<ReturnType<Awaited<ReturnType<typeof createMCPClient>>['tools']>>;
|
|
5
|
+
export declare function useMCPTools({ getSession, projectSlug, mcp, environment, }: {
|
|
6
|
+
getSession: GetSessionFn;
|
|
7
|
+
projectSlug: string;
|
|
8
|
+
mcp: string;
|
|
9
|
+
environment: Record<string, unknown>;
|
|
10
|
+
}): UseQueryResult<MCPToolsResult, Error>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GetSessionFn } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to fetch or retrieve the session token for the chat.
|
|
4
|
+
* If clientToken is provided in config, it will be used directly.
|
|
5
|
+
* Otherwise, if apiKey is provided, it will fetch a new session token.
|
|
6
|
+
*
|
|
7
|
+
* @param config - The ElementsConfig containing clientToken, apiKey, and projectSlug
|
|
8
|
+
* @returns The session token string or null
|
|
9
|
+
*/
|
|
10
|
+
export declare const useSession: ({ getSession, projectSlug, }: {
|
|
11
|
+
getSession: GetSessionFn;
|
|
12
|
+
projectSlug: string;
|
|
13
|
+
}) => string | null;
|