@mastra/dane 0.0.2-alpha.80 → 0.0.2-alpha.81
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/dist/mastra/agents/index.d.ts +0 -85
- package/dist/mastra/agents/index.d.ts.map +1 -1
- package/dist/mastra/agents/index.js +0 -64
- package/dist/mastra/agents/package-publisher.d.ts +65 -0
- package/dist/mastra/agents/package-publisher.d.ts.map +1 -0
- package/dist/mastra/agents/package-publisher.js +154 -0
- package/dist/mastra/index.d.ts +5 -30
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +2 -1
- package/dist/mastra/tools/pnpm.d.ts.map +1 -1
- package/dist/mastra/tools/pnpm.js +3 -4
- package/dist/mastra/workflows/publish-packages.d.ts.map +1 -1
- package/dist/mastra/workflows/publish-packages.js +17 -57
- package/package.json +3 -3
|
@@ -1,91 +1,6 @@
|
|
|
1
1
|
import { Agent } from '@mastra/core';
|
|
2
2
|
export declare const daneCommitMessage: Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>, Record<string, import("@mastra/core").Metric>>;
|
|
3
3
|
export declare const daneIssueLabeler: Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>, Record<string, import("@mastra/core").Metric>>;
|
|
4
|
-
export declare const danePackagePublisher: Agent<{
|
|
5
|
-
execaTool: import("@mastra/core").Tool<"execaTool", import("zod").ZodObject<{
|
|
6
|
-
command: import("zod").ZodString;
|
|
7
|
-
args: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
8
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
9
|
-
command: string;
|
|
10
|
-
args: string[];
|
|
11
|
-
}, {
|
|
12
|
-
command: string;
|
|
13
|
-
args: string[];
|
|
14
|
-
}>, import("zod").ZodObject<{
|
|
15
|
-
message: import("zod").ZodString;
|
|
16
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
17
|
-
message: string;
|
|
18
|
-
}, {
|
|
19
|
-
message: string;
|
|
20
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
21
|
-
command: import("zod").ZodString;
|
|
22
|
-
args: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
23
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
24
|
-
command: string;
|
|
25
|
-
args: string[];
|
|
26
|
-
}, {
|
|
27
|
-
command: string;
|
|
28
|
-
args: string[];
|
|
29
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
30
|
-
pnpmBuild: import("@mastra/core").Tool<"pnpmBuild", import("zod").ZodObject<{
|
|
31
|
-
name: import("zod").ZodString;
|
|
32
|
-
packagePath: import("zod").ZodString;
|
|
33
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
34
|
-
name: string;
|
|
35
|
-
packagePath: string;
|
|
36
|
-
}, {
|
|
37
|
-
name: string;
|
|
38
|
-
packagePath: string;
|
|
39
|
-
}>, import("zod").ZodObject<{
|
|
40
|
-
message: import("zod").ZodString;
|
|
41
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
42
|
-
message: string;
|
|
43
|
-
}, {
|
|
44
|
-
message: string;
|
|
45
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
46
|
-
name: import("zod").ZodString;
|
|
47
|
-
packagePath: import("zod").ZodString;
|
|
48
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
49
|
-
name: string;
|
|
50
|
-
packagePath: string;
|
|
51
|
-
}, {
|
|
52
|
-
name: string;
|
|
53
|
-
packagePath: string;
|
|
54
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
55
|
-
pnpmChangesetPublish: import("@mastra/core").Tool<"pnpmChangesetPublish", import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("zod").ZodObject<{
|
|
56
|
-
message: import("zod").ZodString;
|
|
57
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
58
|
-
message: string;
|
|
59
|
-
}, {
|
|
60
|
-
message: string;
|
|
61
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
62
|
-
pnpmChangesetStatus: import("@mastra/core").Tool<"pnpmChangesetStatus", import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("zod").ZodObject<{
|
|
63
|
-
message: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
64
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
65
|
-
message: string[];
|
|
66
|
-
}, {
|
|
67
|
-
message: string[];
|
|
68
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
69
|
-
activeDistTag: import("@mastra/core").Tool<"activeDistTag", import("zod").ZodObject<{
|
|
70
|
-
packagePath: import("zod").ZodString;
|
|
71
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
72
|
-
packagePath: string;
|
|
73
|
-
}, {
|
|
74
|
-
packagePath: string;
|
|
75
|
-
}>, import("zod").ZodObject<{
|
|
76
|
-
message: import("zod").ZodString;
|
|
77
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
78
|
-
message: string;
|
|
79
|
-
}, {
|
|
80
|
-
message: string;
|
|
81
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
82
|
-
packagePath: import("zod").ZodString;
|
|
83
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
84
|
-
packagePath: string;
|
|
85
|
-
}, {
|
|
86
|
-
packagePath: string;
|
|
87
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
88
|
-
}, Record<string, import("@mastra/core").Metric>>;
|
|
89
4
|
export declare const daneLinkChecker: Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>, Record<string, import("@mastra/core").Metric>>;
|
|
90
5
|
export declare const daneChangeLog: Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>, Record<string, import("@mastra/core").Metric>>;
|
|
91
6
|
export declare const dane: Agent<{
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mastra/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAYrC,eAAO,MAAM,iBAAiB,6HAU5B,CAAC;AAEH,eAAO,MAAM,gBAAgB,6HAO3B,CAAC;AAEH,eAAO,MAAM,eAAe,6HAa1B,CAAC;AAEH,eAAO,MAAM,aAAa,6HAcxB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAuDf,CAAC"}
|
|
@@ -6,7 +6,6 @@ import { execaTool } from '../tools/execa.js';
|
|
|
6
6
|
import { fsTool } from '../tools/fs.js';
|
|
7
7
|
import { imageTool } from '../tools/image.js';
|
|
8
8
|
import { readPDF } from '../tools/pdf.js';
|
|
9
|
-
import { activeDistTag, pnpmBuild, pnpmChangesetPublish, pnpmChangesetStatus } from '../tools/pnpm.js';
|
|
10
9
|
import { getBaseModelConfig } from './model.js';
|
|
11
10
|
export const daneCommitMessage = new Agent({
|
|
12
11
|
name: 'DaneCommitMessage',
|
|
@@ -27,69 +26,6 @@ export const daneIssueLabeler = new Agent({
|
|
|
27
26
|
`,
|
|
28
27
|
model: getBaseModelConfig(),
|
|
29
28
|
});
|
|
30
|
-
const packages_llm_text = `
|
|
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
|
|
59
|
-
`;
|
|
60
|
-
export const danePackagePublisher = new Agent({
|
|
61
|
-
name: 'DanePackagePublisher',
|
|
62
|
-
instructions: `
|
|
63
|
-
I am Dane, a specialized agent for managing pnpm package publications in monorepos. My core responsibilities are:
|
|
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:
|
|
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
|
|
83
|
-
`,
|
|
84
|
-
model: getBaseModelConfig(),
|
|
85
|
-
tools: {
|
|
86
|
-
execaTool,
|
|
87
|
-
pnpmBuild,
|
|
88
|
-
pnpmChangesetPublish,
|
|
89
|
-
pnpmChangesetStatus,
|
|
90
|
-
activeDistTag,
|
|
91
|
-
},
|
|
92
|
-
});
|
|
93
29
|
export const daneLinkChecker = new Agent({
|
|
94
30
|
name: 'DaneLinkChecker',
|
|
95
31
|
instructions: `
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Agent } from '@mastra/core';
|
|
2
|
+
export declare const PACKAGES_LIST_PROMPT = "\n Please analyze the following monorepo directories and identify packages that need pnpm publishing:\n CRITICAL: This step is about planning. We do not want to build anything. All packages MUST be placed in the correct order.\n \n Publish Requirements:\n - @mastra/core first, MUST be before any other package\n - all packages in correct dependency order before building\n - Identify packages that have changes requiring a new pnpm publish\n - Include create-mastra in the packages list if changes exist\n - EXCLUDE @mastra/dane from consideration\n\n Please list all packages that need building grouped by their directory. \n DO NOT NOT USE the 'pnpmBuild' tool during this step.\n ";
|
|
3
|
+
export declare const BUILD_PACKAGES_PROMPT: (packages: string[]) => string;
|
|
4
|
+
export declare const PUBLISH_PACKAGES_PROMPT = "\n <publish_changeset>\n <context>\n All packages have been successfully built and verified. Now we need to publish the changeset.\n </context>\n\n <execution_steps>\n <step order=\"1\">\n <action>Use pnpmChangesetPublish to publish all verified packages</action>\n <verification>Ensure the publish command completes successfully</verification>\n </step>\n </execution_steps>\n\n <critical_rules>\n <rule>Do not proceed if any publish errors occur</rule>\n <rule>Report any failed publishes immediately</rule>\n <rule>Ensure all packages are published atomically</rule>\n </critical_rules>\n\n <output_format>\n Report the publish status and any errors encountered.\n </output_format>\n </publish_changeset>\n \n";
|
|
5
|
+
export declare const danePackagePublisher: Agent<{
|
|
6
|
+
pnpmChangesetStatus: import("@mastra/core").Tool<"pnpmChangesetStatus", import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("zod").ZodObject<{
|
|
7
|
+
message: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
8
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
9
|
+
message: string[];
|
|
10
|
+
}, {
|
|
11
|
+
message: string[];
|
|
12
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
13
|
+
pnpmBuild: import("@mastra/core").Tool<"pnpmBuild", import("zod").ZodObject<{
|
|
14
|
+
name: import("zod").ZodString;
|
|
15
|
+
packagePath: import("zod").ZodString;
|
|
16
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
17
|
+
name: string;
|
|
18
|
+
packagePath: string;
|
|
19
|
+
}, {
|
|
20
|
+
name: string;
|
|
21
|
+
packagePath: string;
|
|
22
|
+
}>, import("zod").ZodObject<{
|
|
23
|
+
message: import("zod").ZodString;
|
|
24
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
25
|
+
message: string;
|
|
26
|
+
}, {
|
|
27
|
+
message: string;
|
|
28
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
29
|
+
name: import("zod").ZodString;
|
|
30
|
+
packagePath: import("zod").ZodString;
|
|
31
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
32
|
+
name: string;
|
|
33
|
+
packagePath: string;
|
|
34
|
+
}, {
|
|
35
|
+
name: string;
|
|
36
|
+
packagePath: string;
|
|
37
|
+
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
38
|
+
pnpmChangesetPublish: import("@mastra/core").Tool<"pnpmChangesetPublish", import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("zod").ZodObject<{
|
|
39
|
+
message: import("zod").ZodString;
|
|
40
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
41
|
+
message: string;
|
|
42
|
+
}, {
|
|
43
|
+
message: string;
|
|
44
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
45
|
+
activeDistTag: import("@mastra/core").Tool<"activeDistTag", import("zod").ZodObject<{
|
|
46
|
+
packagePath: import("zod").ZodString;
|
|
47
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
48
|
+
packagePath: string;
|
|
49
|
+
}, {
|
|
50
|
+
packagePath: string;
|
|
51
|
+
}>, import("zod").ZodObject<{
|
|
52
|
+
message: import("zod").ZodString;
|
|
53
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
54
|
+
message: string;
|
|
55
|
+
}, {
|
|
56
|
+
message: string;
|
|
57
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
58
|
+
packagePath: import("zod").ZodString;
|
|
59
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
60
|
+
packagePath: string;
|
|
61
|
+
}, {
|
|
62
|
+
packagePath: string;
|
|
63
|
+
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
64
|
+
}, Record<string, import("@mastra/core").Metric>>;
|
|
65
|
+
//# sourceMappingURL=package-publisher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-publisher.d.ts","sourceRoot":"","sources":["../../../src/mastra/agents/package-publisher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAqCrC,eAAO,MAAM,oBAAoB,iwBAa5B,CAAC;AAEN,eAAO,MAAM,qBAAqB,aAAc,MAAM,EAAE,WAiDvD,CAAC;AAEF,eAAO,MAAM,uBAAuB,u2BAwBnC,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDA+B/B,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { Agent } from '@mastra/core';
|
|
2
|
+
import { pnpmChangesetStatus, pnpmBuild, pnpmChangesetPublish, activeDistTag } from '../tools/pnpm';
|
|
3
|
+
import { getBaseModelConfig } from './model';
|
|
4
|
+
const packages_llm_text = `
|
|
5
|
+
# PACKAGE LOCATION RULES - FOLLOW THESE EXACTLY:
|
|
6
|
+
|
|
7
|
+
## 1. Core packages - all must be directly under packages/:
|
|
8
|
+
@mastra/core -> packages/core
|
|
9
|
+
@mastra/deployer -> packages/deployer
|
|
10
|
+
mastra -> packages/cli
|
|
11
|
+
@mastra/engine -> packages/engine
|
|
12
|
+
@mastra/evals -> packages/evals
|
|
13
|
+
@mastra/rag -> packages/rag
|
|
14
|
+
@mastra/tts -> packages/tts
|
|
15
|
+
@mastra/memory -> packages/memory
|
|
16
|
+
@mastra/mcp -> packages/mcp
|
|
17
|
+
|
|
18
|
+
## 2. Deployer packages - STRICT RULES:
|
|
19
|
+
@mastra/deployer-cloudflare -> deployers/cloudflare
|
|
20
|
+
@mastra/deployer-vercel -> deployers/vercel
|
|
21
|
+
@mastra/deployer-netlify -> deployers/netlify
|
|
22
|
+
- NEVER in any other directory (not in integrations/, examples/, packages/, etc)
|
|
23
|
+
|
|
24
|
+
## 3. Vector store packages - STRICT RULES:
|
|
25
|
+
- ALL vector packages must be directly under vector-stores/
|
|
26
|
+
- Format: @mastra/vector-{name} -> vector-stores/{name}
|
|
27
|
+
- Special case: @mastra/vector-astra -> vector-stores/astra-db
|
|
28
|
+
|
|
29
|
+
##VALIDATION:
|
|
30
|
+
1. Never mix examples/ or integrations/ with package paths
|
|
31
|
+
2. Package paths must exactly match these patterns
|
|
32
|
+
3. No additional subdirectories allowed
|
|
33
|
+
`;
|
|
34
|
+
export const PACKAGES_LIST_PROMPT = `
|
|
35
|
+
Please analyze the following monorepo directories and identify packages that need pnpm publishing:
|
|
36
|
+
CRITICAL: This step is about planning. We do not want to build anything. All packages MUST be placed in the correct order.
|
|
37
|
+
|
|
38
|
+
Publish Requirements:
|
|
39
|
+
- @mastra/core first, MUST be before any other package
|
|
40
|
+
- all packages in correct dependency order before building
|
|
41
|
+
- Identify packages that have changes requiring a new pnpm publish
|
|
42
|
+
- Include create-mastra in the packages list if changes exist
|
|
43
|
+
- EXCLUDE @mastra/dane from consideration
|
|
44
|
+
|
|
45
|
+
Please list all packages that need building grouped by their directory.
|
|
46
|
+
DO NOT NOT USE the 'pnpmBuild' tool during this step.
|
|
47
|
+
`;
|
|
48
|
+
export const BUILD_PACKAGES_PROMPT = (packages) => `
|
|
49
|
+
<build_execution>
|
|
50
|
+
<context>
|
|
51
|
+
The following packages need to be built in sequence: ${packages.join(', ')}
|
|
52
|
+
</context>
|
|
53
|
+
|
|
54
|
+
<execution_plan>
|
|
55
|
+
<phase order="1">
|
|
56
|
+
<!-- Core packages must be built one at a time in this exact order -->
|
|
57
|
+
<step>Use pnpmBuild to build @mastra/core</step>
|
|
58
|
+
<step>Wait for completion, then use pnpmBuild to build @mastra/deployer</step>
|
|
59
|
+
<step>Wait for completion, then use pnpmBuild to build mastra</step>
|
|
60
|
+
</phase>
|
|
61
|
+
|
|
62
|
+
<phase order="2">
|
|
63
|
+
<!-- After core packages, build remaining packages by directory -->
|
|
64
|
+
<parallel_phase name="packages">
|
|
65
|
+
<description>Build remaining packages/ directory packages</description>
|
|
66
|
+
<action>Use pnpmBuild for each remaining @mastra/* package</action>
|
|
67
|
+
</parallel_phase>
|
|
68
|
+
|
|
69
|
+
<parallel_phase name="integrations">
|
|
70
|
+
<description>Build integrations/ directory packages</description>
|
|
71
|
+
<action>Use pnpmBuild for each @mastra/integration-* package</action>
|
|
72
|
+
</parallel_phase>
|
|
73
|
+
|
|
74
|
+
<parallel_phase name="deployers">
|
|
75
|
+
<description>Build deployers/ directory packages</description>
|
|
76
|
+
<action>Use pnpmBuild for each @mastra/deployer-* package</action>
|
|
77
|
+
</parallel_phase>
|
|
78
|
+
|
|
79
|
+
<parallel_phase name="vector-stores">
|
|
80
|
+
<description>Build vector-stores/ directory packages</description>
|
|
81
|
+
<action>Use pnpmBuild for each @mastra/vector-* package</action>
|
|
82
|
+
</parallel_phase>
|
|
83
|
+
</phase>
|
|
84
|
+
</execution_plan>
|
|
85
|
+
|
|
86
|
+
<critical_rules>
|
|
87
|
+
<rule>Use pnpmBuild tool for each package</rule>
|
|
88
|
+
<rule>Wait for each core package to complete before starting the next</rule>
|
|
89
|
+
<rule>Only start parallel builds after ALL core packages are built</rule>
|
|
90
|
+
<rule>Verify each build succeeds before proceeding</rule>
|
|
91
|
+
</critical_rules>
|
|
92
|
+
|
|
93
|
+
<output_format>
|
|
94
|
+
Execute the builds in order and report any failures immediately.
|
|
95
|
+
</output_format>
|
|
96
|
+
</build_execution>
|
|
97
|
+
`;
|
|
98
|
+
export const PUBLISH_PACKAGES_PROMPT = `
|
|
99
|
+
<publish_changeset>
|
|
100
|
+
<context>
|
|
101
|
+
All packages have been successfully built and verified. Now we need to publish the changeset.
|
|
102
|
+
</context>
|
|
103
|
+
|
|
104
|
+
<execution_steps>
|
|
105
|
+
<step order="1">
|
|
106
|
+
<action>Use pnpmChangesetPublish to publish all verified packages</action>
|
|
107
|
+
<verification>Ensure the publish command completes successfully</verification>
|
|
108
|
+
</step>
|
|
109
|
+
</execution_steps>
|
|
110
|
+
|
|
111
|
+
<critical_rules>
|
|
112
|
+
<rule>Do not proceed if any publish errors occur</rule>
|
|
113
|
+
<rule>Report any failed publishes immediately</rule>
|
|
114
|
+
<rule>Ensure all packages are published atomically</rule>
|
|
115
|
+
</critical_rules>
|
|
116
|
+
|
|
117
|
+
<output_format>
|
|
118
|
+
Report the publish status and any errors encountered.
|
|
119
|
+
</output_format>
|
|
120
|
+
</publish_changeset>
|
|
121
|
+
|
|
122
|
+
`;
|
|
123
|
+
export const danePackagePublisher = new Agent({
|
|
124
|
+
name: 'DanePackagePublisher',
|
|
125
|
+
instructions: `
|
|
126
|
+
I am Dane, a specialized agent for managing pnpm package publications in monorepos. My core responsibilities are:
|
|
127
|
+
|
|
128
|
+
1. Package Analysis:
|
|
129
|
+
- Identify packages requiring publication across the monorepo
|
|
130
|
+
- Detect changes that warrant new version releases
|
|
131
|
+
- Validate package dependencies and versioning
|
|
132
|
+
|
|
133
|
+
2. Publication Management:
|
|
134
|
+
- Orchestrate the correct build order for interdependent packages
|
|
135
|
+
- Ensure proper versioning using changesets
|
|
136
|
+
- Maintain package publishing standards
|
|
137
|
+
|
|
138
|
+
3. Directory Structure Knowledge:
|
|
139
|
+
${packages_llm_text}
|
|
140
|
+
|
|
141
|
+
Important Guidelines:
|
|
142
|
+
- Always respect package dependencies when determining build order
|
|
143
|
+
- Ensure all necessary builds complete before publishing
|
|
144
|
+
- Follow semantic versioning principles
|
|
145
|
+
- Validate package.json configurations before publishing
|
|
146
|
+
`,
|
|
147
|
+
model: getBaseModelConfig(),
|
|
148
|
+
tools: {
|
|
149
|
+
pnpmChangesetStatus,
|
|
150
|
+
pnpmBuild,
|
|
151
|
+
pnpmChangesetPublish,
|
|
152
|
+
activeDistTag,
|
|
153
|
+
},
|
|
154
|
+
});
|
package/dist/mastra/index.d.ts
CHANGED
|
@@ -196,31 +196,13 @@ export declare const mastra: Mastra<{
|
|
|
196
196
|
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
197
197
|
}, Record<string, import("@mastra/core").Metric>>;
|
|
198
198
|
danePackagePublisher: import("@mastra/core").Agent<{
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
args: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
202
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
203
|
-
command: string;
|
|
204
|
-
args: string[];
|
|
205
|
-
}, {
|
|
206
|
-
command: string;
|
|
207
|
-
args: string[];
|
|
208
|
-
}>, import("zod").ZodObject<{
|
|
209
|
-
message: import("zod").ZodString;
|
|
210
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
211
|
-
message: string;
|
|
212
|
-
}, {
|
|
213
|
-
message: string;
|
|
214
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
215
|
-
command: import("zod").ZodString;
|
|
216
|
-
args: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
199
|
+
pnpmChangesetStatus: import("@mastra/core").Tool<"pnpmChangesetStatus", import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("zod").ZodObject<{
|
|
200
|
+
message: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
217
201
|
}, "strip", import("zod").ZodTypeAny, {
|
|
218
|
-
|
|
219
|
-
args: string[];
|
|
202
|
+
message: string[];
|
|
220
203
|
}, {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
204
|
+
message: string[];
|
|
205
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
224
206
|
pnpmBuild: import("@mastra/core").Tool<"pnpmBuild", import("zod").ZodObject<{
|
|
225
207
|
name: import("zod").ZodString;
|
|
226
208
|
packagePath: import("zod").ZodString;
|
|
@@ -253,13 +235,6 @@ export declare const mastra: Mastra<{
|
|
|
253
235
|
}, {
|
|
254
236
|
message: string;
|
|
255
237
|
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
256
|
-
pnpmChangesetStatus: import("@mastra/core").Tool<"pnpmChangesetStatus", import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("zod").ZodObject<{
|
|
257
|
-
message: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
258
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
259
|
-
message: string[];
|
|
260
|
-
}, {
|
|
261
|
-
message: string[];
|
|
262
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
263
238
|
activeDistTag: import("@mastra/core").Tool<"activeDistTag", import("zod").ZodObject<{
|
|
264
239
|
packagePath: import("zod").ZodString;
|
|
265
240
|
}, "strip", import("zod").ZodTypeAny, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mastra/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mastra/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAmBtC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wIA6BjB,CAAC"}
|
package/dist/mastra/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Mastra } from '@mastra/core';
|
|
2
2
|
import { PostgresEngine } from '@mastra/engine';
|
|
3
3
|
import { UpstashKVMemory } from '@mastra/memory';
|
|
4
|
-
import { dane, daneChangeLog, daneCommitMessage, daneIssueLabeler, daneLinkChecker
|
|
4
|
+
import { dane, daneChangeLog, daneCommitMessage, daneIssueLabeler, daneLinkChecker } from './agents/index.js';
|
|
5
5
|
import { daneNewContributor } from './agents/new-contributor.js';
|
|
6
|
+
import { danePackagePublisher } from './agents/package-publisher.js';
|
|
6
7
|
import { firecrawl } from './integrations/index.js';
|
|
7
8
|
import { changelogWorkflow } from './workflows/changelog.js';
|
|
8
9
|
import { githubFirstContributorMessage } from './workflows/first-contributor.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pnpm.d.ts","sourceRoot":"","sources":["../../../src/mastra/tools/pnpm.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;iDA8BpB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;
|
|
1
|
+
{"version":3,"file":"pnpm.d.ts","sourceRoot":"","sources":["../../../src/mastra/tools/pnpm.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;iDA8BpB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;6IA6B9B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;6IA0B/B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;iDA8BxB,CAAC"}
|
|
@@ -46,11 +46,10 @@ export const pnpmChangesetStatus = createTool({
|
|
|
46
46
|
}),
|
|
47
47
|
execute: async () => {
|
|
48
48
|
try {
|
|
49
|
-
console.log(
|
|
49
|
+
console.log(chalk.green(`\nRunning command: pnpm publish -r --dry-run --no-git-checks`));
|
|
50
50
|
const { stdout } = await execa('pnpm', ['publish', '-r', '--dry-run', '--no-git-checks'], {
|
|
51
51
|
all: true,
|
|
52
52
|
// We want to see stderr too since pnpm sometimes puts important info there
|
|
53
|
-
stderr: 'inherit',
|
|
54
53
|
});
|
|
55
54
|
const lines = stdout.split('\n');
|
|
56
55
|
const filteredLines = lines.filter(line => line.startsWith('+'));
|
|
@@ -96,8 +95,8 @@ export const pnpmChangesetPublish = createTool({
|
|
|
96
95
|
});
|
|
97
96
|
export const activeDistTag = createTool({
|
|
98
97
|
id: 'activeDistTag',
|
|
99
|
-
name: 'PNPM
|
|
100
|
-
description: '
|
|
98
|
+
name: 'PNPM Active Dist Tag Tool',
|
|
99
|
+
description: 'Set active dist tag on pnpm module',
|
|
101
100
|
inputSchema: z.object({
|
|
102
101
|
packagePath: z.string(),
|
|
103
102
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-packages.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/publish-packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"publish-packages.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/publish-packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,cAAc,CAAC;AAQ9C,eAAO,MAAM,gBAAgB,oBAE3B,CAAC"}
|
|
@@ -3,6 +3,7 @@ import chalk from 'chalk';
|
|
|
3
3
|
import { existsSync } from 'fs';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
+
import { BUILD_PACKAGES_PROMPT, PACKAGES_LIST_PROMPT, PUBLISH_PACKAGES_PROMPT } from '../agents/package-publisher';
|
|
6
7
|
export const packagePublisher = new Workflow({
|
|
7
8
|
name: 'pnpm-changset-publisher',
|
|
8
9
|
});
|
|
@@ -19,44 +20,22 @@ const getPacakgesToPublish = new Step({
|
|
|
19
20
|
if (!agent) {
|
|
20
21
|
throw new Error('Agent not found');
|
|
21
22
|
}
|
|
22
|
-
const result = await agent.generate(
|
|
23
|
-
|
|
24
|
-
|
|
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.
|
|
43
|
-
`);
|
|
23
|
+
const result = await agent.generate(PACKAGES_LIST_PROMPT);
|
|
24
|
+
console.log(chalk.green(`\n${result.text}`));
|
|
44
25
|
const resultObj = await agent.generate(`
|
|
45
|
-
Please
|
|
26
|
+
Please convert this into a structured object:
|
|
46
27
|
|
|
47
28
|
Input Text: ${result.text}
|
|
48
29
|
|
|
49
|
-
1.
|
|
50
|
-
-
|
|
51
|
-
- @mastra/
|
|
52
|
-
- @mastra/deployer MUST be built second
|
|
53
|
-
- Dependencies must be built before dependents
|
|
30
|
+
1. Order Requirements:
|
|
31
|
+
- @mastra/core MUST be first within packages
|
|
32
|
+
- @mastra/deployer MUST be second within packages
|
|
54
33
|
- Group parallel builds by directory type
|
|
55
34
|
|
|
56
35
|
2. Output Format:
|
|
57
36
|
- Group into: packages[], integrations[], deployers[], vector_stores[]
|
|
58
37
|
- Place create-mastra in packages[] array
|
|
59
|
-
- Maintain correct
|
|
38
|
+
- Maintain correct order within each group
|
|
60
39
|
|
|
61
40
|
3. Critical Rules:
|
|
62
41
|
- Never publish without building first
|
|
@@ -70,7 +49,6 @@ const getPacakgesToPublish = new Step({
|
|
|
70
49
|
vector_stores: z.array(z.string()),
|
|
71
50
|
}),
|
|
72
51
|
});
|
|
73
|
-
console.log(resultObj.object);
|
|
74
52
|
return {
|
|
75
53
|
packages: resultObj?.object?.packages,
|
|
76
54
|
integrations: resultObj?.object?.integrations,
|
|
@@ -137,6 +115,10 @@ const assemblePackages = new Step({
|
|
|
137
115
|
packages: [],
|
|
138
116
|
};
|
|
139
117
|
}
|
|
118
|
+
console.log(chalk.green(`\nBuilding packages:\n`));
|
|
119
|
+
pkgSet.forEach((pkg) => {
|
|
120
|
+
console.log(chalk.green(pkg));
|
|
121
|
+
});
|
|
140
122
|
return { packages: pkgSet };
|
|
141
123
|
},
|
|
142
124
|
});
|
|
@@ -156,28 +138,7 @@ const buildPackages = new Step({
|
|
|
156
138
|
if (!agent) {
|
|
157
139
|
throw new Error('Agent not found');
|
|
158
140
|
}
|
|
159
|
-
|
|
160
|
-
pkgSet.forEach((pkg) => {
|
|
161
|
-
console.log(chalk.green(pkg));
|
|
162
|
-
});
|
|
163
|
-
let res = await agent.generate(`
|
|
164
|
-
Here are the packages that need to be built: ${pkgSet.join(',')}.
|
|
165
|
-
|
|
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
|
|
172
|
-
|
|
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
|
|
178
|
-
|
|
179
|
-
Note: Do not proceed to the next group until the current group is fully built.
|
|
180
|
-
`);
|
|
141
|
+
let res = await agent.generate(BUILD_PACKAGES_PROMPT(pkgSet));
|
|
181
142
|
console.log(chalk.green(res.text));
|
|
182
143
|
return { packages: pkgSet };
|
|
183
144
|
},
|
|
@@ -193,6 +154,7 @@ const verifyBuild = new Step({
|
|
|
193
154
|
packages: [],
|
|
194
155
|
};
|
|
195
156
|
}
|
|
157
|
+
console.log('Verifying the output for:', context.machineContext.stepResults.buildPackages.payload.packages);
|
|
196
158
|
const pkgSet = context.machineContext.stepResults.buildPackages.payload.packages;
|
|
197
159
|
for (const pkg of pkgSet) {
|
|
198
160
|
if (!existsSync(`${pkg}/dist`)) {
|
|
@@ -200,7 +162,6 @@ const verifyBuild = new Step({
|
|
|
200
162
|
throw new Error(`Failed to build ${pkg}.`);
|
|
201
163
|
}
|
|
202
164
|
}
|
|
203
|
-
console.log(pkgSet);
|
|
204
165
|
return {
|
|
205
166
|
packages: pkgSet,
|
|
206
167
|
};
|
|
@@ -222,9 +183,7 @@ const publishChangeset = new Step({
|
|
|
222
183
|
if (!agent) {
|
|
223
184
|
throw new Error('Agent not found');
|
|
224
185
|
}
|
|
225
|
-
|
|
226
|
-
Publish the changeset.
|
|
227
|
-
`);
|
|
186
|
+
const res = await agent.generate(PUBLISH_PACKAGES_PROMPT);
|
|
228
187
|
console.log(chalk.green(res.text));
|
|
229
188
|
return { packages: pkgSet };
|
|
230
189
|
},
|
|
@@ -267,7 +226,8 @@ packagePublisher
|
|
|
267
226
|
context.stepResults.buildPackages?.payload?.packages.length > 0);
|
|
268
227
|
},
|
|
269
228
|
})
|
|
270
|
-
.
|
|
229
|
+
.after(verifyBuild)
|
|
230
|
+
.step(publishChangeset, {
|
|
271
231
|
when: async ({ context }) => {
|
|
272
232
|
return (context.stepResults.buildPackages?.status === 'success' &&
|
|
273
233
|
context.stepResults.buildPackages?.payload?.packages.length > 0);
|
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.81",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"zod": "^3.24.0",
|
|
42
42
|
"@mastra/core": "0.1.27-alpha.70",
|
|
43
43
|
"@mastra/firecrawl": "1.0.4-alpha.61",
|
|
44
|
-
"@mastra/
|
|
44
|
+
"@mastra/memory": "0.0.2-alpha.51",
|
|
45
45
|
"@mastra/github": "1.0.3-alpha.54",
|
|
46
|
+
"@mastra/engine": "0.0.5-alpha.65",
|
|
46
47
|
"@mastra/rag": "0.0.2-alpha.59",
|
|
47
48
|
"@mastra/stabilityai": "1.0.1-alpha.45",
|
|
48
|
-
"@mastra/memory": "0.0.2-alpha.51",
|
|
49
49
|
"@mastra/mcp": "0.0.1-alpha.12"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|