@mastra/dane 0.0.2-alpha.9 → 0.0.2-alpha.91
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/link-checker.d.ts +4 -0
- package/dist/commands/link-checker.d.ts.map +1 -0
- package/dist/commands/link-checker.js +16 -0
- package/dist/commands/message.d.ts.map +1 -1
- package/dist/commands/message.js +3 -1
- package/dist/commands/new-contributor-message.d.ts +2 -0
- package/dist/commands/new-contributor-message.d.ts.map +1 -0
- package/dist/commands/new-contributor-message.js +43 -0
- 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 +30 -4
- package/dist/mastra/agents/index.d.ts +33 -2
- package/dist/mastra/agents/index.d.ts.map +1 -1
- package/dist/mastra/agents/index.js +62 -25
- package/dist/mastra/agents/model.d.ts +7 -0
- package/dist/mastra/agents/model.d.ts.map +1 -0
- package/dist/mastra/agents/model.js +7 -0
- package/dist/mastra/agents/new-contributor.d.ts +3 -0
- package/dist/mastra/agents/new-contributor.d.ts.map +1 -0
- package/dist/mastra/agents/new-contributor.js +12 -0
- package/dist/mastra/agents/package-publisher.d.ts +65 -0
- package/dist/mastra/agents/package-publisher.d.ts.map +1 -0
- package/dist/mastra/agents/package-publisher.js +172 -0
- package/dist/mastra/index.d.ts +134 -3
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +20 -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 +2 -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 +127 -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/first-contributor.d.ts +16 -0
- package/dist/mastra/workflows/first-contributor.d.ts.map +1 -0
- package/dist/mastra/workflows/first-contributor.js +122 -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/link-checker.d.ts +13 -0
- package/dist/mastra/workflows/link-checker.d.ts.map +1 -0
- package/dist/mastra/workflows/link-checker.js +102 -0
- 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 +260 -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 +12 -9
- package/test-files/716a95a5c57a56d32a32b1c9592d6df0.png +0 -0
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,97 @@ export declare const mastra: Mastra<{
|
|
|
166
169
|
pathRegex: string | null;
|
|
167
170
|
limit?: number | undefined;
|
|
168
171
|
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
169
|
-
|
|
170
|
-
|
|
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
|
+
}, Record<string, import("@mastra/core").Metric>>;
|
|
198
|
+
danePackagePublisher: import("@mastra/core").Agent<{
|
|
199
|
+
pnpmChangesetStatus: import("@mastra/core").Tool<"pnpmChangesetStatus", import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("zod").ZodObject<{
|
|
200
|
+
message: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
201
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
202
|
+
message: string[];
|
|
203
|
+
}, {
|
|
204
|
+
message: string[];
|
|
205
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
206
|
+
pnpmBuild: import("@mastra/core").Tool<"pnpmBuild", import("zod").ZodObject<{
|
|
207
|
+
name: import("zod").ZodString;
|
|
208
|
+
packagePath: import("zod").ZodString;
|
|
209
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
210
|
+
name: string;
|
|
211
|
+
packagePath: string;
|
|
212
|
+
}, {
|
|
213
|
+
name: string;
|
|
214
|
+
packagePath: string;
|
|
215
|
+
}>, import("zod").ZodObject<{
|
|
216
|
+
message: import("zod").ZodString;
|
|
217
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
218
|
+
message: string;
|
|
219
|
+
}, {
|
|
220
|
+
message: string;
|
|
221
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
222
|
+
name: import("zod").ZodString;
|
|
223
|
+
packagePath: import("zod").ZodString;
|
|
224
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
225
|
+
name: string;
|
|
226
|
+
packagePath: string;
|
|
227
|
+
}, {
|
|
228
|
+
name: string;
|
|
229
|
+
packagePath: string;
|
|
230
|
+
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
231
|
+
pnpmChangesetPublish: import("@mastra/core").Tool<"pnpmChangesetPublish", import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("zod").ZodObject<{
|
|
232
|
+
message: import("zod").ZodString;
|
|
233
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
234
|
+
message: string;
|
|
235
|
+
}, {
|
|
236
|
+
message: string;
|
|
237
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
238
|
+
activeDistTag: import("@mastra/core").Tool<"activeDistTag", import("zod").ZodObject<{
|
|
239
|
+
packagePath: import("zod").ZodString;
|
|
240
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
241
|
+
packagePath: string;
|
|
242
|
+
}, {
|
|
243
|
+
packagePath: string;
|
|
244
|
+
}>, import("zod").ZodObject<{
|
|
245
|
+
message: import("zod").ZodString;
|
|
246
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
247
|
+
message: string;
|
|
248
|
+
}, {
|
|
249
|
+
message: string;
|
|
250
|
+
}>, import("@mastra/core").ToolExecutionContext<import("zod").ZodObject<{
|
|
251
|
+
packagePath: import("zod").ZodString;
|
|
252
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
253
|
+
packagePath: string;
|
|
254
|
+
}, {
|
|
255
|
+
packagePath: string;
|
|
256
|
+
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
257
|
+
}, Record<string, import("@mastra/core").Metric>>;
|
|
258
|
+
daneLinkChecker: import("@mastra/core").Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>, Record<string, import("@mastra/core").Metric>>;
|
|
259
|
+
daneIssueLabeler: import("@mastra/core").Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>, Record<string, import("@mastra/core").Metric>>;
|
|
260
|
+
daneCommitMessage: import("@mastra/core").Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>, Record<string, import("@mastra/core").Metric>>;
|
|
261
|
+
daneChangeLog: import("@mastra/core").Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>, Record<string, import("@mastra/core").Metric>>;
|
|
262
|
+
daneNewContributor: import("@mastra/core").Agent<{}, Record<string, import("@mastra/core").Metric>>;
|
|
171
263
|
}, {
|
|
172
264
|
message: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
|
|
173
265
|
resourceid: import("zod").ZodString;
|
|
@@ -192,5 +284,44 @@ export declare const mastra: Mastra<{
|
|
|
192
284
|
owner: string;
|
|
193
285
|
issue_number: number;
|
|
194
286
|
}>>;
|
|
195
|
-
|
|
287
|
+
commitMessage: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
|
|
288
|
+
repoPath: import("zod").ZodString;
|
|
289
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
290
|
+
repoPath: string;
|
|
291
|
+
}, {
|
|
292
|
+
repoPath: string;
|
|
293
|
+
}>>;
|
|
294
|
+
packagePublisher: import("@mastra/core").Workflow<any, any>;
|
|
295
|
+
telephoneGame: import("@mastra/core").Workflow<any, any>;
|
|
296
|
+
changelog: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
|
|
297
|
+
channelId: import("zod").ZodString;
|
|
298
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
299
|
+
channelId: string;
|
|
300
|
+
}, {
|
|
301
|
+
channelId: string;
|
|
302
|
+
}>>;
|
|
303
|
+
githubFirstContributorMessage: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
|
|
304
|
+
repo: import("zod").ZodString;
|
|
305
|
+
owner: import("zod").ZodString;
|
|
306
|
+
pr_number: import("zod").ZodNumber;
|
|
307
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
308
|
+
repo: string;
|
|
309
|
+
owner: string;
|
|
310
|
+
pr_number: number;
|
|
311
|
+
}, {
|
|
312
|
+
repo: string;
|
|
313
|
+
owner: string;
|
|
314
|
+
pr_number: number;
|
|
315
|
+
}>>;
|
|
316
|
+
linkChecker: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
|
|
317
|
+
channelId: import("zod").ZodString;
|
|
318
|
+
targetUrl: import("zod").ZodString;
|
|
319
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
320
|
+
channelId: string;
|
|
321
|
+
targetUrl: string;
|
|
322
|
+
}, {
|
|
323
|
+
channelId: string;
|
|
324
|
+
targetUrl: string;
|
|
325
|
+
}>>;
|
|
326
|
+
}, Record<string, import("@mastra/core").MastraVector>, Record<string, import("@mastra/core").MastraTTS>, import("@mastra/core").Logger>;
|
|
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;AAmBtC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wIA6BjB,CAAC"}
|
package/dist/mastra/index.js
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
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, daneLinkChecker } from './agents/index.js';
|
|
5
|
+
import { daneNewContributor } from './agents/new-contributor.js';
|
|
6
|
+
import { danePackagePublisher } from './agents/package-publisher.js';
|
|
5
7
|
import { firecrawl } from './integrations/index.js';
|
|
6
|
-
import {
|
|
8
|
+
import { changelogWorkflow } from './workflows/changelog.js';
|
|
9
|
+
import { githubFirstContributorMessage } from './workflows/first-contributor.js';
|
|
10
|
+
import { messageWorkflow, githubIssueLabeler, commitMessageGenerator } from './workflows/index.js';
|
|
11
|
+
import { linkCheckerWorkflow } from './workflows/link-checker.js';
|
|
12
|
+
import { packagePublisher } from './workflows/publish-packages.js';
|
|
13
|
+
import { telephoneGameWorkflow } from './workflows/telephone-game.js';
|
|
7
14
|
const engine = new PostgresEngine({
|
|
8
15
|
url: 'postgres://postgres:postgres@localhost:5433/mastra',
|
|
9
16
|
});
|
|
10
17
|
export const mastra = new Mastra({
|
|
11
18
|
agents: {
|
|
12
19
|
dane,
|
|
20
|
+
danePackagePublisher,
|
|
21
|
+
daneLinkChecker,
|
|
13
22
|
daneIssueLabeler,
|
|
23
|
+
daneCommitMessage,
|
|
24
|
+
daneChangeLog,
|
|
25
|
+
daneNewContributor,
|
|
14
26
|
},
|
|
15
27
|
engine,
|
|
16
28
|
memory: new UpstashKVMemory({
|
|
@@ -21,8 +33,13 @@ export const mastra = new Mastra({
|
|
|
21
33
|
workflows: {
|
|
22
34
|
message: messageWorkflow,
|
|
23
35
|
githubIssueLabeler: githubIssueLabeler,
|
|
36
|
+
commitMessage: commitMessageGenerator,
|
|
37
|
+
packagePublisher: packagePublisher,
|
|
38
|
+
telephoneGame: telephoneGameWorkflow,
|
|
39
|
+
changelog: changelogWorkflow,
|
|
40
|
+
githubFirstContributorMessage: githubFirstContributorMessage,
|
|
41
|
+
linkChecker: linkCheckerWorkflow,
|
|
24
42
|
},
|
|
25
|
-
logger: false,
|
|
26
43
|
syncs: {
|
|
27
44
|
...firecrawl.getSyncs(),
|
|
28
45
|
},
|
|
@@ -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
|
},
|
|
@@ -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
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/mastra/tools/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,eAAO,MAAM,KAAK,iBAUhB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MastraMCPClient } from '@mastra/mcp';
|
|
2
|
+
export const slack = new MastraMCPClient({
|
|
3
|
+
name: 'Slack',
|
|
4
|
+
server: {
|
|
5
|
+
command: '/usr/local/bin/docker',
|
|
6
|
+
args: ['run', '-i', '--rm', '-e', 'SLACK_BOT_TOKEN', '-e', 'SLACK_TEAM_ID', 'mcp/slack'],
|
|
7
|
+
env: {
|
|
8
|
+
SLACK_BOT_TOKEN: process.env.SLACK_BOT_TOKEN,
|
|
9
|
+
SLACK_TEAM_ID: process.env.SLACK_TEAM_ID,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdf.d.ts","sourceRoot":"","sources":["../../../src/mastra/tools/pdf.ts"],"names":[],"mappings":"
|
|
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"}
|
package/dist/mastra/tools/pdf.js
CHANGED
|
@@ -2,9 +2,9 @@ import { createTool } from '@mastra/core';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { existsSync, readFileSync } from 'fs';
|
|
4
4
|
import path from 'path';
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
import pdfParse from "pdf-parse/lib/pdf-parse.js";
|
|
7
5
|
import { z } from 'zod';
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
import pdfParse from 'pdf-parse/lib/pdf-parse.js';
|
|
8
8
|
export const readPDF = createTool({
|
|
9
9
|
id: 'readPDF',
|
|
10
10
|
name: 'Read PDF',
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const pnpmBuild: import("@mastra/core").Tool<"pnpmBuild", z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
packagePath: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
name: string;
|
|
7
|
+
packagePath: string;
|
|
8
|
+
}, {
|
|
9
|
+
name: string;
|
|
10
|
+
packagePath: 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
|
+
name: z.ZodString;
|
|
19
|
+
packagePath: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
name: string;
|
|
22
|
+
packagePath: string;
|
|
23
|
+
}, {
|
|
24
|
+
name: string;
|
|
25
|
+
packagePath: string;
|
|
26
|
+
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
27
|
+
export declare const pnpmChangesetStatus: import("@mastra/core").Tool<"pnpmChangesetStatus", z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, z.ZodObject<{
|
|
28
|
+
message: z.ZodArray<z.ZodString, "many">;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
message: string[];
|
|
31
|
+
}, {
|
|
32
|
+
message: string[];
|
|
33
|
+
}>, import("@mastra/core").ToolExecutionContext<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
34
|
+
export declare const pnpmChangesetPublish: import("@mastra/core").Tool<"pnpmChangesetPublish", z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, z.ZodObject<{
|
|
35
|
+
message: z.ZodString;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
message: string;
|
|
38
|
+
}, {
|
|
39
|
+
message: string;
|
|
40
|
+
}>, import("@mastra/core").ToolExecutionContext<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
41
|
+
export declare const activeDistTag: import("@mastra/core").Tool<"activeDistTag", z.ZodObject<{
|
|
42
|
+
packagePath: z.ZodString;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
packagePath: string;
|
|
45
|
+
}, {
|
|
46
|
+
packagePath: string;
|
|
47
|
+
}>, z.ZodObject<{
|
|
48
|
+
message: z.ZodString;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
message: string;
|
|
51
|
+
}, {
|
|
52
|
+
message: string;
|
|
53
|
+
}>, import("@mastra/core").ToolExecutionContext<z.ZodObject<{
|
|
54
|
+
packagePath: z.ZodString;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
packagePath: string;
|
|
57
|
+
}, {
|
|
58
|
+
packagePath: string;
|
|
59
|
+
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
60
|
+
//# sourceMappingURL=pnpm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pnpm.d.ts","sourceRoot":"","sources":["../../../src/mastra/tools/pnpm.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;iDA8BpB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;6IA6B9B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;6IA0B/B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;iDA8BxB,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { createTool } from '@mastra/core';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { execa, ExecaError } from 'execa';
|
|
4
|
+
import { readFileSync } from 'fs';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
export const pnpmBuild = createTool({
|
|
8
|
+
id: 'pnpmBuild',
|
|
9
|
+
name: 'PNPM Build Tool',
|
|
10
|
+
description: 'Used to build the pnpm module',
|
|
11
|
+
inputSchema: z.object({
|
|
12
|
+
name: z.string(),
|
|
13
|
+
packagePath: z.string(),
|
|
14
|
+
}),
|
|
15
|
+
outputSchema: z.object({
|
|
16
|
+
message: z.string(),
|
|
17
|
+
}),
|
|
18
|
+
execute: async ({ context: { name, packagePath } }) => {
|
|
19
|
+
try {
|
|
20
|
+
console.log(chalk.green(`\n Building: ${name} at ${packagePath}`));
|
|
21
|
+
const p = execa(`pnpm`, ['build'], {
|
|
22
|
+
stdio: 'inherit',
|
|
23
|
+
cwd: packagePath,
|
|
24
|
+
reject: false,
|
|
25
|
+
});
|
|
26
|
+
console.log(`\n`);
|
|
27
|
+
await p;
|
|
28
|
+
return { message: 'Done' };
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
console.error(e);
|
|
32
|
+
if (e instanceof ExecaError) {
|
|
33
|
+
return { message: e.message };
|
|
34
|
+
}
|
|
35
|
+
return { message: 'Error' };
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
export const pnpmChangesetStatus = createTool({
|
|
40
|
+
id: 'pnpmChangesetStatus',
|
|
41
|
+
name: 'PNPM Changeset Status Tool',
|
|
42
|
+
description: 'Used to check which pnpm modules need to be published',
|
|
43
|
+
inputSchema: z.object({}),
|
|
44
|
+
outputSchema: z.object({
|
|
45
|
+
message: z.array(z.string()),
|
|
46
|
+
}),
|
|
47
|
+
execute: async () => {
|
|
48
|
+
try {
|
|
49
|
+
console.log(chalk.green(`\nRunning command: pnpm publish -r --dry-run --no-git-checks`));
|
|
50
|
+
const { stdout } = await execa('pnpm', ['publish', '-r', '--dry-run', '--no-git-checks'], {
|
|
51
|
+
all: true,
|
|
52
|
+
// We want to see stderr too since pnpm sometimes puts important info there
|
|
53
|
+
});
|
|
54
|
+
const lines = stdout.split('\n');
|
|
55
|
+
const filteredLines = lines.filter(line => line.startsWith('+'));
|
|
56
|
+
const packages = filteredLines.map(line => line.trim().substring(2).split('@').slice(0, -1).join('@'));
|
|
57
|
+
return { message: packages };
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
console.error(e);
|
|
61
|
+
if (e instanceof ExecaError) {
|
|
62
|
+
return { message: [e.message] };
|
|
63
|
+
}
|
|
64
|
+
return { message: ['Error'] };
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
export const pnpmChangesetPublish = createTool({
|
|
69
|
+
id: 'pnpmChangesetPublish',
|
|
70
|
+
name: 'PNPM Changeset Publish Tool',
|
|
71
|
+
description: 'Used to publish the pnpm module',
|
|
72
|
+
inputSchema: z.object({}),
|
|
73
|
+
outputSchema: z.object({
|
|
74
|
+
message: z.string(),
|
|
75
|
+
}),
|
|
76
|
+
execute: async () => {
|
|
77
|
+
try {
|
|
78
|
+
console.log(chalk.green(`Publishing...`));
|
|
79
|
+
const p = execa(`pnpm`, ['changeset', 'publish'], {
|
|
80
|
+
stdio: 'inherit',
|
|
81
|
+
reject: false,
|
|
82
|
+
});
|
|
83
|
+
console.log(`\n`);
|
|
84
|
+
await p;
|
|
85
|
+
return { message: 'Done' };
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
console.error(e);
|
|
89
|
+
if (e instanceof ExecaError) {
|
|
90
|
+
return { message: e.message };
|
|
91
|
+
}
|
|
92
|
+
return { message: 'Error' };
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
export const activeDistTag = createTool({
|
|
97
|
+
id: 'activeDistTag',
|
|
98
|
+
name: 'PNPM Active Dist Tag Tool',
|
|
99
|
+
description: 'Set active dist tag on pnpm module',
|
|
100
|
+
inputSchema: z.object({
|
|
101
|
+
packagePath: z.string(),
|
|
102
|
+
}),
|
|
103
|
+
outputSchema: z.object({
|
|
104
|
+
message: z.string(),
|
|
105
|
+
}),
|
|
106
|
+
execute: async ({ context }) => {
|
|
107
|
+
try {
|
|
108
|
+
const pkgJson = JSON.parse(readFileSync(path.join(context.packagePath, 'package.json'), 'utf-8'));
|
|
109
|
+
const version = pkgJson.version;
|
|
110
|
+
console.log(chalk.green(`Setting active tag to latest for ${pkgJson.name}@${version}`));
|
|
111
|
+
const p = execa(`npm`, ['dist-tag', `add`, `${pkgJson.name}@${version}`, `latest`], {
|
|
112
|
+
stdio: 'inherit',
|
|
113
|
+
reject: false,
|
|
114
|
+
});
|
|
115
|
+
console.log(`\n`);
|
|
116
|
+
await p;
|
|
117
|
+
return { message: 'Done' };
|
|
118
|
+
}
|
|
119
|
+
catch (e) {
|
|
120
|
+
console.error(e);
|
|
121
|
+
if (e instanceof ExecaError) {
|
|
122
|
+
return { message: e.message };
|
|
123
|
+
}
|
|
124
|
+
return { message: 'Error' };
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Workflow } from '@mastra/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const changelogWorkflow: Workflow<any, z.ZodObject<{
|
|
4
|
+
channelId: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
channelId: string;
|
|
7
|
+
}, {
|
|
8
|
+
channelId: string;
|
|
9
|
+
}>>;
|
|
10
|
+
//# sourceMappingURL=changelog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/changelog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,iBAAiB;;;;;;GAK5B,CAAC"}
|