github ComposioHQ/composio @composio/core@0.9.0

latest releases: @composio/cli@0.6.4-beta.575, @composio/cli@0.6.4-beta.574, @composio/cli@0.6.4-beta.573...
6 months ago

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 by initiate() when the underlying POST /api/v3/connected_accounts returns a 400 indicating the retiring path. Carries the migration message and a possibleFixes block pointing at link() and the migration guide.
    • Added: one-time-per-process console.warn from initiate() 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 at link() 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 same ConnectionRequest shape, and respect the allowMultiple guard.

  • 81f8027: Add session.update() method for partially updating session configuration after creation. Accepts the same config shape as create() 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,
    while composio.use() can resume an existing session for multi-turn
    conversations. Sessions can preload frequently used tools, expose custom tools
    directly from session.tools(), use a direct-tools preset for agents that know
    their tool set upfront, and update session config mid-session with
    session.update().

  • 07c9bab: connectedAccounts now accepts both string and string[] 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 passes inlineCustomToolsPayload and preloadedCustomToolSlugs to the session, enabling custom tool execution and preloading on rehydrated sessions.
    • CustomToolsMap.tools: The map now caches the raw CustomTool[] array for future inline re-injection on v3.1 search/execute requests.

Patch Changes

  • c9b6525: Fix connectedAccounts TypeScript type so a single string per toolkit is actually accepted by the public API.

    Previously the schema's .transform() made ToolRouterCreateSessionConfig['connectedAccounts'] resolve to Record<string, string[]> (the post-transform output), so TypeScript users still got Type 'string' is not assignable to type 'string[]' even though the runtime accepted strings. Coercion now happens inside ToolRouter.create, mirroring the Python implementation, and the public type is Record<string, string | string[]>.

  • cc673b6: Resolve internal JSON Schema $ref pointers (#/$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 AJV can't resolve reference … error, and the resolved type information from $defs survives the JSON-Schema → Zod → JSON-Schema round-trip instead of being silently degraded to a permissive anyOf.

    • New dereferenceJsonSchema helper exported from @composio/core performs 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 $ref per Draft 2020-12 semantics, breaks cycles with { type: 'object', additionalProperties: true } (matching the upstream guidance in mastra-ai/mastra#15341), and strips $defs/definitions once everything reachable is inlined. External (http:///https://) $ref pointers are left untouched.
    • @composio/mastra calls the helper inside wrapTool for both inputParameters and outputParameters.
    • @mastra/schema-compat dependency floor raised to ^1.2.9 so users automatically receive PR #15400's recursive-$ref handling.
  • bccd32b: Expose and document the Tool Router direct-tools preset via SessionPreset.DIRECT_TOOLS, with Python parity through SESSION_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 normalized LOCAL_* tool slugs exposed by session.tools(), and composio.use(..., customTools/customToolkits) reuses the same custom preload preparation path as session creation.

Don't miss a new composio release

NewReleases is sending notifications on new releases.