@yourgpt/llm-sdk 2.5.1-beta.6 → 2.6.0-beta.1

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.
Files changed (57) hide show
  1. package/README.md +77 -0
  2. package/dist/adapters/index.d.mts +54 -5
  3. package/dist/adapters/index.d.ts +54 -5
  4. package/dist/adapters/index.js +466 -169
  5. package/dist/adapters/index.mjs +466 -169
  6. package/dist/{base-C58Dsr9p.d.ts → base-BdTpUAWI.d.ts} +2 -1
  7. package/dist/{base-tNgbBaSo.d.mts → base-CkeT7u-O.d.mts} +2 -1
  8. package/dist/fallback/index.d.mts +4 -4
  9. package/dist/fallback/index.d.ts +4 -4
  10. package/dist/fallback/index.js +75 -39
  11. package/dist/fallback/index.mjs +75 -39
  12. package/dist/index.d.mts +8 -7
  13. package/dist/index.d.ts +8 -7
  14. package/dist/index.js +89 -30
  15. package/dist/index.mjs +89 -30
  16. package/dist/providers/anthropic/index.d.mts +3 -3
  17. package/dist/providers/anthropic/index.d.ts +3 -3
  18. package/dist/providers/azure/index.d.mts +3 -3
  19. package/dist/providers/azure/index.d.ts +3 -3
  20. package/dist/providers/azure/index.js +8 -3
  21. package/dist/providers/azure/index.mjs +8 -3
  22. package/dist/providers/fireworks/index.d.mts +3 -3
  23. package/dist/providers/fireworks/index.d.ts +3 -3
  24. package/dist/providers/fireworks/index.js +466 -169
  25. package/dist/providers/fireworks/index.mjs +466 -169
  26. package/dist/providers/google/index.d.mts +3 -3
  27. package/dist/providers/google/index.d.ts +3 -3
  28. package/dist/providers/google/index.js +466 -169
  29. package/dist/providers/google/index.mjs +466 -169
  30. package/dist/providers/ollama/index.d.mts +4 -4
  31. package/dist/providers/ollama/index.d.ts +4 -4
  32. package/dist/providers/openai/index.d.mts +6 -23
  33. package/dist/providers/openai/index.d.ts +6 -23
  34. package/dist/providers/openai/index.js +912 -500
  35. package/dist/providers/openai/index.mjs +912 -500
  36. package/dist/providers/openrouter/index.d.mts +3 -3
  37. package/dist/providers/openrouter/index.d.ts +3 -3
  38. package/dist/providers/openrouter/index.js +466 -169
  39. package/dist/providers/openrouter/index.mjs +466 -169
  40. package/dist/providers/togetherai/index.d.mts +3 -3
  41. package/dist/providers/togetherai/index.d.ts +3 -3
  42. package/dist/providers/togetherai/index.js +466 -169
  43. package/dist/providers/togetherai/index.mjs +466 -169
  44. package/dist/providers/xai/index.d.mts +3 -3
  45. package/dist/providers/xai/index.d.ts +3 -3
  46. package/dist/providers/xai/index.js +466 -169
  47. package/dist/providers/xai/index.mjs +466 -169
  48. package/dist/{types-BkQCSiIt.d.mts → types-BW3csYo5.d.mts} +22 -1
  49. package/dist/{types-BkQCSiIt.d.ts → types-BW3csYo5.d.ts} +22 -1
  50. package/dist/{types-B6dhnguR.d.mts → types-BWRYIvl_.d.mts} +11 -4
  51. package/dist/{types-CCxPmkmK.d.ts → types-CpXcT-tY.d.ts} +11 -4
  52. package/dist/{types-BQ31QIsA.d.ts → types-DA54bSmX.d.ts} +3 -11
  53. package/dist/{types-BSSiJW2o.d.mts → types-NOswlhm9.d.mts} +3 -11
  54. package/dist/yourgpt/index.d.mts +1 -1
  55. package/dist/yourgpt/index.d.ts +1 -1
  56. package/package.json +115 -48
  57. package/LICENSE +0 -21
@@ -1,5 +1,15 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ /** OpenAI reasoning controls. Omit to retain the model's default effort. */
4
+ type OpenAIReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
5
+ interface OpenAIParameterOptions {
6
+ reasoningEffort?: OpenAIReasoningEffort;
7
+ /** Use passthrough for compatible servers with different model rules. */
8
+ parameterPolicy?: "openai" | "passthrough";
9
+ /** Receives omitted-option warnings; defaults to console.warn. */
10
+ onWarning?: (message: string) => void;
11
+ }
12
+
3
13
  /**
4
14
  * Stream event types for llm-sdk
5
15
  * These types are used internally by the SDK for streaming responses
@@ -90,6 +100,12 @@ interface ErrorEvent extends BaseEvent {
90
100
  type: "error";
91
101
  message: string;
92
102
  code?: string;
103
+ status?: number;
104
+ providerCode?: string;
105
+ param?: string;
106
+ requestId?: string;
107
+ /** In-process cause, omitted from serialized error events. */
108
+ cause?: unknown;
93
109
  }
94
110
  /**
95
111
  * Tool call information
@@ -249,6 +265,7 @@ type ResponseFormat = {
249
265
  * LLM configuration
250
266
  */
251
267
  interface LLMConfig {
268
+ reasoningEffort?: OpenAIReasoningEffort;
252
269
  temperature?: number;
253
270
  maxTokens?: number;
254
271
  responseFormat?: ResponseFormat;
@@ -696,6 +713,8 @@ interface DoGenerateParams {
696
713
  messages: CoreMessage[];
697
714
  /** Tools available to the LLM (already formatted for provider) */
698
715
  tools?: unknown[];
716
+ /** OpenAI reasoning effort. Omit to preserve the model default. */
717
+ reasoningEffort?: OpenAIReasoningEffort;
699
718
  /** Temperature (0-2) */
700
719
  temperature?: number;
701
720
  /** Maximum tokens to generate */
@@ -774,6 +793,8 @@ interface GenerateTextParams {
774
793
  tools?: Record<string, Tool>;
775
794
  /** Maximum agentic steps (tool call loops) */
776
795
  maxSteps?: number;
796
+ /** OpenAI reasoning effort. Omit to preserve the model default. */
797
+ reasoningEffort?: OpenAIReasoningEffort;
777
798
  /** Temperature (0-2) */
778
799
  temperature?: number;
779
800
  /** Maximum tokens to generate */
@@ -960,4 +981,4 @@ interface StorageFile {
960
981
  filename?: string;
961
982
  }
962
983
 
963
- export { type ToolExecution as $, type ActionDefinition as A, type ToolResultChunk as B, type CoreMessage as C, type DoneEventMessage as D, type FinishChunk as E, type FilePart as F, type GenerateTextParams as G, type ErrorChunk as H, type ImagePart as I, type TokenUsage as J, type KnowledgeBaseConfig as K, type LanguageModel as L, type Message as M, type FinishReason as N, type ResponseOptions as O, type ProviderToolRuntimeOptions as P, type StorageFile as Q, type ResponseFormat as R, type StreamTextParams as S, type ToolContext as T, type UserMessage as U, DEFAULT_CAPABILITIES as V, type WebSearchConfig as W, type LLMConfig as X, type ToolLocation as Y, type UnifiedToolCall as Z, type UnifiedToolResult as _, type GenerateTextResult as a, type OpenAIToolSelectionHints as a0, type AnthropicToolSelectionHints as a1, type ToolNativeProviderHints as a2, type OpenAIProviderToolOptions as a3, type AnthropicProviderToolOptions as a4, type Citation as a5, type MessageAttachment as a6, type StreamTextResult as b, type Tool as c, type ToolDefinition as d, type ToolProfile as e, type StorageAdapter as f, type StreamEvent as g, type ToolCallInfo as h, type TokenUsageRaw as i, type ToolResponse as j, type StorageMessage as k, type ModelCapabilities as l, type DoGenerateParams as m, type DoGenerateResult as n, type SystemMessage as o, type AssistantMessage as p, type ToolMessage as q, type UserContentPart as r, type TextPart as s, type ToolCall as t, type ToolResult as u, type GenerateStep as v, type StreamPart as w, type StreamChunk as x, type TextDeltaChunk as y, type ToolCallChunk as z };
984
+ export { type UnifiedToolResult as $, type ActionDefinition as A, type ToolResultChunk as B, type CoreMessage as C, type DoneEventMessage as D, type FinishChunk as E, type FilePart as F, type GenerateTextParams as G, type ErrorChunk as H, type ImagePart as I, type TokenUsage as J, type KnowledgeBaseConfig as K, type LanguageModel as L, type Message as M, type FinishReason as N, type OpenAIReasoningEffort as O, type ProviderToolRuntimeOptions as P, type ResponseOptions as Q, type ResponseFormat as R, type StreamTextParams as S, type ToolContext as T, type UserMessage as U, type StorageFile as V, type WebSearchConfig as W, DEFAULT_CAPABILITIES as X, type LLMConfig as Y, type ToolLocation as Z, type UnifiedToolCall as _, type GenerateTextResult as a, type ToolExecution as a0, type OpenAIToolSelectionHints as a1, type AnthropicToolSelectionHints as a2, type ToolNativeProviderHints as a3, type OpenAIProviderToolOptions as a4, type AnthropicProviderToolOptions as a5, type Citation as a6, type OpenAIParameterOptions as a7, type MessageAttachment as a8, type StreamTextResult as b, type Tool as c, type ToolDefinition as d, type ToolProfile as e, type StorageAdapter as f, type StreamEvent as g, type ToolCallInfo as h, type TokenUsageRaw as i, type ToolResponse as j, type StorageMessage as k, type ModelCapabilities as l, type DoGenerateParams as m, type DoGenerateResult as n, type SystemMessage as o, type AssistantMessage as p, type ToolMessage as q, type UserContentPart as r, type TextPart as s, type ToolCall as t, type ToolResult as u, type GenerateStep as v, type StreamPart as w, type StreamChunk as x, type TextDeltaChunk as y, type ToolCallChunk as z };
@@ -1,5 +1,15 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ /** OpenAI reasoning controls. Omit to retain the model's default effort. */
4
+ type OpenAIReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
5
+ interface OpenAIParameterOptions {
6
+ reasoningEffort?: OpenAIReasoningEffort;
7
+ /** Use passthrough for compatible servers with different model rules. */
8
+ parameterPolicy?: "openai" | "passthrough";
9
+ /** Receives omitted-option warnings; defaults to console.warn. */
10
+ onWarning?: (message: string) => void;
11
+ }
12
+
3
13
  /**
4
14
  * Stream event types for llm-sdk
5
15
  * These types are used internally by the SDK for streaming responses
@@ -90,6 +100,12 @@ interface ErrorEvent extends BaseEvent {
90
100
  type: "error";
91
101
  message: string;
92
102
  code?: string;
103
+ status?: number;
104
+ providerCode?: string;
105
+ param?: string;
106
+ requestId?: string;
107
+ /** In-process cause, omitted from serialized error events. */
108
+ cause?: unknown;
93
109
  }
94
110
  /**
95
111
  * Tool call information
@@ -249,6 +265,7 @@ type ResponseFormat = {
249
265
  * LLM configuration
250
266
  */
251
267
  interface LLMConfig {
268
+ reasoningEffort?: OpenAIReasoningEffort;
252
269
  temperature?: number;
253
270
  maxTokens?: number;
254
271
  responseFormat?: ResponseFormat;
@@ -696,6 +713,8 @@ interface DoGenerateParams {
696
713
  messages: CoreMessage[];
697
714
  /** Tools available to the LLM (already formatted for provider) */
698
715
  tools?: unknown[];
716
+ /** OpenAI reasoning effort. Omit to preserve the model default. */
717
+ reasoningEffort?: OpenAIReasoningEffort;
699
718
  /** Temperature (0-2) */
700
719
  temperature?: number;
701
720
  /** Maximum tokens to generate */
@@ -774,6 +793,8 @@ interface GenerateTextParams {
774
793
  tools?: Record<string, Tool>;
775
794
  /** Maximum agentic steps (tool call loops) */
776
795
  maxSteps?: number;
796
+ /** OpenAI reasoning effort. Omit to preserve the model default. */
797
+ reasoningEffort?: OpenAIReasoningEffort;
777
798
  /** Temperature (0-2) */
778
799
  temperature?: number;
779
800
  /** Maximum tokens to generate */
@@ -960,4 +981,4 @@ interface StorageFile {
960
981
  filename?: string;
961
982
  }
962
983
 
963
- export { type ToolExecution as $, type ActionDefinition as A, type ToolResultChunk as B, type CoreMessage as C, type DoneEventMessage as D, type FinishChunk as E, type FilePart as F, type GenerateTextParams as G, type ErrorChunk as H, type ImagePart as I, type TokenUsage as J, type KnowledgeBaseConfig as K, type LanguageModel as L, type Message as M, type FinishReason as N, type ResponseOptions as O, type ProviderToolRuntimeOptions as P, type StorageFile as Q, type ResponseFormat as R, type StreamTextParams as S, type ToolContext as T, type UserMessage as U, DEFAULT_CAPABILITIES as V, type WebSearchConfig as W, type LLMConfig as X, type ToolLocation as Y, type UnifiedToolCall as Z, type UnifiedToolResult as _, type GenerateTextResult as a, type OpenAIToolSelectionHints as a0, type AnthropicToolSelectionHints as a1, type ToolNativeProviderHints as a2, type OpenAIProviderToolOptions as a3, type AnthropicProviderToolOptions as a4, type Citation as a5, type MessageAttachment as a6, type StreamTextResult as b, type Tool as c, type ToolDefinition as d, type ToolProfile as e, type StorageAdapter as f, type StreamEvent as g, type ToolCallInfo as h, type TokenUsageRaw as i, type ToolResponse as j, type StorageMessage as k, type ModelCapabilities as l, type DoGenerateParams as m, type DoGenerateResult as n, type SystemMessage as o, type AssistantMessage as p, type ToolMessage as q, type UserContentPart as r, type TextPart as s, type ToolCall as t, type ToolResult as u, type GenerateStep as v, type StreamPart as w, type StreamChunk as x, type TextDeltaChunk as y, type ToolCallChunk as z };
984
+ export { type UnifiedToolResult as $, type ActionDefinition as A, type ToolResultChunk as B, type CoreMessage as C, type DoneEventMessage as D, type FinishChunk as E, type FilePart as F, type GenerateTextParams as G, type ErrorChunk as H, type ImagePart as I, type TokenUsage as J, type KnowledgeBaseConfig as K, type LanguageModel as L, type Message as M, type FinishReason as N, type OpenAIReasoningEffort as O, type ProviderToolRuntimeOptions as P, type ResponseOptions as Q, type ResponseFormat as R, type StreamTextParams as S, type ToolContext as T, type UserMessage as U, type StorageFile as V, type WebSearchConfig as W, DEFAULT_CAPABILITIES as X, type LLMConfig as Y, type ToolLocation as Z, type UnifiedToolCall as _, type GenerateTextResult as a, type ToolExecution as a0, type OpenAIToolSelectionHints as a1, type AnthropicToolSelectionHints as a2, type ToolNativeProviderHints as a3, type OpenAIProviderToolOptions as a4, type AnthropicProviderToolOptions as a5, type Citation as a6, type OpenAIParameterOptions as a7, type MessageAttachment as a8, type StreamTextResult as b, type Tool as c, type ToolDefinition as d, type ToolProfile as e, type StorageAdapter as f, type StreamEvent as g, type ToolCallInfo as h, type TokenUsageRaw as i, type ToolResponse as j, type StorageMessage as k, type ModelCapabilities as l, type DoGenerateParams as m, type DoGenerateResult as n, type SystemMessage as o, type AssistantMessage as p, type ToolMessage as q, type UserContentPart as r, type TextPart as s, type ToolCall as t, type ToolResult as u, type GenerateStep as v, type StreamPart as w, type StreamChunk as x, type TextDeltaChunk as y, type ToolCallChunk as z };
@@ -1,4 +1,4 @@
1
- import { L as LLMAdapter } from './base-tNgbBaSo.mjs';
1
+ import { L as LLMAdapter } from './base-CkeT7u-O.mjs';
2
2
 
3
3
  /**
4
4
  * Fallback Chain & Routing Strategy Types
@@ -188,7 +188,14 @@ interface FallbackChainConfig {
188
188
  */
189
189
  onFallback?: (info: FallbackInfo) => void;
190
190
  /**
191
- * Custom predicate to decide whether an error should trigger a fallback.
191
+ * Additional errors that may advance to the next model without retrying the
192
+ * current model. Use a narrow compatibility predicate (status/code/param).
193
+ * Transient retries/fallbacks retain their existing behavior. Cancellation
194
+ * and failures after stream output never retry or fall back.
195
+ */
196
+ fallbackErrors?: (error: unknown) => boolean;
197
+ /**
198
+ * Custom predicate controlling same-model retries and subsequent fallback.
192
199
  *
193
200
  * By default, the following trigger fallback:
194
201
  * - HTTP 5xx server errors
@@ -202,8 +209,8 @@ interface FallbackChainConfig {
202
209
  *
203
210
  * @example
204
211
  * ```typescript
205
- * // Also fall back on any error
206
- * retryableErrors: () => true,
212
+ * // Retry only the transient failures your provider identifies.
213
+ * retryableErrors: (error) => isTransientProviderError(error),
207
214
  * ```
208
215
  */
209
216
  retryableErrors?: (error: unknown) => boolean;
@@ -1,4 +1,4 @@
1
- import { L as LLMAdapter } from './base-C58Dsr9p.js';
1
+ import { L as LLMAdapter } from './base-BdTpUAWI.js';
2
2
 
3
3
  /**
4
4
  * Fallback Chain & Routing Strategy Types
@@ -188,7 +188,14 @@ interface FallbackChainConfig {
188
188
  */
189
189
  onFallback?: (info: FallbackInfo) => void;
190
190
  /**
191
- * Custom predicate to decide whether an error should trigger a fallback.
191
+ * Additional errors that may advance to the next model without retrying the
192
+ * current model. Use a narrow compatibility predicate (status/code/param).
193
+ * Transient retries/fallbacks retain their existing behavior. Cancellation
194
+ * and failures after stream output never retry or fall back.
195
+ */
196
+ fallbackErrors?: (error: unknown) => boolean;
197
+ /**
198
+ * Custom predicate controlling same-model retries and subsequent fallback.
192
199
  *
193
200
  * By default, the following trigger fallback:
194
201
  * - HTTP 5xx server errors
@@ -202,8 +209,8 @@ interface FallbackChainConfig {
202
209
  *
203
210
  * @example
204
211
  * ```typescript
205
- * // Also fall back on any error
206
- * retryableErrors: () => true,
212
+ * // Retry only the transient failures your provider identifies.
213
+ * retryableErrors: (error) => isTransientProviderError(error),
207
214
  * ```
208
215
  */
209
216
  retryableErrors?: (error: unknown) => boolean;
@@ -1,13 +1,5 @@
1
- import { d as ToolDefinition, Z as UnifiedToolCall, _ as UnifiedToolResult } from './types-BkQCSiIt.js';
2
- import { L as LLMAdapter } from './base-C58Dsr9p.js';
3
-
4
- /**
5
- * Provider Types
6
- *
7
- * Defines interfaces for:
8
- * 1. Provider Formatters (for tool transformations in agent loop)
9
- * 2. Multi-provider architecture (AIProvider, capabilities, configs)
10
- */
1
+ import { a7 as OpenAIParameterOptions, d as ToolDefinition, _ as UnifiedToolCall, $ as UnifiedToolResult } from './types-BW3csYo5.js';
2
+ import { L as LLMAdapter } from './base-BdTpUAWI.js';
11
3
 
12
4
  /**
13
5
  * Provider formatter interface
@@ -259,7 +251,7 @@ interface BaseProviderConfig {
259
251
  /**
260
252
  * OpenAI provider configuration
261
253
  */
262
- interface OpenAIProviderConfig extends BaseProviderConfig {
254
+ interface OpenAIProviderConfig extends BaseProviderConfig, OpenAIParameterOptions {
263
255
  /** OpenAI organization ID */
264
256
  organization?: string;
265
257
  /** OpenAI project ID */
@@ -1,13 +1,5 @@
1
- import { d as ToolDefinition, Z as UnifiedToolCall, _ as UnifiedToolResult } from './types-BkQCSiIt.mjs';
2
- import { L as LLMAdapter } from './base-tNgbBaSo.mjs';
3
-
4
- /**
5
- * Provider Types
6
- *
7
- * Defines interfaces for:
8
- * 1. Provider Formatters (for tool transformations in agent loop)
9
- * 2. Multi-provider architecture (AIProvider, capabilities, configs)
10
- */
1
+ import { a7 as OpenAIParameterOptions, d as ToolDefinition, _ as UnifiedToolCall, $ as UnifiedToolResult } from './types-BW3csYo5.mjs';
2
+ import { L as LLMAdapter } from './base-CkeT7u-O.mjs';
11
3
 
12
4
  /**
13
5
  * Provider formatter interface
@@ -259,7 +251,7 @@ interface BaseProviderConfig {
259
251
  /**
260
252
  * OpenAI provider configuration
261
253
  */
262
- interface OpenAIProviderConfig extends BaseProviderConfig {
254
+ interface OpenAIProviderConfig extends BaseProviderConfig, OpenAIParameterOptions {
263
255
  /** OpenAI organization ID */
264
256
  organization?: string;
265
257
  /** OpenAI project ID */
@@ -1,4 +1,4 @@
1
- import { k as StorageMessage, f as StorageAdapter, Q as StorageFile } from '../types-BkQCSiIt.mjs';
1
+ import { k as StorageMessage, f as StorageAdapter, V as StorageFile } from '../types-BW3csYo5.mjs';
2
2
  import 'zod';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { k as StorageMessage, f as StorageAdapter, Q as StorageFile } from '../types-BkQCSiIt.js';
1
+ import { k as StorageMessage, f as StorageAdapter, V as StorageFile } from '../types-BW3csYo5.js';
2
2
  import 'zod';
3
3
 
4
4
  /**
package/package.json CHANGED
@@ -1,75 +1,140 @@
1
1
  {
2
2
  "name": "@yourgpt/llm-sdk",
3
- "version": "2.5.1-beta.6",
3
+ "version": "2.6.0-beta.1",
4
4
  "description": "AI SDK for building AI Agents with any LLM",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.mjs",
12
- "require": "./dist/index.js"
10
+ "import": {
11
+ "types": "./dist/index.d.mts",
12
+ "default": "./dist/index.mjs"
13
+ },
14
+ "require": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ }
13
18
  },
14
19
  "./openai": {
15
- "types": "./dist/providers/openai/index.d.mts",
16
- "import": "./dist/providers/openai/index.mjs",
17
- "require": "./dist/providers/openai/index.js"
20
+ "import": {
21
+ "types": "./dist/providers/openai/index.d.mts",
22
+ "default": "./dist/providers/openai/index.mjs"
23
+ },
24
+ "require": {
25
+ "types": "./dist/providers/openai/index.d.ts",
26
+ "default": "./dist/providers/openai/index.js"
27
+ }
18
28
  },
19
29
  "./anthropic": {
20
- "types": "./dist/providers/anthropic/index.d.mts",
21
- "import": "./dist/providers/anthropic/index.mjs",
22
- "require": "./dist/providers/anthropic/index.js"
30
+ "import": {
31
+ "types": "./dist/providers/anthropic/index.d.mts",
32
+ "default": "./dist/providers/anthropic/index.mjs"
33
+ },
34
+ "require": {
35
+ "types": "./dist/providers/anthropic/index.d.ts",
36
+ "default": "./dist/providers/anthropic/index.js"
37
+ }
23
38
  },
24
39
  "./google": {
25
- "types": "./dist/providers/google/index.d.mts",
26
- "import": "./dist/providers/google/index.mjs",
27
- "require": "./dist/providers/google/index.js"
40
+ "import": {
41
+ "types": "./dist/providers/google/index.d.mts",
42
+ "default": "./dist/providers/google/index.mjs"
43
+ },
44
+ "require": {
45
+ "types": "./dist/providers/google/index.d.ts",
46
+ "default": "./dist/providers/google/index.js"
47
+ }
28
48
  },
29
49
  "./ollama": {
30
- "types": "./dist/providers/ollama/index.d.mts",
31
- "import": "./dist/providers/ollama/index.mjs",
32
- "require": "./dist/providers/ollama/index.js"
50
+ "import": {
51
+ "types": "./dist/providers/ollama/index.d.mts",
52
+ "default": "./dist/providers/ollama/index.mjs"
53
+ },
54
+ "require": {
55
+ "types": "./dist/providers/ollama/index.d.ts",
56
+ "default": "./dist/providers/ollama/index.js"
57
+ }
33
58
  },
34
59
  "./xai": {
35
- "types": "./dist/providers/xai/index.d.mts",
36
- "import": "./dist/providers/xai/index.mjs",
37
- "require": "./dist/providers/xai/index.js"
60
+ "import": {
61
+ "types": "./dist/providers/xai/index.d.mts",
62
+ "default": "./dist/providers/xai/index.mjs"
63
+ },
64
+ "require": {
65
+ "types": "./dist/providers/xai/index.d.ts",
66
+ "default": "./dist/providers/xai/index.js"
67
+ }
38
68
  },
39
69
  "./azure": {
40
- "types": "./dist/providers/azure/index.d.mts",
41
- "import": "./dist/providers/azure/index.mjs",
42
- "require": "./dist/providers/azure/index.js"
70
+ "import": {
71
+ "types": "./dist/providers/azure/index.d.mts",
72
+ "default": "./dist/providers/azure/index.mjs"
73
+ },
74
+ "require": {
75
+ "types": "./dist/providers/azure/index.d.ts",
76
+ "default": "./dist/providers/azure/index.js"
77
+ }
43
78
  },
44
79
  "./openrouter": {
45
- "types": "./dist/providers/openrouter/index.d.mts",
46
- "import": "./dist/providers/openrouter/index.mjs",
47
- "require": "./dist/providers/openrouter/index.js"
80
+ "import": {
81
+ "types": "./dist/providers/openrouter/index.d.mts",
82
+ "default": "./dist/providers/openrouter/index.mjs"
83
+ },
84
+ "require": {
85
+ "types": "./dist/providers/openrouter/index.d.ts",
86
+ "default": "./dist/providers/openrouter/index.js"
87
+ }
48
88
  },
49
89
  "./fireworks": {
50
- "types": "./dist/providers/fireworks/index.d.mts",
51
- "import": "./dist/providers/fireworks/index.mjs",
52
- "require": "./dist/providers/fireworks/index.js"
90
+ "import": {
91
+ "types": "./dist/providers/fireworks/index.d.mts",
92
+ "default": "./dist/providers/fireworks/index.mjs"
93
+ },
94
+ "require": {
95
+ "types": "./dist/providers/fireworks/index.d.ts",
96
+ "default": "./dist/providers/fireworks/index.js"
97
+ }
53
98
  },
54
99
  "./togetherai": {
55
- "types": "./dist/providers/togetherai/index.d.mts",
56
- "import": "./dist/providers/togetherai/index.mjs",
57
- "require": "./dist/providers/togetherai/index.js"
100
+ "import": {
101
+ "types": "./dist/providers/togetherai/index.d.mts",
102
+ "default": "./dist/providers/togetherai/index.mjs"
103
+ },
104
+ "require": {
105
+ "types": "./dist/providers/togetherai/index.d.ts",
106
+ "default": "./dist/providers/togetherai/index.js"
107
+ }
58
108
  },
59
109
  "./adapters": {
60
- "types": "./dist/adapters/index.d.ts",
61
- "import": "./dist/adapters/index.mjs",
62
- "require": "./dist/adapters/index.js"
110
+ "import": {
111
+ "types": "./dist/adapters/index.d.mts",
112
+ "default": "./dist/adapters/index.mjs"
113
+ },
114
+ "require": {
115
+ "types": "./dist/adapters/index.d.ts",
116
+ "default": "./dist/adapters/index.js"
117
+ }
63
118
  },
64
119
  "./yourgpt": {
65
- "types": "./dist/yourgpt/index.d.ts",
66
- "import": "./dist/yourgpt/index.mjs",
67
- "require": "./dist/yourgpt/index.js"
120
+ "import": {
121
+ "types": "./dist/yourgpt/index.d.mts",
122
+ "default": "./dist/yourgpt/index.mjs"
123
+ },
124
+ "require": {
125
+ "types": "./dist/yourgpt/index.d.ts",
126
+ "default": "./dist/yourgpt/index.js"
127
+ }
68
128
  },
69
129
  "./fallback": {
70
- "types": "./dist/fallback/index.d.ts",
71
- "import": "./dist/fallback/index.mjs",
72
- "require": "./dist/fallback/index.js"
130
+ "import": {
131
+ "types": "./dist/fallback/index.d.mts",
132
+ "default": "./dist/fallback/index.mjs"
133
+ },
134
+ "require": {
135
+ "types": "./dist/fallback/index.d.ts",
136
+ "default": "./dist/fallback/index.js"
137
+ }
73
138
  }
74
139
  },
75
140
  "homepage": "https://copilot-sdk.yourgpt.ai",
@@ -78,6 +143,15 @@
78
143
  "!dist/**/*.map",
79
144
  "README.md"
80
145
  ],
146
+ "scripts": {
147
+ "build": "tsup",
148
+ "dev": "tsup --watch",
149
+ "clean": "rm -rf dist",
150
+ "lint": "eslint src/",
151
+ "typecheck": "tsc --noEmit",
152
+ "test": "pnpm build && pnpm test:types && node --test test/*.test.cjs",
153
+ "test:types": "tsc --noEmit --strict --skipLibCheck --moduleResolution node16 --module Node16 --target ES2020 test/public-types.ts test/public-types.mts"
154
+ },
81
155
  "dependencies": {
82
156
  "hono": "^4.3.0",
83
157
  "zod": "^3.23.0"
@@ -132,12 +206,5 @@
132
206
  "sideEffects": false,
133
207
  "engines": {
134
208
  "node": ">=18"
135
- },
136
- "scripts": {
137
- "build": "tsup",
138
- "dev": "tsup --watch",
139
- "clean": "rm -rf dist",
140
- "lint": "eslint src/",
141
- "typecheck": "tsc --noEmit"
142
209
  }
143
- }
210
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 YourGPT
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.