@letta-ai/letta-code 0.33.7 → 0.34.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.
Files changed (77) hide show
  1. package/dist/agent-presets.js +2 -2
  2. package/dist/agent-presets.js.map +2 -2
  3. package/dist/ask-user-question.cjs +128 -0
  4. package/dist/ask-user-question.cjs.map +10 -0
  5. package/dist/ask-user-question.js +88 -0
  6. package/dist/ask-user-question.js.map +10 -0
  7. package/dist/channels-public.js.map +1 -1
  8. package/dist/gateway-core.js +6 -20
  9. package/dist/gateway-core.js.map +5 -6
  10. package/dist/mcp-client.js +8 -7
  11. package/dist/mcp-client.js.map +3 -3
  12. package/dist/mcp-oauth.js +23 -9
  13. package/dist/mcp-oauth.js.map +4 -4
  14. package/dist/types/agent/skills.d.ts.map +1 -1
  15. package/dist/types/agent-settings.d.ts +23 -0
  16. package/dist/types/agent-settings.d.ts.map +1 -0
  17. package/dist/types/ask-user-question.d.ts +31 -0
  18. package/dist/types/ask-user-question.d.ts.map +1 -0
  19. package/dist/types/backend/dev/pi-ollama-provider.d.ts +7 -16
  20. package/dist/types/backend/dev/pi-ollama-provider.d.ts.map +1 -1
  21. package/dist/types/channels/gateway-core.d.ts.map +1 -1
  22. package/dist/types/channels/message-channel-formatting.d.ts.map +1 -1
  23. package/dist/types/cli/helpers/tool-name-mapping.d.ts +0 -8
  24. package/dist/types/cli/helpers/tool-name-mapping.d.ts.map +1 -1
  25. package/dist/types/constants.d.ts +1 -1
  26. package/dist/types/constants.d.ts.map +1 -1
  27. package/dist/types/experiments/manager.d.ts.map +1 -1
  28. package/dist/types/experiments/types.d.ts +1 -1
  29. package/dist/types/experiments/types.d.ts.map +1 -1
  30. package/dist/types/mcp-client.d.ts +4 -0
  31. package/dist/types/mcp-client.d.ts.map +1 -1
  32. package/dist/types/mcp-oauth-public.d.ts +10 -1
  33. package/dist/types/mcp-oauth-public.d.ts.map +1 -1
  34. package/dist/types/permissions/checker.d.ts.map +1 -1
  35. package/dist/types/settings-manager.d.ts +5 -14
  36. package/dist/types/settings-manager.d.ts.map +1 -1
  37. package/dist/types/telemetry/error-reporting.d.ts +8 -0
  38. package/dist/types/telemetry/error-reporting.d.ts.map +1 -1
  39. package/dist/types/telemetry/index.d.ts +2 -7
  40. package/dist/types/telemetry/index.d.ts.map +1 -1
  41. package/dist/types/tools/client-preferences.d.ts +8 -0
  42. package/dist/types/tools/client-preferences.d.ts.map +1 -0
  43. package/dist/types/tools/impl/ask-user-question.d.ts +6 -18
  44. package/dist/types/tools/impl/ask-user-question.d.ts.map +1 -1
  45. package/dist/types/tools/impl/monitor.d.ts +0 -1
  46. package/dist/types/tools/impl/monitor.d.ts.map +1 -1
  47. package/dist/types/tools/impl/watch-pr.d.ts.map +1 -1
  48. package/dist/types/tools/manager.d.ts.map +1 -1
  49. package/dist/types/tools/tool-definitions.d.ts +1 -1
  50. package/dist/types/tools/toolset-catalog.d.ts +1 -1
  51. package/dist/types/tools/toolset-catalog.d.ts.map +1 -1
  52. package/dist/types/tools/toolset.d.ts.map +1 -1
  53. package/dist/types/types/client-preferences.d.ts +7 -0
  54. package/dist/types/types/client-preferences.d.ts.map +1 -0
  55. package/dist/types/types/protocol_v2.d.ts +5 -8
  56. package/dist/types/types/protocol_v2.d.ts.map +1 -1
  57. package/dist/types/types/teleport-protocol.d.ts +3 -0
  58. package/dist/types/types/teleport-protocol.d.ts.map +1 -1
  59. package/dist/types/utils/task-notifications.d.ts +0 -1
  60. package/dist/types/utils/task-notifications.d.ts.map +1 -1
  61. package/dist/types/websocket/listener/protocol-outbound.d.ts.map +1 -1
  62. package/dist/types/websocket/listener/queue.d.ts.map +1 -1
  63. package/dist/types/websocket/listener/runtime.d.ts.map +1 -1
  64. package/dist/types/websocket/listener/types.d.ts +1 -9
  65. package/dist/types/websocket/listener/types.d.ts.map +1 -1
  66. package/image-resize-worker.js +2 -6449
  67. package/letta.js +41728 -41891
  68. package/package.json +16 -2
  69. package/scripts/isolated-unit-tests.json +10 -0
  70. package/scripts/smoke-image-worker.mjs +68 -0
  71. package/scripts/source-file-size-baseline.json +13 -13
  72. package/scripts/stage-pypi-deps.mjs +1 -11
  73. package/scripts/unit-test-impact.test.cjs +2 -1
  74. package/skills/curating-memory-palace/SKILL.md +147 -0
  75. package/skills/initializing-memory/SKILL.md +1 -1
  76. package/dist/types/tools/interactive-policy.d.ts +0 -12
  77. package/dist/types/tools/interactive-policy.d.ts.map +0 -1
package/dist/mcp-oauth.js CHANGED
@@ -17392,7 +17392,7 @@ class StreamableHTTPClientTransport {
17392
17392
  // src/mcp-client.ts
17393
17393
  var DEFAULT_CLIENT_INFO = {
17394
17394
  name: "letta-code",
17395
- version: "0.33.7"
17395
+ version: "0.34.0"
17396
17396
  };
17397
17397
  async function connectMcpServer(config2, options = {}) {
17398
17398
  let client = new Client(options.clientInfo ?? DEFAULT_CLIENT_INFO);
@@ -17481,7 +17481,7 @@ function createTransport(config2, options) {
17481
17481
  return new StreamableHTTPClientTransport(new URL(config2.url), {
17482
17482
  requestInit: headersRequestInit(headers),
17483
17483
  authProvider: options.oauth?.authProvider,
17484
- fetch: abortAwareFetch(options.signal)
17484
+ fetch: abortAwareFetch(options.signal, undefined, options.fetch)
17485
17485
  });
17486
17486
  }
17487
17487
  if (config2.transport === "sse") {
@@ -17490,7 +17490,7 @@ function createTransport(config2, options) {
17490
17490
  return new SSEClientTransport(new URL(config2.url), {
17491
17491
  requestInit,
17492
17492
  authProvider: options.oauth?.authProvider,
17493
- fetch: abortAwareFetch(options.signal, headers)
17493
+ fetch: abortAwareFetch(options.signal, headers, options.fetch)
17494
17494
  });
17495
17495
  }
17496
17496
  return new StdioClientTransport({
@@ -17501,13 +17501,14 @@ function createTransport(config2, options) {
17501
17501
  stderr: options.stderr ?? "inherit"
17502
17502
  });
17503
17503
  }
17504
- function abortAwareFetch(operationSignal, headers) {
17504
+ function abortAwareFetch(operationSignal, headers, fetchFn) {
17505
17505
  if (!operationSignal && !headers)
17506
- return;
17506
+ return fetchFn;
17507
+ const request = fetchFn ?? fetch;
17507
17508
  return (url2, init) => {
17508
17509
  const requestInit = headers ? mergeHeaders(init, headers) : { ...init };
17509
17510
  const requestSignal = requestInit.signal ?? undefined;
17510
- return fetch(url2, {
17511
+ return request(url2, {
17511
17512
  ...requestInit,
17512
17513
  signal: operationSignal && requestSignal ? AbortSignal.any([operationSignal, requestSignal]) : operationSignal ?? requestSignal
17513
17514
  });
@@ -18387,13 +18388,15 @@ function isRecord2(value) {
18387
18388
 
18388
18389
  // src/mcp-oauth-public.ts
18389
18390
  var inFlightAuthorizations = new Map;
18391
+ var fetchFunctionIds = new WeakMap;
18392
+ var nextFetchFunctionId = 1;
18390
18393
  async function authorizeMcpServerWithStorage(options) {
18391
18394
  options.signal?.throwIfAborted();
18392
18395
  if (!options.storageNamespace.trim() || options.storageNamespace.includes("\x00")) {
18393
18396
  throw new Error("MCP OAuth storage namespace must be non-empty and contain no NUL bytes");
18394
18397
  }
18395
18398
  const credentialKey = mcpOAuthCredentialKey(options.agentId, options.serverName, options.serverUrl);
18396
- const flightKey = `${options.storageNamespace}\x00${credentialKey}`;
18399
+ const flightKey = `${options.storageNamespace}\x00${credentialKey}\x00${fetchIdentity(options.fetch)}`;
18397
18400
  let flight = inFlightAuthorizations.get(flightKey);
18398
18401
  if (!flight) {
18399
18402
  const controller = new AbortController;
@@ -18448,13 +18451,24 @@ async function runAuthorization(options, credentialKey, signal) {
18448
18451
  name: options.serverName,
18449
18452
  transport: "http",
18450
18453
  url: options.serverUrl
18451
- }, { oauth, signal });
18454
+ }, { fetch: options.fetch, oauth, signal });
18452
18455
  return await withAbort2(oauth.exportCredentials(), signal);
18453
18456
  } finally {
18454
18457
  signal.removeEventListener("abort", cancel);
18455
18458
  await Promise.allSettled([connection?.close(), oauth.close()]);
18456
18459
  }
18457
18460
  }
18461
+ function fetchIdentity(fetchFn) {
18462
+ if (!fetchFn)
18463
+ return "default";
18464
+ let id = fetchFunctionIds.get(fetchFn);
18465
+ if (id === undefined) {
18466
+ id = nextFetchFunctionId;
18467
+ nextFetchFunctionId += 1;
18468
+ fetchFunctionIds.set(fetchFn, id);
18469
+ }
18470
+ return String(id);
18471
+ }
18458
18472
  function abortableStorage(storage, signal) {
18459
18473
  return {
18460
18474
  get: (credentialKey) => runStorageOperation(() => storage.get(credentialKey, signal), signal),
@@ -18528,4 +18542,4 @@ export {
18528
18542
  authorizeMcpServerWithStorage
18529
18543
  };
18530
18544
 
18531
- //# debugId=CBB3C549FD34BF3364756E2164756E21
18545
+ //# debugId=8C6EE428F13188E264756E2164756E21