Minor Changes
-
9f14971: Add migration tooling for the link auth migration: callers using
composio.connectedAccounts.initiate()for Composio-managed auth configs on redirectable OAuth schemes (OAuth1, OAuth2, DCR_OAUTH) now get a typed error and a one-time deprecation warning ahead of the 2026-07-03 all-orgs cutover.- Added:
ComposioLegacyConnectedAccountsEndpointRetiredError, exported from@composio/core. Thrown byinitiate()when the underlyingPOST /api/v3/connected_accountsreturns a 400 indicating the retiring path. Carries the migration message and apossibleFixesblock pointing atlink()and the migration guide. - Added: one-time-per-process
console.warnfrominitiate()when the response indicates a redirectable OAuth scheme. Wording is conditional ("If this auth config is Composio-managed…") so callers using custom OAuth apps or non-OAuth schemes can ignore it without ambiguity. - JSDoc:
initiate()now flags the retirement explicitly and points atlink()for the affected combination. Custom auth configs and non-OAuth schemes (API key, bearer, basic) are unaffected.
No behavior change for any caller outside the Composio-managed-OAuth combination —
initiate()continues to call the legacy endpoint, return the sameConnectionRequestshape, and respect theallowMultipleguard. - Added:
-
81f8027: Add
session.update()method for partially updating session configuration after creation. Accepts the same config shape ascreate()and mutates the session in-place. Available in both TypeScript and Python SDKs. -
711a703: Add expanded ToolRouter session controls for agent workflows.
composio.create()
now creates a fresh session on each call for better isolation and observability,
whilecomposio.use()can resume an existing session for multi-turn
conversations. Sessions can preload frequently used tools, expose custom tools
directly fromsession.tools(), use a direct-tools preset for agents that know
their tool set upfront, and update session config mid-session with
session.update(). -
07c9bab:
connectedAccountsnow accepts bothstringandstring[]per toolkit.A single string is automatically coerced to an array to match the v3.1 API wire format. Existing callers passing
{ gmail: "ca_xxx" }continue to work without changes. Only one account per toolkit is allowed when multi-account mode is disabled. -
3ece424: Add custom tools support to
composio.use().composio.use(id, { customTools, customToolkits }): Reuse an existing session and optionally bind SDK-local custom tools for search and execution.- Inline custom tools payload:
use()now correctly passesinlineCustomToolsPayloadandpreloadedCustomToolSlugsto the session, enabling custom tool execution and preloading on rehydrated sessions. CustomToolsMap.tools: The map now caches the rawCustomTool[]array for future inline re-injection on v3.1 search/execute requests.
Patch Changes
-
c9b6525: Fix
connectedAccountsTypeScript type so a singlestringper toolkit is actually accepted by the public API.Previously the schema's
.transform()madeToolRouterCreateSessionConfig['connectedAccounts']resolve toRecord<string, string[]>(the post-transform output), so TypeScript users still gotType 'string' is not assignable to type 'string[]'even though the runtime accepted strings. Coercion now happens insideToolRouter.create, mirroring the Python implementation, and the public type isRecord<string, string | string[]>. -
cc673b6: Resolve internal JSON Schema
$refpointers (#/$defs/...and#/definitions/...) before handing tool parameters to@mastra/schema-compat. Composio tools whose schemas use$defs/definitions— legal under Draft 7 and 2020-12 — no longer trigger the AJVcan't resolve reference …error, and the resolved type information from$defssurvives the JSON-Schema → Zod → JSON-Schema round-trip instead of being silently degraded to a permissiveanyOf.- New
dereferenceJsonSchemahelper exported from@composio/coreperforms the inline expansion. It deep-clones the input, walks every applicator reflectively (so future JSON Schema keywords are covered), shallow-merges sibling keywords next to$refper Draft 2020-12 semantics, breaks cycles with{ type: 'object', additionalProperties: true }(matching the upstream guidance in mastra-ai/mastra#15341), and strips$defs/definitionsonce everything reachable is inlined. External (http:///https://)$refpointers are left untouched. @composio/mastracalls the helper insidewrapToolfor bothinputParametersandoutputParameters.@mastra/schema-compatdependency floor raised to^1.2.9so users automatically receive PR #15400's recursive-$refhandling.
- New
-
bccd32b: Expose and document the Tool Router direct-tools preset via
SessionPreset.DIRECT_TOOLS, with Python parity throughSESSION_PRESET_DIRECT_TOOLS. Direct-tools examples now use the constants and keep the agent prompt generic while still asserting that only direct tools are exposed. -
bccd32b: Document and tighten Tool Router preload behavior for app tools,
preload.tools = "all", and SDK custom tools. Custom tool and toolkit preload hints now have clearer user-facing comments, direct custom tool descriptions now only state that search is not needed beforehand, examples assert the normalizedLOCAL_*tool slugs exposed bysession.tools(), andcomposio.use(..., customTools/customToolkits)reuses the same custom preload preparation path as session creation.