@mastra/dane 0.0.2-alpha.77 → 0.0.2-alpha.78
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
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mastra/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAarC,eAAO,MAAM,iBAAiB,6HAU5B,CAAC;AAEH,eAAO,MAAM,gBAAgB,6HAO3B,CAAC;AAiBH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mastra/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAarC,eAAO,MAAM,iBAAiB,6HAU5B,CAAC;AAEH,eAAO,MAAM,gBAAgB,6HAO3B,CAAC;AAiBH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAgC/B,CAAC;AAEH,eAAO,MAAM,eAAe,6HAa1B,CAAC;AAEH,eAAO,MAAM,aAAa,6HAcxB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAuDf,CAAC"}
|
|
@@ -39,15 +39,31 @@ const packages_llm_text = `
|
|
|
39
39
|
@mastra/mcp is located in the "packages/mcp" directory.
|
|
40
40
|
@mastra/deployer-{name} is located in the "deployers/{name}" directory.
|
|
41
41
|
@mastra/vector-{name} is located in the "vector-stores/{name}" directory.
|
|
42
|
-
|
|
42
|
+
@mastra/vector-astra is located in the "vector-stores/astra-db" directory.
|
|
43
43
|
`;
|
|
44
44
|
export const danePackagePublisher = new Agent({
|
|
45
45
|
name: 'DanePackagePublisher',
|
|
46
46
|
instructions: `
|
|
47
|
-
|
|
48
|
-
You help engineers publish their pnpm changesets.
|
|
47
|
+
I am Dane, a specialized agent for managing pnpm package publications in monorepos. My core responsibilities are:
|
|
49
48
|
|
|
49
|
+
1. Package Analysis:
|
|
50
|
+
- Identify packages requiring publication across the monorepo
|
|
51
|
+
- Detect changes that warrant new version releases
|
|
52
|
+
- Validate package dependencies and versioning
|
|
53
|
+
|
|
54
|
+
2. Publication Management:
|
|
55
|
+
- Orchestrate the correct build order for interdependent packages
|
|
56
|
+
- Ensure proper versioning using changesets
|
|
57
|
+
- Maintain package publishing standards
|
|
58
|
+
|
|
59
|
+
3. Directory Structure Knowledge:
|
|
50
60
|
${packages_llm_text}
|
|
61
|
+
|
|
62
|
+
Important Guidelines:
|
|
63
|
+
- Always respect package dependencies when determining build order
|
|
64
|
+
- Ensure all necessary builds complete before publishing
|
|
65
|
+
- Follow semantic versioning principles
|
|
66
|
+
- Validate package.json configurations before publishing
|
|
51
67
|
`,
|
|
52
68
|
model: getBaseModelConfig(),
|
|
53
69
|
tools: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Step, Workflow } from '@mastra/core';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
-
import { existsSync
|
|
3
|
+
import { existsSync } from 'fs';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
export const packagePublisher = new Workflow({
|
|
@@ -11,7 +11,8 @@ const getPacakgesToPublish = new Step({
|
|
|
11
11
|
outputSchema: z.object({
|
|
12
12
|
packages: z.array(z.string()),
|
|
13
13
|
integrations: z.array(z.string()),
|
|
14
|
-
|
|
14
|
+
deployers: z.array(z.string()),
|
|
15
|
+
vector_stores: z.array(z.string()),
|
|
15
16
|
}),
|
|
16
17
|
execute: async ({ mastra }) => {
|
|
17
18
|
const agent = mastra?.agents?.['danePackagePublisher'];
|
|
@@ -19,38 +20,53 @@ const getPacakgesToPublish = new Step({
|
|
|
19
20
|
throw new Error('Agent not found');
|
|
20
21
|
}
|
|
21
22
|
const result = await agent.generate(`
|
|
22
|
-
|
|
23
|
-
* My core modules are in the 'packages' directory.
|
|
24
|
-
* My integrations are in the 'integrations' directory.
|
|
25
|
-
* My deployers are in the 'deployers' directory.
|
|
26
|
-
* My vector stores are in the 'vector-stores' directory.
|
|
23
|
+
Please analyze the following monorepo directories and identify packages that need pnpm publishing:
|
|
27
24
|
|
|
28
|
-
|
|
25
|
+
CRITICAL: All packages MUST be built before publishing, in the correct order.
|
|
26
|
+
|
|
27
|
+
1. Directory Structure:
|
|
28
|
+
- packages/ : Contains core modules (format: @mastra/{name})
|
|
29
|
+
- integrations/ : Contains integration packages (format: @mastra/{name})
|
|
30
|
+
- deployers/ : Contains deployer packages (format: @mastra/deployer-{name})
|
|
31
|
+
- vector-stores/: Contains vector store packages with following mapping:
|
|
32
|
+
* @mastra/vector-astra -> vector-stores/astra-db/
|
|
33
|
+
* @mastra/vector-{name} -> vector-stores/{name}/ (for all other vector stores)
|
|
34
|
+
|
|
35
|
+
2. Publish Requirements:
|
|
36
|
+
- Build @mastra/core first, MUST be built before any other package
|
|
37
|
+
- Build all packages in correct dependency order before publishing
|
|
38
|
+
- Identify packages that have changes requiring a new pnpm publish
|
|
39
|
+
- Include create-mastra in the packages list if changes exist
|
|
40
|
+
- EXCLUDE @mastra/dane from consideration
|
|
41
|
+
|
|
42
|
+
Please list all packages that need building grouped by their directory.
|
|
29
43
|
`);
|
|
30
44
|
const resultObj = await agent.generate(`
|
|
31
|
-
|
|
45
|
+
Please organize the following packages for building and publishing:
|
|
46
|
+
|
|
47
|
+
Input Text: ${result.text}
|
|
32
48
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
* @mastra/deployers-{name} and @mastra/vector-{name} must be fourth.
|
|
39
|
-
|
|
40
|
-
Text: ${result.text}
|
|
49
|
+
1. Build Order Requirements:
|
|
50
|
+
- ALL packages MUST be built before publishing
|
|
51
|
+
- @mastra/core MUST be built first
|
|
52
|
+
- Dependencies must be built before dependents
|
|
53
|
+
- Group parallel builds by directory type
|
|
41
54
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
2. Output Format:
|
|
56
|
+
- Group into: packages[], integrations[], deployers[], vector_stores[]
|
|
57
|
+
- Place create-mastra in packages[] array
|
|
58
|
+
- Maintain correct build order within each group
|
|
59
|
+
|
|
60
|
+
3. Critical Rules:
|
|
61
|
+
- Never publish without building first
|
|
62
|
+
- Only include packages that need updates
|
|
63
|
+
- Follow dependency order strictly
|
|
48
64
|
`, {
|
|
49
65
|
output: z.object({
|
|
50
66
|
packages: z.array(z.string()),
|
|
51
67
|
integrations: z.array(z.string()),
|
|
52
68
|
deployers: z.array(z.string()),
|
|
53
|
-
|
|
69
|
+
vector_stores: z.array(z.string()),
|
|
54
70
|
}),
|
|
55
71
|
});
|
|
56
72
|
console.log(resultObj.object);
|
|
@@ -59,7 +75,6 @@ const getPacakgesToPublish = new Step({
|
|
|
59
75
|
integrations: resultObj?.object?.integrations,
|
|
60
76
|
deployers: resultObj?.object?.deployers,
|
|
61
77
|
vector_stores: resultObj?.object?.vector_stores,
|
|
62
|
-
danePackage: resultObj?.object?.danePackage,
|
|
63
78
|
};
|
|
64
79
|
},
|
|
65
80
|
});
|
|
@@ -99,8 +114,8 @@ const assemblePackages = new Step({
|
|
|
99
114
|
if (payload?.vector_stores) {
|
|
100
115
|
payload.vector_stores.forEach((pkg) => {
|
|
101
116
|
let pkgName = pkg.replace('@mastra/vector-', '');
|
|
102
|
-
if (pkgName === '
|
|
103
|
-
pkgName = '
|
|
117
|
+
if (pkgName === 'astra') {
|
|
118
|
+
pkgName = 'astra-db';
|
|
104
119
|
}
|
|
105
120
|
const pkgPath = path.join(process.cwd(), 'vector-stores', pkgName);
|
|
106
121
|
packagesToBuild.add(pkgPath);
|
|
@@ -114,31 +129,6 @@ const assemblePackages = new Step({
|
|
|
114
129
|
packagesToBuild.add(integrationPath);
|
|
115
130
|
});
|
|
116
131
|
}
|
|
117
|
-
if (payload?.danePackage) {
|
|
118
|
-
const danePackage = payload.danePackage;
|
|
119
|
-
let pkgName = danePackage.replace('@mastra/', '');
|
|
120
|
-
const danePackageMapped = path.join(process.cwd(), 'examples', pkgName);
|
|
121
|
-
const pkgJsonPath = readFileSync(path.join(danePackageMapped, 'package.json'), 'utf-8');
|
|
122
|
-
const pkgJson = JSON.parse(pkgJsonPath);
|
|
123
|
-
const dependencies = Object.keys(pkgJson.dependencies || {}).filter((dep) => dep.startsWith('@mastra/'));
|
|
124
|
-
dependencies.forEach((dep) => {
|
|
125
|
-
const pkgName = dep.replace('@mastra/', '');
|
|
126
|
-
const pkgPath = path.join(process.cwd(), 'packages', pkgName);
|
|
127
|
-
const integrationPath = path.join(process.cwd(), 'integrations', pkgName);
|
|
128
|
-
try {
|
|
129
|
-
if (existsSync(pkgPath)) {
|
|
130
|
-
packagesToBuild.add(pkgPath);
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
packagesToBuild.add(integrationPath);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
catch (e) {
|
|
137
|
-
console.error(e);
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
packagesToBuild.add(path.join(process.cwd(), 'examples', 'dane'));
|
|
141
|
-
}
|
|
142
132
|
const pkgSet = Array.from(packagesToBuild.keys());
|
|
143
133
|
if (!packagesToBuild.size) {
|
|
144
134
|
console.error(chalk.red('No packages to build.'));
|
|
@@ -172,17 +162,21 @@ const buildPackages = new Step({
|
|
|
172
162
|
let res = await agent.generate(`
|
|
173
163
|
Here are the packages that need to be built: ${pkgSet.join(',')}.
|
|
174
164
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
165
|
+
Please organize the build order following these strict requirements:
|
|
166
|
+
|
|
167
|
+
1. Core Dependencies (Must be built in this exact order):
|
|
168
|
+
- @mastra/core MUST be built first
|
|
169
|
+
- @mastra/deployer MUST be built second
|
|
170
|
+
- mastra MUST be built third
|
|
179
171
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
172
|
+
2. Parallel Builds (After core dependencies):
|
|
173
|
+
- Build all remaining packages in 'packages' directory in parallel
|
|
174
|
+
- Build all packages in 'integrations' directory in parallel
|
|
175
|
+
- Build all packages in 'deployers' directory in parallel
|
|
176
|
+
- Build all packages in 'vector-stores' directory in parallel
|
|
183
177
|
|
|
184
|
-
|
|
185
|
-
|
|
178
|
+
Note: Do not proceed to the next group until the current group is fully built.
|
|
179
|
+
`);
|
|
186
180
|
console.log(chalk.green(res.text));
|
|
187
181
|
return { packages: pkgSet };
|
|
188
182
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/dane",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.78",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"sqlite3": "^5.1.7",
|
|
40
40
|
"typescript": "^5.5.4",
|
|
41
41
|
"zod": "^3.24.0",
|
|
42
|
-
"@mastra/core": "0.1.27-alpha.69",
|
|
43
42
|
"@mastra/engine": "0.0.5-alpha.63",
|
|
43
|
+
"@mastra/core": "0.1.27-alpha.69",
|
|
44
44
|
"@mastra/github": "1.0.3-alpha.53",
|
|
45
45
|
"@mastra/memory": "0.0.2-alpha.49",
|
|
46
|
-
"@mastra/mcp": "0.0.1-alpha.10",
|
|
47
46
|
"@mastra/stabilityai": "1.0.1-alpha.44",
|
|
47
|
+
"@mastra/firecrawl": "1.0.4-alpha.59",
|
|
48
48
|
"@mastra/rag": "0.0.2-alpha.57",
|
|
49
|
-
"@mastra/
|
|
49
|
+
"@mastra/mcp": "0.0.1-alpha.10"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "npx tsc",
|