Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

refactor(cli): rename LocalToolkitSlugs.match to longestPrefix (#4145)

Alberto Schiabela71b812db1b0
diff --git a/ts/packages/cli/src/effects/toolkit-from-tool-slug.ts b/ts/packages/cli/src/effects/toolkit-from-tool-slug.ts
index 35fedd945..7f27889c7 100644
--- a/ts/packages/cli/src/effects/toolkit-from-tool-slug.ts
+++ b/ts/packages/cli/src/effects/toolkit-from-tool-slug.ts
@@ -38,7 +38,7 @@ export const toolkitFromToolSlug = (
const catalog = yield* ToolkitSlugCatalog;
const local = yield* catalog.local;
- const match = local.match(toolSlug);
+ const match = local.longestPrefix(toolSlug);
if (match !== undefined) {
return toolkitFromMatchedPrefix(match);
}
diff --git a/ts/packages/cli/src/services/toolkit-slug-catalog.ts b/ts/packages/cli/src/services/toolkit-slug-catalog.ts
index 830c057af..41047b728 100644
--- a/ts/packages/cli/src/services/toolkit-slug-catalog.ts
+++ b/ts/packages/cli/src/services/toolkit-slug-catalog.ts
@@ -74,7 +74,7 @@ export interface LocalToolkitSlugs {
* or undefined when nothing local matches — which is what a toolkit released
* after this binary looks like.
*/
- readonly match: (toolSlug: string) => string | undefined;
+ readonly longestPrefix: (toolSlug: string) => string | undefined;
}
const loadLocalToolkitSlugs = Effect.gen(function* () {
@@ -83,7 +83,7 @@ const loadLocalToolkitSlugs = Effect.gen(function* () {
yield* refreshInBackgroundIfStale(learned);
- return { slugs, match: makeLongestPrefixMatcher(slugs) } satisfies LocalToolkitSlugs;
+ return { slugs, longestPrefix: makeLongestPrefixMatcher(slugs) } satisfies LocalToolkitSlugs;
});
/**