@letta-ai/letta-client 1.6.5 → 1.6.6

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 (119) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/package.json +1 -1
  3. package/resources/agents/agents.d.mts +21 -4
  4. package/resources/agents/agents.d.mts.map +1 -1
  5. package/resources/agents/agents.d.ts +21 -4
  6. package/resources/agents/agents.d.ts.map +1 -1
  7. package/resources/agents/agents.js +4 -0
  8. package/resources/agents/agents.js.map +1 -1
  9. package/resources/agents/agents.mjs +4 -0
  10. package/resources/agents/agents.mjs.map +1 -1
  11. package/resources/agents/blocks.d.mts +12 -0
  12. package/resources/agents/blocks.d.mts.map +1 -1
  13. package/resources/agents/blocks.d.ts +12 -0
  14. package/resources/agents/blocks.d.ts.map +1 -1
  15. package/resources/agents/index.d.mts +1 -0
  16. package/resources/agents/index.d.mts.map +1 -1
  17. package/resources/agents/index.d.ts +1 -0
  18. package/resources/agents/index.d.ts.map +1 -1
  19. package/resources/agents/index.js +3 -1
  20. package/resources/agents/index.js.map +1 -1
  21. package/resources/agents/index.mjs +1 -0
  22. package/resources/agents/index.mjs.map +1 -1
  23. package/resources/agents/messages.d.mts +9 -5
  24. package/resources/agents/messages.d.mts.map +1 -1
  25. package/resources/agents/messages.d.ts +9 -5
  26. package/resources/agents/messages.d.ts.map +1 -1
  27. package/resources/agents/passages.d.mts +4 -0
  28. package/resources/agents/passages.d.mts.map +1 -1
  29. package/resources/agents/passages.d.ts +4 -0
  30. package/resources/agents/passages.d.ts.map +1 -1
  31. package/resources/agents/schedule.d.mts +197 -0
  32. package/resources/agents/schedule.d.mts.map +1 -0
  33. package/resources/agents/schedule.d.ts +197 -0
  34. package/resources/agents/schedule.d.ts.map +1 -0
  35. package/resources/agents/schedule.js +40 -0
  36. package/resources/agents/schedule.js.map +1 -0
  37. package/resources/agents/schedule.mjs +36 -0
  38. package/resources/agents/schedule.mjs.map +1 -0
  39. package/resources/blocks/agents.d.mts +1 -1
  40. package/resources/blocks/agents.d.mts.map +1 -1
  41. package/resources/blocks/agents.d.ts +1 -1
  42. package/resources/blocks/agents.d.ts.map +1 -1
  43. package/resources/blocks/blocks.d.mts +25 -0
  44. package/resources/blocks/blocks.d.mts.map +1 -1
  45. package/resources/blocks/blocks.d.ts +25 -0
  46. package/resources/blocks/blocks.d.ts.map +1 -1
  47. package/resources/blocks/blocks.js.map +1 -1
  48. package/resources/blocks/blocks.mjs.map +1 -1
  49. package/resources/conversations/conversations.d.mts +17 -0
  50. package/resources/conversations/conversations.d.mts.map +1 -1
  51. package/resources/conversations/conversations.d.ts +17 -0
  52. package/resources/conversations/conversations.d.ts.map +1 -1
  53. package/resources/conversations/conversations.js.map +1 -1
  54. package/resources/conversations/conversations.mjs.map +1 -1
  55. package/resources/folders/files.d.mts +1 -1
  56. package/resources/folders/files.d.ts +1 -1
  57. package/resources/groups/messages.d.mts +5 -5
  58. package/resources/groups/messages.d.ts +5 -5
  59. package/resources/identities/agents.d.mts +1 -1
  60. package/resources/identities/agents.d.mts.map +1 -1
  61. package/resources/identities/agents.d.ts +1 -1
  62. package/resources/identities/agents.d.ts.map +1 -1
  63. package/resources/mcp-servers/tools.d.mts +1 -1
  64. package/resources/mcp-servers/tools.d.ts +1 -1
  65. package/resources/messages.d.mts +12 -0
  66. package/resources/messages.d.mts.map +1 -1
  67. package/resources/messages.d.ts +12 -0
  68. package/resources/messages.d.ts.map +1 -1
  69. package/resources/runs/index.d.mts +1 -0
  70. package/resources/runs/index.d.mts.map +1 -1
  71. package/resources/runs/index.d.ts +1 -0
  72. package/resources/runs/index.d.ts.map +1 -1
  73. package/resources/runs/index.js +3 -1
  74. package/resources/runs/index.js.map +1 -1
  75. package/resources/runs/index.mjs +1 -0
  76. package/resources/runs/index.mjs.map +1 -1
  77. package/resources/runs/runs.d.mts +8 -0
  78. package/resources/runs/runs.d.mts.map +1 -1
  79. package/resources/runs/runs.d.ts +8 -0
  80. package/resources/runs/runs.d.ts.map +1 -1
  81. package/resources/runs/runs.js +4 -0
  82. package/resources/runs/runs.js.map +1 -1
  83. package/resources/runs/runs.mjs +4 -0
  84. package/resources/runs/runs.mjs.map +1 -1
  85. package/resources/runs/trace.d.mts +31 -0
  86. package/resources/runs/trace.d.mts.map +1 -0
  87. package/resources/runs/trace.d.ts +31 -0
  88. package/resources/runs/trace.d.ts.map +1 -0
  89. package/resources/runs/trace.js +25 -0
  90. package/resources/runs/trace.js.map +1 -0
  91. package/resources/runs/trace.mjs +21 -0
  92. package/resources/runs/trace.mjs.map +1 -0
  93. package/resources/tags.d.mts +1 -1
  94. package/resources/tags.d.ts +1 -1
  95. package/resources/tags.js +1 -1
  96. package/resources/tags.mjs +1 -1
  97. package/src/resources/agents/agents.ts +45 -2
  98. package/src/resources/agents/blocks.ts +15 -0
  99. package/src/resources/agents/index.ts +11 -0
  100. package/src/resources/agents/messages.ts +11 -6
  101. package/src/resources/agents/passages.ts +5 -0
  102. package/src/resources/agents/schedule.ts +361 -0
  103. package/src/resources/blocks/agents.ts +1 -0
  104. package/src/resources/blocks/blocks.ts +31 -0
  105. package/src/resources/conversations/conversations.ts +20 -0
  106. package/src/resources/folders/files.ts +1 -1
  107. package/src/resources/groups/messages.ts +5 -5
  108. package/src/resources/identities/agents.ts +1 -0
  109. package/src/resources/mcp-servers/tools.ts +1 -1
  110. package/src/resources/messages.ts +15 -0
  111. package/src/resources/runs/index.ts +1 -0
  112. package/src/resources/runs/runs.ts +15 -0
  113. package/src/resources/runs/trace.ts +44 -0
  114. package/src/resources/tags.ts +1 -1
  115. package/src/version.ts +1 -1
  116. package/version.d.mts +1 -1
  117. package/version.d.ts +1 -1
  118. package/version.js +1 -1
  119. package/version.mjs +1 -1
@@ -0,0 +1,361 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ import { path } from '../../internal/utils/path';
7
+
8
+ export class Schedule extends APIResource {
9
+ /**
10
+ * Schedule a message to be sent by the agent at a specified time or on a recurring
11
+ * basis.
12
+ */
13
+ create(
14
+ agentID: string,
15
+ body: ScheduleCreateParams,
16
+ options?: RequestOptions,
17
+ ): APIPromise<ScheduleCreateResponse> {
18
+ return this._client.post(path`/v1/agents/${agentID}/schedule`, { body, ...options });
19
+ }
20
+
21
+ /**
22
+ * Retrieve a scheduled message by its ID for a specific agent.
23
+ */
24
+ retrieve(
25
+ scheduledMessageID: string,
26
+ params: ScheduleRetrieveParams,
27
+ options?: RequestOptions,
28
+ ): APIPromise<ScheduleRetrieveResponse> {
29
+ const { agent_id } = params;
30
+ return this._client.get(path`/v1/agents/${agent_id}/schedule/${scheduledMessageID}`, options);
31
+ }
32
+
33
+ /**
34
+ * List all scheduled messages for a specific agent.
35
+ */
36
+ list(
37
+ agentID: string,
38
+ query: ScheduleListParams | null | undefined = {},
39
+ options?: RequestOptions,
40
+ ): APIPromise<ScheduleListResponse> {
41
+ return this._client.get(path`/v1/agents/${agentID}/schedule`, { query, ...options });
42
+ }
43
+
44
+ /**
45
+ * Delete a scheduled message by its ID for a specific agent.
46
+ */
47
+ delete(
48
+ scheduledMessageID: string,
49
+ params: ScheduleDeleteParams,
50
+ options?: RequestOptions,
51
+ ): APIPromise<ScheduleDeleteResponse> {
52
+ const { agent_id, ...body } = params;
53
+ return this._client.delete(path`/v1/agents/${agent_id}/schedule/${scheduledMessageID}`, {
54
+ body,
55
+ ...options,
56
+ });
57
+ }
58
+ }
59
+
60
+ export interface ScheduleCreateResponse {
61
+ id: string;
62
+
63
+ next_scheduled_at?: string;
64
+ }
65
+
66
+ export interface ScheduleRetrieveResponse {
67
+ id: string;
68
+
69
+ agent_id: string;
70
+
71
+ message: ScheduleRetrieveResponse.Message;
72
+
73
+ next_scheduled_time: string | null;
74
+
75
+ schedule: ScheduleRetrieveResponse.UnionMember0 | ScheduleRetrieveResponse.UnionMember1;
76
+ }
77
+
78
+ export namespace ScheduleRetrieveResponse {
79
+ export interface Message {
80
+ messages: Array<Message.Message>;
81
+
82
+ callback_url?: string;
83
+
84
+ include_return_message_types?: Array<
85
+ | 'system_message'
86
+ | 'user_message'
87
+ | 'assistant_message'
88
+ | 'reasoning_message'
89
+ | 'hidden_reasoning_message'
90
+ | 'tool_call_message'
91
+ | 'tool_return_message'
92
+ | 'approval_request_message'
93
+ | 'approval_response_message'
94
+ >;
95
+
96
+ max_steps?: number;
97
+ }
98
+
99
+ export namespace Message {
100
+ export interface Message {
101
+ content: Array<Message.UnionMember0 | Message.UnionMember1> | string;
102
+
103
+ role: 'user' | 'assistant' | 'system';
104
+
105
+ name?: string;
106
+
107
+ otid?: string;
108
+
109
+ sender_id?: string;
110
+
111
+ type?: 'message';
112
+ }
113
+
114
+ export namespace Message {
115
+ export interface UnionMember0 {
116
+ text: string;
117
+
118
+ signature?: string | null;
119
+
120
+ type?: 'text';
121
+ }
122
+
123
+ export interface UnionMember1 {
124
+ source: UnionMember1.Source;
125
+
126
+ type: 'image';
127
+ }
128
+
129
+ export namespace UnionMember1 {
130
+ export interface Source {
131
+ data: string;
132
+
133
+ media_type: string;
134
+
135
+ detail?: string;
136
+
137
+ type?: 'base64';
138
+ }
139
+ }
140
+ }
141
+ }
142
+
143
+ export interface UnionMember0 {
144
+ scheduled_at: number;
145
+
146
+ type?: 'one-time';
147
+ }
148
+
149
+ export interface UnionMember1 {
150
+ cron_expression: string;
151
+
152
+ type: 'recurring';
153
+ }
154
+ }
155
+
156
+ export interface ScheduleListResponse {
157
+ has_next_page: boolean;
158
+
159
+ scheduled_messages: Array<ScheduleListResponse.ScheduledMessage>;
160
+ }
161
+
162
+ export namespace ScheduleListResponse {
163
+ export interface ScheduledMessage {
164
+ id: string;
165
+
166
+ agent_id: string;
167
+
168
+ message: ScheduledMessage.Message;
169
+
170
+ next_scheduled_time: string | null;
171
+
172
+ schedule: ScheduledMessage.UnionMember0 | ScheduledMessage.UnionMember1;
173
+ }
174
+
175
+ export namespace ScheduledMessage {
176
+ export interface Message {
177
+ messages: Array<Message.Message>;
178
+
179
+ callback_url?: string;
180
+
181
+ include_return_message_types?: Array<
182
+ | 'system_message'
183
+ | 'user_message'
184
+ | 'assistant_message'
185
+ | 'reasoning_message'
186
+ | 'hidden_reasoning_message'
187
+ | 'tool_call_message'
188
+ | 'tool_return_message'
189
+ | 'approval_request_message'
190
+ | 'approval_response_message'
191
+ >;
192
+
193
+ max_steps?: number;
194
+ }
195
+
196
+ export namespace Message {
197
+ export interface Message {
198
+ content: Array<Message.UnionMember0 | Message.UnionMember1> | string;
199
+
200
+ role: 'user' | 'assistant' | 'system';
201
+
202
+ name?: string;
203
+
204
+ otid?: string;
205
+
206
+ sender_id?: string;
207
+
208
+ type?: 'message';
209
+ }
210
+
211
+ export namespace Message {
212
+ export interface UnionMember0 {
213
+ text: string;
214
+
215
+ signature?: string | null;
216
+
217
+ type?: 'text';
218
+ }
219
+
220
+ export interface UnionMember1 {
221
+ source: UnionMember1.Source;
222
+
223
+ type: 'image';
224
+ }
225
+
226
+ export namespace UnionMember1 {
227
+ export interface Source {
228
+ data: string;
229
+
230
+ media_type: string;
231
+
232
+ detail?: string;
233
+
234
+ type?: 'base64';
235
+ }
236
+ }
237
+ }
238
+ }
239
+
240
+ export interface UnionMember0 {
241
+ scheduled_at: number;
242
+
243
+ type?: 'one-time';
244
+ }
245
+
246
+ export interface UnionMember1 {
247
+ cron_expression: string;
248
+
249
+ type: 'recurring';
250
+ }
251
+ }
252
+ }
253
+
254
+ export interface ScheduleDeleteResponse {
255
+ success: true;
256
+ }
257
+
258
+ export interface ScheduleCreateParams {
259
+ messages: Array<ScheduleCreateParams.Message>;
260
+
261
+ schedule: ScheduleCreateParams.UnionMember0 | ScheduleCreateParams.UnionMember1;
262
+
263
+ callback_url?: string;
264
+
265
+ include_return_message_types?: Array<
266
+ | 'system_message'
267
+ | 'user_message'
268
+ | 'assistant_message'
269
+ | 'reasoning_message'
270
+ | 'hidden_reasoning_message'
271
+ | 'tool_call_message'
272
+ | 'tool_return_message'
273
+ | 'approval_request_message'
274
+ | 'approval_response_message'
275
+ >;
276
+
277
+ max_steps?: number;
278
+ }
279
+
280
+ export namespace ScheduleCreateParams {
281
+ export interface Message {
282
+ content: Array<Message.UnionMember0 | Message.UnionMember1> | string;
283
+
284
+ role: 'user' | 'assistant' | 'system';
285
+
286
+ name?: string;
287
+
288
+ otid?: string;
289
+
290
+ sender_id?: string;
291
+
292
+ type?: 'message';
293
+ }
294
+
295
+ export namespace Message {
296
+ export interface UnionMember0 {
297
+ text: string;
298
+
299
+ signature?: string | null;
300
+
301
+ type?: 'text';
302
+ }
303
+
304
+ export interface UnionMember1 {
305
+ source: UnionMember1.Source;
306
+
307
+ type: 'image';
308
+ }
309
+
310
+ export namespace UnionMember1 {
311
+ export interface Source {
312
+ data: string;
313
+
314
+ media_type: string;
315
+
316
+ detail?: string;
317
+
318
+ type?: 'base64';
319
+ }
320
+ }
321
+ }
322
+
323
+ export interface UnionMember0 {
324
+ scheduled_at: number;
325
+
326
+ type?: 'one-time';
327
+ }
328
+
329
+ export interface UnionMember1 {
330
+ cron_expression: string;
331
+
332
+ type: 'recurring';
333
+ }
334
+ }
335
+
336
+ export interface ScheduleRetrieveParams {
337
+ agent_id: string;
338
+ }
339
+
340
+ export interface ScheduleListParams {
341
+ after?: string;
342
+
343
+ limit?: string;
344
+ }
345
+
346
+ export interface ScheduleDeleteParams {
347
+ agent_id: string;
348
+ }
349
+
350
+ export declare namespace Schedule {
351
+ export {
352
+ type ScheduleCreateResponse as ScheduleCreateResponse,
353
+ type ScheduleRetrieveResponse as ScheduleRetrieveResponse,
354
+ type ScheduleListResponse as ScheduleListResponse,
355
+ type ScheduleDeleteResponse as ScheduleDeleteResponse,
356
+ type ScheduleCreateParams as ScheduleCreateParams,
357
+ type ScheduleRetrieveParams as ScheduleRetrieveParams,
358
+ type ScheduleListParams as ScheduleListParams,
359
+ type ScheduleDeleteParams as ScheduleDeleteParams,
360
+ };
361
+ }
@@ -33,6 +33,7 @@ export interface AgentListParams extends ArrayPageParams {
33
33
  | 'agent.blocks'
34
34
  | 'agent.identities'
35
35
  | 'agent.managed_group'
36
+ | 'agent.pending_approval'
36
37
  | 'agent.secrets'
37
38
  | 'agent.sources'
38
39
  | 'agent.tags'
@@ -133,6 +133,11 @@ export interface BlockResponse {
133
133
  */
134
134
  read_only?: boolean;
135
135
 
136
+ /**
137
+ * The tags associated with the block.
138
+ */
139
+ tags?: Array<string> | null;
140
+
136
141
  /**
137
142
  * @deprecated (Deprecated) The id of the template.
138
143
  */
@@ -210,6 +215,11 @@ export interface CreateBlock {
210
215
  */
211
216
  read_only?: boolean;
212
217
 
218
+ /**
219
+ * The tags to associate with the block.
220
+ */
221
+ tags?: Array<string> | null;
222
+
213
223
  /**
214
224
  * The id of the template.
215
225
  */
@@ -286,6 +296,11 @@ export interface BlockCreateParams {
286
296
  */
287
297
  read_only?: boolean;
288
298
 
299
+ /**
300
+ * The tags to associate with the block.
301
+ */
302
+ tags?: Array<string> | null;
303
+
289
304
  /**
290
305
  * The id of the template.
291
306
  */
@@ -358,6 +373,11 @@ export interface BlockUpdateParams {
358
373
  */
359
374
  read_only?: boolean;
360
375
 
376
+ /**
377
+ * The tags to associate with the block.
378
+ */
379
+ tags?: Array<string> | null;
380
+
361
381
  /**
362
382
  * The id of the template.
363
383
  */
@@ -420,6 +440,12 @@ export interface BlockListParams extends ArrayPageParams {
420
440
  */
421
441
  label_search?: string | null;
422
442
 
443
+ /**
444
+ * If True, only returns blocks that match ALL given tags. Otherwise, return blocks
445
+ * that have ANY of the passed-in tags.
446
+ */
447
+ match_all_tags?: boolean;
448
+
423
449
  /**
424
450
  * Name filter (alphanumeric, spaces, hyphens, underscores)
425
451
  */
@@ -430,6 +456,11 @@ export interface BlockListParams extends ArrayPageParams {
430
456
  */
431
457
  project_id?: string | null;
432
458
 
459
+ /**
460
+ * List of tags to filter blocks by
461
+ */
462
+ tags?: Array<string> | null;
463
+
433
464
  /**
434
465
  * Whether to include only templates
435
466
  */
@@ -69,6 +69,12 @@ export interface Conversation {
69
69
  */
70
70
  in_context_message_ids?: Array<string>;
71
71
 
72
+ /**
73
+ * IDs of blocks that are isolated (specific to this conversation, overriding agent
74
+ * defaults).
75
+ */
76
+ isolated_block_ids?: Array<string>;
77
+
72
78
  /**
73
79
  * The id of the user that made this object.
74
80
  */
@@ -89,6 +95,13 @@ export interface Conversation {
89
95
  * Request model for creating a new conversation.
90
96
  */
91
97
  export interface CreateConversation {
98
+ /**
99
+ * List of block labels that should be isolated (conversation-specific) rather than
100
+ * shared across conversations. New blocks will be created as copies of the agent's
101
+ * blocks with these labels.
102
+ */
103
+ isolated_block_labels?: Array<string> | null;
104
+
92
105
  /**
93
106
  * A summary of the conversation.
94
107
  */
@@ -103,6 +116,13 @@ export interface ConversationCreateParams {
103
116
  */
104
117
  agent_id: string;
105
118
 
119
+ /**
120
+ * Body param: List of block labels that should be isolated (conversation-specific)
121
+ * rather than shared across conversations. New blocks will be created as copies of
122
+ * the agent's blocks with these labels.
123
+ */
124
+ isolated_block_labels?: Array<string> | null;
125
+
106
126
  /**
107
127
  * Body param: A summary of the conversation.
108
128
  */
@@ -357,7 +357,7 @@ export interface FileDeleteParams {
357
357
 
358
358
  export interface FileUploadParams {
359
359
  /**
360
- * Body param:
360
+ * Body param
361
361
  */
362
362
  file: Uploadable;
363
363
 
@@ -256,7 +256,7 @@ export declare namespace MessageUpdateParams {
256
256
  content: string;
257
257
 
258
258
  /**
259
- * Body param:
259
+ * Body param
260
260
  */
261
261
  message_type?: 'system_message';
262
262
  }
@@ -274,7 +274,7 @@ export declare namespace MessageUpdateParams {
274
274
  content: Array<MessagesAPI.LettaUserMessageContentUnion> | string;
275
275
 
276
276
  /**
277
- * Body param:
277
+ * Body param
278
278
  */
279
279
  message_type?: 'user_message';
280
280
  }
@@ -286,12 +286,12 @@ export declare namespace MessageUpdateParams {
286
286
  group_id: string;
287
287
 
288
288
  /**
289
- * Body param:
289
+ * Body param
290
290
  */
291
291
  reasoning: string;
292
292
 
293
293
  /**
294
- * Body param:
294
+ * Body param
295
295
  */
296
296
  message_type?: 'reasoning_message';
297
297
  }
@@ -309,7 +309,7 @@ export declare namespace MessageUpdateParams {
309
309
  content: Array<MessagesAPI.LettaAssistantMessageContentUnion> | string;
310
310
 
311
311
  /**
312
- * Body param:
312
+ * Body param
313
313
  */
314
314
  message_type?: 'assistant_message';
315
315
  }
@@ -33,6 +33,7 @@ export interface AgentListParams extends ArrayPageParams {
33
33
  | 'agent.blocks'
34
34
  | 'agent.identities'
35
35
  | 'agent.managed_group'
36
+ | 'agent.pending_approval'
36
37
  | 'agent.secrets'
37
38
  | 'agent.sources'
38
39
  | 'agent.tags'
@@ -50,7 +50,7 @@ export interface ToolRetrieveParams {
50
50
 
51
51
  export interface ToolRunParams {
52
52
  /**
53
- * Path param:
53
+ * Path param
54
54
  */
55
55
  mcp_server_id: string;
56
56
 
@@ -38,6 +38,11 @@ export interface MessageSearchRequest {
38
38
  */
39
39
  agent_id?: string | null;
40
40
 
41
+ /**
42
+ * Filter messages by conversation ID
43
+ */
44
+ conversation_id?: string | null;
45
+
41
46
  /**
42
47
  * Filter messages created on or before this date
43
48
  */
@@ -233,6 +238,11 @@ export interface MessageListParams {
233
238
  */
234
239
  before?: string | null;
235
240
 
241
+ /**
242
+ * Conversation ID to filter messages by
243
+ */
244
+ conversation_id?: string | null;
245
+
236
246
  /**
237
247
  * Maximum number of messages to return
238
248
  */
@@ -256,6 +266,11 @@ export interface MessageSearchParams {
256
266
  */
257
267
  agent_id?: string | null;
258
268
 
269
+ /**
270
+ * Filter messages by conversation ID
271
+ */
272
+ conversation_id?: string | null;
273
+
259
274
  /**
260
275
  * Filter messages created on or before this date
261
276
  */
@@ -8,4 +8,5 @@ export {
8
8
  } from './messages';
9
9
  export { Runs, type Job, type StopReasonType, type RunListParams } from './runs';
10
10
  export { Steps, type StepListParams } from './steps';
11
+ export { Trace, type TraceRetrieveResponse, type TraceRetrieveParams } from './trace';
11
12
  export { Usage, type UsageRetrieveResponse } from './usage';
@@ -7,6 +7,8 @@ import * as RunsMessagesAPI from './messages';
7
7
  import { MessageListParams, MessageStreamParams, MessageStreamResponse, Messages } from './messages';
8
8
  import * as StepsAPI from './steps';
9
9
  import { StepListParams, Steps } from './steps';
10
+ import * as TraceAPI from './trace';
11
+ import { Trace, TraceRetrieveParams, TraceRetrieveResponse } from './trace';
10
12
  import * as UsageAPI from './usage';
11
13
  import { Usage, UsageRetrieveResponse } from './usage';
12
14
  import { APIPromise } from '../../core/api-promise';
@@ -18,6 +20,7 @@ export class Runs extends APIResource {
18
20
  messages: RunsMessagesAPI.Messages = new RunsMessagesAPI.Messages(this._client);
19
21
  usage: UsageAPI.Usage = new UsageAPI.Usage(this._client);
20
22
  steps: StepsAPI.Steps = new StepsAPI.Steps(this._client);
23
+ trace: TraceAPI.Trace = new TraceAPI.Trace(this._client);
21
24
 
22
25
  /**
23
26
  * Get the status of a run.
@@ -175,6 +178,11 @@ export interface RunListParams extends ArrayPageParams {
175
178
  */
176
179
  background?: boolean | null;
177
180
 
181
+ /**
182
+ * Filter runs by conversation ID.
183
+ */
184
+ conversation_id?: string | null;
185
+
178
186
  /**
179
187
  * Filter runs by status. Can specify multiple statuses.
180
188
  */
@@ -189,6 +197,7 @@ export interface RunListParams extends ArrayPageParams {
189
197
  Runs.Messages = Messages;
190
198
  Runs.Usage = Usage;
191
199
  Runs.Steps = Steps;
200
+ Runs.Trace = Trace;
192
201
 
193
202
  export declare namespace Runs {
194
203
  export { type Job as Job, type StopReasonType as StopReasonType, type RunListParams as RunListParams };
@@ -203,6 +212,12 @@ export declare namespace Runs {
203
212
  export { Usage as Usage, type UsageRetrieveResponse as UsageRetrieveResponse };
204
213
 
205
214
  export { Steps as Steps, type StepListParams as StepListParams };
215
+
216
+ export {
217
+ Trace as Trace,
218
+ type TraceRetrieveResponse as TraceRetrieveResponse,
219
+ type TraceRetrieveParams as TraceRetrieveParams,
220
+ };
206
221
  }
207
222
 
208
223
  export { type RunsArrayPage };
@@ -0,0 +1,44 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ import { path } from '../../internal/utils/path';
7
+
8
+ export class Trace extends APIResource {
9
+ /**
10
+ * Retrieve OTEL trace spans for a run.
11
+ *
12
+ * Returns a filtered set of spans relevant for observability:
13
+ *
14
+ * - agent_step: Individual agent reasoning steps
15
+ * - tool executions: Tool call spans
16
+ * - Root span: The top-level request span
17
+ * - time_to_first_token: TTFT measurement span
18
+ *
19
+ * Requires ClickHouse to be configured for trace storage.
20
+ */
21
+ retrieve(
22
+ runID: string,
23
+ query: TraceRetrieveParams | null | undefined = {},
24
+ options?: RequestOptions,
25
+ ): APIPromise<TraceRetrieveResponse> {
26
+ return this._client.get(path`/v1/runs/${runID}/trace`, { query, ...options });
27
+ }
28
+ }
29
+
30
+ export type TraceRetrieveResponse = Array<{ [key: string]: unknown }>;
31
+
32
+ export interface TraceRetrieveParams {
33
+ /**
34
+ * Maximum number of spans to return
35
+ */
36
+ limit?: number;
37
+ }
38
+
39
+ export declare namespace Trace {
40
+ export {
41
+ type TraceRetrieveResponse as TraceRetrieveResponse,
42
+ type TraceRetrieveParams as TraceRetrieveParams,
43
+ };
44
+ }
@@ -6,7 +6,7 @@ import { RequestOptions } from '../internal/request-options';
6
6
 
7
7
  export class Tags extends APIResource {
8
8
  /**
9
- * Get the list of all agent tags that have been created.
9
+ * Get the list of all tags (from agents and blocks) that have been created.
10
10
  */
11
11
  list(query: TagListParams | null | undefined = {}, options?: RequestOptions): APIPromise<TagListResponse> {
12
12
  return this._client.get('/v1/tags/', { query, ...options });
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.6.5'; // x-release-please-version
1
+ export const VERSION = '1.6.6'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.6.5";
1
+ export declare const VERSION = "1.6.6";
2
2
  //# sourceMappingURL=version.d.mts.map