portal-aiatende-api 0.11.1 → 0.13.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.
package/dist/index.d.mts CHANGED
@@ -62,6 +62,16 @@ interface CalendarConfig {
62
62
  mappings?: Record<string, string>;
63
63
  businessHours?: BusinessHours;
64
64
  }
65
+ /** Aviso de funcionamento do estabelecimento (ex.: "fechado dia 15/11") — só contexto informativo pra IA, nunca bloqueia o atendimento (diferente de schedule.dateExceptions). */
66
+ interface OperationalNotice {
67
+ id: string;
68
+ /** "YYYY-MM-DD" */
69
+ dateFrom: string;
70
+ /** "YYYY-MM-DD" — ausente/null = só dateFrom */
71
+ dateTo?: string | null;
72
+ title: string;
73
+ instruction: string;
74
+ }
65
75
  interface AiConfig {
66
76
  id: string;
67
77
  clientId: string;
@@ -101,6 +111,12 @@ interface AiConfig {
101
111
  autoPauseIgnoreSalesbot?: boolean;
102
112
  /** A Kommo não diferencia (via webhook/API) uma DM do Instagram de uma resposta a comentário/story — ambas chegam idênticas. Por isso este controle vale pro canal Instagram inteiro: false = mensagens do Instagram são armazenadas mas a IA não responde nem agenda nudge. Default true preserva o comportamento atual. */
103
113
  instagramAiResponseEnabled?: boolean;
114
+ /** Trava de conversa em loop: true = quando a conversa vira ping-pong com um robô (ritmo anormal de respostas da IA, ou o lead repetindo os mesmos 1–2 textos longos), o atende360-assistant deixa a IA INATIVA no lead antes de gerar/enviar mais uma resposta e avisa a equipe por nota, tag "IA em loop" e tarefa. Só vale para o canal Kommo. Default false (opt-in por cliente). */
115
+ conversationLoopGuardEnabled?: boolean;
116
+ /** ID do usuário Kommo que recebe a tarefa de revisão quando a trava anti-loop dispara. null/ausente = não cria tarefa (nota, tag e IA INATIVA continuam). */
117
+ conversationLoopGuardTaskUserId?: number | null;
118
+ /** Avisos de funcionamento do estabelecimento — injetados como contexto informativo no prompt (próximos 30 dias). Nunca bloqueiam a IA. */
119
+ operationalNotices?: OperationalNotice[];
104
120
  /** Estado inicial da IA (tags IA ATIVA/IA INATIVA) pra um lead que ainda não tem nenhuma das 3 tags de estado. */
105
121
  untaggedLeadAiState?: 'inactive' | 'active' | 'active_for_new_leads';
106
122
  /** Estado da IA após handoff. 'inactive' = trava permanente e global (nunca reativa sozinha). 'untag' = remove a tag, elegível pro bootstrap na próxima mensagem. */
@@ -814,4 +830,4 @@ declare class PortalApiError extends Error {
814
830
  constructor(message: string, info?: Partial<PortalApiError>);
815
831
  }
816
832
 
817
- export { type AiActivationSchedule, type AiCareStatus, type AiConfig, type AiExperiment, type AiExperimentConfig, type AiExperimentCriteria, type AiExperimentVariant, type AiPrompt, type AiResumeMode, type AiTimelineEvent, type AiTimelineSearchEvent, type AiTimelineSearchResponse, type BusinessHours, type CalendarConfig, type Client, type ClientsListResponse, ClientsResource, type Contact, type ContactByConversationResponse, type ContactFieldDefinition, type ContactFieldOption, type ContactFieldType, ContactsResource, type ConversationHistoryMessage, type CreateToolEventPayload, type DateException, type DownloadMediaResponse, type GetInternalContextParams, type InternalContextChunk, type InternalContextResult, KnowledgeResource, type KommoAccount, type KommoConfig, type KommoInstallType, type ListConversationsFilters, type LossReasonMapping, type MessagingContact, type MessagingConversation, type MessagingConversationsListResponse, type MessagingMediaItem, type MessagingMessage, type MessagingMessagesListResponse, type MessagingPhoneNumber, MessagingResource, type MessagingSearchMessage, type MessagingSearchMessagesResponse, type NudgeSettings, type PatchConversationPayload, type PipelineMapping, PortalApiError, PortalClient, type PortalClientConfig, type SearchMessagesFilters, type SearchPagination, type SendMessagePayload, type SendMessageResponse, type StageMapping, type TimeRange, type TimelineAttachment, type UpdateContactPayload, type UploadMediaPayload, type UploadMediaResponse, type Wazzup, type WazzupChannel };
833
+ export { type AiActivationSchedule, type AiCareStatus, type AiConfig, type AiExperiment, type AiExperimentConfig, type AiExperimentCriteria, type AiExperimentVariant, type AiPrompt, type AiResumeMode, type AiTimelineEvent, type AiTimelineSearchEvent, type AiTimelineSearchResponse, type BusinessHours, type CalendarConfig, type Client, type ClientsListResponse, ClientsResource, type Contact, type ContactByConversationResponse, type ContactFieldDefinition, type ContactFieldOption, type ContactFieldType, ContactsResource, type ConversationHistoryMessage, type CreateToolEventPayload, type DateException, type DownloadMediaResponse, type GetInternalContextParams, type InternalContextChunk, type InternalContextResult, KnowledgeResource, type KommoAccount, type KommoConfig, type KommoInstallType, type ListConversationsFilters, type LossReasonMapping, type MessagingContact, type MessagingConversation, type MessagingConversationsListResponse, type MessagingMediaItem, type MessagingMessage, type MessagingMessagesListResponse, type MessagingPhoneNumber, MessagingResource, type MessagingSearchMessage, type MessagingSearchMessagesResponse, type NudgeSettings, type OperationalNotice, type PatchConversationPayload, type PipelineMapping, PortalApiError, PortalClient, type PortalClientConfig, type SearchMessagesFilters, type SearchPagination, type SendMessagePayload, type SendMessageResponse, type StageMapping, type TimeRange, type TimelineAttachment, type UpdateContactPayload, type UploadMediaPayload, type UploadMediaResponse, type Wazzup, type WazzupChannel };
package/dist/index.d.ts CHANGED
@@ -62,6 +62,16 @@ interface CalendarConfig {
62
62
  mappings?: Record<string, string>;
63
63
  businessHours?: BusinessHours;
64
64
  }
65
+ /** Aviso de funcionamento do estabelecimento (ex.: "fechado dia 15/11") — só contexto informativo pra IA, nunca bloqueia o atendimento (diferente de schedule.dateExceptions). */
66
+ interface OperationalNotice {
67
+ id: string;
68
+ /** "YYYY-MM-DD" */
69
+ dateFrom: string;
70
+ /** "YYYY-MM-DD" — ausente/null = só dateFrom */
71
+ dateTo?: string | null;
72
+ title: string;
73
+ instruction: string;
74
+ }
65
75
  interface AiConfig {
66
76
  id: string;
67
77
  clientId: string;
@@ -101,6 +111,12 @@ interface AiConfig {
101
111
  autoPauseIgnoreSalesbot?: boolean;
102
112
  /** A Kommo não diferencia (via webhook/API) uma DM do Instagram de uma resposta a comentário/story — ambas chegam idênticas. Por isso este controle vale pro canal Instagram inteiro: false = mensagens do Instagram são armazenadas mas a IA não responde nem agenda nudge. Default true preserva o comportamento atual. */
103
113
  instagramAiResponseEnabled?: boolean;
114
+ /** Trava de conversa em loop: true = quando a conversa vira ping-pong com um robô (ritmo anormal de respostas da IA, ou o lead repetindo os mesmos 1–2 textos longos), o atende360-assistant deixa a IA INATIVA no lead antes de gerar/enviar mais uma resposta e avisa a equipe por nota, tag "IA em loop" e tarefa. Só vale para o canal Kommo. Default false (opt-in por cliente). */
115
+ conversationLoopGuardEnabled?: boolean;
116
+ /** ID do usuário Kommo que recebe a tarefa de revisão quando a trava anti-loop dispara. null/ausente = não cria tarefa (nota, tag e IA INATIVA continuam). */
117
+ conversationLoopGuardTaskUserId?: number | null;
118
+ /** Avisos de funcionamento do estabelecimento — injetados como contexto informativo no prompt (próximos 30 dias). Nunca bloqueiam a IA. */
119
+ operationalNotices?: OperationalNotice[];
104
120
  /** Estado inicial da IA (tags IA ATIVA/IA INATIVA) pra um lead que ainda não tem nenhuma das 3 tags de estado. */
105
121
  untaggedLeadAiState?: 'inactive' | 'active' | 'active_for_new_leads';
106
122
  /** Estado da IA após handoff. 'inactive' = trava permanente e global (nunca reativa sozinha). 'untag' = remove a tag, elegível pro bootstrap na próxima mensagem. */
@@ -814,4 +830,4 @@ declare class PortalApiError extends Error {
814
830
  constructor(message: string, info?: Partial<PortalApiError>);
815
831
  }
816
832
 
817
- export { type AiActivationSchedule, type AiCareStatus, type AiConfig, type AiExperiment, type AiExperimentConfig, type AiExperimentCriteria, type AiExperimentVariant, type AiPrompt, type AiResumeMode, type AiTimelineEvent, type AiTimelineSearchEvent, type AiTimelineSearchResponse, type BusinessHours, type CalendarConfig, type Client, type ClientsListResponse, ClientsResource, type Contact, type ContactByConversationResponse, type ContactFieldDefinition, type ContactFieldOption, type ContactFieldType, ContactsResource, type ConversationHistoryMessage, type CreateToolEventPayload, type DateException, type DownloadMediaResponse, type GetInternalContextParams, type InternalContextChunk, type InternalContextResult, KnowledgeResource, type KommoAccount, type KommoConfig, type KommoInstallType, type ListConversationsFilters, type LossReasonMapping, type MessagingContact, type MessagingConversation, type MessagingConversationsListResponse, type MessagingMediaItem, type MessagingMessage, type MessagingMessagesListResponse, type MessagingPhoneNumber, MessagingResource, type MessagingSearchMessage, type MessagingSearchMessagesResponse, type NudgeSettings, type PatchConversationPayload, type PipelineMapping, PortalApiError, PortalClient, type PortalClientConfig, type SearchMessagesFilters, type SearchPagination, type SendMessagePayload, type SendMessageResponse, type StageMapping, type TimeRange, type TimelineAttachment, type UpdateContactPayload, type UploadMediaPayload, type UploadMediaResponse, type Wazzup, type WazzupChannel };
833
+ export { type AiActivationSchedule, type AiCareStatus, type AiConfig, type AiExperiment, type AiExperimentConfig, type AiExperimentCriteria, type AiExperimentVariant, type AiPrompt, type AiResumeMode, type AiTimelineEvent, type AiTimelineSearchEvent, type AiTimelineSearchResponse, type BusinessHours, type CalendarConfig, type Client, type ClientsListResponse, ClientsResource, type Contact, type ContactByConversationResponse, type ContactFieldDefinition, type ContactFieldOption, type ContactFieldType, ContactsResource, type ConversationHistoryMessage, type CreateToolEventPayload, type DateException, type DownloadMediaResponse, type GetInternalContextParams, type InternalContextChunk, type InternalContextResult, KnowledgeResource, type KommoAccount, type KommoConfig, type KommoInstallType, type ListConversationsFilters, type LossReasonMapping, type MessagingContact, type MessagingConversation, type MessagingConversationsListResponse, type MessagingMediaItem, type MessagingMessage, type MessagingMessagesListResponse, type MessagingPhoneNumber, MessagingResource, type MessagingSearchMessage, type MessagingSearchMessagesResponse, type NudgeSettings, type OperationalNotice, type PatchConversationPayload, type PipelineMapping, PortalApiError, PortalClient, type PortalClientConfig, type SearchMessagesFilters, type SearchPagination, type SendMessagePayload, type SendMessageResponse, type StageMapping, type TimeRange, type TimelineAttachment, type UpdateContactPayload, type UploadMediaPayload, type UploadMediaResponse, type Wazzup, type WazzupChannel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "portal-aiatende-api",
3
- "version": "0.11.1",
3
+ "version": "0.13.0",
4
4
  "description": "Cliente TypeScript tipado para a API interna do Portal AI Atende.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",