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.
@@ -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
- * Clean V2-only adapter for ollama-ai-provider that converts V1 models to V2 interfaces.
5
- * This adapter ensures compatibility with AI SDK 5.0 by providing V2-compliant models.
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 { LanguageModelV2, EmbeddingModelV2 } from '@ai-sdk/provider';
11
+ import type { EmbeddingModelV4, LanguageModelV4 } from "@ai-sdk/provider";
8
12
  /**
9
- * V2-compliant Ollama Provider
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 provider;
21
+ private context;
18
22
  constructor(options?: OllamaV2ProviderOptions);
19
23
  /**
20
- * Get V2-compliant language model
24
+ * Get language model
21
25
  */
22
- languageModel(modelId: string): LanguageModelV2;
26
+ languageModel(modelId: string): LanguageModelV4;
23
27
  /**
24
- * Get V2-compliant embedding model
28
+ * Get embedding model
25
29
  */
26
- embeddingModel<VALUE = string>(modelId: string): EmbeddingModelV2<VALUE>;
30
+ embeddingModel(modelId: string): EmbeddingModelV4;
27
31
  }
28
32
  /**
29
- * Create a V2-compliant Ollama provider
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: (_config: any) => {
32
- chat: () => Promise<never>;
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["defaultResponses"]) => MockModalityClient;
100
+ readonly CUSTOM_CLIENT: (responses: MockClientConfig['defaultResponses']) => MockModalityClient;
101
101
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.6.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": "^1.6.2"
15
+ "modality-mcp-kit": "^2.0.1"
16
16
  },
17
17
  "dependencies": {
18
- "@ai-sdk/google": "^3.0.58",
19
- "ai": "^6.0.146",
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.11",
24
- "modality-bun-kit": "^0.0.4",
25
- "typescript": "^6.0.2"
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
  }