@absolutejs/voice 0.0.22-beta.2 → 0.0.22-beta.4
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.
- package/dist/assistant.d.ts +44 -0
- package/dist/assistantMemory.d.ts +63 -0
- package/dist/fileStore.d.ts +5 -2
- package/dist/index.d.ts +5 -3
- package/dist/index.js +395 -3
- package/dist/trace.d.ts +1 -1
- package/package.json +1 -1
package/dist/assistant.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type VoiceAgent, type VoiceAgentModel, type VoiceAgentOptions, type VoiceAgentSquadOptions, type VoiceAgentTool } from './agent';
|
|
2
2
|
import { type VoiceOutcomeRecipeName, type VoiceOutcomeRecipeOptions } from './outcomeRecipes';
|
|
3
|
+
import { type VoiceAssistantMemoryHandle, type VoiceAssistantMemoryOptions } from './assistantMemory';
|
|
3
4
|
import type { VoiceNormalizedRouteConfig, VoiceOnTurnObjectHandler, VoiceRouteConfig, VoiceRouteResult, VoiceRuntimeOpsConfig, VoiceSessionRecord } from './types';
|
|
5
|
+
import type { StoredVoiceTraceEvent, VoiceTraceEventStore } from './trace';
|
|
4
6
|
export type VoiceAssistantPreset = VoiceOutcomeRecipeName;
|
|
5
7
|
export type VoiceAssistantArtifactPlan<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
6
8
|
ops?: VoiceRuntimeOpsConfig<TContext, TSession, TResult>;
|
|
@@ -11,6 +13,7 @@ export type VoiceAssistantArtifactPlan<TContext = unknown, TSession extends Voic
|
|
|
11
13
|
};
|
|
12
14
|
export type VoiceAssistantGuardrailInput<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Parameters<VoiceOnTurnObjectHandler<TContext, TSession, TResult>>[0] & {
|
|
13
15
|
assistantId: string;
|
|
16
|
+
memory?: VoiceAssistantMemoryHandle;
|
|
14
17
|
};
|
|
15
18
|
export type VoiceAssistantOutputGuardrailInput<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceAssistantGuardrailInput<TContext, TSession, TResult> & {
|
|
16
19
|
result: VoiceRouteResult<TResult>;
|
|
@@ -28,6 +31,16 @@ export type VoiceAssistantVariant<TContext = unknown, TSession extends VoiceSess
|
|
|
28
31
|
tools?: Array<VoiceAgentTool<TContext, TSession, Record<string, unknown>, unknown, TResult>>;
|
|
29
32
|
weight?: number;
|
|
30
33
|
};
|
|
34
|
+
export type VoiceAssistantMemoryLifecycleInput<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Parameters<VoiceOnTurnObjectHandler<TContext, TSession, TResult>>[0] & {
|
|
35
|
+
assistantId: string;
|
|
36
|
+
memory: VoiceAssistantMemoryHandle;
|
|
37
|
+
};
|
|
38
|
+
export type VoiceAssistantMemoryLifecycle<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
39
|
+
afterTurn?: (input: VoiceAssistantMemoryLifecycleInput<TContext, TSession, TResult> & {
|
|
40
|
+
result: VoiceRouteResult<TResult>;
|
|
41
|
+
}) => Promise<void> | void;
|
|
42
|
+
beforeTurn?: (input: VoiceAssistantMemoryLifecycleInput<TContext, TSession, TResult>) => Promise<void> | void;
|
|
43
|
+
};
|
|
31
44
|
export type VoiceAssistantExperimentResolverInput<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord> = {
|
|
32
45
|
assistantId: string;
|
|
33
46
|
context: TContext;
|
|
@@ -82,6 +95,8 @@ export type VoiceAssistantOptions<TContext = unknown, TSession extends VoiceSess
|
|
|
82
95
|
experiment?: VoiceAssistantExperiment<TContext, TSession, TResult>;
|
|
83
96
|
guardrails?: VoiceAssistantGuardrails<TContext, TSession, TResult>;
|
|
84
97
|
id: string;
|
|
98
|
+
memory?: VoiceAssistantMemoryOptions<TContext, TSession>;
|
|
99
|
+
memoryLifecycle?: VoiceAssistantMemoryLifecycle<TContext, TSession, TResult>;
|
|
85
100
|
ops?: VoiceRuntimeOpsConfig<TContext, TSession, TResult>;
|
|
86
101
|
trace?: VoiceAgentOptions<TContext, TSession, TResult>['trace'];
|
|
87
102
|
};
|
|
@@ -94,6 +109,35 @@ export type VoiceAssistant<TContext = unknown, TSession extends VoiceSessionReco
|
|
|
94
109
|
onComplete?: VoiceRouteConfig<TContext, TSession, TResult>['onComplete'];
|
|
95
110
|
}) => VoiceNormalizedRouteConfig<TContext, TSession, TResult>;
|
|
96
111
|
};
|
|
112
|
+
export type VoiceAssistantRunSummary = {
|
|
113
|
+
assistantId: string;
|
|
114
|
+
artifactPlans: Record<string, number>;
|
|
115
|
+
averageElapsedMs?: number;
|
|
116
|
+
blockedGuardrailCount: number;
|
|
117
|
+
escalationCount: number;
|
|
118
|
+
experiments: Record<string, number>;
|
|
119
|
+
guardrailCount: number;
|
|
120
|
+
outcomes: Record<string, number>;
|
|
121
|
+
runCount: number;
|
|
122
|
+
sessions: number;
|
|
123
|
+
toolCalls: Record<string, number>;
|
|
124
|
+
transferCount: number;
|
|
125
|
+
variants: Record<string, number>;
|
|
126
|
+
memory: {
|
|
127
|
+
deletes: number;
|
|
128
|
+
gets: number;
|
|
129
|
+
lists: number;
|
|
130
|
+
sets: number;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
export type VoiceAssistantRunsSummary = {
|
|
134
|
+
assistants: VoiceAssistantRunSummary[];
|
|
135
|
+
totalRuns: number;
|
|
136
|
+
};
|
|
97
137
|
export declare const createVoiceExperiment: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: VoiceAssistantExperimentOptions<TContext, TSession, TResult>) => VoiceAssistantExperiment<TContext, TSession, TResult>;
|
|
98
138
|
export declare const createVoiceAssistant: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: VoiceAssistantOptions<TContext, TSession, TResult>) => VoiceAssistant<TContext, TSession, TResult>;
|
|
139
|
+
export declare const summarizeVoiceAssistantRuns: (input: StoredVoiceTraceEvent[] | {
|
|
140
|
+
events?: StoredVoiceTraceEvent[];
|
|
141
|
+
store?: VoiceTraceEventStore;
|
|
142
|
+
}) => Promise<VoiceAssistantRunsSummary>;
|
|
99
143
|
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { VoiceSessionRecord } from './types';
|
|
2
|
+
import type { VoiceTraceEventStore } from './trace';
|
|
3
|
+
export type VoiceAssistantMemoryRecord<TValue = unknown, TMetadata extends Record<string, unknown> = Record<string, unknown>> = {
|
|
4
|
+
assistantId: string;
|
|
5
|
+
createdAt: number;
|
|
6
|
+
key: string;
|
|
7
|
+
metadata?: TMetadata;
|
|
8
|
+
namespace: string;
|
|
9
|
+
updatedAt: number;
|
|
10
|
+
value: TValue;
|
|
11
|
+
};
|
|
12
|
+
export type VoiceAssistantMemoryStore<TRecord extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord> = {
|
|
13
|
+
delete: (input: {
|
|
14
|
+
assistantId: string;
|
|
15
|
+
key: string;
|
|
16
|
+
namespace: string;
|
|
17
|
+
}) => Promise<void>;
|
|
18
|
+
get: (input: {
|
|
19
|
+
assistantId: string;
|
|
20
|
+
key: string;
|
|
21
|
+
namespace: string;
|
|
22
|
+
}) => Promise<TRecord | undefined>;
|
|
23
|
+
list: (input: {
|
|
24
|
+
assistantId: string;
|
|
25
|
+
namespace?: string;
|
|
26
|
+
}) => Promise<TRecord[]>;
|
|
27
|
+
set: (input: Omit<TRecord, 'createdAt' | 'updatedAt'> & {
|
|
28
|
+
createdAt?: number;
|
|
29
|
+
updatedAt?: number;
|
|
30
|
+
}) => Promise<TRecord>;
|
|
31
|
+
};
|
|
32
|
+
export type VoiceAssistantMemoryNamespaceInput<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord> = {
|
|
33
|
+
assistantId: string;
|
|
34
|
+
context: TContext;
|
|
35
|
+
session: TSession;
|
|
36
|
+
};
|
|
37
|
+
export type VoiceAssistantMemoryOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TRecord extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord> = {
|
|
38
|
+
namespace: string | ((input: VoiceAssistantMemoryNamespaceInput<TContext, TSession>) => Promise<string> | string);
|
|
39
|
+
store: VoiceAssistantMemoryStore<TRecord>;
|
|
40
|
+
};
|
|
41
|
+
export type VoiceAssistantMemoryBinding<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TRecord extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord> = VoiceAssistantMemoryOptions<TContext, TSession, TRecord>;
|
|
42
|
+
export type VoiceAssistantMemoryHandle<TRecord extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord> = {
|
|
43
|
+
delete: (key: string) => Promise<void>;
|
|
44
|
+
get: <TValue = unknown>(key: string) => Promise<TValue | undefined>;
|
|
45
|
+
list: () => Promise<TRecord[]>;
|
|
46
|
+
namespace: string;
|
|
47
|
+
set: <TValue = unknown>(key: string, value: TValue, metadata?: Record<string, unknown>) => Promise<TRecord>;
|
|
48
|
+
};
|
|
49
|
+
export declare const createVoiceAssistantMemoryRecord: <TValue = unknown, TMetadata extends Record<string, unknown> = Record<string, unknown>>(input: Omit<VoiceAssistantMemoryRecord<TValue, TMetadata>, "createdAt" | "updatedAt"> & {
|
|
50
|
+
createdAt?: number;
|
|
51
|
+
updatedAt?: number;
|
|
52
|
+
}) => VoiceAssistantMemoryRecord<TValue, TMetadata>;
|
|
53
|
+
export declare const createVoiceMemoryAssistantMemoryStore: <TRecord extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord>() => VoiceAssistantMemoryStore<TRecord>;
|
|
54
|
+
export declare const resolveVoiceAssistantMemoryNamespace: <TContext, TSession extends VoiceSessionRecord>(input: VoiceAssistantMemoryNamespaceInput<TContext, TSession> & {
|
|
55
|
+
memory: VoiceAssistantMemoryOptions<TContext, TSession>;
|
|
56
|
+
}) => Promise<string>;
|
|
57
|
+
export declare const createVoiceAssistantMemoryHandle: <TContext, TSession extends VoiceSessionRecord, TRecord extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord>(input: {
|
|
58
|
+
assistantId: string;
|
|
59
|
+
context: TContext;
|
|
60
|
+
memory: VoiceAssistantMemoryOptions<TContext, TSession, TRecord>;
|
|
61
|
+
session: TSession;
|
|
62
|
+
trace?: VoiceTraceEventStore;
|
|
63
|
+
}) => Promise<VoiceAssistantMemoryHandle<TRecord>>;
|
package/dist/fileStore.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type VoiceAssistantMemoryRecord, type VoiceAssistantMemoryStore } from './assistantMemory';
|
|
1
2
|
import { type StoredVoiceTraceEvent, type VoiceTraceSinkDeliveryRecord, type VoiceTraceSinkDeliveryStore, type VoiceTraceEventStore } from './trace';
|
|
2
3
|
import type { StoredVoiceIntegrationEvent, StoredVoiceExternalObjectMap, StoredVoiceOpsTask, VoiceExternalObjectMap, VoiceExternalObjectMapStore, VoiceIntegrationEvent, VoiceIntegrationEventStore, VoiceOpsTask, VoiceOpsTaskStore } from './ops';
|
|
3
4
|
import type { StoredVoiceCallReviewArtifact, VoiceCallReviewArtifact, VoiceCallReviewStore } from './testing/review';
|
|
@@ -6,9 +7,10 @@ export type VoiceFileStoreOptions = {
|
|
|
6
7
|
directory: string;
|
|
7
8
|
pretty?: boolean;
|
|
8
9
|
};
|
|
9
|
-
export type VoiceFileRuntimeStorage<TSession extends VoiceSessionRecord = VoiceSessionRecord, TReview extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact, TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask, TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent, TMapping extends StoredVoiceExternalObjectMap = StoredVoiceExternalObjectMap, TTrace extends StoredVoiceTraceEvent = StoredVoiceTraceEvent, TTraceDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord> = {
|
|
10
|
+
export type VoiceFileRuntimeStorage<TSession extends VoiceSessionRecord = VoiceSessionRecord, TReview extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact, TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask, TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent, TMapping extends StoredVoiceExternalObjectMap = StoredVoiceExternalObjectMap, TTrace extends StoredVoiceTraceEvent = StoredVoiceTraceEvent, TTraceDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord, TMemory extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord> = {
|
|
10
11
|
events: VoiceIntegrationEventStore<TEvent>;
|
|
11
12
|
externalObjects: VoiceExternalObjectMapStore<TMapping>;
|
|
13
|
+
memories: VoiceAssistantMemoryStore<TMemory>;
|
|
12
14
|
reviews: VoiceCallReviewStore<TReview>;
|
|
13
15
|
session: VoiceSessionStore<TSession>;
|
|
14
16
|
tasks: VoiceOpsTaskStore<TTask>;
|
|
@@ -22,7 +24,8 @@ export declare const createVoiceFileIntegrationEventStore: <TEvent extends Store
|
|
|
22
24
|
export declare const createVoiceFileExternalObjectMapStore: <TMapping extends StoredVoiceExternalObjectMap = StoredVoiceExternalObjectMap>(options: VoiceFileStoreOptions) => VoiceExternalObjectMapStore<TMapping>;
|
|
23
25
|
export declare const createVoiceFileTraceEventStore: <TEvent extends StoredVoiceTraceEvent = StoredVoiceTraceEvent>(options: VoiceFileStoreOptions) => VoiceTraceEventStore<TEvent>;
|
|
24
26
|
export declare const createVoiceFileTraceSinkDeliveryStore: <TDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord>(options: VoiceFileStoreOptions) => VoiceTraceSinkDeliveryStore<TDelivery>;
|
|
25
|
-
export declare const
|
|
27
|
+
export declare const createVoiceFileAssistantMemoryStore: <TRecord extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord>(options: VoiceFileStoreOptions) => VoiceAssistantMemoryStore<TRecord>;
|
|
28
|
+
export declare const createVoiceFileRuntimeStorage: <TSession extends VoiceSessionRecord = VoiceSessionRecord, TReview extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact, TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask, TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent, TMapping extends StoredVoiceExternalObjectMap = StoredVoiceExternalObjectMap, TTrace extends StoredVoiceTraceEvent = StoredVoiceTraceEvent, TTraceDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord, TMemory extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord>(options: VoiceFileStoreOptions) => VoiceFileRuntimeStorage<TSession, TReview, TTask, TEvent, TMapping, TTrace, TTraceDelivery, TMemory>;
|
|
26
29
|
export declare const createStoredVoiceCallReviewArtifact: <TArtifact extends VoiceCallReviewArtifact = VoiceCallReviewArtifact>(id: string, artifact: TArtifact) => TArtifact & {
|
|
27
30
|
id: string;
|
|
28
31
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { voice } from './plugin';
|
|
2
|
-
export { createVoiceAssistant, createVoiceExperiment } from './assistant';
|
|
2
|
+
export { createVoiceAssistant, createVoiceExperiment, summarizeVoiceAssistantRuns } from './assistant';
|
|
3
3
|
export { createVoiceAgent, createVoiceAgentSquad, createVoiceAgentTool } from './agent';
|
|
4
|
-
export { createStoredVoiceCallReviewArtifact, createStoredVoiceExternalObjectMap, createStoredVoiceIntegrationEvent, createStoredVoiceOpsTask, createVoiceFileExternalObjectMapStore, createVoiceFileIntegrationEventStore, createVoiceFileReviewStore, createVoiceFileRuntimeStorage, createVoiceFileSessionStore, createVoiceFileTaskStore, createVoiceFileTraceSinkDeliveryStore, createVoiceFileTraceEventStore } from './fileStore';
|
|
4
|
+
export { createStoredVoiceCallReviewArtifact, createStoredVoiceExternalObjectMap, createStoredVoiceIntegrationEvent, createStoredVoiceOpsTask, createVoiceFileExternalObjectMapStore, createVoiceFileAssistantMemoryStore, createVoiceFileIntegrationEventStore, createVoiceFileReviewStore, createVoiceFileRuntimeStorage, createVoiceFileSessionStore, createVoiceFileTaskStore, createVoiceFileTraceSinkDeliveryStore, createVoiceFileTraceEventStore } from './fileStore';
|
|
5
|
+
export { createVoiceAssistantMemoryHandle, createVoiceAssistantMemoryRecord, createVoiceMemoryAssistantMemoryStore, resolveVoiceAssistantMemoryNamespace } from './assistantMemory';
|
|
5
6
|
export { buildVoiceTraceReplay, createVoiceMemoryTraceSinkDeliveryStore, createVoiceTraceHTTPSink, createVoiceMemoryTraceEventStore, createVoiceTraceSinkDeliveryId, createVoiceTraceSinkDeliveryRecord, createVoiceTraceSinkStore, createVoiceTraceEvent, createVoiceTraceEventId, deliverVoiceTraceEventsToSinks, evaluateVoiceTrace, exportVoiceTrace, filterVoiceTraceEvents, pruneVoiceTraceEvents, redactVoiceTraceEvent, redactVoiceTraceEvents, redactVoiceTraceText, renderVoiceTraceHTML, renderVoiceTraceMarkdown, resolveVoiceTraceRedactionOptions, selectVoiceTraceEventsForPrune, summarizeVoiceTrace } from './trace';
|
|
6
7
|
export { createVoiceSQLiteExternalObjectMapStore, createVoiceSQLiteIntegrationEventStore, createVoiceSQLiteReviewStore, createVoiceSQLiteRuntimeStorage, createVoiceSQLiteSessionStore, createVoiceSQLiteTaskStore, createVoiceSQLiteTraceSinkDeliveryStore, createVoiceSQLiteTraceEventStore } from './sqliteStore';
|
|
7
8
|
export { createVoicePostgresExternalObjectMapStore, createVoicePostgresIntegrationEventStore, createVoicePostgresReviewStore, createVoicePostgresRuntimeStorage, createVoicePostgresSessionStore, createVoicePostgresTaskStore, createVoicePostgresTraceSinkDeliveryStore, createVoicePostgresTraceEventStore } from './postgresStore';
|
|
@@ -22,7 +23,8 @@ export { conditionAudioChunk, resolveAudioConditioningConfig } from './audioCond
|
|
|
22
23
|
export { resolveVoiceRuntimePreset } from './presets';
|
|
23
24
|
export { resolveTurnDetectionConfig, TURN_PROFILE_DEFAULTS } from './turnProfiles';
|
|
24
25
|
export { createVoiceCallReviewFromLiveTelephonyReport, createVoiceCallReviewRecorder, renderVoiceCallReviewHTML, renderVoiceCallReviewMarkdown } from './testing/review';
|
|
25
|
-
export type { VoiceAssistant, VoiceAssistantArtifactPlan, VoiceAssistantExperiment, VoiceAssistantExperimentOptions, VoiceAssistantGuardrailInput, VoiceAssistantGuardrails, VoiceAssistantOptions, VoiceAssistantOutputGuardrailInput, VoiceAssistantPreset, VoiceAssistantVariant } from './assistant';
|
|
26
|
+
export type { VoiceAssistant, VoiceAssistantArtifactPlan, VoiceAssistantExperiment, VoiceAssistantExperimentOptions, VoiceAssistantGuardrailInput, VoiceAssistantGuardrails, VoiceAssistantMemoryLifecycle, VoiceAssistantMemoryLifecycleInput, VoiceAssistantOptions, VoiceAssistantOutputGuardrailInput, VoiceAssistantPreset, VoiceAssistantRunsSummary, VoiceAssistantRunSummary, VoiceAssistantVariant } from './assistant';
|
|
27
|
+
export type { VoiceAssistantMemoryBinding, VoiceAssistantMemoryHandle, VoiceAssistantMemoryOptions, VoiceAssistantMemoryRecord, VoiceAssistantMemoryStore } from './assistantMemory';
|
|
26
28
|
export type { VoiceAgent, VoiceAgentMessage, VoiceAgentMessageRole, VoiceAgentModel, VoiceAgentModelInput, VoiceAgentModelOutput, VoiceAgentOptions, VoiceAgentRunResult, VoiceAgentSquadOptions, VoiceAgentTool, VoiceAgentToolCall, VoiceAgentToolResult } from './agent';
|
|
27
29
|
export type { VoiceOpsRuntime, VoiceOpsRuntimeConfig, VoiceOpsRuntimeSummary, VoiceOpsRuntimeSinkWorkerConfig, VoiceOpsRuntimeTaskWorkerConfig, VoiceOpsRuntimeTickResult, VoiceOpsRuntimeWebhookWorkerConfig } from './opsRuntime';
|
|
28
30
|
export type { VoiceOpsPresetName, VoiceOpsPresetOverrides, VoiceResolvedOpsPreset } from './opsPresets';
|
package/dist/index.js
CHANGED
|
@@ -5594,6 +5594,112 @@ var resolveVoiceOutcomeRecipe = (name, options = {}) => {
|
|
|
5594
5594
|
};
|
|
5595
5595
|
};
|
|
5596
5596
|
|
|
5597
|
+
// src/assistantMemory.ts
|
|
5598
|
+
var createMemoryId = (input) => `${input.assistantId}:${input.namespace}:${input.key}`;
|
|
5599
|
+
var createVoiceAssistantMemoryRecord = (input) => {
|
|
5600
|
+
const now = Date.now();
|
|
5601
|
+
return {
|
|
5602
|
+
...input,
|
|
5603
|
+
createdAt: input.createdAt ?? input.updatedAt ?? now,
|
|
5604
|
+
updatedAt: input.updatedAt ?? now
|
|
5605
|
+
};
|
|
5606
|
+
};
|
|
5607
|
+
var createVoiceMemoryAssistantMemoryStore = () => {
|
|
5608
|
+
const records = new Map;
|
|
5609
|
+
return {
|
|
5610
|
+
delete: async (input) => {
|
|
5611
|
+
records.delete(createMemoryId(input));
|
|
5612
|
+
},
|
|
5613
|
+
get: async (input) => records.get(createMemoryId(input)),
|
|
5614
|
+
list: async (input) => [...records.values()].filter((record) => record.assistantId === input.assistantId && (input.namespace === undefined || record.namespace === input.namespace)).sort((left, right) => right.updatedAt - left.updatedAt),
|
|
5615
|
+
set: async (input) => {
|
|
5616
|
+
const id = createMemoryId(input);
|
|
5617
|
+
const existing = records.get(id);
|
|
5618
|
+
const record = createVoiceAssistantMemoryRecord({
|
|
5619
|
+
...input,
|
|
5620
|
+
createdAt: input.createdAt ?? existing?.createdAt,
|
|
5621
|
+
updatedAt: input.updatedAt
|
|
5622
|
+
});
|
|
5623
|
+
records.set(id, record);
|
|
5624
|
+
return record;
|
|
5625
|
+
}
|
|
5626
|
+
};
|
|
5627
|
+
};
|
|
5628
|
+
var resolveVoiceAssistantMemoryNamespace = async (input) => typeof input.memory.namespace === "function" ? await input.memory.namespace(input) : input.memory.namespace;
|
|
5629
|
+
var createVoiceAssistantMemoryHandle = async (input) => {
|
|
5630
|
+
const namespace = await resolveVoiceAssistantMemoryNamespace({
|
|
5631
|
+
assistantId: input.assistantId,
|
|
5632
|
+
context: input.context,
|
|
5633
|
+
memory: input.memory,
|
|
5634
|
+
session: input.session
|
|
5635
|
+
});
|
|
5636
|
+
const trace = async (event) => {
|
|
5637
|
+
await input.trace?.append({
|
|
5638
|
+
at: Date.now(),
|
|
5639
|
+
payload: {
|
|
5640
|
+
assistantId: input.assistantId,
|
|
5641
|
+
namespace,
|
|
5642
|
+
...event
|
|
5643
|
+
},
|
|
5644
|
+
scenarioId: input.session.scenarioId,
|
|
5645
|
+
sessionId: input.session.id,
|
|
5646
|
+
type: "assistant.memory"
|
|
5647
|
+
});
|
|
5648
|
+
};
|
|
5649
|
+
return {
|
|
5650
|
+
delete: async (key) => {
|
|
5651
|
+
await input.memory.store.delete({
|
|
5652
|
+
assistantId: input.assistantId,
|
|
5653
|
+
key,
|
|
5654
|
+
namespace
|
|
5655
|
+
});
|
|
5656
|
+
await trace({
|
|
5657
|
+
action: "delete",
|
|
5658
|
+
key
|
|
5659
|
+
});
|
|
5660
|
+
},
|
|
5661
|
+
get: async (key) => {
|
|
5662
|
+
const record = await input.memory.store.get({
|
|
5663
|
+
assistantId: input.assistantId,
|
|
5664
|
+
key,
|
|
5665
|
+
namespace
|
|
5666
|
+
});
|
|
5667
|
+
await trace({
|
|
5668
|
+
action: "get",
|
|
5669
|
+
found: Boolean(record),
|
|
5670
|
+
key
|
|
5671
|
+
});
|
|
5672
|
+
return record?.value;
|
|
5673
|
+
},
|
|
5674
|
+
list: async () => {
|
|
5675
|
+
const records = await input.memory.store.list({
|
|
5676
|
+
assistantId: input.assistantId,
|
|
5677
|
+
namespace
|
|
5678
|
+
});
|
|
5679
|
+
await trace({
|
|
5680
|
+
action: "list",
|
|
5681
|
+
count: records.length
|
|
5682
|
+
});
|
|
5683
|
+
return records;
|
|
5684
|
+
},
|
|
5685
|
+
namespace,
|
|
5686
|
+
set: async (key, value, metadata) => {
|
|
5687
|
+
const record = await input.memory.store.set({
|
|
5688
|
+
assistantId: input.assistantId,
|
|
5689
|
+
key,
|
|
5690
|
+
metadata,
|
|
5691
|
+
namespace,
|
|
5692
|
+
value
|
|
5693
|
+
});
|
|
5694
|
+
await trace({
|
|
5695
|
+
action: "set",
|
|
5696
|
+
key
|
|
5697
|
+
});
|
|
5698
|
+
return record;
|
|
5699
|
+
}
|
|
5700
|
+
};
|
|
5701
|
+
};
|
|
5702
|
+
|
|
5597
5703
|
// src/assistant.ts
|
|
5598
5704
|
var hashString = (value) => {
|
|
5599
5705
|
let hash = 2166136261;
|
|
@@ -5603,6 +5709,47 @@ var hashString = (value) => {
|
|
|
5603
5709
|
}
|
|
5604
5710
|
return hash >>> 0;
|
|
5605
5711
|
};
|
|
5712
|
+
var increment = (record, key) => {
|
|
5713
|
+
record[key] = (record[key] ?? 0) + 1;
|
|
5714
|
+
};
|
|
5715
|
+
var resolveOutcome = (result) => {
|
|
5716
|
+
if (result.transfer) {
|
|
5717
|
+
return "transferred";
|
|
5718
|
+
}
|
|
5719
|
+
if (result.escalate) {
|
|
5720
|
+
return "escalated";
|
|
5721
|
+
}
|
|
5722
|
+
if (result.voicemail) {
|
|
5723
|
+
return "voicemail";
|
|
5724
|
+
}
|
|
5725
|
+
if (result.noAnswer) {
|
|
5726
|
+
return "no-answer";
|
|
5727
|
+
}
|
|
5728
|
+
if (result.complete) {
|
|
5729
|
+
return "completed";
|
|
5730
|
+
}
|
|
5731
|
+
return "continued";
|
|
5732
|
+
};
|
|
5733
|
+
var resolveArtifactPlanName = (artifactPlan) => {
|
|
5734
|
+
const preset = artifactPlan?.preset;
|
|
5735
|
+
if (!preset) {
|
|
5736
|
+
return artifactPlan?.ops ? "custom" : undefined;
|
|
5737
|
+
}
|
|
5738
|
+
return typeof preset === "string" ? preset : preset.name;
|
|
5739
|
+
};
|
|
5740
|
+
var appendAssistantTrace = async (input) => {
|
|
5741
|
+
await input.trace?.append({
|
|
5742
|
+
at: Date.now(),
|
|
5743
|
+
payload: {
|
|
5744
|
+
assistantId: input.assistantId,
|
|
5745
|
+
...input.event
|
|
5746
|
+
},
|
|
5747
|
+
scenarioId: input.session.scenarioId,
|
|
5748
|
+
sessionId: input.session.id,
|
|
5749
|
+
turnId: input.turnId,
|
|
5750
|
+
type: input.type
|
|
5751
|
+
});
|
|
5752
|
+
};
|
|
5606
5753
|
var resolvePresetOps = (artifactPlan) => {
|
|
5607
5754
|
const preset = artifactPlan?.preset;
|
|
5608
5755
|
if (!preset) {
|
|
@@ -5671,6 +5818,7 @@ var createVoiceExperiment = (options) => {
|
|
|
5671
5818
|
};
|
|
5672
5819
|
var createVoiceAssistant = (options) => {
|
|
5673
5820
|
const ops = mergeOps(resolvePresetOps(options.artifactPlan), options.ops);
|
|
5821
|
+
const artifactPlanName = resolveArtifactPlanName(options.artifactPlan);
|
|
5674
5822
|
let agent;
|
|
5675
5823
|
const baseModelOptions = "model" in options && options.model ? {
|
|
5676
5824
|
maxToolRounds: options.maxToolRounds,
|
|
@@ -5700,14 +5848,63 @@ var createVoiceAssistant = (options) => {
|
|
|
5700
5848
|
});
|
|
5701
5849
|
}
|
|
5702
5850
|
const onTurn = async (input) => {
|
|
5851
|
+
const memory = options.memory ? await createVoiceAssistantMemoryHandle({
|
|
5852
|
+
assistantId: options.id,
|
|
5853
|
+
context: input.context,
|
|
5854
|
+
memory: options.memory,
|
|
5855
|
+
session: input.session,
|
|
5856
|
+
trace: options.trace
|
|
5857
|
+
}) : undefined;
|
|
5703
5858
|
const guardrailInput = {
|
|
5704
5859
|
...input,
|
|
5705
|
-
assistantId: options.id
|
|
5860
|
+
assistantId: options.id,
|
|
5861
|
+
memory
|
|
5706
5862
|
};
|
|
5863
|
+
if (memory) {
|
|
5864
|
+
await options.memoryLifecycle?.beforeTurn?.({
|
|
5865
|
+
...input,
|
|
5866
|
+
assistantId: options.id,
|
|
5867
|
+
memory
|
|
5868
|
+
});
|
|
5869
|
+
}
|
|
5707
5870
|
const blocked = await options.guardrails?.beforeTurn?.(guardrailInput);
|
|
5708
5871
|
if (blocked) {
|
|
5872
|
+
if (memory) {
|
|
5873
|
+
await options.memoryLifecycle?.afterTurn?.({
|
|
5874
|
+
...input,
|
|
5875
|
+
assistantId: options.id,
|
|
5876
|
+
memory,
|
|
5877
|
+
result: blocked
|
|
5878
|
+
});
|
|
5879
|
+
}
|
|
5880
|
+
await appendAssistantTrace({
|
|
5881
|
+
assistantId: options.id,
|
|
5882
|
+
event: {
|
|
5883
|
+
action: "blocked",
|
|
5884
|
+
artifactPlan: artifactPlanName,
|
|
5885
|
+
outcome: resolveOutcome(blocked)
|
|
5886
|
+
},
|
|
5887
|
+
session: input.session,
|
|
5888
|
+
trace: options.trace,
|
|
5889
|
+
turnId: input.turn.id,
|
|
5890
|
+
type: "assistant.guardrail"
|
|
5891
|
+
});
|
|
5892
|
+
await appendAssistantTrace({
|
|
5893
|
+
assistantId: options.id,
|
|
5894
|
+
event: {
|
|
5895
|
+
artifactPlan: artifactPlanName,
|
|
5896
|
+
blocked: true,
|
|
5897
|
+
experimentId: options.experiment?.id,
|
|
5898
|
+
outcome: resolveOutcome(blocked)
|
|
5899
|
+
},
|
|
5900
|
+
session: input.session,
|
|
5901
|
+
trace: options.trace,
|
|
5902
|
+
turnId: input.turn.id,
|
|
5903
|
+
type: "assistant.run"
|
|
5904
|
+
});
|
|
5709
5905
|
return blocked;
|
|
5710
5906
|
}
|
|
5907
|
+
const startedAt = Date.now();
|
|
5711
5908
|
const variant = options.experiment?.resolve({
|
|
5712
5909
|
assistantId: options.id,
|
|
5713
5910
|
context: input.context,
|
|
@@ -5722,12 +5919,56 @@ var createVoiceAssistant = (options) => {
|
|
|
5722
5919
|
trace: options.trace,
|
|
5723
5920
|
tools: variant.tools ?? baseModelOptions.tools
|
|
5724
5921
|
}) : agent;
|
|
5725
|
-
const
|
|
5922
|
+
const runResult = await runner.run(input) ?? {};
|
|
5923
|
+
const result = runResult;
|
|
5726
5924
|
const guarded = await options.guardrails?.afterTurn?.({
|
|
5727
5925
|
...guardrailInput,
|
|
5728
5926
|
result
|
|
5729
5927
|
});
|
|
5730
|
-
|
|
5928
|
+
const finalResult = guarded ?? result;
|
|
5929
|
+
if (memory) {
|
|
5930
|
+
await options.memoryLifecycle?.afterTurn?.({
|
|
5931
|
+
...input,
|
|
5932
|
+
assistantId: options.id,
|
|
5933
|
+
memory,
|
|
5934
|
+
result: finalResult
|
|
5935
|
+
});
|
|
5936
|
+
}
|
|
5937
|
+
if (guarded) {
|
|
5938
|
+
await appendAssistantTrace({
|
|
5939
|
+
assistantId: options.id,
|
|
5940
|
+
event: {
|
|
5941
|
+
action: "rewritten",
|
|
5942
|
+
artifactPlan: artifactPlanName,
|
|
5943
|
+
experimentId: options.experiment?.id,
|
|
5944
|
+
outcome: resolveOutcome(finalResult),
|
|
5945
|
+
variantId: variant?.id
|
|
5946
|
+
},
|
|
5947
|
+
session: input.session,
|
|
5948
|
+
trace: options.trace,
|
|
5949
|
+
turnId: input.turn.id,
|
|
5950
|
+
type: "assistant.guardrail"
|
|
5951
|
+
});
|
|
5952
|
+
}
|
|
5953
|
+
await appendAssistantTrace({
|
|
5954
|
+
assistantId: options.id,
|
|
5955
|
+
event: {
|
|
5956
|
+
artifactPlan: artifactPlanName,
|
|
5957
|
+
blocked: false,
|
|
5958
|
+
elapsedMs: Date.now() - startedAt,
|
|
5959
|
+
escalated: Boolean(finalResult.escalate),
|
|
5960
|
+
experimentId: options.experiment?.id,
|
|
5961
|
+
outcome: resolveOutcome(finalResult),
|
|
5962
|
+
toolNames: result.toolResults?.map((tool) => tool.toolName) ?? [],
|
|
5963
|
+
transferred: Boolean(finalResult.transfer),
|
|
5964
|
+
variantId: variant?.id
|
|
5965
|
+
},
|
|
5966
|
+
session: input.session,
|
|
5967
|
+
trace: options.trace,
|
|
5968
|
+
turnId: input.turn.id,
|
|
5969
|
+
type: "assistant.run"
|
|
5970
|
+
});
|
|
5971
|
+
return finalResult;
|
|
5731
5972
|
};
|
|
5732
5973
|
return {
|
|
5733
5974
|
agent,
|
|
@@ -5743,6 +5984,112 @@ var createVoiceAssistant = (options) => {
|
|
|
5743
5984
|
})
|
|
5744
5985
|
};
|
|
5745
5986
|
};
|
|
5987
|
+
var summarizeVoiceAssistantRuns = async (input) => {
|
|
5988
|
+
const events = Array.isArray(input) ? input : input.events ?? await input.store?.list() ?? [];
|
|
5989
|
+
const assistantRuns = events.filter((event) => event.type === "assistant.run");
|
|
5990
|
+
const guardrails = events.filter((event) => event.type === "assistant.guardrail");
|
|
5991
|
+
const byAssistant = new Map;
|
|
5992
|
+
const getSummary = (assistantId) => {
|
|
5993
|
+
let summary = byAssistant.get(assistantId);
|
|
5994
|
+
if (!summary) {
|
|
5995
|
+
summary = {
|
|
5996
|
+
assistantId,
|
|
5997
|
+
artifactPlans: {},
|
|
5998
|
+
blockedGuardrailCount: 0,
|
|
5999
|
+
elapsedCount: 0,
|
|
6000
|
+
elapsedTotal: 0,
|
|
6001
|
+
escalationCount: 0,
|
|
6002
|
+
experiments: {},
|
|
6003
|
+
guardrailCount: 0,
|
|
6004
|
+
memory: {
|
|
6005
|
+
deletes: 0,
|
|
6006
|
+
gets: 0,
|
|
6007
|
+
lists: 0,
|
|
6008
|
+
sets: 0
|
|
6009
|
+
},
|
|
6010
|
+
outcomes: {},
|
|
6011
|
+
runCount: 0,
|
|
6012
|
+
sessionIds: new Set,
|
|
6013
|
+
sessions: 0,
|
|
6014
|
+
toolCalls: {},
|
|
6015
|
+
transferCount: 0,
|
|
6016
|
+
variants: {}
|
|
6017
|
+
};
|
|
6018
|
+
byAssistant.set(assistantId, summary);
|
|
6019
|
+
}
|
|
6020
|
+
return summary;
|
|
6021
|
+
};
|
|
6022
|
+
for (const event of assistantRuns) {
|
|
6023
|
+
const assistantId = typeof event.payload.assistantId === "string" ? event.payload.assistantId : "unknown";
|
|
6024
|
+
const summary = getSummary(assistantId);
|
|
6025
|
+
summary.runCount += 1;
|
|
6026
|
+
summary.sessionIds.add(event.sessionId);
|
|
6027
|
+
if (typeof event.payload.artifactPlan === "string") {
|
|
6028
|
+
increment(summary.artifactPlans, event.payload.artifactPlan);
|
|
6029
|
+
}
|
|
6030
|
+
if (typeof event.payload.experimentId === "string") {
|
|
6031
|
+
increment(summary.experiments, event.payload.experimentId);
|
|
6032
|
+
}
|
|
6033
|
+
if (typeof event.payload.variantId === "string") {
|
|
6034
|
+
increment(summary.variants, event.payload.variantId);
|
|
6035
|
+
}
|
|
6036
|
+
if (typeof event.payload.outcome === "string") {
|
|
6037
|
+
increment(summary.outcomes, event.payload.outcome);
|
|
6038
|
+
}
|
|
6039
|
+
if (event.payload.escalated === true) {
|
|
6040
|
+
summary.escalationCount += 1;
|
|
6041
|
+
}
|
|
6042
|
+
if (event.payload.transferred === true) {
|
|
6043
|
+
summary.transferCount += 1;
|
|
6044
|
+
}
|
|
6045
|
+
if (event.payload.blocked === true) {
|
|
6046
|
+
summary.blockedGuardrailCount += 1;
|
|
6047
|
+
}
|
|
6048
|
+
if (typeof event.payload.elapsedMs === "number") {
|
|
6049
|
+
summary.elapsedCount += 1;
|
|
6050
|
+
summary.elapsedTotal += event.payload.elapsedMs;
|
|
6051
|
+
}
|
|
6052
|
+
if (Array.isArray(event.payload.toolNames)) {
|
|
6053
|
+
for (const toolName of event.payload.toolNames) {
|
|
6054
|
+
if (typeof toolName === "string") {
|
|
6055
|
+
increment(summary.toolCalls, toolName);
|
|
6056
|
+
}
|
|
6057
|
+
}
|
|
6058
|
+
}
|
|
6059
|
+
}
|
|
6060
|
+
for (const event of guardrails) {
|
|
6061
|
+
const assistantId = typeof event.payload.assistantId === "string" ? event.payload.assistantId : "unknown";
|
|
6062
|
+
const summary = getSummary(assistantId);
|
|
6063
|
+
summary.guardrailCount += 1;
|
|
6064
|
+
}
|
|
6065
|
+
for (const event of events.filter((event2) => event2.type === "assistant.memory")) {
|
|
6066
|
+
const assistantId = typeof event.payload.assistantId === "string" ? event.payload.assistantId : "unknown";
|
|
6067
|
+
const summary = getSummary(assistantId);
|
|
6068
|
+
switch (event.payload.action) {
|
|
6069
|
+
case "delete":
|
|
6070
|
+
summary.memory.deletes += 1;
|
|
6071
|
+
break;
|
|
6072
|
+
case "get":
|
|
6073
|
+
summary.memory.gets += 1;
|
|
6074
|
+
break;
|
|
6075
|
+
case "list":
|
|
6076
|
+
summary.memory.lists += 1;
|
|
6077
|
+
break;
|
|
6078
|
+
case "set":
|
|
6079
|
+
summary.memory.sets += 1;
|
|
6080
|
+
break;
|
|
6081
|
+
}
|
|
6082
|
+
}
|
|
6083
|
+
const assistants = [...byAssistant.values()].map(({ elapsedCount, elapsedTotal, sessionIds, ...summary }) => ({
|
|
6084
|
+
...summary,
|
|
6085
|
+
averageElapsedMs: elapsedCount > 0 ? Math.round(elapsedTotal / elapsedCount) : undefined,
|
|
6086
|
+
sessions: sessionIds.size
|
|
6087
|
+
}));
|
|
6088
|
+
return {
|
|
6089
|
+
assistants: assistants.sort((left, right) => left.assistantId.localeCompare(right.assistantId)),
|
|
6090
|
+
totalRuns: assistantRuns.length
|
|
6091
|
+
};
|
|
6092
|
+
};
|
|
5746
6093
|
// src/fileStore.ts
|
|
5747
6094
|
import { mkdir, readFile, readdir, rename, rm, writeFile } from "fs/promises";
|
|
5748
6095
|
import { join } from "path";
|
|
@@ -6427,6 +6774,7 @@ var listJsonFiles = async (directory) => {
|
|
|
6427
6774
|
};
|
|
6428
6775
|
var encodeStoreId = (id) => `${encodeURIComponent(id)}.json`;
|
|
6429
6776
|
var resolveFilePath = (directory, id) => join(directory, encodeStoreId(id));
|
|
6777
|
+
var createMemoryStoreId = (input) => `${input.assistantId}:${input.namespace}:${input.key}`;
|
|
6430
6778
|
var readJsonFile = async (path) => JSON.parse(await readFile(path, "utf8"));
|
|
6431
6779
|
var writeJsonFile = async (path, value, options) => {
|
|
6432
6780
|
await mkdir(options.directory, {
|
|
@@ -6646,6 +6994,40 @@ var createVoiceFileTraceSinkDeliveryStore = (options) => {
|
|
|
6646
6994
|
};
|
|
6647
6995
|
return { get, list, remove, set };
|
|
6648
6996
|
};
|
|
6997
|
+
var createVoiceFileAssistantMemoryStore = (options) => {
|
|
6998
|
+
const get = async (input) => {
|
|
6999
|
+
const path = resolveFilePath(options.directory, createMemoryStoreId(input));
|
|
7000
|
+
try {
|
|
7001
|
+
return await readJsonFile(path);
|
|
7002
|
+
} catch (error) {
|
|
7003
|
+
if (error.code === "ENOENT") {
|
|
7004
|
+
return;
|
|
7005
|
+
}
|
|
7006
|
+
throw error;
|
|
7007
|
+
}
|
|
7008
|
+
};
|
|
7009
|
+
const list = async (input) => {
|
|
7010
|
+
const files = await listJsonFiles(options.directory);
|
|
7011
|
+
const records = await Promise.all(files.map((file) => readJsonFile(file)));
|
|
7012
|
+
return records.filter((record) => record.assistantId === input.assistantId && (input.namespace === undefined || record.namespace === input.namespace)).sort((left, right) => right.updatedAt - left.updatedAt);
|
|
7013
|
+
};
|
|
7014
|
+
const set = async (input) => {
|
|
7015
|
+
const existing = await get(input);
|
|
7016
|
+
const record = createVoiceAssistantMemoryRecord({
|
|
7017
|
+
...input,
|
|
7018
|
+
createdAt: input.createdAt ?? existing?.createdAt,
|
|
7019
|
+
updatedAt: input.updatedAt
|
|
7020
|
+
});
|
|
7021
|
+
await writeJsonFile(resolveFilePath(options.directory, createMemoryStoreId(record)), record, options);
|
|
7022
|
+
return record;
|
|
7023
|
+
};
|
|
7024
|
+
const remove = async (input) => {
|
|
7025
|
+
await rm(resolveFilePath(options.directory, createMemoryStoreId(input)), {
|
|
7026
|
+
force: true
|
|
7027
|
+
});
|
|
7028
|
+
};
|
|
7029
|
+
return { delete: remove, get, list, set };
|
|
7030
|
+
};
|
|
6649
7031
|
var createVoiceFileRuntimeStorage = (options) => ({
|
|
6650
7032
|
events: createVoiceFileIntegrationEventStore({
|
|
6651
7033
|
...options,
|
|
@@ -6655,6 +7037,10 @@ var createVoiceFileRuntimeStorage = (options) => ({
|
|
|
6655
7037
|
...options,
|
|
6656
7038
|
directory: join(options.directory, "external-objects")
|
|
6657
7039
|
}),
|
|
7040
|
+
memories: createVoiceFileAssistantMemoryStore({
|
|
7041
|
+
...options,
|
|
7042
|
+
directory: join(options.directory, "memories")
|
|
7043
|
+
}),
|
|
6658
7044
|
reviews: createVoiceFileReviewStore({
|
|
6659
7045
|
...options,
|
|
6660
7046
|
directory: join(options.directory, "reviews")
|
|
@@ -9141,6 +9527,7 @@ export {
|
|
|
9141
9527
|
summarizeVoiceOpsTaskQueue,
|
|
9142
9528
|
summarizeVoiceOpsTaskAnalytics,
|
|
9143
9529
|
summarizeVoiceIntegrationEvents,
|
|
9530
|
+
summarizeVoiceAssistantRuns,
|
|
9144
9531
|
startVoiceOpsTask,
|
|
9145
9532
|
shapeTelephonyAssistantText,
|
|
9146
9533
|
selectVoiceTraceEventsForPrune,
|
|
@@ -9152,6 +9539,7 @@ export {
|
|
|
9152
9539
|
resolveVoiceOpsTaskAssignment,
|
|
9153
9540
|
resolveVoiceOpsTaskAgeBucket,
|
|
9154
9541
|
resolveVoiceOpsPreset,
|
|
9542
|
+
resolveVoiceAssistantMemoryNamespace,
|
|
9155
9543
|
resolveTurnDetectionConfig,
|
|
9156
9544
|
resolveAudioConditioningConfig,
|
|
9157
9545
|
requeueVoiceOpsTask,
|
|
@@ -9227,6 +9615,7 @@ export {
|
|
|
9227
9615
|
createVoiceMemoryTraceSinkDeliveryStore,
|
|
9228
9616
|
createVoiceMemoryTraceEventStore,
|
|
9229
9617
|
createVoiceMemoryStore,
|
|
9618
|
+
createVoiceMemoryAssistantMemoryStore,
|
|
9230
9619
|
createVoiceLinearIssueUpdateSink,
|
|
9231
9620
|
createVoiceLinearIssueSyncSinks,
|
|
9232
9621
|
createVoiceLinearIssueSink,
|
|
@@ -9246,6 +9635,7 @@ export {
|
|
|
9246
9635
|
createVoiceFileReviewStore,
|
|
9247
9636
|
createVoiceFileIntegrationEventStore,
|
|
9248
9637
|
createVoiceFileExternalObjectMapStore,
|
|
9638
|
+
createVoiceFileAssistantMemoryStore,
|
|
9249
9639
|
createVoiceExternalObjectMapId,
|
|
9250
9640
|
createVoiceExternalObjectMap,
|
|
9251
9641
|
createVoiceExperiment,
|
|
@@ -9254,6 +9644,8 @@ export {
|
|
|
9254
9644
|
createVoiceCallReviewFromLiveTelephonyReport,
|
|
9255
9645
|
createVoiceCallCompletedEvent,
|
|
9256
9646
|
createVoiceCRMActivitySink,
|
|
9647
|
+
createVoiceAssistantMemoryRecord,
|
|
9648
|
+
createVoiceAssistantMemoryHandle,
|
|
9257
9649
|
createVoiceAssistant,
|
|
9258
9650
|
createVoiceAgentTool,
|
|
9259
9651
|
createVoiceAgentSquad,
|
package/dist/trace.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type VoiceTraceEventType = 'agent.handoff' | 'agent.model' | 'agent.result' | 'agent.tool' | 'call.lifecycle' | 'session.error' | 'turn.assistant' | 'turn.committed' | 'turn.cost' | 'turn.transcript';
|
|
1
|
+
export type VoiceTraceEventType = 'assistant.guardrail' | 'assistant.memory' | 'assistant.run' | 'agent.handoff' | 'agent.model' | 'agent.result' | 'agent.tool' | 'call.lifecycle' | 'session.error' | 'turn.assistant' | 'turn.committed' | 'turn.cost' | 'turn.transcript';
|
|
2
2
|
export type VoiceTraceEvent<TPayload extends Record<string, unknown> = Record<string, unknown>> = {
|
|
3
3
|
at: number;
|
|
4
4
|
id?: string;
|