@mastra/dane 0.0.2-alpha.3 → 0.0.2-alpha.31
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/README.md +25 -4
- package/data/crawl/conventional-commit.json +25 -0
- package/package.json +14 -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/commands/issue-labeler.d.ts +0 -1
- package/dist/commands/issue-labeler.js +0 -18
- package/dist/commands/message.d.ts +0 -1
- package/dist/commands/message.js +0 -12
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -8
- package/dist/mastra/agents/index.d.ts +0 -167
- package/dist/mastra/agents/index.js +0 -76
- package/dist/mastra/index.d.ts +0 -195
- package/dist/mastra/index.js +0 -29
- package/dist/mastra/integrations/index.d.ts +0 -4
- package/dist/mastra/integrations/index.js +0 -12
- package/dist/mastra/tools/browser.d.ts +0 -39
- package/dist/mastra/tools/browser.js +0 -118
- package/dist/mastra/tools/calendar.d.ts +0 -20
- package/dist/mastra/tools/calendar.js +0 -134
- package/dist/mastra/tools/crawl.d.ts +0 -32
- package/dist/mastra/tools/crawl.js +0 -24
- package/dist/mastra/tools/execa.d.ts +0 -26
- package/dist/mastra/tools/execa.js +0 -39
- package/dist/mastra/tools/fs.d.ts +0 -32
- package/dist/mastra/tools/fs.js +0 -36
- package/dist/mastra/tools/pdf.d.ts +0 -20
- package/dist/mastra/tools/pdf.js +0 -41
- package/dist/mastra/workflows/chat.d.ts +0 -12
- package/dist/mastra/workflows/chat.js +0 -93
- package/dist/mastra/workflows/index.d.ts +0 -2
- package/dist/mastra/workflows/index.js +0 -2
- package/dist/mastra/workflows/issue-labeler.d.ts +0 -15
- package/dist/mastra/workflows/issue-labeler.js +0 -85
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { Agent } from '@mastra/core';
|
|
2
|
-
export declare const daneIssueLabeler: Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>>;
|
|
3
|
-
export declare const dane: Agent<{
|
|
4
|
-
fsTool: import("@mastra/core").Tool<"fsTool", import("zod").ZodObject<{
|
|
5
|
-
action: import("zod").ZodString;
|
|
6
|
-
file: import("zod").ZodString;
|
|
7
|
-
data: import("zod").ZodString;
|
|
8
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
9
|
-
data: string;
|
|
10
|
-
action: string;
|
|
11
|
-
file: string;
|
|
12
|
-
}, {
|
|
13
|
-
data: string;
|
|
14
|
-
action: string;
|
|
15
|
-
file: string;
|
|
16
|
-
}>, import("zod").ZodObject<{
|
|
17
|
-
message: import("zod").ZodString;
|
|
18
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
19
|
-
message: string;
|
|
20
|
-
}, {
|
|
21
|
-
message: string;
|
|
22
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
23
|
-
action: import("zod").ZodString;
|
|
24
|
-
file: import("zod").ZodString;
|
|
25
|
-
data: import("zod").ZodString;
|
|
26
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
27
|
-
data: string;
|
|
28
|
-
action: string;
|
|
29
|
-
file: string;
|
|
30
|
-
}, {
|
|
31
|
-
data: string;
|
|
32
|
-
action: string;
|
|
33
|
-
file: string;
|
|
34
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
35
|
-
execaTool: import("@mastra/core").Tool<"execaTool", import("zod").ZodObject<{
|
|
36
|
-
command: import("zod").ZodString;
|
|
37
|
-
args: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
38
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
39
|
-
command: string;
|
|
40
|
-
args: string[];
|
|
41
|
-
}, {
|
|
42
|
-
command: string;
|
|
43
|
-
args: string[];
|
|
44
|
-
}>, import("zod").ZodObject<{
|
|
45
|
-
message: import("zod").ZodString;
|
|
46
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
47
|
-
message: string;
|
|
48
|
-
}, {
|
|
49
|
-
message: string;
|
|
50
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
51
|
-
command: import("zod").ZodString;
|
|
52
|
-
args: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
53
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
54
|
-
command: string;
|
|
55
|
-
args: string[];
|
|
56
|
-
}, {
|
|
57
|
-
command: string;
|
|
58
|
-
args: string[];
|
|
59
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
60
|
-
browserTool: import("@mastra/core").Tool<"browserTool", import("zod").ZodObject<{
|
|
61
|
-
url: import("zod").ZodString;
|
|
62
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
63
|
-
url: string;
|
|
64
|
-
}, {
|
|
65
|
-
url: string;
|
|
66
|
-
}>, import("zod").ZodObject<{
|
|
67
|
-
message: import("zod").ZodString;
|
|
68
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
69
|
-
message: string;
|
|
70
|
-
}, {
|
|
71
|
-
message: string;
|
|
72
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
73
|
-
url: import("zod").ZodString;
|
|
74
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
75
|
-
url: string;
|
|
76
|
-
}, {
|
|
77
|
-
url: string;
|
|
78
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
79
|
-
googleSearch: import("@mastra/core").Tool<"googleSearch", import("zod").ZodObject<{
|
|
80
|
-
query: import("zod").ZodString;
|
|
81
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
82
|
-
query: string;
|
|
83
|
-
}, {
|
|
84
|
-
query: string;
|
|
85
|
-
}>, import("zod").ZodObject<{
|
|
86
|
-
message: import("zod").ZodString;
|
|
87
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
88
|
-
message: string;
|
|
89
|
-
}, {
|
|
90
|
-
message: string;
|
|
91
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
92
|
-
query: import("zod").ZodString;
|
|
93
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
94
|
-
query: string;
|
|
95
|
-
}, {
|
|
96
|
-
query: string;
|
|
97
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
98
|
-
readPDF: import("@mastra/core").Tool<"readPDF", import("zod").ZodObject<{
|
|
99
|
-
pdfPath: import("zod").ZodString;
|
|
100
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
101
|
-
pdfPath: string;
|
|
102
|
-
}, {
|
|
103
|
-
pdfPath: string;
|
|
104
|
-
}>, import("zod").ZodObject<{
|
|
105
|
-
content: import("zod").ZodString;
|
|
106
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
107
|
-
content: string;
|
|
108
|
-
}, {
|
|
109
|
-
content: string;
|
|
110
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
111
|
-
pdfPath: import("zod").ZodString;
|
|
112
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
113
|
-
pdfPath: string;
|
|
114
|
-
}, {
|
|
115
|
-
pdfPath: string;
|
|
116
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
117
|
-
listEvents: import("@mastra/core").Tool<"listEvents", import("zod").ZodObject<{
|
|
118
|
-
startDate: import("zod").ZodString;
|
|
119
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
120
|
-
startDate: string;
|
|
121
|
-
}, {
|
|
122
|
-
startDate: string;
|
|
123
|
-
}>, import("zod").ZodObject<{
|
|
124
|
-
content: import("zod").ZodString;
|
|
125
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
126
|
-
content: string;
|
|
127
|
-
}, {
|
|
128
|
-
content: string;
|
|
129
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
130
|
-
startDate: import("zod").ZodString;
|
|
131
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
132
|
-
startDate: string;
|
|
133
|
-
}, {
|
|
134
|
-
startDate: string;
|
|
135
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
136
|
-
crawl: import("@mastra/core").Tool<"crawler", import("zod").ZodObject<{
|
|
137
|
-
url: import("zod").ZodString;
|
|
138
|
-
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
139
|
-
pathRegex: import("zod").ZodNullable<import("zod").ZodString>;
|
|
140
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
141
|
-
url: string;
|
|
142
|
-
limit: number;
|
|
143
|
-
pathRegex: string | null;
|
|
144
|
-
}, {
|
|
145
|
-
url: string;
|
|
146
|
-
pathRegex: string | null;
|
|
147
|
-
limit?: number | undefined;
|
|
148
|
-
}>, import("zod").ZodObject<{
|
|
149
|
-
message: import("zod").ZodString;
|
|
150
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
151
|
-
message: string;
|
|
152
|
-
}, {
|
|
153
|
-
message: string;
|
|
154
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
155
|
-
url: import("zod").ZodString;
|
|
156
|
-
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
157
|
-
pathRegex: import("zod").ZodNullable<import("zod").ZodString>;
|
|
158
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
159
|
-
url: string;
|
|
160
|
-
limit: number;
|
|
161
|
-
pathRegex: string | null;
|
|
162
|
-
}, {
|
|
163
|
-
url: string;
|
|
164
|
-
pathRegex: string | null;
|
|
165
|
-
limit?: number | undefined;
|
|
166
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
167
|
-
}>;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Agent } from '@mastra/core';
|
|
2
|
-
import { browserTool, googleSearch } from '../tools/browser.js';
|
|
3
|
-
import { listEvents } from '../tools/calendar.js';
|
|
4
|
-
import { crawl } from '../tools/crawl.js';
|
|
5
|
-
import { execaTool } from '../tools/execa.js';
|
|
6
|
-
import { fsTool } from '../tools/fs.js';
|
|
7
|
-
import { readPDF } from '../tools/pdf.js';
|
|
8
|
-
export const daneIssueLabeler = new Agent({
|
|
9
|
-
name: 'DaneIssueLabeler',
|
|
10
|
-
instructions: `
|
|
11
|
-
You are Dane, the ultimate GitHub operator.
|
|
12
|
-
You help engineers label their issues.
|
|
13
|
-
`,
|
|
14
|
-
model: {
|
|
15
|
-
provider: 'ANTHROPIC',
|
|
16
|
-
toolChoice: 'auto',
|
|
17
|
-
name: 'claude-3-5-sonnet-20241022',
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
export const dane = new Agent({
|
|
21
|
-
name: 'Dane',
|
|
22
|
-
instructions: `
|
|
23
|
-
You are Dane, my assistant and one of my best friends. We are an ace team!
|
|
24
|
-
You help me with my code, write tests, and even deploy my code to the cloud!
|
|
25
|
-
|
|
26
|
-
DO NOT ATTEMPT TO USE GENERAL KNOWLEDGE! We are only as good as the tools we use.
|
|
27
|
-
|
|
28
|
-
# Our tools:
|
|
29
|
-
|
|
30
|
-
## readPDF
|
|
31
|
-
Makes you a powerful agent capable of reading PDF files.
|
|
32
|
-
|
|
33
|
-
## fsTool
|
|
34
|
-
Makes you a powerful agent capable of reading and writing files to the local filesystem.
|
|
35
|
-
|
|
36
|
-
## execaTool
|
|
37
|
-
Makes you a powerful agent capabale of executing files on the local system.
|
|
38
|
-
|
|
39
|
-
## googleSearch
|
|
40
|
-
Makes you a powerful agent capabale answering all questions by finding the answer on Google search.
|
|
41
|
-
Pass the query as a JS object. If you have links, ALWAYS CITE YOUR SOURCES.
|
|
42
|
-
|
|
43
|
-
## browserTool
|
|
44
|
-
Makes you a powerful agent capable of scraping the web. Pass the url as a JS object.
|
|
45
|
-
|
|
46
|
-
## listEvents
|
|
47
|
-
Makes you a powerful agent capable of listing events on a calendar. When using this tool ONLY RETURN RELEVANT EVENTS.
|
|
48
|
-
DO NOT ATTEMPT TO DO ANYTHING MORE.
|
|
49
|
-
|
|
50
|
-
## crawl
|
|
51
|
-
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
|
-
|
|
55
|
-
# Rules
|
|
56
|
-
* 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.
|
|
58
|
-
* Tell the user what you are doing.
|
|
59
|
-
`,
|
|
60
|
-
model: {
|
|
61
|
-
provider: 'ANTHROPIC',
|
|
62
|
-
toolChoice: 'auto',
|
|
63
|
-
name: 'claude-3-5-sonnet-20241022',
|
|
64
|
-
},
|
|
65
|
-
tools: {
|
|
66
|
-
fsTool,
|
|
67
|
-
execaTool,
|
|
68
|
-
browserTool,
|
|
69
|
-
googleSearch,
|
|
70
|
-
readPDF,
|
|
71
|
-
listEvents,
|
|
72
|
-
crawl,
|
|
73
|
-
// TODO I SHOULD BE ABLE TO PASS A WORKFLOW EXECUTE HERE
|
|
74
|
-
// browserAgentRelay,
|
|
75
|
-
},
|
|
76
|
-
});
|
package/dist/mastra/index.d.ts
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { Mastra } from '@mastra/core';
|
|
2
|
-
export declare const mastra: Mastra<{
|
|
3
|
-
[x: string]: import("@mastra/core").SyncAction<any, any, any, any>;
|
|
4
|
-
}, {
|
|
5
|
-
dane: import("@mastra/core").Agent<{
|
|
6
|
-
fsTool: import("@mastra/core").Tool<"fsTool", import("zod").ZodObject<{
|
|
7
|
-
action: import("zod").ZodString;
|
|
8
|
-
file: import("zod").ZodString;
|
|
9
|
-
data: import("zod").ZodString;
|
|
10
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
11
|
-
data: string;
|
|
12
|
-
action: string;
|
|
13
|
-
file: string;
|
|
14
|
-
}, {
|
|
15
|
-
data: string;
|
|
16
|
-
action: string;
|
|
17
|
-
file: string;
|
|
18
|
-
}>, import("zod").ZodObject<{
|
|
19
|
-
message: import("zod").ZodString;
|
|
20
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
21
|
-
message: string;
|
|
22
|
-
}, {
|
|
23
|
-
message: string;
|
|
24
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
25
|
-
action: import("zod").ZodString;
|
|
26
|
-
file: import("zod").ZodString;
|
|
27
|
-
data: import("zod").ZodString;
|
|
28
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
29
|
-
data: string;
|
|
30
|
-
action: string;
|
|
31
|
-
file: string;
|
|
32
|
-
}, {
|
|
33
|
-
data: string;
|
|
34
|
-
action: string;
|
|
35
|
-
file: string;
|
|
36
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
37
|
-
execaTool: import("@mastra/core").Tool<"execaTool", import("zod").ZodObject<{
|
|
38
|
-
command: import("zod").ZodString;
|
|
39
|
-
args: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
40
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
41
|
-
command: string;
|
|
42
|
-
args: string[];
|
|
43
|
-
}, {
|
|
44
|
-
command: string;
|
|
45
|
-
args: string[];
|
|
46
|
-
}>, import("zod").ZodObject<{
|
|
47
|
-
message: import("zod").ZodString;
|
|
48
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
49
|
-
message: string;
|
|
50
|
-
}, {
|
|
51
|
-
message: string;
|
|
52
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
53
|
-
command: import("zod").ZodString;
|
|
54
|
-
args: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
55
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
56
|
-
command: string;
|
|
57
|
-
args: string[];
|
|
58
|
-
}, {
|
|
59
|
-
command: string;
|
|
60
|
-
args: string[];
|
|
61
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
62
|
-
browserTool: import("@mastra/core").Tool<"browserTool", import("zod").ZodObject<{
|
|
63
|
-
url: import("zod").ZodString;
|
|
64
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
65
|
-
url: string;
|
|
66
|
-
}, {
|
|
67
|
-
url: string;
|
|
68
|
-
}>, import("zod").ZodObject<{
|
|
69
|
-
message: import("zod").ZodString;
|
|
70
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
71
|
-
message: string;
|
|
72
|
-
}, {
|
|
73
|
-
message: string;
|
|
74
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
75
|
-
url: import("zod").ZodString;
|
|
76
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
77
|
-
url: string;
|
|
78
|
-
}, {
|
|
79
|
-
url: string;
|
|
80
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
81
|
-
googleSearch: import("@mastra/core").Tool<"googleSearch", import("zod").ZodObject<{
|
|
82
|
-
query: import("zod").ZodString;
|
|
83
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
84
|
-
query: string;
|
|
85
|
-
}, {
|
|
86
|
-
query: string;
|
|
87
|
-
}>, import("zod").ZodObject<{
|
|
88
|
-
message: import("zod").ZodString;
|
|
89
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
90
|
-
message: string;
|
|
91
|
-
}, {
|
|
92
|
-
message: string;
|
|
93
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
94
|
-
query: import("zod").ZodString;
|
|
95
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
96
|
-
query: string;
|
|
97
|
-
}, {
|
|
98
|
-
query: string;
|
|
99
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
100
|
-
readPDF: import("@mastra/core").Tool<"readPDF", import("zod").ZodObject<{
|
|
101
|
-
pdfPath: import("zod").ZodString;
|
|
102
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
103
|
-
pdfPath: string;
|
|
104
|
-
}, {
|
|
105
|
-
pdfPath: string;
|
|
106
|
-
}>, import("zod").ZodObject<{
|
|
107
|
-
content: import("zod").ZodString;
|
|
108
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
109
|
-
content: string;
|
|
110
|
-
}, {
|
|
111
|
-
content: string;
|
|
112
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
113
|
-
pdfPath: import("zod").ZodString;
|
|
114
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
115
|
-
pdfPath: string;
|
|
116
|
-
}, {
|
|
117
|
-
pdfPath: string;
|
|
118
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
119
|
-
listEvents: import("@mastra/core").Tool<"listEvents", import("zod").ZodObject<{
|
|
120
|
-
startDate: import("zod").ZodString;
|
|
121
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
122
|
-
startDate: string;
|
|
123
|
-
}, {
|
|
124
|
-
startDate: string;
|
|
125
|
-
}>, import("zod").ZodObject<{
|
|
126
|
-
content: import("zod").ZodString;
|
|
127
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
128
|
-
content: string;
|
|
129
|
-
}, {
|
|
130
|
-
content: string;
|
|
131
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
132
|
-
startDate: import("zod").ZodString;
|
|
133
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
134
|
-
startDate: string;
|
|
135
|
-
}, {
|
|
136
|
-
startDate: string;
|
|
137
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
138
|
-
crawl: import("@mastra/core").Tool<"crawler", import("zod").ZodObject<{
|
|
139
|
-
url: import("zod").ZodString;
|
|
140
|
-
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
141
|
-
pathRegex: import("zod").ZodNullable<import("zod").ZodString>;
|
|
142
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
143
|
-
url: string;
|
|
144
|
-
limit: number;
|
|
145
|
-
pathRegex: string | null;
|
|
146
|
-
}, {
|
|
147
|
-
url: string;
|
|
148
|
-
pathRegex: string | null;
|
|
149
|
-
limit?: number | undefined;
|
|
150
|
-
}>, import("zod").ZodObject<{
|
|
151
|
-
message: import("zod").ZodString;
|
|
152
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
153
|
-
message: string;
|
|
154
|
-
}, {
|
|
155
|
-
message: string;
|
|
156
|
-
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
157
|
-
url: import("zod").ZodString;
|
|
158
|
-
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
159
|
-
pathRegex: import("zod").ZodNullable<import("zod").ZodString>;
|
|
160
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
161
|
-
url: string;
|
|
162
|
-
limit: number;
|
|
163
|
-
pathRegex: string | null;
|
|
164
|
-
}, {
|
|
165
|
-
url: string;
|
|
166
|
-
pathRegex: string | null;
|
|
167
|
-
limit?: number | undefined;
|
|
168
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
169
|
-
}>;
|
|
170
|
-
daneIssueLabeler: import("@mastra/core").Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>>;
|
|
171
|
-
}, {
|
|
172
|
-
message: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
|
|
173
|
-
resourceid: import("zod").ZodString;
|
|
174
|
-
threadId: import("zod").ZodString;
|
|
175
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
176
|
-
resourceid: string;
|
|
177
|
-
threadId: string;
|
|
178
|
-
}, {
|
|
179
|
-
resourceid: string;
|
|
180
|
-
threadId: string;
|
|
181
|
-
}>>;
|
|
182
|
-
githubIssueLabeler: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
|
|
183
|
-
repo: import("zod").ZodString;
|
|
184
|
-
owner: import("zod").ZodString;
|
|
185
|
-
issue_number: import("zod").ZodNumber;
|
|
186
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
187
|
-
repo: string;
|
|
188
|
-
owner: string;
|
|
189
|
-
issue_number: number;
|
|
190
|
-
}, {
|
|
191
|
-
repo: string;
|
|
192
|
-
owner: string;
|
|
193
|
-
issue_number: number;
|
|
194
|
-
}>>;
|
|
195
|
-
}, import("@mastra/core").BaseLogger<import("@mastra/core").BaseLogMessage>>;
|
package/dist/mastra/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Mastra } from '@mastra/core';
|
|
2
|
-
import { PostgresEngine } from '@mastra/engine';
|
|
3
|
-
import { UpstashKVMemory } from '@mastra/memory';
|
|
4
|
-
import { dane, daneIssueLabeler } from './agents/index.js';
|
|
5
|
-
import { firecrawl } from './integrations/index.js';
|
|
6
|
-
import { messageWorkflow, githubIssueLabeler } from './workflows/index.js';
|
|
7
|
-
const engine = new PostgresEngine({
|
|
8
|
-
url: 'postgres://postgres:postgres@localhost:5433/mastra',
|
|
9
|
-
});
|
|
10
|
-
export const mastra = new Mastra({
|
|
11
|
-
agents: {
|
|
12
|
-
dane,
|
|
13
|
-
daneIssueLabeler,
|
|
14
|
-
},
|
|
15
|
-
engine,
|
|
16
|
-
memory: new UpstashKVMemory({
|
|
17
|
-
url: 'http://localhost:8079',
|
|
18
|
-
token: `example_token`,
|
|
19
|
-
maxTokens: 39000,
|
|
20
|
-
}),
|
|
21
|
-
workflows: {
|
|
22
|
-
message: messageWorkflow,
|
|
23
|
-
githubIssueLabeler: githubIssueLabeler,
|
|
24
|
-
},
|
|
25
|
-
logger: false,
|
|
26
|
-
syncs: {
|
|
27
|
-
...firecrawl.getSyncs(),
|
|
28
|
-
},
|
|
29
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FirecrawlIntegration } from "@mastra/firecrawl";
|
|
2
|
-
import { GithubIntegration } from "@mastra/github";
|
|
3
|
-
export const firecrawl = new FirecrawlIntegration({
|
|
4
|
-
config: {
|
|
5
|
-
API_KEY: process.env.FIRECRAWL_API_KEY,
|
|
6
|
-
},
|
|
7
|
-
});
|
|
8
|
-
export const github = new GithubIntegration({
|
|
9
|
-
config: {
|
|
10
|
-
PERSONAL_ACCESS_TOKEN: process.env.GITHUB_PERSONAL_ACCESS_TOKEN,
|
|
11
|
-
}
|
|
12
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const browserTool: import("@mastra/core").Tool<"browserTool", z.ZodObject<{
|
|
3
|
-
url: z.ZodString;
|
|
4
|
-
}, "strip", z.ZodTypeAny, {
|
|
5
|
-
url: string;
|
|
6
|
-
}, {
|
|
7
|
-
url: string;
|
|
8
|
-
}>, z.ZodObject<{
|
|
9
|
-
message: z.ZodString;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
message: string;
|
|
12
|
-
}, {
|
|
13
|
-
message: string;
|
|
14
|
-
}>, import("@mastra/core").ToolExecutionContext<z.ZodObject<{
|
|
15
|
-
url: z.ZodString;
|
|
16
|
-
}, "strip", z.ZodTypeAny, {
|
|
17
|
-
url: string;
|
|
18
|
-
}, {
|
|
19
|
-
url: string;
|
|
20
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
21
|
-
export declare const googleSearch: import("@mastra/core").Tool<"googleSearch", z.ZodObject<{
|
|
22
|
-
query: z.ZodString;
|
|
23
|
-
}, "strip", z.ZodTypeAny, {
|
|
24
|
-
query: string;
|
|
25
|
-
}, {
|
|
26
|
-
query: string;
|
|
27
|
-
}>, z.ZodObject<{
|
|
28
|
-
message: z.ZodString;
|
|
29
|
-
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
message: string;
|
|
31
|
-
}, {
|
|
32
|
-
message: string;
|
|
33
|
-
}>, import("@mastra/core").ToolExecutionContext<z.ZodObject<{
|
|
34
|
-
query: z.ZodString;
|
|
35
|
-
}, "strip", z.ZodTypeAny, {
|
|
36
|
-
query: string;
|
|
37
|
-
}, {
|
|
38
|
-
query: string;
|
|
39
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { createTool } from '@mastra/core';
|
|
2
|
-
import { MDocument } from '@mastra/rag';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import { chromium } from 'playwright-core';
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
export const browserTool = createTool({
|
|
7
|
-
id: 'browserTool',
|
|
8
|
-
name: 'Browser Tool',
|
|
9
|
-
description: 'Browser Tool, opens a browser and navigates to a url capturing the content',
|
|
10
|
-
inputSchema: z.object({
|
|
11
|
-
url: z.string(),
|
|
12
|
-
}),
|
|
13
|
-
outputSchema: z.object({
|
|
14
|
-
message: z.string(),
|
|
15
|
-
}),
|
|
16
|
-
execute: async ({ context: { url } }) => {
|
|
17
|
-
try {
|
|
18
|
-
const browser = await chromium.launch({
|
|
19
|
-
headless: true,
|
|
20
|
-
});
|
|
21
|
-
const page = await browser.newPage();
|
|
22
|
-
await page.goto(url);
|
|
23
|
-
const docs = MDocument.fromHTML(await page.content());
|
|
24
|
-
await docs.chunk({
|
|
25
|
-
strategy: 'html',
|
|
26
|
-
options: {
|
|
27
|
-
chunkSize: 300,
|
|
28
|
-
sections: [
|
|
29
|
-
['h1', 'Header 1'],
|
|
30
|
-
['h2', 'Header 2'],
|
|
31
|
-
['h3', 'Header 3'],
|
|
32
|
-
['h4', 'Header 4'],
|
|
33
|
-
['h5', 'Header 5'],
|
|
34
|
-
['h6', 'Header 6'],
|
|
35
|
-
['p', 'Paragraph'],
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
await page.close();
|
|
40
|
-
await browser.close();
|
|
41
|
-
if (!docs.getText().length) {
|
|
42
|
-
return { message: 'No content' };
|
|
43
|
-
}
|
|
44
|
-
return { message: docs.getText().join('\n') };
|
|
45
|
-
}
|
|
46
|
-
catch (e) {
|
|
47
|
-
if (e instanceof Error) {
|
|
48
|
-
console.log(`\n${chalk.red(e.message)}`);
|
|
49
|
-
return { message: `Error: ${e.message}` };
|
|
50
|
-
}
|
|
51
|
-
return { message: 'Error' };
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
export const googleSearch = createTool({
|
|
56
|
-
id: 'googleSearch',
|
|
57
|
-
name: 'Google Search',
|
|
58
|
-
description: 'Google Search. Passes the query to Google and returns the search results.',
|
|
59
|
-
inputSchema: z.object({
|
|
60
|
-
query: z.string(),
|
|
61
|
-
}),
|
|
62
|
-
outputSchema: z.object({
|
|
63
|
-
message: z.string(),
|
|
64
|
-
}),
|
|
65
|
-
execute: async ({ context: { query } }) => {
|
|
66
|
-
let browser;
|
|
67
|
-
try {
|
|
68
|
-
browser = await chromium.launch({
|
|
69
|
-
headless: true,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
catch (e) {
|
|
73
|
-
if (e instanceof Error) {
|
|
74
|
-
console.log(`\n${chalk.red(e.message)}`);
|
|
75
|
-
return { message: `Error: ${e.message}` };
|
|
76
|
-
}
|
|
77
|
-
return { message: 'Error' };
|
|
78
|
-
}
|
|
79
|
-
try {
|
|
80
|
-
const page = await browser.newPage();
|
|
81
|
-
await page.goto(`https://www.google.com/search?q=${encodeURIComponent(query)}`);
|
|
82
|
-
console.log(`\n`);
|
|
83
|
-
console.log(chalk.blue('Waiting for search results...'));
|
|
84
|
-
try {
|
|
85
|
-
await page.click('button:has-text("Accept all")', { timeout: 5000 });
|
|
86
|
-
}
|
|
87
|
-
catch (e) {
|
|
88
|
-
// Cookie dialog didn't appear, continue
|
|
89
|
-
}
|
|
90
|
-
// Wait for results and click first organic result
|
|
91
|
-
await page.waitForSelector('#search');
|
|
92
|
-
const text = await page.evaluate(() => {
|
|
93
|
-
const links = [];
|
|
94
|
-
const searchResults = document.querySelectorAll('div.g a');
|
|
95
|
-
searchResults.forEach(link => {
|
|
96
|
-
const href = link.getAttribute('href');
|
|
97
|
-
if (href && href.startsWith('http')) {
|
|
98
|
-
links.push(href);
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
return links;
|
|
102
|
-
});
|
|
103
|
-
await page.close();
|
|
104
|
-
await browser.close();
|
|
105
|
-
if (!text.length) {
|
|
106
|
-
return { message: 'No results' };
|
|
107
|
-
}
|
|
108
|
-
return { message: text.join('\n') };
|
|
109
|
-
}
|
|
110
|
-
catch (e) {
|
|
111
|
-
if (e instanceof Error) {
|
|
112
|
-
console.log(`\n${chalk.red(e.message)}`);
|
|
113
|
-
return { message: `Error: ${e.message}` };
|
|
114
|
-
}
|
|
115
|
-
return { message: `Error` };
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const listEvents: import("@mastra/core").Tool<"listEvents", z.ZodObject<{
|
|
3
|
-
startDate: z.ZodString;
|
|
4
|
-
}, "strip", z.ZodTypeAny, {
|
|
5
|
-
startDate: string;
|
|
6
|
-
}, {
|
|
7
|
-
startDate: string;
|
|
8
|
-
}>, z.ZodObject<{
|
|
9
|
-
content: z.ZodString;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
content: string;
|
|
12
|
-
}, {
|
|
13
|
-
content: string;
|
|
14
|
-
}>, import("@mastra/core").ToolExecutionContext<z.ZodObject<{
|
|
15
|
-
startDate: z.ZodString;
|
|
16
|
-
}, "strip", z.ZodTypeAny, {
|
|
17
|
-
startDate: string;
|
|
18
|
-
}, {
|
|
19
|
-
startDate: string;
|
|
20
|
-
}>, import("@mastra/core").WorkflowContext<any>>>;
|