agora-agents 2.12.0 → 3.0.0-alpha.2

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 (96) hide show
  1. package/README.md +38 -3
  2. package/dist/cjs/AgoraPoolClient.d.ts +15 -27
  3. package/dist/cjs/AgoraPoolClient.js +75 -54
  4. package/dist/cjs/BaseClient.js +3 -2
  5. package/dist/cjs/agentkit/Agent.d.ts +14 -1
  6. package/dist/cjs/agentkit/Agent.js +126 -9
  7. package/dist/cjs/agentkit/AgentSession.d.ts +11 -2
  8. package/dist/cjs/agentkit/AgentSession.js +134 -22
  9. package/dist/cjs/agentkit/index.d.ts +4 -1
  10. package/dist/cjs/agentkit/index.js +12 -2
  11. package/dist/cjs/agentkit/session-backend.d.ts +25 -0
  12. package/dist/cjs/agentkit/session-backend.js +197 -0
  13. package/dist/cjs/agentkit/types.d.ts +27 -4
  14. package/dist/cjs/agentkit/v3.d.ts +70 -0
  15. package/dist/cjs/agentkit/v3.js +700 -0
  16. package/dist/cjs/agentkit/vendors/avatar.d.ts +24 -12
  17. package/dist/cjs/agentkit/vendors/avatar.js +48 -3
  18. package/dist/cjs/agentkit/vendors/base.d.ts +8 -0
  19. package/dist/cjs/agentkit/vendors/base.js +33 -7
  20. package/dist/cjs/agentkit/vendors/llm.d.ts +7 -7
  21. package/dist/cjs/agentkit/vendors/llm.js +26 -22
  22. package/dist/cjs/agentkit/vendors/tts.d.ts +20 -0
  23. package/dist/cjs/agentkit/vendors/tts.js +5 -2
  24. package/dist/cjs/core/publicHeaders.d.ts +2 -0
  25. package/dist/cjs/core/publicHeaders.js +8 -0
  26. package/dist/cjs/index.d.ts +5 -0
  27. package/dist/cjs/index.js +14 -1
  28. package/dist/cjs/v3/campaign-schema.d.ts +1 -0
  29. package/dist/cjs/v3/campaign-schema.js +18 -0
  30. package/dist/cjs/v3/campaigns.d.ts +50 -0
  31. package/dist/cjs/v3/campaigns.js +81 -0
  32. package/dist/cjs/v3/contract.d.ts +1 -0
  33. package/dist/cjs/v3/contract.js +9115 -0
  34. package/dist/cjs/v3/index.d.ts +15 -0
  35. package/dist/cjs/v3/index.js +56 -0
  36. package/dist/cjs/v3/resources.d.ts +121 -0
  37. package/dist/cjs/v3/resources.js +186 -0
  38. package/dist/cjs/v3/session-lifecycle.d.ts +51 -0
  39. package/dist/cjs/v3/session-lifecycle.js +127 -0
  40. package/dist/cjs/v3/session-schema.d.ts +1 -0
  41. package/dist/cjs/v3/session-schema.js +18 -0
  42. package/dist/cjs/v3/transport.d.ts +36 -0
  43. package/dist/cjs/v3/transport.js +161 -0
  44. package/dist/cjs/v3/types.d.ts +1004 -0
  45. package/dist/cjs/v3/types.js +2 -0
  46. package/dist/cjs/version.d.ts +1 -1
  47. package/dist/cjs/version.js +1 -1
  48. package/dist/esm/AgoraPoolClient.d.mts +15 -27
  49. package/dist/esm/AgoraPoolClient.mjs +69 -48
  50. package/dist/esm/BaseClient.mjs +3 -2
  51. package/dist/esm/agentkit/Agent.d.mts +14 -1
  52. package/dist/esm/agentkit/Agent.mjs +126 -9
  53. package/dist/esm/agentkit/AgentSession.d.mts +11 -2
  54. package/dist/esm/agentkit/AgentSession.mjs +134 -22
  55. package/dist/esm/agentkit/index.d.mts +4 -1
  56. package/dist/esm/agentkit/index.mjs +2 -0
  57. package/dist/esm/agentkit/session-backend.d.mts +25 -0
  58. package/dist/esm/agentkit/session-backend.mjs +191 -0
  59. package/dist/esm/agentkit/types.d.mts +27 -4
  60. package/dist/esm/agentkit/v3.d.mts +70 -0
  61. package/dist/esm/agentkit/v3.mjs +687 -0
  62. package/dist/esm/agentkit/vendors/avatar.d.mts +24 -12
  63. package/dist/esm/agentkit/vendors/avatar.mjs +45 -6
  64. package/dist/esm/agentkit/vendors/base.d.mts +8 -0
  65. package/dist/esm/agentkit/vendors/base.mjs +33 -7
  66. package/dist/esm/agentkit/vendors/llm.d.mts +7 -7
  67. package/dist/esm/agentkit/vendors/llm.mjs +26 -22
  68. package/dist/esm/agentkit/vendors/tts.d.mts +20 -0
  69. package/dist/esm/agentkit/vendors/tts.mjs +5 -2
  70. package/dist/esm/core/publicHeaders.d.mts +2 -0
  71. package/dist/esm/core/publicHeaders.mjs +5 -0
  72. package/dist/esm/index.d.mts +5 -0
  73. package/dist/esm/index.mjs +3 -0
  74. package/dist/esm/v3/campaign-schema.d.mts +1 -0
  75. package/dist/esm/v3/campaign-schema.mjs +2 -0
  76. package/dist/esm/v3/campaigns.d.mts +50 -0
  77. package/dist/esm/v3/campaigns.mjs +77 -0
  78. package/dist/esm/v3/contract.d.mts +1 -0
  79. package/dist/esm/v3/contract.mjs +9112 -0
  80. package/dist/esm/v3/index.d.mts +15 -0
  81. package/dist/esm/v3/index.mjs +15 -0
  82. package/dist/esm/v3/resources.d.mts +121 -0
  83. package/dist/esm/v3/resources.mjs +179 -0
  84. package/dist/esm/v3/session-lifecycle.d.mts +51 -0
  85. package/dist/esm/v3/session-lifecycle.mjs +121 -0
  86. package/dist/esm/v3/session-schema.d.mts +1 -0
  87. package/dist/esm/v3/session-schema.mjs +2 -0
  88. package/dist/esm/v3/transport.d.mts +36 -0
  89. package/dist/esm/v3/transport.mjs +151 -0
  90. package/dist/esm/v3/types.d.mts +1004 -0
  91. package/dist/esm/v3/types.mjs +1 -0
  92. package/dist/esm/version.d.mts +1 -1
  93. package/dist/esm/version.mjs +1 -1
  94. package/openapi.yaml +8917 -0
  95. package/package.json +7 -4
  96. package/reference.md +3 -0
@@ -228,15 +228,27 @@ export declare class GenericAvatar extends BaseAvatar<number> {
228
228
  constructor(options: GenericAvatarOptions);
229
229
  toConfig(): AvatarConfig;
230
230
  }
231
- /** Tavus branding for GenericAvatar; uses the generic wire vendor. */
232
- export { GenericAvatar as Tavus };
233
- /** Protoface branding for GenericAvatar; uses the generic wire vendor. */
234
- export { GenericAvatar as Protoface };
235
- /** LemonSlice branding for GenericAvatar; uses the generic wire vendor. */
236
- export { GenericAvatar as LemonSlice };
237
- /** Constructor options shared with GenericAvatar. */
238
- export type TavusOptions = GenericAvatarOptions;
239
- /** Constructor options shared with GenericAvatar. */
240
- export type ProtofaceOptions = GenericAvatarOptions;
241
- /** Constructor options shared with GenericAvatar. */
242
- export type LemonSliceOptions = GenericAvatarOptions;
231
+ /** Tavus options with an optional provider endpoint override. */
232
+ export type TavusOptions = Omit<GenericAvatarOptions, "apiBaseUrl"> & {
233
+ apiBaseUrl?: string;
234
+ };
235
+ /** Protoface options with an optional provider endpoint override. */
236
+ export type ProtofaceOptions = TavusOptions;
237
+ export declare class Tavus extends GenericAvatar {
238
+ constructor(options: TavusOptions);
239
+ }
240
+ export declare class Protoface extends GenericAvatar {
241
+ constructor(options: ProtofaceOptions);
242
+ }
243
+ export interface LemonSliceOptions extends Omit<TavusOptions, "avatarId"> {
244
+ /** Provider-recommended fixed ID is lemonslice. Explicit overrides remain supported. */
245
+ avatarId?: string;
246
+ agentImageUrl?: string;
247
+ agentId?: string;
248
+ agentImageBase64?: string;
249
+ /** Omit to use the provider default of 2x3. */
250
+ aspectRatio?: "2x3" | "9x16" | "1x1";
251
+ }
252
+ export declare class LemonSlice extends GenericAvatar {
253
+ constructor(options: LemonSliceOptions);
254
+ }
@@ -244,6 +244,51 @@ class GenericAvatar extends base_js_1.BaseAvatar {
244
244
  }
245
245
  }
246
246
  exports.GenericAvatar = GenericAvatar;
247
- exports.Tavus = GenericAvatar;
248
- exports.Protoface = GenericAvatar;
249
- exports.LemonSlice = GenericAvatar;
247
+ class Tavus extends GenericAvatar {
248
+ constructor(options) {
249
+ var _a;
250
+ super(Object.assign(Object.assign({}, options), { apiBaseUrl: (_a = options.apiBaseUrl) !== null && _a !== void 0 ? _a : "https://tavusapi.com/v2/conversations/agora" }));
251
+ }
252
+ }
253
+ exports.Tavus = Tavus;
254
+ class Protoface extends GenericAvatar {
255
+ constructor(options) {
256
+ var _a;
257
+ super(Object.assign(Object.assign({}, options), { apiBaseUrl: (_a = options.apiBaseUrl) !== null && _a !== void 0 ? _a : "https://api.protoface.com/v1/agora" }));
258
+ }
259
+ }
260
+ exports.Protoface = Protoface;
261
+ class LemonSlice extends GenericAvatar {
262
+ constructor(options) {
263
+ var _a, _b;
264
+ const params = Object.assign({}, options.additionalParams);
265
+ for (const [key, value] of [
266
+ ["agent_image_url", options.agentImageUrl],
267
+ ["agent_id", options.agentId],
268
+ ["agent_image_base64", options.agentImageBase64],
269
+ ["aspect_ratio", options.aspectRatio],
270
+ ]) {
271
+ if (value !== undefined)
272
+ params[key] = value;
273
+ }
274
+ let selectors = 0;
275
+ for (const key of ["agent_id", "agent_image_url", "agent_image_base64"]) {
276
+ if (Object.keys(params).includes(key)) {
277
+ const value = params[key];
278
+ if (typeof value !== "string" || !value.trim()) {
279
+ throw new Error(`LemonSlice ${key} must be a nonempty string`);
280
+ }
281
+ selectors++;
282
+ }
283
+ }
284
+ if (selectors !== 1) {
285
+ throw new Error("LemonSlice requires exactly one of agent_id, agent_image_url, agent_image_base64");
286
+ }
287
+ if (Object.keys(params).includes("aspect_ratio") &&
288
+ !["2x3", "9x16", "1x1"].includes(params.aspect_ratio)) {
289
+ throw new Error("LemonSlice aspect_ratio must be 2x3, 9x16, or 1x1");
290
+ }
291
+ super(Object.assign(Object.assign({}, options), { apiBaseUrl: (_a = options.apiBaseUrl) !== null && _a !== void 0 ? _a : "https://lemonslice.com/api/liveai/agora", avatarId: (_b = options.avatarId) !== null && _b !== void 0 ? _b : "lemonslice", additionalParams: params }));
292
+ }
293
+ }
294
+ exports.LemonSlice = LemonSlice;
@@ -116,6 +116,8 @@ declare abstract class ScopedBaseLLM<TScope extends VendorScope> {
116
116
  * Converts the vendor configuration to the Agora API format.
117
117
  */
118
118
  abstract toConfig(): LlmConfig;
119
+ /** Internal v3 serialization; deployment performs complete contract validation. */
120
+ toV3Module(): Record<string, unknown>;
119
121
  }
120
122
  export declare abstract class BaseLLM extends ScopedBaseLLM<"global"> {
121
123
  constructor(options?: BaseLlmOptions);
@@ -147,6 +149,8 @@ declare abstract class ScopedBaseTTS<TScope extends VendorScope, _SR extends num
147
149
  * Converts the vendor configuration to the Agora API format.
148
150
  */
149
151
  abstract toConfig(): TtsConfig;
152
+ /** Internal v3 serialization; deployment performs complete contract validation. */
153
+ toV3Module(): Record<string, unknown>;
150
154
  }
151
155
  export declare abstract class BaseTTS<_SR extends number = number> extends ScopedBaseTTS<"global", _SR> {
152
156
  constructor();
@@ -164,6 +168,8 @@ declare abstract class ScopedBaseSTT<TScope extends VendorScope> {
164
168
  * Converts the vendor configuration to the Agora API format.
165
169
  */
166
170
  abstract toConfig(): SttConfig;
171
+ /** Internal v3 serialization; deployment performs complete contract validation. */
172
+ toV3Module(): Record<string, unknown>;
167
173
  }
168
174
  export declare abstract class BaseSTT extends ScopedBaseSTT<"global"> {
169
175
  constructor();
@@ -205,6 +211,8 @@ declare abstract class ScopedBaseAvatar<TScope extends VendorScope, RequiredSR e
205
211
  * Converts the vendor configuration to the Agora API format.
206
212
  */
207
213
  abstract toConfig(): AvatarConfig;
214
+ /** Internal v3 serialization; deployment performs complete contract validation. */
215
+ toV3Module(): Record<string, unknown>;
208
216
  /**
209
217
  * The TTS sample rate required by this avatar vendor.
210
218
  */
@@ -1,13 +1,7 @@
1
1
  "use strict";
2
- /**
3
- * Base classes for type-safe vendor configurations.
4
- *
5
- * Each vendor class extends a base class and implements a `toConfig()` method
6
- * that converts TypeScript-friendly constructor params (camelCase) into the
7
- * Agora API format (snake_case).
8
- */
9
2
  Object.defineProperty(exports, "__esModule", { value: true });
10
3
  exports.BaseCNAvatar = exports.BaseAvatar = exports.BaseCNMLLM = exports.BaseMLLM = exports.BaseCNSTT = exports.BaseSTT = exports.BaseCNTTS = exports.BaseTTS = exports.BaseCNLLM = exports.BaseLLM = void 0;
4
+ const v3_js_1 = require("../v3.js");
11
5
  /**
12
6
  * Base class for LLM (Large Language Model) vendors.
13
7
  */
@@ -47,6 +41,14 @@ class ScopedBaseLLM {
47
41
  get tools() {
48
42
  return this._tools;
49
43
  }
44
+ /** Internal v3 serialization; deployment performs complete contract validation. */
45
+ toV3Module() {
46
+ const errors = [];
47
+ const module = (0, v3_js_1.toV3Module)(this.toConfig(), "llm", errors);
48
+ if (errors.length)
49
+ throw new v3_js_1.UnsupportedFieldError(errors);
50
+ return module;
51
+ }
50
52
  }
51
53
  class BaseLLM extends ScopedBaseLLM {
52
54
  constructor(options) {
@@ -81,6 +83,14 @@ class ScopedBaseTTS {
81
83
  constructor(areaScope) {
82
84
  this.areaScope = areaScope;
83
85
  }
86
+ /** Internal v3 serialization; deployment performs complete contract validation. */
87
+ toV3Module() {
88
+ const errors = [];
89
+ const module = (0, v3_js_1.toV3Module)(this.toConfig(), "tts", errors);
90
+ if (errors.length)
91
+ throw new v3_js_1.UnsupportedFieldError(errors);
92
+ return module;
93
+ }
84
94
  }
85
95
  class BaseTTS extends ScopedBaseTTS {
86
96
  constructor() {
@@ -101,6 +111,14 @@ class ScopedBaseSTT {
101
111
  constructor(areaScope) {
102
112
  this.areaScope = areaScope;
103
113
  }
114
+ /** Internal v3 serialization; deployment performs complete contract validation. */
115
+ toV3Module() {
116
+ const errors = [];
117
+ const module = (0, v3_js_1.toV3Module)(this.toConfig(), "asr", errors);
118
+ if (errors.length)
119
+ throw new v3_js_1.UnsupportedFieldError(errors);
120
+ return module;
121
+ }
104
122
  }
105
123
  class BaseSTT extends ScopedBaseSTT {
106
124
  constructor() {
@@ -155,6 +173,14 @@ class ScopedBaseAvatar {
155
173
  constructor(areaScope) {
156
174
  this.areaScope = areaScope;
157
175
  }
176
+ /** Internal v3 serialization; deployment performs complete contract validation. */
177
+ toV3Module() {
178
+ const errors = [];
179
+ const module = (0, v3_js_1.toV3Module)(this.toConfig(), "avatar", errors);
180
+ if (errors.length)
181
+ throw new v3_js_1.UnsupportedFieldError(errors);
182
+ return module;
183
+ }
158
184
  }
159
185
  class BaseAvatar extends ScopedBaseAvatar {
160
186
  constructor() {
@@ -1,14 +1,13 @@
1
1
  /**
2
2
  * Type-safe LLM (Large Language Model) vendor classes.
3
3
  */
4
- import { type OpenAIPresetModel } from "../presets.js";
5
4
  import type { LlmConfig } from "../types.js";
6
5
  import { BaseLLM, type BaseLlmOptions } from "./base.js";
7
6
  /**
8
7
  * Constructor options for OpenAI LLM.
9
8
  */
10
9
  type OpenAICommonOptions = BaseLlmOptions & {
11
- /** OpenAI API key. Optional only for AgentKit-supported Agora-managed models. */
10
+ /** OpenAI API key. Omit for Agora-managed credentials; model availability is validated by the server. */
12
11
  apiKey?: string;
13
12
  /** Model name (e.g., 'gpt-4o-mini', 'gpt-4', 'gpt-3.5-turbo') */
14
13
  model: string;
@@ -38,11 +37,10 @@ type OpenAICommonOptions = BaseLlmOptions & {
38
37
  export type OpenAIOptions = (OpenAICommonOptions & {
39
38
  apiKey: string;
40
39
  url: string;
41
- }) | (Omit<OpenAICommonOptions, "model" | "url" | "vendor"> & {
40
+ }) | (Omit<OpenAICommonOptions, "apiKey" | "url" | "vendor"> & {
42
41
  apiKey?: undefined;
43
- model: OpenAIPresetModel;
44
42
  url?: undefined;
45
- vendor?: undefined;
43
+ vendor?: "openai";
46
44
  });
47
45
  /**
48
46
  * OpenAI LLM vendor (and OpenAI-compatible APIs).
@@ -267,9 +265,11 @@ export declare class VertexAILLM extends BaseLLM {
267
265
  }
268
266
  export interface AmazonBedrockOptions extends BaseLlmOptions {
269
267
  /** AWS access key ID. */
270
- accessKey: string;
268
+ accessKey?: string;
271
269
  /** AWS secret access key. */
272
- secretKey: string;
270
+ secretKey?: string;
271
+ /** Bedrock API key, mutually exclusive with the AWS access-key pair. */
272
+ apiKey?: string;
273
273
  /** AWS region. */
274
274
  region: string;
275
275
  model: string;
@@ -4,7 +4,6 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Dify = exports.AmazonBedrock = exports.VertexAILLM = exports.CustomLLM = exports.Groq = exports.Gemini = exports.Anthropic = exports.AzureOpenAI = exports.OpenAI = void 0;
7
- const presets_js_1 = require("../presets.js");
8
7
  const base_js_1 = require("./base.js");
9
8
  function requireString(value, field, vendor) {
10
9
  if (typeof value !== "string" || value.length === 0) {
@@ -21,9 +20,6 @@ function requireRecord(value, field, vendor) {
21
20
  throw new Error(`${vendor} requires ${field}`);
22
21
  }
23
22
  }
24
- function isOpenAIManagedModel(model) {
25
- return presets_js_1.OpenAIPresetModels.includes(model.trim().toLowerCase());
26
- }
27
23
  /**
28
24
  * OpenAI LLM vendor (and OpenAI-compatible APIs).
29
25
  *
@@ -44,23 +40,20 @@ class OpenAI extends base_js_1.BaseLLM {
44
40
  requireString(options.url, "url", "OpenAI");
45
41
  }
46
42
  else {
47
- if (!isOpenAIManagedModel(options.model)) {
48
- throw new Error("OpenAI requires apiKey unless using a supported Agora-managed model");
49
- }
43
+ if (options.vendor && options.vendor !== "openai")
44
+ throw new Error("OpenAI managed credentials require the openai vendor");
50
45
  if (options.url) {
51
46
  throw new Error("OpenAI Agora-managed mode does not allow url");
52
47
  }
53
- if (options.vendor) {
54
- throw new Error("OpenAI Agora-managed mode does not allow vendor");
55
- }
56
48
  }
57
49
  this.options = options;
58
50
  }
59
51
  toConfig() {
52
+ var _a;
60
53
  const { apiKey, model, url, maxHistory, temperature, topP, maxTokens, systemMessages, greetingMessage, failureMessage, inputModalities, params, headers, } = this.options;
61
54
  return Object.assign(Object.assign({ url: url !== null && url !== void 0 ? url : "https://api.openai.com/v1/chat/completions" }, (apiKey && { api_key: apiKey })), {
62
55
  // model is the default; params entries extend it; named fields win.
63
- params: Object.assign(Object.assign(Object.assign(Object.assign({ model }, params), (temperature !== undefined && { temperature })), (topP !== undefined && { top_p: topP })), (maxTokens !== undefined && { max_tokens: maxTokens })), headers, max_history: maxHistory, system_messages: systemMessages, greeting_message: greetingMessage, greeting_audio_url: this.greetingAudioUrl, failure_message: failureMessage, input_modalities: inputModalities !== null && inputModalities !== void 0 ? inputModalities : ["text"], output_modalities: this.outputModalities, style: "openai", vendor: this.vendor, greeting_configs: this.greetingConfigs, template_variables: this.templateVariables, mcp_servers: this.mcpServers, tools: this.tools });
56
+ params: Object.assign(Object.assign(Object.assign(Object.assign({ model }, params), (temperature !== undefined && { temperature })), (topP !== undefined && { top_p: topP })), (maxTokens !== undefined && { max_tokens: maxTokens })), headers, max_history: maxHistory, system_messages: systemMessages, greeting_message: greetingMessage, greeting_audio_url: this.greetingAudioUrl, failure_message: failureMessage, input_modalities: inputModalities !== null && inputModalities !== void 0 ? inputModalities : ["text"], output_modalities: this.outputModalities, style: "openai", vendor: (_a = this.vendor) !== null && _a !== void 0 ? _a : "openai", greeting_configs: this.greetingConfigs, template_variables: this.templateVariables, mcp_servers: this.mcpServers, tools: this.tools });
64
57
  }
65
58
  }
66
59
  exports.OpenAI = OpenAI;
@@ -142,6 +135,7 @@ class Anthropic extends base_js_1.BaseLLM {
142
135
  this.options = options;
143
136
  }
144
137
  toConfig() {
138
+ var _a;
145
139
  const { apiKey, model, url, maxHistory, maxTokens, temperature, topP, systemMessages, greetingMessage, failureMessage, inputModalities, params, headers, } = this.options;
146
140
  return {
147
141
  url,
@@ -157,7 +151,7 @@ class Anthropic extends base_js_1.BaseLLM {
157
151
  input_modalities: inputModalities !== null && inputModalities !== void 0 ? inputModalities : ["text"],
158
152
  output_modalities: this.outputModalities,
159
153
  style: "anthropic",
160
- vendor: this.vendor,
154
+ vendor: (_a = this.vendor) !== null && _a !== void 0 ? _a : "anthropic",
161
155
  greeting_configs: this.greetingConfigs,
162
156
  template_variables: this.templateVariables,
163
157
  mcp_servers: this.mcpServers,
@@ -188,10 +182,12 @@ class Gemini extends base_js_1.BaseLLM {
188
182
  this.options = options;
189
183
  }
190
184
  toConfig() {
185
+ var _a;
191
186
  const { apiKey, model, url, maxHistory, temperature, topP, topK, maxOutputTokens, systemMessages, greetingMessage, failureMessage, inputModalities, params, headers, } = this.options;
192
187
  const defaultUrl = `https://generativelanguage.googleapis.com/v1beta/models/${model}:streamGenerateContent?alt=sse&key=${encodeURIComponent(apiKey)}`;
193
188
  return {
194
189
  url: url !== null && url !== void 0 ? url : defaultUrl,
190
+ api_key: apiKey,
195
191
  // model is the default; params entries extend it; named fields win.
196
192
  params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ model }, params), (temperature !== undefined && { temperature })), (topP !== undefined && { top_p: topP })), (topK !== undefined && { top_k: topK })), (maxOutputTokens !== undefined && { max_output_tokens: maxOutputTokens })),
197
193
  headers,
@@ -203,7 +199,7 @@ class Gemini extends base_js_1.BaseLLM {
203
199
  input_modalities: inputModalities !== null && inputModalities !== void 0 ? inputModalities : ["text"],
204
200
  output_modalities: this.outputModalities,
205
201
  style: "gemini",
206
- vendor: this.vendor,
202
+ vendor: (_a = this.vendor) !== null && _a !== void 0 ? _a : "gemini",
207
203
  greeting_configs: this.greetingConfigs,
208
204
  template_variables: this.templateVariables,
209
205
  mcp_servers: this.mcpServers,
@@ -243,7 +239,7 @@ class Groq extends base_js_1.BaseLLM {
243
239
  requireString(options.url, "url", "Groq");
244
240
  }
245
241
  toConfig() {
246
- return openAIStyleConfig(this.options);
242
+ return openAIStyleConfig(this.options, "groq");
247
243
  }
248
244
  }
249
245
  exports.Groq = Groq;
@@ -270,7 +266,7 @@ class VertexAILLM extends base_js_1.BaseLLM {
270
266
  requireString(options.location, "location", "VertexAILLM");
271
267
  }
272
268
  toConfig() {
273
- var _a, _b;
269
+ var _a, _b, _c;
274
270
  const o = this.options;
275
271
  const defaultUrl = `https://${o.location}-aiplatform.googleapis.com/v1/projects/${o.projectId}/locations/${o.location}/publishers/google/models/${o.model}:streamGenerateContent?alt=sse`;
276
272
  return {
@@ -286,7 +282,7 @@ class VertexAILLM extends base_js_1.BaseLLM {
286
282
  input_modalities: (_b = o.inputModalities) !== null && _b !== void 0 ? _b : ["text"],
287
283
  output_modalities: this.outputModalities,
288
284
  style: "gemini",
289
- vendor: this.vendor,
285
+ vendor: (_c = this.vendor) !== null && _c !== void 0 ? _c : "vertexai",
290
286
  greeting_configs: this.greetingConfigs,
291
287
  template_variables: this.templateVariables,
292
288
  mcp_servers: this.mcpServers,
@@ -299,16 +295,24 @@ class AmazonBedrock extends base_js_1.BaseLLM {
299
295
  constructor(options) {
300
296
  super(options);
301
297
  this.options = options;
302
- requireString(options.accessKey, "accessKey", "AmazonBedrock");
303
- requireString(options.secretKey, "secretKey", "AmazonBedrock");
298
+ if (options.apiKey !== undefined) {
299
+ requireString(options.apiKey, "apiKey", "AmazonBedrock");
300
+ if (options.accessKey !== undefined || options.secretKey !== undefined)
301
+ throw new Error("Use apiKey or accessKey/secretKey, not both");
302
+ }
303
+ else {
304
+ requireString(options.accessKey, "accessKey", "AmazonBedrock");
305
+ requireString(options.secretKey, "secretKey", "AmazonBedrock");
306
+ }
304
307
  requireString(options.region, "region", "AmazonBedrock");
305
308
  requireString(options.model, "model", "AmazonBedrock");
306
309
  }
307
310
  toConfig() {
308
- var _a;
311
+ var _a, _b;
309
312
  const o = this.options;
310
313
  return {
311
314
  url: `https://bedrock-runtime.${o.region}.amazonaws.com/model/${o.model}/converse-stream`,
315
+ api_key: o.apiKey,
312
316
  access_key: o.accessKey,
313
317
  secret_key: o.secretKey,
314
318
  region: o.region,
@@ -323,7 +327,7 @@ class AmazonBedrock extends base_js_1.BaseLLM {
323
327
  input_modalities: (_a = o.inputModalities) !== null && _a !== void 0 ? _a : ["text"],
324
328
  output_modalities: this.outputModalities,
325
329
  style: "bedrock",
326
- vendor: this.vendor,
330
+ vendor: (_b = this.vendor) !== null && _b !== void 0 ? _b : "amazon",
327
331
  greeting_configs: this.greetingConfigs,
328
332
  template_variables: this.templateVariables,
329
333
  mcp_servers: this.mcpServers,
@@ -341,7 +345,7 @@ class Dify extends base_js_1.BaseLLM {
341
345
  requireString(options.model, "model", "Dify");
342
346
  }
343
347
  toConfig() {
344
- var _a;
348
+ var _a, _b;
345
349
  const o = this.options;
346
350
  return {
347
351
  url: o.url,
@@ -356,7 +360,7 @@ class Dify extends base_js_1.BaseLLM {
356
360
  input_modalities: (_a = o.inputModalities) !== null && _a !== void 0 ? _a : ["text"],
357
361
  output_modalities: this.outputModalities,
358
362
  style: "dify",
359
- vendor: this.vendor,
363
+ vendor: (_b = this.vendor) !== null && _b !== void 0 ? _b : "dify",
360
364
  greeting_configs: this.greetingConfigs,
361
365
  template_variables: this.templateVariables,
362
366
  mcp_servers: this.mcpServers,
@@ -482,6 +482,16 @@ type MiniMaxTTSCommonOptions = {
482
482
  model: string;
483
483
  /** Voice style identifier (e.g., 'English_captivating_female1') */
484
484
  voiceId?: string;
485
+ /** Speech speed (default 1). */
486
+ speed?: number;
487
+ volume?: number;
488
+ pitch?: number;
489
+ emotion?: string;
490
+ sampleRate?: number;
491
+ bitrate?: number;
492
+ format?: string;
493
+ channel?: number;
494
+ additionalParams?: Record<string, unknown>;
485
495
  /** WebSocket endpoint (e.g., 'wss://api-uw.minimax.io/ws/v1/t2a_v2') */
486
496
  url?: string;
487
497
  /** Skip patterns for bracketed content */
@@ -494,6 +504,16 @@ export type MiniMaxTTSOptions = (MiniMaxTTSCommonOptions & {
494
504
  model: MiniMaxPresetModel;
495
505
  groupId?: string;
496
506
  voiceId?: string;
507
+ /** Speech speed (default 1). */
508
+ speed?: number;
509
+ volume?: number;
510
+ pitch?: number;
511
+ emotion?: string;
512
+ sampleRate?: number;
513
+ bitrate?: number;
514
+ format?: string;
515
+ channel?: number;
516
+ additionalParams?: Record<string, unknown>;
497
517
  url?: string;
498
518
  });
499
519
  /**
@@ -363,8 +363,11 @@ class MiniMaxTTS extends base_js_1.BaseTTS {
363
363
  this.options = options;
364
364
  }
365
365
  toConfig() {
366
- const { key, groupId, model, voiceId, url, skipPatterns } = this.options;
367
- return Object.assign(Object.assign({ vendor: "minimax", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (key && { key })), (key && groupId && { group_id: groupId })), (key && { model })), (voiceId && { voice_setting: { voice_id: voiceId } })), (key && url && { url })) }, (!key && { _minimaxPresetModel: model })), (skipPatterns && { skip_patterns: skipPatterns }));
366
+ var _a, _b;
367
+ const { key, groupId, model, voiceId, url, skipPatterns, speed, volume, pitch, emotion, sampleRate, bitrate, format, channel, additionalParams, } = this.options;
368
+ const voice = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams === null || additionalParams === void 0 ? void 0 : additionalParams.voice_setting), (voiceId !== undefined && { voice_id: voiceId })), { speed: (_b = speed !== null && speed !== void 0 ? speed : (_a = additionalParams === null || additionalParams === void 0 ? void 0 : additionalParams.voice_setting) === null || _a === void 0 ? void 0 : _a.speed) !== null && _b !== void 0 ? _b : 1 }), (volume !== undefined && { vol: volume })), (pitch !== undefined && { pitch })), (emotion !== undefined && { emotion }));
369
+ const audio = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams === null || additionalParams === void 0 ? void 0 : additionalParams.audio_setting), (sampleRate !== undefined && { sample_rate: sampleRate })), (bitrate !== undefined && { bitrate })), (format !== undefined && { format })), (channel !== undefined && { channel }));
370
+ return Object.assign(Object.assign({ vendor: "minimax", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), (key && { key })), (key && groupId && { group_id: groupId })), (key && { model })), { voice_setting: voice }), (Object.keys(audio).length && { audio_setting: audio })), (key && url && { url })) }, (!key && { _minimaxPresetModel: model })), (skipPatterns && { skip_patterns: skipPatterns }));
368
371
  }
369
372
  }
370
373
  exports.MiniMaxTTS = MiniMaxTTS;
@@ -0,0 +1,2 @@
1
+ /** Header namespace reserved for Agora's internal gateway and studio routing. */
2
+ export declare function isInternalHeader(name: string): boolean;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isInternalHeader = isInternalHeader;
4
+ /** Header namespace reserved for Agora's internal gateway and studio routing. */
5
+ function isInternalHeader(name) {
6
+ const key = name.toLowerCase();
7
+ return key.startsWith("x-studio-") || key === "x-consumer-username";
8
+ }
@@ -5,9 +5,14 @@ export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AgentOptions, Ag
5
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
6
  export type { GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions } from "./agentkit/preview/gemini-tts.js";
7
7
  export { GeminiTTS, GeminiTTSModels } from "./agentkit/preview/gemini-tts.js";
8
+ export { UnsupportedSessionOperationError } from "./agentkit/session-backend.js";
9
+ export type { AssignNumberOptions, DeployOptions, SaveOptions, SecretRef, VariableDefinition } from "./agentkit/v3.js";
10
+ export { DeployedAgent, NumberNotFoundError, SavedAgent, SecretRefNotSupportedError, secretRef, UnsupportedFieldError, } from "./agentkit/v3.js";
8
11
  export * as Agora from "./api/index.js";
9
12
  export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
10
13
  export { Area } from "./core/domain/index.js";
11
14
  export { AgoraEnvironment } from "./environments.js";
12
15
  export { AgoraError, AgoraTimeoutError } from "./errors/index.js";
13
16
  export * from "./exports.js";
17
+ export type { V3, V3Options } from "./v3/index.js";
18
+ export { PreconditionFailedError, V3Client, V3Error } from "./v3/index.js";
package/dist/cjs/index.js CHANGED
@@ -39,7 +39,7 @@ 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
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.AgoraTimeoutError = exports.AgoraError = exports.AgoraEnvironment = exports.Area = exports.Agora = 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;
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
@@ -200,6 +200,15 @@ Object.defineProperty(exports, "XfyunSTT", { enumerable: true, get: function ()
200
200
  var gemini_tts_js_1 = require("./agentkit/preview/gemini-tts.js");
201
201
  Object.defineProperty(exports, "GeminiTTS", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTS; } });
202
202
  Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTSModels; } });
203
+ var session_backend_js_1 = require("./agentkit/session-backend.js");
204
+ Object.defineProperty(exports, "UnsupportedSessionOperationError", { enumerable: true, get: function () { return session_backend_js_1.UnsupportedSessionOperationError; } });
205
+ var v3_js_1 = require("./agentkit/v3.js");
206
+ Object.defineProperty(exports, "DeployedAgent", { enumerable: true, get: function () { return v3_js_1.DeployedAgent; } });
207
+ Object.defineProperty(exports, "NumberNotFoundError", { enumerable: true, get: function () { return v3_js_1.NumberNotFoundError; } });
208
+ Object.defineProperty(exports, "SavedAgent", { enumerable: true, get: function () { return v3_js_1.SavedAgent; } });
209
+ Object.defineProperty(exports, "SecretRefNotSupportedError", { enumerable: true, get: function () { return v3_js_1.SecretRefNotSupportedError; } });
210
+ Object.defineProperty(exports, "secretRef", { enumerable: true, get: function () { return v3_js_1.secretRef; } });
211
+ Object.defineProperty(exports, "UnsupportedFieldError", { enumerable: true, get: function () { return v3_js_1.UnsupportedFieldError; } });
203
212
  exports.Agora = __importStar(require("./api/index.js"));
204
213
  var index_js_2 = require("./core/domain/index.js");
205
214
  Object.defineProperty(exports, "Area", { enumerable: true, get: function () { return index_js_2.Area; } });
@@ -209,3 +218,7 @@ var index_js_3 = require("./errors/index.js");
209
218
  Object.defineProperty(exports, "AgoraError", { enumerable: true, get: function () { return index_js_3.AgoraError; } });
210
219
  Object.defineProperty(exports, "AgoraTimeoutError", { enumerable: true, get: function () { return index_js_3.AgoraTimeoutError; } });
211
220
  __exportStar(require("./exports.js"), exports);
221
+ var index_js_4 = require("./v3/index.js");
222
+ Object.defineProperty(exports, "PreconditionFailedError", { enumerable: true, get: function () { return index_js_4.PreconditionFailedError; } });
223
+ Object.defineProperty(exports, "V3Client", { enumerable: true, get: function () { return index_js_4.V3Client; } });
224
+ Object.defineProperty(exports, "V3Error", { enumerable: true, get: function () { return index_js_4.V3Error; } });
@@ -0,0 +1 @@
1
+ export * from "./types.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Generated from openapi.json.
18
+ __exportStar(require("./types.js"), exports);
@@ -0,0 +1,50 @@
1
+ /** Campaign resource operations; no client-side scheduling/retry orchestration. */
2
+ import type { BaseRequestOptions } from "../BaseClient.js";
3
+ import type { HttpResponsePromise } from "../core/fetcher/HttpResponsePromise.js";
4
+ import type * as T from "./campaign-schema.js";
5
+ import { type V3Transport } from "./transport.js";
6
+ export declare class CampaignsResource {
7
+ private transport;
8
+ constructor(transport: V3Transport);
9
+ create(request: T.CampaignCreate & {
10
+ appid?: string;
11
+ idempotencyKey?: string;
12
+ }, options?: BaseRequestOptions): HttpResponsePromise<T.CampaignResponse>;
13
+ list(request?: {
14
+ appid?: string;
15
+ status?: "scheduled" | "running" | "paused" | "completed" | "canceled" | "failed";
16
+ limit?: number;
17
+ cursor?: string | null;
18
+ order?: "create_ts.asc" | "create_ts.desc";
19
+ }, options?: BaseRequestOptions): HttpResponsePromise<T.CampaignListResponse>;
20
+ listAll(request?: Parameters<CampaignsResource["list"]>[0], options?: BaseRequestOptions): AsyncGenerator<T.CampaignResponse>;
21
+ get(request: {
22
+ appid?: string;
23
+ id: string;
24
+ }, options?: BaseRequestOptions): HttpResponsePromise<T.CampaignResponse>;
25
+ update(request: T.CampaignPatch & {
26
+ appid?: string;
27
+ id: string;
28
+ ifMatch: string;
29
+ }, options?: BaseRequestOptions): HttpResponsePromise<T.CampaignResponse>;
30
+ delete(request: {
31
+ appid?: string;
32
+ id: string;
33
+ }, options?: BaseRequestOptions): HttpResponsePromise<T.CampaignDeleteResponse>;
34
+ pause(request: {
35
+ appid?: string;
36
+ id: string;
37
+ idempotencyKey?: string;
38
+ }, options?: BaseRequestOptions): HttpResponsePromise<T.CampaignResponse>;
39
+ resume(request: {
40
+ appid?: string;
41
+ id: string;
42
+ idempotencyKey?: string;
43
+ }, options?: BaseRequestOptions): HttpResponsePromise<T.CampaignResponse>;
44
+ cancel(request: {
45
+ appid?: string;
46
+ id: string;
47
+ idempotencyKey?: string;
48
+ }, options?: BaseRequestOptions): HttpResponsePromise<T.CampaignResponse>;
49
+ private action;
50
+ }