@letta-ai/letta-agent-sdk 0.5.8 → 0.6.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/README.md +19 -0
- package/dist/app-server-session.d.ts +3 -2
- package/dist/app-server-session.d.ts.map +1 -1
- package/dist/client-entry.js +41 -8
- package/dist/client-entry.js.map +5 -5
- package/dist/cloud-session.d.ts.map +1 -1
- package/dist/index.js +42 -9
- package/dist/index.js.map +6 -6
- package/dist/types.d.ts +13 -0
- 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 +16 -2
- package/src/cloud-session.ts +4 -2
- package/src/types.ts +23 -0
- package/src/validation.ts +39 -0
package/README.md
CHANGED
|
@@ -121,6 +121,25 @@ await using session = client.createSession(agentId, {
|
|
|
121
121
|
|
|
122
122
|
Local execution (embedded Letta Code harness / app server) requires Node.js 22.19 or newer.
|
|
123
123
|
|
|
124
|
+
### Built-in client toolsets
|
|
125
|
+
|
|
126
|
+
Use `toolset` to select a request-scoped harness preset and add bundled client
|
|
127
|
+
tools. `allowedTools` remains the final visibility boundary across bundled and
|
|
128
|
+
custom tools.
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
await using session = client.createSession(agentId, {
|
|
132
|
+
toolset: {
|
|
133
|
+
base: "none",
|
|
134
|
+
include: ["Read", "LS", "Glob", "Grep"],
|
|
135
|
+
},
|
|
136
|
+
allowedTools: ["Read", "LS", "Glob", "Grep"],
|
|
137
|
+
});
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The override applies to this SDK session's turns without changing the agent's
|
|
141
|
+
persisted harness toolset preference.
|
|
142
|
+
|
|
124
143
|
### MCP tools
|
|
125
144
|
|
|
126
145
|
Pass MCP servers by name in session options. The SDK supports local stdio,
|
|
@@ -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, CanUseToolContext, CanUseToolResponse, CreateAgentOptions, LettaCodeRemoteClientOptions, LettaCodeClientSessionOptions, ListModelsResult, ListMessagesOptions, ListMessagesResult, RecoverPendingApprovalsOptions, RecoverPendingApprovalsResult, SendMessage, UpdateModelResult } from "./types.js";
|
|
3
|
+
import type { AnyAgentTool, CanUseToolContext, CanUseToolResponse, ClientToolsetConfig, 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;
|
|
@@ -47,7 +47,8 @@ export declare class AppServerRuntimeController implements RemoteClientRuntimeCo
|
|
|
47
47
|
private readonly client;
|
|
48
48
|
private readonly options;
|
|
49
49
|
private readonly clientToolAllowlist?;
|
|
50
|
-
|
|
50
|
+
private readonly clientToolset?;
|
|
51
|
+
constructor(client: AppServerClient, options: AppServerSessionOptions, clientToolAllowlist?: readonly string[] | undefined, clientToolset?: ClientToolsetConfig | undefined);
|
|
51
52
|
onMessage(handler: (message: ProtocolMessage, channel?: string) => void): () => void;
|
|
52
53
|
send(command: Record<string, unknown>): void;
|
|
53
54
|
sendTurnMessage(runtime: RuntimeScope, message: SendMessage, options: RuntimeSendTurnOptions): void;
|
|
@@ -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;AA0BhD,O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AAY,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;cAmFhE,WAAW,IAAI,IAAI;cAUb,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxD,OAAO,CAAC,cAAc;YAOR,mBAAmB;YAenB,YAAY;YAOZ,wBAAwB;YAiExB,0BAA0B;CAqBzC"}
|
package/dist/client-entry.js
CHANGED
|
@@ -10320,10 +10320,12 @@ class AppServerRuntimeController {
|
|
|
10320
10320
|
client;
|
|
10321
10321
|
options;
|
|
10322
10322
|
clientToolAllowlist;
|
|
10323
|
-
|
|
10323
|
+
clientToolset;
|
|
10324
|
+
constructor(client, options, clientToolAllowlist, clientToolset) {
|
|
10324
10325
|
this.client = client;
|
|
10325
10326
|
this.options = options;
|
|
10326
10327
|
this.clientToolAllowlist = clientToolAllowlist;
|
|
10328
|
+
this.clientToolset = clientToolset;
|
|
10327
10329
|
}
|
|
10328
10330
|
onMessage(handler) {
|
|
10329
10331
|
return this.client.onMessage((message, channel) => {
|
|
@@ -10347,6 +10349,12 @@ class AppServerRuntimeController {
|
|
|
10347
10349
|
if (this.clientToolAllowlist !== undefined) {
|
|
10348
10350
|
payload.client_tool_allowlist = [...new Set(this.clientToolAllowlist)];
|
|
10349
10351
|
}
|
|
10352
|
+
if (this.clientToolset !== undefined) {
|
|
10353
|
+
payload.client_toolset = {
|
|
10354
|
+
...this.clientToolset.base !== undefined ? { base: this.clientToolset.base } : {},
|
|
10355
|
+
...this.clientToolset.include !== undefined ? { include: [...new Set(this.clientToolset.include)] } : {}
|
|
10356
|
+
};
|
|
10357
|
+
}
|
|
10350
10358
|
payload.exclude_interactive_tools = true;
|
|
10351
10359
|
this.client.input({
|
|
10352
10360
|
runtime,
|
|
@@ -10487,12 +10495,13 @@ class AppServerSession extends RemoteClientSessionCore {
|
|
|
10487
10495
|
throw new Error(response.error ?? "Failed to start app-server runtime");
|
|
10488
10496
|
}
|
|
10489
10497
|
const tools = agentToolNames(response.agent);
|
|
10490
|
-
const skillSources =
|
|
10498
|
+
const skillSources = options.skillSources;
|
|
10499
|
+
const clientToolset = "toolset" in options ? options.toolset : undefined;
|
|
10491
10500
|
const mcpToolNames = this.mcpBridge?.tools.map((tool) => tool.name) ?? [];
|
|
10492
|
-
const allowedTools = expandMcpToolWildcards(
|
|
10501
|
+
const allowedTools = expandMcpToolWildcards(options.allowedTools, mcpToolNames);
|
|
10493
10502
|
const availableTools = tools === undefined && mcpToolNames.length === 0 ? undefined : [...tools ?? [], ...mcpToolNames];
|
|
10494
10503
|
return {
|
|
10495
|
-
controller: new AppServerRuntimeController(client, this.remoteOptions, allowedTools),
|
|
10504
|
+
controller: new AppServerRuntimeController(client, this.remoteOptions, allowedTools, clientToolset),
|
|
10496
10505
|
runtime: response.runtime,
|
|
10497
10506
|
model: typeof response.agent?.model === "string" ? response.agent.model : "",
|
|
10498
10507
|
modelSettings: objectRecord(response.agent?.model_settings) ?? null,
|
|
@@ -11255,14 +11264,15 @@ class CloudEnvironmentSession extends RemoteClientSessionCore {
|
|
|
11255
11264
|
throw new Error(response.error ?? "Failed to start Cloud status runtime");
|
|
11256
11265
|
}
|
|
11257
11266
|
const tools = agentToolNames(response.agent);
|
|
11258
|
-
const skillSources =
|
|
11267
|
+
const skillSources = options.skillSources;
|
|
11268
|
+
const clientToolset = "toolset" in options ? options.toolset : undefined;
|
|
11259
11269
|
const mcpToolNames = this.mcpBridge?.tools.map((tool) => tool.name) ?? [];
|
|
11260
|
-
const allowedTools = expandMcpToolWildcards(
|
|
11270
|
+
const allowedTools = expandMcpToolWildcards(options.allowedTools, mcpToolNames);
|
|
11261
11271
|
const availableTools = tools === undefined && mcpToolNames.length === 0 ? undefined : [...tools ?? [], ...mcpToolNames];
|
|
11262
11272
|
return {
|
|
11263
11273
|
controller: new AppServerRuntimeController(client, {
|
|
11264
11274
|
requestTimeoutMs: this.cloudOptions.requestTimeoutMs ?? DEFAULT_TURN_TIMEOUT_MS
|
|
11265
|
-
}, allowedTools),
|
|
11275
|
+
}, allowedTools, clientToolset),
|
|
11266
11276
|
runtime: response.runtime,
|
|
11267
11277
|
model: typeof response.agent?.model === "string" ? response.agent.model : "",
|
|
11268
11278
|
modelSettings: response.agent?.model_settings ?? null,
|
|
@@ -11772,6 +11782,15 @@ var VALID_SKILL_SOURCES = [
|
|
|
11772
11782
|
"agent",
|
|
11773
11783
|
"project"
|
|
11774
11784
|
];
|
|
11785
|
+
var VALID_TOOLSET_BASES = [
|
|
11786
|
+
"auto",
|
|
11787
|
+
"codex",
|
|
11788
|
+
"codex_snake",
|
|
11789
|
+
"default",
|
|
11790
|
+
"gemini",
|
|
11791
|
+
"gemini_snake",
|
|
11792
|
+
"none"
|
|
11793
|
+
];
|
|
11775
11794
|
var VALID_REASONING_EFFORTS = [
|
|
11776
11795
|
"none",
|
|
11777
11796
|
"minimal",
|
|
@@ -11832,6 +11851,19 @@ function validateSystemPromptPreset(preset) {
|
|
|
11832
11851
|
throw new Error(`Invalid system prompt preset '${preset}'. ` + `Valid presets: ${validPresets.join(", ")}`);
|
|
11833
11852
|
}
|
|
11834
11853
|
}
|
|
11854
|
+
function validateClientToolset(toolset) {
|
|
11855
|
+
if (toolset === undefined)
|
|
11856
|
+
return;
|
|
11857
|
+
if (!toolset || typeof toolset !== "object" || Array.isArray(toolset)) {
|
|
11858
|
+
throw new Error("Invalid toolset. Expected an object with optional base and include fields.");
|
|
11859
|
+
}
|
|
11860
|
+
if (toolset.base !== undefined && !VALID_TOOLSET_BASES.includes(toolset.base)) {
|
|
11861
|
+
throw new Error(`Invalid toolset.base '${String(toolset.base)}'. Valid values: ${VALID_TOOLSET_BASES.join(", ")}`);
|
|
11862
|
+
}
|
|
11863
|
+
if (toolset.include !== undefined && (!Array.isArray(toolset.include) || toolset.include.some((toolName) => typeof toolName !== "string" || toolName.length === 0))) {
|
|
11864
|
+
throw new Error("Invalid toolset.include. Expected an array of non-empty bundled tool names.");
|
|
11865
|
+
}
|
|
11866
|
+
}
|
|
11835
11867
|
function validateSkillSources(sources) {
|
|
11836
11868
|
if (sources === undefined) {
|
|
11837
11869
|
return;
|
|
@@ -11891,6 +11923,7 @@ function validateMcpServers(servers) {
|
|
|
11891
11923
|
}
|
|
11892
11924
|
}
|
|
11893
11925
|
function validateCreateSessionOptions(options) {
|
|
11926
|
+
validateClientToolset(options.toolset);
|
|
11894
11927
|
validateSkillSources(options.skillSources);
|
|
11895
11928
|
validateMcpServers(options.mcpServers);
|
|
11896
11929
|
validateReasoningEffort(options.reasoningEffort);
|
|
@@ -12321,4 +12354,4 @@ export {
|
|
|
12321
12354
|
CloudManagedSandboxExpiredError
|
|
12322
12355
|
};
|
|
12323
12356
|
|
|
12324
|
-
//# debugId=
|
|
12357
|
+
//# debugId=FE3D4D568E602DA664756E2164756E21
|