@letta-ai/letta-agent-sdk 0.6.2 → 0.7.0
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/AGENTS.md +42 -0
- package/README.md +101 -1
- package/dist/app-server-session.d.ts.map +1 -1
- package/dist/client-base.d.ts +7 -0
- package/dist/client-base.d.ts.map +1 -1
- package/dist/client-entry.d.ts +3 -0
- package/dist/client-entry.d.ts.map +1 -1
- package/dist/client-entry.js +816 -138
- package/dist/client-entry.js.map +16 -14
- package/dist/cloud-session.d.ts +8 -1
- package/dist/cloud-session.d.ts.map +1 -1
- package/dist/computers.d.ts +67 -0
- package/dist/computers.d.ts.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +817 -139
- package/dist/index.js.map +17 -15
- package/dist/remote-client-session-core.d.ts +13 -16
- package/dist/remote-client-session-core.d.ts.map +1 -1
- package/dist/remote-session-protocol.d.ts +11 -0
- package/dist/remote-session-protocol.d.ts.map +1 -1
- package/dist/remote-turn-coordinator.d.ts +6 -1
- package/dist/remote-turn-coordinator.d.ts.map +1 -1
- package/dist/remote.d.ts +6 -1
- package/dist/remote.d.ts.map +1 -1
- package/dist/transcript-accumulator.d.ts +133 -0
- package/dist/transcript-accumulator.d.ts.map +1 -0
- package/dist/types.d.ts +41 -21
- package/dist/types.d.ts.map +1 -1
- package/dist/validation.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/app-server-session.ts +9 -0
- package/src/client-base.ts +66 -19
- package/src/client-entry.ts +23 -0
- package/src/cloud-session.ts +112 -45
- package/src/computers.ts +132 -0
- package/src/index.ts +24 -0
- package/src/remote-client-session-core.ts +103 -27
- package/src/remote-session-protocol.ts +24 -0
- package/src/remote-turn-coordinator.ts +11 -2
- package/src/remote.ts +41 -12
- package/src/transcript-accumulator.ts +823 -0
- package/src/types.ts +43 -18
- package/src/validation.ts +16 -0
package/AGENTS.md
CHANGED
|
@@ -33,6 +33,48 @@ the selected transport adapter.
|
|
|
33
33
|
Those methods operate at different layers and should not be combined merely
|
|
34
34
|
because they share a name.
|
|
35
35
|
|
|
36
|
+
## Stream identifiers
|
|
37
|
+
|
|
38
|
+
Streamed `SDKMessage` values carry several identifiers, and each one answers a
|
|
39
|
+
different question. Most duplicate or missing message bugs in consumers come
|
|
40
|
+
from using one to answer another's question.
|
|
41
|
+
|
|
42
|
+
- `seqId` answers "have I already processed this stream position?" It is a
|
|
43
|
+
per-run replay cursor: use it to suppress replayed events after a resume or
|
|
44
|
+
reconnect, compare it only within the same `runId`, and reset the threshold
|
|
45
|
+
when a new run starts. It is not row identity.
|
|
46
|
+
- `otid` answers "which typed message slice is this?" Use it to reassemble the
|
|
47
|
+
fragments of one slice. It is not a universal key across message types.
|
|
48
|
+
- `uuid` answers "which message object is this?" Use it for message identity
|
|
49
|
+
and for history cursoring and backfill. It is the top-level message ID when
|
|
50
|
+
the stream provides one and an SDK-generated identifier otherwise, so it is
|
|
51
|
+
neither a guaranteed server ID nor a replay cursor.
|
|
52
|
+
- `toolCallId` answers "which tool call is this about?" Use it to join a
|
|
53
|
+
`tool_call` with its `tool_result`. It is not identity for assistant or
|
|
54
|
+
reasoning messages.
|
|
55
|
+
|
|
56
|
+
Only `assistant` and `reasoning` carry `otid` and `seqId`; `tool_call` and
|
|
57
|
+
`tool_result` carry `toolCallId` and `uuid`. Identity therefore has to be
|
|
58
|
+
decided per message family. A single generic `seqId → otid → uuid` fallback
|
|
59
|
+
chain applied to every message will merge unrelated rows.
|
|
60
|
+
|
|
61
|
+
- Key `assistant` and `reasoning` accumulators on the message type together
|
|
62
|
+
with `otid`, not on `otid` alone. A provider can reuse an `otid` across
|
|
63
|
+
kinds, which collapses assistant text into reasoning. Fall back to `uuid`
|
|
64
|
+
only within the same family — `src/tests/stream-message-identity.test.ts`
|
|
65
|
+
pins the case where two slices share a `uuid` and differ only by type and
|
|
66
|
+
`otid`.
|
|
67
|
+
- Merge tool arguments and results by `toolCallId`, but do not flatten every
|
|
68
|
+
tool-family message onto it. Envelope identity and tool-payload identity are
|
|
69
|
+
distinct.
|
|
70
|
+
- Do not merge persisted history into a transcript while a turn is streaming.
|
|
71
|
+
When backfill after a reconnect is unavoidable, rebase the in-progress
|
|
72
|
+
accumulators onto the fetched rows; otherwise later fragments append to a
|
|
73
|
+
stale baseline and the row renders twice.
|
|
74
|
+
- Mid-stream, `tool_call.toolInput` is `{ raw: "<chunk>" }` until the argument
|
|
75
|
+
fragments parse as JSON. Accumulate `rawArguments` and parse once at the end
|
|
76
|
+
rather than overwriting parsed arguments with a partial wrapper.
|
|
77
|
+
|
|
36
78
|
## Cloud API ownership
|
|
37
79
|
|
|
38
80
|
- `@letta-ai/letta-code` owns the agent harness, app-server protocol, runtime
|
package/README.md
CHANGED
|
@@ -54,6 +54,34 @@ An agent is the persistent entity with memory. A conversation is a thread on tha
|
|
|
54
54
|
- `resumeSession(conversationId)` resumes a saved conversation.
|
|
55
55
|
- `resumeSession(agentId)` resumes the agent's default conversation.
|
|
56
56
|
|
|
57
|
+
Pass your own OTID when you render the user message optimistically, so you can
|
|
58
|
+
match the row you drew with the persisted one:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
const otid = crypto.randomUUID();
|
|
62
|
+
await session.send("Summarize today's changes.", { otid });
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The OTID is stored on the persisted user message (visible via `listMessages()`)
|
|
66
|
+
and doubles as the turn's `clientMessageId`, so it also identifies the message
|
|
67
|
+
in `queue_update` events while it is queued. The SDK generates one when the
|
|
68
|
+
option is omitted.
|
|
69
|
+
|
|
70
|
+
Pass `stateless: true` when a session should use an existing agent without
|
|
71
|
+
loading or changing its MemFS:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
await using session = client.createSession(agentId, { stateless: true });
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The agent and conversation still persist. Stateless sessions preserve the
|
|
78
|
+
agent's model, prompt, tools, tags, and sampling settings, but skip MemFS sync,
|
|
79
|
+
agent-scoped skills and mods, memory transcript writes, and reflection for that
|
|
80
|
+
session. Options that mutate persisted configuration (`model`,
|
|
81
|
+
`reasoningEffort`, `dreaming`, and `resources`) are rejected, as is
|
|
82
|
+
`session.updateModel()`. The option works with local, remote App Server, and
|
|
83
|
+
Cloud backends.
|
|
84
|
+
|
|
57
85
|
Portable sessions also expose the stateful controls needed by interactive
|
|
58
86
|
clients:
|
|
59
87
|
|
|
@@ -100,6 +128,41 @@ cached before the app was backgrounded. Pending approval request IDs are for
|
|
|
100
128
|
correlation; decisions continue through `recoverPendingApprovals()` and the
|
|
101
129
|
session's `canUseTool` callback.
|
|
102
130
|
|
|
131
|
+
## Rendering a transcript
|
|
132
|
+
|
|
133
|
+
`session.stream()` emits message slices, not rows. Reconciling them into a
|
|
134
|
+
conversation view means merging text fragments by message family and `otid`,
|
|
135
|
+
dropping replayed `seqId` positions per run, and merging tool arguments and
|
|
136
|
+
results by `toolCallId`. `createTranscriptAccumulator()` does that for you and
|
|
137
|
+
is available from the package root and `/client`:
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
import { createTranscriptAccumulator } from "@letta-ai/letta-agent-sdk";
|
|
141
|
+
|
|
142
|
+
const transcript = createTranscriptAccumulator();
|
|
143
|
+
|
|
144
|
+
await session.send("Summarize the repo");
|
|
145
|
+
for await (const message of session.stream()) {
|
|
146
|
+
const rows = transcript.apply(message);
|
|
147
|
+
render(rows); // TranscriptRow[]: user | assistant | reasoning | tool_call
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Safe mid-run: merge older history without duplicating in-flight rows.
|
|
151
|
+
transcript.rebase(await session.listMessages({ limit: 50 }));
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Each row carries a stable `key` for list rendering, plus the identifiers it was
|
|
155
|
+
reconciled from (`uuid`, `otid`, `runId`, `seqId`). Tool rows expose the payload
|
|
156
|
+
identity (`toolCallId`) separately from the envelopes that produced them, along
|
|
157
|
+
with `argumentsComplete` and a `status` of `streaming`, `ready`, or `complete`,
|
|
158
|
+
so a partially streamed argument object is never rendered as final input.
|
|
159
|
+
|
|
160
|
+
`apply()` returns the same array reference when a message changed nothing (a
|
|
161
|
+
replayed position, or a turn-level message such as `result`), so memoized
|
|
162
|
+
renderers can skip the update. Turn-level messages (`init`, `result`, `error`,
|
|
163
|
+
`retry`, `queue_update`, `loop_status`) are not transcript rows; handle them
|
|
164
|
+
directly.
|
|
165
|
+
|
|
103
166
|
## Deployment options
|
|
104
167
|
|
|
105
168
|
| Backend | Agent state | Tool execution |
|
|
@@ -108,6 +171,38 @@ session's `canUseTool` callback.
|
|
|
108
171
|
| `local` | Current computer | Current computer through an SDK-managed App Server |
|
|
109
172
|
| `remote` | Configured by the App Server | A user-managed App Server computer |
|
|
110
173
|
|
|
174
|
+
### Choose a computer
|
|
175
|
+
|
|
176
|
+
Cloud clients can list the computers registered with the current Letta account
|
|
177
|
+
and select one by name when opening a session:
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
const { computers } = await client.computers.list({ onlineOnly: true });
|
|
181
|
+
for (const computer of computers) {
|
|
182
|
+
console.log(computer.name, computer.deviceId, computer.status);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
await using session = client.resumeSession(agentId, {
|
|
186
|
+
computer: "Work laptop",
|
|
187
|
+
});
|
|
188
|
+
await session.send("Run the test suite on this computer.");
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Computer names must uniquely identify a registered computer. For persisted
|
|
192
|
+
selections, use the stable `deviceId`; a `connectionId` identifies only the
|
|
193
|
+
current online lease and can rotate after reconnects:
|
|
194
|
+
|
|
195
|
+
```ts
|
|
196
|
+
await using session = client.resumeSession(agentId, {
|
|
197
|
+
computer: { deviceId: "device-..." },
|
|
198
|
+
});
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
`client.computers.get(deviceId)` retrieves one computer and
|
|
202
|
+
`client.computers.resolve(selector)` resolves a name or ID to its current online
|
|
203
|
+
connection. The previous client-level and session-level `environment` options
|
|
204
|
+
remain as deprecated compatibility aliases for `computer`.
|
|
205
|
+
|
|
111
206
|
### Local
|
|
112
207
|
|
|
113
208
|
```ts
|
|
@@ -126,6 +221,10 @@ Use `toolset` to select a request-scoped harness preset and add bundled client
|
|
|
126
221
|
tools. `allowedTools` remains the final visibility boundary across bundled and
|
|
127
222
|
custom tools.
|
|
128
223
|
|
|
224
|
+
Both are scoped to locally executed client tools. Server-side tools (such as
|
|
225
|
+
`web_search`) are attached to the agent itself via `baseTools` at creation and
|
|
226
|
+
are unaffected by `allowedTools` — listing one there matches nothing.
|
|
227
|
+
|
|
129
228
|
```ts
|
|
130
229
|
await using session = client.createSession(agentId, {
|
|
131
230
|
toolset: {
|
|
@@ -227,7 +326,7 @@ For authenticated Remote App Servers in React Native, pass the platform WebSocke
|
|
|
227
326
|
|
|
228
327
|
## Management APIs
|
|
229
328
|
|
|
230
|
-
The client exposes agent, conversation, model, and Cloud repository management alongside active sessions:
|
|
329
|
+
The client exposes agent, conversation, model, computer, and Cloud repository management alongside active sessions:
|
|
231
330
|
|
|
232
331
|
```ts
|
|
233
332
|
const agents = await client.agents.list({ tags: ["support"] });
|
|
@@ -274,6 +373,7 @@ remains changed; retrying is safe. See [Cloud repositories](https://docs.letta.c
|
|
|
274
373
|
- [Quickstart](https://docs.letta.com/letta-agent-sdk/quickstart)
|
|
275
374
|
- [Deployment](https://docs.letta.com/letta-agent-sdk/deployment)
|
|
276
375
|
- [SDK reference](https://docs.letta.com/letta-agent-sdk/reference)
|
|
376
|
+
- [React chat template](https://github.com/letta-ai/letta-agent-sdk-react-chat)
|
|
277
377
|
- [Examples](./examples)
|
|
278
378
|
|
|
279
379
|
---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-server-session.d.ts","sourceRoot":"","sources":["../src/app-server-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,gCAAgC,EAEt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E,8BAAmC,GAC3C,OAAO,CAAC,6BAA6B,CAAC;IAqBnC,YAAY,CAChB,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC;IAwC9B,KAAK,IAAI,IAAI;CAGd;AAED,qBAAa,gBAAiB,SAAQ,uBAAuB;IASzD,OAAO,CAAC,QAAQ,CAAC,aAAa;IARhC,OAAO,CAAC,eAAe,CAAkC;IACzD,OAAO,CAAC,aAAa,CAAmC;IACxD,OAAO,CAAC,SAAS,CAA8B;IAC/C,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,yBAAyB,CAA6B;IAC9D,OAAO,CAAC,2BAA2B,CAA6B;gBAG7C,aAAa,EAAE,uBAAuB,EACvD,IAAI,EAAE,oBAAoB;cAYT,iBAAiB,CAAC,OAAO,EAAE,6BAA6B,GAAG,kBAAkB,GAAG,OAAO;cAKjF,2BAA2B,IAAI,OAAO,CAAC,kBAAkB,CAAC;cAqFhE,WAAW,IAAI,IAAI;cAUb,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxD,OAAO,CAAC,cAAc;YAOR,mBAAmB;YAenB,YAAY;YAOZ,wBAAwB;YAqExB,0BAA0B;CAqBzC"}
|
package/dist/client-base.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RepositoriesClient } from "./repositories.js";
|
|
2
|
+
import { type ComputerSelector, type ComputersClient } from "./computers.js";
|
|
2
3
|
import { type ManagementTransport } from "./management.js";
|
|
3
4
|
import type { AgentsClient, ConversationsClient, ModelsClient } from "./management-types.js";
|
|
4
5
|
import type { CreateAgentOptions, LettaCodeBackend, LettaCodeClientOptions, LettaCodeClientSessionOptions, LettaCodeEnvironment, LettaCodeSession, SDKResultMessage, SendMessage } from "./types.js";
|
|
@@ -14,12 +15,15 @@ import type { CreateAgentOptions, LettaCodeBackend, LettaCodeClientOptions, Lett
|
|
|
14
15
|
*/
|
|
15
16
|
export declare class LettaAgentClientBase {
|
|
16
17
|
readonly backend: LettaCodeBackend;
|
|
18
|
+
readonly computer: ComputerSelector | undefined;
|
|
19
|
+
/** @deprecated Use `computer`. */
|
|
17
20
|
readonly environment: LettaCodeEnvironment | undefined;
|
|
18
21
|
readonly agents: AgentsClient;
|
|
19
22
|
readonly conversations: ConversationsClient;
|
|
20
23
|
readonly models: ModelsClient;
|
|
21
24
|
protected readonly options: LettaCodeClientOptions;
|
|
22
25
|
private repositoriesClient;
|
|
26
|
+
private computersClient;
|
|
23
27
|
private agentRepositoriesClient;
|
|
24
28
|
private cloudClient;
|
|
25
29
|
private managementTransport;
|
|
@@ -31,6 +35,8 @@ export declare class LettaAgentClientBase {
|
|
|
31
35
|
* it belongs to the client/session execution context.
|
|
32
36
|
*/
|
|
33
37
|
get repositories(): RepositoriesClient;
|
|
38
|
+
/** Discover and resolve computers registered with this Letta Cloud account. */
|
|
39
|
+
get computers(): ComputersClient;
|
|
34
40
|
createAgent(options?: CreateAgentOptions): Promise<string>;
|
|
35
41
|
/**
|
|
36
42
|
* Create a new conversation/session.
|
|
@@ -58,6 +64,7 @@ export declare class LettaAgentClientBase {
|
|
|
58
64
|
protected createLocalManagementTransport(): ManagementTransport;
|
|
59
65
|
private remoteOptions;
|
|
60
66
|
private appServerSessionOptions;
|
|
67
|
+
private getComputersClient;
|
|
61
68
|
private getRepositoriesClient;
|
|
62
69
|
private getAgentRepositoriesClient;
|
|
63
70
|
private getCloudManagementTransport;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-base.d.ts","sourceRoot":"","sources":["../src/client-base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"client-base.d.ts","sourceRoot":"","sources":["../src/client-base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AASvD,OAAO,EAEL,KAAK,gBAAgB,EACrB,KA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G;IACH,aAAa,CACX,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,6BAAkC,GAC1C,gBAAgB;IA8CnB;;;OAGG;IACG,MAAM,CACV,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,gBAAgB,CAAC;IAU5B,OAAO,CAAC,oBAAoB;IA6F5B,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzE,SAAS,CAAC,kBAAkB,CAC1B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,6BAA6B,GACtC,gBAAgB;IAInB,SAAS,CAAC,kBAAkB,CAC1B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,6BAA6B,GACtC,gBAAgB;IAInB,SAAS,CAAC,4BAA4B,IAAI,KAAK;IAM/C,SAAS,CAAC,8BAA8B,IAAI,mBAAmB;IAI/D,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,0BAA0B;IAYlC,OAAO,CAAC,2BAA2B;IAQnC,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,sBAAsB;IAgB9B,OAAO,CAAC,YAAY;CAMrB"}
|
package/dist/client-entry.d.ts
CHANGED
|
@@ -12,8 +12,11 @@ export declare class LettaAgentClient extends LettaAgentClientBase {
|
|
|
12
12
|
}
|
|
13
13
|
export { CloudManagedSandboxExpiredError } from "./cloud-session.js";
|
|
14
14
|
export { RepositoriesClient } from "./repositories.js";
|
|
15
|
+
export type { Computer, ComputerMetadata, ComputerSelector, ComputersClient, ListComputersOptions, ListComputersResult, ResolvedComputer, } from "./computers.js";
|
|
15
16
|
export type * from "./management-types.js";
|
|
16
17
|
export { extractStreamTextDelta } from "./stream-events.js";
|
|
18
|
+
export { createTranscriptAccumulator } from "./transcript-accumulator.js";
|
|
19
|
+
export type { TranscriptAccumulator, TranscriptHistoryPage, TranscriptRebaseOptions, TranscriptRow, TranscriptRowIdentity, TranscriptRowKind, TranscriptTextKind, TranscriptTextRow, TranscriptToolCallRow, TranscriptToolCallStatus, TranscriptToolResult, } from "./transcript-accumulator.js";
|
|
17
20
|
export { createReactNativeWebSocketConstructor } from "./websocket.js";
|
|
18
21
|
export type * from "./types.js";
|
|
19
22
|
//# sourceMappingURL=client-entry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-entry.d.ts","sourceRoot":"","sources":["../src/client-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EACV,2BAA2B,EAC3B,4BAA4B,EAC7B,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,+BAA+B,GACvC,4BAA4B,GAC5B,2BAA2B,CAAC;AAEhC;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,oBAAoB;gBAC5C,OAAO,EAAE,+BAA+B;CAMrD;AAED,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,mBAAmB,uBAAuB,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,qCAAqC,EAAE,MAAM,gBAAgB,CAAC;AACvE,mBAAmB,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"client-entry.d.ts","sourceRoot":"","sources":["../src/client-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EACV,2BAA2B,EAC3B,4BAA4B,EAC7B,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,+BAA+B,GACvC,4BAA4B,GAC5B,2BAA2B,CAAC;AAEhC;;;;;GA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