create-mastra 0.18.0-alpha.0 → 1.0.0-beta.0
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/CHANGELOG.md +6 -26
- package/dist/index.js +35 -25
- package/dist/index.js.map +1 -1
- package/dist/starter-files/tools.ts +2 -2
- package/dist/templates/dev.entry.js +2 -45
- package/package.json +4 -11
|
@@ -35,8 +35,8 @@ export const weatherTool = createTool({
|
|
|
35
35
|
conditions: z.string(),
|
|
36
36
|
location: z.string(),
|
|
37
37
|
}),
|
|
38
|
-
execute: async (
|
|
39
|
-
return await getWeather(
|
|
38
|
+
execute: async (inputData) => {
|
|
39
|
+
return await getWeather(inputData.location);
|
|
40
40
|
},
|
|
41
41
|
});
|
|
42
42
|
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
|
-
|
|
3
|
-
import { evaluate } from '@mastra/core/eval';
|
|
4
|
-
import { AvailableHooks, registerHook } from '@mastra/core/hooks';
|
|
5
|
-
import { TABLE_EVALS } from '@mastra/core/storage';
|
|
6
|
-
import { scoreTracesWorkflow } from '@mastra/core/scores/scoreTraces';
|
|
7
|
-
import { checkEvalStorageFields } from '@mastra/core/utils';
|
|
2
|
+
import { scoreTracesWorkflow } from '@mastra/core/evals/scoreTraces';
|
|
8
3
|
import { mastra } from '#mastra';
|
|
9
4
|
import { createNodeServer, getToolExports } from '#server';
|
|
10
5
|
import { tools } from '#tools';
|
|
@@ -15,44 +10,6 @@ await createNodeServer(mastra, {
|
|
|
15
10
|
tools: getToolExports(tools),
|
|
16
11
|
});
|
|
17
12
|
|
|
18
|
-
registerHook(AvailableHooks.ON_GENERATION, ({ input, output, metric, runId, agentName, instructions }) => {
|
|
19
|
-
evaluate({
|
|
20
|
-
agentName,
|
|
21
|
-
input,
|
|
22
|
-
metric,
|
|
23
|
-
output,
|
|
24
|
-
runId,
|
|
25
|
-
globalRunId: runId,
|
|
26
|
-
instructions,
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
|
|
30
13
|
if (mastra.getStorage()) {
|
|
31
14
|
mastra.__registerInternalWorkflow(scoreTracesWorkflow);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {
|
|
35
|
-
const storage = mastra.getStorage();
|
|
36
|
-
if (storage) {
|
|
37
|
-
// Check for required fields
|
|
38
|
-
const logger = mastra?.getLogger();
|
|
39
|
-
const areFieldsValid = checkEvalStorageFields(traceObject, logger);
|
|
40
|
-
if (!areFieldsValid) return;
|
|
41
|
-
|
|
42
|
-
await storage.insert({
|
|
43
|
-
tableName: TABLE_EVALS,
|
|
44
|
-
record: {
|
|
45
|
-
input: traceObject.input,
|
|
46
|
-
output: traceObject.output,
|
|
47
|
-
result: JSON.stringify(traceObject.result || {}),
|
|
48
|
-
agent_name: traceObject.agentName,
|
|
49
|
-
metric_name: traceObject.metricName,
|
|
50
|
-
instructions: traceObject.instructions,
|
|
51
|
-
test_info: null,
|
|
52
|
-
global_run_id: traceObject.globalRunId,
|
|
53
|
-
run_id: traceObject.runId,
|
|
54
|
-
created_at: new Date().toISOString(),
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
});
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-mastra",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
4
|
"description": "Create Mastra apps with one command",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"rollup-plugin-esbuild": "^6.2.1",
|
|
52
52
|
"rollup-plugin-node-externals": "^8.0.1",
|
|
53
53
|
"typescript": "^5.8.3",
|
|
54
|
-
"@internal/lint": "0.0.
|
|
55
|
-
"mastra": "^0.
|
|
54
|
+
"@internal/lint": "0.0.53",
|
|
55
|
+
"mastra": "^1.0.0-beta.0"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
|
58
|
-
"node": ">=
|
|
58
|
+
"node": ">=22.13.0"
|
|
59
59
|
},
|
|
60
60
|
"homepage": "https://mastra.ai",
|
|
61
61
|
"repository": {
|
|
@@ -66,13 +66,6 @@
|
|
|
66
66
|
"bugs": {
|
|
67
67
|
"url": "https://github.com/mastra-ai/mastra/issues"
|
|
68
68
|
},
|
|
69
|
-
"publishConfig": {
|
|
70
|
-
"access": "public",
|
|
71
|
-
"publish-branch": [
|
|
72
|
-
"main",
|
|
73
|
-
"0.x"
|
|
74
|
-
]
|
|
75
|
-
},
|
|
76
69
|
"scripts": {
|
|
77
70
|
"build": "rollup -c",
|
|
78
71
|
"lint": "eslint .",
|