@mastra/dane 0.0.2-alpha.6 → 0.0.2-alpha.61
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/LICENSE +44 -0
- package/README.md +25 -4
- package/data/crawl/conventional-commit.json +25 -0
- package/dist/commands/changelog.d.ts +2 -0
- package/dist/commands/changelog.d.ts.map +1 -0
- package/dist/commands/changelog.js +15 -0
- package/dist/commands/commit-message.d.ts +2 -0
- package/dist/commands/commit-message.d.ts.map +1 -0
- package/dist/commands/commit-message.js +32 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +40 -0
- package/dist/commands/issue-labeler.d.ts.map +1 -1
- package/dist/commands/issue-labeler.js +19 -2
- package/dist/commands/message.d.ts.map +1 -1
- package/dist/commands/message.js +3 -1
- package/dist/commands/publish-packages.d.ts +2 -0
- package/dist/commands/publish-packages.d.ts.map +1 -0
- package/dist/commands/publish-packages.js +11 -0
- package/dist/commands/telephone-game.d.ts +2 -0
- package/dist/commands/telephone-game.d.ts.map +1 -0
- package/dist/commands/telephone-game.js +32 -0
- package/dist/config/index.d.ts +12 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +75 -0
- package/dist/index.js +20 -2
- package/dist/mastra/agents/index.d.ts +115 -0
- package/dist/mastra/agents/index.d.ts.map +1 -1
- package/dist/mastra/agents/index.js +69 -24
- package/dist/mastra/index.d.ts +132 -1
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +12 -3
- package/dist/mastra/integrations/index.d.ts +2 -0
- package/dist/mastra/integrations/index.d.ts.map +1 -1
- package/dist/mastra/integrations/index.js +19 -2
- package/dist/mastra/tools/crawl.d.ts +3 -0
- package/dist/mastra/tools/crawl.d.ts.map +1 -1
- package/dist/mastra/tools/crawl.js +4 -2
- package/dist/mastra/tools/execa.d.ts.map +1 -1
- package/dist/mastra/tools/execa.js +5 -1
- package/dist/mastra/tools/image.d.ts +27 -0
- package/dist/mastra/tools/image.d.ts.map +1 -0
- package/dist/mastra/tools/image.js +37 -0
- package/dist/mastra/tools/mcp.d.ts +3 -0
- package/dist/mastra/tools/mcp.d.ts.map +1 -0
- package/dist/mastra/tools/mcp.js +12 -0
- package/dist/mastra/tools/pdf.d.ts.map +1 -1
- package/dist/mastra/tools/pdf.js +3 -2
- package/dist/mastra/tools/pnpm.d.ts +60 -0
- package/dist/mastra/tools/pnpm.d.ts.map +1 -0
- package/dist/mastra/tools/pnpm.js +128 -0
- package/dist/mastra/workflows/changelog.d.ts +10 -0
- package/dist/mastra/workflows/changelog.d.ts.map +1 -0
- package/dist/mastra/workflows/changelog.js +149 -0
- package/dist/mastra/workflows/chat.d.ts.map +1 -1
- package/dist/mastra/workflows/chat.js +6 -11
- package/dist/mastra/workflows/commit-message.d.ts +10 -0
- package/dist/mastra/workflows/commit-message.d.ts.map +1 -0
- package/dist/mastra/workflows/commit-message.js +138 -0
- package/dist/mastra/workflows/index.d.ts +1 -0
- package/dist/mastra/workflows/index.d.ts.map +1 -1
- package/dist/mastra/workflows/index.js +1 -0
- package/dist/mastra/workflows/issue-labeler.js +1 -1
- package/dist/mastra/workflows/publish-packages.d.ts +3 -0
- package/dist/mastra/workflows/publish-packages.d.ts.map +1 -0
- package/dist/mastra/workflows/publish-packages.js +205 -0
- package/dist/mastra/workflows/telephone-game.d.ts +3 -0
- package/dist/mastra/workflows/telephone-game.d.ts.map +1 -0
- package/dist/mastra/workflows/telephone-game.js +95 -0
- package/package.json +16 -10
- package/test/data/05-versions-space.pdf +0 -0
- package/test/data/05-versions-space.pdf.txt +42 -0
- package/test-files/716a95a5c57a56d32a32b1c9592d6df0.png +0 -0
- package/test-files/roman.md +79 -0
- package/test-files/sample-1.pdf +0 -0
- package/test-files/taxes/2022.txt +45 -0
- package/test-files/taxes/2023.txt +44 -0
package/dist/index.js
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
process.env.NODE_NO_WARNINGS = '1';
|
|
3
2
|
import { Command } from 'commander';
|
|
3
|
+
import dotenv from 'dotenv';
|
|
4
|
+
import { changelog } from './commands/changelog.js';
|
|
5
|
+
import { commitMessageCommand } from './commands/commit-message.js';
|
|
6
|
+
import { configCommand } from './commands/config.js';
|
|
4
7
|
import { issueLabelerCommand } from './commands/issue-labeler.js';
|
|
5
8
|
import { message } from './commands/message.js';
|
|
9
|
+
import { publishPackages } from './commands/publish-packages.js';
|
|
10
|
+
import { telephone } from './commands/telephone-game.js';
|
|
11
|
+
dotenv.config();
|
|
12
|
+
process.env.NODE_NO_WARNINGS = '1';
|
|
6
13
|
const program = new Command();
|
|
7
14
|
program.command('chat').action(message);
|
|
8
|
-
program
|
|
15
|
+
program
|
|
16
|
+
.command('issue-labeler')
|
|
17
|
+
.description('Automatically label GitHub issues based on their content and context')
|
|
18
|
+
.action(issueLabelerCommand);
|
|
19
|
+
program
|
|
20
|
+
.command('commit')
|
|
21
|
+
.description('Create a sensible commit message based on the changes made')
|
|
22
|
+
.action(commitMessageCommand);
|
|
23
|
+
program.addCommand(configCommand);
|
|
24
|
+
program.command('publish').description('Publish packages to the registry').action(publishPackages);
|
|
25
|
+
program.command('telephone-game').description('Play a classic game of telephone').action(telephone);
|
|
26
|
+
program.command('changelog').description('Mastra Changelog').action(changelog);
|
|
9
27
|
program.parse(process.argv);
|
|
@@ -1,5 +1,92 @@
|
|
|
1
1
|
import { Agent } from '@mastra/core';
|
|
2
|
+
export declare const daneCommitMessage: Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>>;
|
|
2
3
|
export declare const daneIssueLabeler: Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>>;
|
|
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
|
+
}>;
|
|
89
|
+
export declare const daneChangeLog: Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>>;
|
|
3
90
|
export declare const dane: Agent<{
|
|
4
91
|
fsTool: import("@mastra/core").Tool<"fsTool", import("zod").ZodObject<{
|
|
5
92
|
action: import("zod").ZodString;
|
|
@@ -147,10 +234,13 @@ export declare const dane: Agent<{
|
|
|
147
234
|
limit?: number | undefined;
|
|
148
235
|
}>, import("zod").ZodObject<{
|
|
149
236
|
message: import("zod").ZodString;
|
|
237
|
+
crawlData: import("zod").ZodAny;
|
|
150
238
|
}, "strip", import("zod").ZodTypeAny, {
|
|
151
239
|
message: string;
|
|
240
|
+
crawlData?: any;
|
|
152
241
|
}, {
|
|
153
242
|
message: string;
|
|
243
|
+
crawlData?: any;
|
|
154
244
|
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
155
245
|
url: import("zod").ZodString;
|
|
156
246
|
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
@@ -164,5 +254,30 @@ export declare const dane: Agent<{
|
|
|
164
254
|
pathRegex: string | null;
|
|
165
255
|
limit?: number | undefined;
|
|
166
256
|
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
257
|
+
imageTool: import("@mastra/core").Tool<"imageTool", import("zod").ZodObject<{
|
|
258
|
+
directory: import("zod").ZodString;
|
|
259
|
+
prompt: import("zod").ZodString;
|
|
260
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
261
|
+
directory: string;
|
|
262
|
+
prompt: string;
|
|
263
|
+
}, {
|
|
264
|
+
directory: string;
|
|
265
|
+
prompt: string;
|
|
266
|
+
}>, import("zod").ZodObject<{
|
|
267
|
+
message: import("zod").ZodString;
|
|
268
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
269
|
+
message: string;
|
|
270
|
+
}, {
|
|
271
|
+
message: string;
|
|
272
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
273
|
+
directory: import("zod").ZodString;
|
|
274
|
+
prompt: import("zod").ZodString;
|
|
275
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
276
|
+
directory: string;
|
|
277
|
+
prompt: string;
|
|
278
|
+
}, {
|
|
279
|
+
directory: string;
|
|
280
|
+
prompt: string;
|
|
281
|
+
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
167
282
|
}>;
|
|
168
283
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;AAmBrC,eAAO,MAAM,iBAAiB,8EAU5B,CAAC;AAEH,eAAO,MAAM,gBAAgB,8EAO3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc/B,CAAC;AAEH,eAAO,MAAM,aAAa,8EAcxB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuDf,CAAC"}
|
|
@@ -1,22 +1,68 @@
|
|
|
1
1
|
import { Agent } from '@mastra/core';
|
|
2
|
+
import { config } from '../../config/index.js';
|
|
2
3
|
import { browserTool, googleSearch } from '../tools/browser.js';
|
|
3
4
|
import { listEvents } from '../tools/calendar.js';
|
|
4
5
|
import { crawl } from '../tools/crawl.js';
|
|
5
6
|
import { execaTool } from '../tools/execa.js';
|
|
6
7
|
import { fsTool } from '../tools/fs.js';
|
|
8
|
+
import { imageTool } from '../tools/image.js';
|
|
7
9
|
import { readPDF } from '../tools/pdf.js';
|
|
10
|
+
import { activeDistTag, pnpmBuild, pnpmChangesetPublish, pnpmChangesetStatus } from '../tools/pnpm.js';
|
|
11
|
+
const getBaseModelConfig = () => ({
|
|
12
|
+
provider: 'ANTHROPIC',
|
|
13
|
+
toolChoice: 'auto',
|
|
14
|
+
name: 'claude-3-5-sonnet-20241022',
|
|
15
|
+
apiKey: config.getAnthropicApiKey(),
|
|
16
|
+
});
|
|
17
|
+
export const daneCommitMessage = new Agent({
|
|
18
|
+
name: 'DaneCommitMessage',
|
|
19
|
+
instructions: `
|
|
20
|
+
You are Dane, the ultimate GitHub operator.
|
|
21
|
+
You help engineers generate commit messages.
|
|
22
|
+
|
|
23
|
+
GENERATE A SCOPE FOR THE COMMIT MESSAGE IF NECESSARY.
|
|
24
|
+
FIGURE OUT THE BEST TOP LEVEL SEMANTIC MATCH TO USE AS THE SCOPE.
|
|
25
|
+
`,
|
|
26
|
+
model: getBaseModelConfig(),
|
|
27
|
+
});
|
|
8
28
|
export const daneIssueLabeler = new Agent({
|
|
9
29
|
name: 'DaneIssueLabeler',
|
|
10
30
|
instructions: `
|
|
11
|
-
You are Dane, the ultimate GitHub operator.
|
|
31
|
+
You are Dane, the ultimate GitHub operator.
|
|
12
32
|
You help engineers label their issues.
|
|
13
33
|
`,
|
|
14
|
-
model:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
34
|
+
model: getBaseModelConfig(),
|
|
35
|
+
});
|
|
36
|
+
export const danePackagePublisher = new Agent({
|
|
37
|
+
name: 'DanePackagePublisher',
|
|
38
|
+
instructions: `
|
|
39
|
+
You are Dane, the ultimate node module publisher.
|
|
40
|
+
You help engineers publish their pnpm changesets.
|
|
41
|
+
`,
|
|
42
|
+
model: getBaseModelConfig(),
|
|
43
|
+
tools: {
|
|
44
|
+
execaTool,
|
|
45
|
+
pnpmBuild,
|
|
46
|
+
pnpmChangesetPublish,
|
|
47
|
+
pnpmChangesetStatus,
|
|
48
|
+
activeDistTag,
|
|
18
49
|
},
|
|
19
50
|
});
|
|
51
|
+
export const daneChangeLog = new Agent({
|
|
52
|
+
name: 'DanePackagePublisher',
|
|
53
|
+
instructions: `
|
|
54
|
+
You are Dane, the changelog writer for Mastra AI. Every week we need to write a changelog for the Mastra AI project.
|
|
55
|
+
## Style Guide
|
|
56
|
+
- Use active voice
|
|
57
|
+
- Lead with the change, not the PR number
|
|
58
|
+
- Include PR numbers in parentheses at end of line
|
|
59
|
+
- Keep descriptions concise but informative
|
|
60
|
+
- Avoid marketing language
|
|
61
|
+
- Link to relevant documentation
|
|
62
|
+
- Use consistent formatting for code references
|
|
63
|
+
`,
|
|
64
|
+
model: getBaseModelConfig(),
|
|
65
|
+
});
|
|
20
66
|
export const dane = new Agent({
|
|
21
67
|
name: 'Dane',
|
|
22
68
|
instructions: `
|
|
@@ -26,42 +72,42 @@ export const dane = new Agent({
|
|
|
26
72
|
DO NOT ATTEMPT TO USE GENERAL KNOWLEDGE! We are only as good as the tools we use.
|
|
27
73
|
|
|
28
74
|
# Our tools:
|
|
29
|
-
|
|
75
|
+
|
|
30
76
|
## readPDF
|
|
31
77
|
Makes you a powerful agent capable of reading PDF files.
|
|
32
78
|
|
|
33
79
|
## fsTool
|
|
34
80
|
Makes you a powerful agent capable of reading and writing files to the local filesystem.
|
|
35
|
-
|
|
81
|
+
|
|
36
82
|
## execaTool
|
|
37
|
-
Makes you a powerful agent capabale of executing files on the local system.
|
|
38
|
-
|
|
39
|
-
## googleSearch
|
|
83
|
+
Makes you a powerful agent capabale of executing files on the local system.
|
|
84
|
+
|
|
85
|
+
## googleSearch
|
|
40
86
|
Makes you a powerful agent capabale answering all questions by finding the answer on Google search.
|
|
41
87
|
Pass the query as a JS object. If you have links, ALWAYS CITE YOUR SOURCES.
|
|
42
|
-
|
|
88
|
+
|
|
43
89
|
## browserTool
|
|
44
|
-
Makes you a powerful agent capable of scraping the web. Pass the url as a JS object.
|
|
90
|
+
Makes you a powerful agent capable of scraping the web. Pass the url as a JS object.
|
|
45
91
|
|
|
46
92
|
## listEvents
|
|
47
|
-
Makes you a powerful agent capable of listing events on a calendar. When using this tool ONLY RETURN RELEVANT EVENTS.
|
|
93
|
+
Makes you a powerful agent capable of listing events on a calendar. When using this tool ONLY RETURN RELEVANT EVENTS.
|
|
48
94
|
DO NOT ATTEMPT TO DO ANYTHING MORE.
|
|
49
95
|
|
|
50
96
|
## crawl
|
|
51
97
|
Use this when the user asks you to crawl. CRAWL is the signal to use this tool.
|
|
52
|
-
Makes you a powerful agent capable of crawling a site and extracting markdown metadata.
|
|
53
|
-
The data will be stored in a database. Confirm that it is sucessful.
|
|
54
|
-
|
|
98
|
+
Makes you a powerful agent capable of crawling a site and extracting markdown metadata.
|
|
99
|
+
The data will be stored in a database if it is not already there. Confirm that it is sucessful.
|
|
100
|
+
The crawled data will be returned in the response on the 'crawlData' field.
|
|
101
|
+
|
|
102
|
+
## imageTool
|
|
103
|
+
Makes you a powerful agent capable of generating images and saving them to disk. Pass the directory and an image prompt.
|
|
104
|
+
|
|
55
105
|
# Rules
|
|
56
106
|
* DO NOT ATTEMPT TO USE GENERAL KNOWLEDGE. Use the 'googleSearch' tool to find the answer.
|
|
57
|
-
* Don't reference tools when you communicate with the user. Do not mention what tools you are using.
|
|
107
|
+
* Don't reference tools when you communicate with the user. Do not mention what tools you are using.
|
|
58
108
|
* Tell the user what you are doing.
|
|
59
109
|
`,
|
|
60
|
-
model:
|
|
61
|
-
provider: 'ANTHROPIC',
|
|
62
|
-
toolChoice: 'auto',
|
|
63
|
-
name: 'claude-3-5-sonnet-20241022',
|
|
64
|
-
},
|
|
110
|
+
model: getBaseModelConfig(),
|
|
65
111
|
tools: {
|
|
66
112
|
fsTool,
|
|
67
113
|
execaTool,
|
|
@@ -70,7 +116,6 @@ export const dane = new Agent({
|
|
|
70
116
|
readPDF,
|
|
71
117
|
listEvents,
|
|
72
118
|
crawl,
|
|
73
|
-
|
|
74
|
-
// browserAgentRelay,
|
|
119
|
+
imageTool,
|
|
75
120
|
},
|
|
76
121
|
});
|
package/dist/mastra/index.d.ts
CHANGED
|
@@ -149,10 +149,13 @@ export declare const mastra: Mastra<{
|
|
|
149
149
|
limit?: number | undefined;
|
|
150
150
|
}>, import("zod").ZodObject<{
|
|
151
151
|
message: import("zod").ZodString;
|
|
152
|
+
crawlData: import("zod").ZodAny;
|
|
152
153
|
}, "strip", import("zod").ZodTypeAny, {
|
|
153
154
|
message: string;
|
|
155
|
+
crawlData?: any;
|
|
154
156
|
}, {
|
|
155
157
|
message: string;
|
|
158
|
+
crawlData?: any;
|
|
156
159
|
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
157
160
|
url: import("zod").ZodString;
|
|
158
161
|
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
@@ -166,8 +169,120 @@ export declare const mastra: Mastra<{
|
|
|
166
169
|
pathRegex: string | null;
|
|
167
170
|
limit?: number | undefined;
|
|
168
171
|
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
172
|
+
imageTool: import("@mastra/core").Tool<"imageTool", import("zod").ZodObject<{
|
|
173
|
+
directory: import("zod").ZodString;
|
|
174
|
+
prompt: import("zod").ZodString;
|
|
175
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
176
|
+
directory: string;
|
|
177
|
+
prompt: string;
|
|
178
|
+
}, {
|
|
179
|
+
directory: string;
|
|
180
|
+
prompt: string;
|
|
181
|
+
}>, import("zod").ZodObject<{
|
|
182
|
+
message: import("zod").ZodString;
|
|
183
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
184
|
+
message: string;
|
|
185
|
+
}, {
|
|
186
|
+
message: string;
|
|
187
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
188
|
+
directory: import("zod").ZodString;
|
|
189
|
+
prompt: import("zod").ZodString;
|
|
190
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
191
|
+
directory: string;
|
|
192
|
+
prompt: string;
|
|
193
|
+
}, {
|
|
194
|
+
directory: string;
|
|
195
|
+
prompt: string;
|
|
196
|
+
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
197
|
+
}>;
|
|
198
|
+
danePackagePublisher: import("@mastra/core").Agent<{
|
|
199
|
+
execaTool: import("@mastra/core").Tool<"execaTool", import("zod").ZodObject<{
|
|
200
|
+
command: import("zod").ZodString;
|
|
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">;
|
|
217
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
218
|
+
command: string;
|
|
219
|
+
args: string[];
|
|
220
|
+
}, {
|
|
221
|
+
command: string;
|
|
222
|
+
args: string[];
|
|
223
|
+
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
224
|
+
pnpmBuild: import("@mastra/core").Tool<"pnpmBuild", import("zod").ZodObject<{
|
|
225
|
+
name: import("zod").ZodString;
|
|
226
|
+
packagePath: import("zod").ZodString;
|
|
227
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
228
|
+
name: string;
|
|
229
|
+
packagePath: string;
|
|
230
|
+
}, {
|
|
231
|
+
name: string;
|
|
232
|
+
packagePath: string;
|
|
233
|
+
}>, import("zod").ZodObject<{
|
|
234
|
+
message: import("zod").ZodString;
|
|
235
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
236
|
+
message: string;
|
|
237
|
+
}, {
|
|
238
|
+
message: string;
|
|
239
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
240
|
+
name: import("zod").ZodString;
|
|
241
|
+
packagePath: import("zod").ZodString;
|
|
242
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
243
|
+
name: string;
|
|
244
|
+
packagePath: string;
|
|
245
|
+
}, {
|
|
246
|
+
name: string;
|
|
247
|
+
packagePath: string;
|
|
248
|
+
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
249
|
+
pnpmChangesetPublish: import("@mastra/core").Tool<"pnpmChangesetPublish", import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("zod").ZodObject<{
|
|
250
|
+
message: import("zod").ZodString;
|
|
251
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
252
|
+
message: string;
|
|
253
|
+
}, {
|
|
254
|
+
message: string;
|
|
255
|
+
}>, 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
|
+
activeDistTag: import("@mastra/core").Tool<"activeDistTag", import("zod").ZodObject<{
|
|
264
|
+
packagePath: import("zod").ZodString;
|
|
265
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
266
|
+
packagePath: string;
|
|
267
|
+
}, {
|
|
268
|
+
packagePath: string;
|
|
269
|
+
}>, import("zod").ZodObject<{
|
|
270
|
+
message: import("zod").ZodString;
|
|
271
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
272
|
+
message: string;
|
|
273
|
+
}, {
|
|
274
|
+
message: string;
|
|
275
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
276
|
+
packagePath: import("zod").ZodString;
|
|
277
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
278
|
+
packagePath: string;
|
|
279
|
+
}, {
|
|
280
|
+
packagePath: string;
|
|
281
|
+
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
169
282
|
}>;
|
|
170
283
|
daneIssueLabeler: import("@mastra/core").Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>>;
|
|
284
|
+
daneCommitMessage: import("@mastra/core").Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>>;
|
|
285
|
+
daneChangeLog: import("@mastra/core").Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>>;
|
|
171
286
|
}, {
|
|
172
287
|
message: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
|
|
173
288
|
resourceid: import("zod").ZodString;
|
|
@@ -192,5 +307,21 @@ export declare const mastra: Mastra<{
|
|
|
192
307
|
owner: string;
|
|
193
308
|
issue_number: number;
|
|
194
309
|
}>>;
|
|
195
|
-
|
|
310
|
+
commitMessage: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
|
|
311
|
+
repoPath: import("zod").ZodString;
|
|
312
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
313
|
+
repoPath: string;
|
|
314
|
+
}, {
|
|
315
|
+
repoPath: string;
|
|
316
|
+
}>>;
|
|
317
|
+
packagePublisher: import("@mastra/core").Workflow<any, any>;
|
|
318
|
+
telephoneGame: import("@mastra/core").Workflow<any, any>;
|
|
319
|
+
changelog: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
|
|
320
|
+
channelId: import("zod").ZodString;
|
|
321
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
322
|
+
channelId: string;
|
|
323
|
+
}, {
|
|
324
|
+
channelId: string;
|
|
325
|
+
}>>;
|
|
326
|
+
}, Record<string, import("@mastra/core").MastraVector>, Record<string, import("@mastra/core").MastraTTS>, import("@mastra/core").BaseLogger<import("@mastra/core").BaseLogMessage>>;
|
|
196
327
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;AAetC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mLAyBjB,CAAC"}
|
package/dist/mastra/index.js
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { Mastra } from '@mastra/core';
|
|
2
2
|
import { PostgresEngine } from '@mastra/engine';
|
|
3
3
|
import { UpstashKVMemory } from '@mastra/memory';
|
|
4
|
-
import { dane, daneIssueLabeler } from './agents/index.js';
|
|
4
|
+
import { dane, daneChangeLog, daneCommitMessage, daneIssueLabeler, danePackagePublisher } from './agents/index.js';
|
|
5
5
|
import { firecrawl } from './integrations/index.js';
|
|
6
|
-
import {
|
|
6
|
+
import { changelogWorkflow } from './workflows/changelog.js';
|
|
7
|
+
import { messageWorkflow, githubIssueLabeler, commitMessageGenerator } from './workflows/index.js';
|
|
8
|
+
import { packagePublisher } from './workflows/publish-packages.js';
|
|
9
|
+
import { telephoneGameWorkflow } from './workflows/telephone-game.js';
|
|
7
10
|
const engine = new PostgresEngine({
|
|
8
11
|
url: 'postgres://postgres:postgres@localhost:5433/mastra',
|
|
9
12
|
});
|
|
10
13
|
export const mastra = new Mastra({
|
|
11
14
|
agents: {
|
|
12
15
|
dane,
|
|
16
|
+
danePackagePublisher,
|
|
13
17
|
daneIssueLabeler,
|
|
18
|
+
daneCommitMessage,
|
|
19
|
+
daneChangeLog,
|
|
14
20
|
},
|
|
15
21
|
engine,
|
|
16
22
|
memory: new UpstashKVMemory({
|
|
@@ -21,8 +27,11 @@ export const mastra = new Mastra({
|
|
|
21
27
|
workflows: {
|
|
22
28
|
message: messageWorkflow,
|
|
23
29
|
githubIssueLabeler: githubIssueLabeler,
|
|
30
|
+
commitMessage: commitMessageGenerator,
|
|
31
|
+
packagePublisher: packagePublisher,
|
|
32
|
+
telephoneGame: telephoneGameWorkflow,
|
|
33
|
+
changelog: changelogWorkflow,
|
|
24
34
|
},
|
|
25
|
-
logger: false,
|
|
26
35
|
syncs: {
|
|
27
36
|
...firecrawl.getSyncs(),
|
|
28
37
|
},
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { FirecrawlIntegration } from "@mastra/firecrawl";
|
|
2
2
|
import { GithubIntegration } from "@mastra/github";
|
|
3
|
+
import { StabilityAiIntegration } from "@mastra/stabilityai";
|
|
3
4
|
export declare const firecrawl: FirecrawlIntegration;
|
|
4
5
|
export declare const github: GithubIntegration;
|
|
6
|
+
export declare const stabilityai: StabilityAiIntegration;
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mastra/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mastra/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAc7D,eAAO,MAAM,SAAS,sBAIpB,CAAC;AAEH,eAAO,MAAM,MAAM,mBAIjB,CAAC;AAEH,eAAO,MAAM,WAAW,wBAItB,CAAC"}
|
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
import { FirecrawlIntegration } from "@mastra/firecrawl";
|
|
2
2
|
import { GithubIntegration } from "@mastra/github";
|
|
3
|
+
import { StabilityAiIntegration } from "@mastra/stabilityai";
|
|
4
|
+
import { config } from "../../config/index.js";
|
|
5
|
+
// Helper function to get key from config or env
|
|
6
|
+
const getApiKey = (configKey, envKey) => {
|
|
7
|
+
const configValue = config.get(configKey);
|
|
8
|
+
if (configValue)
|
|
9
|
+
return configValue;
|
|
10
|
+
const envValue = process.env[envKey];
|
|
11
|
+
if (envValue)
|
|
12
|
+
return envValue;
|
|
13
|
+
return '';
|
|
14
|
+
};
|
|
3
15
|
export const firecrawl = new FirecrawlIntegration({
|
|
4
16
|
config: {
|
|
5
|
-
API_KEY:
|
|
17
|
+
API_KEY: getApiKey('FIRECRAWL_API_KEY', 'FIRECRAWL_API_KEY'),
|
|
6
18
|
},
|
|
7
19
|
});
|
|
8
20
|
export const github = new GithubIntegration({
|
|
9
21
|
config: {
|
|
10
|
-
PERSONAL_ACCESS_TOKEN:
|
|
22
|
+
PERSONAL_ACCESS_TOKEN: getApiKey('GITHUB_PERSONAL_ACCESS_TOKEN', 'GITHUB_PERSONAL_ACCESS_TOKEN'),
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export const stabilityai = new StabilityAiIntegration({
|
|
26
|
+
config: {
|
|
27
|
+
API_KEY: getApiKey('STABILITYAI_API_KEY', 'STABILITYAI_API_KEY'),
|
|
11
28
|
}
|
|
12
29
|
});
|
|
@@ -13,10 +13,13 @@ export declare const crawl: import("@mastra/core").Tool<"crawler", z.ZodObject<{
|
|
|
13
13
|
limit?: number | undefined;
|
|
14
14
|
}>, z.ZodObject<{
|
|
15
15
|
message: z.ZodString;
|
|
16
|
+
crawlData: z.ZodAny;
|
|
16
17
|
}, "strip", z.ZodTypeAny, {
|
|
17
18
|
message: string;
|
|
19
|
+
crawlData?: any;
|
|
18
20
|
}, {
|
|
19
21
|
message: string;
|
|
22
|
+
crawlData?: any;
|
|
20
23
|
}>, import("@mastra/core").ToolExecutionContext<z.ZodObject<{
|
|
21
24
|
url: z.ZodString;
|
|
22
25
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crawl.d.ts","sourceRoot":"","sources":["../../../src/mastra/tools/crawl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"crawl.d.ts","sourceRoot":"","sources":["../../../src/mastra/tools/crawl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAwBhB,CAAC"}
|
|
@@ -11,14 +11,16 @@ export const crawl = createTool({
|
|
|
11
11
|
}),
|
|
12
12
|
outputSchema: z.object({
|
|
13
13
|
message: z.string(),
|
|
14
|
+
crawlData: z.any(),
|
|
14
15
|
}),
|
|
15
16
|
execute: async ({ context, mastra }) => {
|
|
16
|
-
await mastra?.syncs?.['FIRECRAWL:CRAWL_AND_SYNC']?.execute({
|
|
17
|
+
const crawlData = await mastra?.syncs?.['FIRECRAWL:CRAWL_AND_SYNC']?.execute({
|
|
17
18
|
context,
|
|
18
|
-
mastra,
|
|
19
|
+
engine: mastra?.engine,
|
|
19
20
|
});
|
|
20
21
|
return {
|
|
21
22
|
message: 'The website has been successfully crawled and chunks have been synced to the database. Finish.',
|
|
23
|
+
crawlData,
|
|
22
24
|
};
|
|
23
25
|
},
|
|
24
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execa.d.ts","sourceRoot":"","sources":["../../../src/mastra/tools/execa.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"execa.d.ts","sourceRoot":"","sources":["../../../src/mastra/tools/execa.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;iDA4BpB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createTool } from '@mastra/core';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
-
import { execa } from 'execa';
|
|
3
|
+
import { execa, ExecaError } from 'execa';
|
|
4
4
|
import { Transform } from 'stream';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
// Create transform stream that applies chalk
|
|
@@ -25,6 +25,7 @@ export const execaTool = createTool({
|
|
|
25
25
|
}),
|
|
26
26
|
execute: async ({ context: { command, args } }) => {
|
|
27
27
|
try {
|
|
28
|
+
console.log(chalk.green(`Running command: ${command} ${args.join(' ')}`));
|
|
28
29
|
const p = execa(command, args);
|
|
29
30
|
console.log(`\n`);
|
|
30
31
|
p.stdout.pipe(colorTransform).pipe(process.stdout);
|
|
@@ -33,6 +34,9 @@ export const execaTool = createTool({
|
|
|
33
34
|
return { message: r.stdout };
|
|
34
35
|
}
|
|
35
36
|
catch (e) {
|
|
37
|
+
if (e instanceof ExecaError) {
|
|
38
|
+
return { message: e.message };
|
|
39
|
+
}
|
|
36
40
|
return { message: 'Error' };
|
|
37
41
|
}
|
|
38
42
|
},
|