@devries-cameron20 / composio Mirror · read-only / commits / 6b0db59c3
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, 12:15 UTC

refactor(cli): load each generation pipeline through one entry module

The generate handlers assembled their pipeline from three or four dynamic imports and repackaged the results by hand. Each pipeline now has an index module that re-exports what the handler needs, so the deferred load is a single import and the boundary the handler crosses is named. Claude-Session: https://claude.ai/code/session_01MTb47vexN35pLGsSZwBmrJ

jkomyno committed Sep 14, 2026 at 16:11 UTC 6b0db59c30265df5d359dc1b0d2052868e6231d0
4 files changed +19 -24
ts/packages/cli/src/commands/py/commands/py.generate.cmd.ts
+1 -11
@@ -63,17 +63,7 @@ export const pyCmd$Generate = _pyCmd$Generate.pipe(Command.withHandler(generateP
63 * `composio generate` needs it, so the import stays inside the handler instead
64 * of on every command's startup path.
65 */
66 -const loadPythonGeneration = Effect.promise(() =>
67 - Promise.all([
68 - import('src/generation/create-toolkit-index'),
69 - import('src/generation/python/generate'),
70 - import('src/generation/constants'),
71 - ]).then(([toolkitIndex, generate, constants]) => ({
72 - createToolkitIndex: toolkitIndex.createToolkitIndex,
73 - generatePythonSources: generate.generatePythonSources,
74 - BANNER: constants.BANNER,
75 - }))
76 -);
66 +const loadPythonGeneration = Effect.promise(() => import('src/generation/python'));
67
68 export function generatePythonTypeStubs({
69 outputOpt,
ts/packages/cli/src/commands/ts/commands/ts.generate.cmd.ts
+1 -13
@@ -369,19 +369,7 @@ export const handleTsGenerate = (params: GetCmdParams<typeof _tsCmd$Generate>) =
369 * invariant rather than a recoverable failure, so this is `Effect.promise`. The
370 * module registry memoizes the import.
371 */
372 -const loadTypeScriptGeneration = Effect.promise(() =>
373 - Promise.all([
374 - import('src/generation/create-toolkit-index'),
375 - import('src/generation/typescript/generate'),
376 - import('src/generation/typescript/transpile'),
377 - import('src/generation/constants'),
378 - ]).then(([toolkitIndex, generate, transpile, constants]) => ({
379 - createToolkitIndex: toolkitIndex.createToolkitIndex,
380 - generateTypeScriptSources: generate.generateTypeScriptSources,
381 - transpileTypeScriptSources: transpile.transpileTypeScriptSources,
382 - BANNER: constants.BANNER,
383 - }))
384 -);
372 +const loadTypeScriptGeneration = Effect.promise(() => import('src/generation/typescript'));
373
374 export function generateTypescriptTypeStubs({
375 outputOpt,
ts/packages/cli/src/generation/python/index.ts new
+8
@@ -0,0 +1,8 @@
1 +/**
2 + * Entry module for the Python generation pipeline. `composio generate py`
3 + * imports it dynamically from inside its handler so the pipeline stays off every
4 + * other command's startup path.
5 + */
6 +export { createToolkitIndex } from 'src/generation/create-toolkit-index';
7 +export { BANNER } from 'src/generation/constants';
8 +export { generatePythonSources } from 'src/generation/python/generate';
ts/packages/cli/src/generation/typescript/index.ts new
+9
@@ -0,0 +1,9 @@
1 +/**
2 + * Entry module for the TypeScript generation pipeline. `composio generate ts`
3 + * imports it dynamically from inside its handler, because the pipeline pulls in
4 + * the TypeScript compiler and must stay off every other command's startup path.
5 + */
6 +export { createToolkitIndex } from 'src/generation/create-toolkit-index';
7 +export { BANNER } from 'src/generation/constants';
8 +export { generateTypeScriptSources } from 'src/generation/typescript/generate';
9 +export { transpileTypeScriptSources } from 'src/generation/typescript/transpile';