modality-ai 0.1.2 → 0.1.4
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/index.js
CHANGED
|
@@ -126584,9 +126584,15 @@ function jsonSchemaToZod(schema2) {
|
|
|
126584
126584
|
return exports_external.any();
|
|
126585
126585
|
}
|
|
126586
126586
|
}
|
|
126587
|
-
var
|
|
126588
|
-
const {
|
|
126589
|
-
|
|
126587
|
+
var createStdioToHttpClient = (options) => {
|
|
126588
|
+
const {
|
|
126589
|
+
command = "bunx",
|
|
126590
|
+
args: optionArgs = [],
|
|
126591
|
+
env: optionEnv,
|
|
126592
|
+
pkg,
|
|
126593
|
+
timeout: timeout6 = 120000
|
|
126594
|
+
} = options || {};
|
|
126595
|
+
const args2 = pkg ? [pkg, ...optionArgs] : optionArgs;
|
|
126590
126596
|
const env = {
|
|
126591
126597
|
...Object.fromEntries(Object.entries(process.env).filter((entry) => entry[1] !== undefined)),
|
|
126592
126598
|
...optionEnv || {}
|
|
@@ -126596,6 +126602,10 @@ var setupStdioToHttpTools = async (mcpServer, options) => {
|
|
|
126596
126602
|
args: args2,
|
|
126597
126603
|
env
|
|
126598
126604
|
}, timeout6);
|
|
126605
|
+
return client;
|
|
126606
|
+
};
|
|
126607
|
+
var setupStdioToHttpTools = async (mcpServer, options) => {
|
|
126608
|
+
const client = createStdioToHttpClient(options);
|
|
126599
126609
|
const tools = await client.listTools();
|
|
126600
126610
|
const aiTools = {};
|
|
126601
126611
|
for (const tool2 of tools.tools) {
|
|
@@ -126618,6 +126628,7 @@ var setupStdioToHttpTools = async (mcpServer, options) => {
|
|
|
126618
126628
|
export {
|
|
126619
126629
|
setupStdioToHttpTools,
|
|
126620
126630
|
mergeToolCallsAndResults,
|
|
126631
|
+
createStdioToHttpClient,
|
|
126621
126632
|
createAIChat,
|
|
126622
126633
|
OllamaProvider,
|
|
126623
126634
|
ModalityClient
|
|
@@ -32,13 +32,13 @@ declare class ModalityClientImpl {
|
|
|
32
32
|
listTools(): Promise<ListToolsResult>;
|
|
33
33
|
parseContent(toolResult: any): any;
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
declare function
|
|
37
|
-
declare function
|
|
35
|
+
export type ModalityClientInstance = ModalityClientImpl;
|
|
36
|
+
declare function http(url: string, timeout?: number, options?: StreamableHTTPClientTransportOptions): ModalityClientInstance;
|
|
37
|
+
declare function stdio(serverParams: StdioServerParameters, timeout?: number): ModalityClientInstance;
|
|
38
|
+
declare function sse(url: string, timeout?: number, options?: SSEClientTransportOptions): ModalityClientInstance;
|
|
38
39
|
export declare const ModalityClient: {
|
|
39
40
|
http: typeof http;
|
|
40
41
|
stdio: typeof stdio;
|
|
41
42
|
sse: typeof sse;
|
|
42
43
|
};
|
|
43
|
-
export type ModalityClientInstance = ModalityClientImpl;
|
|
44
44
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { createAIChat, mergeToolCallsAndResults, OllamaProvider, } from "./util_ai_model";
|
|
2
2
|
export { ModalityClient } from "./ModalityClient";
|
|
3
|
-
export { setupStdioToHttpTools } from "./setupStdioToHttpTools";
|
|
3
|
+
export { setupStdioToHttpTools, createStdioToHttpClient, } from "./setupStdioToHttpTools";
|
|
4
4
|
export type { ModalityClientInstance } from "./ModalityClient";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ModalityFastMCP, type AITools } from "modality-mcp-kit";
|
|
2
|
+
import { type ModalityClientInstance } from "./ModalityClient";
|
|
2
3
|
interface StdioToHttpOptions {
|
|
3
4
|
command?: string;
|
|
4
5
|
args?: string[];
|
|
@@ -6,6 +7,7 @@ interface StdioToHttpOptions {
|
|
|
6
7
|
pkg?: string;
|
|
7
8
|
timeout?: number;
|
|
8
9
|
}
|
|
10
|
+
export declare const createStdioToHttpClient: (options?: StdioToHttpOptions) => ModalityClientInstance;
|
|
9
11
|
/**
|
|
10
12
|
* Setup Chrome DevTools MCP tools
|
|
11
13
|
* Dynamically loads all tools from chrome-devtools-mcp@latest and exposes them as AITools
|
package/package.json
CHANGED