@droz-js/sdk 0.19.20 → 0.19.22

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@droz-js/sdk",
3
3
  "description": "Droz SDK",
4
- "version": "0.19.20",
4
+ "version": "0.19.22",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",
package/src/drozai.d.ts CHANGED
@@ -6,6 +6,33 @@ declare const DrozAi_base: new (options?: import("./client/http").HttpClientOpti
6
6
  withCustomHeaders(headers: () => Record<string, string>): /*elided*/ any;
7
7
  withHttpRequestExecutor(httpRequestExecutor: import("./client/http").HttpRequestExecutor): /*elided*/ any;
8
8
  } & {
9
+ listAiAgents(variables?: import("./sdks/ai").Exact<{
10
+ [key: string]: never;
11
+ }>, options?: unknown): Promise<import("./sdks/ai").ListAiAgentsQuery>;
12
+ listAiAgentVersions(variables: import("./sdks/ai").Exact<{
13
+ agentId: import("./sdks/ai").Scalars["ID"]["input"];
14
+ }>, options?: unknown): Promise<import("./sdks/ai").ListAiAgentVersionsQuery>;
15
+ aiAgentMetricsByAgent(variables: import("./sdks/ai").Exact<{
16
+ input: import("./sdks/ai").AiAgentMetricsWindowInput;
17
+ }>, options?: unknown): Promise<import("./sdks/ai").AiAgentMetricsByAgentQuery>;
18
+ draftAiAgent(variables: import("./sdks/ai").Exact<{
19
+ input: import("./sdks/ai").DraftAiAgentInput;
20
+ }>, options?: unknown): Promise<import("./sdks/ai").DraftAiAgentMutation>;
21
+ publishAiAgentVersion(variables: import("./sdks/ai").Exact<{
22
+ input: import("./sdks/ai").AiAgentVersionRefInput;
23
+ }>, options?: unknown): Promise<import("./sdks/ai").PublishAiAgentVersionMutation>;
24
+ unpublishAiAgentVersion(variables: import("./sdks/ai").Exact<{
25
+ input: import("./sdks/ai").AiAgentVersionRefInput;
26
+ }>, options?: unknown): Promise<import("./sdks/ai").UnpublishAiAgentVersionMutation>;
27
+ rollbackAiAgentVersion(variables: import("./sdks/ai").Exact<{
28
+ input: import("./sdks/ai").AiAgentVersionRefInput;
29
+ }>, options?: unknown): Promise<import("./sdks/ai").RollbackAiAgentVersionMutation>;
30
+ removeAiAgentVersion(variables: import("./sdks/ai").Exact<{
31
+ input: import("./sdks/ai").AiAgentVersionRefInput;
32
+ }>, options?: unknown): Promise<import("./sdks/ai").RemoveAiAgentVersionMutation>;
33
+ removeAiAgent(variables: import("./sdks/ai").Exact<{
34
+ input: import("./sdks/ai").AiAgentRefInput;
35
+ }>, options?: unknown): Promise<import("./sdks/ai").RemoveAiAgentMutation>;
9
36
  extractImageMetadata(variables: import("./sdks/ai").Exact<{
10
37
  input: import("./sdks/ai").ExtractImageMetadataInput;
11
38
  }>, options?: unknown): Promise<import("./sdks/ai").ExtractImageMetadataMutation>;
package/src/sdks/ai.d.ts CHANGED
@@ -127,17 +127,411 @@ export type AgentInfo = {
127
127
  name: Scalars['String']['output'];
128
128
  picture?: Maybe<Scalars['String']['output']>;
129
129
  };
130
+ export type AiAgentAuthoringRefInput = {
131
+ agentId: Scalars['ID']['input'];
132
+ id: Scalars['ID']['input'];
133
+ };
134
+ export type AiAgentBudget = {
135
+ /**
136
+ * Teto de gasto da conversa em micro-dolar (1e-6 USD). So vale para chamada com preco conhecido:
137
+ * modelo fora da tabela de preco produz custo desconhecido, nunca zero. Combine com `maxTokens`,
138
+ * que sempre vale.
139
+ */
140
+ maxCostMicroUsd?: Maybe<Scalars['Int']['output']>;
141
+ maxSteps: Scalars['Int']['output'];
142
+ /** Teto de token da conversa inteira. Ausente = sem teto de token. */
143
+ maxTokens?: Maybe<Scalars['Int']['output']>;
144
+ maxToolCalls: Scalars['Int']['output'];
145
+ onExceeded: BudgetExceededAction;
146
+ };
147
+ export type AiAgentBudgetInput = {
148
+ maxCostMicroUsd?: InputMaybe<Scalars['Int']['input']>;
149
+ maxSteps: Scalars['Int']['input'];
150
+ maxTokens?: InputMaybe<Scalars['Int']['input']>;
151
+ maxToolCalls: Scalars['Int']['input'];
152
+ onExceeded: BudgetExceededAction;
153
+ };
154
+ export type AiAgentCheckResult = {
155
+ regressions: Array<AiAgentRegression>;
156
+ reports: Array<AiAgentScenarioReport>;
157
+ /** Falso quando um cenário piorou além da tolerância em relação à versão live. */
158
+ safeToPublish: Scalars['Boolean']['output'];
159
+ };
160
+ export type AiAgentCompetingPair = {
161
+ left: Scalars['ID']['output'];
162
+ right: Scalars['ID']['output'];
163
+ /** Similaridade entre as duas descricoes, de 0 a 1. */
164
+ score: Scalars['Number']['output'];
165
+ };
166
+ export type AiAgentConversationMetrics = {
167
+ channel?: Maybe<Scalars['String']['output']>;
168
+ costMicroUsd: Scalars['Number']['output'];
169
+ durationMs: Scalars['Number']['output'];
170
+ lastOutcome: Scalars['String']['output'];
171
+ lastTurnAt: Scalars['Number']['output'];
172
+ sessionId: Scalars['ID']['output'];
173
+ startedAt: Scalars['Number']['output'];
174
+ totalTokens: Scalars['Number']['output'];
175
+ turns: Scalars['Number']['output'];
176
+ };
177
+ export type AiAgentConversationOutcome = {
178
+ agentId: Scalars['ID']['output'];
179
+ agentVersion: Scalars['String']['output'];
180
+ /** Fatos da sessao; chave e valor mascarados quando a politica de retencao pede. */
181
+ collectedData: Scalars['JSON']['output'];
182
+ /** false quando a retencao ja apagou a sessao. */
183
+ collectedDataAvailable: Scalars['Boolean']['output'];
184
+ /** Motivo da parada do ultimo turno, quando houve. */
185
+ haltReason?: Maybe<Scalars['String']['output']>;
186
+ lastTurnAt: Scalars['Number']['output'];
187
+ resolution: Scalars['String']['output'];
188
+ resolutionDefinition: Scalars['String']['output'];
189
+ sessionId: Scalars['ID']['output'];
190
+ startedAt: Scalars['Number']['output'];
191
+ turns: Scalars['Number']['output'];
192
+ };
193
+ /**
194
+ * Como este agente passa o atendimento para uma pessoa.
195
+ *
196
+ * A transicao vive no fluxo do tenant — e a state machine dele que sabe qual estado atende gente —,
197
+ * por isso e configuracao e nao constante da plataforma. Ausente significa que o agente nao passa
198
+ * para ninguem: ele diz que o caso precisa de uma pessoa e usa o comportamento fora de escopo do
199
+ * autor para dizer onde procura-la, em vez de prometer transferencia que nao acontece.
200
+ */
201
+ export type AiAgentHandoff = {
202
+ transition: Scalars['String']['output'];
203
+ };
204
+ export type AiAgentHandoffInput = {
205
+ transition: Scalars['String']['input'];
206
+ };
207
+ export type AiAgentIdentity = {
208
+ displayName: Scalars['String']['output'];
209
+ openingMessage?: Maybe<Scalars['String']['output']>;
210
+ outOfScopeBehaviour: Scalars['String']['output'];
211
+ role: Scalars['String']['output'];
212
+ tone: TonePreset;
213
+ toneNotes?: Maybe<Scalars['String']['output']>;
214
+ };
215
+ export type AiAgentIdentityInput = {
216
+ displayName: Scalars['String']['input'];
217
+ openingMessage?: InputMaybe<Scalars['String']['input']>;
218
+ outOfScopeBehaviour: Scalars['String']['input'];
219
+ role: Scalars['String']['input'];
220
+ tone: TonePreset;
221
+ toneNotes?: InputMaybe<Scalars['String']['input']>;
222
+ };
223
+ export type AiAgentMetrics = {
224
+ agentId: Scalars['ID']['output'];
225
+ answeredTurns: Scalars['Number']['output'];
226
+ avgLlmLatencyMs: Scalars['Number']['output'];
227
+ avgTurnDurationMs: Scalars['Number']['output'];
228
+ budgetExceededTurns: Scalars['Number']['output'];
229
+ conversations: Scalars['Number']['output'];
230
+ /**
231
+ * Conversas em que algum turno **pediu** uma pessoa. Pedido, nao confirmacao: o disparo da transicao
232
+ * e best-effort, entao nem toda solicitacao virou transferencia de fato.
233
+ */
234
+ conversationsHandoffRequested: Scalars['Number']['output'];
235
+ /**
236
+ * Nem uma nem outra: parou por prazo, por repeticao, ou ainda esta acontecendo. Existe para nao
237
+ * inflar a resolucao — contar "nao transferiu" como "resolveu" transformaria conversa abandonada
238
+ * em sucesso.
239
+ */
240
+ conversationsInconclusive: Scalars['Number']['output'];
241
+ /** Conversas resolvidas sob a regra declarada em `resolutionDefinition`. */
242
+ conversationsResolved: Scalars['Number']['output'];
243
+ /** Gasto da janela em micro-dolar (1e-6 USD), inteiro. */
244
+ costMicroUsd: Scalars['Number']['output'];
245
+ from: Scalars['Number']['output'];
246
+ haltReasons: Array<AiAgentMetricsCount>;
247
+ haltedTurns: Scalars['Number']['output'];
248
+ /** Turnos que terminaram pedindo uma pessoa (pedido, nao transferencia). */
249
+ humanRequestedTurns: Scalars['Number']['output'];
250
+ /** Turnos que precisaram de cliente identificado e nao tinham um — a medida do atrito de identificacao. */
251
+ identificationRequiredTurns: Scalars['Number']['output'];
252
+ inputTokens: Scalars['Number']['output'];
253
+ knowledgeEmpty: Scalars['Number']['output'];
254
+ knowledgeRetrieved: Scalars['Number']['output'];
255
+ knowledgeSkipped: Scalars['Number']['output'];
256
+ knowledgeUnavailable: Scalars['Number']['output'];
257
+ llmCalls: Scalars['Number']['output'];
258
+ outputTokens: Scalars['Number']['output'];
259
+ p95TurnDurationMs: Scalars['Number']['output'];
260
+ /** A regra aplicada para contar resolucao, junto do numero, para ele nao ser lido como cada um quiser. */
261
+ resolutionDefinition: Scalars['String']['output'];
262
+ /**
263
+ * Conversas resolvidas sobre o total, em pontos percentuais. **Ausente** quando nao houve conversa na
264
+ * janela — sem dado e zero por cento nao sao a mesma coisa.
265
+ */
266
+ resolutionRate?: Maybe<Scalars['Number']['output']>;
267
+ to: Scalars['Number']['output'];
268
+ toolCalls: Scalars['Number']['output'];
269
+ /** Chamadas de ferramenta que falharam. */
270
+ toolCallsFailed: Scalars['Number']['output'];
271
+ /** Falhas por classe: timeout, upstream, nao configurada, sem identificacao. */
272
+ toolErrorsByClass: Array<AiAgentMetricsCount>;
273
+ /** Falhas por conexao externa, identificada pelo host — responde "qual integracao esta caindo". */
274
+ toolErrorsByConnection: Array<AiAgentMetricsCount>;
275
+ totalTokens: Scalars['Number']['output'];
276
+ /** true quando o teto de leitura foi atingido: os numeros cobrem parte do periodo. */
277
+ truncated: Scalars['Boolean']['output'];
278
+ turns: Scalars['Number']['output'];
279
+ turnsByModel: Array<AiAgentMetricsCount>;
280
+ /**
281
+ * Turnos com ao menos uma chamada ao modelo sem preco conhecido. Com isto > 0, `costMicroUsd` e
282
+ * **piso**, nao total — nao decidir preco sem olhar este numero.
283
+ */
284
+ unpricedTurns: Scalars['Number']['output'];
285
+ };
286
+ export type AiAgentMetricsCount = {
287
+ count: Scalars['Number']['output'];
288
+ key: Scalars['String']['output'];
289
+ };
290
+ export type AiAgentMetricsInput = {
291
+ agentId: Scalars['ID']['input'];
292
+ channel?: InputMaybe<Scalars['String']['input']>;
293
+ from: Scalars['Number']['input'];
294
+ to: Scalars['Number']['input'];
295
+ };
296
+ /** A mesma janela, sem agente: a listagem quer todos de uma vez. */
297
+ export type AiAgentMetricsWindowInput = {
298
+ channel?: InputMaybe<Scalars['String']['input']>;
299
+ from: Scalars['Number']['input'];
300
+ to: Scalars['Number']['input'];
301
+ };
302
+ export type AiAgentProcedure = {
303
+ contingency: Scalars['String']['output'];
304
+ /** `autonomous` ou `needsApproval`. Ferramenta irreversivel exige `needsApproval`. */
305
+ executionAutonomy: Scalars['String']['output'];
306
+ /** As etapas como o autor instruiria uma pessoa. O texto e a fonte da verdade (§6.2). */
307
+ guidanceSteps: Array<Scalars['String']['output']>;
308
+ id: Scalars['ID']['output'];
309
+ name: Scalars['String']['output'];
310
+ status: Scalars['String']['output'];
311
+ /** Ferramentas que as etapas usam. Declaradas: e o que da para validar sem interpretar o texto. */
312
+ toolIds: Array<Scalars['ID']['output']>;
313
+ updatedAt: Scalars['Number']['output'];
314
+ };
315
+ export type AiAgentRefInput = {
316
+ agentId: Scalars['ID']['input'];
317
+ };
318
+ export type AiAgentRegression = {
319
+ after: Scalars['Float']['output'];
320
+ before: Scalars['Float']['output'];
321
+ scenarioId: Scalars['ID']['output'];
322
+ };
323
+ export type AiAgentRetentionDays = {
324
+ long_term_memory: Scalars['Int']['output'];
325
+ session_state: Scalars['Int']['output'];
326
+ transcript: Scalars['Int']['output'];
327
+ };
328
+ export type AiAgentRetentionPolicy = {
329
+ days: AiAgentRetentionDays;
330
+ masksPersonalData: Scalars['Boolean']['output'];
331
+ };
332
+ export type AiAgentScenario = {
333
+ description: Scalars['String']['output'];
334
+ expectations: Array<Scalars['JSON']['output']>;
335
+ scenarioId: Scalars['ID']['output'];
336
+ /** O que o cliente diz, em ordem. */
337
+ turns: Array<Scalars['String']['output']>;
338
+ };
339
+ export type AiAgentScenarioReport = {
340
+ passed: Scalars['Int']['output'];
341
+ /** Fração de execuções em que todas as expectativas valeram, 0..1. */
342
+ rate: Scalars['Float']['output'];
343
+ runs: Scalars['Int']['output'];
344
+ scenarioId: Scalars['ID']['output'];
345
+ };
346
+ export type AiAgentSpec = {
347
+ budget: AiAgentBudget;
348
+ /** One natural-language permission per item. */
349
+ can: Array<Scalars['String']['output']>;
350
+ /** Restrictions. On conflict these win over `can`, without exception. */
351
+ cannot: Array<Scalars['String']['output']>;
352
+ /** Canais em que o agente atende. Ausente = ainda nao vinculado; declarado vazio e erro. */
353
+ channels?: Maybe<Array<Scalars['String']['output']>>;
354
+ handoff?: Maybe<AiAgentHandoff>;
355
+ identity: AiAgentIdentity;
356
+ knowledgeBaseIds: Array<Scalars['ID']['output']>;
357
+ /** `inform_limitation` (default) ou `general_knowledge`; ausente vale o mais restritivo. */
358
+ knowledgeFallback?: Maybe<Scalars['String']['output']>;
359
+ toolIds: Array<Scalars['ID']['output']>;
360
+ };
361
+ export type AiAgentSpecInput = {
362
+ budget: AiAgentBudgetInput;
363
+ can: Array<Scalars['String']['input']>;
364
+ cannot: Array<Scalars['String']['input']>;
365
+ channels?: InputMaybe<Array<Scalars['String']['input']>>;
366
+ handoff?: InputMaybe<AiAgentHandoffInput>;
367
+ identity: AiAgentIdentityInput;
368
+ knowledgeBaseIds: Array<Scalars['ID']['input']>;
369
+ /** `inform_limitation` (default) ou `general_knowledge`; ausente vale o mais restritivo. */
370
+ knowledgeFallback?: InputMaybe<Scalars['String']['input']>;
371
+ toolIds: Array<Scalars['ID']['input']>;
372
+ };
373
+ export type AiAgentSummary = {
374
+ agentId: Scalars['ID']['output'];
375
+ /** Canais da versao no ar; sem versao no ar, os da mais recente. Vazio quando nenhuma declarou canal. */
376
+ channels: Array<Scalars['String']['output']>;
377
+ /** Absent until a version is published. An agent with no live version answers nobody. */
378
+ liveVersion?: Maybe<Scalars['Int']['output']>;
379
+ name: Scalars['String']['output'];
380
+ /** Acoes esperando aprovacao humana (§5.5.3). Zero tambem quando a fila nao pode ser lida. */
381
+ queuedApprovals: Scalars['Number']['output'];
382
+ /**
383
+ * `draft` (nunca publicado), `live` (no ar) ou `paused` (ja esteve no ar e foi tirado). `liveVersion`
384
+ * sozinho nao distingue quem nunca publicou de quem foi pausado.
385
+ */
386
+ status: Scalars['String']['output'];
387
+ /** Momento da versao mais recente, no ar ou nao — o "ultima alteracao" da listagem. */
388
+ updatedAt: Scalars['Number']['output'];
389
+ };
390
+ export type AiAgentTool = {
391
+ /** `pre_approved` (padrao) ou `human_approval`. */
392
+ approval?: Maybe<Scalars['String']['output']>;
393
+ availability: ToolAvailability;
394
+ /** `url` (default): a plataforma impoe o recorte via `{customerId}` na URL; `credential`: a credencial ja e do cliente (declarado, nunca inferido). */
395
+ customerScope?: Maybe<Scalars['String']['output']>;
396
+ description: Scalars['String']['output'];
397
+ effect: ToolEffect;
398
+ name: Scalars['String']['output'];
399
+ /** `{kind: message, message?}` (default), `{kind: retry, attempts, message?}` ou `{kind: handoff}`. */
400
+ onFailure?: Maybe<Scalars['JSON']['output']>;
401
+ parameters: Array<AiAgentToolParameter>;
402
+ requiresAuthenticatedCustomer: Scalars['Boolean']['output'];
403
+ /** Fields the agent is allowed to see. Anything not listed never reaches the model. */
404
+ returns: Array<Scalars['String']['output']>;
405
+ toolId: Scalars['ID']['output'];
406
+ };
407
+ export type AiAgentToolParameter = {
408
+ description: Scalars['String']['output'];
409
+ grounding: ParameterGrounding;
410
+ name: Scalars['String']['output'];
411
+ required: Scalars['Boolean']['output'];
412
+ type: ToolParameterType;
413
+ };
414
+ export type AiAgentToolParameterInput = {
415
+ description: Scalars['String']['input'];
416
+ groundedBy?: InputMaybe<Array<Scalars['String']['input']>>;
417
+ grounding?: InputMaybe<ParameterGrounding>;
418
+ name: Scalars['String']['input'];
419
+ required: Scalars['Boolean']['input'];
420
+ type: ToolParameterType;
421
+ };
422
+ export type AiAgentToolSpecInput = {
423
+ /** `pre_approved` (padrao) ou `human_approval`. */
424
+ approval?: InputMaybe<Scalars['String']['input']>;
425
+ availability: ToolAvailability;
426
+ credentialRef?: InputMaybe<CredentialRefInput>;
427
+ /** `url` (default): a plataforma impoe o recorte via `{customerId}` na URL; `credential`: a credencial ja e do cliente (declarado, nunca inferido). */
428
+ customerScope?: InputMaybe<Scalars['String']['input']>;
429
+ description: Scalars['String']['input'];
430
+ effect: ToolEffect;
431
+ idempotent: Scalars['Boolean']['input'];
432
+ name: Scalars['String']['input'];
433
+ /** `{kind: message, message?}` (default), `{kind: retry, attempts, message?}` ou `{kind: handoff}`. */
434
+ onFailure?: InputMaybe<Scalars['JSON']['input']>;
435
+ parameters: Array<AiAgentToolParameterInput>;
436
+ requiresAuthenticatedCustomer: Scalars['Boolean']['input'];
437
+ /** Campos que o agente pode ver. O que não estiver aqui nunca chega ao modelo. */
438
+ returns: Array<Scalars['String']['input']>;
439
+ reversible: Scalars['Boolean']['input'];
440
+ toolId: Scalars['ID']['input'];
441
+ };
442
+ export type AiAgentTrace = {
443
+ agentId: Scalars['ID']['output'];
444
+ agentVersion: Scalars['String']['output'];
445
+ answer: Scalars['String']['output'];
446
+ /** Presente so quando o turno parou por limite; ausente quando respondeu. */
447
+ haltReason?: Maybe<Scalars['String']['output']>;
448
+ /** O turno tentou usar ferramenta que exige cliente identificado, sem ter um. */
449
+ identificationRequired?: Maybe<Scalars['Boolean']['output']>;
450
+ input: Scalars['String']['output'];
451
+ knowledgeOrigins: Array<Scalars['String']['output']>;
452
+ /** Versao da regra mestra da plataforma vigente no turno — atribui a conversa a regra sob a qual ela rodou. */
453
+ masterRuleVersion?: Maybe<Scalars['Int']['output']>;
454
+ outcome: Scalars['String']['output'];
455
+ promptBuilderVersion: Scalars['Int']['output'];
456
+ /** Identifica o prompt que gerou este turno sem guardar o prompt inteiro. */
457
+ promptFingerprint: Scalars['String']['output'];
458
+ sessionId: Scalars['ID']['output'];
459
+ startedAt: Scalars['Float']['output'];
460
+ steps: Scalars['Int']['output'];
461
+ toolCalls: Array<AiAgentTracedToolCall>;
462
+ turn: Scalars['Int']['output'];
463
+ };
464
+ export type AiAgentTracedToolCall = {
465
+ /** O sistema externo, pelo host. Sem path nem query, que carregam parametro do cliente. */
466
+ connection?: Maybe<Scalars['String']['output']>;
467
+ /** `unauthenticated`, `not_configured`, `timeout` ou `upstream`. */
468
+ errorClass?: Maybe<Scalars['String']['output']>;
469
+ name: Scalars['String']['output'];
470
+ /**
471
+ * Se a chamada deu certo. Ausente em chamada gravada antes do desfecho estruturado existir — e
472
+ * ausente nao significa falha.
473
+ */
474
+ ok?: Maybe<Scalars['Boolean']['output']>;
475
+ /** Ja restrito aos campos que a ferramenta declarou em `returns`. */
476
+ result: Scalars['String']['output'];
477
+ toolId: Scalars['ID']['output'];
478
+ };
479
+ export type AiAgentUseCase = {
480
+ id: Scalars['ID']['output'];
481
+ name: Scalars['String']['output'];
482
+ procedureId?: Maybe<Scalars['ID']['output']>;
483
+ status: Scalars['String']['output'];
484
+ /**
485
+ * NAO e documentacao: e o texto que o roteador le para classificar a mensagem (§6.1). Descricao vaga
486
+ * produz roteamento ruim.
487
+ */
488
+ subjectDescription: Scalars['String']['output'];
489
+ updatedAt: Scalars['Number']['output'];
490
+ };
491
+ export type AiAgentUseCaseOverlap = {
492
+ /** Do par mais parecido para o menos: e a ordem em que o autor deve olhar. */
493
+ pairs: Array<AiAgentCompetingPair>;
494
+ /** O limiar aplicado, publicado junto do resultado para o aviso nao ser lido como cada um quiser. */
495
+ threshold: Scalars['Number']['output'];
496
+ };
497
+ export type AiAgentVersion = {
498
+ agentId: Scalars['ID']['output'];
499
+ createdAt: Scalars['DateTime']['output'];
500
+ spec: AiAgentSpec;
501
+ status: AiAgentVersionStatus;
502
+ version: Scalars['Int']['output'];
503
+ };
504
+ export type AiAgentVersionRefInput = {
505
+ agentId: Scalars['ID']['input'];
506
+ version: Scalars['Int']['input'];
507
+ };
508
+ export declare enum AiAgentVersionStatus {
509
+ Draft = "draft",
510
+ Live = "live",
511
+ Published = "published",
512
+ Removed = "removed"
513
+ }
130
514
  export declare enum AppInstanceStatus {
131
515
  Active = "Active",
132
516
  Failing = "Failing",
133
517
  Inactive = "Inactive"
134
518
  }
519
+ export declare enum BudgetExceededAction {
520
+ EndWithNotice = "end_with_notice",
521
+ TransferToHuman = "transfer_to_human"
522
+ }
135
523
  export declare enum Can {
136
524
  Manage = "manage",
137
525
  Read = "read",
138
526
  Remove = "remove",
139
527
  Write = "write"
140
528
  }
529
+ export type CheckAiAgentVersionInput = {
530
+ agentId: Scalars['ID']['input'];
531
+ /** De 2 a 20. Uma execução só não prova nada num sistema probabilístico. */
532
+ runsPerScenario?: InputMaybe<Scalars['Int']['input']>;
533
+ version: Scalars['Int']['input'];
534
+ };
141
535
  export type CreateNlpInstanceInput = {
142
536
  name: Scalars['String']['input'];
143
537
  options: Array<NlpOptionInput>;
@@ -147,6 +541,17 @@ export type CreateQnAInstanceInput = {
147
541
  name: Scalars['String']['input'];
148
542
  tryToReplyOnTransition?: InputMaybe<Scalars['Boolean']['input']>;
149
543
  };
544
+ export type CredentialRefInput = {
545
+ /** Nome do parâmetro no cofre do tenant. O valor nunca é armazenado aqui. */
546
+ name: Scalars['String']['input'];
547
+ vault: Scalars['String']['input'];
548
+ };
549
+ export type DraftAiAgentInput = {
550
+ /** Omitted for a brand new agent; supplied to draft the next version of an existing one. */
551
+ agentId?: InputMaybe<Scalars['ID']['input']>;
552
+ name: Scalars['String']['input'];
553
+ spec: AiAgentSpecInput;
554
+ };
150
555
  export type ExtractImageMetadataInput = {
151
556
  imageUrl: Scalars['String']['input'];
152
557
  metadataRequirements: Scalars['JSONObject']['input'];
@@ -166,30 +571,94 @@ export type I18nTextInput = {
166
571
  value: Scalars['String']['input'];
167
572
  };
168
573
  export type Mutation = {
574
+ /** Roda os cenários contra uma versão candidata e registra o resultado. Custa chamadas de modelo. */
575
+ checkAiAgentVersion?: Maybe<AiAgentCheckResult>;
169
576
  createNlpInstance?: Maybe<NlpInstance>;
170
577
  createQnAInstance?: Maybe<QnAInstance>;
578
+ draftAiAgent?: Maybe<AiAgentVersion>;
171
579
  extractImageMetadata: ExtractImageMetadataResult;
580
+ publishAiAgentVersion: Array<AiAgentVersion>;
581
+ registerAiAgentTool?: Maybe<AiAgentTool>;
582
+ /** Apaga o agente e a autoria dele. Agente no ar precisa ser pausado antes. */
583
+ removeAiAgent: Scalars['Boolean']['output'];
584
+ removeAiAgentProcedure: Scalars['Boolean']['output'];
585
+ removeAiAgentUseCase: Scalars['Boolean']['output'];
586
+ removeAiAgentVersion: Array<AiAgentVersion>;
172
587
  removeNlpInstance?: Maybe<NlpInstance>;
173
588
  removeQnAInstance?: Maybe<QnAInstance>;
589
+ /** Decide uma acao que ficou esperando aprovacao humana (§5.5.3). Decidir de novo nao repete a acao. */
590
+ resolveAiAgentApproval: Scalars['Boolean']['output'];
591
+ rollbackAiAgentVersion: Array<AiAgentVersion>;
592
+ saveAiAgentProcedure: AiAgentProcedure;
593
+ saveAiAgentScenario?: Maybe<AiAgentScenario>;
594
+ saveAiAgentUseCase: AiAgentUseCase;
595
+ /** Tira a versao do ar sem apagar (pausar). Publicar de novo e o caminho de volta. */
596
+ unpublishAiAgentVersion: Array<AiAgentVersion>;
597
+ unregisterAiAgentTool?: Maybe<Scalars['Boolean']['output']>;
174
598
  updateNlpInstance?: Maybe<NlpInstance>;
175
599
  updateQnAInstance?: Maybe<QnAInstance>;
176
600
  version?: Maybe<Scalars['String']['output']>;
177
601
  };
602
+ export type MutationCheckAiAgentVersionArgs = {
603
+ input: CheckAiAgentVersionInput;
604
+ };
178
605
  export type MutationCreateNlpInstanceArgs = {
179
606
  input: CreateNlpInstanceInput;
180
607
  };
181
608
  export type MutationCreateQnAInstanceArgs = {
182
609
  input: CreateQnAInstanceInput;
183
610
  };
611
+ export type MutationDraftAiAgentArgs = {
612
+ input: DraftAiAgentInput;
613
+ };
184
614
  export type MutationExtractImageMetadataArgs = {
185
615
  input: ExtractImageMetadataInput;
186
616
  };
617
+ export type MutationPublishAiAgentVersionArgs = {
618
+ input: AiAgentVersionRefInput;
619
+ };
620
+ export type MutationRegisterAiAgentToolArgs = {
621
+ input: RegisterAiAgentToolInput;
622
+ };
623
+ export type MutationRemoveAiAgentArgs = {
624
+ input: AiAgentRefInput;
625
+ };
626
+ export type MutationRemoveAiAgentProcedureArgs = {
627
+ input: AiAgentAuthoringRefInput;
628
+ };
629
+ export type MutationRemoveAiAgentUseCaseArgs = {
630
+ input: AiAgentAuthoringRefInput;
631
+ };
632
+ export type MutationRemoveAiAgentVersionArgs = {
633
+ input: AiAgentVersionRefInput;
634
+ };
187
635
  export type MutationRemoveNlpInstanceArgs = {
188
636
  input: RemoveNlpInstanceInput;
189
637
  };
190
638
  export type MutationRemoveQnAInstanceArgs = {
191
639
  input: RemoveQnAInstanceInput;
192
640
  };
641
+ export type MutationResolveAiAgentApprovalArgs = {
642
+ input: ResolveAiAgentApprovalInput;
643
+ };
644
+ export type MutationRollbackAiAgentVersionArgs = {
645
+ input: AiAgentVersionRefInput;
646
+ };
647
+ export type MutationSaveAiAgentProcedureArgs = {
648
+ input: SaveAiAgentProcedureInput;
649
+ };
650
+ export type MutationSaveAiAgentScenarioArgs = {
651
+ input: SaveAiAgentScenarioInput;
652
+ };
653
+ export type MutationSaveAiAgentUseCaseArgs = {
654
+ input: SaveAiAgentUseCaseInput;
655
+ };
656
+ export type MutationUnpublishAiAgentVersionArgs = {
657
+ input: AiAgentVersionRefInput;
658
+ };
659
+ export type MutationUnregisterAiAgentToolArgs = {
660
+ input: UnregisterAiAgentToolInput;
661
+ };
193
662
  export type MutationUpdateNlpInstanceArgs = {
194
663
  input: UpdateNlpInstanceInput;
195
664
  };
@@ -234,6 +703,10 @@ export type PageInfo = {
234
703
  hasNext: Scalars['Boolean']['output'];
235
704
  next?: Maybe<Scalars['Base64']['output']>;
236
705
  };
706
+ export declare enum ParameterGrounding {
707
+ Free = "free",
708
+ Required = "required"
709
+ }
237
710
  export type QnAInstance = {
238
711
  createdAt: Scalars['DateTime']['output'];
239
712
  credentialsId: Scalars['ID']['output'];
@@ -244,22 +717,80 @@ export type QnAInstance = {
244
717
  updatedAt: Scalars['DateTime']['output'];
245
718
  };
246
719
  export type Query = {
720
+ aiAgentConversationMetrics: Array<AiAgentConversationMetrics>;
721
+ aiAgentConversationOutcome?: Maybe<AiAgentConversationOutcome>;
722
+ aiAgentMetrics: AiAgentMetrics;
723
+ /** As metricas da janela para todos os agentes, numa ida so. Agente sem rastro vem com zeros. */
724
+ aiAgentMetricsByAgent: Array<AiAgentMetrics>;
725
+ /**
726
+ * A politica de retencao em vigor para o tenant, com os padroes aplicados quando ele nao
727
+ * configurou a propria. Existe para a politica ser verificavel de fora, nao so estar escrita.
728
+ */
729
+ aiAgentRetentionPolicy: AiAgentRetentionPolicy;
730
+ /**
731
+ * Os turnos de um atendimento, do primeiro ao ultimo. E o que responde "o que aconteceu nesta
732
+ * conversa" sem depender de ler o DynamoDB por fora.
733
+ */
734
+ aiAgentTrace: Array<AiAgentTrace>;
735
+ /**
736
+ * Casos de uso cujas descricoes competem no roteador (§6.1). Aviso de autoria, nao bloqueio: descricoes
737
+ * parecidas podem ser intencionais.
738
+ */
739
+ aiAgentUseCaseOverlap: AiAgentUseCaseOverlap;
247
740
  app?: Maybe<Scalars['DRN']['output']>;
248
741
  getHttpEndpoint?: Maybe<Scalars['String']['output']>;
249
742
  getNlpInstance?: Maybe<NlpInstance>;
250
743
  getQnAInstance?: Maybe<QnAInstance>;
744
+ /** Os procedimentos do agente (§6.2): o plano em linguagem natural. */
745
+ listAiAgentProcedures: Array<AiAgentProcedure>;
746
+ listAiAgentScenarios: Array<AiAgentScenario>;
747
+ listAiAgentTools: Array<AiAgentTool>;
748
+ /** Os casos de uso do agente (§6.1): os motivos de contato. */
749
+ listAiAgentUseCases: Array<AiAgentUseCase>;
750
+ listAiAgentVersions: Array<AiAgentVersion>;
751
+ listAiAgents: Array<AiAgentSummary>;
251
752
  listNlpInstances: Array<NlpInstance>;
252
753
  listQnAInstances: Array<QnAInstance>;
253
754
  testNlpInstance?: Maybe<TestNlpInstanceResult>;
254
755
  testQnAInstance?: Maybe<TestQnAInstanceResult>;
255
756
  version?: Maybe<Scalars['String']['output']>;
256
757
  };
758
+ export type QueryAiAgentConversationMetricsArgs = {
759
+ input: AiAgentMetricsInput;
760
+ };
761
+ export type QueryAiAgentConversationOutcomeArgs = {
762
+ sessionId: Scalars['ID']['input'];
763
+ };
764
+ export type QueryAiAgentMetricsArgs = {
765
+ input: AiAgentMetricsInput;
766
+ };
767
+ export type QueryAiAgentMetricsByAgentArgs = {
768
+ input: AiAgentMetricsWindowInput;
769
+ };
770
+ export type QueryAiAgentTraceArgs = {
771
+ sessionId: Scalars['ID']['input'];
772
+ };
773
+ export type QueryAiAgentUseCaseOverlapArgs = {
774
+ agentId: Scalars['ID']['input'];
775
+ };
257
776
  export type QueryGetNlpInstanceArgs = {
258
777
  id: Scalars['ID']['input'];
259
778
  };
260
779
  export type QueryGetQnAInstanceArgs = {
261
780
  id: Scalars['ID']['input'];
262
781
  };
782
+ export type QueryListAiAgentProceduresArgs = {
783
+ agentId: Scalars['ID']['input'];
784
+ };
785
+ export type QueryListAiAgentScenariosArgs = {
786
+ agentId: Scalars['ID']['input'];
787
+ };
788
+ export type QueryListAiAgentUseCasesArgs = {
789
+ agentId: Scalars['ID']['input'];
790
+ };
791
+ export type QueryListAiAgentVersionsArgs = {
792
+ agentId: Scalars['ID']['input'];
793
+ };
263
794
  export type QueryTestNlpInstanceArgs = {
264
795
  id: Scalars['ID']['input'];
265
796
  sample: Scalars['String']['input'];
@@ -269,12 +800,53 @@ export type QueryTestQnAInstanceArgs = {
269
800
  id: Scalars['ID']['input'];
270
801
  input: Scalars['String']['input'];
271
802
  };
803
+ export type RegisterAiAgentToolInput = {
804
+ method: Scalars['String']['input'];
805
+ spec: AiAgentToolSpecInput;
806
+ /** Pode conter {param} para parâmetros declarados e {customerId}. Precisa ser https e público. */
807
+ url: Scalars['String']['input'];
808
+ };
272
809
  export type RemoveNlpInstanceInput = {
273
810
  id: Scalars['ID']['input'];
274
811
  };
275
812
  export type RemoveQnAInstanceInput = {
276
813
  id: Scalars['ID']['input'];
277
814
  };
815
+ export type ResolveAiAgentApprovalInput = {
816
+ agentId: Scalars['ID']['input'];
817
+ decidedBy: Scalars['String']['input'];
818
+ /** `approved` executa a acao guardada; `rejected` avisa o consumidor e nao executa nada. */
819
+ decision: Scalars['String']['input'];
820
+ /** Identifica a pendencia junto da sessao: e o momento em que a acao foi enfileirada. */
821
+ requestedAt: Scalars['Number']['input'];
822
+ sessionId: Scalars['ID']['input'];
823
+ };
824
+ export type SaveAiAgentProcedureInput = {
825
+ agentId: Scalars['ID']['input'];
826
+ contingency: Scalars['String']['input'];
827
+ executionAutonomy: Scalars['String']['input'];
828
+ guidanceSteps: Array<Scalars['String']['input']>;
829
+ id: Scalars['ID']['input'];
830
+ name: Scalars['String']['input'];
831
+ status: Scalars['String']['input'];
832
+ toolIds: Array<Scalars['ID']['input']>;
833
+ };
834
+ export type SaveAiAgentScenarioInput = {
835
+ agentId: Scalars['ID']['input'];
836
+ description: Scalars['String']['input'];
837
+ /** Expectativas de comportamento. `blocked_by_rule` ainda não é observável e é recusada. */
838
+ expectations: Array<Scalars['JSON']['input']>;
839
+ scenarioId: Scalars['ID']['input'];
840
+ turns: Array<Scalars['String']['input']>;
841
+ };
842
+ export type SaveAiAgentUseCaseInput = {
843
+ agentId: Scalars['ID']['input'];
844
+ id: Scalars['ID']['input'];
845
+ name: Scalars['String']['input'];
846
+ procedureId?: InputMaybe<Scalars['ID']['input']>;
847
+ status: Scalars['String']['input'];
848
+ subjectDescription: Scalars['String']['input'];
849
+ };
278
850
  export type SearchResultsFacet = {
279
851
  name: Scalars['String']['output'];
280
852
  stats?: Maybe<SearchResultsFacetStats>;
@@ -342,7 +914,37 @@ export type TokenUsage = {
342
914
  prompt?: Maybe<Scalars['Int']['output']>;
343
915
  total?: Maybe<Scalars['Int']['output']>;
344
916
  };
917
+ export declare enum TonePreset {
918
+ Cordial = "cordial",
919
+ Descontraido = "descontraido",
920
+ Direto = "direto",
921
+ Formal = "formal",
922
+ Tecnico = "tecnico"
923
+ }
924
+ export declare enum ToolAvailability {
925
+ Available = "available",
926
+ Unavailable = "unavailable"
927
+ }
928
+ export declare enum ToolEffect {
929
+ Read = "read",
930
+ Write = "write"
931
+ }
932
+ export declare enum ToolParameterType {
933
+ Boolean = "boolean",
934
+ Number = "number",
935
+ String = "string"
936
+ }
345
937
  export declare enum Typenames {
938
+ AiAgentApproval = "AiAgentApproval",
939
+ AiAgentEvalReport = "AiAgentEvalReport",
940
+ AiAgentProcedure = "AiAgentProcedure",
941
+ AiAgentRetentionPolicy = "AiAgentRetentionPolicy",
942
+ AiAgentScenario = "AiAgentScenario",
943
+ AiAgentSession = "AiAgentSession",
944
+ AiAgentTool = "AiAgentTool",
945
+ AiAgentTrace = "AiAgentTrace",
946
+ AiAgentUseCase = "AiAgentUseCase",
947
+ AiAgentVersion = "AiAgentVersion",
346
948
  Any = "Any",
347
949
  GraphqlConnections = "GraphqlConnections",
348
950
  GraphqlSubscriptions = "GraphqlSubscriptions",
@@ -350,6 +952,9 @@ export declare enum Typenames {
350
952
  NlpEmbeddings = "NlpEmbeddings",
351
953
  QnA = "QnA"
352
954
  }
955
+ export type UnregisterAiAgentToolInput = {
956
+ toolId: Scalars['ID']['input'];
957
+ };
353
958
  export type UpdateNlpInstanceInput = {
354
959
  id: Scalars['ID']['input'];
355
960
  name?: InputMaybe<Scalars['String']['input']>;
@@ -361,6 +966,61 @@ export type UpdateQnAInstanceInput = {
361
966
  name?: InputMaybe<Scalars['String']['input']>;
362
967
  tryToReplyOnTransition?: InputMaybe<Scalars['Boolean']['input']>;
363
968
  };
969
+ export type AiAgentSummaryFragment = Pick<AiAgentSummary, 'agentId' | 'name' | 'liveVersion' | 'channels' | 'updatedAt' | 'queuedApprovals' | 'status'>;
970
+ export type AiAgentVersionFragment = Pick<AiAgentVersion, 'agentId' | 'version' | 'status' | 'createdAt'>;
971
+ export type AiAgentListingMetricsFragment = Pick<AiAgentMetrics, 'agentId' | 'conversations' | 'conversationsResolved' | 'conversationsHandoffRequested' | 'resolutionRate' | 'resolutionDefinition' | 'costMicroUsd'>;
972
+ export type ListAiAgentsQueryVariables = Exact<{
973
+ [key: string]: never;
974
+ }>;
975
+ export type ListAiAgentsQuery = {
976
+ listAiAgents: Array<AiAgentSummaryFragment>;
977
+ };
978
+ export type ListAiAgentVersionsQueryVariables = Exact<{
979
+ agentId: Scalars['ID']['input'];
980
+ }>;
981
+ export type ListAiAgentVersionsQuery = {
982
+ listAiAgentVersions: Array<AiAgentVersionFragment>;
983
+ };
984
+ export type AiAgentMetricsByAgentQueryVariables = Exact<{
985
+ input: AiAgentMetricsWindowInput;
986
+ }>;
987
+ export type AiAgentMetricsByAgentQuery = {
988
+ aiAgentMetricsByAgent: Array<AiAgentListingMetricsFragment>;
989
+ };
990
+ export type DraftAiAgentMutationVariables = Exact<{
991
+ input: DraftAiAgentInput;
992
+ }>;
993
+ export type DraftAiAgentMutation = {
994
+ draftAiAgent?: Maybe<AiAgentVersionFragment>;
995
+ };
996
+ export type PublishAiAgentVersionMutationVariables = Exact<{
997
+ input: AiAgentVersionRefInput;
998
+ }>;
999
+ export type PublishAiAgentVersionMutation = {
1000
+ publishAiAgentVersion: Array<AiAgentVersionFragment>;
1001
+ };
1002
+ export type UnpublishAiAgentVersionMutationVariables = Exact<{
1003
+ input: AiAgentVersionRefInput;
1004
+ }>;
1005
+ export type UnpublishAiAgentVersionMutation = {
1006
+ unpublishAiAgentVersion: Array<AiAgentVersionFragment>;
1007
+ };
1008
+ export type RollbackAiAgentVersionMutationVariables = Exact<{
1009
+ input: AiAgentVersionRefInput;
1010
+ }>;
1011
+ export type RollbackAiAgentVersionMutation = {
1012
+ rollbackAiAgentVersion: Array<AiAgentVersionFragment>;
1013
+ };
1014
+ export type RemoveAiAgentVersionMutationVariables = Exact<{
1015
+ input: AiAgentVersionRefInput;
1016
+ }>;
1017
+ export type RemoveAiAgentVersionMutation = {
1018
+ removeAiAgentVersion: Array<AiAgentVersionFragment>;
1019
+ };
1020
+ export type RemoveAiAgentMutationVariables = Exact<{
1021
+ input: AiAgentRefInput;
1022
+ }>;
1023
+ export type RemoveAiAgentMutation = Pick<Mutation, 'removeAiAgent'>;
364
1024
  export type ExtractImageMetadataMutationVariables = Exact<{
365
1025
  input: ExtractImageMetadataInput;
366
1026
  }>;
@@ -450,8 +1110,20 @@ export type RemoveQnAInstanceMutationVariables = Exact<{
450
1110
  export type RemoveQnAInstanceMutation = {
451
1111
  removeQnAInstance?: Maybe<QnaFragmentFragment>;
452
1112
  };
1113
+ export declare const AiAgentSummaryFragmentDoc = "\n fragment aiAgentSummary on AiAgentSummary {\n agentId\n name\n liveVersion\n channels\n updatedAt\n queuedApprovals\n status\n}\n ";
1114
+ export declare const AiAgentVersionFragmentDoc = "\n fragment aiAgentVersion on AiAgentVersion {\n agentId\n version\n status\n createdAt\n}\n ";
1115
+ export declare const AiAgentListingMetricsFragmentDoc = "\n fragment aiAgentListingMetrics on AiAgentMetrics {\n agentId\n conversations\n conversationsResolved\n conversationsHandoffRequested\n resolutionRate\n resolutionDefinition\n costMicroUsd\n}\n ";
453
1116
  export declare const NlpInstanceFragmentDoc = "\n fragment nlpInstance on NlpInstance {\n id\n name\n drn\n options {\n transition\n samples\n }\n createdAt\n updatedAt\n}\n ";
454
1117
  export declare const QnaFragmentFragmentDoc = "\n fragment qnaFragment on QnAInstance {\n id\n name\n drn\n credentialsId\n tryToReplyOnTransition\n createdAt\n updatedAt\n}\n ";
1118
+ export declare const ListAiAgentsDocument = "\n query listAiAgents {\n listAiAgents {\n ...aiAgentSummary\n }\n}\n \n fragment aiAgentSummary on AiAgentSummary {\n agentId\n name\n liveVersion\n channels\n updatedAt\n queuedApprovals\n status\n}\n ";
1119
+ export declare const ListAiAgentVersionsDocument = "\n query listAiAgentVersions($agentId: ID!) {\n listAiAgentVersions(agentId: $agentId) {\n ...aiAgentVersion\n }\n}\n \n fragment aiAgentVersion on AiAgentVersion {\n agentId\n version\n status\n createdAt\n}\n ";
1120
+ export declare const AiAgentMetricsByAgentDocument = "\n query aiAgentMetricsByAgent($input: AiAgentMetricsWindowInput!) {\n aiAgentMetricsByAgent(input: $input) {\n ...aiAgentListingMetrics\n }\n}\n \n fragment aiAgentListingMetrics on AiAgentMetrics {\n agentId\n conversations\n conversationsResolved\n conversationsHandoffRequested\n resolutionRate\n resolutionDefinition\n costMicroUsd\n}\n ";
1121
+ export declare const DraftAiAgentDocument = "\n mutation draftAiAgent($input: DraftAiAgentInput!) {\n draftAiAgent(input: $input) {\n ...aiAgentVersion\n }\n}\n \n fragment aiAgentVersion on AiAgentVersion {\n agentId\n version\n status\n createdAt\n}\n ";
1122
+ export declare const PublishAiAgentVersionDocument = "\n mutation publishAiAgentVersion($input: AiAgentVersionRefInput!) {\n publishAiAgentVersion(input: $input) {\n ...aiAgentVersion\n }\n}\n \n fragment aiAgentVersion on AiAgentVersion {\n agentId\n version\n status\n createdAt\n}\n ";
1123
+ export declare const UnpublishAiAgentVersionDocument = "\n mutation unpublishAiAgentVersion($input: AiAgentVersionRefInput!) {\n unpublishAiAgentVersion(input: $input) {\n ...aiAgentVersion\n }\n}\n \n fragment aiAgentVersion on AiAgentVersion {\n agentId\n version\n status\n createdAt\n}\n ";
1124
+ export declare const RollbackAiAgentVersionDocument = "\n mutation rollbackAiAgentVersion($input: AiAgentVersionRefInput!) {\n rollbackAiAgentVersion(input: $input) {\n ...aiAgentVersion\n }\n}\n \n fragment aiAgentVersion on AiAgentVersion {\n agentId\n version\n status\n createdAt\n}\n ";
1125
+ export declare const RemoveAiAgentVersionDocument = "\n mutation removeAiAgentVersion($input: AiAgentVersionRefInput!) {\n removeAiAgentVersion(input: $input) {\n ...aiAgentVersion\n }\n}\n \n fragment aiAgentVersion on AiAgentVersion {\n agentId\n version\n status\n createdAt\n}\n ";
1126
+ export declare const RemoveAiAgentDocument = "\n mutation removeAiAgent($input: AiAgentRefInput!) {\n removeAiAgent(input: $input)\n}\n ";
455
1127
  export declare const ExtractImageMetadataDocument = "\n mutation extractImageMetadata($input: ExtractImageMetadataInput!) {\n extractImageMetadata(input: $input) {\n success\n model\n extractedMetadata\n tokenUsage {\n prompt\n completion\n total\n }\n }\n}\n ";
456
1128
  export declare const GetNlpInstanceDocument = "\n query getNlpInstance($id: ID!) {\n getNlpInstance(id: $id) {\n ...nlpInstance\n }\n}\n \n fragment nlpInstance on NlpInstance {\n id\n name\n drn\n options {\n transition\n samples\n }\n createdAt\n updatedAt\n}\n ";
457
1129
  export declare const ListNlpInstancesDocument = "\n query listNlpInstances {\n listNlpInstances {\n ...nlpInstance\n }\n}\n \n fragment nlpInstance on NlpInstance {\n id\n name\n drn\n options {\n transition\n samples\n }\n createdAt\n updatedAt\n}\n ";
@@ -467,6 +1139,15 @@ export declare const UpdateQnAInstanceDocument = "\n mutation updateQnAInstan
467
1139
  export declare const RemoveQnAInstanceDocument = "\n mutation removeQnAInstance($input: RemoveQnAInstanceInput!) {\n removeQnAInstance(input: $input) {\n ...qnaFragment\n }\n}\n \n fragment qnaFragment on QnAInstance {\n id\n name\n drn\n credentialsId\n tryToReplyOnTransition\n createdAt\n updatedAt\n}\n ";
468
1140
  export type Requester<C = {}> = <R, V>(doc: string, vars?: V, options?: C) => Promise<R> | AsyncIterableIterator<R>;
469
1141
  export declare function getSdk<C>(requester: Requester<C>): {
1142
+ listAiAgents(variables?: ListAiAgentsQueryVariables, options?: C): Promise<ListAiAgentsQuery>;
1143
+ listAiAgentVersions(variables: ListAiAgentVersionsQueryVariables, options?: C): Promise<ListAiAgentVersionsQuery>;
1144
+ aiAgentMetricsByAgent(variables: AiAgentMetricsByAgentQueryVariables, options?: C): Promise<AiAgentMetricsByAgentQuery>;
1145
+ draftAiAgent(variables: DraftAiAgentMutationVariables, options?: C): Promise<DraftAiAgentMutation>;
1146
+ publishAiAgentVersion(variables: PublishAiAgentVersionMutationVariables, options?: C): Promise<PublishAiAgentVersionMutation>;
1147
+ unpublishAiAgentVersion(variables: UnpublishAiAgentVersionMutationVariables, options?: C): Promise<UnpublishAiAgentVersionMutation>;
1148
+ rollbackAiAgentVersion(variables: RollbackAiAgentVersionMutationVariables, options?: C): Promise<RollbackAiAgentVersionMutation>;
1149
+ removeAiAgentVersion(variables: RemoveAiAgentVersionMutationVariables, options?: C): Promise<RemoveAiAgentVersionMutation>;
1150
+ removeAiAgent(variables: RemoveAiAgentMutationVariables, options?: C): Promise<RemoveAiAgentMutation>;
470
1151
  extractImageMetadata(variables: ExtractImageMetadataMutationVariables, options?: C): Promise<ExtractImageMetadataMutation>;
471
1152
  getNlpInstance(variables: GetNlpInstanceQueryVariables, options?: C): Promise<GetNlpInstanceQuery>;
472
1153
  listNlpInstances(variables?: ListNlpInstancesQueryVariables, options?: C): Promise<ListNlpInstancesQuery>;
package/src/sdks/ai.js CHANGED
@@ -1,14 +1,26 @@
1
1
  "use strict";
2
2
  /* istanbul ignore file */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.serviceName = exports.RemoveQnAInstanceDocument = exports.UpdateQnAInstanceDocument = exports.CreateQnAInstanceDocument = exports.TestQnAInstanceDocument = exports.ListQnAInstancesDocument = exports.GetQnAInstanceDocument = exports.TestNlpInstanceDocument = exports.RemoveNlpInstanceDocument = exports.UpdateNlpInstanceDocument = exports.CreateNlpInstanceDocument = exports.ListNlpInstancesDocument = exports.GetNlpInstanceDocument = exports.ExtractImageMetadataDocument = exports.QnaFragmentFragmentDoc = exports.NlpInstanceFragmentDoc = exports.Typenames = exports.Can = exports.AppInstanceStatus = void 0;
4
+ exports.serviceName = exports.RemoveQnAInstanceDocument = exports.UpdateQnAInstanceDocument = exports.CreateQnAInstanceDocument = exports.TestQnAInstanceDocument = exports.ListQnAInstancesDocument = exports.GetQnAInstanceDocument = exports.TestNlpInstanceDocument = exports.RemoveNlpInstanceDocument = exports.UpdateNlpInstanceDocument = exports.CreateNlpInstanceDocument = exports.ListNlpInstancesDocument = exports.GetNlpInstanceDocument = exports.ExtractImageMetadataDocument = exports.RemoveAiAgentDocument = exports.RemoveAiAgentVersionDocument = exports.RollbackAiAgentVersionDocument = exports.UnpublishAiAgentVersionDocument = exports.PublishAiAgentVersionDocument = exports.DraftAiAgentDocument = exports.AiAgentMetricsByAgentDocument = exports.ListAiAgentVersionsDocument = exports.ListAiAgentsDocument = exports.QnaFragmentFragmentDoc = exports.NlpInstanceFragmentDoc = exports.AiAgentListingMetricsFragmentDoc = exports.AiAgentVersionFragmentDoc = exports.AiAgentSummaryFragmentDoc = exports.Typenames = exports.ToolParameterType = exports.ToolEffect = exports.ToolAvailability = exports.TonePreset = exports.ParameterGrounding = exports.Can = exports.BudgetExceededAction = exports.AppInstanceStatus = exports.AiAgentVersionStatus = void 0;
5
5
  exports.getSdk = getSdk;
6
+ var AiAgentVersionStatus;
7
+ (function (AiAgentVersionStatus) {
8
+ AiAgentVersionStatus["Draft"] = "draft";
9
+ AiAgentVersionStatus["Live"] = "live";
10
+ AiAgentVersionStatus["Published"] = "published";
11
+ AiAgentVersionStatus["Removed"] = "removed";
12
+ })(AiAgentVersionStatus || (exports.AiAgentVersionStatus = AiAgentVersionStatus = {}));
6
13
  var AppInstanceStatus;
7
14
  (function (AppInstanceStatus) {
8
15
  AppInstanceStatus["Active"] = "Active";
9
16
  AppInstanceStatus["Failing"] = "Failing";
10
17
  AppInstanceStatus["Inactive"] = "Inactive";
11
18
  })(AppInstanceStatus || (exports.AppInstanceStatus = AppInstanceStatus = {}));
19
+ var BudgetExceededAction;
20
+ (function (BudgetExceededAction) {
21
+ BudgetExceededAction["EndWithNotice"] = "end_with_notice";
22
+ BudgetExceededAction["TransferToHuman"] = "transfer_to_human";
23
+ })(BudgetExceededAction || (exports.BudgetExceededAction = BudgetExceededAction = {}));
12
24
  var Can;
13
25
  (function (Can) {
14
26
  Can["Manage"] = "manage";
@@ -16,8 +28,47 @@ var Can;
16
28
  Can["Remove"] = "remove";
17
29
  Can["Write"] = "write";
18
30
  })(Can || (exports.Can = Can = {}));
31
+ var ParameterGrounding;
32
+ (function (ParameterGrounding) {
33
+ ParameterGrounding["Free"] = "free";
34
+ ParameterGrounding["Required"] = "required";
35
+ })(ParameterGrounding || (exports.ParameterGrounding = ParameterGrounding = {}));
36
+ var TonePreset;
37
+ (function (TonePreset) {
38
+ TonePreset["Cordial"] = "cordial";
39
+ TonePreset["Descontraido"] = "descontraido";
40
+ TonePreset["Direto"] = "direto";
41
+ TonePreset["Formal"] = "formal";
42
+ TonePreset["Tecnico"] = "tecnico";
43
+ })(TonePreset || (exports.TonePreset = TonePreset = {}));
44
+ var ToolAvailability;
45
+ (function (ToolAvailability) {
46
+ ToolAvailability["Available"] = "available";
47
+ ToolAvailability["Unavailable"] = "unavailable";
48
+ })(ToolAvailability || (exports.ToolAvailability = ToolAvailability = {}));
49
+ var ToolEffect;
50
+ (function (ToolEffect) {
51
+ ToolEffect["Read"] = "read";
52
+ ToolEffect["Write"] = "write";
53
+ })(ToolEffect || (exports.ToolEffect = ToolEffect = {}));
54
+ var ToolParameterType;
55
+ (function (ToolParameterType) {
56
+ ToolParameterType["Boolean"] = "boolean";
57
+ ToolParameterType["Number"] = "number";
58
+ ToolParameterType["String"] = "string";
59
+ })(ToolParameterType || (exports.ToolParameterType = ToolParameterType = {}));
19
60
  var Typenames;
20
61
  (function (Typenames) {
62
+ Typenames["AiAgentApproval"] = "AiAgentApproval";
63
+ Typenames["AiAgentEvalReport"] = "AiAgentEvalReport";
64
+ Typenames["AiAgentProcedure"] = "AiAgentProcedure";
65
+ Typenames["AiAgentRetentionPolicy"] = "AiAgentRetentionPolicy";
66
+ Typenames["AiAgentScenario"] = "AiAgentScenario";
67
+ Typenames["AiAgentSession"] = "AiAgentSession";
68
+ Typenames["AiAgentTool"] = "AiAgentTool";
69
+ Typenames["AiAgentTrace"] = "AiAgentTrace";
70
+ Typenames["AiAgentUseCase"] = "AiAgentUseCase";
71
+ Typenames["AiAgentVersion"] = "AiAgentVersion";
21
72
  Typenames["Any"] = "Any";
22
73
  Typenames["GraphqlConnections"] = "GraphqlConnections";
23
74
  Typenames["GraphqlSubscriptions"] = "GraphqlSubscriptions";
@@ -25,6 +76,36 @@ var Typenames;
25
76
  Typenames["NlpEmbeddings"] = "NlpEmbeddings";
26
77
  Typenames["QnA"] = "QnA";
27
78
  })(Typenames || (exports.Typenames = Typenames = {}));
79
+ exports.AiAgentSummaryFragmentDoc = `
80
+ fragment aiAgentSummary on AiAgentSummary {
81
+ agentId
82
+ name
83
+ liveVersion
84
+ channels
85
+ updatedAt
86
+ queuedApprovals
87
+ status
88
+ }
89
+ `;
90
+ exports.AiAgentVersionFragmentDoc = `
91
+ fragment aiAgentVersion on AiAgentVersion {
92
+ agentId
93
+ version
94
+ status
95
+ createdAt
96
+ }
97
+ `;
98
+ exports.AiAgentListingMetricsFragmentDoc = `
99
+ fragment aiAgentListingMetrics on AiAgentMetrics {
100
+ agentId
101
+ conversations
102
+ conversationsResolved
103
+ conversationsHandoffRequested
104
+ resolutionRate
105
+ resolutionDefinition
106
+ costMicroUsd
107
+ }
108
+ `;
28
109
  exports.NlpInstanceFragmentDoc = `
29
110
  fragment nlpInstance on NlpInstance {
30
111
  id
@@ -49,6 +130,67 @@ exports.QnaFragmentFragmentDoc = `
49
130
  updatedAt
50
131
  }
51
132
  `;
133
+ exports.ListAiAgentsDocument = `
134
+ query listAiAgents {
135
+ listAiAgents {
136
+ ...aiAgentSummary
137
+ }
138
+ }
139
+ ${exports.AiAgentSummaryFragmentDoc}`;
140
+ exports.ListAiAgentVersionsDocument = `
141
+ query listAiAgentVersions($agentId: ID!) {
142
+ listAiAgentVersions(agentId: $agentId) {
143
+ ...aiAgentVersion
144
+ }
145
+ }
146
+ ${exports.AiAgentVersionFragmentDoc}`;
147
+ exports.AiAgentMetricsByAgentDocument = `
148
+ query aiAgentMetricsByAgent($input: AiAgentMetricsWindowInput!) {
149
+ aiAgentMetricsByAgent(input: $input) {
150
+ ...aiAgentListingMetrics
151
+ }
152
+ }
153
+ ${exports.AiAgentListingMetricsFragmentDoc}`;
154
+ exports.DraftAiAgentDocument = `
155
+ mutation draftAiAgent($input: DraftAiAgentInput!) {
156
+ draftAiAgent(input: $input) {
157
+ ...aiAgentVersion
158
+ }
159
+ }
160
+ ${exports.AiAgentVersionFragmentDoc}`;
161
+ exports.PublishAiAgentVersionDocument = `
162
+ mutation publishAiAgentVersion($input: AiAgentVersionRefInput!) {
163
+ publishAiAgentVersion(input: $input) {
164
+ ...aiAgentVersion
165
+ }
166
+ }
167
+ ${exports.AiAgentVersionFragmentDoc}`;
168
+ exports.UnpublishAiAgentVersionDocument = `
169
+ mutation unpublishAiAgentVersion($input: AiAgentVersionRefInput!) {
170
+ unpublishAiAgentVersion(input: $input) {
171
+ ...aiAgentVersion
172
+ }
173
+ }
174
+ ${exports.AiAgentVersionFragmentDoc}`;
175
+ exports.RollbackAiAgentVersionDocument = `
176
+ mutation rollbackAiAgentVersion($input: AiAgentVersionRefInput!) {
177
+ rollbackAiAgentVersion(input: $input) {
178
+ ...aiAgentVersion
179
+ }
180
+ }
181
+ ${exports.AiAgentVersionFragmentDoc}`;
182
+ exports.RemoveAiAgentVersionDocument = `
183
+ mutation removeAiAgentVersion($input: AiAgentVersionRefInput!) {
184
+ removeAiAgentVersion(input: $input) {
185
+ ...aiAgentVersion
186
+ }
187
+ }
188
+ ${exports.AiAgentVersionFragmentDoc}`;
189
+ exports.RemoveAiAgentDocument = `
190
+ mutation removeAiAgent($input: AiAgentRefInput!) {
191
+ removeAiAgent(input: $input)
192
+ }
193
+ `;
52
194
  exports.ExtractImageMetadataDocument = `
53
195
  mutation extractImageMetadata($input: ExtractImageMetadataInput!) {
54
196
  extractImageMetadata(input: $input) {
@@ -156,6 +298,33 @@ exports.RemoveQnAInstanceDocument = `
156
298
  ${exports.QnaFragmentFragmentDoc}`;
157
299
  function getSdk(requester) {
158
300
  return {
301
+ listAiAgents(variables, options) {
302
+ return requester(exports.ListAiAgentsDocument, variables, options);
303
+ },
304
+ listAiAgentVersions(variables, options) {
305
+ return requester(exports.ListAiAgentVersionsDocument, variables, options);
306
+ },
307
+ aiAgentMetricsByAgent(variables, options) {
308
+ return requester(exports.AiAgentMetricsByAgentDocument, variables, options);
309
+ },
310
+ draftAiAgent(variables, options) {
311
+ return requester(exports.DraftAiAgentDocument, variables, options);
312
+ },
313
+ publishAiAgentVersion(variables, options) {
314
+ return requester(exports.PublishAiAgentVersionDocument, variables, options);
315
+ },
316
+ unpublishAiAgentVersion(variables, options) {
317
+ return requester(exports.UnpublishAiAgentVersionDocument, variables, options);
318
+ },
319
+ rollbackAiAgentVersion(variables, options) {
320
+ return requester(exports.RollbackAiAgentVersionDocument, variables, options);
321
+ },
322
+ removeAiAgentVersion(variables, options) {
323
+ return requester(exports.RemoveAiAgentVersionDocument, variables, options);
324
+ },
325
+ removeAiAgent(variables, options) {
326
+ return requester(exports.RemoveAiAgentDocument, variables, options);
327
+ },
159
328
  extractImageMetadata(variables, options) {
160
329
  return requester(exports.ExtractImageMetadataDocument, variables, options);
161
330
  },