Skip to content

Conversation

@jkomyno
Copy link
Collaborator

@jkomyno jkomyno commented Dec 3, 2025

This PR closes #2217.

  • in e6ee55a, I added a CommonJS example in ts/examples/cjs.
    You can reproduce the issue's error by running:

    ❯ pnpm start     
    
    > cjs-example@0.1.0 start ts/examples/cjs
    > node ./src/index.cjs
    
    Creating custom tool...
    TypeError: (0 , import_zod_to_json_schema.default) is not a function
        at CustomTools.createTool (ts/packages/core/dist/index.cjs:2131:64)
        at instance.<computed> [as createTool] (ts/packages/core/dist/index.cjs:1663:39)
        at Tools.createCustomTool (ts/packages/core/dist/index.cjs:3475:29)
        at instance.<computed> [as createCustomTool] (ts/packages/core/dist/index.cjs:1663:39)
        at main (ts/examples/cjs/src/index.cjs:10:37)
        at Object.<anonymous> (ts/examples/cjs/src/index.cjs:31:1)
        at Module._compile (node:internal/modules/cjs/loader:1529:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
        at Module.load (node:internal/modules/cjs/loader:1275:32)
        at Module._load (node:internal/modules/cjs/loader:1096:12) {
      errorId: '94f12584-1cfc-4bfe-925c-d6d327ba629d'
  • in 03d4d78, I ported @composio/core's bundler from tsup (which uses rollup under the hood) to tsdown (which uses rolldownunder the hood. You can observe how the issue's error no longer applies:

    ❯ pnpm start
    
    > cjs-example@0.1.0 start ts/examples/cjs
    > node ./src/index.cjs
    
    Creating custom tool...
    Custom tool created: {
      name: 'My Custom Tool',
      slug: 'MY_CUSTOM_TOOL',
      description: 'A custom tool that does something specific',
      inputParameters: {
        title: 'My Custom Tool',
        type: 'object',
        description: 'A custom tool that does something specific',
        properties: { param1: [Object] },
        required: [ 'param1' ]
      },
      outputParameters: {
        type: 'object',
        title: 'Response for My Custom Tool',
        properties: {}
      },
      tags: [],
      toolkit: { name: 'custom', slug: 'custom' }
    }
  • in a71c91d, I fixed the pnpm audit --prod check

@jkomyno jkomyno changed the title chore(ts): fix(core): fix CommonJS usage of @composio/core by moving bundler from tsup to tsdown Dec 3, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

@jkomyno jkomyno marked this pull request as ready for review December 3, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: zod-to-json-schema import fails in CommonJS bundle (v0.2.6)

3 participants