@letta-ai/letta-client 0.1.161 → 0.1.162

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 (264) hide show
  1. package/api/resources/agents/client/Client.d.ts +6 -48
  2. package/api/resources/agents/client/Client.js +34 -231
  3. package/api/resources/agents/resources/blocks/client/Client.js +5 -5
  4. package/api/resources/agents/resources/context/client/Client.js +1 -1
  5. package/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  6. package/api/resources/agents/resources/files/client/Client.d.ts +83 -0
  7. package/api/resources/agents/resources/files/client/Client.js +276 -0
  8. package/api/resources/agents/resources/files/client/index.d.ts +1 -0
  9. package/api/resources/agents/resources/files/client/index.js +2 -0
  10. package/api/resources/agents/resources/files/index.d.ts +1 -0
  11. package/api/resources/agents/resources/files/index.js +17 -0
  12. package/api/resources/agents/resources/folders/client/Client.d.ts +74 -0
  13. package/api/resources/agents/resources/folders/client/Client.js +272 -0
  14. package/api/resources/agents/resources/folders/client/index.d.ts +1 -0
  15. package/api/resources/agents/resources/folders/client/index.js +2 -0
  16. package/api/resources/agents/resources/folders/index.d.ts +1 -0
  17. package/api/resources/agents/resources/folders/index.js +17 -0
  18. package/api/resources/agents/resources/groups/client/Client.js +1 -1
  19. package/api/resources/agents/resources/index.d.ts +2 -0
  20. package/api/resources/agents/resources/index.js +3 -1
  21. package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  22. package/api/resources/agents/resources/messages/client/Client.js +8 -8
  23. package/api/resources/agents/resources/passages/client/Client.js +4 -4
  24. package/api/resources/agents/resources/sources/client/Client.js +3 -3
  25. package/api/resources/agents/resources/templates/client/Client.js +3 -3
  26. package/api/resources/agents/resources/tools/client/Client.js +3 -3
  27. package/api/resources/batches/client/Client.js +4 -4
  28. package/api/resources/blocks/client/Client.js +6 -6
  29. package/api/resources/blocks/resources/agents/client/Client.js +1 -1
  30. package/api/resources/clientSideAccessTokens/client/Client.js +3 -3
  31. package/api/resources/embeddingModels/client/Client.js +1 -1
  32. package/api/resources/folders/client/Client.d.ts +20 -69
  33. package/api/resources/folders/client/Client.js +36 -326
  34. package/api/resources/folders/client/requests/index.d.ts +0 -3
  35. package/api/resources/folders/index.d.ts +1 -0
  36. package/api/resources/folders/index.js +1 -0
  37. package/api/resources/folders/resources/files/client/Client.d.ts +78 -0
  38. package/api/resources/folders/resources/files/client/Client.js +289 -0
  39. package/api/resources/folders/resources/files/client/index.d.ts +1 -0
  40. package/api/resources/folders/resources/files/client/index.js +17 -0
  41. package/api/resources/folders/{client → resources/files/client}/requests/BodyUploadFileToFolder.d.ts +1 -1
  42. package/{dist/api/resources/folders/client/requests/ListFolderFilesRequest.d.ts → api/resources/folders/resources/files/client/requests/FilesListRequest.d.ts} +1 -1
  43. package/api/resources/folders/resources/files/client/requests/index.d.ts +2 -0
  44. package/api/resources/folders/resources/files/client/requests/index.js +2 -0
  45. package/api/resources/folders/resources/files/index.d.ts +1 -0
  46. package/api/resources/folders/resources/files/index.js +17 -0
  47. package/api/resources/folders/resources/index.d.ts +4 -0
  48. package/api/resources/folders/resources/index.js +43 -0
  49. package/api/resources/folders/resources/passages/client/Client.d.ts +49 -0
  50. package/api/resources/folders/resources/passages/client/Client.js +149 -0
  51. package/api/resources/folders/resources/passages/client/index.d.ts +1 -0
  52. package/api/resources/folders/resources/passages/client/index.js +17 -0
  53. package/api/resources/folders/{client/requests/ListFolderPassagesRequest.d.ts → resources/passages/client/requests/PassagesListRequest.d.ts} +1 -1
  54. package/api/resources/folders/resources/passages/client/requests/index.d.ts +1 -0
  55. package/api/resources/folders/resources/passages/client/requests/index.js +2 -0
  56. package/api/resources/folders/resources/passages/index.d.ts +1 -0
  57. package/api/resources/folders/resources/passages/index.js +17 -0
  58. package/api/resources/groups/client/Client.js +6 -6
  59. package/api/resources/groups/resources/messages/client/Client.js +5 -5
  60. package/api/resources/health/client/Client.js +1 -1
  61. package/api/resources/identities/client/Client.js +7 -7
  62. package/api/resources/identities/resources/properties/client/Client.js +1 -1
  63. package/api/resources/jobs/client/Client.js +5 -5
  64. package/api/resources/messages/client/Client.js +1 -1
  65. package/api/resources/models/client/Client.js +1 -1
  66. package/api/resources/projects/client/Client.js +1 -1
  67. package/api/resources/providers/client/Client.js +5 -5
  68. package/api/resources/runs/client/Client.js +4 -4
  69. package/api/resources/runs/resources/messages/client/Client.js +1 -1
  70. package/api/resources/runs/resources/steps/client/Client.js +1 -1
  71. package/api/resources/runs/resources/usage/client/Client.js +1 -1
  72. package/api/resources/sources/client/Client.js +10 -10
  73. package/api/resources/sources/resources/files/client/Client.js +3 -3
  74. package/api/resources/sources/resources/passages/client/Client.js +1 -1
  75. package/api/resources/steps/client/Client.js +2 -2
  76. package/api/resources/steps/resources/feedback/client/Client.js +1 -1
  77. package/api/resources/tags/client/Client.js +1 -1
  78. package/api/resources/telemetry/client/Client.js +1 -1
  79. package/api/resources/templates/client/Client.js +1 -1
  80. package/api/resources/templates/resources/agents/client/Client.js +1 -1
  81. package/api/resources/tools/client/Client.js +19 -19
  82. package/api/resources/voice/client/Client.js +1 -1
  83. package/dist/api/resources/agents/client/Client.d.ts +6 -48
  84. package/dist/api/resources/agents/client/Client.js +34 -231
  85. package/dist/api/resources/agents/resources/blocks/client/Client.js +5 -5
  86. package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
  87. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  88. package/dist/api/resources/agents/resources/files/client/Client.d.ts +83 -0
  89. package/dist/api/resources/agents/resources/files/client/Client.js +276 -0
  90. package/dist/api/resources/agents/resources/files/client/index.d.ts +1 -0
  91. package/dist/api/resources/agents/resources/files/client/index.js +2 -0
  92. package/dist/api/resources/agents/resources/files/index.d.ts +1 -0
  93. package/dist/api/resources/agents/resources/files/index.js +17 -0
  94. package/dist/api/resources/agents/resources/folders/client/Client.d.ts +74 -0
  95. package/dist/api/resources/agents/resources/folders/client/Client.js +272 -0
  96. package/dist/api/resources/agents/resources/folders/client/index.d.ts +1 -0
  97. package/dist/api/resources/agents/resources/folders/client/index.js +2 -0
  98. package/dist/api/resources/agents/resources/folders/index.d.ts +1 -0
  99. package/dist/api/resources/agents/resources/folders/index.js +17 -0
  100. package/dist/api/resources/agents/resources/groups/client/Client.js +1 -1
  101. package/dist/api/resources/agents/resources/index.d.ts +2 -0
  102. package/dist/api/resources/agents/resources/index.js +3 -1
  103. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  104. package/dist/api/resources/agents/resources/messages/client/Client.js +8 -8
  105. package/dist/api/resources/agents/resources/passages/client/Client.js +4 -4
  106. package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
  107. package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
  108. package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
  109. package/dist/api/resources/batches/client/Client.js +4 -4
  110. package/dist/api/resources/blocks/client/Client.js +6 -6
  111. package/dist/api/resources/blocks/resources/agents/client/Client.js +1 -1
  112. package/dist/api/resources/clientSideAccessTokens/client/Client.js +3 -3
  113. package/dist/api/resources/embeddingModels/client/Client.js +1 -1
  114. package/dist/api/resources/folders/client/Client.d.ts +20 -69
  115. package/dist/api/resources/folders/client/Client.js +36 -326
  116. package/dist/api/resources/folders/client/requests/index.d.ts +0 -3
  117. package/dist/api/resources/folders/index.d.ts +1 -0
  118. package/dist/api/resources/folders/index.js +1 -0
  119. package/dist/api/resources/folders/resources/files/client/Client.d.ts +78 -0
  120. package/dist/api/resources/folders/resources/files/client/Client.js +289 -0
  121. package/dist/api/resources/folders/resources/files/client/index.d.ts +1 -0
  122. package/dist/api/resources/folders/resources/files/client/index.js +17 -0
  123. package/dist/api/resources/folders/{client → resources/files/client}/requests/BodyUploadFileToFolder.d.ts +1 -1
  124. package/{api/resources/folders/client/requests/ListFolderFilesRequest.d.ts → dist/api/resources/folders/resources/files/client/requests/FilesListRequest.d.ts} +1 -1
  125. package/dist/api/resources/folders/resources/files/client/requests/index.d.ts +2 -0
  126. package/dist/api/resources/folders/resources/files/client/requests/index.js +2 -0
  127. package/dist/api/resources/folders/resources/files/index.d.ts +1 -0
  128. package/dist/api/resources/folders/resources/files/index.js +17 -0
  129. package/dist/api/resources/folders/resources/index.d.ts +4 -0
  130. package/dist/api/resources/folders/resources/index.js +43 -0
  131. package/dist/api/resources/folders/resources/passages/client/Client.d.ts +49 -0
  132. package/dist/api/resources/folders/resources/passages/client/Client.js +149 -0
  133. package/dist/api/resources/folders/resources/passages/client/index.d.ts +1 -0
  134. package/dist/api/resources/folders/resources/passages/client/index.js +17 -0
  135. package/dist/api/resources/folders/{client/requests/ListFolderPassagesRequest.d.ts → resources/passages/client/requests/PassagesListRequest.d.ts} +1 -1
  136. package/dist/api/resources/folders/resources/passages/client/requests/index.d.ts +1 -0
  137. package/dist/api/resources/folders/resources/passages/client/requests/index.js +2 -0
  138. package/dist/api/resources/folders/resources/passages/index.d.ts +1 -0
  139. package/dist/api/resources/folders/resources/passages/index.js +17 -0
  140. package/dist/api/resources/groups/client/Client.js +6 -6
  141. package/dist/api/resources/groups/resources/messages/client/Client.js +5 -5
  142. package/dist/api/resources/health/client/Client.js +1 -1
  143. package/dist/api/resources/identities/client/Client.js +7 -7
  144. package/dist/api/resources/identities/resources/properties/client/Client.js +1 -1
  145. package/dist/api/resources/jobs/client/Client.js +5 -5
  146. package/dist/api/resources/messages/client/Client.js +1 -1
  147. package/dist/api/resources/models/client/Client.js +1 -1
  148. package/dist/api/resources/projects/client/Client.js +1 -1
  149. package/dist/api/resources/providers/client/Client.js +5 -5
  150. package/dist/api/resources/runs/client/Client.js +4 -4
  151. package/dist/api/resources/runs/resources/messages/client/Client.js +1 -1
  152. package/dist/api/resources/runs/resources/steps/client/Client.js +1 -1
  153. package/dist/api/resources/runs/resources/usage/client/Client.js +1 -1
  154. package/dist/api/resources/sources/client/Client.js +10 -10
  155. package/dist/api/resources/sources/resources/files/client/Client.js +3 -3
  156. package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
  157. package/dist/api/resources/steps/client/Client.js +2 -2
  158. package/dist/api/resources/steps/resources/feedback/client/Client.js +1 -1
  159. package/dist/api/resources/tags/client/Client.js +1 -1
  160. package/dist/api/resources/telemetry/client/Client.js +1 -1
  161. package/dist/api/resources/templates/client/Client.js +1 -1
  162. package/dist/api/resources/templates/resources/agents/client/Client.js +1 -1
  163. package/dist/api/resources/tools/client/Client.js +19 -19
  164. package/dist/api/resources/voice/client/Client.js +1 -1
  165. package/dist/serialization/resources/agents/client/index.d.ts +0 -2
  166. package/dist/serialization/resources/agents/client/index.js +1 -3
  167. package/dist/serialization/resources/agents/{client/openFile.d.ts → resources/files/client/closeAll.d.ts} +3 -3
  168. package/dist/serialization/resources/agents/{client/closeAllOpenFiles.js → resources/files/client/closeAll.js} +1 -1
  169. package/dist/serialization/resources/agents/resources/files/client/index.d.ts +2 -0
  170. package/dist/serialization/resources/agents/resources/files/client/index.js +38 -0
  171. package/{serialization/resources/agents/client/closeAllOpenFiles.d.ts → dist/serialization/resources/agents/resources/files/client/open.d.ts} +3 -3
  172. package/dist/serialization/resources/agents/{client/openFile.js → resources/files/client/open.js} +1 -1
  173. package/dist/serialization/resources/agents/resources/files/index.d.ts +1 -0
  174. package/dist/serialization/resources/agents/resources/files/index.js +17 -0
  175. package/dist/serialization/resources/agents/resources/folders/client/index.d.ts +1 -0
  176. package/dist/serialization/resources/agents/resources/folders/client/index.js +37 -0
  177. package/dist/serialization/resources/agents/resources/folders/client/list.d.ts +11 -0
  178. package/dist/serialization/resources/agents/resources/folders/client/list.js +42 -0
  179. package/dist/serialization/resources/agents/resources/folders/index.d.ts +1 -0
  180. package/dist/serialization/resources/agents/resources/folders/index.js +17 -0
  181. package/dist/serialization/resources/agents/resources/index.d.ts +2 -0
  182. package/dist/serialization/resources/agents/resources/index.js +3 -1
  183. package/dist/serialization/resources/folders/client/{countFolders.d.ts → count.d.ts} +1 -1
  184. package/dist/serialization/resources/folders/client/index.d.ts +3 -5
  185. package/dist/serialization/resources/folders/client/index.js +4 -6
  186. package/dist/serialization/resources/folders/client/{listFolders.d.ts → list.d.ts} +1 -1
  187. package/{serialization/resources/folders/client/getFolderIdByName.d.ts → dist/serialization/resources/folders/client/retrieveByName.d.ts} +1 -1
  188. package/dist/serialization/resources/folders/index.d.ts +1 -0
  189. package/dist/serialization/resources/folders/index.js +1 -0
  190. package/dist/serialization/resources/folders/resources/files/client/index.d.ts +1 -0
  191. package/dist/serialization/resources/folders/resources/files/client/index.js +37 -0
  192. package/dist/serialization/resources/folders/resources/files/client/list.d.ts +11 -0
  193. package/dist/serialization/resources/folders/{client/listFolderFiles.js → resources/files/client/list.js} +2 -2
  194. package/dist/serialization/resources/folders/resources/files/index.d.ts +1 -0
  195. package/dist/serialization/resources/folders/resources/files/index.js +17 -0
  196. package/dist/serialization/resources/folders/resources/index.d.ts +2 -0
  197. package/dist/serialization/resources/folders/resources/index.js +38 -0
  198. package/dist/serialization/resources/folders/resources/passages/client/index.d.ts +1 -0
  199. package/dist/serialization/resources/folders/resources/passages/client/index.js +37 -0
  200. package/dist/serialization/resources/folders/resources/passages/client/list.d.ts +11 -0
  201. package/dist/serialization/resources/folders/{client/listFolderPassages.js → resources/passages/client/list.js} +2 -2
  202. package/dist/serialization/resources/folders/resources/passages/index.d.ts +1 -0
  203. package/dist/serialization/resources/folders/resources/passages/index.js +17 -0
  204. package/dist/version.d.ts +1 -1
  205. package/dist/version.js +1 -1
  206. package/package.json +1 -1
  207. package/reference.md +1144 -931
  208. package/serialization/resources/agents/client/index.d.ts +0 -2
  209. package/serialization/resources/agents/client/index.js +1 -3
  210. package/serialization/resources/agents/{client/openFile.d.ts → resources/files/client/closeAll.d.ts} +3 -3
  211. package/serialization/resources/agents/{client/closeAllOpenFiles.js → resources/files/client/closeAll.js} +1 -1
  212. package/serialization/resources/agents/resources/files/client/index.d.ts +2 -0
  213. package/serialization/resources/agents/resources/files/client/index.js +38 -0
  214. package/{dist/serialization/resources/agents/client/closeAllOpenFiles.d.ts → serialization/resources/agents/resources/files/client/open.d.ts} +3 -3
  215. package/serialization/resources/agents/{client/openFile.js → resources/files/client/open.js} +1 -1
  216. package/serialization/resources/agents/resources/files/index.d.ts +1 -0
  217. package/serialization/resources/agents/resources/files/index.js +17 -0
  218. package/serialization/resources/agents/resources/folders/client/index.d.ts +1 -0
  219. package/serialization/resources/agents/resources/folders/client/index.js +37 -0
  220. package/serialization/resources/agents/resources/folders/client/list.d.ts +11 -0
  221. package/serialization/resources/agents/resources/folders/client/list.js +42 -0
  222. package/serialization/resources/agents/resources/folders/index.d.ts +1 -0
  223. package/serialization/resources/agents/resources/folders/index.js +17 -0
  224. package/serialization/resources/agents/resources/index.d.ts +2 -0
  225. package/serialization/resources/agents/resources/index.js +3 -1
  226. package/serialization/resources/folders/client/{countFolders.d.ts → count.d.ts} +1 -1
  227. package/serialization/resources/folders/client/index.d.ts +3 -5
  228. package/serialization/resources/folders/client/index.js +4 -6
  229. package/serialization/resources/folders/client/{listFolders.d.ts → list.d.ts} +1 -1
  230. package/{dist/serialization/resources/folders/client/getFolderIdByName.d.ts → serialization/resources/folders/client/retrieveByName.d.ts} +1 -1
  231. package/serialization/resources/folders/index.d.ts +1 -0
  232. package/serialization/resources/folders/index.js +1 -0
  233. package/serialization/resources/folders/resources/files/client/index.d.ts +1 -0
  234. package/serialization/resources/folders/resources/files/client/index.js +37 -0
  235. package/serialization/resources/folders/resources/files/client/list.d.ts +11 -0
  236. package/serialization/resources/folders/{client/listFolderFiles.js → resources/files/client/list.js} +2 -2
  237. package/serialization/resources/folders/resources/files/index.d.ts +1 -0
  238. package/serialization/resources/folders/resources/files/index.js +17 -0
  239. package/serialization/resources/folders/resources/index.d.ts +2 -0
  240. package/serialization/resources/folders/resources/index.js +38 -0
  241. package/serialization/resources/folders/resources/passages/client/index.d.ts +1 -0
  242. package/serialization/resources/folders/resources/passages/client/index.js +37 -0
  243. package/serialization/resources/folders/resources/passages/client/list.d.ts +11 -0
  244. package/serialization/resources/folders/{client/listFolderPassages.js → resources/passages/client/list.js} +2 -2
  245. package/serialization/resources/folders/resources/passages/index.d.ts +1 -0
  246. package/serialization/resources/folders/resources/passages/index.js +17 -0
  247. package/version.d.ts +1 -1
  248. package/version.js +1 -1
  249. package/dist/serialization/resources/folders/client/listFolderFiles.d.ts +0 -11
  250. package/dist/serialization/resources/folders/client/listFolderPassages.d.ts +0 -11
  251. package/serialization/resources/folders/client/listFolderFiles.d.ts +0 -11
  252. package/serialization/resources/folders/client/listFolderPassages.d.ts +0 -11
  253. /package/api/resources/folders/{client → resources/files/client}/requests/BodyUploadFileToFolder.js +0 -0
  254. /package/api/resources/folders/{client/requests/ListFolderFilesRequest.js → resources/files/client/requests/FilesListRequest.js} +0 -0
  255. /package/api/resources/folders/{client/requests/ListFolderPassagesRequest.js → resources/passages/client/requests/PassagesListRequest.js} +0 -0
  256. /package/dist/api/resources/folders/{client → resources/files/client}/requests/BodyUploadFileToFolder.js +0 -0
  257. /package/dist/api/resources/folders/{client/requests/ListFolderFilesRequest.js → resources/files/client/requests/FilesListRequest.js} +0 -0
  258. /package/dist/api/resources/folders/{client/requests/ListFolderPassagesRequest.js → resources/passages/client/requests/PassagesListRequest.js} +0 -0
  259. /package/dist/serialization/resources/folders/client/{countFolders.js → count.js} +0 -0
  260. /package/dist/serialization/resources/folders/client/{listFolders.js → list.js} +0 -0
  261. /package/dist/serialization/resources/folders/client/{getFolderIdByName.js → retrieveByName.js} +0 -0
  262. /package/serialization/resources/folders/client/{countFolders.js → count.js} +0 -0
  263. /package/serialization/resources/folders/client/{listFolders.js → list.js} +0 -0
  264. /package/serialization/resources/folders/client/{getFolderIdByName.js → retrieveByName.js} +0 -0
@@ -0,0 +1,276 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
+ return new (P || (P = Promise))(function (resolve, reject) {
41
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
45
+ });
46
+ };
47
+ var __importDefault = (this && this.__importDefault) || function (mod) {
48
+ return (mod && mod.__esModule) ? mod : { "default": mod };
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.Files = void 0;
52
+ const environments = __importStar(require("../../../../../../environments"));
53
+ const core = __importStar(require("../../../../../../core"));
54
+ const Letta = __importStar(require("../../../../../index"));
55
+ const url_join_1 = __importDefault(require("url-join"));
56
+ const serializers = __importStar(require("../../../../../../serialization/index"));
57
+ const errors = __importStar(require("../../../../../../errors/index"));
58
+ class Files {
59
+ constructor(_options = {}) {
60
+ this._options = _options;
61
+ }
62
+ /**
63
+ * Closes all currently open files for a given agent.
64
+ *
65
+ * This endpoint updates the file state for the agent so that no files are marked as open.
66
+ * Typically used to reset the working memory view for the agent.
67
+ *
68
+ * @param {string} agentId
69
+ * @param {Files.RequestOptions} requestOptions - Request-specific configuration.
70
+ *
71
+ * @throws {@link Letta.UnprocessableEntityError}
72
+ *
73
+ * @example
74
+ * await client.agents.files.closeAll("agent_id")
75
+ */
76
+ closeAll(agentId, requestOptions) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ var _a, _b, _c;
79
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
80
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/files/close-all`),
81
+ method: "PATCH",
82
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
83
+ ? yield core.Supplier.get(this._options.project)
84
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.162", "User-Agent": "@letta-ai/letta-client/0.1.162", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
85
+ contentType: "application/json",
86
+ requestType: "json",
87
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
88
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
89
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
90
+ });
91
+ if (_response.ok) {
92
+ return serializers.agents.files.closeAll.Response.parseOrThrow(_response.body, {
93
+ unrecognizedObjectKeys: "passthrough",
94
+ allowUnrecognizedUnionMembers: true,
95
+ allowUnrecognizedEnumValues: true,
96
+ skipValidation: true,
97
+ breadcrumbsPrefix: ["response"],
98
+ });
99
+ }
100
+ if (_response.error.reason === "status-code") {
101
+ switch (_response.error.statusCode) {
102
+ case 422:
103
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
104
+ unrecognizedObjectKeys: "passthrough",
105
+ allowUnrecognizedUnionMembers: true,
106
+ allowUnrecognizedEnumValues: true,
107
+ skipValidation: true,
108
+ breadcrumbsPrefix: ["response"],
109
+ }));
110
+ default:
111
+ throw new errors.LettaError({
112
+ statusCode: _response.error.statusCode,
113
+ body: _response.error.body,
114
+ });
115
+ }
116
+ }
117
+ switch (_response.error.reason) {
118
+ case "non-json":
119
+ throw new errors.LettaError({
120
+ statusCode: _response.error.statusCode,
121
+ body: _response.error.rawBody,
122
+ });
123
+ case "timeout":
124
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files/close-all.");
125
+ case "unknown":
126
+ throw new errors.LettaError({
127
+ message: _response.error.errorMessage,
128
+ });
129
+ }
130
+ });
131
+ }
132
+ /**
133
+ * Opens a specific file for a given agent.
134
+ *
135
+ * This endpoint marks a specific file as open in the agent's file state.
136
+ * The file will be included in the agent's working memory view.
137
+ * Returns a list of file names that were closed due to LRU eviction.
138
+ *
139
+ * @param {string} agentId
140
+ * @param {string} fileId
141
+ * @param {Files.RequestOptions} requestOptions - Request-specific configuration.
142
+ *
143
+ * @throws {@link Letta.UnprocessableEntityError}
144
+ *
145
+ * @example
146
+ * await client.agents.files.open("agent_id", "file_id")
147
+ */
148
+ open(agentId, fileId, requestOptions) {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ var _a, _b, _c;
151
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
152
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/files/${encodeURIComponent(fileId)}/open`),
153
+ method: "PATCH",
154
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
155
+ ? yield core.Supplier.get(this._options.project)
156
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.162", "User-Agent": "@letta-ai/letta-client/0.1.162", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
157
+ contentType: "application/json",
158
+ requestType: "json",
159
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
160
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
161
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
162
+ });
163
+ if (_response.ok) {
164
+ return serializers.agents.files.open.Response.parseOrThrow(_response.body, {
165
+ unrecognizedObjectKeys: "passthrough",
166
+ allowUnrecognizedUnionMembers: true,
167
+ allowUnrecognizedEnumValues: true,
168
+ skipValidation: true,
169
+ breadcrumbsPrefix: ["response"],
170
+ });
171
+ }
172
+ if (_response.error.reason === "status-code") {
173
+ switch (_response.error.statusCode) {
174
+ case 422:
175
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
176
+ unrecognizedObjectKeys: "passthrough",
177
+ allowUnrecognizedUnionMembers: true,
178
+ allowUnrecognizedEnumValues: true,
179
+ skipValidation: true,
180
+ breadcrumbsPrefix: ["response"],
181
+ }));
182
+ default:
183
+ throw new errors.LettaError({
184
+ statusCode: _response.error.statusCode,
185
+ body: _response.error.body,
186
+ });
187
+ }
188
+ }
189
+ switch (_response.error.reason) {
190
+ case "non-json":
191
+ throw new errors.LettaError({
192
+ statusCode: _response.error.statusCode,
193
+ body: _response.error.rawBody,
194
+ });
195
+ case "timeout":
196
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files/{file_id}/open.");
197
+ case "unknown":
198
+ throw new errors.LettaError({
199
+ message: _response.error.errorMessage,
200
+ });
201
+ }
202
+ });
203
+ }
204
+ /**
205
+ * Closes a specific file for a given agent.
206
+ *
207
+ * This endpoint marks a specific file as closed in the agent's file state.
208
+ * The file will be removed from the agent's working memory view.
209
+ *
210
+ * @param {string} agentId
211
+ * @param {string} fileId
212
+ * @param {Files.RequestOptions} requestOptions - Request-specific configuration.
213
+ *
214
+ * @throws {@link Letta.UnprocessableEntityError}
215
+ *
216
+ * @example
217
+ * await client.agents.files.close("agent_id", "file_id")
218
+ */
219
+ close(agentId, fileId, requestOptions) {
220
+ return __awaiter(this, void 0, void 0, function* () {
221
+ var _a, _b, _c;
222
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
223
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/files/${encodeURIComponent(fileId)}/close`),
224
+ method: "PATCH",
225
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
226
+ ? yield core.Supplier.get(this._options.project)
227
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.162", "User-Agent": "@letta-ai/letta-client/0.1.162", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
228
+ contentType: "application/json",
229
+ requestType: "json",
230
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
231
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
232
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
233
+ });
234
+ if (_response.ok) {
235
+ return _response.body;
236
+ }
237
+ if (_response.error.reason === "status-code") {
238
+ switch (_response.error.statusCode) {
239
+ case 422:
240
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
241
+ unrecognizedObjectKeys: "passthrough",
242
+ allowUnrecognizedUnionMembers: true,
243
+ allowUnrecognizedEnumValues: true,
244
+ skipValidation: true,
245
+ breadcrumbsPrefix: ["response"],
246
+ }));
247
+ default:
248
+ throw new errors.LettaError({
249
+ statusCode: _response.error.statusCode,
250
+ body: _response.error.body,
251
+ });
252
+ }
253
+ }
254
+ switch (_response.error.reason) {
255
+ case "non-json":
256
+ throw new errors.LettaError({
257
+ statusCode: _response.error.statusCode,
258
+ body: _response.error.rawBody,
259
+ });
260
+ case "timeout":
261
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files/{file_id}/close.");
262
+ case "unknown":
263
+ throw new errors.LettaError({
264
+ message: _response.error.errorMessage,
265
+ });
266
+ }
267
+ });
268
+ }
269
+ _getCustomAuthorizationHeaders() {
270
+ return __awaiter(this, void 0, void 0, function* () {
271
+ const tokenValue = yield core.Supplier.get(this._options.token);
272
+ return { Authorization: `Bearer ${tokenValue}` };
273
+ });
274
+ }
275
+ }
276
+ exports.Files = Files;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client";
@@ -0,0 +1,17 @@
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
+ __exportStar(require("./client"), exports);
@@ -0,0 +1,74 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../../../environments";
5
+ import * as core from "../../../../../../core";
6
+ import * as Letta from "../../../../../index";
7
+ export declare namespace Folders {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.LettaEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ token?: core.Supplier<string | undefined>;
13
+ /** Override the X-Project header */
14
+ project?: core.Supplier<string | undefined>;
15
+ fetcher?: core.FetchFunction;
16
+ }
17
+ interface RequestOptions {
18
+ /** The maximum time to wait for a response in seconds. */
19
+ timeoutInSeconds?: number;
20
+ /** The number of times to retry the request. Defaults to 2. */
21
+ maxRetries?: number;
22
+ /** A hook to abort the request. */
23
+ abortSignal?: AbortSignal;
24
+ /** Override the X-Project header */
25
+ project?: string | undefined;
26
+ /** Additional headers to include in the request. */
27
+ headers?: Record<string, string>;
28
+ }
29
+ }
30
+ export declare class Folders {
31
+ protected readonly _options: Folders.Options;
32
+ constructor(_options?: Folders.Options);
33
+ /**
34
+ * Attach a folder to an agent.
35
+ *
36
+ * @param {string} agentId
37
+ * @param {string} folderId
38
+ * @param {Folders.RequestOptions} requestOptions - Request-specific configuration.
39
+ *
40
+ * @throws {@link Letta.UnprocessableEntityError}
41
+ *
42
+ * @example
43
+ * await client.agents.folders.attach("agent_id", "folder_id")
44
+ */
45
+ attach(agentId: string, folderId: string, requestOptions?: Folders.RequestOptions): Promise<Letta.AgentState>;
46
+ /**
47
+ * Detach a folder from an agent.
48
+ *
49
+ * @param {string} agentId
50
+ * @param {string} folderId
51
+ * @param {Folders.RequestOptions} requestOptions - Request-specific configuration.
52
+ *
53
+ * @throws {@link Letta.UnprocessableEntityError}
54
+ *
55
+ * @example
56
+ * await client.agents.folders.detach("agent_id", "folder_id")
57
+ */
58
+ detach(agentId: string, folderId: string, requestOptions?: Folders.RequestOptions): Promise<Letta.AgentState>;
59
+ /**
60
+ * Get the folders associated with an agent.
61
+ *
62
+ * @param {string} agentId
63
+ * @param {Folders.RequestOptions} requestOptions - Request-specific configuration.
64
+ *
65
+ * @throws {@link Letta.UnprocessableEntityError}
66
+ *
67
+ * @example
68
+ * await client.agents.folders.list("agent_id")
69
+ */
70
+ list(agentId: string, requestOptions?: Folders.RequestOptions): Promise<Letta.Source[]>;
71
+ protected _getCustomAuthorizationHeaders(): Promise<{
72
+ Authorization: string;
73
+ }>;
74
+ }
@@ -0,0 +1,272 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
+ return new (P || (P = Promise))(function (resolve, reject) {
41
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
45
+ });
46
+ };
47
+ var __importDefault = (this && this.__importDefault) || function (mod) {
48
+ return (mod && mod.__esModule) ? mod : { "default": mod };
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.Folders = void 0;
52
+ const environments = __importStar(require("../../../../../../environments"));
53
+ const core = __importStar(require("../../../../../../core"));
54
+ const Letta = __importStar(require("../../../../../index"));
55
+ const url_join_1 = __importDefault(require("url-join"));
56
+ const serializers = __importStar(require("../../../../../../serialization/index"));
57
+ const errors = __importStar(require("../../../../../../errors/index"));
58
+ class Folders {
59
+ constructor(_options = {}) {
60
+ this._options = _options;
61
+ }
62
+ /**
63
+ * Attach a folder to an agent.
64
+ *
65
+ * @param {string} agentId
66
+ * @param {string} folderId
67
+ * @param {Folders.RequestOptions} requestOptions - Request-specific configuration.
68
+ *
69
+ * @throws {@link Letta.UnprocessableEntityError}
70
+ *
71
+ * @example
72
+ * await client.agents.folders.attach("agent_id", "folder_id")
73
+ */
74
+ attach(agentId, folderId, requestOptions) {
75
+ return __awaiter(this, void 0, void 0, function* () {
76
+ var _a, _b, _c;
77
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
78
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/folders/attach/${encodeURIComponent(folderId)}`),
79
+ method: "PATCH",
80
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
81
+ ? yield core.Supplier.get(this._options.project)
82
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.162", "User-Agent": "@letta-ai/letta-client/0.1.162", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
83
+ contentType: "application/json",
84
+ requestType: "json",
85
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
86
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
87
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
88
+ });
89
+ if (_response.ok) {
90
+ return serializers.AgentState.parseOrThrow(_response.body, {
91
+ unrecognizedObjectKeys: "passthrough",
92
+ allowUnrecognizedUnionMembers: true,
93
+ allowUnrecognizedEnumValues: true,
94
+ skipValidation: true,
95
+ breadcrumbsPrefix: ["response"],
96
+ });
97
+ }
98
+ if (_response.error.reason === "status-code") {
99
+ switch (_response.error.statusCode) {
100
+ case 422:
101
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
102
+ unrecognizedObjectKeys: "passthrough",
103
+ allowUnrecognizedUnionMembers: true,
104
+ allowUnrecognizedEnumValues: true,
105
+ skipValidation: true,
106
+ breadcrumbsPrefix: ["response"],
107
+ }));
108
+ default:
109
+ throw new errors.LettaError({
110
+ statusCode: _response.error.statusCode,
111
+ body: _response.error.body,
112
+ });
113
+ }
114
+ }
115
+ switch (_response.error.reason) {
116
+ case "non-json":
117
+ throw new errors.LettaError({
118
+ statusCode: _response.error.statusCode,
119
+ body: _response.error.rawBody,
120
+ });
121
+ case "timeout":
122
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/folders/attach/{folder_id}.");
123
+ case "unknown":
124
+ throw new errors.LettaError({
125
+ message: _response.error.errorMessage,
126
+ });
127
+ }
128
+ });
129
+ }
130
+ /**
131
+ * Detach a folder from an agent.
132
+ *
133
+ * @param {string} agentId
134
+ * @param {string} folderId
135
+ * @param {Folders.RequestOptions} requestOptions - Request-specific configuration.
136
+ *
137
+ * @throws {@link Letta.UnprocessableEntityError}
138
+ *
139
+ * @example
140
+ * await client.agents.folders.detach("agent_id", "folder_id")
141
+ */
142
+ detach(agentId, folderId, requestOptions) {
143
+ return __awaiter(this, void 0, void 0, function* () {
144
+ var _a, _b, _c;
145
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
146
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/folders/detach/${encodeURIComponent(folderId)}`),
147
+ method: "PATCH",
148
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
149
+ ? yield core.Supplier.get(this._options.project)
150
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.162", "User-Agent": "@letta-ai/letta-client/0.1.162", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
151
+ contentType: "application/json",
152
+ requestType: "json",
153
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
154
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
155
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
156
+ });
157
+ if (_response.ok) {
158
+ return serializers.AgentState.parseOrThrow(_response.body, {
159
+ unrecognizedObjectKeys: "passthrough",
160
+ allowUnrecognizedUnionMembers: true,
161
+ allowUnrecognizedEnumValues: true,
162
+ skipValidation: true,
163
+ breadcrumbsPrefix: ["response"],
164
+ });
165
+ }
166
+ if (_response.error.reason === "status-code") {
167
+ switch (_response.error.statusCode) {
168
+ case 422:
169
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
170
+ unrecognizedObjectKeys: "passthrough",
171
+ allowUnrecognizedUnionMembers: true,
172
+ allowUnrecognizedEnumValues: true,
173
+ skipValidation: true,
174
+ breadcrumbsPrefix: ["response"],
175
+ }));
176
+ default:
177
+ throw new errors.LettaError({
178
+ statusCode: _response.error.statusCode,
179
+ body: _response.error.body,
180
+ });
181
+ }
182
+ }
183
+ switch (_response.error.reason) {
184
+ case "non-json":
185
+ throw new errors.LettaError({
186
+ statusCode: _response.error.statusCode,
187
+ body: _response.error.rawBody,
188
+ });
189
+ case "timeout":
190
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/folders/detach/{folder_id}.");
191
+ case "unknown":
192
+ throw new errors.LettaError({
193
+ message: _response.error.errorMessage,
194
+ });
195
+ }
196
+ });
197
+ }
198
+ /**
199
+ * Get the folders associated with an agent.
200
+ *
201
+ * @param {string} agentId
202
+ * @param {Folders.RequestOptions} requestOptions - Request-specific configuration.
203
+ *
204
+ * @throws {@link Letta.UnprocessableEntityError}
205
+ *
206
+ * @example
207
+ * await client.agents.folders.list("agent_id")
208
+ */
209
+ list(agentId, requestOptions) {
210
+ return __awaiter(this, void 0, void 0, function* () {
211
+ var _a, _b, _c;
212
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
213
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/folders`),
214
+ method: "GET",
215
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
216
+ ? yield core.Supplier.get(this._options.project)
217
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.162", "User-Agent": "@letta-ai/letta-client/0.1.162", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
218
+ contentType: "application/json",
219
+ requestType: "json",
220
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
221
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
222
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
223
+ });
224
+ if (_response.ok) {
225
+ return serializers.agents.folders.list.Response.parseOrThrow(_response.body, {
226
+ unrecognizedObjectKeys: "passthrough",
227
+ allowUnrecognizedUnionMembers: true,
228
+ allowUnrecognizedEnumValues: true,
229
+ skipValidation: true,
230
+ breadcrumbsPrefix: ["response"],
231
+ });
232
+ }
233
+ if (_response.error.reason === "status-code") {
234
+ switch (_response.error.statusCode) {
235
+ case 422:
236
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
237
+ unrecognizedObjectKeys: "passthrough",
238
+ allowUnrecognizedUnionMembers: true,
239
+ allowUnrecognizedEnumValues: true,
240
+ skipValidation: true,
241
+ breadcrumbsPrefix: ["response"],
242
+ }));
243
+ default:
244
+ throw new errors.LettaError({
245
+ statusCode: _response.error.statusCode,
246
+ body: _response.error.body,
247
+ });
248
+ }
249
+ }
250
+ switch (_response.error.reason) {
251
+ case "non-json":
252
+ throw new errors.LettaError({
253
+ statusCode: _response.error.statusCode,
254
+ body: _response.error.rawBody,
255
+ });
256
+ case "timeout":
257
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/folders.");
258
+ case "unknown":
259
+ throw new errors.LettaError({
260
+ message: _response.error.errorMessage,
261
+ });
262
+ }
263
+ });
264
+ }
265
+ _getCustomAuthorizationHeaders() {
266
+ return __awaiter(this, void 0, void 0, function* () {
267
+ const tokenValue = yield core.Supplier.get(this._options.token);
268
+ return { Authorization: `Bearer ${tokenValue}` };
269
+ });
270
+ }
271
+ }
272
+ exports.Folders = Folders;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client";