@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 +17 -7
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +17 -7
- package/package.json +11 -6
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
let _composio_core = require("@composio/core");
|
|
2
|
-
let
|
|
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
|
|
58
|
-
|
|
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
|
|
62
|
-
outputSchema
|
|
63
|
-
execute: async (
|
|
64
|
-
return await executeTool(tool.slug,
|
|
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
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BaseAgenticProvider,
|
|
2
|
-
import {
|
|
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
|
|
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
|
|
62
|
-
outputSchema
|
|
63
|
-
execute: async (
|
|
64
|
-
return await executeTool(tool.slug,
|
|
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.
|
|
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.
|
|
38
|
-
"@mastra/core": "^0.
|
|
39
|
-
"
|
|
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.
|
|
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
|
}
|