hazo_llm_api 1.0.2 → 1.0.4

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.
Files changed (151) hide show
  1. package/README.md +4 -4
  2. package/package.json +1 -1
  3. package/techdoc.md +2 -2
  4. package/dist/components/hazo_llm_prompt_config/hazo_llm_prompt_config.d.ts +0 -16
  5. package/dist/components/hazo_llm_prompt_config/hazo_llm_prompt_config.d.ts.map +0 -1
  6. package/dist/components/hazo_llm_prompt_config/hazo_llm_prompt_config.js +0 -258
  7. package/dist/components/hazo_llm_prompt_config/hazo_llm_prompt_config.js.map +0 -1
  8. package/dist/components/hazo_llm_prompt_config/index.d.ts +0 -8
  9. package/dist/components/hazo_llm_prompt_config/index.d.ts.map +0 -1
  10. package/dist/components/hazo_llm_prompt_config/index.js +0 -7
  11. package/dist/components/hazo_llm_prompt_config/index.js.map +0 -1
  12. package/dist/components/hazo_llm_prompt_config/types.d.ts +0 -74
  13. package/dist/components/hazo_llm_prompt_config/types.d.ts.map +0 -1
  14. package/dist/components/hazo_llm_prompt_config/types.js +0 -8
  15. package/dist/components/hazo_llm_prompt_config/types.js.map +0 -1
  16. package/dist/components/index.d.ts +0 -7
  17. package/dist/components/index.d.ts.map +0 -1
  18. package/dist/components/index.js +0 -7
  19. package/dist/components/index.js.map +0 -1
  20. package/dist/components/layout/index.d.ts +0 -7
  21. package/dist/components/layout/index.d.ts.map +0 -1
  22. package/dist/components/layout/index.js +0 -7
  23. package/dist/components/layout/index.js.map +0 -1
  24. package/dist/components/layout/layout.d.ts +0 -21
  25. package/dist/components/layout/layout.d.ts.map +0 -1
  26. package/dist/components/layout/layout.js +0 -18
  27. package/dist/components/layout/layout.js.map +0 -1
  28. package/dist/index.d.ts +0 -11
  29. package/dist/index.d.ts.map +0 -1
  30. package/dist/index.js +0 -13
  31. package/dist/index.js.map +0 -1
  32. package/dist/lib/config/config_parser.d.ts +0 -131
  33. package/dist/lib/config/config_parser.d.ts.map +0 -1
  34. package/dist/lib/config/config_parser.js +0 -297
  35. package/dist/lib/config/config_parser.js.map +0 -1
  36. package/dist/lib/config/index.d.ts +0 -8
  37. package/dist/lib/config/index.d.ts.map +0 -1
  38. package/dist/lib/config/index.js +0 -22
  39. package/dist/lib/config/index.js.map +0 -1
  40. package/dist/lib/config/provider_loader.d.ts +0 -113
  41. package/dist/lib/config/provider_loader.d.ts.map +0 -1
  42. package/dist/lib/config/provider_loader.js +0 -169
  43. package/dist/lib/config/provider_loader.js.map +0 -1
  44. package/dist/lib/database/index.d.ts +0 -8
  45. package/dist/lib/database/index.d.ts.map +0 -1
  46. package/dist/lib/database/index.js +0 -8
  47. package/dist/lib/database/index.js.map +0 -1
  48. package/dist/lib/database/init_database.d.ts +0 -62
  49. package/dist/lib/database/init_database.d.ts.map +0 -1
  50. package/dist/lib/database/init_database.js +0 -436
  51. package/dist/lib/database/init_database.js.map +0 -1
  52. package/dist/lib/database/utils.d.ts +0 -50
  53. package/dist/lib/database/utils.d.ts.map +0 -1
  54. package/dist/lib/database/utils.js +0 -78
  55. package/dist/lib/database/utils.js.map +0 -1
  56. package/dist/lib/index.d.ts +0 -14
  57. package/dist/lib/index.d.ts.map +0 -1
  58. package/dist/lib/index.js +0 -17
  59. package/dist/lib/index.js.map +0 -1
  60. package/dist/lib/llm_api/hazo_llm_image_image.d.ts +0 -26
  61. package/dist/lib/llm_api/hazo_llm_image_image.d.ts.map +0 -1
  62. package/dist/lib/llm_api/hazo_llm_image_image.js +0 -92
  63. package/dist/lib/llm_api/hazo_llm_image_image.js.map +0 -1
  64. package/dist/lib/llm_api/hazo_llm_image_image_text.d.ts +0 -26
  65. package/dist/lib/llm_api/hazo_llm_image_image_text.d.ts.map +0 -1
  66. package/dist/lib/llm_api/hazo_llm_image_image_text.js +0 -220
  67. package/dist/lib/llm_api/hazo_llm_image_image_text.js.map +0 -1
  68. package/dist/lib/llm_api/hazo_llm_image_text.d.ts +0 -20
  69. package/dist/lib/llm_api/hazo_llm_image_text.d.ts.map +0 -1
  70. package/dist/lib/llm_api/hazo_llm_image_text.js +0 -76
  71. package/dist/lib/llm_api/hazo_llm_image_text.js.map +0 -1
  72. package/dist/lib/llm_api/hazo_llm_text_image.d.ts +0 -20
  73. package/dist/lib/llm_api/hazo_llm_text_image.d.ts.map +0 -1
  74. package/dist/lib/llm_api/hazo_llm_text_image.js +0 -67
  75. package/dist/lib/llm_api/hazo_llm_text_image.js.map +0 -1
  76. package/dist/lib/llm_api/hazo_llm_text_image_text.d.ts +0 -26
  77. package/dist/lib/llm_api/hazo_llm_text_image_text.d.ts.map +0 -1
  78. package/dist/lib/llm_api/hazo_llm_text_image_text.js +0 -152
  79. package/dist/lib/llm_api/hazo_llm_text_image_text.js.map +0 -1
  80. package/dist/lib/llm_api/hazo_llm_text_text.d.ts +0 -20
  81. package/dist/lib/llm_api/hazo_llm_text_text.d.ts.map +0 -1
  82. package/dist/lib/llm_api/hazo_llm_text_text.js +0 -89
  83. package/dist/lib/llm_api/hazo_llm_text_text.js.map +0 -1
  84. package/dist/lib/llm_api/index.d.ts +0 -99
  85. package/dist/lib/llm_api/index.d.ts.map +0 -1
  86. package/dist/lib/llm_api/index.js +0 -952
  87. package/dist/lib/llm_api/index.js.map +0 -1
  88. package/dist/lib/llm_api/provider_helper.d.ts +0 -107
  89. package/dist/lib/llm_api/provider_helper.d.ts.map +0 -1
  90. package/dist/lib/llm_api/provider_helper.js +0 -159
  91. package/dist/lib/llm_api/provider_helper.js.map +0 -1
  92. package/dist/lib/llm_api/types.d.ts +0 -352
  93. package/dist/lib/llm_api/types.d.ts.map +0 -1
  94. package/dist/lib/llm_api/types.js +0 -8
  95. package/dist/lib/llm_api/types.js.map +0 -1
  96. package/dist/lib/prompts/get_prompt.d.ts +0 -50
  97. package/dist/lib/prompts/get_prompt.d.ts.map +0 -1
  98. package/dist/lib/prompts/get_prompt.js +0 -232
  99. package/dist/lib/prompts/get_prompt.js.map +0 -1
  100. package/dist/lib/prompts/index.d.ts +0 -9
  101. package/dist/lib/prompts/index.d.ts.map +0 -1
  102. package/dist/lib/prompts/index.js +0 -9
  103. package/dist/lib/prompts/index.js.map +0 -1
  104. package/dist/lib/prompts/prompt_cache.d.ts +0 -151
  105. package/dist/lib/prompts/prompt_cache.d.ts.map +0 -1
  106. package/dist/lib/prompts/prompt_cache.js +0 -276
  107. package/dist/lib/prompts/prompt_cache.js.map +0 -1
  108. package/dist/lib/prompts/substitute_variables.d.ts +0 -38
  109. package/dist/lib/prompts/substitute_variables.d.ts.map +0 -1
  110. package/dist/lib/prompts/substitute_variables.js +0 -175
  111. package/dist/lib/prompts/substitute_variables.js.map +0 -1
  112. package/dist/lib/providers/gemini/gemini_client.d.ts +0 -25
  113. package/dist/lib/providers/gemini/gemini_client.d.ts.map +0 -1
  114. package/dist/lib/providers/gemini/gemini_client.js +0 -235
  115. package/dist/lib/providers/gemini/gemini_client.js.map +0 -1
  116. package/dist/lib/providers/gemini/gemini_provider.d.ts +0 -111
  117. package/dist/lib/providers/gemini/gemini_provider.d.ts.map +0 -1
  118. package/dist/lib/providers/gemini/gemini_provider.js +0 -431
  119. package/dist/lib/providers/gemini/gemini_provider.js.map +0 -1
  120. package/dist/lib/providers/gemini/index.d.ts +0 -8
  121. package/dist/lib/providers/gemini/index.d.ts.map +0 -1
  122. package/dist/lib/providers/gemini/index.js +0 -8
  123. package/dist/lib/providers/gemini/index.js.map +0 -1
  124. package/dist/lib/providers/index.d.ts +0 -8
  125. package/dist/lib/providers/index.d.ts.map +0 -1
  126. package/dist/lib/providers/index.js +0 -8
  127. package/dist/lib/providers/index.js.map +0 -1
  128. package/dist/lib/providers/qwen/index.d.ts +0 -8
  129. package/dist/lib/providers/qwen/index.d.ts.map +0 -1
  130. package/dist/lib/providers/qwen/index.js +0 -8
  131. package/dist/lib/providers/qwen/index.js.map +0 -1
  132. package/dist/lib/providers/qwen/qwen_client.d.ts +0 -154
  133. package/dist/lib/providers/qwen/qwen_client.d.ts.map +0 -1
  134. package/dist/lib/providers/qwen/qwen_client.js +0 -1002
  135. package/dist/lib/providers/qwen/qwen_client.js.map +0 -1
  136. package/dist/lib/providers/qwen/qwen_provider.d.ts +0 -139
  137. package/dist/lib/providers/qwen/qwen_provider.d.ts.map +0 -1
  138. package/dist/lib/providers/qwen/qwen_provider.js +0 -304
  139. package/dist/lib/providers/qwen/qwen_provider.js.map +0 -1
  140. package/dist/lib/providers/registry.d.ts +0 -66
  141. package/dist/lib/providers/registry.d.ts.map +0 -1
  142. package/dist/lib/providers/registry.js +0 -158
  143. package/dist/lib/providers/registry.js.map +0 -1
  144. package/dist/lib/providers/types.d.ts +0 -95
  145. package/dist/lib/providers/types.d.ts.map +0 -1
  146. package/dist/lib/providers/types.js +0 -19
  147. package/dist/lib/providers/types.js.map +0 -1
  148. package/dist/server.d.ts +0 -21
  149. package/dist/server.d.ts.map +0 -1
  150. package/dist/server.js +0 -32
  151. package/dist/server.js.map +0 -1
@@ -1,352 +0,0 @@
1
- /**
2
- * LLM API Types
3
- *
4
- * TypeScript interfaces and types for the LLM API module.
5
- * Includes configuration, function parameters, and response types.
6
- */
7
- /**
8
- * Logger interface matching Winston logger methods
9
- * Parent application provides this logger instance
10
- */
11
- export interface Logger {
12
- error: (message: string, meta?: Record<string, unknown>) => void;
13
- info: (message: string, meta?: Record<string, unknown>) => void;
14
- warn: (message: string, meta?: Record<string, unknown>) => void;
15
- debug: (message: string, meta?: Record<string, unknown>) => void;
16
- }
17
- /**
18
- * Gemini API generation configuration parameters
19
- * All parameters are optional - only include in API calls if explicitly set
20
- * @deprecated Use provider-specific generation configs instead
21
- */
22
- export interface GeminiGenerationConfig {
23
- /** Controls randomness in output (0.0-2.0). Lower = more deterministic */
24
- temperature?: number;
25
- /** Maximum number of tokens in the response */
26
- max_output_tokens?: number;
27
- /** Nucleus sampling probability (0.0-1.0). Considers tokens up to cumulative probability */
28
- top_p?: number;
29
- /** Top-k sampling. Considers only the top K most probable tokens */
30
- top_k?: number;
31
- /** Number of response candidates to generate (1-8) */
32
- candidate_count?: number;
33
- /** Sequences that stop generation when encountered */
34
- stop_sequences?: string[];
35
- /** Format of the response: "text/plain" or "application/json" */
36
- response_mime_type?: string;
37
- }
38
- /**
39
- * Configuration options for initializing the LLM API
40
- * Supports provider-based architecture where providers are loaded from config file
41
- */
42
- export interface LLMApiConfig {
43
- /** Winston logger instance from parent application */
44
- logger: Logger;
45
- /** Path to SQLite database file (default: "/prompt_library.sqlite" relative to app root) */
46
- sqlite_path?: string;
47
- /**
48
- * Legacy: URL of the LLM API endpoint (for backward compatibility)
49
- * Providers now load URLs from config file
50
- * @deprecated Providers load API URLs from config file
51
- */
52
- api_url?: string;
53
- /**
54
- * Legacy: URL of the LLM API endpoint for image generation (for backward compatibility)
55
- * @deprecated Providers load API URLs from config file
56
- */
57
- api_url_image?: string;
58
- /**
59
- * Legacy: API key for authentication (for backward compatibility)
60
- * Providers now load API keys from .env.local
61
- * @deprecated API keys are loaded from .env.local per provider
62
- */
63
- api_key?: string;
64
- /**
65
- * Legacy: LLM model to use (for backward compatibility)
66
- * @deprecated Use provider registry instead, enabled_llms and primary_llm come from config
67
- */
68
- llm_model?: string;
69
- /**
70
- * Legacy: Generation config for text API calls (for backward compatibility)
71
- * @deprecated Use provider-specific configs from config file
72
- */
73
- gemini_text_config?: GeminiGenerationConfig;
74
- /**
75
- * Legacy: Generation config for image API calls (for backward compatibility)
76
- * @deprecated Use provider-specific configs from config file
77
- */
78
- gemini_image_config?: GeminiGenerationConfig;
79
- }
80
- /**
81
- * Single prompt variable key-value pair
82
- */
83
- export interface PromptVariable {
84
- [key: string]: string;
85
- }
86
- /**
87
- * Array of prompt variables for substitution
88
- * Format: [{ "variable1": "value1", "variable2": "value2" }]
89
- */
90
- export type PromptVariables = PromptVariable[];
91
- /**
92
- * Base64 encoded data with MIME type
93
- * Used for sending images/files to LLM APIs
94
- */
95
- export interface Base64Data {
96
- /** MIME type of the data (e.g., "image/jpeg", "image/png") */
97
- mime_type: string;
98
- /** Base64 encoded string of the data */
99
- data: string;
100
- }
101
- /**
102
- * Prompt text mode - determines how prompt text is obtained
103
- */
104
- export type PromptTextMode = 'static' | 'dynamic';
105
- /**
106
- * Parameters for the call_llm function
107
- */
108
- export interface CallLLMParams {
109
- /** Area/category of the prompt (required for dynamic mode) */
110
- prompt_area?: string;
111
- /** Key identifier for the prompt (required for dynamic mode) */
112
- prompt_key?: string;
113
- /** Variables to substitute in the prompt text */
114
- prompt_variables?: PromptVariables;
115
- /** Base64 encoded data to include in the prompt (images, etc.) */
116
- prompt_b64_data?: Base64Data[];
117
- /** Static prompt text (required for static mode) */
118
- static_prompt?: string;
119
- /** Mode for obtaining prompt text: "static" uses static_prompt, "dynamic" fetches from database */
120
- prompt_text_mode: PromptTextMode;
121
- }
122
- /**
123
- * Prompt record from the prompts_library table
124
- */
125
- export interface PromptRecord {
126
- /** Unique identifier for the prompt */
127
- uuid: string;
128
- /** Area/category of the prompt */
129
- prompt_area: string;
130
- /** Key identifier for the prompt */
131
- prompt_key: string;
132
- /** The actual prompt text */
133
- prompt_text: string;
134
- /** JSON string of variables used in the prompt */
135
- prompt_variables: string;
136
- /** Additional notes about the prompt */
137
- prompt_notes: string;
138
- /** Timestamp when the record was created */
139
- created_at: string;
140
- /** Timestamp when the record was last changed */
141
- changed_by: string;
142
- }
143
- /**
144
- * Generic LLM API response
145
- */
146
- export interface LLMResponse {
147
- /** Whether the API call was successful */
148
- success: boolean;
149
- /** The generated text response from the LLM */
150
- text?: string;
151
- /** Error message if the call failed */
152
- error?: string;
153
- /** Raw response from the API */
154
- raw_response?: unknown;
155
- /** Base64 encoded image data (for image output functions) */
156
- image_b64?: string;
157
- /** MIME type of the generated image */
158
- image_mime_type?: string;
159
- }
160
- /**
161
- * Parameters for hazo_llm_text_text (text input → text output)
162
- */
163
- export interface TextTextParams {
164
- /** Static prompt text */
165
- prompt: string;
166
- /** Variables to substitute in the prompt text */
167
- prompt_variables?: PromptVariables;
168
- /** Area/category for dynamic prompt (optional) */
169
- prompt_area?: string;
170
- /** Key for dynamic prompt (optional) */
171
- prompt_key?: string;
172
- }
173
- /**
174
- * Parameters for hazo_llm_image_text (image input → text output)
175
- */
176
- export interface ImageTextParams {
177
- /** Prompt/instruction for analyzing the image */
178
- prompt: string;
179
- /** Base64 encoded image data */
180
- image_b64: string;
181
- /** MIME type of the image (e.g., "image/jpeg", "image/png") */
182
- image_mime_type: string;
183
- /** Variables to substitute in the prompt text */
184
- prompt_variables?: PromptVariables;
185
- }
186
- /**
187
- * Parameters for hazo_llm_text_image (text input → image output)
188
- */
189
- export interface TextImageParams {
190
- /** Text prompt describing the image to generate */
191
- prompt: string;
192
- /** Variables to substitute in the prompt text */
193
- prompt_variables?: PromptVariables;
194
- }
195
- /**
196
- * Parameters for hazo_llm_image_image (image input → image output)
197
- */
198
- export interface ImageImageParams {
199
- /** Prompt/instruction for transforming the image(s) */
200
- prompt: string;
201
- /** Base64 encoded input image data (for single image, use this OR images array) */
202
- image_b64?: string;
203
- /** MIME type of the input image (for single image) */
204
- image_mime_type?: string;
205
- /** Array of input images (for multiple images) */
206
- images?: Base64Data[];
207
- /** Variables to substitute in the prompt text */
208
- prompt_variables?: PromptVariables;
209
- }
210
- /**
211
- * Parameters for hazo_llm_text_image_text (text → image → text)
212
- * Generates an image from prompt_image, then analyzes it with prompt_text
213
- */
214
- export interface TextImageTextParams {
215
- /** Prompt for image generation (step 1) */
216
- prompt_image: string;
217
- /** Prompt for analyzing the generated image (step 2) */
218
- prompt_text: string;
219
- /** Variables to substitute in the image generation prompt */
220
- prompt_image_variables?: PromptVariables;
221
- /** Variables to substitute in the text analysis prompt */
222
- prompt_text_variables?: PromptVariables;
223
- }
224
- /**
225
- * Base64 image data for chained operations
226
- */
227
- export interface ChainImage {
228
- /** Base64 encoded image data */
229
- image_b64: string;
230
- /** MIME type of the image */
231
- image_mime_type: string;
232
- }
233
- /**
234
- * Parameters for hazo_llm_image_image_text (images → image → text)
235
- * Chain multiple image transformations, then describe the final result
236
- *
237
- * Flow:
238
- * 1. Combine images[0] + images[1] using prompts[0] → result_1
239
- * 2. Combine result_1 + images[2] using prompts[1] → result_2
240
- * 3. Continue chaining through all images
241
- * 4. Analyze final result with description_prompt → text output
242
- *
243
- * Requirements:
244
- * - Minimum 2 images required
245
- * - Number of prompts = number of images - 1
246
- */
247
- export interface ImageImageTextParams {
248
- /** Array of images to chain (minimum 2) */
249
- images: ChainImage[];
250
- /** Array of transformation prompts (length = images.length - 1) */
251
- prompts: string[];
252
- /** Final prompt for describing the last generated image */
253
- description_prompt: string;
254
- /** Variables to substitute in the description prompt */
255
- description_prompt_variables?: PromptVariables;
256
- }
257
- /**
258
- * Gemini API text part
259
- */
260
- export interface GeminiTextPart {
261
- text: string;
262
- }
263
- /**
264
- * Gemini API inline data part (for images)
265
- */
266
- export interface GeminiInlineDataPart {
267
- inline_data: {
268
- mime_type: string;
269
- data: string;
270
- };
271
- }
272
- /**
273
- * Gemini API part (either text or inline data)
274
- */
275
- export type GeminiPart = GeminiTextPart | GeminiInlineDataPart;
276
- /**
277
- * Gemini API content structure
278
- */
279
- export interface GeminiContent {
280
- parts: GeminiPart[];
281
- }
282
- /**
283
- * Gemini API generation config in request format (camelCase for API)
284
- */
285
- export interface GeminiApiGenerationConfig {
286
- temperature?: number;
287
- maxOutputTokens?: number;
288
- topP?: number;
289
- topK?: number;
290
- candidateCount?: number;
291
- stopSequences?: string[];
292
- responseMimeType?: string;
293
- }
294
- /**
295
- * Gemini API request body
296
- */
297
- export interface GeminiRequestBody {
298
- contents: GeminiContent[];
299
- generationConfig?: GeminiApiGenerationConfig;
300
- }
301
- /**
302
- * Gemini API response candidate
303
- */
304
- export interface GeminiCandidate {
305
- content: {
306
- parts: Array<{
307
- text: string;
308
- }>;
309
- role: string;
310
- };
311
- finishReason: string;
312
- index: number;
313
- }
314
- /**
315
- * Gemini API response structure
316
- */
317
- export interface GeminiApiResponse {
318
- candidates?: GeminiCandidate[];
319
- promptFeedback?: {
320
- safetyRatings: Array<{
321
- category: string;
322
- probability: string;
323
- }>;
324
- };
325
- error?: {
326
- code: number;
327
- message: string;
328
- status: string;
329
- };
330
- }
331
- /**
332
- * Initialized LLM API client instance
333
- */
334
- export interface LLMApiClient {
335
- /** Configuration used to initialize the client */
336
- config: LLMApiConfig;
337
- /** Whether the database has been initialized */
338
- db_initialized: boolean;
339
- /** Text input → Text output */
340
- hazo_llm_text_text: (params: TextTextParams, llm?: string) => Promise<LLMResponse>;
341
- /** Image input → Text output (image analysis) */
342
- hazo_llm_image_text: (params: ImageTextParams, llm?: string) => Promise<LLMResponse>;
343
- /** Text input → Image output (image generation) */
344
- hazo_llm_text_image: (params: TextImageParams, llm?: string) => Promise<LLMResponse>;
345
- /** Image input → Image output (image transformation) */
346
- hazo_llm_image_image: (params: ImageImageParams, llm?: string) => Promise<LLMResponse>;
347
- /** Text → Image → Text (generate image then analyze it) */
348
- hazo_llm_text_image_text: (params: TextImageTextParams, llm?: string) => Promise<LLMResponse>;
349
- /** Images → Image → Text (chain image transformations then describe) */
350
- hazo_llm_image_image_text: (params: ImageImageTextParams, llm?: string) => Promise<LLMResponse>;
351
- }
352
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/llm_api/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACjE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAChE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IA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AwE;IACxE,yBAAyB,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;CACjG"}
@@ -1,8 +0,0 @@
1
- /**
2
- * LLM API Types
3
- *
4
- * TypeScript interfaces and types for the LLM API module.
5
- * Includes configuration, function parameters, and response types.
6
- */
7
- export {};
8
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/llm_api/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -1,50 +0,0 @@
1
- /**
2
- * Prompt Retrieval Module
3
- *
4
- * Functions to retrieve prompts from the prompts_library database table.
5
- * Searches by prompt_area and prompt_key to find the prompt_text.
6
- */
7
- import type { Database as SqlJsDatabase } from 'sql.js';
8
- import type { Logger, PromptRecord } from '../llm_api/types.js';
9
- /**
10
- * Retrieve a prompt from the database by prompt_area and prompt_key
11
- * @param db - Database instance
12
- * @param prompt_area - Area/category of the prompt
13
- * @param prompt_key - Key identifier for the prompt
14
- * @param logger - Logger instance
15
- * @returns The prompt record if found, null otherwise
16
- */
17
- export declare function get_prompt_by_area_and_key(db: SqlJsDatabase, prompt_area: string, prompt_key: string, logger: Logger): PromptRecord | null;
18
- /**
19
- * Retrieve the prompt text only by prompt_area and prompt_key
20
- * @param db - Database instance
21
- * @param prompt_area - Area/category of the prompt
22
- * @param prompt_key - Key identifier for the prompt
23
- * @param logger - Logger instance
24
- * @returns The prompt text if found, null otherwise
25
- */
26
- export declare function get_prompt_text(db: SqlJsDatabase, prompt_area: string, prompt_key: string, logger: Logger): string | null;
27
- /**
28
- * Get all prompts by prompt_area
29
- * @param db - Database instance
30
- * @param prompt_area - Area/category of the prompts
31
- * @param logger - Logger instance
32
- * @returns Array of prompt records
33
- */
34
- export declare function get_prompts_by_area(db: SqlJsDatabase, prompt_area: string, logger: Logger): PromptRecord[];
35
- /**
36
- * Get a prompt by its UUID
37
- * @param db - Database instance
38
- * @param uuid - UUID of the prompt
39
- * @param logger - Logger instance
40
- * @returns The prompt record if found, null otherwise
41
- */
42
- export declare function get_prompt_by_uuid(db: SqlJsDatabase, uuid: string, logger: Logger): PromptRecord | null;
43
- /**
44
- * Get all prompts from the library
45
- * @param db - Database instance
46
- * @param logger - Logger instance
47
- * @returns Array of all prompt records
48
- */
49
- export declare function get_all_prompts(db: SqlJsDatabase, logger: Logger): PromptRecord[];
50
- //# sourceMappingURL=get_prompt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get_prompt.d.ts","sourceRoot":"","sources":["../../../src/lib/prompts/get_prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOhE;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,EAAE,EAAE,aAAa,EACjB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,YAAY,GAAG,IAAI,CAmDrB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,aAAa,EACjB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,MAAM,GAAG,IAAI,CAmBf;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,aAAa,EACjB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,YAAY,EAAE,CA8ChB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,YAAY,GAAG,IAAI,CA8CrB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,aAAa,EACjB,MAAM,EAAE,MAAM,GACb,YAAY,EAAE,CA6ChB"}
@@ -1,232 +0,0 @@
1
- /**
2
- * Prompt Retrieval Module
3
- *
4
- * Functions to retrieve prompts from the prompts_library database table.
5
- * Searches by prompt_area and prompt_key to find the prompt_text.
6
- */
7
- import { row_to_prompt_record } from '../database/utils.js';
8
- // =============================================================================
9
- // Prompt Retrieval Functions
10
- // =============================================================================
11
- /**
12
- * Retrieve a prompt from the database by prompt_area and prompt_key
13
- * @param db - Database instance
14
- * @param prompt_area - Area/category of the prompt
15
- * @param prompt_key - Key identifier for the prompt
16
- * @param logger - Logger instance
17
- * @returns The prompt record if found, null otherwise
18
- */
19
- export function get_prompt_by_area_and_key(db, prompt_area, prompt_key, logger) {
20
- const file_name = 'get_prompt.ts';
21
- const select_sql = `
22
- SELECT * FROM prompts_library
23
- WHERE prompt_area = ? AND prompt_key = ?
24
- LIMIT 1
25
- `;
26
- try {
27
- logger.debug('Retrieving prompt from database', {
28
- file: file_name,
29
- line: 62,
30
- data: { prompt_area, prompt_key },
31
- });
32
- const result = db.exec(select_sql, [prompt_area, prompt_key]);
33
- if (result.length === 0 || result[0].values.length === 0) {
34
- logger.warn('Prompt not found in database', {
35
- file: file_name,
36
- line: 71,
37
- data: { prompt_area, prompt_key },
38
- });
39
- return null;
40
- }
41
- const row = result[0].values[0];
42
- const columns = result[0].columns;
43
- const record = row_to_prompt_record(row, columns);
44
- logger.info('Prompt retrieved successfully', {
45
- file: file_name,
46
- line: 82,
47
- data: {
48
- uuid: record.uuid,
49
- prompt_area: record.prompt_area,
50
- prompt_key: record.prompt_key,
51
- },
52
- });
53
- return record;
54
- }
55
- catch (error) {
56
- const error_message = error instanceof Error ? error.message : String(error);
57
- logger.error('Failed to retrieve prompt from database', {
58
- file: file_name,
59
- line: 94,
60
- data: { error: error_message, prompt_area, prompt_key },
61
- });
62
- throw error;
63
- }
64
- }
65
- /**
66
- * Retrieve the prompt text only by prompt_area and prompt_key
67
- * @param db - Database instance
68
- * @param prompt_area - Area/category of the prompt
69
- * @param prompt_key - Key identifier for the prompt
70
- * @param logger - Logger instance
71
- * @returns The prompt text if found, null otherwise
72
- */
73
- export function get_prompt_text(db, prompt_area, prompt_key, logger) {
74
- const file_name = 'get_prompt.ts';
75
- const prompt_record = get_prompt_by_area_and_key(db, prompt_area, prompt_key, logger);
76
- if (prompt_record) {
77
- logger.debug('Prompt text retrieved', {
78
- file: file_name,
79
- line: 121,
80
- data: {
81
- prompt_area,
82
- prompt_key,
83
- text_length: prompt_record.prompt_text.length,
84
- },
85
- });
86
- return prompt_record.prompt_text;
87
- }
88
- return null;
89
- }
90
- /**
91
- * Get all prompts by prompt_area
92
- * @param db - Database instance
93
- * @param prompt_area - Area/category of the prompts
94
- * @param logger - Logger instance
95
- * @returns Array of prompt records
96
- */
97
- export function get_prompts_by_area(db, prompt_area, logger) {
98
- const file_name = 'get_prompt.ts';
99
- const select_sql = `
100
- SELECT * FROM prompts_library
101
- WHERE prompt_area = ?
102
- ORDER BY prompt_key
103
- `;
104
- try {
105
- logger.debug('Retrieving prompts by area', {
106
- file: file_name,
107
- line: 157,
108
- data: { prompt_area },
109
- });
110
- const result = db.exec(select_sql, [prompt_area]);
111
- if (result.length === 0 || result[0].values.length === 0) {
112
- logger.info('No prompts found for area', {
113
- file: file_name,
114
- line: 165,
115
- data: { prompt_area },
116
- });
117
- return [];
118
- }
119
- const columns = result[0].columns;
120
- const records = result[0].values.map(row => row_to_prompt_record(row, columns));
121
- logger.info('Prompts retrieved by area', {
122
- file: file_name,
123
- line: 175,
124
- data: { prompt_area, count: records.length },
125
- });
126
- return records;
127
- }
128
- catch (error) {
129
- const error_message = error instanceof Error ? error.message : String(error);
130
- logger.error('Failed to retrieve prompts by area', {
131
- file: file_name,
132
- line: 183,
133
- data: { error: error_message, prompt_area },
134
- });
135
- throw error;
136
- }
137
- }
138
- /**
139
- * Get a prompt by its UUID
140
- * @param db - Database instance
141
- * @param uuid - UUID of the prompt
142
- * @param logger - Logger instance
143
- * @returns The prompt record if found, null otherwise
144
- */
145
- export function get_prompt_by_uuid(db, uuid, logger) {
146
- const file_name = 'get_prompt.ts';
147
- const select_sql = `
148
- SELECT * FROM prompts_library
149
- WHERE uuid = ?
150
- `;
151
- try {
152
- logger.debug('Retrieving prompt by UUID', {
153
- file: file_name,
154
- line: 211,
155
- data: { uuid },
156
- });
157
- const result = db.exec(select_sql, [uuid]);
158
- if (result.length === 0 || result[0].values.length === 0) {
159
- logger.warn('Prompt not found by UUID', {
160
- file: file_name,
161
- line: 219,
162
- data: { uuid },
163
- });
164
- return null;
165
- }
166
- const row = result[0].values[0];
167
- const columns = result[0].columns;
168
- const record = row_to_prompt_record(row, columns);
169
- logger.info('Prompt retrieved by UUID', {
170
- file: file_name,
171
- line: 229,
172
- data: { uuid },
173
- });
174
- return record;
175
- }
176
- catch (error) {
177
- const error_message = error instanceof Error ? error.message : String(error);
178
- logger.error('Failed to retrieve prompt by UUID', {
179
- file: file_name,
180
- line: 237,
181
- data: { error: error_message, uuid },
182
- });
183
- throw error;
184
- }
185
- }
186
- /**
187
- * Get all prompts from the library
188
- * @param db - Database instance
189
- * @param logger - Logger instance
190
- * @returns Array of all prompt records
191
- */
192
- export function get_all_prompts(db, logger) {
193
- const file_name = 'get_prompt.ts';
194
- const select_sql = `
195
- SELECT * FROM prompts_library
196
- ORDER BY prompt_area, prompt_key
197
- `;
198
- try {
199
- logger.debug('Retrieving all prompts', {
200
- file: file_name,
201
- line: 265,
202
- data: {},
203
- });
204
- const result = db.exec(select_sql);
205
- if (result.length === 0 || result[0].values.length === 0) {
206
- logger.info('No prompts found in library', {
207
- file: file_name,
208
- line: 273,
209
- data: {},
210
- });
211
- return [];
212
- }
213
- const columns = result[0].columns;
214
- const records = result[0].values.map(row => row_to_prompt_record(row, columns));
215
- logger.info('All prompts retrieved', {
216
- file: file_name,
217
- line: 283,
218
- data: { count: records.length },
219
- });
220
- return records;
221
- }
222
- catch (error) {
223
- const error_message = error instanceof Error ? error.message : String(error);
224
- logger.error('Failed to retrieve all prompts', {
225
- file: file_name,
226
- line: 291,
227
- data: { error: error_message },
228
- });
229
- throw error;
230
- }
231
- }
232
- //# sourceMappingURL=get_prompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get_prompt.js","sourceRoot":"","sources":["../../../src/lib/prompts/get_prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,gFAAgF;AAChF,6BAA6B;AAC7B,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CACxC,EAAiB,EACjB,WAAmB,EACnB,UAAkB,EAClB,MAAc;IAEd,MAAM,SAAS,GAAG,eAAe,CAAC;IAElC,MAAM,UAAU,GAAG;;;;GAIlB,CAAC;IAEF,IAAI,CAAC;QACH,MAAM,CAAC,KAAK,CAAC,iCAAiC,EAAE;YAC9C,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,EAAE;YACR,IAAI,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE;SAClC,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC;QAE9D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzD,MAAM,CAAC,IAAI,CAAC,8BAA8B,EAAE;gBAC1C,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE;aAClC,CAAC,CAAC;YACH,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,OAAO,G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,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAClC,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;QAEhF,MAAM,CAAC,IAAI,CAAC,uBAAuB,EAAE;YACnC,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE;SAChC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,aAAa,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7E,MAAM,CAAC,KAAK,CAAC,gCAAgC,EAAE;YAC7C,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;SAC/B,CAAC,CAAC;QACH,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Prompts Module Exports
3
- *
4
- * Export all prompt-related functions from this module
5
- */
6
- export { get_prompt_by_area_and_key, get_prompt_text, get_prompts_by_area, get_prompt_by_uuid, get_all_prompts, } from './get_prompt.js';
7
- export { substitute_variables, parse_prompt_variables, validate_variables, } from './substitute_variables.js';
8
- export { PromptCache, type PromptCacheConfig, type CacheStats, get_prompt_cache, configure_prompt_cache, clear_prompt_cache, } from './prompt_cache.js';
9
- //# sourceMappingURL=index.d.ts.map