@letta-ai/letta-agent-sdk 0.3.0 → 0.3.2
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/README.md +29 -1
- package/dist/app-server-management.d.ts +61 -1
- package/dist/app-server-management.d.ts.map +1 -1
- package/dist/app-server-session.d.ts +7 -4
- package/dist/app-server-session.d.ts.map +1 -1
- package/dist/client-base.d.ts +9 -1
- package/dist/client-base.d.ts.map +1 -1
- package/dist/client-entry.js +677 -61
- package/dist/client-entry.js.map +12 -11
- package/dist/client.d.ts.map +1 -1
- package/dist/cloud-management.d.ts +3 -1
- package/dist/cloud-management.d.ts.map +1 -1
- package/dist/cloud-session.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +733 -71
- package/dist/index.js.map +16 -15
- package/dist/interactiveToolPolicy.d.ts +7 -0
- package/dist/interactiveToolPolicy.d.ts.map +1 -1
- package/dist/local-app-server-session.d.ts +1 -1
- package/dist/local-app-server-session.d.ts.map +1 -1
- package/dist/management-types.d.ts +11 -1
- package/dist/management-types.d.ts.map +1 -1
- package/dist/management.d.ts +12 -1
- package/dist/management.d.ts.map +1 -1
- package/dist/remote-client-session-core.d.ts +24 -1
- package/dist/remote-client-session-core.d.ts.map +1 -1
- package/dist/request-ids.d.ts +24 -0
- package/dist/request-ids.d.ts.map +1 -0
- package/dist/session.d.ts +13 -2
- package/dist/session.d.ts.map +1 -1
- package/dist/types.d.ts +133 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,6 +67,29 @@ await session.recoverPendingApprovals();
|
|
|
67
67
|
`changeDeviceState()` currently confirms command transport only because the
|
|
68
68
|
underlying protocol does not acknowledge that mutation.
|
|
69
69
|
|
|
70
|
+
The read side of the device state is exposed as a one-shot getter and a
|
|
71
|
+
subscription — enough to restore permission-mode UI and re-surface pending
|
|
72
|
+
approvals when a mobile or web client returns to the foreground:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
const status = await session.getDeviceStatus();
|
|
76
|
+
// status.permissionMode, status.workingDirectory, status.isOnline,
|
|
77
|
+
// status.isProcessing, status.pendingControlRequests, status.raw
|
|
78
|
+
|
|
79
|
+
const unsubscribe = session.onDeviceStatus((status) => {
|
|
80
|
+
// Called for every device-status update pushed by the runtime.
|
|
81
|
+
});
|
|
82
|
+
unsubscribe();
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`getDeviceStatus()` always sends a lightweight, request-correlated `sync`
|
|
86
|
+
(`recover_approvals: false`, `force_device_status: true`) and resolves only
|
|
87
|
+
after the runtime acknowledges it and replays a fresh status. This makes the
|
|
88
|
+
getter safe for foreground reconciliation instead of returning a snapshot
|
|
89
|
+
cached before the app was backgrounded. Pending approval request IDs are for
|
|
90
|
+
correlation; decisions continue through `recoverPendingApprovals()` and the
|
|
91
|
+
session's `canUseTool` callback.
|
|
92
|
+
|
|
70
93
|
## Deployment options
|
|
71
94
|
|
|
72
95
|
| Backend | Agent state | Tool execution |
|
|
@@ -115,7 +138,7 @@ For authenticated Remote App Servers in React Native, pass the platform WebSocke
|
|
|
115
138
|
|
|
116
139
|
## Management APIs
|
|
117
140
|
|
|
118
|
-
The client exposes agent, conversation, and Cloud repository management alongside active sessions:
|
|
141
|
+
The client exposes agent, conversation, model, and Cloud repository management alongside active sessions:
|
|
119
142
|
|
|
120
143
|
```ts
|
|
121
144
|
const agents = await client.agents.list({ tags: ["support"] });
|
|
@@ -125,6 +148,11 @@ const conversations = await client.conversations.list({
|
|
|
125
148
|
order: "desc",
|
|
126
149
|
});
|
|
127
150
|
|
|
151
|
+
// No open session required — safe for model pickers and settings screens.
|
|
152
|
+
const { entries: models, availableHandles } = await client.models.list();
|
|
153
|
+
|
|
154
|
+
await client.agents.delete(agents[0].id);
|
|
155
|
+
|
|
128
156
|
const repository = await client.repositories.create({ name: "inputs" });
|
|
129
157
|
await client.repositories.files.create(repository.id, {
|
|
130
158
|
path: "brief.md",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ManagementQuery, ManagementTransport } from "./management.js";
|
|
2
2
|
import type { ConversationMessagesResult, LettaAgent, LettaConversation } from "./management-types.js";
|
|
3
|
-
import type { LettaCodeRemoteClientOptions } from "./types.js";
|
|
3
|
+
import type { LettaCodeRemoteClientOptions, ListModelsResult } from "./types.js";
|
|
4
4
|
type OwnedConnection = {
|
|
5
5
|
url: string;
|
|
6
6
|
close(): void;
|
|
@@ -8,19 +8,79 @@ 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;
|
|
11
16
|
};
|
|
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
|
+
/**
|
|
25
|
+
* Management transport that speaks the app-server control protocol.
|
|
26
|
+
*
|
|
27
|
+
* Connection lifecycle: the Letta Code app-server currently accepts a single
|
|
28
|
+
* control client at a time — while one control socket is attached, additional
|
|
29
|
+
* control sockets are rejected with close code 1008
|
|
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.
|
|
46
|
+
*/
|
|
12
47
|
export declare class AppServerManagementTransport implements ManagementTransport {
|
|
13
48
|
private readonly options;
|
|
49
|
+
private connectionPromise;
|
|
50
|
+
private releasePromise;
|
|
51
|
+
private closingConnections;
|
|
52
|
+
private inFlightRequests;
|
|
53
|
+
private idleWaiters;
|
|
54
|
+
private idleTimer;
|
|
55
|
+
private readonly idleLingerMs;
|
|
14
56
|
constructor(options: AppServerManagementOptions);
|
|
15
57
|
listAgents(query: ManagementQuery): Promise<LettaAgent[]>;
|
|
16
58
|
retrieveAgent(agentId: string): Promise<LettaAgent>;
|
|
17
59
|
updateAgent(agentId: string, body: Record<string, unknown>): Promise<LettaAgent>;
|
|
60
|
+
deleteAgent(agentId: string): Promise<void>;
|
|
61
|
+
listModels(): Promise<ListModelsResult>;
|
|
18
62
|
listConversations(query: ManagementQuery): Promise<LettaConversation[]>;
|
|
19
63
|
retrieveConversation(conversationId: string): Promise<LettaConversation>;
|
|
20
64
|
createConversation(body: Record<string, unknown>): Promise<LettaConversation>;
|
|
21
65
|
updateConversation(conversationId: string, body: Record<string, unknown>): Promise<LettaConversation>;
|
|
22
66
|
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>;
|
|
23
76
|
private request;
|
|
77
|
+
private releaseConnectionWhenIdle;
|
|
78
|
+
private acquireConnection;
|
|
79
|
+
private openConnection;
|
|
80
|
+
private discardConnection;
|
|
81
|
+
private trackClosingConnection;
|
|
82
|
+
private scheduleIdleRelease;
|
|
83
|
+
private clearIdleTimer;
|
|
24
84
|
}
|
|
25
85
|
export {};
|
|
26
86
|
//# 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":"AAOA,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;IACzC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AA8DJ;;;;;GAKG;AACH,wBA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E,MAAM,EACtB,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,0BAA0B,CAAC;IAgBtC;;;;;;;OAOG;IACH,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;YAqBxB,OAAO;YA0CP,yBAAyB;IAsBvC,OAAO,CAAC,iBAAiB;YAsBX,cAAc;IAqD5B,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,cAAc;CAKvB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AppServerClient, type AppServerExternalToolCallHandler } from "@letta-ai/letta-code/app-server-client";
|
|
2
2
|
import { RemoteClientSessionCore, type ProtocolMessage, type RemoteClientRuntimeController, type RuntimeSendTurnOptions, type RuntimeScope, type RuntimeSessionInit, type RuntimeSessionMode } from "./remote-client-session-core.js";
|
|
3
|
-
import type { AnyAgentTool, CanUseToolResponse, CreateAgentOptions, LettaCodeRemoteClientOptions, LettaCodeClientSessionOptions, ListModelsResult, ListMessagesOptions, ListMessagesResult, RecoverPendingApprovalsOptions, RecoverPendingApprovalsResult, SendMessage, UpdateModelResult } from "./types.js";
|
|
3
|
+
import type { AnyAgentTool, CanUseToolContext, CanUseToolResponse, CreateAgentOptions, LettaCodeRemoteClientOptions, LettaCodeClientSessionOptions, ListModelsResult, ListMessagesOptions, ListMessagesResult, RecoverPendingApprovalsOptions, RecoverPendingApprovalsResult, SendMessage, UpdateModelResult } from "./types.js";
|
|
4
4
|
type UpdateModelPayload = {
|
|
5
5
|
model_id?: string;
|
|
6
6
|
model_handle?: string;
|
|
@@ -17,8 +17,11 @@ export type AppServerSessionOptions = Partial<LettaCodeRemoteClientOptions> & {
|
|
|
17
17
|
url: string;
|
|
18
18
|
close(): void;
|
|
19
19
|
}>;
|
|
20
|
-
/**
|
|
21
|
-
|
|
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>;
|
|
22
25
|
/** Whether SDK create-agent payloads should add the origin tag automatically. */
|
|
23
26
|
includeSdkOriginTag?: boolean;
|
|
24
27
|
};
|
|
@@ -39,7 +42,7 @@ type AppServerApprovalResponseDecision = {
|
|
|
39
42
|
behavior: "deny";
|
|
40
43
|
message: string;
|
|
41
44
|
};
|
|
42
|
-
export declare function resolveAppServerToolApproval(options: AppServerApprovalOptions, toolName: string, toolInput: Record<string, unknown
|
|
45
|
+
export declare function resolveAppServerToolApproval(options: AppServerApprovalOptions, toolName: string, toolInput: Record<string, unknown>, context?: CanUseToolContext): Promise<CanUseToolResponse>;
|
|
43
46
|
export declare function toAppServerApprovalDecision(decision: CanUseToolResponse): AppServerApprovalResponseDecision;
|
|
44
47
|
export declare function registerAppServerControlRequestHandler(config: {
|
|
45
48
|
client: AppServerClient;
|
|
@@ -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;AAchD,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,EAEl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AO,EAAE,6BAA6B,GAAG,kBAAkB,GAAG,OAAO;cAKjF,2BAA2B,IAAI,OAAO,CAAC,kBAAkB,CAAC;cA4DhE,WAAW,IAAI,IAAI;YASxB,mBAAmB;YAenB,YAAY;YAMZ,wBAAwB;YAiExB,0BAA0B;CAoBzC"}
|
package/dist/client-base.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RepositoriesClient } from "./repositories.js";
|
|
2
2
|
import { type ManagementTransport } from "./management.js";
|
|
3
|
-
import type { AgentsClient, ConversationsClient } from "./management-types.js";
|
|
3
|
+
import type { AgentsClient, ConversationsClient, ModelsClient } from "./management-types.js";
|
|
4
4
|
import type { CreateAgentOptions, CreateSessionOptions, LettaCodeBackend, LettaCodeClientOptions, LettaCodeClientSessionOptions, LettaCodeEnvironment, LettaCodeSession, SDKResultMessage, SendMessage } from "./types.js";
|
|
5
5
|
/**
|
|
6
6
|
* Top-level Letta Agent SDK client.
|
|
@@ -17,6 +17,7 @@ export declare class LettaAgentClientBase {
|
|
|
17
17
|
readonly environment: LettaCodeEnvironment | undefined;
|
|
18
18
|
readonly agents: AgentsClient;
|
|
19
19
|
readonly conversations: ConversationsClient;
|
|
20
|
+
readonly models: ModelsClient;
|
|
20
21
|
protected readonly options: LettaCodeClientOptions;
|
|
21
22
|
private repositoriesClient;
|
|
22
23
|
private managementTransport;
|
|
@@ -53,7 +54,14 @@ export declare class LettaAgentClientBase {
|
|
|
53
54
|
protected localBackendUnavailableError(): Error;
|
|
54
55
|
protected createLocalManagementTransport(): ManagementTransport;
|
|
55
56
|
private remoteOptions;
|
|
57
|
+
private appServerSessionOptions;
|
|
56
58
|
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>;
|
|
57
65
|
private getManagementTransport;
|
|
58
66
|
private cloudOptions;
|
|
59
67
|
}
|
|
@@ -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;AAcvD,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,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,6BAA6B,EAC7B,oBAAoB,EAIpB,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACZ,MAAM,YAAY,CAAC;AAkDpB;;;;;;;;;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,EAAE,YAAY,CAAC;IAC9B,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACnD,OAAO,CAAC,kBAAkB,CAAmC;IAC7D,OAAO,CAAC,mBAAmB,CAAoC;gBAEnD,OAAO,GAAE,sBAA2B;IAsFhD;;;;;OAKG;IACH,IAAI,YAAY,IAAI,kBAAkB,CAErC;IAEK,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC;IAwBpE;;;;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