@mastra/dane 0.0.2-alpha.5 → 0.0.2-alpha.50

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.
Files changed (68) hide show
  1. package/README.md +25 -4
  2. package/data/crawl/conventional-commit.json +25 -0
  3. package/dist/commands/commit-message.d.ts +2 -0
  4. package/dist/commands/commit-message.d.ts.map +1 -0
  5. package/dist/commands/commit-message.js +32 -0
  6. package/dist/commands/config.d.ts +3 -0
  7. package/dist/commands/config.d.ts.map +1 -0
  8. package/dist/commands/config.js +40 -0
  9. package/dist/commands/issue-labeler.d.ts.map +1 -1
  10. package/dist/commands/issue-labeler.js +19 -2
  11. package/dist/commands/message.d.ts.map +1 -1
  12. package/dist/commands/message.js +3 -1
  13. package/dist/commands/publish-packages.d.ts +2 -0
  14. package/dist/commands/publish-packages.d.ts.map +1 -0
  15. package/dist/commands/publish-packages.js +10 -0
  16. package/dist/commands/telephone-game.d.ts +2 -0
  17. package/dist/commands/telephone-game.d.ts.map +1 -0
  18. package/dist/commands/telephone-game.js +32 -0
  19. package/dist/config/index.d.ts +12 -0
  20. package/dist/config/index.d.ts.map +1 -0
  21. package/dist/config/index.js +75 -0
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +19 -2
  24. package/dist/mastra/agents/index.d.ts +114 -0
  25. package/dist/mastra/agents/index.d.ts.map +1 -1
  26. package/dist/mastra/agents/index.js +54 -24
  27. package/dist/mastra/index.d.ts +124 -1
  28. package/dist/mastra/index.d.ts.map +1 -1
  29. package/dist/mastra/index.js +9 -3
  30. package/dist/mastra/integrations/index.d.ts +2 -0
  31. package/dist/mastra/integrations/index.d.ts.map +1 -1
  32. package/dist/mastra/integrations/index.js +19 -2
  33. package/dist/mastra/tools/crawl.d.ts +3 -0
  34. package/dist/mastra/tools/crawl.d.ts.map +1 -1
  35. package/dist/mastra/tools/crawl.js +4 -2
  36. package/dist/mastra/tools/execa.d.ts.map +1 -1
  37. package/dist/mastra/tools/execa.js +5 -1
  38. package/dist/mastra/tools/image.d.ts +27 -0
  39. package/dist/mastra/tools/image.d.ts.map +1 -0
  40. package/dist/mastra/tools/image.js +37 -0
  41. package/dist/mastra/tools/pdf.d.ts.map +1 -1
  42. package/dist/mastra/tools/pdf.js +3 -2
  43. package/dist/mastra/tools/pnpm.d.ts +60 -0
  44. package/dist/mastra/tools/pnpm.d.ts.map +1 -0
  45. package/dist/mastra/tools/pnpm.js +128 -0
  46. package/dist/mastra/workflows/chat.d.ts.map +1 -1
  47. package/dist/mastra/workflows/chat.js +6 -11
  48. package/dist/mastra/workflows/commit-message.d.ts +10 -0
  49. package/dist/mastra/workflows/commit-message.d.ts.map +1 -0
  50. package/dist/mastra/workflows/commit-message.js +137 -0
  51. package/dist/mastra/workflows/index.d.ts +1 -0
  52. package/dist/mastra/workflows/index.d.ts.map +1 -1
  53. package/dist/mastra/workflows/index.js +1 -0
  54. package/dist/mastra/workflows/issue-labeler.js +1 -1
  55. package/dist/mastra/workflows/publish-packages.d.ts +3 -0
  56. package/dist/mastra/workflows/publish-packages.d.ts.map +1 -0
  57. package/dist/mastra/workflows/publish-packages.js +205 -0
  58. package/dist/mastra/workflows/telephone-game.d.ts +3 -0
  59. package/dist/mastra/workflows/telephone-game.d.ts.map +1 -0
  60. package/dist/mastra/workflows/telephone-game.js +95 -0
  61. package/package.json +15 -10
  62. package/test/data/05-versions-space.pdf +0 -0
  63. package/test/data/05-versions-space.pdf.txt +42 -0
  64. package/test-files/716a95a5c57a56d32a32b1c9592d6df0.png +0 -0
  65. package/test-files/roman.md +79 -0
  66. package/test-files/sample-1.pdf +0 -0
  67. package/test-files/taxes/2022.txt +45 -0
  68. package/test-files/taxes/2023.txt +44 -0
@@ -1,5 +1,91 @@
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
+ }>;
3
89
  export declare const dane: Agent<{
4
90
  fsTool: import("@mastra/core").Tool<"fsTool", import("zod").ZodObject<{
5
91
  action: import("zod").ZodString;
@@ -147,10 +233,13 @@ export declare const dane: Agent<{
147
233
  limit?: number | undefined;
148
234
  }>, import("zod").ZodObject<{
149
235
  message: import("zod").ZodString;
236
+ crawlData: import("zod").ZodAny;
150
237
  }, "strip", import("zod").ZodTypeAny, {
151
238
  message: string;
239
+ crawlData?: any;
152
240
  }, {
153
241
  message: string;
242
+ crawlData?: any;
154
243
  }>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
155
244
  url: import("zod").ZodString;
156
245
  limit: import("zod").ZodDefault<import("zod").ZodNumber>;
@@ -164,5 +253,30 @@ export declare const dane: Agent<{
164
253
  pathRegex: string | null;
165
254
  limit?: number | undefined;
166
255
  }>, import("@mastra/core").WorkflowContext<any>>>;
256
+ imageTool: import("@mastra/core").Tool<"imageTool", import("zod").ZodObject<{
257
+ directory: import("zod").ZodString;
258
+ prompt: import("zod").ZodString;
259
+ }, "strip", import("zod").ZodTypeAny, {
260
+ directory: string;
261
+ prompt: string;
262
+ }, {
263
+ directory: string;
264
+ prompt: string;
265
+ }>, import("zod").ZodObject<{
266
+ message: import("zod").ZodString;
267
+ }, "strip", import("zod").ZodTypeAny, {
268
+ message: string;
269
+ }, {
270
+ message: string;
271
+ }>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
272
+ directory: import("zod").ZodString;
273
+ prompt: import("zod").ZodString;
274
+ }, "strip", import("zod").ZodTypeAny, {
275
+ directory: string;
276
+ prompt: string;
277
+ }, {
278
+ directory: string;
279
+ prompt: string;
280
+ }>, import("@mastra/core").WorkflowContext<any>>>;
167
281
  }>;
168
282
  //# 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;AASrC,eAAO,MAAM,gBAAgB,8EAW3B,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDf,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,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuDf,CAAC"}
@@ -1,20 +1,51 @@
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
- provider: 'ANTHROPIC',
16
- toolChoice: 'auto',
17
- name: 'claude-3-5-sonnet-20241022',
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
  });
20
51
  export const dane = new Agent({
@@ -26,42 +57,42 @@ export const dane = new Agent({
26
57
  DO NOT ATTEMPT TO USE GENERAL KNOWLEDGE! We are only as good as the tools we use.
27
58
 
28
59
  # Our tools:
29
-
60
+
30
61
  ## readPDF
31
62
  Makes you a powerful agent capable of reading PDF files.
32
63
 
33
64
  ## fsTool
34
65
  Makes you a powerful agent capable of reading and writing files to the local filesystem.
35
-
66
+
36
67
  ## execaTool
37
- Makes you a powerful agent capabale of executing files on the local system.
38
-
39
- ## googleSearch
68
+ Makes you a powerful agent capabale of executing files on the local system.
69
+
70
+ ## googleSearch
40
71
  Makes you a powerful agent capabale answering all questions by finding the answer on Google search.
41
72
  Pass the query as a JS object. If you have links, ALWAYS CITE YOUR SOURCES.
42
-
73
+
43
74
  ## browserTool
44
- Makes you a powerful agent capable of scraping the web. Pass the url as a JS object.
75
+ Makes you a powerful agent capable of scraping the web. Pass the url as a JS object.
45
76
 
46
77
  ## listEvents
47
- Makes you a powerful agent capable of listing events on a calendar. When using this tool ONLY RETURN RELEVANT EVENTS.
78
+ Makes you a powerful agent capable of listing events on a calendar. When using this tool ONLY RETURN RELEVANT EVENTS.
48
79
  DO NOT ATTEMPT TO DO ANYTHING MORE.
49
80
 
50
81
  ## crawl
51
82
  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
-
83
+ Makes you a powerful agent capable of crawling a site and extracting markdown metadata.
84
+ The data will be stored in a database if it is not already there. Confirm that it is sucessful.
85
+ The crawled data will be returned in the response on the 'crawlData' field.
86
+
87
+ ## imageTool
88
+ Makes you a powerful agent capable of generating images and saving them to disk. Pass the directory and an image prompt.
89
+
55
90
  # Rules
56
91
  * 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.
92
+ * Don't reference tools when you communicate with the user. Do not mention what tools you are using.
58
93
  * Tell the user what you are doing.
59
94
  `,
60
- model: {
61
- provider: 'ANTHROPIC',
62
- toolChoice: 'auto',
63
- name: 'claude-3-5-sonnet-20241022',
64
- },
95
+ model: getBaseModelConfig(),
65
96
  tools: {
66
97
  fsTool,
67
98
  execaTool,
@@ -70,7 +101,6 @@ export const dane = new Agent({
70
101
  readPDF,
71
102
  listEvents,
72
103
  crawl,
73
- // TODO I SHOULD BE ABLE TO PASS A WORKFLOW EXECUTE HERE
74
- // browserAgentRelay,
104
+ imageTool,
75
105
  },
76
106
  });
@@ -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,119 @@ 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>>>;
171
285
  }, {
172
286
  message: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
173
287
  resourceid: import("zod").ZodString;
@@ -192,5 +306,14 @@ export declare const mastra: Mastra<{
192
306
  owner: string;
193
307
  issue_number: number;
194
308
  }>>;
195
- }, import("@mastra/core").BaseLogger<import("@mastra/core").BaseLogMessage>>;
309
+ commitMessage: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
310
+ repoPath: import("zod").ZodString;
311
+ }, "strip", import("zod").ZodTypeAny, {
312
+ repoPath: string;
313
+ }, {
314
+ repoPath: string;
315
+ }>>;
316
+ packagePublisher: import("@mastra/core").Workflow<any, any>;
317
+ telephoneGame: import("@mastra/core").Workflow<any, any>;
318
+ }, Record<string, import("@mastra/core").MastraVector>, import("@mastra/core").BaseLogger<import("@mastra/core").BaseLogMessage>>;
196
319
  //# 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;AAYtC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAmBjB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mastra/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AActC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iIAuBjB,CAAC"}
@@ -1,16 +1,20 @@
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, daneCommitMessage, daneIssueLabeler, danePackagePublisher } from './agents/index.js';
5
5
  import { firecrawl } from './integrations/index.js';
6
- import { messageWorkflow, githubIssueLabeler } from './workflows/index.js';
6
+ import { messageWorkflow, githubIssueLabeler, commitMessageGenerator } from './workflows/index.js';
7
+ import { packagePublisher } from './workflows/publish-packages.js';
8
+ import { telephoneGameWorkflow } from './workflows/telephone-game.js';
7
9
  const engine = new PostgresEngine({
8
10
  url: 'postgres://postgres:postgres@localhost:5433/mastra',
9
11
  });
10
12
  export const mastra = new Mastra({
11
13
  agents: {
12
14
  dane,
15
+ danePackagePublisher,
13
16
  daneIssueLabeler,
17
+ daneCommitMessage,
14
18
  },
15
19
  engine,
16
20
  memory: new UpstashKVMemory({
@@ -21,8 +25,10 @@ export const mastra = new Mastra({
21
25
  workflows: {
22
26
  message: messageWorkflow,
23
27
  githubIssueLabeler: githubIssueLabeler,
28
+ commitMessage: commitMessageGenerator,
29
+ packagePublisher: packagePublisher,
30
+ telephoneGame: telephoneGameWorkflow,
24
31
  },
25
- logger: false,
26
32
  syncs: {
27
33
  ...firecrawl.getSyncs(),
28
34
  },
@@ -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;AAEnD,eAAO,MAAM,SAAS,sBAIpB,CAAC;AAEH,eAAO,MAAM,MAAM,mBAIjB,CAAA"}
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: process.env.FIRECRAWL_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: process.env.GITHUB_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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAsBhB,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;;;;iDAwBpB,CAAC"}
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
  },
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ export declare const imageTool: import("@mastra/core").Tool<"imageTool", z.ZodObject<{
3
+ directory: z.ZodString;
4
+ prompt: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ directory: string;
7
+ prompt: string;
8
+ }, {
9
+ directory: string;
10
+ prompt: string;
11
+ }>, z.ZodObject<{
12
+ message: z.ZodString;
13
+ }, "strip", z.ZodTypeAny, {
14
+ message: string;
15
+ }, {
16
+ message: string;
17
+ }>, import("@mastra/core").ToolExecutionContext<z.ZodObject<{
18
+ directory: z.ZodString;
19
+ prompt: z.ZodString;
20
+ }, "strip", z.ZodTypeAny, {
21
+ directory: string;
22
+ prompt: string;
23
+ }, {
24
+ directory: string;
25
+ prompt: string;
26
+ }>, import("@mastra/core").WorkflowContext<any>>>;
27
+ //# sourceMappingURL=image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/mastra/tools/image.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;iDAgCpB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { createTool } from '@mastra/core';
2
+ import chalk from 'chalk';
3
+ import { writeFileSync } from 'fs';
4
+ import { resolve } from 'path';
5
+ import { z } from 'zod';
6
+ import { stabilityai } from '../integrations/index.js';
7
+ export const imageTool = createTool({
8
+ id: 'imageTool',
9
+ name: 'imageTool',
10
+ description: 'Generate an image based on a text prompt',
11
+ inputSchema: z.object({
12
+ directory: z.string(),
13
+ prompt: z.string(),
14
+ }),
15
+ outputSchema: z.object({
16
+ message: z.string(),
17
+ }),
18
+ execute: async ({ context: { directory, prompt } }) => {
19
+ try {
20
+ console.log('\n' + chalk.blue(`Generating image...`));
21
+ const generateImageResult = await stabilityai.generateImage(prompt);
22
+ const file = resolve(directory, generateImageResult.filename);
23
+ writeFileSync(file, generateImageResult.buffer);
24
+ console.log(chalk.blue(`Successfully generated: ${file}`));
25
+ return {
26
+ message: `Successfully created ${file}`,
27
+ };
28
+ }
29
+ catch (e) {
30
+ if (e instanceof Error) {
31
+ console.log(`\n${chalk.red(e.message)}`);
32
+ return { message: e.message };
33
+ }
34
+ return { message: 'Error' };
35
+ }
36
+ },
37
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"pdf.d.ts","sourceRoot":"","sources":["../../../src/mastra/tools/pdf.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;iDAsClB,CAAC"}
1
+ {"version":3,"file":"pdf.d.ts","sourceRoot":"","sources":["../../../src/mastra/tools/pdf.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;iDAsClB,CAAC"}