@absolutejs/voice 0.0.22-beta.511 → 0.0.22-beta.513

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.
@@ -0,0 +1,40 @@
1
+ import type { VoiceScorecard } from "./callScorecard";
2
+ export type VoiceAgentPerformanceBucket = "day" | "week" | "month";
3
+ export type VoiceAgentPerformanceCriterionSummary = {
4
+ criterionId: string;
5
+ averageScore: number;
6
+ passRate: number;
7
+ trend: "up" | "down" | "flat";
8
+ delta: number;
9
+ };
10
+ export type VoiceAgentPerformanceBucketSummary = {
11
+ bucketKey: string;
12
+ callsScored: number;
13
+ averageWeightedScore: number;
14
+ passRate: number;
15
+ needsReviewRate: number;
16
+ failRate: number;
17
+ };
18
+ export type VoiceAgentPerformanceReport = {
19
+ agentId: string;
20
+ rubricId: string;
21
+ fromMs: number;
22
+ toMs: number;
23
+ bucket: VoiceAgentPerformanceBucket;
24
+ totalCalls: number;
25
+ buckets: VoiceAgentPerformanceBucketSummary[];
26
+ criteria: VoiceAgentPerformanceCriterionSummary[];
27
+ overallPassRate: number;
28
+ overallAverageScore: number;
29
+ worstCriterion: string | null;
30
+ bestCriterion: string | null;
31
+ };
32
+ export type BuildVoiceAgentPerformanceReportInput = {
33
+ agentId: string;
34
+ rubricId: string;
35
+ scorecards: VoiceScorecard[];
36
+ fromMs?: number;
37
+ toMs?: number;
38
+ bucket?: VoiceAgentPerformanceBucket;
39
+ };
40
+ export declare const buildVoiceAgentPerformanceReport: (input: BuildVoiceAgentPerformanceReportInput) => VoiceAgentPerformanceReport;
@@ -0,0 +1,32 @@
1
+ import { type VoiceScorecard, type VoiceScorecardRubric } from "./callScorecard";
2
+ export type VoiceAIScorecardCompletion = (input: {
3
+ prompt: string;
4
+ systemPrompt?: string;
5
+ }) => Promise<string>;
6
+ export type VoiceAIScorecardScoringResult = {
7
+ criterionId: string;
8
+ score: number;
9
+ rationale?: string;
10
+ };
11
+ export type VoiceAIScorecardParsedResponse = {
12
+ scores: VoiceAIScorecardScoringResult[];
13
+ comments?: string;
14
+ };
15
+ export type ScoreVoiceCallWithAIInput = {
16
+ rubric: VoiceScorecardRubric;
17
+ sessionId: string;
18
+ transcript: string;
19
+ agentId?: string;
20
+ reviewerId?: string;
21
+ metadata?: Record<string, unknown>;
22
+ now?: () => number;
23
+ };
24
+ export type CreateVoiceAIScorecardOptions = {
25
+ completion: VoiceAIScorecardCompletion;
26
+ systemPrompt?: string;
27
+ };
28
+ export declare const parseVoiceAIScorecardResponse: (raw: string, rubric: VoiceScorecardRubric) => VoiceAIScorecardParsedResponse;
29
+ export declare const createVoiceAIScorecard: (options: CreateVoiceAIScorecardOptions) => {
30
+ scoreCall(input: ScoreVoiceCallWithAIInput): Promise<VoiceScorecard>;
31
+ };
32
+ export type VoiceAIScorecard = ReturnType<typeof createVoiceAIScorecard>;
@@ -10,6 +10,19 @@ var __name = (target, name) => {
10
10
  });
11
11
  return target;
12
12
  };
13
+ var __returnValue = (v) => v;
14
+ function __exportSetter(name, newValue) {
15
+ this[name] = __returnValue.bind(null, newValue);
16
+ }
17
+ var __export = (target, all) => {
18
+ for (var name in all)
19
+ __defProp(target, name, {
20
+ get: all[name],
21
+ enumerable: true,
22
+ configurable: true,
23
+ set: __exportSetter.bind(all, name)
24
+ });
25
+ };
13
26
  var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
14
27
  var __typeError = (msg) => {
15
28
  throw TypeError(msg);
@@ -0,0 +1,43 @@
1
+ import type { VoiceCalendarAdapter, VoiceCalendarAppointment } from "./calendarAdapter";
2
+ import type { VoiceCalendarSlot } from "./calendarSlots";
3
+ export type VoiceBookingFlowStep = "ask-service" | "ask-date" | "ask-time" | "confirm" | "booking" | "booked" | "failed";
4
+ export type VoiceBookingFlowState = {
5
+ step: VoiceBookingFlowStep;
6
+ serviceId?: string;
7
+ serviceDurationMinutes?: number;
8
+ attendees?: string[];
9
+ proposedSlots: VoiceCalendarSlot[];
10
+ selectedSlot?: VoiceCalendarSlot;
11
+ appointment?: VoiceCalendarAppointment;
12
+ error?: string;
13
+ };
14
+ export type VoiceBookingFlowServiceCatalog = {
15
+ id: string;
16
+ label: string;
17
+ durationMinutes: number;
18
+ }[];
19
+ export type CreateVoiceBookingFlowOptions = {
20
+ adapter: VoiceCalendarAdapter;
21
+ calendarId: string;
22
+ services?: VoiceBookingFlowServiceCatalog;
23
+ defaultDurationMinutes?: number;
24
+ initialStep?: VoiceBookingFlowStep;
25
+ maxSlotsPerDay?: number;
26
+ };
27
+ export declare const createVoiceBookingFlow: (options: CreateVoiceBookingFlowOptions) => {
28
+ chooseService: (serviceId: string) => void;
29
+ chooseSlot: (slotIndex: number) => void;
30
+ confirm: (input?: {
31
+ attendees?: string[];
32
+ title?: string;
33
+ notes?: string;
34
+ }) => Promise<VoiceCalendarAppointment | null>;
35
+ getState: () => VoiceBookingFlowState;
36
+ proposeSlotsForDay: (input: {
37
+ fromMs: number;
38
+ toMs: number;
39
+ }) => Promise<VoiceCalendarSlot[]>;
40
+ reset: () => void;
41
+ subscribe(listener: (state: VoiceBookingFlowState) => void): () => void;
42
+ };
43
+ export type VoiceBookingFlow = ReturnType<typeof createVoiceBookingFlow>;
@@ -0,0 +1,47 @@
1
+ import type { VoiceCalendarBookedRange, VoiceCalendarBusinessHours, VoiceCalendarSlot } from "./calendarSlots";
2
+ export type VoiceCalendarAppointment = {
3
+ id: string;
4
+ calendarId: string;
5
+ startMs: number;
6
+ endMs: number;
7
+ title?: string;
8
+ attendees?: string[];
9
+ notes?: string;
10
+ metadata?: Record<string, string>;
11
+ createdAt: number;
12
+ status: "scheduled" | "cancelled" | "completed" | "no-show";
13
+ };
14
+ export type VoiceCalendarAvailabilityQuery = {
15
+ calendarId: string;
16
+ fromMs: number;
17
+ toMs: number;
18
+ durationMinutes: number;
19
+ bufferMinutes?: number;
20
+ granularityMinutes?: number;
21
+ maxSlots?: number;
22
+ };
23
+ export type VoiceCalendarBookInput = {
24
+ calendarId: string;
25
+ startMs: number;
26
+ endMs: number;
27
+ title?: string;
28
+ attendees?: string[];
29
+ notes?: string;
30
+ metadata?: Record<string, string>;
31
+ };
32
+ export type VoiceCalendarAdapter = {
33
+ readonly providerName: string;
34
+ listAvailability(query: VoiceCalendarAvailabilityQuery): Promise<VoiceCalendarSlot[]>;
35
+ book(input: VoiceCalendarBookInput): Promise<VoiceCalendarAppointment>;
36
+ cancel(appointmentId: string): Promise<VoiceCalendarAppointment | null>;
37
+ get(appointmentId: string): Promise<VoiceCalendarAppointment | null>;
38
+ reschedule(appointmentId: string, nextStartMs: number, nextEndMs: number): Promise<VoiceCalendarAppointment | null>;
39
+ };
40
+ export type CreateVoiceInMemoryCalendarAdapterOptions = {
41
+ businessHours: VoiceCalendarBusinessHours[];
42
+ timezone?: string;
43
+ bookedRanges?: VoiceCalendarBookedRange[];
44
+ generateId?: () => string;
45
+ now?: () => number;
46
+ };
47
+ export declare const createVoiceInMemoryCalendarAdapter: (options: CreateVoiceInMemoryCalendarAdapterOptions) => VoiceCalendarAdapter;
@@ -0,0 +1,35 @@
1
+ export type VoiceCalendarBusinessHours = {
2
+ weekday: number;
3
+ start: string;
4
+ end: string;
5
+ };
6
+ export type VoiceCalendarBlackout = {
7
+ date: string;
8
+ reason?: string;
9
+ };
10
+ export type VoiceCalendarBookedRange = {
11
+ startMs: number;
12
+ endMs: number;
13
+ };
14
+ export type VoiceCalendarSlot = {
15
+ startMs: number;
16
+ endMs: number;
17
+ durationMinutes: number;
18
+ };
19
+ export type GenerateVoiceCalendarSlotsInput = {
20
+ fromMs: number;
21
+ toMs: number;
22
+ durationMinutes: number;
23
+ bufferMinutes?: number;
24
+ granularityMinutes?: number;
25
+ timezone?: string;
26
+ businessHours: VoiceCalendarBusinessHours[];
27
+ blackoutDates?: VoiceCalendarBlackout[];
28
+ bookedRanges?: VoiceCalendarBookedRange[];
29
+ maxSlots?: number;
30
+ };
31
+ export declare const generateVoiceCalendarSlots: (input: GenerateVoiceCalendarSlotsInput) => VoiceCalendarSlot[];
32
+ export declare const summarizeVoiceCalendarSlot: (slot: VoiceCalendarSlot, options?: {
33
+ timezone?: string;
34
+ locale?: string;
35
+ }) => string;
@@ -0,0 +1,53 @@
1
+ export type VoiceScorecardCriterion = {
2
+ id: string;
3
+ label: string;
4
+ weight: number;
5
+ section?: string;
6
+ passingScore?: number;
7
+ required?: boolean;
8
+ };
9
+ export type VoiceScorecardRubric = {
10
+ id: string;
11
+ label: string;
12
+ scaleMax?: number;
13
+ passingGrade?: number;
14
+ criteria: VoiceScorecardCriterion[];
15
+ };
16
+ export type VoiceScorecardCriterionResult = {
17
+ criterionId: string;
18
+ score: number;
19
+ weight: number;
20
+ rationale?: string;
21
+ passed: boolean;
22
+ };
23
+ export type VoiceScorecard = {
24
+ rubricId: string;
25
+ sessionId: string;
26
+ agentId?: string;
27
+ reviewer: "human" | "llm" | "hybrid";
28
+ reviewerId?: string;
29
+ createdAt: number;
30
+ scaleMax: number;
31
+ passingGrade: number;
32
+ results: VoiceScorecardCriterionResult[];
33
+ weightedScore: number;
34
+ grade: "pass" | "fail" | "needs-review";
35
+ sectionScores: Record<string, number>;
36
+ failedRequiredCriteria: string[];
37
+ comments?: string;
38
+ };
39
+ export type BuildVoiceCallScorecardInput = {
40
+ rubric: VoiceScorecardRubric;
41
+ sessionId: string;
42
+ agentId?: string;
43
+ reviewer: VoiceScorecard["reviewer"];
44
+ reviewerId?: string;
45
+ scores: Record<string, {
46
+ score: number;
47
+ rationale?: string;
48
+ }>;
49
+ comments?: string;
50
+ now?: () => number;
51
+ };
52
+ export declare const buildVoiceCallScorecard: (input: BuildVoiceCallScorecardInput) => VoiceScorecard;
53
+ export declare const DEFAULT_VOICE_SALES_RUBRIC: VoiceScorecardRubric;
@@ -10,6 +10,19 @@ var __name = (target, name) => {
10
10
  });
11
11
  return target;
12
12
  };
13
+ var __returnValue = (v) => v;
14
+ function __exportSetter(name, newValue) {
15
+ this[name] = __returnValue.bind(null, newValue);
16
+ }
17
+ var __export = (target, all) => {
18
+ for (var name in all)
19
+ __defProp(target, name, {
20
+ get: all[name],
21
+ enumerable: true,
22
+ configurable: true,
23
+ set: __exportSetter.bind(all, name)
24
+ });
25
+ };
13
26
  var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
14
27
  var __typeError = (msg) => {
15
28
  throw TypeError(msg);
package/dist/index.d.ts CHANGED
@@ -321,4 +321,24 @@ export { createVoiceSupervisorPresence } from "./supervisorPresence";
321
321
  export type { CreateVoiceSupervisorPresenceOptions, VoiceSupervisorPresence, VoiceSupervisorPresenceEvent, VoiceSupervisorRole, VoiceSupervisorWatcher, } from "./supervisorPresence";
322
322
  export { createVoiceSupervisorPermissions, VOICE_SUPERVISOR_TIER_CAPABILITIES, } from "./supervisorPermissions";
323
323
  export type { CreateVoiceSupervisorPermissionsOptions, VoiceSupervisorCapability, VoiceSupervisorPermission, VoiceSupervisorPermissionCheck, VoiceSupervisorPermissions, VoiceSupervisorTier, } from "./supervisorPermissions";
324
+ export { generateVoiceCalendarSlots, summarizeVoiceCalendarSlot, } from "./calendarSlots";
325
+ export type { GenerateVoiceCalendarSlotsInput, VoiceCalendarBlackout, VoiceCalendarBookedRange, VoiceCalendarBusinessHours, VoiceCalendarSlot, } from "./calendarSlots";
326
+ export { createVoiceInMemoryCalendarAdapter } from "./calendarAdapter";
327
+ export type { CreateVoiceInMemoryCalendarAdapterOptions, VoiceCalendarAdapter, VoiceCalendarAppointment, VoiceCalendarAvailabilityQuery, VoiceCalendarBookInput, } from "./calendarAdapter";
328
+ export { createVoiceBookingFlow } from "./bookingFlow";
329
+ export type { CreateVoiceBookingFlowOptions, VoiceBookingFlow, VoiceBookingFlowServiceCatalog, VoiceBookingFlowState, VoiceBookingFlowStep, } from "./bookingFlow";
330
+ export { scoreVoiceNoShowRisk, summarizeVoiceNoShowVerdict, } from "./noShowPredictor";
331
+ export type { VoiceNoShowHistoricalRecord, VoiceNoShowScoreInput, VoiceNoShowSignal, VoiceNoShowVerdict, } from "./noShowPredictor";
332
+ export { createVoiceReminderScheduler, DEFAULT_VOICE_REMINDER_TRIGGERS, } from "./reminderScheduler";
333
+ export type { CreateVoiceReminderSchedulerOptions, ScheduleVoiceRemindersInput, VoiceReminderChannel, VoiceReminderJob, VoiceReminderScheduler, VoiceReminderTrigger, } from "./reminderScheduler";
334
+ export { buildVoiceCallScorecard, DEFAULT_VOICE_SALES_RUBRIC, } from "./callScorecard";
335
+ export type { BuildVoiceCallScorecardInput, VoiceScorecard, VoiceScorecardCriterion, VoiceScorecardCriterionResult, VoiceScorecardRubric, } from "./callScorecard";
336
+ export { createVoiceAIScorecard, parseVoiceAIScorecardResponse, } from "./aiScorecard";
337
+ export type { CreateVoiceAIScorecardOptions, ScoreVoiceCallWithAIInput, VoiceAIScorecard, VoiceAIScorecardCompletion, VoiceAIScorecardParsedResponse, VoiceAIScorecardScoringResult, } from "./aiScorecard";
338
+ export { buildVoiceAgentPerformanceReport } from "./agentPerformanceReport";
339
+ export type { BuildVoiceAgentPerformanceReportInput, VoiceAgentPerformanceBucket, VoiceAgentPerformanceBucketSummary, VoiceAgentPerformanceCriterionSummary, VoiceAgentPerformanceReport, } from "./agentPerformanceReport";
340
+ export { computeVoiceScorecardCalibration } from "./scorecardCalibration";
341
+ export type { VoiceScorecardCalibrationDivergence, VoiceScorecardCalibrationPair, VoiceScorecardCalibrationReport, } from "./scorecardCalibration";
342
+ export { detectVoiceQualityDrift } from "./qualityDriftDetector";
343
+ export type { DetectVoiceQualityDriftInput, VoiceQualityDriftCriterionAlert, VoiceQualityDriftReport, VoiceQualityDriftSeverity, } from "./qualityDriftDetector";
324
344
  export * from "./types";