import type { TriggerOutput } from '@/triggers/types'
/**
* Shared trigger dropdown options for all Circleback triggers
*/
export const circlebackTriggerOptions = [
{ label: 'General Webhook', id: 'circleback_webhook' },
{ label: 'Meeting Completed', id: 'circleback_meeting_completed' },
{ label: 'Meeting Notes Ready', id: 'circleback_meeting_notes' },
]
/**
* Generate setup instructions for a specific Circleback event type
*/
export function circlebackSetupInstructions(eventType: string): string {
const instructions = [
'Note: You need access to Circleback automations to set up webhooks. See the Circleback webhook documentation for details.',
'In Circleback, click Automations in the sidebar.',
'Create a new automation or edit an existing one.',
'Add a Send webhook request step to your automation.',
'Paste the Webhook URL from above into the Endpoint field.',
'Optionally, copy the Signing Secret from Circleback and paste it above to verify webhook signatures.',
`Toggle what to include in the request (Meeting notes, Action items, Transcript). For this trigger: ${eventType}.`,
'Click "Done" and save the automation.',
]
return instructions
.map(
(instruction, index) =>
`
${index === 0 ? instruction : `${index}. ${instruction}`}
`
)
.join('')
}
/**
* Build output schema for meeting events
*/
export function buildMeetingOutputs(): Record {
return {
id: {
type: 'number',
description: 'Circleback meeting ID',
},
name: {
type: 'string',
description: 'Meeting title/name',
},
url: {
type: 'string',
description: 'URL of the virtual meeting (Zoom, Google Meet, Teams, etc.)',
},
createdAt: {
type: 'string',
description: 'ISO8601 timestamp when meeting was created',
},
duration: {
type: 'number',
description: 'Meeting duration in seconds',
},
recordingUrl: {
type: 'string',
description: 'Recording URL (valid for 24 hours, if enabled)',
},
tags: {
type: 'array',
description: 'Array of tag strings',
},
icalUid: {
type: 'string',
description: 'Calendar event identifier',
},
attendees: {
type: 'array',
description: 'Array of attendee objects with name and email',
items: {
type: 'object',
properties: {
name: { type: 'string', description: 'Attendee name' },
email: { type: 'string', description: 'Attendee email address' },
},
},
},
notes: {
type: 'string',
description: 'Meeting notes in Markdown format',
},
actionItems: {
type: 'array',
description: 'Array of action item objects',
items: {
type: 'object',
properties: {
id: { type: 'number', description: 'Action item ID' },
title: { type: 'string', description: 'Action item title' },
description: { type: 'string', description: 'Action item description' },
assignee: {
type: 'object',
description: 'Person assigned to the action item (or null)',
properties: {
name: { type: 'string', description: 'Assignee name' },
email: { type: 'string', description: 'Assignee email' },
},
},
status: { type: 'string', description: 'Status: PENDING or DONE' },
},
},
},
transcript: {
type: 'array',
description: 'Array of transcript segments',
items: {
type: 'object',
properties: {
speaker: { type: 'string', description: 'Speaker name' },
text: { type: 'string', description: 'Transcript text' },
timestamp: { type: 'number', description: 'Timestamp in seconds' },
},
},
},
insights: {
type: 'object',
description: 'User-created insights keyed by insight name',
},
meeting: {
type: 'object',
description: 'Full meeting payload object',
properties: {
id: { type: 'number', description: 'Meeting ID' },
name: { type: 'string', description: 'Meeting name' },
url: { type: 'string', description: 'Meeting URL' },
duration: { type: 'number', description: 'Duration in seconds' },
createdAt: { type: 'string', description: 'Creation timestamp' },
recordingUrl: { type: 'string', description: 'Recording URL' },
},
},
} as any
}