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.
@@ -1 +1 @@
1
- export { PosthogAnalytics } from '../chunk-67VLC2FJ.js';
1
+ export { PosthogAnalytics } from '../chunk-GY75DPXZ.js';
@@ -82,7 +82,7 @@ var PosthogAnalytics = class {
82
82
  session_id: this.sessionId,
83
83
  cli_version: this.version || "unknown",
84
84
  machine_id: os.hostname(),
85
- disableGeoip: false
85
+ geoip_disable: false
86
86
  };
87
87
  }
88
88
  captureSessionStart() {
@@ -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<z.infer<typeof forecastSchema>>('fetch-weather');
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-ITGBIOBC.js';
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-67VLC2FJ.js';
3
- export { PosthogAnalytics } from './chunk-67VLC2FJ.js';
4
- import { DepsService, create, checkPkgJson, checkAndInstallCoreDeps, interactivePrompt, init, logger, convertToViteEnvVar, FileService as FileService$1 } from './chunk-ITGBIOBC.js';
5
- export { create } from './chunk-ITGBIOBC.js';
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 instrumentation = import.meta.resolve("@opentelemetry/instrumentation/hook.mjs");
252
- currentServerProcess = execa(
253
- "node",
254
- ["--import=./instrumentation.mjs", `--import=${instrumentation}`, "index.mjs"],
255
- {
256
- cwd: dotMastraPath,
257
- env: {
258
- ...Object.fromEntries(env),
259
- PORT: port.toString() || process.env.PORT || "4111",
260
- MASTRA_DEFAULT_STORAGE_URL: `file:${join(dotMastraPath, "..", "mastra.db")}`
261
- },
262
- stdio: "inherit",
263
- reject: false
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-alpha.8",
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-alpha.6",
57
- "@mastra/deployer": "^0.2.6-alpha.8"
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/client-js": "0.1.14-alpha.6",
76
- "@mastra/playground-ui": "4.0.0-alpha.6"
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",