@mastra/dane 0.0.2-alpha.10 → 0.0.2-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mastra/agents/index.d.ts +25 -0
- package/dist/mastra/agents/index.d.ts.map +1 -1
- package/dist/mastra/agents/index.js +5 -0
- package/dist/mastra/index.d.ts +25 -0
- package/dist/mastra/index.d.ts.map +1 -1
- 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 +6 -0
- package/dist/mastra/tools/execa.d.ts.map +1 -1
- package/dist/mastra/tools/execa.js +4 -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/package.json +8 -7
- package/test-files/716a95a5c57a56d32a32b1c9592d6df0.png +0 -0
|
@@ -164,5 +164,30 @@ export declare const dane: Agent<{
|
|
|
164
164
|
pathRegex: string | null;
|
|
165
165
|
limit?: number | undefined;
|
|
166
166
|
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
167
|
+
imageTool: import("@mastra/core").Tool<"imageTool", import("zod").ZodObject<{
|
|
168
|
+
directory: import("zod").ZodString;
|
|
169
|
+
prompt: import("zod").ZodString;
|
|
170
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
171
|
+
directory: string;
|
|
172
|
+
prompt: string;
|
|
173
|
+
}, {
|
|
174
|
+
directory: string;
|
|
175
|
+
prompt: string;
|
|
176
|
+
}>, import("zod").ZodObject<{
|
|
177
|
+
message: import("zod").ZodString;
|
|
178
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
179
|
+
message: string;
|
|
180
|
+
}, {
|
|
181
|
+
message: string;
|
|
182
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
183
|
+
directory: import("zod").ZodString;
|
|
184
|
+
prompt: import("zod").ZodString;
|
|
185
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
186
|
+
directory: string;
|
|
187
|
+
prompt: string;
|
|
188
|
+
}, {
|
|
189
|
+
directory: string;
|
|
190
|
+
prompt: string;
|
|
191
|
+
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
167
192
|
}>;
|
|
168
193
|
//# 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;AAUrC,eAAO,MAAM,gBAAgB,8EAW3B,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4Df,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { crawl } from '../tools/crawl.js';
|
|
|
5
5
|
import { execaTool } from '../tools/execa.js';
|
|
6
6
|
import { fsTool } from '../tools/fs.js';
|
|
7
7
|
import { readPDF } from '../tools/pdf.js';
|
|
8
|
+
import { imageTool } from '../tools/image.js';
|
|
8
9
|
export const daneIssueLabeler = new Agent({
|
|
9
10
|
name: 'DaneIssueLabeler',
|
|
10
11
|
instructions: `
|
|
@@ -51,6 +52,9 @@ export const dane = new Agent({
|
|
|
51
52
|
Use this when the user asks you to crawl. CRAWL is the signal to use this tool.
|
|
52
53
|
Makes you a powerful agent capable of crawling a site and extracting markdown metadata.
|
|
53
54
|
The data will be stored in a database. Confirm that it is sucessful.
|
|
55
|
+
|
|
56
|
+
## imageTool
|
|
57
|
+
Makes you a powerful agent capable of generating images and saving them to disk. Pass the directory and an image prompt.
|
|
54
58
|
|
|
55
59
|
# Rules
|
|
56
60
|
* DO NOT ATTEMPT TO USE GENERAL KNOWLEDGE. Use the 'googleSearch' tool to find the answer.
|
|
@@ -70,6 +74,7 @@ export const dane = new Agent({
|
|
|
70
74
|
readPDF,
|
|
71
75
|
listEvents,
|
|
72
76
|
crawl,
|
|
77
|
+
imageTool
|
|
73
78
|
// TODO I SHOULD BE ABLE TO PASS A WORKFLOW EXECUTE HERE
|
|
74
79
|
// browserAgentRelay,
|
|
75
80
|
},
|
package/dist/mastra/index.d.ts
CHANGED
|
@@ -166,6 +166,31 @@ export declare const mastra: Mastra<{
|
|
|
166
166
|
pathRegex: string | null;
|
|
167
167
|
limit?: number | undefined;
|
|
168
168
|
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
169
|
+
imageTool: import("@mastra/core").Tool<"imageTool", import("zod").ZodObject<{
|
|
170
|
+
directory: import("zod").ZodString;
|
|
171
|
+
prompt: import("zod").ZodString;
|
|
172
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
173
|
+
directory: string;
|
|
174
|
+
prompt: string;
|
|
175
|
+
}, {
|
|
176
|
+
directory: string;
|
|
177
|
+
prompt: string;
|
|
178
|
+
}>, import("zod").ZodObject<{
|
|
179
|
+
message: import("zod").ZodString;
|
|
180
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
181
|
+
message: string;
|
|
182
|
+
}, {
|
|
183
|
+
message: string;
|
|
184
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
185
|
+
directory: import("zod").ZodString;
|
|
186
|
+
prompt: import("zod").ZodString;
|
|
187
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
188
|
+
directory: string;
|
|
189
|
+
prompt: string;
|
|
190
|
+
}, {
|
|
191
|
+
directory: string;
|
|
192
|
+
prompt: string;
|
|
193
|
+
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
169
194
|
}>;
|
|
170
195
|
daneIssueLabeler: import("@mastra/core").Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>>;
|
|
171
196
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mastra/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,cAAc,CAAC;AAYpD,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mastra/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,cAAc,CAAC;AAYpD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+EAsBjB,CAAC"}
|
|
@@ -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,CAAA;AAE5D,eAAO,MAAM,SAAS,sBAIpB,CAAC;AAEH,eAAO,MAAM,MAAM,mBAIjB,CAAA;AAEF,eAAO,MAAM,WAAW,wBAItB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FirecrawlIntegration } from "@mastra/firecrawl";
|
|
2
2
|
import { GithubIntegration } from "@mastra/github";
|
|
3
|
+
import { StabilityAiIntegration } from "@mastra/stabilityai";
|
|
3
4
|
export const firecrawl = new FirecrawlIntegration({
|
|
4
5
|
config: {
|
|
5
6
|
API_KEY: process.env.FIRECRAWL_API_KEY,
|
|
@@ -10,3 +11,8 @@ export const github = new GithubIntegration({
|
|
|
10
11
|
PERSONAL_ACCESS_TOKEN: process.env.GITHUB_PERSONAL_ACCESS_TOKEN,
|
|
11
12
|
}
|
|
12
13
|
});
|
|
14
|
+
export const stabilityai = new StabilityAiIntegration({
|
|
15
|
+
config: {
|
|
16
|
+
API_KEY: process.env.STABILITYAI_API_KEY,
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;iDA2BpB,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
|
|
@@ -33,6 +33,9 @@ export const execaTool = createTool({
|
|
|
33
33
|
return { message: r.stdout };
|
|
34
34
|
}
|
|
35
35
|
catch (e) {
|
|
36
|
+
if (e instanceof ExecaError) {
|
|
37
|
+
return { message: e.message };
|
|
38
|
+
}
|
|
36
39
|
return { message: 'Error' };
|
|
37
40
|
}
|
|
38
41
|
},
|
|
@@ -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":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;iDAgCpB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createTool } from '@mastra/core';
|
|
3
|
+
import { stabilityai } from "../integrations";
|
|
4
|
+
import { writeFileSync } from "fs";
|
|
5
|
+
import { resolve } from "path";
|
|
6
|
+
import chalk from 'chalk';
|
|
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
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/dane",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.11",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -37,12 +37,13 @@
|
|
|
37
37
|
"sqlite3": "^5.1.7",
|
|
38
38
|
"typescript": "^5.5.4",
|
|
39
39
|
"zod": "^3.24.0",
|
|
40
|
-
"@mastra/core": "0.1.27-alpha.
|
|
41
|
-
"@mastra/engine": "0.0.5-alpha.
|
|
42
|
-
"@mastra/
|
|
43
|
-
"@mastra/
|
|
44
|
-
"@mastra/
|
|
45
|
-
"@mastra/
|
|
40
|
+
"@mastra/core": "0.1.27-alpha.43",
|
|
41
|
+
"@mastra/engine": "0.0.5-alpha.37",
|
|
42
|
+
"@mastra/firecrawl": "1.0.4-alpha.28",
|
|
43
|
+
"@mastra/github": "1.0.3-alpha.27",
|
|
44
|
+
"@mastra/stabilityai": "1.0.1-alpha.18",
|
|
45
|
+
"@mastra/memory": "0.0.2-alpha.22",
|
|
46
|
+
"@mastra/rag": "0.0.2-alpha.27"
|
|
46
47
|
},
|
|
47
48
|
"scripts": {
|
|
48
49
|
"build": "npx tsc",
|
|
Binary file
|