Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

#6432: take the app of a refused call from the shared toolkitOf

milind-soni7bdb7f534a6e
diff --git a/server/connector-account-hint.ts b/server/connector-account-hint.ts
index 87c98ebe7b..efd010c33d 100644
--- a/server/connector-account-hint.ts
+++ b/server/connector-account-hint.ts
@@ -6,6 +6,7 @@
// something the bot can act on; this one names the other accounts of the same app, so the bot tries them before it
// tells the person it has no access.
+import { toolkitOf } from "../shared/connector-scopes.ts";
import { annotateFailedCall } from "./connector-scope-hint.ts";
/** GitHub's wording when the connected account's app installation cannot reach what the call asks for. */
@@ -24,12 +25,6 @@ export interface ConnectedAccount {
/** The accounts of every connected app, by app slug. */
export type ConnectedAccounts = Record<string, readonly ConnectedAccount[]>;
-/** The app a Composio tool slug belongs to: the part before the first underscore, lower case. */
-export function toolkitOf(slug: string): string {
- const cut = slug.indexOf("_");
- return (cut > 0 ? slug.slice(0, cut) : slug).toLowerCase();
-}
-
function appName(toolkit: string): string {
if (toolkit === "gmail") return "Gmail";
if (toolkit === "github") return "GitHub";