feat(ui): add Speko voice setup, task calls, and Storybook coverage

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-09 15:03:38 -05:00
1 parent a26b2c403e
commit f34a220790
72 files changed
+2409 -57

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ export type {
} from "@paperclipai/shared";
export type ChatProvider =
"slack" | "github" | "discord" | "microsoft-teams" | "telegram" | "agentmail" | "imessage-photon";
"slack" | "github" | "discord" | "microsoft-teams" | "telegram" | "agentmail" | "imessage-photon" | "speko";
export type ChatEndpointStatus =
| "draft"
| "verifying"
+7
View File
@@ -0,0 +1,7 @@
import type { VoiceCallbackPreference } from "@paperclipai/shared";
import { api } from "./client";
const path = (companyId: string, endpointId: string) => `/companies/${encodeURIComponent(companyId)}/voice-callbacks/${encodeURIComponent(endpointId)}`;
export const voiceCallbacksApi = {
get: (companyId: string, endpointId: string) => api.get<VoiceCallbackPreference | null>(path(companyId, endpointId), { cache: "no-store" }),
save: (companyId: string, endpointId: string, preference: VoiceCallbackPreference) => api.put<VoiceCallbackPreference>(path(companyId, endpointId), preference),
};
+5
View File
@@ -0,0 +1,5 @@
import type { VoiceCallHistoryEntry } from "@paperclipai/shared";
import { api } from "./client";
export const voiceHistoryApi = {
list: (companyId: string, endpointId: string) => api.get<VoiceCallHistoryEntry[]>(`/companies/${encodeURIComponent(companyId)}/voice-history/${encodeURIComponent(endpointId)}`, { cache: "no-store" }),
};
+10
View File
@@ -0,0 +1,10 @@
import type { VoicePhoneConfiguration, VoiceInboundCall, VoiceUnapprovedCallHistoryEntry } from "@paperclipai/shared";
import { api } from "./client";
const path = (companyId: string, endpointId: string) => `/companies/${encodeURIComponent(companyId)}/voice-phone/${encodeURIComponent(endpointId)}`;
export const voicePhoneApi = {
configuration: (companyId: string, endpointId: string) => api.get<VoicePhoneConfiguration>(path(companyId, endpointId), {cache: "no-store"}),
save: (companyId: string, endpointId: string, input: {numberId: string; enabled: boolean; guestIntake?: boolean; lowTrustEnvironmentId?: string | null}) => api.put<VoicePhoneConfiguration>(path(companyId, endpointId), input),
incoming: (companyId: string, endpointId: string) => api.get<VoiceInboundCall[]>(`${path(companyId, endpointId)}/incoming`, {cache: "no-store"}),
history: (companyId: string, endpointId: string) => api.get<VoiceUnapprovedCallHistoryEntry[]>(`${path(companyId, endpointId)}/history`, {cache: "no-store"}),
decide: (companyId: string, endpointId: string, callId: string, input: {approve: boolean; approvalCode: string; issueId?: string}) => api.post<VoiceInboundCall>(`${path(companyId, endpointId)}/incoming/${encodeURIComponent(callId)}`, input),
};
+18
View File
@@ -0,0 +1,18 @@
import type { VoiceSession, VoiceSessionMedia, VoiceSessionNotification } from "@paperclipai/shared";
import { api } from "./client";
const base = (companyId: string) => `/companies/${encodeURIComponent(companyId)}/voice-sessions`;
export const voiceSessionsApi = {
start(companyId: string, input: { endpointId: string; issueId?: string; newConversation?: boolean; idempotencyKey: string; maxDurationSeconds?: number }) {
return api.post<{ session: VoiceSession; media?: VoiceSessionMedia }>(base(companyId), input);
},
get(companyId: string, sessionId: string) {
return api.get<VoiceSession>(`${base(companyId)}/${encodeURIComponent(sessionId)}`, { cache: "no-store" });
},
end(companyId: string, sessionId: string) {
return api.post<VoiceSession>(`${base(companyId)}/${encodeURIComponent(sessionId)}/end`, {});
},
notification(companyId: string, sessionId: string) {
return api.get<VoiceSessionNotification | null>(`${base(companyId)}/${encodeURIComponent(sessionId)}/notification`, { cache: "no-store" });
},
};