mastra-starter 1.0.4 → 1.0.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/index.mjs +3 -2
- package/package.json +1 -1
- package/src/mastra/agents/index.ts +1 -1
- package/util.mjs +5 -3
package/index.mjs
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
import path from 'path';
|
4
4
|
import fs from 'fs';
|
5
|
-
import child_process from 'child_process';
|
6
5
|
|
7
6
|
import { Command } from 'commander';
|
8
7
|
import dotenv from 'dotenv';
|
@@ -27,7 +26,9 @@ const main = async () => {
|
|
27
26
|
const characterJsonPath = path.resolve(process.cwd(), character);
|
28
27
|
|
29
28
|
try {
|
30
|
-
await runCharacter(characterJsonPath
|
29
|
+
await runCharacter(characterJsonPath, {
|
30
|
+
env: process.env,
|
31
|
+
});
|
31
32
|
} catch (error) {
|
32
33
|
console.error(`Error in dev command: ${error.message}`);
|
33
34
|
}
|
package/package.json
CHANGED
@@ -10,7 +10,7 @@ const packageLookup = new PnpmPackageLookup({
|
|
10
10
|
pnpmLockYamlPath: path.join('..', '..', 'pnpm-lock.yaml'),
|
11
11
|
});
|
12
12
|
|
13
|
-
const characterJsonPath = process.env.
|
13
|
+
const characterJsonPath = process.env._CHARACTER_JSON_PATH as string;
|
14
14
|
const characterJsonString = await fs.promises.readFile(characterJsonPath, 'utf8');
|
15
15
|
const characterJson = JSON.parse(characterJsonString);
|
16
16
|
const { plugins = [] } = characterJson;
|
package/util.mjs
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
import child_process from "child_process";
|
2
2
|
|
3
|
-
export const runCharacter = async (characterJsonPath
|
3
|
+
export const runCharacter = async (characterJsonPath, {
|
4
|
+
env = {},
|
5
|
+
} = {}) => {
|
4
6
|
const mastraPath = import.meta.resolve('mastra').replace('file://', '');
|
5
7
|
const cp = child_process.spawn(process.execPath, [mastraPath, 'dev'], {
|
6
8
|
env: {
|
7
|
-
...
|
8
|
-
|
9
|
+
...env,
|
10
|
+
_CHARACTER_JSON_PATH: characterJsonPath,
|
9
11
|
},
|
10
12
|
});
|
11
13
|
cp.stdout.pipe(process.stdout);
|