@letta-ai/letta-client 0.1.161 → 0.1.163

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
@@ -58,13 +58,15 @@ const errors = __importStar(require("../../../../errors/index"));
58
58
  const Client_1 = require("../resources/context/client/Client");
59
59
  const Client_2 = require("../resources/tools/client/Client");
60
60
  const Client_3 = require("../resources/sources/client/Client");
61
- const Client_4 = require("../resources/coreMemory/client/Client");
62
- const Client_5 = require("../resources/blocks/client/Client");
63
- const Client_6 = require("../resources/passages/client/Client");
64
- const Client_7 = require("../resources/messages/client/Client");
65
- const Client_8 = require("../resources/groups/client/Client");
66
- const Client_9 = require("../resources/templates/client/Client");
67
- const Client_10 = require("../resources/memoryVariables/client/Client");
61
+ const Client_4 = require("../resources/folders/client/Client");
62
+ const Client_5 = require("../resources/files/client/Client");
63
+ const Client_6 = require("../resources/coreMemory/client/Client");
64
+ const Client_7 = require("../resources/blocks/client/Client");
65
+ const Client_8 = require("../resources/passages/client/Client");
66
+ const Client_9 = require("../resources/messages/client/Client");
67
+ const Client_10 = require("../resources/groups/client/Client");
68
+ const Client_11 = require("../resources/templates/client/Client");
69
+ const Client_12 = require("../resources/memoryVariables/client/Client");
68
70
  class Agents {
69
71
  constructor(_options = {}) {
70
72
  this._options = _options;
@@ -81,33 +83,41 @@ class Agents {
81
83
  var _a;
82
84
  return ((_a = this._sources) !== null && _a !== void 0 ? _a : (this._sources = new Client_3.Sources(this._options)));
83
85
  }
86
+ get folders() {
87
+ var _a;
88
+ return ((_a = this._folders) !== null && _a !== void 0 ? _a : (this._folders = new Client_4.Folders(this._options)));
89
+ }
90
+ get files() {
91
+ var _a;
92
+ return ((_a = this._files) !== null && _a !== void 0 ? _a : (this._files = new Client_5.Files(this._options)));
93
+ }
84
94
  get coreMemory() {
85
95
  var _a;
86
- return ((_a = this._coreMemory) !== null && _a !== void 0 ? _a : (this._coreMemory = new Client_4.CoreMemory(this._options)));
96
+ return ((_a = this._coreMemory) !== null && _a !== void 0 ? _a : (this._coreMemory = new Client_6.CoreMemory(this._options)));
87
97
  }
88
98
  get blocks() {
89
99
  var _a;
90
- return ((_a = this._blocks) !== null && _a !== void 0 ? _a : (this._blocks = new Client_5.Blocks(this._options)));
100
+ return ((_a = this._blocks) !== null && _a !== void 0 ? _a : (this._blocks = new Client_7.Blocks(this._options)));
91
101
  }
92
102
  get passages() {
93
103
  var _a;
94
- return ((_a = this._passages) !== null && _a !== void 0 ? _a : (this._passages = new Client_6.Passages(this._options)));
104
+ return ((_a = this._passages) !== null && _a !== void 0 ? _a : (this._passages = new Client_8.Passages(this._options)));
95
105
  }
96
106
  get messages() {
97
107
  var _a;
98
- return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_7.Messages(this._options)));
108
+ return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_9.Messages(this._options)));
99
109
  }
100
110
  get groups() {
101
111
  var _a;
102
- return ((_a = this._groups) !== null && _a !== void 0 ? _a : (this._groups = new Client_8.Groups(this._options)));
112
+ return ((_a = this._groups) !== null && _a !== void 0 ? _a : (this._groups = new Client_10.Groups(this._options)));
103
113
  }
104
114
  get templates() {
105
115
  var _a;
106
- return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_9.Templates(this._options)));
116
+ return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_11.Templates(this._options)));
107
117
  }
108
118
  get memoryVariables() {
109
119
  var _a;
110
- return ((_a = this._memoryVariables) !== null && _a !== void 0 ? _a : (this._memoryVariables = new Client_10.MemoryVariables(this._options)));
120
+ return ((_a = this._memoryVariables) !== null && _a !== void 0 ? _a : (this._memoryVariables = new Client_12.MemoryVariables(this._options)));
111
121
  }
112
122
  /**
113
123
  * List all agents associated with a given user.
@@ -193,7 +203,7 @@ class Agents {
193
203
  method: "GET",
194
204
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
195
205
  ? yield core.Supplier.get(this._options.project)
196
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
206
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
197
207
  contentType: "application/json",
198
208
  queryParameters: _queryParams,
199
209
  requestType: "json",
@@ -261,7 +271,7 @@ class Agents {
261
271
  method: "POST",
262
272
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
263
273
  ? yield core.Supplier.get(this._options.project)
264
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
274
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
265
275
  contentType: "application/json",
266
276
  requestType: "json",
267
277
  body: serializers.CreateAgentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -328,7 +338,7 @@ class Agents {
328
338
  method: "GET",
329
339
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
330
340
  ? yield core.Supplier.get(this._options.project)
331
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
341
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
332
342
  contentType: "application/json",
333
343
  requestType: "json",
334
344
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -395,7 +405,7 @@ class Agents {
395
405
  method: "GET",
396
406
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
397
407
  ? yield core.Supplier.get(this._options.project)
398
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
408
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
399
409
  contentType: "application/json",
400
410
  requestType: "json",
401
411
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -479,7 +489,7 @@ class Agents {
479
489
  method: "POST",
480
490
  headers: Object.assign(Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
481
491
  ? yield core.Supplier.get(this._options.project)
482
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
492
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
483
493
  queryParameters: _queryParams,
484
494
  requestType: "file",
485
495
  duplex: _maybeEncodedRequest.duplex,
@@ -559,7 +569,7 @@ class Agents {
559
569
  method: "GET",
560
570
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
561
571
  ? yield core.Supplier.get(this._options.project)
562
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
572
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
563
573
  contentType: "application/json",
564
574
  queryParameters: _queryParams,
565
575
  requestType: "json",
@@ -627,7 +637,7 @@ class Agents {
627
637
  method: "DELETE",
628
638
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
629
639
  ? yield core.Supplier.get(this._options.project)
630
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
640
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
631
641
  contentType: "application/json",
632
642
  requestType: "json",
633
643
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -689,7 +699,7 @@ class Agents {
689
699
  method: "PATCH",
690
700
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
691
701
  ? yield core.Supplier.get(this._options.project)
692
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
702
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
693
703
  contentType: "application/json",
694
704
  requestType: "json",
695
705
  body: serializers.UpdateAgent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -738,213 +748,6 @@ class Agents {
738
748
  }
739
749
  });
740
750
  }
741
- /**
742
- * Closes all currently open files for a given agent.
743
- *
744
- * This endpoint updates the file state for the agent so that no files are marked as open.
745
- * Typically used to reset the working memory view for the agent.
746
- *
747
- * @param {string} agentId
748
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
749
- *
750
- * @throws {@link Letta.UnprocessableEntityError}
751
- *
752
- * @example
753
- * await client.agents.closeAllOpenFiles("agent_id")
754
- */
755
- closeAllOpenFiles(agentId, requestOptions) {
756
- return __awaiter(this, void 0, void 0, function* () {
757
- var _a, _b, _c;
758
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
759
- 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`),
760
- method: "PATCH",
761
- headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
762
- ? yield core.Supplier.get(this._options.project)
763
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
764
- contentType: "application/json",
765
- requestType: "json",
766
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
767
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
768
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
769
- });
770
- if (_response.ok) {
771
- return serializers.agents.closeAllOpenFiles.Response.parseOrThrow(_response.body, {
772
- unrecognizedObjectKeys: "passthrough",
773
- allowUnrecognizedUnionMembers: true,
774
- allowUnrecognizedEnumValues: true,
775
- skipValidation: true,
776
- breadcrumbsPrefix: ["response"],
777
- });
778
- }
779
- if (_response.error.reason === "status-code") {
780
- switch (_response.error.statusCode) {
781
- case 422:
782
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
783
- unrecognizedObjectKeys: "passthrough",
784
- allowUnrecognizedUnionMembers: true,
785
- allowUnrecognizedEnumValues: true,
786
- skipValidation: true,
787
- breadcrumbsPrefix: ["response"],
788
- }));
789
- default:
790
- throw new errors.LettaError({
791
- statusCode: _response.error.statusCode,
792
- body: _response.error.body,
793
- });
794
- }
795
- }
796
- switch (_response.error.reason) {
797
- case "non-json":
798
- throw new errors.LettaError({
799
- statusCode: _response.error.statusCode,
800
- body: _response.error.rawBody,
801
- });
802
- case "timeout":
803
- throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files/close-all.");
804
- case "unknown":
805
- throw new errors.LettaError({
806
- message: _response.error.errorMessage,
807
- });
808
- }
809
- });
810
- }
811
- /**
812
- * Opens a specific file for a given agent.
813
- *
814
- * This endpoint marks a specific file as open in the agent's file state.
815
- * The file will be included in the agent's working memory view.
816
- * Returns a list of file names that were closed due to LRU eviction.
817
- *
818
- * @param {string} agentId
819
- * @param {string} fileId
820
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
821
- *
822
- * @throws {@link Letta.UnprocessableEntityError}
823
- *
824
- * @example
825
- * await client.agents.openFile("agent_id", "file_id")
826
- */
827
- openFile(agentId, fileId, requestOptions) {
828
- return __awaiter(this, void 0, void 0, function* () {
829
- var _a, _b, _c;
830
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
831
- 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`),
832
- method: "PATCH",
833
- headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
834
- ? yield core.Supplier.get(this._options.project)
835
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
836
- contentType: "application/json",
837
- requestType: "json",
838
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
839
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
840
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
841
- });
842
- if (_response.ok) {
843
- return serializers.agents.openFile.Response.parseOrThrow(_response.body, {
844
- unrecognizedObjectKeys: "passthrough",
845
- allowUnrecognizedUnionMembers: true,
846
- allowUnrecognizedEnumValues: true,
847
- skipValidation: true,
848
- breadcrumbsPrefix: ["response"],
849
- });
850
- }
851
- if (_response.error.reason === "status-code") {
852
- switch (_response.error.statusCode) {
853
- case 422:
854
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
855
- unrecognizedObjectKeys: "passthrough",
856
- allowUnrecognizedUnionMembers: true,
857
- allowUnrecognizedEnumValues: true,
858
- skipValidation: true,
859
- breadcrumbsPrefix: ["response"],
860
- }));
861
- default:
862
- throw new errors.LettaError({
863
- statusCode: _response.error.statusCode,
864
- body: _response.error.body,
865
- });
866
- }
867
- }
868
- switch (_response.error.reason) {
869
- case "non-json":
870
- throw new errors.LettaError({
871
- statusCode: _response.error.statusCode,
872
- body: _response.error.rawBody,
873
- });
874
- case "timeout":
875
- throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files/{file_id}/open.");
876
- case "unknown":
877
- throw new errors.LettaError({
878
- message: _response.error.errorMessage,
879
- });
880
- }
881
- });
882
- }
883
- /**
884
- * Closes a specific file for a given agent.
885
- *
886
- * This endpoint marks a specific file as closed in the agent's file state.
887
- * The file will be removed from the agent's working memory view.
888
- *
889
- * @param {string} agentId
890
- * @param {string} fileId
891
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
892
- *
893
- * @throws {@link Letta.UnprocessableEntityError}
894
- *
895
- * @example
896
- * await client.agents.closeFile("agent_id", "file_id")
897
- */
898
- closeFile(agentId, fileId, requestOptions) {
899
- return __awaiter(this, void 0, void 0, function* () {
900
- var _a, _b, _c;
901
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
902
- 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`),
903
- method: "PATCH",
904
- headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
905
- ? yield core.Supplier.get(this._options.project)
906
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
907
- contentType: "application/json",
908
- requestType: "json",
909
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
910
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
911
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
912
- });
913
- if (_response.ok) {
914
- return _response.body;
915
- }
916
- if (_response.error.reason === "status-code") {
917
- switch (_response.error.statusCode) {
918
- case 422:
919
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
920
- unrecognizedObjectKeys: "passthrough",
921
- allowUnrecognizedUnionMembers: true,
922
- allowUnrecognizedEnumValues: true,
923
- skipValidation: true,
924
- breadcrumbsPrefix: ["response"],
925
- }));
926
- default:
927
- throw new errors.LettaError({
928
- statusCode: _response.error.statusCode,
929
- body: _response.error.body,
930
- });
931
- }
932
- }
933
- switch (_response.error.reason) {
934
- case "non-json":
935
- throw new errors.LettaError({
936
- statusCode: _response.error.statusCode,
937
- body: _response.error.rawBody,
938
- });
939
- case "timeout":
940
- throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files/{file_id}/close.");
941
- case "unknown":
942
- throw new errors.LettaError({
943
- message: _response.error.errorMessage,
944
- });
945
- }
946
- });
947
- }
948
751
  /**
949
752
  * Summarize an agent's conversation history to a target message length.
950
753
  *
@@ -973,7 +776,7 @@ class Agents {
973
776
  method: "POST",
974
777
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
975
778
  ? yield core.Supplier.get(this._options.project)
976
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
779
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
977
780
  contentType: "application/json",
978
781
  queryParameters: _queryParams,
979
782
  requestType: "json",
@@ -1041,7 +844,7 @@ class Agents {
1041
844
  method: "POST",
1042
845
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
1043
846
  ? yield core.Supplier.get(this._options.project)
1044
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
847
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
1045
848
  contentType: "application/json",
1046
849
  requestType: "json",
1047
850
  body: serializers.AgentsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -79,7 +79,7 @@ class Blocks {
79
79
  method: "GET",
80
80
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
81
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.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
82
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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
83
  contentType: "application/json",
84
84
  requestType: "json",
85
85
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -148,7 +148,7 @@ class Blocks {
148
148
  method: "PATCH",
149
149
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
150
150
  ? yield core.Supplier.get(this._options.project)
151
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
152
152
  contentType: "application/json",
153
153
  requestType: "json",
154
154
  body: serializers.BlockUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -216,7 +216,7 @@ class Blocks {
216
216
  method: "GET",
217
217
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
218
218
  ? yield core.Supplier.get(this._options.project)
219
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
219
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
220
220
  contentType: "application/json",
221
221
  requestType: "json",
222
222
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -284,7 +284,7 @@ class Blocks {
284
284
  method: "PATCH",
285
285
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
286
286
  ? yield core.Supplier.get(this._options.project)
287
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
287
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
288
288
  contentType: "application/json",
289
289
  requestType: "json",
290
290
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -352,7 +352,7 @@ class Blocks {
352
352
  method: "PATCH",
353
353
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
354
354
  ? yield core.Supplier.get(this._options.project)
355
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
355
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
356
356
  contentType: "application/json",
357
357
  requestType: "json",
358
358
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -78,7 +78,7 @@ class Context {
78
78
  method: "GET",
79
79
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
80
80
  ? yield core.Supplier.get(this._options.project)
81
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
81
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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),
82
82
  contentType: "application/json",
83
83
  requestType: "json",
84
84
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -79,7 +79,7 @@ class CoreMemory {
79
79
  method: "GET",
80
80
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
81
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.161", "User-Agent": "@letta-ai/letta-client/0.1.161", "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),
82
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "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
83
  contentType: "application/json",
84
84
  requestType: "json",
85
85
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -0,0 +1,83 @@
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
+ export declare namespace Files {
7
+ interface Options {
8
+ environment?: core.Supplier<environments.LettaEnvironment | string>;
9
+ /** Specify a custom URL to connect the client to. */
10
+ baseUrl?: core.Supplier<string>;
11
+ token?: core.Supplier<string | undefined>;
12
+ /** Override the X-Project header */
13
+ project?: core.Supplier<string | undefined>;
14
+ fetcher?: core.FetchFunction;
15
+ }
16
+ interface RequestOptions {
17
+ /** The maximum time to wait for a response in seconds. */
18
+ timeoutInSeconds?: number;
19
+ /** The number of times to retry the request. Defaults to 2. */
20
+ maxRetries?: number;
21
+ /** A hook to abort the request. */
22
+ abortSignal?: AbortSignal;
23
+ /** Override the X-Project header */
24
+ project?: string | undefined;
25
+ /** Additional headers to include in the request. */
26
+ headers?: Record<string, string>;
27
+ }
28
+ }
29
+ export declare class Files {
30
+ protected readonly _options: Files.Options;
31
+ constructor(_options?: Files.Options);
32
+ /**
33
+ * Closes all currently open files for a given agent.
34
+ *
35
+ * This endpoint updates the file state for the agent so that no files are marked as open.
36
+ * Typically used to reset the working memory view for the agent.
37
+ *
38
+ * @param {string} agentId
39
+ * @param {Files.RequestOptions} requestOptions - Request-specific configuration.
40
+ *
41
+ * @throws {@link Letta.UnprocessableEntityError}
42
+ *
43
+ * @example
44
+ * await client.agents.files.closeAll("agent_id")
45
+ */
46
+ closeAll(agentId: string, requestOptions?: Files.RequestOptions): Promise<string[]>;
47
+ /**
48
+ * Opens a specific file for a given agent.
49
+ *
50
+ * This endpoint marks a specific file as open in the agent's file state.
51
+ * The file will be included in the agent's working memory view.
52
+ * Returns a list of file names that were closed due to LRU eviction.
53
+ *
54
+ * @param {string} agentId
55
+ * @param {string} fileId
56
+ * @param {Files.RequestOptions} requestOptions - Request-specific configuration.
57
+ *
58
+ * @throws {@link Letta.UnprocessableEntityError}
59
+ *
60
+ * @example
61
+ * await client.agents.files.open("agent_id", "file_id")
62
+ */
63
+ open(agentId: string, fileId: string, requestOptions?: Files.RequestOptions): Promise<string[]>;
64
+ /**
65
+ * Closes a specific file for a given agent.
66
+ *
67
+ * This endpoint marks a specific file as closed in the agent's file state.
68
+ * The file will be removed from the agent's working memory view.
69
+ *
70
+ * @param {string} agentId
71
+ * @param {string} fileId
72
+ * @param {Files.RequestOptions} requestOptions - Request-specific configuration.
73
+ *
74
+ * @throws {@link Letta.UnprocessableEntityError}
75
+ *
76
+ * @example
77
+ * await client.agents.files.close("agent_id", "file_id")
78
+ */
79
+ close(agentId: string, fileId: string, requestOptions?: Files.RequestOptions): Promise<unknown>;
80
+ protected _getCustomAuthorizationHeaders(): Promise<{
81
+ Authorization: string;
82
+ }>;
83
+ }