@letta-ai/letta-code 0.34.12 → 0.34.14
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/agent-presets.js +1 -1
- package/dist/agent-presets.js.map +3 -3
- package/dist/app-server-client.cjs +2 -2
- package/dist/app-server-client.cjs.map +3 -3
- package/dist/app-server-client.js +2 -2
- package/dist/app-server-client.js.map +3 -3
- package/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/mcp-oauth.js +41 -13
- package/dist/mcp-oauth.js.map +7 -6
- package/dist/types/agent/agent-tags.d.ts +4 -0
- package/dist/types/agent/agent-tags.d.ts.map +1 -1
- package/dist/types/agent/skills.d.ts.map +1 -1
- package/dist/types/agent/subagents/index.d.ts.map +1 -1
- package/dist/types/auth/oauth.d.ts +2 -0
- package/dist/types/auth/oauth.d.ts.map +1 -1
- package/dist/types/backend/local/local-backend.d.ts +1 -0
- package/dist/types/backend/local/local-backend.d.ts.map +1 -1
- package/dist/types/backend/local/local-store.d.ts +2 -13
- package/dist/types/backend/local/local-store.d.ts.map +1 -1
- package/dist/types/backend/local/local-transcript.d.ts +9 -5
- package/dist/types/backend/local/local-transcript.d.ts.map +1 -1
- package/dist/types/browser-device-mcp-oauth.d.ts +15 -0
- package/dist/types/browser-device-mcp-oauth.d.ts.map +1 -1
- package/dist/types/cli/subcommands/mcp-connect.d.ts +1 -1
- package/dist/types/cli/subcommands/mcp-connect.d.ts.map +1 -1
- package/dist/types/cli/subcommands/mcp-io.d.ts.map +1 -1
- package/dist/types/cli/subcommands/mcp.d.ts.map +1 -1
- package/dist/types/mcp-oauth-callback.d.ts +10 -1
- package/dist/types/mcp-oauth-callback.d.ts.map +1 -1
- package/dist/types/mcp-oauth-client-name.d.ts +9 -0
- package/dist/types/mcp-oauth-client-name.d.ts.map +1 -0
- package/dist/types/mcp-oauth-public.d.ts +14 -0
- package/dist/types/mcp-oauth-public.d.ts.map +1 -1
- package/dist/types/mcp-oauth.d.ts +14 -0
- package/dist/types/mcp-oauth.d.ts.map +1 -1
- package/dist/types/tools/impl/claude-stream-session.d.ts.map +1 -1
- package/dist/types/tools/impl/codex-app-server.d.ts +4 -0
- package/dist/types/tools/impl/codex-app-server.d.ts.map +1 -1
- package/dist/types/tools/impl/external-coding-agent-task.d.ts +2 -1
- package/dist/types/tools/impl/external-coding-agent-task.d.ts.map +1 -1
- package/dist/types/tools/impl/external-coding-agent.d.ts +1 -1
- package/dist/types/tools/impl/external-coding-agent.d.ts.map +1 -1
- package/dist/types/tools/impl/kill-bash.d.ts.map +1 -1
- package/dist/types/tools/impl/monitor-backup.d.ts +43 -0
- package/dist/types/tools/impl/monitor-backup.d.ts.map +1 -0
- package/dist/types/tools/impl/monitor.d.ts +2 -0
- package/dist/types/tools/impl/monitor.d.ts.map +1 -1
- package/dist/types/tools/impl/opencode-server.d.ts +36 -0
- package/dist/types/tools/impl/opencode-server.d.ts.map +1 -0
- package/dist/types/tools/impl/opencode-session.d.ts +47 -0
- package/dist/types/tools/impl/opencode-session.d.ts.map +1 -0
- package/dist/types/tools/impl/remote-external-coding-agent.d.ts.map +1 -1
- package/dist/types/tools/impl/send-agent-message.d.ts.map +1 -1
- package/dist/types/types/app-server-info.d.ts +2 -0
- package/dist/types/types/app-server-info.d.ts.map +1 -1
- package/dist/types/types/file-write-protocol.d.ts +41 -0
- package/dist/types/types/file-write-protocol.d.ts.map +1 -0
- package/dist/types/types/protocol_v2.d.ts +2 -16
- package/dist/types/types/protocol_v2.d.ts.map +1 -1
- package/dist/types/utils/systemd-workload-scope.d.ts.map +1 -1
- package/letta.js +4561 -3603
- package/npm-shrinkwrap.json +8 -8
- package/package.json +2 -2
- package/scripts/source-file-size-baseline.json +3 -3
- package/skills/creating-skills/scripts/package-skill.ts +18 -8
- package/skills/managing-agent-webhooks/SKILL.md +305 -0
- package/skills/managing-agent-webhooks/scripts/manage-agent-webhooks.mjs +1364 -0
- package/skills/working-across-computers/references/connect-a-computer-for-remote-access.md +26 -3
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.34.
|
|
17395
|
+
version: "0.34.14"
|
|
17396
17396
|
};
|
|
17397
17397
|
async function connectMcpServer(config2, options = {}) {
|
|
17398
17398
|
let client = new Client(options.clientInfo ?? DEFAULT_CLIENT_INFO);
|
|
@@ -17583,17 +17583,17 @@ async function startOAuthCallbackServerOnPort(port) {
|
|
|
17583
17583
|
let completed = false;
|
|
17584
17584
|
let settle;
|
|
17585
17585
|
let reject;
|
|
17586
|
-
const
|
|
17587
|
-
settle = (
|
|
17586
|
+
const callbackPromise = new Promise((resolve, rejectPromise) => {
|
|
17587
|
+
settle = (result) => {
|
|
17588
17588
|
completed = true;
|
|
17589
|
-
resolve(
|
|
17589
|
+
resolve(result);
|
|
17590
17590
|
};
|
|
17591
17591
|
reject = (error2) => {
|
|
17592
17592
|
completed = true;
|
|
17593
17593
|
rejectPromise(error2);
|
|
17594
17594
|
};
|
|
17595
17595
|
});
|
|
17596
|
-
|
|
17596
|
+
callbackPromise.catch(() => {
|
|
17597
17597
|
return;
|
|
17598
17598
|
});
|
|
17599
17599
|
server = createServer((request, response) => {
|
|
@@ -17624,6 +17624,7 @@ async function startOAuthCallbackServerOnPort(port) {
|
|
|
17624
17624
|
const error2 = url2.searchParams.get("error");
|
|
17625
17625
|
const code = url2.searchParams.get("code");
|
|
17626
17626
|
const state = url2.searchParams.get("state");
|
|
17627
|
+
const domain = url2.searchParams.get("domain");
|
|
17627
17628
|
if (!state || state !== expectedState.value) {
|
|
17628
17629
|
response.writeHead(400, { "Content-Type": "text/html" });
|
|
17629
17630
|
response.end(callbackPage("Authorization failed", "Invalid OAuth callback"));
|
|
@@ -17643,7 +17644,7 @@ async function startOAuthCallbackServerOnPort(port) {
|
|
|
17643
17644
|
return;
|
|
17644
17645
|
}
|
|
17645
17646
|
response.writeHead(200, { "Content-Type": "text/html" });
|
|
17646
|
-
settle?.(code);
|
|
17647
|
+
settle?.(domain ? { code, domain } : { code });
|
|
17647
17648
|
response.end(callbackPage("Authorization complete", "You can close this tab and return to Letta Code."), () => {
|
|
17648
17649
|
closeServer(true);
|
|
17649
17650
|
});
|
|
@@ -17684,7 +17685,7 @@ Content-Length: 0\r
|
|
|
17684
17685
|
return {
|
|
17685
17686
|
redirectUrl: `http://127.0.0.1:${address.port}/callback`,
|
|
17686
17687
|
expectedState,
|
|
17687
|
-
|
|
17688
|
+
waitForCallback: () => callbackPromise.finally(() => clearTimeout(timeout)),
|
|
17688
17689
|
close: () => {
|
|
17689
17690
|
clearTimeout(timeout);
|
|
17690
17691
|
if (!completed)
|
|
@@ -17709,6 +17710,21 @@ function escapeHtml(value) {
|
|
|
17709
17710
|
});
|
|
17710
17711
|
}
|
|
17711
17712
|
|
|
17713
|
+
// src/mcp-oauth-client-name.ts
|
|
17714
|
+
var DEFAULT_MCP_OAUTH_CLIENT_NAME = "Letta Code";
|
|
17715
|
+
var MAX_MCP_OAUTH_CLIENT_NAME_LENGTH = 64;
|
|
17716
|
+
function resolveMcpOAuthClientName(clientName) {
|
|
17717
|
+
if (clientName === undefined)
|
|
17718
|
+
return DEFAULT_MCP_OAUTH_CLIENT_NAME;
|
|
17719
|
+
const trimmed = clientName.trim();
|
|
17720
|
+
if (!trimmed)
|
|
17721
|
+
throw new Error("MCP OAuth client name must not be empty");
|
|
17722
|
+
if (trimmed.length > MAX_MCP_OAUTH_CLIENT_NAME_LENGTH) {
|
|
17723
|
+
throw new Error(`MCP OAuth client name must be at most ${MAX_MCP_OAUTH_CLIENT_NAME_LENGTH} characters`);
|
|
17724
|
+
}
|
|
17725
|
+
return trimmed;
|
|
17726
|
+
}
|
|
17727
|
+
|
|
17712
17728
|
// src/mcp-oauth-identity.ts
|
|
17713
17729
|
import { createHash } from "node:crypto";
|
|
17714
17730
|
function mcpOAuthCredentialKey(agentId, serverName, serverUrl) {
|
|
@@ -17865,6 +17881,7 @@ var credentialCoordinators = new Map;
|
|
|
17865
17881
|
var storageObjectIds = new WeakMap;
|
|
17866
17882
|
var nextStorageObjectId = 1;
|
|
17867
17883
|
async function createMcpOAuthSessionWithStorage(options) {
|
|
17884
|
+
const clientName = resolveMcpOAuthClientName(options.clientName);
|
|
17868
17885
|
const coordinationKey = storageCoordinationKey(options.storage, options.credentialKey, options.storageNamespace);
|
|
17869
17886
|
retainCredentialCoordinator(coordinationKey);
|
|
17870
17887
|
let provider;
|
|
@@ -17892,13 +17909,20 @@ async function createMcpOAuthSessionWithStorage(options) {
|
|
|
17892
17909
|
onStatus: options.onStatus,
|
|
17893
17910
|
openBrowser: options.openBrowser ?? openSystemBrowser,
|
|
17894
17911
|
expectedState: callback?.expectedState,
|
|
17895
|
-
generation: loaded.generation
|
|
17912
|
+
generation: loaded.generation,
|
|
17913
|
+
clientName
|
|
17896
17914
|
});
|
|
17897
17915
|
const activeProvider = provider;
|
|
17898
17916
|
const activeCallback = callback;
|
|
17899
17917
|
return {
|
|
17900
17918
|
authProvider: activeProvider,
|
|
17901
|
-
...activeCallback ? {
|
|
17919
|
+
...activeCallback ? {
|
|
17920
|
+
waitForAuthorizationCode: async () => {
|
|
17921
|
+
const { code, domain } = await activeCallback.waitForCallback();
|
|
17922
|
+
options.onAuthorizationCallback?.({ domain });
|
|
17923
|
+
return code;
|
|
17924
|
+
}
|
|
17925
|
+
} : {},
|
|
17902
17926
|
exportCredentials: () => activeProvider.exportCredentials(),
|
|
17903
17927
|
closeCallback: async () => activeCallback?.close(),
|
|
17904
17928
|
close: async () => {
|
|
@@ -17934,6 +17958,7 @@ class PersistentMcpOAuthProvider {
|
|
|
17934
17958
|
onStatus;
|
|
17935
17959
|
openBrowser;
|
|
17936
17960
|
expectedState;
|
|
17961
|
+
clientName;
|
|
17937
17962
|
closed = false;
|
|
17938
17963
|
constructor(options) {
|
|
17939
17964
|
this.credentialKey = options.credentialKey;
|
|
@@ -17943,6 +17968,7 @@ class PersistentMcpOAuthProvider {
|
|
|
17943
17968
|
this.onStatus = options.onStatus;
|
|
17944
17969
|
this.openBrowser = options.openBrowser;
|
|
17945
17970
|
this.expectedState = options.expectedState;
|
|
17971
|
+
this.clientName = options.clientName;
|
|
17946
17972
|
this.generation = options.generation;
|
|
17947
17973
|
const coordinator = getCredentialCoordinator(options.coordinationKey);
|
|
17948
17974
|
this.coordinatorValue = coordinator;
|
|
@@ -17962,7 +17988,7 @@ class PersistentMcpOAuthProvider {
|
|
|
17962
17988
|
}
|
|
17963
17989
|
get clientMetadata() {
|
|
17964
17990
|
return {
|
|
17965
|
-
client_name:
|
|
17991
|
+
client_name: this.clientName,
|
|
17966
17992
|
redirect_uris: [this.redirectUrl],
|
|
17967
17993
|
grant_types: ["authorization_code", "refresh_token"],
|
|
17968
17994
|
response_types: ["code"],
|
|
@@ -18432,7 +18458,7 @@ async function authorizeMcpServerWithStorage(options) {
|
|
|
18432
18458
|
throw new Error("MCP OAuth storage namespace must be non-empty and contain no NUL bytes");
|
|
18433
18459
|
}
|
|
18434
18460
|
const credentialKey = mcpOAuthCredentialKey(options.agentId, options.serverName, options.serverUrl);
|
|
18435
|
-
const flightKey = `${options.storageNamespace}\x00${credentialKey}\x00${fetchIdentity(options.fetch)}`;
|
|
18461
|
+
const flightKey = `${options.storageNamespace}\x00${credentialKey}\x00${fetchIdentity(options.fetch)}\x00${options.clientName ?? ""}`;
|
|
18436
18462
|
let flight = inFlightAuthorizations.get(flightKey);
|
|
18437
18463
|
if (!flight) {
|
|
18438
18464
|
const controller = new AbortController;
|
|
@@ -18462,7 +18488,9 @@ async function runAuthorization(options, credentialKey, signal) {
|
|
|
18462
18488
|
storage,
|
|
18463
18489
|
interactive: true,
|
|
18464
18490
|
openBrowser: options.openBrowser,
|
|
18465
|
-
onStatus: options.onStatus
|
|
18491
|
+
onStatus: options.onStatus,
|
|
18492
|
+
onAuthorizationCallback: options.onAuthorizationCallback,
|
|
18493
|
+
clientName: options.clientName
|
|
18466
18494
|
});
|
|
18467
18495
|
let oauth;
|
|
18468
18496
|
try {
|
|
@@ -18578,4 +18606,4 @@ export {
|
|
|
18578
18606
|
authorizeMcpServerWithStorage
|
|
18579
18607
|
};
|
|
18580
18608
|
|
|
18581
|
-
//# debugId=
|
|
18609
|
+
//# debugId=6B58BCFFD3DE56CB64756E2164756E21
|