@letta-ai/letta-client 1.6.4 → 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 (170) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agents/agents.d.mts +21 -4
  12. package/resources/agents/agents.d.mts.map +1 -1
  13. package/resources/agents/agents.d.ts +21 -4
  14. package/resources/agents/agents.d.ts.map +1 -1
  15. package/resources/agents/agents.js +4 -0
  16. package/resources/agents/agents.js.map +1 -1
  17. package/resources/agents/agents.mjs +4 -0
  18. package/resources/agents/agents.mjs.map +1 -1
  19. package/resources/agents/blocks.d.mts +12 -0
  20. package/resources/agents/blocks.d.mts.map +1 -1
  21. package/resources/agents/blocks.d.ts +12 -0
  22. package/resources/agents/blocks.d.ts.map +1 -1
  23. package/resources/agents/index.d.mts +1 -0
  24. package/resources/agents/index.d.mts.map +1 -1
  25. package/resources/agents/index.d.ts +1 -0
  26. package/resources/agents/index.d.ts.map +1 -1
  27. package/resources/agents/index.js +3 -1
  28. package/resources/agents/index.js.map +1 -1
  29. package/resources/agents/index.mjs +1 -0
  30. package/resources/agents/index.mjs.map +1 -1
  31. package/resources/agents/messages.d.mts +23 -3
  32. package/resources/agents/messages.d.mts.map +1 -1
  33. package/resources/agents/messages.d.ts +23 -3
  34. package/resources/agents/messages.d.ts.map +1 -1
  35. package/resources/agents/messages.js +10 -3
  36. package/resources/agents/messages.js.map +1 -1
  37. package/resources/agents/messages.mjs +10 -3
  38. package/resources/agents/messages.mjs.map +1 -1
  39. package/resources/agents/passages.d.mts +4 -0
  40. package/resources/agents/passages.d.mts.map +1 -1
  41. package/resources/agents/passages.d.ts +4 -0
  42. package/resources/agents/passages.d.ts.map +1 -1
  43. package/resources/agents/schedule.d.mts +197 -0
  44. package/resources/agents/schedule.d.mts.map +1 -0
  45. package/resources/agents/schedule.d.ts +197 -0
  46. package/resources/agents/schedule.d.ts.map +1 -0
  47. package/resources/agents/schedule.js +40 -0
  48. package/resources/agents/schedule.js.map +1 -0
  49. package/resources/agents/schedule.mjs +36 -0
  50. package/resources/agents/schedule.mjs.map +1 -0
  51. package/resources/blocks/agents.d.mts +1 -1
  52. package/resources/blocks/agents.d.mts.map +1 -1
  53. package/resources/blocks/agents.d.ts +1 -1
  54. package/resources/blocks/agents.d.ts.map +1 -1
  55. package/resources/blocks/blocks.d.mts +25 -0
  56. package/resources/blocks/blocks.d.mts.map +1 -1
  57. package/resources/blocks/blocks.d.ts +25 -0
  58. package/resources/blocks/blocks.d.ts.map +1 -1
  59. package/resources/blocks/blocks.js.map +1 -1
  60. package/resources/blocks/blocks.mjs.map +1 -1
  61. package/resources/conversations/conversations.d.mts +113 -0
  62. package/resources/conversations/conversations.d.mts.map +1 -0
  63. package/resources/conversations/conversations.d.ts +113 -0
  64. package/resources/conversations/conversations.d.ts.map +1 -0
  65. package/resources/conversations/conversations.js +37 -0
  66. package/resources/conversations/conversations.js.map +1 -0
  67. package/resources/conversations/conversations.mjs +32 -0
  68. package/resources/conversations/conversations.mjs.map +1 -0
  69. package/resources/conversations/index.d.mts +3 -0
  70. package/resources/conversations/index.d.mts.map +1 -0
  71. package/resources/conversations/index.d.ts +3 -0
  72. package/resources/conversations/index.d.ts.map +1 -0
  73. package/resources/conversations/index.js +9 -0
  74. package/resources/conversations/index.js.map +1 -0
  75. package/resources/conversations/index.mjs +4 -0
  76. package/resources/conversations/index.mjs.map +1 -0
  77. package/resources/conversations/messages.d.mts +198 -0
  78. package/resources/conversations/messages.d.mts.map +1 -0
  79. package/resources/conversations/messages.d.ts +198 -0
  80. package/resources/conversations/messages.d.ts.map +1 -0
  81. package/resources/conversations/messages.js +46 -0
  82. package/resources/conversations/messages.js.map +1 -0
  83. package/resources/conversations/messages.mjs +42 -0
  84. package/resources/conversations/messages.mjs.map +1 -0
  85. package/resources/conversations.d.mts +2 -0
  86. package/resources/conversations.d.mts.map +1 -0
  87. package/resources/conversations.d.ts +2 -0
  88. package/resources/conversations.d.ts.map +1 -0
  89. package/resources/conversations.js +6 -0
  90. package/resources/conversations.js.map +1 -0
  91. package/resources/conversations.mjs +3 -0
  92. package/resources/conversations.mjs.map +1 -0
  93. package/resources/folders/files.d.mts +1 -1
  94. package/resources/folders/files.d.ts +1 -1
  95. package/resources/groups/messages.d.mts +5 -5
  96. package/resources/groups/messages.d.ts +5 -5
  97. package/resources/identities/agents.d.mts +1 -1
  98. package/resources/identities/agents.d.mts.map +1 -1
  99. package/resources/identities/agents.d.ts +1 -1
  100. package/resources/identities/agents.d.ts.map +1 -1
  101. package/resources/index.d.mts +1 -0
  102. package/resources/index.d.mts.map +1 -1
  103. package/resources/index.d.ts +1 -0
  104. package/resources/index.d.ts.map +1 -1
  105. package/resources/index.js +3 -1
  106. package/resources/index.js.map +1 -1
  107. package/resources/index.mjs +1 -0
  108. package/resources/index.mjs.map +1 -1
  109. package/resources/mcp-servers/tools.d.mts +1 -1
  110. package/resources/mcp-servers/tools.d.ts +1 -1
  111. package/resources/messages.d.mts +12 -0
  112. package/resources/messages.d.mts.map +1 -1
  113. package/resources/messages.d.ts +12 -0
  114. package/resources/messages.d.ts.map +1 -1
  115. package/resources/runs/index.d.mts +1 -0
  116. package/resources/runs/index.d.mts.map +1 -1
  117. package/resources/runs/index.d.ts +1 -0
  118. package/resources/runs/index.d.ts.map +1 -1
  119. package/resources/runs/index.js +3 -1
  120. package/resources/runs/index.js.map +1 -1
  121. package/resources/runs/index.mjs +1 -0
  122. package/resources/runs/index.mjs.map +1 -1
  123. package/resources/runs/runs.d.mts +8 -0
  124. package/resources/runs/runs.d.mts.map +1 -1
  125. package/resources/runs/runs.d.ts +8 -0
  126. package/resources/runs/runs.d.ts.map +1 -1
  127. package/resources/runs/runs.js +4 -0
  128. package/resources/runs/runs.js.map +1 -1
  129. package/resources/runs/runs.mjs +4 -0
  130. package/resources/runs/runs.mjs.map +1 -1
  131. package/resources/runs/trace.d.mts +31 -0
  132. package/resources/runs/trace.d.mts.map +1 -0
  133. package/resources/runs/trace.d.ts +31 -0
  134. package/resources/runs/trace.d.ts.map +1 -0
  135. package/resources/runs/trace.js +25 -0
  136. package/resources/runs/trace.js.map +1 -0
  137. package/resources/runs/trace.mjs +21 -0
  138. package/resources/runs/trace.mjs.map +1 -0
  139. package/resources/tags.d.mts +1 -1
  140. package/resources/tags.d.ts +1 -1
  141. package/resources/tags.js +1 -1
  142. package/resources/tags.mjs +1 -1
  143. package/src/client.ts +19 -0
  144. package/src/resources/agents/agents.ts +45 -2
  145. package/src/resources/agents/blocks.ts +15 -0
  146. package/src/resources/agents/index.ts +11 -0
  147. package/src/resources/agents/messages.ts +26 -3
  148. package/src/resources/agents/passages.ts +5 -0
  149. package/src/resources/agents/schedule.ts +361 -0
  150. package/src/resources/blocks/agents.ts +1 -0
  151. package/src/resources/blocks/blocks.ts +31 -0
  152. package/src/resources/conversations/conversations.ts +168 -0
  153. package/src/resources/conversations/index.ts +18 -0
  154. package/src/resources/conversations/messages.ts +277 -0
  155. package/src/resources/conversations.ts +3 -0
  156. package/src/resources/folders/files.ts +1 -1
  157. package/src/resources/groups/messages.ts +5 -5
  158. package/src/resources/identities/agents.ts +1 -0
  159. package/src/resources/index.ts +8 -0
  160. package/src/resources/mcp-servers/tools.ts +1 -1
  161. package/src/resources/messages.ts +15 -0
  162. package/src/resources/runs/index.ts +1 -0
  163. package/src/resources/runs/runs.ts +15 -0
  164. package/src/resources/runs/trace.ts +44 -0
  165. package/src/resources/tags.ts +1 -1
  166. package/src/version.ts +1 -1
  167. package/version.d.mts +1 -1
  168. package/version.d.ts +1 -1
  169. package/version.js +1 -1
  170. package/version.mjs +1 -1
@@ -3,7 +3,7 @@ import { APIPromise } from "../core/api-promise.mjs";
3
3
  import { RequestOptions } from "../internal/request-options.mjs";
4
4
  export declare class Tags extends APIResource {
5
5
  /**
6
- * Get the list of all agent tags that have been created.
6
+ * Get the list of all tags (from agents and blocks) that have been created.
7
7
  */
8
8
  list(query?: TagListParams | null | undefined, options?: RequestOptions): APIPromise<TagListResponse>;
9
9
  }
@@ -3,7 +3,7 @@ import { APIPromise } from "../core/api-promise.js";
3
3
  import { RequestOptions } from "../internal/request-options.js";
4
4
  export declare class Tags extends APIResource {
5
5
  /**
6
- * Get the list of all agent tags that have been created.
6
+ * Get the list of all tags (from agents and blocks) that have been created.
7
7
  */
8
8
  list(query?: TagListParams | null | undefined, options?: RequestOptions): APIPromise<TagListResponse>;
9
9
  }
package/resources/tags.js CHANGED
@@ -5,7 +5,7 @@ exports.Tags = void 0;
5
5
  const resource_1 = require("../core/resource.js");
6
6
  class Tags extends resource_1.APIResource {
7
7
  /**
8
- * Get the list of all agent tags that have been created.
8
+ * Get the list of all tags (from agents and blocks) that have been created.
9
9
  */
10
10
  list(query = {}, options) {
11
11
  return this._client.get('/v1/tags/', { query, ...options });
@@ -2,7 +2,7 @@
2
2
  import { APIResource } from "../core/resource.mjs";
3
3
  export class Tags extends APIResource {
4
4
  /**
5
- * Get the list of all agent tags that have been created.
5
+ * Get the list of all tags (from agents and blocks) that have been created.
6
6
  */
7
7
  list(query = {}, options) {
8
8
  return this._client.get('/v1/tags/', { query, ...options });
package/src/client.ts CHANGED
@@ -135,6 +135,14 @@ import {
135
135
  Blocks,
136
136
  CreateBlock,
137
137
  } from './resources/blocks/blocks';
138
+ import {
139
+ Conversation,
140
+ ConversationCreateParams,
141
+ ConversationListParams,
142
+ ConversationListResponse,
143
+ Conversations,
144
+ CreateConversation,
145
+ } from './resources/conversations/conversations';
138
146
  import {
139
147
  Folder,
140
148
  FolderCreateParams,
@@ -978,6 +986,7 @@ export class Letta {
978
986
  messages: API.Messages = new API.Messages(this);
979
987
  passages: API.Passages = new API.Passages(this);
980
988
  batches: API.Batches = new API.Batches(this);
989
+ conversations: API.Conversations = new API.Conversations(this);
981
990
  accessTokens: API.AccessTokens = new API.AccessTokens(this);
982
991
  }
983
992
 
@@ -997,6 +1006,7 @@ Letta.Groups = Groups;
997
1006
  Letta.Messages = Messages;
998
1007
  Letta.Passages = Passages;
999
1008
  Letta.Batches = Batches;
1009
+ Letta.Conversations = Conversations;
1000
1010
  Letta.AccessTokens = AccessTokens;
1001
1011
 
1002
1012
  export declare namespace Letta {
@@ -1223,6 +1233,15 @@ export declare namespace Letta {
1223
1233
  type BatchListParams as BatchListParams,
1224
1234
  };
1225
1235
 
1236
+ export {
1237
+ Conversations as Conversations,
1238
+ type Conversation as Conversation,
1239
+ type CreateConversation as CreateConversation,
1240
+ type ConversationListResponse as ConversationListResponse,
1241
+ type ConversationCreateParams as ConversationCreateParams,
1242
+ type ConversationListParams as ConversationListParams,
1243
+ };
1244
+
1226
1245
  export {
1227
1246
  AccessTokens as AccessTokens,
1228
1247
  type AccessTokenCreateResponse as AccessTokenCreateResponse,
@@ -120,6 +120,18 @@ import {
120
120
  PassageSearchResponse,
121
121
  Passages,
122
122
  } from './passages';
123
+ import * as ScheduleAPI from './schedule';
124
+ import {
125
+ Schedule,
126
+ ScheduleCreateParams,
127
+ ScheduleCreateResponse,
128
+ ScheduleDeleteParams,
129
+ ScheduleDeleteResponse,
130
+ ScheduleListParams,
131
+ ScheduleListResponse,
132
+ ScheduleRetrieveParams,
133
+ ScheduleRetrieveResponse,
134
+ } from './schedule';
123
135
  import * as AgentsToolsAPI from './tools';
124
136
  import {
125
137
  ToolAttachParams,
@@ -147,6 +159,7 @@ import { path } from '../../internal/utils/path';
147
159
 
148
160
  export class Agents extends APIResource {
149
161
  messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client);
162
+ schedule: ScheduleAPI.Schedule = new ScheduleAPI.Schedule(this._client);
150
163
  blocks: BlocksAPI.Blocks = new BlocksAPI.Blocks(this._client);
151
164
  tools: AgentsToolsAPI.Tools = new AgentsToolsAPI.Tools(this._client);
152
165
  folders: FoldersAPI.Folders = new FoldersAPI.Folders(this._client);
@@ -497,6 +510,16 @@ export interface AgentState {
497
510
  */
498
511
  multi_agent_group?: GroupsGroupsAPI.Group | null;
499
512
 
513
+ /**
514
+ * A message representing a request for approval to call a tool (generated by the
515
+ * LLM to trigger tool execution).
516
+ *
517
+ * Args: id (str): The ID of the message date (datetime): The date the message was
518
+ * created in ISO format name (Optional[str]): The name of the sender of the
519
+ * message tool_call (ToolCall): The tool call
520
+ */
521
+ pending_approval?: MessagesAPI.ApprovalRequestMessage | null;
522
+
500
523
  /**
501
524
  * The per-file view window character limit for this agent. Setting this too high
502
525
  * may exceed the context window, which will break the agent.
@@ -685,6 +708,11 @@ export namespace AgentState {
685
708
  */
686
709
  read_only?: boolean;
687
710
 
711
+ /**
712
+ * The tags associated with the block.
713
+ */
714
+ tags?: Array<string> | null;
715
+
688
716
  /**
689
717
  * The id of the template.
690
718
  */
@@ -2055,6 +2083,7 @@ export interface AgentRetrieveParams {
2055
2083
  | 'agent.blocks'
2056
2084
  | 'agent.identities'
2057
2085
  | 'agent.managed_group'
2086
+ | 'agent.pending_approval'
2058
2087
  | 'agent.secrets'
2059
2088
  | 'agent.sources'
2060
2089
  | 'agent.tags'
@@ -2458,6 +2487,7 @@ export interface AgentListParams extends ArrayPageParams {
2458
2487
  | 'agent.blocks'
2459
2488
  | 'agent.identities'
2460
2489
  | 'agent.managed_group'
2490
+ | 'agent.pending_approval'
2461
2491
  | 'agent.secrets'
2462
2492
  | 'agent.sources'
2463
2493
  | 'agent.tags'
@@ -2531,7 +2561,7 @@ export interface AgentExportFileParams {
2531
2561
 
2532
2562
  export interface AgentImportFileParams {
2533
2563
  /**
2534
- * Body param:
2564
+ * Body param
2535
2565
  */
2536
2566
  file: Uploadable;
2537
2567
 
@@ -2593,12 +2623,13 @@ export interface AgentImportFileParams {
2593
2623
  strip_messages?: boolean;
2594
2624
 
2595
2625
  /**
2596
- * Header param:
2626
+ * Header param
2597
2627
  */
2598
2628
  'x-override-embedding-model'?: string;
2599
2629
  }
2600
2630
 
2601
2631
  Agents.Messages = Messages;
2632
+ Agents.Schedule = Schedule;
2602
2633
  Agents.Blocks = Blocks;
2603
2634
  Agents.Tools = Tools;
2604
2635
  Agents.Folders = Folders;
@@ -2704,6 +2735,18 @@ export declare namespace Agents {
2704
2735
  type MessageStreamParams as MessageStreamParams,
2705
2736
  };
2706
2737
 
2738
+ export {
2739
+ Schedule as Schedule,
2740
+ type ScheduleCreateResponse as ScheduleCreateResponse,
2741
+ type ScheduleRetrieveResponse as ScheduleRetrieveResponse,
2742
+ type ScheduleListResponse as ScheduleListResponse,
2743
+ type ScheduleDeleteResponse as ScheduleDeleteResponse,
2744
+ type ScheduleCreateParams as ScheduleCreateParams,
2745
+ type ScheduleRetrieveParams as ScheduleRetrieveParams,
2746
+ type ScheduleListParams as ScheduleListParams,
2747
+ type ScheduleDeleteParams as ScheduleDeleteParams,
2748
+ };
2749
+
2707
2750
  export {
2708
2751
  Blocks as Blocks,
2709
2752
  type Block as Block,
@@ -161,6 +161,11 @@ export interface Block {
161
161
  */
162
162
  read_only?: boolean;
163
163
 
164
+ /**
165
+ * The tags associated with the block.
166
+ */
167
+ tags?: Array<string> | null;
168
+
164
169
  /**
165
170
  * The id of the template.
166
171
  */
@@ -236,6 +241,11 @@ export interface BlockUpdate {
236
241
  */
237
242
  read_only?: boolean;
238
243
 
244
+ /**
245
+ * The tags to associate with the block.
246
+ */
247
+ tags?: Array<string> | null;
248
+
239
249
  /**
240
250
  * The id of the template.
241
251
  */
@@ -325,6 +335,11 @@ export interface BlockUpdateParams {
325
335
  */
326
336
  read_only?: boolean;
327
337
 
338
+ /**
339
+ * Body param: The tags to associate with the block.
340
+ */
341
+ tags?: Array<string> | null;
342
+
328
343
  /**
329
344
  * Body param: The id of the template.
330
345
  */
@@ -151,6 +151,17 @@ export {
151
151
  type PassageDeleteParams,
152
152
  type PassageSearchParams,
153
153
  } from './passages';
154
+ export {
155
+ Schedule,
156
+ type ScheduleCreateResponse,
157
+ type ScheduleRetrieveResponse,
158
+ type ScheduleListResponse,
159
+ type ScheduleDeleteResponse,
160
+ type ScheduleCreateParams,
161
+ type ScheduleRetrieveParams,
162
+ type ScheduleListParams,
163
+ type ScheduleDeleteParams,
164
+ } from './schedule';
154
165
  export {
155
166
  Tools,
156
167
  type ToolExecuteRequest,
@@ -118,9 +118,16 @@ export class Messages extends APIResource {
118
118
  }
119
119
 
120
120
  /**
121
- * Process a user message and return the agent's response. This endpoint accepts a
122
- * message from a user and processes it through the agent. It will stream the steps
123
- * of the response always, and stream the tokens if 'stream_tokens' is set to True.
121
+ * Process a user message and return the agent's response.
122
+ *
123
+ * Deprecated: Use the `POST /{agent_id}/messages` endpoint with `streaming=true`
124
+ * in the request body instead.
125
+ *
126
+ * This endpoint accepts a message from a user and processes it through the agent.
127
+ * It will stream the steps of the response always, and stream the tokens if
128
+ * 'stream_tokens' is set to True.
129
+ *
130
+ * @deprecated
124
131
  */
125
132
  stream(
126
133
  agentID: string,
@@ -501,6 +508,7 @@ export namespace ImageContent {
501
508
  * tool_returns (List[ToolReturn]): The list of tool returns requested.
502
509
  * group_id (str): The multi-agent group that the message was sent in.
503
510
  * sender_id (str): The id of the sender of the message, can be an identity id or agent id.
511
+ * conversation_id (str): The conversation this message belongs to.
504
512
  *
505
513
  * t
506
514
  */
@@ -555,6 +563,11 @@ export interface InternalMessage {
555
563
  | InternalMessage.SummarizedReasoningContent
556
564
  > | null;
557
565
 
566
+ /**
567
+ * The conversation this message belongs to
568
+ */
569
+ conversation_id?: string | null;
570
+
558
571
  /**
559
572
  * The timestamp when the object was created.
560
573
  */
@@ -1490,6 +1503,11 @@ export interface Run {
1490
1503
  */
1491
1504
  completed_at?: string | null;
1492
1505
 
1506
+ /**
1507
+ * The unique identifier of the conversation associated with the run.
1508
+ */
1509
+ conversation_id?: string | null;
1510
+
1493
1511
  /**
1494
1512
  * The timestamp when the run was created.
1495
1513
  */
@@ -2038,6 +2056,11 @@ export interface MessageListParams extends ArrayPageParams {
2038
2056
  */
2039
2057
  assistant_message_tool_name?: string;
2040
2058
 
2059
+ /**
2060
+ * Conversation ID to filter messages by.
2061
+ */
2062
+ conversation_id?: string | null;
2063
+
2041
2064
  /**
2042
2065
  * Group ID to filter messages by.
2043
2066
  */
@@ -83,6 +83,11 @@ export interface PassageSearchResponse {
83
83
 
84
84
  export namespace PassageSearchResponse {
85
85
  export interface Result {
86
+ /**
87
+ * Unique identifier of the archival memory passage
88
+ */
89
+ id: string;
90
+
86
91
  /**
87
92
  * Text content of the archival memory passage
88
93
  */
@@ -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'