@devries-cameron20 / composio Mirror · read-only / commits / bf3efaa27
Fork 0

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

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 16:00 UTC

chore(cli): bake the toolkit slug catalog into the CLI

Resolving a tool slug to its toolkit needs the catalog, but the catalog is ~800 KB of metadata to learn ~11 KB of slugs. Check the slugs in as generated source so the CLI starts out knowing them. Adds the generator (paginates the production catalog, keeps native toolkits, sorts and dedupes), the checked-in list, a guard test, and a weekly workflow that opens a refresh PR when the catalog moves. The generator refuses to write a list that is short, malformed, or missing staple toolkits, so a bad or wrong-scoped credential aborts before overwriting a good list. The binary build warns when the list is older than two weeks, and never fails on it. Nothing reads the list yet.

jkomyno committed Aug 4, 2026 at 19:18 UTC bf3efaa2706da97ac67997d4a2476777fe8ab7b6
7 files changed +1466 -5
.github/workflows/build-cli-binaries.yml
+16
@@ -70,6 +70,22 @@ jobs:
70 COMMIT_SHA: ${{ github.sha }}
71 run: bash .github/scripts/cli-release/resolve-release-target.sh
72
73 + # The baked toolkit slugs decide whether `composio execute` resolves a
74 + # toolkit locally or pays for a catalog fetch. A stale list is never
75 + # wrong, only slow, so this warns and never blocks a release.
76 + # Refresh with the `CLI - Update Toolkit Slugs` workflow.
77 + - name: Check baked toolkit slugs freshness
78 + continue-on-error: true
79 + run: |
80 + set -euo pipefail
81 + refreshed_at=$(sed -n "s/.*BAKED_TOOLKIT_SLUGS_REFRESHED_AT = '\(.*\)'.*/\1/p" \
82 + ts/packages/cli/src/generated/toolkit-slugs.ts)
83 + age_days=$(( ( $(date -u +%s) - $(date -u -d "$refreshed_at" +%s) ) / 86400 ))
84 + echo "Baked toolkit slugs were refreshed $age_days day(s) ago ($refreshed_at)."
85 + if [ "$age_days" -gt 14 ]; then
86 + echo "::warning::Baked toolkit slugs are $age_days days old. Run the 'CLI - Update Toolkit Slugs' workflow."
87 + fi
88 +
89 build:
90 name: Build ${{ matrix.artifact }}
91 needs: prepare
.github/workflows/cli.update-toolkit-slugs.yml new
+90
@@ -0,0 +1,90 @@
1 +name: CLI - Update Toolkit Slugs
2 +
3 +# Keeps `ts/packages/cli/src/generated/toolkit-slugs.ts` in step with the
4 +# production catalog. The CLI resolves a tool slug to its toolkit by matching
5 +# against that list, and only pays for a network fetch when a slug is missing
6 +# from it — so a stale list costs users a ~2 s fetch, never a wrong answer.
7 +
8 +on:
9 + schedule:
10 + # Weekly, Monday morning UTC. New toolkits ship continuously; users of an
11 + # older binary fall back to the runtime fetch until their next upgrade.
12 + - cron: '0 6 * * 1'
13 + workflow_dispatch:
14 +
15 +permissions:
16 + contents: read
17 +
18 +jobs:
19 + update-toolkit-slugs:
20 + name: Refresh baked toolkit slugs
21 + runs-on: ubuntu-latest
22 + permissions:
23 + contents: write
24 + pull-requests: write
25 + env:
26 + # The baked list ships to users of the PRODUCTION catalog, and the
27 + # generator targets production unless COMPOSIO_BASE_URL says otherwise.
28 + # `docs-update-data.yml` documents this shared secret as staging-scoped
29 + # and uses `secrets.COMPOSIO_DOCS_API_KEY` for its own production reads.
30 + # If the first run 401s, that is the secret to swap in here: the sanity
31 + # gate in the generator aborts before writing anything, so a wrong-scoped
32 + # key fails loudly instead of baking a partial catalog.
33 + COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }}
34 +
35 + steps:
36 + - name: Generate GitHub App token
37 + id: app-token
38 + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
39 + with:
40 + client-id: ${{ vars.RELEASE_BOT_CLIENT_ID }}
41 + private-key: ${{ secrets.RELEASE_BOT_APP_PRIVATE_KEY }}
42 +
43 + - name: Checkout repository
44 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
45 + with:
46 + token: ${{ steps.app-token.outputs.token }}
47 +
48 + - name: Setup Node.js, pnpm, Bun
49 + uses: ./.github/actions/setup-node-pnpm-bun
50 +
51 + - name: Install dependencies
52 + run: pnpm install --frozen-lockfile
53 +
54 + - name: Refresh toolkit slugs
55 + run: pnpm --filter @composio/cli generate:toolkit-slugs
56 +
57 + - name: Check for changes
58 + id: changes
59 + run: |
60 + set -euo pipefail
61 + if git diff --quiet -- ts/packages/cli/src/generated/toolkit-slugs.ts; then
62 + echo "has_changes=false" >> "$GITHUB_OUTPUT"
63 + echo "Catalog unchanged since the last refresh."
64 + else
65 + echo "has_changes=true" >> "$GITHUB_OUTPUT"
66 + git diff --stat -- ts/packages/cli/src/generated/toolkit-slugs.ts
67 + fi
68 +
69 + - name: Create Pull Request
70 + if: steps.changes.outputs.has_changes == 'true'
71 + uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
72 + with:
73 + token: ${{ steps.app-token.outputs.token }}
74 + commit-message: 'chore(cli): refresh baked toolkit slugs'
75 + title: 'chore(cli): refresh baked toolkit slugs'
76 + body: |
77 + ## Summary
78 + Automated refresh of the toolkit slugs the CLI knows without asking
79 + the API, generated by `ts/packages/cli/scripts/generate-toolkit-slugs.ts`.
80 +
81 + Toolkits added since the last refresh currently cost users one
82 + toolkit-list fetch (~2 s) the first time they run one of that
83 + toolkit's tools. Merging this makes them free.
84 +
85 + The generator refuses to write a list that is short, malformed, or
86 + missing staple toolkits, so a bad fetch opens no PR at all.
87 + branch: chore/cli-refresh-toolkit-slugs
88 + base: next
89 + add-paths: |
90 + ts/packages/cli/src/generated/toolkit-slugs.ts
ts/packages/cli/package.json
+1
@@ -31,6 +31,7 @@
31 "validate:boundaries": "tsx ./scripts/validate-lint-boundaries.ts",
32 "install:binary": "bun run ./scripts/install-binary.ts ./dist/composio",
33 "table:metrics": "bun run ./scripts/optimize-metrics-table.ts",
34 + "generate:toolkit-slugs": "bun run ./scripts/generate-toolkit-slugs.ts",
35 "mock": "bun run ./scripts/copy-mocks-from-cache.ts",
36 "prebuild": "pnpm run typecheck",
37 "build": "tsdown && bun run ./scripts/copy-local-tools-assets.ts ./dist",
ts/packages/cli/scripts/generate-toolkit-slugs.ts new
+224
@@ -0,0 +1,224 @@
1 +import process from 'node:process';
2 +import path from 'node:path';
3 +import { $ } from 'bun';
4 +import {
5 + Config,
6 + ConfigProvider,
7 + Console,
8 + Data,
9 + DateTime,
10 + Effect,
11 + Layer,
12 + Logger,
13 + Option,
14 + Schema,
15 +} from 'effect';
16 +import { FileSystem } from '@effect/platform';
17 +import { BunContext, BunFileSystem, BunRuntime } from '@effect/platform-bun';
18 +import { TOOLKIT_SLUG_PATTERN } from 'src/models/toolkits';
19 +import { teardown } from './_teardown';
20 +
21 +/**
22 + * Usage: `pnpm --filter @composio/cli generate:toolkit-slugs`.
23 + *
24 + * Refreshes `src/generated/toolkit-slugs.ts` — the toolkit slugs the CLI knows
25 + * about without asking the API. Resolving a tool slug to its toolkit needs the
26 + * catalog (`GOOGLE_ANALYTICS_RUN_REPORT` belongs to `google_analytics`, not
27 + * `google`), and downloading ~800 KB of toolkit metadata to learn ~11 KB of
28 + * slugs is most of the wall time of a `composio execute`.
29 + *
30 + * Authentication, in order of preference:
31 + * - `COMPOSIO_USER_API_KEY` (+ `COMPOSIO_ORG_ID`) — a `uak_` key, what a
32 + * logged-in developer has locally.
33 + * - `COMPOSIO_API_KEY` — a project-scoped key, what CI has.
34 + *
35 + * `COMPOSIO_BASE_URL` overrides the API host; it defaults to production
36 + * because the baked list ships to users of the production catalog.
37 + */
38 +
39 +const PRODUCTION_BASE_URL = 'https://backend.composio.dev';
40 +const PAGE_SIZE = 1000;
41 +
42 +/** Slugs the catalog cannot plausibly be missing. */
43 +const SENTINEL_SLUGS = ['github', 'gmail', 'google_analytics'] as const;
44 +
45 +/**
46 + * A catalog this small means we are looking at a partial or wrong response —
47 + * an empty page, a filtered org view, an error body that happened to decode.
48 + * Today's production catalog holds ~1070 toolkits and the backend never
49 + * removes one, so anything below this is a bad fetch, not a shrunken catalog.
50 + */
51 +const MIN_EXPECTED_SLUGS = 1000;
52 +
53 +const ToolkitsPage = Schema.Struct({
54 + items: Schema.Array(
55 + Schema.Struct({
56 + slug: Schema.String,
57 + // `native` toolkits are the shared catalog. Anything else (an org-scoped
58 + // custom toolkit, say) is not knowledge we can bake into a released
59 + // binary for everyone.
60 + type: Schema.optional(Schema.String),
61 + })
62 + ),
63 + next_cursor: Schema.NullishOr(Schema.String),
64 +});
65 +
66 +class ToolkitFetchError extends Data.TaggedError('ToolkitFetchError')<{
67 + readonly message: string;
68 +}> {}
69 +
70 +const authHeaders = Effect.gen(function* () {
71 + const userApiKey = yield* Config.option(Config.string('COMPOSIO_USER_API_KEY'));
72 + const orgId = yield* Config.option(Config.string('COMPOSIO_ORG_ID'));
73 + const apiKey = yield* Config.option(Config.string('COMPOSIO_API_KEY'));
74 +
75 + if (Option.isSome(userApiKey)) {
76 + return {
77 + 'x-user-api-key': userApiKey.value,
78 + ...(Option.isSome(orgId) ? { 'x-org-id': orgId.value } : {}),
79 + };
80 + }
81 +
82 + if (Option.isSome(apiKey)) {
83 + return { 'x-api-key': apiKey.value };
84 + }
85 +
86 + return yield* new ToolkitFetchError({
87 + message: 'Set COMPOSIO_API_KEY, or COMPOSIO_USER_API_KEY (+ COMPOSIO_ORG_ID), and retry.',
88 + });
89 +});
90 +
91 +const fetchPage = (params: { baseUrl: string; headers: Record<string, string>; cursor?: string }) =>
92 + Effect.gen(function* () {
93 + const url = new URL('/api/v3/toolkits', params.baseUrl);
94 + url.searchParams.set('limit', String(PAGE_SIZE));
95 + if (params.cursor) {
96 + url.searchParams.set('cursor', params.cursor);
97 + }
98 +
99 + const response = yield* Effect.tryPromise({
100 + try: () => fetch(url, { headers: params.headers }),
101 + catch: cause => new ToolkitFetchError({ message: `GET ${url.pathname} failed: ${cause}` }),
102 + });
103 +
104 + if (!response.ok) {
105 + const body = yield* Effect.promise(() => response.text());
106 + return yield* new ToolkitFetchError({
107 + message: `GET ${url.pathname} returned ${response.status}: ${body.slice(0, 400)}`,
108 + });
109 + }
110 +
111 + const payload = yield* Effect.tryPromise({
112 + try: () => response.json(),
113 + catch: cause => new ToolkitFetchError({ message: `Response was not JSON: ${cause}` }),
114 + });
115 +
116 + return yield* Schema.decodeUnknown(ToolkitsPage)(payload).pipe(
117 + Effect.mapError(cause => new ToolkitFetchError({ message: `Unexpected response: ${cause}` }))
118 + );
119 + });
120 +
121 +/** Walks the cursor to the end of the catalog. */
122 +const fetchAllSlugs = (params: { baseUrl: string; headers: Record<string, string> }) =>
123 + Effect.gen(function* () {
124 + const slugs: string[] = [];
125 + let cursor: string | undefined = undefined;
126 + let page = 0;
127 +
128 + do {
129 + const result = yield* fetchPage({ ...params, cursor });
130 + page += 1;
131 +
132 + for (const toolkit of result.items) {
133 + if (toolkit.type === undefined || toolkit.type === 'native') {
134 + slugs.push(toolkit.slug.toLowerCase());
135 + }
136 + }
137 +
138 + yield* Effect.logInfo(`Page ${page}: ${result.items.length} toolkits (${slugs.length} kept)`);
139 + cursor = result.next_cursor ?? undefined;
140 + } while (cursor);
141 +
142 + return [...new Set(slugs)].sort();
143 + });
144 +
145 +/**
146 + * Refuses to overwrite a good list with a bad fetch. Every failure mode we can
147 + * cheaply detect — truncated pagination, an org-scoped view, a decoded error
148 + * body — shows up as too few slugs, malformed slugs, or missing staples.
149 + */
150 +const checkSanity = (slugs: ReadonlyArray<string>) =>
151 + Effect.gen(function* () {
152 + if (slugs.length < MIN_EXPECTED_SLUGS) {
153 + return yield* new ToolkitFetchError({
154 + message: `Refusing to write ${slugs.length} slugs; expected at least ${MIN_EXPECTED_SLUGS}.`,
155 + });
156 + }
157 +
158 + const malformed = slugs.filter(slug => !TOOLKIT_SLUG_PATTERN.test(slug));
159 + if (malformed.length > 0) {
160 + return yield* new ToolkitFetchError({
161 + message: `Refusing to write malformed slugs: ${malformed.slice(0, 10).join(', ')}`,
162 + });
163 + }
164 +
165 + const missing = SENTINEL_SLUGS.filter(sentinel => !slugs.includes(sentinel));
166 + if (missing.length > 0) {
167 + return yield* new ToolkitFetchError({
168 + message: `Refusing to write a catalog without ${missing.join(', ')}.`,
169 + });
170 + }
171 + });
172 +
173 +const renderModule = (params: { slugs: ReadonlyArray<string>; refreshedAt: string }) =>
174 + `// Generated by scripts/generate-toolkit-slugs.ts — do not edit by hand.
175 +// Refresh: pnpm --filter @composio/cli generate:toolkit-slugs
176 +
177 +/**
178 + * Toolkit slugs known at build time, sorted. Resolving a tool slug to its
179 + * toolkit is a longest-prefix match against the known catalog, and this list
180 + * answers that without a network call. Toolkits released after this snapshot
181 + * are picked up at runtime; the backend never removes a toolkit, so an entry
182 + * here never goes stale in the other direction.
183 + */
184 +export const BAKED_TOOLKIT_SLUGS: ReadonlyArray<string> = [
185 +${params.slugs.map(slug => ` '${slug}',`).join('\n')}
186 +];
187 +
188 +/** When the list above was generated. */
189 +export const BAKED_TOOLKIT_SLUGS_REFRESHED_AT = '${params.refreshedAt}';
190 +`;
191 +
192 +export function generateToolkitSlugs() {
193 + return Effect.gen(function* () {
194 + const fs = yield* FileSystem.FileSystem;
195 + const baseUrl = yield* Config.string('COMPOSIO_BASE_URL').pipe(
196 + Config.withDefault(PRODUCTION_BASE_URL)
197 + );
198 + const headers = yield* authHeaders;
199 +
200 + yield* Effect.logInfo(`Fetching the toolkit catalog from ${baseUrl}`);
201 + const slugs = yield* fetchAllSlugs({ baseUrl, headers });
202 + yield* checkSanity(slugs);
203 +
204 + const refreshedAt = yield* DateTime.now.pipe(Effect.map(DateTime.formatIso));
205 + const outputPath = path.join(process.cwd(), 'src', 'generated', 'toolkit-slugs.ts');
206 +
207 + yield* fs.makeDirectory(path.dirname(outputPath), { recursive: true });
208 + yield* fs.writeFileString(outputPath, renderModule({ slugs, refreshedAt }));
209 + yield* Effect.promise(() => $`pnpm exec prettier --write ${outputPath}`.quiet());
210 +
211 + yield* Console.log(`Wrote ${slugs.length} toolkit slugs to ${outputPath}`);
212 + });
213 +}
214 +
215 +if (require.main === module) {
216 + generateToolkitSlugs().pipe(
217 + Effect.provide(Logger.pretty),
218 + Effect.provide(BunContext.layer),
219 + Effect.provide(BunFileSystem.layer),
220 + Effect.provide(Layer.setConfigProvider(ConfigProvider.fromEnv())),
221 + Effect.scoped,
222 + BunRuntime.runMain({ teardown })
223 + );
224 +}
ts/packages/cli/src/generated/toolkit-slugs.ts new
+1085
@@ -0,0 +1,1085 @@
1 +// Generated by scripts/generate-toolkit-slugs.ts — do not edit by hand.
2 +// Refresh: pnpm --filter @composio/cli generate:toolkit-slugs
3 +
4 +/**
5 + * Toolkit slugs known at build time, sorted. Resolving a tool slug to its
6 + * toolkit is a longest-prefix match against the known catalog, and this list
7 + * answers that without a network call. Toolkits released after this snapshot
8 + * are picked up at runtime; the backend never removes a toolkit, so an entry
9 + * here never goes stale in the other direction.
10 + */
11 +export const BAKED_TOOLKIT_SLUGS: ReadonlyArray<string> = [
12 + '_1password',
13 + '_21risk',
14 + '_2chat',
15 + 'ably',
16 + 'abstract',
17 + 'abuselpdb',
18 + 'abyssale',
19 + 'accredible_certificates',
20 + 'acculynx',
21 + 'active_campaign',
22 + 'active_trail',
23 + 'addressfinder',
24 + 'addresszen',
25 + 'adrapid',
26 + 'adyntel',
27 + 'aeroleads',
28 + 'affinda',
29 + 'affinity',
30 + 'agencyzoom',
31 + 'agent_mail',
32 + 'agentql',
33 + 'agenty',
34 + 'agiled',
35 + 'agility_cms',
36 + 'ahrefs',
37 + 'ai_ml_api',
38 + 'airtable',
39 + 'aivoov',
40 + 'aiwyn_tax_mcp',
41 + 'alchemy',
42 + 'algodocs',
43 + 'algolia',
44 + 'all_images_ai',
45 + 'alltrails_mcp',
46 + 'alpaca',
47 + 'alpha_vantage',
48 + 'altoviz',
49 + 'alttext_ai',
50 + 'amara',
51 + 'ambee',
52 + 'ambient_weather',
53 + 'amcards',
54 + 'amplitude',
55 + 'anchor_browser',
56 + 'anonyflow',
57 + 'anthropic_administrator',
58 + 'apaleo',
59 + 'api2pdf',
60 + 'api_bible',
61 + 'api_labz',
62 + 'api_ninjas',
63 + 'api_sports',
64 + 'apiflash',
65 + 'apify',
66 + 'apify_mcp',
67 + 'apilio',
68 + 'apipie_ai',
69 + 'apiverve',
70 + 'apollo',
71 + 'appcircle',
72 + 'appdrag',
73 + 'appointo',
74 + 'appveyor',
75 + 'artificial_analysis',
76 + 'aryn',
77 + 'asana',
78 + 'ascora',
79 + 'ashby',
80 + 'asin_data_api',
81 + 'astica_ai',
82 + 'async_interview',
83 + 'attio',
84 + 'autobound',
85 + 'autom',
86 + 'aws_marketplace_mcp',
87 + 'ayrshare',
88 + 'backendless',
89 + 'bamboohr',
90 + 'bannerbear',
91 + 'bart',
92 + 'basecamp',
93 + 'baselinker',
94 + 'baserow',
95 + 'basin',
96 + 'beaconchain',
97 + 'beaconstac',
98 + 'beamer',
99 + 'beeminder',
100 + 'bench',
101 + 'benchmark_email',
102 + 'benzinga',
103 + 'bestbuy',
104 + 'better_proposals',
105 + 'better_stack',
106 + 'bettercontact',
107 + 'bidsketch',
108 + 'big_data_cloud',
109 + 'bigmailer',
110 + 'bigml',
111 + 'bigpicture_io',
112 + 'bitbucket',
113 + 'bitquery',
114 + 'bitwarden',
115 + 'blackbaud',
116 + 'blackboard',
117 + 'blazemeter',
118 + 'blocknative',
119 + 'boldsign',
120 + 'bolna',
121 + 'boloforms',
122 + 'bolt_iot',
123 + 'bonsai',
124 + 'bookingmood',
125 + 'booqable',
126 + 'borneo',
127 + 'botbaba',
128 + 'botpress',
129 + 'botsonic',
130 + 'botstar',
131 + 'bouncer',
132 + 'box',
133 + 'boxhero',
134 + 'brandfetch',
135 + 'breathehr',
136 + 'breeze',
137 + 'breezy_hr',
138 + 'brevo',
139 + 'brex',
140 + 'brightdata',
141 + 'brilliant_directories',
142 + 'browseai',
143 + 'browser_tool',
144 + 'browserbase_tool',
145 + 'browserless',
146 + 'btcpay_server',
147 + 'bubble',
148 + 'bugbug',
149 + 'bugherd',
150 + 'bugsnag',
151 + 'buildkite',
152 + 'builtwith',
153 + 'bunnycdn',
154 + 'byteforms',
155 + 'cabinpanda',
156 + 'cal',
157 + 'calendarhero',
158 + 'calendly',
159 + 'callerapi',
160 + 'callingly',
161 + 'callpage',
162 + 'campaign_cleaner',
163 + 'campayn',
164 + 'canny',
165 + 'canva',
166 + 'canvas',
167 + 'capsule_crm',
168 + 'carbone',
169 + 'cardly',
170 + 'castingwords',
171 + 'cats',
172 + 'cdr_platform',
173 + 'celigo',
174 + 'census_bureau',
175 + 'centralstationcrm',
176 + 'certifier',
177 + 'chaser',
178 + 'chatbotkit',
179 + 'chatfai',
180 + 'chatwork',
181 + 'chmeetings',
182 + 'cincopa',
183 + 'circleci',
184 + 'claid_ai',
185 + 'clarity_ai_mcp',
186 + 'classmarker',
187 + 'clearout',
188 + 'clickhouse',
189 + 'clickmeeting',
190 + 'clicksend',
191 + 'clickup',
192 + 'clientary',
193 + 'clockify',
194 + 'close',
195 + 'cloudcart',
196 + 'cloudconvert',
197 + 'cloudflare',
198 + 'cloudflare_api_key',
199 + 'cloudflare_browser_rendering',
200 + 'cloudinary',
201 + 'cloudlayer',
202 + 'cloudpress',
203 + 'coassemble',
204 + 'coda',
205 + 'codacy',
206 + 'codeinterpreter',
207 + 'codemagic',
208 + 'codereadr',
209 + 'cody',
210 + 'coinbase',
211 + 'coinmarketcal',
212 + 'coinmarketcap',
213 + 'coinranking',
214 + 'college_football_data',
215 + 'commcare',
216 + 'companyenrich',
217 + 'composio',
218 + 'composio_search',
219 + 'confluence',
220 + 'connecteam',
221 + 'constant_contact',
222 + 'contentful',
223 + 'contentful_graphql',
224 + 'context7_mcp',
225 + 'control_d',
226 + 'conversion_tools',
227 + 'convertapi',
228 + 'convex',
229 + 'conveyor',
230 + 'convolo_ai',
231 + 'corrently',
232 + 'countdown_api',
233 + 'coupa',
234 + 'craftmypdf',
235 + 'crowdin',
236 + 'crowterminal',
237 + 'crustdata',
238 + 'cults',
239 + 'curated',
240 + 'currencyscoop',
241 + 'currents_api',
242 + 'cursor',
243 + 'customerio',
244 + 'customgpt',
245 + 'customjs',
246 + 'cutt_ly',
247 + 'd2lbrightspace',
248 + 'dadata_ru',
249 + 'daffy',
250 + 'dailybot',
251 + 'dart',
252 + 'data247',
253 + 'databox',
254 + 'databricks',
255 + 'datadog',
256 + 'dataforseo',
257 + 'datagma',
258 + 'datarobot',
259 + 'datascope',
260 + 'daytona',
261 + 'deadline_funnel',
262 + 'deepgram',
263 + 'deepimage',
264 + 'deepseek',
265 + 'deepwiki_mcp',
266 + 'delighted',
267 + 'demio',
268 + 'deployhq',
269 + 'desktime',
270 + 'detrack',
271 + 'devin_mcp',
272 + 'devto',
273 + 'dialmycalls',
274 + 'dialpad',
275 + 'dice_mcp',
276 + 'dictionary_api',
277 + 'diffbot',
278 + 'digicert',
279 + 'digital_ocean',
280 + 'discord',
281 + 'discordbot',
282 + 'dnsfilter',
283 + 'dock_certs',
284 + 'docker_hub',
285 + 'docmosis',
286 + 'docnify',
287 + 'docparser',
288 + 'docraptor',
289 + 'docsautomator',
290 + 'docsbot_ai',
291 + 'docsumo',
292 + 'docugenerate',
293 + 'documenso',
294 + 'documint',
295 + 'docupilot',
296 + 'docupost',
297 + 'docuseal',
298 + 'docusign',
299 + 'doppler',
300 + 'doppler_marketing_automation',
301 + 'doppler_secretops',
302 + 'dotsimple',
303 + 'dovetail',
304 + 'dpd2',
305 + 'draftable',
306 + 'dreamstudio',
307 + 'dripcel',
308 + 'dromo',
309 + 'dropbox',
310 + 'dropbox_sign',
311 + 'dropcontact',
312 + 'dub',
313 + 'dungeon_fighter_online',
314 + 'dynamics365',
315 + 'dynapictures',
316 + 'e2b',
317 + 'eagle_doc',
318 + 'echtpost',
319 + 'ecologi',
320 + 'egnyte',
321 + 'elasticsearch',
322 + 'elevenlabs',
323 + 'elevenreader',
324 + 'elorus',
325 + 'emailable',
326 + 'emaillistverify',
327 + 'emailoctopus',
328 + 'emelia',
329 + 'encodian',
330 + 'endorsal',
331 + 'engage',
332 + 'enginemailer',
333 + 'enigma',
334 + 'entelligence',
335 + 'eodhd_apis',
336 + 'epic_games',
337 + 'erpnext',
338 + 'esignatures_io',
339 + 'espocrm',
340 + 'esputnik',
341 + 'etermin',
342 + 'evenium',
343 + 'eventbrite',
344 + 'eventee',
345 + 'eventzilla',
346 + 'everhour',
347 + 'eversign',
348 + 'exa',
349 + 'excalidraw_mcp',
350 + 'excel',
351 + 'exist',
352 + 'expofp',
353 + 'extracta_ai',
354 + 'facebook',
355 + 'faceup',
356 + 'fal_ai',
357 + 'faraday',
358 + 'fathom',
359 + 'feathery',
360 + 'felt',
361 + 'fibery',
362 + 'fidel_api',
363 + 'figma',
364 + 'files_com',
365 + 'fillout_forms',
366 + 'finage',
367 + 'findymail',
368 + 'finerworks',
369 + 'fingertip',
370 + 'finmei',
371 + 'fireberry',
372 + 'firecrawl',
373 + 'fireflies',
374 + 'firmao',
375 + 'fixer',
376 + 'fixer_io',
377 + 'flexisign',
378 + 'flowiseai',
379 + 'flutterwave',
380 + 'fluxguard',
381 + 'fly',
382 + 'folk',
383 + 'follow_up_boss',
384 + 'fomo',
385 + 'forcemanager',
386 + 'formbricks',
387 + 'formcarry',
388 + 'formdesk',
389 + 'formsite',
390 + 'foursquare',
391 + 'fraudlabs_pro',
392 + 'freeagent',
393 + 'freshbooks',
394 + 'freshdesk',
395 + 'freshservice',
396 + 'fullenrich',
397 + 'gagelist',
398 + 'gamma',
399 + 'gan_ai',
400 + 'gatherup',
401 + 'gemini',
402 + 'gender_api',
403 + 'genderapi_io',
404 + 'genderize',
405 + 'geoapify',
406 + 'geocodio',
407 + 'geokeo',
408 + 'getform',
409 + 'getprospect',
410 + 'gift_up',
411 + 'gigasheet',
412 + 'giphy',
413 + 'gist',
414 + 'gitea',
415 + 'github',
416 + 'gitlab',
417 + 'givebutter',
418 + 'gladia',
419 + 'gleap',
420 + 'globalping',
421 + 'gmail',
422 + 'gocardless_mcp',
423 + 'godaddy_mcp',
424 + 'godial',
425 + 'gong',
426 + 'goodbits',
427 + 'goody',
428 + 'google_address_validation',
429 + 'google_admin',
430 + 'google_analytics',
431 + 'google_chat',
432 + 'google_classroom',
433 + 'google_cloud_vision',
434 + 'google_maps',
435 + 'google_search_console',
436 + 'googleads',
437 + 'googlebigquery',
438 + 'googlecalendar',
439 + 'googlecontacts',
440 + 'googledocs',
441 + 'googledrive',
442 + 'googleforms',
443 + 'googlemeet',
444 + 'googlephotos',
445 + 'googlesheets',
446 + 'googleslides',
447 + 'googlesuper',
448 + 'googletasks',
449 + 'gorgias',
450 + 'gosquared',
451 + 'grafana',
452 + 'grafbase',
453 + 'granola_mcp',
454 + 'granted_mcp',
455 + 'graphhopper',
456 + 'greenhouse',
457 + 'griptape',
458 + 'grist',
459 + 'groqcloud',
460 + 'gtmetrix',
461 + 'gumroad',
462 + 'gusto',
463 + 'habitica',
464 + 'hackernews',
465 + 'hackerrank_work',
466 + 'handwrytten',
467 + 'happy_scribe',
468 + 'harvest',
469 + 'hashnode',
470 + 'headout',
471 + 'heartbeat',
472 + 'helloleads',
473 + 'help_scout',
474 + 'helpdesk',
475 + 'helpwise',
476 + 'here',
477 + 'hex',
478 + 'heygen',
479 + 'heyreach',
480 + 'heyy',
481 + 'heyzine',
482 + 'highergov',
483 + 'highlevel',
484 + 'honeybadger',
485 + 'honeycomb_mcp',
486 + 'honeyhive',
487 + 'hookdeck',
488 + 'hostinger',
489 + 'hotspotsystem',
490 + 'html_to_image',
491 + 'hub_planner',
492 + 'hubspot',
493 + 'hugging_face',
494 + 'humanitix',
495 + 'humanloop',
496 + 'hunter',
497 + 'hypeauditor',
498 + 'hyperbrowser',
499 + 'hyperise',
500 + 'hystruct',
501 + 'ibm_x_force_exchange',
502 + 'icypeas',
503 + 'identitycheck',
504 + 'ignisign',
505 + 'imagekit_io',
506 + 'imagior',
507 + 'imejis_io',
508 + 'imgbb',
509 + 'imgix',
510 + 'incident_io',
511 + 'influxdb_cloud',
512 + 'insighto_ai',
513 + 'instacart',
514 + 'instagram',
515 + 'instantly',
516 + 'intelliprint',
517 + 'intercom',
518 + 'interzoid',
519 + 'ip2location',
520 + 'ip2location_io',
521 + 'ip2proxy',
522 + 'ip2whois',
523 + 'ipdata_co',
524 + 'ipinfo_io',
525 + 'iqair_airvisual',
526 + 'iterable',
527 + 'jigsawstack',
528 + 'jira',
529 + 'jobnimbus',
530 + 'jotform',
531 + 'jumpcloud',
532 + 'junglescout',
533 + 'kadoa',
534 + 'kaggle',
535 + 'kaleido',
536 + 'kanbanize',
537 + 'keen_io',
538 + 'keyword',
539 + 'kibana',
540 + 'kickbox',
541 + 'kieai',
542 + 'kit',
543 + 'klaviyo',
544 + 'klazify',
545 + 'klipfolio',
546 + 'knack',
547 + 'ko_fi',
548 + 'kommo',
549 + 'kontent_ai',
550 + 'kraken_io',
551 + 'l2s',
552 + 'labs64_netlicensing',
553 + 'lagrowthmachine',
554 + 'landbot',
555 + 'langbase',
556 + 'laposta',
557 + 'launch_darkly',
558 + 'leadboxer',
559 + 'leadfeeder',
560 + 'leadiq',
561 + 'leadoku',
562 + 'leexi',
563 + 'leiga',
564 + 'lemlist',
565 + 'lemon_squeezy',
566 + 'lessonspace',
567 + 'lever',
568 + 'leverly',
569 + 'lexoffice',
570 + 'linear',
571 + 'linguapop',
572 + 'linkedin',
573 + 'linkedin_ads',
574 + 'linkhut',
575 + 'linkly',
576 + 'linkup',
577 + 'listclean',
578 + 'listennotes',
579 + 'livesession',
580 + 'llmwhisperer',
581 + 'lmnt',
582 + 'lob',
583 + 'lodgify',
584 + 'logo_dev',
585 + 'loomio',
586 + 'loops_so',
587 + 'loyverse',
588 + 'lusha',
589 + 'magnetic',
590 + 'mailbluster',
591 + 'mailboxlayer',
592 + 'mailcheck',
593 + 'mailchimp',
594 + 'mailcoach',
595 + 'mailercloud',
596 + 'mailerlite',
597 + 'mailersend',
598 + 'mails_so',
599 + 'mailsoftly',
600 + 'mailtrap',
601 + 'maintainx',
602 + 'make',
603 + 'malwarebytes_mcp',
604 + 'manus',
605 + 'mapbox',
606 + 'mapulus',
607 + 'marketstack',
608 + 'matterport',
609 + 'maxio',
610 + 'melo',
611 + 'mem',
612 + 'mem0',
613 + 'memberspot',
614 + 'memberstack',
615 + 'membervault',
616 + 'mercury_mcp',
617 + 'mermaid_chart_mcp',
618 + 'metaads',
619 + 'metabase',
620 + 'metaphor',
621 + 'metatextai',
622 + 'mezmo',
623 + 'microsoft_clarity',
624 + 'microsoft_power_bi',
625 + 'microsoft_teams',
626 + 'microsoft_todo',
627 + 'minerstat',
628 + 'mintlify',
629 + 'miro',
630 + 'missive',
631 + 'mistral_ai',
632 + 'mixmax',
633 + 'mixpanel',
634 + 'mobbin_mcp',
635 + 'mocean',
636 + 'moco',
637 + 'modelry',
638 + 'monday',
639 + 'monday_mcp',
640 + 'moneybird',
641 + 'moonclerk',
642 + 'moosend',
643 + 'mopinion',
644 + 'more_trees',
645 + 'mospi_mcp',
646 + 'motion',
647 + 'moz',
648 + 'msg91',
649 + 'mural',
650 + 'mx_technologies',
651 + 'mx_toolbox',
652 + 'nango',
653 + 'nano_nets',
654 + 'nasa',
655 + 'nasdaq',
656 + 'needle',
657 + 'neo4j',
658 + 'neon',
659 + 'nethunt_crm',
660 + 'netsuite',
661 + 'neuronwriter',
662 + 'neutrino',
663 + 'neverbounce',
664 + 'new_relic',
665 + 'news_api',
666 + 'nextdns',
667 + 'ngrok',
668 + 'niftyimages',
669 + 'ninox',
670 + 'nocodb',
671 + 'nocrm_io',
672 + 'northflank',
673 + 'notion',
674 + 'nozbe_teams',
675 + 'npm',
676 + 'ntfy',
677 + 'nusii_proposals',
678 + 'nutshell',
679 + 'ocr_web_service',
680 + 'ocrspace',
681 + 'odoo',
682 + 'oksign',
683 + 'ollama',
684 + 'omnisend',
685 + 'one_drive',
686 + 'onedesk',
687 + 'onenote',
688 + 'onepage',
689 + 'onesignal_rest_api',
690 + 'onesignal_user_auth',
691 + 'open_sea',
692 + 'openai',
693 + 'opencage',
694 + 'opengraph_io',
695 + 'openperplex',
696 + 'openrouter',
697 + 'openweather_api',
698 + 'optimoroute',
699 + 'outline',
700 + 'outlook',
701 + 'owl_protocol',
702 + 'page_x',
703 + 'pagerduty',
704 + 'pandadoc',
705 + 'paperform',
706 + 'paradym',
707 + 'parallel',
708 + 'parma',
709 + 'parsehub',
710 + 'parsera',
711 + 'parseur',
712 + 'parsio_io',
713 + 'passcreator',
714 + 'passslot',
715 + 'payhere',
716 + 'payhip',
717 + 'paypal',
718 + 'paystack',
719 + 'pdf4me',
720 + 'pdf_api_io',
721 + 'pdf_co',
722 + 'pdfless',
723 + 'pdfmonkey',
724 + 'penpot',
725 + 'peopledatalabs',
726 + 'perigon',
727 + 'perplexityai',
728 + 'persistiq',
729 + 'persona',
730 + 'pexels',
731 + 'phantombuster',
732 + 'piggy',
733 + 'piloterr',
734 + 'pilvio',
735 + 'pinecone',
736 + 'pingdom',
737 + 'pipedrive',
738 + 'pipeline_crm',
739 + 'placekey',
740 + 'placid',
741 + 'plain',
742 + 'planly',
743 + 'planyo_online_booking',
744 + 'plasmic',
745 + 'platerecognizer',
746 + 'plausible_analytics',
747 + 'plisio',
748 + 'pointagram',
749 + 'polygon',
750 + 'polygon_io',
751 + 'polymarket',
752 + 'polymarket_us',
753 + 'poof',
754 + 'pophive_mcp',
755 + 'postalytics',
756 + 'postgrid',
757 + 'postgrid_verify',
758 + 'posthog',
759 + 'postiz_mcp',
760 + 'postman',
761 + 'postmark',
762 + 'prerender',
763 + 'printautopilot',
764 + 'prisma',
765 + 'prismic',
766 + 'proabono',
767 + 'process_street',
768 + 'procfu',
769 + 'productboard',
770 + 'productlane',
771 + 'project_bubble',
772 + 'promptmate_io',
773 + 'proofly',
774 + 'proxiedmail',
775 + 'push_by_techulus',
776 + 'pushbullet',
777 + 'pushover',
778 + 'pylon_mcp',
779 + 'quaderno',
780 + 'quickbooks',
781 + 'radar',
782 + 'rafflys',
783 + 'ragic',
784 + 'ragie',
785 + 'railway',
786 + 'raisely',
787 + 'ramp',
788 + 'rawg_video_games_database',
789 + 'razorpay',
790 + 're_amaze',
791 + 'realphonevalidation',
792 + 'recallai',
793 + 'recruitee',
794 + 'redcircle_api',
795 + 'reddit',
796 + 'reddit_ads',
797 + 'referralrock',
798 + 'refiner',
799 + 'remarkety',
800 + 'remote_retrieval',
801 + 'remove_bg',
802 + 'render',
803 + 'renderform',
804 + 'rentman',
805 + 'repairshopr',
806 + 'replicate',
807 + 'reply',
808 + 'reply_io',
809 + 'resend',
810 + 'respond_io',
811 + 'retailed',
812 + 'retellai',
813 + 'retently',
814 + 'rev',
815 + 'rev_ai',
816 + 'revolt',
817 + 'ritekit',
818 + 'rize',
819 + 'rkvst',
820 + 'roam',
821 + 'roboflow',
822 + 'rocket_reach',
823 + 'rocketadmin',
824 + 'rocketlane',
825 + 'rollbar',
826 + 'rootly',
827 + 'rosette_text_analytics',
828 + 'route4me',
829 + 'rudderstack_transformation',
830 + 'runpod',
831 + 'safetyculture',
832 + 'salesflare',
833 + 'salesforce',
834 + 'salesforce_service_cloud',
835 + 'salesmate',
836 + 'sanity',
837 + 'sap_successfactors',
838 + 'saperly',
839 + 'satismeter',
840 + 'saucelabs',
841 + 'scale_ai',
842 + 'scheduleonce',
843 + 'scrape_do',
844 + 'scrapegraph_ai',
845 + 'scrapfly',
846 + 'scrapingant',
847 + 'scrapingbee',
848 + 'screenshot_fyi',
849 + 'screenshotone',
850 + 'search_api',
851 + 'seat_geek',
852 + 'securitytrails',
853 + 'segment',
854 + 'segmetrics',
855 + 'semanticscholar',
856 + 'semrush',
857 + 'sendbird',
858 + 'sendbird_ai_chabot',
859 + 'sender',
860 + 'sendfox',
861 + 'sendgrid',
862 + 'sendlane',
863 + 'sendloop',
864 + 'sendspark',
865 + 'sensibo',
866 + 'sentry',
867 + 'seqera',
868 + 'serpapi',
869 + 'serpdog',
870 + 'serphouse',
871 + 'serply',
872 + 'serveravatar',
873 + 'servicem8',
874 + 'servicenow',
875 + 'sevdesk',
876 + 'share_point',
877 + 'sharepoint_graph',
878 + 'shipday',
879 + 'shipengine',
880 + 'shippo',
881 + 'shopify',
882 + 'short_io',
883 + 'short_menu',
884 + 'shortcut',
885 + 'shorten_rest',
886 + 'shortpixel',
887 + 'shotstack',
888 + 'sidetracker',
889 + 'signaturely',
890 + 'signpath',
891 + 'signwell',
892 + 'similarweb_digitalrank_api',
893 + 'simla_com',
894 + 'simple_analytics',
895 + 'simplekpi',
896 + 'simplero',
897 + 'simplesat',
898 + 'sitespeakai',
899 + 'skyfire',
900 + 'slack',
901 + 'slackbot',
902 + 'slidesgpt_mcp',
903 + 'slite',
904 + 'smartproxy',
905 + 'sms_alert',
906 + 'smtp2go',
907 + 'smugmug',
908 + 'snapchat',
909 + 'snowflake',
910 + 'snowflake_basic',
911 + 'softr',
912 + 'solcast',
913 + 'soundcloud',
914 + 'sourcegraph',
915 + 'specific',
916 + 'splitwise',
917 + 'spoki',
918 + 'spondyr',
919 + 'spotify',
920 + 'spotlightr',
921 + 'square',
922 + 'sslmate_cert_spotter_api',
923 + 'stack_ai',
924 + 'stack_exchange',
925 + 'stannp',
926 + 'starton',
927 + 'statuscake',
928 + 'storeganise',
929 + 'storerocket',
930 + 'stormboard',
931 + 'stormglass_io',
932 + 'storyblok',
933 + 'strava',
934 + 'streamtime',
935 + 'stripe',
936 + 'studio_by_ai21_labs',
937 + 'suitedash',
938 + 'supabase',
939 + 'supadata',
940 + 'superchat',
941 + 'supersaas',
942 + 'supportbee',
943 + 'supportivekoala',
944 + 'survey_monkey',
945 + 'svix',
946 + 'swaggerhub',
947 + 'swarmsyncai',
948 + 'sympla',
949 + 'synthflow_ai',
950 + 'taggun',
951 + 'talenthr',
952 + 'tally',
953 + 'tapfiliate',
954 + 'taskrabbit_mcp',
955 + 'tave',
956 + 'tavily',
957 + 'tavily_mcp',
958 + 'taxjar',
959 + 'teamcamp',
960 + 'telegram',
961 + 'telnyx',
962 + 'teltel',
963 + 'templated',
964 + 'test_app',
965 + 'text_to_pdf',
966 + 'textcortex',
967 + 'textit',
968 + 'textrazor',
969 + 'thanks_io',
970 + 'the_odds_api',
971 + 'ticketmaster',
972 + 'ticktick',
973 + 'tidy',
974 + 'tiktok',
975 + 'timecamp',
976 + 'timelinesai',
977 + 'timelink',
978 + 'timely',
979 + 'tinyfish_mcp',
980 + 'tinypng',
981 + 'tinyurl',
982 + 'tisane',
983 + 'tldv',
984 + 'todoist',
985 + 'toggl',
986 + 'token_metrics',
987 + 'tomba',
988 + 'tomtom',
989 + 'toneden',
990 + 'tpscheck',
991 + 'trello',
992 + 'triggercmd',
993 + 'tripadvisor',
994 + 'tripadvisor_content_api',
995 + 'trivago_mcp',
996 + 'truvera',
997 + 'turbot_pipes',
998 + 'turso',
999 + 'twelve_data',
1000 + 'twitter',
1001 + 'twocaptcha',
1002 + 'typeform',
1003 + 'typefully',
1004 + 'typless',
1005 + 'u301',
1006 + 'unione',
1007 + 'unisender',
1008 + 'uniswap_api',
1009 + 'updown_io',
1010 + 'uploadcare',
1011 + 'uptimerobot',
1012 + 'userflow',
1013 + 'userlist',
1014 + 'v0',
1015 + 'vapi',
1016 + 'vectorshift',
1017 + 'veo',
1018 + 'vercel',
1019 + 'verifiedemail',
1020 + 'veriphone',
1021 + 'vestaboard',
1022 + 'viator_mcp',
1023 + 'virustotal',
1024 + 'waboxapp',
1025 + 'wachete',
1026 + 'waiverfile',
1027 + 'wakatime',
1028 + 'wati',
1029 + 'weathermap',
1030 + 'webex',
1031 + 'webflow',
1032 + 'webscraper_io',
1033 + 'webscraping_ai',
1034 + 'webvizio',
1035 + 'whatsapp',
1036 + 'whautomate',
1037 + 'whoisfreaks',
1038 + 'whop',
1039 + 'winston_ai',
1040 + 'wisepops',
1041 + 'wit_ai',
1042 + 'wix',
1043 + 'wix_mcp',
1044 + 'wiza',
1045 + 'wolfram_alpha_api',
1046 + 'woodpecker_co',
1047 + 'workable',
1048 + 'workday',
1049 + 'workiom',
1050 + 'worksnaps',
1051 + 'world_news_api',
1052 + 'wrike',
1053 + 'writer',
1054 + 'xata',
1055 + 'xero',
1056 + 'y_gy',
1057 + 'yandex',
1058 + 'yelp',
1059 + 'ynab',
1060 + 'yousearch',
1061 + 'youtube',
1062 + 'zendesk',
1063 + 'zenrows',
1064 + 'zenserp',
1065 + 'zep',
1066 + 'zeplin',
1067 + 'zerobounce',
1068 + 'ziprecruiter_mcp',
1069 + 'zixflow',
1070 + 'zoho',
1071 + 'zoho_bigin',
1072 + 'zoho_books',
1073 + 'zoho_desk',
1074 + 'zoho_inventory',
1075 + 'zoho_invoice',
1076 + 'zoho_mail',
1077 + 'zoom',
1078 + 'zoominfo',
1079 + 'zulip',
1080 + 'zylvie',
1081 + 'zyte_api',
1082 +];
1083 +
1084 +/** When the list above was generated. */
1085 +export const BAKED_TOOLKIT_SLUGS_REFRESHED_AT = '2026-08-04T13:45:26.052Z';
ts/packages/cli/src/models/toolkits.ts
+13 -5
@@ -2,15 +2,23 @@ import { Brand, Schema } from 'effect';
2 import { JSONTransformSchema } from './utils/json-transform-schema';
3
4 /**
5 - * A toolkit slug used to derive generated source filenames.
5 + * The shape of a toolkit slug: a single, safe path segment (no `/`, `\`, or
6 + * `..`), which prevents path traversal / arbitrary file write when a slug is
7 + * interpolated into a filename and joined to the generator's output directory.
8 + * See CWE-22.
9 *
7 - * Restricted to a single, safe path segment (no `/`, `\`, or `..`) to prevent
8 - * path traversal / arbitrary file write when the slug is interpolated into a
9 - * filename and joined to the generator's output directory. See CWE-22.
10 + * Shared so that every place that has to vouch for a slug — the schema below,
11 + * the baked-catalog generator, and the test guarding its output — tightens
12 + * together rather than drifting apart.
13 + */
14 +export const TOOLKIT_SLUG_PATTERN = /^[a-z0-9_][a-z0-9_-]*$/;
15 +
16 +/**
17 + * A toolkit slug used to derive generated source filenames.
18 */
19 export const ToolkitSlug = Schema.Trim.pipe(
20 Schema.nonEmptyString(),
13 - Schema.pattern(/^[a-z0-9_][a-z0-9_-]*$/, {
21 + Schema.pattern(TOOLKIT_SLUG_PATTERN, {
22 identifier: 'ToolkitSlug',
23 message: () =>
24 'Toolkit slug must contain only lowercase letters, digits, underscores, and hyphens (no path separators)',
ts/packages/cli/test/src/generated/toolkit-slugs.test.ts new
+37
@@ -0,0 +1,37 @@
1 +import { describe, expect, it } from 'vitest';
2 +import { BAKED_TOOLKIT_SLUGS, BAKED_TOOLKIT_SLUGS_REFRESHED_AT } from 'src/generated/toolkit-slugs';
3 +import { TOOLKIT_SLUG_PATTERN } from 'src/models/toolkits';
4 +
5 +/**
6 + * Guards the checked-in output of `scripts/generate-toolkit-slugs.ts`. The
7 + * resolver reads this list on every tool execution, so a hand-edit or a bad
8 + * regeneration is a correctness problem, not a cosmetic one. Nothing here
9 + * touches the network — the point is that the CLI does not have to either.
10 + */
11 +describe('BAKED_TOOLKIT_SLUGS', () => {
12 + it('holds the whole catalog', () => {
13 + expect(BAKED_TOOLKIT_SLUGS.length).toBeGreaterThanOrEqual(1000);
14 + });
15 +
16 + it('is sorted and free of duplicates', () => {
17 + expect([...BAKED_TOOLKIT_SLUGS]).toEqual([...new Set(BAKED_TOOLKIT_SLUGS)].sort());
18 + });
19 +
20 + it('holds only lowercase slugs', () => {
21 + const malformed = BAKED_TOOLKIT_SLUGS.filter(slug => !TOOLKIT_SLUG_PATTERN.test(slug));
22 + expect(malformed).toEqual([]);
23 + });
24 +
25 + it('includes staple toolkits', () => {
26 + expect(BAKED_TOOLKIT_SLUGS).toContain('github');
27 + expect(BAKED_TOOLKIT_SLUGS).toContain('gmail');
28 + // The multi-word slug behind https://github.com/ComposioHQ/composio/issues/4049.
29 + expect(BAKED_TOOLKIT_SLUGS).toContain('google_analytics');
30 + });
31 +
32 + it('records when it was generated', () => {
33 + expect(new Date(BAKED_TOOLKIT_SLUGS_REFRESHED_AT).toISOString()).toBe(
34 + BAKED_TOOLKIT_SLUGS_REFRESHED_AT
35 + );
36 + });
37 +});