@mastra/dane 0.0.2-alpha.77 → 0.0.2-alpha.79
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;
|
|
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;AAiCH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAgC/B,CAAC;AAEH,eAAO,MAAM,eAAe,6HAa1B,CAAC;AAEH,eAAO,MAAM,aAAa,6HAcxB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAuDf,CAAC"}
|
|
@@ -28,26 +28,58 @@ export const daneIssueLabeler = new Agent({
|
|
|
28
28
|
model: getBaseModelConfig(),
|
|
29
29
|
});
|
|
30
30
|
const packages_llm_text = `
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
@mastra/
|
|
35
|
-
@mastra/
|
|
36
|
-
|
|
37
|
-
@mastra/
|
|
38
|
-
@mastra/
|
|
39
|
-
@mastra/
|
|
40
|
-
@mastra/
|
|
41
|
-
@mastra/
|
|
42
|
-
|
|
31
|
+
// PACKAGE LOCATION RULES - FOLLOW THESE EXACTLY:
|
|
32
|
+
|
|
33
|
+
// 1. Core packages - all must be directly under packages/:
|
|
34
|
+
@mastra/core -> packages/core
|
|
35
|
+
@mastra/deployer -> packages/deployer
|
|
36
|
+
mastra -> packages/cli
|
|
37
|
+
@mastra/engine -> packages/engine
|
|
38
|
+
@mastra/evals -> packages/evals
|
|
39
|
+
@mastra/rag -> packages/rag
|
|
40
|
+
@mastra/tts -> packages/tts
|
|
41
|
+
@mastra/memory -> packages/memory
|
|
42
|
+
@mastra/mcp -> packages/mcp
|
|
43
|
+
|
|
44
|
+
// 2. Deployer packages - STRICT RULES:
|
|
45
|
+
// - ALL deployer packages must be directly under deployers/
|
|
46
|
+
// - Format: @mastra/deployer-{name} -> deployers/{name}
|
|
47
|
+
// - Example: @mastra/deployer-cloudflare -> deployers/cloudflare
|
|
48
|
+
// - NEVER in any other directory (not in integrations/, examples/, packages/, etc)
|
|
49
|
+
|
|
50
|
+
// 3. Vector store packages - STRICT RULES:
|
|
51
|
+
// - ALL vector packages must be directly under vector-stores/
|
|
52
|
+
// - Format: @mastra/vector-{name} -> vector-stores/{name}
|
|
53
|
+
// - Special case: @mastra/vector-astra -> vector-stores/astra-db
|
|
54
|
+
|
|
55
|
+
// VALIDATION:
|
|
56
|
+
// 1. Never mix examples/ or integrations/ with package paths
|
|
57
|
+
// 2. Package paths must exactly match these patterns
|
|
58
|
+
// 3. No additional subdirectories allowed
|
|
43
59
|
`;
|
|
44
60
|
export const danePackagePublisher = new Agent({
|
|
45
61
|
name: 'DanePackagePublisher',
|
|
46
62
|
instructions: `
|
|
47
|
-
|
|
48
|
-
You help engineers publish their pnpm changesets.
|
|
63
|
+
I am Dane, a specialized agent for managing pnpm package publications in monorepos. My core responsibilities are:
|
|
49
64
|
|
|
65
|
+
1. Package Analysis:
|
|
66
|
+
- Identify packages requiring publication across the monorepo
|
|
67
|
+
- Detect changes that warrant new version releases
|
|
68
|
+
- Validate package dependencies and versioning
|
|
69
|
+
|
|
70
|
+
2. Publication Management:
|
|
71
|
+
- Orchestrate the correct build order for interdependent packages
|
|
72
|
+
- Ensure proper versioning using changesets
|
|
73
|
+
- Maintain package publishing standards
|
|
74
|
+
|
|
75
|
+
3. Directory Structure Knowledge:
|
|
50
76
|
${packages_llm_text}
|
|
77
|
+
|
|
78
|
+
Important Guidelines:
|
|
79
|
+
- Always respect package dependencies when determining build order
|
|
80
|
+
- Ensure all necessary builds complete before publishing
|
|
81
|
+
- Follow semantic versioning principles
|
|
82
|
+
- Validate package.json configurations before publishing
|
|
51
83
|
`,
|
|
52
84
|
model: getBaseModelConfig(),
|
|
53
85
|
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,54 @@ 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
|
-
|
|
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
|
+
- @mastra/deployer MUST be built second
|
|
53
|
+
- Dependencies must be built before dependents
|
|
54
|
+
- Group parallel builds by directory type
|
|
41
55
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
56
|
+
2. Output Format:
|
|
57
|
+
- Group into: packages[], integrations[], deployers[], vector_stores[]
|
|
58
|
+
- Place create-mastra in packages[] array
|
|
59
|
+
- Maintain correct build order within each group
|
|
60
|
+
|
|
61
|
+
3. Critical Rules:
|
|
62
|
+
- Never publish without building first
|
|
63
|
+
- Only include packages that need updates
|
|
64
|
+
- Follow dependency order strictly
|
|
48
65
|
`, {
|
|
49
66
|
output: z.object({
|
|
50
67
|
packages: z.array(z.string()),
|
|
51
68
|
integrations: z.array(z.string()),
|
|
52
69
|
deployers: z.array(z.string()),
|
|
53
|
-
|
|
70
|
+
vector_stores: z.array(z.string()),
|
|
54
71
|
}),
|
|
55
72
|
});
|
|
56
73
|
console.log(resultObj.object);
|
|
@@ -59,7 +76,6 @@ const getPacakgesToPublish = new Step({
|
|
|
59
76
|
integrations: resultObj?.object?.integrations,
|
|
60
77
|
deployers: resultObj?.object?.deployers,
|
|
61
78
|
vector_stores: resultObj?.object?.vector_stores,
|
|
62
|
-
danePackage: resultObj?.object?.danePackage,
|
|
63
79
|
};
|
|
64
80
|
},
|
|
65
81
|
});
|
|
@@ -99,8 +115,8 @@ const assemblePackages = new Step({
|
|
|
99
115
|
if (payload?.vector_stores) {
|
|
100
116
|
payload.vector_stores.forEach((pkg) => {
|
|
101
117
|
let pkgName = pkg.replace('@mastra/vector-', '');
|
|
102
|
-
if (pkgName === '
|
|
103
|
-
pkgName = '
|
|
118
|
+
if (pkgName === 'astra') {
|
|
119
|
+
pkgName = 'astra-db';
|
|
104
120
|
}
|
|
105
121
|
const pkgPath = path.join(process.cwd(), 'vector-stores', pkgName);
|
|
106
122
|
packagesToBuild.add(pkgPath);
|
|
@@ -114,31 +130,6 @@ const assemblePackages = new Step({
|
|
|
114
130
|
packagesToBuild.add(integrationPath);
|
|
115
131
|
});
|
|
116
132
|
}
|
|
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
133
|
const pkgSet = Array.from(packagesToBuild.keys());
|
|
143
134
|
if (!packagesToBuild.size) {
|
|
144
135
|
console.error(chalk.red('No packages to build.'));
|
|
@@ -172,17 +163,21 @@ const buildPackages = new Step({
|
|
|
172
163
|
let res = await agent.generate(`
|
|
173
164
|
Here are the packages that need to be built: ${pkgSet.join(',')}.
|
|
174
165
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
166
|
+
Please organize the build order following these strict requirements:
|
|
167
|
+
|
|
168
|
+
1. Core Dependencies (Must be built in this exact order):
|
|
169
|
+
- @mastra/core MUST be built first
|
|
170
|
+
- @mastra/deployer MUST be built second
|
|
171
|
+
- mastra MUST be built third
|
|
179
172
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
173
|
+
2. Parallel Builds (After core dependencies):
|
|
174
|
+
- Build all remaining packages in 'packages' directory in parallel
|
|
175
|
+
- Build all packages in 'integrations' directory in parallel
|
|
176
|
+
- Build all packages in 'deployers' directory in parallel
|
|
177
|
+
- Build all packages in 'vector-stores' directory in parallel
|
|
183
178
|
|
|
184
|
-
|
|
185
|
-
|
|
179
|
+
Note: Do not proceed to the next group until the current group is fully built.
|
|
180
|
+
`);
|
|
186
181
|
console.log(chalk.green(res.text));
|
|
187
182
|
return { packages: pkgSet };
|
|
188
183
|
},
|
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.79",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"zod": "^3.24.0",
|
|
42
42
|
"@mastra/core": "0.1.27-alpha.69",
|
|
43
43
|
"@mastra/engine": "0.0.5-alpha.63",
|
|
44
|
-
"@mastra/
|
|
44
|
+
"@mastra/firecrawl": "1.0.4-alpha.59",
|
|
45
45
|
"@mastra/memory": "0.0.2-alpha.49",
|
|
46
|
-
"@mastra/
|
|
47
|
-
"@mastra/stabilityai": "1.0.1-alpha.44",
|
|
46
|
+
"@mastra/github": "1.0.3-alpha.53",
|
|
48
47
|
"@mastra/rag": "0.0.2-alpha.57",
|
|
49
|
-
"@mastra/
|
|
48
|
+
"@mastra/stabilityai": "1.0.1-alpha.44",
|
|
49
|
+
"@mastra/mcp": "0.0.1-alpha.10"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "npx tsc",
|