modality-ai 0.6.0 → 0.7.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/dist/index.js +36920 -46047
- package/dist/types/index.d.ts +1 -0
- package/dist/types/provider/ollama-v2-adapter.d.ts +14 -10
- package/dist/types/schemas/schemas_modality.d.ts +5 -5
- package/dist/types/util_tests/aiModelMocks.d.ts +2 -6
- package/dist/types/util_tests/modalityClientMocks.d.ts +1 -1
- package/package.json +11 -9
package/dist/types/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export { createAIChat, mergeToolCallsAndResults, OllamaProvider, } from "./util_
|
|
|
2
2
|
export { ModalityClient } from "./ModalityClient";
|
|
3
3
|
export { setupStdioToHttpTools, createStdioClient, } from "./setupStdioToHttpTools";
|
|
4
4
|
export type { ModalityClientInstance } from "./ModalityClient";
|
|
5
|
+
export type { ModelMessage } from "ai";
|
|
5
6
|
export type { StdioClientOptions } from "./setupStdioToHttpTools";
|
|
6
7
|
export { CLIBrowserOAuthProvider } from "./mcp-oauth-provider";
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Ollama V2 Adapter
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Standalone provider for Ollama that talks to the Ollama REST API directly
|
|
5
|
+
* (no `ollama-ai-provider` dependency). Implements the LanguageModelV4 and
|
|
6
|
+
* EmbeddingModelV4 specifications — the native spec for ai@7.x.
|
|
7
|
+
*
|
|
8
|
+
* API reference: https://github.com/ollama/ollama/blob/main/docs/api.md
|
|
9
|
+
* (message conversion modeled after https://github.com/sgomez/ollama-ai-provider)
|
|
6
10
|
*/
|
|
7
|
-
import type {
|
|
11
|
+
import type { EmbeddingModelV4, LanguageModelV4 } from "@ai-sdk/provider";
|
|
8
12
|
/**
|
|
9
|
-
*
|
|
13
|
+
* Ollama Provider (V4 spec, native for ai@7.x)
|
|
10
14
|
*/
|
|
11
15
|
export interface OllamaV2ProviderOptions {
|
|
12
16
|
baseURL?: string;
|
|
@@ -14,18 +18,18 @@ export interface OllamaV2ProviderOptions {
|
|
|
14
18
|
fetch?: typeof fetch;
|
|
15
19
|
}
|
|
16
20
|
export declare class OllamaV2Provider {
|
|
17
|
-
private
|
|
21
|
+
private context;
|
|
18
22
|
constructor(options?: OllamaV2ProviderOptions);
|
|
19
23
|
/**
|
|
20
|
-
* Get
|
|
24
|
+
* Get language model
|
|
21
25
|
*/
|
|
22
|
-
languageModel(modelId: string):
|
|
26
|
+
languageModel(modelId: string): LanguageModelV4;
|
|
23
27
|
/**
|
|
24
|
-
* Get
|
|
28
|
+
* Get embedding model
|
|
25
29
|
*/
|
|
26
|
-
embeddingModel
|
|
30
|
+
embeddingModel(modelId: string): EmbeddingModelV4;
|
|
27
31
|
}
|
|
28
32
|
/**
|
|
29
|
-
* Create
|
|
33
|
+
* Create an Ollama provider
|
|
30
34
|
*/
|
|
31
35
|
export declare function createOllamaV2(options?: OllamaV2ProviderOptions): OllamaV2Provider;
|
|
@@ -3,9 +3,9 @@ export declare const DEFAULT_AI_PROVIDER = "gemini";
|
|
|
3
3
|
export declare const OLLAMA_URL: string;
|
|
4
4
|
export declare const chatMessageSchema: z.ZodObject<{
|
|
5
5
|
role: z.ZodEnum<{
|
|
6
|
-
user: "user";
|
|
7
6
|
assistant: "assistant";
|
|
8
7
|
system: "system";
|
|
8
|
+
user: "user";
|
|
9
9
|
}>;
|
|
10
10
|
content: z.ZodString;
|
|
11
11
|
}, z.core.$strip>;
|
|
@@ -38,9 +38,9 @@ declare const chatOptionsSchema: z.ZodObject<{
|
|
|
38
38
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
39
39
|
topP: z.ZodOptional<z.ZodNumber>;
|
|
40
40
|
toolChoice: z.ZodOptional<z.ZodEnum<{
|
|
41
|
-
required: "required";
|
|
42
41
|
auto: "auto";
|
|
43
42
|
none: "none";
|
|
43
|
+
required: "required";
|
|
44
44
|
}>>;
|
|
45
45
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
46
46
|
}, z.core.$strip>;
|
|
@@ -54,8 +54,8 @@ export declare const simpleModalityAnswerSchema: z.ZodObject<{
|
|
|
54
54
|
useMemory: z.ZodDefault<z.ZodBoolean>;
|
|
55
55
|
}, z.core.$strip>;
|
|
56
56
|
declare const providerEnum: z.ZodOptional<z.ZodEnum<{
|
|
57
|
-
ollama: "ollama";
|
|
58
57
|
gemini: "gemini";
|
|
58
|
+
ollama: "ollama";
|
|
59
59
|
vscode: "vscode";
|
|
60
60
|
}>>;
|
|
61
61
|
export declare const modalityAnswerSchema: z.ZodObject<{
|
|
@@ -63,8 +63,8 @@ export declare const modalityAnswerSchema: z.ZodObject<{
|
|
|
63
63
|
context: z.ZodOptional<z.ZodString>;
|
|
64
64
|
useMemory: z.ZodDefault<z.ZodBoolean>;
|
|
65
65
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
66
|
-
ollama: "ollama";
|
|
67
66
|
gemini: "gemini";
|
|
67
|
+
ollama: "ollama";
|
|
68
68
|
vscode: "vscode";
|
|
69
69
|
}>>;
|
|
70
70
|
ollama: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
@@ -84,9 +84,9 @@ export declare const modalityAnswerSchema: z.ZodObject<{
|
|
|
84
84
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
85
85
|
topP: z.ZodOptional<z.ZodNumber>;
|
|
86
86
|
toolChoice: z.ZodOptional<z.ZodEnum<{
|
|
87
|
-
required: "required";
|
|
88
87
|
auto: "auto";
|
|
89
88
|
none: "none";
|
|
89
|
+
required: "required";
|
|
90
90
|
}>>;
|
|
91
91
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
92
92
|
}, z.core.$strip>>>;
|
|
@@ -28,12 +28,8 @@ export declare const createAiModelMockModule: () => {
|
|
|
28
28
|
OllamaProvider: typeof MockOllamaProvider;
|
|
29
29
|
GeminiProvider: typeof MockGeminiProvider;
|
|
30
30
|
AIChat: typeof MockAIChat;
|
|
31
|
-
createOllamaChat:
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
createGeminiChat: (_config: any) => {
|
|
35
|
-
chat: () => Promise<never>;
|
|
36
|
-
};
|
|
31
|
+
createOllamaChat: typeof createMockOllamaChat;
|
|
32
|
+
createGeminiChat: typeof createMockGeminiChat;
|
|
37
33
|
AIConfig: any;
|
|
38
34
|
ChatOptions: any;
|
|
39
35
|
ChatResponse: any;
|
|
@@ -97,5 +97,5 @@ export declare const MOCK_SCENARIOS: {
|
|
|
97
97
|
/**
|
|
98
98
|
* Client with custom responses
|
|
99
99
|
*/
|
|
100
|
-
readonly CUSTOM_CLIENT: (responses: MockClientConfig[
|
|
100
|
+
readonly CUSTOM_CLIENT: (responses: MockClientConfig['defaultResponses']) => MockModalityClient;
|
|
101
101
|
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.7.0",
|
|
3
3
|
"name": "modality-ai",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
@@ -12,17 +12,16 @@
|
|
|
12
12
|
"license": "ISC",
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
15
|
-
"modality-mcp-kit": "^
|
|
15
|
+
"modality-mcp-kit": "^2.0.1"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@ai-sdk/google": "^
|
|
19
|
-
"ai": "^
|
|
20
|
-
"ollama-ai-provider": "^1.2.0"
|
|
18
|
+
"@ai-sdk/google": "^4.0.10",
|
|
19
|
+
"ai": "^7.0.18"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
23
|
-
"@types/bun": "^1.3.
|
|
24
|
-
"modality-bun-kit": "^
|
|
25
|
-
"typescript": "^
|
|
22
|
+
"@types/bun": "^1.3.14",
|
|
23
|
+
"modality-bun-kit": "^1.3.14",
|
|
24
|
+
"typescript": "^7.0.2"
|
|
26
25
|
},
|
|
27
26
|
"exports": {
|
|
28
27
|
"types": "./dist/types/index.d.ts",
|
|
@@ -41,5 +40,8 @@
|
|
|
41
40
|
"test": "npm run build && bun test",
|
|
42
41
|
"prepublishOnly": "npm t"
|
|
43
42
|
},
|
|
44
|
-
"files": ["package.json", "README.md", "dist"]
|
|
43
|
+
"files": ["package.json", "README.md", "dist"],
|
|
44
|
+
"patchedDependencies": {
|
|
45
|
+
"sury@11.0.0-alpha.9": "patches/sury@11.0.0-alpha.9.patch"
|
|
46
|
+
}
|
|
45
47
|
}
|