@egdesk/next-api-plugin 1.5.9 → 1.5.10

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.
@@ -2162,6 +2162,7 @@ export type AiCallerCallOptions = {
2162
2162
  systemPrompt?: string;
2163
2163
  model?: string;
2164
2164
  temperature?: number;
2165
+ /** Max output tokens. Omit to auto-use the selected model's Gemini API maximum. */
2165
2166
  maxOutputTokens?: number;
2166
2167
  caller?: string;
2167
2168
  responseSchema?: Record<string, any>;
@@ -2189,11 +2190,58 @@ export type AiCallerCallOptions = {
2189
2190
  : 'string'};
2190
2191
  };
2191
2192
 
2193
+ export type AiCallerModelDetails = {
2194
+ name: string;
2195
+ displayName: string;
2196
+ inputTokenLimit: number | null;
2197
+ outputTokenLimit: number | null;
2198
+ };
2199
+
2200
+ export type AiCallerOutputTokens = {
2201
+ configured: number;
2202
+ modelMax: number | null;
2203
+ autoMaxed: boolean;
2204
+ };
2205
+
2206
+ export type AiCallerUsageSummary = {
2207
+ promptTokens: number;
2208
+ completionTokens: number;
2209
+ totalTokens: number;
2210
+ durationMs: number;
2211
+ };
2212
+
2213
+ export type AiCallerAttachmentsSummary = {
2214
+ imageCount?: number;
2215
+ textFileCount?: number;
2216
+ documentFileCount?: number;
2217
+ videoFileCount?: number;
2218
+ };
2219
+
2220
+ export type AiCallerFunctionCall = {
2221
+ name: string;
2222
+ args: Record<string, unknown>;
2223
+ };
2224
+
2225
+ export type AiCallerCallResult = {
2226
+ content: string;
2227
+ json: unknown | null;
2228
+ functionCalls: AiCallerFunctionCall[];
2229
+ groundingMetadata: unknown | null;
2230
+ codeExecutionResult: string | null;
2231
+ finishReason: string | null;
2232
+ outputTokens: AiCallerOutputTokens;
2233
+ usage: AiCallerUsageSummary;
2234
+ apiKey: { name: string; id: string | null } | null;
2235
+ attachments: AiCallerAttachmentsSummary;
2236
+ logId: string;
2237
+ };
2238
+
2192
2239
  /**
2193
2240
  * Call Gemini and log token usage. Returns the AI response plus a usage summary.
2194
2241
  * Supports images, filePaths, and inline files (documents, text, video frames).
2242
+ * Omit \`maxOutputTokens\` to auto-use the selected model's maximum from the Gemini API.
2195
2243
  */
2196
- export async function callAiCaller(prompt: string, options: AiCallerCallOptions = {}) {
2244
+ export async function callAiCaller(prompt: string, options: AiCallerCallOptions = {}): Promise<AiCallerCallResult> {
2197
2245
  return callAiCallerTool('ai_caller_call', { prompt, ...options });
2198
2246
  }
2199
2247
 
@@ -2229,10 +2277,12 @@ export async function getAiCallerLogs(options: AiCallerLogsOptions = {}) {
2229
2277
  export type AiCallerModelsResult = {
2230
2278
  models: string[];
2231
2279
  defaultModel: string;
2280
+ modelDetails?: AiCallerModelDetails[];
2232
2281
  };
2233
2282
 
2234
2283
  /**
2235
2284
  * List Gemini models available for text generation, fetched live from the Google API via EGDesk.
2285
+ * Includes per-model input/output token limits when available.
2236
2286
  */
2237
2287
  export async function listAiCallerModels(): Promise<AiCallerModelsResult> {
2238
2288
  return callAiCallerTool('ai_caller_list_models', {});
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * The minimum EGDesk app version this plugin version is compatible with.
9
9
  * The app checks this at setup time and warns on mismatch.
10
10
  */
11
- export declare const COMPATIBLE_APP_VERSION = "1.4.10";
11
+ export declare const COMPATIBLE_APP_VERSION = "1.4.11";
12
12
  export interface SetupOptions {
13
13
  egdeskUrl?: string;
14
14
  /** Production EGDesk server URL — written to .env.production.local. Falls back to egdeskUrl. */
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@ exports.setupNextApiPlugin = setupNextApiPlugin;
46
46
  * The minimum EGDesk app version this plugin version is compatible with.
47
47
  * The app checks this at setup time and warns on mismatch.
48
48
  */
49
- exports.COMPATIBLE_APP_VERSION = '1.4.10';
49
+ exports.COMPATIBLE_APP_VERSION = '1.4.11';
50
50
  const fs = __importStar(require("fs"));
51
51
  const path = __importStar(require("path"));
52
52
  const setup_userdata_1 = require("./setup-userdata");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egdesk/next-api-plugin",
3
- "version": "1.5.9",
3
+ "version": "1.5.10",
4
4
  "description": "Next.js plugin for EGDesk database proxy integration",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",