@composio/mastra 0.5.5 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  let _composio_core = require("@composio/core");
2
- let _mastra_core = require("@mastra/core");
2
+ let _mastra_schema_compat = require("@mastra/schema-compat");
3
+ let _mastra_core_tools = require("@mastra/core/tools");
3
4
 
4
5
  //#region src/index.ts
5
6
  /**
@@ -54,14 +55,23 @@ var MastraProvider = class extends _composio_core.BaseAgenticProvider {
54
55
  }
55
56
  wrapTool(tool, executeTool) {
56
57
  const inputParams = tool.inputParameters;
57
- const parameters = this.strict && inputParams?.type === "object" ? (0, _composio_core.removeNonRequiredProperties)(inputParams) : inputParams ?? {};
58
- return (0, _mastra_core.createTool)({
58
+ const inputSchema = (0, _mastra_schema_compat.applyCompatLayer)({
59
+ schema: (this.strict && inputParams?.type === "object" ? (0, _composio_core.removeNonRequiredProperties)(inputParams) : inputParams) ?? {},
60
+ compatLayers: [],
61
+ mode: "jsonSchema"
62
+ });
63
+ const outputSchema = (0, _mastra_schema_compat.applyCompatLayer)({
64
+ schema: tool.outputParameters ?? {},
65
+ compatLayers: [],
66
+ mode: "jsonSchema"
67
+ });
68
+ return (0, _mastra_core_tools.createTool)({
59
69
  id: tool.slug,
60
70
  description: tool.description ?? "",
61
- inputSchema: parameters ? (0, _composio_core.jsonSchemaToZodSchema)(parameters) : void 0,
62
- outputSchema: tool.outputParameters ? (0, _composio_core.jsonSchemaToZodSchema)(tool.outputParameters) : void 0,
63
- execute: async ({ context }) => {
64
- return await executeTool(tool.slug, context);
71
+ inputSchema,
72
+ outputSchema,
73
+ execute: async (inputData, _context) => {
74
+ return await executeTool(tool.slug, inputData);
65
75
  }
66
76
  });
67
77
  }
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BaseAgenticProvider, ExecuteToolFn, McpUrlResponse, Tool } from "@composio/core";
2
- import { createTool } from "@mastra/core";
2
+ import { createTool } from "@mastra/core/tools";
3
3
 
4
4
  //#region src/index.d.ts
5
5
 
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BaseAgenticProvider, ExecuteToolFn, McpUrlResponse, Tool } from "@composio/core";
2
- import { createTool } from "@mastra/core";
2
+ import { createTool } from "@mastra/core/tools";
3
3
 
4
4
  //#region src/index.d.ts
5
5
 
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
- import { BaseAgenticProvider, jsonSchemaToZodSchema, removeNonRequiredProperties } from "@composio/core";
2
- import { createTool } from "@mastra/core";
1
+ import { BaseAgenticProvider, removeNonRequiredProperties } from "@composio/core";
2
+ import { applyCompatLayer } from "@mastra/schema-compat";
3
+ import { createTool } from "@mastra/core/tools";
3
4
 
4
5
  //#region src/index.ts
5
6
  /**
@@ -54,14 +55,23 @@ var MastraProvider = class extends BaseAgenticProvider {
54
55
  }
55
56
  wrapTool(tool, executeTool) {
56
57
  const inputParams = tool.inputParameters;
57
- const parameters = this.strict && inputParams?.type === "object" ? removeNonRequiredProperties(inputParams) : inputParams ?? {};
58
+ const inputSchema = applyCompatLayer({
59
+ schema: (this.strict && inputParams?.type === "object" ? removeNonRequiredProperties(inputParams) : inputParams) ?? {},
60
+ compatLayers: [],
61
+ mode: "jsonSchema"
62
+ });
63
+ const outputSchema = applyCompatLayer({
64
+ schema: tool.outputParameters ?? {},
65
+ compatLayers: [],
66
+ mode: "jsonSchema"
67
+ });
58
68
  return createTool({
59
69
  id: tool.slug,
60
70
  description: tool.description ?? "",
61
- inputSchema: parameters ? jsonSchemaToZodSchema(parameters) : void 0,
62
- outputSchema: tool.outputParameters ? jsonSchemaToZodSchema(tool.outputParameters) : void 0,
63
- execute: async ({ context }) => {
64
- return await executeTool(tool.slug, context);
71
+ inputSchema,
72
+ outputSchema,
73
+ execute: async (inputData, _context) => {
74
+ return await executeTool(tool.slug, inputData);
65
75
  }
66
76
  });
67
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@composio/mastra",
3
- "version": "0.5.5",
3
+ "version": "0.6.1",
4
4
  "description": "Agentic Provider for mastra in Composio SDK",
5
5
  "main": "dist/index.mjs",
6
6
  "publishConfig": {
@@ -34,21 +34,26 @@
34
34
  "author": "",
35
35
  "license": "ISC",
36
36
  "peerDependencies": {
37
- "@composio/core": "0.5.5",
38
- "@mastra/core": "^0.21.1",
39
- "@mastra/mcp": "^0.12.0"
37
+ "@composio/core": "0.6.1",
38
+ "@mastra/core": "^1.0.4",
39
+ "zod": "^3.25 || ^4"
40
40
  },
41
41
  "devDependencies": {
42
+ "@mastra/core": "^1.0.4",
42
43
  "tsdown": "^0.18.4",
43
44
  "typescript": "^5.9.2",
44
45
  "vitest": "^3.1.4",
45
46
  "zod": "^4.1.0",
46
- "@composio/core": "0.5.5"
47
+ "@composio/core": "0.6.1"
48
+ },
49
+ "dependencies": {
50
+ "@mastra/schema-compat": "^1.0.0"
47
51
  },
48
52
  "scripts": {
49
53
  "clean": "git clean -xdf node_modules",
50
54
  "build": "bun run --bun tsdown",
51
- "test": "vitest run"
55
+ "test": "vitest run",
56
+ "typecheck": "tsc --noEmit --skipLibCheck"
52
57
  },
53
58
  "types": "dist/index.d.mts"
54
59
  }