@egdesk/next-api-plugin 1.5.8 → 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.
- package/dist/generate-helpers.js +58 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/generate-helpers.js
CHANGED
|
@@ -2162,9 +2162,17 @@ 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>;
|
|
2169
|
+
/** Gemini function declarations for tool use */
|
|
2170
|
+
tools?: Array<Record<string, any>>;
|
|
2171
|
+
/** Function-calling mode and restrictions */
|
|
2172
|
+
toolConfig?: {
|
|
2173
|
+
mode?: 'AUTO' | 'ANY' | 'NONE' | 'MODE_UNSPECIFIED';
|
|
2174
|
+
allowedFunctionNames?: string[];
|
|
2175
|
+
};
|
|
2168
2176
|
/** Base64 strings (raw or data URLs) */
|
|
2169
2177
|
images?: string[];
|
|
2170
2178
|
/** Absolute paths — images, text files, .pdf, .docx, video (same rules as filesystem MCP) */
|
|
@@ -2182,11 +2190,58 @@ export type AiCallerCallOptions = {
|
|
|
2182
2190
|
: 'string'};
|
|
2183
2191
|
};
|
|
2184
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
|
+
|
|
2185
2239
|
/**
|
|
2186
2240
|
* Call Gemini and log token usage. Returns the AI response plus a usage summary.
|
|
2187
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.
|
|
2188
2243
|
*/
|
|
2189
|
-
export async function callAiCaller(prompt: string, options: AiCallerCallOptions = {}) {
|
|
2244
|
+
export async function callAiCaller(prompt: string, options: AiCallerCallOptions = {}): Promise<AiCallerCallResult> {
|
|
2190
2245
|
return callAiCallerTool('ai_caller_call', { prompt, ...options });
|
|
2191
2246
|
}
|
|
2192
2247
|
|
|
@@ -2222,10 +2277,12 @@ export async function getAiCallerLogs(options: AiCallerLogsOptions = {}) {
|
|
|
2222
2277
|
export type AiCallerModelsResult = {
|
|
2223
2278
|
models: string[];
|
|
2224
2279
|
defaultModel: string;
|
|
2280
|
+
modelDetails?: AiCallerModelDetails[];
|
|
2225
2281
|
};
|
|
2226
2282
|
|
|
2227
2283
|
/**
|
|
2228
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.
|
|
2229
2286
|
*/
|
|
2230
2287
|
export async function listAiCallerModels(): Promise<AiCallerModelsResult> {
|
|
2231
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.
|
|
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.
|
|
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");
|