@letta-ai/letta-client 0.1.8 → 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 (735) hide show
  1. package/Client.d.ts +5 -0
  2. package/Client.js +5 -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 +4 -7
  9. package/api/resources/agents/client/Client.js +49 -44
  10. package/api/resources/agents/client/requests/CreateAgentRequest.d.ts +4 -7
  11. package/api/resources/agents/resources/archivalMemory/client/Client.d.ts +2 -0
  12. package/api/resources/agents/resources/archivalMemory/client/Client.js +31 -21
  13. package/api/resources/agents/resources/context/client/Client.d.ts +2 -0
  14. package/api/resources/agents/resources/context/client/Client.js +20 -10
  15. package/api/resources/agents/resources/coreMemory/client/Client.d.ts +2 -0
  16. package/api/resources/agents/resources/coreMemory/client/Client.js +38 -28
  17. package/api/resources/agents/resources/index.js +17 -7
  18. package/api/resources/agents/resources/memoryVariables/client/Client.d.ts +2 -0
  19. package/api/resources/agents/resources/memoryVariables/client/Client.js +20 -10
  20. package/api/resources/agents/resources/messages/client/Client.d.ts +2 -0
  21. package/api/resources/agents/resources/messages/client/Client.js +36 -26
  22. package/api/resources/agents/resources/messages/types/LettaStreamingResponse.d.ts +1 -1
  23. package/api/resources/agents/resources/messages/types/MessagesListResponse.d.ts +1 -1
  24. package/api/resources/agents/resources/messages/types/MessagesListResponseItem.d.ts +1 -1
  25. package/api/resources/agents/resources/recallMemory/client/Client.d.ts +2 -0
  26. package/api/resources/agents/resources/recallMemory/client/Client.js +20 -10
  27. package/api/resources/agents/resources/sources/client/Client.d.ts +2 -0
  28. package/api/resources/agents/resources/sources/client/Client.js +20 -10
  29. package/api/resources/agents/resources/templates/client/Client.d.ts +2 -0
  30. package/api/resources/agents/resources/templates/client/Client.js +30 -20
  31. package/api/resources/agents/resources/tools/client/Client.d.ts +2 -0
  32. package/api/resources/agents/resources/tools/client/Client.js +26 -16
  33. package/api/resources/agents/types/AgentsSearchRequestCombinator.d.ts +1 -1
  34. package/api/resources/agents/types/AgentsSearchRequestSearchItem.d.ts +1 -1
  35. package/api/resources/agents/types/AgentsSearchRequestSearchItemNameOperator.d.ts +1 -1
  36. package/api/resources/agents/types/AgentsSearchRequestSearchItemOrderByDirection.d.ts +1 -1
  37. package/api/resources/agents/types/AgentsSearchRequestSearchItemOrderByValue.d.ts +1 -1
  38. package/api/resources/agents/types/CreateAgentRequestToolRulesItem.d.ts +1 -1
  39. package/api/resources/agents/types/UpdateAgentToolRulesItem.d.ts +1 -1
  40. package/api/resources/blocks/client/Client.d.ts +2 -0
  41. package/api/resources/blocks/client/Client.js +40 -30
  42. package/api/resources/health/client/Client.d.ts +2 -0
  43. package/api/resources/health/client/Client.js +20 -10
  44. package/api/resources/index.d.ts +2 -0
  45. package/api/resources/index.js +20 -8
  46. package/api/resources/jobs/client/Client.d.ts +2 -0
  47. package/api/resources/jobs/client/Client.js +31 -21
  48. package/api/resources/models/client/Client.d.ts +2 -0
  49. package/api/resources/models/client/Client.js +23 -13
  50. package/api/resources/providers/client/Client.d.ts +2 -0
  51. package/api/resources/providers/client/Client.js +31 -21
  52. package/api/resources/runs/client/Client.d.ts +2 -0
  53. package/api/resources/runs/client/Client.js +37 -27
  54. package/api/resources/sources/client/Client.d.ts +2 -0
  55. package/api/resources/sources/client/Client.js +43 -33
  56. package/api/resources/sources/resources/files/client/Client.d.ts +2 -1
  57. package/api/resources/sources/resources/files/client/Client.js +28 -18
  58. package/api/resources/sources/resources/index.js +17 -7
  59. package/api/resources/sources/resources/passages/client/Client.d.ts +2 -0
  60. package/api/resources/sources/resources/passages/client/Client.js +20 -10
  61. package/api/resources/tag/client/Client.d.ts +44 -0
  62. package/api/resources/tag/client/Client.js +146 -0
  63. package/api/resources/tag/client/index.d.ts +1 -0
  64. package/api/resources/tag/client/index.js +17 -0
  65. package/api/resources/tag/client/requests/ListTagsRequest.d.ts +12 -0
  66. package/api/resources/tag/client/requests/ListTagsRequest.js +5 -0
  67. package/api/resources/tag/client/requests/index.d.ts +1 -0
  68. package/api/resources/tag/client/requests/index.js +2 -0
  69. package/api/resources/tag/index.d.ts +1 -0
  70. package/api/resources/tag/index.js +17 -0
  71. package/api/resources/tools/client/Client.d.ts +2 -0
  72. package/api/resources/tools/client/Client.js +57 -47
  73. package/api/types/AgentStateToolRulesItem.d.ts +1 -1
  74. package/api/types/AgentType.d.ts +1 -1
  75. package/api/types/AppAuthSchemeAuthMode.d.ts +1 -1
  76. package/api/types/ChatCompletionRequestFunctionCall.d.ts +1 -1
  77. package/api/types/ChatCompletionRequestMessagesItem.d.ts +1 -1
  78. package/api/types/ChatCompletionRequestStop.d.ts +1 -1
  79. package/api/types/ChatCompletionRequestToolChoice.d.ts +1 -1
  80. package/api/types/EmbeddingConfigEmbeddingEndpointType.d.ts +1 -1
  81. package/api/types/JobStatus.d.ts +1 -1
  82. package/api/types/JobType.d.ts +1 -1
  83. package/api/types/LettaResponseMessagesItem.d.ts +1 -1
  84. package/api/types/LlmConfigModelEndpointType.d.ts +1 -1
  85. package/api/types/MessageCreateRole.d.ts +1 -1
  86. package/api/types/MessageRole.d.ts +1 -1
  87. package/api/types/NotFoundErrorBodyMessage.d.ts +1 -1
  88. package/api/types/SandboxConfigCreateConfig.d.ts +1 -1
  89. package/api/types/SandboxConfigUpdateConfig.d.ts +1 -1
  90. package/api/types/SandboxType.d.ts +1 -1
  91. package/api/types/ToolCallMessageToolCall.d.ts +1 -1
  92. package/api/types/ToolReturnMessageStatus.d.ts +1 -1
  93. package/api/types/ToolRuleType.d.ts +1 -1
  94. package/api/types/ToolType.d.ts +1 -1
  95. package/api/types/UserMessageInputContent.d.ts +1 -1
  96. package/api/types/ValidationErrorLocItem.d.ts +1 -1
  97. package/core/fetcher/APIResponse.d.ts +1 -1
  98. package/core/fetcher/Fetcher.d.ts +1 -1
  99. package/core/fetcher/Fetcher.js +2 -2
  100. package/core/fetcher/Supplier.d.ts +1 -1
  101. package/core/fetcher/createRequestUrl.js +1 -2
  102. package/core/fetcher/getFetchFn.js +18 -9
  103. package/core/fetcher/getHeader.js +1 -2
  104. package/core/fetcher/getRequestBody.js +3 -4
  105. package/core/fetcher/getResponseBody.js +1 -2
  106. package/core/fetcher/makeRequest.d.ts +1 -1
  107. package/core/fetcher/requestWithRetries.js +3 -4
  108. package/core/fetcher/signals.d.ts +0 -1
  109. package/core/fetcher/signals.js +2 -3
  110. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
  111. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
  112. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
  113. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
  114. package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
  115. package/core/form-data-utils/FormDataWrapper.d.ts +4 -4
  116. package/core/form-data-utils/FormDataWrapper.js +22 -12
  117. package/core/index.js +17 -7
  118. package/core/runtime/runtime.d.ts +1 -1
  119. package/core/runtime/runtime.js +51 -41
  120. package/core/schemas/Schema.d.ts +5 -5
  121. package/core/schemas/builders/bigint/bigint.js +1 -2
  122. package/core/schemas/builders/date/date.js +1 -2
  123. package/core/schemas/builders/enum/enum.js +1 -2
  124. package/core/schemas/builders/lazy/lazy.d.ts +1 -1
  125. package/core/schemas/builders/lazy/lazy.js +3 -4
  126. package/core/schemas/builders/lazy/lazyObject.js +1 -2
  127. package/core/schemas/builders/list/list.js +1 -2
  128. package/core/schemas/builders/literals/booleanLiteral.js +1 -2
  129. package/core/schemas/builders/literals/stringLiteral.js +1 -2
  130. package/core/schemas/builders/object/object.d.ts +1 -1
  131. package/core/schemas/builders/object/object.js +2 -3
  132. package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
  133. package/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
  134. package/core/schemas/builders/object/property.js +2 -3
  135. package/core/schemas/builders/object/types.d.ts +11 -11
  136. package/core/schemas/builders/object-like/getObjectLikeUtils.js +2 -3
  137. package/core/schemas/builders/object-like/types.d.ts +1 -1
  138. package/core/schemas/builders/record/record.js +1 -2
  139. package/core/schemas/builders/record/types.d.ts +2 -2
  140. package/core/schemas/builders/schema-utils/getSchemaUtils.js +3 -4
  141. package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
  142. package/core/schemas/builders/set/set.js +1 -2
  143. package/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
  144. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +1 -2
  145. package/core/schemas/builders/union/discriminant.js +1 -2
  146. package/core/schemas/builders/union/types.d.ts +6 -6
  147. package/core/schemas/builders/union/union.d.ts +1 -1
  148. package/core/schemas/builders/union/union.js +1 -2
  149. package/core/schemas/utils/MaybePromise.d.ts +1 -1
  150. package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +3 -3
  151. package/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
  152. package/core/schemas/utils/entries.d.ts +1 -1
  153. package/core/schemas/utils/entries.js +1 -2
  154. package/core/schemas/utils/filterObject.d.ts +1 -1
  155. package/core/schemas/utils/filterObject.js +1 -2
  156. package/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -2
  157. package/core/schemas/utils/isPlainObject.js +1 -2
  158. package/core/schemas/utils/keys.d.ts +1 -1
  159. package/core/schemas/utils/keys.js +1 -2
  160. package/core/schemas/utils/maybeSkipValidation.js +1 -2
  161. package/core/schemas/utils/partition.js +1 -2
  162. package/core/streaming-fetcher/Stream.d.ts +0 -1
  163. package/core/streaming-fetcher/Stream.js +20 -21
  164. package/dist/Client.d.ts +5 -0
  165. package/dist/Client.js +5 -0
  166. package/dist/api/errors/ConflictError.js +17 -7
  167. package/dist/api/errors/InternalServerError.js +17 -7
  168. package/dist/api/errors/NotFoundError.js +17 -7
  169. package/dist/api/errors/UnprocessableEntityError.js +17 -7
  170. package/dist/api/resources/agents/client/Client.d.ts +4 -7
  171. package/dist/api/resources/agents/client/Client.js +49 -44
  172. package/dist/api/resources/agents/client/requests/CreateAgentRequest.d.ts +4 -7
  173. package/dist/api/resources/agents/resources/archivalMemory/client/Client.d.ts +2 -0
  174. package/dist/api/resources/agents/resources/archivalMemory/client/Client.js +31 -21
  175. package/dist/api/resources/agents/resources/context/client/Client.d.ts +2 -0
  176. package/dist/api/resources/agents/resources/context/client/Client.js +20 -10
  177. package/dist/api/resources/agents/resources/coreMemory/client/Client.d.ts +2 -0
  178. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +38 -28
  179. package/dist/api/resources/agents/resources/index.js +17 -7
  180. package/dist/api/resources/agents/resources/memoryVariables/client/Client.d.ts +2 -0
  181. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +20 -10
  182. package/dist/api/resources/agents/resources/messages/client/Client.d.ts +2 -0
  183. package/dist/api/resources/agents/resources/messages/client/Client.js +36 -26
  184. package/dist/api/resources/agents/resources/messages/types/LettaStreamingResponse.d.ts +1 -1
  185. package/dist/api/resources/agents/resources/messages/types/MessagesListResponse.d.ts +1 -1
  186. package/dist/api/resources/agents/resources/messages/types/MessagesListResponseItem.d.ts +1 -1
  187. package/dist/api/resources/agents/resources/recallMemory/client/Client.d.ts +2 -0
  188. package/dist/api/resources/agents/resources/recallMemory/client/Client.js +20 -10
  189. package/dist/api/resources/agents/resources/sources/client/Client.d.ts +2 -0
  190. package/dist/api/resources/agents/resources/sources/client/Client.js +20 -10
  191. package/dist/api/resources/agents/resources/templates/client/Client.d.ts +2 -0
  192. package/dist/api/resources/agents/resources/templates/client/Client.js +30 -20
  193. package/dist/api/resources/agents/resources/tools/client/Client.d.ts +2 -0
  194. package/dist/api/resources/agents/resources/tools/client/Client.js +26 -16
  195. package/dist/api/resources/agents/types/AgentsSearchRequestCombinator.d.ts +1 -1
  196. package/dist/api/resources/agents/types/AgentsSearchRequestSearchItem.d.ts +1 -1
  197. package/dist/api/resources/agents/types/AgentsSearchRequestSearchItemNameOperator.d.ts +1 -1
  198. package/dist/api/resources/agents/types/AgentsSearchRequestSearchItemOrderByDirection.d.ts +1 -1
  199. package/dist/api/resources/agents/types/AgentsSearchRequestSearchItemOrderByValue.d.ts +1 -1
  200. package/dist/api/resources/agents/types/CreateAgentRequestToolRulesItem.d.ts +1 -1
  201. package/dist/api/resources/agents/types/UpdateAgentToolRulesItem.d.ts +1 -1
  202. package/dist/api/resources/blocks/client/Client.d.ts +2 -0
  203. package/dist/api/resources/blocks/client/Client.js +40 -30
  204. package/dist/api/resources/health/client/Client.d.ts +2 -0
  205. package/dist/api/resources/health/client/Client.js +20 -10
  206. package/dist/api/resources/index.d.ts +2 -0
  207. package/dist/api/resources/index.js +20 -8
  208. package/dist/api/resources/jobs/client/Client.d.ts +2 -0
  209. package/dist/api/resources/jobs/client/Client.js +31 -21
  210. package/dist/api/resources/models/client/Client.d.ts +2 -0
  211. package/dist/api/resources/models/client/Client.js +23 -13
  212. package/dist/api/resources/providers/client/Client.d.ts +2 -0
  213. package/dist/api/resources/providers/client/Client.js +31 -21
  214. package/dist/api/resources/runs/client/Client.d.ts +2 -0
  215. package/dist/api/resources/runs/client/Client.js +37 -27
  216. package/dist/api/resources/sources/client/Client.d.ts +2 -0
  217. package/dist/api/resources/sources/client/Client.js +43 -33
  218. package/dist/api/resources/sources/resources/files/client/Client.d.ts +2 -1
  219. package/dist/api/resources/sources/resources/files/client/Client.js +28 -18
  220. package/dist/api/resources/sources/resources/index.js +17 -7
  221. package/dist/api/resources/sources/resources/passages/client/Client.d.ts +2 -0
  222. package/dist/api/resources/sources/resources/passages/client/Client.js +20 -10
  223. package/dist/api/resources/tag/client/Client.d.ts +44 -0
  224. package/dist/api/resources/tag/client/Client.js +146 -0
  225. package/dist/api/resources/tag/client/index.d.ts +1 -0
  226. package/dist/api/resources/tag/client/index.js +17 -0
  227. package/dist/api/resources/tag/client/requests/ListTagsRequest.d.ts +12 -0
  228. package/dist/api/resources/tag/client/requests/ListTagsRequest.js +5 -0
  229. package/dist/api/resources/tag/client/requests/index.d.ts +1 -0
  230. package/dist/api/resources/tag/client/requests/index.js +2 -0
  231. package/dist/api/resources/tag/index.d.ts +1 -0
  232. package/dist/api/resources/tag/index.js +17 -0
  233. package/dist/api/resources/tools/client/Client.d.ts +2 -0
  234. package/dist/api/resources/tools/client/Client.js +57 -47
  235. package/dist/api/types/AgentStateToolRulesItem.d.ts +1 -1
  236. package/dist/api/types/AgentType.d.ts +1 -1
  237. package/dist/api/types/AppAuthSchemeAuthMode.d.ts +1 -1
  238. package/dist/api/types/ChatCompletionRequestFunctionCall.d.ts +1 -1
  239. package/dist/api/types/ChatCompletionRequestMessagesItem.d.ts +1 -1
  240. package/dist/api/types/ChatCompletionRequestStop.d.ts +1 -1
  241. package/dist/api/types/ChatCompletionRequestToolChoice.d.ts +1 -1
  242. package/dist/api/types/EmbeddingConfigEmbeddingEndpointType.d.ts +1 -1
  243. package/dist/api/types/JobStatus.d.ts +1 -1
  244. package/dist/api/types/JobType.d.ts +1 -1
  245. package/dist/api/types/LettaResponseMessagesItem.d.ts +1 -1
  246. package/dist/api/types/LlmConfigModelEndpointType.d.ts +1 -1
  247. package/dist/api/types/MessageCreateRole.d.ts +1 -1
  248. package/dist/api/types/MessageRole.d.ts +1 -1
  249. package/dist/api/types/NotFoundErrorBodyMessage.d.ts +1 -1
  250. package/dist/api/types/SandboxConfigCreateConfig.d.ts +1 -1
  251. package/dist/api/types/SandboxConfigUpdateConfig.d.ts +1 -1
  252. package/dist/api/types/SandboxType.d.ts +1 -1
  253. package/dist/api/types/ToolCallMessageToolCall.d.ts +1 -1
  254. package/dist/api/types/ToolReturnMessageStatus.d.ts +1 -1
  255. package/dist/api/types/ToolRuleType.d.ts +1 -1
  256. package/dist/api/types/ToolType.d.ts +1 -1
  257. package/dist/api/types/UserMessageInputContent.d.ts +1 -1
  258. package/dist/api/types/ValidationErrorLocItem.d.ts +1 -1
  259. package/dist/core/fetcher/APIResponse.d.ts +1 -1
  260. package/dist/core/fetcher/Fetcher.d.ts +1 -1
  261. package/dist/core/fetcher/Fetcher.js +2 -2
  262. package/dist/core/fetcher/Supplier.d.ts +1 -1
  263. package/dist/core/fetcher/createRequestUrl.js +1 -2
  264. package/dist/core/fetcher/getFetchFn.js +18 -9
  265. package/dist/core/fetcher/getHeader.js +1 -2
  266. package/dist/core/fetcher/getRequestBody.js +3 -4
  267. package/dist/core/fetcher/getResponseBody.js +1 -2
  268. package/dist/core/fetcher/makeRequest.d.ts +1 -1
  269. package/dist/core/fetcher/requestWithRetries.js +3 -4
  270. package/dist/core/fetcher/signals.d.ts +0 -1
  271. package/dist/core/fetcher/signals.js +2 -3
  272. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
  273. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
  274. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
  275. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
  276. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
  277. package/dist/core/form-data-utils/FormDataWrapper.d.ts +4 -4
  278. package/dist/core/form-data-utils/FormDataWrapper.js +22 -12
  279. package/dist/core/index.js +17 -7
  280. package/dist/core/runtime/runtime.d.ts +1 -1
  281. package/dist/core/runtime/runtime.js +51 -41
  282. package/dist/core/schemas/Schema.d.ts +5 -5
  283. package/dist/core/schemas/builders/bigint/bigint.js +1 -2
  284. package/dist/core/schemas/builders/date/date.js +1 -2
  285. package/dist/core/schemas/builders/enum/enum.js +1 -2
  286. package/dist/core/schemas/builders/lazy/lazy.d.ts +1 -1
  287. package/dist/core/schemas/builders/lazy/lazy.js +3 -4
  288. package/dist/core/schemas/builders/lazy/lazyObject.js +1 -2
  289. package/dist/core/schemas/builders/list/list.js +1 -2
  290. package/dist/core/schemas/builders/literals/booleanLiteral.js +1 -2
  291. package/dist/core/schemas/builders/literals/stringLiteral.js +1 -2
  292. package/dist/core/schemas/builders/object/object.d.ts +1 -1
  293. package/dist/core/schemas/builders/object/object.js +2 -3
  294. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
  295. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
  296. package/dist/core/schemas/builders/object/property.js +2 -3
  297. package/dist/core/schemas/builders/object/types.d.ts +11 -11
  298. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +2 -3
  299. package/dist/core/schemas/builders/object-like/types.d.ts +1 -1
  300. package/dist/core/schemas/builders/record/record.js +1 -2
  301. package/dist/core/schemas/builders/record/types.d.ts +2 -2
  302. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +3 -4
  303. package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
  304. package/dist/core/schemas/builders/set/set.js +1 -2
  305. package/dist/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
  306. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +1 -2
  307. package/dist/core/schemas/builders/union/discriminant.js +1 -2
  308. package/dist/core/schemas/builders/union/types.d.ts +6 -6
  309. package/dist/core/schemas/builders/union/union.d.ts +1 -1
  310. package/dist/core/schemas/builders/union/union.js +1 -2
  311. package/dist/core/schemas/utils/MaybePromise.d.ts +1 -1
  312. package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +3 -3
  313. package/dist/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
  314. package/dist/core/schemas/utils/entries.d.ts +1 -1
  315. package/dist/core/schemas/utils/entries.js +1 -2
  316. package/dist/core/schemas/utils/filterObject.d.ts +1 -1
  317. package/dist/core/schemas/utils/filterObject.js +1 -2
  318. package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -2
  319. package/dist/core/schemas/utils/isPlainObject.js +1 -2
  320. package/dist/core/schemas/utils/keys.d.ts +1 -1
  321. package/dist/core/schemas/utils/keys.js +1 -2
  322. package/dist/core/schemas/utils/maybeSkipValidation.js +1 -2
  323. package/dist/core/schemas/utils/partition.js +1 -2
  324. package/dist/core/streaming-fetcher/Stream.d.ts +0 -1
  325. package/dist/core/streaming-fetcher/Stream.js +20 -21
  326. package/dist/environments.d.ts +1 -1
  327. package/dist/index.d.ts +1 -0
  328. package/dist/index.js +19 -8
  329. package/dist/serialization/resources/agents/client/index.js +17 -7
  330. package/dist/serialization/resources/agents/client/list.js +17 -7
  331. package/dist/serialization/resources/agents/client/requests/AgentsSearchRequest.js +17 -7
  332. package/dist/serialization/resources/agents/client/requests/CreateAgentRequest.d.ts +2 -1
  333. package/dist/serialization/resources/agents/client/requests/CreateAgentRequest.js +19 -8
  334. package/dist/serialization/resources/agents/client/requests/UpdateAgent.js +17 -7
  335. package/dist/serialization/resources/agents/resources/archivalMemory/client/create.js +17 -7
  336. package/dist/serialization/resources/agents/resources/archivalMemory/client/index.js +17 -7
  337. package/dist/serialization/resources/agents/resources/archivalMemory/client/list.js +17 -7
  338. package/dist/serialization/resources/agents/resources/archivalMemory/client/requests/CreateArchivalMemory.js +17 -7
  339. package/dist/serialization/resources/agents/resources/coreMemory/client/getBlocks.js +17 -7
  340. package/dist/serialization/resources/agents/resources/coreMemory/client/index.js +17 -7
  341. package/dist/serialization/resources/agents/resources/coreMemory/client/listInContext.js +17 -7
  342. package/dist/serialization/resources/agents/resources/index.js +17 -7
  343. package/dist/serialization/resources/agents/resources/memoryVariables/types/MemoryVariablesGetResponse.js +17 -7
  344. package/dist/serialization/resources/agents/resources/messages/client/requests/LettaStreamingRequest.js +17 -7
  345. package/dist/serialization/resources/agents/resources/messages/client/requests/MessageUpdate.js +17 -7
  346. package/dist/serialization/resources/agents/resources/messages/types/LettaStreamingResponse.js +17 -7
  347. package/dist/serialization/resources/agents/resources/messages/types/MessagesListResponse.js +17 -7
  348. package/dist/serialization/resources/agents/resources/messages/types/MessagesListResponseItem.js +17 -7
  349. package/dist/serialization/resources/agents/resources/sources/client/get.js +17 -7
  350. package/dist/serialization/resources/agents/resources/sources/client/index.js +17 -7
  351. package/dist/serialization/resources/agents/resources/templates/client/requests/TemplatesCreateRequest.js +17 -7
  352. package/dist/serialization/resources/agents/resources/templates/client/requests/TemplatesCreateVersionRequest.js +17 -7
  353. package/dist/serialization/resources/agents/resources/templates/client/requests/TemplatesMigrateRequest.js +17 -7
  354. package/dist/serialization/resources/agents/resources/templates/types/TemplatesMigrateResponse.js +17 -7
  355. package/dist/serialization/resources/agents/resources/tools/client/index.js +17 -7
  356. package/dist/serialization/resources/agents/resources/tools/client/list.js +17 -7
  357. package/dist/serialization/resources/agents/types/AgentsSearchRequestCombinator.js +17 -7
  358. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItem.js +17 -7
  359. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemName.js +17 -7
  360. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemNameOperator.js +17 -7
  361. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemOrderBy.js +17 -7
  362. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemOrderByDirection.js +17 -7
  363. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemOrderByValue.js +17 -7
  364. package/dist/serialization/resources/agents/types/AgentsSearchRequestSearchItemVersion.js +17 -7
  365. package/dist/serialization/resources/agents/types/CreateAgentRequestToolRulesItem.js +17 -7
  366. package/dist/serialization/resources/agents/types/UpdateAgentToolRulesItem.js +17 -7
  367. package/dist/serialization/resources/blocks/client/index.js +17 -7
  368. package/dist/serialization/resources/blocks/client/list.js +17 -7
  369. package/dist/serialization/resources/index.d.ts +1 -0
  370. package/dist/serialization/resources/index.js +19 -8
  371. package/dist/serialization/resources/jobs/client/index.js +17 -7
  372. package/dist/serialization/resources/jobs/client/list.js +17 -7
  373. package/dist/serialization/resources/jobs/client/listActive.js +17 -7
  374. package/dist/serialization/resources/models/client/index.js +17 -7
  375. package/dist/serialization/resources/models/client/listEmbeddingModels.js +17 -7
  376. package/dist/serialization/resources/models/client/listLlms.js +17 -7
  377. package/dist/serialization/resources/providers/client/index.js +17 -7
  378. package/dist/serialization/resources/providers/client/listProviders.js +17 -7
  379. package/dist/serialization/resources/providers/client/requests/ProviderCreate.js +17 -7
  380. package/dist/serialization/resources/providers/client/requests/ProviderUpdate.js +17 -7
  381. package/dist/serialization/resources/runs/client/getRunMessages.js +17 -7
  382. package/dist/serialization/resources/runs/client/index.js +17 -7
  383. package/dist/serialization/resources/runs/client/listActiveRuns.js +17 -7
  384. package/dist/serialization/resources/runs/client/listRuns.js +17 -7
  385. package/dist/serialization/resources/sources/client/getByName.js +17 -7
  386. package/dist/serialization/resources/sources/client/index.js +17 -7
  387. package/dist/serialization/resources/sources/client/list.js +17 -7
  388. package/dist/serialization/resources/sources/client/requests/SourceCreate.js +17 -7
  389. package/dist/serialization/resources/sources/client/requests/SourceUpdate.js +17 -7
  390. package/dist/serialization/resources/sources/resources/files/client/index.js +17 -7
  391. package/dist/serialization/resources/sources/resources/files/client/list.js +17 -7
  392. package/dist/serialization/resources/sources/resources/index.js +17 -7
  393. package/dist/serialization/resources/sources/resources/passages/client/index.js +17 -7
  394. package/dist/serialization/resources/sources/resources/passages/client/list.js +17 -7
  395. package/dist/serialization/resources/tag/client/index.d.ts +1 -0
  396. package/dist/serialization/resources/tag/client/index.js +37 -0
  397. package/dist/serialization/resources/tag/client/listTags.d.ts +9 -0
  398. package/dist/serialization/resources/tag/client/listTags.js +41 -0
  399. package/dist/serialization/resources/tag/index.d.ts +1 -0
  400. package/dist/serialization/resources/tag/index.js +17 -0
  401. package/dist/serialization/resources/tools/client/addBaseTool.js +17 -7
  402. package/dist/serialization/resources/tools/client/getByName.js +17 -7
  403. package/dist/serialization/resources/tools/client/index.js +17 -7
  404. package/dist/serialization/resources/tools/client/list.js +17 -7
  405. package/dist/serialization/resources/tools/client/listComposioActionsByApp.js +17 -7
  406. package/dist/serialization/resources/tools/client/listComposioApps.js +17 -7
  407. package/dist/serialization/resources/tools/client/requests/ToolRunFromSource.js +17 -7
  408. package/dist/serialization/resources/tools/client/requests/ToolUpdate.js +17 -7
  409. package/dist/serialization/types/ActionModel.js +17 -7
  410. package/dist/serialization/types/ActionParametersModel.js +17 -7
  411. package/dist/serialization/types/ActionResponseModel.js +17 -7
  412. package/dist/serialization/types/AgentEnvironmentVariable.js +17 -7
  413. package/dist/serialization/types/AgentState.js +17 -7
  414. package/dist/serialization/types/AgentStateToolRulesItem.js +17 -7
  415. package/dist/serialization/types/AgentType.js +17 -7
  416. package/dist/serialization/types/AppAuthScheme.js +17 -7
  417. package/dist/serialization/types/AppAuthSchemeAuthMode.js +17 -7
  418. package/dist/serialization/types/AppModel.js +17 -7
  419. package/dist/serialization/types/ArchivalMemorySummary.js +17 -7
  420. package/dist/serialization/types/AssistantFile.js +17 -7
  421. package/dist/serialization/types/AssistantMessageInput.js +17 -7
  422. package/dist/serialization/types/AssistantMessageOutput.js +17 -7
  423. package/dist/serialization/types/AuthRequest.js +17 -7
  424. package/dist/serialization/types/AuthResponse.js +17 -7
  425. package/dist/serialization/types/AuthSchemeField.js +17 -7
  426. package/dist/serialization/types/Block.js +17 -7
  427. package/dist/serialization/types/BlockUpdate.js +17 -7
  428. package/dist/serialization/types/ChatCompletionRequest.js +17 -7
  429. package/dist/serialization/types/ChatCompletionRequestFunctionCall.js +17 -7
  430. package/dist/serialization/types/ChatCompletionRequestMessagesItem.js +17 -7
  431. package/dist/serialization/types/ChatCompletionRequestStop.js +17 -7
  432. package/dist/serialization/types/ChatCompletionRequestToolChoice.js +17 -7
  433. package/dist/serialization/types/ChatCompletionResponse.js +17 -7
  434. package/dist/serialization/types/ChildToolRule.js +17 -7
  435. package/dist/serialization/types/Choice.js +17 -7
  436. package/dist/serialization/types/ConditionalToolRule.js +17 -7
  437. package/dist/serialization/types/ConflictErrorBody.js +17 -7
  438. package/dist/serialization/types/ContextWindowOverview.js +17 -7
  439. package/dist/serialization/types/CreateAssistantFileRequest.js +17 -7
  440. package/dist/serialization/types/CreateAssistantRequest.js +17 -7
  441. package/dist/serialization/types/CreateBlock.js +17 -7
  442. package/dist/serialization/types/DeleteAssistantFileResponse.js +17 -7
  443. package/dist/serialization/types/DeleteAssistantResponse.js +17 -7
  444. package/dist/serialization/types/E2BSandboxConfig.js +17 -7
  445. package/dist/serialization/types/EmbeddingConfig.js +17 -7
  446. package/dist/serialization/types/EmbeddingConfigEmbeddingEndpointType.js +17 -7
  447. package/dist/serialization/types/FileMetadata.js +17 -7
  448. package/dist/serialization/types/FunctionCallInput.js +17 -7
  449. package/dist/serialization/types/FunctionCallOutput.js +17 -7
  450. package/dist/serialization/types/FunctionSchema.js +17 -7
  451. package/dist/serialization/types/Health.js +17 -7
  452. package/dist/serialization/types/HttpValidationError.js +17 -7
  453. package/dist/serialization/types/InitToolRule.js +17 -7
  454. package/dist/serialization/types/InternalServerErrorBody.js +17 -7
  455. package/dist/serialization/types/Job.js +17 -7
  456. package/dist/serialization/types/JobStatus.js +17 -7
  457. package/dist/serialization/types/JobType.js +17 -7
  458. package/dist/serialization/types/LettaRequest.js +17 -7
  459. package/dist/serialization/types/LettaResponse.js +17 -7
  460. package/dist/serialization/types/LettaResponseMessagesItem.js +17 -7
  461. package/dist/serialization/types/LettaSchemasLettaMessageToolCall.js +17 -7
  462. package/dist/serialization/types/LettaSchemasMessageMessage.js +17 -7
  463. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionRequestTool.js +17 -7
  464. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionRequestToolCall.js +17 -7
  465. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionRequestToolCallFunction.js +17 -7
  466. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionResponseMessage.js +17 -7
  467. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionResponseToolCall.js +17 -7
  468. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionsToolCallFunction.js +17 -7
  469. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionsToolCallInput.js +17 -7
  470. package/dist/serialization/types/LettaSchemasOpenaiChatCompletionsToolCallOutput.js +17 -7
  471. package/dist/serialization/types/LettaSchemasToolTool.js +17 -7
  472. package/dist/serialization/types/LettaUsageStatistics.js +17 -7
  473. package/dist/serialization/types/LlmConfig.js +17 -7
  474. package/dist/serialization/types/LlmConfigModelEndpointType.js +17 -7
  475. package/dist/serialization/types/LocalSandboxConfig.js +17 -7
  476. package/dist/serialization/types/LogProbToken.js +17 -7
  477. package/dist/serialization/types/Memory.js +17 -7
  478. package/dist/serialization/types/MessageContentLogProb.js +17 -7
  479. package/dist/serialization/types/MessageCreate.js +17 -7
  480. package/dist/serialization/types/MessageCreateRole.js +17 -7
  481. package/dist/serialization/types/MessageRole.js +17 -7
  482. package/dist/serialization/types/NotFoundErrorBody.js +17 -7
  483. package/dist/serialization/types/NotFoundErrorBodyMessage.js +17 -7
  484. package/dist/serialization/types/OpenAiAssistant.js +17 -7
  485. package/dist/serialization/types/Organization.js +17 -7
  486. package/dist/serialization/types/OrganizationCreate.js +17 -7
  487. package/dist/serialization/types/Passage.js +17 -7
  488. package/dist/serialization/types/Provider.js +17 -7
  489. package/dist/serialization/types/ReasoningMessage.js +17 -7
  490. package/dist/serialization/types/RecallMemorySummary.js +17 -7
  491. package/dist/serialization/types/ResponseFormat.js +17 -7
  492. package/dist/serialization/types/Run.js +17 -7
  493. package/dist/serialization/types/SandboxConfig.js +17 -7
  494. package/dist/serialization/types/SandboxConfigCreate.js +17 -7
  495. package/dist/serialization/types/SandboxConfigCreateConfig.js +17 -7
  496. package/dist/serialization/types/SandboxConfigUpdate.js +17 -7
  497. package/dist/serialization/types/SandboxConfigUpdateConfig.js +17 -7
  498. package/dist/serialization/types/SandboxEnvironmentVariable.js +17 -7
  499. package/dist/serialization/types/SandboxEnvironmentVariableCreate.js +17 -7
  500. package/dist/serialization/types/SandboxEnvironmentVariableUpdate.js +17 -7
  501. package/dist/serialization/types/SandboxType.js +17 -7
  502. package/dist/serialization/types/Source.js +17 -7
  503. package/dist/serialization/types/SystemMessageInput.js +17 -7
  504. package/dist/serialization/types/SystemMessageOutput.js +17 -7
  505. package/dist/serialization/types/TerminalToolRule.js +17 -7
  506. package/dist/serialization/types/ToolCallDelta.js +17 -7
  507. package/dist/serialization/types/ToolCallFunctionOutput.js +17 -7
  508. package/dist/serialization/types/ToolCallMessage.js +17 -7
  509. package/dist/serialization/types/ToolCallMessageToolCall.js +17 -7
  510. package/dist/serialization/types/ToolCreate.js +17 -7
  511. package/dist/serialization/types/ToolFunctionChoice.js +17 -7
  512. package/dist/serialization/types/ToolInput.js +17 -7
  513. package/dist/serialization/types/ToolMessage.js +17 -7
  514. package/dist/serialization/types/ToolReturnMessage.js +17 -7
  515. package/dist/serialization/types/ToolReturnMessageStatus.js +17 -7
  516. package/dist/serialization/types/ToolRuleType.js +17 -7
  517. package/dist/serialization/types/ToolType.js +17 -7
  518. package/dist/serialization/types/UsageStatistics.js +17 -7
  519. package/dist/serialization/types/User.js +17 -7
  520. package/dist/serialization/types/UserCreate.js +17 -7
  521. package/dist/serialization/types/UserMessageInput.js +17 -7
  522. package/dist/serialization/types/UserMessageInputContent.js +17 -7
  523. package/dist/serialization/types/UserMessageOutput.js +17 -7
  524. package/dist/serialization/types/UserUpdate.js +17 -7
  525. package/dist/serialization/types/ValidationError.js +17 -7
  526. package/dist/serialization/types/ValidationErrorLocItem.js +17 -7
  527. package/dist/version.d.ts +1 -1
  528. package/dist/version.js +1 -1
  529. package/environments.d.ts +1 -1
  530. package/index.d.ts +1 -0
  531. package/index.js +19 -8
  532. package/{jest.config.js → jest.config.mjs} +4 -1
  533. package/package.json +17 -16
  534. package/reference.md +66 -8
  535. package/scripts/rename-to-esm-files.js +115 -0
  536. package/serialization/resources/agents/client/index.js +17 -7
  537. package/serialization/resources/agents/client/list.js +17 -7
  538. package/serialization/resources/agents/client/requests/AgentsSearchRequest.js +17 -7
  539. package/serialization/resources/agents/client/requests/CreateAgentRequest.d.ts +2 -1
  540. package/serialization/resources/agents/client/requests/CreateAgentRequest.js +19 -8
  541. package/serialization/resources/agents/client/requests/UpdateAgent.js +17 -7
  542. package/serialization/resources/agents/resources/archivalMemory/client/create.js +17 -7
  543. package/serialization/resources/agents/resources/archivalMemory/client/index.js +17 -7
  544. package/serialization/resources/agents/resources/archivalMemory/client/list.js +17 -7
  545. package/serialization/resources/agents/resources/archivalMemory/client/requests/CreateArchivalMemory.js +17 -7
  546. package/serialization/resources/agents/resources/coreMemory/client/getBlocks.js +17 -7
  547. package/serialization/resources/agents/resources/coreMemory/client/index.js +17 -7
  548. package/serialization/resources/agents/resources/coreMemory/client/listInContext.js +17 -7
  549. package/serialization/resources/agents/resources/index.js +17 -7
  550. package/serialization/resources/agents/resources/memoryVariables/types/MemoryVariablesGetResponse.js +17 -7
  551. package/serialization/resources/agents/resources/messages/client/requests/LettaStreamingRequest.js +17 -7
  552. package/serialization/resources/agents/resources/messages/client/requests/MessageUpdate.js +17 -7
  553. package/serialization/resources/agents/resources/messages/types/LettaStreamingResponse.js +17 -7
  554. package/serialization/resources/agents/resources/messages/types/MessagesListResponse.js +17 -7
  555. package/serialization/resources/agents/resources/messages/types/MessagesListResponseItem.js +17 -7
  556. package/serialization/resources/agents/resources/sources/client/get.js +17 -7
  557. package/serialization/resources/agents/resources/sources/client/index.js +17 -7
  558. package/serialization/resources/agents/resources/templates/client/requests/TemplatesCreateRequest.js +17 -7
  559. package/serialization/resources/agents/resources/templates/client/requests/TemplatesCreateVersionRequest.js +17 -7
  560. package/serialization/resources/agents/resources/templates/client/requests/TemplatesMigrateRequest.js +17 -7
  561. package/serialization/resources/agents/resources/templates/types/TemplatesMigrateResponse.js +17 -7
  562. package/serialization/resources/agents/resources/tools/client/index.js +17 -7
  563. package/serialization/resources/agents/resources/tools/client/list.js +17 -7
  564. package/serialization/resources/agents/types/AgentsSearchRequestCombinator.js +17 -7
  565. package/serialization/resources/agents/types/AgentsSearchRequestSearchItem.js +17 -7
  566. package/serialization/resources/agents/types/AgentsSearchRequestSearchItemName.js +17 -7
  567. package/serialization/resources/agents/types/AgentsSearchRequestSearchItemNameOperator.js +17 -7
  568. package/serialization/resources/agents/types/AgentsSearchRequestSearchItemOrderBy.js +17 -7
  569. package/serialization/resources/agents/types/AgentsSearchRequestSearchItemOrderByDirection.js +17 -7
  570. package/serialization/resources/agents/types/AgentsSearchRequestSearchItemOrderByValue.js +17 -7
  571. package/serialization/resources/agents/types/AgentsSearchRequestSearchItemVersion.js +17 -7
  572. package/serialization/resources/agents/types/CreateAgentRequestToolRulesItem.js +17 -7
  573. package/serialization/resources/agents/types/UpdateAgentToolRulesItem.js +17 -7
  574. package/serialization/resources/blocks/client/index.js +17 -7
  575. package/serialization/resources/blocks/client/list.js +17 -7
  576. package/serialization/resources/index.d.ts +1 -0
  577. package/serialization/resources/index.js +19 -8
  578. package/serialization/resources/jobs/client/index.js +17 -7
  579. package/serialization/resources/jobs/client/list.js +17 -7
  580. package/serialization/resources/jobs/client/listActive.js +17 -7
  581. package/serialization/resources/models/client/index.js +17 -7
  582. package/serialization/resources/models/client/listEmbeddingModels.js +17 -7
  583. package/serialization/resources/models/client/listLlms.js +17 -7
  584. package/serialization/resources/providers/client/index.js +17 -7
  585. package/serialization/resources/providers/client/listProviders.js +17 -7
  586. package/serialization/resources/providers/client/requests/ProviderCreate.js +17 -7
  587. package/serialization/resources/providers/client/requests/ProviderUpdate.js +17 -7
  588. package/serialization/resources/runs/client/getRunMessages.js +17 -7
  589. package/serialization/resources/runs/client/index.js +17 -7
  590. package/serialization/resources/runs/client/listActiveRuns.js +17 -7
  591. package/serialization/resources/runs/client/listRuns.js +17 -7
  592. package/serialization/resources/sources/client/getByName.js +17 -7
  593. package/serialization/resources/sources/client/index.js +17 -7
  594. package/serialization/resources/sources/client/list.js +17 -7
  595. package/serialization/resources/sources/client/requests/SourceCreate.js +17 -7
  596. package/serialization/resources/sources/client/requests/SourceUpdate.js +17 -7
  597. package/serialization/resources/sources/resources/files/client/index.js +17 -7
  598. package/serialization/resources/sources/resources/files/client/list.js +17 -7
  599. package/serialization/resources/sources/resources/index.js +17 -7
  600. package/serialization/resources/sources/resources/passages/client/index.js +17 -7
  601. package/serialization/resources/sources/resources/passages/client/list.js +17 -7
  602. package/serialization/resources/tag/client/index.d.ts +1 -0
  603. package/serialization/resources/tag/client/index.js +37 -0
  604. package/serialization/resources/tag/client/listTags.d.ts +9 -0
  605. package/serialization/resources/tag/client/listTags.js +41 -0
  606. package/serialization/resources/tag/index.d.ts +1 -0
  607. package/serialization/resources/tag/index.js +17 -0
  608. package/serialization/resources/tools/client/addBaseTool.js +17 -7
  609. package/serialization/resources/tools/client/getByName.js +17 -7
  610. package/serialization/resources/tools/client/index.js +17 -7
  611. package/serialization/resources/tools/client/list.js +17 -7
  612. package/serialization/resources/tools/client/listComposioActionsByApp.js +17 -7
  613. package/serialization/resources/tools/client/listComposioApps.js +17 -7
  614. package/serialization/resources/tools/client/requests/ToolRunFromSource.js +17 -7
  615. package/serialization/resources/tools/client/requests/ToolUpdate.js +17 -7
  616. package/serialization/types/ActionModel.js +17 -7
  617. package/serialization/types/ActionParametersModel.js +17 -7
  618. package/serialization/types/ActionResponseModel.js +17 -7
  619. package/serialization/types/AgentEnvironmentVariable.js +17 -7
  620. package/serialization/types/AgentState.js +17 -7
  621. package/serialization/types/AgentStateToolRulesItem.js +17 -7
  622. package/serialization/types/AgentType.js +17 -7
  623. package/serialization/types/AppAuthScheme.js +17 -7
  624. package/serialization/types/AppAuthSchemeAuthMode.js +17 -7
  625. package/serialization/types/AppModel.js +17 -7
  626. package/serialization/types/ArchivalMemorySummary.js +17 -7
  627. package/serialization/types/AssistantFile.js +17 -7
  628. package/serialization/types/AssistantMessageInput.js +17 -7
  629. package/serialization/types/AssistantMessageOutput.js +17 -7
  630. package/serialization/types/AuthRequest.js +17 -7
  631. package/serialization/types/AuthResponse.js +17 -7
  632. package/serialization/types/AuthSchemeField.js +17 -7
  633. package/serialization/types/Block.js +17 -7
  634. package/serialization/types/BlockUpdate.js +17 -7
  635. package/serialization/types/ChatCompletionRequest.js +17 -7
  636. package/serialization/types/ChatCompletionRequestFunctionCall.js +17 -7
  637. package/serialization/types/ChatCompletionRequestMessagesItem.js +17 -7
  638. package/serialization/types/ChatCompletionRequestStop.js +17 -7
  639. package/serialization/types/ChatCompletionRequestToolChoice.js +17 -7
  640. package/serialization/types/ChatCompletionResponse.js +17 -7
  641. package/serialization/types/ChildToolRule.js +17 -7
  642. package/serialization/types/Choice.js +17 -7
  643. package/serialization/types/ConditionalToolRule.js +17 -7
  644. package/serialization/types/ConflictErrorBody.js +17 -7
  645. package/serialization/types/ContextWindowOverview.js +17 -7
  646. package/serialization/types/CreateAssistantFileRequest.js +17 -7
  647. package/serialization/types/CreateAssistantRequest.js +17 -7
  648. package/serialization/types/CreateBlock.js +17 -7
  649. package/serialization/types/DeleteAssistantFileResponse.js +17 -7
  650. package/serialization/types/DeleteAssistantResponse.js +17 -7
  651. package/serialization/types/E2BSandboxConfig.js +17 -7
  652. package/serialization/types/EmbeddingConfig.js +17 -7
  653. package/serialization/types/EmbeddingConfigEmbeddingEndpointType.js +17 -7
  654. package/serialization/types/FileMetadata.js +17 -7
  655. package/serialization/types/FunctionCallInput.js +17 -7
  656. package/serialization/types/FunctionCallOutput.js +17 -7
  657. package/serialization/types/FunctionSchema.js +17 -7
  658. package/serialization/types/Health.js +17 -7
  659. package/serialization/types/HttpValidationError.js +17 -7
  660. package/serialization/types/InitToolRule.js +17 -7
  661. package/serialization/types/InternalServerErrorBody.js +17 -7
  662. package/serialization/types/Job.js +17 -7
  663. package/serialization/types/JobStatus.js +17 -7
  664. package/serialization/types/JobType.js +17 -7
  665. package/serialization/types/LettaRequest.js +17 -7
  666. package/serialization/types/LettaResponse.js +17 -7
  667. package/serialization/types/LettaResponseMessagesItem.js +17 -7
  668. package/serialization/types/LettaSchemasLettaMessageToolCall.js +17 -7
  669. package/serialization/types/LettaSchemasMessageMessage.js +17 -7
  670. package/serialization/types/LettaSchemasOpenaiChatCompletionRequestTool.js +17 -7
  671. package/serialization/types/LettaSchemasOpenaiChatCompletionRequestToolCall.js +17 -7
  672. package/serialization/types/LettaSchemasOpenaiChatCompletionRequestToolCallFunction.js +17 -7
  673. package/serialization/types/LettaSchemasOpenaiChatCompletionResponseMessage.js +17 -7
  674. package/serialization/types/LettaSchemasOpenaiChatCompletionResponseToolCall.js +17 -7
  675. package/serialization/types/LettaSchemasOpenaiChatCompletionsToolCallFunction.js +17 -7
  676. package/serialization/types/LettaSchemasOpenaiChatCompletionsToolCallInput.js +17 -7
  677. package/serialization/types/LettaSchemasOpenaiChatCompletionsToolCallOutput.js +17 -7
  678. package/serialization/types/LettaSchemasToolTool.js +17 -7
  679. package/serialization/types/LettaUsageStatistics.js +17 -7
  680. package/serialization/types/LlmConfig.js +17 -7
  681. package/serialization/types/LlmConfigModelEndpointType.js +17 -7
  682. package/serialization/types/LocalSandboxConfig.js +17 -7
  683. package/serialization/types/LogProbToken.js +17 -7
  684. package/serialization/types/Memory.js +17 -7
  685. package/serialization/types/MessageContentLogProb.js +17 -7
  686. package/serialization/types/MessageCreate.js +17 -7
  687. package/serialization/types/MessageCreateRole.js +17 -7
  688. package/serialization/types/MessageRole.js +17 -7
  689. package/serialization/types/NotFoundErrorBody.js +17 -7
  690. package/serialization/types/NotFoundErrorBodyMessage.js +17 -7
  691. package/serialization/types/OpenAiAssistant.js +17 -7
  692. package/serialization/types/Organization.js +17 -7
  693. package/serialization/types/OrganizationCreate.js +17 -7
  694. package/serialization/types/Passage.js +17 -7
  695. package/serialization/types/Provider.js +17 -7
  696. package/serialization/types/ReasoningMessage.js +17 -7
  697. package/serialization/types/RecallMemorySummary.js +17 -7
  698. package/serialization/types/ResponseFormat.js +17 -7
  699. package/serialization/types/Run.js +17 -7
  700. package/serialization/types/SandboxConfig.js +17 -7
  701. package/serialization/types/SandboxConfigCreate.js +17 -7
  702. package/serialization/types/SandboxConfigCreateConfig.js +17 -7
  703. package/serialization/types/SandboxConfigUpdate.js +17 -7
  704. package/serialization/types/SandboxConfigUpdateConfig.js +17 -7
  705. package/serialization/types/SandboxEnvironmentVariable.js +17 -7
  706. package/serialization/types/SandboxEnvironmentVariableCreate.js +17 -7
  707. package/serialization/types/SandboxEnvironmentVariableUpdate.js +17 -7
  708. package/serialization/types/SandboxType.js +17 -7
  709. package/serialization/types/Source.js +17 -7
  710. package/serialization/types/SystemMessageInput.js +17 -7
  711. package/serialization/types/SystemMessageOutput.js +17 -7
  712. package/serialization/types/TerminalToolRule.js +17 -7
  713. package/serialization/types/ToolCallDelta.js +17 -7
  714. package/serialization/types/ToolCallFunctionOutput.js +17 -7
  715. package/serialization/types/ToolCallMessage.js +17 -7
  716. package/serialization/types/ToolCallMessageToolCall.js +17 -7
  717. package/serialization/types/ToolCreate.js +17 -7
  718. package/serialization/types/ToolFunctionChoice.js +17 -7
  719. package/serialization/types/ToolInput.js +17 -7
  720. package/serialization/types/ToolMessage.js +17 -7
  721. package/serialization/types/ToolReturnMessage.js +17 -7
  722. package/serialization/types/ToolReturnMessageStatus.js +17 -7
  723. package/serialization/types/ToolRuleType.js +17 -7
  724. package/serialization/types/ToolType.js +17 -7
  725. package/serialization/types/UsageStatistics.js +17 -7
  726. package/serialization/types/User.js +17 -7
  727. package/serialization/types/UserCreate.js +17 -7
  728. package/serialization/types/UserMessageInput.js +17 -7
  729. package/serialization/types/UserMessageInputContent.js +17 -7
  730. package/serialization/types/UserMessageOutput.js +17 -7
  731. package/serialization/types/UserUpdate.js +17 -7
  732. package/serialization/types/ValidationError.js +17 -7
  733. package/serialization/types/ValidationErrorLocItem.js +17 -7
  734. package/version.d.ts +1 -1
  735. package/version.js +1 -1
@@ -9,9 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getRequestBody = void 0;
13
- function getRequestBody({ body, type }) {
14
- return __awaiter(this, void 0, void 0, function* () {
12
+ exports.getRequestBody = getRequestBody;
13
+ function getRequestBody(_a) {
14
+ return __awaiter(this, arguments, void 0, function* ({ body, type }) {
15
15
  if (type.includes("json")) {
16
16
  return JSON.stringify(body);
17
17
  }
@@ -20,4 +20,3 @@ function getRequestBody({ body, type }) {
20
20
  }
21
21
  });
22
22
  }
23
- exports.getRequestBody = getRequestBody;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getResponseBody = void 0;
12
+ exports.getResponseBody = getResponseBody;
13
13
  const chooseStreamWrapper_1 = require("./stream-wrappers/chooseStreamWrapper");
14
14
  function getResponseBody(response, responseType) {
15
15
  return __awaiter(this, void 0, void 0, function* () {
@@ -52,4 +52,3 @@ function getResponseBody(response, responseType) {
52
52
  }
53
53
  });
54
54
  }
55
- exports.getResponseBody = getResponseBody;
@@ -1 +1 @@
1
- export declare const makeRequest: (fetchFn: (url: string, init: RequestInit) => Promise<Response>, url: string, method: string, headers: Record<string, string>, requestBody: BodyInit | undefined, timeoutMs?: number | undefined, abortSignal?: AbortSignal | undefined, withCredentials?: boolean | undefined, duplex?: "half" | undefined) => Promise<Response>;
1
+ export declare const makeRequest: (fetchFn: (url: string, init: RequestInit) => Promise<Response>, url: string, method: string, headers: Record<string, string>, requestBody: BodyInit | undefined, timeoutMs?: number, abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half") => Promise<Response>;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.requestWithRetries = void 0;
12
+ exports.requestWithRetries = requestWithRetries;
13
13
  const INITIAL_RETRY_DELAY = 1000; // in milliseconds
14
14
  const MAX_RETRY_DELAY = 60000; // in milliseconds
15
15
  const DEFAULT_MAX_RETRIES = 2;
@@ -19,8 +19,8 @@ function addJitter(delay) {
19
19
  const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR;
20
20
  return delay * jitterMultiplier;
21
21
  }
22
- function requestWithRetries(requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
23
- return __awaiter(this, void 0, void 0, function* () {
22
+ function requestWithRetries(requestFn_1) {
23
+ return __awaiter(this, arguments, void 0, function* (requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
24
24
  let response = yield requestFn();
25
25
  for (let i = 0; i < maxRetries; ++i) {
26
26
  if ([408, 409, 429].includes(response.status) || response.status >= 500) {
@@ -38,4 +38,3 @@ function requestWithRetries(requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
38
38
  return response;
39
39
  });
40
40
  }
41
- exports.requestWithRetries = requestWithRetries;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  export declare function getTimeoutSignal(timeoutMs: number): {
3
2
  signal: AbortSignal;
4
3
  abortId: NodeJS.Timeout;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.anySignal = exports.getTimeoutSignal = void 0;
3
+ exports.getTimeoutSignal = getTimeoutSignal;
4
+ exports.anySignal = anySignal;
4
5
  const TIMEOUT = "timeout";
5
6
  function getTimeoutSignal(timeoutMs) {
6
7
  const controller = new AbortController();
7
8
  const abortId = setTimeout(() => controller.abort(TIMEOUT), timeoutMs);
8
9
  return { signal: controller.signal, abortId };
9
10
  }
10
- exports.getTimeoutSignal = getTimeoutSignal;
11
11
  /**
12
12
  * Returns an abort signal that is getting aborted when
13
13
  * at least one of the specified abort signals is aborted.
@@ -34,4 +34,3 @@ function anySignal(...args) {
34
34
  }
35
35
  return controller.signal;
36
36
  }
37
- exports.anySignal = anySignal;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { Readable, Writable } from "readable-stream";
3
2
  import { EventCallback, StreamWrapper } from "./chooseStreamWrapper";
4
3
  export declare class NodePre18StreamWrapper implements StreamWrapper<Writable, Buffer> {
@@ -76,21 +76,23 @@ class NodePre18StreamWrapper {
76
76
  this.encoding = encoding;
77
77
  }
78
78
  text() {
79
- var e_1, _a;
80
79
  return __awaiter(this, void 0, void 0, function* () {
80
+ var _a, e_1, _b, _c;
81
81
  const chunks = [];
82
82
  const encoder = new TextEncoder();
83
83
  this.readableStream.setEncoding((this.encoding || "utf-8"));
84
84
  try {
85
- for (var _b = __asyncValues(this.readableStream), _c; _c = yield _b.next(), !_c.done;) {
86
- const chunk = _c.value;
85
+ for (var _d = true, _e = __asyncValues(this.readableStream), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
86
+ _c = _f.value;
87
+ _d = false;
88
+ const chunk = _c;
87
89
  chunks.push(encoder.encode(chunk));
88
90
  }
89
91
  }
90
92
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
91
93
  finally {
92
94
  try {
93
- if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
95
+ if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
94
96
  }
95
97
  finally { if (e_1) throw e_1.error; }
96
98
  }
@@ -1,5 +1,5 @@
1
1
  import { StreamWrapper } from "./chooseStreamWrapper";
2
- declare type EventCallback = (data?: any) => void;
2
+ type EventCallback = (data?: any) => void;
3
3
  export declare class UndiciStreamWrapper<ReadFormat extends Uint8Array | Uint16Array | Uint32Array> implements StreamWrapper<UndiciStreamWrapper<ReadFormat> | WritableStream<ReadFormat>, ReadFormat> {
4
4
  private readableStream;
5
5
  private reader;
@@ -1,4 +1,4 @@
1
- export declare type EventCallback = (data?: any) => void;
1
+ export type EventCallback = (data?: any) => void;
2
2
  export interface StreamWrapper<WritableStream, ReadFormat> {
3
3
  setEncoding(encoding?: string): void;
4
4
  on(event: string, callback: EventCallback): void;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -32,7 +42,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
42
  });
33
43
  };
34
44
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.chooseStreamWrapper = void 0;
45
+ exports.chooseStreamWrapper = chooseStreamWrapper;
36
46
  const runtime_1 = require("../../runtime");
37
47
  function chooseStreamWrapper(responseBody) {
38
48
  return __awaiter(this, void 0, void 0, function* () {
@@ -47,4 +57,3 @@ function chooseStreamWrapper(responseBody) {
47
57
  }
48
58
  });
49
59
  }
50
- exports.chooseStreamWrapper = chooseStreamWrapper;
@@ -1,4 +1,4 @@
1
- export declare type MaybePromise<T> = Promise<T> | T;
1
+ export type MaybePromise<T> = Promise<T> | T;
2
2
  interface FormDataRequest<Body> {
3
3
  body: Body;
4
4
  headers: Record<string, string>;
@@ -11,7 +11,7 @@ export interface CrossPlatformFormData {
11
11
  getRequest(): MaybePromise<FormDataRequest<unknown>>;
12
12
  }
13
13
  export declare function newFormData(): Promise<CrossPlatformFormData>;
14
- export declare type Node18FormDataFd = {
14
+ export type Node18FormDataFd = {
15
15
  append(name: string, value: unknown, fileName?: string): void;
16
16
  } | undefined;
17
17
  /**
@@ -24,7 +24,7 @@ export declare class Node18FormData implements CrossPlatformFormData {
24
24
  appendFile(key: string, value: unknown, fileName?: string): Promise<void>;
25
25
  getRequest(): Promise<FormDataRequest<unknown>>;
26
26
  }
27
- export declare type Node16FormDataFd = {
27
+ export type Node16FormDataFd = {
28
28
  append(name: string, value: unknown, options?: string | {
29
29
  header?: string | Headers;
30
30
  knownLength?: number;
@@ -44,7 +44,7 @@ export declare class Node16FormData implements CrossPlatformFormData {
44
44
  appendFile(key: string, value: unknown, fileName?: string): Promise<void>;
45
45
  getRequest(): FormDataRequest<Node16FormDataFd>;
46
46
  }
47
- export declare type WebFormDataFd = {
47
+ export type WebFormDataFd = {
48
48
  append(name: string, value: string | Blob, fileName?: string): void;
49
49
  } | undefined;
50
50
  /**
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -32,7 +42,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
42
  });
33
43
  };
34
44
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.WebFormData = exports.Node16FormData = exports.Node18FormData = exports.newFormData = void 0;
45
+ exports.WebFormData = exports.Node16FormData = exports.Node18FormData = void 0;
46
+ exports.newFormData = newFormData;
36
47
  const runtime_1 = require("../runtime");
37
48
  function isNamedValue(value) {
38
49
  return typeof value === "object" && value != null && "name" in value;
@@ -53,7 +64,6 @@ function newFormData() {
53
64
  return formdata;
54
65
  });
55
66
  }
56
- exports.newFormData = newFormData;
57
67
  /**
58
68
  * Form Data Implementation for Node.js 18+
59
69
  */
@@ -68,8 +78,8 @@ class Node18FormData {
68
78
  (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
69
79
  }
70
80
  appendFile(key, value, fileName) {
71
- var _a, _b;
72
81
  return __awaiter(this, void 0, void 0, function* () {
82
+ var _a, _b;
73
83
  if (fileName == null && isNamedValue(value)) {
74
84
  fileName = value.name;
75
85
  }
@@ -114,8 +124,8 @@ class Node16FormData {
114
124
  (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
115
125
  }
116
126
  appendFile(key, value, fileName) {
117
- var _a, _b;
118
127
  return __awaiter(this, void 0, void 0, function* () {
128
+ var _a, _b;
119
129
  if (fileName == null && isNamedValue(value)) {
120
130
  fileName = value.name;
121
131
  }
@@ -156,8 +166,8 @@ class WebFormData {
156
166
  (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
157
167
  }
158
168
  appendFile(key, value, fileName) {
159
- var _a;
160
169
  return __awaiter(this, void 0, void 0, function* () {
170
+ var _a;
161
171
  if (fileName == null && isNamedValue(value)) {
162
172
  fileName = value.name;
163
173
  }
package/core/index.js CHANGED
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
18
18
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
19
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
20
  };
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
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
+ })();
28
38
  Object.defineProperty(exports, "__esModule", { value: true });
29
39
  exports.serialization = void 0;
30
40
  __exportStar(require("./fetcher"), exports);
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export declare const RUNTIME: Runtime;
5
5
  export interface Runtime {
6
- type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd";
6
+ type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd" | "edge-runtime";
7
7
  version?: string;
8
8
  parsedVersion?: number;
9
9
  }
@@ -1,80 +1,85 @@
1
1
  "use strict";
2
- var _a, _b, _c, _d, _e;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.RUNTIME = void 0;
5
- /**
6
- * A constant that indicates whether the environment the code is running is a Web Browser.
7
- */
8
- const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
9
- /**
10
- * A constant that indicates whether the environment the code is running is a Web Worker.
11
- */
12
- const isWebWorker = typeof self === "object" &&
13
- // @ts-ignore
14
- typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" &&
15
- (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" ||
16
- ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" ||
17
- ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "SharedWorkerGlobalScope");
18
- /**
19
- * A constant that indicates whether the environment the code is running is Deno.
20
- */
21
- const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
22
- /**
23
- * A constant that indicates whether the environment the code is running is Bun.sh.
24
- */
25
- const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
26
- /**
27
- * A constant that indicates whether the environment the code is running is Node.JS.
28
- */
29
- const isNode = typeof process !== "undefined" &&
30
- Boolean(process.version) &&
31
- Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node) &&
32
- // Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions
33
- !isDeno &&
34
- !isBun;
35
- /**
36
- * A constant that indicates whether the environment the code is running is in React-Native.
37
- * https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
38
- */
39
- const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
40
- /**
41
- * A constant that indicates whether the environment the code is running is Cloudflare.
42
- * https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent
43
- */
44
- const isCloudflare = typeof globalThis !== "undefined" && ((_e = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _e === void 0 ? void 0 : _e.userAgent) === "Cloudflare-Workers";
45
4
  /**
46
5
  * A constant that indicates which environment and version the SDK is running in.
47
6
  */
48
7
  exports.RUNTIME = evaluateRuntime();
49
8
  function evaluateRuntime() {
9
+ var _a, _b, _c, _d, _e;
10
+ /**
11
+ * A constant that indicates whether the environment the code is running is a Web Browser.
12
+ */
13
+ const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
50
14
  if (isBrowser) {
51
15
  return {
52
16
  type: "browser",
53
17
  version: window.navigator.userAgent,
54
18
  };
55
19
  }
20
+ /**
21
+ * A constant that indicates whether the environment the code is running is Cloudflare.
22
+ * https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent
23
+ */
24
+ const isCloudflare = typeof globalThis !== "undefined" && ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === "Cloudflare-Workers";
56
25
  if (isCloudflare) {
57
26
  return {
58
27
  type: "workerd",
59
28
  };
60
29
  }
30
+ /**
31
+ * A constant that indicates whether the environment the code is running is Edge Runtime.
32
+ * https://vercel.com/docs/functions/runtimes/edge-runtime#check-if-you're-running-on-the-edge-runtime
33
+ */
34
+ const isEdgeRuntime = typeof EdgeRuntime === "string";
35
+ if (isEdgeRuntime) {
36
+ return {
37
+ type: "edge-runtime",
38
+ };
39
+ }
40
+ /**
41
+ * A constant that indicates whether the environment the code is running is a Web Worker.
42
+ */
43
+ const isWebWorker = typeof self === "object" &&
44
+ // @ts-ignore
45
+ typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" &&
46
+ (((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "DedicatedWorkerGlobalScope" ||
47
+ ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "ServiceWorkerGlobalScope" ||
48
+ ((_d = self.constructor) === null || _d === void 0 ? void 0 : _d.name) === "SharedWorkerGlobalScope");
61
49
  if (isWebWorker) {
62
50
  return {
63
51
  type: "web-worker",
64
52
  };
65
53
  }
54
+ /**
55
+ * A constant that indicates whether the environment the code is running is Deno.
56
+ * FYI Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions
57
+ */
58
+ const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
66
59
  if (isDeno) {
67
60
  return {
68
61
  type: "deno",
69
62
  version: Deno.version.deno,
70
63
  };
71
64
  }
65
+ /**
66
+ * A constant that indicates whether the environment the code is running is Bun.sh.
67
+ */
68
+ const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
72
69
  if (isBun) {
73
70
  return {
74
71
  type: "bun",
75
72
  version: Bun.version,
76
73
  };
77
74
  }
75
+ /**
76
+ * A constant that indicates whether the environment the code is running is Node.JS.
77
+ */
78
+ const isNode = typeof process !== "undefined" &&
79
+ "version" in process &&
80
+ !!process.version &&
81
+ "versions" in process &&
82
+ !!((_e = process.versions) === null || _e === void 0 ? void 0 : _e.node);
78
83
  if (isNode) {
79
84
  return {
80
85
  type: "node",
@@ -82,6 +87,11 @@ function evaluateRuntime() {
82
87
  parsedVersion: Number(process.versions.node.split(".")[0]),
83
88
  };
84
89
  }
90
+ /**
91
+ * A constant that indicates whether the environment the code is running is in React-Native.
92
+ * https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
93
+ */
94
+ const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
85
95
  if (isReactNative) {
86
96
  return {
87
97
  type: "react-native",
@@ -1,7 +1,7 @@
1
1
  import { SchemaUtils } from "./builders";
2
- export declare type Schema<Raw = unknown, Parsed = unknown> = BaseSchema<Raw, Parsed> & SchemaUtils<Raw, Parsed>;
3
- export declare type inferRaw<S extends Schema> = S extends Schema<infer Raw, any> ? Raw : never;
4
- export declare type inferParsed<S extends Schema> = S extends Schema<any, infer Parsed> ? Parsed : never;
2
+ export type Schema<Raw = unknown, Parsed = unknown> = BaseSchema<Raw, Parsed> & SchemaUtils<Raw, Parsed>;
3
+ export type inferRaw<S extends Schema> = S extends Schema<infer Raw, any> ? Raw : never;
4
+ export type inferParsed<S extends Schema> = S extends Schema<any, infer Parsed> ? Parsed : never;
5
5
  export interface BaseSchema<Raw, Parsed> {
6
6
  parse: (raw: unknown, opts?: SchemaOptions) => MaybeValid<Parsed>;
7
7
  json: (parsed: unknown, opts?: SchemaOptions) => MaybeValid<Raw>;
@@ -26,8 +26,8 @@ export declare const SchemaType: {
26
26
  readonly UNDISCRIMINATED_UNION: "undiscriminatedUnion";
27
27
  readonly OPTIONAL: "optional";
28
28
  };
29
- export declare type SchemaType = typeof SchemaType[keyof typeof SchemaType];
30
- export declare type MaybeValid<T> = Valid<T> | Invalid;
29
+ export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType];
30
+ export type MaybeValid<T> = Valid<T> | Invalid;
31
31
  export interface Valid<T> {
32
32
  ok: true;
33
33
  value: T;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bigint = void 0;
3
+ exports.bigint = bigint;
4
4
  const Schema_1 = require("../../Schema");
5
5
  const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
6
6
  const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
@@ -47,4 +47,3 @@ function bigint() {
47
47
  };
48
48
  return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
49
49
  }
50
- exports.bigint = bigint;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.date = void 0;
3
+ exports.date = date;
4
4
  const Schema_1 = require("../../Schema");
5
5
  const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
6
6
  const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
@@ -60,4 +60,3 @@ function date() {
60
60
  };
61
61
  return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
62
62
  }
63
- exports.date = date;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.enum_ = void 0;
3
+ exports.enum_ = enum_;
4
4
  const Schema_1 = require("../../Schema");
5
5
  const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
6
6
  const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
@@ -36,4 +36,3 @@ function enum_(values) {
36
36
  });
37
37
  return schemaCreator();
38
38
  }
39
- exports.enum_ = enum_;
@@ -1,5 +1,5 @@
1
1
  import { BaseSchema, Schema } from "../../Schema";
2
- export declare type SchemaGetter<SchemaType extends Schema<any, any>> = () => SchemaType;
2
+ export type SchemaGetter<SchemaType extends Schema<any, any>> = () => SchemaType;
3
3
  export declare function lazy<Raw, Parsed>(getter: SchemaGetter<Schema<Raw, Parsed>>): Schema<Raw, Parsed>;
4
4
  export declare function constructLazyBaseSchema<Raw, Parsed>(getter: SchemaGetter<Schema<Raw, Parsed>>): BaseSchema<Raw, Parsed>;
5
5
  export declare function getMemoizedSchema<SchemaType extends Schema<any, any>>(getter: SchemaGetter<SchemaType>): SchemaType;
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMemoizedSchema = exports.constructLazyBaseSchema = exports.lazy = void 0;
3
+ exports.lazy = lazy;
4
+ exports.constructLazyBaseSchema = constructLazyBaseSchema;
5
+ exports.getMemoizedSchema = getMemoizedSchema;
4
6
  const schema_utils_1 = require("../schema-utils");
5
7
  function lazy(getter) {
6
8
  const baseSchema = constructLazyBaseSchema(getter);
7
9
  return Object.assign(Object.assign({}, baseSchema), (0, schema_utils_1.getSchemaUtils)(baseSchema));
8
10
  }
9
- exports.lazy = lazy;
10
11
  function constructLazyBaseSchema(getter) {
11
12
  return {
12
13
  parse: (raw, opts) => getMemoizedSchema(getter).parse(raw, opts),
@@ -14,7 +15,6 @@ function constructLazyBaseSchema(getter) {
14
15
  getType: () => getMemoizedSchema(getter).getType(),
15
16
  };
16
17
  }
17
- exports.constructLazyBaseSchema = constructLazyBaseSchema;
18
18
  function getMemoizedSchema(getter) {
19
19
  const castedGetter = getter;
20
20
  if (castedGetter.__zurg_memoized == null) {
@@ -22,4 +22,3 @@ function getMemoizedSchema(getter) {
22
22
  }
23
23
  return castedGetter.__zurg_memoized;
24
24
  }
25
- exports.getMemoizedSchema = getMemoizedSchema;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lazyObject = void 0;
3
+ exports.lazyObject = lazyObject;
4
4
  const object_1 = require("../object");
5
5
  const object_like_1 = require("../object-like");
6
6
  const schema_utils_1 = require("../schema-utils");
@@ -9,4 +9,3 @@ function lazyObject(getter) {
9
9
  const baseSchema = Object.assign(Object.assign({}, (0, lazy_1.constructLazyBaseSchema)(getter)), { _getRawProperties: () => (0, lazy_1.getMemoizedSchema)(getter)._getRawProperties(), _getParsedProperties: () => (0, lazy_1.getMemoizedSchema)(getter)._getParsedProperties() });
10
10
  return Object.assign(Object.assign(Object.assign(Object.assign({}, baseSchema), (0, schema_utils_1.getSchemaUtils)(baseSchema)), (0, object_like_1.getObjectLikeUtils)(baseSchema)), (0, object_1.getObjectUtils)(baseSchema));
11
11
  }
12
- exports.lazyObject = lazyObject;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.list = void 0;
3
+ exports.list = list;
4
4
  const Schema_1 = require("../../Schema");
5
5
  const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
6
6
  const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
@@ -19,7 +19,6 @@ function list(schema) {
19
19
  };
20
20
  return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
21
21
  }
22
- exports.list = list;
23
22
  function validateAndTransformArray(value, transformItem) {
24
23
  if (!Array.isArray(value)) {
25
24
  return {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.booleanLiteral = void 0;
3
+ exports.booleanLiteral = booleanLiteral;
4
4
  const Schema_1 = require("../../Schema");
5
5
  const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
6
6
  const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
@@ -26,4 +26,3 @@ function booleanLiteral(literal) {
26
26
  });
27
27
  return schemaCreator();
28
28
  }
29
- exports.booleanLiteral = booleanLiteral;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stringLiteral = void 0;
3
+ exports.stringLiteral = stringLiteral;
4
4
  const Schema_1 = require("../../Schema");
5
5
  const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
6
6
  const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
@@ -26,4 +26,3 @@ function stringLiteral(literal) {
26
26
  });
27
27
  return schemaCreator();
28
28
  }
29
- exports.stringLiteral = stringLiteral;
@@ -1,3 +1,3 @@
1
- import { BaseObjectSchema, inferObjectSchemaFromPropertySchemas, ObjectUtils, PropertySchemas } from "./types";
1
+ import { BaseObjectSchema, ObjectUtils, PropertySchemas, inferObjectSchemaFromPropertySchemas } from "./types";
2
2
  export declare function object<ParsedKeys extends string, T extends PropertySchemas<ParsedKeys>>(schemas: T): inferObjectSchemaFromPropertySchemas<T>;
3
3
  export declare function getObjectUtils<Raw, Parsed>(schema: BaseObjectSchema<Raw, Parsed>): ObjectUtils<Raw, Parsed>;