@letta-ai/letta-agent-sdk 0.3.3 → 0.5.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 +0 -3
- package/README.md +12 -0
- package/dist/app-server-management.d.ts +3 -48
- package/dist/app-server-management.d.ts.map +1 -1
- package/dist/app-server-session.d.ts +0 -6
- package/dist/app-server-session.d.ts.map +1 -1
- package/dist/client-base.d.ts +7 -15
- package/dist/client-base.d.ts.map +1 -1
- package/dist/client-entry.js +369 -468
- package/dist/client-entry.js.map +13 -12
- package/dist/client.d.ts +3 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/cloud-session.d.ts.map +1 -1
- package/dist/cloud-status-transport.d.ts +53 -0
- package/dist/cloud-status-transport.d.ts.map +1 -0
- package/dist/index.d.ts +7 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +896 -2019
- package/dist/index.js.map +18 -18
- package/dist/local-app-server-session.d.ts +1 -1
- package/dist/local-app-server-session.d.ts.map +1 -1
- package/dist/local-app-server.d.ts +11 -0
- package/dist/local-app-server.d.ts.map +1 -1
- package/dist/management.d.ts +0 -7
- package/dist/management.d.ts.map +1 -1
- package/dist/remote-session-protocol.d.ts +2 -0
- package/dist/remote-session-protocol.d.ts.map +1 -1
- package/dist/remote-turn-coordinator.d.ts.map +1 -1
- package/dist/types.d.ts +57 -66
- 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-management.ts +20 -256
- package/src/app-server-session.ts +0 -32
- package/src/client-base.ts +47 -73
- package/src/client.ts +31 -70
- package/src/cloud-session.ts +9 -267
- package/src/cloud-status-transport.ts +305 -0
- package/src/index.ts +11 -29
- package/src/local-app-server-session.ts +13 -3
- package/src/local-app-server.ts +97 -3
- package/src/management.ts +0 -7
- package/src/remote-session-protocol.ts +14 -0
- package/src/remote-turn-coordinator.ts +20 -2
- package/src/types.ts +64 -111
- package/src/validation.ts +21 -6
- package/dist/protocol.d.ts +0 -205
- package/dist/protocol.d.ts.map +0 -1
- package/dist/session.d.ts +0 -155
- package/dist/session.d.ts.map +0 -1
- package/dist/transport.d.ts +0 -53
- package/dist/transport.d.ts.map +0 -1
- package/src/protocol.ts +0 -249
- package/src/session.ts +0 -1638
- package/src/transport.ts +0 -484
package/AGENTS.md
CHANGED
|
@@ -20,9 +20,6 @@ that Bun placed in one file; trace it back to `src/` before changing it.
|
|
|
20
20
|
controller used by the portable session core.
|
|
21
21
|
- `cloud-session.ts` resolves Cloud runtimes and managed sandboxes, then uses
|
|
22
22
|
the same runtime controller and portable session core.
|
|
23
|
-
- `session.ts` is the separate legacy stdio implementation used only when
|
|
24
|
-
`transport: "stdio"` is selected and by the historical agent-less
|
|
25
|
-
`createSession()` helper.
|
|
26
23
|
- `types.ts` defines the stable public SDK surface. Internal protocol types
|
|
27
24
|
belong beside their implementation rather than in the public type barrel.
|
|
28
25
|
|
package/README.md
CHANGED
|
@@ -10,6 +10,12 @@ Build applications with stateful agents powered by the [Letta agent harness](htt
|
|
|
10
10
|
npm install @letta-ai/letta-agent-sdk
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
The `0.4.x` SDK line requires the matching single-socket
|
|
14
|
+
`@letta-ai/letta-code` app-server release. Release `letta-code` first, then
|
|
15
|
+
replace the SDK's package dependency with that published version before
|
|
16
|
+
publishing `0.4.0`; the development branch intentionally does not name an
|
|
17
|
+
unpublished package version.
|
|
18
|
+
|
|
13
19
|
Local execution requires Node.js 22.19 or newer.
|
|
14
20
|
|
|
15
21
|
## Quick start
|
|
@@ -38,6 +44,12 @@ for await (const message of session.stream()) {
|
|
|
38
44
|
}
|
|
39
45
|
```
|
|
40
46
|
|
|
47
|
+
Assistant and reasoning messages are incremental text fragments. Reconcile
|
|
48
|
+
fragments by `type` and `otid` when `otid` is available; `uuid` is a legacy
|
|
49
|
+
transport identifier and is not a portable lineage key. After reconnecting,
|
|
50
|
+
use `(runId, seqId)` to suppress replayed fragments. Sequence IDs are scoped to
|
|
51
|
+
their run and must not be compared across runs.
|
|
52
|
+
|
|
41
53
|
An agent is the persistent entity with memory. A conversation is a thread on that agent. A session is the active connection used to send messages, stream events, execute tools, and handle approvals.
|
|
42
54
|
|
|
43
55
|
- `createSession(agentId)` starts a new conversation.
|
|
@@ -8,51 +8,18 @@ type OwnedConnection = {
|
|
|
8
8
|
export type AppServerManagementOptions = Partial<LettaCodeRemoteClientOptions> & {
|
|
9
9
|
url?: string;
|
|
10
10
|
connect?: () => Promise<OwnedConnection>;
|
|
11
|
-
/**
|
|
12
|
-
* How long (in milliseconds) an idle control connection lingers before it
|
|
13
|
-
* is released. Defaults to {@link DEFAULT_IDLE_LINGER_MS}.
|
|
14
|
-
*/
|
|
15
|
-
idleLingerMs?: number;
|
|
16
11
|
};
|
|
17
|
-
/**
|
|
18
|
-
* Wait for every management transport targeting this app-server to release
|
|
19
|
-
* its control connection. The registry is process-wide so a session created
|
|
20
|
-
* by a different `LettaAgentClient` instance can still take the server's
|
|
21
|
-
* single control slot safely.
|
|
22
|
-
*/
|
|
23
|
-
export declare function releaseAppServerManagementConnections(url: string): Promise<void>;
|
|
24
12
|
/**
|
|
25
13
|
* Management transport that speaks the app-server control protocol.
|
|
26
14
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* `"control channel already connected"` (see letta-ai/letta-code
|
|
31
|
-
* `src/websocket/app-server.ts`). Sessions (`AppServerSession`) need that same
|
|
32
|
-
* control slot, so a management transport that holds an idle connection
|
|
33
|
-
* starves any later `resumeSession()`/`createSession()` from the same process
|
|
34
|
-
* (live-reproduced in the letta-mobile reference app, SDK-FEEDBACK.md #00).
|
|
35
|
-
*
|
|
36
|
-
* To stay out of the way, this transport pools a single lazily-connected
|
|
37
|
-
* client while requests are in flight (bursts share one connection and one
|
|
38
|
-
* request-id counter, so responses correlate correctly), then releases the
|
|
39
|
-
* connection shortly after it goes idle ({@link DEFAULT_IDLE_LINGER_MS}) and
|
|
40
|
-
* reconnects lazily on the next request. Before a session connects, all
|
|
41
|
-
* management transports registered for the same app-server URL relinquish
|
|
42
|
-
* their connections; the handoff waits for in-flight work and for the control
|
|
43
|
-
* socket's close event. The inverse contention — a management request issued
|
|
44
|
-
* while a session holds the control slot — cannot be solved client-side and
|
|
45
|
-
* still fails until the app-server allows multiple control clients.
|
|
15
|
+
* The app-server assigns every client an independent connection, so management
|
|
16
|
+
* keeps one lazy pooled client while sessions connect alongside it. Unexpected
|
|
17
|
+
* disconnects discard the pool and the next management request reconnects.
|
|
46
18
|
*/
|
|
47
19
|
export declare class AppServerManagementTransport implements ManagementTransport {
|
|
48
20
|
private readonly options;
|
|
49
21
|
private connectionPromise;
|
|
50
|
-
private releasePromise;
|
|
51
22
|
private closingConnections;
|
|
52
|
-
private inFlightRequests;
|
|
53
|
-
private idleWaiters;
|
|
54
|
-
private idleTimer;
|
|
55
|
-
private readonly idleLingerMs;
|
|
56
23
|
constructor(options: AppServerManagementOptions);
|
|
57
24
|
listAgents(query: ManagementQuery): Promise<LettaAgent[]>;
|
|
58
25
|
retrieveAgent(agentId: string): Promise<LettaAgent>;
|
|
@@ -64,23 +31,11 @@ export declare class AppServerManagementTransport implements ManagementTransport
|
|
|
64
31
|
createConversation(body: Record<string, unknown>): Promise<LettaConversation>;
|
|
65
32
|
updateConversation(conversationId: string, body: Record<string, unknown>): Promise<LettaConversation>;
|
|
66
33
|
listConversationMessages(conversationId: string, query: ManagementQuery): Promise<ConversationMessagesResult>;
|
|
67
|
-
/**
|
|
68
|
-
* Release the pooled control connection instead of waiting out the idle
|
|
69
|
-
* linger. If requests are in flight, wait for them to settle first.
|
|
70
|
-
*
|
|
71
|
-
* The app-server accepts a single control client (see the class docs), so
|
|
72
|
-
* This is called before opening a session to hand the control slot over
|
|
73
|
-
* without a linger-sized or socket-close race window.
|
|
74
|
-
*/
|
|
75
|
-
releaseIdleConnection(): Promise<void>;
|
|
76
34
|
private request;
|
|
77
|
-
private releaseConnectionWhenIdle;
|
|
78
35
|
private acquireConnection;
|
|
79
36
|
private openConnection;
|
|
80
37
|
private discardConnection;
|
|
81
38
|
private trackClosingConnection;
|
|
82
|
-
private scheduleIdleRelease;
|
|
83
|
-
private clearIdleTimer;
|
|
84
39
|
}
|
|
85
40
|
export {};
|
|
86
41
|
//# sourceMappingURL=app-server-management.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-server-management.d.ts","sourceRoot":"","sources":["../src/app-server-management.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-server-management.d.ts","sourceRoot":"","sources":["../src/app-server-management.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACV,0BAA0B,EAC1B,UAAU,EACV,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAEV,4BAA4B,EAC5B,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,KAAK,eAAe,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,IAAI,IAAI,CAAA;CAAE,CAAC;AAkCtD,MAAM,MAAM,0BAA0B,GACpC,OAAO,CAAC,4BAA4B,CAAC,GAAG;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;CAC1C,CAAC;AAoDJ;;;;;;GAMG;AACH,qBAAa,4BACX,YAAW,mBAAmB;IAKlB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,OAAO,CAAC,iBAAiB,CAA0C;IACnE,OAAO,CAAC,kBAAkB,CAA4B;gBAEzB,OAAO,EAAE,0BAA0B;IAE1D,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAYzD,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAanD,WAAW,CACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,UAAU,CAAC;IAahB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW3C,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;IA0BvC,iBAAiB,CACrB,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAYzB,oBAAoB,CACxB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,iBAAiB,CAAC;IAavB,kBAAkB,CACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,iBAAiB,CAAC;IAavB,kBAAkB,CACtB,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,iBAAiB,CAAC;IAavB,wBAAwB,CAC5B,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,0BAA0B,CAAC;YAgBxB,OAAO;IAwBrB,OAAO,CAAC,iBAAiB;YAsBX,cAAc;IA+C5B,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,sBAAsB;CAW/B"}
|
|
@@ -17,16 +17,10 @@ export type AppServerSessionOptions = Partial<LettaCodeRemoteClientOptions> & {
|
|
|
17
17
|
url: string;
|
|
18
18
|
close(): void;
|
|
19
19
|
}>;
|
|
20
|
-
/**
|
|
21
|
-
* Internal handoff hook used to release a management connection owned by
|
|
22
|
-
* the same SDK client before this session opens its control socket.
|
|
23
|
-
*/
|
|
24
|
-
beforeConnect?: () => Promise<void>;
|
|
25
20
|
/** Whether SDK create-agent payloads should add the origin tag automatically. */
|
|
26
21
|
includeSdkOriginTag?: boolean;
|
|
27
22
|
};
|
|
28
23
|
export type AppServerSessionMode = RuntimeSessionMode;
|
|
29
|
-
export declare function assertRemoteSessionOptionsSupported(action: string, options: LettaCodeClientSessionOptions): void;
|
|
30
24
|
export declare function createAgentBody(options: CreateAgentOptions, settings?: {
|
|
31
25
|
includeSdkOriginTag?: boolean;
|
|
32
26
|
}): Promise<Record<string, unknown>>;
|
|
@@ -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,EAEtC,MAAM,wCAAwC,CAAC;
|
|
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,EAEtC,MAAM,wCAAwC,CAAC;AAahD,OAAO,EACL,uBAAuB,EAKvB,KAAK,eAAe,EACpB,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,EAC5B,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAElB,8BAA8B,EAC9B,6BAA6B,EAC7B,WAAW,EACX,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAoDpB,KAAK,kBAAkB,GAAG;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAIF,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAChD,MAAM,EAAE,GAAG,SAAS,CAStB;AAED,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,4BAA4B,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,GACtF,OAAO,CAAC,eAAe,CAAC;IAYrB,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;IASvC,WAAW,CACf,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC;IAYvB,uBAAuB,CAC3B,OAAO,EAAE,YAAY,EACrB,OAAO,GAAE,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;IAOzD,OAAO,CAAC,QAAQ,CAAC,aAAa;IANhC,OAAO,CAAC,eAAe,CAAkC;IACzD,OAAO,CAAC,aAAa,CAAmC;IACxD,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;cA0DhE,WAAW,IAAI,IAAI;YASxB,mBAAmB;YAenB,YAAY;YAMZ,wBAAwB;YAiExB,0BAA0B;CAoBzC"}
|
package/dist/client-base.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { RepositoriesClient } from "./repositories.js";
|
|
2
2
|
import { type ManagementTransport } from "./management.js";
|
|
3
3
|
import type { AgentsClient, ConversationsClient, ModelsClient } from "./management-types.js";
|
|
4
|
-
import type { CreateAgentOptions,
|
|
4
|
+
import type { CreateAgentOptions, LettaCodeBackend, LettaCodeClientOptions, LettaCodeClientSessionOptions, LettaCodeEnvironment, LettaCodeSession, SDKResultMessage, SendMessage } from "./types.js";
|
|
5
5
|
/**
|
|
6
6
|
* Top-level Letta Agent SDK client.
|
|
7
7
|
*
|
|
8
8
|
* `backend` selects how the SDK reaches or runs the Letta Code harness.
|
|
9
9
|
* `local` spawns an SDK-owned Letta Code app-server and speaks the websocket
|
|
10
|
-
* protocol
|
|
10
|
+
* protocol.
|
|
11
11
|
* `remote` connects to a user-managed Letta Code app-server websocket endpoint.
|
|
12
12
|
* `cloud` uses agents hosted on Letta Cloud, with an explicit remote
|
|
13
13
|
* environment or SDK-managed sandbox.
|
|
@@ -33,10 +33,9 @@ export declare class LettaAgentClientBase {
|
|
|
33
33
|
/**
|
|
34
34
|
* Create a new conversation/session.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
* top-level createSession() helper.
|
|
36
|
+
* The app-server protocol requires an explicit agent id.
|
|
38
37
|
*/
|
|
39
|
-
createSession(
|
|
38
|
+
createSession(agentId: string, options?: LettaCodeClientSessionOptions): LettaCodeSession;
|
|
40
39
|
/**
|
|
41
40
|
* Resume an existing agent default conversation or a specific conversation.
|
|
42
41
|
*
|
|
@@ -45,23 +44,16 @@ export declare class LettaAgentClientBase {
|
|
|
45
44
|
*/
|
|
46
45
|
resumeSession(id: string, options?: LettaCodeClientSessionOptions): LettaCodeSession;
|
|
47
46
|
/** One-shot prompt convenience helper using a new conversation. */
|
|
48
|
-
prompt(message: SendMessage, agentId
|
|
47
|
+
prompt(message: SendMessage, agentId: string, options?: LettaCodeClientSessionOptions): Promise<SDKResultMessage>;
|
|
49
48
|
private assertSessionBackend;
|
|
50
|
-
protected useLegacyLocalStdio(): boolean;
|
|
51
49
|
protected createLocalAgent(_options: CreateAgentOptions): Promise<string>;
|
|
52
|
-
protected createLocalSession(_agentId: string
|
|
53
|
-
protected resumeLocalSession(_id: string, _options: LettaCodeClientSessionOptions
|
|
50
|
+
protected createLocalSession(_agentId: string, _options: LettaCodeClientSessionOptions): LettaCodeSession;
|
|
51
|
+
protected resumeLocalSession(_id: string, _options: LettaCodeClientSessionOptions): LettaCodeSession;
|
|
54
52
|
protected localBackendUnavailableError(): Error;
|
|
55
53
|
protected createLocalManagementTransport(): ManagementTransport;
|
|
56
54
|
private remoteOptions;
|
|
57
55
|
private appServerSessionOptions;
|
|
58
56
|
private getRepositoriesClient;
|
|
59
|
-
/**
|
|
60
|
-
* The app-server accepts a single control client at a time. Before a session
|
|
61
|
-
* connects, wait for this client's management work to settle and relinquish
|
|
62
|
-
* its pooled connection; management reconnects lazily on its next call.
|
|
63
|
-
*/
|
|
64
|
-
protected releaseIdleManagementConnection(): Promise<void>;
|
|
65
57
|
private getManagementTransport;
|
|
66
58
|
private cloudOptions;
|
|
67
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-base.d.ts","sourceRoot":"","sources":["../src/client-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"client-base.d.ts","sourceRoot":"","sources":["../src/client-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAavD,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,kBAAkB,EAElB,gBAAgB,EAChB,sBAAsB,EACtB,6BAA6B,EAC7B,oBAAoB,EAIpB,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACZ,MAAM,YAAY,CAAC;AAmDpB;;;;;;;;;GASG;AACH,qBAAa,oBAAoB;IAC/B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,oBAAoB,GAAG,SAAS,CAAC;IACvD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;IAC5C,QAAQ,CAAC,MAAM,E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