Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
chore(cli): bake the toolkit slug catalog into the CLI
jkomynobf3efaa2706d
diff --git a/.github/workflows/build-cli-binaries.yml b/.github/workflows/build-cli-binaries.ymlindex aee82b4b9..aa6058420 100644--- a/.github/workflows/build-cli-binaries.yml+++ b/.github/workflows/build-cli-binaries.yml@@ -70,6 +70,22 @@ jobs:COMMIT_SHA: ${{ github.sha }}run: bash .github/scripts/cli-release/resolve-release-target.sh+ # The baked toolkit slugs decide whether `composio execute` resolves a+ # toolkit locally or pays for a catalog fetch. A stale list is never+ # wrong, only slow, so this warns and never blocks a release.+ # Refresh with the `CLI - Update Toolkit Slugs` workflow.+ - name: Check baked toolkit slugs freshness+ continue-on-error: true+ run: |+ set -euo pipefail+ refreshed_at=$(sed -n "s/.*BAKED_TOOLKIT_SLUGS_REFRESHED_AT = '\(.*\)'.*/\1/p" \+ ts/packages/cli/src/generated/toolkit-slugs.ts)+ age_days=$(( ( $(date -u +%s) - $(date -u -d "$refreshed_at" +%s) ) / 86400 ))+ echo "Baked toolkit slugs were refreshed $age_days day(s) ago ($refreshed_at)."+ if [ "$age_days" -gt 14 ]; then+ echo "::warning::Baked toolkit slugs are $age_days days old. Run the 'CLI - Update Toolkit Slugs' workflow."+ fi+build:name: Build ${{ matrix.artifact }}needs: preparediff --git a/.github/workflows/cli.update-toolkit-slugs.yml b/.github/workflows/cli.update-toolkit-slugs.ymlnew file mode 100644index 000000000..6c5b819a6--- /dev/null+++ b/.github/workflows/cli.update-toolkit-slugs.yml@@ -0,0 +1,90 @@+name: CLI - Update Toolkit Slugs++# Keeps `ts/packages/cli/src/generated/toolkit-slugs.ts` in step with the+# production catalog. The CLI resolves a tool slug to its toolkit by matching+# against that list, and only pays for a network fetch when a slug is missing+# from it — so a stale list costs users a ~2 s fetch, never a wrong answer.++on:+ schedule:+ # Weekly, Monday morning UTC. New toolkits ship continuously; users of an+ # older binary fall back to the runtime fetch until their next upgrade.+ - cron: '0 6 * * 1'+ workflow_dispatch:++permissions:+ contents: read++jobs:+ update-toolkit-slugs:+ name: Refresh baked toolkit slugs+ runs-on: ubuntu-latest+ permissions:+ contents: write+ pull-requests: write+ env:+ # The baked list ships to users of the PRODUCTION catalog, and the+ # generator targets production unless COMPOSIO_BASE_URL says otherwise.+ # `docs-update-data.yml` documents this shared secret as staging-scoped+ # and uses `secrets.COMPOSIO_DOCS_API_KEY` for its own production reads.+ # If the first run 401s, that is the secret to swap in here: the sanity+ # gate in the generator aborts before writing anything, so a wrong-scoped+ # key fails loudly instead of baking a partial catalog.+ COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }}++ steps:+ - name: Generate GitHub App token+ id: app-token+ uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0+ with:+ client-id: ${{ vars.RELEASE_BOT_CLIENT_ID }}+ private-key: ${{ secrets.RELEASE_BOT_APP_PRIVATE_KEY }}++ - name: Checkout repository+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1+ with:+ token: ${{ steps.app-token.outputs.token }}++ - name: Setup Node.js, pnpm, Bun+ uses: ./.github/actions/setup-node-pnpm-bun++ - name: Install dependencies+ run: pnpm install --frozen-lockfile++ - name: Refresh toolkit slugs+ run: pnpm --filter @composio/cli generate:toolkit-slugs++ - name: Check for changes+ id: changes+ run: |+ set -euo pipefail+ if git diff --quiet -- ts/packages/cli/src/generated/toolkit-slugs.ts; then+ echo "has_changes=false" >> "$GITHUB_OUTPUT"+ echo "Catalog unchanged since the last refresh."+ else+ echo "has_changes=true" >> "$GITHUB_OUTPUT"+ git diff --stat -- ts/packages/cli/src/generated/toolkit-slugs.ts+ fi++ - name: Create Pull Request+ if: steps.changes.outputs.has_changes == 'true'+ uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1+ with:+ token: ${{ steps.app-token.outputs.token }}+ commit-message: 'chore(cli): refresh baked toolkit slugs'+ title: 'chore(cli): refresh baked toolkit slugs'+ body: |+ ## Summary+ Automated refresh of the toolkit slugs the CLI knows without asking+ the API, generated by `ts/packages/cli/scripts/generate-toolkit-slugs.ts`.++ Toolkits added since the last refresh currently cost users one+ toolkit-list fetch (~2 s) the first time they run one of that+ toolkit's tools. Merging this makes them free.++ The generator refuses to write a list that is short, malformed, or+ missing staple toolkits, so a bad fetch opens no PR at all.+ branch: chore/cli-refresh-toolkit-slugs+ base: next+ add-paths: |+ ts/packages/cli/src/generated/toolkit-slugs.tsdiff --git a/ts/packages/cli/package.json b/ts/packages/cli/package.jsonindex 6ec288cd1..0adf7b7f1 100644--- a/ts/packages/cli/package.json+++ b/ts/packages/cli/package.json@@ -31,6 +31,7 @@"validate:boundaries": "tsx ./scripts/validate-lint-boundaries.ts","install:binary": "bun run ./scripts/install-binary.ts ./dist/composio","table:metrics": "bun run ./scripts/optimize-metrics-table.ts",+ "generate:toolkit-slugs": "bun run ./scripts/generate-toolkit-slugs.ts","mock": "bun run ./scripts/copy-mocks-from-cache.ts","prebuild": "pnpm run typecheck","build": "tsdown && bun run ./scripts/copy-local-tools-assets.ts ./dist",diff --git a/ts/packages/cli/scripts/generate-toolkit-slugs.ts b/ts/packages/cli/scripts/generate-toolkit-slugs.tsnew file mode 100644index 000000000..468174702--- /dev/null+++ b/ts/packages/cli/scripts/generate-toolkit-slugs.ts@@ -0,0 +1,224 @@+import process from 'node:process';+import path from 'node:path';+import { $ } from 'bun';+import {+ Config,+ ConfigProvider,+ Console,+ Data,+ DateTime,+ Effect,+ Layer,+ Logger,+ Option,+ Schema,+} from 'effect';+import { FileSystem } from '@effect/platform';+import { BunContext, BunFileSystem, BunRuntime } from '@effect/platform-bun';+import { TOOLKIT_SLUG_PATTERN } from 'src/models/toolkits';+import { teardown } from './_teardown';++/**+ * Usage: `pnpm --filter @composio/cli generate:toolkit-slugs`.+ *+ * Refreshes `src/generated/toolkit-slugs.ts` — the toolkit slugs the CLI knows+ * about without asking the API. Resolving a tool slug to its toolkit needs the+ * catalog (`GOOGLE_ANALYTICS_RUN_REPORT` belongs to `google_analytics`, not+ * `google`), and downloading ~800 KB of toolkit metadata to learn ~11 KB of+ * slugs is most of the wall time of a `composio execute`.+ *+ * Authentication, in order of preference:+ * - `COMPOSIO_USER_API_KEY` (+ `COMPOSIO_ORG_ID`) — a `uak_` key, what a+ * logged-in developer has locally.+ * - `COMPOSIO_API_KEY` — a project-scoped key, what CI has.+ *+ * `COMPOSIO_BASE_URL` overrides the API host; it defaults to production+ * because the baked list ships to users of the production catalog.+ */++const PRODUCTION_BASE_URL = 'https://backend.composio.dev';+const PAGE_SIZE = 1000;++/** Slugs the catalog cannot plausibly be missing. */+const SENTINEL_SLUGS = ['github', 'gmail', 'google_analytics'] as const;++/**+ * A catalog this small means we are looking at a partial or wrong response —+ * an empty page, a filtered org view, an error body that happened to decode.+ * Today's production catalog holds ~1070 toolkits and the backend never+ * removes one, so anything below this is a bad fetch, not a shrunken catalog.+ */+const MIN_EXPECTED_SLUGS = 1000;++const ToolkitsPage = Schema.Struct({+ items: Schema.Array(+ Schema.Struct({+ slug: Schema.String,+ // `native` toolkits are the shared catalog. Anything else (an org-scoped+ // custom toolkit, say) is not knowledge we can bake into a released+ // binary for everyone.+ type: Schema.optional(Schema.String),+ })+ ),+ next_cursor: Schema.NullishOr(Schema.String),+});++class ToolkitFetchError extends Data.TaggedError('ToolkitFetchError')<{+ readonly message: string;+}> {}++const authHeaders = Effect.gen(function* () {+ const userApiKey = yield* Config.option(Config.string('COMPOSIO_USER_API_KEY'));+ const orgId = yield* Config.option(Config.string('COMPOSIO_ORG_ID'));+ const apiKey = yield* Config.option(Config.string('COMPOSIO_API_KEY'));++ if (Option.isSome(userApiKey)) {+ return {+ 'x-user-api-key': userApiKey.value,+ ...(Option.isSome(orgId) ? { 'x-org-id': orgId.value } : {}),+ };+ }++ if (Option.isSome(apiKey)) {+ return { 'x-api-key': apiKey.value };+ }++ return yield* new ToolkitFetchError({+ message: 'Set COMPOSIO_API_KEY, or COMPOSIO_USER_API_KEY (+ COMPOSIO_ORG_ID), and retry.',+ });+});++const fetchPage = (params: { baseUrl: string; headers: Record<string, string>; cursor?: string }) =>+ Effect.gen(function* () {+ const url = new URL('/api/v3/toolkits', params.baseUrl);+ url.searchParams.set('limit', String(PAGE_SIZE));+ if (params.cursor) {+ url.searchParams.set('cursor', params.cursor);+ }++ const response = yield* Effect.tryPromise({+ try: () => fetch(url, { headers: params.headers }),+ catch: cause => new ToolkitFetchError({ message: `GET ${url.pathname} failed: ${cause}` }),+ });++ if (!response.ok) {+ const body = yield* Effect.promise(() => response.text());+ return yield* new ToolkitFetchError({+ message: `GET ${url.pathname} returned ${response.status}: ${body.slice(0, 400)}`,+ });+ }++ const payload = yield* Effect.tryPromise({+ try: () => response.json(),+ catch: cause => new ToolkitFetchError({ message: `Response was not JSON: ${cause}` }),+ });++ return yield* Schema.decodeUnknown(ToolkitsPage)(payload).pipe(+ Effect.mapError(cause => new ToolkitFetchError({ message: `Unexpected response: ${cause}` }))+ );+ });++/** Walks the cursor to the end of the catalog. */+const fetchAllSlugs = (params: { baseUrl: string; headers: Record<string, string> }) =>+ Effect.gen(function* () {+ const slugs: string[] = [];+ let cursor: string | undefined = undefined;+ let page = 0;++ do {+ const result = yield* fetchPage({ ...params, cursor });+ page += 1;++ for (const toolkit of result.items) {+ if (toolkit.type === undefined || toolkit.type === 'native') {+ slugs.push(toolkit.slug.toLowerCase());+ }+ }++ yield* Effect.logInfo(`Page ${page}: ${result.items.length} toolkits (${slugs.length} kept)`);+ cursor = result.next_cursor ?? undefined;+ } while (cursor);++ return [...new Set(slugs)].sort();+ });++/**+ * Refuses to overwrite a good list with a bad fetch. Every failure mode we can+ * cheaply detect — truncated pagination, an org-scoped view, a decoded error+ * body — shows up as too few slugs, malformed slugs, or missing staples.+ */+const checkSanity = (slugs: ReadonlyArray<string>) =>+ Effect.gen(function* () {+ if (slugs.length < MIN_EXPECTED_SLUGS) {+ return yield* new ToolkitFetchError({+ message: `Refusing to write ${slugs.length} slugs; expected at least ${MIN_EXPECTED_SLUGS}.`,+ });+ }++ const malformed = slugs.filter(slug => !TOOLKIT_SLUG_PATTERN.test(slug));+ if (malformed.length > 0) {+ return yield* new ToolkitFetchError({+ message: `Refusing to write malformed slugs: ${malformed.slice(0, 10).join(', ')}`,+ });+ }++ const missing = SENTINEL_SLUGS.filter(sentinel => !slugs.includes(sentinel));+ if (missing.length > 0) {+ return yield* new ToolkitFetchError({+ message: `Refusing to write a catalog without ${missing.join(', ')}.`,+ });+ }+ });++const renderModule = (params: { slugs: ReadonlyArray<string>; refreshedAt: string }) =>+ `// Generated by scripts/generate-toolkit-slugs.ts — do not edit by hand.+// Refresh: pnpm --filter @composio/cli generate:toolkit-slugs++/**+ * Toolkit slugs known at build time, sorted. Resolving a tool slug to its+ * toolkit is a longest-prefix match against the known catalog, and this list+ * answers that without a network call. Toolkits released after this snapshot+ * are picked up at runtime; the backend never removes a toolkit, so an entry+ * here never goes stale in the other direction.+ */+export const BAKED_TOOLKIT_SLUGS: ReadonlyArray<string> = [+${params.slugs.map(slug => ` '${slug}',`).join('\n')}+];++/** When the list above was generated. */+export const BAKED_TOOLKIT_SLUGS_REFRESHED_AT = '${params.refreshedAt}';+`;++export function generateToolkitSlugs() {+ return Effect.gen(function* () {+ const fs = yield* FileSystem.FileSystem;+ const baseUrl = yield* Config.string('COMPOSIO_BASE_URL').pipe(+ Config.withDefault(PRODUCTION_BASE_URL)+ );+ const headers = yield* authHeaders;++ yield* Effect.logInfo(`Fetching the toolkit catalog from ${baseUrl}`);+ const slugs = yield* fetchAllSlugs({ baseUrl, headers });+ yield* checkSanity(slugs);++ const refreshedAt = yield* DateTime.now.pipe(Effect.map(DateTime.formatIso));+ const outputPath = path.join(process.cwd(), 'src', 'generated', 'toolkit-slugs.ts');++ yield* fs.makeDirectory(path.dirname(outputPath), { recursive: true });+ yield* fs.writeFileString(outputPath, renderModule({ slugs, refreshedAt }));+ yield* Effect.promise(() => $`pnpm exec prettier --write ${outputPath}`.quiet());++ yield* Console.log(`Wrote ${slugs.length} toolkit slugs to ${outputPath}`);+ });+}++if (require.main === module) {+ generateToolkitSlugs().pipe(+ Effect.provide(Logger.pretty),+ Effect.provide(BunContext.layer),+ Effect.provide(BunFileSystem.layer),+ Effect.provide(Layer.setConfigProvider(ConfigProvider.fromEnv())),+ Effect.scoped,+ BunRuntime.runMain({ teardown })+ );+}diff --git a/ts/packages/cli/src/generated/toolkit-slugs.ts b/ts/packages/cli/src/generated/toolkit-slugs.tsnew file mode 100644index 000000000..c8e2e74c8--- /dev/null+++ b/ts/packages/cli/src/generated/toolkit-slugs.ts@@ -0,0 +1,1085 @@+// Generated by scripts/generate-toolkit-slugs.ts — do not edit by hand.+// Refresh: pnpm --filter @composio/cli generate:toolkit-slugs++/**+ * Toolkit slugs known at build time, sorted. Resolving a tool slug to its+ * toolkit is a longest-prefix match against the known catalog, and this list+ * answers that without a network call. Toolkits released after this snapshot+ * are picked up at runtime; the backend never removes a toolkit, so an entry+ * here never goes stale in the other direction.+ */+export const BAKED_TOOLKIT_SLUGS: ReadonlyArray<string> = [+ '_1password',+ '_21risk',+ '_2chat',+ 'ably',+ 'abstract',+ 'abuselpdb',+ 'abyssale',+ 'accredible_certificates',+ 'acculynx',+ 'active_campaign',+ 'active_trail',+ 'addressfinder',+ 'addresszen',+ 'adrapid',+ 'adyntel',+ 'aeroleads',+ 'affinda',+ 'affinity',+ 'agencyzoom',+ 'agent_mail',+ 'agentql',+ 'agenty',+ 'agiled',+ 'agility_cms',+ 'ahrefs',+ 'ai_ml_api',+ 'airtable',+ 'aivoov',+ 'aiwyn_tax_mcp',+ 'alchemy',+ 'algodocs',+ 'algolia',+ 'all_images_ai',+ 'alltrails_mcp',+ 'alpaca',+ 'alpha_vantage',+ 'altoviz',+ 'alttext_ai',+ 'amara',+ 'ambee',+ 'ambient_weather',+ 'amcards',+ 'amplitude',+ 'anchor_browser',+ 'anonyflow',+ 'anthropic_administrator',+ 'apaleo',+ 'api2pdf',+ 'api_bible',+ 'api_labz',+ 'api_ninjas',+ 'api_sports',+ 'apiflash',+ 'apify',+ 'apify_mcp',+ 'apilio',+ 'apipie_ai',+ 'apiverve',+ 'apollo',+ 'appcircle',+ 'appdrag',+ 'appointo',+ 'appveyor',+ 'artificial_analysis',+ 'aryn',+ 'asana',+ 'ascora',+ 'ashby',+ 'asin_data_api',+ 'astica_ai',+ 'async_interview',+ 'attio',+ 'autobound',+ 'autom',+ 'aws_marketplace_mcp',+ 'ayrshare',+ 'backendless',+ 'bamboohr',+ 'bannerbear',+ 'bart',+ 'basecamp',+ 'baselinker',+ 'baserow',+ 'basin',+ 'beaconchain',+ 'beaconstac',+ 'beamer',+ 'beeminder',+ 'bench',+ 'benchmark_email',+ 'benzinga',+ 'bestbuy',+ 'better_proposals',+ 'better_stack',+ 'bettercontact',+ 'bidsketch',+ 'big_data_cloud',+ 'bigmailer',+ 'bigml',+ 'bigpicture_io',+ 'bitbucket',+ 'bitquery',+ 'bitwarden',+ 'blackbaud',+ 'blackboard',+ 'blazemeter',+ 'blocknative',+ 'boldsign',+ 'bolna',+ 'boloforms',+ 'bolt_iot',+ 'bonsai',+ 'bookingmood',+ 'booqable',+ 'borneo',+ 'botbaba',+ 'botpress',+ 'botsonic',+ 'botstar',+ 'bouncer',+ 'box',+ 'boxhero',+ 'brandfetch',+ 'breathehr',+ 'breeze',+ 'breezy_hr',+ 'brevo',+ 'brex',+ 'brightdata',+ 'brilliant_directories',+ 'browseai',+ 'browser_tool',+ 'browserbase_tool',+ 'browserless',+ 'btcpay_server',+ 'bubble',+ 'bugbug',+ 'bugherd',+ 'bugsnag',+ 'buildkite',+ 'builtwith',+ 'bunnycdn',+ 'byteforms',+ 'cabinpanda',+ 'cal',+ 'calendarhero',+ 'calendly',+ 'callerapi',+ 'callingly',+ 'callpage',+ 'campaign_cleaner',+ 'campayn',+ 'canny',+ 'canva',+ 'canvas',+ 'capsule_crm',+ 'carbone',+ 'cardly',+ 'castingwords',+ 'cats',+ 'cdr_platform',+ 'celigo',+ 'census_bureau',+ 'centralstationcrm',+ 'certifier',+ 'chaser',+ 'chatbotkit',+ 'chatfai',+ 'chatwork',+ 'chmeetings',+ 'cincopa',+ 'circleci',+ 'claid_ai',+ 'clarity_ai_mcp',+ 'classmarker',+ 'clearout',+ 'clickhouse',+ 'clickmeeting',+ 'clicksend',+ 'clickup',+ 'clientary',+ 'clockify',+ 'close',+ 'cloudcart',+ 'cloudconvert',+ 'cloudflare',+ 'cloudflare_api_key',+ 'cloudflare_browser_rendering',+ 'cloudinary',+ 'cloudlayer',+ 'cloudpress',+ 'coassemble',+ 'coda',+ 'codacy',+ 'codeinterpreter',+ 'codemagic',+ 'codereadr',+ 'cody',+ 'coinbase',+ 'coinmarketcal',+ 'coinmarketcap',+ 'coinranking',+ 'college_football_data',+ 'commcare',+ 'companyenrich',+ 'composio',+ 'composio_search',+ 'confluence',+ 'connecteam',+ 'constant_contact',+ 'contentful',+ 'contentful_graphql',+ 'context7_mcp',+ 'control_d',+ 'conversion_tools',+ 'convertapi',+ 'convex',+ 'conveyor',+ 'convolo_ai',+ 'corrently',+ 'countdown_api',+ 'coupa',+ 'craftmypdf',+ 'crowdin',+ 'crowterminal',+ 'crustdata',+ 'cults',+ 'curated',+ 'currencyscoop',+ 'currents_api',+ 'cursor',+ 'customerio',+ 'customgpt',+ 'customjs',+ 'cutt_ly',+ 'd2lbrightspace',+ 'dadata_ru',+ 'daffy',+ 'dailybot',+ 'dart',+ 'data247',+ 'databox',+ 'databricks',+ 'datadog',+ 'dataforseo',+ 'datagma',+ 'datarobot',+ 'datascope',+ 'daytona',+ 'deadline_funnel',+ 'deepgram',+ 'deepimage',+ 'deepseek',+ 'deepwiki_mcp',+ 'delighted',+ 'demio',+ 'deployhq',+ 'desktime',+ 'detrack',+ 'devin_mcp',+ 'devto',+ 'dialmycalls',+ 'dialpad',+ 'dice_mcp',+ 'dictionary_api',+ 'diffbot',+ 'digicert',+ 'digital_ocean',+ 'discord',+ 'discordbot',+ 'dnsfilter',+ 'dock_certs',+ 'docker_hub',+ 'docmosis',+ 'docnify',+ 'docparser',+ 'docraptor',+ 'docsautomator',+ 'docsbot_ai',+ 'docsumo',+ 'docugenerate',+ 'documenso',+ 'documint',+ 'docupilot',+ 'docupost',+ 'docuseal',+ 'docusign',+ 'doppler',+ 'doppler_marketing_automation',+ 'doppler_secretops',+ 'dotsimple',+ 'dovetail',+ 'dpd2',+ 'draftable',+ 'dreamstudio',+ 'dripcel',+ 'dromo',+ 'dropbox',+ 'dropbox_sign',+ 'dropcontact',+ 'dub',+ 'dungeon_fighter_online',+ 'dynamics365',+ 'dynapictures',+ 'e2b',+ 'eagle_doc',+ 'echtpost',+ 'ecologi',+ 'egnyte',+ 'elasticsearch',+ 'elevenlabs',+ 'elevenreader',+ 'elorus',+ 'emailable',+ 'emaillistverify',+ 'emailoctopus',+ 'emelia',+ 'encodian',+ 'endorsal',+ 'engage',+ 'enginemailer',+ 'enigma',+ 'entelligence',+ 'eodhd_apis',+ 'epic_games',+ 'erpnext',+ 'esignatures_io',+ 'espocrm',+ 'esputnik',+ 'etermin',+ 'evenium',+ 'eventbrite',+ 'eventee',+ 'eventzilla',+ 'everhour',+ 'eversign',+ 'exa',+ 'excalidraw_mcp',+ 'excel',+ 'exist',+ 'expofp',+ 'extracta_ai',+ 'facebook',+ 'faceup',+ 'fal_ai',+ 'faraday',+ 'fathom',+ 'feathery',+ 'felt',+ 'fibery',+ 'fidel_api',+ 'figma',+ 'files_com',+ 'fillout_forms',+ 'finage',+ 'findymail',+ 'finerworks',+ 'fingertip',+ 'finmei',+ 'fireberry',+ 'firecrawl',+ 'fireflies',+ 'firmao',+ 'fixer',+ 'fixer_io',+ 'flexisign',+ 'flowiseai',+ 'flutterwave',+ 'fluxguard',+ 'fly',+ 'folk',+ 'follow_up_boss',+ 'fomo',+ 'forcemanager',+ 'formbricks',+ 'formcarry',+ 'formdesk',+ 'formsite',+ 'foursquare',+ 'fraudlabs_pro',+ 'freeagent',+ 'freshbooks',+ 'freshdesk',+ 'freshservice',+ 'fullenrich',+ 'gagelist',+ 'gamma',+ 'gan_ai',+ 'gatherup',+ 'gemini',+ 'gender_api',+ 'genderapi_io',+ 'genderize',+ 'geoapify',+ 'geocodio',+ 'geokeo',+ 'getform',+ 'getprospect',+ 'gift_up',+ 'gigasheet',+ 'giphy',+ 'gist',+ 'gitea',+ 'github',+ 'gitlab',+ 'givebutter',+ 'gladia',+ 'gleap',+ 'globalping',+ 'gmail',+ 'gocardless_mcp',+ 'godaddy_mcp',+ 'godial',+ 'gong',+ 'goodbits',+ 'goody',+ 'google_address_validation',+ 'google_admin',+ 'google_analytics',+ 'google_chat',+ 'google_classroom',+ 'google_cloud_vision',+ 'google_maps',+ 'google_search_console',+ 'googleads',+ 'googlebigquery',+ 'googlecalendar',+ 'googlecontacts',+ 'googledocs',+ 'googledrive',+ 'googleforms',+ 'googlemeet',+ 'googlephotos',+ 'googlesheets',+ 'googleslides',+ 'googlesuper',+ 'googletasks',+ 'gorgias',+ 'gosquared',+ 'grafana',+ 'grafbase',+ 'granola_mcp',+ 'granted_mcp',+ 'graphhopper',+ 'greenhouse',+ 'griptape',+ 'grist',+ 'groqcloud',+ 'gtmetrix',+ 'gumroad',+ 'gusto',+ 'habitica',+ 'hackernews',+ 'hackerrank_work',+ 'handwrytten',+ 'happy_scribe',+ 'harvest',+ 'hashnode',+ 'headout',+ 'heartbeat',+ 'helloleads',+ 'help_scout',+ 'helpdesk',+ 'helpwise',+ 'here',+ 'hex',+ 'heygen',+ 'heyreach',+ 'heyy',+ 'heyzine',+ 'highergov',+ 'highlevel',+ 'honeybadger',+ 'honeycomb_mcp',+ 'honeyhive',+ 'hookdeck',+ 'hostinger',+ 'hotspotsystem',+ 'html_to_image',+ 'hub_planner',+ 'hubspot',+ 'hugging_face',+ 'humanitix',+ 'humanloop',+ 'hunter',+ 'hypeauditor',+ 'hyperbrowser',+ 'hyperise',+ 'hystruct',+ 'ibm_x_force_exchange',+ 'icypeas',+ 'identitycheck',+ 'ignisign',+ 'imagekit_io',+ 'imagior',+ 'imejis_io',+ 'imgbb',+ 'imgix',+ 'incident_io',+ 'influxdb_cloud',+ 'insighto_ai',+ 'instacart',+ 'instagram',+ 'instantly',+ 'intelliprint',+ 'intercom',+ 'interzoid',+ 'ip2location',+ 'ip2location_io',+ 'ip2proxy',+ 'ip2whois',+ 'ipdata_co',+ 'ipinfo_io',+ 'iqair_airvisual',+ 'iterable',+ 'jigsawstack',+ 'jira',+ 'jobnimbus',+ 'jotform',+ 'jumpcloud',+ 'junglescout',+ 'kadoa',+ 'kaggle',+ 'kaleido',+ 'kanbanize',+ 'keen_io',+ 'keyword',+ 'kibana',+ 'kickbox',+ 'kieai',+ 'kit',+ 'klaviyo',+ 'klazify',+ 'klipfolio',+ 'knack',+ 'ko_fi',+ 'kommo',+ 'kontent_ai',+ 'kraken_io',+ 'l2s',+ 'labs64_netlicensing',+ 'lagrowthmachine',+ 'landbot',+ 'langbase',+ 'laposta',+ 'launch_darkly',+ 'leadboxer',+ 'leadfeeder',+ 'leadiq',+ 'leadoku',+ 'leexi',+ 'leiga',+ 'lemlist',+ 'lemon_squeezy',+ 'lessonspace',+ 'lever',+ 'leverly',+ 'lexoffice',+ 'linear',+ 'linguapop',+ 'linkedin',+ 'linkedin_ads',+ 'linkhut',+ 'linkly',+ 'linkup',+ 'listclean',+ 'listennotes',+ 'livesession',+ 'llmwhisperer',+ 'lmnt',+ 'lob',+ 'lodgify',+ 'logo_dev',+ 'loomio',+ 'loops_so',+ 'loyverse',+ 'lusha',+ 'magnetic',+ 'mailbluster',+ 'mailboxlayer',+ 'mailcheck',+ 'mailchimp',+ 'mailcoach',+ 'mailercloud',+ 'mailerlite',+ 'mailersend',+ 'mails_so',+ 'mailsoftly',+ 'mailtrap',+ 'maintainx',+ 'make',+ 'malwarebytes_mcp',+ 'manus',+ 'mapbox',+ 'mapulus',+ 'marketstack',+ 'matterport',+ 'maxio',+ 'melo',+ 'mem',+ 'mem0',+ 'memberspot',+ 'memberstack',+ 'membervault',+ 'mercury_mcp',+ 'mermaid_chart_mcp',+ 'metaads',+ 'metabase',+ 'metaphor',+ 'metatextai',+ 'mezmo',+ 'microsoft_clarity',+ 'microsoft_power_bi',+ 'microsoft_teams',+ 'microsoft_todo',+ 'minerstat',+ 'mintlify',+ 'miro',+ 'missive',+ 'mistral_ai',+ 'mixmax',+ 'mixpanel',+ 'mobbin_mcp',+ 'mocean',+ 'moco',+ 'modelry',+ 'monday',+ 'monday_mcp',+ 'moneybird',+ 'moonclerk',+ 'moosend',+ 'mopinion',+ 'more_trees',+ 'mospi_mcp',+ 'motion',+ 'moz',+ 'msg91',+ 'mural',+ 'mx_technologies',+ 'mx_toolbox',+ 'nango',+ 'nano_nets',+ 'nasa',+ 'nasdaq',+ 'needle',+ 'neo4j',+ 'neon',+ 'nethunt_crm',+ 'netsuite',+ 'neuronwriter',+ 'neutrino',+ 'neverbounce',+ 'new_relic',+ 'news_api',+ 'nextdns',+ 'ngrok',+ 'niftyimages',+ 'ninox',+ 'nocodb',+ 'nocrm_io',+ 'northflank',+ 'notion',+ 'nozbe_teams',+ 'npm',+ 'ntfy',+ 'nusii_proposals',+ 'nutshell',+ 'ocr_web_service',+ 'ocrspace',+ 'odoo',+ 'oksign',+ 'ollama',+ 'omnisend',+ 'one_drive',+ 'onedesk',+ 'onenote',+ 'onepage',+ 'onesignal_rest_api',+ 'onesignal_user_auth',+ 'open_sea',+ 'openai',+ 'opencage',+ 'opengraph_io',+ 'openperplex',+ 'openrouter',+ 'openweather_api',+ 'optimoroute',+ 'outline',+ 'outlook',+ 'owl_protocol',+ 'page_x',+ 'pagerduty',+ 'pandadoc',+ 'paperform',+ 'paradym',+ 'parallel',+ 'parma',+ 'parsehub',+ 'parsera',+ 'parseur',+ 'parsio_io',+ 'passcreator',+ 'passslot',+ 'payhere',+ 'payhip',+ 'paypal',+ 'paystack',+ 'pdf4me',+ 'pdf_api_io',+ 'pdf_co',+ 'pdfless',+ 'pdfmonkey',+ 'penpot',+ 'peopledatalabs',+ 'perigon',+ 'perplexityai',+ 'persistiq',+ 'persona',+ 'pexels',+ 'phantombuster',+ 'piggy',+ 'piloterr',+ 'pilvio',+ 'pinecone',+ 'pingdom',+ 'pipedrive',+ 'pipeline_crm',+ 'placekey',+ 'placid',+ 'plain',+ 'planly',+ 'planyo_online_booking',+ 'plasmic',+ 'platerecognizer',+ 'plausible_analytics',+ 'plisio',+ 'pointagram',+ 'polygon',+ 'polygon_io',+ 'polymarket',+ 'polymarket_us',+ 'poof',+ 'pophive_mcp',+ 'postalytics',+ 'postgrid',+ 'postgrid_verify',+ 'posthog',+ 'postiz_mcp',+ 'postman',+ 'postmark',+ 'prerender',+ 'printautopilot',+ 'prisma',+ 'prismic',+ 'proabono',+ 'process_street',+ 'procfu',+ 'productboard',+ 'productlane',+ 'project_bubble',+ 'promptmate_io',+ 'proofly',+ 'proxiedmail',+ 'push_by_techulus',+ 'pushbullet',+ 'pushover',+ 'pylon_mcp',+ 'quaderno',+ 'quickbooks',+ 'radar',+ 'rafflys',+ 'ragic',+ 'ragie',+ 'railway',+ 'raisely',+ 'ramp',+ 'rawg_video_games_database',+ 'razorpay',+ 're_amaze',+ 'realphonevalidation',+ 'recallai',+ 'recruitee',+ 'redcircle_api',+ 'reddit',+ 'reddit_ads',+ 'referralrock',+ 'refiner',+ 'remarkety',+ 'remote_retrieval',+ 'remove_bg',+ 'render',+ 'renderform',+ 'rentman',+ 'repairshopr',+ 'replicate',+ 'reply',+ 'reply_io',+ 'resend',+ 'respond_io',+ 'retailed',+ 'retellai',+ 'retently',+ 'rev',+ 'rev_ai',+ 'revolt',+ 'ritekit',+ 'rize',+ 'rkvst',+ 'roam',+ 'roboflow',+ 'rocket_reach',+ 'rocketadmin',+ 'rocketlane',+ 'rollbar',+ 'rootly',+ 'rosette_text_analytics',+ 'route4me',+ 'rudderstack_transformation',+ 'runpod',+ 'safetyculture',+ 'salesflare',+ 'salesforce',+ 'salesforce_service_cloud',+ 'salesmate',+ 'sanity',+ 'sap_successfactors',+ 'saperly',+ 'satismeter',+ 'saucelabs',+ 'scale_ai',+ 'scheduleonce',+ 'scrape_do',+ 'scrapegraph_ai',+ 'scrapfly',+ 'scrapingant',+ 'scrapingbee',+ 'screenshot_fyi',+ 'screenshotone',+ 'search_api',+ 'seat_geek',+ 'securitytrails',+ 'segment',+ 'segmetrics',+ 'semanticscholar',+ 'semrush',+ 'sendbird',+ 'sendbird_ai_chabot',+ 'sender',+ 'sendfox',+ 'sendgrid',+ 'sendlane',+ 'sendloop',+ 'sendspark',+ 'sensibo',+ 'sentry',+ 'seqera',+ 'serpapi',+ 'serpdog',+ 'serphouse',+ 'serply',+ 'serveravatar',+ 'servicem8',+ 'servicenow',+ 'sevdesk',+ 'share_point',+ 'sharepoint_graph',+ 'shipday',+ 'shipengine',+ 'shippo',+ 'shopify',+ 'short_io',+ 'short_menu',+ 'shortcut',+ 'shorten_rest',+ 'shortpixel',+ 'shotstack',+ 'sidetracker',+ 'signaturely',+ 'signpath',+ 'signwell',+ 'similarweb_digitalrank_api',+ 'simla_com',+ 'simple_analytics',+ 'simplekpi',+ 'simplero',+ 'simplesat',+ 'sitespeakai',+ 'skyfire',+ 'slack',+ 'slackbot',+ 'slidesgpt_mcp',+ 'slite',+ 'smartproxy',+ 'sms_alert',+ 'smtp2go',+ 'smugmug',+ 'snapchat',+ 'snowflake',+ 'snowflake_basic',+ 'softr',+ 'solcast',+ 'soundcloud',+ 'sourcegraph',+ 'specific',+ 'splitwise',+ 'spoki',+ 'spondyr',+ 'spotify',+ 'spotlightr',+ 'square',+ 'sslmate_cert_spotter_api',+ 'stack_ai',+ 'stack_exchange',+ 'stannp',+ 'starton',+ 'statuscake',+ 'storeganise',+ 'storerocket',+ 'stormboard',+ 'stormglass_io',+ 'storyblok',+ 'strava',+ 'streamtime',+ 'stripe',+ 'studio_by_ai21_labs',+ 'suitedash',+ 'supabase',+ 'supadata',+ 'superchat',+ 'supersaas',+ 'supportbee',+ 'supportivekoala',+ 'survey_monkey',+ 'svix',+ 'swaggerhub',+ 'swarmsyncai',+ 'sympla',+ 'synthflow_ai',+ 'taggun',+ 'talenthr',+ 'tally',+ 'tapfiliate',+ 'taskrabbit_mcp',+ 'tave',+ 'tavily',+ 'tavily_mcp',+ 'taxjar',+ 'teamcamp',+ 'telegram',+ 'telnyx',+ 'teltel',+ 'templated',+ 'test_app',+ 'text_to_pdf',+ 'textcortex',+ 'textit',+ 'textrazor',+ 'thanks_io',+ 'the_odds_api',+ 'ticketmaster',+ 'ticktick',+ 'tidy',+ 'tiktok',+ 'timecamp',+ 'timelinesai',+ 'timelink',+ 'timely',+ 'tinyfish_mcp',+ 'tinypng',+ 'tinyurl',+ 'tisane',+ 'tldv',+ 'todoist',+ 'toggl',+ 'token_metrics',+ 'tomba',+ 'tomtom',+ 'toneden',+ 'tpscheck',+ 'trello',+ 'triggercmd',+ 'tripadvisor',+ 'tripadvisor_content_api',+ 'trivago_mcp',+ 'truvera',+ 'turbot_pipes',+ 'turso',+ 'twelve_data',+ 'twitter',+ 'twocaptcha',+ 'typeform',+ 'typefully',+ 'typless',+ 'u301',+ 'unione',+ 'unisender',+ 'uniswap_api',+ 'updown_io',+ 'uploadcare',+ 'uptimerobot',+ 'userflow',+ 'userlist',+ 'v0',+ 'vapi',+ 'vectorshift',+ 'veo',+ 'vercel',+ 'verifiedemail',+ 'veriphone',+ 'vestaboard',+ 'viator_mcp',+ 'virustotal',+ 'waboxapp',+ 'wachete',+ 'waiverfile',+ 'wakatime',+ 'wati',+ 'weathermap',+ 'webex',+ 'webflow',+ 'webscraper_io',+ 'webscraping_ai',+ 'webvizio',+ 'whatsapp',+ 'whautomate',+ 'whoisfreaks',+ 'whop',+ 'winston_ai',+ 'wisepops',+ 'wit_ai',+ 'wix',+ 'wix_mcp',+ 'wiza',+ 'wolfram_alpha_api',+ 'woodpecker_co',+ 'workable',+ 'workday',+ 'workiom',+ 'worksnaps',+ 'world_news_api',+ 'wrike',+ 'writer',+ 'xata',+ 'xero',+ 'y_gy',+ 'yandex',+ 'yelp',+ 'ynab',+ 'yousearch',+ 'youtube',+ 'zendesk',+ 'zenrows',+ 'zenserp',+ 'zep',+ 'zeplin',+ 'zerobounce',+ 'ziprecruiter_mcp',+ 'zixflow',+ 'zoho',+ 'zoho_bigin',+ 'zoho_books',+ 'zoho_desk',+ 'zoho_inventory',+ 'zoho_invoice',+ 'zoho_mail',+ 'zoom',+ 'zoominfo',+ 'zulip',+ 'zylvie',+ 'zyte_api',+];++/** When the list above was generated. */+export const BAKED_TOOLKIT_SLUGS_REFRESHED_AT = '2026-08-04T13:45:26.052Z';diff --git a/ts/packages/cli/src/models/toolkits.ts b/ts/packages/cli/src/models/toolkits.tsindex c72bc6ade..e9690d32c 100644--- a/ts/packages/cli/src/models/toolkits.ts+++ b/ts/packages/cli/src/models/toolkits.ts@@ -2,15 +2,23 @@ import { Brand, Schema } from 'effect';import { JSONTransformSchema } from './utils/json-transform-schema';/**- * A toolkit slug used to derive generated source filenames.+ * The shape of a toolkit slug: a single, safe path segment (no `/`, `\`, or+ * `..`), which prevents path traversal / arbitrary file write when a slug is+ * interpolated into a filename and joined to the generator's output directory.+ * See CWE-22.*- * Restricted to a single, safe path segment (no `/`, `\`, or `..`) to prevent- * path traversal / arbitrary file write when the slug is interpolated into a- * filename and joined to the generator's output directory. See CWE-22.+ * Shared so that every place that has to vouch for a slug — the schema below,+ * the baked-catalog generator, and the test guarding its output — tightens+ * together rather than drifting apart.+ */+export const TOOLKIT_SLUG_PATTERN = /^[a-z0-9_][a-z0-9_-]*$/;++/**+ * A toolkit slug used to derive generated source filenames.*/export const ToolkitSlug = Schema.Trim.pipe(Schema.nonEmptyString(),- Schema.pattern(/^[a-z0-9_][a-z0-9_-]*$/, {+ Schema.pattern(TOOLKIT_SLUG_PATTERN, {identifier: 'ToolkitSlug',message: () =>'Toolkit slug must contain only lowercase letters, digits, underscores, and hyphens (no path separators)',diff --git a/ts/packages/cli/test/src/generated/toolkit-slugs.test.ts b/ts/packages/cli/test/src/generated/toolkit-slugs.test.tsnew file mode 100644index 000000000..e77575f4c--- /dev/null+++ b/ts/packages/cli/test/src/generated/toolkit-slugs.test.ts@@ -0,0 +1,37 @@+import { describe, expect, it } from 'vitest';+import { BAKED_TOOLKIT_SLUGS, BAKED_TOOLKIT_SLUGS_REFRESHED_AT } from 'src/generated/toolkit-slugs';+import { TOOLKIT_SLUG_PATTERN } from 'src/models/toolkits';++/**+ * Guards the checked-in output of `scripts/generate-toolkit-slugs.ts`. The+ * resolver reads this list on every tool execution, so a hand-edit or a bad+ * regeneration is a correctness problem, not a cosmetic one. Nothing here+ * touches the network — the point is that the CLI does not have to either.+ */+describe('BAKED_TOOLKIT_SLUGS', () => {+ it('holds the whole catalog', () => {+ expect(BAKED_TOOLKIT_SLUGS.length).toBeGreaterThanOrEqual(1000);+ });++ it('is sorted and free of duplicates', () => {+ expect([...BAKED_TOOLKIT_SLUGS]).toEqual([...new Set(BAKED_TOOLKIT_SLUGS)].sort());+ });++ it('holds only lowercase slugs', () => {+ const malformed = BAKED_TOOLKIT_SLUGS.filter(slug => !TOOLKIT_SLUG_PATTERN.test(slug));+ expect(malformed).toEqual([]);+ });++ it('includes staple toolkits', () => {+ expect(BAKED_TOOLKIT_SLUGS).toContain('github');+ expect(BAKED_TOOLKIT_SLUGS).toContain('gmail');+ // The multi-word slug behind https://github.com/ComposioHQ/composio/issues/4049.+ expect(BAKED_TOOLKIT_SLUGS).toContain('google_analytics');+ });++ it('records when it was generated', () => {+ expect(new Date(BAKED_TOOLKIT_SLUGS_REFRESHED_AT).toISOString()).toBe(+ BAKED_TOOLKIT_SLUGS_REFRESHED_AT+ );+ });+});