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

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,29 @@
1
+ import type { VoiceCallerIdentity } from "./callerMemory";
2
+ import type { VoiceCRMContactSummary, VoiceCRMContract } from "./crmContract";
3
+ export type VoiceCallerCRMLinkRecord = {
4
+ callerKey: string;
5
+ vendor: string;
6
+ contactId: string;
7
+ contact: VoiceCRMContactSummary;
8
+ resolvedAt: number;
9
+ source: "memory" | "phone-lookup" | "email-lookup" | "manual";
10
+ };
11
+ export type VoiceCallerCRMLinkCacheStore = {
12
+ get(key: string): Promise<VoiceCallerCRMLinkRecord | null> | VoiceCallerCRMLinkRecord | null;
13
+ put(record: VoiceCallerCRMLinkRecord): Promise<void> | void;
14
+ remove(key: string): Promise<boolean> | boolean;
15
+ };
16
+ export type CreateVoiceCallerCRMLinkerOptions = {
17
+ contract: VoiceCRMContract;
18
+ cache?: VoiceCallerCRMLinkCacheStore;
19
+ staleAfterMs?: number;
20
+ now?: () => number;
21
+ };
22
+ export declare const createInMemoryVoiceCallerCRMLinkCache: () => VoiceCallerCRMLinkCacheStore;
23
+ export declare const createVoiceCallerCRMLinker: (options: CreateVoiceCallerCRMLinkerOptions) => {
24
+ associate: (identity: VoiceCallerIdentity, contact: VoiceCRMContactSummary) => Promise<VoiceCallerCRMLinkRecord>;
25
+ contract: VoiceCRMContract;
26
+ invalidate: (identity: VoiceCallerIdentity) => Promise<boolean>;
27
+ resolve: (identity: VoiceCallerIdentity) => Promise<VoiceCallerCRMLinkRecord | null>;
28
+ };
29
+ export type VoiceCallerCRMLinker = ReturnType<typeof createVoiceCallerCRMLinker>;
@@ -0,0 +1,37 @@
1
+ import type { VoiceCRMContract } from "./crmContract";
2
+ export type VoiceCRMCallLoggerInput = {
3
+ sessionId: string;
4
+ contactId?: string;
5
+ startedAt: number;
6
+ endedAt?: number;
7
+ durationSeconds?: number;
8
+ summary?: string;
9
+ disposition?: string;
10
+ recordingUrl?: string;
11
+ transcriptUrl?: string;
12
+ metadata?: Record<string, unknown>;
13
+ };
14
+ export type VoiceCRMCallLogResult = {
15
+ activityId: string;
16
+ vendor: string;
17
+ loggedAt: number;
18
+ };
19
+ export type VoiceCRMCallLogErrorPolicy = "throw" | "swallow" | "queue";
20
+ export type CreateVoiceCRMCallLoggerOptions = {
21
+ contract: VoiceCRMContract;
22
+ errorPolicy?: VoiceCRMCallLogErrorPolicy;
23
+ onError?: (error: Error, input: VoiceCRMCallLoggerInput) => void | Promise<void>;
24
+ enqueueOnFailure?: (input: VoiceCRMCallLoggerInput) => Promise<void> | void;
25
+ now?: () => number;
26
+ };
27
+ export declare const createVoiceCRMCallLogger: (options: CreateVoiceCRMCallLoggerOptions) => {
28
+ contract: VoiceCRMContract;
29
+ logCallEnd: (input: VoiceCRMCallLoggerInput) => Promise<VoiceCRMCallLogResult | null>;
30
+ noteOnContact: (input: {
31
+ contactId: string;
32
+ body: string;
33
+ }) => Promise<{
34
+ noteId: string;
35
+ } | null>;
36
+ };
37
+ export type VoiceCRMCallLogger = ReturnType<typeof createVoiceCRMCallLogger>;
@@ -0,0 +1,70 @@
1
+ export type VoiceCRMContactSummary = {
2
+ id: string;
3
+ vendor?: string;
4
+ firstName?: string;
5
+ lastName?: string;
6
+ email?: string;
7
+ phone?: string;
8
+ jobTitle?: string;
9
+ metadata?: Record<string, unknown>;
10
+ };
11
+ export type VoiceCRMLeadInput = {
12
+ firstName?: string;
13
+ lastName?: string;
14
+ email?: string;
15
+ phone?: string;
16
+ company?: string;
17
+ jobTitle?: string;
18
+ source?: string;
19
+ notes?: string;
20
+ metadata?: Record<string, unknown>;
21
+ };
22
+ export type VoiceCRMCallActivityInput = {
23
+ contactId?: string;
24
+ sessionId: string;
25
+ startedAt: number;
26
+ endedAt: number;
27
+ durationSeconds: number;
28
+ summary?: string;
29
+ disposition?: string;
30
+ recordingUrl?: string;
31
+ transcriptUrl?: string;
32
+ metadata?: Record<string, unknown>;
33
+ };
34
+ export type VoiceCRMNoteInput = {
35
+ contactId: string;
36
+ body: string;
37
+ metadata?: Record<string, unknown>;
38
+ };
39
+ export type VoiceCRMTaskInput = {
40
+ contactId?: string;
41
+ subject: string;
42
+ description?: string;
43
+ dueAt?: number;
44
+ priority?: "low" | "normal" | "high";
45
+ };
46
+ export type VoiceCRMContract = {
47
+ readonly vendor: string;
48
+ lookupByPhone(phone: string): Promise<VoiceCRMContactSummary | null>;
49
+ lookupByEmail(email: string): Promise<VoiceCRMContactSummary | null>;
50
+ createLead(input: VoiceCRMLeadInput): Promise<VoiceCRMContactSummary>;
51
+ logCall(input: VoiceCRMCallActivityInput): Promise<{
52
+ activityId: string;
53
+ }>;
54
+ addNote(input: VoiceCRMNoteInput): Promise<{
55
+ noteId: string;
56
+ }>;
57
+ createTask?(input: VoiceCRMTaskInput): Promise<{
58
+ taskId: string;
59
+ }>;
60
+ };
61
+ export type VoiceCRMRegistry = {
62
+ default(): VoiceCRMContract | null;
63
+ get(vendor: string): VoiceCRMContract | null;
64
+ list(): VoiceCRMContract[];
65
+ };
66
+ export type CreateVoiceCRMRegistryOptions = {
67
+ contracts: VoiceCRMContract[];
68
+ defaultVendor?: string;
69
+ };
70
+ export declare const createVoiceCRMRegistry: (options: CreateVoiceCRMRegistryOptions) => VoiceCRMRegistry;
package/dist/index.d.ts CHANGED
@@ -341,4 +341,20 @@ export { computeVoiceScorecardCalibration } from "./scorecardCalibration";
341
341
  export type { VoiceScorecardCalibrationDivergence, VoiceScorecardCalibrationPair, VoiceScorecardCalibrationReport, } from "./scorecardCalibration";
342
342
  export { detectVoiceQualityDrift } from "./qualityDriftDetector";
343
343
  export type { DetectVoiceQualityDriftInput, VoiceQualityDriftCriterionAlert, VoiceQualityDriftReport, VoiceQualityDriftSeverity, } from "./qualityDriftDetector";
344
+ export { findVoicePathwaySlot, findVoicePathwayState, validateVoicePathway, } from "./pathway";
345
+ export type { VoicePathway, VoicePathwayAction, VoicePathwayCondition, VoicePathwaySlot, VoicePathwaySlotType, VoicePathwayState, VoicePathwayTransition, VoicePathwayValidationIssue, VoicePathwayValidationReport, } from "./pathway";
346
+ export { createVoicePathwayRuntime } from "./pathwayRuntime";
347
+ export type { CreateVoicePathwayRuntimeOptions, VoicePathwayRuntime, VoicePathwayRuntimeEvent, VoicePathwayRuntimeState, VoicePathwayRuntimeStatus, VoicePathwaySlotValue, VoicePathwayToolCall, } from "./pathwayRuntime";
348
+ export { createVoicePathwaySlotCollector, DEFAULT_VOICE_PATHWAY_SLOT_PARSERS, } from "./pathwaySlotCollector";
349
+ export type { CreateVoicePathwaySlotCollectorOptions, VoicePathwaySlotCollector, VoicePathwaySlotCollectorAttempt, VoicePathwaySlotParser, VoicePathwaySlotParseResult, } from "./pathwaySlotCollector";
350
+ export { compileVoicePathwayToAssistant } from "./pathwayCompiler";
351
+ export type { CompileVoicePathwayOptions, VoicePathwayCompiledAssistant, VoicePathwayCompilerToolDefinition, } from "./pathwayCompiler";
352
+ export { renderVoicePathwayMermaid, renderVoicePathwayText, visualizeVoicePathway, } from "./pathwayVisualizer";
353
+ export type { VoicePathwayVisualization } from "./pathwayVisualizer";
354
+ export { createVoiceCRMRegistry } from "./crmContract";
355
+ export type { CreateVoiceCRMRegistryOptions, VoiceCRMCallActivityInput, VoiceCRMContactSummary, VoiceCRMContract, VoiceCRMLeadInput, VoiceCRMNoteInput, VoiceCRMRegistry, VoiceCRMTaskInput, } from "./crmContract";
356
+ export { createInMemoryVoiceCallerCRMLinkCache, createVoiceCallerCRMLinker, } from "./callerCRMLinker";
357
+ export type { CreateVoiceCallerCRMLinkerOptions, VoiceCallerCRMLinkCacheStore, VoiceCallerCRMLinker, VoiceCallerCRMLinkRecord, } from "./callerCRMLinker";
358
+ export { createVoiceCRMCallLogger } from "./crmCallLogger";
359
+ export type { CreateVoiceCRMCallLoggerOptions, VoiceCRMCallLogErrorPolicy, VoiceCRMCallLogger, VoiceCRMCallLoggerInput, VoiceCRMCallLogResult, } from "./crmCallLogger";
344
360
  export * from "./types";