feat(secretaria): tools de agenda operam na agenda real do satélite via ponte
listar_horarios/agendar_horario chamam a ponte do scoreodonto (/api/nw/agenda slots|book) quando configurada — slot_id sintético (dentista|start|end), telefone derivado do JID do contato — com fallback ao calendário interno preservado. brain.ts injeta a config da agenda (agenda_url/secret/clinica_id) no toolCtx. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -78,12 +78,20 @@ export class ProtocolEngine {
|
||||
const toolNames = opts?.tools ?? ALL_TOOL_NAMES
|
||||
const toolDefs = resolveTools(toolNames)
|
||||
|
||||
const secCfg = (await this.config.get('secretaria')) as any
|
||||
const toolCtx: ToolContext = {
|
||||
db: this.db,
|
||||
conversationId,
|
||||
extChatId: conversation.ext_chat_id ?? undefined,
|
||||
tenantId: opts?.tenantId,
|
||||
hooks: opts?.hooks,
|
||||
// Ponte de agenda do satélite (scoreodonto) — as tools de agenda operam
|
||||
// na agenda real da clínica quando configurada.
|
||||
agenda: {
|
||||
url: secCfg?.agenda_url,
|
||||
secret: secCfg?.agenda_secret,
|
||||
clinicaId: secCfg?.clinica_id,
|
||||
},
|
||||
}
|
||||
|
||||
let response: string
|
||||
|
||||
Reference in New Issue
Block a user