@mastra/core 0.1.27-alpha.64 → 0.1.27-alpha.66

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.
@@ -31,6 +31,7 @@ var cohereAi = require('cohere-ai');
31
31
  var radash = require('radash');
32
32
  var sift = require('sift');
33
33
  var xstate = require('xstate');
34
+ var dotenv = require('dotenv');
34
35
 
35
36
  function _arrayLikeToArray(r, a) {
36
37
  (null == a || a > r.length) && (a = r.length);
@@ -4079,6 +4080,7 @@ exports.Mastra = /*#__PURE__*/function () {
4079
4080
  this.workflows = void 0;
4080
4081
  this.telemetry = void 0;
4081
4082
  this.tts = void 0;
4083
+ this.deployer = void 0;
4082
4084
  this.engine = void 0;
4083
4085
  this.memory = void 0;
4084
4086
  /*
@@ -4096,6 +4098,12 @@ exports.Mastra = /*#__PURE__*/function () {
4096
4098
  }
4097
4099
  this.logger = logger;
4098
4100
  }
4101
+ /**
4102
+ * Deployer
4103
+ **/
4104
+ if (config != null && config.deployer) {
4105
+ this.deployer = config.deployer;
4106
+ }
4099
4107
  /*
4100
4108
  Telemetry
4101
4109
  */
@@ -4292,6 +4300,9 @@ exports.Mastra = /*#__PURE__*/function () {
4292
4300
  _proto.getVectors = function getVectors() {
4293
4301
  return this.vectors;
4294
4302
  };
4303
+ _proto.getDeployer = function getDeployer() {
4304
+ return this.deployer;
4305
+ };
4295
4306
  _proto.getWorkflow = function getWorkflow(id, _temp) {
4296
4307
  var _this$workflows;
4297
4308
  var _ref4 = _temp === void 0 ? {} : _temp,
@@ -6802,6 +6813,75 @@ function executeHook(hook, data) {
6802
6813
  });
6803
6814
  }
6804
6815
 
6816
+ var MastraDeployer = /*#__PURE__*/function () {
6817
+ function MastraDeployer(_ref) {
6818
+ var scope = _ref.scope,
6819
+ env = _ref.env,
6820
+ projectName = _ref.projectName;
6821
+ this.scope = void 0;
6822
+ this.projectName = void 0;
6823
+ this.env = void 0;
6824
+ this.scope = scope;
6825
+ this.env = env;
6826
+ this.projectName = projectName;
6827
+ }
6828
+ var _proto = MastraDeployer.prototype;
6829
+ _proto.loadEnvVars = function loadEnvVars() {
6830
+ var _this = this;
6831
+ this.getEnvFiles().forEach(function (file) {
6832
+ var content = fs.readFileSync(file, 'utf-8');
6833
+ var config = dotenv.parse(content);
6834
+ _this.env = _extends({}, _this.env, config);
6835
+ });
6836
+ };
6837
+ _proto.getEnvFiles = function getEnvFiles() {
6838
+ var envFiles = ['.env', '.env.production'].map(function (file) {
6839
+ return path.join(process.cwd(), file);
6840
+ }).filter(function (file) {
6841
+ return fs.existsSync(file);
6842
+ });
6843
+ return envFiles;
6844
+ };
6845
+ _proto.parseEnvFile = function parseEnvFile(filePath) {
6846
+ var content = fs.readFileSync(filePath, 'utf-8');
6847
+ return content.split('\n').map(function (line) {
6848
+ return line.trim();
6849
+ }).filter(function (line) {
6850
+ return line && !line.startsWith('#');
6851
+ }).filter(function (line) {
6852
+ return line.includes('=');
6853
+ }); // Only include valid KEY=value pairs
6854
+ };
6855
+ _proto.writeFiles = function writeFiles(_ref2) {
6856
+ var dir = _ref2.dir;
6857
+ console.log('Writing files to', dir);
6858
+ };
6859
+ _proto.writeIndex = function writeIndex(_ref3) {
6860
+ var dir = _ref3.dir;
6861
+ console.log('Writing index to', dir);
6862
+ };
6863
+ _proto.deploy = /*#__PURE__*/function () {
6864
+ var _deploy = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref4) {
6865
+ var dir, siteId;
6866
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
6867
+ while (1) switch (_context.prev = _context.next) {
6868
+ case 0:
6869
+ dir = _ref4.dir, siteId = _ref4.siteId;
6870
+ console.log("Deploy command " + this.scope + "..." + (siteId || '') + " to " + dir + " " + (this.projectName || 'mastra-starter'));
6871
+ case 2:
6872
+ case "end":
6873
+ return _context.stop();
6874
+ }
6875
+ }, _callee, this);
6876
+ }));
6877
+ function deploy(_x) {
6878
+ return _deploy.apply(this, arguments);
6879
+ }
6880
+ return deploy;
6881
+ }();
6882
+ return MastraDeployer;
6883
+ }();
6884
+
6805
6885
  exports.BaseLogger = BaseLogger;
6806
6886
  exports.CohereRelevanceScorer = CohereRelevanceScorer;
6807
6887
  exports.ConsoleLogger = ConsoleLogger;
@@ -6810,6 +6890,7 @@ exports.InstrumentClass = InstrumentClass;
6810
6890
  exports.Integration = Integration;
6811
6891
  exports.LogLevel = LogLevel;
6812
6892
  exports.MastraAgentRelevanceScorer = MastraAgentRelevanceScorer;
6893
+ exports.MastraDeployer = MastraDeployer;
6813
6894
  exports.MastraEngine = MastraEngine;
6814
6895
  exports.MastraMemory = MastraMemory;
6815
6896
  exports.MastraVector = MastraVector;