@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.
- package/CHANGELOG.md +38 -0
- package/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents/agents.d.mts +21 -4
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +21 -4
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js +4 -0
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +4 -0
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/blocks.d.mts +12 -0
- package/resources/agents/blocks.d.mts.map +1 -1
- package/resources/agents/blocks.d.ts +12 -0
- package/resources/agents/blocks.d.ts.map +1 -1
- package/resources/agents/index.d.mts +1 -0
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +1 -0
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js +3 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs +1 -0
- package/resources/agents/index.mjs.map +1 -1
- package/resources/agents/messages.d.mts +23 -3
- package/resources/agents/messages.d.mts.map +1 -1
- package/resources/agents/messages.d.ts +23 -3
- package/resources/agents/messages.d.ts.map +1 -1
- package/resources/agents/messages.js +10 -3
- package/resources/agents/messages.js.map +1 -1
- package/resources/agents/messages.mjs +10 -3
- package/resources/agents/messages.mjs.map +1 -1
- package/resources/agents/passages.d.mts +4 -0
- package/resources/agents/passages.d.mts.map +1 -1
- package/resources/agents/passages.d.ts +4 -0
- package/resources/agents/passages.d.ts.map +1 -1
- package/resources/agents/schedule.d.mts +197 -0
- package/resources/agents/schedule.d.mts.map +1 -0
- package/resources/agents/schedule.d.ts +197 -0
- package/resources/agents/schedule.d.ts.map +1 -0
- package/resources/agents/schedule.js +40 -0
- package/resources/agents/schedule.js.map +1 -0
- package/resources/agents/schedule.mjs +36 -0
- package/resources/agents/schedule.mjs.map +1 -0
- package/resources/blocks/agents.d.mts +1 -1
- package/resources/blocks/agents.d.mts.map +1 -1
- package/resources/blocks/agents.d.ts +1 -1
- package/resources/blocks/agents.d.ts.map +1 -1
- package/resources/blocks/blocks.d.mts +25 -0
- package/resources/blocks/blocks.d.mts.map +1 -1
- package/resources/blocks/blocks.d.ts +25 -0
- package/resources/blocks/blocks.d.ts.map +1 -1
- package/resources/blocks/blocks.js.map +1 -1
- package/resources/blocks/blocks.mjs.map +1 -1
- package/resources/conversations/conversations.d.mts +113 -0
- package/resources/conversations/conversations.d.mts.map +1 -0
- package/resources/conversations/conversations.d.ts +113 -0
- package/resources/conversations/conversations.d.ts.map +1 -0
- package/resources/conversations/conversations.js +37 -0
- package/resources/conversations/conversations.js.map +1 -0
- package/resources/conversations/conversations.mjs +32 -0
- package/resources/conversations/conversations.mjs.map +1 -0
- package/resources/conversations/index.d.mts +3 -0
- package/resources/conversations/index.d.mts.map +1 -0
- package/resources/conversations/index.d.ts +3 -0
- package/resources/conversations/index.d.ts.map +1 -0
- package/resources/conversations/index.js +9 -0
- package/resources/conversations/index.js.map +1 -0
- package/resources/conversations/index.mjs +4 -0
- package/resources/conversations/index.mjs.map +1 -0
- package/resources/conversations/messages.d.mts +198 -0
- package/resources/conversations/messages.d.mts.map +1 -0
- package/resources/conversations/messages.d.ts +198 -0
- package/resources/conversations/messages.d.ts.map +1 -0
- package/resources/conversations/messages.js +46 -0
- package/resources/conversations/messages.js.map +1 -0
- package/resources/conversations/messages.mjs +42 -0
- package/resources/conversations/messages.mjs.map +1 -0
- package/resources/conversations.d.mts +2 -0
- package/resources/conversations.d.mts.map +1 -0
- package/resources/conversations.d.ts +2 -0
- package/resources/conversations.d.ts.map +1 -0
- package/resources/conversations.js +6 -0
- package/resources/conversations.js.map +1 -0
- package/resources/conversations.mjs +3 -0
- package/resources/conversations.mjs.map +1 -0
- package/resources/folders/files.d.mts +1 -1
- package/resources/folders/files.d.ts +1 -1
- package/resources/groups/messages.d.mts +5 -5
- package/resources/groups/messages.d.ts +5 -5
- package/resources/identities/agents.d.mts +1 -1
- package/resources/identities/agents.d.mts.map +1 -1
- package/resources/identities/agents.d.ts +1 -1
- package/resources/identities/agents.d.ts.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/mcp-servers/tools.d.mts +1 -1
- package/resources/mcp-servers/tools.d.ts +1 -1
- package/resources/messages.d.mts +12 -0
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +12 -0
- package/resources/messages.d.ts.map +1 -1
- package/resources/runs/index.d.mts +1 -0
- package/resources/runs/index.d.mts.map +1 -1
- package/resources/runs/index.d.ts +1 -0
- package/resources/runs/index.d.ts.map +1 -1
- package/resources/runs/index.js +3 -1
- package/resources/runs/index.js.map +1 -1
- package/resources/runs/index.mjs +1 -0
- package/resources/runs/index.mjs.map +1 -1
- package/resources/runs/runs.d.mts +8 -0
- package/resources/runs/runs.d.mts.map +1 -1
- package/resources/runs/runs.d.ts +8 -0
- package/resources/runs/runs.d.ts.map +1 -1
- package/resources/runs/runs.js +4 -0
- package/resources/runs/runs.js.map +1 -1
- package/resources/runs/runs.mjs +4 -0
- package/resources/runs/runs.mjs.map +1 -1
- package/resources/runs/trace.d.mts +31 -0
- package/resources/runs/trace.d.mts.map +1 -0
- package/resources/runs/trace.d.ts +31 -0
- package/resources/runs/trace.d.ts.map +1 -0
- package/resources/runs/trace.js +25 -0
- package/resources/runs/trace.js.map +1 -0
- package/resources/runs/trace.mjs +21 -0
- package/resources/runs/trace.mjs.map +1 -0
- package/resources/tags.d.mts +1 -1
- package/resources/tags.d.ts +1 -1
- package/resources/tags.js +1 -1
- package/resources/tags.mjs +1 -1
- package/src/client.ts +19 -0
- package/src/resources/agents/agents.ts +45 -2
- package/src/resources/agents/blocks.ts +15 -0
- package/src/resources/agents/index.ts +11 -0
- package/src/resources/agents/messages.ts +26 -3
- package/src/resources/agents/passages.ts +5 -0
- package/src/resources/agents/schedule.ts +361 -0
- package/src/resources/blocks/agents.ts +1 -0
- package/src/resources/blocks/blocks.ts +31 -0
- package/src/resources/conversations/conversations.ts +168 -0
- package/src/resources/conversations/index.ts +18 -0
- package/src/resources/conversations/messages.ts +277 -0
- package/src/resources/conversations.ts +3 -0
- package/src/resources/folders/files.ts +1 -1
- package/src/resources/groups/messages.ts +5 -5
- package/src/resources/identities/agents.ts +1 -0
- package/src/resources/index.ts +8 -0
- package/src/resources/mcp-servers/tools.ts +1 -1
- package/src/resources/messages.ts +15 -0
- package/src/resources/runs/index.ts +1 -0
- package/src/resources/runs/runs.ts +15 -0
- package/src/resources/runs/trace.ts +44 -0
- package/src/resources/tags.ts +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as AgentsAPI from "../agents/agents.mjs";
|
|
3
|
+
import * as MessagesAPI from "../agents/messages.mjs";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
5
|
+
import { Stream } from "../../core/streaming.mjs";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
7
|
+
export declare class Messages extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Send a message to a conversation and get a streaming response.
|
|
10
|
+
*
|
|
11
|
+
* This endpoint sends a message to an existing conversation and streams the
|
|
12
|
+
* agent's response back.
|
|
13
|
+
*/
|
|
14
|
+
create(conversationID: string, body: MessageCreateParams, options?: RequestOptions): APIPromise<Stream<MessagesAPI.LettaStreamingResponse>>;
|
|
15
|
+
/**
|
|
16
|
+
* List all messages in a conversation.
|
|
17
|
+
*
|
|
18
|
+
* Returns LettaMessage objects (UserMessage, AssistantMessage, etc.) for all
|
|
19
|
+
* messages in the conversation, ordered by position (oldest first), with support
|
|
20
|
+
* for cursor-based pagination.
|
|
21
|
+
*/
|
|
22
|
+
list(conversationID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): APIPromise<MessageListResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Resume the stream for the most recent active run in a conversation.
|
|
25
|
+
*
|
|
26
|
+
* This endpoint allows you to reconnect to an active background stream for a
|
|
27
|
+
* conversation, enabling recovery from network interruptions.
|
|
28
|
+
*/
|
|
29
|
+
stream(conversationID: string, body?: MessageStreamParams | undefined, options?: RequestOptions): APIPromise<Stream<MessagesAPI.LettaStreamingResponse>>;
|
|
30
|
+
}
|
|
31
|
+
export type MessageListResponse = Array<MessagesAPI.Message>;
|
|
32
|
+
export type MessageStreamResponse = unknown;
|
|
33
|
+
export interface MessageCreateParams {
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated The name of the message argument in the designated message tool.
|
|
36
|
+
* Still supported for legacy agent types, but deprecated for letta_v1_agent
|
|
37
|
+
* onward.
|
|
38
|
+
*/
|
|
39
|
+
assistant_message_tool_kwarg?: string;
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated The name of the designated message tool. Still supported for legacy
|
|
42
|
+
* agent types, but deprecated for letta_v1_agent onward.
|
|
43
|
+
*/
|
|
44
|
+
assistant_message_tool_name?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Whether to process the request in the background (only used when
|
|
47
|
+
* streaming=true).
|
|
48
|
+
*/
|
|
49
|
+
background?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Client-side tools that the agent can call. When the agent calls a client-side
|
|
52
|
+
* tool, execution pauses and returns control to the client to execute the tool and
|
|
53
|
+
* provide the result via a ToolReturn.
|
|
54
|
+
*/
|
|
55
|
+
client_tools?: Array<MessageCreateParams.ClientTool> | null;
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated If set to True, enables reasoning before responses or tool calls
|
|
58
|
+
* from the agent.
|
|
59
|
+
*/
|
|
60
|
+
enable_thinking?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Whether to include periodic keepalive ping messages in the stream to prevent
|
|
63
|
+
* connection timeouts (only used when streaming=true).
|
|
64
|
+
*/
|
|
65
|
+
include_pings?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Only return specified message types in the response. If `None` (default) returns
|
|
68
|
+
* all messages.
|
|
69
|
+
*/
|
|
70
|
+
include_return_message_types?: Array<MessagesAPI.MessageType> | null;
|
|
71
|
+
/**
|
|
72
|
+
* Syntactic sugar for a single user message. Equivalent to messages=[{'role':
|
|
73
|
+
* 'user', 'content': input}].
|
|
74
|
+
*/
|
|
75
|
+
input?: string | Array<MessagesAPI.TextContent | MessagesAPI.ImageContent | MessagesAPI.ToolCallContent | MessagesAPI.ToolReturnContent | MessagesAPI.ReasoningContent | MessagesAPI.RedactedReasoningContent | MessagesAPI.OmittedReasoningContent | MessageCreateParams.SummarizedReasoningContent> | null;
|
|
76
|
+
/**
|
|
77
|
+
* Maximum number of steps the agent should take to process the request.
|
|
78
|
+
*/
|
|
79
|
+
max_steps?: number;
|
|
80
|
+
/**
|
|
81
|
+
* The messages to be sent to the agent.
|
|
82
|
+
*/
|
|
83
|
+
messages?: Array<AgentsAPI.MessageCreate | MessagesAPI.ApprovalCreate> | null;
|
|
84
|
+
/**
|
|
85
|
+
* Flag to determine if individual tokens should be streamed, rather than streaming
|
|
86
|
+
* per step (only used when streaming=true).
|
|
87
|
+
*/
|
|
88
|
+
stream_tokens?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
91
|
+
* returns a complete response.
|
|
92
|
+
*/
|
|
93
|
+
streaming?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated Whether the server should parse specific tool call arguments
|
|
96
|
+
* (default `send_message`) as `AssistantMessage` objects. Still supported for
|
|
97
|
+
* legacy agent types, but deprecated for letta_v1_agent onward.
|
|
98
|
+
*/
|
|
99
|
+
use_assistant_message?: boolean;
|
|
100
|
+
}
|
|
101
|
+
export declare namespace MessageCreateParams {
|
|
102
|
+
/**
|
|
103
|
+
* Schema for a client-side tool passed in the request.
|
|
104
|
+
*
|
|
105
|
+
* Client-side tools are executed by the client, not the server. When the agent
|
|
106
|
+
* calls a client-side tool, execution pauses and returns control to the client to
|
|
107
|
+
* execute the tool and provide the result.
|
|
108
|
+
*/
|
|
109
|
+
interface ClientTool {
|
|
110
|
+
/**
|
|
111
|
+
* The name of the tool function
|
|
112
|
+
*/
|
|
113
|
+
name: string;
|
|
114
|
+
/**
|
|
115
|
+
* Description of what the tool does
|
|
116
|
+
*/
|
|
117
|
+
description?: string | null;
|
|
118
|
+
/**
|
|
119
|
+
* JSON Schema for the function parameters
|
|
120
|
+
*/
|
|
121
|
+
parameters?: {
|
|
122
|
+
[key: string]: unknown;
|
|
123
|
+
} | null;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The style of reasoning content returned by the OpenAI Responses API
|
|
127
|
+
*/
|
|
128
|
+
interface SummarizedReasoningContent {
|
|
129
|
+
/**
|
|
130
|
+
* The unique identifier for this reasoning step.
|
|
131
|
+
*/
|
|
132
|
+
id: string;
|
|
133
|
+
/**
|
|
134
|
+
* Summaries of the reasoning content.
|
|
135
|
+
*/
|
|
136
|
+
summary: Array<SummarizedReasoningContent.Summary>;
|
|
137
|
+
/**
|
|
138
|
+
* The encrypted reasoning content.
|
|
139
|
+
*/
|
|
140
|
+
encrypted_content?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Indicates this is a summarized reasoning step.
|
|
143
|
+
*/
|
|
144
|
+
type?: 'summarized_reasoning';
|
|
145
|
+
}
|
|
146
|
+
namespace SummarizedReasoningContent {
|
|
147
|
+
interface Summary {
|
|
148
|
+
/**
|
|
149
|
+
* The index of the summary part.
|
|
150
|
+
*/
|
|
151
|
+
index: number;
|
|
152
|
+
/**
|
|
153
|
+
* The text of the summary part.
|
|
154
|
+
*/
|
|
155
|
+
text: string;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
export interface MessageListParams {
|
|
160
|
+
/**
|
|
161
|
+
* Message ID cursor for pagination. Returns messages that come after this message
|
|
162
|
+
* ID in the conversation
|
|
163
|
+
*/
|
|
164
|
+
after?: string | null;
|
|
165
|
+
/**
|
|
166
|
+
* Message ID cursor for pagination. Returns messages that come before this message
|
|
167
|
+
* ID in the conversation
|
|
168
|
+
*/
|
|
169
|
+
before?: string | null;
|
|
170
|
+
/**
|
|
171
|
+
* Maximum number of messages to return
|
|
172
|
+
*/
|
|
173
|
+
limit?: number | null;
|
|
174
|
+
}
|
|
175
|
+
export interface MessageStreamParams {
|
|
176
|
+
/**
|
|
177
|
+
* Number of entries to read per batch.
|
|
178
|
+
*/
|
|
179
|
+
batch_size?: number | null;
|
|
180
|
+
/**
|
|
181
|
+
* Whether to include periodic keepalive ping messages in the stream to prevent
|
|
182
|
+
* connection timeouts.
|
|
183
|
+
*/
|
|
184
|
+
include_pings?: boolean | null;
|
|
185
|
+
/**
|
|
186
|
+
* Seconds to wait between polls when no new data.
|
|
187
|
+
*/
|
|
188
|
+
poll_interval?: number | null;
|
|
189
|
+
/**
|
|
190
|
+
* Sequence id to use as a cursor for pagination. Response will start streaming
|
|
191
|
+
* after this chunk sequence id
|
|
192
|
+
*/
|
|
193
|
+
starting_after?: number;
|
|
194
|
+
}
|
|
195
|
+
export declare namespace Messages {
|
|
196
|
+
export { type MessageListResponse as MessageListResponse, type MessageStreamResponse as MessageStreamResponse, type MessageCreateParams as MessageCreateParams, type MessageListParams as MessageListParams, type MessageStreamParams as MessageStreamParams, };
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=messages.d.mts.map
|
|
@@ -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M,CAAC;QAE3B;;WAEG;QACH,IAAI,CAAC,EAAE,sBAAsB,CAAC;KAC/B;IAED,UAAiB,0BAA0B,CAAC;QAC1C,UAAiB,OAAO;YACtB;;eAEG;YACH,KAAK,EAAE,MAAM,CAAC;YAEd;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;SACd;KACF;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as AgentsAPI from "../agents/agents.js";
|
|
3
|
+
import * as MessagesAPI from "../agents/messages.js";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
5
|
+
import { Stream } from "../../core/streaming.js";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
7
|
+
export declare class Messages extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Send a message to a conversation and get a streaming response.
|
|
10
|
+
*
|
|
11
|
+
* This endpoint sends a message to an existing conversation and streams the
|
|
12
|
+
* agent's response back.
|
|
13
|
+
*/
|
|
14
|
+
create(conversationID: string, body: MessageCreateParams, options?: RequestOptions): APIPromise<Stream<MessagesAPI.LettaStreamingResponse>>;
|
|
15
|
+
/**
|
|
16
|
+
* List all messages in a conversation.
|
|
17
|
+
*
|
|
18
|
+
* Returns LettaMessage objects (UserMessage, AssistantMessage, etc.) for all
|
|
19
|
+
* messages in the conversation, ordered by position (oldest first), with support
|
|
20
|
+
* for cursor-based pagination.
|
|
21
|
+
*/
|
|
22
|
+
list(conversationID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): APIPromise<MessageListResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Resume the stream for the most recent active run in a conversation.
|
|
25
|
+
*
|
|
26
|
+
* This endpoint allows you to reconnect to an active background stream for a
|
|
27
|
+
* conversation, enabling recovery from network interruptions.
|
|
28
|
+
*/
|
|
29
|
+
stream(conversationID: string, body?: MessageStreamParams | undefined, options?: RequestOptions): APIPromise<Stream<MessagesAPI.LettaStreamingResponse>>;
|
|
30
|
+
}
|
|
31
|
+
export type MessageListResponse = Array<MessagesAPI.Message>;
|
|
32
|
+
export type MessageStreamResponse = unknown;
|
|
33
|
+
export interface MessageCreateParams {
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated The name of the message argument in the designated message tool.
|
|
36
|
+
* Still supported for legacy agent types, but deprecated for letta_v1_agent
|
|
37
|
+
* onward.
|
|
38
|
+
*/
|
|
39
|
+
assistant_message_tool_kwarg?: string;
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated The name of the designated message tool. Still supported for legacy
|
|
42
|
+
* agent types, but deprecated for letta_v1_agent onward.
|
|
43
|
+
*/
|
|
44
|
+
assistant_message_tool_name?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Whether to process the request in the background (only used when
|
|
47
|
+
* streaming=true).
|
|
48
|
+
*/
|
|
49
|
+
background?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Client-side tools that the agent can call. When the agent calls a client-side
|
|
52
|
+
* tool, execution pauses and returns control to the client to execute the tool and
|
|
53
|
+
* provide the result via a ToolReturn.
|
|
54
|
+
*/
|
|
55
|
+
client_tools?: Array<MessageCreateParams.ClientTool> | null;
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated If set to True, enables reasoning before responses or tool calls
|
|
58
|
+
* from the agent.
|
|
59
|
+
*/
|
|
60
|
+
enable_thinking?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Whether to include periodic keepalive ping messages in the stream to prevent
|
|
63
|
+
* connection timeouts (only used when streaming=true).
|
|
64
|
+
*/
|
|
65
|
+
include_pings?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Only return specified message types in the response. If `None` (default) returns
|
|
68
|
+
* all messages.
|
|
69
|
+
*/
|
|
70
|
+
include_return_message_types?: Array<MessagesAPI.MessageType> | null;
|
|
71
|
+
/**
|
|
72
|
+
* Syntactic sugar for a single user message. Equivalent to messages=[{'role':
|
|
73
|
+
* 'user', 'content': input}].
|
|
74
|
+
*/
|
|
75
|
+
input?: string | Array<MessagesAPI.TextContent | MessagesAPI.ImageContent | MessagesAPI.ToolCallContent | MessagesAPI.ToolReturnContent | MessagesAPI.ReasoningContent | MessagesAPI.RedactedReasoningContent | MessagesAPI.OmittedReasoningContent | MessageCreateParams.SummarizedReasoningContent> | null;
|
|
76
|
+
/**
|
|
77
|
+
* Maximum number of steps the agent should take to process the request.
|
|
78
|
+
*/
|
|
79
|
+
max_steps?: number;
|
|
80
|
+
/**
|
|
81
|
+
* The messages to be sent to the agent.
|
|
82
|
+
*/
|
|
83
|
+
messages?: Array<AgentsAPI.MessageCreate | MessagesAPI.ApprovalCreate> | null;
|
|
84
|
+
/**
|
|
85
|
+
* Flag to determine if individual tokens should be streamed, rather than streaming
|
|
86
|
+
* per step (only used when streaming=true).
|
|
87
|
+
*/
|
|
88
|
+
stream_tokens?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
91
|
+
* returns a complete response.
|
|
92
|
+
*/
|
|
93
|
+
streaming?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated Whether the server should parse specific tool call arguments
|
|
96
|
+
* (default `send_message`) as `AssistantMessage` objects. Still supported for
|
|
97
|
+
* legacy agent types, but deprecated for letta_v1_agent onward.
|
|
98
|
+
*/
|
|
99
|
+
use_assistant_message?: boolean;
|
|
100
|
+
}
|
|
101
|
+
export declare namespace MessageCreateParams {
|
|
102
|
+
/**
|
|
103
|
+
* Schema for a client-side tool passed in the request.
|
|
104
|
+
*
|
|
105
|
+
* Client-side tools are executed by the client, not the server. When the agent
|
|
106
|
+
* calls a client-side tool, execution pauses and returns control to the client to
|
|
107
|
+
* execute the tool and provide the result.
|
|
108
|
+
*/
|
|
109
|
+
interface ClientTool {
|
|
110
|
+
/**
|
|
111
|
+
* The name of the tool function
|
|
112
|
+
*/
|
|
113
|
+
name: string;
|
|
114
|
+
/**
|
|
115
|
+
* Description of what the tool does
|
|
116
|
+
*/
|
|
117
|
+
description?: string | null;
|
|
118
|
+
/**
|
|
119
|
+
* JSON Schema for the function parameters
|
|
120
|
+
*/
|
|
121
|
+
parameters?: {
|
|
122
|
+
[key: string]: unknown;
|
|
123
|
+
} | null;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The style of reasoning content returned by the OpenAI Responses API
|
|
127
|
+
*/
|
|
128
|
+
interface SummarizedReasoningContent {
|
|
129
|
+
/**
|
|
130
|
+
* The unique identifier for this reasoning step.
|
|
131
|
+
*/
|
|
132
|
+
id: string;
|
|
133
|
+
/**
|
|
134
|
+
* Summaries of the reasoning content.
|
|
135
|
+
*/
|
|
136
|
+
summary: Array<SummarizedReasoningContent.Summary>;
|
|
137
|
+
/**
|
|
138
|
+
* The encrypted reasoning content.
|
|
139
|
+
*/
|
|
140
|
+
encrypted_content?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Indicates this is a summarized reasoning step.
|
|
143
|
+
*/
|
|
144
|
+
type?: 'summarized_reasoning';
|
|
145
|
+
}
|
|
146
|
+
namespace SummarizedReasoningContent {
|
|
147
|
+
interface Summary {
|
|
148
|
+
/**
|
|
149
|
+
* The index of the summary part.
|
|
150
|
+
*/
|
|
151
|
+
index: number;
|
|
152
|
+
/**
|
|
153
|
+
* The text of the summary part.
|
|
154
|
+
*/
|
|
155
|
+
text: string;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
export interface MessageListParams {
|
|
160
|
+
/**
|
|
161
|
+
* Message ID cursor for pagination. Returns messages that come after this message
|
|
162
|
+
* ID in the conversation
|
|
163
|
+
*/
|
|
164
|
+
after?: string | null;
|
|
165
|
+
/**
|
|
166
|
+
* Message ID cursor for pagination. Returns messages that come before this message
|
|
167
|
+
* ID in the conversation
|
|
168
|
+
*/
|
|
169
|
+
before?: string | null;
|
|
170
|
+
/**
|
|
171
|
+
* Maximum number of messages to return
|
|
172
|
+
*/
|
|
173
|
+
limit?: number | null;
|
|
174
|
+
}
|
|
175
|
+
export interface MessageStreamParams {
|
|
176
|
+
/**
|
|
177
|
+
* Number of entries to read per batch.
|
|
178
|
+
*/
|
|
179
|
+
batch_size?: number | null;
|
|
180
|
+
/**
|
|
181
|
+
* Whether to include periodic keepalive ping messages in the stream to prevent
|
|
182
|
+
* connection timeouts.
|
|
183
|
+
*/
|
|
184
|
+
include_pings?: boolean | null;
|
|
185
|
+
/**
|
|
186
|
+
* Seconds to wait between polls when no new data.
|
|
187
|
+
*/
|
|
188
|
+
poll_interval?: number | null;
|
|
189
|
+
/**
|
|
190
|
+
* Sequence id to use as a cursor for pagination. Response will start streaming
|
|
191
|
+
* after this chunk sequence id
|
|
192
|
+
*/
|
|
193
|
+
starting_after?: number;
|
|
194
|
+
}
|
|
195
|
+
export declare namespace Messages {
|
|
196
|
+
export { type MessageListResponse as MessageListResponse, type MessageStreamResponse as MessageStreamResponse, type MessageCreateParams as MessageCreateParams, type MessageListParams as MessageListParams, type MessageStreamParams as MessageStreamParams, };
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/resources/conversations/messages.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,KAAK,WAAW;OAChB,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE;OACV,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;OAKG;IACH,MAAM,CACJ,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,mBAAmB,EACzB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAQzD;;;;;;OAMG;IACH,IAAI,CACF,cAAc,EAAE,MAAM,EACtB,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAIlC;;;;;OAKG;IACH,MAAM,CACJ,cAAc,EAAE,MAAM,EACtB,IAAI,GAAE,mBAAmB,GAAG,SAAc,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;CAO1D;AAED,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAE7D,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC;AAE5C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,4BAA4B,CAAC,EAAE,MAAM,CAAC;IAEtC;;;OAGG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IAErC;;;OAGG;IACH,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.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Messages = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
7
|
+
class Messages extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Send a message to a conversation and get a streaming response.
|
|
10
|
+
*
|
|
11
|
+
* This endpoint sends a message to an existing conversation and streams the
|
|
12
|
+
* agent's response back.
|
|
13
|
+
*/
|
|
14
|
+
create(conversationID, body, options) {
|
|
15
|
+
return this._client.post((0, path_1.path) `/v1/conversations/${conversationID}/messages`, {
|
|
16
|
+
body,
|
|
17
|
+
...options,
|
|
18
|
+
stream: true,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* List all messages in a conversation.
|
|
23
|
+
*
|
|
24
|
+
* Returns LettaMessage objects (UserMessage, AssistantMessage, etc.) for all
|
|
25
|
+
* messages in the conversation, ordered by position (oldest first), with support
|
|
26
|
+
* for cursor-based pagination.
|
|
27
|
+
*/
|
|
28
|
+
list(conversationID, query = {}, options) {
|
|
29
|
+
return this._client.get((0, path_1.path) `/v1/conversations/${conversationID}/messages`, { query, ...options });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Resume the stream for the most recent active run in a conversation.
|
|
33
|
+
*
|
|
34
|
+
* This endpoint allows you to reconnect to an active background stream for a
|
|
35
|
+
* conversation, enabling recovery from network interruptions.
|
|
36
|
+
*/
|
|
37
|
+
stream(conversationID, body = {}, options) {
|
|
38
|
+
return this._client.post((0, path_1.path) `/v1/conversations/${conversationID}/stream`, {
|
|
39
|
+
body,
|
|
40
|
+
...options,
|
|
41
|
+
stream: true,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.Messages = Messages;
|
|
46
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/resources/conversations/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAMlD,uDAAiD;AAEjD,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;OAKG;IACH,MAAM,CACJ,cAAsB,EACtB,IAAyB,EACzB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,qBAAqB,cAAc,WAAW,EAAE;YAC3E,IAAI;YACJ,GAAG,OAAO;YACV,MAAM,EAAE,IAAI;SACb,CAA2D,CAAC;IAC/D,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,cAAsB,EACtB,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qBAAqB,cAAc,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrG,CAAC;IAED;;;;;OAKG;IACH,MAAM,CACJ,cAAsB,EACtB,OAAwC,EAAE,EAC1C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,qBAAqB,cAAc,SAAS,EAAE;YACzE,IAAI;YACJ,GAAG,OAAO;YACV,MAAM,EAAE,IAAI;SACb,CAA2D,CAAC;IAC/D,CAAC;CACF;AAnDD,4BAmDC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
4
|
+
export class Messages extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Send a message to a conversation and get a streaming response.
|
|
7
|
+
*
|
|
8
|
+
* This endpoint sends a message to an existing conversation and streams the
|
|
9
|
+
* agent's response back.
|
|
10
|
+
*/
|
|
11
|
+
create(conversationID, body, options) {
|
|
12
|
+
return this._client.post(path `/v1/conversations/${conversationID}/messages`, {
|
|
13
|
+
body,
|
|
14
|
+
...options,
|
|
15
|
+
stream: true,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* List all messages in a conversation.
|
|
20
|
+
*
|
|
21
|
+
* Returns LettaMessage objects (UserMessage, AssistantMessage, etc.) for all
|
|
22
|
+
* messages in the conversation, ordered by position (oldest first), with support
|
|
23
|
+
* for cursor-based pagination.
|
|
24
|
+
*/
|
|
25
|
+
list(conversationID, query = {}, options) {
|
|
26
|
+
return this._client.get(path `/v1/conversations/${conversationID}/messages`, { query, ...options });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Resume the stream for the most recent active run in a conversation.
|
|
30
|
+
*
|
|
31
|
+
* This endpoint allows you to reconnect to an active background stream for a
|
|
32
|
+
* conversation, enabling recovery from network interruptions.
|
|
33
|
+
*/
|
|
34
|
+
stream(conversationID, body = {}, options) {
|
|
35
|
+
return this._client.post(path `/v1/conversations/${conversationID}/stream`, {
|
|
36
|
+
body,
|
|
37
|
+
...options,
|
|
38
|
+
stream: true,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=messages.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../src/resources/conversations/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAMf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;OAKG;IACH,MAAM,CACJ,cAAsB,EACtB,IAAyB,EACzB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,qBAAqB,cAAc,WAAW,EAAE;YAC3E,IAAI;YACJ,GAAG,OAAO;YACV,MAAM,EAAE,IAAI;SACb,CAA2D,CAAC;IAC/D,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,cAAsB,EACtB,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,qBAAqB,cAAc,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrG,CAAC;IAED;;;;;OAKG;IACH,MAAM,CACJ,cAAsB,EACtB,OAAwC,EAAE,EAC1C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,qBAAqB,cAAc,SAAS,EAAE;YACzE,IAAI;YACJ,GAAG,OAAO;YACV,MAAM,EAAE,IAAI;SACb,CAA2D,CAAC;IAC/D,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.d.mts","sourceRoot":"","sources":["../src/resources/conversations.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../src/resources/conversations.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./conversations/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=conversations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../src/resources/conversations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mEAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.mjs","sourceRoot":"","sources":["../src/resources/conversations.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -164,7 +164,7 @@ export declare namespace MessageUpdateParams {
|
|
|
164
164
|
*/
|
|
165
165
|
content: string;
|
|
166
166
|
/**
|
|
167
|
-
* Body param
|
|
167
|
+
* Body param
|
|
168
168
|
*/
|
|
169
169
|
message_type?: 'system_message';
|
|
170
170
|
}
|
|
@@ -179,7 +179,7 @@ export declare namespace MessageUpdateParams {
|
|
|
179
179
|
*/
|
|
180
180
|
content: Array<MessagesAPI.LettaUserMessageContentUnion> | string;
|
|
181
181
|
/**
|
|
182
|
-
* Body param
|
|
182
|
+
* Body param
|
|
183
183
|
*/
|
|
184
184
|
message_type?: 'user_message';
|
|
185
185
|
}
|
|
@@ -189,11 +189,11 @@ export declare namespace MessageUpdateParams {
|
|
|
189
189
|
*/
|
|
190
190
|
group_id: string;
|
|
191
191
|
/**
|
|
192
|
-
* Body param
|
|
192
|
+
* Body param
|
|
193
193
|
*/
|
|
194
194
|
reasoning: string;
|
|
195
195
|
/**
|
|
196
|
-
* Body param
|
|
196
|
+
* Body param
|
|
197
197
|
*/
|
|
198
198
|
message_type?: 'reasoning_message';
|
|
199
199
|
}
|
|
@@ -208,7 +208,7 @@ export declare namespace MessageUpdateParams {
|
|
|
208
208
|
*/
|
|
209
209
|
content: Array<MessagesAPI.LettaAssistantMessageContentUnion> | string;
|
|
210
210
|
/**
|
|
211
|
-
* Body param
|
|
211
|
+
* Body param
|
|
212
212
|
*/
|
|
213
213
|
message_type?: 'assistant_message';
|
|
214
214
|
}
|
|
@@ -164,7 +164,7 @@ export declare namespace MessageUpdateParams {
|
|
|
164
164
|
*/
|
|
165
165
|
content: string;
|
|
166
166
|
/**
|
|
167
|
-
* Body param
|
|
167
|
+
* Body param
|
|
168
168
|
*/
|
|
169
169
|
message_type?: 'system_message';
|
|
170
170
|
}
|
|
@@ -179,7 +179,7 @@ export declare namespace MessageUpdateParams {
|
|
|
179
179
|
*/
|
|
180
180
|
content: Array<MessagesAPI.LettaUserMessageContentUnion> | string;
|
|
181
181
|
/**
|
|
182
|
-
* Body param
|
|
182
|
+
* Body param
|
|
183
183
|
*/
|
|
184
184
|
message_type?: 'user_message';
|
|
185
185
|
}
|
|
@@ -189,11 +189,11 @@ export declare namespace MessageUpdateParams {
|
|
|
189
189
|
*/
|
|
190
190
|
group_id: string;
|
|
191
191
|
/**
|
|
192
|
-
* Body param
|
|
192
|
+
* Body param
|
|
193
193
|
*/
|
|
194
194
|
reasoning: string;
|
|
195
195
|
/**
|
|
196
|
-
* Body param
|
|
196
|
+
* Body param
|
|
197
197
|
*/
|
|
198
198
|
message_type?: 'reasoning_message';
|
|
199
199
|
}
|
|
@@ -208,7 +208,7 @@ export declare namespace MessageUpdateParams {
|
|
|
208
208
|
*/
|
|
209
209
|
content: Array<MessagesAPI.LettaAssistantMessageContentUnion> | string;
|
|
210
210
|
/**
|
|
211
|
-
* Body param
|
|
211
|
+
* Body param
|
|
212
212
|
*/
|
|
213
213
|
message_type?: 'assistant_message';
|
|
214
214
|
}
|
|
@@ -14,7 +14,7 @@ export interface AgentListParams extends ArrayPageParams {
|
|
|
14
14
|
* Specify which relational fields to include in the response. No relationships are
|
|
15
15
|
* included by default.
|
|
16
16
|
*/
|
|
17
|
-
include?: Array<'agent.blocks' | 'agent.identities' | 'agent.managed_group' | 'agent.secrets' | 'agent.sources' | 'agent.tags' | 'agent.tools'>;
|
|
17
|
+
include?: Array<'agent.blocks' | 'agent.identities' | 'agent.managed_group' | 'agent.pending_approval' | 'agent.secrets' | 'agent.sources' | 'agent.tags' | 'agent.tools'>;
|
|
18
18
|
}
|
|
19
19
|
export declare namespace Agents {
|
|
20
20
|
export { type AgentListParams as AgentListParams };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.mts","sourceRoot":"","sources":["../../src/resources/identities/agents.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,EAAE,oBAAoB,EAAE;OACxB,EAAa,KAAK,eAAe,EAAE,WAAW,EAAE;OAChD,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,IAAI,CACF,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,oBAAoB,EAAE,SAAS,CAAC,UAAU,CAAC;CAO3D;AAED,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CACX,cAAc,GACd,kBAAkB,GAClB,qBAAqB,GACrB,eAAe,GACf,eAAe,GACf,YAAY,GACZ,aAAa,CAChB,CAAC;CACH;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,eAAe,IAAI,eAAe,EAAE,CAAC;CACpD;AAED,OAAO,EAAE,KAAK,oBAAoB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"agents.d.mts","sourceRoot":"","sources":["../../src/resources/identities/agents.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,EAAE,oBAAoB,EAAE;OACxB,EAAa,KAAK,eAAe,EAAE,WAAW,EAAE;OAChD,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,IAAI,CACF,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,oBAAoB,EAAE,SAAS,CAAC,UAAU,CAAC;CAO3D;AAED,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CACX,cAAc,GACd,kBAAkB,GAClB,qBAAqB,GACrB,wBAAwB,GACxB,eAAe,GACf,eAAe,GACf,YAAY,GACZ,aAAa,CAChB,CAAC;CACH;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,eAAe,IAAI,eAAe,EAAE,CAAC;CACpD;AAED,OAAO,EAAE,KAAK,oBAAoB,EAAE,CAAC"}
|