mastra 0.1.57-alpha.85 → 0.1.57-alpha.86

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,2 +1,2 @@
1
- export declare function down(): Promise<void>;
1
+ export declare function down(composePath?: string): Promise<void>;
2
2
  //# sourceMappingURL=down.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"down.d.ts","sourceRoot":"","sources":["../../../src/commands/engine/down.ts"],"names":[],"mappings":"AAIA,wBAAsB,IAAI,kBAWzB"}
1
+ {"version":3,"file":"down.d.ts","sourceRoot":"","sources":["../../../src/commands/engine/down.ts"],"names":[],"mappings":"AAIA,wBAAsB,IAAI,CAAC,WAAW,CAAC,EAAE,MAAM,iBAY9C"}
@@ -1,11 +1,12 @@
1
1
  import yoctoSpinner from 'yocto-spinner';
2
2
  import { DockerService } from '../../services/service.docker.js';
3
- export async function down() {
3
+ export async function down(composePath) {
4
4
  const spinner = yoctoSpinner({ text: 'Shutting down docker container\n' });
5
5
  spinner.start();
6
6
  try {
7
7
  const dockerService = new DockerService();
8
- await dockerService.stopDockerContainer('mastra-pg.docker-compose.yaml');
8
+ const composeFile = dockerService.getComposeFile(composePath);
9
+ await dockerService.stopDockerContainer(composeFile);
9
10
  spinner.success('Docker container shut down successfully\n');
10
11
  }
11
12
  catch (error) {
@@ -1,2 +1,2 @@
1
- export declare function up(): Promise<void>;
1
+ export declare function up(composePath?: string): Promise<void>;
2
2
  //# sourceMappingURL=up.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../../src/commands/engine/up.ts"],"names":[],"mappings":"AAIA,wBAAsB,EAAE,kBAWvB"}
1
+ {"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../../src/commands/engine/up.ts"],"names":[],"mappings":"AAIA,wBAAsB,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,iBAY5C"}
@@ -1,11 +1,12 @@
1
1
  import yoctoSpinner from 'yocto-spinner';
2
2
  import { DockerService } from '../../services/service.docker.js';
3
- export async function up() {
3
+ export async function up(composePath) {
4
4
  const spinner = yoctoSpinner({ text: 'Starting docker container\n' });
5
5
  spinner.start();
6
6
  try {
7
7
  const dockerService = new DockerService();
8
- await dockerService.startDockerContainer('mastra-pg.docker-compose.yaml');
8
+ const composeFile = dockerService.getComposeFile(composePath);
9
+ await dockerService.startDockerContainer(composeFile);
9
10
  spinner.success('Docker containers started successfully\n');
10
11
  }
11
12
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAoQA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAsQA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -153,24 +153,26 @@ engine
153
153
  engine
154
154
  .command('up')
155
155
  .description('Runs docker-compose up to start docker containers')
156
- .action(async () => {
156
+ .option('-f, --file <path>', 'Path to docker-compose file')
157
+ .action(async (args) => {
157
158
  await analytics.trackCommandExecution({
158
159
  command: 'engine up',
159
- args: {},
160
+ args,
160
161
  execution: async () => {
161
- await up();
162
+ await up(args.file);
162
163
  },
163
164
  });
164
165
  });
165
166
  engine
166
167
  .command('down')
167
168
  .description('Runs docker-compose down to shut down docker containers')
168
- .action(async () => {
169
+ .option('-f, --file <path>', 'Path to docker-compose file')
170
+ .action(async (args) => {
169
171
  await analytics.trackCommandExecution({
170
172
  command: 'engine down',
171
173
  args: {},
172
174
  execution: async () => {
173
- await down();
175
+ await down(args.file);
174
176
  },
175
177
  });
176
178
  });
@@ -22,5 +22,6 @@ export declare class DockerService {
22
22
  dbUrl: string;
23
23
  }>;
24
24
  private editComposeFile;
25
+ getComposeFile(composePath: string): string;
25
26
  }
26
27
  //# sourceMappingURL=service.docker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"service.docker.d.ts","sourceRoot":"","sources":["../../src/services/service.docker.ts"],"names":[],"mappings":"AAOA,qBAAa,aAAa;IACxB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAqB5B,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQ1C,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;YAqBlD,eAAe;IAUvB,aAAa,CAAC,EAClB,mBAAmB,GACpB,GAAE;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAAO;;;IAW1F,kBAAkB;IASlB,oBAAoB,CAAC,iBAAiB,EAAE,MAAM;IAS9C,mBAAmB,CAAC,iBAAiB,EAAE,MAAM;IAS7C,kBAAkB,CAAC,EACvB,oBAAoB,EACpB,YAAY,GACb,EAAE;QACD,oBAAoB,EAAE,MAAM,CAAC;QAC7B,YAAY,EAAE,MAAM,CAAC;KACtB;;;IAUD,OAAO,CAAC,eAAe;CAoBxB"}
1
+ {"version":3,"file":"service.docker.d.ts","sourceRoot":"","sources":["../../src/services/service.docker.ts"],"names":[],"mappings":"AAQA,qBAAa,aAAa;IACxB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAqB5B,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQ1C,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;YAqBlD,eAAe;IAUvB,aAAa,CAAC,EAClB,mBAAmB,GACpB,GAAE;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAAO;;;IAW1F,kBAAkB;IASlB,oBAAoB,CAAC,iBAAiB,EAAE,MAAM;IAS9C,mBAAmB,CAAC,iBAAiB,EAAE,MAAM;IAS7C,kBAAkB,CAAC,EACvB,oBAAoB,EACpB,YAAY,GACb,EAAE;QACD,oBAAoB,EAAE,MAAM,CAAC;QAC7B,YAAY,EAAE,MAAM,CAAC;KACtB;;;IAUD,OAAO,CAAC,eAAe;IAqBvB,cAAc,CAAC,WAAW,EAAE,MAAM;CAmBnC"}
@@ -1,4 +1,5 @@
1
1
  import { execa } from 'execa';
2
+ import fs from 'fs';
2
3
  import path from 'path';
3
4
  import { check } from 'tcp-port-used';
4
5
  import { fileURLToPath } from 'url';
@@ -108,4 +109,23 @@ export class DockerService {
108
109
  ],
109
110
  });
110
111
  }
112
+ getComposeFile(composePath) {
113
+ const fileService = new FileService();
114
+ let composeFile;
115
+ if (composePath) {
116
+ if (!fs.existsSync(composePath)) {
117
+ throw new Error(`Docker compose file not found: ${composePath}`);
118
+ }
119
+ composeFile = composePath;
120
+ }
121
+ else {
122
+ composeFile = fileService.getFirstExistingFile([
123
+ 'mastra-pg.docker-compose.yaml',
124
+ 'mastra-pg.docker-compose.yml',
125
+ 'docker-compose.yaml',
126
+ 'docker-compose.yml',
127
+ ]);
128
+ }
129
+ return composeFile;
130
+ }
111
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mastra",
3
- "version": "0.1.57-alpha.85",
3
+ "version": "0.1.57-alpha.86",
4
4
  "license": "MIT",
5
5
  "description": "cli for mastra",
6
6
  "type": "module",
@@ -96,7 +96,7 @@
96
96
  "yocto-spinner": "^0.1.1",
97
97
  "zod": "^3.24.1",
98
98
  "zod-to-json-schema": "^3.24.1",
99
- "@mastra/core": "0.1.27-alpha.58"
99
+ "@mastra/core": "0.1.27-alpha.59"
100
100
  },
101
101
  "devDependencies": {
102
102
  "@types/express": "^5.0.0",
@@ -109,6 +109,7 @@
109
109
  "@types/tcp-port-used": "^1.0.4",
110
110
  "@vitejs/plugin-react": "^4.3.4",
111
111
  "autoprefixer": "^10.4.20",
112
+ "cpy-cli": "^5.0.0",
112
113
  "eslint-plugin-react-hooks": "^5.0.0",
113
114
  "eslint-plugin-react-refresh": "^0.4.14",
114
115
  "postcss": "^8.4.49",
@@ -120,7 +121,7 @@
120
121
  "build": "npm-run-all build:tsc copy-starter-files build:playground",
121
122
  "build:tsc": "tsc",
122
123
  "build:dev": "npx tsc --watch",
123
- "copy-starter-files": "cp -r src/starter-files dist/",
124
+ "copy-starter-files": "cpy src/starter-files dist/",
124
125
  "build:playground": "cd src/playground && vite build",
125
126
  "dev:playground": "cd src/playground && vite",
126
127
  "init": "npx tsx src/index.ts init",