@stack-spot/portal-network 0.40.0 → 0.41.0

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,750 @@
1
+ /**
2
+ * ai-agent-mgmt-api API
3
+ * 0.0.1
4
+ * DO NOT MODIFY - This file has been generated using oazapfts.
5
+ * See https://www.npmjs.com/package/oazapfts
6
+ */
7
+ import * as Oazapfts from "@oazapfts/runtime";
8
+ import * as QS from "@oazapfts/runtime/query";
9
+ export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
10
+ headers: {},
11
+ baseUrl: "/",
12
+ };
13
+ const oazapfts = Oazapfts.runtime(defaults);
14
+ export const servers = {};
15
+ export type AgentType = "CONVERSATIONAL" | "SINGLE_ANSWER";
16
+ export type LlmConfigRequestPart = {
17
+ model_slug: string;
18
+ temperature?: number | null;
19
+ };
20
+ export type SimilarityFunction = "COSINE" | "EUCLIDEAN" | "DOT_PRODUCT";
21
+ export type KnowledgeSourcesConfigRequestPart = {
22
+ similarity_function?: SimilarityFunction;
23
+ max_number_of_kos?: number | null;
24
+ relevancy_threshold?: number | null;
25
+ post_processing?: boolean | null;
26
+ sealed?: boolean | null;
27
+ /** List of knowledge source ids (ULID). */
28
+ knowledge_sources: string[];
29
+ };
30
+ export type NewAgentRequest = {
31
+ name: string;
32
+ slug: string;
33
+ description?: string;
34
+ avatar?: string;
35
+ suggested_prompts?: string[];
36
+ system_prompt: string;
37
+ "type": AgentType;
38
+ llm_config?: (LlmConfigRequestPart) | null;
39
+ knowledge_sources_config?: (KnowledgeSourcesConfigRequestPart) | null;
40
+ };
41
+ export type ViolationResponse = {
42
+ field?: string;
43
+ message?: string;
44
+ };
45
+ export type LlmConfigResponse = {
46
+ model_slug: string;
47
+ temperature: number;
48
+ };
49
+ export type KnowledgeSourceResponse = {
50
+ similarity_function: SimilarityFunction;
51
+ max_number_of_kos: number;
52
+ relevancy_threshold: number;
53
+ post_processing: boolean;
54
+ sealed: boolean;
55
+ knowledge_sources: string[];
56
+ };
57
+ export type ZonedDateTime = string;
58
+ export type ModifiedAgentRequest = {
59
+ name?: string | null;
60
+ slug?: string | null;
61
+ description?: string | null;
62
+ avatar?: string | null;
63
+ suggested_prompts?: string[] | null;
64
+ system_prompt?: string | null;
65
+ "type"?: AgentType;
66
+ llm_config?: (LlmConfigRequestPart) | null;
67
+ knowledge_sources_config?: (KnowledgeSourcesConfigRequestPart) | null;
68
+ };
69
+ export type ForkAgentRequest = {
70
+ slug?: string;
71
+ name?: string | null;
72
+ };
73
+ export type VisibilityLevel = "PERSONAL" | "SHARED" | "WORKSPACE" | "ACCOUNT";
74
+ export type ChangeVisibilityRequest = {
75
+ level: VisibilityLevel;
76
+ };
77
+ export type AgentResponse = {
78
+ id: string;
79
+ name: string;
80
+ slug: string;
81
+ description?: string;
82
+ avatar?: string;
83
+ system_prompt: string;
84
+ "type": string;
85
+ llm_config?: LlmConfigResponse;
86
+ suggested_prompts?: string[];
87
+ knowledge_sources_config?: KnowledgeSourceResponse;
88
+ visibility_level: string;
89
+ creator_name: string;
90
+ created_by: string;
91
+ created_at: ZonedDateTime;
92
+ updated_by?: string;
93
+ updated_at?: ZonedDateTime;
94
+ };
95
+ /**
96
+ * Creates a new AI Agent.
97
+ */
98
+ export function postV1Agent({ newAgentRequest }: {
99
+ newAgentRequest?: NewAgentRequest;
100
+ }, opts?: Oazapfts.RequestOpts) {
101
+ return oazapfts.ok(oazapfts.fetchJson<{
102
+ status: 201;
103
+ data: {
104
+ id?: string;
105
+ };
106
+ } | {
107
+ status: 400;
108
+ data: {
109
+ code?: string;
110
+ details?: string;
111
+ violations?: ViolationResponse[];
112
+ };
113
+ } | {
114
+ status: 422;
115
+ data: {
116
+ code?: string;
117
+ details?: string;
118
+ additionalInformation?: {
119
+ [key: string]: any;
120
+ } | null;
121
+ };
122
+ } | {
123
+ status: 500;
124
+ data: {
125
+ code?: string;
126
+ details?: string;
127
+ additionalInformation?: {
128
+ [key: string]: any;
129
+ } | null;
130
+ };
131
+ }>("/v1/agent", oazapfts.json({
132
+ ...opts,
133
+ method: "POST",
134
+ body: newAgentRequest
135
+ })));
136
+ }
137
+ /**
138
+ * Get agent by ID
139
+ */
140
+ export function getV1AgentByAgentId({ agentId }: {
141
+ agentId: string;
142
+ }, opts?: Oazapfts.RequestOpts) {
143
+ return oazapfts.ok(oazapfts.fetchJson<{
144
+ status: 200;
145
+ data: {
146
+ id: string;
147
+ name: string;
148
+ slug: string;
149
+ description?: string;
150
+ avatar?: string;
151
+ system_prompt: string;
152
+ "type": string;
153
+ llm_config?: LlmConfigResponse;
154
+ suggested_prompts?: string[];
155
+ knowledge_sources_config?: KnowledgeSourceResponse;
156
+ visibility_level: string;
157
+ creator_name: string;
158
+ created_by: string;
159
+ created_at: ZonedDateTime;
160
+ updated_by?: string;
161
+ updated_at?: ZonedDateTime;
162
+ };
163
+ } | {
164
+ status: 404;
165
+ data: {
166
+ code?: string;
167
+ details?: string;
168
+ additionalInformation?: {
169
+ [key: string]: any;
170
+ } | null;
171
+ };
172
+ } | {
173
+ status: 500;
174
+ data: {
175
+ code?: string;
176
+ details?: string;
177
+ additionalInformation?: {
178
+ [key: string]: any;
179
+ } | null;
180
+ };
181
+ }>(`/v1/agent/${encodeURIComponent(agentId)}`, {
182
+ ...opts
183
+ }));
184
+ }
185
+ /**
186
+ * Update agent by ID
187
+ */
188
+ export function putV1AgentByAgentId({ agentId, modifiedAgentRequest }: {
189
+ agentId: string;
190
+ modifiedAgentRequest?: ModifiedAgentRequest;
191
+ }, opts?: Oazapfts.RequestOpts) {
192
+ return oazapfts.ok(oazapfts.fetchJson<{
193
+ status: 204;
194
+ } | {
195
+ status: 400;
196
+ data: {
197
+ code?: string;
198
+ details?: string;
199
+ violations?: ViolationResponse[];
200
+ };
201
+ } | {
202
+ status: 404;
203
+ data: {
204
+ code?: string;
205
+ details?: string;
206
+ additionalInformation?: {
207
+ [key: string]: any;
208
+ } | null;
209
+ };
210
+ } | {
211
+ status: 422;
212
+ data: {
213
+ code?: string;
214
+ details?: string;
215
+ additionalInformation?: {
216
+ [key: string]: any;
217
+ } | null;
218
+ };
219
+ } | {
220
+ status: 500;
221
+ data: {
222
+ code?: string;
223
+ details?: string;
224
+ additionalInformation?: {
225
+ [key: string]: any;
226
+ } | null;
227
+ };
228
+ }>(`/v1/agent/${encodeURIComponent(agentId)}`, oazapfts.json({
229
+ ...opts,
230
+ method: "PUT",
231
+ body: modifiedAgentRequest
232
+ })));
233
+ }
234
+ /**
235
+ * Delete agent by ID
236
+ */
237
+ export function deleteV1AgentByAgentId({ agentId }: {
238
+ agentId: string;
239
+ }, opts?: Oazapfts.RequestOpts) {
240
+ return oazapfts.ok(oazapfts.fetchJson<{
241
+ status: 204;
242
+ } | {
243
+ status: 404;
244
+ data: {
245
+ code?: string;
246
+ details?: string;
247
+ additionalInformation?: {
248
+ [key: string]: any;
249
+ } | null;
250
+ };
251
+ } | {
252
+ status: 422;
253
+ data: {
254
+ code?: string;
255
+ details?: string;
256
+ additionalInformation?: {
257
+ [key: string]: any;
258
+ } | null;
259
+ };
260
+ } | {
261
+ status: 500;
262
+ data: {
263
+ code?: string;
264
+ details?: string;
265
+ additionalInformation?: {
266
+ [key: string]: any;
267
+ } | null;
268
+ };
269
+ }>(`/v1/agent/${encodeURIComponent(agentId)}`, {
270
+ ...opts,
271
+ method: "DELETE"
272
+ }));
273
+ }
274
+ /**
275
+ * AI Agent validade publish.
276
+ */
277
+ export function getV1AgentByAgentIdDependencies({ agentId }: {
278
+ agentId: string;
279
+ }, opts?: Oazapfts.RequestOpts) {
280
+ return oazapfts.ok(oazapfts.fetchJson<{
281
+ status: 200;
282
+ data: {
283
+ ks_names?: string[];
284
+ error_ks_names?: string[];
285
+ missing_ks_list?: string[];
286
+ };
287
+ } | {
288
+ status: 400;
289
+ data: {
290
+ code?: string;
291
+ details?: string;
292
+ violations?: ViolationResponse[];
293
+ };
294
+ } | {
295
+ status: 404;
296
+ data: {
297
+ code?: string;
298
+ details?: string;
299
+ additionalInformation?: {
300
+ [key: string]: any;
301
+ } | null;
302
+ };
303
+ } | {
304
+ status: 422;
305
+ data: {
306
+ code?: string;
307
+ details?: string;
308
+ additionalInformation?: {
309
+ [key: string]: any;
310
+ } | null;
311
+ };
312
+ } | {
313
+ status: 500;
314
+ data: {
315
+ code?: string;
316
+ details?: string;
317
+ additionalInformation?: {
318
+ [key: string]: any;
319
+ } | null;
320
+ };
321
+ }>(`/v1/agent/${encodeURIComponent(agentId)}/dependencies`, {
322
+ ...opts
323
+ }));
324
+ }
325
+ /**
326
+ * Fork an AI agent.
327
+ */
328
+ export function postV1AgentByAgentIdFork({ agentId, forkAgentRequest }: {
329
+ agentId: string;
330
+ forkAgentRequest?: ForkAgentRequest;
331
+ }, opts?: Oazapfts.RequestOpts) {
332
+ return oazapfts.ok(oazapfts.fetchJson<{
333
+ status: 201;
334
+ data: {
335
+ id?: string;
336
+ };
337
+ } | {
338
+ status: 500;
339
+ data: {
340
+ code?: string;
341
+ details?: string;
342
+ additionalInformation?: {
343
+ [key: string]: any;
344
+ } | null;
345
+ };
346
+ }>(`/v1/agent/${encodeURIComponent(agentId)}/fork`, oazapfts.json({
347
+ ...opts,
348
+ method: "POST",
349
+ body: forkAgentRequest
350
+ })));
351
+ }
352
+ /**
353
+ * AI Agent update visibility.
354
+ */
355
+ export function postV1AgentByAgentIdPublish({ agentId, changeVisibilityRequest }: {
356
+ agentId: string;
357
+ changeVisibilityRequest?: ChangeVisibilityRequest;
358
+ }, opts?: Oazapfts.RequestOpts) {
359
+ return oazapfts.ok(oazapfts.fetchJson<{
360
+ status: 204;
361
+ } | {
362
+ status: 400;
363
+ data: {
364
+ code?: string;
365
+ details?: string;
366
+ violations?: ViolationResponse[];
367
+ };
368
+ } | {
369
+ status: 404;
370
+ data: {
371
+ code?: string;
372
+ details?: string;
373
+ additionalInformation?: {
374
+ [key: string]: any;
375
+ } | null;
376
+ };
377
+ } | {
378
+ status: 422;
379
+ data: {
380
+ code?: string;
381
+ details?: string;
382
+ additionalInformation?: {
383
+ [key: string]: any;
384
+ } | null;
385
+ };
386
+ } | {
387
+ status: 500;
388
+ data: {
389
+ code?: string;
390
+ details?: string;
391
+ additionalInformation?: {
392
+ [key: string]: any;
393
+ } | null;
394
+ };
395
+ }>(`/v1/agent/${encodeURIComponent(agentId)}/publish`, oazapfts.json({
396
+ ...opts,
397
+ method: "POST",
398
+ body: changeVisibilityRequest
399
+ })));
400
+ }
401
+ /**
402
+ * Share an AI agent.
403
+ */
404
+ export function postV1AgentByAgentIdShare({ agentId }: {
405
+ agentId: string;
406
+ }, opts?: Oazapfts.RequestOpts) {
407
+ return oazapfts.ok(oazapfts.fetchJson<{
408
+ status: 204;
409
+ data: object;
410
+ } | {
411
+ status: 500;
412
+ data: {
413
+ code?: string;
414
+ details?: string;
415
+ additionalInformation?: {
416
+ [key: string]: any;
417
+ } | null;
418
+ };
419
+ }>(`/v1/agent/${encodeURIComponent(agentId)}/share`, {
420
+ ...opts,
421
+ method: "POST"
422
+ }));
423
+ }
424
+ /**
425
+ * List all built-in AI Agents.
426
+ */
427
+ export function getV1Agents({ visibility }: {
428
+ visibility?: VisibilityLevel;
429
+ }, opts?: Oazapfts.RequestOpts) {
430
+ return oazapfts.ok(oazapfts.fetchJson<{
431
+ status: 200;
432
+ data: AgentResponse[];
433
+ } | {
434
+ status: 500;
435
+ data: {
436
+ code?: string;
437
+ details?: string;
438
+ additionalInformation?: {
439
+ [key: string]: any;
440
+ } | null;
441
+ };
442
+ }>(`/v1/agents${QS.query(QS.explode({
443
+ visibility
444
+ }))}`, {
445
+ ...opts
446
+ }));
447
+ }
448
+ /**
449
+ * Creates a new built-in AI Agent.
450
+ */
451
+ export function postV1PublicAgent({ newAgentRequest }: {
452
+ newAgentRequest?: NewAgentRequest;
453
+ }, opts?: Oazapfts.RequestOpts) {
454
+ return oazapfts.ok(oazapfts.fetchJson<{
455
+ status: 201;
456
+ data: {
457
+ id?: string;
458
+ };
459
+ } | {
460
+ status: 400;
461
+ data: {
462
+ code?: string;
463
+ details?: string;
464
+ violations?: ViolationResponse[];
465
+ };
466
+ } | {
467
+ status: 422;
468
+ data: {
469
+ code?: string;
470
+ details?: string;
471
+ additionalInformation?: {
472
+ [key: string]: any;
473
+ } | null;
474
+ };
475
+ } | {
476
+ status: 500;
477
+ data: {
478
+ code?: string;
479
+ details?: string;
480
+ additionalInformation?: {
481
+ [key: string]: any;
482
+ } | null;
483
+ };
484
+ }>("/v1/public/agent", oazapfts.json({
485
+ ...opts,
486
+ method: "POST",
487
+ body: newAgentRequest
488
+ })));
489
+ }
490
+ /**
491
+ * Get agent by ID
492
+ */
493
+ export function getV1PublicAgentByAgentId({ agentId }: {
494
+ agentId: string;
495
+ }, opts?: Oazapfts.RequestOpts) {
496
+ return oazapfts.ok(oazapfts.fetchJson<{
497
+ status: 200;
498
+ data: {
499
+ id: string;
500
+ name: string;
501
+ slug: string;
502
+ description?: string;
503
+ avatar?: string;
504
+ system_prompt: string;
505
+ "type": string;
506
+ llm_config?: LlmConfigResponse;
507
+ suggested_prompts?: string[];
508
+ knowledge_sources_config?: KnowledgeSourceResponse;
509
+ visibility_level: string;
510
+ creator_name: string;
511
+ created_by: string;
512
+ created_at: ZonedDateTime;
513
+ updated_by?: string;
514
+ updated_at?: ZonedDateTime;
515
+ };
516
+ } | {
517
+ status: 404;
518
+ data: {
519
+ code?: string;
520
+ details?: string;
521
+ additionalInformation?: {
522
+ [key: string]: any;
523
+ } | null;
524
+ };
525
+ } | {
526
+ status: 500;
527
+ data: {
528
+ code?: string;
529
+ details?: string;
530
+ additionalInformation?: {
531
+ [key: string]: any;
532
+ } | null;
533
+ };
534
+ }>(`/v1/public/agent/${encodeURIComponent(agentId)}`, {
535
+ ...opts
536
+ }));
537
+ }
538
+ /**
539
+ * Update agent by ID
540
+ */
541
+ export function putV1PublicAgentByAgentId({ agentId, modifiedAgentRequest }: {
542
+ agentId: string;
543
+ modifiedAgentRequest?: ModifiedAgentRequest;
544
+ }, opts?: Oazapfts.RequestOpts) {
545
+ return oazapfts.ok(oazapfts.fetchJson<{
546
+ status: 204;
547
+ } | {
548
+ status: 400;
549
+ data: {
550
+ code?: string;
551
+ details?: string;
552
+ violations?: ViolationResponse[];
553
+ };
554
+ } | {
555
+ status: 404;
556
+ data: {
557
+ code?: string;
558
+ details?: string;
559
+ additionalInformation?: {
560
+ [key: string]: any;
561
+ } | null;
562
+ };
563
+ } | {
564
+ status: 422;
565
+ data: {
566
+ code?: string;
567
+ details?: string;
568
+ additionalInformation?: {
569
+ [key: string]: any;
570
+ } | null;
571
+ };
572
+ } | {
573
+ status: 500;
574
+ data: {
575
+ code?: string;
576
+ details?: string;
577
+ additionalInformation?: {
578
+ [key: string]: any;
579
+ } | null;
580
+ };
581
+ }>(`/v1/public/agent/${encodeURIComponent(agentId)}`, oazapfts.json({
582
+ ...opts,
583
+ method: "PUT",
584
+ body: modifiedAgentRequest
585
+ })));
586
+ }
587
+ /**
588
+ * Delete agent by ID
589
+ */
590
+ export function deleteV1PublicAgentByAgentId({ agentId }: {
591
+ agentId: string;
592
+ }, opts?: Oazapfts.RequestOpts) {
593
+ return oazapfts.ok(oazapfts.fetchJson<{
594
+ status: 204;
595
+ } | {
596
+ status: 404;
597
+ data: {
598
+ code?: string;
599
+ details?: string;
600
+ additionalInformation?: {
601
+ [key: string]: any;
602
+ } | null;
603
+ };
604
+ } | {
605
+ status: 422;
606
+ data: {
607
+ code?: string;
608
+ details?: string;
609
+ additionalInformation?: {
610
+ [key: string]: any;
611
+ } | null;
612
+ };
613
+ } | {
614
+ status: 500;
615
+ data: {
616
+ code?: string;
617
+ details?: string;
618
+ additionalInformation?: {
619
+ [key: string]: any;
620
+ } | null;
621
+ };
622
+ }>(`/v1/public/agent/${encodeURIComponent(agentId)}`, {
623
+ ...opts,
624
+ method: "DELETE"
625
+ }));
626
+ }
627
+ /**
628
+ * AI Agent validade publish.
629
+ */
630
+ export function getV1PublicAgentByAgentIdDependencies({ agentId }: {
631
+ agentId: string;
632
+ }, opts?: Oazapfts.RequestOpts) {
633
+ return oazapfts.ok(oazapfts.fetchJson<{
634
+ status: 200;
635
+ data: {
636
+ ks_names?: string[];
637
+ error_ks_names?: string[];
638
+ missing_ks_list?: string[];
639
+ };
640
+ } | {
641
+ status: 400;
642
+ data: {
643
+ code?: string;
644
+ details?: string;
645
+ violations?: ViolationResponse[];
646
+ };
647
+ } | {
648
+ status: 404;
649
+ data: {
650
+ code?: string;
651
+ details?: string;
652
+ additionalInformation?: {
653
+ [key: string]: any;
654
+ } | null;
655
+ };
656
+ } | {
657
+ status: 422;
658
+ data: {
659
+ code?: string;
660
+ details?: string;
661
+ additionalInformation?: {
662
+ [key: string]: any;
663
+ } | null;
664
+ };
665
+ } | {
666
+ status: 500;
667
+ data: {
668
+ code?: string;
669
+ details?: string;
670
+ additionalInformation?: {
671
+ [key: string]: any;
672
+ } | null;
673
+ };
674
+ }>(`/v1/public/agent/${encodeURIComponent(agentId)}/dependencies`, {
675
+ ...opts
676
+ }));
677
+ }
678
+ /**
679
+ * AI Agent update visibility.
680
+ */
681
+ export function postV1PublicAgentByAgentIdPublish({ agentId, changeVisibilityRequest }: {
682
+ agentId: string;
683
+ changeVisibilityRequest?: ChangeVisibilityRequest;
684
+ }, opts?: Oazapfts.RequestOpts) {
685
+ return oazapfts.ok(oazapfts.fetchJson<{
686
+ status: 204;
687
+ } | {
688
+ status: 400;
689
+ data: {
690
+ code?: string;
691
+ details?: string;
692
+ violations?: ViolationResponse[];
693
+ };
694
+ } | {
695
+ status: 404;
696
+ data: {
697
+ code?: string;
698
+ details?: string;
699
+ additionalInformation?: {
700
+ [key: string]: any;
701
+ } | null;
702
+ };
703
+ } | {
704
+ status: 422;
705
+ data: {
706
+ code?: string;
707
+ details?: string;
708
+ additionalInformation?: {
709
+ [key: string]: any;
710
+ } | null;
711
+ };
712
+ } | {
713
+ status: 500;
714
+ data: {
715
+ code?: string;
716
+ details?: string;
717
+ additionalInformation?: {
718
+ [key: string]: any;
719
+ } | null;
720
+ };
721
+ }>(`/v1/public/agent/${encodeURIComponent(agentId)}/publish`, oazapfts.json({
722
+ ...opts,
723
+ method: "POST",
724
+ body: changeVisibilityRequest
725
+ })));
726
+ }
727
+ /**
728
+ * List all built-in AI Agents.
729
+ */
730
+ export function getV1PublicAgents({ visibility }: {
731
+ visibility?: VisibilityLevel;
732
+ }, opts?: Oazapfts.RequestOpts) {
733
+ return oazapfts.ok(oazapfts.fetchJson<{
734
+ status: 200;
735
+ data: AgentResponse[];
736
+ } | {
737
+ status: 500;
738
+ data: {
739
+ code?: string;
740
+ details?: string;
741
+ additionalInformation?: {
742
+ [key: string]: any;
743
+ } | null;
744
+ };
745
+ }>(`/v1/public/agents${QS.query(QS.explode({
746
+ visibility
747
+ }))}`, {
748
+ ...opts
749
+ }));
750
+ }