@egdesk/next-api-plugin 1.5.55 → 1.5.56

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.
@@ -2842,6 +2842,10 @@ export type AiCallerCallOptions = {
2842
2842
  keyName?: ${(options.apiKeyNames ?? []).length > 0
2843
2843
  ? (options.apiKeyNames.map(n => `'${n}'`).join(' | ') + ' | (string & {})')
2844
2844
  : 'string'};
2845
+ /** standard = default. flex = 50% cheaper, slower/sheddable. priority = more expensive. */
2846
+ serviceTier?: 'standard' | 'flex' | 'priority';
2847
+ /** Explicit cache name from createAiCallerCache (cachedContents/...). */
2848
+ cachedContent?: string;
2845
2849
  };
2846
2850
 
2847
2851
  export type AiCallerModelDetails = {
@@ -2888,6 +2892,8 @@ export type AiCallerCallResult = {
2888
2892
  apiKey: { name: string; id: string | null } | null;
2889
2893
  attachments: AiCallerAttachmentsSummary;
2890
2894
  logId: string;
2895
+ serviceTier: 'standard' | 'flex' | 'priority';
2896
+ cachedContent: string | null;
2891
2897
  };
2892
2898
 
2893
2899
  /**
@@ -2924,6 +2930,8 @@ export type AiCallerGenerateImageOptions = {
2924
2930
  keyName?: ${(options.apiKeyNames ?? []).length > 0
2925
2931
  ? (options.apiKeyNames.map(n => `'${n}'`).join(' | ') + ' | (string & {})')
2926
2932
  : 'string'};
2933
+ /** standard = default. flex = 50% cheaper, slower/sheddable. */
2934
+ serviceTier?: 'standard' | 'flex' | 'priority';
2927
2935
  };
2928
2936
 
2929
2937
  export type AiCallerGeneratedImage = {
@@ -3001,6 +3009,86 @@ export async function listAiCallerModels(): Promise<AiCallerModelsResult> {
3001
3009
  return callAiCallerTool('ai_caller_list_models', {});
3002
3010
  }
3003
3011
 
3012
+ export type AiCallerBatchRequest = {
3013
+ key?: string;
3014
+ prompt?: string;
3015
+ systemPrompt?: string;
3016
+ temperature?: number;
3017
+ maxOutputTokens?: number;
3018
+ responseSchema?: Record<string, any>;
3019
+ tools?: Array<Record<string, any>>;
3020
+ toolConfig?: AiCallerCallOptions['toolConfig'];
3021
+ cachedContent?: string;
3022
+ images?: string[];
3023
+ filePaths?: string[];
3024
+ files?: AiCallerCallOptions['files'];
3025
+ };
3026
+
3027
+ export type AiCallerBatchSubmitOptions = {
3028
+ model?: string;
3029
+ displayName?: string;
3030
+ caller?: string;
3031
+ keyName?: ${(options.apiKeyNames ?? []).length > 0
3032
+ ? (options.apiKeyNames.map(n => `'${n}'`).join(' | ') + ' | (string & {})')
3033
+ : 'string'};
3034
+ };
3035
+
3036
+ /** Submit an async Gemini Batch job (50% of standard price). Poll with getAiCallerBatch. */
3037
+ export async function submitAiCallerBatch(
3038
+ requests: AiCallerBatchRequest[],
3039
+ options: AiCallerBatchSubmitOptions = {}
3040
+ ) {
3041
+ return callAiCallerTool('ai_caller_batch_submit', { requests, ...options });
3042
+ }
3043
+
3044
+ /** Get a Gemini Batch job. Set waitMs to poll up to 120s per call. */
3045
+ export async function getAiCallerBatch(
3046
+ name: string,
3047
+ options: { includeResults?: boolean; waitMs?: number; pollIntervalMs?: number; keyName?: string } = {}
3048
+ ) {
3049
+ return callAiCallerTool('ai_caller_batch_get', { name, ...options });
3050
+ }
3051
+
3052
+ export async function listAiCallerBatches(options: { pageSize?: number; pageToken?: string; keyName?: string } = {}) {
3053
+ return callAiCallerTool('ai_caller_batch_list', options);
3054
+ }
3055
+
3056
+ export async function cancelAiCallerBatch(name: string, options: { keyName?: string } = {}) {
3057
+ return callAiCallerTool('ai_caller_batch_cancel', { name, ...options });
3058
+ }
3059
+
3060
+ export type AiCallerCacheCreateOptions = {
3061
+ prompt?: string;
3062
+ systemPrompt?: string;
3063
+ model?: string;
3064
+ displayName?: string;
3065
+ ttl?: string | number;
3066
+ images?: string[];
3067
+ filePaths?: string[];
3068
+ files?: AiCallerCallOptions['files'];
3069
+ caller?: string;
3070
+ keyName?: ${(options.apiKeyNames ?? []).length > 0
3071
+ ? (options.apiKeyNames.map(n => `'${n}'`).join(' | ') + ' | (string & {})')
3072
+ : 'string'};
3073
+ };
3074
+
3075
+ /** Create an explicit Gemini context cache. Pass the returned name as cachedContent on later calls. */
3076
+ export async function createAiCallerCache(options: AiCallerCacheCreateOptions = {}) {
3077
+ return callAiCallerTool('ai_caller_cache_create', options);
3078
+ }
3079
+
3080
+ export async function listAiCallerCaches(options: { pageSize?: number; pageToken?: string; keyName?: string } = {}) {
3081
+ return callAiCallerTool('ai_caller_cache_list', options);
3082
+ }
3083
+
3084
+ export async function getAiCallerCache(name: string, options: { keyName?: string } = {}) {
3085
+ return callAiCallerTool('ai_caller_cache_get', { name, ...options });
3086
+ }
3087
+
3088
+ export async function deleteAiCallerCache(name: string, options: { keyName?: string } = {}) {
3089
+ return callAiCallerTool('ai_caller_cache_delete', { name, ...options });
3090
+ }
3091
+
3004
3092
  // ==========================================
3005
3093
  // PageIndex (MCP) — PDF RAG
3006
3094
  // ==========================================
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.63";
11
+ export declare const COMPATIBLE_APP_VERSION = "1.4.64";
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.63';
49
+ exports.COMPATIBLE_APP_VERSION = '1.4.64';
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.55",
3
+ "version": "1.5.56",
4
4
  "description": "Next.js plugin for EGDesk database proxy integration",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",