Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
fix paths
Rahul Tarakea7913f558c4
diff --git a/fern/docs.yml b/fern/docs.ymlindex 870891b48..9c8ea94ef 100644--- a/fern/docs.yml+++ b/fern/docs.yml@@ -123,71 +123,71 @@ navigation:skip-slug: truecontents:- page: Welcome- path: pages/dist/welcome.mdx+ path: pages/dist/get-started/welcome.mdxslug: welcome- page: Quickstart- path: pages/dist/quickstart.mdx+ path: pages/dist/get-started/quickstart.mdxslug: quickstart- page: IDE and Agent Setup- path: pages/dist/dev-setup.mdx+ path: pages/dist/get-started/dev-setup.mdxslug: dev-setup- page: Providers- path: pages/dist/providers.mdx+ path: pages/dist/get-started/providers.mdxslug: providers- section: Toolsicon: toolsskip-slug: truecontents:- page: Executing Tools- path: pages/dist/executing-tools.mdx+ path: pages/dist/tool-calling/executing-tools.mdxslug: executing-tools- page: Authenticating Tools- path: pages/dist/authenticating-tools.mdx+ path: pages/dist/tool-calling/authenticating-tools.mdxslug: authenticating-tools- page: Fetch and Filter Tools- path: pages/dist/fetching-tools.mdx+ path: pages/dist/tool-calling/fetching-tools.mdxslug: fetching-tools- section: Modifiersslug: modifierscontents:- page: Schema Modifiers- path: pages/dist/schema-modifiers.mdx+ path: pages/dist/tool-calling/schema-modifiers.mdxslug: schema-modifiers- page: Before Tool Execution- path: pages/dist/before-execution-modifiers.mdx+ path: pages/dist/tool-calling/before-execution-modifiers.mdxslug: before-execution- page: After Tool Execution- path: pages/dist/after-execution-modifiers.mdx+ path: pages/dist/tool-calling/after-execution-modifiers.mdxslug: after-execution- page: Custom tools- path: pages/dist/custom-tools.mdx+ path: pages/dist/tool-calling/custom-tools.mdxslug: custom-tools- section: Authenticationicon: lockskip-slug: truecontents:- page: Custom Auth Configs- path: pages/dist/custom-auth-configs.mdx+ path: pages/dist/authentication/custom-auth-configs.mdxslug: custom-auth-configs- page: Programmatic Auth Configs- path: pages/dist/programmatic-auth-configs.mdx+ path: pages/dist/authentication/programmatic-auth-configs.mdxslug: programmatic-auth-configs- page: Custom Auth Parameters- path: pages/dist/custom-auth-params.mdx+ path: pages/dist/authentication/custom-auth-params.mdxslug: custom-auth-params- section: Triggersicon: boltskip-slug: truecontents:- page: Using Triggers- path: pages/dist/using-triggers.mdx+ path: pages/dist/triggers/using-triggers.mdxslug: using-triggers- section: MCPicon: serverskip-slug: truecontents:- page: Introduction- path: pages/dist/introduction.mdx+ path: pages/dist/mcp/introduction.mdxslug: mcp-introduction- section: Resourcesicon: book@@ -203,27 +203,27 @@ navigation:skip-slug: truecontents:- page: Hello World- path: pages/dist/hello-world.mdx+ path: pages/dist/examples/hello-world.mdxslug: examples/hello-world- page: Sample Script- path: pages/dist/sample-script.mdx+ path: pages/dist/examples/sample-script.mdxslug: examples/sample-script- page: Basic Hono Server- path: pages/dist/sample-webserver.mdx+ path: pages/dist/examples/sample-webserver/sample-webserver.mdxslug: examples/sample-webserver- section: Full Stack Applicationsicon: globeskip-slug: truecontents:- page: Full Stack Chat App- path: pages/dist/vercel-composio.mdx+ path: pages/dist/examples/vercel-composio.mdxslug: examples/chat-app- section: Productivity & Automationicon: zapskip-slug: truecontents:- page: Gmail Reaper- path: pages/dist/gmail-filterer.mdx+ path: pages/dist/examples/gmail-filterer.mdxslug: examples/gmail-reaper- tab: providerslayout:@@ -231,23 +231,23 @@ navigation:icon: codecontents:- page: OpenAI Provider- path: pages/dist/openai.mdx+ path: pages/dist/providers/openai.mdx- page: Anthropic Provider- path: pages/dist/anthropic.mdx+ path: pages/dist/providers/anthropic.mdx- page: LangChain Provider- path: pages/dist/langchain.mdx+ path: pages/dist/providers/langchain.mdx- page: CrewAI Provider- path: pages/dist/crewai.mdx+ path: pages/dist/providers/crewai.mdx- page: Vercel AI SDK Provider- path: pages/dist/vercel.mdx+ path: pages/dist/providers/vercel.mdx- page: Google ADK Provider- path: pages/dist/google-adk.mdx+ path: pages/dist/providers/google-adk.mdx- page: OpenAI Agents Provider- path: pages/dist/openai-agents.mdx+ path: pages/dist/providers/openai-agents.mdx- page: Mastra Provider- path: pages/dist/mastra.mdx+ path: pages/dist/providers/mastra.mdx- page: Custom Provider- path: pages/dist/custom.mdx+ path: pages/dist/providers/custom.mdx- tab: toolslayout:- section: Toolsdiff --git a/fern/package.json b/fern/package.jsonindex 2ec17e522..f285385c0 100644--- a/fern/package.json+++ b/fern/package.json@@ -44,6 +44,7 @@"hono": "^4.7.11","next": "^15.3.3","only-allow": "^1.2.1",+ "openai": "^4.94.0","react": "^18.3.1","tailwindcss": "^3.4.17","typedoc": "^0.28.5",diff --git a/fern/pages/src/authentication/custom-auth-configs.mdx b/fern/pages/src/authentication/custom-auth-configs.mdxindex bdb26f565..c5838e371 100644--- a/fern/pages/src/authentication/custom-auth-configs.mdx+++ b/fern/pages/src/authentication/custom-auth-configs.mdx@@ -20,7 +20,7 @@ You'll need to customize the auth config in cases where you want to add in a dif<Tab title="Example: PostHog">You may change the subdomain for the PostHog toolkit to match your own instance.<Frame background="subtle" title="PostHog Auth Config Settings">-<img src="../../assets/images/custom-auth-posthog.png" />+<img src="../../../assets/images/custom-auth-posthog.png" /></Frame></Tab><Tab title="Example: Hubspot">@@ -29,7 +29,7 @@ For Hubspot you may customize everything here. For each auth scheme there is a dIf you choose to use your own developer app for OAuth2 scheme, you will have to provide the client ID and client secret.<Frame background="subtle" title="Hubspot Auth Config Settings">-<img src="../../assets/images/custom-auth-hubspot.png" />+<img src="../../../assets/images/custom-auth-hubspot.png" /></Frame></Tab></Tabs>@@ -56,12 +56,12 @@ Examples for Google and GitHub:<Tabs><Tab title="Google"><Frame background="subtle" caption="Google OAuth Configuration">- <img src="../../assets/images/google-oauth-config.png" />+ <img src="../../../assets/images/google-oauth-config.png" /></Frame></Tab><Tab title="GitHub"><Frame background="subtle" caption="GitHub OAuth Configuration">- <img src="../../assets/images/github-oauth-config.png" />+ <img src="../../../assets/images/github-oauth-config.png" /></Frame></Tab></Tabs>@@ -84,7 +84,7 @@ Once you have the OAuth credentials, you can add them to the auth config in the4. Click **"Create Integration"** once done!<Frame background="subtle" title="Auth Config Settings">- <img src="../../assets/images/integration-step-3-0.png" />+ <img src="../../../assets/images/integration-step-3-0.png" /></Frame>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)By default the users will see an OAuth screen like the one below:<Frame background="subtle" caption="Composio's Domain in OAuth Consent Screen">- <img src="../../assets/images/oauth-branding.png" />+ <img src="../../../assets/images/oauth-branding.png" /></Frame>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):Specify the your custom redirect URI in the auth config settings!<Frame background="subtle" title="Auth Config Settings">-<img src="../../assets/images/custom-redirect-uri.png" />+<img src="../../../assets/images/custom-redirect-uri.png" /></Frame></Step></Steps>diff --git a/fern/snippets/typescript/sample-webserver/index.ts b/fern/pages/src/examples/sample-webserver/index.tssimilarity index 100%rename from fern/snippets/typescript/sample-webserver/index.tsrename to fern/pages/src/examples/sample-webserver/index.tsdiff --git a/fern/pages/src/examples/sample-webserver.mdx b/fern/pages/src/examples/sample-webserver/sample-webserver.mdxsimilarity index 91%rename from fern/pages/src/examples/sample-webserver.mdxrename to fern/pages/src/examples/sample-webserver/sample-webserver.mdxindex b0018b10d..ef481c8d2 100644--- a/fern/pages/src/examples/sample-webserver.mdx+++ b/fern/pages/src/examples/sample-webserver/sample-webserver.mdx@@ -35,7 +35,7 @@ In this tutorial, we will create an auth config, initiate a connection, and sendBasic scaffolding for the server.<SnippetCode- src="fern/snippets/typescript/sample-webserver/index.ts"+ src="./index.ts"startLine={1}endLine={10}title="Setup"@@ -53,7 +53,7 @@ For this example, we will create a basic GMAIL auth config.You are recommend to store these config ids, so that you can reuse them later.<SnippetCode- src="fern/snippets/typescript/sample-webserver/index.ts"+ src="./index.ts"startLine={12}endLine={16}title="Auth Configs"@@ -69,7 +69,7 @@ they will be redirected to the auth flow.Once they have authorized the connection, you can use the `id` to get and execute the tools as the user.<SnippetCode- src="fern/snippets/typescript/sample-webserver/index.ts"+ src="./index.ts"startLine={16}endLine={27}title="Initiating a connection"@@ -90,7 +90,7 @@ curl -X POST http://localhost:3000/create-connection \Now let's send that email.<SnippetCode- src="fern/snippets/typescript/sample-webserver/index.ts"+ src="./index.ts"startLine={29}endLine={59}title="Sending an email"@@ -109,7 +109,7 @@ curl -X POST http://localhost:3000/send-email \### Full Code-You can see the full code [here](https://github.com/ComposioHQ/composio/blob/next/fern/snippets/typescript/sample-webserver/index.ts).+You can see the full code [here](https://github.com/ComposioHQ/composio/blob/next/fern/pages/src/examples/sample-webserver/index.ts).### What just happened?diff --git a/fern/pages/src/examples/vercel-composio.mdx b/fern/pages/src/examples/vercel-composio.mdxindex e805a411d..fec4e96fd 100644--- a/fern/pages/src/examples/vercel-composio.mdx+++ b/fern/pages/src/examples/vercel-composio.mdx@@ -27,7 +27,7 @@ Learn how to create auth configs [here](/docs/authenticating-tools#creating-an-aOnce done, your auth configs will be available in the [Composio dashboard](https://app.composio.dev/integrations).<Frame>- <img src="../../assets/images/examples/auth-configs.png" alt="Auth configs" />+ <img src="../../../assets/images/examples/auth-configs.png" alt="Auth configs" /></Frame>### 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 fIn order to list the toolkits and their connection status, we create a Next.js API route to fetch the toolkits using Composio SDK.<Frame>- <img src="../../assets/images/examples/toolkits.png" />+ <img src="../../../assets/images/examples/toolkits.png" /></Frame>### 1. Listing connected accounts@@ -128,7 +128,7 @@ Users need to connect and disconnect their accounts from the chatbot to enable tWhen a user wants to connect their account, we create a connection request that redirects them to the OAuth provider:<Frame>- <img src="../../assets/images/examples/create-connection.png" />+ <img src="../../../assets/images/examples/create-connection.png" /></Frame>```typescript app/api/connections/initiate/route.ts@@ -155,7 +155,7 @@ export async function POST(request: Request) {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:<Frame>- <img src="../../assets/images/examples/connection-status.png" />+ <img src="../../../assets/images/examples/connection-status.png" /></Frame>```typescript app/api/connections/status/route.ts@@ -260,7 +260,7 @@ export async function POST(request: Request) {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.<Frame>- <img src="../../assets/images/examples/custom-tool-component.png" />+ <img src="../../../assets/images/examples/custom-tool-component.png" /></Frame>You can find the `ToolCall` component at `components/tool-call.tsx`. Here's how to integrate it into your message rendering:diff --git a/fern/pages/src/get-started/dev-setup.mdx b/fern/pages/src/get-started/dev-setup.mdxindex e4f03af74..a7093ce10 100644--- a/fern/pages/src/get-started/dev-setup.mdx+++ b/fern/pages/src/get-started/dev-setup.mdx@@ -15,7 +15,7 @@ This guide explains how to setup your IDE, and coding agents to help you ship faTo optimize your experience building with Composio, you can add instructions to Cursor's system settings.<Frame>- <img src="../../assets/images/cursor-settings.png" alt="Cursor settings" />+ <img src="../../../assets/images/cursor-settings.png" alt="Cursor settings" /></Frame>Add the following to your Cursor "Rules for AI":diff --git a/fern/pages/src/get-started/providers.mdx b/fern/pages/src/get-started/providers.mdxindex 162c144e4..d06918002 100644--- a/fern/pages/src/get-started/providers.mdx+++ b/fern/pages/src/get-started/providers.mdx@@ -9,7 +9,7 @@ Every LLM framework and provider essentially does the same thing - **tool callin<Frame><img- src="../../assets/images/providers-and-toolsets.png"+ src="../../../assets/images/providers-and-toolsets.png"alt="Providers and Toolsets"width="400px"height="auto"@@ -121,21 +121,21 @@ composio = Composio(provider=OpenAIAgentsProvider())<CardGroup cols={3}><Cardtitle="OpenAI Provider"- icon={<img src="../../assets/images/openai-logo.svg" width="24" height="24" />}+ icon={<img src="../../../assets/images/openai-logo.svg" width="24" height="24" />}href="/providers/openai">Integrate with OpenAI's tool calling and agents.</Card><Cardtitle="Anthropic Provider"- icon={<img src="../../assets/images/anthropic-logo.svg" width="24" height="24" />}+ icon={<img src="../../../assets/images/anthropic-logo.svg" width="24" height="24" />}href="/providers/anthropic">Use Anthropic's Claude models with Composio tools.</Card><Cardtitle="Gemini Provider"- icon={<img src="../../assets/images/google-logo.svg" width="24" height="24" />}+ icon={<img src="../../../assets/images/google-logo.svg" width="24" height="24" />}href="/providers/google-adk">Integrate with Google's Gemini models.@@ -146,7 +146,7 @@ composio = Composio(provider=OpenAIAgentsProvider())<CardGroup cols={3}><Cardtitle="LangGraph Provider"- icon={<img src="../../assets/images/langgraph-logo.svg"/>}+ icon={<img src="../../../assets/images/langgraph-logo.svg"/>}href="/providers/langgraph">Add tools to LangGraph agent flows.@@ -160,7 +160,7 @@ composio = Composio(provider=OpenAIAgentsProvider())</Card><Cardtitle="Vercel AI SDK Provider"- icon={<img src="../../assets/images/vercel-logo.svg" width="24" height="24" />}+ icon={<img src="../../../assets/images/vercel-logo.svg" width="24" height="24" />}href="/providers/vercel">Use Composio tools with Vercel's AI SDK.diff --git a/fern/pages/src/get-started/welcome.mdx b/fern/pages/src/get-started/welcome.mdxindex 153c41ba9..c0b6fba64 100644--- a/fern/pages/src/get-started/welcome.mdx+++ b/fern/pages/src/get-started/welcome.mdx@@ -7,7 +7,7 @@ hide-nav-links: false---<Frame>- <img src="../../assets/images/hero.png" alt="Composio introduction image" />+ <img src="../../../assets/images/hero.png" alt="Composio introduction image" /></Frame><Tip>Give your AI IDE access to Composio's documentation using our llms.txt files: ([shortdiff --git a/fern/pages/src/tool-calling/after-execution-modifiers.mdx b/fern/pages/src/tool-calling/after-execution-modifiers.mdxindex 2f5a71a42..575fe9c9a 100644--- a/fern/pages/src/tool-calling/after-execution-modifiers.mdx+++ b/fern/pages/src/tool-calling/after-execution-modifiers.mdx@@ -18,7 +18,7 @@ These modifiers are called after the tool is executed by the LLM. This allows yo- Convert the output to a different format before returning it to the agent.<Frame>- <img src="../../assets/images/after-execute.png" alt="After Execution Modifier" />+ <img src="../../../assets/images/after-execute.png" alt="After Execution Modifier" /></Frame><Note>diff --git a/fern/pages/src/tool-calling/authenticating-tools.mdx b/fern/pages/src/tool-calling/authenticating-tools.mdxindex eada51343..97a1ea551 100644--- a/fern/pages/src/tool-calling/authenticating-tools.mdx+++ b/fern/pages/src/tool-calling/authenticating-tools.mdx@@ -29,13 +29,13 @@ Once created, it's reusable across multiple users.<Step title="Select App">Navigate to the [Apps page](https://app.composio.dev/apps) and choose the app you want to integrate (for example, Google Sheets).<Frame background="subtle" title="Application Selection Screen">- <img src="../../assets/images/integration-step-1-0.png" />+ <img src="../../../assets/images/integration-step-1-0.png" /></Frame></Step><Step title="Initiate Setup">Click the **"Setup Integration"** button.<Frame background="subtle" title="Auth Config Setup Interface">- <img src="../../assets/images/integration-step-2-0.png" />+ <img src="../../../assets/images/integration-step-2-0.png" /></Frame></Step><Step title="Configure Auth Config Settings">@@ -48,7 +48,7 @@ Once created, it's reusable across multiple users.</Note><Frame background="subtle" title="Auth Config Settings">- <img src="../../assets/images/auth-config-creation.png" />+ <img src="../../../assets/images/auth-config-creation.png" /></Frame></Step><Step title="Create and Get ID">diff --git a/fern/pages/src/tool-calling/before-execution-modifiers.mdx b/fern/pages/src/tool-calling/before-execution-modifiers.mdxindex 7ad6bd9f2..65412064f 100644--- a/fern/pages/src/tool-calling/before-execution-modifiers.mdx+++ b/fern/pages/src/tool-calling/before-execution-modifiers.mdx@@ -18,7 +18,7 @@ These modifiers are called before the tool is executed by the LLM. This allows y- Overriding the arguments emitted by the LLM.<Frame>- <img src="../../assets/images/before-execute.png" alt="Before Execution Modifier" />+ <img src="../../../assets/images/before-execute.png" alt="Before Execution Modifier" /></Frame><Note>diff --git a/fern/pages/src/tool-calling/schema-modifiers.mdx b/fern/pages/src/tool-calling/schema-modifiers.mdxindex 69d631d54..bccabd306 100644--- a/fern/pages/src/tool-calling/schema-modifiers.mdx+++ b/fern/pages/src/tool-calling/schema-modifiers.mdx@@ -13,7 +13,7 @@ Schema modifiers are part of Composio SDK's powerful middleware capabilities thaSchema modifiers transform a tool's schema before the tool is seen by an agent.<Frame>- <img src="../../assets/images/schema-modifier.png" alt="Schema Modifier" />+ <img src="../../../assets/images/schema-modifier.png" alt="Schema Modifier" /></Frame>**Useful for:** - Adding arguments to the tool. For example, adding a `thought` argument to the toolto prompt the agent to explain the reasoning. - Hiding arguments from the tool. In cases where thediff --git a/fern/pages/src/triggers/using-triggers.mdx b/fern/pages/src/triggers/using-triggers.mdxindex 8e5c5f131..284f3dc5e 100644--- a/fern/pages/src/triggers/using-triggers.mdx+++ b/fern/pages/src/triggers/using-triggers.mdx@@ -11,7 +11,7 @@ Triggers act as a notification system for your AI applications, enabling your agWhen these events take place, triggers capture relevant information and deliver structured payloads directly to your system, facilitating timely and context-aware responses.<Frame caption="Triggers through Composio" background="subtle">- + </Frame><Tip title="Prerequisites">@@ -24,7 +24,7 @@ When these events take place, triggers capture relevant information and deliverHead to the any app that supports triggers, eg [Slack](https://app.composio.dev/app/slack) in the dashboard and enable the trigger of choice.<video- src="../../assets/videos/enabling-triggers.mp4"+ src="../../../assets/videos/enabling-triggers.mp4"width="854"height="480"autoplay@@ -36,7 +36,7 @@ Head to the any app that supports triggers, eg [Slack](https://app.composio.dev/The [triggers page](https://app.composio.dev/active_triggers?page=1) will show you all the triggers that are enabled for your account.<Frame caption="Triggers page" background="subtle">- <img src="../../assets/images/manage-triggers.png" alt="Manage triggers" />+ <img src="../../../assets/images/manage-triggers.png" alt="Manage triggers" /></Frame>You create triggers through the SDK as well.@@ -122,7 +122,7 @@ print(instance)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.<Frame caption="Webhook setup" background="subtle">- <img src="../../assets/images/setup-webhook.png" alt="Webhook setup" />+ <img src="../../../assets/images/setup-webhook.png" alt="Webhook setup" /></Frame><CodeGroup>@@ -203,7 +203,7 @@ The dashboard will show you the trigger configuration to fill in.<Frame caption="Trigger configuration" background="subtle"><img- src="../../assets/images/trigger-config.png"+ src="../../../assets/images/trigger-config.png"alt="Trigger configuration"width="400px"height="auto"@@ -281,5 +281,5 @@ If you encounter issues with triggers or webhook listeners, you can use the CompAccess the trigger logs [here](https://app.composio.dev/trigger_logs).<Frame caption="Trigger logs" background="subtle">- <img src="../../assets/images/trigger-debug.png" alt="Trigger logs" />+ <img src="../../../assets/images/trigger-debug.png" alt="Trigger logs" /></Frame>\ No newline at end of filediff --git a/fern/scripts/build-snippets.ts b/fern/scripts/build-snippets.tsindex 22b76d670..467928127 100644--- a/fern/scripts/build-snippets.ts+++ b/fern/scripts/build-snippets.ts@@ -57,9 +57,23 @@ function getLanguageFromPath(filePath: string): { syntax: string; displayName: sreturn languageMap[extension || ''] || { syntax: 'text', displayName: 'Text' };}-function readFileLines(filePath: string, startLine?: number, endLine?: number): string {+function readFileLines(+ filePath: string,+ contextDir: string,+ startLine?: number,+ endLine?: number+): string {try {- const fullPath = path.resolve(PROJECT_ROOT, filePath);+ let fullPath: string;++ // If the path starts with './' or '../', resolve it relative to the context directory+ if (filePath.startsWith('./') || filePath.startsWith('../')) {+ fullPath = path.resolve(contextDir, filePath);+ } else {+ // Otherwise, resolve it relative to the project root+ fullPath = path.resolve(PROJECT_ROOT, filePath);+ }+const content = fs.readFileSync(fullPath, 'utf8');const lines = content.split('\n');@@ -90,7 +104,7 @@ function generateHighlightString(return `{${relativeStart}-${relativeEnd}}`;}-function parseSnippetCodeTags(content: string): string {+function parseSnippetCodeTags(content: string, contextDir: string): string {const exampleCodeRegex = /<SnippetCode\s+([^>]*?)(?:\s*\/?>|>\s*<\/SnippetCode>)/g;return content.replace(exampleCodeRegex, (match, propsString) => {@@ -129,7 +143,7 @@ function parseSnippetCodeTags(content: string): string {}// Read the file content- const codeContent = readFileLines(props.src, props.startLine, props.endLine);+ const codeContent = readFileLines(props.src, contextDir, props.startLine, props.endLine);const langInfo = getLanguageFromPath(props.src);const syntax = props.language || langInfo.syntax;const displayName = langInfo.displayName;@@ -154,7 +168,8 @@ function parseSnippetCodeTags(content: string): string {function processFile(srcPath: string, distPath: string) {try {const content = fs.readFileSync(srcPath, 'utf8');- const processedContent = parseSnippetCodeTags(content);+ const contextDir = path.dirname(srcPath);+ const processedContent = parseSnippetCodeTags(content, contextDir);// Ensure the directory existsconst distDir = path.dirname(distPath);@@ -192,13 +207,8 @@ function processAllFiles() {// Calculate the relative path from the source directoryconst relativePath = path.relative(DOCS_SRC_DIR, srcPath);- // Check if this file is in the SDK directory- const isInSDK = relativePath.startsWith('sdk/') || relativePath.startsWith('sdk\\');-- // If in SDK, preserve directory structure; otherwise flatten- const distPath = isInSDK- ? path.join(PAGES_DIST_DIR, relativePath)- : path.join(PAGES_DIST_DIR, entry.name);+ // Always preserve directory structure+ const distPath = path.join(PAGES_DIST_DIR, relativePath);processFile(srcPath, distPath);}@@ -219,13 +229,8 @@ function startWatchMode() {const srcPath = path.join(DOCS_SRC_DIR, filename);- // Check if this file is in the SDK directory- const isInSDK = filename.startsWith('sdk/') || filename.startsWith('sdk\\');-- // If in SDK, preserve directory structure; otherwise flatten- const distPath = isInSDK- ? path.join(PAGES_DIST_DIR, filename)- : path.join(PAGES_DIST_DIR, path.basename(filename));+ // Always preserve directory structure+ const distPath = path.join(PAGES_DIST_DIR, filename);if (eventType === 'change' && fs.existsSync(srcPath)) {console.log(`🔄 File changed: ${filename}`);diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex aff3b9df9..6b74ffb06 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -89,7 +89,7 @@ importers:version: 1.9.7composio-core:specifier: ^0.5.39- version: 0.5.39(@ai-sdk/[email protected]([email protected]))(@cloudflare/[email protected])(@langchain/[email protected]([email protected]([email protected])([email protected])))(@langchain/[email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected]))([email protected]([email protected])([email protected]))([email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])([email protected]([email protected])([email protected]))([email protected]))([email protected]([email protected])([email protected]))+ version: 0.5.39(@ai-sdk/[email protected]([email protected]))(@cloudflare/[email protected])(@langchain/[email protected]([email protected]([email protected])([email protected])))(@langchain/[email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected]))([email protected]([email protected])([email protected]))([email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])([email protected]([email protected])([email protected]))([email protected]))([email protected]([email protected])([email protected]))hono:specifier: ^4.7.11version: 4.7.11@@ -99,6 +99,9 @@ importers:only-allow:specifier: ^1.2.1version: 1.2.1+ openai:+ specifier: ^4.94.0+ version: 4.104.0([email protected])([email protected])react:specifier: ^18.3.1version: 18.3.1@@ -7003,14 +7006,14 @@ snapshots:transitivePeerDependencies:- openaidependencies:'@cfworker/json-schema': 4.1.1ansi-styles: 5.2.0camelcase: 6.3.0decamelize: 1.2.0js-tiktoken: 1.0.20mustache: 4.2.0p-queue: 6.6.2p-retry: 4.6.2@@ -7074,9 +7077,9 @@ snapshots:- encoding- ws- '@langchain/[email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])':+ '@langchain/[email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])':dependencies:js-tiktoken: 1.0.20openai: 4.104.0([email protected])([email protected])zod: 3.25.32@@ -7084,9 +7087,9 @@ snapshots:- encoding- ws- '@langchain/[email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))':+ '@langchain/[email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))':dependencies:js-tiktoken: 1.0.20'@manypkg/[email protected]':@@ -8824,7 +8827,7 @@ snapshots:sirv: 3.0.1tinyglobby: 0.2.14tinyrainbow: 2.0.0- vitest: 3.2.3(@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected])+ vitest: 3.2.3(@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected])'@vitest/[email protected]':dependencies:@@ -9165,23 +9168,23 @@ snapshots:has-own-prop: 2.0.0repeat-string: 1.6.1- [email protected](@ai-sdk/[email protected]([email protected]))(@cloudflare/[email protected])(@langchain/[email protected]([email protected]([email protected])([email protected])))(@langchain/[email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected]))([email protected]([email protected])([email protected]))([email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])([email protected]([email protected])([email protected]))([email protected]))([email protected]([email protected])([email protected])):+ [email protected](@ai-sdk/[email protected]([email protected]))(@cloudflare/[email protected])(@langchain/[email protected]([email protected]([email protected])([email protected])))(@langchain/[email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected]))([email protected]([email protected])([email protected]))([email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])([email protected]([email protected])([email protected]))([email protected]))([email protected]([email protected])([email protected])):dependencies:'@ai-sdk/openai': 1.3.22([email protected])'@cloudflare/workers-types': 4.20250612.0'@composio/mcp': 1.0.3-0'@hey-api/client-axios': 0.2.12([email protected])- '@langchain/openai': 0.5.13(@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])+ '@langchain/openai': 0.5.13(@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])ai: 4.3.16([email protected])([email protected])axios: 1.10.0chalk: 4.1.2cli-progress: 3.12.0commander: 12.1.0inquirer: 10.2.2- langchain: 0.3.28(@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])([email protected]([email protected])([email protected]))([email protected])+ langchain: 0.3.28(@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])([email protected]([email protected])([email protected]))([email protected])open: 8.4.2- openai: 5.3.0([email protected])([email protected])+ openai: 4.104.0([email protected])([email protected])pusher-js: 8.4.0-rc2resolve-package-path: 4.0.3uuid: 10.0.0@@ -10086,15 +10089,15 @@ snapshots:- [email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])([email protected]([email protected])([email protected]))([email protected]):+ [email protected](@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])([email protected]([email protected])([email protected]))([email protected]):dependencies:- '@langchain/openai': 0.5.13(@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])- '@langchain/textsplitters': 0.1.0(@langchain/[email protected]([email protected]([email protected])([email protected])))+ '@langchain/openai': 0.5.13(@langchain/[email protected]([email protected]([email protected])([email protected])))([email protected])+ '@langchain/textsplitters': 0.1.0(@langchain/[email protected]([email protected]([email protected])([email protected])))js-tiktoken: 1.0.20js-yaml: 4.1.0jsonpointer: 5.0.1openapi-types: 12.1.3p-retry: 4.6.2uuid: 10.0.0@@ -10119,7 +10122,7 @@ snapshots:optionalDependencies:openai: 4.104.0([email protected])([email protected])dependencies:'@types/uuid': 10.0.0chalk: 4.1.2@@ -10129,7 +10132,7 @@ snapshots:semver: 7.7.2uuid: 10.0.0optionalDependencies:- openai: 5.3.0([email protected])([email protected])+ openai: 4.104.0([email protected])([email protected])dependencies: