@campfire-interactive/cfi-ai-hub-client 2.0.2 → 2.0.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.
Files changed (81) hide show
  1. package/dist/ai.d.ts +26 -0
  2. package/dist/ai.d.ts.map +1 -0
  3. package/dist/ai.js +66 -0
  4. package/dist/ai.js.map +1 -0
  5. package/dist/bom.d.ts +12 -0
  6. package/dist/bom.d.ts.map +1 -0
  7. package/dist/bom.js +64 -0
  8. package/dist/bom.js.map +1 -0
  9. package/dist/cache.d.ts +11 -0
  10. package/dist/cache.d.ts.map +1 -0
  11. package/dist/cache.js +37 -0
  12. package/dist/cache.js.map +1 -0
  13. package/dist/client.d.ts +31 -0
  14. package/dist/client.d.ts.map +1 -0
  15. package/dist/client.js +51 -0
  16. package/dist/client.js.map +1 -0
  17. package/dist/conversations.d.ts +28 -0
  18. package/dist/conversations.d.ts.map +1 -0
  19. package/dist/conversations.js +74 -0
  20. package/dist/conversations.js.map +1 -0
  21. package/dist/documents.d.ts +18 -0
  22. package/dist/documents.d.ts.map +1 -0
  23. package/dist/documents.js +28 -0
  24. package/dist/documents.js.map +1 -0
  25. package/dist/errors.d.ts +26 -0
  26. package/dist/errors.d.ts.map +1 -0
  27. package/dist/errors.js +55 -0
  28. package/dist/errors.js.map +1 -0
  29. package/dist/forecast.d.ts +61 -0
  30. package/dist/forecast.d.ts.map +1 -0
  31. package/dist/forecast.js +164 -0
  32. package/dist/forecast.js.map +1 -0
  33. package/dist/http.d.ts +42 -0
  34. package/dist/http.d.ts.map +1 -0
  35. package/dist/http.js +214 -0
  36. package/dist/http.js.map +1 -0
  37. package/dist/index.d.ts +21 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +49 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/jobs.d.ts +33 -0
  42. package/dist/jobs.d.ts.map +1 -0
  43. package/dist/jobs.js +79 -0
  44. package/dist/jobs.js.map +1 -0
  45. package/dist/macro.d.ts +35 -0
  46. package/dist/macro.d.ts.map +1 -0
  47. package/dist/macro.js +64 -0
  48. package/dist/macro.js.map +1 -0
  49. package/dist/mock.d.ts +107 -0
  50. package/dist/mock.d.ts.map +1 -0
  51. package/dist/mock.js +497 -0
  52. package/dist/mock.js.map +1 -0
  53. package/dist/multipart.d.ts +4 -0
  54. package/dist/multipart.d.ts.map +1 -0
  55. package/dist/multipart.js +21 -0
  56. package/dist/multipart.js.map +1 -0
  57. package/dist/omsf.d.ts +22 -0
  58. package/dist/omsf.d.ts.map +1 -0
  59. package/dist/omsf.js +67 -0
  60. package/dist/omsf.js.map +1 -0
  61. package/dist/prompts.d.ts +24 -0
  62. package/dist/prompts.d.ts.map +1 -0
  63. package/dist/prompts.js +71 -0
  64. package/dist/prompts.js.map +1 -0
  65. package/dist/rag.d.ts +18 -0
  66. package/dist/rag.d.ts.map +1 -0
  67. package/dist/rag.js +39 -0
  68. package/dist/rag.js.map +1 -0
  69. package/dist/tracker.d.ts +15 -0
  70. package/dist/tracker.d.ts.map +1 -0
  71. package/dist/tracker.js +74 -0
  72. package/dist/tracker.js.map +1 -0
  73. package/dist/types.d.ts +713 -0
  74. package/dist/types.d.ts.map +1 -0
  75. package/dist/types.js +18 -0
  76. package/dist/types.js.map +1 -0
  77. package/dist/vendor.d.ts +8 -0
  78. package/dist/vendor.d.ts.map +1 -0
  79. package/dist/vendor.js +18 -0
  80. package/dist/vendor.js.map +1 -0
  81. package/package.json +1 -1
@@ -0,0 +1,713 @@
1
+ /** A file payload accepted by multipart upload methods. Pair a Blob with a filename when the Blob lacks one. */
2
+ export type FileInput = Blob | File | {
3
+ blob: Blob;
4
+ filename: string;
5
+ };
6
+ export interface CfiAiHubClientConfig {
7
+ /**
8
+ * Full base URL including any root path and API version prefix.
9
+ * Example: `https://ai-hub.cfi2.net/cfi-ai-hub/api/v1`
10
+ */
11
+ baseUrl: string;
12
+ /** Async or sync provider that returns a platform-identity JWT. */
13
+ getToken: () => string | Promise<string>;
14
+ /** Request timeout in milliseconds. Defaults to 30_000. */
15
+ timeout?: number;
16
+ }
17
+ export interface ChatRequest {
18
+ message: string;
19
+ system_prompt?: string;
20
+ temperature?: number;
21
+ max_tokens?: number;
22
+ }
23
+ export interface ChatResponse {
24
+ response: string;
25
+ model: string;
26
+ tokens_used?: number | null;
27
+ }
28
+ export interface EmbeddingRequest {
29
+ text: string;
30
+ model?: string;
31
+ }
32
+ export interface EmbeddingResponse {
33
+ embedding: number[];
34
+ model: string;
35
+ dimensions: number;
36
+ }
37
+ export interface SentimentRequest {
38
+ text: string;
39
+ }
40
+ export interface SentimentResponse {
41
+ sentiment: string;
42
+ score: number;
43
+ reasoning: string;
44
+ }
45
+ export interface SummarizeRequest {
46
+ text: string;
47
+ max_length?: number;
48
+ }
49
+ export interface SummarizeResponse {
50
+ summary: string;
51
+ original_length: number;
52
+ summary_length: number;
53
+ }
54
+ export interface AttributeFilter {
55
+ attributeName: string;
56
+ attributeValue: string;
57
+ }
58
+ export interface BomProcessFileOptions {
59
+ sheetName?: string;
60
+ outputFilename?: string;
61
+ model?: string;
62
+ temperature?: number;
63
+ useDirectUpload?: boolean;
64
+ callbackUrl?: string;
65
+ backendBaseUrl?: string;
66
+ configId?: number;
67
+ progId?: number;
68
+ }
69
+ export interface BomSeedVectorDbFileOptions {
70
+ batchSize?: number;
71
+ startId?: number;
72
+ callbackUrl?: string;
73
+ }
74
+ export interface BomProcessResponse {
75
+ success: boolean;
76
+ progress_id: string;
77
+ progress_url?: string | null;
78
+ message: string;
79
+ data?: Array<Record<string, unknown>> | null;
80
+ error?: string | null;
81
+ output_file?: string | null;
82
+ item_count?: number | null;
83
+ method?: 'direct_upload' | 'csv_conversion' | string | null;
84
+ raw_response?: string | null;
85
+ }
86
+ export interface BomSearchRequest {
87
+ query: string;
88
+ limit?: number;
89
+ score_threshold?: number;
90
+ customer?: string;
91
+ program?: string;
92
+ level?: number;
93
+ exact_match_only?: boolean;
94
+ attributes?: AttributeFilter[];
95
+ }
96
+ export interface BomSearchResult {
97
+ id: string;
98
+ score: number;
99
+ part_number: string;
100
+ description: string;
101
+ customer: string;
102
+ program: string;
103
+ material: string;
104
+ cost?: number | null;
105
+ level?: number | null;
106
+ usage_context: string;
107
+ bom_data: Record<string, unknown>;
108
+ }
109
+ export interface BomSearchResponse {
110
+ success: boolean;
111
+ results: BomSearchResult[];
112
+ query: string;
113
+ total_results: number;
114
+ error?: string | null;
115
+ }
116
+ export interface BomStoreAttributesRequest {
117
+ query: string;
118
+ attributes?: AttributeFilter[];
119
+ item_name?: string;
120
+ item_number?: string;
121
+ item_type?: string;
122
+ }
123
+ export interface BomStoreAttributesResponse {
124
+ success: boolean;
125
+ message: string;
126
+ item_id?: number | null;
127
+ item_created: boolean;
128
+ item_name?: string | null;
129
+ item_number?: string | null;
130
+ item_type?: string | null;
131
+ error?: string | null;
132
+ }
133
+ export interface BomSeedVectorDbRequest {
134
+ data: Record<string, unknown>;
135
+ batch_size?: number;
136
+ start_id?: number;
137
+ collection_name?: string;
138
+ }
139
+ export interface VolumeAnalyzeResponse {
140
+ status: string;
141
+ session_id: string;
142
+ insights: string;
143
+ images: string[];
144
+ }
145
+ export interface FollowUpRequest {
146
+ session_id: string;
147
+ prompt: string;
148
+ }
149
+ export interface FollowUpResponse {
150
+ status: string;
151
+ session_id: string;
152
+ response: string;
153
+ images: string[];
154
+ }
155
+ export interface ColumnDetectionResponse {
156
+ columns: string[];
157
+ auto_detected: Record<string, string | null>;
158
+ month_columns: string[];
159
+ month_mapping: Record<string, string>;
160
+ grouping_columns: Record<string, string | null>;
161
+ }
162
+ /** ISO-8601 date string (YYYY-MM-DD). */
163
+ export type IsoDate = string;
164
+ export interface FileComparisonConfig {
165
+ key_col: string;
166
+ sop_col: string;
167
+ eop_col: string;
168
+ prog_col?: string;
169
+ lifetime_col?: string;
170
+ auto_detect_months?: boolean;
171
+ month_cols_manual?: string[];
172
+ start_date?: IsoDate;
173
+ end_date?: IsoDate;
174
+ }
175
+ export interface FileComparisonResponse {
176
+ merged_data: Array<Record<string, unknown>>;
177
+ data_quality: Record<string, number>;
178
+ timeframe: Record<string, unknown>;
179
+ statistics: Record<string, number>;
180
+ }
181
+ export interface VolumeDashboardResponse {
182
+ dashboard_data: Record<string, unknown>;
183
+ }
184
+ export interface OmsfHealthResponse {
185
+ api: string;
186
+ llm_available: boolean;
187
+ llm_provider: string;
188
+ code_interpreter: string;
189
+ }
190
+ export interface TenantConfigEntry {
191
+ fieldName: string;
192
+ weight: number;
193
+ isActive?: boolean;
194
+ }
195
+ export interface SegmentsInfo {
196
+ keySegments?: string[];
197
+ progCol?: string;
198
+ sopCol?: string;
199
+ eopCol?: string;
200
+ }
201
+ export interface CompareVendorFilesRequest {
202
+ vendorUploadId1: number;
203
+ vendorUploadId2: number;
204
+ fileDownloadUrl1: string;
205
+ fileDownloadUrl2: string;
206
+ fileName1: string;
207
+ fileName2: string;
208
+ callbackUrl?: string;
209
+ quoteOppCallbackUrl?: string;
210
+ tenantConfig?: TenantConfigEntry[];
211
+ backendBaseUrl?: string;
212
+ segmentsInfo?: SegmentsInfo;
213
+ }
214
+ export interface CompareVendorFilesResponse {
215
+ success: boolean;
216
+ progress_id: string;
217
+ message: string;
218
+ }
219
+ export declare const ProgressStatus: {
220
+ readonly PENDING: "pending";
221
+ readonly PROCESSING: "processing";
222
+ readonly DONE: "done";
223
+ readonly ABORT: "abort";
224
+ readonly ABORT_WITH_MESSAGE: "ABORT WITH MESSAGE";
225
+ readonly ERROR: "error";
226
+ };
227
+ export type ProgressStatusValue = (typeof ProgressStatus)[keyof typeof ProgressStatus];
228
+ export interface ProgressResponse<TData = unknown> {
229
+ success: boolean;
230
+ progress_id: string;
231
+ status: ProgressStatusValue | string;
232
+ message: string;
233
+ percentage: number;
234
+ created_at: string;
235
+ updated_at: string;
236
+ data?: TData | null;
237
+ error?: string | null;
238
+ metadata?: Record<string, unknown> | null;
239
+ }
240
+ export interface AbortProgressInput {
241
+ message?: string;
242
+ }
243
+ export interface ActionResponse {
244
+ success: boolean;
245
+ message: string;
246
+ }
247
+ export interface PollProgressOptions {
248
+ /** Polling interval in milliseconds. Defaults to 1000. */
249
+ intervalMs?: number;
250
+ /** Max total wait time in milliseconds. Defaults to 30 minutes. */
251
+ timeoutMs?: number;
252
+ /** Callback invoked on each poll with the latest progress snapshot. */
253
+ onProgress?: (progress: ProgressResponse) => void;
254
+ /** AbortSignal to stop polling early. */
255
+ signal?: AbortSignal;
256
+ }
257
+ export interface CacheGetResponse<T = unknown> {
258
+ key: string;
259
+ value: T;
260
+ }
261
+ export interface CacheSetInput<T = unknown> {
262
+ value: T;
263
+ /** Expiration in seconds. */
264
+ expiration?: number;
265
+ }
266
+ export interface CacheSetResponse {
267
+ key: string;
268
+ status: string;
269
+ }
270
+ export interface CacheDeleteResponse {
271
+ key: string;
272
+ deleted: boolean;
273
+ }
274
+ export interface CacheTokenInvalidateResponse {
275
+ status: string;
276
+ message: string;
277
+ }
278
+ export type ForecastModelName = 'timesfm' | 'chronos' | 'moirai';
279
+ /** A single week of volume input. `week` must be a Monday (YYYY-MM-DD). */
280
+ export interface WeeklyDataPoint {
281
+ week: IsoDate;
282
+ value: number;
283
+ }
284
+ export interface ForecastRequest {
285
+ series_id: string;
286
+ /** Historical weekly volume data, ordered chronologically. Minimum 4 points. */
287
+ weekly_data: WeeklyDataPoint[];
288
+ /** Weeks to forecast beyond the last data point. Range 1–520. Default 52. */
289
+ forecast_horizon_weeks?: number;
290
+ /**
291
+ * Models to run. When omitted or empty the system auto-selects the best model
292
+ * by holding out a validation window, measuring WMAPE, and forecasting with the winner.
293
+ */
294
+ models?: ForecastModelName[];
295
+ /**
296
+ * When true, macro indicator data stored in the database is fetched and
297
+ * passed to models that support covariates (Chronos, Moirai).
298
+ */
299
+ use_external_factors?: boolean;
300
+ }
301
+ /** A single weekly point in the combined historical + forecast timeline. */
302
+ export interface WeeklyForecastPoint {
303
+ week: IsoDate;
304
+ /** Volume value. null for missing historical weeks. */
305
+ value: number | null;
306
+ /** True for forecast rows, false for historical actuals. */
307
+ is_forecast: boolean;
308
+ lo_80?: number | null;
309
+ hi_80?: number | null;
310
+ lo_95?: number | null;
311
+ hi_95?: number | null;
312
+ }
313
+ /** Forecast result from one model. */
314
+ export interface ModelForecastResult {
315
+ model: ForecastModelName;
316
+ timeline: WeeklyForecastPoint[];
317
+ /** WMAPE (%) over any verification window. null when no overlap exists. */
318
+ accuracy_wmape: number | null;
319
+ /** max(0, 100 − WMAPE). null when WMAPE is null. */
320
+ accuracy_pct: number | null;
321
+ /** True when macro covariates were actually used by this model. */
322
+ covariates_used: boolean;
323
+ /** Sanitized error message when this model failed; timeline will be empty. */
324
+ error?: string | null;
325
+ /** Correlate with server logs for root-cause details. */
326
+ error_id?: string | null;
327
+ }
328
+ /** Auto-model selection metadata — present when models was not specified. */
329
+ export interface ModelSelectionInfo {
330
+ winner: ForecastModelName;
331
+ /** WMAPE (%) per model on the held-out validation window. null if model failed. */
332
+ validation_wmape: Record<string, number | null>;
333
+ /** Number of weeks held out from history for model comparison. */
334
+ validation_weeks: number;
335
+ }
336
+ export interface ForecastResponse {
337
+ series_id: string;
338
+ forecast_horizon_weeks: number;
339
+ /** Effective cutoff used — last week of weekly_data. */
340
+ cutoff_date: IsoDate;
341
+ /** One entry per requested or auto-selected model. */
342
+ results: ModelForecastResult[];
343
+ /** Present only when the system auto-selected the best model. */
344
+ model_selection?: ModelSelectionInfo | null;
345
+ }
346
+ export interface ForecastJobResponse {
347
+ progress_id: string;
348
+ /** Poll this URL to check job status. */
349
+ progress_url: string;
350
+ series_id: string;
351
+ message: string;
352
+ }
353
+ export interface BatchForecastRequest {
354
+ /** 1–500 forecast requests. */
355
+ series: ForecastRequest[];
356
+ /** Optional HTTPS URL to POST the completed result to when the job finishes. */
357
+ callback_url?: string;
358
+ }
359
+ export interface BatchForecastJobResponse {
360
+ progress_id: string;
361
+ progress_url: string;
362
+ total_series: number;
363
+ message: string;
364
+ }
365
+ export interface BatchForecastResult {
366
+ total: number;
367
+ completed: number;
368
+ failed: number;
369
+ results: ForecastResponse[];
370
+ errors: Array<{
371
+ series_id: string;
372
+ error: string;
373
+ }>;
374
+ }
375
+ export interface ForecastHealthResponse {
376
+ status: string;
377
+ models_enabled: ForecastModelName[];
378
+ device: string;
379
+ model_load_status: Record<ForecastModelName, boolean>;
380
+ checkpoints: Record<ForecastModelName, string>;
381
+ }
382
+ export type MacroIndicatorType = 'fed_funds_rate' | 'unemployment_rate' | 'consumer_satisfaction_index';
383
+ export interface MacroMonthlyValue {
384
+ /** Any date within the target month (server normalises to the 1st). */
385
+ month: IsoDate;
386
+ value: number;
387
+ }
388
+ export interface MacroUpsertRequest {
389
+ indicator: MacroIndicatorType;
390
+ /** Monthly data points to upsert. Duplicate months are deduplicated (last value wins). */
391
+ data: MacroMonthlyValue[];
392
+ /** Optional label for the originating system, e.g. 'FRED', 'BLS', 'internal'. */
393
+ source?: string;
394
+ }
395
+ export interface MacroUpsertResponse {
396
+ indicator: MacroIndicatorType;
397
+ total_submitted: number;
398
+ inserted: number;
399
+ updated: number;
400
+ skipped: number;
401
+ }
402
+ export interface MacroDataPoint {
403
+ indicator: MacroIndicatorType;
404
+ month: IsoDate;
405
+ value: number;
406
+ source: string | null;
407
+ created_at: string;
408
+ updated_at: string;
409
+ }
410
+ export interface MacroQueryResponse {
411
+ indicator: MacroIndicatorType;
412
+ total: number;
413
+ data: MacroDataPoint[];
414
+ }
415
+ export interface MacroQueryOptions {
416
+ /** First month to include (any day in that month, e.g. '2023-01-01'). */
417
+ start_month?: IsoDate;
418
+ /** Last month to include (any day in that month, e.g. '2023-12-01'). */
419
+ end_month?: IsoDate;
420
+ }
421
+ export interface MacroTypeInfo {
422
+ key: MacroIndicatorType;
423
+ label: string;
424
+ description: string;
425
+ unit: string;
426
+ /** Most recent month for which data is stored. null when no data loaded yet. */
427
+ latest_month: IsoDate | null;
428
+ /** Timestamp of the most recent write for this indicator. null when no data loaded yet. */
429
+ last_updated_at: string | null;
430
+ }
431
+ export interface MacroTypesResponse {
432
+ types: MacroTypeInfo[];
433
+ }
434
+ export interface HealthResponse {
435
+ status: string;
436
+ timestamp: string;
437
+ database_connected: boolean;
438
+ redis_connected: boolean;
439
+ llm_enabled: boolean;
440
+ version: string;
441
+ }
442
+ export interface TableInfoColumn {
443
+ column_name: string;
444
+ data_type: string;
445
+ is_nullable: string;
446
+ character_maximum_length: number | null;
447
+ numeric_precision: number | null;
448
+ numeric_scale: number | null;
449
+ }
450
+ export interface TableInfoResponse {
451
+ table_name: string;
452
+ columns: TableInfoColumn[];
453
+ }
454
+ export interface Tool {
455
+ name: string;
456
+ description: string;
457
+ parameters: Record<string, unknown>;
458
+ }
459
+ export interface ToolCall {
460
+ id: string;
461
+ name: string;
462
+ arguments: Record<string, unknown>;
463
+ }
464
+ export interface ToolResult {
465
+ tool_call_id: string;
466
+ content: string | Record<string, unknown>;
467
+ is_error?: boolean;
468
+ }
469
+ export type MessageRole = 'system' | 'user' | 'assistant' | 'tool';
470
+ export interface ConversationMessage {
471
+ role: MessageRole;
472
+ content?: string | null;
473
+ tool_calls?: ToolCall[] | null;
474
+ tool_call_id?: string | null;
475
+ }
476
+ export interface StreamingChatRequest {
477
+ messages: ConversationMessage[];
478
+ system_prompt?: string | null;
479
+ model?: string | null;
480
+ temperature?: number | null;
481
+ max_tokens?: number | null;
482
+ tools?: Tool[] | null;
483
+ }
484
+ export type ChatChunkType = 'chunk' | 'tool_call' | 'done' | 'error';
485
+ export interface ChatChunk {
486
+ type: ChatChunkType;
487
+ delta?: string;
488
+ tool_call?: ToolCall;
489
+ usage?: Record<string, unknown>;
490
+ stop_reason?: string;
491
+ error?: {
492
+ code: string;
493
+ message: string;
494
+ };
495
+ }
496
+ export interface StructuredRequest {
497
+ messages: ConversationMessage[];
498
+ schema: Record<string, unknown>;
499
+ system_prompt?: string | null;
500
+ model?: string | null;
501
+ temperature?: number | null;
502
+ max_tokens?: number | null;
503
+ max_repair_retries?: number;
504
+ }
505
+ export interface StructuredResponse {
506
+ result: Record<string, unknown>;
507
+ model: string;
508
+ usage: Record<string, unknown>;
509
+ repair_attempts: number;
510
+ }
511
+ export type JobStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
512
+ export interface SubmitJobRequest {
513
+ type: string;
514
+ input?: Record<string, unknown>;
515
+ correlation_id?: string;
516
+ callback_url?: string;
517
+ }
518
+ export interface JobResponse {
519
+ id: string;
520
+ tenant_id?: string | null;
521
+ type: string;
522
+ status: JobStatus;
523
+ input: Record<string, unknown>;
524
+ result?: Record<string, unknown> | null;
525
+ error?: Record<string, unknown> | null;
526
+ progress?: number | null;
527
+ progress_message?: string | null;
528
+ correlation_id?: string | null;
529
+ callback_url?: string | null;
530
+ created_at: string;
531
+ started_at?: string | null;
532
+ finished_at?: string | null;
533
+ cancelled_at?: string | null;
534
+ }
535
+ export interface JobListResponse {
536
+ jobs: JobResponse[];
537
+ }
538
+ export interface JobListOptions {
539
+ status?: JobStatus;
540
+ type?: string;
541
+ limit?: number;
542
+ }
543
+ export interface JobResultDoneResponse {
544
+ status: 'succeeded';
545
+ result: Record<string, unknown>;
546
+ }
547
+ export interface JobResultPendingResponse {
548
+ status: 'queued' | 'running';
549
+ progress?: number | null;
550
+ progress_message?: string | null;
551
+ }
552
+ export interface PromptVersion {
553
+ prompt_id: string;
554
+ version: number;
555
+ description?: string | null;
556
+ body: string;
557
+ variables: string[];
558
+ output_schema?: Record<string, unknown> | null;
559
+ created_by?: string | null;
560
+ created_at: string;
561
+ updated_at: string;
562
+ }
563
+ export interface PromptListResponse {
564
+ prompt_ids: string[];
565
+ }
566
+ export interface PromptVersionsResponse {
567
+ prompt_id: string;
568
+ versions: PromptVersion[];
569
+ }
570
+ export interface CreatePromptVersionRequest {
571
+ body: string;
572
+ variables?: string[];
573
+ output_schema?: Record<string, unknown> | null;
574
+ description?: string | null;
575
+ }
576
+ export interface UpsertOverrideRequest {
577
+ body: string;
578
+ variables?: string[];
579
+ output_schema?: Record<string, unknown> | null;
580
+ description?: string | null;
581
+ }
582
+ export interface TenantPromptOverrideResponse {
583
+ tenant_id: string;
584
+ prompt_id: string;
585
+ body: string;
586
+ variables: string[];
587
+ output_schema?: Record<string, unknown> | null;
588
+ created_by?: string | null;
589
+ created_at: string;
590
+ updated_at: string;
591
+ }
592
+ export interface RenderPromptRequest {
593
+ variables?: Record<string, unknown>;
594
+ tenant_id?: string;
595
+ }
596
+ export interface RenderPromptResponse {
597
+ rendered: string;
598
+ prompt_id: string;
599
+ version?: number | null;
600
+ source: 'override' | 'base';
601
+ output_schema?: Record<string, unknown> | null;
602
+ }
603
+ export interface RagUpsertItem {
604
+ id?: string;
605
+ text: string;
606
+ vector?: number[];
607
+ metadata?: Record<string, unknown>;
608
+ }
609
+ export interface RagUpsertRequest {
610
+ collection: string;
611
+ items: RagUpsertItem[];
612
+ }
613
+ export interface RagUpsertResponse {
614
+ upserted: number;
615
+ collection: string;
616
+ }
617
+ export interface RagRetrieveRequest {
618
+ collection: string;
619
+ query: string;
620
+ k?: number;
621
+ filters?: Record<string, unknown>;
622
+ }
623
+ export interface RagMatch {
624
+ id: string;
625
+ score: number;
626
+ text: string;
627
+ metadata: Record<string, unknown>;
628
+ }
629
+ export interface RagRetrieveResponse {
630
+ matches: RagMatch[];
631
+ collection: string;
632
+ }
633
+ export interface CreateConversationRequest {
634
+ title?: string | null;
635
+ metadata?: Record<string, unknown>;
636
+ model?: string | null;
637
+ }
638
+ export interface ConversationMessageResponse {
639
+ id: number;
640
+ role: MessageRole;
641
+ content?: string | null;
642
+ tool_calls?: ToolCall[] | null;
643
+ tool_call_id?: string | null;
644
+ usage?: Record<string, unknown> | null;
645
+ created_at: string;
646
+ }
647
+ export interface ConversationResponse {
648
+ id: string;
649
+ tenant_id: string;
650
+ user_id?: string | null;
651
+ title?: string | null;
652
+ metadata: Record<string, unknown>;
653
+ model?: string | null;
654
+ created_at: string;
655
+ updated_at: string;
656
+ deleted_at?: string | null;
657
+ messages?: ConversationMessageResponse[] | null;
658
+ }
659
+ export interface ConversationListResponse {
660
+ conversations: ConversationResponse[];
661
+ }
662
+ export interface ConversationListOptions {
663
+ user_only?: boolean;
664
+ include_deleted?: boolean;
665
+ limit?: number;
666
+ rfq_id?: string;
667
+ bom_id?: string;
668
+ program_id?: string;
669
+ feature?: string;
670
+ }
671
+ export interface AppendMessageRequest {
672
+ role?: MessageRole;
673
+ content?: string | null;
674
+ tool_calls?: ToolCall[] | null;
675
+ tool_call_id?: string | null;
676
+ }
677
+ export type DocumentFormat = 'docx' | 'pdf' | 'csv' | 'html';
678
+ export interface GenerateDocumentRequest {
679
+ prompt_id: string;
680
+ format?: DocumentFormat;
681
+ filename?: string;
682
+ variables?: Record<string, unknown>;
683
+ correlation_id?: string;
684
+ callback_url?: string;
685
+ }
686
+ export interface GenerateDocumentResponse {
687
+ job_id: string;
688
+ status: JobStatus;
689
+ type: string;
690
+ }
691
+ /**
692
+ * Shape of `JobResponse.result` once a document_generate job succeeds.
693
+ * Fetch via `client.jobs.result(jobId)`.
694
+ */
695
+ export interface DocumentJobResult {
696
+ url: string;
697
+ backend: 'local' | 's3';
698
+ storage_key: string;
699
+ expires_at?: string | null;
700
+ format: DocumentFormat;
701
+ filename: string;
702
+ size_bytes: number;
703
+ title?: string | null;
704
+ sections: string[];
705
+ model?: string | null;
706
+ usage?: Record<string, unknown>;
707
+ prompt: {
708
+ id: string;
709
+ version?: number | null;
710
+ source: 'override' | 'base';
711
+ };
712
+ }
713
+ //# sourceMappingURL=types.d.ts.map