25 Commits

Author SHA1 Message Date
Malay Vasa 0c944a524a fix(docs): stop reference cards repeating the title as the description
Reference pages fall back to the page title for their meta description.
Pass only a real description to the card, and have the route drop any
description that merely repeats the title.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 20:28:03 +05:30
Malay Vasa cb52048028 fix(docs): keep toolkit titles and the home card count stable across pages
- only catalog toolkit pages ("<Name> - Composio Toolkit") get the
  "<Name> Toolkit" card title; the toolkits index and MDX guides keep
  their own titles instead of "Toolkits Toolkit"
- the home card description is a shared constant used by the URL
  builder, so the /docs index page and the root layout produce the same
  image URL and the live app count is never dropped
- update the integration expectation from ?variant=home to the new
  section=home URL

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 20:12:05 +05:30
Malay Vasa 84c04f888b feat(docs): redesign social preview cards
Rebuild the /api/og route around a shared shell with a slot per section
(docs, toolkits, API reference, changelog, home) on the docs dark surface,
with a light variant behind theme=light.

- Geist Sans / Mono vendored as TTF (Satori cannot read the site's woff2)
- Composio wordmark and mark sliced from the existing logo SVGs
- toolkit cards link the Composio mark to the toolkit logo; logos only
  load from Composio hosts and use the CDN's dark variant
- reference cards show a REST API pill and version; changelog cards show
  the date once as an eyebrow
- home card counts apps from the live catalog label
- balanced title and description wrapping, faded pixel-grid background
- assets traced for the build via outputFileTracingIncludes

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 19:30:00 +05:30
Brendan O'Leary b972a93b22 fix(docs): improve homepage social preview 2026-09-10 12:05:26 -07:00
Brendan O'Leary 37a647d1c4 fix(docs): serve social preview images from the docs host 2026-09-10 11:21:17 -07:00
Soham Basu 42ce7609a2 feat(docs): launch unified support knowledge MVP 2026-08-21 15:03:54 -07:00
Rahul Tarak ea2e02071a docs: fast-search with mercury-2 (#3687)
## Summary
- Switch the docs Eve agent from the AI Gateway `openai/gpt-5.4-mini`
string to an Inception Labs Mercury 2 OpenAI-compatible chat model.
- Keep tool calling on the chat-completions path and pass Mercury's
`reasoning_effort=medium` through the AI SDK OpenAI adapter.
- Add `DOCS_AGENT_MODEL_FLOW` so the same agent can run either `mercury`
or the old AI Gateway flow for eval comparisons.
- Add docs-agent eve evals covering grounded docs answers, docs
retrieval, citations, and account-specific support refusal.
- Replace the docs-agent retriever with an in-process BM25-style lexical
ranker that returns bounded full content for the top results, so Mercury
gets rich context in one fast tool call instead of a serial
`search_docs` → `read_doc` round trip.
- Precompute BM25 term counts/document frequencies into the generated
`agent/lib/docs-index.ts` snapshot at build time, removing deployed
cold-start corpus construction while keeping retrieval in-process.
- Add opt-in search perf logging (`DOCS_AGENT_SEARCH_PERF_LOG=1`,
optional `DOCS_AGENT_SEARCH_LOG_QUERY=1`) with timings for tokenization,
corpus load/cache, ranking, hydration, total duration, corpus source,
and top URLs.
- Add `eval:agent` and `eval:agent:flows` scripts; `eval:agent:flows`
can run local model-flow comparisons or remote target comparisons via
`DOCS_AGENT_EVAL_TARGETS`.
- Add `INCEPTION_API_KEY` / optional Mercury and gateway model knobs to
`docs/.env.example`, and move `@ai-sdk/openai` to runtime dependencies
for the agent import.

## Notes
- This is intentionally an experiment to see how Mercury's diffusion
model behaves with Eve tool calling (`search_docs` and `read_doc`).
- Preview/runtime environments need `INCEPTION_API_KEY`;
`INCEPTION_MODEL` and `INCEPTION_BASE_URL` are optional overrides.
- The custom fetch prevents accidentally falling back to
`OPENAI_API_KEY` against Inception's endpoint.
- The docs search is lexical/in-memory, not vector search. The slow path
was mostly serial model/tool round trips and cold index construction,
not embedding lookup.
- The generated BM25 snapshot is process-local once loaded: warm for the
lifetime of the running Node/Vercel function instance, and reset on cold
starts, redeploys, or process restarts. The expensive term-count corpus
is now built at docs build time.
- Perf logs omit raw user queries by default; set
`DOCS_AGENT_SEARCH_LOG_QUERY=1` only when you explicitly want raw
query/term logging.
- Local A/B-style eval run:
  ```bash
DOCS_AGENT_EVAL_FLOWS=gateway,mercury bun run eval:agent:flows --
--strict
  ```
- Live target comparison:
  ```bash

DOCS_AGENT_EVAL_TARGETS=baseline=https://<prod>,mercury=https://<preview>
bun run eval:agent:flows -- --strict
  ```

## Tests
- `bunx eslint scripts/build-agent-index.ts agent/lib/docs.ts
agent/tools/search_docs.ts`
- `bun scripts/build-agent-index.ts` (wrote 133 pages + 1000 toolkits +
1139 BM25 rows)
- `DOCS_AGENT_SEARCH_PERF_LOG=1 EVE_FORCE_BUNDLE=1 bun -e "const
tool=(await import('./agent/tools/search_docs.ts?log=' +
Date.now())).default; await tool.execute({query:'create a session with
github tools'}); await tool.execute({query:'auth config connected
account'});"` (logs cold and warm timing JSON)
- `EVE_FORCE_BUNDLE=1 bun -e "const tool=(await
import('./agent/tools/search_docs.ts?bundle=' + Date.now())).default;
const started=performance.now(); const r=await
tool.execute({query:'create a session with github tools'});
console.log(r.retrieval, r.results[0].url, r.results[0].content.length,
Math.round(performance.now()-started)+'ms');"` (precomputed bundle path,
~12ms)
- `bun -e "const tool=(await import('./agent/tools/search_docs.ts?live='
+ Date.now())).default; const started=performance.now(); const r=await
tool.execute({query:'create a session with github tools'});
console.log(r.retrieval, r.results[0].url, r.results[0].content.length,
Math.round(performance.now()-started)+'ms');"` (live-content path,
~34ms)
- `EVE_FORCE_BUNDLE=1 bun -e "const tool=(await
import('./agent/tools/search_docs.ts')).default; await
tool.execute({query:'create a session with github tools'}); const
started=performance.now(); const r=await tool.execute({query:'auth
config connected account'}); console.log(r.results[0].url,
r.results[0].content.length,
Math.round(performance.now()-started)+'ms');"` (warm path ~2ms)
-
`PATH=/Users/cryogenicplanet/.vite-plus/js_runtime/node/24.15.0/bin:$PATH
./node_modules/.bin/eve info --json` (reports `status: ready`, `model:
inception/mercury-2`, `errors: 0`)
- `DOCS_AGENT_MODEL_FLOW=gateway
PATH=/Users/cryogenicplanet/.vite-plus/js_runtime/node/24.15.0/bin:$PATH
./node_modules/.bin/eve info --json` (reports `status: ready`, `model:
openai/gpt-5.4-mini`, `errors: 0`)
-
`PATH=/Users/cryogenicplanet/.vite-plus/js_runtime/node/24.15.0/bin:$PATH
./node_modules/.bin/eve eval --list`
-
`PATH=/Users/cryogenicplanet/.vite-plus/js_runtime/node/24.15.0/bin:$PATH
bun scripts/eval-agent-flows.ts --list`
- `bun test tests/static/` (16 passed)
- `bun run types:check` currently fails on existing docs type-generation
errors in `app/(home)/docs/changelog/[...slug]/page.tsx`,
`app/(home)/examples/[[...slug]]/page.tsx`,
`app/(home)/toolkits/[[...slug]]/page.tsx`,
`app/llms.mdx/[[...slug]]/route.ts`, `lib/search-index.ts`, and
`lib/source.ts`; no new eval or `docs/agent/agent.ts` errors were
reported.

## Not run
- Real live model evals, because this local environment does not have
`INCEPTION_API_KEY` or AI Gateway credentials.


## Latest update
- Added default eager docs retrieval in the Eve HTTP channel: the server
runs the same BM25 search on the user's message before the first model
step and injects the results as one-turn context.
- Kept `search_docs` and `read_doc` available so Mercury can still
search/read more when the eager context is weak, ambiguous, or missing.
- Added `DOCS_AGENT_EAGER_SEARCH=0` as an escape hatch and labeled perf
logs with `invocation: "eager_context" | "tool"`.
- Updated the loading copy from “Searching the docs…” to “Thinking with
the docs…” so UI latency is not attributed solely to the search call.

## Latest tests
- `bun run lint -- agent/channels/eve.ts agent/tools/search_docs.ts
agent/lib/docs-search.ts components/eve-chat.tsx
evals/docs-agent/grounded-answers.eval.ts`
-
`PATH=/Users/cryogenicplanet/.vite-plus/js_runtime/node/24.15.0/bin:$PATH
node_modules/eve/bin/eve.js info --json` (reports `status: ready`,
`errors: 0`)
- `DOCS_AGENT_SEARCH_PERF_LOG=1 EVE_FORCE_BUNDLE=1 bun -e "import {
searchDocs } from './agent/lib/docs-search'; const r = searchDocs('How
do I create a session in Composio? Keep it brief.', { invocation:
'eager_context' }); console.log(JSON.stringify({count:r.results.length,
top:r.results[0]?.url, content: !!r.results[0]?.content}, null, 2));"`
- `DOCS_AGENT_SEARCH_PERF_LOG=1 bun -e "import { searchDocs } from
'./agent/lib/docs-search'; searchDocs('How do I create a session in
Composio? Keep it brief.', { invocation: 'eager_context' });
searchDocs('How do I create a session in Composio? Keep it brief.', {
invocation: 'tool' });"`
- `bun run types:check` still fails only on the pre-existing docs
type-generation issues listed above.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 03:17:57 -07:00
Rahul Tarak 18c3b98de6 docs: reapply Algolia docs search (#3454)
## Summary
- Re-apply the Algolia docs search migration after the previous PR was
merged and reverted.
- Keep the existing Fumadocs search UI while using Algolia API when
search keys are configured, with `/api/search` fallback for local
development and tests.
- Add a first-party Algolia index builder/sync script that creates
section-sized docs records from MDX/OpenAPI/toolkit/changelog content,
configures index relevance settings, and replaces index objects without
relying on Algolia Crawler.
- Add Algolia Insights view/click events and a terminal search relevance
test script.
- Clean search breadcrumbs so results show labels like `Toolkit` and
`Cookbook` instead of duplicated `toolkits > Gmail` formatting.

## Tests
- `cd docs && bun run types:check`
- `cd docs && bun run sync:search --dry-run`
- `cd docs && bunx eslint components/custom-search-dialog.tsx
lib/search-index.ts scripts/sync-algolia-search.ts
scripts/test-algolia-search.ts`

## Notes
- Live Algolia sync requires `ALGOLIA_ADMIN_API_KEY`.
- Live search relevance tests require `ALGOLIA_SEARCH_API_KEY` or
`NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY`.
2026-05-19 02:27:40 -07:00
Rahul Tarak 5f400fc5f7 Revert "docs: migrate search to Algolia" (#3453)
Reverts ComposioHQ/composio#3452
2026-05-19 01:34:36 -07:00
Rahul Tarak 7bd3e0669c docs: migrate search to Algolia (#3452)
## Summary
- Switch docs search dialog to Algolia when public Algolia env vars are
configured, with local `/api/search` fallback for development/tests
- Add a shared docs search index builder plus `bun run sync:search` to
publish records to Algolia
- Add a GitHub Actions workflow to dry-run and sync the Algolia index on
`next` docs changes when secrets are configured
- Document required Algolia env vars and sync command

## Tests
- `cd docs && bun run types:check`
- `cd docs && bun run sync:search --dry-run`
- `cd docs && bun test tests/static/`
- `cd docs && bunx eslint components/custom-search-dialog.tsx
lib/search-index.ts scripts/sync-algolia-search.ts`
- `cd docs && bun run build`

## Notes
- `bun run lint` still fails on existing unrelated repo-wide lint errors
in files outside this change (for example `app/global-error.tsx`,
`components/ask-ai-button.tsx`, `components/version-selector.tsx`). The
changed search files pass targeted ESLint.
- Production search requires `NEXT_PUBLIC_ALGOLIA_APP_ID`,
`NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY`, and optionally
`NEXT_PUBLIC_ALGOLIA_INDEX_NAME` (default `composio_docs`). Index
syncing requires `ALGOLIA_APP_ID`/`ALGOLIA_ADMIN_API_KEY` secrets.
2026-05-19 01:33:26 -07:00
Sushmithamallesh af340f0969 docs: add OpenAPI API reference pages to search index
Switch search indexes from sync array to async function so OpenAPI-generated
API reference pages can be loaded via openapiSource(). Fix readonly type
error from `as const` on structuredData empty arrays.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 18:21:24 -08:00
Sushmithamallesh 6eb009a6c5 fix: use unique IDs for changelog search entries
Multiple changelog entries can share the same date. Append title to
the ID to avoid collisions in the search index.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 18:06:51 -08:00
Sushmithamallesh 68f7fc56ae fix: add reference docs and changelog to search index
- Reference MDX pages (SDK reference, errors, rate-limits) now searchable
- Changelog entries now searchable by title
- Note: OpenAPI-generated API reference pages require async loading and
  can't be indexed in the sync search route

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 17:56:28 -08:00
Sushmithamallesh 60f3b52cc3 fix: add dynamic toolkit pages to search index
Toolkit pages generated from toolkits.json were not searchable because
the search API only indexed Fumadocs MDX pages. Now loads toolkit data
via getAllToolkitsSync() and adds entries for each toolkit that doesn't
already have an MDX page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 17:51:18 -08:00
Sushmithamallesh b720461495 docs: Rename Examples → Cookbooks across entire docs site
Renames the "Examples" section to "Cookbooks" - directory structure,
routes, navigation, search, LLM endpoints, sitemap, and redirects.
Adds /examples/* → /cookbooks/* permanent redirects for backwards compat.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 02:23:09 -08:00
Sushmithamallesh 267200c0ef docs: show nested parameter schemas on toolkit detail pages
Toolkit tool pages now display nested object and array parameter schemas
using expandable TypeTables. When a user expands a tool, the full schema
is lazily fetched from the single-tool API endpoint (with version pinning)
to get complete nested property definitions that the list endpoint omits.

- Add `properties`, `requiredFields`, `items` to ParameterSchema type
- Fetch version-specific tools/triggers using toolkit version from changelog
- Add `/api/tools/[slug]` proxy route for client-side detail fetches
- Render nested object/array children as TypeTables inside parent descriptions
- Show `array<type>` instead of just `array` for typed arrays
- Increase tool/trigger fetch limit to 10,000

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 20:44:31 -08:00
Sushmithamallesh d371b8be07 feat(docs): Enhance feedback with page title, browser, viewport info
- Add page title to Slack message (from document.title)
- Add browser/OS detection from user agent
- Add viewport size for mobile vs desktop context
- Add referrer to track how users found the page
- Add timestamp in UTC
- Fix URL to docs.composio.dev
- Display all context in a compact footer section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 11:17:49 -08:00
Sushmithamallesh c5369010b3 docs: merge Tool Router section into main docs
- Move Tool Router content to main docs section:
  - Authentication pages → /docs/authenticating-users/
  - Guide pages → /docs/guides/
  - Toolkit pages → /docs/toolkits/
- Add MCP and native tool examples to provider pages:
  - openai-agents.mdx: Usage with Tools, Usage with MCP, Usage with direct tools
  - vercel.mdx: Usage with Tools, Usage with MCP, Usage with direct tools
  - anthropic.mdx: Usage with MCP, Usage with direct tools
- Remove Tool Router section entirely:
  - Delete content/tool-router/ folder
  - Delete app/(home)/tool-router/ routes
  - Remove from navigation, search, and LLM routes
- Remove "Usage with direct MCP servers" sections (deprecated approach)
- Update all internal links from /tool-router/* to /docs/*
- Add redirects for old Tool Router URLs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 22:08:40 -08:00
Sushmithamallesh 7b76a0be0a Fix SSRF vulnerability - restrict proxy to backend.composio.dev only 2026-01-22 13:46:21 -08:00
Sushmithamallesh c0ae64b1f0 Add API proxy to fix CORS issues in API reference playground 2026-01-22 12:46:26 -08:00
Sushmithamallesh 5f1fe0c31c feat(docs): add share feedback button with Slack integration
- Add Feedback modal component (Geist-style)
- Add API route that posts to Slack webhook
- Add SLACK_FEEDBACK_WEBHOOK_URL to .env.example

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 15:11:52 -08:00
Sushmithamallesh e615eb0a5a fix(docs): avoid lib/source import to fix top-level await issue 2026-01-16 13:31:35 -08:00
Sushmithamallesh de950afda4 fix(docs): exclude referenceSource from search to fix 500 error 2026-01-16 13:23:13 -08:00
Sushmithamallesh bda787e2b7 fix(docs): add error handling to search API for debugging
Wrap search handler initialization in try-catch to capture and log
actual errors in production serverless environment.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 13:16:19 -08:00
Sushmithamallesh a4ec83a83a chore: rename fumadocs directory to docs
- Rename fumadocs/ directory to docs/
- Update all path references in GitHub workflows
- Update CODEOWNERS
- Update SDK doc generation scripts output paths
- Rename workflow file fumadocs-check-links.yml to docs-check-links.yml
- Update package.json name to @composio/docs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 12:41:58 -08:00