@letta-ai/letta-client 0.1.37 → 0.1.39

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 (295) hide show
  1. package/api/resources/agents/client/Client.d.ts +6 -3
  2. package/api/resources/agents/client/Client.js +29 -19
  3. package/api/resources/agents/client/requests/AgentsListRequest.d.ts +2 -2
  4. package/api/resources/agents/client/requests/CreateAgentRequest.d.ts +2 -2
  5. package/api/resources/agents/client/requests/UpdateAgent.d.ts +2 -2
  6. package/api/resources/agents/resources/blocks/client/Client.d.ts +97 -0
  7. package/api/resources/agents/resources/blocks/client/Client.js +400 -0
  8. package/api/resources/agents/resources/blocks/client/index.d.ts +1 -0
  9. package/api/resources/agents/resources/context/client/Client.js +1 -1
  10. package/api/resources/agents/resources/coreMemory/client/Client.d.ts +0 -65
  11. package/api/resources/agents/resources/coreMemory/client/Client.js +1 -332
  12. package/api/resources/agents/resources/index.d.ts +3 -2
  13. package/api/resources/agents/resources/index.js +4 -3
  14. package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  15. package/api/resources/agents/resources/messages/client/Client.js +5 -5
  16. package/api/resources/agents/resources/{archivalMemory → passages}/client/Client.d.ts +14 -14
  17. package/{dist/api/resources/agents/resources/archivalMemory → api/resources/agents/resources/passages}/client/Client.js +15 -15
  18. package/api/resources/agents/resources/{archivalMemory/client/requests/ArchivalMemoryListRequest.d.ts → passages/client/requests/PassagesListRequest.d.ts} +1 -1
  19. package/api/resources/agents/resources/passages/client/requests/index.d.ts +2 -0
  20. package/api/resources/agents/resources/sources/client/Client.js +3 -3
  21. package/api/resources/agents/resources/templates/client/Client.js +3 -3
  22. package/api/resources/agents/resources/tools/client/Client.js +3 -3
  23. package/api/resources/agents/types/AgentsSearchResponseAgentsItem.d.ts +1 -1
  24. package/api/resources/agents/types/AgentsSearchResponseAgentsItemIdentityIds.d.ts +4 -0
  25. package/api/resources/agents/types/index.d.ts +1 -2
  26. package/api/resources/agents/types/index.js +1 -2
  27. package/api/resources/blocks/client/Client.js +6 -6
  28. package/api/resources/health/client/Client.js +1 -1
  29. package/api/resources/identities/client/Client.d.ts +18 -18
  30. package/api/resources/identities/client/Client.js +36 -33
  31. package/api/resources/identities/client/requests/{UpsertIdentityRequest.d.ts → IdentitiesCreateRequest.d.ts} +1 -1
  32. package/{dist/api/resources/identities/client/requests/ListIdentitiesRequest.d.ts → api/resources/identities/client/requests/IdentitiesListRequest.d.ts} +2 -1
  33. package/{dist/api/resources/identities/client/requests/CreateIdentityRequest.d.ts → api/resources/identities/client/requests/IdentitiesUpsertRequest.d.ts} +1 -1
  34. package/api/resources/identities/client/requests/IdentityUpdate.d.ts +4 -0
  35. package/api/resources/identities/client/requests/index.d.ts +3 -3
  36. package/api/resources/jobs/client/Client.js +4 -4
  37. package/api/resources/models/client/Client.js +2 -2
  38. package/api/resources/providers/client/Client.js +4 -4
  39. package/api/resources/runs/client/Client.js +6 -6
  40. package/api/resources/sources/client/Client.js +6 -6
  41. package/api/resources/sources/resources/files/client/Client.js +3 -3
  42. package/api/resources/sources/resources/passages/client/Client.js +1 -1
  43. package/api/resources/steps/client/Client.js +2 -2
  44. package/api/resources/tag/client/Client.js +1 -1
  45. package/api/resources/templates/client/Client.js +1 -1
  46. package/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItem.d.ts +1 -1
  47. package/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentityIds.d.ts +4 -0
  48. package/api/resources/templates/types/index.d.ts +1 -2
  49. package/api/resources/templates/types/index.js +1 -2
  50. package/api/resources/tools/client/Client.js +11 -11
  51. package/api/types/AgentState.d.ts +2 -2
  52. package/api/types/Identity.d.ts +4 -2
  53. package/api/types/IdentityCreate.d.ts +2 -0
  54. package/api/types/IdentityProperty.d.ts +15 -0
  55. package/api/types/IdentityPropertyType.d.ts +13 -0
  56. package/api/types/IdentityPropertyType.js +12 -0
  57. package/api/types/IdentityPropertyValue.d.ts +7 -0
  58. package/api/types/index.d.ts +3 -0
  59. package/api/types/index.js +3 -0
  60. package/dist/api/resources/agents/client/Client.d.ts +6 -3
  61. package/dist/api/resources/agents/client/Client.js +29 -19
  62. package/dist/api/resources/agents/client/requests/AgentsListRequest.d.ts +2 -2
  63. package/dist/api/resources/agents/client/requests/CreateAgentRequest.d.ts +2 -2
  64. package/dist/api/resources/agents/client/requests/UpdateAgent.d.ts +2 -2
  65. package/dist/api/resources/agents/resources/blocks/client/Client.d.ts +97 -0
  66. package/dist/api/resources/agents/resources/blocks/client/Client.js +400 -0
  67. package/dist/api/resources/agents/resources/blocks/client/index.d.ts +1 -0
  68. package/dist/api/resources/agents/resources/blocks/client/index.js +2 -0
  69. package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
  70. package/dist/api/resources/agents/resources/coreMemory/client/Client.d.ts +0 -65
  71. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -332
  72. package/dist/api/resources/agents/resources/index.d.ts +3 -2
  73. package/dist/api/resources/agents/resources/index.js +4 -3
  74. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  75. package/dist/api/resources/agents/resources/messages/client/Client.js +5 -5
  76. package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/Client.d.ts +14 -14
  77. package/{api/resources/agents/resources/archivalMemory → dist/api/resources/agents/resources/passages}/client/Client.js +15 -15
  78. package/dist/api/resources/agents/resources/{archivalMemory/client/requests/ArchivalMemoryListRequest.d.ts → passages/client/requests/PassagesListRequest.d.ts} +1 -1
  79. package/dist/api/resources/agents/resources/passages/client/requests/index.d.ts +2 -0
  80. package/dist/api/resources/agents/resources/passages/client/requests/index.js +2 -0
  81. package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
  82. package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
  83. package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
  84. package/dist/api/resources/agents/types/AgentsSearchResponseAgentsItem.d.ts +1 -1
  85. package/dist/api/resources/agents/types/AgentsSearchResponseAgentsItemIdentityIds.d.ts +4 -0
  86. package/dist/api/resources/agents/types/index.d.ts +1 -2
  87. package/dist/api/resources/agents/types/index.js +1 -2
  88. package/dist/api/resources/blocks/client/Client.js +6 -6
  89. package/dist/api/resources/health/client/Client.js +1 -1
  90. package/dist/api/resources/identities/client/Client.d.ts +18 -18
  91. package/dist/api/resources/identities/client/Client.js +36 -33
  92. package/dist/api/resources/identities/client/requests/{UpsertIdentityRequest.d.ts → IdentitiesCreateRequest.d.ts} +1 -1
  93. package/{api/resources/identities/client/requests/ListIdentitiesRequest.d.ts → dist/api/resources/identities/client/requests/IdentitiesListRequest.d.ts} +2 -1
  94. package/{api/resources/identities/client/requests/CreateIdentityRequest.d.ts → dist/api/resources/identities/client/requests/IdentitiesUpsertRequest.d.ts} +1 -1
  95. package/dist/api/resources/identities/client/requests/IdentityUpdate.d.ts +4 -0
  96. package/dist/api/resources/identities/client/requests/index.d.ts +3 -3
  97. package/dist/api/resources/jobs/client/Client.js +4 -4
  98. package/dist/api/resources/models/client/Client.js +2 -2
  99. package/dist/api/resources/providers/client/Client.js +4 -4
  100. package/dist/api/resources/runs/client/Client.js +6 -6
  101. package/dist/api/resources/sources/client/Client.js +6 -6
  102. package/dist/api/resources/sources/resources/files/client/Client.js +3 -3
  103. package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
  104. package/dist/api/resources/steps/client/Client.js +2 -2
  105. package/dist/api/resources/tag/client/Client.js +1 -1
  106. package/dist/api/resources/templates/client/Client.js +1 -1
  107. package/dist/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItem.d.ts +1 -1
  108. package/dist/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentityIds.d.ts +4 -0
  109. package/dist/api/resources/templates/types/index.d.ts +1 -2
  110. package/dist/api/resources/templates/types/index.js +1 -2
  111. package/dist/api/resources/tools/client/Client.js +11 -11
  112. package/dist/api/types/AgentState.d.ts +2 -2
  113. package/dist/api/types/Identity.d.ts +4 -2
  114. package/dist/api/types/IdentityCreate.d.ts +2 -0
  115. package/dist/api/types/IdentityProperty.d.ts +15 -0
  116. package/dist/api/types/IdentityPropertyType.d.ts +13 -0
  117. package/dist/api/types/IdentityPropertyType.js +12 -0
  118. package/dist/api/types/IdentityPropertyValue.d.ts +7 -0
  119. package/dist/api/types/index.d.ts +3 -0
  120. package/dist/api/types/index.js +3 -0
  121. package/dist/serialization/resources/agents/client/requests/CreateAgentRequest.d.ts +1 -1
  122. package/dist/serialization/resources/agents/client/requests/CreateAgentRequest.js +1 -1
  123. package/dist/serialization/resources/agents/client/requests/UpdateAgent.d.ts +1 -1
  124. package/dist/serialization/resources/agents/client/requests/UpdateAgent.js +1 -1
  125. package/dist/serialization/resources/agents/resources/blocks/client/index.d.ts +1 -0
  126. package/dist/serialization/resources/agents/resources/{coreMemory → blocks}/client/index.js +2 -2
  127. package/dist/serialization/resources/agents/resources/{coreMemory/client/listBlocks.d.ts → blocks/client/list.d.ts} +1 -1
  128. package/dist/serialization/resources/agents/resources/index.d.ts +3 -3
  129. package/dist/serialization/resources/agents/resources/index.js +4 -4
  130. package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/create.d.ts +1 -1
  131. package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/list.d.ts +1 -1
  132. package/dist/serialization/resources/agents/types/AgentsSearchResponseAgentsItem.d.ts +2 -2
  133. package/dist/serialization/resources/agents/types/AgentsSearchResponseAgentsItem.js +2 -2
  134. package/dist/serialization/resources/agents/types/AgentsSearchResponseAgentsItemIdentityIds.d.ts +10 -0
  135. package/dist/serialization/resources/agents/types/{AgentsSearchResponseAgentsItemIdentifierKeyItem.js → AgentsSearchResponseAgentsItemIdentityIds.js} +5 -2
  136. package/dist/serialization/resources/agents/types/index.d.ts +1 -2
  137. package/dist/serialization/resources/agents/types/index.js +1 -2
  138. package/dist/serialization/resources/identities/client/index.d.ts +1 -1
  139. package/dist/serialization/resources/identities/client/index.js +2 -2
  140. package/dist/serialization/resources/identities/client/{listIdentities.d.ts → list.d.ts} +1 -1
  141. package/dist/serialization/resources/identities/client/requests/IdentityUpdate.d.ts +3 -0
  142. package/dist/serialization/resources/identities/client/requests/IdentityUpdate.js +3 -0
  143. package/dist/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItem.d.ts +2 -2
  144. package/dist/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItem.js +2 -2
  145. package/dist/serialization/resources/templates/types/{TemplatesCreateAgentsResponseAgentsItemIdentifierKeyItem.d.ts → TemplatesCreateAgentsResponseAgentsItemIdentityIds.d.ts} +3 -3
  146. package/dist/serialization/resources/templates/types/{TemplatesCreateAgentsResponseAgentsItemIdentifierKeyItem.js → TemplatesCreateAgentsResponseAgentsItemIdentityIds.js} +5 -2
  147. package/dist/serialization/resources/templates/types/index.d.ts +1 -2
  148. package/dist/serialization/resources/templates/types/index.js +1 -2
  149. package/dist/serialization/types/AgentState.d.ts +1 -1
  150. package/dist/serialization/types/AgentState.js +1 -1
  151. package/dist/serialization/types/Identity.d.ts +3 -2
  152. package/dist/serialization/types/Identity.js +3 -2
  153. package/dist/serialization/types/IdentityCreate.d.ts +2 -0
  154. package/dist/serialization/types/IdentityCreate.js +2 -0
  155. package/dist/serialization/types/IdentityProperty.d.ts +16 -0
  156. package/dist/serialization/types/IdentityProperty.js +47 -0
  157. package/dist/serialization/types/IdentityPropertyType.d.ts +10 -0
  158. package/dist/serialization/types/IdentityPropertyType.js +41 -0
  159. package/dist/serialization/types/IdentityPropertyValue.d.ts +10 -0
  160. package/dist/serialization/types/IdentityPropertyValue.js +47 -0
  161. package/dist/serialization/types/index.d.ts +3 -0
  162. package/dist/serialization/types/index.js +3 -0
  163. package/dist/version.d.ts +1 -1
  164. package/dist/version.js +1 -1
  165. package/package.json +1 -1
  166. package/reference.md +46 -44
  167. package/serialization/resources/agents/client/requests/CreateAgentRequest.d.ts +1 -1
  168. package/serialization/resources/agents/client/requests/CreateAgentRequest.js +1 -1
  169. package/serialization/resources/agents/client/requests/UpdateAgent.d.ts +1 -1
  170. package/serialization/resources/agents/client/requests/UpdateAgent.js +1 -1
  171. package/serialization/resources/agents/resources/blocks/client/index.d.ts +1 -0
  172. package/serialization/resources/agents/resources/{coreMemory → blocks}/client/index.js +2 -2
  173. package/serialization/resources/agents/resources/{coreMemory/client/listBlocks.d.ts → blocks/client/list.d.ts} +1 -1
  174. package/serialization/resources/agents/resources/blocks/index.d.ts +1 -0
  175. package/serialization/resources/agents/resources/blocks/index.js +17 -0
  176. package/serialization/resources/agents/resources/index.d.ts +3 -3
  177. package/serialization/resources/agents/resources/index.js +4 -4
  178. package/serialization/resources/agents/resources/{archivalMemory → passages}/client/create.d.ts +1 -1
  179. package/serialization/resources/agents/resources/{archivalMemory → passages}/client/list.d.ts +1 -1
  180. package/serialization/resources/agents/resources/passages/index.d.ts +1 -0
  181. package/serialization/resources/agents/resources/passages/index.js +17 -0
  182. package/serialization/resources/agents/types/AgentsSearchResponseAgentsItem.d.ts +2 -2
  183. package/serialization/resources/agents/types/AgentsSearchResponseAgentsItem.js +2 -2
  184. package/serialization/resources/agents/types/AgentsSearchResponseAgentsItemIdentityIds.d.ts +10 -0
  185. package/serialization/resources/agents/types/{AgentsSearchResponseAgentsItemIdentifierKeyItem.js → AgentsSearchResponseAgentsItemIdentityIds.js} +5 -2
  186. package/serialization/resources/agents/types/index.d.ts +1 -2
  187. package/serialization/resources/agents/types/index.js +1 -2
  188. package/serialization/resources/identities/client/index.d.ts +1 -1
  189. package/serialization/resources/identities/client/index.js +2 -2
  190. package/serialization/resources/identities/client/{listIdentities.d.ts → list.d.ts} +1 -1
  191. package/serialization/resources/identities/client/requests/IdentityUpdate.d.ts +3 -0
  192. package/serialization/resources/identities/client/requests/IdentityUpdate.js +3 -0
  193. package/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItem.d.ts +2 -2
  194. package/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItem.js +2 -2
  195. package/serialization/resources/templates/types/{TemplatesCreateAgentsResponseAgentsItemIdentifierKeyItem.d.ts → TemplatesCreateAgentsResponseAgentsItemIdentityIds.d.ts} +3 -3
  196. package/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentityIds.js +44 -0
  197. package/serialization/resources/templates/types/index.d.ts +1 -2
  198. package/serialization/resources/templates/types/index.js +1 -2
  199. package/serialization/types/AgentState.d.ts +1 -1
  200. package/serialization/types/AgentState.js +1 -1
  201. package/serialization/types/Identity.d.ts +3 -2
  202. package/serialization/types/Identity.js +3 -2
  203. package/serialization/types/IdentityCreate.d.ts +2 -0
  204. package/serialization/types/IdentityCreate.js +2 -0
  205. package/serialization/types/IdentityProperty.d.ts +16 -0
  206. package/serialization/types/IdentityProperty.js +47 -0
  207. package/serialization/types/IdentityPropertyType.d.ts +10 -0
  208. package/serialization/types/IdentityPropertyType.js +41 -0
  209. package/serialization/types/IdentityPropertyValue.d.ts +10 -0
  210. package/serialization/types/IdentityPropertyValue.js +47 -0
  211. package/serialization/types/index.d.ts +3 -0
  212. package/serialization/types/index.js +3 -0
  213. package/version.d.ts +1 -1
  214. package/version.js +1 -1
  215. package/api/resources/agents/resources/archivalMemory/client/requests/index.d.ts +0 -2
  216. package/api/resources/agents/types/AgentsSearchResponseAgentsItemIdentifierKey.d.ts +0 -5
  217. package/api/resources/agents/types/AgentsSearchResponseAgentsItemIdentifierKeyItem.d.ts +0 -4
  218. package/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentifierKey.d.ts +0 -5
  219. package/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentifierKeyItem.d.ts +0 -4
  220. package/dist/api/resources/agents/resources/archivalMemory/client/requests/index.d.ts +0 -2
  221. package/dist/api/resources/agents/types/AgentsSearchResponseAgentsItemIdentifierKey.d.ts +0 -5
  222. package/dist/api/resources/agents/types/AgentsSearchResponseAgentsItemIdentifierKeyItem.d.ts +0 -4
  223. package/dist/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentifierKey.d.ts +0 -5
  224. package/dist/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentifierKeyItem.d.ts +0 -4
  225. package/dist/serialization/resources/agents/resources/coreMemory/client/index.d.ts +0 -1
  226. package/dist/serialization/resources/agents/types/AgentsSearchResponseAgentsItemIdentifierKey.d.ts +0 -11
  227. package/dist/serialization/resources/agents/types/AgentsSearchResponseAgentsItemIdentifierKey.js +0 -47
  228. package/dist/serialization/resources/agents/types/AgentsSearchResponseAgentsItemIdentifierKeyItem.d.ts +0 -10
  229. package/dist/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentifierKey.d.ts +0 -11
  230. package/dist/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentifierKey.js +0 -47
  231. package/serialization/resources/agents/resources/coreMemory/client/index.d.ts +0 -1
  232. package/serialization/resources/agents/types/AgentsSearchResponseAgentsItemIdentifierKey.d.ts +0 -11
  233. package/serialization/resources/agents/types/AgentsSearchResponseAgentsItemIdentifierKey.js +0 -47
  234. package/serialization/resources/agents/types/AgentsSearchResponseAgentsItemIdentifierKeyItem.d.ts +0 -10
  235. package/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentifierKey.d.ts +0 -11
  236. package/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentifierKey.js +0 -47
  237. package/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentifierKeyItem.js +0 -41
  238. /package/api/resources/agents/resources/{archivalMemory/client/requests → blocks/client}/index.js +0 -0
  239. /package/api/resources/agents/resources/{archivalMemory → blocks}/index.d.ts +0 -0
  240. /package/api/resources/agents/resources/{archivalMemory → blocks}/index.js +0 -0
  241. /package/api/resources/agents/resources/{archivalMemory → passages}/client/index.d.ts +0 -0
  242. /package/api/resources/agents/resources/{archivalMemory → passages}/client/index.js +0 -0
  243. /package/api/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.d.ts +0 -0
  244. /package/api/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.js +0 -0
  245. /package/api/resources/agents/resources/{archivalMemory/client/requests/ArchivalMemoryListRequest.js → passages/client/requests/PassagesListRequest.js} +0 -0
  246. /package/{dist/api/resources/agents/resources/archivalMemory → api/resources/agents/resources/passages}/client/requests/index.js +0 -0
  247. /package/{dist/api/resources/agents/resources/archivalMemory → api/resources/agents/resources/passages}/index.d.ts +0 -0
  248. /package/{dist/api/resources/agents/resources/archivalMemory → api/resources/agents/resources/passages}/index.js +0 -0
  249. /package/api/resources/agents/types/{AgentsSearchResponseAgentsItemIdentifierKey.js → AgentsSearchResponseAgentsItemIdentityIds.js} +0 -0
  250. /package/api/resources/{agents/types/AgentsSearchResponseAgentsItemIdentifierKeyItem.js → identities/client/requests/IdentitiesCreateRequest.js} +0 -0
  251. /package/api/resources/identities/client/requests/{CreateIdentityRequest.js → IdentitiesListRequest.js} +0 -0
  252. /package/api/resources/identities/client/requests/{ListIdentitiesRequest.js → IdentitiesUpsertRequest.js} +0 -0
  253. /package/api/resources/{identities/client/requests/UpsertIdentityRequest.js → templates/types/TemplatesCreateAgentsResponseAgentsItemIdentityIds.js} +0 -0
  254. /package/api/{resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentifierKey.js → types/IdentityProperty.js} +0 -0
  255. /package/api/{resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentifierKeyItem.js → types/IdentityPropertyValue.js} +0 -0
  256. /package/dist/{serialization/resources/agents/resources/archivalMemory → api/resources/agents/resources/blocks}/index.d.ts +0 -0
  257. /package/dist/{serialization/resources/agents/resources/archivalMemory → api/resources/agents/resources/blocks}/index.js +0 -0
  258. /package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/index.d.ts +0 -0
  259. /package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/index.js +0 -0
  260. /package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.d.ts +0 -0
  261. /package/dist/api/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.js +0 -0
  262. /package/dist/api/resources/agents/resources/{archivalMemory/client/requests/ArchivalMemoryListRequest.js → passages/client/requests/PassagesListRequest.js} +0 -0
  263. /package/dist/{serialization/resources/agents/resources/coreMemory → api/resources/agents/resources/passages}/index.d.ts +0 -0
  264. /package/dist/{serialization/resources/agents/resources/coreMemory → api/resources/agents/resources/passages}/index.js +0 -0
  265. /package/dist/api/resources/agents/types/{AgentsSearchResponseAgentsItemIdentifierKey.js → AgentsSearchResponseAgentsItemIdentityIds.js} +0 -0
  266. /package/dist/api/resources/{agents/types/AgentsSearchResponseAgentsItemIdentifierKeyItem.js → identities/client/requests/IdentitiesCreateRequest.js} +0 -0
  267. /package/dist/api/resources/identities/client/requests/{CreateIdentityRequest.js → IdentitiesListRequest.js} +0 -0
  268. /package/dist/api/resources/identities/client/requests/{ListIdentitiesRequest.js → IdentitiesUpsertRequest.js} +0 -0
  269. /package/dist/api/resources/{identities/client/requests/UpsertIdentityRequest.js → templates/types/TemplatesCreateAgentsResponseAgentsItemIdentityIds.js} +0 -0
  270. /package/dist/api/{resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentifierKey.js → types/IdentityProperty.js} +0 -0
  271. /package/dist/api/{resources/templates/types/TemplatesCreateAgentsResponseAgentsItemIdentifierKeyItem.js → types/IdentityPropertyValue.js} +0 -0
  272. /package/dist/serialization/resources/agents/resources/{coreMemory/client/listBlocks.js → blocks/client/list.js} +0 -0
  273. /package/{serialization/resources/agents/resources/archivalMemory → dist/serialization/resources/agents/resources/blocks}/index.d.ts +0 -0
  274. /package/{serialization/resources/agents/resources/archivalMemory → dist/serialization/resources/agents/resources/blocks}/index.js +0 -0
  275. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/create.js +0 -0
  276. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/index.d.ts +0 -0
  277. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/index.js +0 -0
  278. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/list.js +0 -0
  279. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.d.ts +0 -0
  280. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.js +0 -0
  281. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/index.d.ts +0 -0
  282. /package/dist/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/index.js +0 -0
  283. /package/{serialization/resources/agents/resources/coreMemory → dist/serialization/resources/agents/resources/passages}/index.d.ts +0 -0
  284. /package/{serialization/resources/agents/resources/coreMemory → dist/serialization/resources/agents/resources/passages}/index.js +0 -0
  285. /package/dist/serialization/resources/identities/client/{listIdentities.js → list.js} +0 -0
  286. /package/serialization/resources/agents/resources/{coreMemory/client/listBlocks.js → blocks/client/list.js} +0 -0
  287. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/create.js +0 -0
  288. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/index.d.ts +0 -0
  289. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/index.js +0 -0
  290. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/list.js +0 -0
  291. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.d.ts +0 -0
  292. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/CreateArchivalMemory.js +0 -0
  293. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/index.d.ts +0 -0
  294. /package/serialization/resources/agents/resources/{archivalMemory → passages}/client/requests/index.js +0 -0
  295. /package/serialization/resources/identities/client/{listIdentities.js → list.js} +0 -0
@@ -0,0 +1,400 @@
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.Blocks = 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 Blocks {
59
+ constructor(_options = {}) {
60
+ this._options = _options;
61
+ }
62
+ /**
63
+ * Retrieve a memory block from an agent.
64
+ *
65
+ * @param {string} agentId
66
+ * @param {string} blockLabel
67
+ * @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
68
+ *
69
+ * @throws {@link Letta.UnprocessableEntityError}
70
+ *
71
+ * @example
72
+ * await client.agents.blocks.retrieve("agent_id", "block_label")
73
+ */
74
+ retrieve(agentId, blockLabel, requestOptions) {
75
+ return __awaiter(this, void 0, void 0, function* () {
76
+ var _a, _b, _c;
77
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
78
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core-memory/blocks/${encodeURIComponent(blockLabel)}`),
79
+ method: "GET",
80
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
81
+ contentType: "application/json",
82
+ requestType: "json",
83
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
84
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
85
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
86
+ });
87
+ if (_response.ok) {
88
+ return serializers.Block.parseOrThrow(_response.body, {
89
+ unrecognizedObjectKeys: "passthrough",
90
+ allowUnrecognizedUnionMembers: true,
91
+ allowUnrecognizedEnumValues: true,
92
+ skipValidation: true,
93
+ breadcrumbsPrefix: ["response"],
94
+ });
95
+ }
96
+ if (_response.error.reason === "status-code") {
97
+ switch (_response.error.statusCode) {
98
+ case 422:
99
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
100
+ unrecognizedObjectKeys: "passthrough",
101
+ allowUnrecognizedUnionMembers: true,
102
+ allowUnrecognizedEnumValues: true,
103
+ skipValidation: true,
104
+ breadcrumbsPrefix: ["response"],
105
+ }));
106
+ default:
107
+ throw new errors.LettaError({
108
+ statusCode: _response.error.statusCode,
109
+ body: _response.error.body,
110
+ });
111
+ }
112
+ }
113
+ switch (_response.error.reason) {
114
+ case "non-json":
115
+ throw new errors.LettaError({
116
+ statusCode: _response.error.statusCode,
117
+ body: _response.error.rawBody,
118
+ });
119
+ case "timeout":
120
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core-memory/blocks/{block_label}.");
121
+ case "unknown":
122
+ throw new errors.LettaError({
123
+ message: _response.error.errorMessage,
124
+ });
125
+ }
126
+ });
127
+ }
128
+ /**
129
+ * Updates a memory block of an agent.
130
+ *
131
+ * @param {string} agentId
132
+ * @param {string} blockLabel
133
+ * @param {Letta.BlockUpdate} request
134
+ * @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
135
+ *
136
+ * @throws {@link Letta.UnprocessableEntityError}
137
+ *
138
+ * @example
139
+ * await client.agents.blocks.modify("agent_id", "block_label", {})
140
+ */
141
+ modify(agentId, blockLabel, request, requestOptions) {
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ var _a, _b, _c;
144
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
145
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core-memory/blocks/${encodeURIComponent(blockLabel)}`),
146
+ method: "PATCH",
147
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "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),
148
+ contentType: "application/json",
149
+ requestType: "json",
150
+ body: serializers.BlockUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
151
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
152
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
153
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
154
+ });
155
+ if (_response.ok) {
156
+ return serializers.Block.parseOrThrow(_response.body, {
157
+ unrecognizedObjectKeys: "passthrough",
158
+ allowUnrecognizedUnionMembers: true,
159
+ allowUnrecognizedEnumValues: true,
160
+ skipValidation: true,
161
+ breadcrumbsPrefix: ["response"],
162
+ });
163
+ }
164
+ if (_response.error.reason === "status-code") {
165
+ switch (_response.error.statusCode) {
166
+ case 422:
167
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
168
+ unrecognizedObjectKeys: "passthrough",
169
+ allowUnrecognizedUnionMembers: true,
170
+ allowUnrecognizedEnumValues: true,
171
+ skipValidation: true,
172
+ breadcrumbsPrefix: ["response"],
173
+ }));
174
+ default:
175
+ throw new errors.LettaError({
176
+ statusCode: _response.error.statusCode,
177
+ body: _response.error.body,
178
+ });
179
+ }
180
+ }
181
+ switch (_response.error.reason) {
182
+ case "non-json":
183
+ throw new errors.LettaError({
184
+ statusCode: _response.error.statusCode,
185
+ body: _response.error.rawBody,
186
+ });
187
+ case "timeout":
188
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/core-memory/blocks/{block_label}.");
189
+ case "unknown":
190
+ throw new errors.LettaError({
191
+ message: _response.error.errorMessage,
192
+ });
193
+ }
194
+ });
195
+ }
196
+ /**
197
+ * Retrieve the memory blocks of a specific agent.
198
+ *
199
+ * @param {string} agentId
200
+ * @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
201
+ *
202
+ * @throws {@link Letta.UnprocessableEntityError}
203
+ *
204
+ * @example
205
+ * await client.agents.blocks.list("agent_id")
206
+ */
207
+ list(agentId, requestOptions) {
208
+ return __awaiter(this, void 0, void 0, function* () {
209
+ var _a, _b, _c;
210
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
211
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core-memory/blocks`),
212
+ method: "GET",
213
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "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),
214
+ contentType: "application/json",
215
+ requestType: "json",
216
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
217
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
218
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
219
+ });
220
+ if (_response.ok) {
221
+ return serializers.agents.blocks.list.Response.parseOrThrow(_response.body, {
222
+ unrecognizedObjectKeys: "passthrough",
223
+ allowUnrecognizedUnionMembers: true,
224
+ allowUnrecognizedEnumValues: true,
225
+ skipValidation: true,
226
+ breadcrumbsPrefix: ["response"],
227
+ });
228
+ }
229
+ if (_response.error.reason === "status-code") {
230
+ switch (_response.error.statusCode) {
231
+ case 422:
232
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
233
+ unrecognizedObjectKeys: "passthrough",
234
+ allowUnrecognizedUnionMembers: true,
235
+ allowUnrecognizedEnumValues: true,
236
+ skipValidation: true,
237
+ breadcrumbsPrefix: ["response"],
238
+ }));
239
+ default:
240
+ throw new errors.LettaError({
241
+ statusCode: _response.error.statusCode,
242
+ body: _response.error.body,
243
+ });
244
+ }
245
+ }
246
+ switch (_response.error.reason) {
247
+ case "non-json":
248
+ throw new errors.LettaError({
249
+ statusCode: _response.error.statusCode,
250
+ body: _response.error.rawBody,
251
+ });
252
+ case "timeout":
253
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core-memory/blocks.");
254
+ case "unknown":
255
+ throw new errors.LettaError({
256
+ message: _response.error.errorMessage,
257
+ });
258
+ }
259
+ });
260
+ }
261
+ /**
262
+ * Attach a block to an agent.
263
+ *
264
+ * @param {string} agentId
265
+ * @param {string} blockId
266
+ * @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
267
+ *
268
+ * @throws {@link Letta.UnprocessableEntityError}
269
+ *
270
+ * @example
271
+ * await client.agents.blocks.attach("agent_id", "block_id")
272
+ */
273
+ attach(agentId, blockId, requestOptions) {
274
+ return __awaiter(this, void 0, void 0, function* () {
275
+ var _a, _b, _c;
276
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
277
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core-memory/blocks/attach/${encodeURIComponent(blockId)}`),
278
+ method: "PATCH",
279
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "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),
280
+ contentType: "application/json",
281
+ requestType: "json",
282
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
283
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
284
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
285
+ });
286
+ if (_response.ok) {
287
+ return serializers.AgentState.parseOrThrow(_response.body, {
288
+ unrecognizedObjectKeys: "passthrough",
289
+ allowUnrecognizedUnionMembers: true,
290
+ allowUnrecognizedEnumValues: true,
291
+ skipValidation: true,
292
+ breadcrumbsPrefix: ["response"],
293
+ });
294
+ }
295
+ if (_response.error.reason === "status-code") {
296
+ switch (_response.error.statusCode) {
297
+ case 422:
298
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
299
+ unrecognizedObjectKeys: "passthrough",
300
+ allowUnrecognizedUnionMembers: true,
301
+ allowUnrecognizedEnumValues: true,
302
+ skipValidation: true,
303
+ breadcrumbsPrefix: ["response"],
304
+ }));
305
+ default:
306
+ throw new errors.LettaError({
307
+ statusCode: _response.error.statusCode,
308
+ body: _response.error.body,
309
+ });
310
+ }
311
+ }
312
+ switch (_response.error.reason) {
313
+ case "non-json":
314
+ throw new errors.LettaError({
315
+ statusCode: _response.error.statusCode,
316
+ body: _response.error.rawBody,
317
+ });
318
+ case "timeout":
319
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/core-memory/blocks/attach/{block_id}.");
320
+ case "unknown":
321
+ throw new errors.LettaError({
322
+ message: _response.error.errorMessage,
323
+ });
324
+ }
325
+ });
326
+ }
327
+ /**
328
+ * Detach a block from an agent.
329
+ *
330
+ * @param {string} agentId
331
+ * @param {string} blockId
332
+ * @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
333
+ *
334
+ * @throws {@link Letta.UnprocessableEntityError}
335
+ *
336
+ * @example
337
+ * await client.agents.blocks.detach("agent_id", "block_id")
338
+ */
339
+ detach(agentId, blockId, requestOptions) {
340
+ return __awaiter(this, void 0, void 0, function* () {
341
+ var _a, _b, _c;
342
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
343
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core-memory/blocks/detach/${encodeURIComponent(blockId)}`),
344
+ method: "PATCH",
345
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "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),
346
+ contentType: "application/json",
347
+ requestType: "json",
348
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
349
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
350
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
351
+ });
352
+ if (_response.ok) {
353
+ return serializers.AgentState.parseOrThrow(_response.body, {
354
+ unrecognizedObjectKeys: "passthrough",
355
+ allowUnrecognizedUnionMembers: true,
356
+ allowUnrecognizedEnumValues: true,
357
+ skipValidation: true,
358
+ breadcrumbsPrefix: ["response"],
359
+ });
360
+ }
361
+ if (_response.error.reason === "status-code") {
362
+ switch (_response.error.statusCode) {
363
+ case 422:
364
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
365
+ unrecognizedObjectKeys: "passthrough",
366
+ allowUnrecognizedUnionMembers: true,
367
+ allowUnrecognizedEnumValues: true,
368
+ skipValidation: true,
369
+ breadcrumbsPrefix: ["response"],
370
+ }));
371
+ default:
372
+ throw new errors.LettaError({
373
+ statusCode: _response.error.statusCode,
374
+ body: _response.error.body,
375
+ });
376
+ }
377
+ }
378
+ switch (_response.error.reason) {
379
+ case "non-json":
380
+ throw new errors.LettaError({
381
+ statusCode: _response.error.statusCode,
382
+ body: _response.error.rawBody,
383
+ });
384
+ case "timeout":
385
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/core-memory/blocks/detach/{block_id}.");
386
+ case "unknown":
387
+ throw new errors.LettaError({
388
+ message: _response.error.errorMessage,
389
+ });
390
+ }
391
+ });
392
+ }
393
+ _getCustomAuthorizationHeaders() {
394
+ return __awaiter(this, void 0, void 0, function* () {
395
+ const tokenValue = yield core.Supplier.get(this._options.token);
396
+ return { Authorization: `Bearer ${tokenValue}` };
397
+ });
398
+ }
399
+ }
400
+ exports.Blocks = Blocks;
@@ -76,7 +76,7 @@ class Context {
76
76
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
77
77
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/context`),
78
78
  method: "GET",
79
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.37", "User-Agent": "@letta-ai/letta-client/0.1.37", "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
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.39", "User-Agent": "@letta-ai/letta-client/0.1.39", "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),
80
80
  contentType: "application/json",
81
81
  requestType: "json",
82
82
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -39,71 +39,6 @@ export declare class CoreMemory {
39
39
  * await client.agents.coreMemory.retrieve("agent_id")
40
40
  */
41
41
  retrieve(agentId: string, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.Memory>;
42
- /**
43
- * Retrieve a memory block from an agent.
44
- *
45
- * @param {string} agentId
46
- * @param {string} blockLabel
47
- * @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
48
- *
49
- * @throws {@link Letta.UnprocessableEntityError}
50
- *
51
- * @example
52
- * await client.agents.coreMemory.retrieveBlock("agent_id", "block_label")
53
- */
54
- retrieveBlock(agentId: string, blockLabel: string, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.Block>;
55
- /**
56
- * Updates a memory block of an agent.
57
- *
58
- * @param {string} agentId
59
- * @param {string} blockLabel
60
- * @param {Letta.BlockUpdate} request
61
- * @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
62
- *
63
- * @throws {@link Letta.UnprocessableEntityError}
64
- *
65
- * @example
66
- * await client.agents.coreMemory.modifyBlock("agent_id", "block_label", {})
67
- */
68
- modifyBlock(agentId: string, blockLabel: string, request: Letta.BlockUpdate, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.Block>;
69
- /**
70
- * Retrieve the memory blocks of a specific agent.
71
- *
72
- * @param {string} agentId
73
- * @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
74
- *
75
- * @throws {@link Letta.UnprocessableEntityError}
76
- *
77
- * @example
78
- * await client.agents.coreMemory.listBlocks("agent_id")
79
- */
80
- listBlocks(agentId: string, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.Block[]>;
81
- /**
82
- * Attach a block to an agent.
83
- *
84
- * @param {string} agentId
85
- * @param {string} blockId
86
- * @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
87
- *
88
- * @throws {@link Letta.UnprocessableEntityError}
89
- *
90
- * @example
91
- * await client.agents.coreMemory.attachBlock("agent_id", "block_id")
92
- */
93
- attachBlock(agentId: string, blockId: string, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.AgentState>;
94
- /**
95
- * Detach a block from an agent.
96
- *
97
- * @param {string} agentId
98
- * @param {string} blockId
99
- * @param {CoreMemory.RequestOptions} requestOptions - Request-specific configuration.
100
- *
101
- * @throws {@link Letta.UnprocessableEntityError}
102
- *
103
- * @example
104
- * await client.agents.coreMemory.detachBlock("agent_id", "block_id")
105
- */
106
- detachBlock(agentId: string, blockId: string, requestOptions?: CoreMemory.RequestOptions): Promise<Letta.AgentState>;
107
42
  protected _getCustomAuthorizationHeaders(): Promise<{
108
43
  Authorization: string;
109
44
  }>;