@arbol-ai/sdk 5.58.0 → 5.59.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.
@@ -35,7 +35,7 @@ export interface AccountConnection {
35
35
  }[];
36
36
  name: string;
37
37
  /**
38
- * The independent portal this account connects to.
38
+ * Which of the provider's independent sites this connection reaches.
39
39
  */
40
40
  portal?: string;
41
41
  /**
@@ -383,6 +383,7 @@ export interface RaizAgentSettings {
383
383
  } | null;
384
384
  replyChoices: boolean | null;
385
385
  sessionCloseAfterMinutes: number | null;
386
+ teamCloseAfterMinutes: number | null;
386
387
  temperature: number | null;
387
388
  toolDiscovery: boolean | null;
388
389
  voice: RaizAgentVoiceSettings | null;
@@ -427,6 +428,7 @@ export interface RaizAgentSettingsInput {
427
428
  } | null;
428
429
  replyChoices?: boolean | null;
429
430
  sessionCloseAfterMinutes?: number | null;
431
+ teamCloseAfterMinutes?: number | null;
430
432
  temperature?: number | null;
431
433
  toolDiscovery?: boolean | null;
432
434
  voice?: RaizAgentVoiceSettings | null;
@@ -1,5 +1,5 @@
1
1
  import type { Empty, ForbiddenFailure, HttpsUrl, InternalFailure, InvalidInputFailure, OutcomeUnknownFailure, PageInfo, RateLimitedFailure, RequestTooLargeFailure, ResponseMetadata, UpstreamTimeoutFailure, UpstreamUnavailableFailure } from "../../models.js";
2
- import { type RaizAddressInUseFailure, type RaizAgentInUseFailure, type RaizAgentModalityLockedFailure, type RaizAgentProceduresInvalidFailure, type RaizAgentSettingsInvalidFailure, type RaizAgentWorkflowInvalidFailure, type RaizBulletinLimitReachedFailure, type RaizBulletinPeriodInvalidFailure, type RaizBusinessHours, type RaizCallInProgressFailure, type RaizCampaignAgentNotReadyFailure, type RaizCampaignHeaderMissingFailure, type RaizCampaignHeaderNotStoredFailure, type RaizCampaignNoRecipientsFailure, type RaizCampaignVariableMissingFailure, type RaizChannelAgentMismatchFailure, type RaizChannelNotReadyFailure, type RaizChannelTypeMismatchFailure, type RaizContactSuppressedFailure, type RaizConversationClosedFailure, type RaizConversationNotHandedOffFailure, type RaizConversationOpenFailure, type RaizDailyReportInProgressFailure, type RaizDailyReportRecipientsMissingFailure, type RaizDefinitionNotActiveFailure, type RaizDefinitionOptionsInvalidFailure, type RaizDefinitionRetiredFailure, type RaizDefinitionTypeLockedFailure, type RaizEvalCasesUnavailableFailure, type RaizEvalGateUnmetFailure, type RaizFactSubjectMismatchFailure, type RaizFactValueInvalidFailure, type RaizFeedbackProposalUnavailableFailure, type RaizHandoffAlreadyContinuedFailure, type RaizIdentifierInUseFailure, type RaizImportFileInvalidFailure, type RaizImportFileTooLargeFailure, type RaizIntegrationProcedureUnavailableFailure, type RaizIntegrationToolUnavailableFailure, type RaizIntegrationsUnavailableFailure, type RaizInvalidCursorFailure, type RaizInvalidStateFailure, type RaizIpNetworkInvalidFailure, type RaizKeyInUseFailure, type RaizKnowledgeDocumentUnavailableFailure, type RaizKnowledgeFileInvalidFailure, type RaizKnowledgeKindMismatchFailure, type RaizPhoneNumber, type RaizProviderRejectedFailure, type RaizReplyInProgressFailure, type RaizReportFilterUnsupportedFailure, type RaizReportRangeInvalidFailure, type RaizResourceNotFoundFailure, type RaizSourceConversationOpenFailure, type RaizSuppressionExistsFailure, type RaizTaskNotRetryableFailure, type RaizTemplateHeaderMismatchFailure, type RaizTemplateHeaderRequiredFailure, type RaizTemplateNotApprovedFailure, type RaizTemplateNotFoundFailure, type RaizTemplateParametersMismatchFailure, type RaizTemplateUnsupportedFailure, type RaizTimeZoneUnknownFailure, type RaizVersionConflictFailure, type RaizVoiceAgentNotReadyFailure, type RaizVoiceUnavailableFailure, type RaizWebsiteNotApprovedFailure, type RaizWhatsappAiPausedFailure, type RaizWhatsappDeliveryFailedFailure, type RaizWhatsappMarketingStoppedFailure, type RaizWhatsappMediaRejectedFailure, type RaizWhatsappMessageUnsupportedFailure, type RaizWhatsappRateLimitedFailure, type RaizWhatsappRecipientUnavailableFailure, type RaizWhatsappWindowClosedFailure } from "../models.js";
2
+ import { type RaizAddressInUseFailure, type RaizAgentInUseFailure, type RaizAgentModalityLockedFailure, type RaizAgentProceduresInvalidFailure, type RaizAgentSettingsInvalidFailure, type RaizAgentWorkflowInvalidFailure, type RaizAssigneeUnavailableFailure, type RaizBulletinLimitReachedFailure, type RaizBulletinPeriodInvalidFailure, type RaizBusinessHours, type RaizCallInProgressFailure, type RaizCampaignAgentNotReadyFailure, type RaizCampaignHeaderMissingFailure, type RaizCampaignHeaderNotStoredFailure, type RaizCampaignNoRecipientsFailure, type RaizCampaignVariableMissingFailure, type RaizChannelAgentMismatchFailure, type RaizChannelNotReadyFailure, type RaizChannelTypeMismatchFailure, type RaizContactSuppressedFailure, type RaizConversationClosedFailure, type RaizConversationNotHandedOffFailure, type RaizConversationOpenFailure, type RaizDailyReportInProgressFailure, type RaizDailyReportRecipientsMissingFailure, type RaizDefinitionNotActiveFailure, type RaizDefinitionOptionsInvalidFailure, type RaizDefinitionRetiredFailure, type RaizDefinitionTypeLockedFailure, type RaizEvalCasesUnavailableFailure, type RaizEvalGateUnmetFailure, type RaizFactSubjectMismatchFailure, type RaizFactValueInvalidFailure, type RaizFeedbackProposalUnavailableFailure, type RaizHandoffAlreadyContinuedFailure, type RaizIdentifierInUseFailure, type RaizImportFileInvalidFailure, type RaizImportFileTooLargeFailure, type RaizIntegrationProcedureUnavailableFailure, type RaizIntegrationToolUnavailableFailure, type RaizIntegrationsUnavailableFailure, type RaizInvalidCursorFailure, type RaizInvalidStateFailure, type RaizIpNetworkInvalidFailure, type RaizKeyInUseFailure, type RaizKnowledgeDocumentUnavailableFailure, type RaizKnowledgeFileInvalidFailure, type RaizKnowledgeKindMismatchFailure, type RaizPhoneNumber, type RaizProviderRejectedFailure, type RaizReplyInProgressFailure, type RaizReportFilterUnsupportedFailure, type RaizReportRangeInvalidFailure, type RaizResourceNotFoundFailure, type RaizSourceConversationOpenFailure, type RaizSuppressionExistsFailure, type RaizTaskNotRetryableFailure, type RaizTeamUnavailableFailure, type RaizTemplateHeaderMismatchFailure, type RaizTemplateHeaderRequiredFailure, type RaizTemplateNotApprovedFailure, type RaizTemplateNotFoundFailure, type RaizTemplateParametersMismatchFailure, type RaizTemplateUnsupportedFailure, type RaizTimeZoneUnknownFailure, type RaizVersionConflictFailure, type RaizVoiceAgentNotReadyFailure, type RaizVoiceUnavailableFailure, type RaizWebsiteNotApprovedFailure, type RaizWhatsappAiPausedFailure, type RaizWhatsappDeliveryFailedFailure, type RaizWhatsappMarketingStoppedFailure, type RaizWhatsappMediaRejectedFailure, type RaizWhatsappMessageUnsupportedFailure, type RaizWhatsappRateLimitedFailure, type RaizWhatsappRecipientUnavailableFailure, type RaizWhatsappWindowClosedFailure } from "../models.js";
3
3
  /**
4
4
  * Only a text Agent can hold a web conversation; a voice Agent only with
5
5
  * `origin: test`, to try it by text.
@@ -472,7 +472,7 @@ export interface RaizCreateChannelServiceUnavailableError {
472
472
  metadata: ResponseMetadata;
473
473
  success: false;
474
474
  }
475
- export type RaizCreateChannelServiceUnavailableFailure = UpstreamUnavailableFailure | RaizCampaignHeaderNotStoredFailure | RaizVoiceUnavailableFailure | RaizFeedbackProposalUnavailableFailure | RaizIntegrationsUnavailableFailure;
475
+ export type RaizCreateChannelServiceUnavailableFailure = UpstreamUnavailableFailure | RaizTeamUnavailableFailure | RaizCampaignHeaderNotStoredFailure | RaizVoiceUnavailableFailure | RaizFeedbackProposalUnavailableFailure | RaizIntegrationsUnavailableFailure;
476
476
  /**
477
477
  * A failed answer.
478
478
  */
@@ -498,7 +498,7 @@ export interface RaizCreateChannelUnprocessableContentError {
498
498
  metadata: ResponseMetadata;
499
499
  success: false;
500
500
  }
501
- export type RaizCreateChannelUnprocessableContentFailure = RaizContactUnreachableFailure | RaizDailyReportRecipientsMissingFailure | RaizDefinitionOptionsInvalidFailure | RaizFactSubjectMismatchFailure | RaizFactValueInvalidFailure | RaizImportFileInvalidFailure | RaizIpNetworkInvalidFailure | RaizProfileVariableMissingFailure | RaizTimeZoneUnknownFailure | RaizCampaignHeaderMissingFailure | RaizCampaignVariableMissingFailure | RaizChannelAgentMismatchFailure | RaizTemplateHeaderMismatchFailure | RaizTemplateHeaderRequiredFailure | RaizTemplateParametersMismatchFailure | RaizTemplateUnsupportedFailure | RaizWhatsappMediaRejectedFailure | RaizWhatsappMessageUnsupportedFailure | RaizWhatsappRecipientUnavailableFailure | RaizCallRejectedFailure | RaizProviderAccountUnsupportedFailure | RaizProviderCredentialsRejectedFailure | RaizVoiceNotAvailableFailure | RaizVoiceNumberNotOwnedFailure | RaizAgentProceduresInvalidFailure | RaizAgentWorkflowInvalidFailure | RaizAgentSettingsInvalidFailure | RaizBulletinPeriodInvalidFailure | RaizIntegrationProcedureUnavailableFailure | RaizIntegrationToolUnavailableFailure | RaizKnowledgeDocumentUnavailableFailure | RaizKnowledgeFileInvalidFailure | RaizKnowledgeKindMismatchFailure | RaizWebsiteNotApprovedFailure | RaizWidgetVoiceUnheardFailure | RaizProviderRejectedFailure;
501
+ export type RaizCreateChannelUnprocessableContentFailure = RaizAssigneeUnavailableFailure | RaizContactUnreachableFailure | RaizDailyReportRecipientsMissingFailure | RaizDefinitionOptionsInvalidFailure | RaizFactSubjectMismatchFailure | RaizFactValueInvalidFailure | RaizImportFileInvalidFailure | RaizIpNetworkInvalidFailure | RaizProfileVariableMissingFailure | RaizTimeZoneUnknownFailure | RaizCampaignHeaderMissingFailure | RaizCampaignVariableMissingFailure | RaizChannelAgentMismatchFailure | RaizTemplateHeaderMismatchFailure | RaizTemplateHeaderRequiredFailure | RaizTemplateParametersMismatchFailure | RaizTemplateUnsupportedFailure | RaizWhatsappMediaRejectedFailure | RaizWhatsappMessageUnsupportedFailure | RaizWhatsappRecipientUnavailableFailure | RaizCallRejectedFailure | RaizProviderAccountUnsupportedFailure | RaizProviderCredentialsRejectedFailure | RaizVoiceNotAvailableFailure | RaizVoiceNumberNotOwnedFailure | RaizAgentProceduresInvalidFailure | RaizAgentWorkflowInvalidFailure | RaizAgentSettingsInvalidFailure | RaizBulletinPeriodInvalidFailure | RaizIntegrationProcedureUnavailableFailure | RaizIntegrationToolUnavailableFailure | RaizKnowledgeDocumentUnavailableFailure | RaizKnowledgeFileInvalidFailure | RaizKnowledgeKindMismatchFailure | RaizWebsiteNotApprovedFailure | RaizWidgetVoiceUnheardFailure | RaizProviderRejectedFailure;
502
502
  /**
503
503
  * A failed answer.
504
504
  */
@@ -602,7 +602,7 @@ export interface RaizDeleteChannelServiceUnavailableError {
602
602
  metadata: ResponseMetadata;
603
603
  success: false;
604
604
  }
605
- export type RaizDeleteChannelServiceUnavailableFailure = UpstreamUnavailableFailure | RaizCampaignHeaderNotStoredFailure | RaizVoiceUnavailableFailure | RaizFeedbackProposalUnavailableFailure | RaizIntegrationsUnavailableFailure;
605
+ export type RaizDeleteChannelServiceUnavailableFailure = UpstreamUnavailableFailure | RaizTeamUnavailableFailure | RaizCampaignHeaderNotStoredFailure | RaizVoiceUnavailableFailure | RaizFeedbackProposalUnavailableFailure | RaizIntegrationsUnavailableFailure;
606
606
  /**
607
607
  * A failed answer.
608
608
  */
@@ -628,7 +628,7 @@ export interface RaizDeleteChannelUnprocessableContentError {
628
628
  metadata: ResponseMetadata;
629
629
  success: false;
630
630
  }
631
- export type RaizDeleteChannelUnprocessableContentFailure = RaizContactUnreachableFailure | RaizDailyReportRecipientsMissingFailure | RaizDefinitionOptionsInvalidFailure | RaizFactSubjectMismatchFailure | RaizFactValueInvalidFailure | RaizImportFileInvalidFailure | RaizIpNetworkInvalidFailure | RaizProfileVariableMissingFailure | RaizTimeZoneUnknownFailure | RaizCampaignHeaderMissingFailure | RaizCampaignVariableMissingFailure | RaizChannelAgentMismatchFailure | RaizTemplateHeaderMismatchFailure | RaizTemplateHeaderRequiredFailure | RaizTemplateParametersMismatchFailure | RaizTemplateUnsupportedFailure | RaizWhatsappMediaRejectedFailure | RaizWhatsappMessageUnsupportedFailure | RaizWhatsappRecipientUnavailableFailure | RaizCallRejectedFailure | RaizProviderAccountUnsupportedFailure | RaizProviderCredentialsRejectedFailure | RaizVoiceNotAvailableFailure | RaizVoiceNumberNotOwnedFailure | RaizAgentProceduresInvalidFailure | RaizAgentWorkflowInvalidFailure | RaizAgentSettingsInvalidFailure | RaizBulletinPeriodInvalidFailure | RaizIntegrationProcedureUnavailableFailure | RaizIntegrationToolUnavailableFailure | RaizKnowledgeDocumentUnavailableFailure | RaizKnowledgeFileInvalidFailure | RaizKnowledgeKindMismatchFailure | RaizWebsiteNotApprovedFailure | RaizWidgetVoiceUnheardFailure | RaizProviderRejectedFailure;
631
+ export type RaizDeleteChannelUnprocessableContentFailure = RaizAssigneeUnavailableFailure | RaizContactUnreachableFailure | RaizDailyReportRecipientsMissingFailure | RaizDefinitionOptionsInvalidFailure | RaizFactSubjectMismatchFailure | RaizFactValueInvalidFailure | RaizImportFileInvalidFailure | RaizIpNetworkInvalidFailure | RaizProfileVariableMissingFailure | RaizTimeZoneUnknownFailure | RaizCampaignHeaderMissingFailure | RaizCampaignVariableMissingFailure | RaizChannelAgentMismatchFailure | RaizTemplateHeaderMismatchFailure | RaizTemplateHeaderRequiredFailure | RaizTemplateParametersMismatchFailure | RaizTemplateUnsupportedFailure | RaizWhatsappMediaRejectedFailure | RaizWhatsappMessageUnsupportedFailure | RaizWhatsappRecipientUnavailableFailure | RaizCallRejectedFailure | RaizProviderAccountUnsupportedFailure | RaizProviderCredentialsRejectedFailure | RaizVoiceNotAvailableFailure | RaizVoiceNumberNotOwnedFailure | RaizAgentProceduresInvalidFailure | RaizAgentWorkflowInvalidFailure | RaizAgentSettingsInvalidFailure | RaizBulletinPeriodInvalidFailure | RaizIntegrationProcedureUnavailableFailure | RaizIntegrationToolUnavailableFailure | RaizKnowledgeDocumentUnavailableFailure | RaizKnowledgeFileInvalidFailure | RaizKnowledgeKindMismatchFailure | RaizWebsiteNotApprovedFailure | RaizWidgetVoiceUnheardFailure | RaizProviderRejectedFailure;
632
632
  /**
633
633
  * A failed answer.
634
634
  */
@@ -1100,7 +1100,7 @@ export interface RaizUpdateChannelServiceUnavailableError {
1100
1100
  metadata: ResponseMetadata;
1101
1101
  success: false;
1102
1102
  }
1103
- export type RaizUpdateChannelServiceUnavailableFailure = UpstreamUnavailableFailure | RaizCampaignHeaderNotStoredFailure | RaizVoiceUnavailableFailure | RaizFeedbackProposalUnavailableFailure | RaizIntegrationsUnavailableFailure;
1103
+ export type RaizUpdateChannelServiceUnavailableFailure = UpstreamUnavailableFailure | RaizTeamUnavailableFailure | RaizCampaignHeaderNotStoredFailure | RaizVoiceUnavailableFailure | RaizFeedbackProposalUnavailableFailure | RaizIntegrationsUnavailableFailure;
1104
1104
  /**
1105
1105
  * A failed answer.
1106
1106
  */
@@ -1126,7 +1126,7 @@ export interface RaizUpdateChannelUnprocessableContentError {
1126
1126
  metadata: ResponseMetadata;
1127
1127
  success: false;
1128
1128
  }
1129
- export type RaizUpdateChannelUnprocessableContentFailure = RaizContactUnreachableFailure | RaizDailyReportRecipientsMissingFailure | RaizDefinitionOptionsInvalidFailure | RaizFactSubjectMismatchFailure | RaizFactValueInvalidFailure | RaizImportFileInvalidFailure | RaizIpNetworkInvalidFailure | RaizProfileVariableMissingFailure | RaizTimeZoneUnknownFailure | RaizCampaignHeaderMissingFailure | RaizCampaignVariableMissingFailure | RaizChannelAgentMismatchFailure | RaizTemplateHeaderMismatchFailure | RaizTemplateHeaderRequiredFailure | RaizTemplateParametersMismatchFailure | RaizTemplateUnsupportedFailure | RaizWhatsappMediaRejectedFailure | RaizWhatsappMessageUnsupportedFailure | RaizWhatsappRecipientUnavailableFailure | RaizCallRejectedFailure | RaizProviderAccountUnsupportedFailure | RaizProviderCredentialsRejectedFailure | RaizVoiceNotAvailableFailure | RaizVoiceNumberNotOwnedFailure | RaizAgentProceduresInvalidFailure | RaizAgentWorkflowInvalidFailure | RaizAgentSettingsInvalidFailure | RaizBulletinPeriodInvalidFailure | RaizIntegrationProcedureUnavailableFailure | RaizIntegrationToolUnavailableFailure | RaizKnowledgeDocumentUnavailableFailure | RaizKnowledgeFileInvalidFailure | RaizKnowledgeKindMismatchFailure | RaizWebsiteNotApprovedFailure | RaizWidgetVoiceUnheardFailure | RaizProviderRejectedFailure;
1129
+ export type RaizUpdateChannelUnprocessableContentFailure = RaizAssigneeUnavailableFailure | RaizContactUnreachableFailure | RaizDailyReportRecipientsMissingFailure | RaizDefinitionOptionsInvalidFailure | RaizFactSubjectMismatchFailure | RaizFactValueInvalidFailure | RaizImportFileInvalidFailure | RaizIpNetworkInvalidFailure | RaizProfileVariableMissingFailure | RaizTimeZoneUnknownFailure | RaizCampaignHeaderMissingFailure | RaizCampaignVariableMissingFailure | RaizChannelAgentMismatchFailure | RaizTemplateHeaderMismatchFailure | RaizTemplateHeaderRequiredFailure | RaizTemplateParametersMismatchFailure | RaizTemplateUnsupportedFailure | RaizWhatsappMediaRejectedFailure | RaizWhatsappMessageUnsupportedFailure | RaizWhatsappRecipientUnavailableFailure | RaizCallRejectedFailure | RaizProviderAccountUnsupportedFailure | RaizProviderCredentialsRejectedFailure | RaizVoiceNotAvailableFailure | RaizVoiceNumberNotOwnedFailure | RaizAgentProceduresInvalidFailure | RaizAgentWorkflowInvalidFailure | RaizAgentSettingsInvalidFailure | RaizBulletinPeriodInvalidFailure | RaizIntegrationProcedureUnavailableFailure | RaizIntegrationToolUnavailableFailure | RaizKnowledgeDocumentUnavailableFailure | RaizKnowledgeFileInvalidFailure | RaizKnowledgeKindMismatchFailure | RaizWebsiteNotApprovedFailure | RaizWidgetVoiceUnheardFailure | RaizProviderRejectedFailure;
1130
1130
  export interface RaizVerifyChannelBody {
1131
1131
  /**
1132
1132
  * Phone number in E.164 format.
@@ -33,11 +33,12 @@ export interface Client {
33
33
  * at least that many match. `averageMessageCount` and
34
34
  * `averageDurationSeconds` are their average length. `groupBy` also divides
35
35
  * them, largest group first, each with its outcomes: by `outcome`, `status`,
36
- * `channel`, `agent`, `sentiment`, `tool` (which Agent tools they used, and
37
- * in how many a tool failed), `toolError` (why calls of `toolName` failed) or
38
- * `fact:<definition key>` (such as the reason for contact). Use it to answer
39
- * how many conversations match, or how they divide, instead of paging through
40
- * the list; for volumes per day use `get_report`.
36
+ * `channel`, `agent`, `sentiment`, `waitingOn` (who each open conversation
37
+ * waits for: the AI, the team or the contact), `tool` (which Agent tools they
38
+ * used, and in how many a tool failed), `toolError` (why calls of `toolName`
39
+ * failed) or `fact:<definition key>` (such as the reason for contact). Use it
40
+ * to answer how many conversations match, or how they divide, instead of
41
+ * paging through the list; for volumes per day use `get_report`.
41
42
  */
42
43
  count(request?: CountRequest, options?: RequestOptions): Promise<CountResponse>;
43
44
  /**
@@ -55,12 +56,15 @@ export interface Client {
55
56
  * (`workers`: each Agent and the team, and who answers now), title, summary,
56
57
  * outcome, sentiment and current facts. Add `expand=messages` for the
57
58
  * transcript, oldest first, each message with its author, the Agent's tool
58
- * calls and quoted replies (continue with `messagesCursor`), and
59
- * `expand=recording` for a short-lived link to the call recording. Staff may
60
- * also request `expand=diagnostics` for bounded live call-termination
61
- * evidence; this additionally requires raiz:staff:operate and never changes
62
- * the conversation. The `review-conversation` skill explains how to read and
63
- * summarize one.
59
+ * calls and quoted replies (continue with `messagesCursor`),
60
+ * `expand=recording` for a short-lived link to the call recording, and
61
+ * `expand=history` for the case's history: the handoff to the team, who took
62
+ * it or was given it, the return to the AI and the closing. `waitingOn` says
63
+ * who an open conversation waits for (the AI, the team or the contact) and
64
+ * `assigneeId` who has its case. Staff may also request `expand=diagnostics`
65
+ * for bounded live call-termination evidence; this additionally requires
66
+ * raiz:staff:operate and never changes the conversation. The
67
+ * `review-conversation` skill explains how to read and summarize one.
64
68
  */
65
69
  get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
66
70
  /**
@@ -70,23 +74,26 @@ export interface Client {
70
74
  * counterpart or subject), `agentId`, `channelId`, `channelType`, `status`,
71
75
  * `conversationDirection`, `origin`, `outcome`, `sentiment`, `handling` (`ai`
72
76
  * or `team`: whether the AI takes part; `escalated`: handed to the team by
73
- * the AI), `worker` (`ai` or `team`: who answers it now), the Agent's tools
74
- * (`toolName`, `toolStatus`: which tool it called and how the call ended), a
75
- * captured fact (`factDefinition`, `factValue`), `assessment` (`failed` or
76
- * `passed`), `toReview` (evaluated failures or unresolved handoffs;
77
- * explicitly resolved successes leave this queue), length (`messagesMin`,
78
- * `messagesMax`, `durationMin`, `durationMax`), `campaignId`, `profileId`,
79
- * `requestedBy` and start time (`startedAfter`, `startedBefore`); `q`
80
- * searches participant identities (names, profile names, usernames, phones,
81
- * emails and documents), visible messages, titles, summaries and exact
82
- * conversation references; `count_conversations` counts every match. Each
83
- * item already carries its title, summary, outcome, sentiment, workers and
84
- * tool calls (how many, how many failed, the latest failure), often enough to
85
- * answer. `sort`: `started` (newest first), `last_message` (latest activity
86
- * first) or `changed`, the feed of status, outcome and analysis changes,
87
- * oldest first, that systems poll from a saved `pageInfo.nextCursor` (a
88
- * deleted conversation appears once with `deletedAt`). Next:
89
- * `get_conversation` for a transcript.
77
+ * the AI), `worker` (`ai` or `team`: who answers it now), `waitingOn` (`ai`,
78
+ * `team` or `contact`: who an open conversation waits for; `team` lists the
79
+ * cases a person has to answer), `assignee` (a member id, `me` or `none`:
80
+ * whose case it is), `unattended` (closed with a handoff nobody of the team
81
+ * answered), the Agent's tools (`toolName`, `toolStatus`: which tool it
82
+ * called and how the call ended), a captured fact (`factDefinition`,
83
+ * `factValue`), `assessment` (`failed` or `passed`), `toReview` (evaluated
84
+ * failures or unresolved handoffs; explicitly resolved successes leave this
85
+ * queue), length (`messagesMin`, `messagesMax`, `durationMin`,
86
+ * `durationMax`), `campaignId`, `profileId`, `requestedBy` and start time
87
+ * (`startedAfter`, `startedBefore`); `q` searches participant identities
88
+ * (names, profile names, usernames, phones, emails and documents), visible
89
+ * messages, titles, summaries and exact conversation references;
90
+ * `count_conversations` counts every match. Each item already carries its
91
+ * title, summary, outcome, sentiment, workers and tool calls (how many, how
92
+ * many failed, the latest failure), often enough to answer. `sort`: `started`
93
+ * (newest first), `last_message` (latest activity first) or `changed`, the
94
+ * feed of status, outcome and analysis changes, oldest first, that systems
95
+ * poll from a saved `pageInfo.nextCursor` (a deleted conversation appears
96
+ * once with `deletedAt`). Next: `get_conversation` for a transcript.
90
97
  */
91
98
  list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
92
99
  /**
@@ -108,16 +115,19 @@ export interface Client {
108
115
  /**
109
116
  * Update a conversation
110
117
  *
111
- * Change a conversation's title, summary, metadata, contact or subject, or
112
- * close it (`status: closed`), which starts its analysis. A title or summary
113
- * written here always wins over the generated one. A call closes by itself
114
- * (CALL_IN_PROGRESS); a web chat cannot close while the Agent is replying
115
- * (REPLY_IN_PROGRESS, retry shortly). On WhatsApp, `aiEnabled` activates or
116
- * pauses AI only for this open conversation and leaves future episodes
117
- * unchanged; `aiPaused` pauses or resumes the Agent for this person until
118
- * their open conversation closes. Activating or resuming answers what the
119
- * contact wrote after the last real answer, the team's or the Agent's (a wait
120
- * notice is not one).
118
+ * Change a conversation's title, summary, metadata, contact or subject, give
119
+ * its case to a person of the organization (`assigneeId`: a member id from
120
+ * `listAssignees`, `me`, or `null` for nobody; its new owner is told by
121
+ * email), or close it (`status: closed`), which starts its analysis. A title
122
+ * or summary written here always wins over the generated one. A call closes
123
+ * by itself (CALL_IN_PROGRESS); a web chat cannot close while the Agent is
124
+ * replying (REPLY_IN_PROGRESS, retry shortly). On WhatsApp, `aiEnabled`
125
+ * activates or pauses AI only for this open conversation and leaves future
126
+ * episodes unchanged; `aiPaused` pauses or resumes the Agent for this person
127
+ * until their open conversation closes (one a person handles closes by itself
128
+ * after the Agent's `teamCloseAfterMinutes` without messages). Activating or
129
+ * resuming answers what the contact wrote after the last real answer, the
130
+ * team's or the Agent's (a wait notice is not one).
121
131
  */
122
132
  update(request: UpdateRequest, options?: RequestOptions): Promise<UpdateResponse>;
123
133
  }
@@ -178,6 +188,23 @@ export interface CountRequest {
178
188
  * then handed to people is `team` while open.
179
189
  */
180
190
  worker?: "ai" | "team";
191
+ /**
192
+ * Open conversations by who they wait for, as each conversation's `waitingOn`
193
+ * says: `ai`, `team` (the team's cases to answer) or `contact`. Closed
194
+ * conversations never match.
195
+ */
196
+ waitingOn?: "ai" | "team" | "contact";
197
+ /**
198
+ * Conversations by the case's owner: a member id, `me` (the person calling)
199
+ * or `none` (nobody has it). With `waitingOn=team`: one person's cases to
200
+ * answer, or the ones nobody took.
201
+ */
202
+ assignee?: string;
203
+ /**
204
+ * `true`: conversations that closed for inactivity with a handoff nobody of
205
+ * the team answered.
206
+ */
207
+ unattended?: boolean;
181
208
  /**
182
209
  * Comma-separated origins.
183
210
  */
@@ -284,11 +311,12 @@ export interface CountRequest {
284
311
  */
285
312
  durationMax?: number;
286
313
  /**
287
- * `outcome`, `status`, `channel` (type), `agent`, `sentiment`, `tool` (each
288
- * Agent tool and the conversations that used it; null for those that used
289
- * none), `toolError` (failed calls, of `toolName` when given, by error) or
290
- * `fact:<definition key>` (the current value of that definition, such as the
291
- * reason for contact).
314
+ * `outcome`, `status`, `channel` (type), `agent`, `sentiment`, `waitingOn`
315
+ * (who each open conversation waits for: `ai`, `team` or `contact`; null for
316
+ * the closed ones), `tool` (each Agent tool and the conversations that used
317
+ * it; null for those that used none), `toolError` (failed calls, of
318
+ * `toolName` when given, by error) or `fact:<definition key>` (the current
319
+ * value of that definition, such as the reason for contact).
292
320
  */
293
321
  groupBy?: string;
294
322
  }
@@ -307,7 +335,7 @@ export interface GetRequest {
307
335
  conversationId: string;
308
336
  /**
309
337
  * Related data to include, comma-separated: `messages`, `recording`,
310
- * `diagnostics`.
338
+ * `diagnostics`, `history`.
311
339
  */
312
340
  expand?: string;
313
341
  /**
@@ -386,6 +414,23 @@ export interface ListRequest {
386
414
  * then handed to people is `team` while open.
387
415
  */
388
416
  worker?: "ai" | "team";
417
+ /**
418
+ * Open conversations by who they wait for, as each conversation's `waitingOn`
419
+ * says: `ai`, `team` (the team's cases to answer) or `contact`. Closed
420
+ * conversations never match.
421
+ */
422
+ waitingOn?: "ai" | "team" | "contact";
423
+ /**
424
+ * Conversations by the case's owner: a member id, `me` (the person calling)
425
+ * or `none` (nobody has it). With `waitingOn=team`: one person's cases to
426
+ * answer, or the ones nobody took.
427
+ */
428
+ assignee?: string;
429
+ /**
430
+ * `true`: conversations that closed for inactivity with a handoff nobody of
431
+ * the team answered.
432
+ */
433
+ unattended?: boolean;
389
434
  /**
390
435
  * Comma-separated origins.
391
436
  */
@@ -27,7 +27,7 @@ const ContinueOperation = {
27
27
  const CountOperation = {
28
28
  method: "GET",
29
29
  route: "/v1/raiz/conversations/count",
30
- 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", period: "period", sentiment: "sentiment", toolName: "toolName", toolStatus: "toolStatus", factDefinition: "factDefinition", factValue: "factValue", assessment: "assessment", toReview: "toReview", messagesMin: "messagesMin", messagesMax: "messagesMax", durationMin: "durationMin", durationMax: "durationMax", groupBy: "groupBy" },
30
+ query: { agentId: "agentId", campaignId: "campaignId", channelId: "channelId", channelType: "channelType", contactId: "contactId", conversationDirection: "conversationDirection", handling: "handling", worker: "worker", waitingOn: "waitingOn", assignee: "assignee", unattended: "unattended", origin: "origin", outcome: "outcome", metadataReference: "metadataReference", profileId: "profileId", q: "q", requestedBy: "requestedBy", startedAfter: "startedAfter", startedBefore: "startedBefore", status: "status", period: "period", sentiment: "sentiment", toolName: "toolName", toolStatus: "toolStatus", factDefinition: "factDefinition", factValue: "factValue", assessment: "assessment", toReview: "toReview", messagesMin: "messagesMin", messagesMax: "messagesMax", durationMin: "durationMin", durationMax: "durationMax", groupBy: "groupBy" },
31
31
  response: null,
32
32
  errors: { "400": true, "401": true, "403": true, "429": true, "500": true, "502": true, "503": true, "504": true },
33
33
  };
@@ -47,7 +47,7 @@ const GetOperation = {
47
47
  const ListOperation = {
48
48
  method: "GET",
49
49
  route: "/v1/raiz/conversations",
50
- 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", period: "period", sentiment: "sentiment", toolName: "toolName", toolStatus: "toolStatus", factDefinition: "factDefinition", factValue: "factValue", assessment: "assessment", toReview: "toReview", messagesMin: "messagesMin", messagesMax: "messagesMax", durationMin: "durationMin", durationMax: "durationMax", sort: "sort" },
50
+ query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", campaignId: "campaignId", channelId: "channelId", channelType: "channelType", contactId: "contactId", conversationDirection: "conversationDirection", handling: "handling", worker: "worker", waitingOn: "waitingOn", assignee: "assignee", unattended: "unattended", origin: "origin", outcome: "outcome", metadataReference: "metadataReference", profileId: "profileId", q: "q", requestedBy: "requestedBy", startedAfter: "startedAfter", startedBefore: "startedBefore", status: "status", period: "period", sentiment: "sentiment", toolName: "toolName", toolStatus: "toolStatus", factDefinition: "factDefinition", factValue: "factValue", assessment: "assessment", toReview: "toReview", messagesMin: "messagesMin", messagesMax: "messagesMax", durationMin: "durationMin", durationMax: "durationMax", sort: "sort" },
51
51
  response: RaizConversationPageResponseCodec,
52
52
  errors: { "400": true, "401": true, "403": true, "429": true, "500": true, "502": true, "503": true, "504": true },
53
53
  };
@@ -64,5 +64,5 @@ const UpdateOperation = {
64
64
  route: "/v1/raiz/conversations/{conversationId}",
65
65
  body: "flat",
66
66
  response: RaizConversationResponseCodec,
67
- errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
67
+ errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
68
68
  };
@@ -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, SendRequest, SendResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
- export type { RaizContinueConversationBadRequestError, RaizContinueConversationBadRequestFailure, RaizContinueConversationBody, RaizContinueConversationConflictError, RaizContinueConversationConflictFailure, RaizContinueConversationNotFoundError, RaizContinueConversationNotFoundFailure, RaizContinueConversationServiceUnavailableError, RaizContinueConversationServiceUnavailableFailure, RaizContinueConversationUnprocessableContentError, RaizContinueConversationUnprocessableContentFailure, RaizConversation, RaizConversationCount, RaizConversationCountResponse, RaizConversationDiagnostics, RaizConversationGroup, RaizConversationOutcomeCounts, RaizConversationPage, RaizConversationPageResponse, RaizConversationResponse, RaizConversationToolCalls, RaizConversationToolFailure, RaizConversationWorker, RaizCountConversationsServiceUnavailableError, RaizCountConversationsServiceUnavailableFailure, RaizDeleteConversationConflictError, RaizDeleteConversationConflictFailure, RaizGetConversationBadRequestError, RaizGetConversationBadRequestFailure, RaizGetConversationServiceUnavailableError, RaizGetConversationServiceUnavailableFailure, RaizListConversationsBadRequestError, RaizListConversationsBadRequestFailure, RaizListConversationsServiceUnavailableError, RaizListConversationsServiceUnavailableFailure, RaizMessage, RaizMessagePage, RaizMessageResponse, RaizSendMessageBadGatewayError, RaizSendMessageBadGatewayFailure, RaizSendMessageBody, RaizSendMessageConflictError, RaizSendMessageConflictFailure, RaizSendMessageNotFoundError, RaizSendMessageNotFoundFailure, RaizSendMessageTooManyRequestsError, RaizSendMessageTooManyRequestsFailure, RaizSendMessageUnprocessableContentError, RaizSendMessageUnprocessableContentFailure, RaizUpdateConversationBadRequestError, RaizUpdateConversationBadRequestFailure, RaizUpdateConversationBody, RaizUpdateConversationConflictError, RaizUpdateConversationConflictFailure, RaizUpdateConversationServiceUnavailableError, RaizUpdateConversationServiceUnavailableFailure, } from "./models.js";
5
+ export type { RaizAssigneeUnavailableError, RaizContinueConversationBadRequestError, RaizContinueConversationBadRequestFailure, RaizContinueConversationBody, RaizContinueConversationConflictError, RaizContinueConversationConflictFailure, RaizContinueConversationNotFoundError, RaizContinueConversationNotFoundFailure, RaizContinueConversationServiceUnavailableError, RaizContinueConversationServiceUnavailableFailure, RaizContinueConversationUnprocessableContentError, RaizContinueConversationUnprocessableContentFailure, RaizConversation, RaizConversationCount, RaizConversationCountResponse, RaizConversationDiagnostics, RaizConversationEvent, RaizConversationGroup, RaizConversationOutcomeCounts, RaizConversationPage, RaizConversationPageResponse, RaizConversationResponse, RaizConversationToolCalls, RaizConversationToolFailure, RaizConversationWorker, RaizCountConversationsServiceUnavailableError, RaizCountConversationsServiceUnavailableFailure, RaizDeleteConversationConflictError, RaizDeleteConversationConflictFailure, RaizGetConversationBadRequestError, RaizGetConversationBadRequestFailure, RaizGetConversationServiceUnavailableError, RaizGetConversationServiceUnavailableFailure, RaizListConversationsBadRequestError, RaizListConversationsBadRequestFailure, RaizListConversationsServiceUnavailableError, RaizListConversationsServiceUnavailableFailure, RaizMessage, RaizMessagePage, RaizMessageResponse, RaizSendMessageBadGatewayError, RaizSendMessageBadGatewayFailure, RaizSendMessageBody, RaizSendMessageConflictError, RaizSendMessageConflictFailure, RaizSendMessageNotFoundError, RaizSendMessageNotFoundFailure, RaizSendMessageTooManyRequestsError, RaizSendMessageTooManyRequestsFailure, RaizSendMessageUnprocessableContentError, RaizSendMessageUnprocessableContentFailure, RaizUpdateConversationBadRequestError, RaizUpdateConversationBadRequestFailure, RaizUpdateConversationBody, RaizUpdateConversationConflictError, RaizUpdateConversationConflictFailure, RaizUpdateConversationServiceUnavailableError, RaizUpdateConversationServiceUnavailableFailure, } from "./models.js";
@@ -1,5 +1,21 @@
1
1
  import { type InvalidInputFailure, type OutcomeUnknownFailure, type PageInfo, type RateLimitedFailure, type ResponseMetadata, type SignedUrl, type UpstreamUnavailableFailure } from "../../models.js";
2
- import { type RaizCallInProgressFailure, type RaizChannelNotReadyFailure, type RaizChannelTypeMismatchFailure, type RaizContactSuppressedFailure, type RaizConversationClosedFailure, type RaizConversationNotHandedOffFailure, type RaizConversationOpenFailure, type RaizFact, type RaizHandoffAlreadyContinuedFailure, type RaizIntegrationsUnavailableFailure, type RaizInvalidCursorFailure, type RaizInvalidStateFailure, type RaizReplyInProgressFailure, type RaizResourceNotFoundFailure, type RaizTemplateHeaderFile, type RaizTemplateHeaderMismatchFailure, type RaizTemplateHeaderRequiredFailure, type RaizTemplateNotApprovedFailure, type RaizTemplateNotFoundFailure, type RaizTemplateParametersMismatchFailure, type RaizTemplateUnsupportedFailure, type RaizVersionConflictFailure, type RaizWhatsappAiPausedFailure, type RaizWhatsappDeliveryFailedFailure, type RaizWhatsappMarketingStoppedFailure, type RaizWhatsappMediaRejectedFailure, type RaizWhatsappMessageUnsupportedFailure, type RaizWhatsappRateLimitedFailure, type RaizWhatsappRecipientUnavailableFailure, type RaizWhatsappWindowClosedFailure } from "../models.js";
2
+ import { type RaizAssigneeUnavailableFailure, type RaizCallInProgressFailure, type RaizChannelNotReadyFailure, type RaizChannelTypeMismatchFailure, type RaizContactSuppressedFailure, type RaizConversationClosedFailure, type RaizConversationNotHandedOffFailure, type RaizConversationOpenFailure, type RaizFact, type RaizHandoffAlreadyContinuedFailure, type RaizIntegrationsUnavailableFailure, type RaizInvalidCursorFailure, type RaizInvalidStateFailure, type RaizReplyInProgressFailure, type RaizResourceNotFoundFailure, type RaizTeamUnavailableFailure, type RaizTemplateHeaderFile, type RaizTemplateHeaderMismatchFailure, type RaizTemplateHeaderRequiredFailure, type RaizTemplateNotApprovedFailure, type RaizTemplateNotFoundFailure, type RaizTemplateParametersMismatchFailure, type RaizTemplateUnsupportedFailure, type RaizVersionConflictFailure, type RaizWhatsappAiPausedFailure, type RaizWhatsappDeliveryFailedFailure, type RaizWhatsappMarketingStoppedFailure, type RaizWhatsappMediaRejectedFailure, type RaizWhatsappMessageUnsupportedFailure, type RaizWhatsappRateLimitedFailure, type RaizWhatsappRecipientUnavailableFailure, type RaizWhatsappWindowClosedFailure } from "../models.js";
3
+ /**
4
+ * A failed answer.
5
+ */
6
+ export interface RaizAssigneeUnavailableError {
7
+ data: null;
8
+ /**
9
+ * That person cannot take conversations in this organization. `listAssignees`
10
+ * names who can.
11
+ */
12
+ error: RaizAssigneeUnavailableFailure;
13
+ /**
14
+ * What every answer carries besides its data or error.
15
+ */
16
+ metadata: ResponseMetadata;
17
+ success: false;
18
+ }
3
19
  /**
4
20
  * A failed answer.
5
21
  */
@@ -124,6 +140,9 @@ export interface RaizConversation {
124
140
  aiPausedBy: "agent" | "operator" | null;
125
141
  analysisErrorCode: string | null;
126
142
  analyzedAt: Temporal.Instant | null;
143
+ assignedAt: Temporal.Instant | null;
144
+ assignedBy: string | null;
145
+ assigneeId: string | null;
127
146
  campaignId: string | null;
128
147
  campaignRecipientId: string | null;
129
148
  channelAddress: string | null;
@@ -155,6 +174,13 @@ export interface RaizConversation {
155
174
  * that was not rejected).
156
175
  */
157
176
  facts: RaizFact[];
177
+ /**
178
+ * The case's history, oldest first: the handoff, who took it or was given it,
179
+ * the return to the AI, a person's pause or resume, and the closing. Present
180
+ * only when expanded. Who answered the contact is in `workers` and in each
181
+ * message's `memberId`.
182
+ */
183
+ history?: RaizConversationEvent[];
158
184
  /**
159
185
  * Conversation id.
160
186
  */
@@ -216,11 +242,18 @@ export interface RaizConversation {
216
242
  title: string | null;
217
243
  titleAuthor: "person" | "ai" | "system" | "import" | "provider" | null;
218
244
  toolCalls: RaizConversationToolCalls;
245
+ /**
246
+ * It closed for inactivity with a handoff nobody of the team answered. Such a
247
+ * conversation is also one to review (`toReview`).
248
+ */
249
+ unattended: boolean;
219
250
  /**
220
251
  * An instant in RFC 3339 format, in UTC.
221
252
  */
222
253
  updatedAt: Temporal.Instant;
223
254
  version: number;
255
+ waitingOn: "ai" | "team" | "contact" | null;
256
+ waitingSinceAt: Temporal.Instant | null;
224
257
  /**
225
258
  * Who works the conversation for the organization, in the order each first
226
259
  * wrote something the contact saw (those who have not yet, last): each Agent
@@ -272,6 +305,42 @@ export interface RaizConversationDiagnostics {
272
305
  status: "available" | "unavailable" | "not_recorded" | "not_applicable";
273
306
  terminationReasonPresent: boolean;
274
307
  }
308
+ export interface RaizConversationEvent {
309
+ /**
310
+ * For `assigned`: the member who has the case from then on.
311
+ */
312
+ assigneeId?: string;
313
+ /**
314
+ * An instant in RFC 3339 format, in UTC.
315
+ */
316
+ at: Temporal.Instant;
317
+ /**
318
+ * Who did it: a `person` of the organization, the `ai`, or the `system` (a
319
+ * rule, such as the inactivity close).
320
+ */
321
+ author: "person" | "ai" | "system" | "import" | "provider";
322
+ authorId: string | null;
323
+ /**
324
+ * For `returned_to_ai`: nobody of the team asked for it; an unanswered
325
+ * technical handoff came back by itself.
326
+ */
327
+ automatic?: boolean;
328
+ closeReason?: string | null;
329
+ /**
330
+ * `handed_off`: the AI passed the conversation to the team (`messageId` is
331
+ * its handoff message). `assigned`: a person took the case or was given it
332
+ * (`authorId` is who decided, `assigneeId` who has it, `previousAssigneeId`
333
+ * who had it). `unassigned`: it was left with nobody. `returned_to_ai`: the
334
+ * team gave it back to the AI. `ai_paused`, `ai_resumed`: a person paused or
335
+ * resumed the AI for the recipient. `closed`: it closed, with `closeReason`.
336
+ */
337
+ kind: "handed_off" | "assigned" | "unassigned" | "returned_to_ai" | "ai_paused" | "ai_resumed" | "closed";
338
+ /**
339
+ * Message id.
340
+ */
341
+ messageId?: string;
342
+ previousAssigneeId?: string | null;
343
+ }
275
344
  export interface RaizConversationGroup {
276
345
  averageDurationSeconds: number | null;
277
346
  averageMessageCount: number | null;
@@ -718,6 +787,7 @@ export interface RaizUpdateConversationBody {
718
787
  * this conversation after the last real answer.
719
788
  */
720
789
  aiPaused?: boolean;
790
+ assigneeId?: string | null;
721
791
  contactId?: string | null;
722
792
  /**
723
793
  * The `version` you read. When present, the change applies only if nobody
@@ -765,9 +835,10 @@ export interface RaizUpdateConversationServiceUnavailableError {
765
835
  metadata: ResponseMetadata;
766
836
  success: false;
767
837
  }
768
- export type RaizUpdateConversationServiceUnavailableFailure = UpstreamUnavailableFailure | RaizIntegrationsUnavailableFailure;
838
+ export type RaizUpdateConversationServiceUnavailableFailure = UpstreamUnavailableFailure | RaizTeamUnavailableFailure | RaizIntegrationsUnavailableFailure;
769
839
  export declare const RaizContinueConversationBodyCodec: import("../../_/codec.js").Codec;
770
840
  export declare const RaizConversationCodec: import("../../_/codec.js").Codec;
841
+ export declare const RaizConversationEventCodec: import("../../_/codec.js").Codec;
771
842
  export declare const RaizConversationPageCodec: import("../../_/codec.js").Codec;
772
843
  export declare const RaizConversationPageResponseCodec: import("../../_/codec.js").Codec;
773
844
  export declare const RaizConversationResponseCodec: import("../../_/codec.js").Codec;
@@ -8,18 +8,24 @@ export const RaizContinueConversationBodyCodec = object([
8
8
  ]);
9
9
  export const RaizConversationCodec = object([
10
10
  ["analyzedAt", null, instant],
11
+ ["assignedAt", null, instant],
11
12
  ["createdAt", null, instant],
12
13
  ["deletedAt", null, instant],
13
14
  ["endedAt", null, instant],
14
15
  ["facts", null, array(() => RaizFactCodec)],
16
+ ["history", null, array(() => RaizConversationEventCodec)],
15
17
  ["lastMessageAt", null, instant],
16
18
  ["messages", null, () => RaizMessagePageCodec],
17
19
  ["outcomeReview", null, object([["reviewedAt", null, instant]])],
18
20
  ["recording", null, () => SignedUrlCodec],
19
21
  ["startedAt", null, instant],
20
22
  ["updatedAt", null, instant],
23
+ ["waitingSinceAt", null, instant],
21
24
  ["workers", null, array(() => RaizConversationWorkerCodec)],
22
25
  ]);
26
+ export const RaizConversationEventCodec = object([
27
+ ["at", null, instant],
28
+ ]);
23
29
  export const RaizConversationPageCodec = object([
24
30
  ["data", null, array(() => RaizConversationCodec)],
25
31
  ]);
@@ -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 { RaizAddressInUseFailure, RaizAgentInUseFailure, RaizAgentIntegrationProcedureInput, RaizAgentModalityLockedFailure, RaizAgentProcedureInput, RaizAgentProceduresInvalidFailure, RaizAgentProceduresInvalidFailureData, RaizAgentSettingsInvalidFailure, RaizAgentWorkflowInvalidFailure, RaizAgentWorkflowInvalidFailureData, RaizBulletinLimitReachedFailure, RaizBulletinPeriodInvalidFailure, RaizBusinessHours, RaizBusinessHoursWindow, RaizCallInProgressFailure, RaizCampaignAgentNotReadyFailure, RaizCampaignHeaderMissingFailure, RaizCampaignHeaderNotStoredFailure, RaizCampaignHeaderNotStoredFailureData, RaizCampaignNoRecipientsFailure, RaizCampaignVariableMissingFailure, RaizCampaignVariableMissingFailureData, RaizChannelAgentMismatchFailure, RaizChannelNotReadyFailure, RaizChannelTypeMismatchFailure, RaizContactHoursWindow, RaizContactSuppressedFailure, RaizConversationClosedFailure, RaizConversationNotHandedOffFailure, RaizConversationOpenFailure, RaizDailyReportInProgressFailure, RaizDailyReportRecipientsMissingFailure, RaizDefinitionNotActiveFailure, RaizDefinitionOptionsInvalidFailure, RaizDefinitionRetiredFailure, RaizDefinitionTypeLockedFailure, RaizEmailAddress, RaizEvalCasesUnavailableFailure, RaizEvalGateUnmetFailure, RaizFact, RaizFactSubjectMismatchFailure, RaizFactValueInvalidFailure, RaizFeedbackProposalUnavailableFailure, RaizHandoffAlreadyContinuedFailure, RaizIdentifierInUseFailure, RaizImportFileInvalidFailure, RaizImportFileTooLargeFailure, RaizIntegrationProcedureUnavailableFailure, RaizIntegrationToolUnavailableFailure, RaizIntegrationsUnavailableFailure, RaizInvalidCursorFailure, RaizInvalidStateFailure, RaizIpNetworkInvalidFailure, RaizKeyInUseFailure, RaizKnowledgeDocumentUnavailableFailure, RaizKnowledgeFileInvalidFailure, RaizKnowledgeKindMismatchFailure, RaizOutsideHoursTemplate, RaizPhoneNumber, RaizProviderRejectedError, RaizProviderRejectedFailure, RaizReplyInProgressFailure, RaizReportFilterUnsupportedFailure, RaizReportRangeInvalidFailure, RaizResourceNotFoundError, RaizResourceNotFoundFailure, RaizSourceConversationOpenFailure, RaizSuppressionExistsFailure, RaizTask, RaizTaskNotRetryableFailure, RaizTaskResponse, RaizTemplateHeaderFile, RaizTemplateHeaderMismatchFailure, RaizTemplateHeaderRequiredFailure, RaizTemplateNotApprovedFailure, RaizTemplateNotFoundFailure, RaizTemplateParametersMismatchFailure, RaizTemplateUnsupportedFailure, RaizTimeZoneUnknownFailure, RaizVersionConflictError, RaizVersionConflictFailure, RaizVoiceAgentNotReadyFailure, RaizVoiceUnavailableFailure, RaizWebsiteNotApprovedFailure, RaizWhatsappAiPausedFailure, RaizWhatsappDeliveryFailedFailure, RaizWhatsappMarketingStoppedFailure, RaizWhatsappMediaRejectedFailure, RaizWhatsappMessageUnsupportedFailure, RaizWhatsappRateLimitedFailure, RaizWhatsappRecipientUnavailableFailure, RaizWhatsappWindowClosedFailure, } from "./models.js";
5
+ export type { RaizAddressInUseFailure, RaizAgentInUseFailure, RaizAgentIntegrationProcedureInput, RaizAgentModalityLockedFailure, RaizAgentProcedureInput, RaizAgentProceduresInvalidFailure, RaizAgentProceduresInvalidFailureData, RaizAgentSettingsInvalidFailure, RaizAgentWorkflowInvalidFailure, RaizAgentWorkflowInvalidFailureData, RaizAssigneeUnavailableFailure, RaizBulletinLimitReachedFailure, RaizBulletinPeriodInvalidFailure, RaizBusinessHours, RaizBusinessHoursWindow, RaizCallInProgressFailure, RaizCampaignAgentNotReadyFailure, RaizCampaignHeaderMissingFailure, RaizCampaignHeaderNotStoredFailure, RaizCampaignHeaderNotStoredFailureData, RaizCampaignNoRecipientsFailure, RaizCampaignVariableMissingFailure, RaizCampaignVariableMissingFailureData, RaizChannelAgentMismatchFailure, RaizChannelNotReadyFailure, RaizChannelTypeMismatchFailure, RaizContactHoursWindow, RaizContactSuppressedFailure, RaizConversationClosedFailure, RaizConversationNotHandedOffFailure, RaizConversationOpenFailure, RaizDailyReportInProgressFailure, RaizDailyReportRecipientsMissingFailure, RaizDefinitionNotActiveFailure, RaizDefinitionOptionsInvalidFailure, RaizDefinitionRetiredFailure, RaizDefinitionTypeLockedFailure, RaizEmailAddress, RaizEvalCasesUnavailableFailure, RaizEvalGateUnmetFailure, RaizFact, RaizFactSubjectMismatchFailure, RaizFactValueInvalidFailure, RaizFeedbackProposalUnavailableFailure, RaizHandoffAlreadyContinuedFailure, RaizIdentifierInUseFailure, RaizImportFileInvalidFailure, RaizImportFileTooLargeFailure, RaizIntegrationProcedureUnavailableFailure, RaizIntegrationToolUnavailableFailure, RaizIntegrationsUnavailableFailure, RaizInvalidCursorFailure, RaizInvalidStateFailure, RaizIpNetworkInvalidFailure, RaizKeyInUseFailure, RaizKnowledgeDocumentUnavailableFailure, RaizKnowledgeFileInvalidFailure, RaizKnowledgeKindMismatchFailure, RaizOutsideHoursTemplate, RaizPhoneNumber, RaizProviderRejectedError, RaizProviderRejectedFailure, RaizReplyInProgressFailure, RaizReportFilterUnsupportedFailure, RaizReportRangeInvalidFailure, RaizResourceNotFoundError, RaizResourceNotFoundFailure, RaizSourceConversationOpenFailure, RaizSuppressionExistsFailure, RaizTask, RaizTaskNotRetryableFailure, RaizTaskResponse, RaizTeamUnavailableFailure, RaizTemplateHeaderFile, RaizTemplateHeaderMismatchFailure, RaizTemplateHeaderRequiredFailure, RaizTemplateNotApprovedFailure, RaizTemplateNotFoundFailure, RaizTemplateParametersMismatchFailure, RaizTemplateUnsupportedFailure, RaizTimeZoneUnknownFailure, RaizVersionConflictError, RaizVersionConflictFailure, RaizVoiceAgentNotReadyFailure, RaizVoiceUnavailableFailure, RaizWebsiteNotApprovedFailure, RaizWhatsappAiPausedFailure, RaizWhatsappDeliveryFailedFailure, RaizWhatsappMarketingStoppedFailure, RaizWhatsappMediaRejectedFailure, RaizWhatsappMessageUnsupportedFailure, RaizWhatsappRateLimitedFailure, RaizWhatsappRecipientUnavailableFailure, RaizWhatsappWindowClosedFailure, } from "./models.js";
@@ -324,6 +324,28 @@ export interface RaizAgentWorkflowInvalidFailureData {
324
324
  path: string;
325
325
  }[];
326
326
  }
327
+ /**
328
+ * That person cannot take conversations in this organization. `listAssignees`
329
+ * names who can.
330
+ */
331
+ export interface RaizAssigneeUnavailableFailure {
332
+ /**
333
+ * The failure code, stable across releases.
334
+ */
335
+ code: "ASSIGNEE_UNAVAILABLE";
336
+ /**
337
+ * No fields.
338
+ */
339
+ data: Empty;
340
+ /**
341
+ * What went wrong, for people; it never contains input values.
342
+ */
343
+ message: string;
344
+ /**
345
+ * Whether repeating the same request may succeed.
346
+ */
347
+ retryable: false;
348
+ }
327
349
  /**
328
350
  * The organization already has 30 bulletins in force or scheduled. End or
329
351
  * delete one before adding another.
@@ -1561,6 +1583,27 @@ export interface RaizTaskResponse {
1561
1583
  metadata: ResponseMetadata;
1562
1584
  success: true;
1563
1585
  }
1586
+ /**
1587
+ * The organization's team cannot be read right now. Try again shortly.
1588
+ */
1589
+ export interface RaizTeamUnavailableFailure {
1590
+ /**
1591
+ * The failure code, stable across releases.
1592
+ */
1593
+ code: "TEAM_UNAVAILABLE";
1594
+ /**
1595
+ * No fields.
1596
+ */
1597
+ data: Empty;
1598
+ /**
1599
+ * What went wrong, for people; it never contains input values.
1600
+ */
1601
+ message: string;
1602
+ /**
1603
+ * Whether repeating the same request may succeed.
1604
+ */
1605
+ retryable: true;
1606
+ }
1564
1607
  export interface RaizTemplateHeaderFile {
1565
1608
  /**
1566
1609
  * The file's bytes in base64, at most 5242880 bytes decoded.
@@ -77,6 +77,7 @@ export interface RaizOrganization {
77
77
  escalations: boolean;
78
78
  failedOutcomes: boolean;
79
79
  failures: boolean;
80
+ firstReplyMinutes: number;
80
81
  frequency: "immediate" | "hourly" | "every3Hours" | "every6Hours" | "every12Hours";
81
82
  phones: string[];
82
83
  recipients: RaizEmailAddress[];
@@ -202,6 +203,7 @@ export interface RaizUpdateOrganizationBody {
202
203
  escalations?: boolean | null;
203
204
  failedOutcomes?: boolean | null;
204
205
  failures?: boolean | null;
206
+ firstReplyMinutes?: number | null;
205
207
  frequency?: "immediate" | "hourly" | "every3Hours" | "every6Hours" | "every12Hours" | null;
206
208
  phones?: string[] | null;
207
209
  recipients?: RaizEmailAddress[] | null;
@@ -11,28 +11,32 @@ export interface Client {
11
11
  * Get a report
12
12
  *
13
13
  * Get the numbers behind a question. `name`: `conversations_daily`
14
- * (conversations the AI took part in, per day), `booking_details` (verified
15
- * individual creation receipts with patient, specialty, appointments and
16
- * later recorded cancellations; also requires conversation read/write
17
- * permission; filter specialty by its recorded code), `booking_outcomes`
18
- * (verified saved booking receipts by completion day and integration,
19
- * excluding tests, imports and deleted conversations; createdCount counts new
20
- * appointments created by the AI, not confirmations of existing appointments;
21
- * confirmedCount is its compatibility alias and must not be added again;
22
- * reschedules, cancellations, failures, pending and unverified results
23
- * separately), `tool_calls_daily` (Agent tool calls per day), `tool_calls`
24
- * (each call, newest first), `assessment_results_daily` (assessment results
25
- * per day), `pqrsf_daily` (PQRSF classification, confirmed informational
26
- * resolution and correct referrals from current pqrsf_* facts; unknown and
27
- * pending analysis remain visible; excludes tests/imports/deleted records),
28
- * each over days in the organization's time zone (`from`, `to`; the last 30
29
- * days by default), or `campaign_progress`. Narrow with `agentId`,
30
- * `channelType`, `campaignId` or `definitionId`; unsupported filters fail. At
31
- * most 1000 rows: `hasMore` means split the range or filter. Booking outcomes
32
- * return no partial totals when their evidence scan exceeds its bound.
33
- * Conversation success and completed tool calls never establish a booking;
34
- * these are historical receipts, not the provider's current appointment
35
- * status.
14
+ * (conversations the AI took part in, per day), `handoffs_daily` (the
15
+ * conversations the AI handed to the team per day, Agent and person: how many
16
+ * a person answered, how many within the organization's first-reply time and
17
+ * how soon on average, how many still wait, how many closed with nobody
18
+ * answering and how many went back to the AI; filter `agentId`),
19
+ * `booking_details` (verified individual creation receipts with patient,
20
+ * specialty, appointments and later recorded cancellations; also requires
21
+ * conversation read/write permission; filter specialty by its recorded code),
22
+ * `booking_outcomes` (verified saved booking receipts by completion day and
23
+ * integration, excluding tests, imports and deleted conversations;
24
+ * createdCount counts new appointments created by the AI, not confirmations
25
+ * of existing appointments; confirmedCount is its compatibility alias and
26
+ * must not be added again; reschedules, cancellations, failures, pending and
27
+ * unverified results separately), `tool_calls_daily` (Agent tool calls per
28
+ * day), `tool_calls` (each call, newest first), `assessment_results_daily`
29
+ * (assessment results per day), `pqrsf_daily` (PQRSF classification,
30
+ * confirmed informational resolution and correct referrals from current
31
+ * pqrsf_* facts; unknown and pending analysis remain visible; excludes
32
+ * tests/imports/deleted records), each over days in the organization's time
33
+ * zone (`from`, `to`; the last 30 days by default), or `campaign_progress`.
34
+ * Narrow with `agentId`, `channelType`, `campaignId` or `definitionId`;
35
+ * unsupported filters fail. At most 1000 rows: `hasMore` means split the
36
+ * range or filter. Booking outcomes return no partial totals when their
37
+ * evidence scan exceeds its bound. Conversation success and completed tool
38
+ * calls never establish a booking; these are historical receipts, not the
39
+ * provider's current appointment status.
36
40
  */
37
41
  get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
38
42
  }
@@ -68,11 +72,15 @@ export interface GetRequest {
68
72
  /**
69
73
  * `conversations_daily`: conversations the AI took part in per day, Agent,
70
74
  * channel type and direction, with outcomes and escalations (filters
71
- * `agentId`, `channelType`). `booking_details`: individual patients and
72
- * appointments from explicit successful creation receipts, including
73
- * specialty, paired exams, deduplication, matched patient names and later
74
- * recorded cancellations; filters agentId and specialty; requires
75
- * conversation read/write permission too. Historical receipts with
75
+ * `agentId`, `channelType`). `handoffs_daily`: the conversations the AI
76
+ * handed to the team, per day of the handoff, Agent and person (who answered
77
+ * first, else the case's owner), with how many were answered, answered in
78
+ * time, still waiting, closed unattended or returned to the AI, and the
79
+ * average seconds to the first answer (filter `agentId`). `booking_details`:
80
+ * individual patients and appointments from explicit successful creation
81
+ * receipts, including specialty, paired exams, deduplication, matched patient
82
+ * names and later recorded cancellations; filters agentId and specialty;
83
+ * requires conversation read/write permission too. Historical receipts with
76
84
  * created=true, not current provider status or all provider protocols.
77
85
  * unverifiedCount covers explicit creations missing a stable patient/slot.
78
86
  * `booking_outcomes`: verified saved booking receipts per completion day,
@@ -91,7 +99,7 @@ export interface GetRequest {
91
99
  * inferred. `campaign_progress`: recipients by status (filter `campaignId`;
92
100
  * no dates).
93
101
  */
94
- name: "conversations_daily" | "pqrsf_daily" | "tool_calls_daily" | "tool_calls" | "booking_outcomes" | "booking_details" | "assessment_results_daily" | "campaign_progress";
102
+ name: "conversations_daily" | "handoffs_daily" | "pqrsf_daily" | "tool_calls_daily" | "tool_calls" | "booking_outcomes" | "booking_details" | "assessment_results_daily" | "campaign_progress";
95
103
  /**
96
104
  * Last day (`YYYY-MM-DD`), inclusive, of a daily report. Default: today in
97
105
  * the organization's time zone.
@@ -45,6 +45,24 @@ export type RaizReport = {
45
45
  toReviewCount: number;
46
46
  }[];
47
47
  to: Temporal.PlainDate;
48
+ } | {
49
+ from: Temporal.PlainDate;
50
+ hasMore: boolean;
51
+ name: "handoffs_daily";
52
+ rows: {
53
+ agentId: string | null;
54
+ agentName: string | null;
55
+ answeredCount: number;
56
+ answeredInTimeCount: number;
57
+ avgFirstReplySeconds: number | null;
58
+ day: Temporal.PlainDate;
59
+ handoffCount: number;
60
+ memberId: string | null;
61
+ returnedCount: number;
62
+ unattendedCount: number;
63
+ waitingCount: number;
64
+ }[];
65
+ to: Temporal.PlainDate;
48
66
  } | {
49
67
  from: Temporal.PlainDate;
50
68
  hasMore: boolean;
@@ -1,7 +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
- export const RaizReportCodec = union([object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["occurredAt", null, instant]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["appointmentDate", null, date], ["cancelledAt", null, instant], ["createdAt", null, instant], ["day", null, date]]))], ["snapshotAt", null, instant], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]])]);
4
+ export const RaizReportCodec = union([object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["occurredAt", null, instant]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["appointmentDate", null, date], ["cancelledAt", null, instant], ["createdAt", null, instant], ["day", null, date]]))], ["snapshotAt", null, instant], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]])]);
5
5
  export const RaizReportResponseCodec = object([
6
6
  ["data", null, () => RaizReportCodec],
7
7
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbol-ai/sdk",
3
- "version": "5.58.0",
3
+ "version": "5.59.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",
@@ -58,8 +58,8 @@
58
58
  "packageManager": "bun@1.4.3",
59
59
  "arbol": {
60
60
  "openapi": {
61
- "release": "1.20261113.150152",
62
- "sha256": "5846d7f85161ffc99a3121a402c3da9d4715375f9ea331a74c815e682af08e8d"
61
+ "release": "1.20261114.55927",
62
+ "sha256": "462eea12036d37178570a5523a10281d5389066b5910e996572d5e3a70f1de66"
63
63
  }
64
64
  }
65
65
  }