@letta-ai/letta-client 0.1.148 → 0.1.151

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 (322) hide show
  1. package/api/resources/agents/client/Client.d.ts +0 -15
  2. package/api/resources/agents/client/Client.js +11 -86
  3. package/api/resources/agents/resources/blocks/client/Client.d.ts +1 -1
  4. package/api/resources/agents/resources/blocks/client/Client.js +6 -6
  5. package/api/resources/agents/resources/context/client/Client.js +1 -1
  6. package/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  7. package/api/resources/agents/resources/groups/client/Client.js +1 -1
  8. package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  9. package/api/resources/agents/resources/messages/client/Client.d.ts +40 -0
  10. package/api/resources/agents/resources/messages/client/Client.js +164 -6
  11. package/api/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.d.ts +5 -0
  12. package/api/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.js +5 -0
  13. package/api/resources/agents/resources/messages/types/index.d.ts +1 -0
  14. package/api/resources/agents/resources/messages/types/index.js +1 -0
  15. package/api/resources/agents/resources/passages/client/Client.js +4 -4
  16. package/api/resources/agents/resources/sources/client/Client.js +3 -3
  17. package/api/resources/agents/resources/templates/client/Client.js +3 -3
  18. package/api/resources/agents/resources/tools/client/Client.js +3 -3
  19. package/api/resources/batches/client/Client.js +4 -4
  20. package/api/resources/blocks/client/Client.js +6 -6
  21. package/api/resources/blocks/resources/agents/client/Client.d.ts +2 -1
  22. package/api/resources/blocks/resources/agents/client/Client.js +15 -3
  23. package/api/resources/blocks/resources/agents/client/index.d.ts +1 -1
  24. package/api/resources/blocks/resources/agents/client/index.js +15 -0
  25. package/api/resources/blocks/resources/agents/client/requests/AgentsListRequest.d.ts +13 -0
  26. package/api/resources/blocks/resources/agents/client/requests/AgentsListRequest.js +5 -0
  27. package/api/resources/blocks/resources/agents/client/requests/index.d.ts +1 -0
  28. package/api/resources/blocks/resources/agents/client/requests/index.js +2 -0
  29. package/api/resources/blocks/resources/index.d.ts +1 -0
  30. package/api/resources/blocks/resources/index.js +4 -0
  31. package/api/resources/clientSideAccessTokens/client/Client.d.ts +12 -0
  32. package/api/resources/clientSideAccessTokens/client/Client.js +76 -3
  33. package/api/resources/clientSideAccessTokens/client/requests/ClientSideAccessTokensListClientSideAccessTokensRequest.d.ts +21 -0
  34. package/api/resources/clientSideAccessTokens/client/requests/ClientSideAccessTokensListClientSideAccessTokensRequest.js +5 -0
  35. package/api/resources/clientSideAccessTokens/client/requests/index.d.ts +1 -0
  36. package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.d.ts +8 -0
  37. package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.js +5 -0
  38. package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.d.ts +10 -0
  39. package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.js +5 -0
  40. package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.d.ts +8 -0
  41. package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.js +5 -0
  42. package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.d.ts +9 -0
  43. package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.js +5 -0
  44. package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.d.ts +10 -0
  45. package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.js +12 -0
  46. package/api/resources/clientSideAccessTokens/types/index.d.ts +5 -0
  47. package/api/resources/clientSideAccessTokens/types/index.js +5 -0
  48. package/api/resources/embeddingModels/client/Client.js +1 -1
  49. package/api/resources/groups/client/Client.js +6 -6
  50. package/api/resources/groups/resources/messages/client/Client.js +5 -5
  51. package/api/resources/health/client/Client.js +1 -1
  52. package/api/resources/identities/client/Client.js +7 -7
  53. package/api/resources/identities/resources/properties/client/Client.js +1 -1
  54. package/api/resources/jobs/client/Client.js +5 -5
  55. package/api/resources/messages/client/Client.js +1 -1
  56. package/api/resources/models/client/Client.js +1 -1
  57. package/api/resources/projects/client/Client.js +1 -1
  58. package/api/resources/providers/client/Client.js +5 -5
  59. package/api/resources/runs/client/Client.js +4 -4
  60. package/api/resources/runs/resources/messages/client/Client.js +1 -1
  61. package/api/resources/runs/resources/steps/client/Client.js +1 -1
  62. package/api/resources/runs/resources/usage/client/Client.js +1 -1
  63. package/api/resources/sources/client/Client.d.ts +18 -0
  64. package/api/resources/sources/client/Client.js +87 -8
  65. package/api/resources/sources/client/requests/GetSourcesMetadataRequest.d.ts +10 -0
  66. package/api/resources/sources/client/requests/GetSourcesMetadataRequest.js +5 -0
  67. package/api/resources/sources/client/requests/SourceCreate.d.ts +6 -6
  68. package/api/resources/sources/client/requests/index.d.ts +1 -0
  69. package/api/resources/sources/resources/files/client/Client.d.ts +3 -2
  70. package/api/resources/sources/resources/files/client/Client.js +11 -5
  71. package/api/resources/sources/resources/files/client/requests/BodyUploadFileToSource.d.ts +5 -0
  72. package/api/resources/sources/resources/passages/client/Client.js +1 -1
  73. package/api/resources/steps/client/Client.js +2 -2
  74. package/api/resources/steps/resources/feedback/client/Client.js +1 -1
  75. package/api/resources/tags/client/Client.js +1 -1
  76. package/api/resources/telemetry/client/Client.js +1 -1
  77. package/api/resources/templates/client/Client.js +1 -1
  78. package/api/resources/templates/resources/agents/client/Client.js +1 -1
  79. package/api/resources/templates/resources/agents/client/requests/AgentsCreateRequest.d.ts +3 -0
  80. package/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.d.ts +13 -0
  81. package/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.js +5 -0
  82. package/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.d.ts +9 -0
  83. package/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.js +11 -0
  84. package/api/resources/templates/resources/agents/types/index.d.ts +2 -0
  85. package/api/resources/templates/resources/agents/types/index.js +2 -0
  86. package/api/resources/tools/client/Client.js +19 -19
  87. package/api/resources/tools/types/UpdateMcpServerRequest.d.ts +1 -1
  88. package/api/resources/voice/client/Client.js +1 -1
  89. package/api/types/DuplicateFileHandling.d.ts +12 -0
  90. package/api/types/DuplicateFileHandling.js +11 -0
  91. package/api/types/FileMetadata.d.ts +8 -4
  92. package/api/types/FileStats.d.ts +14 -0
  93. package/api/types/FileStats.js +5 -0
  94. package/api/types/LlmConfig.d.ts +2 -0
  95. package/api/types/Message.d.ts +18 -17
  96. package/api/types/OrganizationSourcesStats.d.ts +17 -0
  97. package/api/types/OrganizationSourcesStats.js +5 -0
  98. package/api/types/Source.d.ts +4 -4
  99. package/api/types/SourceStats.d.ts +19 -0
  100. package/api/types/SourceStats.js +5 -0
  101. package/api/types/UpdateStdioMcpServer.d.ts +13 -0
  102. package/api/types/UpdateStdioMcpServer.js +5 -0
  103. package/api/types/index.d.ts +5 -0
  104. package/api/types/index.js +5 -0
  105. package/dist/api/resources/agents/client/Client.d.ts +0 -15
  106. package/dist/api/resources/agents/client/Client.js +11 -86
  107. package/dist/api/resources/agents/resources/blocks/client/Client.d.ts +1 -1
  108. package/dist/api/resources/agents/resources/blocks/client/Client.js +6 -6
  109. package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
  110. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  111. package/dist/api/resources/agents/resources/groups/client/Client.js +1 -1
  112. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  113. package/dist/api/resources/agents/resources/messages/client/Client.d.ts +40 -0
  114. package/dist/api/resources/agents/resources/messages/client/Client.js +164 -6
  115. package/dist/api/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.d.ts +5 -0
  116. package/dist/api/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.js +5 -0
  117. package/dist/api/resources/agents/resources/messages/types/index.d.ts +1 -0
  118. package/dist/api/resources/agents/resources/messages/types/index.js +1 -0
  119. package/dist/api/resources/agents/resources/passages/client/Client.js +4 -4
  120. package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
  121. package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
  122. package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
  123. package/dist/api/resources/batches/client/Client.js +4 -4
  124. package/dist/api/resources/blocks/client/Client.js +6 -6
  125. package/dist/api/resources/blocks/resources/agents/client/Client.d.ts +2 -1
  126. package/dist/api/resources/blocks/resources/agents/client/Client.js +15 -3
  127. package/dist/api/resources/blocks/resources/agents/client/index.d.ts +1 -1
  128. package/dist/api/resources/blocks/resources/agents/client/index.js +15 -0
  129. package/dist/api/resources/blocks/resources/agents/client/requests/AgentsListRequest.d.ts +13 -0
  130. package/dist/api/resources/blocks/resources/agents/client/requests/AgentsListRequest.js +5 -0
  131. package/dist/api/resources/blocks/resources/agents/client/requests/index.d.ts +1 -0
  132. package/dist/api/resources/blocks/resources/agents/client/requests/index.js +2 -0
  133. package/dist/api/resources/blocks/resources/index.d.ts +1 -0
  134. package/dist/api/resources/blocks/resources/index.js +4 -0
  135. package/dist/api/resources/clientSideAccessTokens/client/Client.d.ts +12 -0
  136. package/dist/api/resources/clientSideAccessTokens/client/Client.js +76 -3
  137. package/dist/api/resources/clientSideAccessTokens/client/requests/ClientSideAccessTokensListClientSideAccessTokensRequest.d.ts +21 -0
  138. package/dist/api/resources/clientSideAccessTokens/client/requests/ClientSideAccessTokensListClientSideAccessTokensRequest.js +5 -0
  139. package/dist/api/resources/clientSideAccessTokens/client/requests/index.d.ts +1 -0
  140. package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.d.ts +8 -0
  141. package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.js +5 -0
  142. package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.d.ts +10 -0
  143. package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.js +5 -0
  144. package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.d.ts +8 -0
  145. package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.js +5 -0
  146. package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.d.ts +9 -0
  147. package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.js +5 -0
  148. package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.d.ts +10 -0
  149. package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.js +12 -0
  150. package/dist/api/resources/clientSideAccessTokens/types/index.d.ts +5 -0
  151. package/dist/api/resources/clientSideAccessTokens/types/index.js +5 -0
  152. package/dist/api/resources/embeddingModels/client/Client.js +1 -1
  153. package/dist/api/resources/groups/client/Client.js +6 -6
  154. package/dist/api/resources/groups/resources/messages/client/Client.js +5 -5
  155. package/dist/api/resources/health/client/Client.js +1 -1
  156. package/dist/api/resources/identities/client/Client.js +7 -7
  157. package/dist/api/resources/identities/resources/properties/client/Client.js +1 -1
  158. package/dist/api/resources/jobs/client/Client.js +5 -5
  159. package/dist/api/resources/messages/client/Client.js +1 -1
  160. package/dist/api/resources/models/client/Client.js +1 -1
  161. package/dist/api/resources/projects/client/Client.js +1 -1
  162. package/dist/api/resources/providers/client/Client.js +5 -5
  163. package/dist/api/resources/runs/client/Client.js +4 -4
  164. package/dist/api/resources/runs/resources/messages/client/Client.js +1 -1
  165. package/dist/api/resources/runs/resources/steps/client/Client.js +1 -1
  166. package/dist/api/resources/runs/resources/usage/client/Client.js +1 -1
  167. package/dist/api/resources/sources/client/Client.d.ts +18 -0
  168. package/dist/api/resources/sources/client/Client.js +87 -8
  169. package/dist/api/resources/sources/client/requests/GetSourcesMetadataRequest.d.ts +10 -0
  170. package/dist/api/resources/sources/client/requests/GetSourcesMetadataRequest.js +5 -0
  171. package/dist/api/resources/sources/client/requests/SourceCreate.d.ts +6 -6
  172. package/dist/api/resources/sources/client/requests/index.d.ts +1 -0
  173. package/dist/api/resources/sources/resources/files/client/Client.d.ts +3 -2
  174. package/dist/api/resources/sources/resources/files/client/Client.js +11 -5
  175. package/dist/api/resources/sources/resources/files/client/requests/BodyUploadFileToSource.d.ts +5 -0
  176. package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
  177. package/dist/api/resources/steps/client/Client.js +2 -2
  178. package/dist/api/resources/steps/resources/feedback/client/Client.js +1 -1
  179. package/dist/api/resources/tags/client/Client.js +1 -1
  180. package/dist/api/resources/telemetry/client/Client.js +1 -1
  181. package/dist/api/resources/templates/client/Client.js +1 -1
  182. package/dist/api/resources/templates/resources/agents/client/Client.js +1 -1
  183. package/dist/api/resources/templates/resources/agents/client/requests/AgentsCreateRequest.d.ts +3 -0
  184. package/dist/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.d.ts +13 -0
  185. package/dist/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.js +5 -0
  186. package/dist/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.d.ts +9 -0
  187. package/dist/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.js +11 -0
  188. package/dist/api/resources/templates/resources/agents/types/index.d.ts +2 -0
  189. package/dist/api/resources/templates/resources/agents/types/index.js +2 -0
  190. package/dist/api/resources/tools/client/Client.js +19 -19
  191. package/dist/api/resources/tools/types/UpdateMcpServerRequest.d.ts +1 -1
  192. package/dist/api/resources/voice/client/Client.js +1 -1
  193. package/dist/api/types/DuplicateFileHandling.d.ts +12 -0
  194. package/dist/api/types/DuplicateFileHandling.js +11 -0
  195. package/dist/api/types/FileMetadata.d.ts +8 -4
  196. package/dist/api/types/FileStats.d.ts +14 -0
  197. package/dist/api/types/FileStats.js +5 -0
  198. package/dist/api/types/LlmConfig.d.ts +2 -0
  199. package/dist/api/types/Message.d.ts +18 -17
  200. package/dist/api/types/OrganizationSourcesStats.d.ts +17 -0
  201. package/dist/api/types/OrganizationSourcesStats.js +5 -0
  202. package/dist/api/types/Source.d.ts +4 -4
  203. package/dist/api/types/SourceStats.d.ts +19 -0
  204. package/dist/api/types/SourceStats.js +5 -0
  205. package/dist/api/types/UpdateStdioMcpServer.d.ts +13 -0
  206. package/dist/api/types/UpdateStdioMcpServer.js +5 -0
  207. package/dist/api/types/index.d.ts +5 -0
  208. package/dist/api/types/index.js +5 -0
  209. package/dist/serialization/resources/agents/client/index.d.ts +0 -1
  210. package/dist/serialization/resources/agents/client/index.js +1 -2
  211. package/dist/serialization/resources/agents/{client/cancelAgentRun.d.ts → resources/messages/client/cancel.d.ts} +4 -4
  212. package/dist/serialization/resources/agents/{client/cancelAgentRun.js → resources/messages/client/cancel.js} +1 -1
  213. package/dist/serialization/resources/agents/resources/messages/client/index.d.ts +2 -0
  214. package/dist/serialization/resources/agents/resources/messages/client/index.js +3 -1
  215. package/dist/serialization/resources/agents/resources/messages/client/previewRawPayload.d.ts +9 -0
  216. package/dist/serialization/resources/agents/resources/messages/client/previewRawPayload.js +41 -0
  217. package/dist/serialization/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.d.ts +12 -0
  218. package/dist/serialization/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.js +43 -0
  219. package/dist/serialization/resources/agents/resources/messages/types/index.d.ts +1 -0
  220. package/dist/serialization/resources/agents/resources/messages/types/index.js +1 -0
  221. package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.d.ts +14 -0
  222. package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.js +45 -0
  223. package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.d.ts +16 -0
  224. package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.js +47 -0
  225. package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.d.ts +14 -0
  226. package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.js +45 -0
  227. package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.d.ts +15 -0
  228. package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.js +46 -0
  229. package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.d.ts +10 -0
  230. package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.js +41 -0
  231. package/dist/serialization/resources/clientSideAccessTokens/types/index.d.ts +5 -0
  232. package/dist/serialization/resources/clientSideAccessTokens/types/index.js +5 -0
  233. package/dist/serialization/resources/sources/client/requests/SourceCreate.d.ts +3 -3
  234. package/dist/serialization/resources/sources/client/requests/SourceCreate.js +3 -3
  235. package/dist/serialization/resources/templates/resources/agents/client/requests/AgentsCreateRequest.d.ts +2 -0
  236. package/dist/serialization/resources/templates/resources/agents/client/requests/AgentsCreateRequest.js +2 -0
  237. package/dist/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.d.ts +19 -0
  238. package/dist/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.js +50 -0
  239. package/dist/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.d.ts +10 -0
  240. package/dist/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.js +41 -0
  241. package/dist/serialization/resources/templates/resources/agents/types/index.d.ts +2 -0
  242. package/dist/serialization/resources/templates/resources/agents/types/index.js +2 -0
  243. package/dist/serialization/resources/tools/types/UpdateMcpServerRequest.d.ts +2 -1
  244. package/dist/serialization/resources/tools/types/UpdateMcpServerRequest.js +2 -1
  245. package/dist/serialization/types/DuplicateFileHandling.d.ts +10 -0
  246. package/dist/serialization/types/DuplicateFileHandling.js +41 -0
  247. package/dist/serialization/types/FileMetadata.d.ts +4 -2
  248. package/dist/serialization/types/FileMetadata.js +4 -2
  249. package/dist/serialization/types/FileStats.d.ts +14 -0
  250. package/dist/serialization/types/FileStats.js +45 -0
  251. package/dist/serialization/types/LlmConfig.d.ts +1 -0
  252. package/dist/serialization/types/LlmConfig.js +1 -0
  253. package/dist/serialization/types/OrganizationSourcesStats.d.ts +16 -0
  254. package/dist/serialization/types/OrganizationSourcesStats.js +47 -0
  255. package/dist/serialization/types/Source.d.ts +2 -2
  256. package/dist/serialization/types/Source.js +2 -2
  257. package/dist/serialization/types/SourceStats.d.ts +17 -0
  258. package/dist/serialization/types/SourceStats.js +48 -0
  259. package/dist/serialization/types/UpdateStdioMcpServer.d.ts +14 -0
  260. package/dist/serialization/types/UpdateStdioMcpServer.js +45 -0
  261. package/dist/serialization/types/index.d.ts +5 -0
  262. package/dist/serialization/types/index.js +5 -0
  263. package/dist/version.d.ts +1 -1
  264. package/dist/version.js +1 -1
  265. package/package.json +1 -1
  266. package/reference.md +312 -77
  267. package/serialization/resources/agents/client/index.d.ts +0 -1
  268. package/serialization/resources/agents/client/index.js +1 -2
  269. package/serialization/resources/agents/{client/cancelAgentRun.d.ts → resources/messages/client/cancel.d.ts} +4 -4
  270. package/serialization/resources/agents/{client/cancelAgentRun.js → resources/messages/client/cancel.js} +1 -1
  271. package/serialization/resources/agents/resources/messages/client/index.d.ts +2 -0
  272. package/serialization/resources/agents/resources/messages/client/index.js +3 -1
  273. package/serialization/resources/agents/resources/messages/client/previewRawPayload.d.ts +9 -0
  274. package/serialization/resources/agents/resources/messages/client/previewRawPayload.js +41 -0
  275. package/serialization/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.d.ts +12 -0
  276. package/serialization/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.js +43 -0
  277. package/serialization/resources/agents/resources/messages/types/index.d.ts +1 -0
  278. package/serialization/resources/agents/resources/messages/types/index.js +1 -0
  279. package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.d.ts +14 -0
  280. package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.js +45 -0
  281. package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.d.ts +16 -0
  282. package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.js +47 -0
  283. package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.d.ts +14 -0
  284. package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.js +45 -0
  285. package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.d.ts +15 -0
  286. package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.js +46 -0
  287. package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.d.ts +10 -0
  288. package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.js +41 -0
  289. package/serialization/resources/clientSideAccessTokens/types/index.d.ts +5 -0
  290. package/serialization/resources/clientSideAccessTokens/types/index.js +5 -0
  291. package/serialization/resources/sources/client/requests/SourceCreate.d.ts +3 -3
  292. package/serialization/resources/sources/client/requests/SourceCreate.js +3 -3
  293. package/serialization/resources/templates/resources/agents/client/requests/AgentsCreateRequest.d.ts +2 -0
  294. package/serialization/resources/templates/resources/agents/client/requests/AgentsCreateRequest.js +2 -0
  295. package/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.d.ts +19 -0
  296. package/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.js +50 -0
  297. package/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.d.ts +10 -0
  298. package/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.js +41 -0
  299. package/serialization/resources/templates/resources/agents/types/index.d.ts +2 -0
  300. package/serialization/resources/templates/resources/agents/types/index.js +2 -0
  301. package/serialization/resources/tools/types/UpdateMcpServerRequest.d.ts +2 -1
  302. package/serialization/resources/tools/types/UpdateMcpServerRequest.js +2 -1
  303. package/serialization/types/DuplicateFileHandling.d.ts +10 -0
  304. package/serialization/types/DuplicateFileHandling.js +41 -0
  305. package/serialization/types/FileMetadata.d.ts +4 -2
  306. package/serialization/types/FileMetadata.js +4 -2
  307. package/serialization/types/FileStats.d.ts +14 -0
  308. package/serialization/types/FileStats.js +45 -0
  309. package/serialization/types/LlmConfig.d.ts +1 -0
  310. package/serialization/types/LlmConfig.js +1 -0
  311. package/serialization/types/OrganizationSourcesStats.d.ts +16 -0
  312. package/serialization/types/OrganizationSourcesStats.js +47 -0
  313. package/serialization/types/Source.d.ts +2 -2
  314. package/serialization/types/Source.js +2 -2
  315. package/serialization/types/SourceStats.d.ts +17 -0
  316. package/serialization/types/SourceStats.js +48 -0
  317. package/serialization/types/UpdateStdioMcpServer.d.ts +14 -0
  318. package/serialization/types/UpdateStdioMcpServer.js +45 -0
  319. package/serialization/types/index.d.ts +5 -0
  320. package/serialization/types/index.js +5 -0
  321. package/version.d.ts +1 -1
  322. package/version.js +1 -1
@@ -193,7 +193,7 @@ class Agents {
193
193
  method: "GET",
194
194
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
195
195
  ? 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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
196
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
197
  contentType: "application/json",
198
198
  queryParameters: _queryParams,
199
199
  requestType: "json",
@@ -261,7 +261,7 @@ class Agents {
261
261
  method: "POST",
262
262
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
263
263
  ? 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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
264
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
265
  contentType: "application/json",
266
266
  requestType: "json",
267
267
  body: serializers.CreateAgentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -328,7 +328,7 @@ class Agents {
328
328
  method: "GET",
329
329
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
330
330
  ? 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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
331
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
332
  contentType: "application/json",
333
333
  requestType: "json",
334
334
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -395,7 +395,7 @@ class Agents {
395
395
  method: "GET",
396
396
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
397
397
  ? 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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
398
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
399
  contentType: "application/json",
400
400
  requestType: "json",
401
401
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -479,7 +479,7 @@ class Agents {
479
479
  method: "POST",
480
480
  headers: Object.assign(Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
481
481
  ? 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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
482
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
483
  queryParameters: _queryParams,
484
484
  requestType: "file",
485
485
  duplex: _maybeEncodedRequest.duplex,
@@ -559,7 +559,7 @@ class Agents {
559
559
  method: "GET",
560
560
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
561
561
  ? 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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
562
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
563
  contentType: "application/json",
564
564
  queryParameters: _queryParams,
565
565
  requestType: "json",
@@ -627,7 +627,7 @@ class Agents {
627
627
  method: "DELETE",
628
628
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
629
629
  ? 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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
630
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
631
  contentType: "application/json",
632
632
  requestType: "json",
633
633
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -689,7 +689,7 @@ class Agents {
689
689
  method: "PATCH",
690
690
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
691
691
  ? 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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
692
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
693
  contentType: "application/json",
694
694
  requestType: "json",
695
695
  body: serializers.UpdateAgent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -760,7 +760,7 @@ class Agents {
760
760
  method: "PATCH",
761
761
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
762
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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
763
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
764
  contentType: "application/json",
765
765
  requestType: "json",
766
766
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -808,81 +808,6 @@ class Agents {
808
808
  }
809
809
  });
810
810
  }
811
- /**
812
- * Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
813
- *
814
- * Note to cancel active runs associated with an agent, redis is required.
815
- *
816
- * @param {string} agentId
817
- * @param {string[]} request
818
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
819
- *
820
- * @throws {@link Letta.UnprocessableEntityError}
821
- *
822
- * @example
823
- * await client.agents.cancelAgentRun("agent_id", undefined)
824
- */
825
- cancelAgentRun(agentId, request, requestOptions) {
826
- return __awaiter(this, void 0, void 0, function* () {
827
- var _a, _b, _c;
828
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
829
- 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)}/messages/cancel`),
830
- method: "POST",
831
- headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
832
- ? yield core.Supplier.get(this._options.project)
833
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
834
- contentType: "application/json",
835
- requestType: "json",
836
- body: request != null
837
- ? serializers.agents.cancelAgentRun.Request.jsonOrThrow(request, {
838
- unrecognizedObjectKeys: "strip",
839
- })
840
- : undefined,
841
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
842
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
843
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
844
- });
845
- if (_response.ok) {
846
- return serializers.agents.cancelAgentRun.Response.parseOrThrow(_response.body, {
847
- unrecognizedObjectKeys: "passthrough",
848
- allowUnrecognizedUnionMembers: true,
849
- allowUnrecognizedEnumValues: true,
850
- skipValidation: true,
851
- breadcrumbsPrefix: ["response"],
852
- });
853
- }
854
- if (_response.error.reason === "status-code") {
855
- switch (_response.error.statusCode) {
856
- case 422:
857
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
858
- unrecognizedObjectKeys: "passthrough",
859
- allowUnrecognizedUnionMembers: true,
860
- allowUnrecognizedEnumValues: true,
861
- skipValidation: true,
862
- breadcrumbsPrefix: ["response"],
863
- }));
864
- default:
865
- throw new errors.LettaError({
866
- statusCode: _response.error.statusCode,
867
- body: _response.error.body,
868
- });
869
- }
870
- }
871
- switch (_response.error.reason) {
872
- case "non-json":
873
- throw new errors.LettaError({
874
- statusCode: _response.error.statusCode,
875
- body: _response.error.rawBody,
876
- });
877
- case "timeout":
878
- throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/messages/cancel.");
879
- case "unknown":
880
- throw new errors.LettaError({
881
- message: _response.error.errorMessage,
882
- });
883
- }
884
- });
885
- }
886
811
  /**
887
812
  * Summarize an agent's conversation history to a target message length.
888
813
  *
@@ -911,7 +836,7 @@ class Agents {
911
836
  method: "POST",
912
837
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
913
838
  ? yield core.Supplier.get(this._options.project)
914
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
839
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
915
840
  contentType: "application/json",
916
841
  queryParameters: _queryParams,
917
842
  requestType: "json",
@@ -979,7 +904,7 @@ class Agents {
979
904
  method: "POST",
980
905
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
981
906
  ? yield core.Supplier.get(this._options.project)
982
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
983
908
  contentType: "application/json",
984
909
  requestType: "json",
985
910
  body: serializers.AgentsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -70,7 +70,7 @@ export declare class Blocks {
70
70
  */
71
71
  list(agentId: string, requestOptions?: Blocks.RequestOptions): Promise<Letta.Block[]>;
72
72
  /**
73
- * Attach a core memoryblock to an agent.
73
+ * Attach a core memory block to an agent.
74
74
  *
75
75
  * @param {string} agentId
76
76
  * @param {string} blockId
@@ -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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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,
@@ -265,7 +265,7 @@ class Blocks {
265
265
  });
266
266
  }
267
267
  /**
268
- * Attach a core memoryblock to an agent.
268
+ * Attach a core memory block to an agent.
269
269
  *
270
270
  * @param {string} agentId
271
271
  * @param {string} blockId
@@ -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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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,
@@ -84,7 +84,7 @@ class Groups {
84
84
  method: "GET",
85
85
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
86
86
  ? yield core.Supplier.get(this._options.project)
87
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
87
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
88
88
  contentType: "application/json",
89
89
  queryParameters: _queryParams,
90
90
  requestType: "json",
@@ -80,7 +80,7 @@ class MemoryVariables {
80
80
  method: "GET",
81
81
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
82
82
  ? yield core.Supplier.get(this._options.project)
83
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
84
84
  contentType: "application/json",
85
85
  requestType: "json",
86
86
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -87,6 +87,21 @@ export declare class Messages {
87
87
  * It will stream the steps of the response always, and stream the tokens if 'stream_tokens' is set to True.
88
88
  */
89
89
  createStream(agentId: string, request: Letta.LettaStreamingRequest, requestOptions?: Messages.RequestOptions): Promise<core.Stream<Letta.agents.LettaStreamingResponse>>;
90
+ /**
91
+ * Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
92
+ *
93
+ * Note to cancel active runs associated with an agent, redis is required.
94
+ *
95
+ * @param {string} agentId
96
+ * @param {string[]} request
97
+ * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
98
+ *
99
+ * @throws {@link Letta.UnprocessableEntityError}
100
+ *
101
+ * @example
102
+ * await client.agents.messages.cancel("agent_id", undefined)
103
+ */
104
+ cancel(agentId: string, request?: string[], requestOptions?: Messages.RequestOptions): Promise<Record<string, unknown>>;
90
105
  /**
91
106
  * Asynchronously process a user message and return a run object.
92
107
  * The actual processing happens in the background, and the status can be checked using the run ID.
@@ -125,6 +140,31 @@ export declare class Messages {
125
140
  * await client.agents.messages.reset("agent_id")
126
141
  */
127
142
  reset(agentId: string, request?: Letta.agents.MessagesResetRequest, requestOptions?: Messages.RequestOptions): Promise<Letta.AgentState>;
143
+ /**
144
+ * Inspect the raw LLM request payload without sending it.
145
+ *
146
+ * This endpoint processes the message through the agent loop up until
147
+ * the LLM request, then returns the raw request payload that would
148
+ * be sent to the LLM provider. Useful for debugging and inspection.
149
+ *
150
+ * @param {string} agentId
151
+ * @param {Letta.agents.MessagesPreviewRawPayloadRequest} request
152
+ * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
153
+ *
154
+ * @throws {@link Letta.UnprocessableEntityError}
155
+ *
156
+ * @example
157
+ * await client.agents.messages.previewRawPayload("agent_id", {
158
+ * messages: [{
159
+ * role: "user",
160
+ * content: [{
161
+ * type: "text",
162
+ * text: "text"
163
+ * }]
164
+ * }]
165
+ * })
166
+ */
167
+ previewRawPayload(agentId: string, request: Letta.agents.MessagesPreviewRawPayloadRequest, requestOptions?: Messages.RequestOptions): Promise<Record<string, unknown>>;
128
168
  protected _getCustomAuthorizationHeaders(): Promise<{
129
169
  Authorization: string;
130
170
  }>;
@@ -102,7 +102,7 @@ class Messages {
102
102
  method: "GET",
103
103
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
104
104
  ? yield core.Supplier.get(this._options.project)
105
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
105
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
106
106
  contentType: "application/json",
107
107
  queryParameters: _queryParams,
108
108
  requestType: "json",
@@ -180,7 +180,7 @@ class Messages {
180
180
  method: "POST",
181
181
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
182
182
  ? yield core.Supplier.get(this._options.project)
183
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
183
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
184
184
  contentType: "application/json",
185
185
  requestType: "json",
186
186
  body: serializers.LettaRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -252,7 +252,7 @@ class Messages {
252
252
  method: "PATCH",
253
253
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
254
254
  ? yield core.Supplier.get(this._options.project)
255
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
255
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
256
256
  contentType: "application/json",
257
257
  requestType: "json",
258
258
  body: serializers.agents.MessagesModifyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -314,7 +314,7 @@ class Messages {
314
314
  method: "POST",
315
315
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
316
316
  ? yield core.Supplier.get(this._options.project)
317
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
317
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
318
318
  contentType: "application/json",
319
319
  requestType: "json",
320
320
  body: serializers.LettaStreamingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -374,6 +374,81 @@ class Messages {
374
374
  }
375
375
  });
376
376
  }
377
+ /**
378
+ * Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
379
+ *
380
+ * Note to cancel active runs associated with an agent, redis is required.
381
+ *
382
+ * @param {string} agentId
383
+ * @param {string[]} request
384
+ * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
385
+ *
386
+ * @throws {@link Letta.UnprocessableEntityError}
387
+ *
388
+ * @example
389
+ * await client.agents.messages.cancel("agent_id", undefined)
390
+ */
391
+ cancel(agentId, request, requestOptions) {
392
+ return __awaiter(this, void 0, void 0, function* () {
393
+ var _a, _b, _c;
394
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
395
+ 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)}/messages/cancel`),
396
+ method: "POST",
397
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
398
+ ? yield core.Supplier.get(this._options.project)
399
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
400
+ contentType: "application/json",
401
+ requestType: "json",
402
+ body: request != null
403
+ ? serializers.agents.messages.cancel.Request.jsonOrThrow(request, {
404
+ unrecognizedObjectKeys: "strip",
405
+ })
406
+ : undefined,
407
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
408
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
409
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
410
+ });
411
+ if (_response.ok) {
412
+ return serializers.agents.messages.cancel.Response.parseOrThrow(_response.body, {
413
+ unrecognizedObjectKeys: "passthrough",
414
+ allowUnrecognizedUnionMembers: true,
415
+ allowUnrecognizedEnumValues: true,
416
+ skipValidation: true,
417
+ breadcrumbsPrefix: ["response"],
418
+ });
419
+ }
420
+ if (_response.error.reason === "status-code") {
421
+ switch (_response.error.statusCode) {
422
+ case 422:
423
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
424
+ unrecognizedObjectKeys: "passthrough",
425
+ allowUnrecognizedUnionMembers: true,
426
+ allowUnrecognizedEnumValues: true,
427
+ skipValidation: true,
428
+ breadcrumbsPrefix: ["response"],
429
+ }));
430
+ default:
431
+ throw new errors.LettaError({
432
+ statusCode: _response.error.statusCode,
433
+ body: _response.error.body,
434
+ });
435
+ }
436
+ }
437
+ switch (_response.error.reason) {
438
+ case "non-json":
439
+ throw new errors.LettaError({
440
+ statusCode: _response.error.statusCode,
441
+ body: _response.error.rawBody,
442
+ });
443
+ case "timeout":
444
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/messages/cancel.");
445
+ case "unknown":
446
+ throw new errors.LettaError({
447
+ message: _response.error.errorMessage,
448
+ });
449
+ }
450
+ });
451
+ }
377
452
  /**
378
453
  * Asynchronously process a user message and return a run object.
379
454
  * The actual processing happens in the background, and the status can be checked using the run ID.
@@ -406,7 +481,7 @@ class Messages {
406
481
  method: "POST",
407
482
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
408
483
  ? yield core.Supplier.get(this._options.project)
409
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
484
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
410
485
  contentType: "application/json",
411
486
  requestType: "json",
412
487
  body: serializers.agents.LettaAsyncRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -480,7 +555,7 @@ class Messages {
480
555
  method: "PATCH",
481
556
  headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
482
557
  ? yield core.Supplier.get(this._options.project)
483
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
558
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
484
559
  contentType: "application/json",
485
560
  queryParameters: _queryParams,
486
561
  requestType: "json",
@@ -529,6 +604,89 @@ class Messages {
529
604
  }
530
605
  });
531
606
  }
607
+ /**
608
+ * Inspect the raw LLM request payload without sending it.
609
+ *
610
+ * This endpoint processes the message through the agent loop up until
611
+ * the LLM request, then returns the raw request payload that would
612
+ * be sent to the LLM provider. Useful for debugging and inspection.
613
+ *
614
+ * @param {string} agentId
615
+ * @param {Letta.agents.MessagesPreviewRawPayloadRequest} request
616
+ * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
617
+ *
618
+ * @throws {@link Letta.UnprocessableEntityError}
619
+ *
620
+ * @example
621
+ * await client.agents.messages.previewRawPayload("agent_id", {
622
+ * messages: [{
623
+ * role: "user",
624
+ * content: [{
625
+ * type: "text",
626
+ * text: "text"
627
+ * }]
628
+ * }]
629
+ * })
630
+ */
631
+ previewRawPayload(agentId, request, requestOptions) {
632
+ return __awaiter(this, void 0, void 0, function* () {
633
+ var _a, _b, _c;
634
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
635
+ 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)}/messages/preview-raw-payload`),
636
+ method: "POST",
637
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
638
+ ? yield core.Supplier.get(this._options.project)
639
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
+ contentType: "application/json",
641
+ requestType: "json",
642
+ body: serializers.agents.MessagesPreviewRawPayloadRequest.jsonOrThrow(request, {
643
+ unrecognizedObjectKeys: "strip",
644
+ }),
645
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
646
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
647
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
648
+ });
649
+ if (_response.ok) {
650
+ return serializers.agents.messages.previewRawPayload.Response.parseOrThrow(_response.body, {
651
+ unrecognizedObjectKeys: "passthrough",
652
+ allowUnrecognizedUnionMembers: true,
653
+ allowUnrecognizedEnumValues: true,
654
+ skipValidation: true,
655
+ breadcrumbsPrefix: ["response"],
656
+ });
657
+ }
658
+ if (_response.error.reason === "status-code") {
659
+ switch (_response.error.statusCode) {
660
+ case 422:
661
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
662
+ unrecognizedObjectKeys: "passthrough",
663
+ allowUnrecognizedUnionMembers: true,
664
+ allowUnrecognizedEnumValues: true,
665
+ skipValidation: true,
666
+ breadcrumbsPrefix: ["response"],
667
+ }));
668
+ default:
669
+ throw new errors.LettaError({
670
+ statusCode: _response.error.statusCode,
671
+ body: _response.error.body,
672
+ });
673
+ }
674
+ }
675
+ switch (_response.error.reason) {
676
+ case "non-json":
677
+ throw new errors.LettaError({
678
+ statusCode: _response.error.statusCode,
679
+ body: _response.error.rawBody,
680
+ });
681
+ case "timeout":
682
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/messages/preview-raw-payload.");
683
+ case "unknown":
684
+ throw new errors.LettaError({
685
+ message: _response.error.errorMessage,
686
+ });
687
+ }
688
+ });
689
+ }
532
690
  _getCustomAuthorizationHeaders() {
533
691
  return __awaiter(this, void 0, void 0, function* () {
534
692
  const tokenValue = yield core.Supplier.get(this._options.token);
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Letta from "../../../../../index";
5
+ export type MessagesPreviewRawPayloadRequest = Letta.LettaRequest | Letta.LettaStreamingRequest;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
1
  export * from "./MessagesModifyRequest";
2
2
  export * from "./MessagesModifyResponse";
3
3
  export * from "./LettaStreamingResponse";
4
+ export * from "./MessagesPreviewRawPayloadRequest";