feat: inbound calls in cal ai (#23890)

* feat: lang support

* fix: type errors

* feat: select voice agent

* refactor: address feedback

* refactor: address feedback

* refactor: missing import

* fix: types

* feat: add inbound calls

* chore: formatting

* chore

* feat: finish inbound call

* chore: formatting

* fix: update bug

* fix: types

* refactor: Agent Configuration Sheet (#23930)

* refactor: agent configuration sheet

* chore: use default phone numbre

* refactor: improvements

* refactor: improvements

* fix: types

* fix: feedback

* chore:

* fix: feedback

* fix: prompt

* fix: review

* fix: review

* refactor: class

* refactor: class

* refactor: rename

* Update apps/web/public/static/locales/en/common.json

* Update apps/web/public/static/locales/en/common.json

* chore: update set value

* fix: remove index

* fix: type error

* fix: update tetss

* fix: use logger

* refactor: don't use static

* fix: type

* fix: schema

* refactor:

---------

Co-authored-by: Carina Wollendorfer <[email protected]>
This commit is contained in:
Udit TakkarandCarina Wollendorfer authored and GitHub committed 2025-10-09 11:40:37 +01:00
1 parent bec49ef417
commit aa48e72c12
74 files changed
+2980 -1680

No files matched your search

@@ -0,0 +1,20 @@
/*
Warnings:
- A unique constraint covering the columns `[inboundAgentId]` on the table `WorkflowStep` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterTable
ALTER TABLE "Agent" ADD COLUMN "inboundEventTypeId" INTEGER;
-- AlterTable
ALTER TABLE "WorkflowStep" ADD COLUMN "inboundAgentId" TEXT;
-- CreateIndex
CREATE INDEX "Agent_inboundEventTypeId_idx" ON "Agent"("inboundEventTypeId");
-- CreateIndex
CREATE UNIQUE INDEX "WorkflowStep_inboundAgentId_key" ON "WorkflowStep"("inboundAgentId");
-- AddForeignKey
ALTER TABLE "WorkflowStep" ADD CONSTRAINT "WorkflowStep_inboundAgentId_fkey" FOREIGN KEY ("inboundAgentId") REFERENCES "Agent"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+10
View File
@@ -247,6 +247,7 @@ model EventType {
createdAt DateTime? @default(now())
updatedAt DateTime? @updatedAt
@@unique([userId, slug])
@@unique([teamId, slug])
@@unique([userId, parentId])
@@ -1426,6 +1427,9 @@ model WorkflowStep {
agentId String? @unique
agent Agent? @relation(fields: [agentId], references: [id], onDelete: SetNull)
inboundAgentId String? @unique
inboundAgent Agent? @relation("WorkflowStepInboundAgent", fields: [inboundAgentId], references: [id], onDelete: SetNull)
@@index([workflowId])
}
@@ -2538,6 +2542,7 @@ enum PhoneNumberSubscriptionStatus {
UNPAID
}
// Cal AI Voice Agent
model Agent {
id String @id @default(uuid())
@@ -2552,6 +2557,9 @@ model Agent {
// Provider-specific agent ID (e.g., Retell AI agent ID)
providerAgentId String @unique
// Event type association for inbound agents
inboundEventTypeId Int?
enabled Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@ -2559,9 +2567,11 @@ model Agent {
inboundPhoneNumbers CalAiPhoneNumber[] @relation("InboundAgent")
outboundPhoneNumbers CalAiPhoneNumber[] @relation("OutboundAgent")
workflowStep WorkflowStep?
inboundWorkflowStep WorkflowStep? @relation("WorkflowStepInboundAgent")
@@index([userId])
@@index([teamId])
@@index([inboundEventTypeId])
}
model CalAiPhoneNumber {