Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
fix(connected-apps): keep server/index.ts at the size the ratchet lists
David Neyra79f9da0a959f
diff --git a/server/index.ts b/server/index.tsindex 278e200ad0..0e40ac5e55 100644--- a/server/index.ts+++ b/server/index.ts@@ -646,8 +646,7 @@ import { createDevsReports } from "./host/devs-reports.ts"; import { createSettiimport { createCardRequester, linePersonKey } from "./host/thread-person.ts"; import { selfThreadRefusal } from "./host/self-threads.ts"; import { lookedAfterBy } from "./host/looked-after.ts"; import { createActingPeople, HANDED_PEOPLE_FILE, HandedPeople, type HandedRun, keptPrivate, privateHandBack, withPerson } from "./host/acting-person.ts"; import { createTurnCallSignals } from "./host/turn-call-signals.ts";import { createThreadRoutes } from "./routes/threads.ts";import { createWebhookRoutes } from "./routes/webhooks.ts";-import { accountsByApp, withAccountHint } from "./connector-account-hint.ts";-import { withScopeHint } from "./connector-scope-hint.ts";+import { withScopeHint } from "./connector-scope-hint.ts"; import { accountsByApp, withAccountHint } from "./connector-account-hint.ts";import { connectorFileDeps, connectorFileScope, prepareConnectorFiles, withMissingFileHint } from "./connector-files.ts";import { createConnectorCards } from "./host/connector-cards.ts";import { createLoginMailCodes } from "./host/login-mail-codes.ts"; import { createLateToolResults } from "./host/late-tool-results.ts"; import { internalBodyRefusal } from "./host/internal-body-ids.ts";@@ -14417,12 +14416,7 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {};if (upstream.transportSessionId) headers["mcp-session-id"] = upstream.transportSessionId; if (connectorCalls.length) connectionHealth.appCall({ ...(internalCapability.connectorsFor ? { person: internalCapability.connectorsFor } : {}), slugs: connectorCalls.map((one) => one.slug), status: upstream.status, bytes: upstream.bytes, contentType: upstream.contentType });res.writeHead(upstream.status, headers);- // A call refused for the connected account it used names the other accounts of that app, so the bot tries them- // before it tells the person it has no access.- const callSlugs = connectorCalls.map((call) => call.slug);- const answered = proactive.fence.confines(internalCapability.threadId) ? recordsAnswer(upstream.bytes, upstream.contentType) : upstream.bytes;- const hinted = withMissingFileHint(withScopeHint(answered, upstream.contentType, callSlugs), upstream.contentType, callSlugs);- return res.end(Buffer.from(await withAccountHint(hinted, upstream.contentType, callSlugs, () => composio.connectedServices(...teamConnections.via(actor.access)).then(accountsByApp))));+ return res.end(Buffer.from(await withAccountHint(withMissingFileHint(withScopeHint(proactive.fence.confines(internalCapability.threadId) ? recordsAnswer(upstream.bytes, upstream.contentType) : upstream.bytes, upstream.contentType, connectorCalls.map((call) => call.slug)), upstream.contentType, connectorCalls.map((call) => call.slug)), upstream.contentType, connectorCalls.map((call) => call.slug), () => composio.connectedServices(...teamConnections.via(actor.access)).then(accountsByApp))));}if (path === "/api/internal/computer-control") {const botId = url.searchParams.get("botId") ?? "";