@letta-ai/letta-agent-sdk 0.8.78 → 0.8.80

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.
@@ -22,6 +22,8 @@ export interface StartLocalAppServerOptions {
22
22
  env?: Record<string, string | undefined>;
23
23
  filesystemConfinement?: "memory";
24
24
  agentId?: string;
25
+ /** Register the app-server as a Letta Cloud computer with this name. */
26
+ computerName?: string;
25
27
  }
26
28
 
27
29
  interface LocalAppServerProcess {
@@ -95,7 +97,10 @@ function tryExtractListeningUrl(output: string): string | null {
95
97
 
96
98
  export function buildLocalAppServerArgs(
97
99
  cliPath: string,
98
- options: Pick<StartLocalAppServerOptions, "backend" | "listen"> = {},
100
+ options: Pick<
101
+ StartLocalAppServerOptions,
102
+ "backend" | "listen" | "computerName"
103
+ > = {},
99
104
  ): string[] {
100
105
  return [
101
106
  cliPath,
@@ -103,6 +108,9 @@ export function buildLocalAppServerArgs(
103
108
  "server",
104
109
  "--listen",
105
110
  options.listen ?? DEFAULT_LISTEN_URL,
111
+ ...(options.computerName !== undefined
112
+ ? ["--computer-name", options.computerName]
113
+ : []),
106
114
  ];
107
115
  }
108
116
 
@@ -5,7 +5,7 @@ import {
5
5
  } from "@letta-ai/letta-code/app-server-client";
6
6
  import type { ConversationRetrieveResponseMessage } from "@letta-ai/letta-code/app-server-protocol";
7
7
  import type { AppServerSessionOptions } from "./app-server-session.js";
8
- import { createExternalToolCallHandler, externalToolGroups } from "./external-tools.js";
8
+ import { createExternalToolCallHandler, externalToolGroups, registerExternalToolCallHandler } from "./external-tools.js";
9
9
  import { applyUniqueRequestIds } from "./request-ids.js";
10
10
  import {
11
11
  runtimeToolPolicy,
@@ -215,12 +215,12 @@ export class ToolRegistry {
215
215
  ? { requestTimeoutMs: this.options.requestTimeoutMs }
216
216
  : {}),
217
217
  }));
218
- client.onExternalToolCall(async (request) => {
218
+ registerExternalToolCallHandler(client, async (request, signal) => {
219
219
  const runtime = request.runtime;
220
220
  const entry = runtime &&
221
221
  [...this.entries].find((candidate) => candidate.runtimes.some((r) => runtimeKey(r) === runtimeKey(runtime)));
222
222
  if (!entry) throw new Error(`No tools registered for conversation ${runtime?.conversation_id}`);
223
- return entry.call(request);
223
+ return entry.call(request, signal);
224
224
  });
225
225
  try {
226
226
  await client.connect();
package/src/types.ts CHANGED
@@ -433,6 +433,13 @@ export interface LettaCodeCloudClientOptions {
433
433
  environment?: LettaCodeEnvironment;
434
434
  /** Options for SDK-managed sandboxes when no computer is selected. */
435
435
  sandbox?: LettaCodeCloudSandboxOptions;
436
+ /**
437
+ * Register this machine as a computer with this name and run the client's
438
+ * sessions on it. The SDK starts a Letta Code app-server here, so tools from
439
+ * `client.registerTools()` run in this process, including on turns Letta
440
+ * Cloud delivers to this computer. Node.js only; excludes `computer`/`sandbox`.
441
+ */
442
+ registerComputer?: { name: string };
436
443
  }
437
444
 
438
445
  export type LettaCodeClientOptions =