mastra 0.4.5-alpha.8 → 0.4.5
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/analytics/index.js +1 -1
- package/dist/{chunk-67VLC2FJ.js → chunk-GY75DPXZ.js} +1 -1
- package/dist/{chunk-ITGBIOBC.js → chunk-SIN6LLKM.js} +13 -12
- package/dist/commands/create/create.js +1 -1
- package/dist/index.js +21 -19
- package/package.json +6 -5
- package/src/playground/dist/assets/GeistMonoVF-BHyMa335.woff +0 -0
- package/src/playground/dist/assets/{index-B-3xPPtl.js → index-DsUSHcnm.js} +1 -1
- package/src/playground/dist/assets/{index-CbKnDcHv.js → index-hodzN7iD.js} +1 -1
- package/src/playground/dist/assets/index-pacfg0rB.js +592 -0
- package/src/playground/dist/assets/style-B03jYXLF.css +1 -0
- package/src/playground/dist/favicon.ico +0 -0
- package/src/playground/dist/index.html +2 -2
- package/src/playground/dist/mastra.svg +9 -1
- package/src/playground/dist/assets/index-B0gxzXm-.js +0 -635
- package/src/playground/dist/assets/style-voyZF7mI.css +0 -1
- package/src/playground/dist/mastra-light.ico +0 -0
package/dist/analytics/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { PosthogAnalytics } from '../chunk-
|
|
1
|
+
export { PosthogAnalytics } from '../chunk-GY75DPXZ.js';
|
|
@@ -455,12 +455,24 @@ const agent = new Agent({
|
|
|
455
455
|
\`,
|
|
456
456
|
});
|
|
457
457
|
|
|
458
|
+
const forecastSchema = z.array(
|
|
459
|
+
z.object({
|
|
460
|
+
date: z.string(),
|
|
461
|
+
maxTemp: z.number(),
|
|
462
|
+
minTemp: z.number(),
|
|
463
|
+
precipitationChance: z.number(),
|
|
464
|
+
condition: z.string(),
|
|
465
|
+
location: z.string(),
|
|
466
|
+
}),
|
|
467
|
+
);
|
|
468
|
+
|
|
458
469
|
const fetchWeather = new Step({
|
|
459
470
|
id: 'fetch-weather',
|
|
460
471
|
description: 'Fetches weather forecast for a given city',
|
|
461
472
|
inputSchema: z.object({
|
|
462
473
|
city: z.string().describe('The city to get the weather for'),
|
|
463
474
|
}),
|
|
475
|
+
outputSchema: forecastSchema,
|
|
464
476
|
execute: async ({ context }) => {
|
|
465
477
|
const triggerData = context?.getStepResult<{ city: string }>('trigger');
|
|
466
478
|
|
|
@@ -505,23 +517,12 @@ const fetchWeather = new Step({
|
|
|
505
517
|
},
|
|
506
518
|
});
|
|
507
519
|
|
|
508
|
-
const forecastSchema = z.array(
|
|
509
|
-
z.object({
|
|
510
|
-
date: z.string(),
|
|
511
|
-
maxTemp: z.number(),
|
|
512
|
-
minTemp: z.number(),
|
|
513
|
-
precipitationChance: z.number(),
|
|
514
|
-
condition: z.string(),
|
|
515
|
-
location: z.string(),
|
|
516
|
-
}),
|
|
517
|
-
);
|
|
518
520
|
|
|
519
521
|
const planActivities = new Step({
|
|
520
522
|
id: 'plan-activities',
|
|
521
523
|
description: 'Suggests activities based on weather conditions',
|
|
522
|
-
inputSchema: forecastSchema,
|
|
523
524
|
execute: async ({ context, mastra }) => {
|
|
524
|
-
const forecast = context?.getStepResult
|
|
525
|
+
const forecast = context?.getStepResult(fetchWeather);
|
|
525
526
|
|
|
526
527
|
if (!forecast || forecast.length === 0) {
|
|
527
528
|
throw new Error('Forecast data not found');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { create } from '../../chunk-
|
|
1
|
+
export { create } from '../../chunk-SIN6LLKM.js';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
import { PosthogAnalytics } from './chunk-
|
|
3
|
-
export { PosthogAnalytics } from './chunk-
|
|
4
|
-
import { DepsService, create, checkPkgJson, checkAndInstallCoreDeps, interactivePrompt, init, logger, convertToViteEnvVar, FileService as FileService$1 } from './chunk-
|
|
5
|
-
export { create } from './chunk-
|
|
2
|
+
import { PosthogAnalytics } from './chunk-GY75DPXZ.js';
|
|
3
|
+
export { PosthogAnalytics } from './chunk-GY75DPXZ.js';
|
|
4
|
+
import { DepsService, create, checkPkgJson, checkAndInstallCoreDeps, interactivePrompt, init, logger, convertToViteEnvVar, FileService as FileService$1 } from './chunk-SIN6LLKM.js';
|
|
5
|
+
export { create } from './chunk-SIN6LLKM.js';
|
|
6
6
|
import { Command } from 'commander';
|
|
7
7
|
import { config } from 'dotenv';
|
|
8
8
|
import { join as join$1, dirname, basename } from 'node:path';
|
|
@@ -13,6 +13,7 @@ import { readFileSync } from 'node:fs';
|
|
|
13
13
|
import { fileURLToPath } from 'node:url';
|
|
14
14
|
import { join } from 'path';
|
|
15
15
|
import { FileService, getDeployer } from '@mastra/deployer';
|
|
16
|
+
import { isWebContainer } from '@webcontainer/env';
|
|
16
17
|
import { execa } from 'execa';
|
|
17
18
|
import { stat } from 'node:fs/promises';
|
|
18
19
|
|
|
@@ -248,21 +249,22 @@ var isRestarting = false;
|
|
|
248
249
|
var startServer = async (dotMastraPath, port, env) => {
|
|
249
250
|
try {
|
|
250
251
|
logger.info("[Mastra Dev] - Starting server...");
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
"
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
252
|
+
const commands = [];
|
|
253
|
+
if (!isWebContainer()) {
|
|
254
|
+
const instrumentation = import.meta.resolve("@opentelemetry/instrumentation/hook.mjs");
|
|
255
|
+
commands.push("--import=./instrumentation.mjs", `--import=${instrumentation}`);
|
|
256
|
+
}
|
|
257
|
+
commands.push("index.mjs");
|
|
258
|
+
currentServerProcess = execa("node", commands, {
|
|
259
|
+
cwd: dotMastraPath,
|
|
260
|
+
env: {
|
|
261
|
+
...Object.fromEntries(env),
|
|
262
|
+
PORT: port.toString() || process.env.PORT || "4111",
|
|
263
|
+
MASTRA_DEFAULT_STORAGE_URL: `file:${join(dotMastraPath, "..", "mastra.db")}`
|
|
264
|
+
},
|
|
265
|
+
stdio: "inherit",
|
|
266
|
+
reject: false
|
|
267
|
+
});
|
|
266
268
|
if (currentServerProcess?.exitCode && currentServerProcess?.exitCode !== 0) {
|
|
267
269
|
if (!currentServerProcess) {
|
|
268
270
|
throw new Error(`Server failed to start`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mastra",
|
|
3
|
-
"version": "0.4.5
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"description": "cli for mastra",
|
|
6
6
|
"type": "module",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@clack/prompts": "^0.8.2",
|
|
38
38
|
"@lukeed/uuid": "^2.0.1",
|
|
39
39
|
"@opentelemetry/instrumentation": "^0.57.2",
|
|
40
|
+
"@webcontainer/env": "^1.1.1",
|
|
40
41
|
"commander": "^12.1.0",
|
|
41
42
|
"dotenv": "^16.4.7",
|
|
42
43
|
"execa": "^9.5.2",
|
|
@@ -53,8 +54,8 @@
|
|
|
53
54
|
"yocto-spinner": "^0.1.2",
|
|
54
55
|
"zod": "^3.24.2",
|
|
55
56
|
"zod-to-json-schema": "^3.24.3",
|
|
56
|
-
"@mastra/core": "^0.8.0
|
|
57
|
-
"@mastra/deployer": "^0.2.6
|
|
57
|
+
"@mastra/core": "^0.8.0",
|
|
58
|
+
"@mastra/deployer": "^0.2.6"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@microsoft/api-extractor": "^7.52.1",
|
|
@@ -72,8 +73,8 @@
|
|
|
72
73
|
"typescript": "^5.8.2",
|
|
73
74
|
"vitest": "^3.0.9",
|
|
74
75
|
"@internal/lint": "0.0.1",
|
|
75
|
-
"@mastra/
|
|
76
|
-
"@mastra/
|
|
76
|
+
"@mastra/playground-ui": "4.0.0",
|
|
77
|
+
"@mastra/client-js": "0.1.14"
|
|
77
78
|
},
|
|
78
79
|
"scripts": {
|
|
79
80
|
"build": "npm-run-all --serial build:lib copy-starter-files copy-templates build:playground",
|
|
Binary file
|