@codeworksh/aikit 0.4.1-dev.20260530192508 → 0.4.1-dev.20260530194815
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/index.d.mts +68 -62
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/registry-Cfdk78qk.mjs.map +1 -1
package/index.d.mts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import Type$1, { Static, Static as Static$1, TSchema, TSchema as TSchema$1, Type, Type as Type$2 } from "typebox";
|
|
2
2
|
import { statSync } from "fs";
|
|
3
3
|
import { Readable } from "stream";
|
|
4
|
+
import { AnthropicLanguageModelOptions, AnthropicProviderSettings } from "@ai-sdk/anthropic";
|
|
5
|
+
import { GoogleGenerativeAIProviderSettings, GoogleLanguageModelOptions } from "@ai-sdk/google";
|
|
6
|
+
import { GoogleVertexProviderSettings } from "@ai-sdk/google-vertex";
|
|
7
|
+
import { GoogleVertexAnthropicProviderSettings } from "@ai-sdk/google-vertex/anthropic";
|
|
8
|
+
import { OpenAILanguageModelChatOptions, OpenAILanguageModelCompletionOptions, OpenAILanguageModelResponsesOptions, OpenAIProviderSettings } from "@ai-sdk/openai";
|
|
9
|
+
import { OpenAICompatibleLanguageModelChatOptions, OpenAICompatibleLanguageModelCompletionOptions, OpenAICompatibleProviderSettings } from "@ai-sdk/openai-compatible";
|
|
10
|
+
import { XaiLanguageModelChatOptions, XaiLanguageModelResponsesOptions, XaiProviderSettings } from "@ai-sdk/xai";
|
|
11
|
+
import { OpenRouterProviderOptions, OpenRouterProviderSettings } from "@openrouter/ai-sdk-provider";
|
|
4
12
|
|
|
5
13
|
//#region src/event/event.d.ts
|
|
6
14
|
declare namespace Event {
|
|
@@ -5424,13 +5432,13 @@ declare namespace Model {
|
|
|
5424
5432
|
function getBuiltInModels(): Promise<BuiltInModels>;
|
|
5425
5433
|
const registry: {
|
|
5426
5434
|
(): Promise<Map<string, Map<string, {
|
|
5427
|
-
headers?: Record<string, string> | undefined;
|
|
5428
5435
|
api?: {
|
|
5429
5436
|
id?: string | undefined;
|
|
5430
5437
|
url?: string | undefined;
|
|
5431
|
-
method?: "
|
|
5438
|
+
method?: "messages" | "languageModel" | "chat" | "completion" | "completionModel" | "responses" | undefined;
|
|
5432
5439
|
} | undefined;
|
|
5433
5440
|
options?: Record<string, unknown> | undefined;
|
|
5441
|
+
headers?: Record<string, string> | undefined;
|
|
5434
5442
|
thinkingLevelMap?: {
|
|
5435
5443
|
off?: string | null | undefined;
|
|
5436
5444
|
minimal?: string | null | undefined;
|
|
@@ -5452,19 +5460,17 @@ declare namespace Model {
|
|
|
5452
5460
|
googleVertexAnthropic?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-compatible" | "openrouter" | "xai" | undefined;
|
|
5453
5461
|
openaiCompatible?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-compatible" | "openrouter" | "xai" | undefined;
|
|
5454
5462
|
} | undefined;
|
|
5455
|
-
|
|
5456
|
-
id: string;
|
|
5463
|
+
protocol: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-compatible" | "openrouter" | "xai";
|
|
5457
5464
|
name: string;
|
|
5465
|
+
id: string;
|
|
5458
5466
|
provider: {
|
|
5459
5467
|
key?: string | undefined;
|
|
5460
5468
|
options?: Record<string, any> | undefined;
|
|
5461
|
-
id: string;
|
|
5462
5469
|
name: string;
|
|
5470
|
+
id: string;
|
|
5463
5471
|
source: "env" | "config" | "custom" | "api" | "unknown";
|
|
5464
5472
|
env: string[];
|
|
5465
5473
|
};
|
|
5466
|
-
baseUrl: string;
|
|
5467
|
-
reasoning: boolean;
|
|
5468
5474
|
input: ("text" | "image")[];
|
|
5469
5475
|
cost: {
|
|
5470
5476
|
input: number;
|
|
@@ -5472,64 +5478,18 @@ declare namespace Model {
|
|
|
5472
5478
|
cacheRead: number;
|
|
5473
5479
|
cacheWrite: number;
|
|
5474
5480
|
};
|
|
5481
|
+
maxTokens: number;
|
|
5482
|
+
baseUrl: string;
|
|
5483
|
+
reasoning: boolean;
|
|
5475
5484
|
contextWindow: number;
|
|
5476
|
-
protocol: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-compatible" | "openrouter" | "xai";
|
|
5477
5485
|
}>>>;
|
|
5478
5486
|
reset(): void;
|
|
5479
5487
|
};
|
|
5480
5488
|
function supportsProtocol(model: Info, protocol: KnownProviderEnum): boolean;
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
url?: string | undefined;
|
|
5486
|
-
method?: "languageModel" | "chat" | "completion" | "completionModel" | "messages" | "responses" | undefined;
|
|
5487
|
-
} | undefined;
|
|
5488
|
-
options?: Record<string, unknown> | undefined;
|
|
5489
|
-
thinkingLevelMap?: {
|
|
5490
|
-
off?: string | null | undefined;
|
|
5491
|
-
minimal?: string | null | undefined;
|
|
5492
|
-
low?: string | null | undefined;
|
|
5493
|
-
medium?: string | null | undefined;
|
|
5494
|
-
high?: string | null | undefined;
|
|
5495
|
-
xhigh?: string | null | undefined;
|
|
5496
|
-
} | undefined;
|
|
5497
|
-
npm?: string | undefined;
|
|
5498
|
-
providerOptionsKey?: string | undefined;
|
|
5499
|
-
providerOptions?: Record<string, unknown> | undefined;
|
|
5500
|
-
supportedProtocols?: {
|
|
5501
|
-
anthropic?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-compatible" | "openrouter" | "xai" | undefined;
|
|
5502
|
-
google?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-compatible" | "openrouter" | "xai" | undefined;
|
|
5503
|
-
openai?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-compatible" | "openrouter" | "xai" | undefined;
|
|
5504
|
-
openrouter?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-compatible" | "openrouter" | "xai" | undefined;
|
|
5505
|
-
xai?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-compatible" | "openrouter" | "xai" | undefined;
|
|
5506
|
-
googleVertex?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-compatible" | "openrouter" | "xai" | undefined;
|
|
5507
|
-
googleVertexAnthropic?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-compatible" | "openrouter" | "xai" | undefined;
|
|
5508
|
-
openaiCompatible?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-compatible" | "openrouter" | "xai" | undefined;
|
|
5509
|
-
} | undefined;
|
|
5510
|
-
maxTokens: number;
|
|
5511
|
-
id: string;
|
|
5512
|
-
name: string;
|
|
5513
|
-
provider: {
|
|
5514
|
-
key?: string | undefined;
|
|
5515
|
-
options?: Record<string, any> | undefined;
|
|
5516
|
-
id: string;
|
|
5517
|
-
name: string;
|
|
5518
|
-
source: "env" | "config" | "custom" | "api" | "unknown";
|
|
5519
|
-
env: string[];
|
|
5520
|
-
};
|
|
5521
|
-
baseUrl: string;
|
|
5522
|
-
reasoning: boolean;
|
|
5523
|
-
input: ("text" | "image")[];
|
|
5524
|
-
cost: {
|
|
5525
|
-
input: number;
|
|
5526
|
-
output: number;
|
|
5527
|
-
cacheRead: number;
|
|
5528
|
-
cacheWrite: number;
|
|
5529
|
-
};
|
|
5530
|
-
contextWindow: number;
|
|
5531
|
-
protocol: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-compatible" | "openrouter" | "xai";
|
|
5532
|
-
} | undefined>;
|
|
5489
|
+
type ProviderToProtocol<TProvider extends string> = TProvider extends KnownProviderEnum ? TProvider : KnownProviderEnum;
|
|
5490
|
+
function getModel<TProvider extends string, TProtocol extends KnownProviderEnum = ProviderToProtocol<TProvider>>(provider: TProvider, model: string, overrides?: Partial<Info> & {
|
|
5491
|
+
protocol?: TProtocol;
|
|
5492
|
+
}): Promise<TModel<TProtocol> | undefined>;
|
|
5533
5493
|
function getProviders(): Promise<string[]>;
|
|
5534
5494
|
function getModels<TProvider extends string>(provider: TProvider): Promise<Info[]>;
|
|
5535
5495
|
/**
|
|
@@ -5543,7 +5503,9 @@ declare namespace Model {
|
|
|
5543
5503
|
//#endregion
|
|
5544
5504
|
//#region src/llm.d.ts
|
|
5545
5505
|
type LLM = {
|
|
5546
|
-
<TProvider extends string,
|
|
5506
|
+
<TProvider extends string, TProtocol extends Model.KnownProviderEnum = Model.ProviderToProtocol<TProvider>>(provider: TProvider, model: string, overrides?: Partial<Model.Info> & {
|
|
5507
|
+
protocol?: TProtocol;
|
|
5508
|
+
}): Promise<Model.TModel<TProtocol> | undefined>;
|
|
5547
5509
|
model: typeof Model.getModel;
|
|
5548
5510
|
models: typeof Model.getModels;
|
|
5549
5511
|
providers: typeof Model.getProviders;
|
|
@@ -6631,6 +6593,41 @@ declare class AssistantMessageEventStream extends EventStream<Event.LLMMessageEv
|
|
|
6631
6593
|
/** Factory function for AssistantMessageEventStream (for use in extensions) */
|
|
6632
6594
|
declare function createAssistantMessageEventStream(): AssistantMessageEventStream;
|
|
6633
6595
|
//#endregion
|
|
6596
|
+
//#region src/llm/options.d.ts
|
|
6597
|
+
type ProviderOptionBag = Record<string, Record<string, unknown> | undefined>;
|
|
6598
|
+
type AISDKOptions<TFactoryOptions, TProviderOptions extends ProviderOptionBag = ProviderOptionBag> = Protocol.CommonOptions & {
|
|
6599
|
+
baseURL?: string;
|
|
6600
|
+
method?: Model.APIMethodEnum;
|
|
6601
|
+
modelId?: string;
|
|
6602
|
+
toolChoice?: unknown;
|
|
6603
|
+
activeTools?: string[];
|
|
6604
|
+
factoryOptions?: Partial<TFactoryOptions> & Record<string, unknown>;
|
|
6605
|
+
providerOptions?: TProviderOptions & ProviderOptionBag;
|
|
6606
|
+
};
|
|
6607
|
+
type OpenAILanguageOptions = OpenAILanguageModelResponsesOptions | OpenAILanguageModelChatOptions | OpenAILanguageModelCompletionOptions;
|
|
6608
|
+
type OpenAICompatibleLanguageOptions = OpenAICompatibleLanguageModelChatOptions | OpenAICompatibleLanguageModelCompletionOptions;
|
|
6609
|
+
type XaiLanguageOptions = XaiLanguageModelResponsesOptions | XaiLanguageModelChatOptions;
|
|
6610
|
+
type OpenAIOptions = AISDKOptions<OpenAIProviderSettings, {
|
|
6611
|
+
openai?: OpenAILanguageOptions;
|
|
6612
|
+
}>;
|
|
6613
|
+
type AnthropicOptions = AISDKOptions<AnthropicProviderSettings, {
|
|
6614
|
+
anthropic?: AnthropicLanguageModelOptions;
|
|
6615
|
+
}>;
|
|
6616
|
+
type GoogleOptions = AISDKOptions<GoogleGenerativeAIProviderSettings, {
|
|
6617
|
+
google?: GoogleLanguageModelOptions;
|
|
6618
|
+
}>;
|
|
6619
|
+
type GoogleVertexOptions = AISDKOptions<GoogleVertexProviderSettings>;
|
|
6620
|
+
type GoogleVertexAnthropicOptions = AISDKOptions<GoogleVertexAnthropicProviderSettings>;
|
|
6621
|
+
type OpenAICompatibleOptions = AISDKOptions<OpenAICompatibleProviderSettings, {
|
|
6622
|
+
"openai-compatible"?: OpenAICompatibleLanguageOptions;
|
|
6623
|
+
}>;
|
|
6624
|
+
type OpenRouterOptions = AISDKOptions<OpenRouterProviderSettings, {
|
|
6625
|
+
openrouter?: OpenRouterProviderOptions;
|
|
6626
|
+
}>;
|
|
6627
|
+
type XaiOptions = AISDKOptions<XaiProviderSettings, {
|
|
6628
|
+
xai?: XaiLanguageOptions;
|
|
6629
|
+
}>;
|
|
6630
|
+
//#endregion
|
|
6634
6631
|
//#region src/llm/shared.d.ts
|
|
6635
6632
|
declare const ThinkingBudgets: Type$2.TObject<{
|
|
6636
6633
|
minimal: Type$2.TOptional<Type$2.TNumber>;
|
|
@@ -7112,7 +7109,16 @@ declare namespace Protocol {
|
|
|
7112
7109
|
reasoning?: Model.ActiveThinkingLevel;
|
|
7113
7110
|
thinkingBudgets?: ThinkingBudgets;
|
|
7114
7111
|
};
|
|
7115
|
-
export interface OptionsByProtocol {
|
|
7112
|
+
export interface OptionsByProtocol {
|
|
7113
|
+
[Model.KnownProviderEnum.openai]: OpenAIOptions;
|
|
7114
|
+
[Model.KnownProviderEnum.anthropic]: AnthropicOptions;
|
|
7115
|
+
[Model.KnownProviderEnum.google]: GoogleOptions;
|
|
7116
|
+
[Model.KnownProviderEnum.googleVertex]: GoogleVertexOptions;
|
|
7117
|
+
[Model.KnownProviderEnum.googleVertexAnthropic]: GoogleVertexAnthropicOptions;
|
|
7118
|
+
[Model.KnownProviderEnum.openaiCompatible]: OpenAICompatibleOptions;
|
|
7119
|
+
[Model.KnownProviderEnum.openrouter]: OpenRouterOptions;
|
|
7120
|
+
[Model.KnownProviderEnum.xai]: XaiOptions;
|
|
7121
|
+
}
|
|
7116
7122
|
export type ProtocolWithOptions = keyof OptionsByProtocol & Model.KnownProviderEnum;
|
|
7117
7123
|
export type OptionsFor<TProtocol extends ProtocolWithOptions> = OptionsByProtocol[TProtocol];
|
|
7118
7124
|
export type StreamFunction<TProtocol extends Model.KnownProviderEnum = Model.KnownProviderEnum, S extends TSchema$1 = TSchema$1> = (model: Model.TModel<TProtocol>, context: Message.Context, options?: Static$1<S>) => AssistantMessageEventStream;
|