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 23, 00:30 UTC
fix paths
Rahul Tarak committed
Jun 18, 2025 at 15:58 UTC
ea7913f558c4c014301881c3d02f5e259f0ca12d
16 files changed
+115
-106
fern/docs.yml
+30
-30
@@ -123,71 +123,71 @@ navigation:
123
skip-slug: true
124
contents:
125
- page: Welcome
126
- path: pages/dist/welcome.mdx
126
+ path: pages/dist/get-started/welcome.mdx
127
slug: welcome
128
- page: Quickstart
129
- path: pages/dist/quickstart.mdx
129
+ path: pages/dist/get-started/quickstart.mdx
130
slug: quickstart
131
- page: IDE and Agent Setup
132
- path: pages/dist/dev-setup.mdx
132
+ path: pages/dist/get-started/dev-setup.mdx
133
slug: dev-setup
134
- page: Providers
135
- path: pages/dist/providers.mdx
135
+ path: pages/dist/get-started/providers.mdx
136
slug: providers
137
- section: Tools
138
icon: tools
139
skip-slug: true
140
contents:
141
- page: Executing Tools
142
- path: pages/dist/executing-tools.mdx
142
+ path: pages/dist/tool-calling/executing-tools.mdx
143
slug: executing-tools
144
- page: Authenticating Tools
145
- path: pages/dist/authenticating-tools.mdx
145
+ path: pages/dist/tool-calling/authenticating-tools.mdx
146
slug: authenticating-tools
147
- page: Fetch and Filter Tools
148
- path: pages/dist/fetching-tools.mdx
148
+ path: pages/dist/tool-calling/fetching-tools.mdx
149
slug: fetching-tools
150
- section: Modifiers
151
slug: modifiers
152
contents:
153
- page: Schema Modifiers
154
- path: pages/dist/schema-modifiers.mdx
154
+ path: pages/dist/tool-calling/schema-modifiers.mdx
155
slug: schema-modifiers
156
- page: Before Tool Execution
157
- path: pages/dist/before-execution-modifiers.mdx
157
+ path: pages/dist/tool-calling/before-execution-modifiers.mdx
158
slug: before-execution
159
- page: After Tool Execution
160
- path: pages/dist/after-execution-modifiers.mdx
160
+ path: pages/dist/tool-calling/after-execution-modifiers.mdx
161
slug: after-execution
162
- page: Custom tools
163
- path: pages/dist/custom-tools.mdx
163
+ path: pages/dist/tool-calling/custom-tools.mdx
164
slug: custom-tools
165
- section: Authentication
166
icon: lock
167
skip-slug: true
168
contents:
169
- page: Custom Auth Configs
170
- path: pages/dist/custom-auth-configs.mdx
170
+ path: pages/dist/authentication/custom-auth-configs.mdx
171
slug: custom-auth-configs
172
- page: Programmatic Auth Configs
173
- path: pages/dist/programmatic-auth-configs.mdx
173
+ path: pages/dist/authentication/programmatic-auth-configs.mdx
174
slug: programmatic-auth-configs
175
- page: Custom Auth Parameters
176
- path: pages/dist/custom-auth-params.mdx
176
+ path: pages/dist/authentication/custom-auth-params.mdx
177
slug: custom-auth-params
178
- section: Triggers
179
icon: bolt
180
skip-slug: true
181
contents:
182
- page: Using Triggers
183
- path: pages/dist/using-triggers.mdx
183
+ path: pages/dist/triggers/using-triggers.mdx
184
slug: using-triggers
185
- section: MCP
186
icon: server
187
skip-slug: true
188
contents:
189
- page: Introduction
190
- path: pages/dist/introduction.mdx
190
+ path: pages/dist/mcp/introduction.mdx
191
slug: mcp-introduction
192
- section: Resources
193
icon: book
@@ -203,27 +203,27 @@ navigation:
203
skip-slug: true
204
contents:
205
- page: Hello World
206
- path: pages/dist/hello-world.mdx
206
+ path: pages/dist/examples/hello-world.mdx
207
slug: examples/hello-world
208
- page: Sample Script
209
- path: pages/dist/sample-script.mdx
209
+ path: pages/dist/examples/sample-script.mdx
210
slug: examples/sample-script
211
- page: Basic Hono Server
212
- path: pages/dist/sample-webserver.mdx
212
+ path: pages/dist/examples/sample-webserver/sample-webserver.mdx
213
slug: examples/sample-webserver
214
- section: Full Stack Applications
215
icon: globe
216
skip-slug: true
217
contents:
218
- page: Full Stack Chat App
219
- path: pages/dist/vercel-composio.mdx
219
+ path: pages/dist/examples/vercel-composio.mdx
220
slug: examples/chat-app
221
- section: Productivity & Automation
222
icon: zap
223
skip-slug: true
224
contents:
225
- page: Gmail Reaper
226
- path: pages/dist/gmail-filterer.mdx
226
+ path: pages/dist/examples/gmail-filterer.mdx
227
slug: examples/gmail-reaper
228
- tab: providers
229
layout:
@@ -231,23 +231,23 @@ navigation:
231
icon: code
232
contents:
233
- page: OpenAI Provider
234
- path: pages/dist/openai.mdx
234
+ path: pages/dist/providers/openai.mdx
235
- page: Anthropic Provider
236
- path: pages/dist/anthropic.mdx
236
+ path: pages/dist/providers/anthropic.mdx
237
- page: LangChain Provider
238
- path: pages/dist/langchain.mdx
238
+ path: pages/dist/providers/langchain.mdx
239
- page: CrewAI Provider
240
- path: pages/dist/crewai.mdx
240
+ path: pages/dist/providers/crewai.mdx
241
- page: Vercel AI SDK Provider
242
- path: pages/dist/vercel.mdx
242
+ path: pages/dist/providers/vercel.mdx
243
- page: Google ADK Provider
244
- path: pages/dist/google-adk.mdx
244
+ path: pages/dist/providers/google-adk.mdx
245
- page: OpenAI Agents Provider
246
- path: pages/dist/openai-agents.mdx
246
+ path: pages/dist/providers/openai-agents.mdx
247
- page: Mastra Provider
248
- path: pages/dist/mastra.mdx
248
+ path: pages/dist/providers/mastra.mdx
249
- page: Custom Provider
250
- path: pages/dist/custom.mdx
250
+ path: pages/dist/providers/custom.mdx
251
- tab: tools
252
layout:
253
- section: Tools
fern/package.json
+1
@@ -44,6 +44,7 @@
44
"hono": "^4.7.11",
45
"next": "^15.3.3",
46
"only-allow": "^1.2.1",
47
+ "openai": "^4.94.0",
48
"react": "^18.3.1",
49
"tailwindcss": "^3.4.17",
50
"typedoc": "^0.28.5",
fern/pages/src/authentication/custom-auth-configs.mdx
+7
-7
@@ -20,7 +20,7 @@ You'll need to customize the auth config in cases where you want to add in a dif
20
<Tab title="Example: PostHog">
21
You may change the subdomain for the PostHog toolkit to match your own instance.
22
<Frame background="subtle" title="PostHog Auth Config Settings">
23
-<img src="../../assets/images/custom-auth-posthog.png" />
23
+<img src="../../../assets/images/custom-auth-posthog.png" />
24
</Frame>
25
</Tab>
26
<Tab title="Example: Hubspot">
@@ -29,7 +29,7 @@ For Hubspot you may customize everything here. For each auth scheme there is a d
29
If you choose to use your own developer app for OAuth2 scheme, you will have to provide the client ID and client secret.
30
31
<Frame background="subtle" title="Hubspot Auth Config Settings">
32
-<img src="../../assets/images/custom-auth-hubspot.png" />
32
+<img src="../../../assets/images/custom-auth-hubspot.png" />
33
</Frame>
34
</Tab>
35
</Tabs>
@@ -56,12 +56,12 @@ Examples for Google and GitHub:
56
<Tabs>
57
<Tab title="Google">
58
<Frame background="subtle" caption="Google OAuth Configuration">
59
- <img src="../../assets/images/google-oauth-config.png" />
59
+ <img src="../../../assets/images/google-oauth-config.png" />
60
</Frame>
61
</Tab>
62
<Tab title="GitHub">
63
<Frame background="subtle" caption="GitHub OAuth Configuration">
64
- <img src="../../assets/images/github-oauth-config.png" />
64
+ <img src="../../../assets/images/github-oauth-config.png" />
65
</Frame>
66
</Tab>
67
</Tabs>
@@ -84,7 +84,7 @@ Once you have the OAuth credentials, you can add them to the auth config in the
84
4. Click **"Create Integration"** once done!
85
86
<Frame background="subtle" title="Auth Config Settings">
87
- <img src="../../assets/images/integration-step-3-0.png" />
87
+ <img src="../../../assets/images/integration-step-3-0.png" />
88
</Frame>
89
90
As usual, copy and use the auth config ID starting with `ac_` in your application code via a secret manager.
@@ -127,7 +127,7 @@ print(connected_account)
127
By default the users will see an OAuth screen like the one below:
128
129
<Frame background="subtle" caption="Composio's Domain in OAuth Consent Screen">
130
- <img src="../../assets/images/oauth-branding.png" />
130
+ <img src="../../../assets/images/oauth-branding.png" />
131
</Frame>
132
133
The OAuth redirect URL is surfaced in the some OAuth providers' consent screens. This may cause confusion for some users as that URL is not of the same domain as the application.
@@ -206,7 +206,7 @@ def authorize_app(toolkit: str):
206
Specify the your custom redirect URI in the auth config settings!
207
208
<Frame background="subtle" title="Auth Config Settings">
209
-<img src="../../assets/images/custom-redirect-uri.png" />
209
+<img src="../../../assets/images/custom-redirect-uri.png" />
210
</Frame>
211
</Step>
212
</Steps>
fern/pages/src/examples/sample-webserver/index.ts
renamed
fern/pages/src/examples/sample-webserver/sample-webserver.mdx
renamed
+5
-5
@@ -35,7 +35,7 @@ In this tutorial, we will create an auth config, initiate a connection, and send
35
Basic scaffolding for the server.
36
37
<SnippetCode
38
- src="fern/snippets/typescript/sample-webserver/index.ts"
38
+ src="./index.ts"
39
startLine={1}
40
endLine={10}
41
title="Setup"
@@ -53,7 +53,7 @@ For this example, we will create a basic GMAIL auth config.
53
You are recommend to store these config ids, so that you can reuse them later.
54
55
<SnippetCode
56
- src="fern/snippets/typescript/sample-webserver/index.ts"
56
+ src="./index.ts"
57
startLine={12}
58
endLine={16}
59
title="Auth Configs"
@@ -69,7 +69,7 @@ they will be redirected to the auth flow.
69
Once they have authorized the connection, you can use the `id` to get and execute the tools as the user.
70
71
<SnippetCode
72
- src="fern/snippets/typescript/sample-webserver/index.ts"
72
+ src="./index.ts"
73
startLine={16}
74
endLine={27}
75
title="Initiating a connection"
@@ -90,7 +90,7 @@ curl -X POST http://localhost:3000/create-connection \
90
Now let's send that email.
91
92
<SnippetCode
93
- src="fern/snippets/typescript/sample-webserver/index.ts"
93
+ src="./index.ts"
94
startLine={29}
95
endLine={59}
96
title="Sending an email"
@@ -109,7 +109,7 @@ curl -X POST http://localhost:3000/send-email \
109
110
### Full Code
111
112
-You can see the full code [here](https://github.com/ComposioHQ/composio/blob/next/fern/snippets/typescript/sample-webserver/index.ts).
112
+You can see the full code [here](https://github.com/ComposioHQ/composio/blob/next/fern/pages/src/examples/sample-webserver/index.ts).
113
114
115
### What just happened?
fern/pages/src/examples/vercel-composio.mdx
+5
-5
@@ -27,7 +27,7 @@ Learn how to create auth configs [here](/docs/authenticating-tools#creating-an-a
27
Once done, your auth configs will be available in the [Composio dashboard](https://app.composio.dev/integrations).
28
29
<Frame>
30
- <img src="../../assets/images/examples/auth-configs.png" alt="Auth configs" />
30
+ <img src="../../../assets/images/examples/auth-configs.png" alt="Auth configs" />
31
</Frame>
32
33
### Save auth config IDs to environment variables
@@ -62,7 +62,7 @@ The Composio SDK is meant to be used only in server-side code. For client-side f
62
In order to list the toolkits and their connection status, we create a Next.js API route to fetch the toolkits using Composio SDK.
63
64
<Frame>
65
- <img src="../../assets/images/examples/toolkits.png" />
65
+ <img src="../../../assets/images/examples/toolkits.png" />
66
</Frame>
67
68
### 1. Listing connected accounts
@@ -128,7 +128,7 @@ Users need to connect and disconnect their accounts from the chatbot to enable t
128
When a user wants to connect their account, we create a connection request that redirects them to the OAuth provider:
129
130
<Frame>
131
- <img src="../../assets/images/examples/create-connection.png" />
131
+ <img src="../../../assets/images/examples/create-connection.png" />
132
</Frame>
133
134
```typescript app/api/connections/initiate/route.ts
@@ -155,7 +155,7 @@ export async function POST(request: Request) {
155
After initiating a connection, we need to wait for the OAuth flow to complete. We check the connection status to know when it's ready to use:
156
157
<Frame>
158
- <img src="../../assets/images/examples/connection-status.png" />
158
+ <img src="../../../assets/images/examples/connection-status.png" />
159
</Frame>
160
161
```typescript app/api/connections/status/route.ts
@@ -260,7 +260,7 @@ export async function POST(request: Request) {
260
By default, tool calls appear as raw JSON in the chat interface. To create a better user experience, we can build custom components that display tool calls with proper formatting and loading states.
261
262
<Frame>
263
- <img src="../../assets/images/examples/custom-tool-component.png" />
263
+ <img src="../../../assets/images/examples/custom-tool-component.png" />
264
</Frame>
265
266
You can find the `ToolCall` component at `components/tool-call.tsx`. Here's how to integrate it into your message rendering:
fern/pages/src/get-started/dev-setup.mdx
+1
-1
@@ -15,7 +15,7 @@ This guide explains how to setup your IDE, and coding agents to help you ship fa
15
To optimize your experience building with Composio, you can add instructions to Cursor's system settings.
16
17
<Frame>
18
- <img src="../../assets/images/cursor-settings.png" alt="Cursor settings" />
18
+ <img src="../../../assets/images/cursor-settings.png" alt="Cursor settings" />
19
</Frame>
20
21
Add the following to your Cursor "Rules for AI":
fern/pages/src/get-started/providers.mdx
+6
-6
@@ -9,7 +9,7 @@ Every LLM framework and provider essentially does the same thing - **tool callin
9
10
<Frame>
11
<img
12
- src="../../assets/images/providers-and-toolsets.png"
12
+ src="../../../assets/images/providers-and-toolsets.png"
13
alt="Providers and Toolsets"
14
width="400px"
15
height="auto"
@@ -121,21 +121,21 @@ composio = Composio(provider=OpenAIAgentsProvider())
121
<CardGroup cols={3}>
122
<Card
123
title="OpenAI Provider"
124
- icon={<img src="../../assets/images/openai-logo.svg" width="24" height="24" />}
124
+ icon={<img src="../../../assets/images/openai-logo.svg" width="24" height="24" />}
125
href="/providers/openai"
126
>
127
Integrate with OpenAI's tool calling and agents.
128
</Card>
129
<Card
130
title="Anthropic Provider"
131
- icon={<img src="../../assets/images/anthropic-logo.svg" width="24" height="24" />}
131
+ icon={<img src="../../../assets/images/anthropic-logo.svg" width="24" height="24" />}
132
href="/providers/anthropic"
133
>
134
Use Anthropic's Claude models with Composio tools.
135
</Card>
136
<Card
137
title="Gemini Provider"
138
- icon={<img src="../../assets/images/google-logo.svg" width="24" height="24" />}
138
+ icon={<img src="../../../assets/images/google-logo.svg" width="24" height="24" />}
139
href="/providers/google-adk"
140
>
141
Integrate with Google's Gemini models.
@@ -146,7 +146,7 @@ composio = Composio(provider=OpenAIAgentsProvider())
146
<CardGroup cols={3}>
147
<Card
148
title="LangGraph Provider"
149
- icon={<img src="../../assets/images/langgraph-logo.svg"/>}
149
+ icon={<img src="../../../assets/images/langgraph-logo.svg"/>}
150
href="/providers/langgraph"
151
>
152
Add tools to LangGraph agent flows.
@@ -160,7 +160,7 @@ composio = Composio(provider=OpenAIAgentsProvider())
160
</Card>
161
<Card
162
title="Vercel AI SDK Provider"
163
- icon={<img src="../../assets/images/vercel-logo.svg" width="24" height="24" />}
163
+ icon={<img src="../../../assets/images/vercel-logo.svg" width="24" height="24" />}
164
href="/providers/vercel"
165
>
166
Use Composio tools with Vercel's AI SDK.
fern/pages/src/get-started/welcome.mdx
+1
-1
@@ -7,7 +7,7 @@ hide-nav-links: false
7
---
8
9
<Frame>
10
- <img src="../../assets/images/hero.png" alt="Composio introduction image" />
10
+ <img src="../../../assets/images/hero.png" alt="Composio introduction image" />
11
</Frame>
12
<Tip>
13
Give your AI IDE access to Composio's documentation using our llms.txt files: ([short
fern/pages/src/tool-calling/after-execution-modifiers.mdx
+1
-1
@@ -18,7 +18,7 @@ These modifiers are called after the tool is executed by the LLM. This allows yo
18
- Convert the output to a different format before returning it to the agent.
19
20
<Frame>
21
- <img src="../../assets/images/after-execute.png" alt="After Execution Modifier" />
21
+ <img src="../../../assets/images/after-execute.png" alt="After Execution Modifier" />
22
</Frame>
23
24
<Note>
fern/pages/src/tool-calling/authenticating-tools.mdx
+3
-3
@@ -29,13 +29,13 @@ Once created, it's reusable across multiple users.
29
<Step title="Select App">
30
Navigate to the [Apps page](https://app.composio.dev/apps) and choose the app you want to integrate (for example, Google Sheets).
31
<Frame background="subtle" title="Application Selection Screen">
32
- <img src="../../assets/images/integration-step-1-0.png" />
32
+ <img src="../../../assets/images/integration-step-1-0.png" />
33
</Frame>
34
</Step>
35
<Step title="Initiate Setup">
36
Click the **"Setup Integration"** button.
37
<Frame background="subtle" title="Auth Config Setup Interface">
38
- <img src="../../assets/images/integration-step-2-0.png" />
38
+ <img src="../../../assets/images/integration-step-2-0.png" />
39
</Frame>
40
</Step>
41
<Step title="Configure Auth Config Settings">
@@ -48,7 +48,7 @@ Once created, it's reusable across multiple users.
48
</Note>
49
50
<Frame background="subtle" title="Auth Config Settings">
51
- <img src="../../assets/images/auth-config-creation.png" />
51
+ <img src="../../../assets/images/auth-config-creation.png" />
52
</Frame>
53
</Step>
54
<Step title="Create and Get ID">
fern/pages/src/tool-calling/before-execution-modifiers.mdx
+1
-1
@@ -18,7 +18,7 @@ These modifiers are called before the tool is executed by the LLM. This allows y
18
- Overriding the arguments emitted by the LLM.
19
20
<Frame>
21
- <img src="../../assets/images/before-execute.png" alt="Before Execution Modifier" />
21
+ <img src="../../../assets/images/before-execute.png" alt="Before Execution Modifier" />
22
</Frame>
23
24
<Note>
fern/pages/src/tool-calling/schema-modifiers.mdx
+1
-1
@@ -13,7 +13,7 @@ Schema modifiers are part of Composio SDK's powerful middleware capabilities tha
13
Schema modifiers transform a tool's schema before the tool is seen by an agent.
14
15
<Frame>
16
- <img src="../../assets/images/schema-modifier.png" alt="Schema Modifier" />
16
+ <img src="../../../assets/images/schema-modifier.png" alt="Schema Modifier" />
17
</Frame>
18
**Useful for:** - Adding arguments to the tool. For example, adding a `thought` argument to the tool
19
to prompt the agent to explain the reasoning. - Hiding arguments from the tool. In cases where the
fern/pages/src/triggers/using-triggers.mdx
+6
-6
@@ -11,7 +11,7 @@ Triggers act as a notification system for your AI applications, enabling your ag
11
When these events take place, triggers capture relevant information and deliver structured payloads directly to your system, facilitating timely and context-aware responses.
12
13
<Frame caption="Triggers through Composio" background="subtle">
14
- 
14
+ 
15
</Frame>
16
17
<Tip title="Prerequisites">
@@ -24,7 +24,7 @@ When these events take place, triggers capture relevant information and deliver
24
Head to the any app that supports triggers, eg [Slack](https://app.composio.dev/app/slack) in the dashboard and enable the trigger of choice.
25
26
<video
27
- src="../../assets/videos/enabling-triggers.mp4"
27
+ src="../../../assets/videos/enabling-triggers.mp4"
28
width="854"
29
height="480"
30
autoplay
@@ -36,7 +36,7 @@ Head to the any app that supports triggers, eg [Slack](https://app.composio.dev/
36
The [triggers page](https://app.composio.dev/active_triggers?page=1) will show you all the triggers that are enabled for your account.
37
38
<Frame caption="Triggers page" background="subtle">
39
- <img src="../../assets/images/manage-triggers.png" alt="Manage triggers" />
39
+ <img src="../../../assets/images/manage-triggers.png" alt="Manage triggers" />
40
</Frame>
41
42
You create triggers through the SDK as well.
@@ -122,7 +122,7 @@ print(instance)
122
To receive trigger events via webhooks, you need to configure a publicly accessible URL where Composio can send the event payloads. This URL should point to an endpoint in your application that can process incoming webhook requests.
123
124
<Frame caption="Webhook setup" background="subtle">
125
- <img src="../../assets/images/setup-webhook.png" alt="Webhook setup" />
125
+ <img src="../../../assets/images/setup-webhook.png" alt="Webhook setup" />
126
</Frame>
127
128
<CodeGroup>
@@ -203,7 +203,7 @@ The dashboard will show you the trigger configuration to fill in.
203
204
<Frame caption="Trigger configuration" background="subtle">
205
<img
206
- src="../../assets/images/trigger-config.png"
206
+ src="../../../assets/images/trigger-config.png"
207
alt="Trigger configuration"
208
width="400px"
209
height="auto"
@@ -281,5 +281,5 @@ If you encounter issues with triggers or webhook listeners, you can use the Comp
281
Access the trigger logs [here](https://app.composio.dev/trigger_logs).
282
283
<Frame caption="Trigger logs" background="subtle">
284
- <img src="../../assets/images/trigger-debug.png" alt="Trigger logs" />
284
+ <img src="../../../assets/images/trigger-debug.png" alt="Trigger logs" />
285
</Frame>
\ No newline at end of file
fern/scripts/build-snippets.ts
+24
-19
@@ -57,9 +57,23 @@ function getLanguageFromPath(filePath: string): { syntax: string; displayName: s
57
return languageMap[extension || ''] || { syntax: 'text', displayName: 'Text' };
58
}
59
60
-function readFileLines(filePath: string, startLine?: number, endLine?: number): string {
60
+function readFileLines(
61
+ filePath: string,
62
+ contextDir: string,
63
+ startLine?: number,
64
+ endLine?: number
65
+): string {
66
try {
62
- const fullPath = path.resolve(PROJECT_ROOT, filePath);
67
+ let fullPath: string;
68
+
69
+ // If the path starts with './' or '../', resolve it relative to the context directory
70
+ if (filePath.startsWith('./') || filePath.startsWith('../')) {
71
+ fullPath = path.resolve(contextDir, filePath);
72
+ } else {
73
+ // Otherwise, resolve it relative to the project root
74
+ fullPath = path.resolve(PROJECT_ROOT, filePath);
75
+ }
76
+
77
const content = fs.readFileSync(fullPath, 'utf8');
78
const lines = content.split('\n');
79
@@ -90,7 +104,7 @@ function generateHighlightString(
104
return `{${relativeStart}-${relativeEnd}}`;
105
}
106
93
-function parseSnippetCodeTags(content: string): string {
107
+function parseSnippetCodeTags(content: string, contextDir: string): string {
108
const exampleCodeRegex = /<SnippetCode\s+([^>]*?)(?:\s*\/?>|>\s*<\/SnippetCode>)/g;
109
110
return content.replace(exampleCodeRegex, (match, propsString) => {
@@ -129,7 +143,7 @@ function parseSnippetCodeTags(content: string): string {
143
}
144
145
// Read the file content
132
- const codeContent = readFileLines(props.src, props.startLine, props.endLine);
146
+ const codeContent = readFileLines(props.src, contextDir, props.startLine, props.endLine);
147
const langInfo = getLanguageFromPath(props.src);
148
const syntax = props.language || langInfo.syntax;
149
const displayName = langInfo.displayName;
@@ -154,7 +168,8 @@ function parseSnippetCodeTags(content: string): string {
168
function processFile(srcPath: string, distPath: string) {
169
try {
170
const content = fs.readFileSync(srcPath, 'utf8');
157
- const processedContent = parseSnippetCodeTags(content);
171
+ const contextDir = path.dirname(srcPath);
172
+ const processedContent = parseSnippetCodeTags(content, contextDir);
173
174
// Ensure the directory exists
175
const distDir = path.dirname(distPath);
@@ -192,13 +207,8 @@ function processAllFiles() {
207
// Calculate the relative path from the source directory
208
const relativePath = path.relative(DOCS_SRC_DIR, srcPath);
209
195
- // Check if this file is in the SDK directory
196
- const isInSDK = relativePath.startsWith('sdk/') || relativePath.startsWith('sdk\\');
197
-
198
- // If in SDK, preserve directory structure; otherwise flatten
199
- const distPath = isInSDK
200
- ? path.join(PAGES_DIST_DIR, relativePath)
201
- : path.join(PAGES_DIST_DIR, entry.name);
210
+ // Always preserve directory structure
211
+ const distPath = path.join(PAGES_DIST_DIR, relativePath);
212
213
processFile(srcPath, distPath);
214
}
@@ -219,13 +229,8 @@ function startWatchMode() {
229
230
const srcPath = path.join(DOCS_SRC_DIR, filename);
231
222
- // Check if this file is in the SDK directory
223
- const isInSDK = filename.startsWith('sdk/') || filename.startsWith('sdk\\');
224
-
225
- // If in SDK, preserve directory structure; otherwise flatten
226
- const distPath = isInSDK
227
- ? path.join(PAGES_DIST_DIR, filename)
228
- : path.join(PAGES_DIST_DIR, path.basename(filename));
232
+ // Always preserve directory structure
233
+ const distPath = path.join(PAGES_DIST_DIR, filename);
234
235
if (eventType === 'change' && fs.existsSync(srcPath)) {
236
console.log(`🔄 File changed: ${filename}`);
pnpm-lock.yaml
+23
-20
@@ -89,7 +89,7 @@ importers:
89
version: 1.9.7
90
composio-core:
91
specifier: ^0.5.39
92
- version: 0.5.39(@ai-sdk/openai@1.3.22(zod@3.25.62))(@cloudflare/workers-types@4.20250612.0)(@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62)))(@langchain/openai@0.5.13(@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62)))(ws@8.18.2))(ai@4.3.16(react@18.3.1)(zod@3.25.62))(langchain@0.3.28(@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62)))(axios@1.10.0)(openai@5.3.0(ws@8.18.2)(zod@3.25.62))(ws@8.18.2))(openai@5.3.0(ws@8.18.2)(zod@3.25.62))
92
+ version: 0.5.39(@ai-sdk/openai@1.3.22(zod@3.25.62))(@cloudflare/workers-types@4.20250612.0)(@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62)))(@langchain/openai@0.5.13(@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62)))(ws@8.18.2))(ai@4.3.16(react@18.3.1)(zod@3.25.62))(langchain@0.3.28(@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62)))(axios@1.10.0)(openai@4.104.0(ws@8.18.2)(zod@3.25.62))(ws@8.18.2))(openai@4.104.0(ws@8.18.2)(zod@3.25.62))
93
hono:
94
specifier: ^4.7.11
95
version: 4.7.11
@@ -99,6 +99,9 @@ importers:
99
only-allow:
100
specifier: ^1.2.1
101
version: 1.2.1
102
+ openai:
103
+ specifier: ^4.94.0
104
+ version: 4.104.0(ws@8.18.2)(zod@3.25.62)
105
react:
106
specifier: ^18.3.1
107
version: 18.3.1
@@ -7003,14 +7006,14 @@ snapshots:
7006
transitivePeerDependencies:
7007
- openai
7008
7006
- '@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62))':
7009
+ '@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62))':
7010
dependencies:
7011
'@cfworker/json-schema': 4.1.1
7012
ansi-styles: 5.2.0
7013
camelcase: 6.3.0
7014
decamelize: 1.2.0
7015
js-tiktoken: 1.0.20
7013
- langsmith: 0.3.31(openai@5.3.0(ws@8.18.2)(zod@3.25.62))
7016
+ langsmith: 0.3.31(openai@4.104.0(ws@8.18.2)(zod@3.25.62))
7017
mustache: 4.2.0
7018
p-queue: 6.6.2
7019
p-retry: 4.6.2
@@ -7074,9 +7077,9 @@ snapshots:
7077
- encoding
7078
- ws
7079
7077
- '@langchain/openai@0.5.13(@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62)))(ws@8.18.2)':
7080
+ '@langchain/openai@0.5.13(@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62)))(ws@8.18.2)':
7081
dependencies:
7079
- '@langchain/core': 0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62))
7082
+ '@langchain/core': 0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62))
7083
js-tiktoken: 1.0.20
7084
openai: 4.104.0(ws@8.18.2)(zod@3.25.32)
7085
zod: 3.25.32
@@ -7084,9 +7087,9 @@ snapshots:
7087
- encoding
7088
- ws
7089
7087
- '@langchain/textsplitters@0.1.0(@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62)))':
7090
+ '@langchain/textsplitters@0.1.0(@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62)))':
7091
dependencies:
7089
- '@langchain/core': 0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62))
7092
+ '@langchain/core': 0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62))
7093
js-tiktoken: 1.0.20
7094
7095
'@manypkg/find-root@1.1.0':
@@ -8824,7 +8827,7 @@ snapshots:
8827
sirv: 3.0.1
8828
tinyglobby: 0.2.14
8829
tinyrainbow: 2.0.0
8827
- vitest: 3.2.3(@types/node@22.15.31)(@vitest/ui@3.2.3)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0)
8830
+ vitest: 3.2.3(@types/node@20.19.1)(@vitest/ui@3.2.3)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
8831
8832
'@vitest/utils@3.2.3':
8833
dependencies:
@@ -9165,23 +9168,23 @@ snapshots:
9168
has-own-prop: 2.0.0
9169
repeat-string: 1.6.1
9170
9168
- composio-core@0.5.39(@ai-sdk/openai@1.3.22(zod@3.25.62))(@cloudflare/workers-types@4.20250612.0)(@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62)))(@langchain/openai@0.5.13(@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62)))(ws@8.18.2))(ai@4.3.16(react@18.3.1)(zod@3.25.62))(langchain@0.3.28(@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62)))(axios@1.10.0)(openai@5.3.0(ws@8.18.2)(zod@3.25.62))(ws@8.18.2))(openai@5.3.0(ws@8.18.2)(zod@3.25.62)):
9171
+ composio-core@0.5.39(@ai-sdk/openai@1.3.22(zod@3.25.62))(@cloudflare/workers-types@4.20250612.0)(@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62)))(@langchain/openai@0.5.13(@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62)))(ws@8.18.2))(ai@4.3.16(react@18.3.1)(zod@3.25.62))(langchain@0.3.28(@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62)))(axios@1.10.0)(openai@4.104.0(ws@8.18.2)(zod@3.25.62))(ws@8.18.2))(openai@4.104.0(ws@8.18.2)(zod@3.25.62)):
9172
dependencies:
9173
'@ai-sdk/openai': 1.3.22(zod@3.25.62)
9174
'@cloudflare/workers-types': 4.20250612.0
9175
'@composio/mcp': 1.0.3-0
9176
'@hey-api/client-axios': 0.2.12(axios@1.10.0)
9174
- '@langchain/core': 0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62))
9175
- '@langchain/openai': 0.5.13(@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62)))(ws@8.18.2)
9177
+ '@langchain/core': 0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62))
9178
+ '@langchain/openai': 0.5.13(@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62)))(ws@8.18.2)
9179
ai: 4.3.16(react@18.3.1)(zod@3.25.62)
9180
axios: 1.10.0
9181
chalk: 4.1.2
9182
cli-progress: 3.12.0
9183
commander: 12.1.0
9184
inquirer: 10.2.2
9182
- langchain: 0.3.28(@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62)))(axios@1.10.0)(openai@5.3.0(ws@8.18.2)(zod@3.25.62))(ws@8.18.2)
9185
+ langchain: 0.3.28(@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62)))(axios@1.10.0)(openai@4.104.0(ws@8.18.2)(zod@3.25.62))(ws@8.18.2)
9186
open: 8.4.2
9184
- openai: 5.3.0(ws@8.18.2)(zod@3.25.62)
9187
+ openai: 4.104.0(ws@8.18.2)(zod@3.25.62)
9188
pusher-js: 8.4.0-rc2
9189
resolve-package-path: 4.0.3
9190
uuid: 10.0.0
@@ -10086,15 +10089,15 @@ snapshots:
10089
10090
kind-of@6.0.3: {}
10091
10089
- langchain@0.3.28(@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62)))(axios@1.10.0)(openai@5.3.0(ws@8.18.2)(zod@3.25.62))(ws@8.18.2):
10092
+ langchain@0.3.28(@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62)))(axios@1.10.0)(openai@4.104.0(ws@8.18.2)(zod@3.25.62))(ws@8.18.2):
10093
dependencies:
10091
- '@langchain/core': 0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62))
10092
- '@langchain/openai': 0.5.13(@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62)))(ws@8.18.2)
10093
- '@langchain/textsplitters': 0.1.0(@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62)))
10094
+ '@langchain/core': 0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62))
10095
+ '@langchain/openai': 0.5.13(@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62)))(ws@8.18.2)
10096
+ '@langchain/textsplitters': 0.1.0(@langchain/core@0.3.58(openai@4.104.0(ws@8.18.2)(zod@3.25.62)))
10097
js-tiktoken: 1.0.20
10098
js-yaml: 4.1.0
10099
jsonpointer: 5.0.1
10097
- langsmith: 0.3.31(openai@5.3.0(ws@8.18.2)(zod@3.25.62))
10100
+ langsmith: 0.3.31(openai@4.104.0(ws@8.18.2)(zod@3.25.62))
10101
openapi-types: 12.1.3
10102
p-retry: 4.6.2
10103
uuid: 10.0.0
@@ -10119,7 +10122,7 @@ snapshots:
10122
optionalDependencies:
10123
openai: 4.104.0(ws@8.18.2)(zod@3.25.32)
10124
10122
- langsmith@0.3.31(openai@5.3.0(ws@8.18.2)(zod@3.25.62)):
10125
+ langsmith@0.3.31(openai@4.104.0(ws@8.18.2)(zod@3.25.62)):
10126
dependencies:
10127
'@types/uuid': 10.0.0
10128
chalk: 4.1.2
@@ -10129,7 +10132,7 @@ snapshots:
10132
semver: 7.7.2
10133
uuid: 10.0.0
10134
optionalDependencies:
10132
- openai: 5.3.0(ws@8.18.2)(zod@3.25.62)
10135
+ openai: 4.104.0(ws@8.18.2)(zod@3.25.62)
10136
10137
langsmith@0.3.31(openai@5.3.0(zod@3.25.62)):
10138
dependencies: