INNER CODE UNIT · JavaScript

mcpEnsureInitialized

EdgeTypE/better-deepseek · src/background/index.js:730

async function mcpEnsureInitialized(serverUrl, apiKey) {
  const key = `${serverUrl}|${apiKey}`;
  const cached = mcpInitCache.get(key);
  if (cached) {
    await cached.initialized;
    return { sessionId: cached.sessionId, authMethod: cached.authMethod };
  }

  const entry = { initialized: null, sessionId: null, authMethod: "bearer" };
  mcpInitCache.set(key, entry);

  const initBody = {
    jsonrpc: "2.0", id: 1, method: "initialize",
    params: {
      protocolVersion: "2024-11-05",
      capabilities: {},
      clientInfo: { name: "better-deepseek", version: getExtensionVersion() },
    },

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…