@letta-ai/letta-agent-sdk 0.8.19 → 0.8.21

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.
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,6BAA6B,EAE7B,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,qBAAa,gBAAiB,SAAQ,oBAAoB;cACrC,gBAAgB,IAAI,gBAAgB;cAIpC,8BAA8B,IAAI,mBAAmB;cAwB/C,gBAAgB,CACvC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,MAAM,CAAC;cAiBC,kBAAkB,CACnC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,6BAA6B,GACrC,gBAAgB;cAaA,2BAA2B,CAC5C,YAAY,EAAE,qBAAqB,EACnC,cAAc,EAAE,6BAA6B,GAC5C,gBAAgB;cAiCA,kBAAkB,CACnC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,6BAA6B,GACrC,gBAAgB;CAsBpB"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,6BAA6B,EAE7B,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,qBAAa,gBAAiB,SAAQ,oBAAoB;cACrC,gBAAgB,IAAI,gBAAgB;cAIpC,8BAA8B,IAAI,mBAAmB;cAwB/C,gBAAgB,CACvC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,MAAM,CAAC;cAiBC,kBAAkB,CACnC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,6BAA6B,GACrC,gBAAgB;cAaA,2BAA2B,CAC5C,YAAY,EAAE,qBAAqB,EACnC,cAAc,EAAE,6BAA6B,GAC5C,gBAAgB;cAwCA,kBAAkB,CACnC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,6BAA6B,GACrC,gBAAgB;CAsBpB"}
package/dist/index.js CHANGED
@@ -15074,6 +15074,13 @@ class AppServerSession extends RemoteClientSessionCore {
15074
15074
  const mode = mapPermissionMode(options.permissionMode);
15075
15075
  if (mode)
15076
15076
  command.mode = mode;
15077
+ if (this.mode.kind === "agent-free" && this.mode.disableMemoryGuard === true) {
15078
+ command.execution_settings = {
15079
+ allowed_tools: [],
15080
+ disallowed_tools: [],
15081
+ disable_memory_guard: true
15082
+ };
15083
+ }
15077
15084
  if (options.cwd !== undefined)
15078
15085
  command.cwd = options.cwd;
15079
15086
  if (this.mode.kind === "session" && this.mode.options.stateless === true) {
@@ -16930,11 +16937,16 @@ function agentFreeSessionOptions(options) {
16930
16937
  isSubagent: _isSubagent,
16931
16938
  modelSettings: _modelSettings,
16932
16939
  contextWindowLimit: _contextWindowLimit,
16940
+ conversationId: _conversationId,
16941
+ disableMemoryGuard: _disableMemoryGuard,
16933
16942
  ...sessionOptions
16934
16943
  } = options;
16935
16944
  return sessionOptions;
16936
16945
  }
16937
16946
  function validateAgentFreeQueryOptions(options) {
16947
+ if (options.conversationId !== undefined && (typeof options.conversationId !== "string" || !options.conversationId.trim())) {
16948
+ throw new Error("query() conversationId must be a non-empty string.");
16949
+ }
16938
16950
  if (typeof options.model !== "string" || options.model.length === 0) {
16939
16951
  throw new Error("query() requires a non-empty model.");
16940
16952
  }
@@ -17126,19 +17138,25 @@ class LettaAgentClientBase {
17126
17138
  validateAgentFreeQueryOptions(options);
17127
17139
  const sessionOptions = agentFreeSessionOptions(options);
17128
17140
  this.assertSessionBackend("query", sessionOptions);
17141
+ if (options.disableMemoryGuard === true && this.backend === "cloud") {
17142
+ throw new Error('query() disableMemoryGuard is only supported with backend: "local" or "remote".');
17143
+ }
17129
17144
  if (this.backend === "remote") {
17130
17145
  return new AppServerSession(this.appServerSessionOptions(), {
17131
17146
  kind: "agent-free",
17132
- createConversation: {
17133
- model: options.model,
17134
- system: options.system,
17135
- ...options.parentAgentId !== undefined ? { parentAgentId: options.parentAgentId } : {},
17136
- ...options.name !== undefined ? { name: options.name } : {},
17137
- ...options.isSubagent !== undefined ? { isSubagent: options.isSubagent } : {},
17138
- ...options.modelSettings !== undefined ? { modelSettings: options.modelSettings } : {},
17139
- ...options.contextWindowLimit !== undefined ? { contextWindowLimit: options.contextWindowLimit } : {}
17147
+ ...options.conversationId ? { conversationId: options.conversationId } : {
17148
+ createConversation: {
17149
+ model: options.model,
17150
+ system: options.system,
17151
+ ...options.parentAgentId !== undefined ? { parentAgentId: options.parentAgentId } : {},
17152
+ ...options.name !== undefined ? { name: options.name } : {},
17153
+ ...options.isSubagent !== undefined ? { isSubagent: options.isSubagent } : {},
17154
+ ...options.modelSettings !== undefined ? { modelSettings: options.modelSettings } : {},
17155
+ ...options.contextWindowLimit !== undefined ? { contextWindowLimit: options.contextWindowLimit } : {}
17156
+ }
17140
17157
  },
17141
- options: sessionOptions
17158
+ options: sessionOptions,
17159
+ ...options.disableMemoryGuard === true ? { disableMemoryGuard: true } : {}
17142
17160
  });
17143
17161
  }
17144
17162
  if (this.backend === "cloud") {
@@ -17146,7 +17164,7 @@ class LettaAgentClientBase {
17146
17164
  if (computer === undefined) {
17147
17165
  throw new Error("Cloud query() requires an explicit computer; managed sandboxes are agent-scoped.");
17148
17166
  }
17149
- const conversation = await this.getCloudClient().post("/v1/conversations/ephemeral", {
17167
+ const conversation = options.conversationId ? { id: options.conversationId } : await this.getCloudClient().post("/v1/conversations/ephemeral", {
17150
17168
  body: {
17151
17169
  model: options.model,
17152
17170
  system: options.system,
@@ -18011,16 +18029,19 @@ class LettaAgentClient extends LettaAgentClientBase {
18011
18029
  }
18012
18030
  return createLocalAppServerSession(localOptions.appServer, {
18013
18031
  kind: "agent-free",
18014
- createConversation: {
18015
- model: queryOptions.model,
18016
- system: queryOptions.system,
18017
- ...queryOptions.parentAgentId !== undefined ? { parentAgentId: queryOptions.parentAgentId } : {},
18018
- ...queryOptions.name !== undefined ? { name: queryOptions.name } : {},
18019
- ...queryOptions.isSubagent !== undefined ? { isSubagent: queryOptions.isSubagent } : {},
18020
- ...queryOptions.modelSettings !== undefined ? { modelSettings: queryOptions.modelSettings } : {},
18021
- ...queryOptions.contextWindowLimit !== undefined ? { contextWindowLimit: queryOptions.contextWindowLimit } : {}
18032
+ ...queryOptions.conversationId ? { conversationId: queryOptions.conversationId } : {
18033
+ createConversation: {
18034
+ model: queryOptions.model,
18035
+ system: queryOptions.system,
18036
+ ...queryOptions.parentAgentId !== undefined ? { parentAgentId: queryOptions.parentAgentId } : {},
18037
+ ...queryOptions.name !== undefined ? { name: queryOptions.name } : {},
18038
+ ...queryOptions.isSubagent !== undefined ? { isSubagent: queryOptions.isSubagent } : {},
18039
+ ...queryOptions.modelSettings !== undefined ? { modelSettings: queryOptions.modelSettings } : {},
18040
+ ...queryOptions.contextWindowLimit !== undefined ? { contextWindowLimit: queryOptions.contextWindowLimit } : {}
18041
+ }
18022
18042
  },
18023
- options: sessionOptions
18043
+ options: sessionOptions,
18044
+ ...queryOptions.disableMemoryGuard === true ? { disableMemoryGuard: true } : {}
18024
18045
  });
18025
18046
  }
18026
18047
  resumeLocalSession(id, options) {
@@ -35612,4 +35633,4 @@ export {
35612
35633
  CloudManagedSandboxExpiredError
35613
35634
  };
35614
35635
 
35615
- //# debugId=2F3F778626C1E04E64756E2164756E21
35636
+ //# debugId=2F69CD53ED6E55BD64756E2164756E21