@chanl-ai/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.
Files changed (137) hide show
  1. package/dist/adapters/openai.d.ts +106 -0
  2. package/dist/adapters/openai.d.ts.map +1 -0
  3. package/dist/adapters/openai.js +185 -0
  4. package/dist/adapters/openai.js.map +1 -0
  5. package/dist/client.d.ts +74 -0
  6. package/dist/client.d.ts.map +1 -0
  7. package/dist/client.js +293 -0
  8. package/dist/client.js.map +1 -0
  9. package/dist/errors/index.d.ts +179 -0
  10. package/dist/errors/index.d.ts.map +1 -0
  11. package/dist/errors/index.js +319 -0
  12. package/dist/errors/index.js.map +1 -0
  13. package/dist/index.d.ts +38 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +76 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/live/index.d.ts +9 -0
  18. package/dist/live/index.d.ts.map +1 -0
  19. package/dist/live/index.js +16 -0
  20. package/dist/live/index.js.map +1 -0
  21. package/dist/live/live-call.d.ts +48 -0
  22. package/dist/live/live-call.d.ts.map +1 -0
  23. package/dist/live/live-call.js +148 -0
  24. package/dist/live/live-call.js.map +1 -0
  25. package/dist/live/live-chat.d.ts +71 -0
  26. package/dist/live/live-chat.d.ts.map +1 -0
  27. package/dist/live/live-chat.js +95 -0
  28. package/dist/live/live-chat.js.map +1 -0
  29. package/dist/live/live-execution.d.ts +55 -0
  30. package/dist/live/live-execution.d.ts.map +1 -0
  31. package/dist/live/live-execution.js +170 -0
  32. package/dist/live/live-execution.js.map +1 -0
  33. package/dist/live/typed-emitter.d.ts +15 -0
  34. package/dist/live/typed-emitter.d.ts.map +1 -0
  35. package/dist/live/typed-emitter.js +40 -0
  36. package/dist/live/typed-emitter.js.map +1 -0
  37. package/dist/live/types.d.ts +24 -0
  38. package/dist/live/types.d.ts.map +1 -0
  39. package/dist/live/types.js +6 -0
  40. package/dist/live/types.js.map +1 -0
  41. package/dist/modules/agents.d.ts +378 -0
  42. package/dist/modules/agents.d.ts.map +1 -0
  43. package/dist/modules/agents.js +259 -0
  44. package/dist/modules/agents.js.map +1 -0
  45. package/dist/modules/alerts.d.ts +43 -0
  46. package/dist/modules/alerts.d.ts.map +1 -0
  47. package/dist/modules/alerts.js +56 -0
  48. package/dist/modules/alerts.js.map +1 -0
  49. package/dist/modules/audio.d.ts +47 -0
  50. package/dist/modules/audio.d.ts.map +1 -0
  51. package/dist/modules/audio.js +75 -0
  52. package/dist/modules/audio.js.map +1 -0
  53. package/dist/modules/auth.d.ts +76 -0
  54. package/dist/modules/auth.d.ts.map +1 -0
  55. package/dist/modules/auth.js +59 -0
  56. package/dist/modules/auth.js.map +1 -0
  57. package/dist/modules/calls.d.ts +825 -0
  58. package/dist/modules/calls.d.ts.map +1 -0
  59. package/dist/modules/calls.js +398 -0
  60. package/dist/modules/calls.js.map +1 -0
  61. package/dist/modules/chat.d.ts +165 -0
  62. package/dist/modules/chat.d.ts.map +1 -0
  63. package/dist/modules/chat.js +169 -0
  64. package/dist/modules/chat.js.map +1 -0
  65. package/dist/modules/health.d.ts +45 -0
  66. package/dist/modules/health.d.ts.map +1 -0
  67. package/dist/modules/health.js +22 -0
  68. package/dist/modules/health.js.map +1 -0
  69. package/dist/modules/knowledge.d.ts +202 -0
  70. package/dist/modules/knowledge.d.ts.map +1 -0
  71. package/dist/modules/knowledge.js +147 -0
  72. package/dist/modules/knowledge.js.map +1 -0
  73. package/dist/modules/mcp.d.ts +140 -0
  74. package/dist/modules/mcp.d.ts.map +1 -0
  75. package/dist/modules/mcp.js +110 -0
  76. package/dist/modules/mcp.js.map +1 -0
  77. package/dist/modules/memory.d.ts +163 -0
  78. package/dist/modules/memory.d.ts.map +1 -0
  79. package/dist/modules/memory.js +208 -0
  80. package/dist/modules/memory.js.map +1 -0
  81. package/dist/modules/personas.d.ts +168 -0
  82. package/dist/modules/personas.d.ts.map +1 -0
  83. package/dist/modules/personas.js +106 -0
  84. package/dist/modules/personas.js.map +1 -0
  85. package/dist/modules/prompts.d.ts +128 -0
  86. package/dist/modules/prompts.d.ts.map +1 -0
  87. package/dist/modules/prompts.js +93 -0
  88. package/dist/modules/prompts.js.map +1 -0
  89. package/dist/modules/scenarios.d.ts +294 -0
  90. package/dist/modules/scenarios.d.ts.map +1 -0
  91. package/dist/modules/scenarios.js +349 -0
  92. package/dist/modules/scenarios.js.map +1 -0
  93. package/dist/modules/scorecard.d.ts +642 -0
  94. package/dist/modules/scorecard.d.ts.map +1 -0
  95. package/dist/modules/scorecard.js +327 -0
  96. package/dist/modules/scorecard.js.map +1 -0
  97. package/dist/modules/tools.d.ts +222 -0
  98. package/dist/modules/tools.d.ts.map +1 -0
  99. package/dist/modules/tools.js +302 -0
  100. package/dist/modules/tools.js.map +1 -0
  101. package/dist/modules/toolsets.d.ts +173 -0
  102. package/dist/modules/toolsets.d.ts.map +1 -0
  103. package/dist/modules/toolsets.js +216 -0
  104. package/dist/modules/toolsets.js.map +1 -0
  105. package/dist/modules/transcript.d.ts +60 -0
  106. package/dist/modules/transcript.d.ts.map +1 -0
  107. package/dist/modules/transcript.js +69 -0
  108. package/dist/modules/transcript.js.map +1 -0
  109. package/dist/modules/workspace.d.ts +48 -0
  110. package/dist/modules/workspace.d.ts.map +1 -0
  111. package/dist/modules/workspace.js +49 -0
  112. package/dist/modules/workspace.js.map +1 -0
  113. package/dist/types/api.d.ts +8 -0
  114. package/dist/types/api.d.ts.map +1 -0
  115. package/dist/types/api.js +25 -0
  116. package/dist/types/api.js.map +1 -0
  117. package/dist/types/config.d.ts +70 -0
  118. package/dist/types/config.d.ts.map +1 -0
  119. package/dist/types/config.js +3 -0
  120. package/dist/types/config.js.map +1 -0
  121. package/dist/types/memory.d.ts +243 -0
  122. package/dist/types/memory.d.ts.map +1 -0
  123. package/dist/types/memory.js +9 -0
  124. package/dist/types/memory.js.map +1 -0
  125. package/dist/types/tool-calls.d.ts +61 -0
  126. package/dist/types/tool-calls.d.ts.map +1 -0
  127. package/dist/types/tool-calls.js +9 -0
  128. package/dist/types/tool-calls.js.map +1 -0
  129. package/dist/types/tools.d.ts +321 -0
  130. package/dist/types/tools.d.ts.map +1 -0
  131. package/dist/types/tools.js +9 -0
  132. package/dist/types/tools.js.map +1 -0
  133. package/dist/types/toolsets.d.ts +149 -0
  134. package/dist/types/toolsets.d.ts.map +1 -0
  135. package/dist/types/toolsets.js +8 -0
  136. package/dist/types/toolsets.js.map +1 -0
  137. package/package.json +60 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AACA,2CAA8C;AAC9C,qDAAwD;AACxD,mDAAsD;AACtD,mDAAsD;AACtD,6CAA+C;AAC/C,yCAA4C;AAC5C,6CAAgD;AAChD,+CAAkD;AAClD,2CAA8C;AAC9C,iDAAoD;AACpD,mDAAsD;AACtD,6CAAgD;AAChD,iDAAoD;AACpD,2CAA8C;AAC9C,uCAA0C;AAC1C,mDAAsD;AACtD,6CAAgD;AAChD,yCAA4C;AAE5C,MAAa,QAAQ;IAuBnB,YAAY,MAAmB;QAC7B,IAAI,CAAC,MAAM,GAAG;YACZ,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE;gBACL,UAAU,EAAE,CAAC;gBACb,UAAU,EAAE,IAAI;gBAChB,iBAAiB,EAAE,CAAC;aACrB;YACD,GAAG,MAAM;SACV,CAAC;QAEF,qBAAqB;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,mBAAW,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,IAAI,6BAAgB,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,SAAS,GAAG,IAAI,2BAAe,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,IAAI,2BAAe,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,GAAG,IAAI,oBAAW,CAAC,IAAI,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AAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,OAAgB;QACvB,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC;IAC9B,CAAC;CACF;AA5UD,4BA4UC"}
@@ -0,0 +1,179 @@
1
+ /**
2
+ * Custom Error Classes for @chanl-ai/sdk
3
+ *
4
+ * TDD Phase: RED - These errors define the error handling contract
5
+ *
6
+ * Design Principles:
7
+ * - Error transparency: Include code, message, and context for debugging
8
+ * - HTTP status awareness: Map API response codes to specific error types
9
+ * - Serializable details: Allow JSON serialization for logging
10
+ */
11
+ /**
12
+ * Options type for ChanlError constructor
13
+ * Uses explicit `| undefined` to be compatible with exactOptionalPropertyTypes
14
+ */
15
+ interface ChanlErrorOptions {
16
+ code?: string | undefined;
17
+ statusCode?: number | undefined;
18
+ details?: Record<string, unknown> | undefined;
19
+ cause?: Error | undefined;
20
+ requestId?: string | undefined;
21
+ }
22
+ /**
23
+ * Base error class for all Chanl SDK errors
24
+ */
25
+ export declare class ChanlError extends Error {
26
+ /** Error code for programmatic handling */
27
+ readonly code: string;
28
+ /** HTTP status code if from API response */
29
+ readonly statusCode?: number;
30
+ /** Additional error details for debugging */
31
+ readonly details?: Record<string, unknown>;
32
+ /** Original error if wrapping another error */
33
+ readonly cause?: Error;
34
+ /** Request ID from API for tracing */
35
+ readonly requestId?: string;
36
+ constructor(message: string, options?: ChanlErrorOptions);
37
+ /**
38
+ * Convert error to JSON for logging/serialization
39
+ */
40
+ toJSON(): Record<string, unknown>;
41
+ }
42
+ /**
43
+ * Error thrown when a requested resource is not found (404)
44
+ */
45
+ export declare class NotFoundError extends ChanlError {
46
+ /** The type of resource that was not found */
47
+ readonly resourceType: string;
48
+ /** The identifier that was used to look up the resource */
49
+ readonly resourceId: string;
50
+ constructor(resourceType: string, resourceId: string, options?: {
51
+ details?: Record<string, unknown> | undefined;
52
+ requestId?: string | undefined;
53
+ });
54
+ }
55
+ /**
56
+ * Error thrown when input validation fails (400)
57
+ */
58
+ export declare class ValidationError extends ChanlError {
59
+ /** Field-level validation errors */
60
+ readonly fieldErrors?: Record<string, string[]>;
61
+ constructor(message: string, options?: {
62
+ fieldErrors?: Record<string, string[]> | undefined;
63
+ details?: Record<string, unknown> | undefined;
64
+ requestId?: string | undefined;
65
+ });
66
+ /**
67
+ * Get validation errors for a specific field
68
+ */
69
+ getFieldErrors(field: string): string[];
70
+ /**
71
+ * Check if a specific field has validation errors
72
+ */
73
+ hasFieldError(field: string): boolean;
74
+ }
75
+ /**
76
+ * Error thrown when authentication fails (401)
77
+ */
78
+ export declare class AuthenticationError extends ChanlError {
79
+ constructor(message?: string, options?: {
80
+ details?: Record<string, unknown> | undefined;
81
+ requestId?: string | undefined;
82
+ });
83
+ }
84
+ /**
85
+ * Error thrown when authorization fails (403)
86
+ */
87
+ export declare class AuthorizationError extends ChanlError {
88
+ /** The action that was attempted */
89
+ readonly action?: string;
90
+ /** The resource that was being accessed */
91
+ readonly resource?: string;
92
+ constructor(message?: string, options?: {
93
+ action?: string | undefined;
94
+ resource?: string | undefined;
95
+ details?: Record<string, unknown> | undefined;
96
+ requestId?: string | undefined;
97
+ });
98
+ }
99
+ /**
100
+ * Error thrown when there's a conflict (409)
101
+ */
102
+ export declare class ConflictError extends ChanlError {
103
+ /** The conflicting resource identifier */
104
+ readonly conflictingResource?: string;
105
+ constructor(message: string, options?: {
106
+ conflictingResource?: string | undefined;
107
+ details?: Record<string, unknown> | undefined;
108
+ requestId?: string | undefined;
109
+ });
110
+ }
111
+ /**
112
+ * Error thrown when rate limit is exceeded (429)
113
+ */
114
+ export declare class RateLimitError extends ChanlError {
115
+ /** When the rate limit resets (Unix timestamp) */
116
+ readonly retryAfter?: number;
117
+ constructor(message?: string, options?: {
118
+ retryAfter?: number | undefined;
119
+ details?: Record<string, unknown> | undefined;
120
+ requestId?: string | undefined;
121
+ });
122
+ }
123
+ /**
124
+ * Error thrown when API server fails (5xx)
125
+ */
126
+ export declare class ServerError extends ChanlError {
127
+ constructor(message?: string, options?: {
128
+ statusCode?: number | undefined;
129
+ details?: Record<string, unknown> | undefined;
130
+ requestId?: string | undefined;
131
+ });
132
+ }
133
+ /**
134
+ * Error thrown for network/connection issues
135
+ */
136
+ export declare class NetworkError extends ChanlError {
137
+ constructor(message?: string, options?: {
138
+ cause?: Error | undefined;
139
+ details?: Record<string, unknown> | undefined;
140
+ });
141
+ }
142
+ /**
143
+ * Error thrown when request times out
144
+ */
145
+ export declare class TimeoutError extends ChanlError {
146
+ /** Timeout duration in milliseconds */
147
+ readonly timeoutMs?: number;
148
+ constructor(message?: string, options?: {
149
+ timeoutMs?: number | undefined;
150
+ details?: Record<string, unknown> | undefined;
151
+ requestId?: string | undefined;
152
+ });
153
+ }
154
+ /**
155
+ * Type guard to check if error is a ChanlError
156
+ */
157
+ export declare function isChanlError(error: unknown): error is ChanlError;
158
+ /**
159
+ * Type guard to check if error is a NotFoundError
160
+ */
161
+ export declare function isNotFoundError(error: unknown): error is NotFoundError;
162
+ /**
163
+ * Type guard to check if error is a ValidationError
164
+ */
165
+ export declare function isValidationError(error: unknown): error is ValidationError;
166
+ /**
167
+ * Type guard to check if error is an AuthenticationError
168
+ */
169
+ export declare function isAuthenticationError(error: unknown): error is AuthenticationError;
170
+ /**
171
+ * Factory function to create appropriate error from API response
172
+ */
173
+ export declare function createErrorFromResponse(statusCode: number, message: string, options?: {
174
+ details?: Record<string, unknown> | undefined;
175
+ requestId?: string | undefined;
176
+ fieldErrors?: Record<string, string[]> | undefined;
177
+ }): ChanlError;
178
+ export {};
179
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;GAGG;AACH,UAAU,iBAAiB;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,GAA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SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAC3B;CAmBT;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE1E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,mBAAmB,CAE9B;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,CAAC;CAC/C,GACL,UAAU,CA2BZ"}
@@ -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
+ //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AO,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"}
@@ -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,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAG9B,cAAc,oBAAoB,CAAC;AAGnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,76 @@
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
+ 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","sour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