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 21, 09:45 UTC
fix(core): restore source type names in the TS SDK reference (#4848)
This PR: - fixes the cut-off `executeMeta()` signature flagged in https://github.com/ComposioHQ/composio/pull/4844#discussion_r4259885596 - pins TypeDoc's `--displayBasePath` to the package directory, so `sources[].fileName` no longer depends on which files TypeDoc happens to visit - resolves source paths against that directory in `getSourceFileText()` and lets a failed read throw instead of returning `undefined` - cuts over-long unions between members in `simplifyTypeForSignature()` and `simplifyTypeForTable()`, so a truncated type never ends inside a string literal - adds regression tests for the TypeDoc argument, the source lookup, and union truncation ## Context The generator has preferred the type names written in source since f6b550573. TypeDoc reports source paths relative to the common directory of every file it visited; once that moved from `src/` to the repo root, the lookup read `src/ts/packages/core/src/...`, the `catch` hid the error, and every signature fell back to TypeDoc's expanded types. The reference silently flipped in #4575 (`mcpConfig: MCPConfigCreationParams` became an inline object shape), and long unions such as `ToolRouterSessionMetaToolSlug` were then cut at 97 characters. The regenerated pages are not included here. Merging this triggers `generate-sdk-docs.yml`, which updates #4844. Expect that diff to touch 20 files: signatures go back to named types such as `Promise<MCPItem>` and `Promise<ToolRouterSessionExecuteResponse>`. ## Checks - `pnpm exec vitest run test/scripts/generate-docs.test.ts` in `ts/packages/core`: 20 passed - `pnpm run generate:docs` locally: `executeMeta()` renders `slug: ToolRouterSessionMetaToolSlug` and `Promise<ToolRouterSessionExecuteResponse>`