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.
- package/README.md +38 -3
- package/dist/cjs/AgoraPoolClient.d.ts +15 -27
- package/dist/cjs/AgoraPoolClient.js +75 -54
- package/dist/cjs/BaseClient.js +3 -2
- package/dist/cjs/agentkit/Agent.d.ts +14 -1
- package/dist/cjs/agentkit/Agent.js +126 -9
- package/dist/cjs/agentkit/AgentSession.d.ts +11 -2
- package/dist/cjs/agentkit/AgentSession.js +134 -22
- package/dist/cjs/agentkit/index.d.ts +4 -1
- package/dist/cjs/agentkit/index.js +12 -2
- package/dist/cjs/agentkit/session-backend.d.ts +25 -0
- package/dist/cjs/agentkit/session-backend.js +197 -0
- package/dist/cjs/agentkit/types.d.ts +27 -4
- package/dist/cjs/agentkit/v3.d.ts +70 -0
- package/dist/cjs/agentkit/v3.js +700 -0
- package/dist/cjs/agentkit/vendors/avatar.d.ts +24 -12
- package/dist/cjs/agentkit/vendors/avatar.js +48 -3
- package/dist/cjs/agentkit/vendors/base.d.ts +8 -0
- package/dist/cjs/agentkit/vendors/base.js +33 -7
- package/dist/cjs/agentkit/vendors/llm.d.ts +7 -7
- package/dist/cjs/agentkit/vendors/llm.js +26 -22
- package/dist/cjs/agentkit/vendors/tts.d.ts +20 -0
- package/dist/cjs/agentkit/vendors/tts.js +5 -2
- package/dist/cjs/core/publicHeaders.d.ts +2 -0
- package/dist/cjs/core/publicHeaders.js +8 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +14 -1
- package/dist/cjs/v3/campaign-schema.d.ts +1 -0
- package/dist/cjs/v3/campaign-schema.js +18 -0
- package/dist/cjs/v3/campaigns.d.ts +50 -0
- package/dist/cjs/v3/campaigns.js +81 -0
- package/dist/cjs/v3/contract.d.ts +1 -0
- package/dist/cjs/v3/contract.js +9115 -0
- package/dist/cjs/v3/index.d.ts +15 -0
- package/dist/cjs/v3/index.js +56 -0
- package/dist/cjs/v3/resources.d.ts +121 -0
- package/dist/cjs/v3/resources.js +186 -0
- package/dist/cjs/v3/session-lifecycle.d.ts +51 -0
- package/dist/cjs/v3/session-lifecycle.js +127 -0
- package/dist/cjs/v3/session-schema.d.ts +1 -0
- package/dist/cjs/v3/session-schema.js +18 -0
- package/dist/cjs/v3/transport.d.ts +36 -0
- package/dist/cjs/v3/transport.js +161 -0
- package/dist/cjs/v3/types.d.ts +1004 -0
- package/dist/cjs/v3/types.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/AgoraPoolClient.d.mts +15 -27
- package/dist/esm/AgoraPoolClient.mjs +69 -48
- package/dist/esm/BaseClient.mjs +3 -2
- package/dist/esm/agentkit/Agent.d.mts +14 -1
- package/dist/esm/agentkit/Agent.mjs +126 -9
- package/dist/esm/agentkit/AgentSession.d.mts +11 -2
- package/dist/esm/agentkit/AgentSession.mjs +134 -22
- package/dist/esm/agentkit/index.d.mts +4 -1
- package/dist/esm/agentkit/index.mjs +2 -0
- package/dist/esm/agentkit/session-backend.d.mts +25 -0
- package/dist/esm/agentkit/session-backend.mjs +191 -0
- package/dist/esm/agentkit/types.d.mts +27 -4
- package/dist/esm/agentkit/v3.d.mts +70 -0
- package/dist/esm/agentkit/v3.mjs +687 -0
- package/dist/esm/agentkit/vendors/avatar.d.mts +24 -12
- package/dist/esm/agentkit/vendors/avatar.mjs +45 -6
- package/dist/esm/agentkit/vendors/base.d.mts +8 -0
- package/dist/esm/agentkit/vendors/base.mjs +33 -7
- package/dist/esm/agentkit/vendors/llm.d.mts +7 -7
- package/dist/esm/agentkit/vendors/llm.mjs +26 -22
- package/dist/esm/agentkit/vendors/tts.d.mts +20 -0
- package/dist/esm/agentkit/vendors/tts.mjs +5 -2
- package/dist/esm/core/publicHeaders.d.mts +2 -0
- package/dist/esm/core/publicHeaders.mjs +5 -0
- package/dist/esm/index.d.mts +5 -0
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/v3/campaign-schema.d.mts +1 -0
- package/dist/esm/v3/campaign-schema.mjs +2 -0
- package/dist/esm/v3/campaigns.d.mts +50 -0
- package/dist/esm/v3/campaigns.mjs +77 -0
- package/dist/esm/v3/contract.d.mts +1 -0
- package/dist/esm/v3/contract.mjs +9112 -0
- package/dist/esm/v3/index.d.mts +15 -0
- package/dist/esm/v3/index.mjs +15 -0
- package/dist/esm/v3/resources.d.mts +121 -0
- package/dist/esm/v3/resources.mjs +179 -0
- package/dist/esm/v3/session-lifecycle.d.mts +51 -0
- package/dist/esm/v3/session-lifecycle.mjs +121 -0
- package/dist/esm/v3/session-schema.d.mts +1 -0
- package/dist/esm/v3/session-schema.mjs +2 -0
- package/dist/esm/v3/transport.d.mts +36 -0
- package/dist/esm/v3/transport.mjs +151 -0
- package/dist/esm/v3/types.d.mts +1004 -0
- package/dist/esm/v3/types.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/openapi.yaml +8917 -0
- package/package.json +7 -4
- package/reference.md +3 -0
|
@@ -235,17 +235,29 @@ export type McpServersItem = McpServer & Record<string, unknown>;
|
|
|
235
235
|
/** Full agent configuration (alias for StartAgentsRequest.Properties) */
|
|
236
236
|
export type AgentConfig = StartAgentsRequest.Properties;
|
|
237
237
|
/** Agent configuration update (for runtime updates) */
|
|
238
|
-
export type AgentConfigUpdate = UpdateAgentsRequest.Properties
|
|
238
|
+
export type AgentConfigUpdate = UpdateAgentsRequest.Properties & {
|
|
239
|
+
messages?: import("../v3/types.js").Message[];
|
|
240
|
+
};
|
|
239
241
|
/** Options for creating a session via {@link Agent.createSession} */
|
|
240
242
|
export interface SessionOptions {
|
|
243
|
+
/** Runtime values for declared template variables; selects ephemeral startup for inline builders. */
|
|
244
|
+
values?: Record<string, string | number | boolean>;
|
|
245
|
+
idempotencyKey?: string;
|
|
246
|
+
labels?: Record<string, string>;
|
|
247
|
+
maxDuration?: number;
|
|
248
|
+
encryption?: import("../v3/session-schema.js").RtcEncryption;
|
|
249
|
+
audioScenario?: "aiserver" | "chorus";
|
|
250
|
+
geofence?: import("../v3/session-lifecycle.js").SessionGeofence;
|
|
251
|
+
gracefulStop?: import("../v3/session-schema.js").GracefulStop;
|
|
252
|
+
dataPolicy?: import("../v3/session-schema.js").DataPolicy;
|
|
241
253
|
/** Unique agent instance name sent to the Agora API. Omit to auto-generate `agent-{timestamp}`. */
|
|
242
254
|
name?: string;
|
|
243
255
|
/** The channel to join */
|
|
244
256
|
channel: string;
|
|
245
257
|
/** Authentication token for the channel. Omit to auto-generate (requires appCertificate on the session). */
|
|
246
258
|
token?: string;
|
|
247
|
-
/** The agent's RTC UID */
|
|
248
|
-
agentUid
|
|
259
|
+
/** The agent's RTC UID. Omit for server auto-assignment (legacy inline sessions use 0). */
|
|
260
|
+
agentUid?: string;
|
|
249
261
|
/** Remote user UIDs to subscribe to */
|
|
250
262
|
remoteUids: string[];
|
|
251
263
|
/** Idle timeout in seconds (0 = no auto-exit) */
|
|
@@ -267,10 +279,21 @@ export interface SessionOptions {
|
|
|
267
279
|
/** Optional warning logger. Defaults to console.warn. Set to a no-op to silence warnings. */
|
|
268
280
|
warn?: (message: string) => void;
|
|
269
281
|
}
|
|
282
|
+
/** Outbound telephony options; from is a registered number ID, to is an E.164 number. */
|
|
283
|
+
export type CallOptions = Pick<SessionOptions, "name" | "values" | "idempotencyKey" | "labels" | "maxDuration" | "idleTimeout" | "gracefulStop" | "dataPolicy" | "debug" | "warn"> & {
|
|
284
|
+
from: string;
|
|
285
|
+
to: string;
|
|
286
|
+
callPolicy?: import("../v3/types.js").CallPolicy;
|
|
287
|
+
};
|
|
270
288
|
/** Session status */
|
|
271
289
|
export type SessionStatus = ListAgentsResponse.Data.List.Item.Status;
|
|
272
290
|
/** Session info (from get endpoint) */
|
|
273
|
-
export type SessionInfo = GetAgentsResponse
|
|
291
|
+
export type SessionInfo = GetAgentsResponse & {
|
|
292
|
+
agent_session_id?: string;
|
|
293
|
+
agent_name?: string;
|
|
294
|
+
/** Extraction analysis, when returned by the service. */
|
|
295
|
+
analysis?: import("../v3/types.js").SessionAnalysis | null;
|
|
296
|
+
};
|
|
274
297
|
/** Session list response */
|
|
275
298
|
export type SessionListResponse = ListAgentsResponse;
|
|
276
299
|
/** Session summary (list item) */
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { AgoraClient } from "../AgoraPoolClient.js";
|
|
2
|
+
import type * as V3 from "../v3/types.js";
|
|
3
|
+
import type { Agent, AgentOptions } from "./Agent.js";
|
|
4
|
+
import type { AgentSession } from "./AgentSession.js";
|
|
5
|
+
import type { CallOptions, LlmConfig, MllmConfig, SessionOptions, SttConfig, TtsConfig } from "./types.js";
|
|
6
|
+
export type SecretRef = string & {
|
|
7
|
+
readonly __secretRef: unique symbol;
|
|
8
|
+
};
|
|
9
|
+
export declare function secretRef(set: string, key: string): SecretRef;
|
|
10
|
+
export declare class SecretRefNotSupportedError extends Error {
|
|
11
|
+
constructor();
|
|
12
|
+
}
|
|
13
|
+
export declare class UnsupportedFieldError extends Error {
|
|
14
|
+
readonly fields: string[];
|
|
15
|
+
constructor(fields: string[]);
|
|
16
|
+
}
|
|
17
|
+
export declare class NumberNotFoundError extends Error {
|
|
18
|
+
constructor(number: string, appid: string);
|
|
19
|
+
}
|
|
20
|
+
export declare function assertNoSecretRefs(value: unknown): void;
|
|
21
|
+
export type VariableDefinition = V3.Contract_VariableDefinition;
|
|
22
|
+
export declare function validateVariable(name: string, def: VariableDefinition): void;
|
|
23
|
+
type Config = AgentOptions & {
|
|
24
|
+
llm?: LlmConfig;
|
|
25
|
+
tts?: TtsConfig;
|
|
26
|
+
stt?: SttConfig;
|
|
27
|
+
mllm?: MllmConfig;
|
|
28
|
+
};
|
|
29
|
+
type Map = Record<string, any>;
|
|
30
|
+
export declare function toV3Module(config: object, kind: "asr" | "llm" | "tts" | "avatar", errors?: string[]): Map;
|
|
31
|
+
export declare function buildV3Agent(config: Config, variables: Record<string, VariableDefinition>, name: string): V3.AgentCreateRequest;
|
|
32
|
+
/** Explicitly clear readable stale keys under standard JSON merge-patch semantics. */
|
|
33
|
+
export declare function redeployPatch(previous: V3.AgentResponse, desired: V3.AgentCreateRequest): V3.AgentPatchRequest;
|
|
34
|
+
export interface SaveOptions {
|
|
35
|
+
name?: string;
|
|
36
|
+
agentId?: string;
|
|
37
|
+
}
|
|
38
|
+
/** Compatibility name for save options. */
|
|
39
|
+
export type DeployOptions = SaveOptions;
|
|
40
|
+
export declare function deployAgent(client: AgoraClient, body: V3.AgentCreateRequest, options: DeployOptions): Promise<SavedAgent>;
|
|
41
|
+
export interface AssignNumberOptions {
|
|
42
|
+
maxCallDurationSeconds?: number;
|
|
43
|
+
maxSilenceDurationMs?: number;
|
|
44
|
+
/** Full inbound policy, including end_call. Named duration options take precedence. */
|
|
45
|
+
callPolicy?: V3.InboundCallPolicy;
|
|
46
|
+
}
|
|
47
|
+
export declare class SavedAgent {
|
|
48
|
+
private readonly client;
|
|
49
|
+
readonly etag: string;
|
|
50
|
+
readonly id: string;
|
|
51
|
+
readonly name: string;
|
|
52
|
+
readonly raw: AgoraClient["v3"]["agents"];
|
|
53
|
+
constructor(client: AgoraClient, data: V3.AgentResponse, etag: string);
|
|
54
|
+
static get(client: AgoraClient, agentId: string): Promise<SavedAgent>;
|
|
55
|
+
createSession(options: SessionOptions): AgentSession;
|
|
56
|
+
/** Create an outbound phone-call session using this saved agent. */
|
|
57
|
+
call(options: CallOptions): AgentSession;
|
|
58
|
+
/** Save a revised configuration to this stored identity, preserving its name by default. */
|
|
59
|
+
update(config: Agent, options?: {
|
|
60
|
+
name?: string;
|
|
61
|
+
}): Promise<SavedAgent>;
|
|
62
|
+
delete(): Promise<void>;
|
|
63
|
+
/** Scan project number pages and return numbers assigned to this stored agent. */
|
|
64
|
+
listNumbers(): Promise<V3.NumberResponse[]>;
|
|
65
|
+
assignNumber(number: string | V3.NumberResponse, options?: AssignNumberOptions): Promise<V3.NumberResponse>;
|
|
66
|
+
unassignNumber(number: string | V3.NumberResponse): Promise<V3.NumberResponse>;
|
|
67
|
+
private setNumber;
|
|
68
|
+
}
|
|
69
|
+
/** Compatibility alias; save() and deploy() return the same handle type. */
|
|
70
|
+
export { SavedAgent as DeployedAgent };
|