@ghostspeak/plugin-gateway-ghost 0.1.1 → 0.2.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.
- package/dist/index.js +4284 -9
- package/dist/index.js.map +42 -6
- package/package.json +27 -3
- package/dist/src/config.d.ts +0 -56
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/gateway.d.ts +0 -34
- package/dist/src/gateway.d.ts.map +0 -1
- package/dist/src/handlers/image-description.d.ts +0 -15
- package/dist/src/handlers/image-description.d.ts.map +0 -1
- package/dist/src/handlers/image-generation.d.ts +0 -15
- package/dist/src/handlers/image-generation.d.ts.map +0 -1
- package/dist/src/handlers/index.d.ts +0 -12
- package/dist/src/handlers/index.d.ts.map +0 -1
- package/dist/src/handlers/object-generation.d.ts +0 -20
- package/dist/src/handlers/object-generation.d.ts.map +0 -1
- package/dist/src/handlers/text-embedding.d.ts +0 -12
- package/dist/src/handlers/text-embedding.d.ts.map +0 -1
- package/dist/src/handlers/text-generation.d.ts +0 -34
- package/dist/src/handlers/text-generation.d.ts.map +0 -1
- package/dist/src/handlers/text-to-speech.d.ts +0 -12
- package/dist/src/handlers/text-to-speech.d.ts.map +0 -1
- package/dist/src/handlers/tokenizer.d.ts +0 -16
- package/dist/src/handlers/tokenizer.d.ts.map +0 -1
- package/dist/src/handlers/transcription.d.ts +0 -12
- package/dist/src/handlers/transcription.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -22
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/plugin.d.ts +0 -19
- package/dist/src/plugin.d.ts.map +0 -1
- package/dist/src/utils/error-handler.d.ts +0 -25
- package/dist/src/utils/error-handler.d.ts.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghostspeak/plugin-gateway-ghost",
|
|
3
|
-
"description": "Unified
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "Unified AI Gateway plugin for ElizaOS - Vercel AI Gateway + FAL.ai for text, images, video, and more",
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@ai-sdk/openai-compatible": "^0.2.14",
|
|
51
51
|
"@elizaos/core": "1.7.0",
|
|
52
|
-
"@
|
|
52
|
+
"@fal-ai/client": "^1.8.1",
|
|
53
|
+
"@msgpack/msgpack": "^3.1.3",
|
|
53
54
|
"ai": "^4.3.16",
|
|
54
55
|
"js-tiktoken": "^1.0.18",
|
|
55
56
|
"zod": "^3.24.2"
|
|
@@ -127,6 +128,29 @@
|
|
|
127
128
|
"description": "Default TTS voice. Default: alloy",
|
|
128
129
|
"required": false,
|
|
129
130
|
"default": "alloy"
|
|
131
|
+
},
|
|
132
|
+
"FAL_API_KEY": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"description": "FAL.ai API key (optional - enables video generation and alternative image models)",
|
|
135
|
+
"required": false
|
|
136
|
+
},
|
|
137
|
+
"FAL_IMAGE_MODEL": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"description": "FAL image model. Default: fal-ai/flux/dev",
|
|
140
|
+
"required": false,
|
|
141
|
+
"default": "fal-ai/flux/dev"
|
|
142
|
+
},
|
|
143
|
+
"FAL_VIDEO_MODEL": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"description": "FAL video model. Default: fal-ai/minimax-video/image-to-video",
|
|
146
|
+
"required": false,
|
|
147
|
+
"default": "fal-ai/minimax-video/image-to-video"
|
|
148
|
+
},
|
|
149
|
+
"FAL_PREFER_FOR_IMAGES": {
|
|
150
|
+
"type": "boolean",
|
|
151
|
+
"description": "Use FAL instead of Vercel Gateway for image generation. Default: false",
|
|
152
|
+
"required": false,
|
|
153
|
+
"default": false
|
|
130
154
|
}
|
|
131
155
|
}
|
|
132
156
|
}
|
package/dist/src/config.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI Gateway Configuration
|
|
3
|
-
*
|
|
4
|
-
* Zod schema for validating environment variables and plugin configuration.
|
|
5
|
-
* Uses Vercel AI Gateway with January 2026 model defaults.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
/**
|
|
9
|
-
* Configuration schema for the AI Gateway plugin
|
|
10
|
-
*/
|
|
11
|
-
export declare const aiGatewayConfigSchema: z.ZodObject<{
|
|
12
|
-
AI_GATEWAY_API_KEY: z.ZodString;
|
|
13
|
-
AI_GATEWAY_BASE_URL: z.ZodDefault<z.ZodString>;
|
|
14
|
-
AI_GATEWAY_TEXT_SMALL_MODEL: z.ZodDefault<z.ZodString>;
|
|
15
|
-
AI_GATEWAY_TEXT_LARGE_MODEL: z.ZodDefault<z.ZodString>;
|
|
16
|
-
AI_GATEWAY_EMBEDDING_MODEL: z.ZodDefault<z.ZodString>;
|
|
17
|
-
AI_GATEWAY_IMAGE_MODEL: z.ZodDefault<z.ZodString>;
|
|
18
|
-
AI_GATEWAY_VISION_MODEL: z.ZodDefault<z.ZodString>;
|
|
19
|
-
AI_GATEWAY_TRANSCRIPTION_MODEL: z.ZodDefault<z.ZodString>;
|
|
20
|
-
AI_GATEWAY_TTS_MODEL: z.ZodDefault<z.ZodString>;
|
|
21
|
-
AI_GATEWAY_TTS_VOICE: z.ZodDefault<z.ZodEnum<["alloy", "echo", "fable", "onyx", "nova", "shimmer"]>>;
|
|
22
|
-
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
AI_GATEWAY_API_KEY: string;
|
|
24
|
-
AI_GATEWAY_BASE_URL: string;
|
|
25
|
-
AI_GATEWAY_TEXT_SMALL_MODEL: string;
|
|
26
|
-
AI_GATEWAY_TEXT_LARGE_MODEL: string;
|
|
27
|
-
AI_GATEWAY_EMBEDDING_MODEL: string;
|
|
28
|
-
AI_GATEWAY_IMAGE_MODEL: string;
|
|
29
|
-
AI_GATEWAY_VISION_MODEL: string;
|
|
30
|
-
AI_GATEWAY_TRANSCRIPTION_MODEL: string;
|
|
31
|
-
AI_GATEWAY_TTS_MODEL: string;
|
|
32
|
-
AI_GATEWAY_TTS_VOICE: "alloy" | "echo" | "fable" | "onyx" | "nova" | "shimmer";
|
|
33
|
-
}, {
|
|
34
|
-
AI_GATEWAY_API_KEY: string;
|
|
35
|
-
AI_GATEWAY_BASE_URL?: string | undefined;
|
|
36
|
-
AI_GATEWAY_TEXT_SMALL_MODEL?: string | undefined;
|
|
37
|
-
AI_GATEWAY_TEXT_LARGE_MODEL?: string | undefined;
|
|
38
|
-
AI_GATEWAY_EMBEDDING_MODEL?: string | undefined;
|
|
39
|
-
AI_GATEWAY_IMAGE_MODEL?: string | undefined;
|
|
40
|
-
AI_GATEWAY_VISION_MODEL?: string | undefined;
|
|
41
|
-
AI_GATEWAY_TRANSCRIPTION_MODEL?: string | undefined;
|
|
42
|
-
AI_GATEWAY_TTS_MODEL?: string | undefined;
|
|
43
|
-
AI_GATEWAY_TTS_VOICE?: "alloy" | "echo" | "fable" | "onyx" | "nova" | "shimmer" | undefined;
|
|
44
|
-
}>;
|
|
45
|
-
export type AIGatewayConfig = z.infer<typeof aiGatewayConfigSchema>;
|
|
46
|
-
/**
|
|
47
|
-
* Parse and validate configuration from environment variables
|
|
48
|
-
*/
|
|
49
|
-
export declare function parseConfig(env: Record<string, string | undefined>): AIGatewayConfig;
|
|
50
|
-
/**
|
|
51
|
-
* Get configuration with defaults (for optional config scenarios)
|
|
52
|
-
*/
|
|
53
|
-
export declare function getConfigWithDefaults(partial: Partial<AIGatewayConfig> & {
|
|
54
|
-
AI_GATEWAY_API_KEY: string;
|
|
55
|
-
}): AIGatewayConfig;
|
|
56
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dist/src/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmChC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,eAAe,CAapF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE,GACjE,eAAe,CAEjB"}
|
package/dist/src/gateway.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI Gateway Client Factory
|
|
3
|
-
*
|
|
4
|
-
* Creates OpenAI-compatible clients for Vercel AI Gateway.
|
|
5
|
-
* All models are accessed through a single endpoint with provider/model format.
|
|
6
|
-
*/
|
|
7
|
-
import type { LanguageModelV1, EmbeddingModel } from 'ai';
|
|
8
|
-
import type { AIGatewayConfig } from './config';
|
|
9
|
-
/**
|
|
10
|
-
* Create or return cached gateway client
|
|
11
|
-
*
|
|
12
|
-
* Uses OpenAI-compatible provider from Vercel AI SDK.
|
|
13
|
-
* All models are accessed via provider/model-name format (e.g., anthropic/claude-opus-4.5)
|
|
14
|
-
*/
|
|
15
|
-
export declare function createGatewayClient(config: AIGatewayConfig): import("@ai-sdk/openai-compatible").OpenAICompatibleProvider<string, string, string, string>;
|
|
16
|
-
/**
|
|
17
|
-
* Get a language model from the gateway
|
|
18
|
-
*
|
|
19
|
-
* @param config - Gateway configuration
|
|
20
|
-
* @param modelId - Full model ID (e.g., "anthropic/claude-opus-4.5")
|
|
21
|
-
*/
|
|
22
|
-
export declare function getLanguageModel(config: AIGatewayConfig, modelId: string): LanguageModelV1;
|
|
23
|
-
/**
|
|
24
|
-
* Get an embedding model from the gateway
|
|
25
|
-
*
|
|
26
|
-
* @param config - Gateway configuration
|
|
27
|
-
* @param modelId - Full model ID (e.g., "openai/text-embedding-3-large")
|
|
28
|
-
*/
|
|
29
|
-
export declare function getEmbeddingModel(config: AIGatewayConfig, modelId: string): EmbeddingModel<string>;
|
|
30
|
-
/**
|
|
31
|
-
* Clear the gateway cache (useful for testing or config changes)
|
|
32
|
-
*/
|
|
33
|
-
export declare function clearGatewayCache(): void;
|
|
34
|
-
//# sourceMappingURL=gateway.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../src/gateway.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMhD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,gGAsB1D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,GAAG,eAAe,CAG1F;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAGlG;AAED;;GAEG;AACH,wBAAgB,iBAAiB,SAGhC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Image Description Handler
|
|
3
|
-
*
|
|
4
|
-
* Handles IMAGE_DESCRIPTION model type using vision models (Grok 2 Vision).
|
|
5
|
-
*/
|
|
6
|
-
import type { IAgentRuntime } from '@elizaos/core';
|
|
7
|
-
import type { AIGatewayConfig } from '../config';
|
|
8
|
-
/**
|
|
9
|
-
* Create IMAGE_DESCRIPTION handler
|
|
10
|
-
*/
|
|
11
|
-
export declare function createImageDescriptionHandler(config: AIGatewayConfig): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<{
|
|
12
|
-
title: string;
|
|
13
|
-
description: string;
|
|
14
|
-
}>;
|
|
15
|
-
//# sourceMappingURL=image-description.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image-description.d.ts","sourceRoot":"","sources":["../../../src/handlers/image-description.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,eAAe,GACtB,CACD,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CA8CnD"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Image Generation Handler
|
|
3
|
-
*
|
|
4
|
-
* Handles IMAGE model type using FLUX 2 Pro (the current standard, not DALL-E).
|
|
5
|
-
* Uses the gateway's REST API directly since the AI SDK image model requires specific factories.
|
|
6
|
-
*/
|
|
7
|
-
import type { IAgentRuntime } from '@elizaos/core';
|
|
8
|
-
import type { AIGatewayConfig } from '../config';
|
|
9
|
-
/**
|
|
10
|
-
* Create IMAGE handler using FLUX via REST API
|
|
11
|
-
*/
|
|
12
|
-
export declare function createImageHandler(config: AIGatewayConfig): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<{
|
|
13
|
-
url: string;
|
|
14
|
-
}[]>;
|
|
15
|
-
//# sourceMappingURL=image-generation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image-generation.d.ts","sourceRoot":"","sources":["../../../src/handlers/image-generation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,GACtB,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,CAuCzF"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Handler Exports
|
|
3
|
-
*/
|
|
4
|
-
export { createTextSmallHandler, createTextLargeHandler, createTextCompletionHandler, createTextReasoningSmallHandler, createTextReasoningLargeHandler, } from './text-generation';
|
|
5
|
-
export { createTextEmbeddingHandler } from './text-embedding';
|
|
6
|
-
export { createObjectSmallHandler, createObjectLargeHandler } from './object-generation';
|
|
7
|
-
export { createImageHandler } from './image-generation';
|
|
8
|
-
export { createImageDescriptionHandler } from './image-description';
|
|
9
|
-
export { createTranscriptionHandler } from './transcription';
|
|
10
|
-
export { createTextToSpeechHandler } from './text-to-speech';
|
|
11
|
-
export { createTokenizerEncodeHandler, createTokenizerDecodeHandler } from './tokenizer';
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/handlers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Object Generation Handlers
|
|
3
|
-
*
|
|
4
|
-
* Handles OBJECT_SMALL and OBJECT_LARGE model types for structured output.
|
|
5
|
-
*/
|
|
6
|
-
import type { IAgentRuntime } from '@elizaos/core';
|
|
7
|
-
import type { AIGatewayConfig } from '../config';
|
|
8
|
-
/**
|
|
9
|
-
* Create object generation handler for a specific model
|
|
10
|
-
*/
|
|
11
|
-
export declare function createObjectHandler(config: AIGatewayConfig, modelId: string): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
12
|
-
/**
|
|
13
|
-
* Create OBJECT_SMALL handler
|
|
14
|
-
*/
|
|
15
|
-
export declare function createObjectSmallHandler(config: AIGatewayConfig): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
16
|
-
/**
|
|
17
|
-
* Create OBJECT_LARGE handler
|
|
18
|
-
*/
|
|
19
|
-
export declare function createObjectLargeHandler(config: AIGatewayConfig): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
20
|
-
//# sourceMappingURL=object-generation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object-generation.d.ts","sourceRoot":"","sources":["../../../src/handlers/object-generation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAyCjD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,MAAM,GACd,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAqD/F;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,eAAe,aA1DnD,aAAa,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA4D/F;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,eAAe,aAjEnD,aAAa,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAmE/F"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Text Embedding Handler
|
|
3
|
-
*
|
|
4
|
-
* Handles TEXT_EMBEDDING model type for vector embeddings.
|
|
5
|
-
*/
|
|
6
|
-
import type { IAgentRuntime } from '@elizaos/core';
|
|
7
|
-
import type { AIGatewayConfig } from '../config';
|
|
8
|
-
/**
|
|
9
|
-
* Create TEXT_EMBEDDING handler
|
|
10
|
-
*/
|
|
11
|
-
export declare function createTextEmbeddingHandler(config: AIGatewayConfig): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<number[]>;
|
|
12
|
-
//# sourceMappingURL=text-embedding.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text-embedding.d.ts","sourceRoot":"","sources":["../../../src/handlers/text-embedding.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,eAAe,GACtB,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CA4BhF"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Text Generation Handlers
|
|
3
|
-
*
|
|
4
|
-
* Handles TEXT_SMALL, TEXT_LARGE, TEXT_COMPLETION, TEXT_REASONING_SMALL, TEXT_REASONING_LARGE
|
|
5
|
-
* with full streaming support.
|
|
6
|
-
*/
|
|
7
|
-
import type { IAgentRuntime } from '@elizaos/core';
|
|
8
|
-
import type { TextStreamResult } from '@elizaos/core';
|
|
9
|
-
import type { AIGatewayConfig } from '../config';
|
|
10
|
-
/**
|
|
11
|
-
* Create a text generation handler for a specific model type
|
|
12
|
-
*/
|
|
13
|
-
export declare function createTextHandler(config: AIGatewayConfig, modelId: string): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<string | TextStreamResult>;
|
|
14
|
-
/**
|
|
15
|
-
* Create TEXT_SMALL handler (fast, efficient)
|
|
16
|
-
*/
|
|
17
|
-
export declare function createTextSmallHandler(config: AIGatewayConfig): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<string | TextStreamResult>;
|
|
18
|
-
/**
|
|
19
|
-
* Create TEXT_LARGE handler (best quality)
|
|
20
|
-
*/
|
|
21
|
-
export declare function createTextLargeHandler(config: AIGatewayConfig): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<string | TextStreamResult>;
|
|
22
|
-
/**
|
|
23
|
-
* Create TEXT_COMPLETION handler (same as TEXT_LARGE)
|
|
24
|
-
*/
|
|
25
|
-
export declare function createTextCompletionHandler(config: AIGatewayConfig): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<string | TextStreamResult>;
|
|
26
|
-
/**
|
|
27
|
-
* Create TEXT_REASONING_SMALL handler
|
|
28
|
-
*/
|
|
29
|
-
export declare function createTextReasoningSmallHandler(config: AIGatewayConfig): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<string | TextStreamResult>;
|
|
30
|
-
/**
|
|
31
|
-
* Create TEXT_REASONING_LARGE handler
|
|
32
|
-
*/
|
|
33
|
-
export declare function createTextReasoningLargeHandler(config: AIGatewayConfig): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<string | TextStreamResult>;
|
|
34
|
-
//# sourceMappingURL=text-generation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text-generation.d.ts","sourceRoot":"","sources":["../../../src/handlers/text-generation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAsB,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,MAAM,GACd,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAiFjG;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,aAtFjD,aAAa,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAwFjG;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,aA7FjD,aAAa,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,CA+FjG;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,eAAe,aApGtD,aAAa,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAsGjG;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,eAAe,aA3G1D,aAAa,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,CA6GjG;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,eAAe,aAlH1D,aAAa,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAoHjG"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Text-to-Speech Handler
|
|
3
|
-
*
|
|
4
|
-
* Handles TEXT_TO_SPEECH model type via REST API.
|
|
5
|
-
*/
|
|
6
|
-
import type { IAgentRuntime } from '@elizaos/core';
|
|
7
|
-
import type { AIGatewayConfig } from '../config';
|
|
8
|
-
/**
|
|
9
|
-
* Create TEXT_TO_SPEECH handler
|
|
10
|
-
*/
|
|
11
|
-
export declare function createTextToSpeechHandler(config: AIGatewayConfig): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<Buffer>;
|
|
12
|
-
//# sourceMappingURL=text-to-speech.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text-to-speech.d.ts","sourceRoot":"","sources":["../../../src/handlers/text-to-speech.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,eAAe,GACtB,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CA2C9E"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tokenizer Handlers
|
|
3
|
-
*
|
|
4
|
-
* Handles TEXT_TOKENIZER_ENCODE and TEXT_TOKENIZER_DECODE using js-tiktoken.
|
|
5
|
-
* Uses local tokenization (no API calls required).
|
|
6
|
-
*/
|
|
7
|
-
import type { IAgentRuntime } from '@elizaos/core';
|
|
8
|
-
/**
|
|
9
|
-
* Create TEXT_TOKENIZER_ENCODE handler
|
|
10
|
-
*/
|
|
11
|
-
export declare function createTokenizerEncodeHandler(): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<number[]>;
|
|
12
|
-
/**
|
|
13
|
-
* Create TEXT_TOKENIZER_DECODE handler
|
|
14
|
-
*/
|
|
15
|
-
export declare function createTokenizerDecodeHandler(): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<string>;
|
|
16
|
-
//# sourceMappingURL=tokenizer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tokenizer.d.ts","sourceRoot":"","sources":["../../../src/handlers/tokenizer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AA0BnD;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,CAC9C,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,MAAM,EAAE,CAAC,CAMrB;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,CAC9C,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,MAAM,CAAC,CAMnB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcription Handler
|
|
3
|
-
*
|
|
4
|
-
* Handles TRANSCRIPTION model type using Whisper via REST API.
|
|
5
|
-
*/
|
|
6
|
-
import type { IAgentRuntime } from '@elizaos/core';
|
|
7
|
-
import type { AIGatewayConfig } from '../config';
|
|
8
|
-
/**
|
|
9
|
-
* Create TRANSCRIPTION handler
|
|
10
|
-
*/
|
|
11
|
-
export declare function createTranscriptionHandler(config: AIGatewayConfig): (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<string>;
|
|
12
|
-
//# sourceMappingURL=transcription.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transcription.d.ts","sourceRoot":"","sources":["../../../src/handlers/transcription.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,eAAe,GACtB,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAyC9E"}
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @ghostspeak/plugin-ai-gateway
|
|
3
|
-
*
|
|
4
|
-
* Unified Vercel AI Gateway plugin for ElizaOS.
|
|
5
|
-
* One API key for all model types - text, embeddings, images, speech, and more.
|
|
6
|
-
*
|
|
7
|
-
* January 2026 model defaults:
|
|
8
|
-
* - TEXT_SMALL: anthropic/claude-haiku-4.5
|
|
9
|
-
* - TEXT_LARGE: anthropic/claude-opus-4.5
|
|
10
|
-
* - IMAGE: bfl/flux-2-pro (not DALL-E)
|
|
11
|
-
* - VISION: xai/grok-2-vision
|
|
12
|
-
* - EMBEDDING: openai/text-embedding-3-large
|
|
13
|
-
* - TTS: openai/tts-1-hd
|
|
14
|
-
* - TRANSCRIPTION: openai/whisper-1
|
|
15
|
-
*/
|
|
16
|
-
export { aiGatewayPlugin } from './plugin';
|
|
17
|
-
export { default } from './plugin';
|
|
18
|
-
export { aiGatewayConfigSchema, parseConfig, getConfigWithDefaults, type AIGatewayConfig } from './config';
|
|
19
|
-
export { createGatewayClient, getLanguageModel, getEmbeddingModel, clearGatewayCache } from './gateway';
|
|
20
|
-
export { createTextSmallHandler, createTextLargeHandler, createTextCompletionHandler, createTextReasoningSmallHandler, createTextReasoningLargeHandler, createTextEmbeddingHandler, createObjectSmallHandler, createObjectLargeHandler, createImageHandler, createImageDescriptionHandler, createTranscriptionHandler, createTextToSpeechHandler, createTokenizerEncodeHandler, createTokenizerDecodeHandler, } from './handlers';
|
|
21
|
-
export { AIGatewayError, isRateLimitError, isAuthError } from './utils/error-handler';
|
|
22
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnC,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3G,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGxG,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,+BAA+B,EAC/B,+BAA+B,EAC/B,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/src/plugin.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI Gateway Plugin
|
|
3
|
-
*
|
|
4
|
-
* Unified Vercel AI Gateway plugin for ElizaOS.
|
|
5
|
-
* One API key for all model types: text, embeddings, images, speech, and more.
|
|
6
|
-
*
|
|
7
|
-
* January 2026 defaults:
|
|
8
|
-
* - TEXT_SMALL/LARGE: Claude Haiku 4.5 / Opus 4.5
|
|
9
|
-
* - IMAGE: FLUX 2 Pro (not DALL-E)
|
|
10
|
-
* - VISION: Grok 2 Vision
|
|
11
|
-
* - EMBEDDING: text-embedding-3-large
|
|
12
|
-
*/
|
|
13
|
-
import type { Plugin } from '@elizaos/core';
|
|
14
|
-
/**
|
|
15
|
-
* AI Gateway Plugin
|
|
16
|
-
*/
|
|
17
|
-
export declare const aiGatewayPlugin: Plugin;
|
|
18
|
-
export default aiGatewayPlugin;
|
|
19
|
-
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/src/plugin.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAA+B,MAAM,eAAe,CAAC;AAkHzE;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MA8D7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error Handling Utilities
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* AI Gateway specific error
|
|
6
|
-
*/
|
|
7
|
-
export declare class AIGatewayError extends Error {
|
|
8
|
-
readonly code: string;
|
|
9
|
-
readonly statusCode?: number | undefined;
|
|
10
|
-
readonly cause?: Error | undefined;
|
|
11
|
-
constructor(message: string, code: string, statusCode?: number | undefined, cause?: Error | undefined);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Wrap handler errors with context
|
|
15
|
-
*/
|
|
16
|
-
export declare function wrapHandlerError(modelType: string, error: unknown): never;
|
|
17
|
-
/**
|
|
18
|
-
* Check if error is a rate limit error
|
|
19
|
-
*/
|
|
20
|
-
export declare function isRateLimitError(error: unknown): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Check if error is an authentication error
|
|
23
|
-
*/
|
|
24
|
-
export declare function isAuthError(error: unknown): boolean;
|
|
25
|
-
//# sourceMappingURL=error-handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../../src/utils/error-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;aAGrB,IAAI,EAAE,MAAM;aACZ,UAAU,CAAC,EAAE,MAAM;aACnB,KAAK,CAAC,EAAE,KAAK;gBAH7B,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,KAAK,CAAC,EAAE,KAAK,YAAA;CAKhC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,CASzE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAKxD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAKnD"}
|