- Add per-request cancellation to public SDK methods via ComposioRequestOptions with an optional AbortSignal parameter
- Introduce ComposioRequestCancelledError for detecting caller-initiated request aborts
- Expose AbortSignal via SessionContext.signal for custom tool cooperative cancellation
- Add pre-execute signal check to throw ComposioRequestCancelledError if the signal is already aborted before user code runs
- Expose search and showDisabled filters on authConfigs.list()
- Add provider-agnostic JSON-schema property-key sanitizer with sanitizeSchemaPropertyKeys, restoreOriginalKeys, mappingHasRenames functions and KeyMapping and KeySanitizationPolicy types
- Drop CommonJS entrypoints and publish TypeScript SDK packages as ESM-only, requiring Node.js 22.22.3 or newer
- Replace chalk with picocolors for colored error and log output
- Remove the deprecated uuid field from the auth config retrieve and list response type
Minor Changes
-
a0bef5d: Bump
@composio/clientto0.1.0-alpha.74. -
dfd7a08: Add per-request cancellation to public SDK methods via a new
ComposioRequestOptions({ signal?: AbortSignal }) trailing argument, plus a typedComposioRequestCancelledErrorfor detecting caller-initiated aborts.Without this, a slow
tools.getortools.executehad no way to be cancelled — a 100s search would block the calling agent indefinitely. The new shape:try { const tools = await composio.tools.get( 'user_1', { search: 'send email', limit: 50 }, { signal: AbortSignal.timeout(5_000) } ); } catch (err) { if (err instanceof ComposioRequestCancelledError) { return; } throw err; }The signal is forwarded to the underlying
@composio/clientfetch. Any abort error (APIUserAbortError,AbortError, orDOMException(name='AbortError')) coming back is normalized toComposioRequestCancelledErrorso callers caninstanceof-detect cancellation without unwrapping nested causes. Catch-and-wrap paths intools.execute/tools.getRawComposioToolBySlug/toolkits.getre-throw the cancellation error rather than remapping it toComposioToolExecutionError/ComposioToolNotFoundError/ComposioToolkitFetchError.Wired through on:
- Tools:
get,getRawComposioTools,getRawComposioToolBySlug,getRawToolRouterSessionTools,execute,executeSessionTool,getToolsEnum,getInput,proxyExecute - Toolkits:
get,listCategories - AuthConfigs:
list,create,get,update,delete,updateStatus,enable,disable - ConnectedAccounts:
list,get,delete,refresh,updateStatus,enable,disable,update - Triggers:
listActive,create,update,delete,enable,disable,listTypes,getType,listEnum - MCP:
create,list,get,delete,update,generate - ToolRouter (
composio.create/composio.use,composio.toolRouter.create/.use) — long-running session-creation paths - ToolRouterSession:
authorize,toolkits,search,execute,proxyExecute,update
Custom-tool cooperative cancellation
Native tool execution is cancelled by the SDK (the underlying
fetchis aborted). Custom tools are different — the SDK can't preempt user-supplied JavaScript. Two affordances are added so callers get sensible behavior anyway:- Pre-execute signal check: if
signal.abortedis true before the user'sexecuteruns, the SDK throwsComposioRequestCancelledErrorand never invokes user code. - Cooperative signal forwarding: the same
AbortSignalis exposed viaSessionContext.signalfor Tool Router custom tools. Long-running implementations can wirectx.signalinto their ownfetch(or any abortable IO) to abort mid-execution; the resultingAbortErroris normalized toComposioRequestCancelledErrorby the SDK.
import { experimental_createTool } from '@composio/core'; const longRunningFetch = experimental_createTool('LONG_RUNNING_FETCH', { name: 'Long-running fetch', description: 'Fetches a URL with cooperative cancellation', inputParams: z.object({ url: z.string() }), execute: async (input, ctx) => { // Pass ctx.signal into fetch so a session.execute(...) abort cancels // the in-flight HTTP request mid-flight. const resp = await fetch(input.url, { signal: ctx.signal }); return { result: await resp.json() }; }, }); - Tools:
-
025a657: Drop CommonJS entrypoints and publish the TypeScript SDK packages as ESM-only packages. This is a breaking change within the existing 0.x release line: consumers must use Node.js 22.22.3 or newer. CommonJS callers can only rely on Node's native
require(esm)interop, and the SDK no longer ships custom CommonJS compatibility machinery or.cjsartifacts. -
4b76dbf: Remove the deprecated
uuidfield from the auth config retrieve/list response type.The platform has removed the deprecated V1/V2 UUID-mirror field from V3 API responses (it was a mirror of the canonical nanoid
id). The SDK no longer reads or re-exposesuuidonAuthConfigRetrieveResponse(and therefore on the items ofAuthConfigListResponse).This is technically a breaking change to the SDK response type: consumers should use
idinstead ofuuid. TheexpectedInputFieldsfield is unaffected — it remains a top-level field on the API response.
Patch Changes
-
552859a: Expose
searchandshowDisabledfilters onauthConfigs.list(). -
23f9053: Replace
chalkwithpicocolorsfor colored error and log output. The two render identically, butpicocolorsis a fraction of the size (~0.8 kB gzipped vs chalk's much larger footprint), shrinking the bundled package. -
507318d: Add a provider-agnostic JSON-schema property-key sanitizer:
sanitizeSchemaPropertyKeys(schema, policy),restoreOriginalKeys(value, mapping),mappingHasRenames(mapping), and theKeyMapping/KeySanitizationPolicytypes.Some providers constrain the characters and length of tool
input_schemaproperty keys and reject the whole request on a single violation. This utility rewrites offending keys to conforming aliases (recursing throughproperties, arrayitems/prefixItems, the composition keywordsallOf/anyOf/oneOfandnot/if/then/else, plusadditionalProperties/patternProperties/$defs/contains) and records a schema-shaped reverse mapping so the original parameter names can be restored before execution. The constraint is injected as aKeySanitizationPolicy, so the traversal, collision handling, prototype safety, and depth cap stay provider-agnostic. The@composio/anthropicprovider now consumes it. -
6a4cb54: Preserve root
$defs/definitionsblocks on tool parameter schemas and dereference them in the Node file modifier, so auto file upload/download detection works whenfile_uploadableorfile_downloadableis hidden behind an internal$ref. -
cbbad15: Improve Zod compatibility at the SDK schema boundary. Custom tools now convert both
zod/v3and Zod v4 schemas to JSON Schema correctly instead of degrading Zod v4 object schemas to empty schemas.@composio/corenow exposesjsonSchemaToZodShapevia@composio/core/utils/json-schema, and the Claude Agent SDK provider uses that core subpath instead of converting to a full Zod object and casting.shapeout of it. -
Updated dependencies [025a657]
- @composio/json-schema-to-zod@0.2.0