@letta-ai/letta-client 1.0.0-alpha.20 → 1.0.0-alpha.22

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 (75) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/agents/agents.d.mts +42 -11
  10. package/resources/agents/agents.d.mts.map +1 -1
  11. package/resources/agents/agents.d.ts +42 -11
  12. package/resources/agents/agents.d.ts.map +1 -1
  13. package/resources/agents/agents.js.map +1 -1
  14. package/resources/agents/agents.mjs.map +1 -1
  15. package/resources/agents/folders.d.mts +2 -2
  16. package/resources/agents/folders.d.mts.map +1 -1
  17. package/resources/agents/folders.d.ts +2 -2
  18. package/resources/agents/folders.d.ts.map +1 -1
  19. package/resources/agents/index.d.mts +1 -1
  20. package/resources/agents/index.d.mts.map +1 -1
  21. package/resources/agents/index.d.ts +1 -1
  22. package/resources/agents/index.d.ts.map +1 -1
  23. package/resources/agents/index.js.map +1 -1
  24. package/resources/agents/index.mjs.map +1 -1
  25. package/resources/agents/messages.d.mts +6 -81
  26. package/resources/agents/messages.d.mts.map +1 -1
  27. package/resources/agents/messages.d.ts +6 -81
  28. package/resources/agents/messages.d.ts.map +1 -1
  29. package/resources/agents/messages.js +9 -16
  30. package/resources/agents/messages.js.map +1 -1
  31. package/resources/agents/messages.mjs +9 -16
  32. package/resources/agents/messages.mjs.map +1 -1
  33. package/resources/archives/passages.d.mts +2 -1
  34. package/resources/archives/passages.d.mts.map +1 -1
  35. package/resources/archives/passages.d.ts +2 -1
  36. package/resources/archives/passages.d.ts.map +1 -1
  37. package/resources/folders/files.d.mts +4 -2
  38. package/resources/folders/files.d.mts.map +1 -1
  39. package/resources/folders/files.d.ts +4 -2
  40. package/resources/folders/files.d.ts.map +1 -1
  41. package/resources/index.d.mts +1 -1
  42. package/resources/index.d.mts.map +1 -1
  43. package/resources/index.d.ts +1 -1
  44. package/resources/index.d.ts.map +1 -1
  45. package/resources/index.js.map +1 -1
  46. package/resources/index.mjs.map +1 -1
  47. package/resources/mcp-servers/index.d.mts +1 -1
  48. package/resources/mcp-servers/index.d.mts.map +1 -1
  49. package/resources/mcp-servers/index.d.ts +1 -1
  50. package/resources/mcp-servers/index.d.ts.map +1 -1
  51. package/resources/mcp-servers/index.js.map +1 -1
  52. package/resources/mcp-servers/index.mjs.map +1 -1
  53. package/resources/mcp-servers/mcp-servers.d.mts +40 -208
  54. package/resources/mcp-servers/mcp-servers.d.mts.map +1 -1
  55. package/resources/mcp-servers/mcp-servers.d.ts +40 -208
  56. package/resources/mcp-servers/mcp-servers.d.ts.map +1 -1
  57. package/resources/mcp-servers/mcp-servers.js +0 -7
  58. package/resources/mcp-servers/mcp-servers.js.map +1 -1
  59. package/resources/mcp-servers/mcp-servers.mjs +0 -7
  60. package/resources/mcp-servers/mcp-servers.mjs.map +1 -1
  61. package/src/client.ts +0 -2
  62. package/src/resources/agents/agents.ts +46 -13
  63. package/src/resources/agents/folders.ts +2 -2
  64. package/src/resources/agents/index.ts +0 -2
  65. package/src/resources/agents/messages.ts +11 -125
  66. package/src/resources/archives/passages.ts +2 -1
  67. package/src/resources/folders/files.ts +4 -2
  68. package/src/resources/index.ts +0 -1
  69. package/src/resources/mcp-servers/index.ts +0 -1
  70. package/src/resources/mcp-servers/mcp-servers.ts +39 -242
  71. package/src/version.ts +1 -1
  72. package/version.d.mts +1 -1
  73. package/version.d.ts +1 -1
  74. package/version.js +1 -1
  75. package/version.mjs +1 -1
@@ -84,8 +84,6 @@ import {
84
84
  MessageRole,
85
85
  MessageStreamParams,
86
86
  MessageType,
87
- MessageUpdateParams,
88
- MessageUpdateResponse,
89
87
  Messages,
90
88
  MessagesArrayPage,
91
89
  OmittedReasoningContent,
@@ -314,7 +312,8 @@ export interface AgentState {
314
312
  name: string;
315
313
 
316
314
  /**
317
- * The sources used by the agent.
315
+ * @deprecated Deprecated: Use `folders` field instead. The sources used by the
316
+ * agent.
318
317
  */
319
318
  sources: Array<AgentState.Source>;
320
319
 
@@ -561,7 +560,8 @@ export namespace AgentState {
561
560
  is_open: boolean;
562
561
 
563
562
  /**
564
- * Unique identifier of the source.
563
+ * @deprecated Deprecated: Use `folder_id` field instead. Unique identifier of the
564
+ * source.
565
565
  */
566
566
  source_id: string;
567
567
 
@@ -745,6 +745,11 @@ export interface AnthropicModelSettings {
745
745
  */
746
746
  max_output_tokens?: number;
747
747
 
748
+ /**
749
+ * The structured output format for the model.
750
+ */
751
+ output_format?: TextResponseFormat | JsonSchemaResponseFormat | JsonObjectResponseFormat | null;
752
+
748
753
  /**
749
754
  * Whether to enable parallel tool calling.
750
755
  */
@@ -1498,6 +1503,11 @@ export interface AgentCreateParams {
1498
1503
  */
1499
1504
  enable_sleeptime?: boolean | null;
1500
1505
 
1506
+ /**
1507
+ * The ids of the folders used by the agent.
1508
+ */
1509
+ folder_ids?: Array<string> | null;
1510
+
1501
1511
  /**
1502
1512
  * @deprecated Deprecated: please use the 'create agents from a template' endpoint
1503
1513
  * instead.
@@ -1662,7 +1672,8 @@ export interface AgentCreateParams {
1662
1672
  secrets?: { [key: string]: string } | null;
1663
1673
 
1664
1674
  /**
1665
- * The ids of the sources used by the agent.
1675
+ * @deprecated Deprecated: Use `folder_ids` field instead. The ids of the sources
1676
+ * used by the agent.
1666
1677
  */
1667
1678
  source_ids?: Array<string> | null;
1668
1679
 
@@ -1784,6 +1795,11 @@ export interface AgentUpdateParams {
1784
1795
  */
1785
1796
  enable_sleeptime?: boolean | null;
1786
1797
 
1798
+ /**
1799
+ * The ids of the folders used by the agent.
1800
+ */
1801
+ folder_ids?: Array<string> | null;
1802
+
1787
1803
  /**
1788
1804
  * If set to True, the agent will be hidden.
1789
1805
  */
@@ -1909,7 +1925,8 @@ export interface AgentUpdateParams {
1909
1925
  secrets?: { [key: string]: string } | null;
1910
1926
 
1911
1927
  /**
1912
- * The ids of the sources used by the agent.
1928
+ * @deprecated Deprecated: Use `folder_ids` field instead. The ids of the sources
1929
+ * used by the agent.
1913
1930
  */
1914
1931
  source_ids?: Array<string> | null;
1915
1932
 
@@ -2073,13 +2090,24 @@ export interface AgentImportFileParams {
2073
2090
  append_copy_suffix?: boolean;
2074
2091
 
2075
2092
  /**
2076
- * Body param: Environment variables as a JSON string to pass to the agent for tool
2077
- * execution.
2093
+ * Body param: Embedding handle to override with.
2094
+ */
2095
+ embedding?: string | null;
2096
+
2097
+ /**
2098
+ * @deprecated Body param: Environment variables as a JSON string to pass to the
2099
+ * agent for tool execution. Use 'secrets' instead.
2078
2100
  */
2079
2101
  env_vars_json?: string | null;
2080
2102
 
2081
2103
  /**
2082
- * Body param: Override import with specific embedding handle.
2104
+ * Body param: If provided, overrides the agent name with this value.
2105
+ */
2106
+ name?: string | null;
2107
+
2108
+ /**
2109
+ * @deprecated Body param: Override import with specific embedding handle. Use
2110
+ * 'embedding' instead.
2083
2111
  */
2084
2112
  override_embedding_handle?: string | null;
2085
2113
 
@@ -2091,15 +2119,22 @@ export interface AgentImportFileParams {
2091
2119
  override_existing_tools?: boolean;
2092
2120
 
2093
2121
  /**
2094
- * Body param: If provided, overrides the agent name with this value.
2122
+ * @deprecated Body param: If provided, overrides the agent name with this value.
2123
+ * Use 'name' instead.
2095
2124
  */
2096
2125
  override_name?: string | null;
2097
2126
 
2098
2127
  /**
2099
- * Body param: The project ID to associate the uploaded agent with.
2128
+ * @deprecated Body param: The project ID to associate the uploaded agent with.
2129
+ * This is now passed via headers.
2100
2130
  */
2101
2131
  project_id?: string | null;
2102
2132
 
2133
+ /**
2134
+ * Body param: Secrets as a JSON string to pass to the agent for tool execution.
2135
+ */
2136
+ secrets?: string | null;
2137
+
2103
2138
  /**
2104
2139
  * Body param: If set to True, strips all messages from the agent before importing.
2105
2140
  */
@@ -2202,13 +2237,11 @@ export declare namespace Agents {
2202
2237
  type UpdateSystemMessage as UpdateSystemMessage,
2203
2238
  type UpdateUserMessage as UpdateUserMessage,
2204
2239
  type UserMessage as UserMessage,
2205
- type MessageUpdateResponse as MessageUpdateResponse,
2206
2240
  type MessageCancelResponse as MessageCancelResponse,
2207
2241
  type MessagesArrayPage as MessagesArrayPage,
2208
2242
  type MessageCreateParams as MessageCreateParams,
2209
2243
  type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming,
2210
2244
  type MessageCreateParamsStreaming as MessageCreateParamsStreaming,
2211
- type MessageUpdateParams as MessageUpdateParams,
2212
2245
  type MessageListParams as MessageListParams,
2213
2246
  type MessageCancelParams as MessageCancelParams,
2214
2247
  type MessageCreateAsyncParams as MessageCreateAsyncParams,
@@ -31,7 +31,7 @@ export class Folders extends APIResource {
31
31
  folderID: string,
32
32
  params: FolderAttachParams,
33
33
  options?: RequestOptions,
34
- ): APIPromise<AgentsAPI.AgentState> {
34
+ ): APIPromise<AgentsAPI.AgentState | null> {
35
35
  const { agent_id } = params;
36
36
  return this._client.patch(path`/v1/agents/${agent_id}/folders/attach/${folderID}`, options);
37
37
  }
@@ -43,7 +43,7 @@ export class Folders extends APIResource {
43
43
  folderID: string,
44
44
  params: FolderDetachParams,
45
45
  options?: RequestOptions,
46
- ): APIPromise<AgentsAPI.AgentState> {
46
+ ): APIPromise<AgentsAPI.AgentState | null> {
47
47
  const { agent_id } = params;
48
48
  return this._client.patch(path`/v1/agents/${agent_id}/folders/detach/${folderID}`, options);
49
49
  }
@@ -125,12 +125,10 @@ export {
125
125
  type UpdateSystemMessage,
126
126
  type UpdateUserMessage,
127
127
  type UserMessage,
128
- type MessageUpdateResponse,
129
128
  type MessageCancelResponse,
130
129
  type MessageCreateParams,
131
130
  type MessageCreateParamsNonStreaming,
132
131
  type MessageCreateParamsStreaming,
133
- type MessageUpdateParams,
134
132
  type MessageListParams,
135
133
  type MessageCancelParams,
136
134
  type MessageCreateAsyncParams,
@@ -56,18 +56,6 @@ export class Messages extends APIResource {
56
56
  }) as APIPromise<LettaResponse> | APIPromise<Stream<LettaStreamingResponse>>;
57
57
  }
58
58
 
59
- /**
60
- * Update the details of a message associated with an agent.
61
- */
62
- update(
63
- messageID: string,
64
- params: MessageUpdateParams,
65
- options?: RequestOptions,
66
- ): APIPromise<MessageUpdateResponse> {
67
- const { agent_id, ...body } = params;
68
- return this._client.patch(path`/v1/agents/${agent_id}/messages/${messageID}`, { body, ...options });
69
- }
70
-
71
59
  /**
72
60
  * Retrieve message history for an agent.
73
61
  */
@@ -96,6 +84,16 @@ export class Messages extends APIResource {
96
84
  return this._client.post(path`/v1/agents/${agentID}/messages/cancel`, { body, ...options });
97
85
  }
98
86
 
87
+ /**
88
+ * Summarize an agent's conversation history.
89
+ */
90
+ compact(agentID: string, options?: RequestOptions): APIPromise<void> {
91
+ return this._client.post(path`/v1/agents/${agentID}/summarize`, {
92
+ ...options,
93
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
94
+ });
95
+ }
96
+
99
97
  /**
100
98
  * Asynchronously process a user message and return a run object. The actual
101
99
  * processing happens in the background, and the status can be checked using the
@@ -115,7 +113,7 @@ export class Messages extends APIResource {
115
113
  agentID: string,
116
114
  body: MessageResetParams,
117
115
  options?: RequestOptions,
118
- ): APIPromise<AgentsAPI.AgentState> {
116
+ ): APIPromise<AgentsAPI.AgentState | null> {
119
117
  return this._client.patch(path`/v1/agents/${agentID}/reset-messages`, { body, ...options });
120
118
  }
121
119
 
@@ -135,16 +133,6 @@ export class Messages extends APIResource {
135
133
  stream: true,
136
134
  }) as APIPromise<Stream<LettaStreamingResponse>>;
137
135
  }
138
-
139
- /**
140
- * Summarize an agent's conversation history.
141
- */
142
- summarize(agentID: string, options?: RequestOptions): APIPromise<void> {
143
- return this._client.post(path`/v1/agents/${agentID}/summarize`, {
144
- ...options,
145
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
146
- });
147
- }
148
136
  }
149
137
 
150
138
  export type MessagesArrayPage = ArrayPage<Message>;
@@ -1709,27 +1697,6 @@ export interface UserMessage {
1709
1697
  step_id?: string | null;
1710
1698
  }
1711
1699
 
1712
- /**
1713
- * A message generated by the system. Never streamed back on a response, only used
1714
- * for cursor pagination.
1715
- *
1716
- * Args: id (str): The ID of the message date (datetime): The date the message was
1717
- * created in ISO format name (Optional[str]): The name of the sender of the
1718
- * message content (str): The message content sent by the system
1719
- */
1720
- export type MessageUpdateResponse =
1721
- | SystemMessage
1722
- | UserMessage
1723
- | ReasoningMessage
1724
- | HiddenReasoningMessage
1725
- | ToolCallMessage
1726
- | ToolsAPI.ToolReturnMessage
1727
- | AssistantMessage
1728
- | ApprovalRequestMessage
1729
- | ApprovalResponseMessage
1730
- | SummaryMessage
1731
- | EventMessage;
1732
-
1733
1700
  export type MessageCancelResponse = { [key: string]: unknown };
1734
1701
 
1735
1702
  export type MessageCreateParams = MessageCreateParamsNonStreaming | MessageCreateParamsStreaming;
@@ -1880,85 +1847,6 @@ export interface MessageCreateParamsStreaming extends MessageCreateParamsBase {
1880
1847
  streaming: true;
1881
1848
  }
1882
1849
 
1883
- export type MessageUpdateParams =
1884
- | MessageUpdateParams.UpdateSystemMessage
1885
- | MessageUpdateParams.UpdateUserMessage
1886
- | MessageUpdateParams.UpdateReasoningMessage
1887
- | MessageUpdateParams.UpdateAssistantMessage;
1888
-
1889
- export declare namespace MessageUpdateParams {
1890
- export interface UpdateSystemMessage {
1891
- /**
1892
- * Path param: The ID of the agent in the format 'agent-<uuid4>'
1893
- */
1894
- agent_id: string;
1895
-
1896
- /**
1897
- * Body param: The message content sent by the system (can be a string or an array
1898
- * of multi-modal content parts)
1899
- */
1900
- content: string;
1901
-
1902
- /**
1903
- * Body param:
1904
- */
1905
- message_type?: 'system_message';
1906
- }
1907
-
1908
- export interface UpdateUserMessage {
1909
- /**
1910
- * Path param: The ID of the agent in the format 'agent-<uuid4>'
1911
- */
1912
- agent_id: string;
1913
-
1914
- /**
1915
- * Body param: The message content sent by the user (can be a string or an array of
1916
- * multi-modal content parts)
1917
- */
1918
- content: Array<LettaUserMessageContentUnion> | string;
1919
-
1920
- /**
1921
- * Body param:
1922
- */
1923
- message_type?: 'user_message';
1924
- }
1925
-
1926
- export interface UpdateReasoningMessage {
1927
- /**
1928
- * Path param: The ID of the agent in the format 'agent-<uuid4>'
1929
- */
1930
- agent_id: string;
1931
-
1932
- /**
1933
- * Body param:
1934
- */
1935
- reasoning: string;
1936
-
1937
- /**
1938
- * Body param:
1939
- */
1940
- message_type?: 'reasoning_message';
1941
- }
1942
-
1943
- export interface UpdateAssistantMessage {
1944
- /**
1945
- * Path param: The ID of the agent in the format 'agent-<uuid4>'
1946
- */
1947
- agent_id: string;
1948
-
1949
- /**
1950
- * Body param: The message content sent by the assistant (can be a string or an
1951
- * array of content parts)
1952
- */
1953
- content: Array<LettaAssistantMessageContentUnion> | string;
1954
-
1955
- /**
1956
- * Body param:
1957
- */
1958
- message_type?: 'assistant_message';
1959
- }
1960
- }
1961
-
1962
1850
  export interface MessageListParams extends ArrayPageParams {
1963
1851
  /**
1964
1852
  * @deprecated The name of the message argument.
@@ -2277,13 +2165,11 @@ export declare namespace Messages {
2277
2165
  type UpdateSystemMessage as UpdateSystemMessage,
2278
2166
  type UpdateUserMessage as UpdateUserMessage,
2279
2167
  type UserMessage as UserMessage,
2280
- type MessageUpdateResponse as MessageUpdateResponse,
2281
2168
  type MessageCancelResponse as MessageCancelResponse,
2282
2169
  type MessagesArrayPage as MessagesArrayPage,
2283
2170
  type MessageCreateParams as MessageCreateParams,
2284
2171
  type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming,
2285
2172
  type MessageCreateParamsStreaming as MessageCreateParamsStreaming,
2286
- type MessageUpdateParams as MessageUpdateParams,
2287
2173
  type MessageListParams as MessageListParams,
2288
2174
  type MessageCancelParams as MessageCancelParams,
2289
2175
  type MessageCreateAsyncParams as MessageCreateAsyncParams,
@@ -101,7 +101,8 @@ export interface PassageCreateResponse {
101
101
  metadata?: { [key: string]: unknown } | null;
102
102
 
103
103
  /**
104
- * The data source of the passage.
104
+ * @deprecated Deprecated: Use `folder_id` field instead. The data source of the
105
+ * passage.
105
106
  */
106
107
  source_id?: string | null;
107
108
 
@@ -63,7 +63,8 @@ export interface FileListResponse {
63
63
  id: string;
64
64
 
65
65
  /**
66
- * The unique identifier of the source associated with the document.
66
+ * @deprecated Deprecated: Use `folder_id` field instead. The unique identifier of
67
+ * the source associated with the document.
67
68
  */
68
69
  source_id: string;
69
70
 
@@ -150,7 +151,8 @@ export interface FileUploadResponse {
150
151
  id: string;
151
152
 
152
153
  /**
153
- * The unique identifier of the source associated with the document.
154
+ * @deprecated Deprecated: Use `folder_id` field instead. The unique identifier of
155
+ * the source associated with the document.
154
156
  */
155
157
  source_id: string;
156
158
 
@@ -120,7 +120,6 @@ export {
120
120
  type McpServerRetrieveResponse,
121
121
  type McpServerUpdateResponse,
122
122
  type McpServerListResponse,
123
- type McpServerConnectResponse,
124
123
  type McpServerRefreshResponse,
125
124
  type McpServerCreateParams,
126
125
  type McpServerUpdateParams,
@@ -17,7 +17,6 @@ export {
17
17
  type McpServerRetrieveResponse,
18
18
  type McpServerUpdateResponse,
19
19
  type McpServerListResponse,
20
- type McpServerConnectResponse,
21
20
  type McpServerRefreshResponse,
22
21
  type McpServerCreateParams,
23
22
  type McpServerUpdateParams,