@anam-ai/js-sdk 4.8.0-alpha.sam.1 → 4.8.0-alpha.sam.3
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/main/AnamClient.d.ts +1 -1
- package/dist/main/AnamClient.d.ts.map +1 -1
- package/dist/main/AnamClient.js +1 -1
- package/dist/main/AnamClient.js.map +1 -1
- package/dist/main/modules/{ThoughtHistoryClient.d.ts → ReasoningHistoryClient.d.ts} +4 -4
- package/dist/main/modules/ReasoningHistoryClient.d.ts.map +1 -0
- package/dist/main/modules/ReasoningHistoryClient.js +46 -0
- package/dist/main/modules/ReasoningHistoryClient.js.map +1 -0
- package/dist/main/modules/index.d.ts +1 -1
- package/dist/main/modules/index.d.ts.map +1 -1
- package/dist/main/modules/index.js +3 -3
- package/dist/main/modules/index.js.map +1 -1
- package/dist/main/types/events/internal/InternalEvent.d.ts +1 -1
- package/dist/main/types/events/internal/InternalEvent.d.ts.map +1 -1
- package/dist/main/types/events/internal/InternalEvent.js +1 -1
- package/dist/main/types/events/internal/InternalEvent.js.map +1 -1
- package/dist/main/types/events/internal/InternalEventCallbacks.d.ts +2 -1
- package/dist/main/types/events/internal/InternalEventCallbacks.d.ts.map +1 -1
- package/dist/main/types/events/public/AnamEvent.d.ts +2 -2
- package/dist/main/types/events/public/AnamEvent.d.ts.map +1 -1
- package/dist/main/types/events/public/AnamEvent.js +2 -2
- package/dist/main/types/events/public/AnamEvent.js.map +1 -1
- package/dist/main/types/events/public/EventCallbacks.d.ts +3 -1
- package/dist/main/types/events/public/EventCallbacks.d.ts.map +1 -1
- package/dist/main/types/messageHistory/ReasoningMessage.d.ts +6 -0
- package/dist/main/types/messageHistory/ReasoningMessage.d.ts.map +1 -0
- package/dist/main/types/messageHistory/{Thought.js → ReasoningMessage.js} +1 -1
- package/dist/main/types/messageHistory/ReasoningMessage.js.map +1 -0
- package/dist/main/types/messageHistory/ReasoningStreamEvent.d.ts +7 -0
- package/dist/main/types/messageHistory/ReasoningStreamEvent.d.ts.map +1 -0
- package/dist/main/types/messageHistory/{ThoughtStreamEvent.js → ReasoningStreamEvent.js} +1 -1
- package/dist/main/types/messageHistory/ReasoningStreamEvent.js.map +1 -0
- package/dist/main/types/messageHistory/index.d.ts +2 -2
- package/dist/main/types/messageHistory/index.d.ts.map +1 -1
- package/dist/module/AnamClient.d.ts +65 -0
- package/dist/module/AnamClient.d.ts.map +1 -0
- package/dist/module/AnamClient.js +462 -0
- package/dist/module/AnamClient.js.map +1 -0
- package/dist/module/index.d.ts +26 -0
- package/dist/module/index.d.ts.map +1 -0
- package/dist/module/index.js +27 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/lib/ClientError.d.ts +19 -0
- package/dist/module/lib/ClientError.d.ts.map +1 -0
- package/dist/module/lib/ClientError.js +30 -0
- package/dist/module/lib/ClientError.js.map +1 -0
- package/dist/module/lib/ClientMetrics.d.ts +59 -0
- package/dist/module/lib/ClientMetrics.d.ts.map +1 -0
- package/dist/module/lib/ClientMetrics.js +305 -0
- package/dist/module/lib/ClientMetrics.js.map +1 -0
- package/dist/module/lib/constants.d.ts +10 -0
- package/dist/module/lib/constants.d.ts.map +1 -0
- package/dist/module/lib/constants.js +11 -0
- package/dist/module/lib/constants.js.map +1 -0
- package/dist/module/lib/correlationId.d.ts +2 -0
- package/dist/module/lib/correlationId.d.ts.map +1 -0
- package/dist/module/lib/correlationId.js +9 -0
- package/dist/module/lib/correlationId.js.map +1 -0
- package/dist/module/lib/validateApiGatewayConfig.d.ts +8 -0
- package/dist/module/lib/validateApiGatewayConfig.d.ts.map +1 -0
- package/dist/module/lib/validateApiGatewayConfig.js +31 -0
- package/dist/module/lib/validateApiGatewayConfig.js.map +1 -0
- package/dist/module/lib/version.d.ts +3 -0
- package/dist/module/lib/version.d.ts.map +1 -0
- package/dist/module/lib/version.js +3 -0
- package/dist/module/lib/version.js.map +1 -0
- package/dist/module/modules/CoreApiRestClient.d.ts +18 -0
- package/dist/module/modules/CoreApiRestClient.d.ts.map +1 -0
- package/dist/module/modules/CoreApiRestClient.js +149 -0
- package/dist/module/modules/CoreApiRestClient.js.map +1 -0
- package/dist/module/modules/EngineApiRestClient.d.ts +9 -0
- package/dist/module/modules/EngineApiRestClient.d.ts.map +1 -0
- package/dist/module/modules/EngineApiRestClient.js +56 -0
- package/dist/module/modules/EngineApiRestClient.js.map +1 -0
- package/dist/module/modules/InternalEventEmitter.d.ts +9 -0
- package/dist/module/modules/InternalEventEmitter.d.ts.map +1 -0
- package/dist/module/modules/InternalEventEmitter.js +24 -0
- package/dist/module/modules/InternalEventEmitter.js.map +1 -0
- package/dist/module/modules/MessageHistoryClient.d.ts +13 -0
- package/dist/module/modules/MessageHistoryClient.d.ts.map +1 -0
- package/dist/module/modules/MessageHistoryClient.js +66 -0
- package/dist/module/modules/MessageHistoryClient.js.map +1 -0
- package/dist/module/modules/PublicEventEmitter.d.ts +9 -0
- package/dist/module/modules/PublicEventEmitter.d.ts.map +1 -0
- package/dist/module/modules/PublicEventEmitter.js +33 -0
- package/dist/module/modules/PublicEventEmitter.js.map +1 -0
- package/dist/module/modules/ReasoningHistoryClient.d.ts +10 -0
- package/dist/module/modules/ReasoningHistoryClient.d.ts.map +1 -0
- package/dist/module/modules/ReasoningHistoryClient.js +42 -0
- package/dist/module/modules/ReasoningHistoryClient.js.map +1 -0
- package/dist/module/modules/SignallingClient.d.ts +34 -0
- package/dist/module/modules/SignallingClient.d.ts.map +1 -0
- package/dist/module/modules/SignallingClient.js +251 -0
- package/dist/module/modules/SignallingClient.js.map +1 -0
- package/dist/module/modules/StreamingClient.d.ts +81 -0
- package/dist/module/modules/StreamingClient.d.ts.map +1 -0
- package/dist/module/modules/StreamingClient.js +706 -0
- package/dist/module/modules/StreamingClient.js.map +1 -0
- package/dist/module/modules/ToolCallManager.d.ts +8 -0
- package/dist/module/modules/ToolCallManager.d.ts.map +1 -0
- package/dist/module/modules/ToolCallManager.js +17 -0
- package/dist/module/modules/ToolCallManager.js.map +1 -0
- package/dist/module/modules/index.d.ts +10 -0
- package/dist/module/modules/index.d.ts.map +1 -0
- package/dist/module/modules/index.js +10 -0
- package/dist/module/modules/index.js.map +1 -0
- package/dist/module/types/AgentAudioInputStream.d.ts +28 -0
- package/dist/module/types/AgentAudioInputStream.d.ts.map +1 -0
- package/dist/module/types/AgentAudioInputStream.js +50 -0
- package/dist/module/types/AgentAudioInputStream.js.map +1 -0
- package/dist/module/types/AnamClientOptions.d.ts +4 -0
- package/dist/module/types/AnamClientOptions.d.ts.map +1 -0
- package/dist/module/types/AnamClientOptions.js +2 -0
- package/dist/module/types/AnamClientOptions.js.map +1 -0
- package/dist/module/types/AnamInternalClientOptions.d.ts +4 -0
- package/dist/module/types/AnamInternalClientOptions.d.ts.map +1 -0
- package/dist/module/types/AnamInternalClientOptions.js +2 -0
- package/dist/module/types/AnamInternalClientOptions.js.map +1 -0
- package/dist/module/types/AnamPublicClientOptions.d.ts +20 -0
- package/dist/module/types/AnamPublicClientOptions.d.ts.map +1 -0
- package/dist/module/types/AnamPublicClientOptions.js +2 -0
- package/dist/module/types/AnamPublicClientOptions.js.map +1 -0
- package/dist/module/types/ApiGatewayConfig.d.ts +45 -0
- package/dist/module/types/ApiGatewayConfig.d.ts.map +1 -0
- package/dist/module/types/ApiGatewayConfig.js +2 -0
- package/dist/module/types/ApiGatewayConfig.js.map +1 -0
- package/dist/module/types/InputAudioState.d.ts +11 -0
- package/dist/module/types/InputAudioState.d.ts.map +1 -0
- package/dist/module/types/InputAudioState.js +8 -0
- package/dist/module/types/InputAudioState.js.map +1 -0
- package/dist/module/types/PersonaConfig.d.ts +13 -0
- package/dist/module/types/PersonaConfig.d.ts.map +1 -0
- package/dist/module/types/PersonaConfig.js +4 -0
- package/dist/module/types/PersonaConfig.js.map +1 -0
- package/dist/module/types/TalkMessageStream.d.ts +18 -0
- package/dist/module/types/TalkMessageStream.d.ts.map +1 -0
- package/dist/module/types/TalkMessageStream.js +89 -0
- package/dist/module/types/TalkMessageStream.js.map +1 -0
- package/dist/module/types/TalkMessageStreamState.d.ts +7 -0
- package/dist/module/types/TalkMessageStreamState.d.ts.map +1 -0
- package/dist/module/types/TalkMessageStreamState.js +8 -0
- package/dist/module/types/TalkMessageStreamState.js.map +1 -0
- package/dist/module/types/VoiceDetectionOptions.d.ts +4 -0
- package/dist/module/types/VoiceDetectionOptions.d.ts.map +1 -0
- package/dist/module/types/VoiceDetectionOptions.js +2 -0
- package/dist/module/types/VoiceDetectionOptions.js.map +1 -0
- package/dist/module/types/coreApi/ApiOptions.d.ts +7 -0
- package/dist/module/types/coreApi/ApiOptions.d.ts.map +1 -0
- package/dist/module/types/coreApi/ApiOptions.js +2 -0
- package/dist/module/types/coreApi/ApiOptions.js.map +1 -0
- package/dist/module/types/coreApi/StartSessionOptions.d.ts +5 -0
- package/dist/module/types/coreApi/StartSessionOptions.d.ts.map +1 -0
- package/dist/module/types/coreApi/StartSessionOptions.js +2 -0
- package/dist/module/types/coreApi/StartSessionOptions.js.map +1 -0
- package/dist/module/types/coreApi/StartSessionResponse.d.ts +13 -0
- package/dist/module/types/coreApi/StartSessionResponse.d.ts.map +1 -0
- package/dist/module/types/coreApi/StartSessionResponse.js +2 -0
- package/dist/module/types/coreApi/StartSessionResponse.js.map +1 -0
- package/dist/module/types/coreApi/index.d.ts +5 -0
- package/dist/module/types/coreApi/index.d.ts.map +1 -0
- package/dist/module/types/coreApi/index.js +2 -0
- package/dist/module/types/coreApi/index.js.map +1 -0
- package/dist/module/types/engineApi/EngineApiRestClientOptions.d.ts +4 -0
- package/dist/module/types/engineApi/EngineApiRestClientOptions.d.ts.map +1 -0
- package/dist/module/types/engineApi/EngineApiRestClientOptions.js +2 -0
- package/dist/module/types/engineApi/EngineApiRestClientOptions.js.map +1 -0
- package/dist/module/types/engineApi/index.d.ts +1 -0
- package/dist/module/types/engineApi/index.d.ts.map +1 -0
- package/dist/module/types/engineApi/index.js +2 -0
- package/dist/module/types/engineApi/index.js.map +1 -0
- package/dist/module/types/events/EventCallback.d.ts +2 -0
- package/dist/module/types/events/EventCallback.d.ts.map +1 -0
- package/dist/module/types/events/EventCallback.js +2 -0
- package/dist/module/types/events/EventCallback.js.map +1 -0
- package/dist/module/types/events/index.d.ts +7 -0
- package/dist/module/types/events/index.d.ts.map +1 -0
- package/dist/module/types/events/index.js +4 -0
- package/dist/module/types/events/index.js.map +1 -0
- package/dist/module/types/events/internal/InternalEvent.d.ts +8 -0
- package/dist/module/types/events/internal/InternalEvent.d.ts.map +1 -0
- package/dist/module/types/events/internal/InternalEvent.js +9 -0
- package/dist/module/types/events/internal/InternalEvent.js.map +1 -0
- package/dist/module/types/events/internal/InternalEventCallbacks.d.ts +9 -0
- package/dist/module/types/events/internal/InternalEventCallbacks.d.ts.map +1 -0
- package/dist/module/types/events/internal/InternalEventCallbacks.js +2 -0
- package/dist/module/types/events/internal/InternalEventCallbacks.js.map +1 -0
- package/dist/module/types/events/public/AnamEvent.d.ts +21 -0
- package/dist/module/types/events/public/AnamEvent.d.ts.map +1 -0
- package/dist/module/types/events/public/AnamEvent.js +22 -0
- package/dist/module/types/events/public/AnamEvent.js.map +1 -0
- package/dist/module/types/events/public/ConnectionClosedCodes.d.ts +8 -0
- package/dist/module/types/events/public/ConnectionClosedCodes.d.ts.map +1 -0
- package/dist/module/types/events/public/ConnectionClosedCodes.js +9 -0
- package/dist/module/types/events/public/ConnectionClosedCodes.js.map +1 -0
- package/dist/module/types/events/public/EventCallbacks.d.ts +23 -0
- package/dist/module/types/events/public/EventCallbacks.d.ts.map +1 -0
- package/dist/module/types/events/public/EventCallbacks.js +2 -0
- package/dist/module/types/events/public/EventCallbacks.js.map +1 -0
- package/dist/module/types/index.d.ts +18 -0
- package/dist/module/types/index.d.ts.map +1 -0
- package/dist/module/types/index.js +9 -0
- package/dist/module/types/index.js.map +1 -0
- package/dist/module/types/messageHistory/Message.d.ts +8 -0
- package/dist/module/types/messageHistory/Message.d.ts.map +1 -0
- package/dist/module/types/messageHistory/Message.js +2 -0
- package/dist/module/types/messageHistory/Message.js.map +1 -0
- package/dist/module/types/messageHistory/MessageRole.d.ts +5 -0
- package/dist/module/types/messageHistory/MessageRole.d.ts.map +1 -0
- package/dist/module/types/messageHistory/MessageRole.js +6 -0
- package/dist/module/types/messageHistory/MessageRole.js.map +1 -0
- package/dist/module/types/messageHistory/MessageStreamEvent.d.ts +9 -0
- package/dist/module/types/messageHistory/MessageStreamEvent.d.ts.map +1 -0
- package/dist/module/types/messageHistory/MessageStreamEvent.js +2 -0
- package/dist/module/types/messageHistory/MessageStreamEvent.js.map +1 -0
- package/dist/module/types/messageHistory/ReasoningMessage.d.ts +6 -0
- package/dist/module/types/messageHistory/ReasoningMessage.d.ts.map +1 -0
- package/dist/module/types/messageHistory/ReasoningMessage.js +2 -0
- package/dist/module/types/messageHistory/ReasoningMessage.js.map +1 -0
- package/dist/module/types/messageHistory/ReasoningStreamEvent.d.ts +7 -0
- package/dist/module/types/messageHistory/ReasoningStreamEvent.d.ts.map +1 -0
- package/dist/module/types/messageHistory/ReasoningStreamEvent.js +2 -0
- package/dist/module/types/messageHistory/ReasoningStreamEvent.js.map +1 -0
- package/dist/module/types/messageHistory/index.d.ts +6 -0
- package/dist/module/types/messageHistory/index.d.ts.map +1 -0
- package/dist/module/types/messageHistory/index.js +2 -0
- package/dist/module/types/messageHistory/index.js.map +1 -0
- package/dist/module/types/signalling/AgentAudioInputConfig.d.ts +9 -0
- package/dist/module/types/signalling/AgentAudioInputConfig.d.ts.map +1 -0
- package/dist/module/types/signalling/AgentAudioInputConfig.js +2 -0
- package/dist/module/types/signalling/AgentAudioInputConfig.js.map +1 -0
- package/dist/module/types/signalling/AgentAudioInputPayload.d.ts +13 -0
- package/dist/module/types/signalling/AgentAudioInputPayload.d.ts.map +1 -0
- package/dist/module/types/signalling/AgentAudioInputPayload.js +2 -0
- package/dist/module/types/signalling/AgentAudioInputPayload.js.map +1 -0
- package/dist/module/types/signalling/SignalMessage.d.ts +19 -0
- package/dist/module/types/signalling/SignalMessage.d.ts.map +1 -0
- package/dist/module/types/signalling/SignalMessage.js +15 -0
- package/dist/module/types/signalling/SignalMessage.js.map +1 -0
- package/dist/module/types/signalling/SignallingClientOptions.d.ts +12 -0
- package/dist/module/types/signalling/SignallingClientOptions.d.ts.map +1 -0
- package/dist/module/types/signalling/SignallingClientOptions.js +2 -0
- package/dist/module/types/signalling/SignallingClientOptions.js.map +1 -0
- package/dist/module/types/signalling/TalkMessageStreamPayload.d.ts +7 -0
- package/dist/module/types/signalling/TalkMessageStreamPayload.d.ts.map +1 -0
- package/dist/module/types/signalling/TalkMessageStreamPayload.js +2 -0
- package/dist/module/types/signalling/TalkMessageStreamPayload.js.map +1 -0
- package/dist/module/types/signalling/TalkStreamInterruptedSignalMessage.d.ts +5 -0
- package/dist/module/types/signalling/TalkStreamInterruptedSignalMessage.d.ts.map +1 -0
- package/dist/module/types/signalling/TalkStreamInterruptedSignalMessage.js +7 -0
- package/dist/module/types/signalling/TalkStreamInterruptedSignalMessage.js.map +1 -0
- package/dist/module/types/signalling/index.d.ts +6 -0
- package/dist/module/types/signalling/index.d.ts.map +1 -0
- package/dist/module/types/signalling/index.js +2 -0
- package/dist/module/types/signalling/index.js.map +1 -0
- package/dist/module/types/streaming/ClientToolEvent.d.ts +10 -0
- package/dist/module/types/streaming/ClientToolEvent.d.ts.map +1 -0
- package/dist/module/types/streaming/ClientToolEvent.js +2 -0
- package/dist/module/types/streaming/ClientToolEvent.js.map +1 -0
- package/dist/module/types/streaming/DataChannelMessage.d.ts +6 -0
- package/dist/module/types/streaming/DataChannelMessage.d.ts.map +1 -0
- package/dist/module/types/streaming/DataChannelMessage.js +7 -0
- package/dist/module/types/streaming/DataChannelMessage.js.map +1 -0
- package/dist/module/types/streaming/InputAudioOptions.d.ts +8 -0
- package/dist/module/types/streaming/InputAudioOptions.d.ts.map +1 -0
- package/dist/module/types/streaming/InputAudioOptions.js +2 -0
- package/dist/module/types/streaming/InputAudioOptions.js.map +1 -0
- package/dist/module/types/streaming/StreamingClientOptions.d.ts +16 -0
- package/dist/module/types/streaming/StreamingClientOptions.d.ts.map +1 -0
- package/dist/module/types/streaming/StreamingClientOptions.js +2 -0
- package/dist/module/types/streaming/StreamingClientOptions.js.map +1 -0
- package/dist/module/types/streaming/WebRtcClientToolEvent.d.ts +11 -0
- package/dist/module/types/streaming/WebRtcClientToolEvent.d.ts.map +1 -0
- package/dist/module/types/streaming/WebRtcClientToolEvent.js +2 -0
- package/dist/module/types/streaming/WebRtcClientToolEvent.js.map +1 -0
- package/dist/module/types/streaming/WebRtcReasoningTextMessageEvent.d.ts +8 -0
- package/dist/module/types/streaming/WebRtcReasoningTextMessageEvent.d.ts.map +1 -0
- package/dist/module/types/streaming/WebRtcReasoningTextMessageEvent.js +2 -0
- package/dist/module/types/streaming/WebRtcReasoningTextMessageEvent.js.map +1 -0
- package/dist/module/types/streaming/WebRtcTextMessageEvent.d.ts +9 -0
- package/dist/module/types/streaming/WebRtcTextMessageEvent.d.ts.map +1 -0
- package/dist/module/types/streaming/WebRtcTextMessageEvent.js +2 -0
- package/dist/module/types/streaming/WebRtcTextMessageEvent.js.map +1 -0
- package/dist/module/types/streaming/index.d.ts +8 -0
- package/dist/module/types/streaming/index.d.ts.map +1 -0
- package/dist/module/types/streaming/index.js +2 -0
- package/dist/module/types/streaming/index.js.map +1 -0
- package/dist/umd/anam.js +2 -0
- package/dist/umd/anam.js.LICENSE.txt +8 -0
- package/package.json +1 -1
- package/dist/main/modules/ThoughtHistoryClient.d.ts.map +0 -1
- package/dist/main/modules/ThoughtHistoryClient.js +0 -34
- package/dist/main/modules/ThoughtHistoryClient.js.map +0 -1
- package/dist/main/types/messageHistory/Thought.d.ts +0 -5
- package/dist/main/types/messageHistory/Thought.d.ts.map +0 -1
- package/dist/main/types/messageHistory/Thought.js.map +0 -1
- package/dist/main/types/messageHistory/ThoughtStreamEvent.d.ts +0 -6
- package/dist/main/types/messageHistory/ThoughtStreamEvent.d.ts.map +0 -1
- package/dist/main/types/messageHistory/ThoughtStreamEvent.js.map +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ApiGatewayConfig } from '../types/ApiGatewayConfig';
|
|
2
|
+
export declare const DEFAULT_ANAM_METRICS_BASE_URL = "https://api.anam.ai";
|
|
3
|
+
export declare const DEFAULT_ANAM_API_VERSION = "/v1";
|
|
4
|
+
export declare enum ClientMetricMeasurement {
|
|
5
|
+
CLIENT_METRIC_MEASUREMENT_ERROR = "client_error",
|
|
6
|
+
CLIENT_METRIC_MEASUREMENT_CONNECTION_CLOSED = "client_connection_closed",
|
|
7
|
+
CLIENT_METRIC_MEASUREMENT_CONNECTION_ESTABLISHED = "client_connection_established",
|
|
8
|
+
CLIENT_METRIC_MEASUREMENT_SESSION_ATTEMPT = "client_session_attempt",
|
|
9
|
+
CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS = "client_session_success"
|
|
10
|
+
}
|
|
11
|
+
export declare const setClientMetricsBaseUrl: (baseUrl: string, apiVersion?: string) => void;
|
|
12
|
+
export declare const setClientMetricsApiGateway: (config: ApiGatewayConfig | undefined) => void;
|
|
13
|
+
export declare const setClientMetricsDisabled: (disabled: boolean) => void;
|
|
14
|
+
export interface AnamMetricsContext {
|
|
15
|
+
sessionId: string | null;
|
|
16
|
+
organizationId: string | null;
|
|
17
|
+
attemptCorrelationId: string | null;
|
|
18
|
+
}
|
|
19
|
+
export declare const setMetricsContext: (context: Partial<AnamMetricsContext>) => void;
|
|
20
|
+
export declare const sendClientMetric: (name: string, value: string, tags?: Record<string, string | number>) => Promise<void>;
|
|
21
|
+
export interface RTCStatsJsonReport {
|
|
22
|
+
personaVideoStream?: {
|
|
23
|
+
framesReceived: number | string;
|
|
24
|
+
framesDropped: number | string;
|
|
25
|
+
framesPerSecond: number | string;
|
|
26
|
+
packetsReceived: number | string;
|
|
27
|
+
packetsLost: number | string;
|
|
28
|
+
resolution?: string;
|
|
29
|
+
jitter?: number;
|
|
30
|
+
}[];
|
|
31
|
+
personaAudioStream?: {
|
|
32
|
+
packetsReceived: number | string;
|
|
33
|
+
packetsLost: number | string;
|
|
34
|
+
audioLevel: number | string;
|
|
35
|
+
jitter?: number;
|
|
36
|
+
totalAudioEnergy?: number;
|
|
37
|
+
}[];
|
|
38
|
+
userAudioInput?: {
|
|
39
|
+
packetsSent: number | string;
|
|
40
|
+
retransmittedPackets?: number;
|
|
41
|
+
avgPacketSendDelay?: number;
|
|
42
|
+
}[];
|
|
43
|
+
codecs?: {
|
|
44
|
+
status: string;
|
|
45
|
+
mimeType: string;
|
|
46
|
+
payloadType: string | number;
|
|
47
|
+
clockRate?: number;
|
|
48
|
+
channels?: number;
|
|
49
|
+
}[];
|
|
50
|
+
transportLayer?: {
|
|
51
|
+
dtlsState: string;
|
|
52
|
+
iceState: string;
|
|
53
|
+
bytesSent?: number;
|
|
54
|
+
bytesReceived?: number;
|
|
55
|
+
}[];
|
|
56
|
+
issues: string[];
|
|
57
|
+
}
|
|
58
|
+
export declare const createRTCStatsReport: (stats: RTCStatsReport, outputFormat?: 'console' | 'json') => RTCStatsJsonReport | void;
|
|
59
|
+
//# sourceMappingURL=ClientMetrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientMetrics.d.ts","sourceRoot":"","sources":["../../../src/lib/ClientMetrics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,eAAO,MAAM,6BAA6B,wBAAwB,CAAC;AACnE,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAE9C,oBAAY,uBAAuB;IACjC,+BAA+B,iBAAiB;IAChD,2CAA2C,6BAA6B;IACxE,gDAAgD,kCAAkC;IAClF,yCAAyC,2BAA2B;IACpE,yCAAyC,2BAA2B;CACrE;AAOD,eAAO,MAAM,uBAAuB,YACzB,MAAM,eACH,MAAM,SAInB,CAAC;AAEF,eAAO,MAAM,0BAA0B,WAC7B,gBAAgB,GAAG,SAAS,S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AAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;QAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,EAAE,CAAC;IACJ,cAAc,CAAC,EAAE;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,EAAE,CAAC;IACJ,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,oBAAoB,UACxB,cAAc,iBACP,SAAS,GAAG,MAAM,KAC/B,kBAAkB,GAAG,IA+QvB,CAAC"}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { CLIENT_METADATA } from './constants';
|
|
11
|
+
export const DEFAULT_ANAM_METRICS_BASE_URL = 'https://api.anam.ai';
|
|
12
|
+
export const DEFAULT_ANAM_API_VERSION = '/v1';
|
|
13
|
+
export var ClientMetricMeasurement;
|
|
14
|
+
(function (ClientMetricMeasurement) {
|
|
15
|
+
ClientMetricMeasurement["CLIENT_METRIC_MEASUREMENT_ERROR"] = "client_error";
|
|
16
|
+
ClientMetricMeasurement["CLIENT_METRIC_MEASUREMENT_CONNECTION_CLOSED"] = "client_connection_closed";
|
|
17
|
+
ClientMetricMeasurement["CLIENT_METRIC_MEASUREMENT_CONNECTION_ESTABLISHED"] = "client_connection_established";
|
|
18
|
+
ClientMetricMeasurement["CLIENT_METRIC_MEASUREMENT_SESSION_ATTEMPT"] = "client_session_attempt";
|
|
19
|
+
ClientMetricMeasurement["CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS"] = "client_session_success";
|
|
20
|
+
})(ClientMetricMeasurement || (ClientMetricMeasurement = {}));
|
|
21
|
+
let anamCurrentBaseUrl = DEFAULT_ANAM_METRICS_BASE_URL;
|
|
22
|
+
let anamCurrentApiVersion = DEFAULT_ANAM_API_VERSION;
|
|
23
|
+
let apiGatewayConfig;
|
|
24
|
+
let metricsDisabled = false;
|
|
25
|
+
export const setClientMetricsBaseUrl = (baseUrl, apiVersion = DEFAULT_ANAM_API_VERSION) => {
|
|
26
|
+
anamCurrentBaseUrl = baseUrl;
|
|
27
|
+
anamCurrentApiVersion = apiVersion;
|
|
28
|
+
};
|
|
29
|
+
export const setClientMetricsApiGateway = (config) => {
|
|
30
|
+
apiGatewayConfig = config;
|
|
31
|
+
};
|
|
32
|
+
export const setClientMetricsDisabled = (disabled) => {
|
|
33
|
+
metricsDisabled = disabled;
|
|
34
|
+
};
|
|
35
|
+
let anamMetricsContext = {
|
|
36
|
+
sessionId: null,
|
|
37
|
+
organizationId: null,
|
|
38
|
+
attemptCorrelationId: null,
|
|
39
|
+
};
|
|
40
|
+
export const setMetricsContext = (context) => {
|
|
41
|
+
anamMetricsContext = Object.assign(Object.assign({}, anamMetricsContext), context);
|
|
42
|
+
};
|
|
43
|
+
export const sendClientMetric = (name, value, tags) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
+
// Skip sending metrics if disabled
|
|
45
|
+
if (metricsDisabled) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
const metricTags = Object.assign(Object.assign({}, CLIENT_METADATA), tags);
|
|
50
|
+
// Add session and organization IDs if available
|
|
51
|
+
if (anamMetricsContext.sessionId) {
|
|
52
|
+
metricTags.sessionId = anamMetricsContext.sessionId;
|
|
53
|
+
}
|
|
54
|
+
if (anamMetricsContext.organizationId) {
|
|
55
|
+
metricTags.organizationId = anamMetricsContext.organizationId;
|
|
56
|
+
}
|
|
57
|
+
if (anamMetricsContext.attemptCorrelationId) {
|
|
58
|
+
metricTags.attemptCorrelationId = anamMetricsContext.attemptCorrelationId;
|
|
59
|
+
}
|
|
60
|
+
// Determine URL and headers based on API Gateway configuration
|
|
61
|
+
const targetPath = `${anamCurrentApiVersion}/metrics/client`;
|
|
62
|
+
let url;
|
|
63
|
+
let headers = {
|
|
64
|
+
'Content-Type': 'application/json',
|
|
65
|
+
};
|
|
66
|
+
if ((apiGatewayConfig === null || apiGatewayConfig === void 0 ? void 0 : apiGatewayConfig.enabled) && (apiGatewayConfig === null || apiGatewayConfig === void 0 ? void 0 : apiGatewayConfig.baseUrl)) {
|
|
67
|
+
// Route through gateway
|
|
68
|
+
url = `${apiGatewayConfig.baseUrl}${targetPath}`;
|
|
69
|
+
headers['X-Anam-Target-Url'] = `${anamCurrentBaseUrl}${targetPath}`;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
// Direct call to Anam API
|
|
73
|
+
url = `${anamCurrentBaseUrl}${targetPath}`;
|
|
74
|
+
}
|
|
75
|
+
yield fetch(url, {
|
|
76
|
+
method: 'POST',
|
|
77
|
+
headers,
|
|
78
|
+
body: JSON.stringify({
|
|
79
|
+
name,
|
|
80
|
+
value,
|
|
81
|
+
tags: metricTags,
|
|
82
|
+
}),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
console.error('Failed to send error metric:', error);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
export const createRTCStatsReport = (stats, outputFormat = 'console') => {
|
|
90
|
+
/**
|
|
91
|
+
* constructs a report of the RTC stats for logging to the console or returns as JSON
|
|
92
|
+
*/
|
|
93
|
+
var _a, _b, _c;
|
|
94
|
+
// Collect stats by type for organized reporting
|
|
95
|
+
const statsByType = {};
|
|
96
|
+
stats.forEach((report) => {
|
|
97
|
+
if (!statsByType[report.type]) {
|
|
98
|
+
statsByType[report.type] = [];
|
|
99
|
+
}
|
|
100
|
+
statsByType[report.type].push(report);
|
|
101
|
+
});
|
|
102
|
+
// Initialize JSON report structure
|
|
103
|
+
const jsonReport = {
|
|
104
|
+
issues: [],
|
|
105
|
+
};
|
|
106
|
+
// Build video statistics (Persona video output)
|
|
107
|
+
const inboundVideo = ((_a = statsByType['inbound-rtp']) === null || _a === void 0 ? void 0 : _a.filter((r) => r.kind === 'video')) || [];
|
|
108
|
+
if (inboundVideo.length > 0) {
|
|
109
|
+
jsonReport.personaVideoStream = [];
|
|
110
|
+
inboundVideo.forEach((report) => {
|
|
111
|
+
var _a, _b, _c, _d, _e;
|
|
112
|
+
const videoData = {
|
|
113
|
+
framesReceived: (_a = report.framesReceived) !== null && _a !== void 0 ? _a : 'unknown',
|
|
114
|
+
framesDropped: (_b = report.framesDropped) !== null && _b !== void 0 ? _b : 'unknown',
|
|
115
|
+
framesPerSecond: (_c = report.framesPerSecond) !== null && _c !== void 0 ? _c : 'unknown',
|
|
116
|
+
packetsReceived: (_d = report.packetsReceived) !== null && _d !== void 0 ? _d : 'unknown',
|
|
117
|
+
packetsLost: (_e = report.packetsLost) !== null && _e !== void 0 ? _e : 'unknown',
|
|
118
|
+
resolution: report.frameWidth && report.frameHeight
|
|
119
|
+
? `${report.frameWidth}x${report.frameHeight}`
|
|
120
|
+
: undefined,
|
|
121
|
+
jitter: report.jitter !== undefined ? report.jitter : undefined,
|
|
122
|
+
};
|
|
123
|
+
jsonReport.personaVideoStream.push(videoData);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
// Build audio statistics (Persona audio output)
|
|
127
|
+
const inboundAudio = ((_b = statsByType['inbound-rtp']) === null || _b === void 0 ? void 0 : _b.filter((r) => r.kind === 'audio')) || [];
|
|
128
|
+
if (inboundAudio.length > 0) {
|
|
129
|
+
jsonReport.personaAudioStream = [];
|
|
130
|
+
inboundAudio.forEach((report) => {
|
|
131
|
+
var _a, _b, _c;
|
|
132
|
+
const audioData = {
|
|
133
|
+
packetsReceived: (_a = report.packetsReceived) !== null && _a !== void 0 ? _a : 'unknown',
|
|
134
|
+
packetsLost: (_b = report.packetsLost) !== null && _b !== void 0 ? _b : 'unknown',
|
|
135
|
+
audioLevel: (_c = report.audioLevel) !== null && _c !== void 0 ? _c : 'unknown',
|
|
136
|
+
jitter: report.jitter !== undefined ? report.jitter : undefined,
|
|
137
|
+
totalAudioEnergy: report.totalAudioEnergy !== undefined
|
|
138
|
+
? report.totalAudioEnergy
|
|
139
|
+
: undefined,
|
|
140
|
+
};
|
|
141
|
+
jsonReport.personaAudioStream.push(audioData);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// Build user audio input statistics
|
|
145
|
+
const outboundAudio = ((_c = statsByType['outbound-rtp']) === null || _c === void 0 ? void 0 : _c.filter((r) => r.kind === 'audio')) || [];
|
|
146
|
+
if (outboundAudio.length > 0) {
|
|
147
|
+
jsonReport.userAudioInput = [];
|
|
148
|
+
outboundAudio.forEach((report) => {
|
|
149
|
+
var _a, _b;
|
|
150
|
+
const userAudioData = {
|
|
151
|
+
packetsSent: (_a = report.packetsSent) !== null && _a !== void 0 ? _a : 'unknown',
|
|
152
|
+
retransmittedPackets: (_b = report.retransmittedPacketsSent) !== null && _b !== void 0 ? _b : undefined,
|
|
153
|
+
avgPacketSendDelay: report.totalPacketSendDelay !== undefined
|
|
154
|
+
? (report.totalPacketSendDelay / (report.packetsSent || 1)) * 1000
|
|
155
|
+
: undefined,
|
|
156
|
+
};
|
|
157
|
+
jsonReport.userAudioInput.push(userAudioData);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
// Build codec information
|
|
161
|
+
if (statsByType['codec']) {
|
|
162
|
+
jsonReport.codecs = [];
|
|
163
|
+
statsByType['codec'].forEach((report) => {
|
|
164
|
+
const codecData = {
|
|
165
|
+
status: report.payloadType ? 'Active' : 'Available',
|
|
166
|
+
mimeType: report.mimeType || 'Unknown',
|
|
167
|
+
payloadType: report.payloadType || 'N/A',
|
|
168
|
+
clockRate: report.clockRate || undefined,
|
|
169
|
+
channels: report.channels || undefined,
|
|
170
|
+
};
|
|
171
|
+
jsonReport.codecs.push(codecData);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
// Build transport layer information
|
|
175
|
+
if (statsByType['transport']) {
|
|
176
|
+
jsonReport.transportLayer = [];
|
|
177
|
+
statsByType['transport'].forEach((report) => {
|
|
178
|
+
const transportData = {
|
|
179
|
+
dtlsState: report.dtlsState || 'unknown',
|
|
180
|
+
iceState: report.iceState || 'unknown',
|
|
181
|
+
bytesSent: report.bytesSent || undefined,
|
|
182
|
+
bytesReceived: report.bytesReceived || undefined,
|
|
183
|
+
};
|
|
184
|
+
jsonReport.transportLayer.push(transportData);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
// Build issues summary
|
|
188
|
+
const issues = [];
|
|
189
|
+
// Check for video issues
|
|
190
|
+
inboundVideo.forEach((report) => {
|
|
191
|
+
if (typeof report.framesDropped === 'number' && report.framesDropped > 0) {
|
|
192
|
+
issues.push(`Video: ${report.framesDropped} frames dropped`);
|
|
193
|
+
}
|
|
194
|
+
if (typeof report.packetsLost === 'number' && report.packetsLost > 0) {
|
|
195
|
+
issues.push(`Video: ${report.packetsLost} packets lost`);
|
|
196
|
+
}
|
|
197
|
+
if (typeof report.framesPerSecond === 'number' &&
|
|
198
|
+
report.framesPerSecond < 23) {
|
|
199
|
+
issues.push(`Video: Low frame rate (${report.framesPerSecond} fps)`);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
// Check for audio issues
|
|
203
|
+
inboundAudio.forEach((report) => {
|
|
204
|
+
if (typeof report.packetsLost === 'number' && report.packetsLost > 0) {
|
|
205
|
+
issues.push(`Audio: ${report.packetsLost} packets lost`);
|
|
206
|
+
}
|
|
207
|
+
if (typeof report.jitter === 'number' && report.jitter > 0.1) {
|
|
208
|
+
issues.push(`Audio: High jitter (${(report.jitter * 1000).toFixed(1)}ms)`);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
jsonReport.issues = issues;
|
|
212
|
+
// Return JSON if requested
|
|
213
|
+
if (outputFormat === 'json') {
|
|
214
|
+
return jsonReport;
|
|
215
|
+
}
|
|
216
|
+
// Generate console output from JSON report
|
|
217
|
+
console.group('📊 WebRTC Session Statistics Report');
|
|
218
|
+
// Console output for video stream
|
|
219
|
+
if (jsonReport.personaVideoStream &&
|
|
220
|
+
jsonReport.personaVideoStream.length > 0) {
|
|
221
|
+
console.group('📹 Persona Video Stream (Inbound)');
|
|
222
|
+
jsonReport.personaVideoStream.forEach((videoData) => {
|
|
223
|
+
console.log(`Frames Received: ${videoData.framesReceived}`);
|
|
224
|
+
console.log(`Frames Dropped: ${videoData.framesDropped}`);
|
|
225
|
+
console.log(`Frames Per Second: ${videoData.framesPerSecond}`);
|
|
226
|
+
console.log(`Packets Received: ${typeof videoData.packetsReceived === 'number' ? videoData.packetsReceived.toLocaleString() : videoData.packetsReceived}`);
|
|
227
|
+
console.log(`Packets Lost: ${videoData.packetsLost}`);
|
|
228
|
+
if (videoData.resolution) {
|
|
229
|
+
console.log(`Resolution: ${videoData.resolution}`);
|
|
230
|
+
}
|
|
231
|
+
if (videoData.jitter !== undefined) {
|
|
232
|
+
console.log(`Jitter: ${videoData.jitter.toFixed(5)}ms`);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
console.groupEnd();
|
|
236
|
+
}
|
|
237
|
+
// Console output for audio stream
|
|
238
|
+
if (jsonReport.personaAudioStream &&
|
|
239
|
+
jsonReport.personaAudioStream.length > 0) {
|
|
240
|
+
console.group('🔊 Persona Audio Stream (Inbound)');
|
|
241
|
+
jsonReport.personaAudioStream.forEach((audioData) => {
|
|
242
|
+
console.log(`Packets Received: ${typeof audioData.packetsReceived === 'number' ? audioData.packetsReceived.toLocaleString() : audioData.packetsReceived}`);
|
|
243
|
+
console.log(`Packets Lost: ${audioData.packetsLost}`);
|
|
244
|
+
console.log(`Audio Level: ${audioData.audioLevel}`);
|
|
245
|
+
if (audioData.jitter !== undefined) {
|
|
246
|
+
console.log(`Jitter: ${audioData.jitter.toFixed(5)}ms`);
|
|
247
|
+
}
|
|
248
|
+
if (audioData.totalAudioEnergy !== undefined) {
|
|
249
|
+
console.log(`Total Audio Energy: ${audioData.totalAudioEnergy.toFixed(6)}`);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
console.groupEnd();
|
|
253
|
+
}
|
|
254
|
+
// Console output for user audio input
|
|
255
|
+
if (jsonReport.userAudioInput && jsonReport.userAudioInput.length > 0) {
|
|
256
|
+
console.group('🎤 User Audio Input (Outbound)');
|
|
257
|
+
jsonReport.userAudioInput.forEach((userAudioData) => {
|
|
258
|
+
console.log(`Packets Sent: ${typeof userAudioData.packetsSent === 'number' ? userAudioData.packetsSent.toLocaleString() : userAudioData.packetsSent}`);
|
|
259
|
+
if (userAudioData.retransmittedPackets) {
|
|
260
|
+
console.log(`Retransmitted Packets: ${userAudioData.retransmittedPackets}`);
|
|
261
|
+
}
|
|
262
|
+
if (userAudioData.avgPacketSendDelay !== undefined) {
|
|
263
|
+
console.log(`Avg Packet Send Delay: ${userAudioData.avgPacketSendDelay.toFixed(5)}ms`);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
console.groupEnd();
|
|
267
|
+
}
|
|
268
|
+
// Console output for codecs
|
|
269
|
+
if (jsonReport.codecs && jsonReport.codecs.length > 0) {
|
|
270
|
+
console.group('🔧 Codecs Used');
|
|
271
|
+
jsonReport.codecs.forEach((codecData) => {
|
|
272
|
+
console.log(`${codecData.status} ${codecData.mimeType} - Payload Type: ${codecData.payloadType}`);
|
|
273
|
+
if (codecData.clockRate) {
|
|
274
|
+
console.log(` Clock Rate: ${codecData.clockRate}Hz`);
|
|
275
|
+
}
|
|
276
|
+
if (codecData.channels) {
|
|
277
|
+
console.log(` Channels: ${codecData.channels}`);
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
console.groupEnd();
|
|
281
|
+
}
|
|
282
|
+
// Console output for transport layer
|
|
283
|
+
if (jsonReport.transportLayer && jsonReport.transportLayer.length > 0) {
|
|
284
|
+
console.group('🚚 Transport Layer');
|
|
285
|
+
jsonReport.transportLayer.forEach((transportData) => {
|
|
286
|
+
console.log(`DTLS State: ${transportData.dtlsState}`);
|
|
287
|
+
console.log(`ICE State: ${transportData.iceState}`);
|
|
288
|
+
if (transportData.bytesReceived || transportData.bytesSent) {
|
|
289
|
+
console.log(`Data Transfer (bytes) - Sent: ${(transportData.bytesSent || 0).toLocaleString()}, Received: ${(transportData.bytesReceived || 0).toLocaleString()}`);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
console.groupEnd();
|
|
293
|
+
}
|
|
294
|
+
// Console output for issues
|
|
295
|
+
if (jsonReport.issues.length > 0) {
|
|
296
|
+
console.group('⚠️ Potential Issues Detected');
|
|
297
|
+
jsonReport.issues.forEach((issue) => console.warn(issue));
|
|
298
|
+
console.groupEnd();
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
console.log('✅ No significant issues detected');
|
|
302
|
+
}
|
|
303
|
+
console.groupEnd();
|
|
304
|
+
};
|
|
305
|
+
//# sourceMappingURL=ClientMetrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientMetrics.js","sourceRoot":"","sources":["../../../src/lib/ClientMetrics.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,MAAM,CAAC,MAAM,6BAA6B,GAAG,qBAAqB,CAAC;AACnE,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAE9C,MAAM,CAAN,IAAY,uBAMX;AAND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AAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;IAED,4BAA4B;IAC5B,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAC9C,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1D,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,CAAC,QAAQ,EAAE,CAAC;AACrB,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const DEFAULT_HEADERS: {
|
|
2
|
+
'Content-Type': string;
|
|
3
|
+
};
|
|
4
|
+
export declare const DEFAULT_API_BASE_URL = "https://api.anam.ai";
|
|
5
|
+
export declare const DEFAULT_API_VERSION = "/v1";
|
|
6
|
+
export declare const CLIENT_METADATA: {
|
|
7
|
+
client: string;
|
|
8
|
+
version: string;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe;;CAE3B,CAAC;AAEF,eAAO,MAAM,oBAAoB,wBAAwB,CAAC;AAC1D,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC,eAAO,MAAM,eAAe;;;CAG3B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Core API
|
|
2
|
+
export const DEFAULT_HEADERS = {
|
|
3
|
+
'Content-Type': 'application/json',
|
|
4
|
+
};
|
|
5
|
+
export const DEFAULT_API_BASE_URL = 'https://api.anam.ai';
|
|
6
|
+
export const DEFAULT_API_VERSION = '/v1'; // include the leading slash
|
|
7
|
+
export const CLIENT_METADATA = {
|
|
8
|
+
client: 'js-sdk',
|
|
9
|
+
version: '0.0.0-automated',
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,cAAc,EAAE,kBAAkB;CACnC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAC1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC,CAAC,4BAA4B;AAEtE,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,iBAAiB;CAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correlationId.d.ts","sourceRoot":"","sources":["../../../src/lib/correlationId.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,WAQpC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function generateCorrelationId() {
|
|
2
|
+
// Try native crypto.randomUUID() first (supported in modern browsers)
|
|
3
|
+
if (typeof crypto !== 'undefined' && crypto.randomUUID) {
|
|
4
|
+
return crypto.randomUUID();
|
|
5
|
+
}
|
|
6
|
+
// Fallback for older environments and older react native
|
|
7
|
+
return Date.now().toString(36) + Math.random().toString(36).substr(2, 9);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=correlationId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correlationId.js","sourceRoot":"","sources":["../../../src/lib/correlationId.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,qBAAqB;IACnC,sEAAsE;IACtE,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACvD,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;IAC7B,CAAC;IAED,yDAAyD;IACzD,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ApiGatewayConfig } from '../types/ApiGatewayConfig';
|
|
2
|
+
/**
|
|
3
|
+
* Validates API Gateway configuration
|
|
4
|
+
* @param apiGatewayConfig - The API Gateway configuration to validate
|
|
5
|
+
* @returns Error message if invalid, undefined if valid
|
|
6
|
+
*/
|
|
7
|
+
export declare function validateApiGatewayConfig(apiGatewayConfig: ApiGatewayConfig | undefined): string | undefined;
|
|
8
|
+
//# sourceMappingURL=validateApiGatewayConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateApiGatewayConfig.d.ts","sourceRoot":"","sources":["../../../src/lib/validateApiGatewayConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,gBAAgB,EAAE,gBAAgB,GAAG,SAAS,GAC7C,MAAM,GAAG,SAAS,CA2BpB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates API Gateway configuration
|
|
3
|
+
* @param apiGatewayConfig - The API Gateway configuration to validate
|
|
4
|
+
* @returns Error message if invalid, undefined if valid
|
|
5
|
+
*/
|
|
6
|
+
export function validateApiGatewayConfig(apiGatewayConfig) {
|
|
7
|
+
if (!apiGatewayConfig || !apiGatewayConfig.enabled) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
if (!apiGatewayConfig.baseUrl) {
|
|
11
|
+
return 'API Gateway baseUrl is required when enabled';
|
|
12
|
+
}
|
|
13
|
+
// Validate baseUrl format
|
|
14
|
+
try {
|
|
15
|
+
const url = new URL(apiGatewayConfig.baseUrl);
|
|
16
|
+
if (!['http:', 'https:', 'ws:', 'wss:'].includes(url.protocol)) {
|
|
17
|
+
return `Invalid API Gateway baseUrl protocol: ${url.protocol}. Must be http:, https:, ws:, or wss:`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
return `Invalid API Gateway baseUrl: ${apiGatewayConfig.baseUrl}`;
|
|
22
|
+
}
|
|
23
|
+
// Validate wsPath if provided
|
|
24
|
+
if (apiGatewayConfig.wsPath) {
|
|
25
|
+
if (!apiGatewayConfig.wsPath.startsWith('/')) {
|
|
26
|
+
return 'API Gateway wsPath must start with /';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=validateApiGatewayConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateApiGatewayConfig.js","sourceRoot":"","sources":["../../../src/lib/validateApiGatewayConfig.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,gBAA8C;IAE9C,IAAI,CAAC,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;QACnD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAC9B,OAAO,8CAA8C,CAAC;IACxD,CAAC;IAED,0BAA0B;IAC1B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/D,OAAO,yCAAyC,GAAG,CAAC,QAAQ,uCAAuC,CAAC;QACtG,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,gCAAgC,gBAAgB,CAAC,OAAO,EAAE,CAAC;IACpE,CAAC;IAED,8BAA8B;IAC9B,IAAI,gBAAgB,CAAC,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7C,OAAO,sCAAsC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/lib/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/lib/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ApiOptions, PersonaConfig, StartSessionResponse } from '../types';
|
|
2
|
+
import { StartSessionOptions } from '../types/coreApi/StartSessionOptions';
|
|
3
|
+
export declare class CoreApiRestClient {
|
|
4
|
+
private baseUrl;
|
|
5
|
+
private apiVersion;
|
|
6
|
+
private apiKey;
|
|
7
|
+
private sessionToken;
|
|
8
|
+
private apiGatewayConfig;
|
|
9
|
+
constructor(sessionToken?: string, apiKey?: string, options?: ApiOptions);
|
|
10
|
+
/**
|
|
11
|
+
* Builds URL and headers for a request, applying API Gateway configuration if enabled
|
|
12
|
+
*/
|
|
13
|
+
private buildGatewayUrlAndHeaders;
|
|
14
|
+
startSession(personaConfig?: PersonaConfig, sessionOptions?: StartSessionOptions): Promise<StartSessionResponse>;
|
|
15
|
+
unsafe_getSessionToken(personaConfig: PersonaConfig): Promise<string>;
|
|
16
|
+
private getApiUrl;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=CoreApiRestClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoreApiRestClient.d.ts","sourceRoot":"","sources":["../../../src/modules/CoreApiRestClient.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,UAAU,EACV,aAAa,EACb,oBAAoB,EAErB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAG3E,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,gBAAgB,CAA+B;gBAE3C,YAAY,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU;IAWxE;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAuBpB,YAAY,CACvB,aAAa,CAAC,EAAE,aAAa,EAC7B,cAAc,CAAC,EAAE,mBAAmB,GACnC,OAAO,CAAC,oBAAoB,CAAC;IA2HnB,sBAAsB,CACjC,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,MAAM,CAAC;IAwClB,OAAO,CAAC,SAAS;CAGlB"}
|