@chanl/sdk 2.0.1
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 +59 -0
- package/dist/adapters/openai.d.ts +106 -0
- package/dist/adapters/openai.d.ts.map +1 -0
- package/dist/adapters/openai.js +185 -0
- package/dist/adapters/openai.js.map +1 -0
- package/dist/client.d.ts +74 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +293 -0
- package/dist/client.js.map +1 -0
- package/dist/errors/index.d.ts +179 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +319 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +76 -0
- package/dist/index.js.map +1 -0
- package/dist/live/index.d.ts +9 -0
- package/dist/live/index.d.ts.map +1 -0
- package/dist/live/index.js +16 -0
- package/dist/live/index.js.map +1 -0
- package/dist/live/live-call.d.ts +48 -0
- package/dist/live/live-call.d.ts.map +1 -0
- package/dist/live/live-call.js +148 -0
- package/dist/live/live-call.js.map +1 -0
- package/dist/live/live-chat.d.ts +71 -0
- package/dist/live/live-chat.d.ts.map +1 -0
- package/dist/live/live-chat.js +95 -0
- package/dist/live/live-chat.js.map +1 -0
- package/dist/live/live-execution.d.ts +55 -0
- package/dist/live/live-execution.d.ts.map +1 -0
- package/dist/live/live-execution.js +170 -0
- package/dist/live/live-execution.js.map +1 -0
- package/dist/live/typed-emitter.d.ts +15 -0
- package/dist/live/typed-emitter.d.ts.map +1 -0
- package/dist/live/typed-emitter.js +40 -0
- package/dist/live/typed-emitter.js.map +1 -0
- package/dist/live/types.d.ts +24 -0
- package/dist/live/types.d.ts.map +1 -0
- package/dist/live/types.js +6 -0
- package/dist/live/types.js.map +1 -0
- package/dist/modules/agents.d.ts +378 -0
- package/dist/modules/agents.d.ts.map +1 -0
- package/dist/modules/agents.js +259 -0
- package/dist/modules/agents.js.map +1 -0
- package/dist/modules/alerts.d.ts +43 -0
- package/dist/modules/alerts.d.ts.map +1 -0
- package/dist/modules/alerts.js +56 -0
- package/dist/modules/alerts.js.map +1 -0
- package/dist/modules/audio.d.ts +47 -0
- package/dist/modules/audio.d.ts.map +1 -0
- package/dist/modules/audio.js +75 -0
- package/dist/modules/audio.js.map +1 -0
- package/dist/modules/auth.d.ts +76 -0
- package/dist/modules/auth.d.ts.map +1 -0
- package/dist/modules/auth.js +59 -0
- package/dist/modules/auth.js.map +1 -0
- package/dist/modules/calls.d.ts +825 -0
- package/dist/modules/calls.d.ts.map +1 -0
- package/dist/modules/calls.js +398 -0
- package/dist/modules/calls.js.map +1 -0
- package/dist/modules/chat.d.ts +165 -0
- package/dist/modules/chat.d.ts.map +1 -0
- package/dist/modules/chat.js +169 -0
- package/dist/modules/chat.js.map +1 -0
- package/dist/modules/health.d.ts +45 -0
- package/dist/modules/health.d.ts.map +1 -0
- package/dist/modules/health.js +22 -0
- package/dist/modules/health.js.map +1 -0
- package/dist/modules/knowledge.d.ts +202 -0
- package/dist/modules/knowledge.d.ts.map +1 -0
- package/dist/modules/knowledge.js +147 -0
- package/dist/modules/knowledge.js.map +1 -0
- package/dist/modules/mcp.d.ts +140 -0
- package/dist/modules/mcp.d.ts.map +1 -0
- package/dist/modules/mcp.js +110 -0
- package/dist/modules/mcp.js.map +1 -0
- package/dist/modules/memory.d.ts +163 -0
- package/dist/modules/memory.d.ts.map +1 -0
- package/dist/modules/memory.js +208 -0
- package/dist/modules/memory.js.map +1 -0
- package/dist/modules/personas.d.ts +168 -0
- package/dist/modules/personas.d.ts.map +1 -0
- package/dist/modules/personas.js +106 -0
- package/dist/modules/personas.js.map +1 -0
- package/dist/modules/prompts.d.ts +128 -0
- package/dist/modules/prompts.d.ts.map +1 -0
- package/dist/modules/prompts.js +93 -0
- package/dist/modules/prompts.js.map +1 -0
- package/dist/modules/scenarios.d.ts +294 -0
- package/dist/modules/scenarios.d.ts.map +1 -0
- package/dist/modules/scenarios.js +349 -0
- package/dist/modules/scenarios.js.map +1 -0
- package/dist/modules/scorecard.d.ts +642 -0
- package/dist/modules/scorecard.d.ts.map +1 -0
- package/dist/modules/scorecard.js +327 -0
- package/dist/modules/scorecard.js.map +1 -0
- package/dist/modules/tools.d.ts +222 -0
- package/dist/modules/tools.d.ts.map +1 -0
- package/dist/modules/tools.js +302 -0
- package/dist/modules/tools.js.map +1 -0
- package/dist/modules/toolsets.d.ts +173 -0
- package/dist/modules/toolsets.d.ts.map +1 -0
- package/dist/modules/toolsets.js +216 -0
- package/dist/modules/toolsets.js.map +1 -0
- package/dist/modules/transcript.d.ts +60 -0
- package/dist/modules/transcript.d.ts.map +1 -0
- package/dist/modules/transcript.js +69 -0
- package/dist/modules/transcript.js.map +1 -0
- package/dist/modules/workspace.d.ts +48 -0
- package/dist/modules/workspace.d.ts.map +1 -0
- package/dist/modules/workspace.js +49 -0
- package/dist/modules/workspace.js.map +1 -0
- package/dist/types/api.d.ts +8 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +25 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/config.d.ts +70 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +3 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/memory.d.ts +243 -0
- package/dist/types/memory.d.ts.map +1 -0
- package/dist/types/memory.js +9 -0
- package/dist/types/memory.js.map +1 -0
- package/dist/types/tool-calls.d.ts +61 -0
- package/dist/types/tool-calls.d.ts.map +1 -0
- package/dist/types/tool-calls.js +9 -0
- package/dist/types/tool-calls.js.map +1 -0
- package/dist/types/tools.d.ts +321 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +9 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/types/toolsets.d.ts +149 -0
- package/dist/types/toolsets.d.ts.map +1 -0
- package/dist/types/toolsets.js +8 -0
- package/dist/types/toolsets.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Custom Error Classes for @chanl-ai/sdk
|
|
4
|
+
*
|
|
5
|
+
* TDD Phase: RED - These errors define the error handling contract
|
|
6
|
+
*
|
|
7
|
+
* Design Principles:
|
|
8
|
+
* - Error transparency: Include code, message, and context for debugging
|
|
9
|
+
* - HTTP status awareness: Map API response codes to specific error types
|
|
10
|
+
* - Serializable details: Allow JSON serialization for logging
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.TimeoutError = exports.NetworkError = exports.ServerError = exports.RateLimitError = exports.ConflictError = exports.AuthorizationError = exports.AuthenticationError = exports.ValidationError = exports.NotFoundError = exports.ChanlError = void 0;
|
|
14
|
+
exports.isChanlError = isChanlError;
|
|
15
|
+
exports.isNotFoundError = isNotFoundError;
|
|
16
|
+
exports.isValidationError = isValidationError;
|
|
17
|
+
exports.isAuthenticationError = isAuthenticationError;
|
|
18
|
+
exports.createErrorFromResponse = createErrorFromResponse;
|
|
19
|
+
/**
|
|
20
|
+
* Base error class for all Chanl SDK errors
|
|
21
|
+
*/
|
|
22
|
+
class ChanlError extends Error {
|
|
23
|
+
constructor(message, options = {}) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.name = 'ChanlError';
|
|
26
|
+
this.code = options.code ?? 'CHANL_ERROR';
|
|
27
|
+
// Only assign optional properties when defined (exactOptionalPropertyTypes)
|
|
28
|
+
if (options.statusCode !== undefined) {
|
|
29
|
+
this.statusCode = options.statusCode;
|
|
30
|
+
}
|
|
31
|
+
if (options.details !== undefined) {
|
|
32
|
+
this.details = options.details;
|
|
33
|
+
}
|
|
34
|
+
if (options.cause !== undefined) {
|
|
35
|
+
this.cause = options.cause;
|
|
36
|
+
}
|
|
37
|
+
if (options.requestId !== undefined) {
|
|
38
|
+
this.requestId = options.requestId;
|
|
39
|
+
}
|
|
40
|
+
// Maintains proper stack trace in V8 environments
|
|
41
|
+
if (Error.captureStackTrace) {
|
|
42
|
+
Error.captureStackTrace(this, this.constructor);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Convert error to JSON for logging/serialization
|
|
47
|
+
*/
|
|
48
|
+
toJSON() {
|
|
49
|
+
return {
|
|
50
|
+
name: this.name,
|
|
51
|
+
code: this.code,
|
|
52
|
+
message: this.message,
|
|
53
|
+
statusCode: this.statusCode,
|
|
54
|
+
details: this.details,
|
|
55
|
+
requestId: this.requestId,
|
|
56
|
+
stack: this.stack,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.ChanlError = ChanlError;
|
|
61
|
+
/**
|
|
62
|
+
* Error thrown when a requested resource is not found (404)
|
|
63
|
+
*/
|
|
64
|
+
class NotFoundError extends ChanlError {
|
|
65
|
+
constructor(resourceType, resourceId, options = {}) {
|
|
66
|
+
const details = {
|
|
67
|
+
resourceType,
|
|
68
|
+
resourceId,
|
|
69
|
+
...options.details,
|
|
70
|
+
};
|
|
71
|
+
super(`${resourceType} with ID '${resourceId}' not found`, {
|
|
72
|
+
code: 'NOT_FOUND',
|
|
73
|
+
statusCode: 404,
|
|
74
|
+
details,
|
|
75
|
+
requestId: options.requestId,
|
|
76
|
+
});
|
|
77
|
+
this.name = 'NotFoundError';
|
|
78
|
+
this.resourceType = resourceType;
|
|
79
|
+
this.resourceId = resourceId;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.NotFoundError = NotFoundError;
|
|
83
|
+
/**
|
|
84
|
+
* Error thrown when input validation fails (400)
|
|
85
|
+
*/
|
|
86
|
+
class ValidationError extends ChanlError {
|
|
87
|
+
constructor(message, options = {}) {
|
|
88
|
+
const details = {
|
|
89
|
+
...options.details,
|
|
90
|
+
};
|
|
91
|
+
if (options.fieldErrors !== undefined) {
|
|
92
|
+
details['fieldErrors'] = options.fieldErrors;
|
|
93
|
+
}
|
|
94
|
+
super(message, {
|
|
95
|
+
code: 'VALIDATION_ERROR',
|
|
96
|
+
statusCode: 400,
|
|
97
|
+
details,
|
|
98
|
+
requestId: options.requestId,
|
|
99
|
+
});
|
|
100
|
+
this.name = 'ValidationError';
|
|
101
|
+
if (options.fieldErrors !== undefined) {
|
|
102
|
+
this.fieldErrors = options.fieldErrors;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Get validation errors for a specific field
|
|
107
|
+
*/
|
|
108
|
+
getFieldErrors(field) {
|
|
109
|
+
return this.fieldErrors?.[field] ?? [];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Check if a specific field has validation errors
|
|
113
|
+
*/
|
|
114
|
+
hasFieldError(field) {
|
|
115
|
+
return (this.fieldErrors?.[field]?.length ?? 0) > 0;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.ValidationError = ValidationError;
|
|
119
|
+
/**
|
|
120
|
+
* Error thrown when authentication fails (401)
|
|
121
|
+
*/
|
|
122
|
+
class AuthenticationError extends ChanlError {
|
|
123
|
+
constructor(message = 'Authentication required', options = {}) {
|
|
124
|
+
super(message, {
|
|
125
|
+
code: 'AUTHENTICATION_ERROR',
|
|
126
|
+
statusCode: 401,
|
|
127
|
+
details: options.details,
|
|
128
|
+
requestId: options.requestId,
|
|
129
|
+
});
|
|
130
|
+
this.name = 'AuthenticationError';
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
exports.AuthenticationError = AuthenticationError;
|
|
134
|
+
/**
|
|
135
|
+
* Error thrown when authorization fails (403)
|
|
136
|
+
*/
|
|
137
|
+
class AuthorizationError extends ChanlError {
|
|
138
|
+
constructor(message = 'Permission denied', options = {}) {
|
|
139
|
+
const details = {
|
|
140
|
+
...options.details,
|
|
141
|
+
};
|
|
142
|
+
if (options.action !== undefined) {
|
|
143
|
+
details['action'] = options.action;
|
|
144
|
+
}
|
|
145
|
+
if (options.resource !== undefined) {
|
|
146
|
+
details['resource'] = options.resource;
|
|
147
|
+
}
|
|
148
|
+
super(message, {
|
|
149
|
+
code: 'AUTHORIZATION_ERROR',
|
|
150
|
+
statusCode: 403,
|
|
151
|
+
details,
|
|
152
|
+
requestId: options.requestId,
|
|
153
|
+
});
|
|
154
|
+
this.name = 'AuthorizationError';
|
|
155
|
+
if (options.action !== undefined) {
|
|
156
|
+
this.action = options.action;
|
|
157
|
+
}
|
|
158
|
+
if (options.resource !== undefined) {
|
|
159
|
+
this.resource = options.resource;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
exports.AuthorizationError = AuthorizationError;
|
|
164
|
+
/**
|
|
165
|
+
* Error thrown when there's a conflict (409)
|
|
166
|
+
*/
|
|
167
|
+
class ConflictError extends ChanlError {
|
|
168
|
+
constructor(message, options = {}) {
|
|
169
|
+
const details = {
|
|
170
|
+
...options.details,
|
|
171
|
+
};
|
|
172
|
+
if (options.conflictingResource !== undefined) {
|
|
173
|
+
details['conflictingResource'] = options.conflictingResource;
|
|
174
|
+
}
|
|
175
|
+
super(message, {
|
|
176
|
+
code: 'CONFLICT_ERROR',
|
|
177
|
+
statusCode: 409,
|
|
178
|
+
details,
|
|
179
|
+
requestId: options.requestId,
|
|
180
|
+
});
|
|
181
|
+
this.name = 'ConflictError';
|
|
182
|
+
if (options.conflictingResource !== undefined) {
|
|
183
|
+
this.conflictingResource = options.conflictingResource;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.ConflictError = ConflictError;
|
|
188
|
+
/**
|
|
189
|
+
* Error thrown when rate limit is exceeded (429)
|
|
190
|
+
*/
|
|
191
|
+
class RateLimitError extends ChanlError {
|
|
192
|
+
constructor(message = 'Rate limit exceeded', options = {}) {
|
|
193
|
+
const details = {
|
|
194
|
+
...options.details,
|
|
195
|
+
};
|
|
196
|
+
if (options.retryAfter !== undefined) {
|
|
197
|
+
details['retryAfter'] = options.retryAfter;
|
|
198
|
+
}
|
|
199
|
+
super(message, {
|
|
200
|
+
code: 'RATE_LIMIT_ERROR',
|
|
201
|
+
statusCode: 429,
|
|
202
|
+
details,
|
|
203
|
+
requestId: options.requestId,
|
|
204
|
+
});
|
|
205
|
+
this.name = 'RateLimitError';
|
|
206
|
+
if (options.retryAfter !== undefined) {
|
|
207
|
+
this.retryAfter = options.retryAfter;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
exports.RateLimitError = RateLimitError;
|
|
212
|
+
/**
|
|
213
|
+
* Error thrown when API server fails (5xx)
|
|
214
|
+
*/
|
|
215
|
+
class ServerError extends ChanlError {
|
|
216
|
+
constructor(message = 'Internal server error', options = {}) {
|
|
217
|
+
super(message, {
|
|
218
|
+
code: 'SERVER_ERROR',
|
|
219
|
+
statusCode: options.statusCode ?? 500,
|
|
220
|
+
details: options.details,
|
|
221
|
+
requestId: options.requestId,
|
|
222
|
+
});
|
|
223
|
+
this.name = 'ServerError';
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
exports.ServerError = ServerError;
|
|
227
|
+
/**
|
|
228
|
+
* Error thrown for network/connection issues
|
|
229
|
+
*/
|
|
230
|
+
class NetworkError extends ChanlError {
|
|
231
|
+
constructor(message = 'Network error', options = {}) {
|
|
232
|
+
super(message, {
|
|
233
|
+
code: 'NETWORK_ERROR',
|
|
234
|
+
cause: options.cause,
|
|
235
|
+
details: options.details,
|
|
236
|
+
});
|
|
237
|
+
this.name = 'NetworkError';
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
exports.NetworkError = NetworkError;
|
|
241
|
+
/**
|
|
242
|
+
* Error thrown when request times out
|
|
243
|
+
*/
|
|
244
|
+
class TimeoutError extends ChanlError {
|
|
245
|
+
constructor(message = 'Request timeout', options = {}) {
|
|
246
|
+
const details = {
|
|
247
|
+
...options.details,
|
|
248
|
+
};
|
|
249
|
+
if (options.timeoutMs !== undefined) {
|
|
250
|
+
details['timeoutMs'] = options.timeoutMs;
|
|
251
|
+
}
|
|
252
|
+
super(message, {
|
|
253
|
+
code: 'TIMEOUT_ERROR',
|
|
254
|
+
details,
|
|
255
|
+
requestId: options.requestId,
|
|
256
|
+
});
|
|
257
|
+
this.name = 'TimeoutError';
|
|
258
|
+
if (options.timeoutMs !== undefined) {
|
|
259
|
+
this.timeoutMs = options.timeoutMs;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
exports.TimeoutError = TimeoutError;
|
|
264
|
+
/**
|
|
265
|
+
* Type guard to check if error is a ChanlError
|
|
266
|
+
*/
|
|
267
|
+
function isChanlError(error) {
|
|
268
|
+
return error instanceof ChanlError;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Type guard to check if error is a NotFoundError
|
|
272
|
+
*/
|
|
273
|
+
function isNotFoundError(error) {
|
|
274
|
+
return error instanceof NotFoundError;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Type guard to check if error is a ValidationError
|
|
278
|
+
*/
|
|
279
|
+
function isValidationError(error) {
|
|
280
|
+
return error instanceof ValidationError;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Type guard to check if error is an AuthenticationError
|
|
284
|
+
*/
|
|
285
|
+
function isAuthenticationError(error) {
|
|
286
|
+
return error instanceof AuthenticationError;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Factory function to create appropriate error from API response
|
|
290
|
+
*/
|
|
291
|
+
function createErrorFromResponse(statusCode, message, options = {}) {
|
|
292
|
+
switch (statusCode) {
|
|
293
|
+
case 400:
|
|
294
|
+
return new ValidationError(message, options);
|
|
295
|
+
case 401:
|
|
296
|
+
return new AuthenticationError(message, options);
|
|
297
|
+
case 403:
|
|
298
|
+
return new AuthorizationError(message, options);
|
|
299
|
+
case 404:
|
|
300
|
+
// For 404, we need resourceType and resourceId which aren't in options
|
|
301
|
+
// Return a generic ChanlError instead
|
|
302
|
+
return new ChanlError(message, {
|
|
303
|
+
code: 'NOT_FOUND',
|
|
304
|
+
statusCode: 404,
|
|
305
|
+
details: options.details,
|
|
306
|
+
requestId: options.requestId,
|
|
307
|
+
});
|
|
308
|
+
case 409:
|
|
309
|
+
return new ConflictError(message, options);
|
|
310
|
+
case 429:
|
|
311
|
+
return new RateLimitError(message, options);
|
|
312
|
+
default:
|
|
313
|
+
if (statusCode >= 500) {
|
|
314
|
+
return new ServerError(message, { statusCode, ...options });
|
|
315
|
+
}
|
|
316
|
+
return new ChanlError(message, { statusCode, ...options });
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAgXH,oCAEC;AAKD,0CAEC;AAKD,8CAEC;AAKD,sDAIC;AAKD,0DAmCC;AAnaD;;GAEG;AACH,MAAa,UAAW,SAAQ,KAAK;IAYnC,YAAY,OAAe,EAAE,UAA6B,EAAE;QAC1D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,aAAa,CAAC;QAE1C,4EAA4E;QAC5E,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACrC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACvC,CAAC;QACD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QACjC,CAAC;QACD,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAChC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC7B,CAAC;QACD,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACrC,CA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AAC,CAAC;QAC/C,KAAK,GAAG;YACN,OAAO,IAAI,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACnD,KAAK,GAAG;YACN,OAAO,IAAI,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,KAAK,GAAG;YACN,uEAAuE;YACvE,sCAAsC;YACtC,OAAO,IAAI,UAAU,CAAC,OAAO,EAAE;gBAC7B,IAAI,EAAE,WAAW;gBACjB,UAAU,EAAE,GAAG;gBACf,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,SAAS,EAAE,OAAO,CAAC,SAAS;aAC7B,CAAC,CAAC;QACL,KAAK,GAAG;YACN,OAAO,IAAI,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7C,KAAK,GAAG;YACN,OAAO,IAAI,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9C;YACE,IAAI,UAAU,IAAI,GAAG,EAAE,CAAC;gBACtB,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;YAC9D,CAAC;YACD,OAAO,IAAI,UAAU,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export { ChanlSDK } from './client';
|
|
2
|
+
export { ChanlConfig, ChanlAuthConfig } from './types/config';
|
|
3
|
+
export { AudioModule } from './modules/audio';
|
|
4
|
+
export { TranscriptModule } from './modules/transcript';
|
|
5
|
+
export { ScorecardModule } from './modules/scorecard';
|
|
6
|
+
export { WorkspaceModule } from './modules/workspace';
|
|
7
|
+
export { AlertModule } from './modules/alerts';
|
|
8
|
+
export { AuthModule } from './modules/auth';
|
|
9
|
+
export { HealthModule } from './modules/health';
|
|
10
|
+
export { PromptsModule } from './modules/prompts';
|
|
11
|
+
export { ToolsModule } from './modules/tools';
|
|
12
|
+
export { ToolsetsModule } from './modules/toolsets';
|
|
13
|
+
export { ScenariosModule } from './modules/scenarios';
|
|
14
|
+
export { AgentsModule } from './modules/agents';
|
|
15
|
+
export { PersonasModule } from './modules/personas';
|
|
16
|
+
export { CallsModule } from './modules/calls';
|
|
17
|
+
export { McpModule } from './modules/mcp';
|
|
18
|
+
export { KnowledgeModule } from './modules/knowledge';
|
|
19
|
+
export { MemoryModule } from './modules/memory';
|
|
20
|
+
export { ChatModule } from './modules/chat';
|
|
21
|
+
export * from './types/api';
|
|
22
|
+
export * from './modules/prompts';
|
|
23
|
+
export * from './modules/scenarios';
|
|
24
|
+
export * from './modules/calls';
|
|
25
|
+
export * from './modules/personas';
|
|
26
|
+
export * from './modules/agents';
|
|
27
|
+
export * from './modules/scorecard';
|
|
28
|
+
export * from './types/tools';
|
|
29
|
+
export * from './types/tool-calls';
|
|
30
|
+
export * from './types/toolsets';
|
|
31
|
+
export * from './modules/mcp';
|
|
32
|
+
export * from './modules/knowledge';
|
|
33
|
+
export * from './types/memory';
|
|
34
|
+
export * from './modules/chat';
|
|
35
|
+
export * from './live';
|
|
36
|
+
export * from './errors';
|
|
37
|
+
export * from './adapters/openai';
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,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(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
|
+
exports.ChatModule = exports.MemoryModule = exports.KnowledgeModule = exports.McpModule = exports.CallsModule = exports.PersonasModule = exports.AgentsModule = exports.ScenariosModule = exports.ToolsetsModule = exports.ToolsModule = exports.PromptsModule = exports.HealthModule = exports.AuthModule = exports.AlertModule = exports.WorkspaceModule = exports.ScorecardModule = exports.TranscriptModule = exports.AudioModule = exports.ChanlSDK = void 0;
|
|
18
|
+
var client_1 = require("./client");
|
|
19
|
+
Object.defineProperty(exports, "ChanlSDK", { enumerable: true, get: function () { return client_1.ChanlSDK; } });
|
|
20
|
+
var audio_1 = require("./modules/audio");
|
|
21
|
+
Object.defineProperty(exports, "AudioModule", { enumerable: true, get: function () { return audio_1.AudioModule; } });
|
|
22
|
+
var transcript_1 = require("./modules/transcript");
|
|
23
|
+
Object.defineProperty(exports, "TranscriptModule", { enumerable: true, get: function () { return transcript_1.TranscriptModule; } });
|
|
24
|
+
var scorecard_1 = require("./modules/scorecard");
|
|
25
|
+
Object.defineProperty(exports, "ScorecardModule", { enumerable: true, get: function () { return scorecard_1.ScorecardModule; } });
|
|
26
|
+
var workspace_1 = require("./modules/workspace");
|
|
27
|
+
Object.defineProperty(exports, "WorkspaceModule", { enumerable: true, get: function () { return workspace_1.WorkspaceModule; } });
|
|
28
|
+
var alerts_1 = require("./modules/alerts");
|
|
29
|
+
Object.defineProperty(exports, "AlertModule", { enumerable: true, get: function () { return alerts_1.AlertModule; } });
|
|
30
|
+
var auth_1 = require("./modules/auth");
|
|
31
|
+
Object.defineProperty(exports, "AuthModule", { enumerable: true, get: function () { return auth_1.AuthModule; } });
|
|
32
|
+
var health_1 = require("./modules/health");
|
|
33
|
+
Object.defineProperty(exports, "HealthModule", { enumerable: true, get: function () { return health_1.HealthModule; } });
|
|
34
|
+
var prompts_1 = require("./modules/prompts");
|
|
35
|
+
Object.defineProperty(exports, "PromptsModule", { enumerable: true, get: function () { return prompts_1.PromptsModule; } });
|
|
36
|
+
var tools_1 = require("./modules/tools");
|
|
37
|
+
Object.defineProperty(exports, "ToolsModule", { enumerable: true, get: function () { return tools_1.ToolsModule; } });
|
|
38
|
+
var toolsets_1 = require("./modules/toolsets");
|
|
39
|
+
Object.defineProperty(exports, "ToolsetsModule", { enumerable: true, get: function () { return toolsets_1.ToolsetsModule; } });
|
|
40
|
+
var scenarios_1 = require("./modules/scenarios");
|
|
41
|
+
Object.defineProperty(exports, "ScenariosModule", { enumerable: true, get: function () { return scenarios_1.ScenariosModule; } });
|
|
42
|
+
var agents_1 = require("./modules/agents");
|
|
43
|
+
Object.defineProperty(exports, "AgentsModule", { enumerable: true, get: function () { return agents_1.AgentsModule; } });
|
|
44
|
+
var personas_1 = require("./modules/personas");
|
|
45
|
+
Object.defineProperty(exports, "PersonasModule", { enumerable: true, get: function () { return personas_1.PersonasModule; } });
|
|
46
|
+
var calls_1 = require("./modules/calls");
|
|
47
|
+
Object.defineProperty(exports, "CallsModule", { enumerable: true, get: function () { return calls_1.CallsModule; } });
|
|
48
|
+
var mcp_1 = require("./modules/mcp");
|
|
49
|
+
Object.defineProperty(exports, "McpModule", { enumerable: true, get: function () { return mcp_1.McpModule; } });
|
|
50
|
+
var knowledge_1 = require("./modules/knowledge");
|
|
51
|
+
Object.defineProperty(exports, "KnowledgeModule", { enumerable: true, get: function () { return knowledge_1.KnowledgeModule; } });
|
|
52
|
+
var memory_1 = require("./modules/memory");
|
|
53
|
+
Object.defineProperty(exports, "MemoryModule", { enumerable: true, get: function () { return memory_1.MemoryModule; } });
|
|
54
|
+
var chat_1 = require("./modules/chat");
|
|
55
|
+
Object.defineProperty(exports, "ChatModule", { enumerable: true, get: function () { return chat_1.ChatModule; } });
|
|
56
|
+
// Re-export all types from modules
|
|
57
|
+
__exportStar(require("./types/api"), exports);
|
|
58
|
+
__exportStar(require("./modules/prompts"), exports);
|
|
59
|
+
__exportStar(require("./modules/scenarios"), exports);
|
|
60
|
+
__exportStar(require("./modules/calls"), exports);
|
|
61
|
+
__exportStar(require("./modules/personas"), exports);
|
|
62
|
+
__exportStar(require("./modules/agents"), exports);
|
|
63
|
+
__exportStar(require("./modules/scorecard"), exports); // Export tool types
|
|
64
|
+
__exportStar(require("./types/tools"), exports);
|
|
65
|
+
// Export tool call types (shared across chat, scenarios, calls)
|
|
66
|
+
__exportStar(require("./types/tool-calls"), exports);
|
|
67
|
+
// Export toolset types
|
|
68
|
+
__exportStar(require("./types/toolsets"), exports); // Export MCP types
|
|
69
|
+
__exportStar(require("./modules/mcp"), exports); // Export Knowledge types
|
|
70
|
+
__exportStar(require("./modules/knowledge"), exports); // Export Memory types
|
|
71
|
+
__exportStar(require("./types/memory"), exports); // Export Chat types
|
|
72
|
+
__exportStar(require("./modules/chat"), exports); // Export live monitoring classes
|
|
73
|
+
__exportStar(require("./live"), exports); // Export error classes
|
|
74
|
+
__exportStar(require("./errors"), exports); // Export OpenAI adapter
|
|
75
|
+
__exportStar(require("./adapters/openai"), exports);
|
|
76
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"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-0,0 +1,9 @@
|
|
|
1
|
+
export { TypedEventEmitter } from './typed-emitter';
|
|
2
|
+
export type { LiveOptions } from './types';
|
|
3
|
+
export { LiveCall } from './live-call';
|
|
4
|
+
export type { LiveCallEvents } from './live-call';
|
|
5
|
+
export { LiveExecution } from './live-execution';
|
|
6
|
+
export type { LiveExecutionEvents, ExecutionStepEvent } from './live-execution';
|
|
7
|
+
export { LiveChat } from './live-chat';
|
|
8
|
+
export type { LiveChatEvents, LiveChatSendOptions } from './live-chat';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/live/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGpD,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGhF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LiveChat = exports.LiveExecution = exports.LiveCall = exports.TypedEventEmitter = void 0;
|
|
4
|
+
// Base
|
|
5
|
+
var typed_emitter_1 = require("./typed-emitter");
|
|
6
|
+
Object.defineProperty(exports, "TypedEventEmitter", { enumerable: true, get: function () { return typed_emitter_1.TypedEventEmitter; } });
|
|
7
|
+
// LiveCall
|
|
8
|
+
var live_call_1 = require("./live-call");
|
|
9
|
+
Object.defineProperty(exports, "LiveCall", { enumerable: true, get: function () { return live_call_1.LiveCall; } });
|
|
10
|
+
// LiveExecution
|
|
11
|
+
var live_execution_1 = require("./live-execution");
|
|
12
|
+
Object.defineProperty(exports, "LiveExecution", { enumerable: true, get: function () { return live_execution_1.LiveExecution; } });
|
|
13
|
+
// LiveChat
|
|
14
|
+
var live_chat_1 = require("./live-chat");
|
|
15
|
+
Object.defineProperty(exports, "LiveChat", { enumerable: true, get: function () { return live_chat_1.LiveChat; } });
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/live/index.ts"],"names":[],"mappings":";;;AAAA,OAAO;AACP,iDAAoD;AAA3C,kHAAA,iBAAiB,OAAA;AAK1B,WAAW;AACX,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AAGjB,gBAAgB;AAChB,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AAGtB,WAAW;AACX,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { TypedEventEmitter } from './typed-emitter';
|
|
2
|
+
import type { TranscriptSegment, LiveOptions } from './types';
|
|
3
|
+
import type { ChanlSDK } from '../client';
|
|
4
|
+
import type { Call, CallScorecardResult } from '../modules/calls';
|
|
5
|
+
export type LiveCallEvents = {
|
|
6
|
+
'status': (status: string, call: Call) => void;
|
|
7
|
+
'transcript': (segment: TranscriptSegment) => void;
|
|
8
|
+
'ended': (summary: {
|
|
9
|
+
status: string;
|
|
10
|
+
duration: number;
|
|
11
|
+
}) => void;
|
|
12
|
+
'scorecard': (results: CallScorecardResult[]) => void;
|
|
13
|
+
'error': (error: Error) => void;
|
|
14
|
+
'timeout': () => void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Live voice call monitor.
|
|
18
|
+
*
|
|
19
|
+
* Polls call status and transcript, emitting typed events as data arrives.
|
|
20
|
+
* Automatically fetches scorecard results when the call reaches a terminal state.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const live = await sdk.calls.start(wsId, { agentId, phone });
|
|
25
|
+
* live.on('status', (s) => console.log('Status:', s));
|
|
26
|
+
* live.on('transcript', (seg) => console.log(`${seg.speaker}: ${seg.text}`));
|
|
27
|
+
* live.on('ended', (sum) => console.log(`Done: ${sum.status}`));
|
|
28
|
+
* live.on('scorecard', (r) => console.log('Score:', r[0]?.overallScore));
|
|
29
|
+
* await live.completed;
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class LiveCall extends TypedEventEmitter<LiveCallEvents> {
|
|
33
|
+
private sdk;
|
|
34
|
+
readonly callId: string;
|
|
35
|
+
/** Resolves when monitoring ends (terminal status, timeout, or stop). */
|
|
36
|
+
readonly completed: Promise<void>;
|
|
37
|
+
private _resolveCompleted;
|
|
38
|
+
private abortController;
|
|
39
|
+
private pollInterval;
|
|
40
|
+
private maxPolls;
|
|
41
|
+
constructor(sdk: ChanlSDK, callId: string, options?: LiveOptions);
|
|
42
|
+
/** Stop monitoring. The call itself continues in the background. */
|
|
43
|
+
stop(): void;
|
|
44
|
+
private poll;
|
|
45
|
+
private fetchScorecard;
|
|
46
|
+
private sleep;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=live-call.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-call.d.ts","sourceRoot":"","sources":["../../src/live/live-call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC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