@letta-ai/letta-client 0.1.7 → 0.1.9

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 (811) hide show
  1. package/Client.d.ts +8 -0
  2. package/Client.js +10 -0
  3. package/README.md +9 -9
  4. package/api/errors/ConflictError.js +17 -7
  5. package/api/errors/InternalServerError.js +17 -7
  6. package/api/errors/NotFoundError.js +17 -7
  7. package/api/errors/UnprocessableEntityError.js +17 -7
  8. package/api/resources/agents/client/Client.d.ts +17 -7
  9. package/api/resources/agents/client/Client.js +116 -39
  10. package/api/resources/agents/client/requests/CreateAgentRequest.d.ts +6 -9
  11. package/api/resources/agents/client/requests/ResetMessagesRequest.d.ts +13 -0
  12. package/api/resources/agents/client/requests/ResetMessagesRequest.js +5 -0
  13. package/api/resources/agents/client/requests/index.d.ts +1 -0
  14. package/api/resources/agents/resources/archivalMemory/client/Client.d.ts +2 -0
  15. package/api/resources/agents/resources/archivalMemory/client/Client.js +31 -21
  16. package/api/resources/agents/resources/context/client/Client.d.ts +2 -0
  17. package/api/resources/agents/resources/context/client/Client.js +20 -10
  18. package/api/resources/agents/resources/coreMemory/client/Client.d.ts +2 -0
  19. package/api/resources/agents/resources/coreMemory/client/Client.js +38 -28
  20. package/api/resources/agents/resources/index.js +17 -7
  21. package/api/resources/agents/resources/memoryVariables/client/Client.d.ts +2 -0
  22. package/api/resources/agents/resources/memoryVariables/client/Client.js +20 -10
  23. package/api/resources/agents/resources/messages/client/Client.d.ts +3 -1
  24. package/api/resources/agents/resources/messages/client/Client.js +37 -27
  25. package/api/resources/agents/resources/messages/types/LettaStreamingResponse.d.ts +1 -1
  26. package/api/resources/agents/resources/messages/types/MessagesListResponse.d.ts +1 -1
  27. package/api/resources/agents/resources/messages/types/MessagesListResponseItem.d.ts +1 -1
  28. package/api/resources/agents/resources/recallMemory/client/Client.d.ts +2 -0
  29. package/api/resources/agents/resources/recallMemory/client/Client.js +20 -10
  30. package/api/resources/agents/resources/sources/client/Client.d.ts +2 -0
  31. package/api/resources/agents/resources/sources/client/Client.js +20 -10
  32. package/api/resources/agents/resources/templates/client/Client.d.ts +2 -0
  33. package/api/resources/agents/resources/templates/client/Client.js +30 -20
  34. package/api/resources/agents/resources/templates/client/requests/TemplatesCreateRequest.d.ts +1 -1
  35. package/api/resources/agents/resources/tools/client/Client.d.ts +2 -0
  36. package/api/resources/agents/resources/tools/client/Client.js +26 -16
  37. package/api/resources/agents/types/AgentsSearchRequestCombinator.d.ts +1 -1
  38. package/api/resources/agents/types/AgentsSearchRequestSearchItem.d.ts +1 -1
  39. package/api/resources/agents/types/AgentsSearchRequestSearchItemNameOperator.d.ts +1 -1
  40. package/api/resources/agents/types/AgentsSearchRequestSearchItemOrderByDirection.d.ts +1 -1
  41. package/api/resources/agents/types/AgentsSearchRequestSearchItemOrderByValue.d.ts +1 -1
  42. package/api/resources/agents/types/CreateAgentRequestToolRulesItem.d.ts +1 -1
  43. package/api/resources/agents/types/UpdateAgentToolRulesItem.d.ts +1 -1
  44. package/api/resources/blocks/client/Client.d.ts +2 -0
  45. package/api/resources/blocks/client/Client.js +40 -30
  46. package/api/resources/health/client/Client.d.ts +2 -0
  47. package/api/resources/health/client/Client.js +20 -10
  48. package/api/resources/index.d.ts +4 -0
  49. package/api/resources/index.js +22 -8
  50. package/api/resources/jobs/client/Client.d.ts +2 -0
  51. package/api/resources/jobs/client/Client.js +31 -21
  52. package/api/resources/models/client/Client.d.ts +2 -0
  53. package/api/resources/models/client/Client.js +23 -13
  54. package/api/resources/providers/client/Client.d.ts +2 -0
  55. package/api/resources/providers/client/Client.js +31 -21
  56. package/api/resources/runs/client/Client.d.ts +117 -0
  57. package/api/resources/runs/client/Client.js +510 -0
  58. package/api/resources/runs/client/index.d.ts +1 -0
  59. package/api/resources/runs/client/index.js +17 -0
  60. package/api/resources/runs/client/requests/GetRunMessagesRequest.d.ts +50 -0
  61. package/api/resources/runs/client/requests/GetRunMessagesRequest.js +5 -0
  62. package/api/resources/runs/client/requests/index.d.ts +1 -0
  63. package/api/resources/runs/client/requests/index.js +2 -0
  64. package/api/resources/runs/index.d.ts +1 -0
  65. package/api/resources/runs/index.js +17 -0
  66. package/api/resources/sources/client/Client.d.ts +2 -0
  67. package/api/resources/sources/client/Client.js +43 -33
  68. package/api/resources/sources/resources/files/client/Client.d.ts +2 -1
  69. package/api/resources/sources/resources/files/client/Client.js +28 -18
  70. package/api/resources/sources/resources/index.js +17 -7
  71. package/api/resources/sources/resources/passages/client/Client.d.ts +2 -0
  72. package/api/resources/sources/resources/passages/client/Client.js +20 -10
  73. package/api/resources/tag/client/Client.d.ts +44 -0
  74. package/api/resources/tag/client/Client.js +146 -0
  75. package/api/resources/tag/client/index.d.ts +1 -0
  76. package/api/resources/tag/client/index.js +17 -0
  77. package/api/resources/tag/client/requests/ListTagsRequest.d.ts +12 -0
  78. package/api/resources/tag/client/requests/ListTagsRequest.js +5 -0
  79. package/api/resources/tag/client/requests/index.d.ts +1 -0
  80. package/api/resources/tag/client/requests/index.js +2 -0
  81. package/api/resources/tag/index.d.ts +1 -0
  82. package/api/resources/tag/index.js +17 -0
  83. package/api/resources/tools/client/Client.d.ts +2 -0
  84. package/api/resources/tools/client/Client.js +57 -47
  85. package/api/resources/tools/client/requests/ToolRunFromSource.d.ts +1 -1
  86. package/api/resources/tools/client/requests/ToolUpdate.d.ts +0 -2
  87. package/api/types/AgentStateToolRulesItem.d.ts +1 -1
  88. package/api/types/AgentType.d.ts +1 -1
  89. package/api/types/AppAuthSchemeAuthMode.d.ts +1 -1
  90. package/api/types/ChatCompletionRequestFunctionCall.d.ts +1 -1
  91. package/api/types/ChatCompletionRequestMessagesItem.d.ts +1 -1
  92. package/api/types/ChatCompletionRequestStop.d.ts +1 -1
  93. package/api/types/ChatCompletionRequestToolChoice.d.ts +1 -1
  94. package/api/types/EmbeddingConfigEmbeddingEndpointType.d.ts +1 -1
  95. package/api/types/Job.d.ts +2 -0
  96. package/api/types/JobStatus.d.ts +1 -1
  97. package/api/types/JobType.d.ts +8 -0
  98. package/api/types/JobType.js +10 -0
  99. package/api/types/LettaResponseMessagesItem.d.ts +1 -1
  100. package/api/types/LettaSchemasToolTool.d.ts +0 -2
  101. package/api/types/LlmConfigModelEndpointType.d.ts +1 -1
  102. package/api/types/MessageCreateRole.d.ts +1 -1
  103. package/api/types/MessageRole.d.ts +1 -1
  104. package/api/types/NotFoundErrorBodyMessage.d.ts +1 -1
  105. package/api/types/Run.d.ts +34 -0
  106. package/api/types/Run.js +5 -0
  107. package/api/types/SandboxConfigCreateConfig.d.ts +1 -1
  108. package/api/types/SandboxConfigUpdateConfig.d.ts +1 -1
  109. package/api/types/SandboxType.d.ts +1 -1
  110. package/api/types/ToolCallMessageToolCall.d.ts +1 -1
  111. package/api/types/ToolCreate.d.ts +0 -2
  112. package/api/types/ToolReturnMessageStatus.d.ts +1 -1
  113. package/api/types/ToolRuleType.d.ts +1 -1
  114. package/api/types/ToolType.d.ts +1 -1
  115. package/api/types/UserMessageInputContent.d.ts +1 -1
  116. package/api/types/ValidationErrorLocItem.d.ts +1 -1
  117. package/api/types/index.d.ts +2 -0
  118. package/api/types/index.js +2 -0
  119. package/core/fetcher/APIResponse.d.ts +1 -1
  120. package/core/fetcher/Fetcher.d.ts +1 -1
  121. package/core/fetcher/Fetcher.js +2 -2
  122. package/core/fetcher/Supplier.d.ts +1 -1
  123. package/core/fetcher/createRequestUrl.js +1 -2
  124. package/core/fetcher/getFetchFn.js +18 -9
  125. package/core/fetcher/getHeader.js +1 -2
  126. package/core/fetcher/getRequestBody.js +3 -4
  127. package/core/fetcher/getResponseBody.js +1 -2
  128. package/core/fetcher/makeRequest.d.ts +1 -1
  129. package/core/fetcher/requestWithRetries.js +3 -4
  130. package/core/fetcher/signals.d.ts +0 -1
  131. package/core/fetcher/signals.js +2 -3
  132. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
  133. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
  134. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
  135. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
  136. package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
  137. package/core/form-data-utils/FormDataWrapper.d.ts +4 -4
  138. package/core/form-data-utils/FormDataWrapper.js +22 -12
  139. package/core/index.js +17 -7
  140. package/core/runtime/runtime.d.ts +1 -1
  141. package/core/runtime/runtime.js +51 -41
  142. package/core/schemas/Schema.d.ts +5 -5
  143. package/core/schemas/builders/bigint/bigint.js +1 -2
  144. package/core/schemas/builders/date/date.js +1 -2
  145. package/core/schemas/builders/enum/enum.js +1 -2
  146. package/core/schemas/builders/lazy/lazy.d.ts +1 -1
  147. package/core/schemas/builders/lazy/lazy.js +3 -4
  148. package/core/schemas/builders/lazy/lazyObject.js +1 -2
  149. package/core/schemas/builders/list/list.js +1 -2
  150. package/core/schemas/builders/literals/booleanLiteral.js +1 -2
  151. package/core/schemas/builders/literals/stringLiteral.js +1 -2
  152. package/core/schemas/builders/object/object.d.ts +1 -1
  153. package/core/schemas/builders/object/object.js +2 -3
  154. package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
  155. package/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
  156. package/core/schemas/builders/object/property.js +2 -3
  157. package/core/schemas/builders/object/types.d.ts +11 -11
  158. package/core/schemas/builders/object-like/getObjectLikeUtils.js +2 -3
  159. package/core/schemas/builders/object-like/types.d.ts +1 -1
  160. package/core/schemas/builders/record/record.js +1 -2
  161. package/core/schemas/builders/record/types.d.ts +2 -2
  162. package/core/schemas/builders/schema-utils/getSchemaUtils.js +3 -4
  163. package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
  164. package/core/schemas/builders/set/set.js +1 -2
  165. package/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
  166. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +1 -2
  167. package/core/schemas/builders/union/discriminant.js +1 -2
  168. package/core/schemas/builders/union/types.d.ts +6 -6
  169. package/core/schemas/builders/union/union.d.ts +1 -1
  170. package/core/schemas/builders/union/union.js +1 -2
  171. package/core/schemas/utils/MaybePromise.d.ts +1 -1
  172. package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +3 -3
  173. package/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
  174. package/core/schemas/utils/entries.d.ts +1 -1
  175. package/core/schemas/utils/entries.js +1 -2
  176. package/core/schemas/utils/filterObject.d.ts +1 -1
  177. package/core/schemas/utils/filterObject.js +1 -2
  178. package/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -2
  179. package/core/schemas/utils/isPlainObject.js +1 -2
  180. package/core/schemas/utils/keys.d.ts +1 -1
  181. package/core/schemas/utils/keys.js +1 -2
  182. package/core/schemas/utils/maybeSkipValidation.js +1 -2
  183. package/core/schemas/utils/partition.js +1 -2
  184. package/core/streaming-fetcher/Stream.d.ts +0 -1
  185. package/core/streaming-fetcher/Stream.js +20 -21
  186. package/dist/Client.d.ts +8 -0
  187. package/dist/Client.js +10 -0
  188. package/dist/api/errors/ConflictError.js +17 -7
  189. package/dist/api/errors/InternalServerError.js +17 -7
  190. package/dist/api/errors/NotFoundError.js +17 -7
  191. package/dist/api/errors/UnprocessableEntityError.js +17 -7
  192. package/dist/api/resources/agents/client/Client.d.ts +17 -7
  193. package/dist/api/resources/agents/client/Client.js +116 -39
  194. package/dist/api/resources/agents/client/requests/CreateAgentRequest.d.ts +6 -9
  195. package/dist/api/resources/agents/client/requests/ResetMessagesRequest.d.ts +13 -0
  196. package/dist/api/resources/agents/client/requests/ResetMessagesRequest.js +5 -0
  197. package/dist/api/resources/agents/client/requests/index.d.ts +1 -0
  198. package/dist/api/resources/agents/resources/archivalMemory/client/Client.d.ts +2 -0
  199. package/dist/api/resources/agents/resources/archivalMemory/client/Client.js +31 -21
  200. package/dist/api/resources/agents/resources/context/client/Client.d.ts +2 -0
  201. package/dist/api/resources/agents/resources/context/client/Client.js +20 -10
  202. package/dist/api/resources/agents/resources/coreMemory/client/Client.d.ts +2 -0
  203. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +38 -28
  204. package/dist/api/resources/agents/resources/index.js +17 -7
  205. package/dist/api/resources/agents/resources/memoryVariables/client/Client.d.ts +2 -0
  206. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +20 -10
  207. package/dist/api/resources/agents/resources/messages/client/Client.d.ts +3 -1
  208. package/dist/api/resources/agents/resources/messages/client/Client.js +37 -27
  209. package/dist/api/resources/agents/resources/messages/types/LettaStreamingResponse.d.ts +1 -1
  210. package/dist/api/resources/agents/resources/messages/types/MessagesListResponse.d.ts +1 -1
  211. package/dist/api/resources/agents/resources/messages/types/MessagesListResponseItem.d.ts +1 -1
  212. package/dist/api/resources/agents/resources/recallMemory/client/Client.d.ts +2 -0
  213. package/dist/api/resources/agents/resources/recallMemory/client/Client.js +20 -10
  214. package/dist/api/resources/agents/resources/sources/client/Client.d.ts +2 -0
  215. package/dist/api/resources/agents/resources/sources/client/Client.js +20 -10
  216. package/dist/api/resources/agents/resources/templates/client/Client.d.ts +2 -0
  217. package/dist/api/resources/agents/resources/templates/client/Client.js +30 -20
  218. package/dist/api/resources/agents/resources/templates/client/requests/TemplatesCreateRequest.d.ts +1 -1
  219. package/dist/api/resources/agents/resources/tools/client/Client.d.ts +2 -0
  220. package/dist/api/resources/agents/resources/tools/client/Client.js +26 -16
  221. package/dist/api/resources/agents/types/AgentsSearchRequestCombinator.d.ts +1 -1
  222. package/dist/api/resources/agents/types/AgentsSearchRequestSearchItem.d.ts +1 -1
  223. package/dist/api/resources/agents/types/AgentsSearchRequestSearchItemNameOperator.d.ts +1 -1
  224. package/dist/api/resources/agents/types/AgentsSearchRequestSearchItemOrderByDirection.d.ts +1 -1
  225. package/dist/api/resources/agents/types/AgentsSearchRequestSearchItemOrderByValue.d.ts +1 -1
  226. package/dist/api/resources/agents/types/CreateAgentRequestToolRulesItem.d.ts +1 -1
  227. package/dist/api/resources/agents/types/UpdateAgentToolRulesItem.d.ts +1 -1
  228. package/dist/api/resources/blocks/client/Client.d.ts +2 -0
  229. package/dist/api/resources/blocks/client/Client.js +40 -30
  230. package/dist/api/resources/health/client/Client.d.ts +2 -0
  231. package/dist/api/resources/health/client/Client.js +20 -10
  232. package/dist/api/resources/index.d.ts +4 -0
  233. package/dist/api/resources/index.js +22 -8
  234. package/dist/api/resources/jobs/client/Client.d.ts +2 -0
  235. package/dist/api/resources/jobs/client/Client.js +31 -21
  236. package/dist/api/resources/models/client/Client.d.ts +2 -0
  237. package/dist/api/resources/models/client/Client.js +23 -13
  238. package/dist/api/resources/providers/client/Client.d.ts +2 -0
  239. package/dist/api/resources/providers/client/Client.js +31 -21
  240. package/dist/api/resources/runs/client/Client.d.ts +117 -0
  241. package/dist/api/resources/runs/client/Client.js +510 -0
  242. package/dist/api/resources/runs/client/index.d.ts +1 -0
  243. package/dist/api/resources/runs/client/index.js +17 -0
  244. package/dist/api/resources/runs/client/requests/GetRunMessagesRequest.d.ts +50 -0
  245. package/dist/api/resources/runs/client/requests/GetRunMessagesRequest.js +5 -0
  246. package/dist/api/resources/runs/client/requests/index.d.ts +1 -0
  247. package/dist/api/resources/runs/client/requests/index.js +2 -0
  248. package/dist/api/resources/runs/index.d.ts +1 -0
  249. package/dist/api/resources/runs/index.js +17 -0
  250. package/dist/api/resources/sources/client/Client.d.ts +2 -0
  251. package/dist/api/resources/sources/client/Client.js +43 -33
  252. package/dist/api/resources/sources/resources/files/client/Client.d.ts +2 -1
  253. package/dist/api/resources/sources/resources/files/client/Client.js +28 -18
  254. package/dist/api/resources/sources/resources/index.js +17 -7
  255. package/dist/api/resources/sources/resources/passages/client/Client.d.ts +2 -0
  256. package/dist/api/resources/sources/resources/passages/client/Client.js +20 -10
  257. package/dist/api/resources/tag/client/Client.d.ts +44 -0
  258. package/dist/api/resources/tag/client/Client.js +146 -0
  259. package/dist/api/resources/tag/client/index.d.ts +1 -0
  260. package/dist/api/resources/tag/client/index.js +17 -0
  261. package/dist/api/resources/tag/client/requests/ListTagsRequest.d.ts +12 -0
  262. package/dist/api/resources/tag/client/requests/ListTagsRequest.js +5 -0
  263. package/dist/api/resources/tag/client/requests/index.d.ts +1 -0
  264. package/dist/api/resources/tag/client/requests/index.js +2 -0
  265. package/dist/api/resources/tag/index.d.ts +1 -0
  266. package/dist/api/resources/tag/index.js +17 -0
  267. package/dist/api/resources/tools/client/Client.d.ts +2 -0
  268. package/dist/api/resources/tools/client/Client.js +57 -47
  269. package/dist/api/resources/tools/client/requests/ToolRunFromSource.d.ts +1 -1
  270. package/dist/api/resources/tools/client/requests/ToolUpdate.d.ts +0 -2
  271. package/dist/api/types/AgentStateToolRulesItem.d.ts +1 -1
  272. package/dist/api/types/AgentType.d.ts +1 -1
  273. package/dist/api/types/AppAuthSchemeAuthMode.d.ts +1 -1
  274. package/dist/api/types/ChatCompletionRequestFunctionCall.d.ts +1 -1
  275. package/dist/api/types/ChatCompletionRequestMessagesItem.d.ts +1 -1
  276. package/dist/api/types/ChatCompletionRequestStop.d.ts +1 -1
  277. package/dist/api/types/ChatCompletionRequestToolChoice.d.ts +1 -1
  278. package/dist/api/types/EmbeddingConfigEmbeddingEndpointType.d.ts +1 -1
  279. package/dist/api/types/Job.d.ts +2 -0
  280. package/dist/api/types/JobStatus.d.ts +1 -1
  281. package/dist/api/types/JobType.d.ts +8 -0
  282. package/dist/api/types/JobType.js +10 -0
  283. package/dist/api/types/LettaResponseMessagesItem.d.ts +1 -1
  284. package/dist/api/types/LettaSchemasToolTool.d.ts +0 -2
  285. package/dist/api/types/LlmConfigModelEndpointType.d.ts +1 -1
  286. package/dist/api/types/MessageCreateRole.d.ts +1 -1
  287. package/dist/api/types/MessageRole.d.ts +1 -1
  288. package/dist/api/types/NotFoundErrorBodyMessage.d.ts +1 -1
  289. package/dist/api/types/Run.d.ts +34 -0
  290. package/dist/api/types/Run.js +5 -0
  291. package/dist/api/types/SandboxConfigCreateConfig.d.ts +1 -1
  292. package/dist/api/types/SandboxConfigUpdateConfig.d.ts +1 -1
  293. package/dist/api/types/SandboxType.d.ts +1 -1
  294. package/dist/api/types/ToolCallMessageToolCall.d.ts +1 -1
  295. package/dist/api/types/ToolCreate.d.ts +0 -2
  296. package/dist/api/types/ToolReturnMessageStatus.d.ts +1 -1
  297. package/dist/api/types/ToolRuleType.d.ts +1 -1
  298. package/dist/api/types/ToolType.d.ts +1 -1
  299. package/dist/api/types/UserMessageInputContent.d.ts +1 -1
  300. package/dist/api/types/ValidationErrorLocItem.d.ts +1 -1
  301. package/dist/api/types/index.d.ts +2 -0
  302. package/dist/api/types/index.js +2 -0
  303. package/dist/core/fetcher/APIResponse.d.ts +1 -1
  304. package/dist/core/fetcher/Fetcher.d.ts +1 -1
  305. package/dist/core/fetcher/Fetcher.js +2 -2
  306. package/dist/core/fetcher/Supplier.d.ts +1 -1
  307. package/dist/core/fetcher/createRequestUrl.js +1 -2
  308. package/dist/core/fetcher/getFetchFn.js +18 -9
  309. package/dist/core/fetcher/getHeader.js +1 -2
  310. package/dist/core/fetcher/getRequestBody.js +3 -4
  311. package/dist/core/fetcher/getResponseBody.js +1 -2
  312. package/dist/core/fetcher/makeRequest.d.ts +1 -1
  313. package/dist/core/fetcher/requestWithRetries.js +3 -4
  314. package/dist/core/fetcher/signals.d.ts +0 -1
  315. package/dist/core/fetcher/signals.js +2 -3
  316. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
  317. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
  318. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
  319. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
  320. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
  321. package/dist/core/form-data-utils/FormDataWrapper.d.ts +4 -4
  322. package/dist/core/form-data-utils/FormDataWrapper.js +22 -12
  323. package/dist/core/index.js +17 -7
  324. package/dist/core/runtime/runtime.d.ts +1 -1
  325. package/dist/core/runtime/runtime.js +51 -41
  326. package/dist/core/schemas/Schema.d.ts +5 -5
  327. package/dist/core/schemas/builders/bigint/bigint.js +1 -2
  328. package/dist/core/schemas/builders/date/date.js +1 -2
  329. package/dist/core/schemas/builders/enum/enum.js +1 -2
  330. package/dist/core/schemas/builders/lazy/lazy.d.ts +1 -1
  331. package/dist/core/schemas/builders/lazy/lazy.js +3 -4
  332. package/dist/core/schemas/builders/lazy/lazyObject.js +1 -2
  333. package/dist/core/schemas/builders/list/list.js +1 -2
  334. package/dist/core/schemas/builders/literals/booleanLiteral.js +1 -2
  335. package/dist/core/schemas/builders/literals/stringLiteral.js +1 -2
  336. package/dist/core/schemas/builders/object/object.d.ts +1 -1
  337. package/dist/core/schemas/builders/object/object.js +2 -3
  338. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
  339. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
  340. package/dist/core/schemas/builders/object/property.js +2 -3
  341. package/dist/core/schemas/builders/object/types.d.ts +11 -11
  342. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +2 -3
  343. package/dist/core/schemas/builders/object-like/types.d.ts +1 -1
  344. package/dist/core/schemas/builders/record/record.js +1 -2
  345. package/dist/core/schemas/builders/record/types.d.ts +2 -2
  346. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +3 -4
  347. package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
  348. package/dist/core/schemas/builders/set/set.js +1 -2
  349. package/dist/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
  350. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +1 -2
  351. package/dist/core/schemas/builders/union/discriminant.js +1 -2
  352. package/dist/core/schemas/builders/union/types.d.ts +6 -6
  353. package/dist/core/schemas/builders/union/union.d.ts +1 -1
  354. package/dist/core/schemas/builders/union/union.js +1 -2
  355. package/dist/core/schemas/utils/MaybePromise.d.ts +1 -1
  356. package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +3 -3
  357. package/dist/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
  358. package/dist/core/schemas/utils/entries.d.ts +1 -1
  359. package/dist/core/schemas/utils/entries.js +1 -2
  360. package/dist/core/schemas/utils/filterObject.d.ts +1 -1
  361. package/dist/core/schemas/utils/filterObject.js +1 -2
  362. package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -2
  363. package/dist/core/schemas/utils/isPlainObject.js +1 -2
  364. package/dist/core/schemas/utils/keys.d.ts +1 -1
  365. package/dist/core/schemas/utils/keys.js +1 -2
  366. package/dist/core/schemas/utils/maybeSkipValidation.js +1 -2
  367. package/dist/core/schemas/utils/partition.js +1 -2
  368. package/dist/core/streaming-fetcher/Stream.d.ts +0 -1
  369. package/dist/core/streaming-fetcher/Stream.js +20 -21
  370. package/dist/environments.d.ts +1 -1
  371. package/dist/index.d.ts +1 -0
  372. package/dist/index.js +19 -8
  373. package/dist/serialization/resources/agents/client/index.js +17 -7
  374. package/dist/serialization/resources/agents/client/list.js +17 -7
  375. package/dist/serialization/resources/agents/client/requests/AgentsSearchRequest.js +17 -7
  376. package/dist/serialization/resources/agents/client/requests/CreateAgentRequest.d.ts +3 -2
  377. package/dist/serialization/resources/agents/client/requests/CreateAgentRequest.js +20 -9
  378. package/dist/serialization/resources/agents/client/requests/UpdateAgent.js +17 -7
  379. package/dist/serialization/resources/agents/resources/archivalMemory/client/create.js +17 -7
  380. package/dist/serialization/resources/agents/resources/archivalMemory/client/index.js +17 -7
  381. package/dist/serialization/resources/agents/resources/archivalMemory/client/list.js +17 -7
  382. package/dist/serialization/resources/agents/resources/archivalMemory/client/requests/CreateArchivalMemory.js +17 -7
  383. package/dist/serialization/resources/agents/resources/coreMemory/client/getBlocks.js +17 -7
  384. package/dist/serialization/resources/agents/resources/coreMemory/client/index.js +17 -7
  385. package/dist/serialization/resources/agents/resources/coreMemory/client/listInContext.js +17 -7
  386. package/dist/serialization/resources/agents/resources/index.js +17 -7
  387. package/dist/serialization/resources/agents/resources/memoryVariables/types/MemoryVariablesGetResponse.js +17 -7
  388. package/dist/serialization/resources/agents/resources/messages/client/requests/LettaStreamingRequest.js +17 -7
  389. package/dist/serialization/resources/agents/resources/messages/client/requests/MessageUpdate.js +17 -7
  390. package/dist/serialization/resources/agents/resources/messages/types/LettaStreamingResponse.js +17 -7
  391. package/dist/serialization/resources/agents/resources/messages/types/MessagesListResponse.js +17 -7
  392. package/dist/serialization/resources/agents/resources/messages/types/MessagesListResponseItem.js +17 -7
  393. package/dist/serialization/resources/agents/resources/sources/client/get.js +17 -7
  394. package/dist/serialization/resources/agents/resources/sources/client/index.js +17 -7
  395. package/dist/serialization/resources/agents/resources/templates/client/requests/TemplatesCreateRequest.d.ts +1 -1
  396. package/dist/serialization/resources/agents/resources/templates/client/requests/TemplatesCreateRequest.js +18 -8
  397. package/dist/serialization/resources/agents/resources/templates/client/requests/TemplatesCreateVersionRequest.js +17 -7
  398. package/dist/serialization/resources/agents/resources/templates/client/requests/TemplatesMigrateRequest.js +17 -7
  399. package/dist/serialization/resources/agents/resources/templates/types/TemplatesMigrateResponse.js +17 -7
  400. package/dist/serialization/resources/agents/resources/tools/client/index.js +17 -7
  401. package/dist/serialization/resources/agents/resources/tools/client/list.js +17 -7
  402. package/dist/serialization/resources/agents/types/AgentsSearchRequestCombinator.js +17 -7
  403. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItem.js +17 -7
  404. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemName.js +17 -7
  405. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemNameOperator.js +17 -7
  406. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemOrderBy.js +17 -7
  407. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemOrderByDirection.js +17 -7
  408. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemOrderByValue.js +17 -7
  409. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemVersion.js +17 -7
  410. package/dist/serialization/resources/agents/types/CreateAgentRequestToolRulesItem.js +17 -7
  411. package/dist/serialization/resources/agents/types/UpdateAgentToolRulesItem.js +17 -7
  412. package/dist/serialization/resources/blocks/client/index.js +17 -7
  413. package/dist/serialization/resources/blocks/client/list.js +17 -7
  414. package/dist/serialization/resources/index.d.ts +2 -0
  415. package/dist/serialization/resources/index.js +20 -8
  416. package/dist/serialization/resources/jobs/client/index.js +17 -7
  417. package/dist/serialization/resources/jobs/client/list.js +17 -7
  418. package/dist/serialization/resources/jobs/client/listActive.js +17 -7
  419. package/dist/serialization/resources/models/client/index.js +17 -7
  420. package/dist/serialization/resources/models/client/listEmbeddingModels.js +17 -7
  421. package/dist/serialization/resources/models/client/listLlms.js +17 -7
  422. package/dist/serialization/resources/providers/client/index.js +17 -7
  423. package/dist/serialization/resources/providers/client/listProviders.js +17 -7
  424. package/dist/serialization/resources/providers/client/requests/ProviderCreate.js +17 -7
  425. package/dist/serialization/resources/providers/client/requests/ProviderUpdate.js +17 -7
  426. package/dist/serialization/resources/runs/client/getRunMessages.d.ts +11 -0
  427. package/dist/serialization/resources/runs/client/getRunMessages.js +42 -0
  428. package/dist/serialization/resources/runs/client/index.d.ts +3 -0
  429. package/dist/serialization/resources/runs/client/index.js +39 -0
  430. package/dist/serialization/resources/runs/client/listActiveRuns.d.ts +11 -0
  431. package/dist/serialization/resources/runs/client/listActiveRuns.js +42 -0
  432. package/dist/serialization/resources/runs/client/listRuns.d.ts +11 -0
  433. package/dist/serialization/resources/runs/client/listRuns.js +42 -0
  434. package/dist/serialization/resources/runs/index.d.ts +1 -0
  435. package/dist/serialization/resources/runs/index.js +17 -0
  436. package/dist/serialization/resources/sources/client/getByName.js +17 -7
  437. package/dist/serialization/resources/sources/client/index.js +17 -7
  438. package/dist/serialization/resources/sources/client/list.js +17 -7
  439. package/dist/serialization/resources/sources/client/requests/SourceCreate.js +17 -7
  440. package/dist/serialization/resources/sources/client/requests/SourceUpdate.js +17 -7
  441. package/dist/serialization/resources/sources/resources/files/client/index.js +17 -7
  442. package/dist/serialization/resources/sources/resources/files/client/list.js +17 -7
  443. package/dist/serialization/resources/sources/resources/index.js +17 -7
  444. package/dist/serialization/resources/sources/resources/passages/client/index.js +17 -7
  445. package/dist/serialization/resources/sources/resources/passages/client/list.js +17 -7
  446. package/dist/serialization/resources/tag/client/index.d.ts +1 -0
  447. package/dist/serialization/resources/tag/client/index.js +37 -0
  448. package/dist/serialization/resources/tag/client/listTags.d.ts +9 -0
  449. package/dist/serialization/resources/tag/client/listTags.js +41 -0
  450. package/dist/serialization/resources/tag/index.d.ts +1 -0
  451. package/dist/serialization/resources/tag/index.js +17 -0
  452. package/dist/serialization/resources/tools/client/addBaseTool.js +17 -7
  453. package/dist/serialization/resources/tools/client/getByName.js +17 -7
  454. package/dist/serialization/resources/tools/client/index.js +17 -7
  455. package/dist/serialization/resources/tools/client/list.js +17 -7
  456. package/dist/serialization/resources/tools/client/listComposioActionsByApp.js +17 -7
  457. package/dist/serialization/resources/tools/client/listComposioApps.js +17 -7
  458. package/dist/serialization/resources/tools/client/requests/ToolRunFromSource.d.ts +1 -1
  459. package/dist/serialization/resources/tools/client/requests/ToolRunFromSource.js +18 -8
  460. package/dist/serialization/resources/tools/client/requests/ToolUpdate.d.ts +0 -1
  461. package/dist/serialization/resources/tools/client/requests/ToolUpdate.js +17 -8
  462. package/dist/serialization/types/ActionModel.js +17 -7
  463. package/dist/serialization/types/ActionParametersModel.js +17 -7
  464. package/dist/serialization/types/ActionResponseModel.js +17 -7
  465. package/dist/serialization/types/AgentEnvironmentVariable.js +17 -7
  466. package/dist/serialization/types/AgentState.js +17 -7
  467. package/dist/serialization/types/AgentStateToolRulesItem.js +17 -7
  468. package/dist/serialization/types/AgentType.js +17 -7
  469. package/dist/serialization/types/AppAuthScheme.js +17 -7
  470. package/dist/serialization/types/AppAuthSchemeAuthMode.js +17 -7
  471. package/dist/serialization/types/AppModel.js +17 -7
  472. package/dist/serialization/types/ArchivalMemorySummary.js +17 -7
  473. package/dist/serialization/types/AssistantFile.js +17 -7
  474. package/dist/serialization/types/AssistantMessageInput.js +17 -7
  475. package/dist/serialization/types/AssistantMessageOutput.js +17 -7
  476. package/dist/serialization/types/AuthRequest.js +17 -7
  477. package/dist/serialization/types/AuthResponse.js +17 -7
  478. package/dist/serialization/types/AuthSchemeField.js +17 -7
  479. package/dist/serialization/types/Block.js +17 -7
  480. package/dist/serialization/types/BlockUpdate.js +17 -7
  481. package/dist/serialization/types/ChatCompletionRequest.js +17 -7
  482. package/dist/serialization/types/ChatCompletionRequestFunctionCall.js +17 -7
  483. package/dist/serialization/types/ChatCompletionRequestMessagesItem.js +17 -7
  484. package/dist/serialization/types/ChatCompletionRequestStop.js +17 -7
  485. package/dist/serialization/types/ChatCompletionRequestToolChoice.js +17 -7
  486. package/dist/serialization/types/ChatCompletionResponse.js +17 -7
  487. package/dist/serialization/types/ChildToolRule.js +17 -7
  488. package/dist/serialization/types/Choice.js +17 -7
  489. package/dist/serialization/types/ConditionalToolRule.js +17 -7
  490. package/dist/serialization/types/ConflictErrorBody.js +17 -7
  491. package/dist/serialization/types/ContextWindowOverview.js +17 -7
  492. package/dist/serialization/types/CreateAssistantFileRequest.js +17 -7
  493. package/dist/serialization/types/CreateAssistantRequest.js +17 -7
  494. package/dist/serialization/types/CreateBlock.js +17 -7
  495. package/dist/serialization/types/DeleteAssistantFileResponse.js +17 -7
  496. package/dist/serialization/types/DeleteAssistantResponse.js +17 -7
  497. package/dist/serialization/types/E2BSandboxConfig.js +17 -7
  498. package/dist/serialization/types/EmbeddingConfig.js +17 -7
  499. package/dist/serialization/types/EmbeddingConfigEmbeddingEndpointType.js +17 -7
  500. package/dist/serialization/types/FileMetadata.js +17 -7
  501. package/dist/serialization/types/FunctionCallInput.js +17 -7
  502. package/dist/serialization/types/FunctionCallOutput.js +17 -7
  503. package/dist/serialization/types/FunctionSchema.js +17 -7
  504. package/dist/serialization/types/Health.js +17 -7
  505. package/dist/serialization/types/HttpValidationError.js +17 -7
  506. package/dist/serialization/types/InitToolRule.js +17 -7
  507. package/dist/serialization/types/InternalServerErrorBody.js +17 -7
  508. package/dist/serialization/types/Job.d.ts +2 -0
  509. package/dist/serialization/types/Job.js +19 -7
  510. package/dist/serialization/types/JobStatus.js +17 -7
  511. package/dist/serialization/types/JobType.d.ts +10 -0
  512. package/dist/serialization/types/JobType.js +44 -0
  513. package/dist/serialization/types/LettaRequest.js +17 -7
  514. package/dist/serialization/types/LettaResponse.js +17 -7
  515. package/dist/serialization/types/LettaResponseMessagesItem.js +17 -7
  516. package/dist/serialization/types/LettaSchemasLettaMessageToolCall.js +17 -7
  517. package/dist/serialization/types/LettaSchemasMessageMessage.js +17 -7
  518. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionRequestTool.js +17 -7
  519. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionRequestToolCall.js +17 -7
  520. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionRequestToolCallFunction.js +17 -7
  521. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionResponseMessage.js +17 -7
  522. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionResponseToolCall.js +17 -7
  523. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionsToolCallFunction.js +17 -7
  524. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionsToolCallInput.js +17 -7
  525. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionsToolCallOutput.js +17 -7
  526. package/dist/serialization/types/LettaSchemasToolTool.d.ts +0 -1
  527. package/dist/serialization/types/LettaSchemasToolTool.js +17 -8
  528. package/dist/serialization/types/LettaUsageStatistics.js +17 -7
  529. package/dist/serialization/types/LlmConfig.js +17 -7
  530. package/dist/serialization/types/LlmConfigModelEndpointType.js +17 -7
  531. package/dist/serialization/types/LocalSandboxConfig.js +17 -7
  532. package/dist/serialization/types/LogProbToken.js +17 -7
  533. package/dist/serialization/types/Memory.js +17 -7
  534. package/dist/serialization/types/MessageContentLogProb.js +17 -7
  535. package/dist/serialization/types/MessageCreate.js +17 -7
  536. package/dist/serialization/types/MessageCreateRole.js +17 -7
  537. package/dist/serialization/types/MessageRole.js +17 -7
  538. package/dist/serialization/types/NotFoundErrorBody.js +17 -7
  539. package/dist/serialization/types/NotFoundErrorBodyMessage.js +17 -7
  540. package/dist/serialization/types/OpenAiAssistant.js +17 -7
  541. package/dist/serialization/types/Organization.js +17 -7
  542. package/dist/serialization/types/OrganizationCreate.js +17 -7
  543. package/dist/serialization/types/Passage.js +17 -7
  544. package/dist/serialization/types/Provider.js +17 -7
  545. package/dist/serialization/types/ReasoningMessage.js +17 -7
  546. package/dist/serialization/types/RecallMemorySummary.js +17 -7
  547. package/dist/serialization/types/ResponseFormat.js +17 -7
  548. package/dist/serialization/types/Run.d.ts +22 -0
  549. package/dist/serialization/types/Run.js +53 -0
  550. package/dist/serialization/types/SandboxConfig.js +17 -7
  551. package/dist/serialization/types/SandboxConfigCreate.js +17 -7
  552. package/dist/serialization/types/SandboxConfigCreateConfig.js +17 -7
  553. package/dist/serialization/types/SandboxConfigUpdate.js +17 -7
  554. package/dist/serialization/types/SandboxConfigUpdateConfig.js +17 -7
  555. package/dist/serialization/types/SandboxEnvironmentVariable.js +17 -7
  556. package/dist/serialization/types/SandboxEnvironmentVariableCreate.js +17 -7
  557. package/dist/serialization/types/SandboxEnvironmentVariableUpdate.js +17 -7
  558. package/dist/serialization/types/SandboxType.js +17 -7
  559. package/dist/serialization/types/Source.js +17 -7
  560. package/dist/serialization/types/SystemMessageInput.js +17 -7
  561. package/dist/serialization/types/SystemMessageOutput.js +17 -7
  562. package/dist/serialization/types/TerminalToolRule.js +17 -7
  563. package/dist/serialization/types/ToolCallDelta.js +17 -7
  564. package/dist/serialization/types/ToolCallFunctionOutput.js +17 -7
  565. package/dist/serialization/types/ToolCallMessage.js +17 -7
  566. package/dist/serialization/types/ToolCallMessageToolCall.js +17 -7
  567. package/dist/serialization/types/ToolCreate.d.ts +0 -1
  568. package/dist/serialization/types/ToolCreate.js +17 -8
  569. package/dist/serialization/types/ToolFunctionChoice.js +17 -7
  570. package/dist/serialization/types/ToolInput.js +17 -7
  571. package/dist/serialization/types/ToolMessage.js +17 -7
  572. package/dist/serialization/types/ToolReturnMessage.js +17 -7
  573. package/dist/serialization/types/ToolReturnMessageStatus.js +17 -7
  574. package/dist/serialization/types/ToolRuleType.js +17 -7
  575. package/dist/serialization/types/ToolType.js +17 -7
  576. package/dist/serialization/types/UsageStatistics.js +17 -7
  577. package/dist/serialization/types/User.js +17 -7
  578. package/dist/serialization/types/UserCreate.js +17 -7
  579. package/dist/serialization/types/UserMessageInput.js +17 -7
  580. package/dist/serialization/types/UserMessageInputContent.js +17 -7
  581. package/dist/serialization/types/UserMessageOutput.js +17 -7
  582. package/dist/serialization/types/UserUpdate.js +17 -7
  583. package/dist/serialization/types/ValidationError.js +17 -7
  584. package/dist/serialization/types/ValidationErrorLocItem.js +17 -7
  585. package/dist/serialization/types/index.d.ts +2 -0
  586. package/dist/serialization/types/index.js +2 -0
  587. package/dist/version.d.ts +1 -1
  588. package/dist/version.js +1 -1
  589. package/environments.d.ts +1 -1
  590. package/index.d.ts +1 -0
  591. package/index.js +19 -8
  592. package/{jest.config.js → jest.config.mjs} +4 -1
  593. package/package.json +17 -16
  594. package/reference.md +524 -9
  595. package/scripts/rename-to-esm-files.js +115 -0
  596. package/serialization/resources/agents/client/index.js +17 -7
  597. package/serialization/resources/agents/client/list.js +17 -7
  598. package/serialization/resources/agents/client/requests/AgentsSearchRequest.js +17 -7
  599. package/serialization/resources/agents/client/requests/CreateAgentRequest.d.ts +3 -2
  600. package/serialization/resources/agents/client/requests/CreateAgentRequest.js +20 -9
  601. package/serialization/resources/agents/client/requests/UpdateAgent.js +17 -7
  602. package/serialization/resources/agents/resources/archivalMemory/client/create.js +17 -7
  603. package/serialization/resources/agents/resources/archivalMemory/client/index.js +17 -7
  604. package/serialization/resources/agents/resources/archivalMemory/client/list.js +17 -7
  605. package/serialization/resources/agents/resources/archivalMemory/client/requests/CreateArchivalMemory.js +17 -7
  606. package/serialization/resources/agents/resources/coreMemory/client/getBlocks.js +17 -7
  607. package/serialization/resources/agents/resources/coreMemory/client/index.js +17 -7
  608. package/serialization/resources/agents/resources/coreMemory/client/listInContext.js +17 -7
  609. package/serialization/resources/agents/resources/index.js +17 -7
  610. package/serialization/resources/agents/resources/memoryVariables/types/MemoryVariablesGetResponse.js +17 -7
  611. package/serialization/resources/agents/resources/messages/client/requests/LettaStreamingRequest.js +17 -7
  612. package/serialization/resources/agents/resources/messages/client/requests/MessageUpdate.js +17 -7
  613. package/serialization/resources/agents/resources/messages/types/LettaStreamingResponse.js +17 -7
  614. package/serialization/resources/agents/resources/messages/types/MessagesListResponse.js +17 -7
  615. package/serialization/resources/agents/resources/messages/types/MessagesListResponseItem.js +17 -7
  616. package/serialization/resources/agents/resources/sources/client/get.js +17 -7
  617. package/serialization/resources/agents/resources/sources/client/index.js +17 -7
  618. package/serialization/resources/agents/resources/templates/client/requests/TemplatesCreateRequest.d.ts +1 -1
  619. package/serialization/resources/agents/resources/templates/client/requests/TemplatesCreateRequest.js +18 -8
  620. package/serialization/resources/agents/resources/templates/client/requests/TemplatesCreateVersionRequest.js +17 -7
  621. package/serialization/resources/agents/resources/templates/client/requests/TemplatesMigrateRequest.js +17 -7
  622. package/serialization/resources/agents/resources/templates/types/TemplatesMigrateResponse.js +17 -7
  623. package/serialization/resources/agents/resources/tools/client/index.js +17 -7
  624. package/serialization/resources/agents/resources/tools/client/list.js +17 -7
  625. package/serialization/resources/agents/types/AgentsSearchRequestCombinator.js +17 -7
  626. package/serialization/resources/agents/types/AgentsSearchRequestSearchItem.js +17 -7
  627. package/serialization/resources/agents/types/AgentsSearchRequestSearchItemName.js +17 -7
  628. package/serialization/resources/agents/types/AgentsSearchRequestSearchItemNameOperator.js +17 -7
  629. package/serialization/resources/agents/types/AgentsSearchRequestSearchItemOrderBy.js +17 -7
  630. package/serialization/resources/agents/types/AgentsSearchRequestSearchItemOrderByDirection.js +17 -7
  631. package/serialization/resources/agents/types/AgentsSearchRequestSearchItemOrderByValue.js +17 -7
  632. package/serialization/resources/agents/types/AgentsSearchRequestSearchItemVersion.js +17 -7
  633. package/serialization/resources/agents/types/CreateAgentRequestToolRulesItem.js +17 -7
  634. package/serialization/resources/agents/types/UpdateAgentToolRulesItem.js +17 -7
  635. package/serialization/resources/blocks/client/index.js +17 -7
  636. package/serialization/resources/blocks/client/list.js +17 -7
  637. package/serialization/resources/index.d.ts +2 -0
  638. package/serialization/resources/index.js +20 -8
  639. package/serialization/resources/jobs/client/index.js +17 -7
  640. package/serialization/resources/jobs/client/list.js +17 -7
  641. package/serialization/resources/jobs/client/listActive.js +17 -7
  642. package/serialization/resources/models/client/index.js +17 -7
  643. package/serialization/resources/models/client/listEmbeddingModels.js +17 -7
  644. package/serialization/resources/models/client/listLlms.js +17 -7
  645. package/serialization/resources/providers/client/index.js +17 -7
  646. package/serialization/resources/providers/client/listProviders.js +17 -7
  647. package/serialization/resources/providers/client/requests/ProviderCreate.js +17 -7
  648. package/serialization/resources/providers/client/requests/ProviderUpdate.js +17 -7
  649. package/serialization/resources/runs/client/getRunMessages.d.ts +11 -0
  650. package/serialization/resources/runs/client/getRunMessages.js +42 -0
  651. package/serialization/resources/runs/client/index.d.ts +3 -0
  652. package/serialization/resources/runs/client/index.js +39 -0
  653. package/serialization/resources/runs/client/listActiveRuns.d.ts +11 -0
  654. package/serialization/resources/runs/client/listActiveRuns.js +42 -0
  655. package/serialization/resources/runs/client/listRuns.d.ts +11 -0
  656. package/serialization/resources/runs/client/listRuns.js +42 -0
  657. package/serialization/resources/runs/index.d.ts +1 -0
  658. package/serialization/resources/runs/index.js +17 -0
  659. package/serialization/resources/sources/client/getByName.js +17 -7
  660. package/serialization/resources/sources/client/index.js +17 -7
  661. package/serialization/resources/sources/client/list.js +17 -7
  662. package/serialization/resources/sources/client/requests/SourceCreate.js +17 -7
  663. package/serialization/resources/sources/client/requests/SourceUpdate.js +17 -7
  664. package/serialization/resources/sources/resources/files/client/index.js +17 -7
  665. package/serialization/resources/sources/resources/files/client/list.js +17 -7
  666. package/serialization/resources/sources/resources/index.js +17 -7
  667. package/serialization/resources/sources/resources/passages/client/index.js +17 -7
  668. package/serialization/resources/sources/resources/passages/client/list.js +17 -7
  669. package/serialization/resources/tag/client/index.d.ts +1 -0
  670. package/serialization/resources/tag/client/index.js +37 -0
  671. package/serialization/resources/tag/client/listTags.d.ts +9 -0
  672. package/serialization/resources/tag/client/listTags.js +41 -0
  673. package/serialization/resources/tag/index.d.ts +1 -0
  674. package/serialization/resources/tag/index.js +17 -0
  675. package/serialization/resources/tools/client/addBaseTool.js +17 -7
  676. package/serialization/resources/tools/client/getByName.js +17 -7
  677. package/serialization/resources/tools/client/index.js +17 -7
  678. package/serialization/resources/tools/client/list.js +17 -7
  679. package/serialization/resources/tools/client/listComposioActionsByApp.js +17 -7
  680. package/serialization/resources/tools/client/listComposioApps.js +17 -7
  681. package/serialization/resources/tools/client/requests/ToolRunFromSource.d.ts +1 -1
  682. package/serialization/resources/tools/client/requests/ToolRunFromSource.js +18 -8
  683. package/serialization/resources/tools/client/requests/ToolUpdate.d.ts +0 -1
  684. package/serialization/resources/tools/client/requests/ToolUpdate.js +17 -8
  685. package/serialization/types/ActionModel.js +17 -7
  686. package/serialization/types/ActionParametersModel.js +17 -7
  687. package/serialization/types/ActionResponseModel.js +17 -7
  688. package/serialization/types/AgentEnvironmentVariable.js +17 -7
  689. package/serialization/types/AgentState.js +17 -7
  690. package/serialization/types/AgentStateToolRulesItem.js +17 -7
  691. package/serialization/types/AgentType.js +17 -7
  692. package/serialization/types/AppAuthScheme.js +17 -7
  693. package/serialization/types/AppAuthSchemeAuthMode.js +17 -7
  694. package/serialization/types/AppModel.js +17 -7
  695. package/serialization/types/ArchivalMemorySummary.js +17 -7
  696. package/serialization/types/AssistantFile.js +17 -7
  697. package/serialization/types/AssistantMessageInput.js +17 -7
  698. package/serialization/types/AssistantMessageOutput.js +17 -7
  699. package/serialization/types/AuthRequest.js +17 -7
  700. package/serialization/types/AuthResponse.js +17 -7
  701. package/serialization/types/AuthSchemeField.js +17 -7
  702. package/serialization/types/Block.js +17 -7
  703. package/serialization/types/BlockUpdate.js +17 -7
  704. package/serialization/types/ChatCompletionRequest.js +17 -7
  705. package/serialization/types/ChatCompletionRequestFunctionCall.js +17 -7
  706. package/serialization/types/ChatCompletionRequestMessagesItem.js +17 -7
  707. package/serialization/types/ChatCompletionRequestStop.js +17 -7
  708. package/serialization/types/ChatCompletionRequestToolChoice.js +17 -7
  709. package/serialization/types/ChatCompletionResponse.js +17 -7
  710. package/serialization/types/ChildToolRule.js +17 -7
  711. package/serialization/types/Choice.js +17 -7
  712. package/serialization/types/ConditionalToolRule.js +17 -7
  713. package/serialization/types/ConflictErrorBody.js +17 -7
  714. package/serialization/types/ContextWindowOverview.js +17 -7
  715. package/serialization/types/CreateAssistantFileRequest.js +17 -7
  716. package/serialization/types/CreateAssistantRequest.js +17 -7
  717. package/serialization/types/CreateBlock.js +17 -7
  718. package/serialization/types/DeleteAssistantFileResponse.js +17 -7
  719. package/serialization/types/DeleteAssistantResponse.js +17 -7
  720. package/serialization/types/E2BSandboxConfig.js +17 -7
  721. package/serialization/types/EmbeddingConfig.js +17 -7
  722. package/serialization/types/EmbeddingConfigEmbeddingEndpointType.js +17 -7
  723. package/serialization/types/FileMetadata.js +17 -7
  724. package/serialization/types/FunctionCallInput.js +17 -7
  725. package/serialization/types/FunctionCallOutput.js +17 -7
  726. package/serialization/types/FunctionSchema.js +17 -7
  727. package/serialization/types/Health.js +17 -7
  728. package/serialization/types/HttpValidationError.js +17 -7
  729. package/serialization/types/InitToolRule.js +17 -7
  730. package/serialization/types/InternalServerErrorBody.js +17 -7
  731. package/serialization/types/Job.d.ts +2 -0
  732. package/serialization/types/Job.js +19 -7
  733. package/serialization/types/JobStatus.js +17 -7
  734. package/serialization/types/JobType.d.ts +10 -0
  735. package/serialization/types/JobType.js +44 -0
  736. package/serialization/types/LettaRequest.js +17 -7
  737. package/serialization/types/LettaResponse.js +17 -7
  738. package/serialization/types/LettaResponseMessagesItem.js +17 -7
  739. package/serialization/types/LettaSchemasLettaMessageToolCall.js +17 -7
  740. package/serialization/types/LettaSchemasMessageMessage.js +17 -7
  741. package/serialization/types/LettaSchemasOpenaiChatCompletionRequestTool.js +17 -7
  742. package/serialization/types/LettaSchemasOpenaiChatCompletionRequestToolCall.js +17 -7
  743. package/serialization/types/LettaSchemasOpenaiChatCompletionRequestToolCallFunction.js +17 -7
  744. package/serialization/types/LettaSchemasOpenaiChatCompletionResponseMessage.js +17 -7
  745. package/serialization/types/LettaSchemasOpenaiChatCompletionResponseToolCall.js +17 -7
  746. package/serialization/types/LettaSchemasOpenaiChatCompletionsToolCallFunction.js +17 -7
  747. package/serialization/types/LettaSchemasOpenaiChatCompletionsToolCallInput.js +17 -7
  748. package/serialization/types/LettaSchemasOpenaiChatCompletionsToolCallOutput.js +17 -7
  749. package/serialization/types/LettaSchemasToolTool.d.ts +0 -1
  750. package/serialization/types/LettaSchemasToolTool.js +17 -8
  751. package/serialization/types/LettaUsageStatistics.js +17 -7
  752. package/serialization/types/LlmConfig.js +17 -7
  753. package/serialization/types/LlmConfigModelEndpointType.js +17 -7
  754. package/serialization/types/LocalSandboxConfig.js +17 -7
  755. package/serialization/types/LogProbToken.js +17 -7
  756. package/serialization/types/Memory.js +17 -7
  757. package/serialization/types/MessageContentLogProb.js +17 -7
  758. package/serialization/types/MessageCreate.js +17 -7
  759. package/serialization/types/MessageCreateRole.js +17 -7
  760. package/serialization/types/MessageRole.js +17 -7
  761. package/serialization/types/NotFoundErrorBody.js +17 -7
  762. package/serialization/types/NotFoundErrorBodyMessage.js +17 -7
  763. package/serialization/types/OpenAiAssistant.js +17 -7
  764. package/serialization/types/Organization.js +17 -7
  765. package/serialization/types/OrganizationCreate.js +17 -7
  766. package/serialization/types/Passage.js +17 -7
  767. package/serialization/types/Provider.js +17 -7
  768. package/serialization/types/ReasoningMessage.js +17 -7
  769. package/serialization/types/RecallMemorySummary.js +17 -7
  770. package/serialization/types/ResponseFormat.js +17 -7
  771. package/serialization/types/Run.d.ts +22 -0
  772. package/serialization/types/Run.js +53 -0
  773. package/serialization/types/SandboxConfig.js +17 -7
  774. package/serialization/types/SandboxConfigCreate.js +17 -7
  775. package/serialization/types/SandboxConfigCreateConfig.js +17 -7
  776. package/serialization/types/SandboxConfigUpdate.js +17 -7
  777. package/serialization/types/SandboxConfigUpdateConfig.js +17 -7
  778. package/serialization/types/SandboxEnvironmentVariable.js +17 -7
  779. package/serialization/types/SandboxEnvironmentVariableCreate.js +17 -7
  780. package/serialization/types/SandboxEnvironmentVariableUpdate.js +17 -7
  781. package/serialization/types/SandboxType.js +17 -7
  782. package/serialization/types/Source.js +17 -7
  783. package/serialization/types/SystemMessageInput.js +17 -7
  784. package/serialization/types/SystemMessageOutput.js +17 -7
  785. package/serialization/types/TerminalToolRule.js +17 -7
  786. package/serialization/types/ToolCallDelta.js +17 -7
  787. package/serialization/types/ToolCallFunctionOutput.js +17 -7
  788. package/serialization/types/ToolCallMessage.js +17 -7
  789. package/serialization/types/ToolCallMessageToolCall.js +17 -7
  790. package/serialization/types/ToolCreate.d.ts +0 -1
  791. package/serialization/types/ToolCreate.js +17 -8
  792. package/serialization/types/ToolFunctionChoice.js +17 -7
  793. package/serialization/types/ToolInput.js +17 -7
  794. package/serialization/types/ToolMessage.js +17 -7
  795. package/serialization/types/ToolReturnMessage.js +17 -7
  796. package/serialization/types/ToolReturnMessageStatus.js +17 -7
  797. package/serialization/types/ToolRuleType.js +17 -7
  798. package/serialization/types/ToolType.js +17 -7
  799. package/serialization/types/UsageStatistics.js +17 -7
  800. package/serialization/types/User.js +17 -7
  801. package/serialization/types/UserCreate.js +17 -7
  802. package/serialization/types/UserMessageInput.js +17 -7
  803. package/serialization/types/UserMessageInputContent.js +17 -7
  804. package/serialization/types/UserMessageOutput.js +17 -7
  805. package/serialization/types/UserUpdate.js +17 -7
  806. package/serialization/types/ValidationError.js +17 -7
  807. package/serialization/types/ValidationErrorLocItem.js +17 -7
  808. package/serialization/types/index.d.ts +2 -0
  809. package/serialization/types/index.js +2 -0
  810. package/version.d.ts +1 -1
  811. package/version.js +1 -1
@@ -0,0 +1,510 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
+ return new (P || (P = Promise))(function (resolve, reject) {
41
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
45
+ });
46
+ };
47
+ var __importDefault = (this && this.__importDefault) || function (mod) {
48
+ return (mod && mod.__esModule) ? mod : { "default": mod };
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.Runs = void 0;
52
+ const environments = __importStar(require("../../../../environments"));
53
+ const core = __importStar(require("../../../../core"));
54
+ const Letta = __importStar(require("../../../index"));
55
+ const url_join_1 = __importDefault(require("url-join"));
56
+ const serializers = __importStar(require("../../../../serialization/index"));
57
+ const errors = __importStar(require("../../../../errors/index"));
58
+ class Runs {
59
+ constructor(_options = {}) {
60
+ this._options = _options;
61
+ }
62
+ /**
63
+ * List all runs.
64
+ *
65
+ * @param {Runs.RequestOptions} requestOptions - Request-specific configuration.
66
+ *
67
+ * @throws {@link Letta.UnprocessableEntityError}
68
+ *
69
+ * @example
70
+ * await client.runs.listRuns()
71
+ */
72
+ listRuns(requestOptions) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ var _a, _b, _c;
75
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
76
+ 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/runs/"),
77
+ method: "GET",
78
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@letta-ai/letta-client/0.1.9", "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),
79
+ contentType: "application/json",
80
+ requestType: "json",
81
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
82
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
83
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
84
+ });
85
+ if (_response.ok) {
86
+ return serializers.runs.listRuns.Response.parseOrThrow(_response.body, {
87
+ unrecognizedObjectKeys: "passthrough",
88
+ allowUnrecognizedUnionMembers: true,
89
+ allowUnrecognizedEnumValues: true,
90
+ skipValidation: true,
91
+ breadcrumbsPrefix: ["response"],
92
+ });
93
+ }
94
+ if (_response.error.reason === "status-code") {
95
+ switch (_response.error.statusCode) {
96
+ case 422:
97
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
98
+ unrecognizedObjectKeys: "passthrough",
99
+ allowUnrecognizedUnionMembers: true,
100
+ allowUnrecognizedEnumValues: true,
101
+ skipValidation: true,
102
+ breadcrumbsPrefix: ["response"],
103
+ }));
104
+ default:
105
+ throw new errors.LettaError({
106
+ statusCode: _response.error.statusCode,
107
+ body: _response.error.body,
108
+ });
109
+ }
110
+ }
111
+ switch (_response.error.reason) {
112
+ case "non-json":
113
+ throw new errors.LettaError({
114
+ statusCode: _response.error.statusCode,
115
+ body: _response.error.rawBody,
116
+ });
117
+ case "timeout":
118
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/runs/.");
119
+ case "unknown":
120
+ throw new errors.LettaError({
121
+ message: _response.error.errorMessage,
122
+ });
123
+ }
124
+ });
125
+ }
126
+ /**
127
+ * List all active runs.
128
+ *
129
+ * @param {Runs.RequestOptions} requestOptions - Request-specific configuration.
130
+ *
131
+ * @throws {@link Letta.UnprocessableEntityError}
132
+ *
133
+ * @example
134
+ * await client.runs.listActiveRuns()
135
+ */
136
+ listActiveRuns(requestOptions) {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ var _a, _b, _c;
139
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
140
+ 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/runs/active"),
141
+ method: "GET",
142
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@letta-ai/letta-client/0.1.9", "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),
143
+ contentType: "application/json",
144
+ requestType: "json",
145
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
146
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
147
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
148
+ });
149
+ if (_response.ok) {
150
+ return serializers.runs.listActiveRuns.Response.parseOrThrow(_response.body, {
151
+ unrecognizedObjectKeys: "passthrough",
152
+ allowUnrecognizedUnionMembers: true,
153
+ allowUnrecognizedEnumValues: true,
154
+ skipValidation: true,
155
+ breadcrumbsPrefix: ["response"],
156
+ });
157
+ }
158
+ if (_response.error.reason === "status-code") {
159
+ switch (_response.error.statusCode) {
160
+ case 422:
161
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
162
+ unrecognizedObjectKeys: "passthrough",
163
+ allowUnrecognizedUnionMembers: true,
164
+ allowUnrecognizedEnumValues: true,
165
+ skipValidation: true,
166
+ breadcrumbsPrefix: ["response"],
167
+ }));
168
+ default:
169
+ throw new errors.LettaError({
170
+ statusCode: _response.error.statusCode,
171
+ body: _response.error.body,
172
+ });
173
+ }
174
+ }
175
+ switch (_response.error.reason) {
176
+ case "non-json":
177
+ throw new errors.LettaError({
178
+ statusCode: _response.error.statusCode,
179
+ body: _response.error.rawBody,
180
+ });
181
+ case "timeout":
182
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/runs/active.");
183
+ case "unknown":
184
+ throw new errors.LettaError({
185
+ message: _response.error.errorMessage,
186
+ });
187
+ }
188
+ });
189
+ }
190
+ /**
191
+ * Get the status of a run.
192
+ *
193
+ * @param {string} runId
194
+ * @param {Runs.RequestOptions} requestOptions - Request-specific configuration.
195
+ *
196
+ * @throws {@link Letta.UnprocessableEntityError}
197
+ *
198
+ * @example
199
+ * await client.runs.getRun("run_id")
200
+ */
201
+ getRun(runId, requestOptions) {
202
+ return __awaiter(this, void 0, void 0, function* () {
203
+ var _a, _b, _c;
204
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
205
+ 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/runs/${encodeURIComponent(runId)}`),
206
+ method: "GET",
207
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@letta-ai/letta-client/0.1.9", "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),
208
+ contentType: "application/json",
209
+ requestType: "json",
210
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
211
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
212
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
213
+ });
214
+ if (_response.ok) {
215
+ return serializers.Run.parseOrThrow(_response.body, {
216
+ unrecognizedObjectKeys: "passthrough",
217
+ allowUnrecognizedUnionMembers: true,
218
+ allowUnrecognizedEnumValues: true,
219
+ skipValidation: true,
220
+ breadcrumbsPrefix: ["response"],
221
+ });
222
+ }
223
+ if (_response.error.reason === "status-code") {
224
+ switch (_response.error.statusCode) {
225
+ case 422:
226
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
227
+ unrecognizedObjectKeys: "passthrough",
228
+ allowUnrecognizedUnionMembers: true,
229
+ allowUnrecognizedEnumValues: true,
230
+ skipValidation: true,
231
+ breadcrumbsPrefix: ["response"],
232
+ }));
233
+ default:
234
+ throw new errors.LettaError({
235
+ statusCode: _response.error.statusCode,
236
+ body: _response.error.body,
237
+ });
238
+ }
239
+ }
240
+ switch (_response.error.reason) {
241
+ case "non-json":
242
+ throw new errors.LettaError({
243
+ statusCode: _response.error.statusCode,
244
+ body: _response.error.rawBody,
245
+ });
246
+ case "timeout":
247
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/runs/{run_id}.");
248
+ case "unknown":
249
+ throw new errors.LettaError({
250
+ message: _response.error.errorMessage,
251
+ });
252
+ }
253
+ });
254
+ }
255
+ /**
256
+ * Delete a run by its run_id.
257
+ *
258
+ * @param {string} runId
259
+ * @param {Runs.RequestOptions} requestOptions - Request-specific configuration.
260
+ *
261
+ * @throws {@link Letta.UnprocessableEntityError}
262
+ *
263
+ * @example
264
+ * await client.runs.deleteRun("run_id")
265
+ */
266
+ deleteRun(runId, requestOptions) {
267
+ return __awaiter(this, void 0, void 0, function* () {
268
+ var _a, _b, _c;
269
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
270
+ 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/runs/${encodeURIComponent(runId)}`),
271
+ method: "DELETE",
272
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@letta-ai/letta-client/0.1.9", "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),
273
+ contentType: "application/json",
274
+ requestType: "json",
275
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
276
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
277
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
278
+ });
279
+ if (_response.ok) {
280
+ return serializers.Run.parseOrThrow(_response.body, {
281
+ unrecognizedObjectKeys: "passthrough",
282
+ allowUnrecognizedUnionMembers: true,
283
+ allowUnrecognizedEnumValues: true,
284
+ skipValidation: true,
285
+ breadcrumbsPrefix: ["response"],
286
+ });
287
+ }
288
+ if (_response.error.reason === "status-code") {
289
+ switch (_response.error.statusCode) {
290
+ case 422:
291
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
292
+ unrecognizedObjectKeys: "passthrough",
293
+ allowUnrecognizedUnionMembers: true,
294
+ allowUnrecognizedEnumValues: true,
295
+ skipValidation: true,
296
+ breadcrumbsPrefix: ["response"],
297
+ }));
298
+ default:
299
+ throw new errors.LettaError({
300
+ statusCode: _response.error.statusCode,
301
+ body: _response.error.body,
302
+ });
303
+ }
304
+ }
305
+ switch (_response.error.reason) {
306
+ case "non-json":
307
+ throw new errors.LettaError({
308
+ statusCode: _response.error.statusCode,
309
+ body: _response.error.rawBody,
310
+ });
311
+ case "timeout":
312
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling DELETE /v1/runs/{run_id}.");
313
+ case "unknown":
314
+ throw new errors.LettaError({
315
+ message: _response.error.errorMessage,
316
+ });
317
+ }
318
+ });
319
+ }
320
+ /**
321
+ * Get messages associated with a run with filtering options.
322
+ *
323
+ * Args:
324
+ * run_id: ID of the run
325
+ * cursor: Cursor for pagination
326
+ * start_date: Filter messages after this date
327
+ * end_date: Filter messages before this date
328
+ * limit: Maximum number of messages to return
329
+ * query_text: Search text in message content
330
+ * ascending: Sort order by creation time
331
+ * tags: Filter by message tags
332
+ * match_all_tags: If true, match all tags. If false, match any tag
333
+ * role: Filter by message role (user/assistant/system/tool)
334
+ * tool_name: Filter by tool call name
335
+ * user_id: ID of the user making the request
336
+ *
337
+ * @param {string} runId
338
+ * @param {Letta.GetRunMessagesRequest} request
339
+ * @param {Runs.RequestOptions} requestOptions - Request-specific configuration.
340
+ *
341
+ * @throws {@link Letta.UnprocessableEntityError}
342
+ *
343
+ * @example
344
+ * await client.runs.getRunMessages("run_id")
345
+ */
346
+ getRunMessages(runId_1) {
347
+ return __awaiter(this, arguments, void 0, function* (runId, request = {}, requestOptions) {
348
+ var _a, _b, _c;
349
+ const { cursor, startDate, endDate, limit, queryText, ascending, tags, matchAllTags, role, toolName } = request;
350
+ const _queryParams = {};
351
+ if (cursor != null) {
352
+ _queryParams["cursor"] = cursor;
353
+ }
354
+ if (startDate != null) {
355
+ _queryParams["start_date"] = startDate.toISOString();
356
+ }
357
+ if (endDate != null) {
358
+ _queryParams["end_date"] = endDate.toISOString();
359
+ }
360
+ if (limit != null) {
361
+ _queryParams["limit"] = limit.toString();
362
+ }
363
+ if (queryText != null) {
364
+ _queryParams["query_text"] = queryText;
365
+ }
366
+ if (ascending != null) {
367
+ _queryParams["ascending"] = ascending.toString();
368
+ }
369
+ if (tags != null) {
370
+ if (Array.isArray(tags)) {
371
+ _queryParams["tags"] = tags.map((item) => item);
372
+ }
373
+ else {
374
+ _queryParams["tags"] = tags;
375
+ }
376
+ }
377
+ if (matchAllTags != null) {
378
+ _queryParams["match_all_tags"] = matchAllTags.toString();
379
+ }
380
+ if (role != null) {
381
+ _queryParams["role"] = role;
382
+ }
383
+ if (toolName != null) {
384
+ _queryParams["tool_name"] = toolName;
385
+ }
386
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
387
+ 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/runs/${encodeURIComponent(runId)}/messages`),
388
+ method: "GET",
389
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@letta-ai/letta-client/0.1.9", "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),
390
+ contentType: "application/json",
391
+ queryParameters: _queryParams,
392
+ requestType: "json",
393
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
394
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
395
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
396
+ });
397
+ if (_response.ok) {
398
+ return serializers.runs.getRunMessages.Response.parseOrThrow(_response.body, {
399
+ unrecognizedObjectKeys: "passthrough",
400
+ allowUnrecognizedUnionMembers: true,
401
+ allowUnrecognizedEnumValues: true,
402
+ skipValidation: true,
403
+ breadcrumbsPrefix: ["response"],
404
+ });
405
+ }
406
+ if (_response.error.reason === "status-code") {
407
+ switch (_response.error.statusCode) {
408
+ case 422:
409
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
410
+ unrecognizedObjectKeys: "passthrough",
411
+ allowUnrecognizedUnionMembers: true,
412
+ allowUnrecognizedEnumValues: true,
413
+ skipValidation: true,
414
+ breadcrumbsPrefix: ["response"],
415
+ }));
416
+ default:
417
+ throw new errors.LettaError({
418
+ statusCode: _response.error.statusCode,
419
+ body: _response.error.body,
420
+ });
421
+ }
422
+ }
423
+ switch (_response.error.reason) {
424
+ case "non-json":
425
+ throw new errors.LettaError({
426
+ statusCode: _response.error.statusCode,
427
+ body: _response.error.rawBody,
428
+ });
429
+ case "timeout":
430
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/runs/{run_id}/messages.");
431
+ case "unknown":
432
+ throw new errors.LettaError({
433
+ message: _response.error.errorMessage,
434
+ });
435
+ }
436
+ });
437
+ }
438
+ /**
439
+ * Get usage statistics for a run.
440
+ *
441
+ * @param {string} runId
442
+ * @param {Runs.RequestOptions} requestOptions - Request-specific configuration.
443
+ *
444
+ * @throws {@link Letta.UnprocessableEntityError}
445
+ *
446
+ * @example
447
+ * await client.runs.getRunUsage("run_id")
448
+ */
449
+ getRunUsage(runId, requestOptions) {
450
+ return __awaiter(this, void 0, void 0, function* () {
451
+ var _a, _b, _c;
452
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
453
+ 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/runs/${encodeURIComponent(runId)}/usage`),
454
+ method: "GET",
455
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@letta-ai/letta-client/0.1.9", "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),
456
+ contentType: "application/json",
457
+ requestType: "json",
458
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
459
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
460
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
461
+ });
462
+ if (_response.ok) {
463
+ return serializers.UsageStatistics.parseOrThrow(_response.body, {
464
+ unrecognizedObjectKeys: "passthrough",
465
+ allowUnrecognizedUnionMembers: true,
466
+ allowUnrecognizedEnumValues: true,
467
+ skipValidation: true,
468
+ breadcrumbsPrefix: ["response"],
469
+ });
470
+ }
471
+ if (_response.error.reason === "status-code") {
472
+ switch (_response.error.statusCode) {
473
+ case 422:
474
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
475
+ unrecognizedObjectKeys: "passthrough",
476
+ allowUnrecognizedUnionMembers: true,
477
+ allowUnrecognizedEnumValues: true,
478
+ skipValidation: true,
479
+ breadcrumbsPrefix: ["response"],
480
+ }));
481
+ default:
482
+ throw new errors.LettaError({
483
+ statusCode: _response.error.statusCode,
484
+ body: _response.error.body,
485
+ });
486
+ }
487
+ }
488
+ switch (_response.error.reason) {
489
+ case "non-json":
490
+ throw new errors.LettaError({
491
+ statusCode: _response.error.statusCode,
492
+ body: _response.error.rawBody,
493
+ });
494
+ case "timeout":
495
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/runs/{run_id}/usage.");
496
+ case "unknown":
497
+ throw new errors.LettaError({
498
+ message: _response.error.errorMessage,
499
+ });
500
+ }
501
+ });
502
+ }
503
+ _getCustomAuthorizationHeaders() {
504
+ return __awaiter(this, void 0, void 0, function* () {
505
+ const tokenValue = yield core.Supplier.get(this._options.token);
506
+ return { Authorization: `Bearer ${tokenValue}` };
507
+ });
508
+ }
509
+ }
510
+ exports.Runs = Runs;
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,50 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Letta from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {}
8
+ */
9
+ export interface GetRunMessagesRequest {
10
+ /**
11
+ * Cursor for pagination
12
+ */
13
+ cursor?: string;
14
+ /**
15
+ * Filter messages after this date
16
+ */
17
+ startDate?: Date;
18
+ /**
19
+ * Filter messages before this date
20
+ */
21
+ endDate?: Date;
22
+ /**
23
+ * Maximum number of messages to return
24
+ */
25
+ limit?: number;
26
+ /**
27
+ * Search text in message content
28
+ */
29
+ queryText?: string;
30
+ /**
31
+ * Sort order by creation time
32
+ */
33
+ ascending?: boolean;
34
+ /**
35
+ * Filter by message tags
36
+ */
37
+ tags?: string | string[];
38
+ /**
39
+ * If true, match all tags. If false, match any tag
40
+ */
41
+ matchAllTags?: boolean;
42
+ /**
43
+ * Filter by message role
44
+ */
45
+ role?: Letta.MessageRole;
46
+ /**
47
+ * Filter by tool call name
48
+ */
49
+ toolName?: string;
50
+ }
@@ -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 });
@@ -0,0 +1 @@
1
+ export { type GetRunMessagesRequest } from "./GetRunMessagesRequest";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client"), exports);
@@ -9,6 +9,8 @@ import { Passages } from "../resources/passages/client/Client";
9
9
  export declare namespace Sources {
10
10
  interface Options {
11
11
  environment?: core.Supplier<environments.LettaEnvironment | string>;
12
+ /** Specify a custom URL to connect the client to. */
13
+ baseUrl?: core.Supplier<string>;
12
14
  token?: core.Supplier<string | undefined>;
13
15
  fetcher?: core.FetchFunction;
14
16
  }