@zavudev/sdk 0.17.0 → 0.18.0

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 (185) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client.d.mts +11 -5
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +11 -5
  5. package/client.d.ts.map +1 -1
  6. package/client.js +7 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +7 -1
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/addresses.d.mts +104 -0
  12. package/resources/addresses.d.mts.map +1 -0
  13. package/resources/addresses.d.ts +104 -0
  14. package/resources/addresses.d.ts.map +1 -0
  15. package/resources/addresses.js +72 -0
  16. package/resources/addresses.js.map +1 -0
  17. package/resources/addresses.mjs +68 -0
  18. package/resources/addresses.mjs.map +1 -0
  19. package/resources/broadcasts/broadcasts.d.mts +23 -1
  20. package/resources/broadcasts/broadcasts.d.mts.map +1 -1
  21. package/resources/broadcasts/broadcasts.d.ts +23 -1
  22. package/resources/broadcasts/broadcasts.d.ts.map +1 -1
  23. package/resources/broadcasts/broadcasts.js +15 -0
  24. package/resources/broadcasts/broadcasts.js.map +1 -1
  25. package/resources/broadcasts/broadcasts.mjs +15 -0
  26. package/resources/broadcasts/broadcasts.mjs.map +1 -1
  27. package/resources/broadcasts/index.d.mts +1 -1
  28. package/resources/broadcasts/index.d.mts.map +1 -1
  29. package/resources/broadcasts/index.d.ts +1 -1
  30. package/resources/broadcasts/index.d.ts.map +1 -1
  31. package/resources/broadcasts/index.js.map +1 -1
  32. package/resources/broadcasts/index.mjs.map +1 -1
  33. package/resources/index.d.mts +5 -3
  34. package/resources/index.d.mts.map +1 -1
  35. package/resources/index.d.ts +5 -3
  36. package/resources/index.d.ts.map +1 -1
  37. package/resources/index.js +6 -2
  38. package/resources/index.js.map +1 -1
  39. package/resources/index.mjs +3 -1
  40. package/resources/index.mjs.map +1 -1
  41. package/resources/phone-numbers.d.mts +67 -1
  42. package/resources/phone-numbers.d.mts.map +1 -1
  43. package/resources/phone-numbers.d.ts +67 -1
  44. package/resources/phone-numbers.d.ts.map +1 -1
  45. package/resources/phone-numbers.js +15 -0
  46. package/resources/phone-numbers.js.map +1 -1
  47. package/resources/phone-numbers.mjs +15 -0
  48. package/resources/phone-numbers.mjs.map +1 -1
  49. package/resources/regulatory-documents.d.mts +114 -0
  50. package/resources/regulatory-documents.d.mts.map +1 -0
  51. package/resources/regulatory-documents.d.ts +114 -0
  52. package/resources/regulatory-documents.d.ts.map +1 -0
  53. package/resources/regulatory-documents.js +84 -0
  54. package/resources/regulatory-documents.js.map +1 -0
  55. package/resources/regulatory-documents.mjs +80 -0
  56. package/resources/regulatory-documents.mjs.map +1 -0
  57. package/resources/senders/agent/agent.d.mts +230 -0
  58. package/resources/senders/agent/agent.d.mts.map +1 -0
  59. package/resources/senders/agent/agent.d.ts +230 -0
  60. package/resources/senders/agent/agent.d.ts.map +1 -0
  61. package/resources/senders/agent/agent.js +105 -0
  62. package/resources/senders/agent/agent.js.map +1 -0
  63. package/resources/senders/agent/agent.mjs +100 -0
  64. package/resources/senders/agent/agent.mjs.map +1 -0
  65. package/resources/senders/agent/executions.d.mts +32 -0
  66. package/resources/senders/agent/executions.d.mts.map +1 -0
  67. package/resources/senders/agent/executions.d.ts +32 -0
  68. package/resources/senders/agent/executions.d.ts.map +1 -0
  69. package/resources/senders/agent/executions.js +27 -0
  70. package/resources/senders/agent/executions.js.map +1 -0
  71. package/resources/senders/agent/executions.mjs +23 -0
  72. package/resources/senders/agent/executions.mjs.map +1 -0
  73. package/resources/senders/agent/flows.d.mts +301 -0
  74. package/resources/senders/agent/flows.d.mts.map +1 -0
  75. package/resources/senders/agent/flows.d.ts +301 -0
  76. package/resources/senders/agent/flows.d.ts.map +1 -0
  77. package/resources/senders/agent/flows.js +135 -0
  78. package/resources/senders/agent/flows.js.map +1 -0
  79. package/resources/senders/agent/flows.mjs +131 -0
  80. package/resources/senders/agent/flows.mjs.map +1 -0
  81. package/resources/senders/agent/index.d.mts +6 -0
  82. package/resources/senders/agent/index.d.mts.map +1 -0
  83. package/resources/senders/agent/index.d.ts +6 -0
  84. package/resources/senders/agent/index.d.ts.map +1 -0
  85. package/resources/senders/agent/index.js +15 -0
  86. package/resources/senders/agent/index.js.map +1 -0
  87. package/resources/senders/agent/index.mjs +7 -0
  88. package/resources/senders/agent/index.mjs.map +1 -0
  89. package/resources/senders/agent/knowledge-bases/documents.d.mts +86 -0
  90. package/resources/senders/agent/knowledge-bases/documents.d.mts.map +1 -0
  91. package/resources/senders/agent/knowledge-bases/documents.d.ts +86 -0
  92. package/resources/senders/agent/knowledge-bases/documents.d.ts.map +1 -0
  93. package/resources/senders/agent/knowledge-bases/documents.js +70 -0
  94. package/resources/senders/agent/knowledge-bases/documents.js.map +1 -0
  95. package/resources/senders/agent/knowledge-bases/documents.mjs +66 -0
  96. package/resources/senders/agent/knowledge-bases/documents.mjs.map +1 -0
  97. package/resources/senders/agent/knowledge-bases/index.d.mts +3 -0
  98. package/resources/senders/agent/knowledge-bases/index.d.mts.map +1 -0
  99. package/resources/senders/agent/knowledge-bases/index.d.ts +3 -0
  100. package/resources/senders/agent/knowledge-bases/index.d.ts.map +1 -0
  101. package/resources/senders/agent/knowledge-bases/index.js +9 -0
  102. package/resources/senders/agent/knowledge-bases/index.js.map +1 -0
  103. package/resources/senders/agent/knowledge-bases/index.mjs +4 -0
  104. package/resources/senders/agent/knowledge-bases/index.mjs.map +1 -0
  105. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts +147 -0
  106. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts.map +1 -0
  107. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts +147 -0
  108. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts.map +1 -0
  109. package/resources/senders/agent/knowledge-bases/knowledge-bases.js +106 -0
  110. package/resources/senders/agent/knowledge-bases/knowledge-bases.js.map +1 -0
  111. package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs +101 -0
  112. package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs.map +1 -0
  113. package/resources/senders/agent/knowledge-bases.d.mts +2 -0
  114. package/resources/senders/agent/knowledge-bases.d.mts.map +1 -0
  115. package/resources/senders/agent/knowledge-bases.d.ts +2 -0
  116. package/resources/senders/agent/knowledge-bases.d.ts.map +1 -0
  117. package/resources/senders/agent/knowledge-bases.js +6 -0
  118. package/resources/senders/agent/knowledge-bases.js.map +1 -0
  119. package/resources/senders/agent/knowledge-bases.mjs +3 -0
  120. package/resources/senders/agent/knowledge-bases.mjs.map +1 -0
  121. package/resources/senders/agent/tools.d.mts +242 -0
  122. package/resources/senders/agent/tools.d.mts.map +1 -0
  123. package/resources/senders/agent/tools.d.ts +242 -0
  124. package/resources/senders/agent/tools.d.ts.map +1 -0
  125. package/resources/senders/agent/tools.js +126 -0
  126. package/resources/senders/agent/tools.js.map +1 -0
  127. package/resources/senders/agent/tools.mjs +122 -0
  128. package/resources/senders/agent/tools.mjs.map +1 -0
  129. package/resources/senders/agent.d.mts +2 -0
  130. package/resources/senders/agent.d.mts.map +1 -0
  131. package/resources/senders/agent.d.ts +2 -0
  132. package/resources/senders/agent.d.ts.map +1 -0
  133. package/resources/senders/agent.js +6 -0
  134. package/resources/senders/agent.js.map +1 -0
  135. package/resources/senders/agent.mjs +3 -0
  136. package/resources/senders/agent.mjs.map +1 -0
  137. package/resources/senders/index.d.mts +3 -0
  138. package/resources/senders/index.d.mts.map +1 -0
  139. package/resources/senders/index.d.ts +3 -0
  140. package/resources/senders/index.d.ts.map +1 -0
  141. package/resources/senders/index.js +9 -0
  142. package/resources/senders/index.js.map +1 -0
  143. package/resources/senders/index.mjs +4 -0
  144. package/resources/senders/index.mjs.map +1 -0
  145. package/resources/senders/senders.d.mts +342 -0
  146. package/resources/senders/senders.d.mts.map +1 -0
  147. package/resources/senders/senders.d.ts +342 -0
  148. package/resources/senders/senders.d.ts.map +1 -0
  149. package/resources/senders/senders.js +150 -0
  150. package/resources/senders/senders.js.map +1 -0
  151. package/resources/senders/senders.mjs +145 -0
  152. package/resources/senders/senders.mjs.map +1 -0
  153. package/resources/senders.d.mts +1 -337
  154. package/resources/senders.d.mts.map +1 -1
  155. package/resources/senders.d.ts +1 -337
  156. package/resources/senders.d.ts.map +1 -1
  157. package/resources/senders.js +2 -138
  158. package/resources/senders.js.map +1 -1
  159. package/resources/senders.mjs +1 -136
  160. package/resources/senders.mjs.map +1 -1
  161. package/src/client.ts +79 -17
  162. package/src/resources/addresses.ts +160 -0
  163. package/src/resources/broadcasts/broadcasts.ts +33 -0
  164. package/src/resources/broadcasts/index.ts +2 -0
  165. package/src/resources/index.ts +29 -1
  166. package/src/resources/phone-numbers.ts +97 -0
  167. package/src/resources/regulatory-documents.ts +184 -0
  168. package/src/resources/senders/agent/agent.ts +417 -0
  169. package/src/resources/senders/agent/executions.ts +48 -0
  170. package/src/resources/senders/agent/flows.ts +409 -0
  171. package/src/resources/senders/agent/index.ts +60 -0
  172. package/src/resources/senders/agent/knowledge-bases/documents.ts +133 -0
  173. package/src/resources/senders/agent/knowledge-bases/index.ts +24 -0
  174. package/src/resources/senders/agent/knowledge-bases/knowledge-bases.ts +251 -0
  175. package/src/resources/senders/agent/knowledge-bases.ts +3 -0
  176. package/src/resources/senders/agent/tools.ts +334 -0
  177. package/src/resources/senders/agent.ts +3 -0
  178. package/src/resources/senders/index.ts +32 -0
  179. package/src/resources/senders/senders.ts +506 -0
  180. package/src/resources/senders.ts +1 -476
  181. package/src/version.ts +1 -1
  182. package/version.d.mts +1 -1
  183. package/version.d.ts +1 -1
  184. package/version.js +1 -1
  185. package/version.mjs +1 -1
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.RegulatoryDocuments = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const pagination_1 = require("../core/pagination.js");
7
+ const headers_1 = require("../internal/headers.js");
8
+ const path_1 = require("../internal/utils/path.js");
9
+ class RegulatoryDocuments extends resource_1.APIResource {
10
+ /**
11
+ * Create a regulatory document record after uploading the file. Use the upload-url
12
+ * endpoint first to get an upload URL.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const regulatoryDocument =
17
+ * await client.regulatoryDocuments.create({
18
+ * documentType: 'passport',
19
+ * fileSize: 102400,
20
+ * mimeType: 'image/jpeg',
21
+ * name: 'Passport Scan',
22
+ * storageId: 'kg2abc123...',
23
+ * });
24
+ * ```
25
+ */
26
+ create(body, options) {
27
+ return this._client.post('/v1/documents', { body, ...options });
28
+ }
29
+ /**
30
+ * Get a specific regulatory document.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const regulatoryDocument =
35
+ * await client.regulatoryDocuments.retrieve('documentId');
36
+ * ```
37
+ */
38
+ retrieve(documentID, options) {
39
+ return this._client.get((0, path_1.path) `/v1/documents/${documentID}`, options);
40
+ }
41
+ /**
42
+ * List regulatory documents for this project.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * // Automatically fetches more pages as needed.
47
+ * for await (const regulatoryDocument of client.regulatoryDocuments.list()) {
48
+ * // ...
49
+ * }
50
+ * ```
51
+ */
52
+ list(query = {}, options) {
53
+ return this._client.getAPIList('/v1/documents', (pagination_1.Cursor), { query, ...options });
54
+ }
55
+ /**
56
+ * Delete a regulatory document. Cannot delete verified documents.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * await client.regulatoryDocuments.delete('documentId');
61
+ * ```
62
+ */
63
+ delete(documentID, options) {
64
+ return this._client.delete((0, path_1.path) `/v1/documents/${documentID}`, {
65
+ ...options,
66
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
67
+ });
68
+ }
69
+ /**
70
+ * Get a presigned URL to upload a document file. After uploading, use the
71
+ * storageId to create the document record.
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * const response =
76
+ * await client.regulatoryDocuments.uploadURL();
77
+ * ```
78
+ */
79
+ uploadURL(options) {
80
+ return this._client.post('/v1/documents/upload-url', options);
81
+ }
82
+ }
83
+ exports.RegulatoryDocuments = RegulatoryDocuments;
84
+ //# sourceMappingURL=regulatory-documents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regulatory-documents.js","sourceRoot":"","sources":["../src/resources/regulatory-documents.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAA4E;AAC5E,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,mBAAoB,SAAQ,sBAAW;IAClD;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CACJ,IAAoC,EACpC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAkB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAAyD,EAAE,EAC3D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAA,mBAA0B,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrG,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,UAAkB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,iBAAiB,UAAU,EAAE,EAAE;YAC5D,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,SAAS,CAAC,OAAwB;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;CACF;AAnFD,kDAmFC"}
@@ -0,0 +1,80 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { Cursor } from "../core/pagination.mjs";
4
+ import { buildHeaders } from "../internal/headers.mjs";
5
+ import { path } from "../internal/utils/path.mjs";
6
+ export class RegulatoryDocuments extends APIResource {
7
+ /**
8
+ * Create a regulatory document record after uploading the file. Use the upload-url
9
+ * endpoint first to get an upload URL.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const regulatoryDocument =
14
+ * await client.regulatoryDocuments.create({
15
+ * documentType: 'passport',
16
+ * fileSize: 102400,
17
+ * mimeType: 'image/jpeg',
18
+ * name: 'Passport Scan',
19
+ * storageId: 'kg2abc123...',
20
+ * });
21
+ * ```
22
+ */
23
+ create(body, options) {
24
+ return this._client.post('/v1/documents', { body, ...options });
25
+ }
26
+ /**
27
+ * Get a specific regulatory document.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const regulatoryDocument =
32
+ * await client.regulatoryDocuments.retrieve('documentId');
33
+ * ```
34
+ */
35
+ retrieve(documentID, options) {
36
+ return this._client.get(path `/v1/documents/${documentID}`, options);
37
+ }
38
+ /**
39
+ * List regulatory documents for this project.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * // Automatically fetches more pages as needed.
44
+ * for await (const regulatoryDocument of client.regulatoryDocuments.list()) {
45
+ * // ...
46
+ * }
47
+ * ```
48
+ */
49
+ list(query = {}, options) {
50
+ return this._client.getAPIList('/v1/documents', (Cursor), { query, ...options });
51
+ }
52
+ /**
53
+ * Delete a regulatory document. Cannot delete verified documents.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * await client.regulatoryDocuments.delete('documentId');
58
+ * ```
59
+ */
60
+ delete(documentID, options) {
61
+ return this._client.delete(path `/v1/documents/${documentID}`, {
62
+ ...options,
63
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
64
+ });
65
+ }
66
+ /**
67
+ * Get a presigned URL to upload a document file. After uploading, use the
68
+ * storageId to create the document record.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const response =
73
+ * await client.regulatoryDocuments.uploadURL();
74
+ * ```
75
+ */
76
+ uploadURL(options) {
77
+ return this._client.post('/v1/documents/upload-url', options);
78
+ }
79
+ }
80
+ //# sourceMappingURL=regulatory-documents.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regulatory-documents.mjs","sourceRoot":"","sources":["../src/resources/regulatory-documents.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,MAAM,EAAkC;OAC1C,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAClD;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CACJ,IAAoC,EACpC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAkB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAAyD,EAAE,EAC3D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAA,MAA0B,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrG,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,UAAkB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,iBAAiB,UAAU,EAAE,EAAE;YAC5D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,SAAS,CAAC,OAAwB;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;CACF"}
@@ -0,0 +1,230 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import * as ExecutionsAPI from "./executions.mjs";
3
+ import { ExecutionListParams, Executions } from "./executions.mjs";
4
+ import * as FlowsAPI from "./flows.mjs";
5
+ import { AgentFlow, AgentFlowsCursor, FlowCreateParams, FlowCreateResponse, FlowDeleteParams, FlowDuplicateParams, FlowDuplicateResponse, FlowListParams, FlowRetrieveParams, FlowRetrieveResponse, FlowUpdateParams, FlowUpdateResponse, Flows } from "./flows.mjs";
6
+ import * as ToolsAPI from "./tools.mjs";
7
+ import { AgentTool, AgentToolsCursor, ToolCreateParams, ToolCreateResponse, ToolDeleteParams, ToolListParams, ToolRetrieveParams, ToolRetrieveResponse, ToolTestParams, ToolTestResponse, ToolUpdateParams, ToolUpdateResponse, Tools } from "./tools.mjs";
8
+ import * as KnowledgeBasesAPI from "./knowledge-bases/knowledge-bases.mjs";
9
+ import { AgentDocument, AgentKnowledgeBase, AgentKnowledgeBasesCursor, KnowledgeBaseCreateParams, KnowledgeBaseCreateResponse, KnowledgeBaseDeleteParams, KnowledgeBaseListParams, KnowledgeBaseRetrieveParams, KnowledgeBaseRetrieveResponse, KnowledgeBaseUpdateParams, KnowledgeBaseUpdateResponse, KnowledgeBases } from "./knowledge-bases/knowledge-bases.mjs";
10
+ import { APIPromise } from "../../../core/api-promise.mjs";
11
+ import { Cursor } from "../../../core/pagination.mjs";
12
+ import { RequestOptions } from "../../../internal/request-options.mjs";
13
+ export declare class AgentResource extends APIResource {
14
+ executions: ExecutionsAPI.Executions;
15
+ flows: FlowsAPI.Flows;
16
+ tools: ToolsAPI.Tools;
17
+ knowledgeBases: KnowledgeBasesAPI.KnowledgeBases;
18
+ /**
19
+ * Create an AI agent for a sender. Each sender can have at most one agent.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const agentResponse = await client.senders.agent.create(
24
+ * 'senderId',
25
+ * {
26
+ * model: 'gpt-4o-mini',
27
+ * name: 'Customer Support',
28
+ * provider: 'openai',
29
+ * systemPrompt:
30
+ * 'You are a helpful customer support agent. Be friendly and concise.',
31
+ * apiKey: 'sk-...',
32
+ * },
33
+ * );
34
+ * ```
35
+ */
36
+ create(senderID: string, body: AgentCreateParams, options?: RequestOptions): APIPromise<AgentResponse>;
37
+ /**
38
+ * Get the AI agent configuration for a sender.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const agentResponse = await client.senders.agent.retrieve(
43
+ * 'senderId',
44
+ * );
45
+ * ```
46
+ */
47
+ retrieve(senderID: string, options?: RequestOptions): APIPromise<AgentResponse>;
48
+ /**
49
+ * Update an AI agent's configuration.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const agentResponse = await client.senders.agent.update(
54
+ * 'senderId',
55
+ * );
56
+ * ```
57
+ */
58
+ update(senderID: string, body: AgentUpdateParams, options?: RequestOptions): APIPromise<AgentResponse>;
59
+ /**
60
+ * Delete an AI agent.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * await client.senders.agent.delete('senderId');
65
+ * ```
66
+ */
67
+ delete(senderID: string, options?: RequestOptions): APIPromise<void>;
68
+ /**
69
+ * Get statistics for an AI agent including invocations, tokens, and costs.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * const agentStats = await client.senders.agent.stats(
74
+ * 'senderId',
75
+ * );
76
+ * ```
77
+ */
78
+ stats(senderID: string, options?: RequestOptions): APIPromise<AgentStats>;
79
+ }
80
+ export type AgentExecutionsCursor = Cursor<AgentExecution>;
81
+ /**
82
+ * AI Agent configuration for a sender.
83
+ */
84
+ export interface Agent {
85
+ id: string;
86
+ createdAt: string;
87
+ /**
88
+ * Whether the agent is active.
89
+ */
90
+ enabled: boolean;
91
+ /**
92
+ * Model ID (e.g., gpt-4o-mini, claude-3-5-sonnet).
93
+ */
94
+ model: string;
95
+ name: string;
96
+ /**
97
+ * LLM provider for the AI agent.
98
+ */
99
+ provider: AgentProvider;
100
+ senderId: string;
101
+ /**
102
+ * System prompt for the agent.
103
+ */
104
+ systemPrompt: string;
105
+ updatedAt: string;
106
+ /**
107
+ * Number of previous messages to include as context.
108
+ */
109
+ contextWindowMessages?: number;
110
+ /**
111
+ * Whether to include contact metadata in context.
112
+ */
113
+ includeContactMetadata?: boolean;
114
+ /**
115
+ * Maximum tokens for LLM response.
116
+ */
117
+ maxTokens?: number | null;
118
+ stats?: Agent.Stats;
119
+ /**
120
+ * LLM temperature (0-2).
121
+ */
122
+ temperature?: number | null;
123
+ /**
124
+ * Channels that trigger the agent.
125
+ */
126
+ triggerOnChannels?: Array<string>;
127
+ /**
128
+ * Message types that trigger the agent.
129
+ */
130
+ triggerOnMessageTypes?: Array<string>;
131
+ }
132
+ export declare namespace Agent {
133
+ interface Stats {
134
+ /**
135
+ * Total cost in USD.
136
+ */
137
+ totalCost?: number;
138
+ totalInvocations?: number;
139
+ totalTokensUsed?: number;
140
+ }
141
+ }
142
+ export interface AgentExecution {
143
+ id: string;
144
+ agentId: string;
145
+ /**
146
+ * Cost in USD.
147
+ */
148
+ cost: number;
149
+ createdAt: string;
150
+ inputTokens: number;
151
+ latencyMs: number;
152
+ outputTokens: number;
153
+ /**
154
+ * Status of an agent execution.
155
+ */
156
+ status: AgentExecutionStatus;
157
+ errorMessage?: string | null;
158
+ inboundMessageId?: string;
159
+ responseMessageId?: string | null;
160
+ responseText?: string | null;
161
+ }
162
+ /**
163
+ * Status of an agent execution.
164
+ */
165
+ export type AgentExecutionStatus = 'success' | 'error' | 'filtered' | 'rate_limited' | 'balance_insufficient';
166
+ /**
167
+ * LLM provider for the AI agent.
168
+ */
169
+ export type AgentProvider = 'openai' | 'anthropic' | 'google' | 'mistral' | 'zavu';
170
+ export interface AgentResponse {
171
+ /**
172
+ * AI Agent configuration for a sender.
173
+ */
174
+ agent: Agent;
175
+ }
176
+ export interface AgentStats {
177
+ errorCount: number;
178
+ successCount: number;
179
+ /**
180
+ * Total cost in USD.
181
+ */
182
+ totalCost: number;
183
+ totalInvocations: number;
184
+ totalTokensUsed: number;
185
+ avgLatencyMs?: number | null;
186
+ }
187
+ export interface AgentCreateParams {
188
+ model: string;
189
+ name: string;
190
+ /**
191
+ * LLM provider for the AI agent.
192
+ */
193
+ provider: AgentProvider;
194
+ systemPrompt: string;
195
+ /**
196
+ * API key for the LLM provider. Required unless provider is 'zavu'.
197
+ */
198
+ apiKey?: string;
199
+ contextWindowMessages?: number;
200
+ includeContactMetadata?: boolean;
201
+ maxTokens?: number;
202
+ temperature?: number;
203
+ triggerOnChannels?: Array<string>;
204
+ triggerOnMessageTypes?: Array<string>;
205
+ }
206
+ export interface AgentUpdateParams {
207
+ apiKey?: string;
208
+ contextWindowMessages?: number;
209
+ enabled?: boolean;
210
+ includeContactMetadata?: boolean;
211
+ maxTokens?: number | null;
212
+ model?: string;
213
+ name?: string;
214
+ /**
215
+ * LLM provider for the AI agent.
216
+ */
217
+ provider?: AgentProvider;
218
+ systemPrompt?: string;
219
+ temperature?: number | null;
220
+ triggerOnChannels?: Array<string>;
221
+ triggerOnMessageTypes?: Array<string>;
222
+ }
223
+ export declare namespace AgentResource {
224
+ export { type Agent as Agent, type AgentExecution as AgentExecution, type AgentExecutionStatus as AgentExecutionStatus, type AgentProvider as AgentProvider, type AgentResponse as AgentResponse, type AgentStats as AgentStats, type AgentCreateParams as AgentCreateParams, type AgentUpdateParams as AgentUpdateParams, };
225
+ export { Executions as Executions, type ExecutionListParams as ExecutionListParams };
226
+ export { Flows as Flows, type AgentFlow as AgentFlow, type FlowCreateResponse as FlowCreateResponse, type FlowRetrieveResponse as FlowRetrieveResponse, type FlowUpdateResponse as FlowUpdateResponse, type FlowDuplicateResponse as FlowDuplicateResponse, type AgentFlowsCursor as AgentFlowsCursor, type FlowCreateParams as FlowCreateParams, type FlowRetrieveParams as FlowRetrieveParams, type FlowUpdateParams as FlowUpdateParams, type FlowListParams as FlowListParams, type FlowDeleteParams as FlowDeleteParams, type FlowDuplicateParams as FlowDuplicateParams, };
227
+ export { Tools as Tools, type AgentTool as AgentTool, type ToolCreateResponse as ToolCreateResponse, type ToolRetrieveResponse as ToolRetrieveResponse, type ToolUpdateResponse as ToolUpdateResponse, type ToolTestResponse as ToolTestResponse, type AgentToolsCursor as AgentToolsCursor, type ToolCreateParams as ToolCreateParams, type ToolRetrieveParams as ToolRetrieveParams, type ToolUpdateParams as ToolUpdateParams, type ToolListParams as ToolListParams, type ToolDeleteParams as ToolDeleteParams, type ToolTestParams as ToolTestParams, };
228
+ export { KnowledgeBases as KnowledgeBases, type AgentDocument as AgentDocument, type AgentKnowledgeBase as AgentKnowledgeBase, type KnowledgeBaseCreateResponse as KnowledgeBaseCreateResponse, type KnowledgeBaseRetrieveResponse as KnowledgeBaseRetrieveResponse, type KnowledgeBaseUpdateResponse as KnowledgeBaseUpdateResponse, type AgentKnowledgeBasesCursor as AgentKnowledgeBasesCursor, type KnowledgeBaseCreateParams as KnowledgeBaseCreateParams, type KnowledgeBaseRetrieveParams as KnowledgeBaseRetrieveParams, type KnowledgeBaseUpdateParams as KnowledgeBaseUpdateParams, type KnowledgeBaseListParams as KnowledgeBaseListParams, type KnowledgeBaseDeleteParams as KnowledgeBaseDeleteParams, };
229
+ }
230
+ //# sourceMappingURL=agent.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.mts","sourceRoot":"","sources":["../../../src/resources/senders/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,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
@@ -0,0 +1,230 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import * as ExecutionsAPI from "./executions.js";
3
+ import { ExecutionListParams, Executions } from "./executions.js";
4
+ import * as FlowsAPI from "./flows.js";
5
+ import { AgentFlow, AgentFlowsCursor, FlowCreateParams, FlowCreateResponse, FlowDeleteParams, FlowDuplicateParams, FlowDuplicateResponse, FlowListParams, FlowRetrieveParams, FlowRetrieveResponse, FlowUpdateParams, FlowUpdateResponse, Flows } from "./flows.js";
6
+ import * as ToolsAPI from "./tools.js";
7
+ import { AgentTool, AgentToolsCursor, ToolCreateParams, ToolCreateResponse, ToolDeleteParams, ToolListParams, ToolRetrieveParams, ToolRetrieveResponse, ToolTestParams, ToolTestResponse, ToolUpdateParams, ToolUpdateResponse, Tools } from "./tools.js";
8
+ import * as KnowledgeBasesAPI from "./knowledge-bases/knowledge-bases.js";
9
+ import { AgentDocument, AgentKnowledgeBase, AgentKnowledgeBasesCursor, KnowledgeBaseCreateParams, KnowledgeBaseCreateResponse, KnowledgeBaseDeleteParams, KnowledgeBaseListParams, KnowledgeBaseRetrieveParams, KnowledgeBaseRetrieveResponse, KnowledgeBaseUpdateParams, KnowledgeBaseUpdateResponse, KnowledgeBases } from "./knowledge-bases/knowledge-bases.js";
10
+ import { APIPromise } from "../../../core/api-promise.js";
11
+ import { Cursor } from "../../../core/pagination.js";
12
+ import { RequestOptions } from "../../../internal/request-options.js";
13
+ export declare class AgentResource extends APIResource {
14
+ executions: ExecutionsAPI.Executions;
15
+ flows: FlowsAPI.Flows;
16
+ tools: ToolsAPI.Tools;
17
+ knowledgeBases: KnowledgeBasesAPI.KnowledgeBases;
18
+ /**
19
+ * Create an AI agent for a sender. Each sender can have at most one agent.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const agentResponse = await client.senders.agent.create(
24
+ * 'senderId',
25
+ * {
26
+ * model: 'gpt-4o-mini',
27
+ * name: 'Customer Support',
28
+ * provider: 'openai',
29
+ * systemPrompt:
30
+ * 'You are a helpful customer support agent. Be friendly and concise.',
31
+ * apiKey: 'sk-...',
32
+ * },
33
+ * );
34
+ * ```
35
+ */
36
+ create(senderID: string, body: AgentCreateParams, options?: RequestOptions): APIPromise<AgentResponse>;
37
+ /**
38
+ * Get the AI agent configuration for a sender.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const agentResponse = await client.senders.agent.retrieve(
43
+ * 'senderId',
44
+ * );
45
+ * ```
46
+ */
47
+ retrieve(senderID: string, options?: RequestOptions): APIPromise<AgentResponse>;
48
+ /**
49
+ * Update an AI agent's configuration.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const agentResponse = await client.senders.agent.update(
54
+ * 'senderId',
55
+ * );
56
+ * ```
57
+ */
58
+ update(senderID: string, body: AgentUpdateParams, options?: RequestOptions): APIPromise<AgentResponse>;
59
+ /**
60
+ * Delete an AI agent.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * await client.senders.agent.delete('senderId');
65
+ * ```
66
+ */
67
+ delete(senderID: string, options?: RequestOptions): APIPromise<void>;
68
+ /**
69
+ * Get statistics for an AI agent including invocations, tokens, and costs.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * const agentStats = await client.senders.agent.stats(
74
+ * 'senderId',
75
+ * );
76
+ * ```
77
+ */
78
+ stats(senderID: string, options?: RequestOptions): APIPromise<AgentStats>;
79
+ }
80
+ export type AgentExecutionsCursor = Cursor<AgentExecution>;
81
+ /**
82
+ * AI Agent configuration for a sender.
83
+ */
84
+ export interface Agent {
85
+ id: string;
86
+ createdAt: string;
87
+ /**
88
+ * Whether the agent is active.
89
+ */
90
+ enabled: boolean;
91
+ /**
92
+ * Model ID (e.g., gpt-4o-mini, claude-3-5-sonnet).
93
+ */
94
+ model: string;
95
+ name: string;
96
+ /**
97
+ * LLM provider for the AI agent.
98
+ */
99
+ provider: AgentProvider;
100
+ senderId: string;
101
+ /**
102
+ * System prompt for the agent.
103
+ */
104
+ systemPrompt: string;
105
+ updatedAt: string;
106
+ /**
107
+ * Number of previous messages to include as context.
108
+ */
109
+ contextWindowMessages?: number;
110
+ /**
111
+ * Whether to include contact metadata in context.
112
+ */
113
+ includeContactMetadata?: boolean;
114
+ /**
115
+ * Maximum tokens for LLM response.
116
+ */
117
+ maxTokens?: number | null;
118
+ stats?: Agent.Stats;
119
+ /**
120
+ * LLM temperature (0-2).
121
+ */
122
+ temperature?: number | null;
123
+ /**
124
+ * Channels that trigger the agent.
125
+ */
126
+ triggerOnChannels?: Array<string>;
127
+ /**
128
+ * Message types that trigger the agent.
129
+ */
130
+ triggerOnMessageTypes?: Array<string>;
131
+ }
132
+ export declare namespace Agent {
133
+ interface Stats {
134
+ /**
135
+ * Total cost in USD.
136
+ */
137
+ totalCost?: number;
138
+ totalInvocations?: number;
139
+ totalTokensUsed?: number;
140
+ }
141
+ }
142
+ export interface AgentExecution {
143
+ id: string;
144
+ agentId: string;
145
+ /**
146
+ * Cost in USD.
147
+ */
148
+ cost: number;
149
+ createdAt: string;
150
+ inputTokens: number;
151
+ latencyMs: number;
152
+ outputTokens: number;
153
+ /**
154
+ * Status of an agent execution.
155
+ */
156
+ status: AgentExecutionStatus;
157
+ errorMessage?: string | null;
158
+ inboundMessageId?: string;
159
+ responseMessageId?: string | null;
160
+ responseText?: string | null;
161
+ }
162
+ /**
163
+ * Status of an agent execution.
164
+ */
165
+ export type AgentExecutionStatus = 'success' | 'error' | 'filtered' | 'rate_limited' | 'balance_insufficient';
166
+ /**
167
+ * LLM provider for the AI agent.
168
+ */
169
+ export type AgentProvider = 'openai' | 'anthropic' | 'google' | 'mistral' | 'zavu';
170
+ export interface AgentResponse {
171
+ /**
172
+ * AI Agent configuration for a sender.
173
+ */
174
+ agent: Agent;
175
+ }
176
+ export interface AgentStats {
177
+ errorCount: number;
178
+ successCount: number;
179
+ /**
180
+ * Total cost in USD.
181
+ */
182
+ totalCost: number;
183
+ totalInvocations: number;
184
+ totalTokensUsed: number;
185
+ avgLatencyMs?: number | null;
186
+ }
187
+ export interface AgentCreateParams {
188
+ model: string;
189
+ name: string;
190
+ /**
191
+ * LLM provider for the AI agent.
192
+ */
193
+ provider: AgentProvider;
194
+ systemPrompt: string;
195
+ /**
196
+ * API key for the LLM provider. Required unless provider is 'zavu'.
197
+ */
198
+ apiKey?: string;
199
+ contextWindowMessages?: number;
200
+ includeContactMetadata?: boolean;
201
+ maxTokens?: number;
202
+ temperature?: number;
203
+ triggerOnChannels?: Array<string>;
204
+ triggerOnMessageTypes?: Array<string>;
205
+ }
206
+ export interface AgentUpdateParams {
207
+ apiKey?: string;
208
+ contextWindowMessages?: number;
209
+ enabled?: boolean;
210
+ includeContactMetadata?: boolean;
211
+ maxTokens?: number | null;
212
+ model?: string;
213
+ name?: string;
214
+ /**
215
+ * LLM provider for the AI agent.
216
+ */
217
+ provider?: AgentProvider;
218
+ systemPrompt?: string;
219
+ temperature?: number | null;
220
+ triggerOnChannels?: Array<string>;
221
+ triggerOnMessageTypes?: Array<string>;
222
+ }
223
+ export declare namespace AgentResource {
224
+ export { type Agent as Agent, type AgentExecution as AgentExecution, type AgentExecutionStatus as AgentExecutionStatus, type AgentProvider as AgentProvider, type AgentResponse as AgentResponse, type AgentStats as AgentStats, type AgentCreateParams as AgentCreateParams, type AgentUpdateParams as AgentUpdateParams, };
225
+ export { Executions as Executions, type ExecutionListParams as ExecutionListParams };
226
+ export { Flows as Flows, type AgentFlow as AgentFlow, type FlowCreateResponse as FlowCreateResponse, type FlowRetrieveResponse as FlowRetrieveResponse, type FlowUpdateResponse as FlowUpdateResponse, type FlowDuplicateResponse as FlowDuplicateResponse, type AgentFlowsCursor as AgentFlowsCursor, type FlowCreateParams as FlowCreateParams, type FlowRetrieveParams as FlowRetrieveParams, type FlowUpdateParams as FlowUpdateParams, type FlowListParams as FlowListParams, type FlowDeleteParams as FlowDeleteParams, type FlowDuplicateParams as FlowDuplicateParams, };
227
+ export { Tools as Tools, type AgentTool as AgentTool, type ToolCreateResponse as ToolCreateResponse, type ToolRetrieveResponse as ToolRetrieveResponse, type ToolUpdateResponse as ToolUpdateResponse, type ToolTestResponse as ToolTestResponse, type AgentToolsCursor as AgentToolsCursor, type ToolCreateParams as ToolCreateParams, type ToolRetrieveParams as ToolRetrieveParams, type ToolUpdateParams as ToolUpdateParams, type ToolListParams as ToolListParams, type ToolDeleteParams as ToolDeleteParams, type ToolTestParams as ToolTestParams, };
228
+ export { KnowledgeBases as KnowledgeBases, type AgentDocument as AgentDocument, type AgentKnowledgeBase as AgentKnowledgeBase, type KnowledgeBaseCreateResponse as KnowledgeBaseCreateResponse, type KnowledgeBaseRetrieveResponse as KnowledgeBaseRetrieveResponse, type KnowledgeBaseUpdateResponse as KnowledgeBaseUpdateResponse, type AgentKnowledgeBasesCursor as AgentKnowledgeBasesCursor, type KnowledgeBaseCreateParams as KnowledgeBaseCreateParams, type KnowledgeBaseRetrieveParams as KnowledgeBaseRetrieveParams, type KnowledgeBaseUpdateParams as KnowledgeBaseUpdateParams, type KnowledgeBaseListParams as KnowledgeBaseListParams, type KnowledgeBaseDeleteParams as KnowledgeBaseDeleteParams, };
229
+ }
230
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/resources/senders/agent/agent.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,aAAa;OAClB,EAAE,mBAAmB,EAAE,UAAU,EAAE;OACnC,KAAK,QAAQ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