@zavudev/sdk 0.55.0 → 0.56.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 (273) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client.d.mts +25 -10
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +25 -10
  5. package/client.d.ts.map +1 -1
  6. package/client.js +15 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +15 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agent-templates.d.mts +97 -0
  12. package/resources/agent-templates.d.mts.map +1 -0
  13. package/resources/agent-templates.d.ts +97 -0
  14. package/resources/agent-templates.d.ts.map +1 -0
  15. package/resources/agent-templates.js +39 -0
  16. package/resources/agent-templates.js.map +1 -0
  17. package/resources/agent-templates.mjs +35 -0
  18. package/resources/agent-templates.mjs.map +1 -0
  19. package/resources/agents/agents.d.mts +462 -0
  20. package/resources/agents/agents.d.mts.map +1 -0
  21. package/resources/agents/agents.d.ts +462 -0
  22. package/resources/agents/agents.d.ts.map +1 -0
  23. package/resources/agents/agents.js +129 -0
  24. package/resources/agents/agents.js.map +1 -0
  25. package/resources/agents/agents.mjs +124 -0
  26. package/resources/agents/agents.mjs.map +1 -0
  27. package/resources/agents/index.d.mts +3 -0
  28. package/resources/agents/index.d.mts.map +1 -0
  29. package/resources/agents/index.d.ts +3 -0
  30. package/resources/agents/index.d.ts.map +1 -0
  31. package/resources/agents/index.js +9 -0
  32. package/resources/agents/index.js.map +1 -0
  33. package/resources/agents/index.mjs +4 -0
  34. package/resources/agents/index.mjs.map +1 -0
  35. package/resources/agents/senders.d.mts +54 -0
  36. package/resources/agents/senders.d.mts.map +1 -0
  37. package/resources/agents/senders.d.ts +54 -0
  38. package/resources/agents/senders.d.ts.map +1 -0
  39. package/resources/agents/senders.js +45 -0
  40. package/resources/agents/senders.js.map +1 -0
  41. package/resources/agents/senders.mjs +41 -0
  42. package/resources/agents/senders.mjs.map +1 -0
  43. package/resources/agents.d.mts +2 -0
  44. package/resources/agents.d.mts.map +1 -0
  45. package/resources/agents.d.ts +2 -0
  46. package/resources/agents.d.ts.map +1 -0
  47. package/resources/agents.js +6 -0
  48. package/resources/agents.js.map +1 -0
  49. package/resources/agents.mjs +3 -0
  50. package/resources/agents.mjs.map +1 -0
  51. package/resources/calls.d.mts +530 -0
  52. package/resources/calls.d.mts.map +1 -0
  53. package/resources/calls.d.ts +530 -0
  54. package/resources/calls.d.ts.map +1 -0
  55. package/resources/calls.js +76 -0
  56. package/resources/calls.js.map +1 -0
  57. package/resources/calls.mjs +72 -0
  58. package/resources/calls.mjs.map +1 -0
  59. package/resources/conversations.d.mts +360 -0
  60. package/resources/conversations.d.mts.map +1 -0
  61. package/resources/conversations.d.ts +360 -0
  62. package/resources/conversations.d.ts.map +1 -0
  63. package/resources/conversations.js +47 -0
  64. package/resources/conversations.js.map +1 -0
  65. package/resources/conversations.mjs +43 -0
  66. package/resources/conversations.mjs.map +1 -0
  67. package/resources/email-domains.d.mts +260 -0
  68. package/resources/email-domains.d.mts.map +1 -0
  69. package/resources/email-domains.d.ts +260 -0
  70. package/resources/email-domains.d.ts.map +1 -0
  71. package/resources/email-domains.js +77 -0
  72. package/resources/email-domains.js.map +1 -0
  73. package/resources/email-domains.mjs +73 -0
  74. package/resources/email-domains.mjs.map +1 -0
  75. package/resources/functions/functions.d.mts +122 -1
  76. package/resources/functions/functions.d.mts.map +1 -1
  77. package/resources/functions/functions.d.ts +122 -1
  78. package/resources/functions/functions.d.ts.map +1 -1
  79. package/resources/functions/functions.js +53 -0
  80. package/resources/functions/functions.js.map +1 -1
  81. package/resources/functions/functions.mjs +53 -0
  82. package/resources/functions/functions.mjs.map +1 -1
  83. package/resources/functions/git-link.d.mts +295 -0
  84. package/resources/functions/git-link.d.mts.map +1 -0
  85. package/resources/functions/git-link.d.ts +295 -0
  86. package/resources/functions/git-link.d.ts.map +1 -0
  87. package/resources/functions/git-link.js +97 -0
  88. package/resources/functions/git-link.js.map +1 -0
  89. package/resources/functions/git-link.mjs +93 -0
  90. package/resources/functions/git-link.mjs.map +1 -0
  91. package/resources/functions/index.d.mts +3 -1
  92. package/resources/functions/index.d.mts.map +1 -1
  93. package/resources/functions/index.d.ts +3 -1
  94. package/resources/functions/index.d.ts.map +1 -1
  95. package/resources/functions/index.js +5 -1
  96. package/resources/functions/index.js.map +1 -1
  97. package/resources/functions/index.mjs +2 -0
  98. package/resources/functions/index.mjs.map +1 -1
  99. package/resources/functions/triggers.d.mts +164 -0
  100. package/resources/functions/triggers.d.mts.map +1 -0
  101. package/resources/functions/triggers.d.ts +164 -0
  102. package/resources/functions/triggers.d.ts.map +1 -0
  103. package/resources/functions/triggers.js +74 -0
  104. package/resources/functions/triggers.js.map +1 -0
  105. package/resources/functions/triggers.mjs +70 -0
  106. package/resources/functions/triggers.mjs.map +1 -0
  107. package/resources/index.d.mts +10 -5
  108. package/resources/index.d.mts.map +1 -1
  109. package/resources/index.d.ts +10 -5
  110. package/resources/index.d.ts.map +1 -1
  111. package/resources/index.js +11 -1
  112. package/resources/index.js.map +1 -1
  113. package/resources/index.mjs +5 -0
  114. package/resources/index.mjs.map +1 -1
  115. package/resources/introspect.d.mts +74 -1
  116. package/resources/introspect.d.mts.map +1 -1
  117. package/resources/introspect.d.ts +74 -1
  118. package/resources/introspect.d.ts.map +1 -1
  119. package/resources/introspect.js +22 -0
  120. package/resources/introspect.js.map +1 -1
  121. package/resources/introspect.mjs +22 -0
  122. package/resources/introspect.mjs.map +1 -1
  123. package/resources/messages.d.mts +54 -1
  124. package/resources/messages.d.mts.map +1 -1
  125. package/resources/messages.d.ts +54 -1
  126. package/resources/messages.d.ts.map +1 -1
  127. package/resources/messages.js +18 -0
  128. package/resources/messages.js.map +1 -1
  129. package/resources/messages.mjs +18 -0
  130. package/resources/messages.mjs.map +1 -1
  131. package/resources/senders/agent/agent.d.mts +4 -3
  132. package/resources/senders/agent/agent.d.mts.map +1 -1
  133. package/resources/senders/agent/agent.d.ts +4 -3
  134. package/resources/senders/agent/agent.d.ts.map +1 -1
  135. package/resources/senders/agent/agent.js +2 -2
  136. package/resources/senders/agent/agent.js.map +1 -1
  137. package/resources/senders/agent/agent.mjs +2 -2
  138. package/resources/senders/agent/agent.mjs.map +1 -1
  139. package/resources/senders/agent/index.d.mts +2 -2
  140. package/resources/senders/agent/index.d.mts.map +1 -1
  141. package/resources/senders/agent/index.d.ts +2 -2
  142. package/resources/senders/agent/index.d.ts.map +1 -1
  143. package/resources/senders/agent/index.js +2 -2
  144. package/resources/senders/agent/index.js.map +1 -1
  145. package/resources/senders/agent/index.mjs +1 -1
  146. package/resources/senders/agent/index.mjs.map +1 -1
  147. package/resources/senders/agent/knowledge-bases/documents.d.mts +56 -1
  148. package/resources/senders/agent/knowledge-bases/documents.d.mts.map +1 -1
  149. package/resources/senders/agent/knowledge-bases/documents.d.ts +56 -1
  150. package/resources/senders/agent/knowledge-bases/documents.d.ts.map +1 -1
  151. package/resources/senders/agent/knowledge-bases/documents.js +33 -0
  152. package/resources/senders/agent/knowledge-bases/documents.js.map +1 -1
  153. package/resources/senders/agent/knowledge-bases/documents.mjs +33 -0
  154. package/resources/senders/agent/knowledge-bases/documents.mjs.map +1 -1
  155. package/resources/senders/agent/knowledge-bases/index.d.mts +1 -1
  156. package/resources/senders/agent/knowledge-bases/index.d.mts.map +1 -1
  157. package/resources/senders/agent/knowledge-bases/index.d.ts +1 -1
  158. package/resources/senders/agent/knowledge-bases/index.d.ts.map +1 -1
  159. package/resources/senders/agent/knowledge-bases/index.js.map +1 -1
  160. package/resources/senders/agent/knowledge-bases/index.mjs.map +1 -1
  161. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts +2 -2
  162. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts.map +1 -1
  163. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts +2 -2
  164. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts.map +1 -1
  165. package/resources/senders/agent/knowledge-bases/knowledge-bases.js.map +1 -1
  166. package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs.map +1 -1
  167. package/resources/senders/agent/tools/index.d.mts +3 -0
  168. package/resources/senders/agent/tools/index.d.mts.map +1 -0
  169. package/resources/senders/agent/tools/index.d.ts +3 -0
  170. package/resources/senders/agent/tools/index.d.ts.map +1 -0
  171. package/resources/senders/agent/tools/index.js +9 -0
  172. package/resources/senders/agent/tools/index.js.map +1 -0
  173. package/resources/senders/agent/tools/index.mjs +4 -0
  174. package/resources/senders/agent/tools/index.mjs.map +1 -0
  175. package/resources/senders/agent/tools/tools.d.mts +338 -0
  176. package/resources/senders/agent/tools/tools.d.mts.map +1 -0
  177. package/resources/senders/agent/tools/tools.d.ts +338 -0
  178. package/resources/senders/agent/tools/tools.d.ts.map +1 -0
  179. package/resources/senders/agent/tools/tools.js +163 -0
  180. package/resources/senders/agent/tools/tools.js.map +1 -0
  181. package/resources/senders/agent/tools/tools.mjs +158 -0
  182. package/resources/senders/agent/tools/tools.mjs.map +1 -0
  183. package/resources/senders/agent/tools/webhook.d.mts +28 -0
  184. package/resources/senders/agent/tools/webhook.d.mts.map +1 -0
  185. package/resources/senders/agent/tools/webhook.d.ts +28 -0
  186. package/resources/senders/agent/tools/webhook.d.ts.map +1 -0
  187. package/resources/senders/agent/tools/webhook.js +28 -0
  188. package/resources/senders/agent/tools/webhook.js.map +1 -0
  189. package/resources/senders/agent/tools/webhook.mjs +24 -0
  190. package/resources/senders/agent/tools/webhook.mjs.map +1 -0
  191. package/resources/senders/agent/tools.d.mts +1 -270
  192. package/resources/senders/agent/tools.d.mts.map +1 -1
  193. package/resources/senders/agent/tools.d.ts +1 -270
  194. package/resources/senders/agent/tools.d.ts.map +1 -1
  195. package/resources/senders/agent/tools.js +2 -131
  196. package/resources/senders/agent/tools.js.map +1 -1
  197. package/resources/senders/agent/tools.mjs +1 -129
  198. package/resources/senders/agent/tools.mjs.map +1 -1
  199. package/resources/senders/index.d.mts +2 -1
  200. package/resources/senders/index.d.mts.map +1 -1
  201. package/resources/senders/index.d.ts +2 -1
  202. package/resources/senders/index.d.ts.map +1 -1
  203. package/resources/senders/index.js +3 -1
  204. package/resources/senders/index.js.map +1 -1
  205. package/resources/senders/index.mjs +1 -0
  206. package/resources/senders/index.mjs.map +1 -1
  207. package/resources/senders/senders.d.mts +4 -0
  208. package/resources/senders/senders.d.mts.map +1 -1
  209. package/resources/senders/senders.d.ts +4 -0
  210. package/resources/senders/senders.d.ts.map +1 -1
  211. package/resources/senders/senders.js +4 -0
  212. package/resources/senders/senders.js.map +1 -1
  213. package/resources/senders/senders.mjs +4 -0
  214. package/resources/senders/senders.mjs.map +1 -1
  215. package/resources/senders/telegram.d.mts +48 -0
  216. package/resources/senders/telegram.d.mts.map +1 -0
  217. package/resources/senders/telegram.d.ts +48 -0
  218. package/resources/senders/telegram.d.ts.map +1 -0
  219. package/resources/senders/telegram.js +41 -0
  220. package/resources/senders/telegram.js.map +1 -0
  221. package/resources/senders/telegram.mjs +37 -0
  222. package/resources/senders/telegram.mjs.map +1 -0
  223. package/resources/templates.d.mts +66 -1
  224. package/resources/templates.d.mts.map +1 -1
  225. package/resources/templates.d.ts +66 -1
  226. package/resources/templates.d.ts.map +1 -1
  227. package/resources/templates.js +31 -0
  228. package/resources/templates.js.map +1 -1
  229. package/resources/templates.mjs +31 -0
  230. package/resources/templates.mjs.map +1 -1
  231. package/resources/urls.d.mts +24 -1
  232. package/resources/urls.d.mts.map +1 -1
  233. package/resources/urls.d.ts +24 -1
  234. package/resources/urls.d.ts.map +1 -1
  235. package/resources/urls.js +15 -0
  236. package/resources/urls.js.map +1 -1
  237. package/resources/urls.mjs +15 -0
  238. package/resources/urls.mjs.map +1 -1
  239. package/src/client.ts +129 -0
  240. package/src/resources/agent-templates.ts +128 -0
  241. package/src/resources/agents/agents.ts +603 -0
  242. package/src/resources/agents/index.ts +21 -0
  243. package/src/resources/agents/senders.ts +79 -0
  244. package/src/resources/agents.ts +3 -0
  245. package/src/resources/calls.ts +638 -0
  246. package/src/resources/conversations.ts +472 -0
  247. package/src/resources/email-domains.ts +337 -0
  248. package/src/resources/functions/functions.ts +202 -0
  249. package/src/resources/functions/git-link.ts +398 -0
  250. package/src/resources/functions/index.ts +22 -0
  251. package/src/resources/functions/triggers.ts +227 -0
  252. package/src/resources/index.ts +57 -0
  253. package/src/resources/introspect.ts +105 -0
  254. package/src/resources/messages.ts +66 -0
  255. package/src/resources/senders/agent/agent.ts +23 -17
  256. package/src/resources/senders/agent/index.ts +4 -1
  257. package/src/resources/senders/agent/knowledge-bases/documents.ts +89 -0
  258. package/src/resources/senders/agent/knowledge-bases/index.ts +4 -0
  259. package/src/resources/senders/agent/knowledge-bases/knowledge-bases.ts +8 -0
  260. package/src/resources/senders/agent/tools/index.ts +21 -0
  261. package/src/resources/senders/agent/tools/tools.ts +460 -0
  262. package/src/resources/senders/agent/tools/webhook.ts +40 -0
  263. package/src/resources/senders/agent/tools.ts +1 -364
  264. package/src/resources/senders/index.ts +2 -0
  265. package/src/resources/senders/senders.ts +10 -0
  266. package/src/resources/senders/telegram.ts +73 -0
  267. package/src/resources/templates.ts +80 -0
  268. package/src/resources/urls.ts +35 -0
  269. package/src/version.ts +1 -1
  270. package/version.d.mts +1 -1
  271. package/version.d.ts +1 -1
  272. package/version.js +1 -1
  273. package/version.mjs +1 -1
@@ -1,271 +1,2 @@
1
- import { APIResource } from "../../../core/resource.mjs";
2
- import { APIPromise } from "../../../core/api-promise.mjs";
3
- import { Cursor, type CursorParams, PagePromise } from "../../../core/pagination.mjs";
4
- import { RequestOptions } from "../../../internal/request-options.mjs";
5
- export declare class Tools extends APIResource {
6
- /**
7
- * Create a new tool for an agent. Tools allow the agent to call external webhooks.
8
- *
9
- * @example
10
- * ```ts
11
- * const tool = await client.senders.agent.tools.create(
12
- * 'senderId',
13
- * {
14
- * description: 'Get the status of a customer order',
15
- * name: 'get_order_status',
16
- * parameters: {
17
- * type: 'object',
18
- * properties: {
19
- * order_id: {
20
- * type: 'string',
21
- * description: 'The order ID to look up',
22
- * },
23
- * },
24
- * required: ['order_id'],
25
- * },
26
- * webhookUrl:
27
- * 'https://api.example.com/webhooks/order-status',
28
- * webhookSecret: 'whsec_...',
29
- * },
30
- * );
31
- * ```
32
- */
33
- create(senderID: string, body: ToolCreateParams, options?: RequestOptions): APIPromise<ToolCreateResponse>;
34
- /**
35
- * Get a specific tool.
36
- *
37
- * @example
38
- * ```ts
39
- * const tool = await client.senders.agent.tools.retrieve(
40
- * 'toolId',
41
- * { senderId: 'senderId' },
42
- * );
43
- * ```
44
- */
45
- retrieve(toolID: string, params: ToolRetrieveParams, options?: RequestOptions): APIPromise<ToolRetrieveResponse>;
46
- /**
47
- * Update a tool.
48
- *
49
- * @example
50
- * ```ts
51
- * const tool = await client.senders.agent.tools.update(
52
- * 'toolId',
53
- * { senderId: 'senderId' },
54
- * );
55
- * ```
56
- */
57
- update(toolID: string, params: ToolUpdateParams, options?: RequestOptions): APIPromise<ToolUpdateResponse>;
58
- /**
59
- * List tools for an agent.
60
- *
61
- * @example
62
- * ```ts
63
- * // Automatically fetches more pages as needed.
64
- * for await (const agentTool of client.senders.agent.tools.list(
65
- * 'senderId',
66
- * )) {
67
- * // ...
68
- * }
69
- * ```
70
- */
71
- list(senderID: string, query?: ToolListParams | null | undefined, options?: RequestOptions): PagePromise<AgentToolsCursor, AgentTool>;
72
- /**
73
- * Delete a tool.
74
- *
75
- * @example
76
- * ```ts
77
- * await client.senders.agent.tools.delete('toolId', {
78
- * senderId: 'senderId',
79
- * });
80
- * ```
81
- */
82
- delete(toolID: string, params: ToolDeleteParams, options?: RequestOptions): APIPromise<void>;
83
- /**
84
- * Run a tool with the parameters you supply and return what it answered.
85
- *
86
- * The call is synchronous: the response carries the tool's status, body, and
87
- * duration, so a green result is evidence the tool ran rather than evidence it was
88
- * accepted. Each run is also recorded and readable afterwards via
89
- * `GET /v1/senders/{senderId}/agent/tools/{toolId}/test-runs`.
90
- *
91
- * A tool that answers with an error is reported as a run with `success: false` —
92
- * the endpoint itself still returns 200. This fires the tool's real webhook, so a
93
- * test has whatever side effects the tool has.
94
- *
95
- * @example
96
- * ```ts
97
- * const response = await client.senders.agent.tools.test(
98
- * 'toolId',
99
- * {
100
- * senderId: 'senderId',
101
- * testParams: { order_id: 'ORD-12345' },
102
- * },
103
- * );
104
- * ```
105
- */
106
- test(toolID: string, params: ToolTestParams, options?: RequestOptions): APIPromise<ToolTestResponse>;
107
- }
108
- export type AgentToolsCursor = Cursor<AgentTool>;
109
- export interface AgentTool {
110
- id: string;
111
- agentId: string;
112
- createdAt: string;
113
- /**
114
- * Description for the LLM to understand when to use this tool.
115
- */
116
- description: string;
117
- enabled: boolean;
118
- name: string;
119
- parameters: ToolParameters;
120
- updatedAt: string;
121
- /**
122
- * HTTPS URL to call when the tool is executed.
123
- */
124
- webhookUrl: string;
125
- /**
126
- * Signing secret for this tool's webhook. **Returned only when the tool is
127
- * created**, never on a later read.
128
- *
129
- * Zavu generates one if you do not supply it, and signs every call to this tool
130
- * with it: `X-Zavu-Signature: <hex>`, the HMAC-SHA256 of the request body. Verify
131
- * it before trusting the call. Lost it? Rotate with
132
- * `POST /v1/senders/{senderId}/agent/tools/{toolId}/webhook/secret`.
133
- */
134
- webhookSecret?: string;
135
- }
136
- export interface ToolParameters {
137
- properties: {
138
- [key: string]: ToolParameters.Properties;
139
- };
140
- required: Array<string>;
141
- type: 'object';
142
- }
143
- export declare namespace ToolParameters {
144
- interface Properties {
145
- description?: string;
146
- type?: string;
147
- }
148
- }
149
- export interface ToolCreateResponse {
150
- tool: AgentTool;
151
- }
152
- export interface ToolRetrieveResponse {
153
- tool: AgentTool;
154
- }
155
- export interface ToolUpdateResponse {
156
- tool: AgentTool;
157
- }
158
- export interface ToolTestResponse {
159
- /**
160
- * One run of a tool triggered from the test endpoint. Recorded so a test is
161
- * verifiable after the fact rather than only visible in the response.
162
- */
163
- run: ToolTestResponse.Run;
164
- }
165
- export declare namespace ToolTestResponse {
166
- /**
167
- * One run of a tool triggered from the test endpoint. Recorded so a test is
168
- * verifiable after the fact rather than only visible in the response.
169
- */
170
- interface Run {
171
- id: string;
172
- createdAt: string;
173
- durationMs: number;
174
- /**
175
- * Whether the tool returned without error. A tool that answered with a non-2xx
176
- * status is a failed run, not an error of this endpoint.
177
- */
178
- success: boolean;
179
- toolId: string;
180
- /**
181
- * Why the run failed, when it did.
182
- */
183
- error?: string | null;
184
- /**
185
- * The parameters the tool was called with.
186
- */
187
- params?: {
188
- [key: string]: unknown;
189
- };
190
- /**
191
- * The tool's response body, truncated.
192
- */
193
- response?: string | null;
194
- /**
195
- * HTTP status the tool's webhook returned. Absent for tools that do not go over
196
- * HTTP.
197
- */
198
- statusCode?: number | null;
199
- }
200
- }
201
- export interface ToolCreateParams {
202
- description: string;
203
- name: string;
204
- parameters: ToolParameters;
205
- /**
206
- * Must be HTTPS.
207
- */
208
- webhookUrl: string;
209
- enabled?: boolean;
210
- /**
211
- * Signing secret for the webhook. Optional: Zavu generates one when omitted and
212
- * returns it on this response only. Supply your own if you already have a secret
213
- * you want reused.
214
- */
215
- webhookSecret?: string;
216
- }
217
- export interface ToolRetrieveParams {
218
- senderId: string;
219
- }
220
- export interface ToolUpdateParams {
221
- /**
222
- * Path param
223
- */
224
- senderId: string;
225
- /**
226
- * Body param
227
- */
228
- description?: string;
229
- /**
230
- * Body param
231
- */
232
- enabled?: boolean;
233
- /**
234
- * Body param
235
- */
236
- name?: string;
237
- /**
238
- * Body param
239
- */
240
- parameters?: ToolParameters;
241
- /**
242
- * Body param
243
- */
244
- webhookSecret?: string | null;
245
- /**
246
- * Body param
247
- */
248
- webhookUrl?: string;
249
- }
250
- export interface ToolListParams extends CursorParams {
251
- enabled?: boolean;
252
- }
253
- export interface ToolDeleteParams {
254
- senderId: string;
255
- }
256
- export interface ToolTestParams {
257
- /**
258
- * Path param
259
- */
260
- senderId: string;
261
- /**
262
- * Body param: Parameters to pass to the tool for testing.
263
- */
264
- testParams: {
265
- [key: string]: unknown;
266
- };
267
- }
268
- export declare namespace Tools {
269
- export { type AgentTool as AgentTool, type ToolParameters as ToolParameters, 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, };
270
- }
1
+ export * from "./tools/index.mjs";
271
2
  //# sourceMappingURL=tools.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.mts","sourceRoot":"","sources":["../../../src/resources/senders/agent/tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,qCAAiC;AAElF,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAGnE,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAI1G;;;;;;;;;;OAUG;IACH,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAKnC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAK1G;;;;;;;;;;;;OAYG;IACH,IAAI,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M,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;IAE5B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACxC;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH"}
1
+ {"version":3,"file":"tools.d.mts","sourceRoot":"","sources":["../../../src/resources/senders/agent/tools.ts"],"names":[],"mappings":"AAEA,kCAA8B"}
@@ -1,271 +1,2 @@
1
- import { APIResource } from "../../../core/resource.js";
2
- import { APIPromise } from "../../../core/api-promise.js";
3
- import { Cursor, type CursorParams, PagePromise } from "../../../core/pagination.js";
4
- import { RequestOptions } from "../../../internal/request-options.js";
5
- export declare class Tools extends APIResource {
6
- /**
7
- * Create a new tool for an agent. Tools allow the agent to call external webhooks.
8
- *
9
- * @example
10
- * ```ts
11
- * const tool = await client.senders.agent.tools.create(
12
- * 'senderId',
13
- * {
14
- * description: 'Get the status of a customer order',
15
- * name: 'get_order_status',
16
- * parameters: {
17
- * type: 'object',
18
- * properties: {
19
- * order_id: {
20
- * type: 'string',
21
- * description: 'The order ID to look up',
22
- * },
23
- * },
24
- * required: ['order_id'],
25
- * },
26
- * webhookUrl:
27
- * 'https://api.example.com/webhooks/order-status',
28
- * webhookSecret: 'whsec_...',
29
- * },
30
- * );
31
- * ```
32
- */
33
- create(senderID: string, body: ToolCreateParams, options?: RequestOptions): APIPromise<ToolCreateResponse>;
34
- /**
35
- * Get a specific tool.
36
- *
37
- * @example
38
- * ```ts
39
- * const tool = await client.senders.agent.tools.retrieve(
40
- * 'toolId',
41
- * { senderId: 'senderId' },
42
- * );
43
- * ```
44
- */
45
- retrieve(toolID: string, params: ToolRetrieveParams, options?: RequestOptions): APIPromise<ToolRetrieveResponse>;
46
- /**
47
- * Update a tool.
48
- *
49
- * @example
50
- * ```ts
51
- * const tool = await client.senders.agent.tools.update(
52
- * 'toolId',
53
- * { senderId: 'senderId' },
54
- * );
55
- * ```
56
- */
57
- update(toolID: string, params: ToolUpdateParams, options?: RequestOptions): APIPromise<ToolUpdateResponse>;
58
- /**
59
- * List tools for an agent.
60
- *
61
- * @example
62
- * ```ts
63
- * // Automatically fetches more pages as needed.
64
- * for await (const agentTool of client.senders.agent.tools.list(
65
- * 'senderId',
66
- * )) {
67
- * // ...
68
- * }
69
- * ```
70
- */
71
- list(senderID: string, query?: ToolListParams | null | undefined, options?: RequestOptions): PagePromise<AgentToolsCursor, AgentTool>;
72
- /**
73
- * Delete a tool.
74
- *
75
- * @example
76
- * ```ts
77
- * await client.senders.agent.tools.delete('toolId', {
78
- * senderId: 'senderId',
79
- * });
80
- * ```
81
- */
82
- delete(toolID: string, params: ToolDeleteParams, options?: RequestOptions): APIPromise<void>;
83
- /**
84
- * Run a tool with the parameters you supply and return what it answered.
85
- *
86
- * The call is synchronous: the response carries the tool's status, body, and
87
- * duration, so a green result is evidence the tool ran rather than evidence it was
88
- * accepted. Each run is also recorded and readable afterwards via
89
- * `GET /v1/senders/{senderId}/agent/tools/{toolId}/test-runs`.
90
- *
91
- * A tool that answers with an error is reported as a run with `success: false` —
92
- * the endpoint itself still returns 200. This fires the tool's real webhook, so a
93
- * test has whatever side effects the tool has.
94
- *
95
- * @example
96
- * ```ts
97
- * const response = await client.senders.agent.tools.test(
98
- * 'toolId',
99
- * {
100
- * senderId: 'senderId',
101
- * testParams: { order_id: 'ORD-12345' },
102
- * },
103
- * );
104
- * ```
105
- */
106
- test(toolID: string, params: ToolTestParams, options?: RequestOptions): APIPromise<ToolTestResponse>;
107
- }
108
- export type AgentToolsCursor = Cursor<AgentTool>;
109
- export interface AgentTool {
110
- id: string;
111
- agentId: string;
112
- createdAt: string;
113
- /**
114
- * Description for the LLM to understand when to use this tool.
115
- */
116
- description: string;
117
- enabled: boolean;
118
- name: string;
119
- parameters: ToolParameters;
120
- updatedAt: string;
121
- /**
122
- * HTTPS URL to call when the tool is executed.
123
- */
124
- webhookUrl: string;
125
- /**
126
- * Signing secret for this tool's webhook. **Returned only when the tool is
127
- * created**, never on a later read.
128
- *
129
- * Zavu generates one if you do not supply it, and signs every call to this tool
130
- * with it: `X-Zavu-Signature: <hex>`, the HMAC-SHA256 of the request body. Verify
131
- * it before trusting the call. Lost it? Rotate with
132
- * `POST /v1/senders/{senderId}/agent/tools/{toolId}/webhook/secret`.
133
- */
134
- webhookSecret?: string;
135
- }
136
- export interface ToolParameters {
137
- properties: {
138
- [key: string]: ToolParameters.Properties;
139
- };
140
- required: Array<string>;
141
- type: 'object';
142
- }
143
- export declare namespace ToolParameters {
144
- interface Properties {
145
- description?: string;
146
- type?: string;
147
- }
148
- }
149
- export interface ToolCreateResponse {
150
- tool: AgentTool;
151
- }
152
- export interface ToolRetrieveResponse {
153
- tool: AgentTool;
154
- }
155
- export interface ToolUpdateResponse {
156
- tool: AgentTool;
157
- }
158
- export interface ToolTestResponse {
159
- /**
160
- * One run of a tool triggered from the test endpoint. Recorded so a test is
161
- * verifiable after the fact rather than only visible in the response.
162
- */
163
- run: ToolTestResponse.Run;
164
- }
165
- export declare namespace ToolTestResponse {
166
- /**
167
- * One run of a tool triggered from the test endpoint. Recorded so a test is
168
- * verifiable after the fact rather than only visible in the response.
169
- */
170
- interface Run {
171
- id: string;
172
- createdAt: string;
173
- durationMs: number;
174
- /**
175
- * Whether the tool returned without error. A tool that answered with a non-2xx
176
- * status is a failed run, not an error of this endpoint.
177
- */
178
- success: boolean;
179
- toolId: string;
180
- /**
181
- * Why the run failed, when it did.
182
- */
183
- error?: string | null;
184
- /**
185
- * The parameters the tool was called with.
186
- */
187
- params?: {
188
- [key: string]: unknown;
189
- };
190
- /**
191
- * The tool's response body, truncated.
192
- */
193
- response?: string | null;
194
- /**
195
- * HTTP status the tool's webhook returned. Absent for tools that do not go over
196
- * HTTP.
197
- */
198
- statusCode?: number | null;
199
- }
200
- }
201
- export interface ToolCreateParams {
202
- description: string;
203
- name: string;
204
- parameters: ToolParameters;
205
- /**
206
- * Must be HTTPS.
207
- */
208
- webhookUrl: string;
209
- enabled?: boolean;
210
- /**
211
- * Signing secret for the webhook. Optional: Zavu generates one when omitted and
212
- * returns it on this response only. Supply your own if you already have a secret
213
- * you want reused.
214
- */
215
- webhookSecret?: string;
216
- }
217
- export interface ToolRetrieveParams {
218
- senderId: string;
219
- }
220
- export interface ToolUpdateParams {
221
- /**
222
- * Path param
223
- */
224
- senderId: string;
225
- /**
226
- * Body param
227
- */
228
- description?: string;
229
- /**
230
- * Body param
231
- */
232
- enabled?: boolean;
233
- /**
234
- * Body param
235
- */
236
- name?: string;
237
- /**
238
- * Body param
239
- */
240
- parameters?: ToolParameters;
241
- /**
242
- * Body param
243
- */
244
- webhookSecret?: string | null;
245
- /**
246
- * Body param
247
- */
248
- webhookUrl?: string;
249
- }
250
- export interface ToolListParams extends CursorParams {
251
- enabled?: boolean;
252
- }
253
- export interface ToolDeleteParams {
254
- senderId: string;
255
- }
256
- export interface ToolTestParams {
257
- /**
258
- * Path param
259
- */
260
- senderId: string;
261
- /**
262
- * Body param: Parameters to pass to the tool for testing.
263
- */
264
- testParams: {
265
- [key: string]: unknown;
266
- };
267
- }
268
- export declare namespace Tools {
269
- export { type AgentTool as AgentTool, type ToolParameters as ToolParameters, 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, };
270
- }
1
+ export * from "./tools/index.js";
271
2
  //# sourceMappingURL=tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/resources/senders/agent/tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AACvD,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,oCAAiC;AAElF,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAI1G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zC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/resources/senders/agent/tools.ts"],"names":[],"mappings":"AAEA,iCAA8B"}
@@ -1,135 +1,6 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Tools = 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 Tools extends resource_1.APIResource {
10
- /**
11
- * Create a new tool for an agent. Tools allow the agent to call external webhooks.
12
- *
13
- * @example
14
- * ```ts
15
- * const tool = await client.senders.agent.tools.create(
16
- * 'senderId',
17
- * {
18
- * description: 'Get the status of a customer order',
19
- * name: 'get_order_status',
20
- * parameters: {
21
- * type: 'object',
22
- * properties: {
23
- * order_id: {
24
- * type: 'string',
25
- * description: 'The order ID to look up',
26
- * },
27
- * },
28
- * required: ['order_id'],
29
- * },
30
- * webhookUrl:
31
- * 'https://api.example.com/webhooks/order-status',
32
- * webhookSecret: 'whsec_...',
33
- * },
34
- * );
35
- * ```
36
- */
37
- create(senderID, body, options) {
38
- return this._client.post((0, path_1.path) `/v1/senders/${senderID}/agent/tools`, { body, ...options });
39
- }
40
- /**
41
- * Get a specific tool.
42
- *
43
- * @example
44
- * ```ts
45
- * const tool = await client.senders.agent.tools.retrieve(
46
- * 'toolId',
47
- * { senderId: 'senderId' },
48
- * );
49
- * ```
50
- */
51
- retrieve(toolID, params, options) {
52
- const { senderId } = params;
53
- return this._client.get((0, path_1.path) `/v1/senders/${senderId}/agent/tools/${toolID}`, options);
54
- }
55
- /**
56
- * Update a tool.
57
- *
58
- * @example
59
- * ```ts
60
- * const tool = await client.senders.agent.tools.update(
61
- * 'toolId',
62
- * { senderId: 'senderId' },
63
- * );
64
- * ```
65
- */
66
- update(toolID, params, options) {
67
- const { senderId, ...body } = params;
68
- return this._client.patch((0, path_1.path) `/v1/senders/${senderId}/agent/tools/${toolID}`, { body, ...options });
69
- }
70
- /**
71
- * List tools for an agent.
72
- *
73
- * @example
74
- * ```ts
75
- * // Automatically fetches more pages as needed.
76
- * for await (const agentTool of client.senders.agent.tools.list(
77
- * 'senderId',
78
- * )) {
79
- * // ...
80
- * }
81
- * ```
82
- */
83
- list(senderID, query = {}, options) {
84
- return this._client.getAPIList((0, path_1.path) `/v1/senders/${senderID}/agent/tools`, (pagination_1.Cursor), {
85
- query,
86
- ...options,
87
- });
88
- }
89
- /**
90
- * Delete a tool.
91
- *
92
- * @example
93
- * ```ts
94
- * await client.senders.agent.tools.delete('toolId', {
95
- * senderId: 'senderId',
96
- * });
97
- * ```
98
- */
99
- delete(toolID, params, options) {
100
- const { senderId } = params;
101
- return this._client.delete((0, path_1.path) `/v1/senders/${senderId}/agent/tools/${toolID}`, {
102
- ...options,
103
- headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
104
- });
105
- }
106
- /**
107
- * Run a tool with the parameters you supply and return what it answered.
108
- *
109
- * The call is synchronous: the response carries the tool's status, body, and
110
- * duration, so a green result is evidence the tool ran rather than evidence it was
111
- * accepted. Each run is also recorded and readable afterwards via
112
- * `GET /v1/senders/{senderId}/agent/tools/{toolId}/test-runs`.
113
- *
114
- * A tool that answers with an error is reported as a run with `success: false` —
115
- * the endpoint itself still returns 200. This fires the tool's real webhook, so a
116
- * test has whatever side effects the tool has.
117
- *
118
- * @example
119
- * ```ts
120
- * const response = await client.senders.agent.tools.test(
121
- * 'toolId',
122
- * {
123
- * senderId: 'senderId',
124
- * testParams: { order_id: 'ORD-12345' },
125
- * },
126
- * );
127
- * ```
128
- */
129
- test(toolID, params, options) {
130
- const { senderId, ...body } = params;
131
- return this._client.post((0, path_1.path) `/v1/senders/${senderId}/agent/tools/${toolID}/test`, { body, ...options });
132
- }
133
- }
134
- exports.Tools = Tools;
4
+ const tslib_1 = require("../../../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./tools/index.js"), exports);
135
6
  //# sourceMappingURL=tools.js.map