@devries-cameron20 / composio-1 / commits / f57b395a8
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.

[codex] Deduplicate CLI skill release channel helpers (#3131)

## Summary - address the two unresolved bugbot cleanup comments from #3127 - centralize the CLI release channel type in one canonical definition - reuse the existing feature-gating helper for composio-cli skill builds instead of duplicating it ## Why The remaining bugbot comments on #3127 were both valid low-severity duplication issues. This follow-up keeps the release-channel and skill-build logic from drifting across files without changing behavior. ## Validation - `pnpm --filter @composio/cli validate:skills` - `pnpm --filter @composio/cli exec vitest run test/src/effects/install-skill.test.ts` - `pnpm --filter @composio/cli typecheck`

Rahul Tarak committed Apr 7, 2026 at 01:41 UTC f57b395a852e2ae94565c3c49e1fff0fdfead5c2
6 files changed +12 -12
ts/packages/cli/skills-src/composio-cli/index.ts
+1 -3
@@ -5,6 +5,7 @@ import { composioDevReference } from './references/composio-dev';
5 import { powerUserExamplesReference } from './references/power-user-examples';
6 import { troubleshootingReference } from './references/troubleshooting';
7 import {
8 + isEnabledForBuild,
9 renderReferenceDocument,
10 resolveSkillBuildContext,
11 validateReferenceDocument,
@@ -40,9 +41,6 @@ type SkillCommand = {
41 }>;
42 };
43
43 -const isEnabledForBuild = (build: SkillBuildContext, entry?: { features?: SkillFeatureFlag[] }) =>
44 - !entry?.features || entry.features.every(feature => build.experimentalFeatures[feature]);
45 -
44 const sourceAssetsDir = path.resolve(import.meta.dirname, './assets');
45
46 const frontmatter = {
ts/packages/cli/skills-src/composio-cli/reference-schema.ts
+3 -3
@@ -1,6 +1,6 @@
1 -import { CLI_EXPERIMENTAL_FEATURES } from '../../src/constants';
1 +import { CLI_EXPERIMENTAL_FEATURES, type CliReleaseChannel } from '../../src/constants';
2
3 -export type SkillReleaseChannel = 'beta' | 'stable';
3 +export type SkillReleaseChannel = CliReleaseChannel;
4
5 export type SkillFeatureFlag =
6 (typeof CLI_EXPERIMENTAL_FEATURES)[keyof typeof CLI_EXPERIMENTAL_FEATURES];
@@ -54,7 +54,7 @@ export const resolveSkillBuildContext = (channel: SkillReleaseChannel): SkillBui
54 },
55 });
56
57 -const isEnabledForBuild = (build: SkillBuildContext, value?: FeatureScoped) =>
57 +export const isEnabledForBuild = (build: SkillBuildContext, value?: FeatureScoped) =>
58 !value?.features || value.features.every(feature => build.experimentalFeatures[feature]);
59
60 export const renderCommandSnippet = (snippet: CommandSnippet) => {
ts/packages/cli/src/constants.ts
+4
@@ -89,3 +89,7 @@ export const GITHUB_REPO = {
89 export const CLI_EXPERIMENTAL_FEATURES = {
90 LISTEN: 'listen',
91 } as const;
92 +
93 +export const CLI_RELEASE_CHANNELS = ['stable', 'beta'] as const;
94 +
95 +export type CliReleaseChannel = (typeof CLI_RELEASE_CHANNELS)[number];
ts/packages/cli/src/effects/install-skill.ts
+2 -2
@@ -5,7 +5,7 @@ import { HttpClient } from '@effect/platform';
5 import { NodeOs } from 'src/services/node-os';
6 import { TerminalUI } from 'src/services/terminal-ui';
7 import { GITHUB_CONFIG } from 'src/effects/github-config';
8 -import { APP_VERSION } from 'src/constants';
8 +import { APP_VERSION, type CliReleaseChannel } from 'src/constants';
9 import {
10 fetchLatestCliRelease,
11 type GitHubRelease,
@@ -15,7 +15,7 @@ import decompress from 'decompress';
15
16 const SKILL_NAME = 'composio-cli';
17 const SKILL_ASSET_NAME = 'composio-skill.zip';
18 -export type SkillReleaseChannel = 'beta' | 'stable';
18 +export type SkillReleaseChannel = CliReleaseChannel;
19
20 type GitHubConfig = GitHubRepoConfig & {
21 TAG: Option.Option<string>;
ts/packages/cli/src/effects/resolve-cli-release.ts
+1 -2
@@ -1,8 +1,7 @@
1 import { Effect } from 'effect';
2 import { HttpClient } from '@effect/platform';
3 import { semverComparator } from 'src/effects/compare-semver';
4 -
5 -export type CliReleaseChannel = 'beta' | 'stable';
4 +import type { CliReleaseChannel } from 'src/constants';
5
6 export type GitHubReleaseAsset = {
7 name: string;
ts/packages/cli/src/services/cli-user-config.ts
+1 -2
@@ -12,8 +12,7 @@ import {
12 cliUserConfigToJSON,
13 } from 'src/models/cli-user-config';
14 import * as constants from 'src/constants';
15 -
16 -export type CliReleaseChannel = 'stable' | 'beta';
15 +import type { CliReleaseChannel } from 'src/constants';
16
17 export type CliUserConfigResolved = {
18 readonly channel: CliReleaseChannel;