tekimax-ts 0.2.0 → 0.2.3

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.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AIProvider, C as ChatOptions, a as ChatResult, S as StreamChunk, T as Tool$1, M as Message$1, G as GenerateTextResult, I as ImageAnalysisOptions, b as ImageAnalysisResult, V as VideoAnalysisOptions, c as VideoAnalysisResult, E as EmbeddingOptions, d as EmbeddingResult, e as SpeechGenerationOptions, f as SpeechResult, g as ImageGenerationOptions, h as ImageResult, i as TranscriptionOptions, j as TranscriptionResult, k as ImageEditOptions, l as VideoGenerationOptions, m as VideoResult } from './tekimax-Dav_a903.cjs';
2
- export { n as ContentPart, o as ImageContent, p as ImageContentPart, q as MessageRole, r as Tekimax, s as TekimaxOptions, t as TextContentPart, u as ToolCall, v as ToolDefinition, w as VideoContent } from './tekimax-Dav_a903.cjs';
1
+ import { A as AIProvider, C as ChatOptions, a as ChatResult, S as StreamChunk, T as Tool$1, M as Message$1, b as TekimaxPlugin, G as GenerateTextResult, V as VisionCapability, I as ImageAnalysisOptions, c as ImageAnalysisResult, d as VideoAnalysisCapability, E as EmbeddingCapability, e as VideoAnalysisOptions, f as VideoAnalysisResult, g as EmbeddingOptions, h as EmbeddingResult, i as SpeechGenerationCapability, j as ImageGenerationCapability, k as ImageEditCapability, l as TranscriptionCapability, m as SpeechGenerationOptions, n as SpeechResult, o as ImageGenerationOptions, p as ImageResult, q as TranscriptionOptions, r as TranscriptionResult, s as ImageEditOptions, P as PluginContext } from './tekimax-DIIjg64-.cjs';
2
+ export { t as ContentPart, u as ImageContent, v as ImageContentPart, w as MessageRole, x as ModelCost, y as ModelDefinition, z as ModelLimit, B as ModelModalities, O as OpenResponsesReasoningConfig, D as Tekimax, F as TekimaxOptions, H as TextContentPart, J as ToolCall, K as ToolDefinition, L as VideoContent, N as VideoGenerationCapability, Q as VideoGenerationOptions, R as VideoResult } from './tekimax-DIIjg64-.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -2734,8 +2734,9 @@ interface GenerateTextOptions {
2734
2734
  temperature?: number;
2735
2735
  maxTokens?: number;
2736
2736
  signal?: AbortSignal;
2737
+ plugins?: TekimaxPlugin[];
2737
2738
  }
2738
- declare function generateText({ adapter, ...options }: GenerateTextOptions & {
2739
+ declare function generateText({ adapter, plugins, ...options }: GenerateTextOptions & {
2739
2740
  adapter: AIProvider;
2740
2741
  }): Promise<GenerateTextResult>;
2741
2742
 
@@ -2748,7 +2749,7 @@ declare const parseThinking: (content: string) => {
2748
2749
  rest: string;
2749
2750
  };
2750
2751
 
2751
- declare class AnthropicProvider implements AIProvider {
2752
+ declare class AnthropicProvider implements AIProvider, VisionCapability {
2752
2753
  name: string;
2753
2754
  private client;
2754
2755
  constructor(options: {
@@ -2761,7 +2762,7 @@ declare class AnthropicProvider implements AIProvider {
2761
2762
  private mapTool;
2762
2763
  }
2763
2764
 
2764
- declare class GeminiProvider implements AIProvider {
2765
+ declare class GeminiProvider implements AIProvider, VisionCapability, VideoAnalysisCapability, EmbeddingCapability {
2765
2766
  name: string;
2766
2767
  private client;
2767
2768
  constructor(options: {
@@ -2790,12 +2791,12 @@ declare class OllamaProvider implements AIProvider {
2790
2791
  private mapTool;
2791
2792
  }
2792
2793
 
2793
- declare class OpenAIProvider implements AIProvider {
2794
+ declare class OpenAIProvider implements AIProvider, SpeechGenerationCapability, ImageGenerationCapability, ImageEditCapability, VisionCapability, TranscriptionCapability, EmbeddingCapability {
2794
2795
  name: string;
2795
2796
  private client;
2796
2797
  constructor(options: {
2797
2798
  apiKey: string;
2798
- dangerouslyAllowBrowser?: boolean;
2799
+ baseURL?: string;
2799
2800
  });
2800
2801
  generateSpeech(options: SpeechGenerationOptions): Promise<SpeechResult>;
2801
2802
  generateImage(options: ImageGenerationOptions): Promise<ImageResult>;
@@ -2981,7 +2982,7 @@ declare function withRetry<T>(fn: () => Promise<T>, options?: RetryOptions): Pro
2981
2982
  * // All calls through this client now auto-retry on failures
2982
2983
  * ```
2983
2984
  */
2984
- declare function createRetryProvider(provider: AIProvider, options?: RetryOptions): AIProvider;
2985
+ declare function createRetryProvider<TProvider extends AIProvider>(provider: TProvider, options?: RetryOptions): TProvider;
2985
2986
 
2986
2987
  /**
2987
2988
  * Middleware interface for intercepting provider calls.
@@ -3040,7 +3041,7 @@ interface Middleware {
3040
3041
  * const client = new Tekimax({ provider })
3041
3042
  * ```
3042
3043
  */
3043
- declare function wrapProvider(provider: AIProvider, middlewares: Middleware[]): AIProvider;
3044
+ declare function wrapProvider<TProvider extends AIProvider>(provider: TProvider, middlewares: Middleware[]): TProvider;
3044
3045
  /**
3045
3046
  * Logging middleware — logs model, token usage, and latency to console.
3046
3047
  *
@@ -3090,154 +3091,20 @@ declare class FallbackProvider implements AIProvider {
3090
3091
  constructor(providers: AIProvider[], options?: FallbackProviderOptions);
3091
3092
  chat(options: ChatOptions): Promise<ChatResult>;
3092
3093
  chatStream(options: ChatOptions): AsyncIterable<StreamChunk>;
3093
- get generateImage(): ((options: ImageGenerationOptions) => Promise<ImageResult>) | undefined;
3094
- get editImage(): ((options: ImageEditOptions) => Promise<ImageResult>) | undefined;
3095
- get analyzeImage(): ((options: ImageAnalysisOptions) => Promise<ImageAnalysisResult>) | undefined;
3096
- get generateSpeech(): ((options: SpeechGenerationOptions) => Promise<SpeechResult>) | undefined;
3097
- get transcribeAudio(): ((options: TranscriptionOptions) => Promise<TranscriptionResult>) | undefined;
3098
- get generateVideo(): ((options: VideoGenerationOptions) => Promise<VideoResult>) | undefined;
3099
- get analyzeVideo(): ((options: VideoAnalysisOptions) => Promise<VideoAnalysisResult>) | undefined;
3100
- get embed(): ((options: EmbeddingOptions) => Promise<EmbeddingResult>) | undefined;
3094
+ get generateImage(): any;
3095
+ get editImage(): any;
3096
+ get analyzeImage(): any;
3097
+ get generateSpeech(): any;
3098
+ get transcribeAudio(): any;
3099
+ get generateVideo(): any;
3100
+ get analyzeVideo(): any;
3101
+ get embed(): any;
3101
3102
  /**
3102
3103
  * Try each provider in order. On failure, fall back to the next.
3103
3104
  */
3104
3105
  private tryProviders;
3105
3106
  }
3106
3107
 
3107
- interface ConvexManagerOptions {
3108
- /** Convex team access token. Defaults to process.env.CONVEX_ACCESS_TOKEN */
3109
- accessToken?: string;
3110
- /** Convex team ID. If omitted, auto-resolved from token via /token_details */
3111
- teamId?: string | number;
3112
- }
3113
- interface ConvexProject {
3114
- id: number;
3115
- name: string;
3116
- slug: string;
3117
- teamId: number;
3118
- createTime: number;
3119
- }
3120
- interface ConvexCreateProjectResult {
3121
- projectId: number;
3122
- deploymentName: string;
3123
- deploymentUrl: string;
3124
- }
3125
- interface ConvexCreateProjectOptions {
3126
- /** Deployment type. Default: 'prod' */
3127
- deploymentType?: 'dev' | 'prod';
3128
- /** Deployment region. Default: server-chosen. Use getRegions() to list valid IDs. */
3129
- region?: string;
3130
- }
3131
- interface ConvexEnvVar {
3132
- name: string;
3133
- value: string;
3134
- }
3135
- interface ConvexRegion {
3136
- id: string;
3137
- name: string;
3138
- }
3139
- interface ConvexTokenDetails {
3140
- type: string;
3141
- teamId: number;
3142
- name: string;
3143
- createTime: number;
3144
- }
3145
- interface ConvexDeployOptions {
3146
- /** Path to the Convex project directory (where convex/ folder lives). */
3147
- projectDir?: string;
3148
- /** Additional CLI flags for `npx convex deploy`. */
3149
- flags?: string[];
3150
- }
3151
- interface ConvexOpenAPISpecOptions {
3152
- /** Path to the Convex project directory. Defaults to cwd. */
3153
- projectDir?: string;
3154
- /** Output file path. Defaults to 'convex-spec.yaml'. */
3155
- output?: string;
3156
- /** Additional CLI flags for `npx convex-helpers open-api-spec`. */
3157
- flags?: string[];
3158
- }
3159
- /**
3160
- * Programmatic interface to the Convex Management API.
3161
- *
3162
- * Provision projects, push schemas, manage env vars, and deploy — all from code.
3163
- *
3164
- * @example
3165
- * ```ts
3166
- * import { ConvexManager } from 'tekimax-ts'
3167
- *
3168
- * const convex = new ConvexManager({
3169
- * accessToken: process.env.CONVEX_ACCESS_TOKEN,
3170
- * teamId: process.env.CONVEX_TEAM_ID,
3171
- * })
3172
- *
3173
- * // Create a project
3174
- * const project = await convex.createProject('my-ai-app')
3175
- *
3176
- * // Set env vars on the deployment
3177
- * await convex.setEnvVars(project.deploymentName, [
3178
- * { name: 'OPENAI_API_KEY', value: 'sk-...' },
3179
- * ])
3180
- *
3181
- * // Push schema & functions
3182
- * const deployKey = await convex.createDeployKey(project.deploymentName)
3183
- * await convex.deploy(deployKey, { projectDir: './my-convex-app' })
3184
- * ```
3185
- */
3186
- declare class ConvexManager {
3187
- private accessToken;
3188
- private teamId;
3189
- constructor(options?: ConvexManagerOptions);
3190
- /**
3191
- * Create a new Convex project (includes an initial deployment).
3192
- */
3193
- createProject(name: string, options?: ConvexCreateProjectOptions): Promise<ConvexCreateProjectResult>;
3194
- /**
3195
- * List all projects for the team.
3196
- */
3197
- listProjects(): Promise<ConvexProject[]>;
3198
- /**
3199
- * Delete a project by ID.
3200
- */
3201
- deleteProject(projectId: number): Promise<void>;
3202
- /**
3203
- * Generate a deploy key for a deployment (needed for schema push / deploy).
3204
- */
3205
- createDeployKey(deploymentName: string): Promise<string>;
3206
- /**
3207
- * Set environment variables on a deployment (bulk upsert).
3208
- */
3209
- setEnvVars(deploymentName: string, vars: ConvexEnvVar[]): Promise<void>;
3210
- /**
3211
- * List environment variables on a deployment.
3212
- */
3213
- getEnvVars(deploymentName: string): Promise<ConvexEnvVar[]>;
3214
- /**
3215
- * Push Convex functions and schema to a deployment.
3216
- * Shells out to `npx convex deploy` with the given deploy key.
3217
- */
3218
- deploy(deployKey: string, options?: ConvexDeployOptions): void;
3219
- /**
3220
- * Resolve token details (type, teamId, name) from the access token.
3221
- */
3222
- getTokenDetails(): Promise<ConvexTokenDetails>;
3223
- /**
3224
- * List available deployment regions.
3225
- */
3226
- getRegions(): Promise<ConvexRegion[]>;
3227
- /**
3228
- * Generate an OpenAPI specification from a Convex deployment.
3229
- *
3230
- * Uses `npx convex-helpers open-api-spec` to introspect the deployment
3231
- * and produce a `convex-spec.yaml` file. You can then use tools like
3232
- * openapi-generator-cli to create type-safe clients in Go, Java, etc.
3233
- *
3234
- * @see https://docs.convex.dev/client/open-api
3235
- */
3236
- generateOpenAPISpec(options?: ConvexOpenAPISpecOptions): void;
3237
- private resolveTeamId;
3238
- private request;
3239
- }
3240
-
3241
3108
  /**
3242
3109
  * Minimal Redis client interface.
3243
3110
  * Compatible with `ioredis`, `@upstash/redis`, `redis` (node-redis), etc.
@@ -3400,4 +3267,42 @@ declare class SessionStore {
3400
3267
  touch(sessionId: string): Promise<void>;
3401
3268
  }
3402
3269
 
3403
- export { AIProvider, AnthropicProvider, types as ApiTypes, type CacheOptions, ChatOptions, ChatResult, type ConvexCreateProjectOptions, type ConvexCreateProjectResult, type ConvexDeployOptions, type ConvexEnvVar, ConvexManager, type ConvexManagerOptions, type ConvexOpenAPISpecOptions, type ConvexProject, type ConvexRegion, type ConvexTokenDetails, type CostEstimate, EmbeddingOptions, EmbeddingResult, FallbackProvider, type FallbackProviderOptions, GeminiProvider, type GenerateObjectOptions, type GenerateObjectResult, type GenerateTextOptions, GenerateTextResult, GrokProvider, ImageAnalysisOptions, ImageAnalysisResult, ImageEditOptions, ImageGenerationOptions, ImageResult, Message$1 as Message, type Middleware, OllamaProvider, OpenAIProvider, OpenRouterProvider, type RateLimitOptions, type RateLimitResult, RateLimiter, type RedisClient, ResponseCache, type RetryOptions, type SessionOptions, SessionStore, SpeechGenerationOptions, SpeechResult, StreamChunk, TekimaxClient, TekimaxProvider, TokenBudget, type TokenBudgetOptions, type TokenBudgetResult, type TokenUsage, Tool$1 as Tool, TranscriptionOptions, TranscriptionResult, VideoAnalysisOptions, VideoAnalysisResult, VideoGenerationOptions, VideoResult, createRetryProvider, estimateCost, fileToBase64, generateObject, generateText, getSupportedCostModels, loggingMiddleware, parseThinking, registerModelPrice, tool, withRetry, wrapProvider };
3270
+ /**
3271
+ * Telemetry: basic Logger Plugin
3272
+ * Logs payloads, streaming chunks, and tool execution boundaries.
3273
+ */
3274
+ declare class LoggerPlugin implements TekimaxPlugin {
3275
+ name: string;
3276
+ onInit(): void;
3277
+ beforeRequest(context: PluginContext): Promise<void>;
3278
+ afterResponse(context: PluginContext, result: ChatResult): Promise<void>;
3279
+ onStreamChunk(context: PluginContext, chunk: StreamChunk): void;
3280
+ beforeToolExecute(toolName: string, args: unknown): Promise<void>;
3281
+ afterToolExecute(toolName: string, result: unknown): Promise<void>;
3282
+ }
3283
+
3284
+ /**
3285
+ * Security: PII Filter Plugin
3286
+ * Redacts sensitive standard patterns (like emails and SSNs) from messages
3287
+ * before they are sent to the provider.
3288
+ */
3289
+ declare class PIIFilterPlugin implements TekimaxPlugin {
3290
+ name: string;
3291
+ private patterns;
3292
+ beforeRequest(context: PluginContext): Promise<PluginContext | void>;
3293
+ }
3294
+
3295
+ /**
3296
+ * Scalability: Max Context Overflow Plugin
3297
+ * Prevents token overflow in long-running loops by aggressively
3298
+ * shifting out the oldest messages (excluding the system prompt)
3299
+ * when the message array exceeds the configured limit.
3300
+ */
3301
+ declare class MaxContextOverflowPlugin implements TekimaxPlugin {
3302
+ private maxMessages;
3303
+ name: string;
3304
+ constructor(maxMessages?: number);
3305
+ beforeRequest(context: PluginContext): Promise<PluginContext | void>;
3306
+ }
3307
+
3308
+ export { AIProvider, AnthropicProvider, types as ApiTypes, type CacheOptions, ChatOptions, ChatResult, type CostEstimate, EmbeddingCapability, EmbeddingOptions, EmbeddingResult, FallbackProvider, type FallbackProviderOptions, GeminiProvider, type GenerateObjectOptions, type GenerateObjectResult, type GenerateTextOptions, GenerateTextResult, GrokProvider, ImageAnalysisOptions, ImageAnalysisResult, ImageEditCapability, ImageEditOptions, ImageGenerationCapability, ImageGenerationOptions, ImageResult, LoggerPlugin, MaxContextOverflowPlugin, Message$1 as Message, type Middleware, OllamaProvider, OpenAIProvider, OpenRouterProvider, PIIFilterPlugin, PluginContext, type RateLimitOptions, type RateLimitResult, RateLimiter, type RedisClient, ResponseCache, type RetryOptions, type SessionOptions, SessionStore, SpeechGenerationCapability, SpeechGenerationOptions, SpeechResult, StreamChunk, TekimaxClient, TekimaxPlugin, TekimaxProvider, TokenBudget, type TokenBudgetOptions, type TokenBudgetResult, type TokenUsage, Tool$1 as Tool, TranscriptionCapability, TranscriptionOptions, TranscriptionResult, VideoAnalysisCapability, VideoAnalysisOptions, VideoAnalysisResult, VisionCapability, createRetryProvider, estimateCost, fileToBase64, generateObject, generateText, getSupportedCostModels, loggingMiddleware, parseThinking, registerModelPrice, tool, withRetry, wrapProvider };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AIProvider, C as ChatOptions, a as ChatResult, S as StreamChunk, T as Tool$1, M as Message$1, G as GenerateTextResult, I as ImageAnalysisOptions, b as ImageAnalysisResult, V as VideoAnalysisOptions, c as VideoAnalysisResult, E as EmbeddingOptions, d as EmbeddingResult, e as SpeechGenerationOptions, f as SpeechResult, g as ImageGenerationOptions, h as ImageResult, i as TranscriptionOptions, j as TranscriptionResult, k as ImageEditOptions, l as VideoGenerationOptions, m as VideoResult } from './tekimax-Dav_a903.js';
2
- export { n as ContentPart, o as ImageContent, p as ImageContentPart, q as MessageRole, r as Tekimax, s as TekimaxOptions, t as TextContentPart, u as ToolCall, v as ToolDefinition, w as VideoContent } from './tekimax-Dav_a903.js';
1
+ import { A as AIProvider, C as ChatOptions, a as ChatResult, S as StreamChunk, T as Tool$1, M as Message$1, b as TekimaxPlugin, G as GenerateTextResult, V as VisionCapability, I as ImageAnalysisOptions, c as ImageAnalysisResult, d as VideoAnalysisCapability, E as EmbeddingCapability, e as VideoAnalysisOptions, f as VideoAnalysisResult, g as EmbeddingOptions, h as EmbeddingResult, i as SpeechGenerationCapability, j as ImageGenerationCapability, k as ImageEditCapability, l as TranscriptionCapability, m as SpeechGenerationOptions, n as SpeechResult, o as ImageGenerationOptions, p as ImageResult, q as TranscriptionOptions, r as TranscriptionResult, s as ImageEditOptions, P as PluginContext } from './tekimax-DIIjg64-.js';
2
+ export { t as ContentPart, u as ImageContent, v as ImageContentPart, w as MessageRole, x as ModelCost, y as ModelDefinition, z as ModelLimit, B as ModelModalities, O as OpenResponsesReasoningConfig, D as Tekimax, F as TekimaxOptions, H as TextContentPart, J as ToolCall, K as ToolDefinition, L as VideoContent, N as VideoGenerationCapability, Q as VideoGenerationOptions, R as VideoResult } from './tekimax-DIIjg64-.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -2734,8 +2734,9 @@ interface GenerateTextOptions {
2734
2734
  temperature?: number;
2735
2735
  maxTokens?: number;
2736
2736
  signal?: AbortSignal;
2737
+ plugins?: TekimaxPlugin[];
2737
2738
  }
2738
- declare function generateText({ adapter, ...options }: GenerateTextOptions & {
2739
+ declare function generateText({ adapter, plugins, ...options }: GenerateTextOptions & {
2739
2740
  adapter: AIProvider;
2740
2741
  }): Promise<GenerateTextResult>;
2741
2742
 
@@ -2748,7 +2749,7 @@ declare const parseThinking: (content: string) => {
2748
2749
  rest: string;
2749
2750
  };
2750
2751
 
2751
- declare class AnthropicProvider implements AIProvider {
2752
+ declare class AnthropicProvider implements AIProvider, VisionCapability {
2752
2753
  name: string;
2753
2754
  private client;
2754
2755
  constructor(options: {
@@ -2761,7 +2762,7 @@ declare class AnthropicProvider implements AIProvider {
2761
2762
  private mapTool;
2762
2763
  }
2763
2764
 
2764
- declare class GeminiProvider implements AIProvider {
2765
+ declare class GeminiProvider implements AIProvider, VisionCapability, VideoAnalysisCapability, EmbeddingCapability {
2765
2766
  name: string;
2766
2767
  private client;
2767
2768
  constructor(options: {
@@ -2790,12 +2791,12 @@ declare class OllamaProvider implements AIProvider {
2790
2791
  private mapTool;
2791
2792
  }
2792
2793
 
2793
- declare class OpenAIProvider implements AIProvider {
2794
+ declare class OpenAIProvider implements AIProvider, SpeechGenerationCapability, ImageGenerationCapability, ImageEditCapability, VisionCapability, TranscriptionCapability, EmbeddingCapability {
2794
2795
  name: string;
2795
2796
  private client;
2796
2797
  constructor(options: {
2797
2798
  apiKey: string;
2798
- dangerouslyAllowBrowser?: boolean;
2799
+ baseURL?: string;
2799
2800
  });
2800
2801
  generateSpeech(options: SpeechGenerationOptions): Promise<SpeechResult>;
2801
2802
  generateImage(options: ImageGenerationOptions): Promise<ImageResult>;
@@ -2981,7 +2982,7 @@ declare function withRetry<T>(fn: () => Promise<T>, options?: RetryOptions): Pro
2981
2982
  * // All calls through this client now auto-retry on failures
2982
2983
  * ```
2983
2984
  */
2984
- declare function createRetryProvider(provider: AIProvider, options?: RetryOptions): AIProvider;
2985
+ declare function createRetryProvider<TProvider extends AIProvider>(provider: TProvider, options?: RetryOptions): TProvider;
2985
2986
 
2986
2987
  /**
2987
2988
  * Middleware interface for intercepting provider calls.
@@ -3040,7 +3041,7 @@ interface Middleware {
3040
3041
  * const client = new Tekimax({ provider })
3041
3042
  * ```
3042
3043
  */
3043
- declare function wrapProvider(provider: AIProvider, middlewares: Middleware[]): AIProvider;
3044
+ declare function wrapProvider<TProvider extends AIProvider>(provider: TProvider, middlewares: Middleware[]): TProvider;
3044
3045
  /**
3045
3046
  * Logging middleware — logs model, token usage, and latency to console.
3046
3047
  *
@@ -3090,154 +3091,20 @@ declare class FallbackProvider implements AIProvider {
3090
3091
  constructor(providers: AIProvider[], options?: FallbackProviderOptions);
3091
3092
  chat(options: ChatOptions): Promise<ChatResult>;
3092
3093
  chatStream(options: ChatOptions): AsyncIterable<StreamChunk>;
3093
- get generateImage(): ((options: ImageGenerationOptions) => Promise<ImageResult>) | undefined;
3094
- get editImage(): ((options: ImageEditOptions) => Promise<ImageResult>) | undefined;
3095
- get analyzeImage(): ((options: ImageAnalysisOptions) => Promise<ImageAnalysisResult>) | undefined;
3096
- get generateSpeech(): ((options: SpeechGenerationOptions) => Promise<SpeechResult>) | undefined;
3097
- get transcribeAudio(): ((options: TranscriptionOptions) => Promise<TranscriptionResult>) | undefined;
3098
- get generateVideo(): ((options: VideoGenerationOptions) => Promise<VideoResult>) | undefined;
3099
- get analyzeVideo(): ((options: VideoAnalysisOptions) => Promise<VideoAnalysisResult>) | undefined;
3100
- get embed(): ((options: EmbeddingOptions) => Promise<EmbeddingResult>) | undefined;
3094
+ get generateImage(): any;
3095
+ get editImage(): any;
3096
+ get analyzeImage(): any;
3097
+ get generateSpeech(): any;
3098
+ get transcribeAudio(): any;
3099
+ get generateVideo(): any;
3100
+ get analyzeVideo(): any;
3101
+ get embed(): any;
3101
3102
  /**
3102
3103
  * Try each provider in order. On failure, fall back to the next.
3103
3104
  */
3104
3105
  private tryProviders;
3105
3106
  }
3106
3107
 
3107
- interface ConvexManagerOptions {
3108
- /** Convex team access token. Defaults to process.env.CONVEX_ACCESS_TOKEN */
3109
- accessToken?: string;
3110
- /** Convex team ID. If omitted, auto-resolved from token via /token_details */
3111
- teamId?: string | number;
3112
- }
3113
- interface ConvexProject {
3114
- id: number;
3115
- name: string;
3116
- slug: string;
3117
- teamId: number;
3118
- createTime: number;
3119
- }
3120
- interface ConvexCreateProjectResult {
3121
- projectId: number;
3122
- deploymentName: string;
3123
- deploymentUrl: string;
3124
- }
3125
- interface ConvexCreateProjectOptions {
3126
- /** Deployment type. Default: 'prod' */
3127
- deploymentType?: 'dev' | 'prod';
3128
- /** Deployment region. Default: server-chosen. Use getRegions() to list valid IDs. */
3129
- region?: string;
3130
- }
3131
- interface ConvexEnvVar {
3132
- name: string;
3133
- value: string;
3134
- }
3135
- interface ConvexRegion {
3136
- id: string;
3137
- name: string;
3138
- }
3139
- interface ConvexTokenDetails {
3140
- type: string;
3141
- teamId: number;
3142
- name: string;
3143
- createTime: number;
3144
- }
3145
- interface ConvexDeployOptions {
3146
- /** Path to the Convex project directory (where convex/ folder lives). */
3147
- projectDir?: string;
3148
- /** Additional CLI flags for `npx convex deploy`. */
3149
- flags?: string[];
3150
- }
3151
- interface ConvexOpenAPISpecOptions {
3152
- /** Path to the Convex project directory. Defaults to cwd. */
3153
- projectDir?: string;
3154
- /** Output file path. Defaults to 'convex-spec.yaml'. */
3155
- output?: string;
3156
- /** Additional CLI flags for `npx convex-helpers open-api-spec`. */
3157
- flags?: string[];
3158
- }
3159
- /**
3160
- * Programmatic interface to the Convex Management API.
3161
- *
3162
- * Provision projects, push schemas, manage env vars, and deploy — all from code.
3163
- *
3164
- * @example
3165
- * ```ts
3166
- * import { ConvexManager } from 'tekimax-ts'
3167
- *
3168
- * const convex = new ConvexManager({
3169
- * accessToken: process.env.CONVEX_ACCESS_TOKEN,
3170
- * teamId: process.env.CONVEX_TEAM_ID,
3171
- * })
3172
- *
3173
- * // Create a project
3174
- * const project = await convex.createProject('my-ai-app')
3175
- *
3176
- * // Set env vars on the deployment
3177
- * await convex.setEnvVars(project.deploymentName, [
3178
- * { name: 'OPENAI_API_KEY', value: 'sk-...' },
3179
- * ])
3180
- *
3181
- * // Push schema & functions
3182
- * const deployKey = await convex.createDeployKey(project.deploymentName)
3183
- * await convex.deploy(deployKey, { projectDir: './my-convex-app' })
3184
- * ```
3185
- */
3186
- declare class ConvexManager {
3187
- private accessToken;
3188
- private teamId;
3189
- constructor(options?: ConvexManagerOptions);
3190
- /**
3191
- * Create a new Convex project (includes an initial deployment).
3192
- */
3193
- createProject(name: string, options?: ConvexCreateProjectOptions): Promise<ConvexCreateProjectResult>;
3194
- /**
3195
- * List all projects for the team.
3196
- */
3197
- listProjects(): Promise<ConvexProject[]>;
3198
- /**
3199
- * Delete a project by ID.
3200
- */
3201
- deleteProject(projectId: number): Promise<void>;
3202
- /**
3203
- * Generate a deploy key for a deployment (needed for schema push / deploy).
3204
- */
3205
- createDeployKey(deploymentName: string): Promise<string>;
3206
- /**
3207
- * Set environment variables on a deployment (bulk upsert).
3208
- */
3209
- setEnvVars(deploymentName: string, vars: ConvexEnvVar[]): Promise<void>;
3210
- /**
3211
- * List environment variables on a deployment.
3212
- */
3213
- getEnvVars(deploymentName: string): Promise<ConvexEnvVar[]>;
3214
- /**
3215
- * Push Convex functions and schema to a deployment.
3216
- * Shells out to `npx convex deploy` with the given deploy key.
3217
- */
3218
- deploy(deployKey: string, options?: ConvexDeployOptions): void;
3219
- /**
3220
- * Resolve token details (type, teamId, name) from the access token.
3221
- */
3222
- getTokenDetails(): Promise<ConvexTokenDetails>;
3223
- /**
3224
- * List available deployment regions.
3225
- */
3226
- getRegions(): Promise<ConvexRegion[]>;
3227
- /**
3228
- * Generate an OpenAPI specification from a Convex deployment.
3229
- *
3230
- * Uses `npx convex-helpers open-api-spec` to introspect the deployment
3231
- * and produce a `convex-spec.yaml` file. You can then use tools like
3232
- * openapi-generator-cli to create type-safe clients in Go, Java, etc.
3233
- *
3234
- * @see https://docs.convex.dev/client/open-api
3235
- */
3236
- generateOpenAPISpec(options?: ConvexOpenAPISpecOptions): void;
3237
- private resolveTeamId;
3238
- private request;
3239
- }
3240
-
3241
3108
  /**
3242
3109
  * Minimal Redis client interface.
3243
3110
  * Compatible with `ioredis`, `@upstash/redis`, `redis` (node-redis), etc.
@@ -3400,4 +3267,42 @@ declare class SessionStore {
3400
3267
  touch(sessionId: string): Promise<void>;
3401
3268
  }
3402
3269
 
3403
- export { AIProvider, AnthropicProvider, types as ApiTypes, type CacheOptions, ChatOptions, ChatResult, type ConvexCreateProjectOptions, type ConvexCreateProjectResult, type ConvexDeployOptions, type ConvexEnvVar, ConvexManager, type ConvexManagerOptions, type ConvexOpenAPISpecOptions, type ConvexProject, type ConvexRegion, type ConvexTokenDetails, type CostEstimate, EmbeddingOptions, EmbeddingResult, FallbackProvider, type FallbackProviderOptions, GeminiProvider, type GenerateObjectOptions, type GenerateObjectResult, type GenerateTextOptions, GenerateTextResult, GrokProvider, ImageAnalysisOptions, ImageAnalysisResult, ImageEditOptions, ImageGenerationOptions, ImageResult, Message$1 as Message, type Middleware, OllamaProvider, OpenAIProvider, OpenRouterProvider, type RateLimitOptions, type RateLimitResult, RateLimiter, type RedisClient, ResponseCache, type RetryOptions, type SessionOptions, SessionStore, SpeechGenerationOptions, SpeechResult, StreamChunk, TekimaxClient, TekimaxProvider, TokenBudget, type TokenBudgetOptions, type TokenBudgetResult, type TokenUsage, Tool$1 as Tool, TranscriptionOptions, TranscriptionResult, VideoAnalysisOptions, VideoAnalysisResult, VideoGenerationOptions, VideoResult, createRetryProvider, estimateCost, fileToBase64, generateObject, generateText, getSupportedCostModels, loggingMiddleware, parseThinking, registerModelPrice, tool, withRetry, wrapProvider };
3270
+ /**
3271
+ * Telemetry: basic Logger Plugin
3272
+ * Logs payloads, streaming chunks, and tool execution boundaries.
3273
+ */
3274
+ declare class LoggerPlugin implements TekimaxPlugin {
3275
+ name: string;
3276
+ onInit(): void;
3277
+ beforeRequest(context: PluginContext): Promise<void>;
3278
+ afterResponse(context: PluginContext, result: ChatResult): Promise<void>;
3279
+ onStreamChunk(context: PluginContext, chunk: StreamChunk): void;
3280
+ beforeToolExecute(toolName: string, args: unknown): Promise<void>;
3281
+ afterToolExecute(toolName: string, result: unknown): Promise<void>;
3282
+ }
3283
+
3284
+ /**
3285
+ * Security: PII Filter Plugin
3286
+ * Redacts sensitive standard patterns (like emails and SSNs) from messages
3287
+ * before they are sent to the provider.
3288
+ */
3289
+ declare class PIIFilterPlugin implements TekimaxPlugin {
3290
+ name: string;
3291
+ private patterns;
3292
+ beforeRequest(context: PluginContext): Promise<PluginContext | void>;
3293
+ }
3294
+
3295
+ /**
3296
+ * Scalability: Max Context Overflow Plugin
3297
+ * Prevents token overflow in long-running loops by aggressively
3298
+ * shifting out the oldest messages (excluding the system prompt)
3299
+ * when the message array exceeds the configured limit.
3300
+ */
3301
+ declare class MaxContextOverflowPlugin implements TekimaxPlugin {
3302
+ private maxMessages;
3303
+ name: string;
3304
+ constructor(maxMessages?: number);
3305
+ beforeRequest(context: PluginContext): Promise<PluginContext | void>;
3306
+ }
3307
+
3308
+ export { AIProvider, AnthropicProvider, types as ApiTypes, type CacheOptions, ChatOptions, ChatResult, type CostEstimate, EmbeddingCapability, EmbeddingOptions, EmbeddingResult, FallbackProvider, type FallbackProviderOptions, GeminiProvider, type GenerateObjectOptions, type GenerateObjectResult, type GenerateTextOptions, GenerateTextResult, GrokProvider, ImageAnalysisOptions, ImageAnalysisResult, ImageEditCapability, ImageEditOptions, ImageGenerationCapability, ImageGenerationOptions, ImageResult, LoggerPlugin, MaxContextOverflowPlugin, Message$1 as Message, type Middleware, OllamaProvider, OpenAIProvider, OpenRouterProvider, PIIFilterPlugin, PluginContext, type RateLimitOptions, type RateLimitResult, RateLimiter, type RedisClient, ResponseCache, type RetryOptions, type SessionOptions, SessionStore, SpeechGenerationCapability, SpeechGenerationOptions, SpeechResult, StreamChunk, TekimaxClient, TekimaxPlugin, TekimaxProvider, TokenBudget, type TokenBudgetOptions, type TokenBudgetResult, type TokenUsage, Tool$1 as Tool, TranscriptionCapability, TranscriptionOptions, TranscriptionResult, VideoAnalysisCapability, VideoAnalysisOptions, VideoAnalysisResult, VisionCapability, createRetryProvider, estimateCost, fileToBase64, generateObject, generateText, getSupportedCostModels, loggingMiddleware, parseThinking, registerModelPrice, tool, withRetry, wrapProvider };