@runflow-ai/sdk 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.
@@ -0,0 +1,678 @@
1
+ import express from 'express';
2
+ export interface SwaggerConfig {
3
+ title?: string;
4
+ description?: string;
5
+ version?: string;
6
+ contact?: {
7
+ name?: string;
8
+ email?: string;
9
+ url?: string;
10
+ };
11
+ }
12
+ /**
13
+ * Gera especificação OpenAPI para o agente
14
+ */
15
+ export declare function generateSwaggerSpec(port: number, config?: SwaggerConfig): {
16
+ openapi: string;
17
+ info: {
18
+ title: string;
19
+ description: string;
20
+ version: string;
21
+ contact: {
22
+ name?: string;
23
+ email?: string;
24
+ url?: string;
25
+ };
26
+ };
27
+ servers: {
28
+ url: string;
29
+ description: string;
30
+ }[];
31
+ paths: {
32
+ '/chat': {
33
+ post: {
34
+ summary: string;
35
+ description: string;
36
+ tags: string[];
37
+ requestBody: {
38
+ required: boolean;
39
+ content: {
40
+ 'application/json': {
41
+ schema: {
42
+ type: string;
43
+ required: string[];
44
+ properties: {
45
+ message: {
46
+ type: string;
47
+ description: string;
48
+ example: string;
49
+ };
50
+ companyId: {
51
+ type: string;
52
+ description: string;
53
+ example: string;
54
+ };
55
+ userId: {
56
+ type: string;
57
+ description: string;
58
+ example: string;
59
+ };
60
+ sessionId: {
61
+ type: string;
62
+ description: string;
63
+ example: string;
64
+ };
65
+ channel: {
66
+ type: string;
67
+ description: string;
68
+ example: string;
69
+ };
70
+ metadata: {
71
+ type: string;
72
+ description: string;
73
+ example: {
74
+ source: string;
75
+ page: string;
76
+ };
77
+ };
78
+ };
79
+ };
80
+ };
81
+ };
82
+ };
83
+ responses: {
84
+ 200: {
85
+ description: string;
86
+ content: {
87
+ 'application/json': {
88
+ schema: {
89
+ type: string;
90
+ properties: {
91
+ success: {
92
+ type: string;
93
+ example: boolean;
94
+ };
95
+ data: {
96
+ type: string;
97
+ properties: {
98
+ message: {
99
+ type: string;
100
+ description: string;
101
+ example: string;
102
+ };
103
+ metadata: {
104
+ type: string;
105
+ description: string;
106
+ properties: {
107
+ llmProvider: {
108
+ type: string;
109
+ example: string;
110
+ };
111
+ model: {
112
+ type: string;
113
+ example: string;
114
+ };
115
+ toolsUsed: {
116
+ type: string;
117
+ items: {
118
+ type: string;
119
+ };
120
+ example: string[];
121
+ };
122
+ processingTime: {
123
+ type: string;
124
+ example: number;
125
+ };
126
+ };
127
+ };
128
+ };
129
+ };
130
+ };
131
+ };
132
+ };
133
+ };
134
+ };
135
+ 400: {
136
+ description: string;
137
+ content: {
138
+ 'application/json': {
139
+ schema: {
140
+ type: string;
141
+ properties: {
142
+ success: {
143
+ type: string;
144
+ example: boolean;
145
+ };
146
+ error: {
147
+ type: string;
148
+ example: string;
149
+ };
150
+ };
151
+ };
152
+ };
153
+ };
154
+ };
155
+ 429: {
156
+ description: string;
157
+ content: {
158
+ 'application/json': {
159
+ schema: {
160
+ type: string;
161
+ properties: {
162
+ success: {
163
+ type: string;
164
+ example: boolean;
165
+ };
166
+ error: {
167
+ type: string;
168
+ example: string;
169
+ };
170
+ };
171
+ };
172
+ };
173
+ };
174
+ };
175
+ 500: {
176
+ description: string;
177
+ content: {
178
+ 'application/json': {
179
+ schema: {
180
+ type: string;
181
+ properties: {
182
+ success: {
183
+ type: string;
184
+ example: boolean;
185
+ };
186
+ error: {
187
+ type: string;
188
+ example: string;
189
+ };
190
+ };
191
+ };
192
+ };
193
+ };
194
+ };
195
+ };
196
+ };
197
+ };
198
+ '/health': {
199
+ get: {
200
+ summary: string;
201
+ description: string;
202
+ tags: string[];
203
+ responses: {
204
+ 200: {
205
+ description: string;
206
+ content: {
207
+ 'application/json': {
208
+ schema: {
209
+ type: string;
210
+ properties: {
211
+ status: {
212
+ type: string;
213
+ example: string;
214
+ };
215
+ timestamp: {
216
+ type: string;
217
+ example: string;
218
+ };
219
+ agent: {
220
+ type: string;
221
+ properties: {
222
+ systemPrompt: {
223
+ type: string;
224
+ };
225
+ llmProvider: {
226
+ type: string;
227
+ };
228
+ model: {
229
+ type: string;
230
+ };
231
+ };
232
+ };
233
+ };
234
+ };
235
+ };
236
+ };
237
+ };
238
+ };
239
+ };
240
+ };
241
+ '/agent-info': {
242
+ get: {
243
+ summary: string;
244
+ description: string;
245
+ tags: string[];
246
+ responses: {
247
+ 200: {
248
+ description: string;
249
+ content: {
250
+ 'application/json': {
251
+ schema: {
252
+ type: string;
253
+ properties: {
254
+ systemPrompt: {
255
+ type: string;
256
+ };
257
+ llm: {
258
+ type: string;
259
+ properties: {
260
+ provider: {
261
+ type: string;
262
+ example: string;
263
+ };
264
+ model: {
265
+ type: string;
266
+ example: string;
267
+ };
268
+ };
269
+ };
270
+ toolsEnabled: {
271
+ type: string;
272
+ };
273
+ sessionEnabled: {
274
+ type: string;
275
+ };
276
+ };
277
+ };
278
+ };
279
+ };
280
+ };
281
+ };
282
+ };
283
+ };
284
+ };
285
+ components: {
286
+ schemas: {
287
+ ChatRequest: {
288
+ type: string;
289
+ required: string[];
290
+ properties: {
291
+ message: {
292
+ type: string;
293
+ };
294
+ companyId: {
295
+ type: string;
296
+ };
297
+ userId: {
298
+ type: string;
299
+ };
300
+ sessionId: {
301
+ type: string;
302
+ };
303
+ channel: {
304
+ type: string;
305
+ };
306
+ metadata: {
307
+ type: string;
308
+ };
309
+ };
310
+ };
311
+ ChatResponse: {
312
+ type: string;
313
+ properties: {
314
+ success: {
315
+ type: string;
316
+ };
317
+ data: {
318
+ type: string;
319
+ properties: {
320
+ message: {
321
+ type: string;
322
+ };
323
+ metadata: {
324
+ type: string;
325
+ };
326
+ };
327
+ };
328
+ };
329
+ };
330
+ ErrorResponse: {
331
+ type: string;
332
+ properties: {
333
+ success: {
334
+ type: string;
335
+ example: boolean;
336
+ };
337
+ error: {
338
+ type: string;
339
+ };
340
+ };
341
+ };
342
+ };
343
+ };
344
+ };
345
+ /**
346
+ * Adiciona endpoints de documentação Swagger ao app Express
347
+ */
348
+ export declare function setupSwagger(app: express.Application, port: number, config?: SwaggerConfig): {
349
+ openapi: string;
350
+ info: {
351
+ title: string;
352
+ description: string;
353
+ version: string;
354
+ contact: {
355
+ name?: string;
356
+ email?: string;
357
+ url?: string;
358
+ };
359
+ };
360
+ servers: {
361
+ url: string;
362
+ description: string;
363
+ }[];
364
+ paths: {
365
+ '/chat': {
366
+ post: {
367
+ summary: string;
368
+ description: string;
369
+ tags: string[];
370
+ requestBody: {
371
+ required: boolean;
372
+ content: {
373
+ 'application/json': {
374
+ schema: {
375
+ type: string;
376
+ required: string[];
377
+ properties: {
378
+ message: {
379
+ type: string;
380
+ description: string;
381
+ example: string;
382
+ };
383
+ companyId: {
384
+ type: string;
385
+ description: string;
386
+ example: string;
387
+ };
388
+ userId: {
389
+ type: string;
390
+ description: string;
391
+ example: string;
392
+ };
393
+ sessionId: {
394
+ type: string;
395
+ description: string;
396
+ example: string;
397
+ };
398
+ channel: {
399
+ type: string;
400
+ description: string;
401
+ example: string;
402
+ };
403
+ metadata: {
404
+ type: string;
405
+ description: string;
406
+ example: {
407
+ source: string;
408
+ page: string;
409
+ };
410
+ };
411
+ };
412
+ };
413
+ };
414
+ };
415
+ };
416
+ responses: {
417
+ 200: {
418
+ description: string;
419
+ content: {
420
+ 'application/json': {
421
+ schema: {
422
+ type: string;
423
+ properties: {
424
+ success: {
425
+ type: string;
426
+ example: boolean;
427
+ };
428
+ data: {
429
+ type: string;
430
+ properties: {
431
+ message: {
432
+ type: string;
433
+ description: string;
434
+ example: string;
435
+ };
436
+ metadata: {
437
+ type: string;
438
+ description: string;
439
+ properties: {
440
+ llmProvider: {
441
+ type: string;
442
+ example: string;
443
+ };
444
+ model: {
445
+ type: string;
446
+ example: string;
447
+ };
448
+ toolsUsed: {
449
+ type: string;
450
+ items: {
451
+ type: string;
452
+ };
453
+ example: string[];
454
+ };
455
+ processingTime: {
456
+ type: string;
457
+ example: number;
458
+ };
459
+ };
460
+ };
461
+ };
462
+ };
463
+ };
464
+ };
465
+ };
466
+ };
467
+ };
468
+ 400: {
469
+ description: string;
470
+ content: {
471
+ 'application/json': {
472
+ schema: {
473
+ type: string;
474
+ properties: {
475
+ success: {
476
+ type: string;
477
+ example: boolean;
478
+ };
479
+ error: {
480
+ type: string;
481
+ example: string;
482
+ };
483
+ };
484
+ };
485
+ };
486
+ };
487
+ };
488
+ 429: {
489
+ description: string;
490
+ content: {
491
+ 'application/json': {
492
+ schema: {
493
+ type: string;
494
+ properties: {
495
+ success: {
496
+ type: string;
497
+ example: boolean;
498
+ };
499
+ error: {
500
+ type: string;
501
+ example: string;
502
+ };
503
+ };
504
+ };
505
+ };
506
+ };
507
+ };
508
+ 500: {
509
+ description: string;
510
+ content: {
511
+ 'application/json': {
512
+ schema: {
513
+ type: string;
514
+ properties: {
515
+ success: {
516
+ type: string;
517
+ example: boolean;
518
+ };
519
+ error: {
520
+ type: string;
521
+ example: string;
522
+ };
523
+ };
524
+ };
525
+ };
526
+ };
527
+ };
528
+ };
529
+ };
530
+ };
531
+ '/health': {
532
+ get: {
533
+ summary: string;
534
+ description: string;
535
+ tags: string[];
536
+ responses: {
537
+ 200: {
538
+ description: string;
539
+ content: {
540
+ 'application/json': {
541
+ schema: {
542
+ type: string;
543
+ properties: {
544
+ status: {
545
+ type: string;
546
+ example: string;
547
+ };
548
+ timestamp: {
549
+ type: string;
550
+ example: string;
551
+ };
552
+ agent: {
553
+ type: string;
554
+ properties: {
555
+ systemPrompt: {
556
+ type: string;
557
+ };
558
+ llmProvider: {
559
+ type: string;
560
+ };
561
+ model: {
562
+ type: string;
563
+ };
564
+ };
565
+ };
566
+ };
567
+ };
568
+ };
569
+ };
570
+ };
571
+ };
572
+ };
573
+ };
574
+ '/agent-info': {
575
+ get: {
576
+ summary: string;
577
+ description: string;
578
+ tags: string[];
579
+ responses: {
580
+ 200: {
581
+ description: string;
582
+ content: {
583
+ 'application/json': {
584
+ schema: {
585
+ type: string;
586
+ properties: {
587
+ systemPrompt: {
588
+ type: string;
589
+ };
590
+ llm: {
591
+ type: string;
592
+ properties: {
593
+ provider: {
594
+ type: string;
595
+ example: string;
596
+ };
597
+ model: {
598
+ type: string;
599
+ example: string;
600
+ };
601
+ };
602
+ };
603
+ toolsEnabled: {
604
+ type: string;
605
+ };
606
+ sessionEnabled: {
607
+ type: string;
608
+ };
609
+ };
610
+ };
611
+ };
612
+ };
613
+ };
614
+ };
615
+ };
616
+ };
617
+ };
618
+ components: {
619
+ schemas: {
620
+ ChatRequest: {
621
+ type: string;
622
+ required: string[];
623
+ properties: {
624
+ message: {
625
+ type: string;
626
+ };
627
+ companyId: {
628
+ type: string;
629
+ };
630
+ userId: {
631
+ type: string;
632
+ };
633
+ sessionId: {
634
+ type: string;
635
+ };
636
+ channel: {
637
+ type: string;
638
+ };
639
+ metadata: {
640
+ type: string;
641
+ };
642
+ };
643
+ };
644
+ ChatResponse: {
645
+ type: string;
646
+ properties: {
647
+ success: {
648
+ type: string;
649
+ };
650
+ data: {
651
+ type: string;
652
+ properties: {
653
+ message: {
654
+ type: string;
655
+ };
656
+ metadata: {
657
+ type: string;
658
+ };
659
+ };
660
+ };
661
+ };
662
+ };
663
+ ErrorResponse: {
664
+ type: string;
665
+ properties: {
666
+ success: {
667
+ type: string;
668
+ example: boolean;
669
+ };
670
+ error: {
671
+ type: string;
672
+ };
673
+ };
674
+ };
675
+ };
676
+ };
677
+ };
678
+ //# sourceMappingURL=swagger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swagger.d.ts","sourceRoot":"","sources":["../../src/agents/swagger.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,GAAG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