@devries-cameron20 / composio Mirror · read-only / commits / e655ab2fe
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 22, 05:45 UTC

fix(cli): e2e tests

jkomyno committed Feb 25, 2026 at 20:14 UTC e655ab2fe5c16d45d9bbea86cef55ed98240add1
3 files changed +27 -51
ts/e2e-tests/_utils/src/const.ts
+1 -1
@@ -1,7 +1,7 @@
1 /**
2 * Environment variables to automatically pass through to Docker containers.
3 */
4 -export const WELL_KNOWN_ENV_VARS = ['COMPOSIO_API_KEY', 'OPENAI_API_KEY'] as const;
4 +export const WELL_KNOWN_ENV_VARS = ['COMPOSIO_API_KEY', 'COMPOSIO_BASE_URL', 'OPENAI_API_KEY'] as const;
5
6 /**
7 * Node.js versions that are well-known to the CI matrix strategy.
ts/e2e-tests/cli/toolkits/info/e2e.test.ts
+12 -19
@@ -64,35 +64,27 @@ e2e(import.meta.url, {
64 expect(obj.slug).toBe('gmail');
65 });
66
67 - it('has meta with description, tools_count, and triggers_count', () => {
67 + it('has meta with description and logo', () => {
68 const obj = JSON.parse(sanitizeOutput(validResult.stdout));
69 expect(obj.meta).toHaveProperty('description');
70 - expect(typeof obj.meta.tools_count).toBe('number');
71 - expect(typeof obj.meta.triggers_count).toBe('number');
70 + expect(typeof obj.meta.description).toBe('string');
71 + expect(obj.meta).toHaveProperty('logo');
72 });
73
74 - it('has auth_config_details array', () => {
74 + it('has is_no_auth and enabled', () => {
75 const obj = JSON.parse(sanitizeOutput(validResult.stdout));
76 - expect(Array.isArray(obj.auth_config_details)).toBe(true);
77 - expect(obj.auth_config_details.length).toBeGreaterThan(0);
76 + expect(typeof obj.is_no_auth).toBe('boolean');
77 + expect(typeof obj.enabled).toBe('boolean');
78 });
79
80 - it('each auth_config_detail has mode, name, and fields', () => {
80 + it('has composio_managed_auth_schemes array', () => {
81 const obj = JSON.parse(sanitizeOutput(validResult.stdout));
82 - for (const detail of obj.auth_config_details) {
83 - expect(detail).toHaveProperty('mode');
84 - expect(detail).toHaveProperty('name');
85 - expect(detail).toHaveProperty('fields');
86 - expect(detail.fields).toHaveProperty('auth_config_creation');
87 - expect(detail.fields).toHaveProperty('connected_account_initiation');
88 - }
82 + expect(Array.isArray(obj.composio_managed_auth_schemes)).toBe(true);
83 });
84
91 - it('has composio_managed_auth_schemes, no_auth, and is_local_toolkit', () => {
85 + it('has connected_account (object or null)', () => {
86 const obj = JSON.parse(sanitizeOutput(validResult.stdout));
93 - expect(Array.isArray(obj.composio_managed_auth_schemes)).toBe(true);
94 - expect(typeof obj.no_auth).toBe('boolean');
95 - expect(typeof obj.is_local_toolkit).toBe('boolean');
87 + expect(obj).toHaveProperty('connected_account');
88 });
89 });
90
@@ -110,7 +102,8 @@ e2e(import.meta.url, {
102 });
103
104 it('out.json contains valid JSON with slug "gmail"', () => {
113 - const obj = JSON.parse(sanitizeOutput(redirectResult.files['out.json']));
105 + const content = redirectResult.files['out.json'];
106 + const obj = JSON.parse(sanitizeOutput(content));
107 expect(obj.slug).toBe('gmail');
108 });
109 });
ts/packages/cli/src/commands/toolkits/commands/toolkits.info.cmd.ts
+14 -31
@@ -43,42 +43,25 @@ export const toolkitsCmd$Info = Command.make('info', { slug, userId }, ({ slug,
43 const clientSingleton = yield* ComposioClientSingleton;
44 const client = yield* clientSingleton.get();
45
46 - const toolkitOpt = yield* ui
47 - .withSpinner(
48 - `Fetching toolkit "${slugValue}"...`,
49 - Effect.gen(function* () {
50 - const sessionId = yield* createToolRouterSession(client, userId);
51 - const result = yield* Effect.tryPromise(() =>
52 - client.toolRouter.session.toolkits(sessionId, {
53 - toolkits: [slugValue],
54 - })
55 - );
56 - const item = result.items[0];
57 - if (!item) {
58 - return yield* Effect.fail(new Error(`Toolkit "${slugValue}" not found.`));
59 - }
60 - return item;
61 - })
62 - )
63 - .pipe(
64 - Effect.asSome,
65 - Effect.catchAll(error =>
66 - Effect.gen(function* () {
67 - const message =
68 - error instanceof Error ? error.message : `Failed to fetch toolkit "${slugValue}".`;
69 - yield* ui.log.error(message);
70 - yield* ui.log.step('Browse available toolkits:\n> composio toolkits list');
71 - return Option.none();
46 + const result = yield* ui.withSpinner(
47 + `Fetching toolkit "${slugValue}"...`,
48 + Effect.gen(function* () {
49 + const sessionId = yield* createToolRouterSession(client, userId);
50 + return yield* Effect.tryPromise(() =>
51 + client.toolRouter.session.toolkits(sessionId, {
52 + toolkits: [slugValue],
53 })
73 - )
74 - );
54 + );
55 + })
56 + );
57
76 - if (Option.isNone(toolkitOpt)) {
58 + const toolkit = result.items[0];
59 + if (!toolkit) {
60 + yield* ui.log.warn(`Toolkit "${slugValue}" not found.`);
61 + yield* ui.log.step('Browse available toolkits:\n> composio toolkits list');
62 return;
63 }
64
80 - const toolkit = toolkitOpt.value;
81 -
65 yield* ui.note(formatToolkitInfo(toolkit), `Toolkit: ${toolkit.name}`);
66
67 // Next step hint