@wrcb/cb-common 1.0.898 → 1.0.900
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/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/services/RedisService.d.ts +8 -0
- package/build/services/RedisService.js +17 -0
- package/build/types/clinica.d.ts +270 -0
- package/build/types/clinica.js +141 -0
- package/build/types/crm.d.ts +13 -2
- package/build/types/crm.js +24 -0
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export * from './types/predictionType';
|
|
|
58
58
|
export * from './types/mercadoProfissional';
|
|
59
59
|
export * from './types/trabalhoHomeOffice';
|
|
60
60
|
export * from './types/crm';
|
|
61
|
+
export * from './types/clinica';
|
|
61
62
|
export * from './types/companion';
|
|
62
63
|
export * from './events/subjects';
|
|
63
64
|
export * from './events/baseListener';
|
package/build/index.js
CHANGED
|
@@ -86,6 +86,7 @@ __exportStar(require("./types/mercadoProfissional"), exports);
|
|
|
86
86
|
__exportStar(require("./types/trabalhoHomeOffice"), exports);
|
|
87
87
|
// crm — núcleo multi-tenant (pipeline configurável + agente de IA)
|
|
88
88
|
__exportStar(require("./types/crm"), exports);
|
|
89
|
+
__exportStar(require("./types/clinica"), exports);
|
|
89
90
|
__exportStar(require("./types/companion"), exports);
|
|
90
91
|
__exportStar(require("./events/subjects"), exports);
|
|
91
92
|
__exportStar(require("./events/baseListener"), exports);
|
|
@@ -21,4 +21,12 @@ export declare class RedisService {
|
|
|
21
21
|
static babeliaWordQuestionsKey(word: string, language: string): string;
|
|
22
22
|
static babeliaTopicsListKey(language: string, level: string, activityType: string, topicType?: string): string;
|
|
23
23
|
static babeliaLeaderboardKey(userId: string): string;
|
|
24
|
+
/** Trava de agenda de UM profissional enquanto um horário é marcado. */
|
|
25
|
+
static clinicaSlotLockKey(tenant: Tenant, professionalId: string): string;
|
|
26
|
+
/** Configuração da agenda da conta (lida a cada mensagem que chega). */
|
|
27
|
+
static clinicaAgendaSettingsKey(tenant: Tenant, ownerId: string): string;
|
|
28
|
+
/** Rodada de um worker periódico: só um pod roda por vez. */
|
|
29
|
+
static clinicaRoundLockKey(tenant: Tenant, worker: string): string;
|
|
30
|
+
/** Cache das leituras da Meta (campanhas, posts) de uma conta. */
|
|
31
|
+
static clinicaMetaCacheKey(tenant: Tenant, ownerId: string, what: string): string;
|
|
24
32
|
}
|
|
@@ -68,5 +68,22 @@ class RedisService {
|
|
|
68
68
|
static babeliaLeaderboardKey(userId) {
|
|
69
69
|
return `babelia:leaderboard:${userId}`;
|
|
70
70
|
}
|
|
71
|
+
// --- Pacientto (clinica-backend) -----------------------------------------
|
|
72
|
+
/** Trava de agenda de UM profissional enquanto um horário é marcado. */
|
|
73
|
+
static clinicaSlotLockKey(tenant, professionalId) {
|
|
74
|
+
return `${tenant}:clinica:slot-lock:${professionalId}`;
|
|
75
|
+
}
|
|
76
|
+
/** Configuração da agenda da conta (lida a cada mensagem que chega). */
|
|
77
|
+
static clinicaAgendaSettingsKey(tenant, ownerId) {
|
|
78
|
+
return `${tenant}:clinica:agenda-settings:${ownerId}`;
|
|
79
|
+
}
|
|
80
|
+
/** Rodada de um worker periódico: só um pod roda por vez. */
|
|
81
|
+
static clinicaRoundLockKey(tenant, worker) {
|
|
82
|
+
return `${tenant}:clinica:round:${worker}`;
|
|
83
|
+
}
|
|
84
|
+
/** Cache das leituras da Meta (campanhas, posts) de uma conta. */
|
|
85
|
+
static clinicaMetaCacheKey(tenant, ownerId, what) {
|
|
86
|
+
return `${tenant}:clinica:meta:${ownerId}:${what}`;
|
|
87
|
+
}
|
|
71
88
|
}
|
|
72
89
|
exports.RedisService = RedisService;
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
export declare enum ClinicaAppointmentStatus {
|
|
2
|
+
AwaitingDeposit = "AwaitingDeposit",
|
|
3
|
+
Confirmed = "Confirmed",
|
|
4
|
+
Cancelled = "Cancelled",
|
|
5
|
+
Completed = "Completed",
|
|
6
|
+
NoShow = "NoShow"
|
|
7
|
+
}
|
|
8
|
+
export declare enum ClinicaAppointmentSource {
|
|
9
|
+
Ai = "Ai",
|
|
10
|
+
Panel = "Panel",
|
|
11
|
+
Assistant = "Assistant"
|
|
12
|
+
}
|
|
13
|
+
export declare enum ClinicaCancelReason {
|
|
14
|
+
PatientRequested = "PatientRequested",
|
|
15
|
+
ClinicRescheduled = "ClinicRescheduled",
|
|
16
|
+
DepositExpired = "DepositExpired",
|
|
17
|
+
Other = "Other"
|
|
18
|
+
}
|
|
19
|
+
export declare enum ClinicaDepositStatus {
|
|
20
|
+
NotRequired = "NotRequired",
|
|
21
|
+
Pending = "Pending",
|
|
22
|
+
Approved = "Approved",
|
|
23
|
+
Rejected = "Rejected",
|
|
24
|
+
Expired = "Expired"
|
|
25
|
+
}
|
|
26
|
+
/** Um intervalo de atendimento na semana. `weekday`: 0 = domingo. */
|
|
27
|
+
export interface ClinicaWeeklySlot {
|
|
28
|
+
weekday: number;
|
|
29
|
+
start: string;
|
|
30
|
+
end: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Como a profissional libera a agenda.
|
|
34
|
+
* - Weekly: grade da semana (seg a sex, 9h às 18h…), vale toda semana.
|
|
35
|
+
* - SpecificDays: tudo começa fechado; ela libera dia a dia ("19/10 em
|
|
36
|
+
* Piumhi, das 9h às 18h"), pela tela ou pelo assistente.
|
|
37
|
+
* Dia liberado vale nos dois modos: no semanal, é um dia a mais.
|
|
38
|
+
*/
|
|
39
|
+
export declare enum ClinicaAvailabilityMode {
|
|
40
|
+
Weekly = "Weekly",
|
|
41
|
+
SpecificDays = "SpecificDays"
|
|
42
|
+
}
|
|
43
|
+
/** Um dia liberado (modo SpecificDays). `date`: AAAA-MM-DD; horas "HH:MM", no fuso da conta. */
|
|
44
|
+
export interface ClinicaOpenDay {
|
|
45
|
+
clinicId: string;
|
|
46
|
+
date: string;
|
|
47
|
+
start: string;
|
|
48
|
+
end: string;
|
|
49
|
+
}
|
|
50
|
+
/** Lembrete enviado antes do horário marcado (ex.: 1 dia antes). */
|
|
51
|
+
export interface ClinicaReminder {
|
|
52
|
+
beforeMinutes: number;
|
|
53
|
+
text: string | null;
|
|
54
|
+
aiInstruction: string | null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* O que é da conta, e não de cada profissional: o fuso da agenda e o jeito
|
|
58
|
+
* da IA conversar.
|
|
59
|
+
*/
|
|
60
|
+
export interface ClinicaAgendaSettings {
|
|
61
|
+
timezone: string;
|
|
62
|
+
readDelaySeconds: number;
|
|
63
|
+
audioEnabled: boolean;
|
|
64
|
+
fishVoiceId: string | null;
|
|
65
|
+
reclassifySuggestions: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* As regras de agenda de UMA profissional. Cada uma configura as suas: grade,
|
|
69
|
+
* antecedência, Pix, prazo de cancelamento, lembretes e se a IA pode mandar
|
|
70
|
+
* fotos de resultado (a regra de publicidade muda por conselho: CFM, CFO…).
|
|
71
|
+
*/
|
|
72
|
+
export interface ClinicaProfessionalRules {
|
|
73
|
+
availabilityMode: ClinicaAvailabilityMode;
|
|
74
|
+
slotMinutes: number;
|
|
75
|
+
minNoticeMinutes: number;
|
|
76
|
+
maxDaysAhead: number;
|
|
77
|
+
depositHoldMinutes: number;
|
|
78
|
+
cancelWithoutLossHours: number;
|
|
79
|
+
pixKey: string | null;
|
|
80
|
+
pixKeyHolder: string | null;
|
|
81
|
+
reminders: ClinicaReminder[];
|
|
82
|
+
photosEnabled: boolean;
|
|
83
|
+
}
|
|
84
|
+
/** 1 = só informa, 3 = equilibrada (padrão), 5 = máxima. */
|
|
85
|
+
export type ClinicaAggressiveness = 1 | 2 | 3 | 4 | 5;
|
|
86
|
+
/** Foto de resultado de um atendimento do catálogo. */
|
|
87
|
+
export interface ClinicaServicePhoto {
|
|
88
|
+
id: string;
|
|
89
|
+
key: string;
|
|
90
|
+
caption: string;
|
|
91
|
+
tags: string[];
|
|
92
|
+
consent: boolean;
|
|
93
|
+
}
|
|
94
|
+
export interface ClinicaStageSuggestion {
|
|
95
|
+
stageKey: string;
|
|
96
|
+
reason: string;
|
|
97
|
+
createdAt: Date;
|
|
98
|
+
}
|
|
99
|
+
export interface ClinicaTestChatMessage {
|
|
100
|
+
role: 'user' | 'assistant';
|
|
101
|
+
content: string;
|
|
102
|
+
}
|
|
103
|
+
/** Uma ferramenta usada pela IA no teste. As que mudam dado são simuladas. */
|
|
104
|
+
export interface ClinicaTestChatStep {
|
|
105
|
+
tool: string;
|
|
106
|
+
arguments: Record<string, string | number | boolean | null | string[]>;
|
|
107
|
+
result: string;
|
|
108
|
+
succeeded: boolean;
|
|
109
|
+
simulated: boolean;
|
|
110
|
+
}
|
|
111
|
+
export interface ClinicaTestChatPhoto {
|
|
112
|
+
url: string;
|
|
113
|
+
caption: string;
|
|
114
|
+
}
|
|
115
|
+
export interface ClinicaTestChatResult {
|
|
116
|
+
reply: string;
|
|
117
|
+
steps: ClinicaTestChatStep[];
|
|
118
|
+
sources: string[];
|
|
119
|
+
photos: ClinicaTestChatPhoto[];
|
|
120
|
+
audio: string | null;
|
|
121
|
+
handoff: string | null;
|
|
122
|
+
stageKey: string;
|
|
123
|
+
}
|
|
124
|
+
export declare enum ClinicaMetaStatus {
|
|
125
|
+
Pending = "Pending",
|
|
126
|
+
Active = "Active",
|
|
127
|
+
Expired = "Expired"
|
|
128
|
+
}
|
|
129
|
+
export interface ClinicaMetaPageOption {
|
|
130
|
+
id: string;
|
|
131
|
+
name: string;
|
|
132
|
+
igUserId: string | null;
|
|
133
|
+
igUsername: string | null;
|
|
134
|
+
}
|
|
135
|
+
export interface ClinicaMetaAdAccountOption {
|
|
136
|
+
id: string;
|
|
137
|
+
name: string;
|
|
138
|
+
currency: string;
|
|
139
|
+
}
|
|
140
|
+
export declare enum ClinicaCommentPlatform {
|
|
141
|
+
Instagram = "Instagram",
|
|
142
|
+
Facebook = "Facebook"
|
|
143
|
+
}
|
|
144
|
+
/** Resposta automática a comentários (estilo ManyChat, só comentários). */
|
|
145
|
+
export interface ClinicaCommentRule {
|
|
146
|
+
id: string;
|
|
147
|
+
name: string;
|
|
148
|
+
isActive: boolean;
|
|
149
|
+
platforms: ClinicaCommentPlatform[];
|
|
150
|
+
keywords: string[];
|
|
151
|
+
postIds: string[];
|
|
152
|
+
publicReplies: string[];
|
|
153
|
+
aiPublicReply: boolean;
|
|
154
|
+
privateMessage: string | null;
|
|
155
|
+
}
|
|
156
|
+
export declare enum ClinicaCampaignAutomationMode {
|
|
157
|
+
Off = "Off",
|
|
158
|
+
SemiAutomatic = "SemiAutomatic",
|
|
159
|
+
Automatic = "Automatic"
|
|
160
|
+
}
|
|
161
|
+
export interface ClinicaCampaignLimits {
|
|
162
|
+
maxDailySpendCents: number | null;
|
|
163
|
+
maxMonthlySpendCents: number | null;
|
|
164
|
+
maxBudgetIncreasePercent: number;
|
|
165
|
+
}
|
|
166
|
+
export declare enum ClinicaCampaignActionType {
|
|
167
|
+
Pause = "Pause",
|
|
168
|
+
Activate = "Activate",
|
|
169
|
+
SetDailyBudget = "SetDailyBudget",
|
|
170
|
+
CreateFromPost = "CreateFromPost"
|
|
171
|
+
}
|
|
172
|
+
export declare enum ClinicaCampaignActionOrigin {
|
|
173
|
+
Panel = "Panel",
|
|
174
|
+
Assistant = "Assistant",
|
|
175
|
+
Automation = "Automation"
|
|
176
|
+
}
|
|
177
|
+
export declare enum ClinicaCampaignActionStatus {
|
|
178
|
+
Suggested = "Suggested",
|
|
179
|
+
Executed = "Executed",
|
|
180
|
+
Rejected = "Rejected",
|
|
181
|
+
Failed = "Failed"
|
|
182
|
+
}
|
|
183
|
+
export interface ClinicaCampaignMetrics {
|
|
184
|
+
campaignId: string;
|
|
185
|
+
name: string;
|
|
186
|
+
status: string;
|
|
187
|
+
objective: string | null;
|
|
188
|
+
dailyBudgetCents: number | null;
|
|
189
|
+
spendCents: number;
|
|
190
|
+
impressions: number;
|
|
191
|
+
reach: number;
|
|
192
|
+
clicks: number;
|
|
193
|
+
conversations: number;
|
|
194
|
+
leads: number;
|
|
195
|
+
appointments: number;
|
|
196
|
+
costPerLeadCents: number | null;
|
|
197
|
+
costPerAppointmentCents: number | null;
|
|
198
|
+
}
|
|
199
|
+
export interface ClinicaMetaPost {
|
|
200
|
+
id: string;
|
|
201
|
+
platform: ClinicaCommentPlatform;
|
|
202
|
+
caption: string;
|
|
203
|
+
mediaType: string;
|
|
204
|
+
permalink: string | null;
|
|
205
|
+
thumbnailUrl: string | null;
|
|
206
|
+
publishedAt: string;
|
|
207
|
+
likes: number;
|
|
208
|
+
comments: number;
|
|
209
|
+
reach: number | null;
|
|
210
|
+
saves: number | null;
|
|
211
|
+
shares: number | null;
|
|
212
|
+
views: number | null;
|
|
213
|
+
}
|
|
214
|
+
export interface ClinicaCreativeScript {
|
|
215
|
+
hook: string;
|
|
216
|
+
lines: string[];
|
|
217
|
+
onScreenText: string[];
|
|
218
|
+
caption: string;
|
|
219
|
+
}
|
|
220
|
+
export interface ClinicaCreativeSuggestion {
|
|
221
|
+
title: string;
|
|
222
|
+
basedOn: string[];
|
|
223
|
+
why: string;
|
|
224
|
+
script: ClinicaCreativeScript;
|
|
225
|
+
}
|
|
226
|
+
export interface ClinicaCreativeRankingItem {
|
|
227
|
+
postId: string;
|
|
228
|
+
verdict: 'focar' | 'manter' | 'deixar';
|
|
229
|
+
reason: string;
|
|
230
|
+
}
|
|
231
|
+
/** De qual anúncio veio o contato (clique para o WhatsApp). */
|
|
232
|
+
export interface ClinicaAdReferral {
|
|
233
|
+
adId: string;
|
|
234
|
+
campaignId: string | null;
|
|
235
|
+
headline: string | null;
|
|
236
|
+
sourceUrl: string | null;
|
|
237
|
+
receivedAt: Date;
|
|
238
|
+
}
|
|
239
|
+
export declare enum ClinicaAssistantActionType {
|
|
240
|
+
RequestReschedule = "RequestReschedule",
|
|
241
|
+
MoveAppointment = "MoveAppointment",
|
|
242
|
+
CancelAppointment = "CancelAppointment",
|
|
243
|
+
BlockAgenda = "BlockAgenda",
|
|
244
|
+
OpenDay = "OpenDay",
|
|
245
|
+
SendMessage = "SendMessage",
|
|
246
|
+
MoveLeadStage = "MoveLeadStage",
|
|
247
|
+
PauseCampaign = "PauseCampaign",
|
|
248
|
+
ActivateCampaign = "ActivateCampaign",
|
|
249
|
+
SetCampaignBudget = "SetCampaignBudget",
|
|
250
|
+
CreateCampaignFromPost = "CreateCampaignFromPost"
|
|
251
|
+
}
|
|
252
|
+
export declare enum ClinicaAssistantPlanStatus {
|
|
253
|
+
Proposed = "Proposed",
|
|
254
|
+
Running = "Running",
|
|
255
|
+
Done = "Done",
|
|
256
|
+
PartiallyFailed = "PartiallyFailed",
|
|
257
|
+
Discarded = "Discarded"
|
|
258
|
+
}
|
|
259
|
+
export declare enum ClinicaAssistantActionStatus {
|
|
260
|
+
Pending = "Pending",
|
|
261
|
+
Done = "Done",
|
|
262
|
+
Failed = "Failed"
|
|
263
|
+
}
|
|
264
|
+
export interface ClinicaAssistantAction {
|
|
265
|
+
type: ClinicaAssistantActionType;
|
|
266
|
+
description: string;
|
|
267
|
+
params: Record<string, string | number | boolean | null>;
|
|
268
|
+
status: ClinicaAssistantActionStatus;
|
|
269
|
+
error: string | null;
|
|
270
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Tipos do Pacientto (clinica-backend / clinica-frontend): agenda, sinal por
|
|
3
|
+
// Pix, áudio e assistente de comandos. O núcleo de CRM (funil, conversa,
|
|
4
|
+
// follow-up) continua em ./crm.ts.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ClinicaAssistantActionStatus = exports.ClinicaAssistantPlanStatus = exports.ClinicaAssistantActionType = exports.ClinicaCampaignActionStatus = exports.ClinicaCampaignActionOrigin = exports.ClinicaCampaignActionType = exports.ClinicaCampaignAutomationMode = exports.ClinicaCommentPlatform = exports.ClinicaMetaStatus = exports.ClinicaAvailabilityMode = exports.ClinicaDepositStatus = exports.ClinicaCancelReason = exports.ClinicaAppointmentSource = exports.ClinicaAppointmentStatus = void 0;
|
|
7
|
+
// ============================================
|
|
8
|
+
// AGENDA
|
|
9
|
+
// ============================================
|
|
10
|
+
var ClinicaAppointmentStatus;
|
|
11
|
+
(function (ClinicaAppointmentStatus) {
|
|
12
|
+
// Horário reservado esperando o comprovante do sinal. Libera sozinho quando
|
|
13
|
+
// `deposit.expiresAt` passa.
|
|
14
|
+
ClinicaAppointmentStatus["AwaitingDeposit"] = "AwaitingDeposit";
|
|
15
|
+
ClinicaAppointmentStatus["Confirmed"] = "Confirmed";
|
|
16
|
+
ClinicaAppointmentStatus["Cancelled"] = "Cancelled";
|
|
17
|
+
ClinicaAppointmentStatus["Completed"] = "Completed";
|
|
18
|
+
ClinicaAppointmentStatus["NoShow"] = "NoShow";
|
|
19
|
+
})(ClinicaAppointmentStatus || (exports.ClinicaAppointmentStatus = ClinicaAppointmentStatus = {}));
|
|
20
|
+
var ClinicaAppointmentSource;
|
|
21
|
+
(function (ClinicaAppointmentSource) {
|
|
22
|
+
// Marcado pela IA no WhatsApp.
|
|
23
|
+
ClinicaAppointmentSource["Ai"] = "Ai";
|
|
24
|
+
// Marcado pela equipe no painel.
|
|
25
|
+
ClinicaAppointmentSource["Panel"] = "Panel";
|
|
26
|
+
// Marcado pelo assistente de comandos.
|
|
27
|
+
ClinicaAppointmentSource["Assistant"] = "Assistant";
|
|
28
|
+
})(ClinicaAppointmentSource || (exports.ClinicaAppointmentSource = ClinicaAppointmentSource = {}));
|
|
29
|
+
var ClinicaCancelReason;
|
|
30
|
+
(function (ClinicaCancelReason) {
|
|
31
|
+
ClinicaCancelReason["PatientRequested"] = "PatientRequested";
|
|
32
|
+
ClinicaCancelReason["ClinicRescheduled"] = "ClinicRescheduled";
|
|
33
|
+
ClinicaCancelReason["DepositExpired"] = "DepositExpired";
|
|
34
|
+
ClinicaCancelReason["Other"] = "Other";
|
|
35
|
+
})(ClinicaCancelReason || (exports.ClinicaCancelReason = ClinicaCancelReason = {}));
|
|
36
|
+
var ClinicaDepositStatus;
|
|
37
|
+
(function (ClinicaDepositStatus) {
|
|
38
|
+
ClinicaDepositStatus["NotRequired"] = "NotRequired";
|
|
39
|
+
ClinicaDepositStatus["Pending"] = "Pending";
|
|
40
|
+
ClinicaDepositStatus["Approved"] = "Approved";
|
|
41
|
+
// Comprovante lido mas recusado (valor, chave ou data não batem). Continua
|
|
42
|
+
// esperando um válido até expirar.
|
|
43
|
+
ClinicaDepositStatus["Rejected"] = "Rejected";
|
|
44
|
+
ClinicaDepositStatus["Expired"] = "Expired";
|
|
45
|
+
})(ClinicaDepositStatus || (exports.ClinicaDepositStatus = ClinicaDepositStatus = {}));
|
|
46
|
+
/**
|
|
47
|
+
* Como a profissional libera a agenda.
|
|
48
|
+
* - Weekly: grade da semana (seg a sex, 9h às 18h…), vale toda semana.
|
|
49
|
+
* - SpecificDays: tudo começa fechado; ela libera dia a dia ("19/10 em
|
|
50
|
+
* Piumhi, das 9h às 18h"), pela tela ou pelo assistente.
|
|
51
|
+
* Dia liberado vale nos dois modos: no semanal, é um dia a mais.
|
|
52
|
+
*/
|
|
53
|
+
var ClinicaAvailabilityMode;
|
|
54
|
+
(function (ClinicaAvailabilityMode) {
|
|
55
|
+
ClinicaAvailabilityMode["Weekly"] = "Weekly";
|
|
56
|
+
ClinicaAvailabilityMode["SpecificDays"] = "SpecificDays";
|
|
57
|
+
})(ClinicaAvailabilityMode || (exports.ClinicaAvailabilityMode = ClinicaAvailabilityMode = {}));
|
|
58
|
+
// ============================================
|
|
59
|
+
// META (Instagram e Facebook)
|
|
60
|
+
// ============================================
|
|
61
|
+
var ClinicaMetaStatus;
|
|
62
|
+
(function (ClinicaMetaStatus) {
|
|
63
|
+
// Conectado, esperando escolher a página e a conta de anúncios.
|
|
64
|
+
ClinicaMetaStatus["Pending"] = "Pending";
|
|
65
|
+
ClinicaMetaStatus["Active"] = "Active";
|
|
66
|
+
// O token venceu ou foi revogado: precisa conectar de novo.
|
|
67
|
+
ClinicaMetaStatus["Expired"] = "Expired";
|
|
68
|
+
})(ClinicaMetaStatus || (exports.ClinicaMetaStatus = ClinicaMetaStatus = {}));
|
|
69
|
+
var ClinicaCommentPlatform;
|
|
70
|
+
(function (ClinicaCommentPlatform) {
|
|
71
|
+
ClinicaCommentPlatform["Instagram"] = "Instagram";
|
|
72
|
+
ClinicaCommentPlatform["Facebook"] = "Facebook";
|
|
73
|
+
})(ClinicaCommentPlatform || (exports.ClinicaCommentPlatform = ClinicaCommentPlatform = {}));
|
|
74
|
+
var ClinicaCampaignAutomationMode;
|
|
75
|
+
(function (ClinicaCampaignAutomationMode) {
|
|
76
|
+
ClinicaCampaignAutomationMode["Off"] = "Off";
|
|
77
|
+
// A IA sugere e o admin aprova.
|
|
78
|
+
ClinicaCampaignAutomationMode["SemiAutomatic"] = "SemiAutomatic";
|
|
79
|
+
// A IA executa sozinha, dentro dos limites.
|
|
80
|
+
ClinicaCampaignAutomationMode["Automatic"] = "Automatic";
|
|
81
|
+
})(ClinicaCampaignAutomationMode || (exports.ClinicaCampaignAutomationMode = ClinicaCampaignAutomationMode = {}));
|
|
82
|
+
var ClinicaCampaignActionType;
|
|
83
|
+
(function (ClinicaCampaignActionType) {
|
|
84
|
+
ClinicaCampaignActionType["Pause"] = "Pause";
|
|
85
|
+
ClinicaCampaignActionType["Activate"] = "Activate";
|
|
86
|
+
ClinicaCampaignActionType["SetDailyBudget"] = "SetDailyBudget";
|
|
87
|
+
ClinicaCampaignActionType["CreateFromPost"] = "CreateFromPost";
|
|
88
|
+
})(ClinicaCampaignActionType || (exports.ClinicaCampaignActionType = ClinicaCampaignActionType = {}));
|
|
89
|
+
var ClinicaCampaignActionOrigin;
|
|
90
|
+
(function (ClinicaCampaignActionOrigin) {
|
|
91
|
+
ClinicaCampaignActionOrigin["Panel"] = "Panel";
|
|
92
|
+
ClinicaCampaignActionOrigin["Assistant"] = "Assistant";
|
|
93
|
+
ClinicaCampaignActionOrigin["Automation"] = "Automation";
|
|
94
|
+
})(ClinicaCampaignActionOrigin || (exports.ClinicaCampaignActionOrigin = ClinicaCampaignActionOrigin = {}));
|
|
95
|
+
var ClinicaCampaignActionStatus;
|
|
96
|
+
(function (ClinicaCampaignActionStatus) {
|
|
97
|
+
// Sugerida pela automação, esperando o admin.
|
|
98
|
+
ClinicaCampaignActionStatus["Suggested"] = "Suggested";
|
|
99
|
+
ClinicaCampaignActionStatus["Executed"] = "Executed";
|
|
100
|
+
ClinicaCampaignActionStatus["Rejected"] = "Rejected";
|
|
101
|
+
ClinicaCampaignActionStatus["Failed"] = "Failed";
|
|
102
|
+
})(ClinicaCampaignActionStatus || (exports.ClinicaCampaignActionStatus = ClinicaCampaignActionStatus = {}));
|
|
103
|
+
// ============================================
|
|
104
|
+
// ASSISTENTE DE COMANDOS
|
|
105
|
+
// ============================================
|
|
106
|
+
var ClinicaAssistantActionType;
|
|
107
|
+
(function (ClinicaAssistantActionType) {
|
|
108
|
+
// Desmarca e chama o paciente no WhatsApp para escolher outro horário.
|
|
109
|
+
ClinicaAssistantActionType["RequestReschedule"] = "RequestReschedule";
|
|
110
|
+
// Muda o horário de um agendamento para outro já livre.
|
|
111
|
+
ClinicaAssistantActionType["MoveAppointment"] = "MoveAppointment";
|
|
112
|
+
ClinicaAssistantActionType["CancelAppointment"] = "CancelAppointment";
|
|
113
|
+
// Bloqueia a agenda de um profissional (folga, imprevisto).
|
|
114
|
+
ClinicaAssistantActionType["BlockAgenda"] = "BlockAgenda";
|
|
115
|
+
// Libera um dia para atendimento ("vou atender dia 19/10 em Piumhi das 9
|
|
116
|
+
// às 18").
|
|
117
|
+
ClinicaAssistantActionType["OpenDay"] = "OpenDay";
|
|
118
|
+
ClinicaAssistantActionType["SendMessage"] = "SendMessage";
|
|
119
|
+
ClinicaAssistantActionType["MoveLeadStage"] = "MoveLeadStage";
|
|
120
|
+
// Campanhas (só o dono da conta, dentro dos limites de gasto).
|
|
121
|
+
ClinicaAssistantActionType["PauseCampaign"] = "PauseCampaign";
|
|
122
|
+
ClinicaAssistantActionType["ActivateCampaign"] = "ActivateCampaign";
|
|
123
|
+
ClinicaAssistantActionType["SetCampaignBudget"] = "SetCampaignBudget";
|
|
124
|
+
ClinicaAssistantActionType["CreateCampaignFromPost"] = "CreateCampaignFromPost";
|
|
125
|
+
})(ClinicaAssistantActionType || (exports.ClinicaAssistantActionType = ClinicaAssistantActionType = {}));
|
|
126
|
+
var ClinicaAssistantPlanStatus;
|
|
127
|
+
(function (ClinicaAssistantPlanStatus) {
|
|
128
|
+
// Proposto, esperando o "executar" de quem pediu.
|
|
129
|
+
ClinicaAssistantPlanStatus["Proposed"] = "Proposed";
|
|
130
|
+
ClinicaAssistantPlanStatus["Running"] = "Running";
|
|
131
|
+
ClinicaAssistantPlanStatus["Done"] = "Done";
|
|
132
|
+
// Terminou com alguma ação falhando — o detalhe fica em cada ação.
|
|
133
|
+
ClinicaAssistantPlanStatus["PartiallyFailed"] = "PartiallyFailed";
|
|
134
|
+
ClinicaAssistantPlanStatus["Discarded"] = "Discarded";
|
|
135
|
+
})(ClinicaAssistantPlanStatus || (exports.ClinicaAssistantPlanStatus = ClinicaAssistantPlanStatus = {}));
|
|
136
|
+
var ClinicaAssistantActionStatus;
|
|
137
|
+
(function (ClinicaAssistantActionStatus) {
|
|
138
|
+
ClinicaAssistantActionStatus["Pending"] = "Pending";
|
|
139
|
+
ClinicaAssistantActionStatus["Done"] = "Done";
|
|
140
|
+
ClinicaAssistantActionStatus["Failed"] = "Failed";
|
|
141
|
+
})(ClinicaAssistantActionStatus || (exports.ClinicaAssistantActionStatus = ClinicaAssistantActionStatus = {}));
|
package/build/types/crm.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export interface CrmStage {
|
|
|
49
49
|
isWon: boolean;
|
|
50
50
|
isLost: boolean;
|
|
51
51
|
slaMinutes: number | null;
|
|
52
|
+
aggressiveness?: number | null;
|
|
52
53
|
}
|
|
53
54
|
export declare enum CrmStageChangedBy {
|
|
54
55
|
Ai = "Ai",
|
|
@@ -78,7 +79,8 @@ export declare enum CrmHandoffReason {
|
|
|
78
79
|
Sensitive = "Sensitive",
|
|
79
80
|
ManualTakeover = "ManualTakeover",
|
|
80
81
|
SlaBreach = "SlaBreach",
|
|
81
|
-
MinorSuspected = "MinorSuspected"
|
|
82
|
+
MinorSuspected = "MinorSuspected",
|
|
83
|
+
AiTurnLimit = "AiTurnLimit"
|
|
82
84
|
}
|
|
83
85
|
export declare enum CrmAgentStyle {
|
|
84
86
|
Service = "Service",
|
|
@@ -89,7 +91,16 @@ export declare enum CrmAgentTool {
|
|
|
89
91
|
MoveStage = "MoveStage",
|
|
90
92
|
ScheduleFollowUp = "ScheduleFollowUp",
|
|
91
93
|
RecordField = "RecordField",
|
|
92
|
-
RequestHuman = "RequestHuman"
|
|
94
|
+
RequestHuman = "RequestHuman",
|
|
95
|
+
CheckAvailability = "CheckAvailability",
|
|
96
|
+
BookAppointment = "BookAppointment",
|
|
97
|
+
ListAppointments = "ListAppointments",
|
|
98
|
+
RescheduleAppointment = "RescheduleAppointment",
|
|
99
|
+
CancelAppointment = "CancelAppointment",
|
|
100
|
+
SetAudioConsent = "SetAudioConsent",
|
|
101
|
+
SendAudio = "SendAudio",
|
|
102
|
+
SendServicePhotos = "SendServicePhotos",
|
|
103
|
+
ConfirmPresence = "ConfirmPresence"
|
|
93
104
|
}
|
|
94
105
|
export interface CrmAgentToolCall {
|
|
95
106
|
tool: CrmAgentTool;
|
package/build/types/crm.js
CHANGED
|
@@ -138,6 +138,9 @@ var CrmHandoffReason;
|
|
|
138
138
|
// O contato disse ou deu sinal de ter menos de 18 anos, numa conversa de
|
|
139
139
|
// persona adulta. A IA sai e não volta sozinha.
|
|
140
140
|
CrmHandoffReason["MinorSuspected"] = "MinorSuspected";
|
|
141
|
+
// A IA mandou mensagens demais seguidas sem o contato responder (follow-up
|
|
142
|
+
// que não para, laço). Freio contra parecer spam e queimar o número.
|
|
143
|
+
CrmHandoffReason["AiTurnLimit"] = "AiTurnLimit";
|
|
141
144
|
})(CrmHandoffReason || (exports.CrmHandoffReason = CrmHandoffReason = {}));
|
|
142
145
|
// Como o agente conversa. Muda o que o núcleo injeta no prompt, a leitura do
|
|
143
146
|
// opt-out e as travas — não o que a persona é, que continua no `systemPrompt`.
|
|
@@ -168,6 +171,27 @@ var CrmAgentTool;
|
|
|
168
171
|
CrmAgentTool["RecordField"] = "RecordField";
|
|
169
172
|
// Devolve a conversa para um humano.
|
|
170
173
|
CrmAgentTool["RequestHuman"] = "RequestHuman";
|
|
174
|
+
// --- Agenda (Pacientto) -------------------------------------------------
|
|
175
|
+
// Horários livres de verdade, já descontados agendamentos e bloqueios. O
|
|
176
|
+
// agente só pode oferecer o que esta ferramenta devolver.
|
|
177
|
+
CrmAgentTool["CheckAvailability"] = "CheckAvailability";
|
|
178
|
+
// Marca o horário. Com sinal, nasce reservado aguardando o comprovante Pix.
|
|
179
|
+
CrmAgentTool["BookAppointment"] = "BookAppointment";
|
|
180
|
+
// Agendamentos futuros do contato, para remarcar ou cancelar o certo.
|
|
181
|
+
CrmAgentTool["ListAppointments"] = "ListAppointments";
|
|
182
|
+
CrmAgentTool["RescheduleAppointment"] = "RescheduleAppointment";
|
|
183
|
+
CrmAgentTool["CancelAppointment"] = "CancelAppointment";
|
|
184
|
+
// --- Áudio ----------------------------------------------------------------
|
|
185
|
+
// Grava a resposta do contato à pergunta "posso te mandar um áudio?".
|
|
186
|
+
CrmAgentTool["SetAudioConsent"] = "SetAudioConsent";
|
|
187
|
+
// Gera a fala (FishAudio) e envia como áudio. Só com consentimento.
|
|
188
|
+
CrmAgentTool["SendAudio"] = "SendAudio";
|
|
189
|
+
// --- Catálogo e presença (Pacientto) -------------------------------------
|
|
190
|
+
// Envia fotos de resultado de um atendimento do catálogo (só as que têm
|
|
191
|
+
// autorização do paciente fotografado).
|
|
192
|
+
CrmAgentTool["SendServicePhotos"] = "SendServicePhotos";
|
|
193
|
+
// O paciente confirmou que vai ao horário marcado.
|
|
194
|
+
CrmAgentTool["ConfirmPresence"] = "ConfirmPresence";
|
|
171
195
|
})(CrmAgentTool || (exports.CrmAgentTool = CrmAgentTool = {}));
|
|
172
196
|
/**
|
|
173
197
|
* NÃO SÃO CONFIGURÁVEIS, de propósito — e vale registrar por quê, porque a
|