@devries-cameron20 / composio Mirror · read-only / commits / dacb61745
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, 02:00 UTC

Revert "Release: custom tools alpha (0.7.0-alpha.0) (#2953)"

This reverts commit e14d6d98d5a4291c4b33c02f2c1cb93e9dbe0524, reversing changes made to 6bcac5beb80270732674e9cd23d1f3ace67c1ba9.

dhawal committed Mar 18, 2026 at 23:57 UTC dacb61745209036e3e431684756c2ff52f7e3230
27 files changed +45 -237
.changeset/custom-tools-alpha-release.md deleted
-35
@@ -1,35 +0,0 @@
1 ----
2 -"@composio/core": minor
3 ----
4 -
5 -feat(core): custom tools, custom toolkits, and proxy execute for tool router sessions (TypeScript only)
6 -
7 -### Custom Tools
8 -
9 -Define local tools that execute in-process alongside remote Composio tools:
10 -
11 -- **Standalone tools** — no auth, run entirely locally
12 -- **Extension tools** — inherit auth from a Composio toolkit (e.g. Gmail) via `extendsToolkit`
13 -- **Custom toolkits** — group related tools under a namespace
14 -
15 -### Proxy Execute
16 -
17 -`session.proxyExecute()` and `ctx.proxyExecute()` for raw HTTP API calls through Composio's auth layer. Returns `{ status, data, headers }`.
18 -
19 -### Session Creation
20 -
21 -```typescript
22 -const session = await composio.create("user_123", {
23 - toolkits: ["gmail"],
24 - experimental: {
25 - customTools: [myTool, myExtensionTool],
26 - customToolkits: [myToolkit],
27 - },
28 -});
29 -```
30 -
31 -### Other Changes
32 -
33 -- Slug mapping uses backend response (`slug`/`original_slug`) instead of client-side prefix
34 -- Uses official `@composio/client@0.1.0-alpha.62` types
35 -- `proxyExecute` uses official client method
.changeset/pre.json deleted
-22
@@ -1,22 +0,0 @@
1 -{
2 - "mode": "pre",
3 - "tag": "alpha",
4 - "initialVersions": {
5 - "@composio/cli": "0.2.4",
6 - "@composio/core": "0.6.5",
7 - "@composio/json-schema-to-zod": "0.1.20",
8 - "@composio/anthropic": "0.6.5",
9 - "@composio/claude-agent-sdk": "0.6.5",
10 - "@composio/cloudflare": "0.6.5",
11 - "@composio/google": "0.6.5",
12 - "@composio/langchain": "0.6.5",
13 - "@composio/llamaindex": "0.6.5",
14 - "@composio/mastra": "0.6.5",
15 - "@composio/openai": "0.6.5",
16 - "@composio/openai-agents": "0.6.5",
17 - "@composio/vercel": "0.6.5"
18 - },
19 - "changesets": [
20 - "custom-tools-alpha-release"
21 - ]
22 -}
ts/examples/tool-router/src/custom-tools.ts
+23 -71
@@ -5,11 +5,6 @@
5 * remote Composio tools. Includes a tool that calls the Gmail API
6 * directly via ctx.proxyExecute().
7 *
8 - * Three tool types demonstrated:
9 - * 1. Standalone — no auth, pure local logic
10 - * 2. Extension — inherits auth from a Composio toolkit (Gmail)
11 - * 3. Toolkit — groups related tools under a namespace
12 - *
8 * Usage:
9 * COMPOSIO_API_KEY=... OPENAI_API_KEY=... bun src/custom-tools.ts
10 */
@@ -19,16 +14,16 @@ import { OpenAIAgentsProvider } from "@composio/openai-agents";
14 import { Agent, run } from "@openai/agents";
15 import { z } from "zod/v3";
16
22 -// ── 1. Standalone tool (no auth) ────────────────────────────────
17 +// ── Custom tools ────────────────────────────────────────────────
18
19 +/** Standalone tool (no auth needed) */
20 const getUser = experimental_createTool("GET_USER", {
21 name: "Get user",
26 - description: "Look up an internal user by ID. Returns name, email, and role.",
22 + description: "Look up an internal user by ID",
23 inputParams: z.object({
28 - user_id: z.string().describe("User ID (e.g. user-1, user-2)"),
24 + user_id: z.string().describe("User ID (e.g. user-1)"),
25 }),
26 execute: async ({ user_id }) => {
31 - // In a real app, this would query your database
27 const users: Record<string, Record<string, string>> = {
28 "user-1": { name: "Alice Johnson", email: "alice@acme.com", role: "admin" },
29 "user-2": { name: "Bob Smith", email: "bob@acme.com", role: "developer" },
@@ -39,61 +34,46 @@ const getUser = experimental_createTool("GET_USER", {
34 },
35 });
36
42 -// ── 2. Extension tool (inherits Gmail auth via proxy execute) ───
43 -
44 -const sendCompanyEmail = experimental_createTool("SEND_COMPANY_EMAIL", {
45 - name: "Send company formatted email",
46 - description:
47 - "Draft a company-branded email via Gmail. Adds a standard signature " +
48 - "and formats the body with the company template. The draft appears " +
49 - "in the authenticated user's Gmail drafts folder.",
37 +/** Extension tool — inherits Gmail auth, calls the real API via proxy */
38 +const createDraft = experimental_createTool("CREATE_DRAFT", {
39 + name: "Create Gmail draft",
40 + description: "Create a real Gmail draft via the Gmail API. Appears in the user's drafts folder.",
41 extendsToolkit: "gmail",
42 inputParams: z.object({
43 to: z.string().describe("Recipient email address"),
44 subject: z.string().describe("Email subject"),
54 - body: z.string().describe("Email body content (plain text)"),
45 + body: z.string().describe("Email body (plain text)"),
46 }),
47 execute: async (input, ctx) => {
57 - // Add company branding to the email
58 - const branded = [
59 - input.body,
60 - "",
61 - "---",
62 - "Sent via Acme Corp Internal Tools",
63 - `Drafted by: ${ctx.userId}`,
64 - ].join("\r\n");
65 -
66 - // Build RFC 2822 email and base64url encode
67 - const rawEmail = `To: ${input.to}\r\nSubject: ${input.subject}\r\nContent-Type: text/plain; charset=UTF-8\r\n\r\n${branded}`;
68 - const encoded = Buffer.from(rawEmail)
48 + const raw = Buffer.from(
49 + `To: ${input.to}\r\nSubject: ${input.subject}\r\nContent-Type: text/plain; charset=UTF-8\r\n\r\n${input.body}`
50 + )
51 .toString("base64")
52 .replace(/\+/g, "-")
53 .replace(/\//g, "_")
54 .replace(/=+$/, "");
55
74 - // Create draft via Gmail API using session's auth
56 const res = await ctx.proxyExecute({
57 toolkit: "gmail",
58 endpoint: "https://gmail.googleapis.com/gmail/v1/users/me/drafts",
59 method: "POST",
79 - body: { message: { raw: encoded } },
60 + body: { message: { raw } },
61 });
62
63 if (res.status !== 200) throw new Error(`Gmail API error ${res.status}`);
64 const data = res.data as { id: string; message: { id: string } };
84 - return { draft_id: data.id, to: input.to, subject: input.subject };
65 + return { draft_id: data.id, message_id: data.message.id, to: input.to, subject: input.subject };
66 },
67 });
68
88 -// ── 3. Custom toolkit (groups tools under a namespace) ──────────
89 -
69 +/** Custom toolkit — groups related tools under one namespace */
70 const roleManager = experimental_createToolkit("ROLE_MANAGER", {
71 name: "Role Manager",
92 - description: "Manage internal user roles and permissions",
72 + description: "Manage user roles",
73 tools: [
74 experimental_createTool("SET_ROLE", {
75 name: "Set role",
96 - description: "Assign a new role to a user",
76 + description: "Set a user's role",
77 inputParams: z.object({
78 user_id: z.string().describe("User ID"),
79 role: z.enum(["admin", "developer", "viewer"]).describe("New role"),
@@ -103,24 +83,20 @@ const roleManager = experimental_createToolkit("ROLE_MANAGER", {
83 ],
84 });
85
106 -// ── Agent setup ─────────────────────────────────────────────────
86 +// ── Agent ────────────────────────────────────────────────────────
87
88 const composio = new Composio({
89 provider: new OpenAIAgentsProvider(),
90 });
91
112 -const session = await composio.create(process.env.COMPOSIO_USER_ID ?? "default", {
113 - toolkits: ["gmail", "weathermap"],
92 +const session = await composio.create("default", {
93 + toolkits: ["gmail"],
94 experimental: {
115 - customTools: [getUser, sendCompanyEmail],
95 + customTools: [getUser, createDraft],
96 customToolkits: [roleManager],
97 },
98 });
99
120 -console.log(`Session: ${session.sessionId}`);
121 -console.log("Custom tools:", session.customTools().map(t => t.slug).join(", "));
122 -console.log();
123 -
100 const tools = await session.tools();
101
102 const agent = new Agent({
@@ -132,32 +108,8 @@ const agent = new Agent({
108 tools,
109 });
110
135 -// Tool call logging
136 -agent.on("agent_tool_start", (_ctx, tool, details: Record<string, unknown>) => {
137 - const input = (details as { toolCall?: { arguments?: unknown } }).toolCall?.arguments ?? {};
138 - const json = JSON.stringify(typeof input === "string" ? JSON.parse(input) : input, null, 2);
139 - console.log(`\n ┌─ ${tool.name}`);
140 - console.log(` │ INPUT: ${json.length > 500 ? json.slice(0, 500) + "..." : json}`);
141 -});
142 -agent.on("agent_tool_end", (_ctx, tool, result: unknown) => {
143 - let output: unknown;
144 - try { output = typeof result === "string" ? JSON.parse(result as string) : result; } catch { output = result; }
145 - const json = JSON.stringify(output, null, 2);
146 - console.log(` │ OUTPUT: ${json.length > 500 ? json.slice(0, 500) + "..." : json}`);
147 - console.log(` └─ ${tool.name} done`);
148 -});
149 -
150 -// Multi-task prompt that exercises all tool types:
151 -// - Standalone local tool (get user)
152 -// - Toolkit local tool (set role)
153 -// - Remote Composio tool (weather)
154 -// - Extension local tool with proxy execute (company email)
155 -const prompt = process.argv[2] ?? `Do all of these:
156 -1. Look up user-1's profile
157 -2. Promote user-2 to admin
158 -3. What's the weather in Tokyo right now?
159 -4. Send a company formatted email to myself summarizing the above results`;
111 +const prompt = process.argv[2] ?? "Get user-1's info and draft an email to them saying hello";
112
113 console.log(`> ${prompt}\n`);
114 const result = await run(agent, prompt);
163 -console.log(`\n${result.finalOutput}`);
115 +console.log(result.finalOutput);
ts/packages/cli/CHANGELOG.md
-7
@@ -1,12 +1,5 @@
1 # @composio/cli
2
3 -## 0.7.0-alpha.0
4 -
5 -### Patch Changes
6 -
7 -- Updated dependencies
8 - - @composio/core@0.7.0-alpha.0
9 -
3 ## 0.2.4
4
5 ### Patch Changes
ts/packages/cli/package.json
+1 -1
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/cli",
3 - "version": "0.7.0-alpha.0",
3 + "version": "0.2.4",
4 "description": "Composio CLI",
5 "main": "./dist/bin.mjs",
6 "private": true,
ts/packages/core/CHANGELOG.md
-10
@@ -1,15 +1,5 @@
1 # @composio/core
2
3 -## 0.7.0-alpha.0
4 -
5 -### Minor Changes
6 -
7 -- Custom tools, custom toolkits, and proxy execute for tool router sessions (TypeScript only)
8 - - `experimental_createTool()` — standalone (no auth), extension (inherits toolkit auth via `extendsToolkit`), or grouped in toolkits
9 - - `experimental_createToolkit()` — group related tools under a namespace
10 - - `session.proxyExecute()` / `ctx.proxyExecute()` — raw HTTP calls through Composio auth, returns `{ status, data, headers }`
11 - - Bump `@composio/client` to `0.1.0-alpha.62`
12 -
3 ## 0.6.5
4
5 ### Patch Changes
ts/packages/core/package.json
+1 -1
@@ -1,7 +1,7 @@
1 {
2 "name": "@composio/core",
3 "type": "module",
4 - "version": "0.7.0-alpha.0",
4 + "version": "0.6.5",
5 "description": "",
6 "main": "src/index.ts",
7 "publishConfig": {
ts/packages/providers/anthropic/CHANGELOG.md
-7
@@ -1,12 +1,5 @@
1 # @composio/anthropic
2
3 -## 0.7.0-alpha.0
4 -
5 -### Patch Changes
6 -
7 -- Updated dependencies
8 - - @composio/core@0.7.0-alpha.0
9 -
3 ## 0.6.5
4
5 ### Patch Changes
ts/packages/providers/anthropic/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/anthropic",
3 - "version": "0.7.0-alpha.0",
3 + "version": "0.6.5",
4 "description": "Non-Agentic Provider for Anthropic in Composio SDK",
5 "main": "src/index.ts",
6 "publishConfig": {
@@ -43,7 +43,7 @@
43 "packageManager": "pnpm@10.28.0",
44 "peerDependencies": {
45 "@anthropic-ai/sdk": "^0.52.0",
46 - "@composio/core": "0.7.0-alpha.0",
46 + "@composio/core": "0.6.5",
47 "@mastra/mcp": "^0.12.0"
48 },
49 "devDependencies": {
ts/packages/providers/claude-agent-sdk/CHANGELOG.md
-7
@@ -1,12 +1,5 @@
1 # @composio/claude-code-agents
2
3 -## 0.7.0-alpha.0
4 -
5 -### Patch Changes
6 -
7 -- Updated dependencies
8 - - @composio/core@0.7.0-alpha.0
9 -
3 ## 0.6.5
4
5 ### Patch Changes
ts/packages/providers/claude-agent-sdk/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/claude-agent-sdk",
3 - "version": "0.7.0-alpha.0",
3 + "version": "0.6.5",
4 "description": "Composio provider for Claude Agent SDK",
5 "main": "src/index.ts",
6 "publishConfig": {
@@ -48,7 +48,7 @@
48 "zod": "^3.25.76"
49 },
50 "peerDependencies": {
51 - "@composio/core": "0.7.0-alpha.0",
51 + "@composio/core": "0.6.5",
52 "@anthropic-ai/claude-agent-sdk": ">=0.1.0"
53 },
54 "devDependencies": {
ts/packages/providers/cloudflare/CHANGELOG.md
-7
@@ -1,12 +1,5 @@
1 # @composio/cloudflare
2
3 -## 0.7.0-alpha.0
4 -
5 -### Patch Changes
6 -
7 -- Updated dependencies
8 - - @composio/core@0.7.0-alpha.0
9 -
3 ## 0.6.5
4
5 ### Patch Changes
ts/packages/providers/cloudflare/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/cloudflare",
3 - "version": "0.7.0-alpha.0",
3 + "version": "0.6.5",
4 "description": "",
5 "main": "src/index.ts",
6 "publishConfig": {
@@ -39,7 +39,7 @@
39 "packageManager": "pnpm@10.28.0",
40 "peerDependencies": {
41 "@cloudflare/workers-types": "catalog:",
42 - "@composio/core": "0.7.0-alpha.0"
42 + "@composio/core": "0.6.5"
43 },
44 "devDependencies": {
45 "@composio/core": "workspace:*",
ts/packages/providers/google/CHANGELOG.md
-7
@@ -1,12 +1,5 @@
1 # @composio/google
2
3 -## 0.7.0-alpha.0
4 -
5 -### Patch Changes
6 -
7 -- Updated dependencies
8 - - @composio/core@0.7.0-alpha.0
9 -
3 ## 0.6.5
4
5 ### Patch Changes
ts/packages/providers/google/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/google",
3 - "version": "0.7.0-alpha.0",
3 + "version": "0.6.5",
4 "description": "Google GenAI Provider for Composio SDK",
5 "main": "src/index.ts",
6 "publishConfig": {
@@ -44,7 +44,7 @@
44 "license": "ISC",
45 "packageManager": "pnpm@10.28.0",
46 "peerDependencies": {
47 - "@composio/core": "0.7.0-alpha.0",
47 + "@composio/core": "0.6.5",
48 "@google/genai": "^1.1.0"
49 },
50 "devDependencies": {
ts/packages/providers/langchain/CHANGELOG.md
-7
@@ -1,12 +1,5 @@
1 # @composio/langchain
2
3 -## 0.7.0-alpha.0
4 -
5 -### Patch Changes
6 -
7 -- Updated dependencies
8 - - @composio/core@0.7.0-alpha.0
9 -
3 ## 0.6.5
4
5 ### Patch Changes
ts/packages/providers/langchain/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/langchain",
3 - "version": "0.7.0-alpha.0",
3 + "version": "0.6.5",
4 "description": "",
5 "main": "dist/index.js",
6 "publishConfig": {
@@ -38,7 +38,7 @@
38 "license": "ISC",
39 "packageManager": "pnpm@10.28.0",
40 "peerDependencies": {
41 - "@composio/core": "0.7.0-alpha.0",
41 + "@composio/core": "0.6.5",
42 "@langchain/core": "^1.1.4"
43 },
44 "devDependencies": {
ts/packages/providers/llamaindex/CHANGELOG.md
-7
@@ -1,12 +1,5 @@
1 # @composio/llamaindex
2
3 -## 0.7.0-alpha.0
4 -
5 -### Patch Changes
6 -
7 -- Updated dependencies
8 - - @composio/core@0.7.0-alpha.0
9 -
3 ## 0.6.5
4
5 ### Patch Changes
ts/packages/providers/llamaindex/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/llamaindex",
3 - "version": "0.7.0-alpha.0",
3 + "version": "0.6.5",
4 "description": "Agentic Provider for llamaindex in Composio SDK",
5 "main": "src/index.ts",
6 "publishConfig": {
@@ -41,7 +41,7 @@
41 "license": "ISC",
42 "packageManager": "pnpm@10.28.0",
43 "peerDependencies": {
44 - "@composio/core": "0.7.0-alpha.0",
44 + "@composio/core": "0.6.5",
45 "llamaindex": "^0.12.0"
46 },
47 "devDependencies": {
ts/packages/providers/mastra/CHANGELOG.md
-7
@@ -1,12 +1,5 @@
1 # @composio/mastra
2
3 -## 0.7.0-alpha.0
4 -
5 -### Patch Changes
6 -
7 -- Updated dependencies
8 - - @composio/core@0.7.0-alpha.0
9 -
3 ## 0.6.5
4
5 ### Patch Changes
ts/packages/providers/mastra/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/mastra",
3 - "version": "0.7.0-alpha.0",
3 + "version": "0.6.5",
4 "description": "Agentic Provider for mastra in Composio SDK",
5 "main": "src/index.ts",
6 "publishConfig": {
@@ -43,7 +43,7 @@
43 "license": "ISC",
44 "packageManager": "pnpm@10.28.0",
45 "peerDependencies": {
46 - "@composio/core": "0.7.0-alpha.0",
46 + "@composio/core": "0.6.5",
47 "@mastra/core": "^1.0.4",
48 "zod": "^3.25 || ^4"
49 },
ts/packages/providers/openai-agents/CHANGELOG.md
-7
@@ -1,12 +1,5 @@
1 # @composio/openai-agents
2
3 -## 0.7.0-alpha.0
4 -
5 -### Patch Changes
6 -
7 -- Updated dependencies
8 - - @composio/core@0.7.0-alpha.0
9 -
3 ## 0.6.5
4
5 ### Patch Changes
ts/packages/providers/openai-agents/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/openai-agents",
3 - "version": "0.7.0-alpha.0",
3 + "version": "0.6.5",
4 "description": "",
5 "main": "src/index.ts",
6 "publishConfig": {
@@ -38,7 +38,7 @@
38 "license": "ISC",
39 "packageManager": "pnpm@10.28.0",
40 "peerDependencies": {
41 - "@composio/core": "0.7.0-alpha.0",
41 + "@composio/core": "0.6.5",
42 "@openai/agents": "^0.1.3",
43 "zod": "catalog:"
44 },
ts/packages/providers/openai/CHANGELOG.md
-7
@@ -1,12 +1,5 @@
1 # @composio/openai
2
3 -## 0.7.0-alpha.0
4 -
5 -### Patch Changes
6 -
7 -- Updated dependencies
8 - - @composio/core@0.7.0-alpha.0
9 -
3 ## 0.6.5
4
5 ### Patch Changes
ts/packages/providers/openai/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/openai",
3 - "version": "0.7.0-alpha.0",
3 + "version": "0.6.5",
4 "description": "",
5 "main": "src/index.ts",
6 "publishConfig": {
@@ -38,7 +38,7 @@
38 "license": "ISC",
39 "packageManager": "pnpm@10.28.0",
40 "peerDependencies": {
41 - "@composio/core": "0.7.0-alpha.0",
41 + "@composio/core": "0.6.5",
42 "openai": "catalog:"
43 },
44 "devDependencies": {
ts/packages/providers/vercel/CHANGELOG.md
-7
@@ -1,12 +1,5 @@
1 # @composio/vercel
2
3 -## 0.7.0-alpha.0
4 -
5 -### Patch Changes
6 -
7 -- Updated dependencies
8 - - @composio/core@0.7.0-alpha.0
9 -
3 ## 0.6.5
4
5 ### Patch Changes
ts/packages/providers/vercel/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/vercel",
3 - "version": "0.7.0-alpha.0",
3 + "version": "0.6.5",
4 "description": "",
5 "main": "src/index.ts",
6 "publishConfig": {
@@ -38,7 +38,7 @@
38 "license": "ISC",
39 "packageManager": "pnpm@10.28.0",
40 "peerDependencies": {
41 - "@composio/core": "0.7.0-alpha.0",
41 + "@composio/core": "0.6.5",
42 "ai": "^5.0.0 || ^6.0.0"
43 },
44 "devDependencies": {