agora-agents 3.0.0-alpha.2 → 3.0.0-alpha.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.
Files changed (111) hide show
  1. package/README.md +4 -4
  2. package/dist/cjs/AgoraPoolClient.d.ts +16 -3
  3. package/dist/cjs/AgoraPoolClient.js +26 -12
  4. package/dist/cjs/agentkit/Agent.js +17 -7
  5. package/dist/cjs/agentkit/AgentSession.js +6 -2
  6. package/dist/cjs/agentkit/avatar-types.d.ts +6 -0
  7. package/dist/cjs/agentkit/index.d.ts +5 -7
  8. package/dist/cjs/agentkit/index.js +7 -6
  9. package/dist/cjs/agentkit/presets.js +3 -3
  10. package/dist/cjs/agentkit/preview/client.d.ts +6 -5
  11. package/dist/cjs/agentkit/preview/client.js +7 -7
  12. package/dist/cjs/agentkit/preview/gemini-tts.d.ts +3 -31
  13. package/dist/cjs/agentkit/preview/gemini-tts.js +4 -30
  14. package/dist/cjs/agentkit/preview/index.d.ts +2 -2
  15. package/dist/cjs/agentkit/preview/index.js +4 -4
  16. package/dist/cjs/agentkit/token.d.ts +9 -7
  17. package/dist/cjs/agentkit/token.js +8 -7
  18. package/dist/cjs/agentkit/types.d.ts +12 -3
  19. package/dist/cjs/agentkit/v3.js +13 -7
  20. package/dist/cjs/agentkit/vendors/avatar.d.ts +6 -0
  21. package/dist/cjs/agentkit/vendors/avatar.js +14 -2
  22. package/dist/cjs/agentkit/vendors/stt.d.ts +35 -0
  23. package/dist/cjs/agentkit/vendors/stt.js +19 -2
  24. package/dist/cjs/agentkit/vendors/tts.d.ts +72 -18
  25. package/dist/cjs/agentkit/vendors/tts.js +60 -11
  26. package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +13 -0
  27. package/dist/cjs/api/resources/agents/types/GetTurnsAgentsResponse.d.ts +3 -1
  28. package/dist/cjs/api/types/Asr.d.ts +4 -1
  29. package/dist/cjs/api/types/CartesiaTts.d.ts +10 -0
  30. package/dist/cjs/api/types/CartesiaTts.js +9 -0
  31. package/dist/cjs/api/types/CartesiaTtsParams.d.ts +1 -1
  32. package/dist/cjs/api/types/DeepgramAsrParams.d.ts +1 -1
  33. package/dist/cjs/api/types/FishAudioTts.d.ts +10 -0
  34. package/dist/cjs/api/types/FishAudioTts.js +9 -0
  35. package/dist/cjs/api/types/FishAudioTtsParams.d.ts +1 -1
  36. package/dist/cjs/api/types/GeminiTts.d.ts +9 -0
  37. package/dist/cjs/api/types/GeminiTts.js +3 -0
  38. package/dist/cjs/api/types/GeminiTtsParams.d.ts +15 -0
  39. package/dist/cjs/api/types/GeminiTtsParams.js +3 -0
  40. package/dist/cjs/api/types/RtzrAsr.d.ts +10 -0
  41. package/dist/cjs/api/types/RtzrAsr.js +3 -0
  42. package/dist/cjs/api/types/RtzrAsrParams.d.ts +31 -0
  43. package/dist/cjs/api/types/RtzrAsrParams.js +3 -0
  44. package/dist/cjs/api/types/SarvamTtsParams.d.ts +12 -8
  45. package/dist/cjs/api/types/SarvamTtsParams.js +1 -1
  46. package/dist/cjs/api/types/Tts.d.ts +4 -1
  47. package/dist/cjs/api/types/index.d.ts +4 -0
  48. package/dist/cjs/api/types/index.js +4 -0
  49. package/dist/cjs/core/auth/publicAuthorization.d.ts +3 -0
  50. package/dist/cjs/core/auth/publicAuthorization.js +37 -0
  51. package/dist/cjs/index.d.ts +4 -4
  52. package/dist/cjs/index.js +7 -5
  53. package/dist/cjs/v3/transport.js +4 -3
  54. package/dist/cjs/version.d.ts +1 -1
  55. package/dist/cjs/version.js +1 -1
  56. package/dist/esm/AgoraPoolClient.d.mts +16 -3
  57. package/dist/esm/AgoraPoolClient.mjs +26 -12
  58. package/dist/esm/agentkit/Agent.mjs +17 -7
  59. package/dist/esm/agentkit/AgentSession.mjs +6 -2
  60. package/dist/esm/agentkit/avatar-types.d.mts +6 -0
  61. package/dist/esm/agentkit/index.d.mts +5 -7
  62. package/dist/esm/agentkit/index.mjs +2 -3
  63. package/dist/esm/agentkit/presets.mjs +3 -3
  64. package/dist/esm/agentkit/preview/client.d.mts +6 -5
  65. package/dist/esm/agentkit/preview/client.mjs +7 -7
  66. package/dist/esm/agentkit/preview/gemini-tts.d.mts +3 -31
  67. package/dist/esm/agentkit/preview/gemini-tts.mjs +1 -28
  68. package/dist/esm/agentkit/preview/index.d.mts +2 -2
  69. package/dist/esm/agentkit/preview/index.mjs +1 -1
  70. package/dist/esm/agentkit/token.d.mts +9 -7
  71. package/dist/esm/agentkit/token.mjs +8 -7
  72. package/dist/esm/agentkit/types.d.mts +12 -3
  73. package/dist/esm/agentkit/v3.mjs +13 -7
  74. package/dist/esm/agentkit/vendors/avatar.d.mts +6 -0
  75. package/dist/esm/agentkit/vendors/avatar.mjs +14 -2
  76. package/dist/esm/agentkit/vendors/stt.d.mts +35 -0
  77. package/dist/esm/agentkit/vendors/stt.mjs +17 -1
  78. package/dist/esm/agentkit/vendors/tts.d.mts +72 -18
  79. package/dist/esm/agentkit/vendors/tts.mjs +58 -10
  80. package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +13 -0
  81. package/dist/esm/api/resources/agents/types/GetTurnsAgentsResponse.d.mts +3 -1
  82. package/dist/esm/api/types/Asr.d.mts +4 -1
  83. package/dist/esm/api/types/CartesiaTts.d.mts +10 -0
  84. package/dist/esm/api/types/CartesiaTts.mjs +8 -1
  85. package/dist/esm/api/types/CartesiaTtsParams.d.mts +1 -1
  86. package/dist/esm/api/types/DeepgramAsrParams.d.mts +1 -1
  87. package/dist/esm/api/types/FishAudioTts.d.mts +10 -0
  88. package/dist/esm/api/types/FishAudioTts.mjs +8 -1
  89. package/dist/esm/api/types/FishAudioTtsParams.d.mts +1 -1
  90. package/dist/esm/api/types/GeminiTts.d.mts +9 -0
  91. package/dist/esm/api/types/GeminiTts.mjs +2 -0
  92. package/dist/esm/api/types/GeminiTtsParams.d.mts +15 -0
  93. package/dist/esm/api/types/GeminiTtsParams.mjs +2 -0
  94. package/dist/esm/api/types/RtzrAsr.d.mts +10 -0
  95. package/dist/esm/api/types/RtzrAsr.mjs +2 -0
  96. package/dist/esm/api/types/RtzrAsrParams.d.mts +31 -0
  97. package/dist/esm/api/types/RtzrAsrParams.mjs +2 -0
  98. package/dist/esm/api/types/SarvamTtsParams.d.mts +12 -8
  99. package/dist/esm/api/types/SarvamTtsParams.mjs +1 -1
  100. package/dist/esm/api/types/Tts.d.mts +4 -1
  101. package/dist/esm/api/types/index.d.mts +4 -0
  102. package/dist/esm/api/types/index.mjs +4 -0
  103. package/dist/esm/core/auth/publicAuthorization.d.mts +3 -0
  104. package/dist/esm/core/auth/publicAuthorization.mjs +33 -0
  105. package/dist/esm/index.d.mts +4 -4
  106. package/dist/esm/index.mjs +2 -2
  107. package/dist/esm/v3/transport.mjs +4 -3
  108. package/dist/esm/version.d.mts +1 -1
  109. package/dist/esm/version.mjs +1 -1
  110. package/openapi.yaml +13 -5
  111. package/package.json +2 -2
@@ -3,7 +3,17 @@ import type * as Agora from "../index.js";
3
3
  * Cartesia Text-to-Speech configuration (Beta).
4
4
  */
5
5
  export interface CartesiaTts {
6
+ /** Credential mode. When provided, must be "managed" (Agora managed mode) or "byok" (BYOK mode). */
7
+ credential_mode?: CartesiaTts.CredentialMode;
6
8
  params: Agora.CartesiaTtsParams;
7
9
  /** Controls whether the TTS module skips bracketed content when reading LLM response text. */
8
10
  skip_patterns?: number[];
9
11
  }
12
+ export declare namespace CartesiaTts {
13
+ /** Credential mode. When provided, must be "managed" (Agora managed mode) or "byok" (BYOK mode). */
14
+ const CredentialMode: {
15
+ readonly Managed: "managed";
16
+ readonly Byok: "byok";
17
+ };
18
+ type CredentialMode = (typeof CredentialMode)[keyof typeof CredentialMode];
19
+ }
@@ -1,3 +1,12 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CartesiaTts = void 0;
5
+ var CartesiaTts;
6
+ (function (CartesiaTts) {
7
+ /** Credential mode. When provided, must be "managed" (Agora managed mode) or "byok" (BYOK mode). */
8
+ CartesiaTts.CredentialMode = {
9
+ Managed: "managed",
10
+ Byok: "byok",
11
+ };
12
+ })(CartesiaTts || (exports.CartesiaTts = CartesiaTts = {}));
@@ -4,7 +4,7 @@ import type * as Agora from "../index.js";
4
4
  */
5
5
  export interface CartesiaTtsParams {
6
6
  /** Cartesia API key */
7
- api_key: string;
7
+ api_key?: string;
8
8
  /** Model ID (for example, sonic-2) */
9
9
  model_id: string;
10
10
  /** WebSocket URL for the Cartesia streaming API */
@@ -5,7 +5,7 @@ export interface DeepgramAsrParams {
5
5
  /** WebSocket URL for Deepgram's streaming API */
6
6
  url?: string | null;
7
7
  /** Deepgram API key */
8
- key: string;
8
+ api_key: string;
9
9
  /** Speech recognition model */
10
10
  model?: string | null;
11
11
  /** Language code for speech recognition */
@@ -3,7 +3,17 @@ import type * as Agora from "../index.js";
3
3
  * Fish Audio Text-to-Speech configuration (Beta).
4
4
  */
5
5
  export interface FishAudioTts {
6
+ /** Credential mode. When provided, must be "managed" (Agora managed mode) or "byok" (BYOK mode). */
7
+ credential_mode?: FishAudioTts.CredentialMode;
6
8
  params: Agora.FishAudioTtsParams;
7
9
  /** Controls whether the TTS module skips bracketed content when reading LLM response text. */
8
10
  skip_patterns?: number[];
9
11
  }
12
+ export declare namespace FishAudioTts {
13
+ /** Credential mode. When provided, must be "managed" (Agora managed mode) or "byok" (BYOK mode). */
14
+ const CredentialMode: {
15
+ readonly Managed: "managed";
16
+ readonly Byok: "byok";
17
+ };
18
+ type CredentialMode = (typeof CredentialMode)[keyof typeof CredentialMode];
19
+ }
@@ -1,3 +1,12 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.FishAudioTts = void 0;
5
+ var FishAudioTts;
6
+ (function (FishAudioTts) {
7
+ /** Credential mode. When provided, must be "managed" (Agora managed mode) or "byok" (BYOK mode). */
8
+ FishAudioTts.CredentialMode = {
9
+ Managed: "managed",
10
+ Byok: "byok",
11
+ };
12
+ })(FishAudioTts || (exports.FishAudioTts = FishAudioTts = {}));
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export interface FishAudioTtsParams {
5
5
  /** Fish Audio API key */
6
- api_key: string;
6
+ api_key?: string;
7
7
  /** Fish Audio reference ID */
8
8
  reference_id: string;
9
9
  /** Backend model version to use */
@@ -0,0 +1,9 @@
1
+ import type * as Agora from "../index.js";
2
+ /**
3
+ * Gemini Text-to-Speech configuration.
4
+ */
5
+ export interface GeminiTts {
6
+ params: Agora.GeminiTtsParams;
7
+ /** Controls whether the TTS module skips bracketed content when reading LLM response text. */
8
+ skip_patterns?: number[];
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Gemini TTS configuration parameters.
3
+ */
4
+ export interface GeminiTtsParams {
5
+ /** Gemini API key. */
6
+ api_key: string;
7
+ /** Gemini TTS model name. */
8
+ model: string;
9
+ /** Gemini voice name. */
10
+ voice: string;
11
+ /** Style instruction for the generated speech. */
12
+ style?: string;
13
+ /** Accepts any additional properties */
14
+ [key: string]: any;
15
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import type * as Agora from "../index.js";
2
+ /**
3
+ * RTZR ASR configuration.
4
+ */
5
+ export interface RtzrAsr {
6
+ language?: Agora.AsrLanguage;
7
+ params: Agora.RtzrAsrParams;
8
+ /** Accepts any additional properties */
9
+ [key: string]: any;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,31 @@
1
+ /**
2
+ * RTZR ASR configuration parameters.
3
+ */
4
+ export interface RtzrAsrParams {
5
+ /** RTZR client ID. */
6
+ client_id: string;
7
+ /** RTZR client secret. */
8
+ client_secret: string;
9
+ /** RTZR API base URL. */
10
+ api_base?: string;
11
+ /** RTZR recognition model name. */
12
+ model_name?: string;
13
+ /** RTZR recognition language code. Defaults to Korean (`ko`). */
14
+ language?: string;
15
+ /** Input audio sample rate in Hz. */
16
+ sample_rate?: number;
17
+ /** Input audio encoding. */
18
+ encoding?: string;
19
+ /** Whether to enable inverse text normalization. */
20
+ use_itn?: boolean;
21
+ /** Whether to filter disfluencies such as stuttering. */
22
+ use_disfluency_filter?: boolean;
23
+ /** Whether to filter profanity. */
24
+ use_profanity_filter?: boolean;
25
+ /** Whether to add punctuation to the recognized text. */
26
+ use_punctuation?: boolean;
27
+ /** Keywords to improve recognition accuracy. */
28
+ keywords?: string[];
29
+ /** Accepts any additional properties */
30
+ [key: string]: any;
31
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,23 +4,27 @@
4
4
  export interface SarvamTtsParams {
5
5
  /** Sarvam API subscription key */
6
6
  api_subscription_key: string;
7
- /** Voice ID (e.g., anushka, abhilash, karun, hitesh, manisha, vidya, arya) */
7
+ /** Speaker voice to use. */
8
8
  speaker: string;
9
- /** Target language code (e.g., en-IN) */
9
+ /** Target language code in BCP-47 format (e.g., `hi-IN`, `bn-IN`, `en-IN`). */
10
10
  target_language_code: SarvamTtsParams.TargetLanguageCode;
11
- /** Pitch adjustment for the voice */
11
+ /** Pitch control for the `bulbul:v2` model. */
12
12
  pitch?: number;
13
- /** Speed of speech */
13
+ /** Speech speed. Defaults to `1.0`. */
14
14
  pace?: number;
15
- /** Volume level of the speech */
15
+ /** Audio loudness control for the `bulbul:v2` model. */
16
16
  loudness?: number;
17
- /** Audio sample rate in Hz */
18
- sample_rate?: number;
17
+ /** Output speech sample rate in Hz. Defaults to `24000`. */
18
+ speech_sample_rate?: number;
19
+ /** Whether to normalize English words and numeric entities. Defaults to `false`. */
20
+ enable_preprocessing?: boolean;
21
+ /** TTS model to use. Defaults to `bulbul:v3`. */
22
+ model?: string;
19
23
  /** Accepts any additional properties */
20
24
  [key: string]: any;
21
25
  }
22
26
  export declare namespace SarvamTtsParams {
23
- /** Target language code (e.g., en-IN) */
27
+ /** Target language code in BCP-47 format (e.g., `hi-IN`, `bn-IN`, `en-IN`). */
24
28
  const TargetLanguageCode: {
25
29
  readonly EnIn: "en-IN";
26
30
  readonly HiIn: "hi-IN";
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.SarvamTtsParams = void 0;
5
5
  var SarvamTtsParams;
6
6
  (function (SarvamTtsParams) {
7
- /** Target language code (e.g., en-IN) */
7
+ /** Target language code in BCP-47 format (e.g., `hi-IN`, `bn-IN`, `en-IN`). */
8
8
  SarvamTtsParams.TargetLanguageCode = {
9
9
  EnIn: "en-IN",
10
10
  HiIn: "hi-IN",
@@ -1,5 +1,5 @@
1
1
  import type * as Agora from "../index.js";
2
- export type Tts = Agora.Tts.Tencent | Agora.Tts.Bytedance | Agora.Tts.Microsoft | Agora.Tts.Elevenlabs | Agora.Tts.Minimax | Agora.Tts.Murf | Agora.Tts.Cartesia | Agora.Tts.Openai | Agora.Tts.Humeai | Agora.Tts.Rime | Agora.Tts.Fishaudio | Agora.Tts.Google | Agora.Tts.Amazon | Agora.Tts.Sarvam | Agora.Tts.GenericHttp | Agora.Tts.Xai | Agora.Tts.Deepgram | Agora.Tts.Cosyvoice | Agora.Tts.BytedanceDuplex | Agora.Tts.Stepfun | Agora.Tts.Gradium | Agora.Tts.Mistral | Agora.Tts.Typecast | Agora.Tts.Smallestai;
2
+ export type Tts = Agora.Tts.Tencent | Agora.Tts.Bytedance | Agora.Tts.Microsoft | Agora.Tts.Elevenlabs | Agora.Tts.Minimax | Agora.Tts.Murf | Agora.Tts.Cartesia | Agora.Tts.Openai | Agora.Tts.Humeai | Agora.Tts.Rime | Agora.Tts.Fishaudio | Agora.Tts.Google | Agora.Tts.Gemini | Agora.Tts.Amazon | Agora.Tts.Sarvam | Agora.Tts.GenericHttp | Agora.Tts.Xai | Agora.Tts.Deepgram | Agora.Tts.Cosyvoice | Agora.Tts.BytedanceDuplex | Agora.Tts.Stepfun | Agora.Tts.Gradium | Agora.Tts.Mistral | Agora.Tts.Typecast | Agora.Tts.Smallestai;
3
3
  export declare namespace Tts {
4
4
  interface Tencent extends Agora.TencentTts {
5
5
  vendor: "tencent";
@@ -37,6 +37,9 @@ export declare namespace Tts {
37
37
  interface Google extends Agora.GoogleTts {
38
38
  vendor: "google";
39
39
  }
40
+ interface Gemini extends Agora.GeminiTts {
41
+ vendor: "gemini";
42
+ }
40
43
  interface Amazon extends Agora.AmazonTts {
41
44
  vendor: "amazon";
42
45
  }
@@ -32,6 +32,8 @@ export * from "./FishAudioTts.js";
32
32
  export * from "./FishAudioTtsParams.js";
33
33
  export * from "./GeminiAsr.js";
34
34
  export * from "./GeminiAsrParams.js";
35
+ export * from "./GeminiTts.js";
36
+ export * from "./GeminiTtsParams.js";
35
37
  export * from "./GenericHttpTts.js";
36
38
  export * from "./GenericHttpTtsParams.js";
37
39
  export * from "./GoogleAsr.js";
@@ -73,6 +75,8 @@ export * from "./OpenAiTts.js";
73
75
  export * from "./OpenAiTtsParams.js";
74
76
  export * from "./RimeTts.js";
75
77
  export * from "./RimeTtsParams.js";
78
+ export * from "./RtzrAsr.js";
79
+ export * from "./RtzrAsrParams.js";
76
80
  export * from "./SarvamAsr.js";
77
81
  export * from "./SarvamAsrParams.js";
78
82
  export * from "./SarvamTts.js";
@@ -48,6 +48,8 @@ __exportStar(require("./FishAudioTts.js"), exports);
48
48
  __exportStar(require("./FishAudioTtsParams.js"), exports);
49
49
  __exportStar(require("./GeminiAsr.js"), exports);
50
50
  __exportStar(require("./GeminiAsrParams.js"), exports);
51
+ __exportStar(require("./GeminiTts.js"), exports);
52
+ __exportStar(require("./GeminiTtsParams.js"), exports);
51
53
  __exportStar(require("./GenericHttpTts.js"), exports);
52
54
  __exportStar(require("./GenericHttpTtsParams.js"), exports);
53
55
  __exportStar(require("./GoogleAsr.js"), exports);
@@ -89,6 +91,8 @@ __exportStar(require("./OpenAiTts.js"), exports);
89
91
  __exportStar(require("./OpenAiTtsParams.js"), exports);
90
92
  __exportStar(require("./RimeTts.js"), exports);
91
93
  __exportStar(require("./RimeTtsParams.js"), exports);
94
+ __exportStar(require("./RtzrAsr.js"), exports);
95
+ __exportStar(require("./RtzrAsrParams.js"), exports);
92
96
  __exportStar(require("./SarvamAsr.js"), exports);
93
97
  __exportStar(require("./SarvamAsrParams.js"), exports);
94
98
  __exportStar(require("./SarvamTts.js"), exports);
@@ -0,0 +1,3 @@
1
+ export declare function validateBasicCredentials(customerId: unknown, customerSecret: unknown): void;
2
+ /** Validate public REST schemes without including credential values in errors. */
3
+ export declare function validatePublicAuthorization(value: string): void;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateBasicCredentials = validateBasicCredentials;
4
+ exports.validatePublicAuthorization = validatePublicAuthorization;
5
+ const base64_js_1 = require("../base64.js");
6
+ function validateBasicCredentials(customerId, customerSecret) {
7
+ if (typeof customerId !== "string" ||
8
+ !customerId.trim() ||
9
+ typeof customerSecret !== "string" ||
10
+ !customerSecret.trim())
11
+ throw new Error("customerId and customerSecret must both be non-empty strings");
12
+ if (customerId.includes(":"))
13
+ throw new Error("customerId must not contain ':'");
14
+ }
15
+ /** Validate public REST schemes without including credential values in errors. */
16
+ function validatePublicAuthorization(value) {
17
+ if (/^agora token=\S+$/i.test(value))
18
+ return;
19
+ const basic = /^Basic ([A-Za-z0-9+/]+={0,2})$/i.exec(value);
20
+ if (basic) {
21
+ try {
22
+ const decoded = (0, base64_js_1.base64Decode)(basic[1]);
23
+ // Exact UTF-8 round-trip also rejects malformed/noncanonical base64.
24
+ if ((0, base64_js_1.base64Encode)(decoded) !== basic[1])
25
+ throw new Error("Invalid encoding");
26
+ const separator = decoded.indexOf(":");
27
+ if (separator < 0)
28
+ throw new Error("Missing separator");
29
+ validateBasicCredentials(decoded.slice(0, separator), decoded.slice(separator + 1));
30
+ return;
31
+ }
32
+ catch (_a) {
33
+ throw new Error("Basic authorization requires valid base64 UTF-8 customerId:customerSecret credentials");
34
+ }
35
+ }
36
+ throw new Error("Only Agora token or valid Basic authorization is supported");
37
+ }
@@ -1,13 +1,13 @@
1
1
  export type { AgoraAuthMode } from "./AgoraPoolClient.js";
2
2
  export { AgoraClient } from "./AgoraPoolClient.js";
3
3
  export type { AgoraArea, AreaScope, GlobalArea } from "./agentkit/area.js";
4
- export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AgentOptions, AgentPreset, AgentSessionEvent, AgentSessionEventHandler, AgentSessionOptions, AgentsClient, AkoolAvatarConfig, AkoolAvatarOptions, AkoolSampleRate, AliyunLLMOptions, AmazonBedrockOptions, AmazonSTTOptions, AmazonTTSOptions, AmazonTts, AmazonTtsParams, AnamAvatarConfig, AnamAvatarOptions, AnthropicOptions, AresSTTOptions, AsrConfig, AsrPreset, AsrVendorName, AssemblyAISTTOptions, AvatarConfig, AvatarVendor, AvatarWireVendor, AzureOpenAIOptions, AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, BaseMllmOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CartesiaSampleRate, CartesiaTTSOptions, CartesiaTts, CartesiaTtsParams, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, CustomLLMOptions, DeepgramSTTOptions, DeepgramTTSOptions, DeepSeekLLMOptions, DifyOptions, Eagerness, ElevenLabsSampleRate, ElevenLabsTTSOptions, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FengmingSTTOptions, FillerWordsConfig, FillerWordsContent, FillerWordsContentGeneratedConfig, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsGeneratedLlmProvider, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTTSOptions, FishAudioTts, FishAudioTtsParams, GeminiAsrParams, GeminiLiveModel, GeminiLiveOptions, GeminiLiveVoice, GeminiOptions, GeminiPreviewVoice, GeminiSTTModel, GeminiSTTOptions, GeminiThinkingLevel, GenerateConvoAITokenOptions, GenerateTokenOptions, GenericAvatarConfig, GenericAvatarOptions, GenericTTSOptions, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, GoogleSTTOptions, GoogleTTSOptions, GoogleTts, GoogleTtsParams, GradiumTTSOptions, GradiumTts, GradiumTtsParams, GroqOptions, HeyGenAvatarConfig, HeyGenAvatarOptions, HeyGenSampleRate, HumeAITTSOptions, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LemonSliceOptions, LiveAvatarAvatarConfig, LiveAvatarAvatarOptions, LiveAvatarSampleRate, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmPreset, LlmStyle, LlmTool, LlmToolExecution, LlmToolFunction, LlmToolServer, LlmVendor, McpServer, McpServersItem, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MicrosoftSampleRate, MicrosoftSTTOptions, MicrosoftTTSOptions, MicrosoftTts, MicrosoftTtsParams, MiniMaxCNTTSOptions, MiniMaxTTSOptions, MinimaxTts, MinimaxTtsParams, MistralTTSOptions, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTTSOptions, MurfTts, MurfTtsParams, OpenAIGPTLiveOptions, OpenAIOptions, OpenAIRealtimeOptions, OpenAISTTOptions, OpenAITTSOptions, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, PresetCategory, PresetInput, PreviewFeature, PreviewRoute, ProtofaceOptions, QwenOmniOptions, RimeTTSOptions, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SampleRate, SarvamSTTOptions, SarvamTTSOptions, SarvamTts, SarvamTtsParams, SayOptions, SensetimeAvatarConfig, SensetimeAvatarOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SmallestAISTTOptions, SmallestAITTSOptions, SmallestAiAsr, SmallestAiAsrParams, SmallestAiTts, SmallestAiTtsParams, SpatiusAvatarConfig, SpatiusAvatarOptions, SpatiusAvatarParams, SpeakPriority, SpeechmaticsSTTOptions, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, StepFunTTSOptions, StrictAvatarConfig, SttConfig, SttVendor, TavusOptions, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TtsPreset, TtsVendor, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, TypecastTTSOptions, TypecastTts, TypecastTtsParams, VertexAILLMOptions, VertexAIOptions, XAiAsr, XAiAsrParams, XAiSTTOptions, XAiTTSOptions, XAiTts, XAiTtsParams, XaiGrokOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./agentkit/index.js";
5
- export { Agent, AgentPresets, AgentSession, AkoolAvatar, AliyunLLM, AmazonBedrock, AmazonSTT, AmazonTTS, AnamAvatar, Anthropic, AresSTT, AssemblyAISTT, AudioScenario, AzureOpenAI, AzureOpenAIRealtime, BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseMLLM, BaseSTT, BaseTTS, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CartesiaTTS, CosyVoiceTTS, CredentialMode, CustomLLM, createPreviewRoute, DataChannel, DeepgramSTT, DeepgramTTS, DeepSeekLLM, Dify, ElevenLabsTTS, ExpiresIn, FengmingSTT, FillerWordsSelectionRule, FishAudioTTS, GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, Gemini, GeminiLive, GeminiLiveModels, GeminiSTT, GeminiSTTModels, GeminiThinkingLevels, GeminiTranscriptionMode, GenericAvatar, GenericTTS, Geofence, GoogleSTT, GoogleTTS, GradiumTTS, Groq, generateConvoAIToken, generateRtcToken, HeyGenAvatar, HumeAITTS, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, isSpatiusAvatar, LemonSlice, LiveAvatarAvatar, MAX_EXPIRY_SECONDS, MicrosoftCNSTT, MicrosoftCNTTS, MicrosoftSTT, MicrosoftTTS, MiniMaxCNTTS, MiniMaxTTS, MistralTTS, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, MurfTTS, normalizePresetInput, OpenAI, OpenAIGPTLive, OpenAIRealtime, OpenAISTT, OpenAITTS, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, Protoface, previewRequestHeaders, QwenOmni, REDACTED, RimeTTS, redactHeadersForDebug, redactSecrets, SalModeValues, SarvamSTT, SarvamTTS, SensetimeAvatar, SilenceActionValues, SmallestAISTT, SmallestAITTS, SpatiusAvatar, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, SpeechmaticsSTT, StepFunTTS, Tavus, TencentLLM, TencentSTT, TencentTTS, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, TypecastTTS, toBaseAvatarConfig, VertexAI, VertexAILLM, validateAvatarConfig, validateTtsSampleRate, XAiSTT, XAiTTS, XaiGrok, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./agentkit/index.js";
6
- export type { GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions } from "./agentkit/preview/gemini-tts.js";
7
- export { GeminiTTS, GeminiTTSModels } from "./agentkit/preview/gemini-tts.js";
4
+ export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AgentOptions, AgentPreset, AgentSessionEvent, AgentSessionEventHandler, AgentSessionOptions, AgentsClient, AkoolAvatarConfig, AkoolAvatarOptions, AkoolSampleRate, AliyunLLMOptions, AmazonBedrockOptions, AmazonSTTOptions, AmazonTTSOptions, AmazonTts, AmazonTtsParams, AnamAvatarConfig, AnamAvatarOptions, AnthropicOptions, AresSTTOptions, AsrConfig, AsrPreset, AsrVendorName, AssemblyAISTTOptions, AvatarConfig, AvatarVendor, AvatarWireVendor, AzureOpenAIOptions, AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, BaseMllmOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CartesiaSampleRate, CartesiaTTSOptions, CartesiaTts, CartesiaTtsParams, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, CustomLLMOptions, DeepgramSTTOptions, DeepgramTTSOptions, DeepSeekLLMOptions, DifyOptions, Eagerness, ElevenLabsSampleRate, ElevenLabsTTSOptions, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FengmingSTTOptions, FillerWordsConfig, FillerWordsContent, FillerWordsContentGeneratedConfig, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsGeneratedLlmProvider, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTTSOptions, FishAudioTts, FishAudioTtsParams, GeminiAsrParams, GeminiLiveModel, GeminiLiveOptions, GeminiLiveVoice, GeminiOptions, GeminiPreviewVoice, GeminiSTTModel, GeminiSTTOptions, GeminiThinkingLevel, GenerateConvoAITokenOptions, GenerateTokenOptions, GenericAvatarConfig, GenericAvatarOptions, GenericTTSOptions, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, GoogleSTTOptions, GoogleTTSOptions, GoogleTts, GoogleTtsParams, GradiumTTSOptions, GradiumTts, GradiumTtsParams, GroqOptions, HeyGenAvatarConfig, HeyGenAvatarOptions, HeyGenSampleRate, HumeAITTSOptions, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LemonSliceOptions, LiveAvatarAvatarConfig, LiveAvatarAvatarOptions, LiveAvatarSampleRate, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmPreset, LlmStyle, LlmTool, LlmToolExecution, LlmToolFunction, LlmToolServer, LlmVendor, McpServer, McpServersItem, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MicrosoftSampleRate, MicrosoftSTTOptions, MicrosoftTTSOptions, MicrosoftTts, MicrosoftTtsParams, MiniMaxCNTTSOptions, MiniMaxTTSOptions, MinimaxTts, MinimaxTtsParams, MistralTTSOptions, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTTSOptions, MurfTts, MurfTtsParams, OpenAIGPTLiveOptions, OpenAIOptions, OpenAIRealtimeOptions, OpenAISTTOptions, OpenAITTSOptions, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, PresetCategory, PresetInput, PreviewFeature, PreviewRoute, ProtofaceOptions, QwenOmniOptions, RimeTTSOptions, RimeTts, RimeTtsParams, RTZRSTTOptions, RtcConfig, RtzrAsr, RtzrAsrParams, SalConfig, SalMode, SampleRate, SarvamSTTOptions, SarvamTTSOptions, SarvamTts, SarvamTtsParams, SayOptions, SensetimeAvatarConfig, SensetimeAvatarOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SmallestAISTTOptions, SmallestAITTSOptions, SmallestAiAsr, SmallestAiAsrParams, SmallestAiTts, SmallestAiTtsParams, SpatiusAvatarConfig, SpatiusAvatarOptions, SpatiusAvatarParams, SpeakConfig, SpeakPriority, SpeechmaticsSTTOptions, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, StepFunTTSOptions, StrictAvatarConfig, SttConfig, SttVendor, TavusOptions, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TtsPreset, TtsVendor, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, TypecastTTSOptions, TypecastTts, TypecastTtsParams, VertexAILLMOptions, VertexAIOptions, XAiAsr, XAiAsrParams, XAiSTTOptions, XAiTTSOptions, XAiTts, XAiTtsParams, XaiGrokOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./agentkit/index.js";
5
+ export { Agent, AgentPresets, AgentSession, AkoolAvatar, AliyunLLM, AmazonBedrock, AmazonSTT, AmazonTTS, AnamAvatar, Anthropic, AresSTT, AssemblyAISTT, AudioScenario, AzureOpenAI, AzureOpenAIRealtime, BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseMLLM, BaseSTT, BaseTTS, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CartesiaTTS, CosyVoiceTTS, CredentialMode, CustomLLM, createPreviewRoute, DataChannel, DeepgramSTT, DeepgramTTS, DeepSeekLLM, Dify, ElevenLabsTTS, ExpiresIn, FengmingSTT, FillerWordsSelectionRule, FishAudioTTS, GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, Gemini, GeminiLive, GeminiLiveModels, GeminiSTT, GeminiSTTModels, GeminiThinkingLevels, GeminiTranscriptionMode, GenericAvatar, GenericTTS, Geofence, GoogleSTT, GoogleTTS, GradiumTTS, Groq, generateConvoAIToken, generateRtcToken, HeyGenAvatar, HumeAITTS, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, isSpatiusAvatar, LemonSlice, LiveAvatarAvatar, MAX_EXPIRY_SECONDS, MicrosoftCNSTT, MicrosoftCNTTS, MicrosoftSTT, MicrosoftTTS, MiniMaxCNTTS, MiniMaxTTS, MistralTTS, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, MurfTTS, normalizePresetInput, OpenAI, OpenAIGPTLive, OpenAIRealtime, OpenAISTT, OpenAITTS, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, Protoface, previewRequestHeaders, QwenOmni, REDACTED, RimeTTS, RTZRSTT, redactHeadersForDebug, redactSecrets, SalModeValues, SarvamSTT, SarvamTTS, SarvamTTSLanguage, SensetimeAvatar, SilenceActionValues, SmallestAISTT, SmallestAITTS, SpatiusAvatar, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, SpeechmaticsSTT, StepFunTTS, Tavus, TencentLLM, TencentSTT, TencentTTS, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, TypecastTTS, toBaseAvatarConfig, VertexAI, VertexAILLM, validateAvatarConfig, validateTtsSampleRate, XAiSTT, XAiTTS, XaiGrok, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./agentkit/index.js";
8
6
  export { UnsupportedSessionOperationError } from "./agentkit/session-backend.js";
9
7
  export type { AssignNumberOptions, DeployOptions, SaveOptions, SecretRef, VariableDefinition } from "./agentkit/v3.js";
10
8
  export { DeployedAgent, NumberNotFoundError, SavedAgent, SecretRefNotSupportedError, secretRef, UnsupportedFieldError, } from "./agentkit/v3.js";
9
+ export type { GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions } from "./agentkit/vendors/tts.js";
10
+ export { GeminiTTS, GeminiTTSModels } from "./agentkit/vendors/tts.js";
11
11
  export * as Agora from "./api/index.js";
12
12
  export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
13
13
  export { Area } from "./core/domain/index.js";
package/dist/cjs/index.js CHANGED
@@ -38,8 +38,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.GeminiLiveModels = exports.GeminiLive = exports.Gemini = exports.GEMINI_PREVIEW_MLLM_URL = exports.GEMINI_MLLM_URL = exports.GEMINI_MLLM_DEFAULT_MODEL = exports.FishAudioTTS = exports.FillerWordsSelectionRule = exports.FengmingSTT = exports.ExpiresIn = exports.ElevenLabsTTS = exports.Dify = exports.DeepSeekLLM = exports.DeepgramTTS = exports.DeepgramSTT = exports.DataChannel = exports.createPreviewRoute = exports.CustomLLM = exports.CredentialMode = exports.CosyVoiceTTS = exports.CartesiaTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNMLLM = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.AzureOpenAIRealtime = exports.AzureOpenAI = exports.AudioScenario = exports.AssemblyAISTT = exports.AresSTT = exports.Anthropic = exports.AnamAvatar = exports.AmazonTTS = exports.AmazonSTT = exports.AmazonBedrock = exports.AliyunLLM = exports.AkoolAvatar = exports.AgentSession = exports.AgentPresets = exports.Agent = exports.AgoraClient = void 0;
40
40
  exports.OpenAITTS = exports.OpenAISTT = exports.OpenAIRealtime = exports.OpenAIGPTLive = exports.OpenAI = exports.normalizePresetInput = exports.MurfTTS = exports.MllmTurnDetectionModeValues = exports.MllmTurnDetectionModeServerVad = exports.MllmTurnDetectionModeSemanticVad = exports.MllmTurnDetectionModeAgoraVad = exports.MistralTTS = exports.MiniMaxTTS = exports.MiniMaxCNTTS = exports.MicrosoftTTS = exports.MicrosoftSTT = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.MAX_EXPIRY_SECONDS = exports.LiveAvatarAvatar = exports.LemonSlice = exports.isSpatiusAvatar = exports.isSensetimeAvatar = exports.isLiveAvatarAvatar = exports.isHeyGenAvatar = exports.isGenericAvatar = exports.isAvatarTokenManaged = exports.isAnamAvatar = exports.isAkoolAvatar = exports.InterruptionModeValues = exports.InterruptionModeStartOfSpeech = exports.InterruptionModeKeywords = exports.InterruptionDisabledStrategyIgnore = exports.InterruptionDisabledStrategyAppend = exports.InterruptionDisabledStrategy = exports.HumeAITTS = exports.HeyGenAvatar = exports.generateRtcToken = exports.generateConvoAIToken = exports.Groq = exports.GradiumTTS = exports.GoogleTTS = exports.GoogleSTT = exports.Geofence = exports.GenericTTS = exports.GenericAvatar = exports.GeminiTranscriptionMode = exports.GeminiThinkingLevels = exports.GeminiSTTModels = exports.GeminiSTT = void 0;
41
- exports.GeminiTTSModels = exports.GeminiTTS = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.XaiGrok = exports.XAiTTS = exports.XAiSTT = exports.validateTtsSampleRate = exports.validateAvatarConfig = exports.VertexAILLM = exports.VertexAI = exports.toBaseAvatarConfig = exports.TypecastTTS = exports.TurnDetectionTypeValues = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnSpeakingActionIgnore = exports.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.ThinkOnListeningActionIgnore = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.Tavus = exports.StepFunTTS = exports.SpeechmaticsSTT = exports.SpeakPriorityValues = exports.SpeakPriorityInterrupt = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = exports.SpatiusAvatar = exports.SmallestAITTS = exports.SmallestAISTT = exports.SilenceActionValues = exports.SensetimeAvatar = exports.SarvamTTS = exports.SarvamSTT = exports.SalModeValues = exports.redactSecrets = exports.redactHeadersForDebug = exports.RimeTTS = exports.REDACTED = exports.QwenOmni = exports.previewRequestHeaders = exports.Protoface = exports.PreviewFeatures = exports.PREVIEW_FEATURE_HEADER = exports.PREVIEW_API_BASE_URL = void 0;
42
- exports.V3Error = exports.V3Client = exports.PreconditionFailedError = exports.AgoraTimeoutError = exports.AgoraError = exports.AgoraEnvironment = exports.Area = exports.Agora = exports.UnsupportedFieldError = exports.secretRef = exports.SecretRefNotSupportedError = exports.SavedAgent = exports.NumberNotFoundError = exports.DeployedAgent = exports.UnsupportedSessionOperationError = void 0;
41
+ exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.XaiGrok = exports.XAiTTS = exports.XAiSTT = exports.validateTtsSampleRate = exports.validateAvatarConfig = exports.VertexAILLM = exports.VertexAI = exports.toBaseAvatarConfig = exports.TypecastTTS = exports.TurnDetectionTypeValues = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnSpeakingActionIgnore = exports.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.ThinkOnListeningActionIgnore = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.Tavus = exports.StepFunTTS = exports.SpeechmaticsSTT = exports.SpeakPriorityValues = exports.SpeakPriorityInterrupt = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = exports.SpatiusAvatar = exports.SmallestAITTS = exports.SmallestAISTT = exports.SilenceActionValues = exports.SensetimeAvatar = exports.SarvamTTSLanguage = exports.SarvamTTS = exports.SarvamSTT = exports.SalModeValues = exports.redactSecrets = exports.redactHeadersForDebug = exports.RTZRSTT = exports.RimeTTS = exports.REDACTED = exports.QwenOmni = exports.previewRequestHeaders = exports.Protoface = exports.PreviewFeatures = exports.PREVIEW_FEATURE_HEADER = exports.PREVIEW_API_BASE_URL = void 0;
42
+ exports.V3Error = exports.V3Client = exports.PreconditionFailedError = exports.AgoraTimeoutError = exports.AgoraError = exports.AgoraEnvironment = exports.Area = exports.Agora = exports.GeminiTTSModels = exports.GeminiTTS = exports.UnsupportedFieldError = exports.secretRef = exports.SecretRefNotSupportedError = exports.SavedAgent = exports.NumberNotFoundError = exports.DeployedAgent = exports.UnsupportedSessionOperationError = void 0;
43
43
  var AgoraPoolClient_js_1 = require("./AgoraPoolClient.js");
44
44
  Object.defineProperty(exports, "AgoraClient", { enumerable: true, get: function () { return AgoraPoolClient_js_1.AgoraClient; } });
45
45
  // Agentkit layer exports - clean, ergonomic API
@@ -156,11 +156,13 @@ Object.defineProperty(exports, "previewRequestHeaders", { enumerable: true, get:
156
156
  Object.defineProperty(exports, "QwenOmni", { enumerable: true, get: function () { return index_js_1.QwenOmni; } });
157
157
  Object.defineProperty(exports, "REDACTED", { enumerable: true, get: function () { return index_js_1.REDACTED; } });
158
158
  Object.defineProperty(exports, "RimeTTS", { enumerable: true, get: function () { return index_js_1.RimeTTS; } });
159
+ Object.defineProperty(exports, "RTZRSTT", { enumerable: true, get: function () { return index_js_1.RTZRSTT; } });
159
160
  Object.defineProperty(exports, "redactHeadersForDebug", { enumerable: true, get: function () { return index_js_1.redactHeadersForDebug; } });
160
161
  Object.defineProperty(exports, "redactSecrets", { enumerable: true, get: function () { return index_js_1.redactSecrets; } });
161
162
  Object.defineProperty(exports, "SalModeValues", { enumerable: true, get: function () { return index_js_1.SalModeValues; } });
162
163
  Object.defineProperty(exports, "SarvamSTT", { enumerable: true, get: function () { return index_js_1.SarvamSTT; } });
163
164
  Object.defineProperty(exports, "SarvamTTS", { enumerable: true, get: function () { return index_js_1.SarvamTTS; } });
165
+ Object.defineProperty(exports, "SarvamTTSLanguage", { enumerable: true, get: function () { return index_js_1.SarvamTTSLanguage; } });
164
166
  Object.defineProperty(exports, "SensetimeAvatar", { enumerable: true, get: function () { return index_js_1.SensetimeAvatar; } });
165
167
  Object.defineProperty(exports, "SilenceActionValues", { enumerable: true, get: function () { return index_js_1.SilenceActionValues; } });
166
168
  Object.defineProperty(exports, "SmallestAISTT", { enumerable: true, get: function () { return index_js_1.SmallestAISTT; } });
@@ -197,9 +199,6 @@ Object.defineProperty(exports, "XaiGrok", { enumerable: true, get: function () {
197
199
  Object.defineProperty(exports, "XfyunBigModelSTT", { enumerable: true, get: function () { return index_js_1.XfyunBigModelSTT; } });
198
200
  Object.defineProperty(exports, "XfyunDialectSTT", { enumerable: true, get: function () { return index_js_1.XfyunDialectSTT; } });
199
201
  Object.defineProperty(exports, "XfyunSTT", { enumerable: true, get: function () { return index_js_1.XfyunSTT; } });
200
- var gemini_tts_js_1 = require("./agentkit/preview/gemini-tts.js");
201
- Object.defineProperty(exports, "GeminiTTS", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTS; } });
202
- Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTSModels; } });
203
202
  var session_backend_js_1 = require("./agentkit/session-backend.js");
204
203
  Object.defineProperty(exports, "UnsupportedSessionOperationError", { enumerable: true, get: function () { return session_backend_js_1.UnsupportedSessionOperationError; } });
205
204
  var v3_js_1 = require("./agentkit/v3.js");
@@ -209,6 +208,9 @@ Object.defineProperty(exports, "SavedAgent", { enumerable: true, get: function (
209
208
  Object.defineProperty(exports, "SecretRefNotSupportedError", { enumerable: true, get: function () { return v3_js_1.SecretRefNotSupportedError; } });
210
209
  Object.defineProperty(exports, "secretRef", { enumerable: true, get: function () { return v3_js_1.secretRef; } });
211
210
  Object.defineProperty(exports, "UnsupportedFieldError", { enumerable: true, get: function () { return v3_js_1.UnsupportedFieldError; } });
211
+ var tts_js_1 = require("./agentkit/vendors/tts.js");
212
+ Object.defineProperty(exports, "GeminiTTS", { enumerable: true, get: function () { return tts_js_1.GeminiTTS; } });
213
+ Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: function () { return tts_js_1.GeminiTTSModels; } });
212
214
  exports.Agora = __importStar(require("./api/index.js"));
213
215
  var index_js_2 = require("./core/domain/index.js");
214
216
  Object.defineProperty(exports, "Area", { enumerable: true, get: function () { return index_js_2.Area; } });
@@ -14,6 +14,7 @@ exports.validateIdempotencyKey = validateIdempotencyKey;
14
14
  exports.segment = segment;
15
15
  exports.omit = omit;
16
16
  exports.snapshotPagination = snapshotPagination;
17
+ const publicAuthorization_js_1 = require("../core/auth/publicAuthorization.js");
17
18
  const Fetcher_js_1 = require("../core/fetcher/Fetcher.js");
18
19
  const HttpResponsePromise_js_1 = require("../core/fetcher/HttpResponsePromise.js");
19
20
  const publicHeaders_js_1 = require("../core/publicHeaders.js");
@@ -83,7 +84,7 @@ class V3Transport {
83
84
  var _a, _b, _c, _d, _e, _f, _g;
84
85
  for (const key of Object.keys(capturedOptions)) {
85
86
  if (["customerid", "customersecret", "clientid", "clientsecret", "username", "password"].includes(key.replace(/_/g, "").toLowerCase()))
86
- throw new Error(`${key} is not supported; use token authorization`);
87
+ throw new Error(`${key} is not supported; configure credentials on AgoraClient or use an authorization override`);
87
88
  }
88
89
  if (body && typeof body === "object" && "idempotencyKey" in body)
89
90
  throw new Error("idempotencyKey is not supported by this operation");
@@ -119,8 +120,8 @@ class V3Transport {
119
120
  continue;
120
121
  if ((0, publicHeaders_js_1.isInternalHeader)(key))
121
122
  throw new Error(`${name} is an internal header and is not supported`);
122
- if (key === "authorization" && !/^agora token=\S+$/i.test(value))
123
- throw new Error("Only Agora token authorization is supported");
123
+ if (key === "authorization")
124
+ (0, publicAuthorization_js_1.validatePublicAuthorization)(value);
124
125
  if (key === "idempotency-key")
125
126
  validateIdempotencyKey(value);
126
127
  if (key === "idempotency-key" &&
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "v3.0.0-alpha.2";
1
+ export declare const SDK_VERSION = "v3.0.0-alpha.3";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "v3.0.0-alpha.2";
4
+ exports.SDK_VERSION = "v3.0.0-alpha.3";
@@ -5,11 +5,12 @@ import { AgoraClient as BaseAgoraClient } from "./Client.mjs";
5
5
  import { Pool } from "./core/domain/index.mjs";
6
6
  /**
7
7
  * Auth mode for the client:
8
+ * - `basic`: Customer ID and Secret for HTTP Basic authentication
8
9
  * - `token`: Pre-built `agora token=<value>` auth header
9
10
  * - `app-credentials`: appId + appCertificate only; AgentSession generates
10
11
  * a fresh ConvoAI token per API call
11
12
  */
12
- export type AgoraAuthMode = "token" | "app-credentials";
13
+ export type AgoraAuthMode = "basic" | "token" | "app-credentials";
13
14
  export declare namespace AgoraClient {
14
15
  type Options<TArea extends AgoraArea = AgoraArea> = BaseOptions<TArea> & AuthOptions;
15
16
  interface BaseOptions<TArea extends AgoraArea = AgoraArea> extends Omit<BaseClientOptions, "baseUrl" | "environment" | "username" | "password" | "authorization"> {
@@ -20,8 +21,17 @@ export declare namespace AgoraClient {
20
21
  /** Agora App ID — used as the `appid` path parameter and for RTC token generation */
21
22
  appId: string;
22
23
  }
24
+ /** Use Customer ID and Customer Secret for HTTP Basic REST authentication. */
25
+ interface BasicAuthOptions {
26
+ customerId: string;
27
+ customerSecret: string;
28
+ appCertificate?: string;
29
+ authToken?: never;
30
+ }
23
31
  /** Use a pre-built Agora token for REST API authentication. Pass the raw token; the SDK sets `Authorization: agora token=<authToken>` automatically. */
24
32
  interface TokenAuthOptions {
33
+ customerId?: never;
34
+ customerSecret?: never;
25
35
  appCertificate?: string;
26
36
  authToken: string;
27
37
  }
@@ -30,10 +40,12 @@ export declare namespace AgoraClient {
30
40
  * ConvoAI token per API call — no Customer Secret required.
31
41
  */
32
42
  interface AppCredentialsOptions {
43
+ customerId?: never;
44
+ customerSecret?: never;
33
45
  appCertificate: string;
34
46
  authToken?: never;
35
47
  }
36
- type AuthOptions = TokenAuthOptions | AppCredentialsOptions;
48
+ type AuthOptions = BasicAuthOptions | TokenAuthOptions | AppCredentialsOptions;
37
49
  interface RequestOptions extends BaseRequestOptions {
38
50
  }
39
51
  }
@@ -41,7 +53,8 @@ export declare namespace AgoraClient {
41
53
  * AgoraClient extends the base client with domain pool support for
42
54
  * regional URL cycling and automatic domain selection.
43
55
  *
44
- * Two authentication modes are supported:
56
+ * Three authentication modes are supported. For HTTP Basic authentication,
57
+ * supply customerId and customerSecret; appCertificate is optional for RTC signing.
45
58
  *
46
59
  * **App credentials (recommended)** — no Customer Secret needed; AgentSession
47
60
  * generates a short-lived ConvoAI token per API call:
@@ -21,6 +21,8 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  import { V3Client, V3Transport } from "./v3/index.mjs";
22
22
  import { generateConvoAIToken } from "./agentkit/token.mjs";
23
23
  import { AgoraClient as BaseAgoraClient } from "./Client.mjs";
24
+ import { BasicAuth } from "./core/auth/BasicAuth.mjs";
25
+ import { validateBasicCredentials, validatePublicAuthorization } from "./core/auth/publicAuthorization.mjs";
24
26
  import { Area, CNAPIPath, GlobalAPIPath, Pool } from "./core/domain/index.mjs";
25
27
  import { isInternalHeader } from "./core/publicHeaders.mjs";
26
28
  import { AgoraError } from "./errors/index.mjs";
@@ -66,7 +68,8 @@ function createClientPool(area) {
66
68
  * AgoraClient extends the base client with domain pool support for
67
69
  * regional URL cycling and automatic domain selection.
68
70
  *
69
- * Two authentication modes are supported:
71
+ * Three authentication modes are supported. For HTTP Basic authentication,
72
+ * supply customerId and customerSecret; appCertificate is optional for RTC signing.
70
73
  *
71
74
  * **App credentials (recommended)** — no Customer Secret needed; AgentSession
72
75
  * generates a short-lived ConvoAI token per API call:
@@ -105,6 +108,8 @@ export class AgoraClient extends BaseAgoraClient {
105
108
  var _a, _b, _c, _d;
106
109
  const pool = createClientPool(options.area);
107
110
  for (const key of Object.keys(options)) {
111
+ if (key === "customerId" || key === "customerSecret")
112
+ continue;
108
113
  if ([
109
114
  "customerid",
110
115
  "customersecret",
@@ -114,29 +119,38 @@ export class AgoraClient extends BaseAgoraClient {
114
119
  "password",
115
120
  "authorization",
116
121
  ].includes(key.replace(/_/g, "").toLowerCase())) {
117
- throw new Error(`${key} is not supported; use appId/appCertificate or authToken`);
122
+ throw new Error(`${key} is not supported; use appId/appCertificate, authToken, or customerId/customerSecret`);
118
123
  }
119
124
  }
120
- const authMode = options.authToken !== undefined ? "token" : "app-credentials";
121
- const { authToken, appId, appCertificate } = options, rest = __rest(options, ["authToken", "appId", "appCertificate"]);
125
+ const { authToken, appId, appCertificate, customerId, customerSecret } = options, rest = __rest(options, ["authToken", "appId", "appCertificate", "customerId", "customerSecret"]);
126
+ const basic = customerId !== undefined || customerSecret !== undefined;
127
+ if (basic && authToken !== undefined)
128
+ throw new Error("customerId/customerSecret cannot be combined with authToken");
129
+ if (basic)
130
+ validateBasicCredentials(customerId, customerSecret);
131
+ const authMode = basic ? "basic" : authToken !== undefined ? "token" : "app-credentials";
122
132
  if (authMode === "app-credentials" && !appCertificate)
123
- throw new Error("appCertificate or authToken is required");
124
- const authorization = () => authMode === "token"
125
- ? `agora token=${authToken}`
126
- : `agora token=${generateConvoAIToken({ appId, appCertificate: appCertificate, channelName: "", uid: 0 })}`;
133
+ throw new Error("appCertificate, authToken, or customerId/customerSecret is required");
134
+ const authorization = () => {
135
+ if (authMode === "basic")
136
+ return BasicAuth.toAuthorizationHeader({ username: customerId, password: customerSecret });
137
+ if (authMode === "token")
138
+ return `agora token=${authToken}`;
139
+ return `agora token=${generateConvoAIToken({ appId, appCertificate: appCertificate, channelName: "", uid: 0 })}`;
140
+ };
127
141
  const originalFetch = (_a = options.fetch) !== null && _a !== void 0 ? _a : globalThis.fetch;
128
- const tokenOnlyFetch = (input, init) => __awaiter(this, void 0, void 0, function* () {
142
+ const authenticatedFetch = (input, init) => __awaiter(this, void 0, void 0, function* () {
129
143
  const finalHeaders = new Headers(input instanceof Request ? input.headers : undefined);
130
144
  new Headers(init === null || init === void 0 ? void 0 : init.headers).forEach((value, key) => finalHeaders.set(key, value));
131
145
  const auth = finalHeaders.get("authorization");
132
- if (auth !== null && !/^agora token=\S+$/i.test(auth))
133
- throw new Error("Only Agora token authorization is supported");
146
+ if (auth !== null)
147
+ validatePublicAuthorization(auth);
134
148
  for (const name of finalHeaders.keys())
135
149
  if (isInternalHeader(name))
136
150
  throw new Error(`${name} is an internal header and is not supported`);
137
151
  return originalFetch(input, init);
138
152
  });
139
- super(Object.assign(Object.assign({}, rest), { fetch: tokenOnlyFetch, username: "", password: "", authorization, baseUrl: () => pool.getCurrentURL() }));
153
+ super(Object.assign(Object.assign({}, rest), { fetch: authenticatedFetch, username: "", password: "", authorization, baseUrl: () => pool.getCurrentURL() }));
140
154
  this._pool = pool;
141
155
  this.appId = appId;
142
156
  this.appCertificate = appCertificate;