@arbol-ai/sdk 5.23.0 → 5.25.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.
@@ -2,4 +2,4 @@ export { ApiError } from "../../_/index.js";
2
2
  export type { RequestOptions } from "../../_/index.js";
3
3
  export { createClient } from "./client.js";
4
4
  export type { Client, ClientOptions, LookupRequest, LookupResponse, } from "./client.js";
5
- export type { AccountColombiaLookupPresentation, AccountColombiaLookupPresentationResponse, AccountColombiaResourceEnvelope, AccountConsultIncludedRecordBody, } from "./models.js";
5
+ export type { AccountColombiaLookupPresentation, AccountColombiaLookupPresentationResponse, AccountColombiaResourceEnvelope, AccountConsultIncludedRecordBody, AccountSisbenClassification, } from "./models.js";
@@ -1,4 +1,4 @@
1
- import { type ResponseMetadata, type SisbenClassification } from "../../models.js";
1
+ import type { ResponseMetadata } from "../../models.js";
2
2
  export type AccountColombiaLookupPresentation = AccountColombiaResourceEnvelope | {
3
3
  text: string;
4
4
  };
@@ -15,7 +15,7 @@ export interface AccountColombiaLookupPresentationResponse {
15
15
  success: true;
16
16
  }
17
17
  export interface AccountColombiaResourceEnvelope {
18
- result: string | SisbenClassification;
18
+ result: string | AccountSisbenClassification;
19
19
  }
20
20
  export type AccountConsultIncludedRecordBody = {
21
21
  agentMode?: boolean;
@@ -25,5 +25,49 @@ export type AccountConsultIncludedRecordBody = {
25
25
  } & {
26
26
  integration?: "policia-colombia";
27
27
  };
28
+ export type AccountSisbenClassification = {
29
+ group: "A";
30
+ observedAt: Temporal.Instant;
31
+ registered: true;
32
+ source: "DNP-SISBEN-IV";
33
+ subgroup: string | null;
34
+ verification: "source_report" | "last_known";
35
+ } | {
36
+ group: "B";
37
+ observedAt: Temporal.Instant;
38
+ registered: true;
39
+ source: "DNP-SISBEN-IV";
40
+ subgroup: string | null;
41
+ verification: "source_report" | "last_known";
42
+ } | {
43
+ group: "C";
44
+ observedAt: Temporal.Instant;
45
+ registered: true;
46
+ source: "DNP-SISBEN-IV";
47
+ subgroup: string | null;
48
+ verification: "source_report" | "last_known";
49
+ } | {
50
+ group: "D";
51
+ observedAt: Temporal.Instant;
52
+ registered: true;
53
+ source: "DNP-SISBEN-IV";
54
+ subgroup: string | null;
55
+ verification: "source_report" | "last_known";
56
+ } | {
57
+ group: null;
58
+ observedAt: Temporal.Instant;
59
+ registered: false;
60
+ source: "DNP-SISBEN-IV";
61
+ subgroup: null;
62
+ verification: "source_report" | "last_known";
63
+ } | {
64
+ group: null;
65
+ observedAt: null;
66
+ registered: null;
67
+ source: "DNP-SISBEN-IV";
68
+ subgroup: null;
69
+ verification: "unavailable" | "unsupported_document";
70
+ };
28
71
  export declare const AccountColombiaLookupPresentationResponseCodec: import("../../_/codec.js").Codec;
29
72
  export declare const AccountColombiaResourceEnvelopeCodec: import("../../_/codec.js").Codec;
73
+ export declare const AccountSisbenClassificationCodec: import("../../_/codec.js").Codec;
@@ -1,10 +1,10 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
- import { object } from "../../_/index.js";
4
- import { SisbenClassificationCodec, } from "../../models.js";
3
+ import { instant, object, union } from "../../_/index.js";
5
4
  export const AccountColombiaLookupPresentationResponseCodec = object([
6
5
  ["data", null, () => AccountColombiaResourceEnvelopeCodec],
7
6
  ]);
8
7
  export const AccountColombiaResourceEnvelopeCodec = object([
9
- ["result", null, () => SisbenClassificationCodec],
8
+ ["result", null, () => AccountSisbenClassificationCodec],
10
9
  ]);
10
+ export const AccountSisbenClassificationCodec = union([object([["observedAt", null, instant]]), object([["observedAt", null, instant]]), object([["observedAt", null, instant]]), object([["observedAt", null, instant]]), object([["observedAt", null, instant]])]);
@@ -1,4 +1,4 @@
1
- import { type ResponseMetadata, type SisbenClassification } from "../../models.js";
1
+ import type { ResponseMetadata } from "../../models.js";
2
2
  export type AdresAffiliationPresentation = {
3
3
  affiliations: {
4
4
  affiliateType: string | null;
@@ -31,11 +31,6 @@ export type AdresAffiliationPresentation = {
31
31
  value: string;
32
32
  }[];
33
33
  };
34
- sisben: {
35
- official: SisbenClassification;
36
- status: "reported" | "explicitly_absent" | "not_reported";
37
- value: string | null;
38
- };
39
34
  source: string;
40
35
  verification: "source_report" | "last_known";
41
36
  } | {
@@ -57,11 +52,6 @@ export type AdresAffiliationPresentation = {
57
52
  countryCode: "CO";
58
53
  outcome: "not_found";
59
54
  person: null;
60
- sisben: {
61
- official: SisbenClassification;
62
- status: "reported" | "explicitly_absent" | "not_reported";
63
- value: string | null;
64
- };
65
55
  source: string;
66
56
  verification: "source_report" | "last_known";
67
57
  } | {
@@ -1,8 +1,7 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
3
  import { array, date, instant, object, union } from "../../_/index.js";
4
- import { SisbenClassificationCodec, } from "../../models.js";
5
- export const AdresAffiliationPresentationCodec = union([object([["affiliations", null, array(object([["from", null, date], ["to", null, date]]))], ["consultedAt", null, instant], ["person", null, object([["birthDate", null, date]])], ["sisben", null, object([["official", null, () => SisbenClassificationCodec]])]]), object([["affiliations", null, array(object([["from", null, date], ["to", null, date]]))], ["consultedAt", null, instant], ["sisben", null, object([["official", null, () => SisbenClassificationCodec]])]])]);
4
+ export const AdresAffiliationPresentationCodec = union([object([["affiliations", null, array(object([["from", null, date], ["to", null, date]]))], ["consultedAt", null, instant], ["person", null, object([["birthDate", null, date]])]]), object([["affiliations", null, array(object([["from", null, date], ["to", null, date]]))], ["consultedAt", null, instant]])]);
6
5
  export const AdresAffiliationPresentationResponseCodec = object([
7
6
  ["data", null, () => AdresAffiliationPresentationCodec],
8
7
  ]);
package/dist/index.d.ts CHANGED
@@ -2,4 +2,4 @@ export { ApiError } from "./_/index.js";
2
2
  export type { RequestOptions } from "./_/index.js";
3
3
  export { createClient } from "./client.js";
4
4
  export type { Client, ClientOptions, } from "./client.js";
5
- export type { AvailabilityBookingInput, CancelAppointmentBadGatewayError, CancelAppointmentBadGatewayFailure, Connection, ConnectionNotConfiguredFailure, ConnectionNotFoundError, ConnectionNotFoundFailure, ConnectionPage, ConnectionPageResponse, ConnectionResponse, CreateAppointmentBadGatewayError, CreateAppointmentBadGatewayFailure, CredentialsRejectedError, CredentialsRejectedFailure, DeletedObject, DeletedObjectResponse, Empty, Failure, ForbiddenError, ForbiddenFailure, InternalError, InternalFailure, InvalidInputError, InvalidInputFailure, InvalidInputFailureData, ListAvailabilityUnprocessableContentError, ListAvailabilityUnprocessableContentFailure, ListContractsBadGatewayError, ListContractsBadGatewayFailure, ListContractsUnprocessableContentError, ListContractsUnprocessableContentFailure, ListServicesBadGatewayError, ListServicesBadGatewayFailure, ListServicesUnprocessableContentError, ListServicesUnprocessableContentFailure, LookupPatientBadGatewayError, LookupPatientBadGatewayFailure, OutcomeUnknownError, OutcomeUnknownFailure, PageInfo, ProviderUnavailableFailure, RateLimitedError, RateLimitedFailure, RequestTooLargeError, RequestTooLargeFailure, ResponseMetadata, SisbenClassification, ToolRefusedFailure, ToolRefusedFailureData, ToolResult, ToolResultResponse, UnauthorizedError, UnauthorizedFailure, UnsupportedMediaTypeError, UnsupportedMediaTypeFailure, UpstreamTimeoutError, UpstreamTimeoutFailure, UpstreamUnavailableError, UpstreamUnavailableFailure, ValidationIssue, VerifyConnectionResult, VerifyConnectionResultResponse, } from "./models.js";
5
+ export type { AvailabilityBookingInput, CancelAppointmentBadGatewayError, CancelAppointmentBadGatewayFailure, Connection, ConnectionNotConfiguredFailure, ConnectionNotFoundError, ConnectionNotFoundFailure, ConnectionPage, ConnectionPageResponse, ConnectionResponse, CreateAppointmentBadGatewayError, CreateAppointmentBadGatewayFailure, CredentialsRejectedError, CredentialsRejectedFailure, DeletedObject, DeletedObjectResponse, Empty, Failure, ForbiddenError, ForbiddenFailure, InternalError, InternalFailure, InvalidInputError, InvalidInputFailure, InvalidInputFailureData, ListAvailabilityUnprocessableContentError, ListAvailabilityUnprocessableContentFailure, ListContractsBadGatewayError, ListContractsBadGatewayFailure, ListContractsUnprocessableContentError, ListContractsUnprocessableContentFailure, ListServicesBadGatewayError, ListServicesBadGatewayFailure, ListServicesUnprocessableContentError, ListServicesUnprocessableContentFailure, LookupPatientBadGatewayError, LookupPatientBadGatewayFailure, OutcomeUnknownError, OutcomeUnknownFailure, PageInfo, ProviderUnavailableFailure, RateLimitedError, RateLimitedFailure, RequestTooLargeError, RequestTooLargeFailure, ResponseMetadata, ToolRefusedFailure, ToolRefusedFailureData, ToolResult, ToolResultResponse, UnauthorizedError, UnauthorizedFailure, UnsupportedMediaTypeError, UnsupportedMediaTypeFailure, UpstreamTimeoutError, UpstreamTimeoutFailure, UpstreamUnavailableError, UpstreamUnavailableFailure, ValidationIssue, VerifyConnectionResult, VerifyConnectionResultResponse, } from "./models.js";
package/dist/models.d.ts CHANGED
@@ -583,49 +583,6 @@ export interface ResponseMetadata {
583
583
  */
584
584
  requestId: string;
585
585
  }
586
- export type SisbenClassification = {
587
- group: "A";
588
- observedAt: Temporal.Instant;
589
- registered: true;
590
- source: "DNP-SISBEN-IV";
591
- subgroup: string | null;
592
- verification: "source_report" | "last_known";
593
- } | {
594
- group: "B";
595
- observedAt: Temporal.Instant;
596
- registered: true;
597
- source: "DNP-SISBEN-IV";
598
- subgroup: string | null;
599
- verification: "source_report" | "last_known";
600
- } | {
601
- group: "C";
602
- observedAt: Temporal.Instant;
603
- registered: true;
604
- source: "DNP-SISBEN-IV";
605
- subgroup: string | null;
606
- verification: "source_report" | "last_known";
607
- } | {
608
- group: "D";
609
- observedAt: Temporal.Instant;
610
- registered: true;
611
- source: "DNP-SISBEN-IV";
612
- subgroup: string | null;
613
- verification: "source_report" | "last_known";
614
- } | {
615
- group: null;
616
- observedAt: Temporal.Instant;
617
- registered: false;
618
- source: "DNP-SISBEN-IV";
619
- subgroup: null;
620
- verification: "source_report" | "last_known";
621
- } | {
622
- group: null;
623
- observedAt: null;
624
- registered: null;
625
- source: "DNP-SISBEN-IV";
626
- subgroup: null;
627
- verification: "unavailable" | "unsupported_document";
628
- };
629
586
  /**
630
587
  * The clinic's rules did not answer the request as asked: data.reason says why
631
588
  * and data.guidance what to do next. Nothing was changed.
@@ -866,4 +823,3 @@ export declare const ConnectionCodec: import("./_/codec.js").Codec;
866
823
  export declare const ConnectionPageCodec: import("./_/codec.js").Codec;
867
824
  export declare const ConnectionPageResponseCodec: import("./_/codec.js").Codec;
868
825
  export declare const ConnectionResponseCodec: import("./_/codec.js").Codec;
869
- export declare const SisbenClassificationCodec: import("./_/codec.js").Codec;
package/dist/models.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
- import { array, date, instant, object, union } from "./_/index.js";
3
+ import { array, date, instant, object } from "./_/index.js";
4
4
  export const AvailabilityBookingInputCodec = object([
5
5
  ["date", null, date],
6
6
  ["startsAt", null, instant],
@@ -17,4 +17,3 @@ export const ConnectionPageResponseCodec = object([
17
17
  export const ConnectionResponseCodec = object([
18
18
  ["data", null, () => ConnectionCodec],
19
19
  ]);
20
- export const SisbenClassificationCodec = union([object([["observedAt", null, instant]]), object([["observedAt", null, instant]]), object([["observedAt", null, instant]]), object([["observedAt", null, instant]]), object([["observedAt", null, instant]])]);
@@ -1,23 +1,17 @@
1
1
  import type { ResponseMetadata } from "../../models.js";
2
2
  export type PoliciaColombiaJudicialRecordPresentation = {
3
- arrayName: string[] | null;
4
3
  details: string;
5
4
  documentNumber: string;
6
5
  documentType: "CC" | "CE" | "PA" | "PPT" | "DP";
7
- familyName: string | null;
8
6
  fullName: string | null;
9
- givenName: string | null;
10
7
  identityStatus: "document_matched" | "unverified";
11
- judicialStatus: "no_pending_matters" | "pending_matters" | "in_person_required" | "other_statement";
8
+ judicialStatus: "no_pending_matters" | "not_currently_required" | "pending_matters" | "in_person_required" | "other_statement";
12
9
  observedAt: Temporal.Instant;
13
10
  } | {
14
- arrayName: null;
15
11
  details: null;
16
12
  documentNumber: string;
17
13
  documentType: "CC" | "CE" | "PA" | "PPT" | "DP";
18
- familyName: null;
19
14
  fullName: null;
20
- givenName: null;
21
15
  identityStatus: "unverified";
22
16
  judicialStatus: "unverified";
23
17
  observedAt: null;
@@ -31,7 +31,8 @@ export interface RaizChange {
31
31
  * What changed: `contact`, `contact_point`, `contact_identifier`, `agent`,
32
32
  * `agent_tool` (its id is the Agent's), `channel`, `definition`,
33
33
  * `knowledge_document`, `campaign`, `suppression`, `bulletin`,
34
- * `provider_account`, `fact`, `task` (a person cancelled or retried it).
34
+ * `conversation_view`, `provider_account`, `fact`, `task` (a person cancelled
35
+ * or retried it).
35
36
  */
36
37
  resourceType: string;
37
38
  sourceId: string | null;
@@ -1,6 +1,6 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
- import { type RaizCount, type RaizResponseMetadata, type RaizTask } from "../models.js";
3
- import { type RaizContact, type RaizContactIdentifierInput, type RaizContactPage, type RaizContactPointInput, type RaizPostalAddress } from "./models.js";
2
+ import { type RaizResponseMetadata, type RaizTask } from "../models.js";
3
+ import { type RaizContact, type RaizContactIdentifierInput, type RaizContactPage, type RaizContactPointInput, type RaizCount, type RaizPostalAddress } from "./models.js";
4
4
  export interface ClientOptions extends BaseClientOptions {
5
5
  /**
6
6
  * The URL the paths of the API are relative to.
@@ -2,4 +2,4 @@ export { ApiError } from "../../_/index.js";
2
2
  export type { RequestOptions } from "../../_/index.js";
3
3
  export { createClient } from "./client.js";
4
4
  export type { Client, ClientOptions, CountRequest, CountResponse, CreateRequest, CreateResponse, GetRequest, GetResponse, ImportRequest, ImportResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
- export type { RaizContact, RaizContactIdentifierInput, RaizContactLastConversation, RaizContactPage, RaizContactPointInput, RaizContactTimelinePage, RaizPostalAddress, } from "./models.js";
5
+ export type { RaizContact, RaizContactIdentifierInput, RaizContactLastConversation, RaizContactPage, RaizContactPointInput, RaizContactTimelinePage, RaizCount, RaizPostalAddress, } from "./models.js";
@@ -153,6 +153,16 @@ export interface RaizContactTimelinePage {
153
153
  */
154
154
  pageInfo: PageInfo;
155
155
  }
156
+ export interface RaizCount {
157
+ /**
158
+ * True when the count reached 10000: at least that many match.
159
+ */
160
+ capped: boolean;
161
+ /**
162
+ * How many match the filters, counted up to 10000.
163
+ */
164
+ count: number;
165
+ }
156
166
  export interface RaizPostalAddress {
157
167
  city?: string;
158
168
  /**
@@ -1,7 +1,7 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
2
  import type { DeletedObject } from "../../models.js";
3
- import type { RaizCount, RaizResponseMetadata } from "../models.js";
4
- import { type RaizConversation, type RaizConversationPage } from "./models.js";
3
+ import type { RaizResponseMetadata } from "../models.js";
4
+ import { type RaizConversation, type RaizConversationCount, type RaizConversationPage } from "./models.js";
5
5
  export interface ClientOptions extends BaseClientOptions {
6
6
  /**
7
7
  * The URL the paths of the API are relative to.
@@ -27,9 +27,14 @@ export interface Client {
27
27
  *
28
28
  * Count the conversations `list_conversations` returns for the same filters
29
29
  * (every filter it takes, without `sort`), up to 10,000: `capped` then says
30
- * at least that many match. Use it to answer how many conversations match
31
- * instead of paging through the list; for volumes per day, Agent or outcome
32
- * use `get_report`.
30
+ * at least that many match. `averageMessageCount` is their average length.
31
+ * `groupBy` also divides them, largest group first, each with its outcomes:
32
+ * by `outcome`, `status`, `channel`, `agent`, `sentiment`, `tool` (which
33
+ * Agent tools they used, and in how many a tool failed), `toolError` (why
34
+ * calls of `toolName` failed) or `fact:<definition key>` (such as the reason
35
+ * for contact). Use it to answer how many conversations match, or how they
36
+ * divide, instead of paging through the list; for volumes per day use
37
+ * `get_report`.
33
38
  */
34
39
  count(request?: CountRequest, options?: RequestOptions): Promise<CountResponse>;
35
40
  /**
@@ -60,19 +65,23 @@ export interface Client {
60
65
  *
61
66
  * Find calls, WhatsApp chats and web chats. Filter by `contactId` (as
62
67
  * counterpart or subject), `agentId`, `channelId`, `channelType`, `status`,
63
- * `conversationDirection`, `origin`, `outcome`, `handling` (`ai` or `team`:
64
- * whether the AI takes part; `escalated`: handed to the team by the AI),
65
- * `worker` (`ai` or `team`: who answers it now), `campaignId`, `profileId`,
66
- * `requestedBy` and start time (`startedAfter`, `startedBefore`); `q`
67
- * searches participant identities (names, profile names, usernames, phones,
68
- * emails and documents), visible messages, titles, summaries and exact
69
- * conversation references; `count_conversations` counts every match. Each
70
- * item already carries its title, summary, outcome, sentiment and workers,
71
- * often enough to answer. `sort`: `started` (newest first), `last_message`
72
- * (latest activity first) or `changed`, the feed of status, outcome and
73
- * analysis changes, oldest first, that systems poll from a saved
74
- * `pageInfo.nextCursor` (a deleted conversation appears once with
75
- * `deletedAt`). Next: `get_conversation` for a transcript.
68
+ * `conversationDirection`, `origin`, `outcome`, `sentiment`, `handling` (`ai`
69
+ * or `team`: whether the AI takes part; `escalated`: handed to the team by
70
+ * the AI), `worker` (`ai` or `team`: who answers it now), the Agent's tools
71
+ * (`toolName`, `toolStatus`: which tool it called and how the call ended), a
72
+ * captured fact (`factDefinition`, `factValue`), `assessment` (`failed` or
73
+ * `passed`), length (`messagesMin`, `messagesMax`, `durationMin`,
74
+ * `durationMax`), `campaignId`, `profileId`, `requestedBy` and start time
75
+ * (`startedAfter`, `startedBefore`); `q` searches participant identities
76
+ * (names, profile names, usernames, phones, emails and documents), visible
77
+ * messages, titles, summaries and exact conversation references;
78
+ * `count_conversations` counts every match. Each item already carries its
79
+ * title, summary, outcome, sentiment, workers and tool calls (how many, how
80
+ * many failed, the latest failure), often enough to answer. `sort`: `started`
81
+ * (newest first), `last_message` (latest activity first) or `changed`, the
82
+ * feed of status, outcome and analysis changes, oldest first, that systems
83
+ * poll from a saved `pageInfo.nextCursor` (a deleted conversation appears
84
+ * once with `deletedAt`). Next: `get_conversation` for a transcript.
76
85
  */
77
86
  list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
78
87
  /**
@@ -201,9 +210,63 @@ export interface CountRequest {
201
210
  */
202
211
  startedBefore?: Temporal.Instant;
203
212
  status?: "open" | "closed";
213
+ /**
214
+ * Comma-separated sentiments of the analysis.
215
+ */
216
+ sentiment?: string;
217
+ /**
218
+ * Conversations where the Agent called this tool: its exact name, as the
219
+ * transcript's tool parts show it (`toolName`). `count_conversations` with
220
+ * `groupBy=tool` lists the names with how many conversations used each.
221
+ */
222
+ toolName?: string;
223
+ /**
224
+ * With `toolName`, a call of that tool ended this way; alone, a call of any
225
+ * tool did (`failed`: conversations where a tool failed).
226
+ */
227
+ toolStatus?: "completed" | "failed" | "denied";
228
+ /**
229
+ * Conversations whose current fact of this definition (its `key`) is known:
230
+ * about the conversation, or about its contact for a contact definition. With
231
+ * `factValue`, equal to that value.
232
+ */
233
+ factDefinition?: string;
234
+ /**
235
+ * With `factDefinition`: an option's key or label, a text (ignoring case), a
236
+ * number, a date (YYYY-MM-DD) or `true`/`false`.
237
+ */
238
+ factValue?: string;
239
+ /**
240
+ * The conversation's yes/no assessments: `failed`, at least one answered no;
241
+ * `passed`, at least one answered and every answered one yes.
242
+ */
243
+ assessment?: "failed" | "passed";
244
+ /**
245
+ * At least this many messages.
246
+ */
247
+ messagesMin?: number;
248
+ /**
249
+ * At most this many messages.
250
+ */
251
+ messagesMax?: number;
252
+ /**
253
+ * Calls of at least this many seconds.
254
+ */
255
+ durationMin?: number;
256
+ /**
257
+ * Calls of at most this many seconds.
258
+ */
259
+ durationMax?: number;
260
+ /**
261
+ * `outcome`, `status`, `channel` (type), `agent`, `sentiment`, `tool` (each
262
+ * Agent tool and the conversations that used it), `toolError` (failed calls,
263
+ * of `toolName` when given, by error) or `fact:<definition key>` (the current
264
+ * value of that definition, such as the reason for contact).
265
+ */
266
+ groupBy?: string;
204
267
  }
205
268
  export interface CountResponse {
206
- data: RaizCount;
269
+ data: RaizConversationCount;
207
270
  error: null;
208
271
  metadata: RaizResponseMetadata;
209
272
  success: true;
@@ -356,6 +419,53 @@ export interface ListRequest {
356
419
  */
357
420
  startedBefore?: Temporal.Instant;
358
421
  status?: "open" | "closed";
422
+ /**
423
+ * Comma-separated sentiments of the analysis.
424
+ */
425
+ sentiment?: string;
426
+ /**
427
+ * Conversations where the Agent called this tool: its exact name, as the
428
+ * transcript's tool parts show it (`toolName`). `count_conversations` with
429
+ * `groupBy=tool` lists the names with how many conversations used each.
430
+ */
431
+ toolName?: string;
432
+ /**
433
+ * With `toolName`, a call of that tool ended this way; alone, a call of any
434
+ * tool did (`failed`: conversations where a tool failed).
435
+ */
436
+ toolStatus?: "completed" | "failed" | "denied";
437
+ /**
438
+ * Conversations whose current fact of this definition (its `key`) is known:
439
+ * about the conversation, or about its contact for a contact definition. With
440
+ * `factValue`, equal to that value.
441
+ */
442
+ factDefinition?: string;
443
+ /**
444
+ * With `factDefinition`: an option's key or label, a text (ignoring case), a
445
+ * number, a date (YYYY-MM-DD) or `true`/`false`.
446
+ */
447
+ factValue?: string;
448
+ /**
449
+ * The conversation's yes/no assessments: `failed`, at least one answered no;
450
+ * `passed`, at least one answered and every answered one yes.
451
+ */
452
+ assessment?: "failed" | "passed";
453
+ /**
454
+ * At least this many messages.
455
+ */
456
+ messagesMin?: number;
457
+ /**
458
+ * At most this many messages.
459
+ */
460
+ messagesMax?: number;
461
+ /**
462
+ * Calls of at least this many seconds.
463
+ */
464
+ durationMin?: number;
465
+ /**
466
+ * Calls of at most this many seconds.
467
+ */
468
+ durationMax?: number;
359
469
  /**
360
470
  * `started` (newest first), `last_message` (most recent activity first) or
361
471
  * `changed`: the changed feed, oldest change first, with deleted
@@ -25,7 +25,7 @@ const ContinueOperation = {
25
25
  const CountOperation = {
26
26
  method: "GET",
27
27
  route: "/v1/raiz/conversations/count",
28
- query: { agentId: "agentId", campaignId: "campaignId", channelId: "channelId", channelType: "channelType", contactId: "contactId", conversationDirection: "conversationDirection", handling: "handling", worker: "worker", origin: "origin", outcome: "outcome", metadataReference: "metadataReference", profileId: "profileId", q: "q", requestedBy: "requestedBy", startedAfter: "startedAfter", startedBefore: "startedBefore", status: "status" },
28
+ query: { agentId: "agentId", campaignId: "campaignId", channelId: "channelId", channelType: "channelType", contactId: "contactId", conversationDirection: "conversationDirection", handling: "handling", worker: "worker", origin: "origin", outcome: "outcome", metadataReference: "metadataReference", profileId: "profileId", q: "q", requestedBy: "requestedBy", startedAfter: "startedAfter", startedBefore: "startedBefore", status: "status", sentiment: "sentiment", toolName: "toolName", toolStatus: "toolStatus", factDefinition: "factDefinition", factValue: "factValue", assessment: "assessment", messagesMin: "messagesMin", messagesMax: "messagesMax", durationMin: "durationMin", durationMax: "durationMax", groupBy: "groupBy" },
29
29
  response: null,
30
30
  errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
31
31
  };
@@ -46,7 +46,7 @@ const GetOperation = {
46
46
  const ListOperation = {
47
47
  method: "GET",
48
48
  route: "/v1/raiz/conversations",
49
- query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", campaignId: "campaignId", channelId: "channelId", channelType: "channelType", contactId: "contactId", conversationDirection: "conversationDirection", handling: "handling", worker: "worker", origin: "origin", outcome: "outcome", metadataReference: "metadataReference", profileId: "profileId", q: "q", requestedBy: "requestedBy", startedAfter: "startedAfter", startedBefore: "startedBefore", status: "status", sort: "sort" },
49
+ query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", campaignId: "campaignId", channelId: "channelId", channelType: "channelType", contactId: "contactId", conversationDirection: "conversationDirection", handling: "handling", worker: "worker", origin: "origin", outcome: "outcome", metadataReference: "metadataReference", profileId: "profileId", q: "q", requestedBy: "requestedBy", startedAfter: "startedAfter", startedBefore: "startedBefore", status: "status", sentiment: "sentiment", toolName: "toolName", toolStatus: "toolStatus", factDefinition: "factDefinition", factValue: "factValue", assessment: "assessment", messagesMin: "messagesMin", messagesMax: "messagesMax", durationMin: "durationMin", durationMax: "durationMax", sort: "sort" },
50
50
  response: object([["data", null, () => RaizConversationPageCodec]]),
51
51
  errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
52
52
  };
@@ -2,4 +2,4 @@ export { ApiError } from "../../_/index.js";
2
2
  export type { RequestOptions } from "../../_/index.js";
3
3
  export { createClient } from "./client.js";
4
4
  export type { Client, ClientOptions, ContinueRequest, ContinueResponse, CountRequest, CountResponse, DeleteRequest, DeleteResponse, GetRequest, GetResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
- export type { RaizConversation, RaizConversationDiagnostics, RaizConversationPage, RaizConversationWorker, RaizMessage, RaizMessagePage, RaizSignedUrl, } from "./models.js";
5
+ export type { RaizConversation, RaizConversationCount, RaizConversationDiagnostics, RaizConversationGroup, RaizConversationOutcomeCounts, RaizConversationPage, RaizConversationToolCalls, RaizConversationToolFailure, RaizConversationWorker, RaizMessage, RaizMessagePage, RaizSignedUrl, } from "./models.js";
@@ -100,6 +100,7 @@ export interface RaizConversation {
100
100
  summaryAuthor: "person" | "ai" | "system" | "import" | "provider" | null;
101
101
  title: string | null;
102
102
  titleAuthor: "person" | "ai" | "system" | "import" | "provider" | null;
103
+ toolCalls: RaizConversationToolCalls;
103
104
  /**
104
105
  * An instant in RFC 3339 format, in UTC.
105
106
  */
@@ -114,6 +115,18 @@ export interface RaizConversation {
114
115
  */
115
116
  workers: RaizConversationWorker[];
116
117
  }
118
+ export interface RaizConversationCount {
119
+ averageMessageCount: number | null;
120
+ /**
121
+ * True when the count reached 10000: at least that many match.
122
+ */
123
+ capped: boolean;
124
+ /**
125
+ * How many match the filters, counted up to 10000.
126
+ */
127
+ count: number;
128
+ groups: RaizConversationGroup[] | null;
129
+ }
117
130
  export interface RaizConversationDiagnostics {
118
131
  errorCode: string | null;
119
132
  providerErrorCode: number | null;
@@ -129,6 +142,25 @@ export interface RaizConversationDiagnostics {
129
142
  status: "available" | "unavailable" | "not_recorded" | "not_applicable";
130
143
  terminationReasonPresent: boolean;
131
144
  }
145
+ export interface RaizConversationGroup {
146
+ /**
147
+ * Conversations in the group.
148
+ */
149
+ count: number;
150
+ failed: number | null;
151
+ key: string | null;
152
+ label: string | null;
153
+ outcomes: RaizConversationOutcomeCounts;
154
+ }
155
+ export interface RaizConversationOutcomeCounts {
156
+ failure: number;
157
+ /**
158
+ * Not analyzed yet.
159
+ */
160
+ pending: number;
161
+ success: number;
162
+ unknown: number;
163
+ }
132
164
  export interface RaizConversationPage {
133
165
  /**
134
166
  * Items admitted by this resource contract within the verified organization.
@@ -143,6 +175,22 @@ export interface RaizConversationPage {
143
175
  */
144
176
  pageInfo: PageInfo;
145
177
  }
178
+ export interface RaizConversationToolCalls {
179
+ /**
180
+ * The Agent's tool calls in the conversation.
181
+ */
182
+ count: number;
183
+ /**
184
+ * How many of them failed.
185
+ */
186
+ failed: number;
187
+ lastFailure: RaizConversationToolFailure | null;
188
+ }
189
+ export interface RaizConversationToolFailure {
190
+ errorCode: string | null;
191
+ errorMessage: string | null;
192
+ toolName: string;
193
+ }
146
194
  export type RaizConversationWorker = {
147
195
  agentId: string;
148
196
  answering: boolean;
@@ -2,4 +2,4 @@ export { ApiError } from "../_/index.js";
2
2
  export type { RequestOptions } from "../_/index.js";
3
3
  export { createClient } from "./client.js";
4
4
  export type { Client, ClientOptions, } from "./client.js";
5
- export type { RaizAgentIntegrationProcedureInput, RaizAgentProcedureInput, RaizBusinessHours, RaizBusinessHoursWindow, RaizContactHoursWindow, RaizCount, RaizEmailAddress, RaizFact, RaizFailureResponse, RaizHttpsUrl, RaizOutsideHoursTemplate, RaizPhoneNumber, RaizResponseMetadata, RaizTask, } from "./models.js";
5
+ export type { RaizAgentIntegrationProcedureInput, RaizAgentProcedureInput, RaizBusinessHours, RaizBusinessHoursWindow, RaizContactHoursWindow, RaizEmailAddress, RaizFact, RaizFailureResponse, RaizHttpsUrl, RaizOutsideHoursTemplate, RaizPhoneNumber, RaizResponseMetadata, RaizTask, } from "./models.js";
@@ -245,16 +245,6 @@ export interface RaizContactHoursWindow {
245
245
  */
246
246
  to: string;
247
247
  }
248
- export interface RaizCount {
249
- /**
250
- * True when the count reached 10000: at least that many match.
251
- */
252
- capped: boolean;
253
- /**
254
- * How many match the filters, counted up to 10000.
255
- */
256
- count: number;
257
- }
258
248
  export type RaizEmailAddress = string;
259
249
  export interface RaizFact {
260
250
  /**
@@ -271,6 +261,7 @@ export interface RaizFact {
271
261
  definition: {
272
262
  id: string;
273
263
  key: string;
264
+ kind: "attribute" | "assessment" | "category" | "metric";
274
265
  name: string;
275
266
  valueType: "text" | "number" | "boolean" | "date" | "option";
276
267
  };
@@ -622,6 +613,27 @@ export interface RaizFailureResponse {
622
613
  };
623
614
  message: "This operation or field does not apply to this channel's type.";
624
615
  retryable: false;
616
+ } | {
617
+ code: "CONVERSATION_VIEW_AUTHOR_ONLY";
618
+ data: {
619
+ [key: string]: unknown;
620
+ };
621
+ message: "Only the person who saved this view can make it private; it would disappear for the rest of the team.";
622
+ retryable: false;
623
+ } | {
624
+ code: "CONVERSATION_VIEW_LIMIT_REACHED";
625
+ data: {
626
+ [key: string]: unknown;
627
+ };
628
+ message: "The organization already has 200 saved views. Delete one before saving another.";
629
+ retryable: false;
630
+ } | {
631
+ code: "CONVERSATION_VIEW_NAME_TAKEN";
632
+ data: {
633
+ [key: string]: unknown;
634
+ };
635
+ message: "Another saved view already has this name. Choose a different name.";
636
+ retryable: false;
625
637
  } | {
626
638
  code: "TEMPLATE_HEADER_MISMATCH";
627
639
  data: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbol-ai/sdk",
3
- "version": "5.23.0",
3
+ "version": "5.25.0",
4
4
  "description": "The Arbol API for TypeScript and JavaScript, generated by Cloudflare Forge from the platform's public OpenAPI.",
5
5
  "keywords": [
6
6
  "arbol",
@@ -57,8 +57,8 @@
57
57
  "packageManager": "bun@1.4.3",
58
58
  "arbol": {
59
59
  "openapi": {
60
- "release": "1.20261101.42905",
61
- "sha256": "f4cc346e1a7389c2e8490ad863d667107f9721408ed856db98fa2130d6bbd6bb"
60
+ "release": "1.20261101.70110",
61
+ "sha256": "4e788d1263f27e67611185e5a290fc8c4c9d3c287f417a7bb8decd8e78ce32a6"
62
62
  }
63
63
  }
64
64
  }