@letta-ai/letta-agent-sdk 0.7.3 → 0.7.5
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/dist/app-server-management.d.ts +2 -1
- package/dist/app-server-management.d.ts.map +1 -1
- package/dist/client-entry.d.ts +1 -0
- package/dist/client-entry.d.ts.map +1 -1
- package/dist/client-entry.js +39 -3
- package/dist/client-entry.js.map +10 -9
- package/dist/cloud-management.d.ts +2 -1
- package/dist/cloud-management.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -3
- package/dist/index.js.map +10 -9
- package/dist/management-errors.d.ts +9 -0
- package/dist/management-errors.d.ts.map +1 -0
- package/dist/management-types.d.ts +13 -1
- package/dist/management-types.d.ts.map +1 -1
- package/dist/management.d.ts +2 -1
- package/dist/management.d.ts.map +1 -1
- package/dist/types.d.ts +16 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/app-server-management.ts +24 -0
- package/src/client-entry.ts +1 -0
- package/src/cloud-management.ts +8 -0
- package/src/index.ts +2 -0
- package/src/management-errors.ts +16 -0
- package/src/management-types.ts +17 -0
- package/src/management.ts +25 -0
- package/src/remote-client-session-core.ts +1 -1
- package/src/types.ts +16 -2
- package/src/validation.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentListParams, AgentUpdateParams } from "@letta-ai/letta-client/resources/agents/agents";
|
|
2
|
-
import type { ConversationCreateParams, ConversationListParams, ConversationUpdateParams } from "@letta-ai/letta-client/resources/conversations/conversations";
|
|
2
|
+
import type { ConversationCreateParams, ConversationForkParams, ConversationListParams, ConversationUpdateParams } from "@letta-ai/letta-client/resources/conversations/conversations";
|
|
3
3
|
import type { MessageListParams } from "@letta-ai/letta-client/resources/conversations/messages";
|
|
4
4
|
import type { ManagementTransport } from "./management.js";
|
|
5
5
|
import type { ConversationMessagesResult, LettaAgent, LettaConversation } from "./management-types.js";
|
|
@@ -33,6 +33,7 @@ export declare class AppServerManagementTransport implements ManagementTransport
|
|
|
33
33
|
retrieveConversation(conversationId: string): Promise<LettaConversation>;
|
|
34
34
|
createConversation(body: ConversationCreateParams): Promise<LettaConversation>;
|
|
35
35
|
updateConversation(conversationId: string, body: ConversationUpdateParams): Promise<LettaConversation>;
|
|
36
|
+
forkConversation(conversationId: string, body: ConversationForkParams): Promise<LettaConversation>;
|
|
36
37
|
listConversationMessages(conversationId: string, query: MessageListParams): Promise<ConversationMessagesResult>;
|
|
37
38
|
private request;
|
|
38
39
|
private acquireConnection;
|
|
@@ -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":"AAmBA,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EAClB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,8DAA8D,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAGjG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,KAAK,EACV,0BAA0B,EAC1B,UAAU,EACV,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEjF,KAAK,eAAe,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,IAAI,IAAI,CAAA;CAAE,CAAC;AAEtD,MAAM,MAAM,0BAA0B,GACpC,OAAO,CAAC,4BAA4B,CAAC,GAAG;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE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|
package/dist/client-entry.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare class LettaAgentClient extends LettaAgentClientBase {
|
|
|
11
11
|
constructor(options: PortableLettaAgentClientOptions);
|
|
12
12
|
}
|
|
13
13
|
export { CloudManagedSandboxExpiredError } from "./cloud-session.js";
|
|
14
|
+
export { ConversationForkHydrationError } from "./management-errors.js";
|
|
14
15
|
export { RepositoriesClient } from "./repositories.js";
|
|
15
16
|
export type { Computer, ComputerMetadata, ComputerSelector, ComputersClient, ListComputersOptions, ListComputersResult, ResolvedComputer, } from "./computers.js";
|
|
16
17
|
export type * from "./management-types.js";
|
|
@@ -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,YAAY,EACV,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,mBAAmB,uBAAuB,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EACrB,iBAAiB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Y,CAAC"}
|
package/dist/client-entry.js
CHANGED
|
@@ -3439,6 +3439,16 @@ function normalizeAppServerModels(response) {
|
|
|
3439
3439
|
};
|
|
3440
3440
|
}
|
|
3441
3441
|
|
|
3442
|
+
// src/management-errors.ts
|
|
3443
|
+
class ConversationForkHydrationError extends Error {
|
|
3444
|
+
conversationId;
|
|
3445
|
+
constructor(conversationId, cause) {
|
|
3446
|
+
super(`Conversation ${conversationId} was forked, but its state could not be retrieved.`, { cause });
|
|
3447
|
+
this.name = "ConversationForkHydrationError";
|
|
3448
|
+
this.conversationId = conversationId;
|
|
3449
|
+
}
|
|
3450
|
+
}
|
|
3451
|
+
|
|
3442
3452
|
// src/request-ids.ts
|
|
3443
3453
|
var processRequestCounter = 0;
|
|
3444
3454
|
function createRequestIdGenerator() {
|
|
@@ -3509,6 +3519,15 @@ class AppServerManagementTransport {
|
|
|
3509
3519
|
const response = await this.request("conversation_update", { conversation_id: conversationId, body }, "conversation_update_response");
|
|
3510
3520
|
return ensureResponse(response, response.conversation, `Failed to update conversation ${conversationId}.`);
|
|
3511
3521
|
}
|
|
3522
|
+
async forkConversation(conversationId, body) {
|
|
3523
|
+
const response = await this.request("conversation_fork", { conversation_id: conversationId, body }, "conversation_fork_response");
|
|
3524
|
+
const fork = ensureResponse(response, response.conversation, `Failed to fork conversation ${conversationId}.`);
|
|
3525
|
+
try {
|
|
3526
|
+
return await this.retrieveConversation(fork.id);
|
|
3527
|
+
} catch (error) {
|
|
3528
|
+
throw new ConversationForkHydrationError(fork.id, error);
|
|
3529
|
+
}
|
|
3530
|
+
}
|
|
3512
3531
|
async listConversationMessages(conversationId, query) {
|
|
3513
3532
|
const response = await this.request("conversation_messages_list", { conversation_id: conversationId, query }, "conversation_messages_list_response");
|
|
3514
3533
|
if (!response.success) {
|
|
@@ -9467,7 +9486,7 @@ class RemoteClientSessionCore {
|
|
|
9467
9486
|
}
|
|
9468
9487
|
async updateModel(update) {
|
|
9469
9488
|
if (this.mode.kind === "session" && this.mode.options.stateless === true) {
|
|
9470
|
-
throw new Error("updateModel() is unavailable in a stateless session because it changes
|
|
9489
|
+
throw new Error("updateModel() is unavailable in a stateless session because it changes persistent model configuration.");
|
|
9471
9490
|
}
|
|
9472
9491
|
if (!this.initialized) {
|
|
9473
9492
|
await this.initialize();
|
|
@@ -10530,6 +10549,9 @@ class CloudManagementTransport {
|
|
|
10530
10549
|
async updateConversation(conversationId, body) {
|
|
10531
10550
|
return this.client.conversations.update(conversationId, body);
|
|
10532
10551
|
}
|
|
10552
|
+
async forkConversation(conversationId, query) {
|
|
10553
|
+
return this.client.conversations.fork(conversationId, query);
|
|
10554
|
+
}
|
|
10533
10555
|
async listConversationMessages(conversationId, query) {
|
|
10534
10556
|
const page = await this.client.conversations.messages.list(conversationId, toOrderRelativeCursors(query));
|
|
10535
10557
|
return { messages: page.items };
|
|
@@ -11653,6 +11675,12 @@ function conversationUpdateBody(options) {
|
|
|
11653
11675
|
archived: options.archived
|
|
11654
11676
|
};
|
|
11655
11677
|
}
|
|
11678
|
+
function conversationForkQuery(options) {
|
|
11679
|
+
return {
|
|
11680
|
+
message_id: options.messageId,
|
|
11681
|
+
hidden: options.hidden
|
|
11682
|
+
};
|
|
11683
|
+
}
|
|
11656
11684
|
function conversationMessagesQuery(options) {
|
|
11657
11685
|
return {
|
|
11658
11686
|
before: options.before,
|
|
@@ -11686,6 +11714,13 @@ function createConversationsClient(transport) {
|
|
|
11686
11714
|
retrieve: (conversationId) => transport().retrieveConversation(conversationId),
|
|
11687
11715
|
create: (options) => transport().createConversation(conversationCreateBody(options)),
|
|
11688
11716
|
update: (conversationId, options) => transport().updateConversation(conversationId, conversationUpdateBody(options)),
|
|
11717
|
+
fork: async (sourceConversationId, options = {}) => {
|
|
11718
|
+
assertNonEmptyId2(sourceConversationId, "conversation id");
|
|
11719
|
+
if (options.messageId !== undefined) {
|
|
11720
|
+
assertNonEmptyId2(options.messageId, "message id");
|
|
11721
|
+
}
|
|
11722
|
+
return await transport().forkConversation(sourceConversationId, conversationForkQuery(options));
|
|
11723
|
+
},
|
|
11689
11724
|
listMessages: (conversationId, options = {}) => transport().listConversationMessages(conversationId, conversationMessagesQuery(options))
|
|
11690
11725
|
};
|
|
11691
11726
|
}
|
|
@@ -11841,7 +11876,7 @@ function validateCreateSessionOptions(options) {
|
|
|
11841
11876
|
["resources", options.resources]
|
|
11842
11877
|
].find(([, value]) => value !== undefined);
|
|
11843
11878
|
if (persistedOption) {
|
|
11844
|
-
throw new Error(`stateless sessions cannot set ${persistedOption[0]} because it changes
|
|
11879
|
+
throw new Error(`stateless sessions cannot set ${persistedOption[0]} because it changes persistent configuration.`);
|
|
11845
11880
|
}
|
|
11846
11881
|
}
|
|
11847
11882
|
validateClientToolset(options.toolset);
|
|
@@ -12731,7 +12766,8 @@ export {
|
|
|
12731
12766
|
createReactNativeWebSocketConstructor,
|
|
12732
12767
|
RepositoriesClient,
|
|
12733
12768
|
LettaAgentClient,
|
|
12769
|
+
ConversationForkHydrationError,
|
|
12734
12770
|
CloudManagedSandboxExpiredError
|
|
12735
12771
|
};
|
|
12736
12772
|
|
|
12737
|
-
//# debugId=
|
|
12773
|
+
//# debugId=4189F3F92EE00D0D64756E2164756E21
|