@mastra/dane 0.0.2-alpha.12 → 0.0.2-alpha.14
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/commands/commit-message.d.ts +2 -0
- package/dist/commands/commit-message.d.ts.map +1 -0
- package/dist/commands/commit-message.js +31 -0
- package/dist/index.js +5 -3
- package/dist/mastra/agents/index.d.ts +1 -0
- package/dist/mastra/agents/index.d.ts.map +1 -1
- package/dist/mastra/agents/index.js +18 -0
- package/dist/mastra/index.d.ts +9 -1
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +6 -7
- package/dist/mastra/tools/image.d.ts.map +1 -1
- package/dist/mastra/tools/image.js +4 -4
- package/dist/mastra/tools/pdf.d.ts.map +1 -1
- package/dist/mastra/tools/pdf.js +2 -2
- package/dist/mastra/workflows/chat.d.ts.map +1 -1
- package/dist/mastra/workflows/chat.js +5 -9
- 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 +105 -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/package.json +9 -10
- package/dist/mastra/workflows/commit.d.ts +0 -1
- package/dist/mastra/workflows/commit.d.ts.map +0 -1
- package/dist/mastra/workflows/commit.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit-message.d.ts","sourceRoot":"","sources":["../../src/commands/commit-message.ts"],"names":[],"mappings":"AAKA,wBAAsB,oBAAoB,kBAgCzC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { execSync } from 'child_process';
|
|
3
|
+
import { mastra } from '../mastra/index.js';
|
|
4
|
+
export async function commitMessageCommand() {
|
|
5
|
+
console.log(chalk.green("Hi! I'm Dane!"));
|
|
6
|
+
console.log(chalk.green('Let me generate a commit message for you..\n'));
|
|
7
|
+
try {
|
|
8
|
+
const workflow = mastra.getWorkflow('commitMessage');
|
|
9
|
+
if (!workflow) {
|
|
10
|
+
console.error(chalk.red('Commit message workflow not found. Make sure it is properly set up.'));
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
// Get the current path
|
|
14
|
+
const currentPath = execSync('pwd', { encoding: 'utf-8' }).trim();
|
|
15
|
+
const result = await workflow.execute({
|
|
16
|
+
triggerData: {
|
|
17
|
+
repoPath: currentPath,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
const errorMessage = Object.values(result.results).find(result => result.status === 'failed')?.error;
|
|
21
|
+
if (result.results?.commit?.status !== 'success') {
|
|
22
|
+
console.error(chalk.red(`\n${errorMessage}`));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
console.log(chalk.green('\nCommit message generated and committed successfully'));
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error(chalk.red('Error:', error?.message || 'An unknown error occurred'));
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
import dotenv from 'dotenv';
|
|
3
|
-
dotenv.config();
|
|
4
|
-
process.env.NODE_NO_WARNINGS = '1';
|
|
5
2
|
import { Command } from 'commander';
|
|
3
|
+
import dotenv from 'dotenv';
|
|
4
|
+
import { commitMessageCommand } from './commands/commit-message.js';
|
|
6
5
|
import { issueLabelerCommand } from './commands/issue-labeler.js';
|
|
7
6
|
import { message } from './commands/message.js';
|
|
7
|
+
dotenv.config();
|
|
8
|
+
process.env.NODE_NO_WARNINGS = '1';
|
|
8
9
|
const program = new Command();
|
|
9
10
|
program.command('chat').action(message);
|
|
10
11
|
program.command('issue-labeler').action(issueLabelerCommand);
|
|
12
|
+
program.command('commit').action(commitMessageCommand);
|
|
11
13
|
program.parse(process.argv);
|
|
@@ -1,4 +1,5 @@
|
|
|
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>>>;
|
|
3
4
|
export declare const dane: Agent<{
|
|
4
5
|
fsTool: import("@mastra/core").Tool<"fsTool", import("zod").ZodObject<{
|
|
@@ -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;AAUrC,eAAO,MAAM,gBAAgB,8EAW3B,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4Df,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,iBAAiB,8EAiB5B,CAAC;AAEH,eAAO,MAAM,gBAAgB,8EAW3B,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4Df,CAAC"}
|
|
@@ -6,6 +6,24 @@ import { execaTool } from '../tools/execa.js';
|
|
|
6
6
|
import { fsTool } from '../tools/fs.js';
|
|
7
7
|
import { imageTool } from '../tools/image.js';
|
|
8
8
|
import { readPDF } from '../tools/pdf.js';
|
|
9
|
+
export const daneCommitMessage = new Agent({
|
|
10
|
+
name: 'DaneCommitMessage',
|
|
11
|
+
instructions: `
|
|
12
|
+
You are Dane, the ultimate GitHub operator.
|
|
13
|
+
You help engineers generate commit messages.
|
|
14
|
+
|
|
15
|
+
GENERATE MESSAGES ACCORDING TO THE GIT COMMIT MESSAGE CONVENTION.
|
|
16
|
+
|
|
17
|
+
GENERATE A SCOPE FOR THE COMMIT MESSAGE IF NECESSARY.
|
|
18
|
+
|
|
19
|
+
FIGURE OUT THE BEST TOP LEVEL SEMANTIC MATCH TO USE AS THE SCOPE.
|
|
20
|
+
`,
|
|
21
|
+
model: {
|
|
22
|
+
provider: 'ANTHROPIC',
|
|
23
|
+
toolChoice: 'auto',
|
|
24
|
+
name: 'claude-3-5-sonnet-20241022',
|
|
25
|
+
},
|
|
26
|
+
});
|
|
9
27
|
export const daneIssueLabeler = new Agent({
|
|
10
28
|
name: 'DaneIssueLabeler',
|
|
11
29
|
instructions: `
|
package/dist/mastra/index.d.ts
CHANGED
|
@@ -193,6 +193,7 @@ export declare const mastra: Mastra<{
|
|
|
193
193
|
}>, import("@mastra/core").WorkflowContext<any>>>;
|
|
194
194
|
}>;
|
|
195
195
|
daneIssueLabeler: import("@mastra/core").Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>>;
|
|
196
|
+
daneCommitMessage: import("@mastra/core").Agent<Record<string, import("@mastra/core").ToolAction<any, any, any, any>>>;
|
|
196
197
|
}, {
|
|
197
198
|
message: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
|
|
198
199
|
resourceid: import("zod").ZodString;
|
|
@@ -217,5 +218,12 @@ export declare const mastra: Mastra<{
|
|
|
217
218
|
owner: string;
|
|
218
219
|
issue_number: number;
|
|
219
220
|
}>>;
|
|
220
|
-
|
|
221
|
+
commitMessage: import("@mastra/core").Workflow<any, import("zod").ZodObject<{
|
|
222
|
+
repoPath: import("zod").ZodString;
|
|
223
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
224
|
+
repoPath: string;
|
|
225
|
+
}, {
|
|
226
|
+
repoPath: string;
|
|
227
|
+
}>>;
|
|
228
|
+
}, import("@mastra/core").BaseLogger<import("@mastra/core").BaseLogMessage>>;
|
|
221
229
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mastra/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAqBjB,CAAC"}
|
package/dist/mastra/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
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 } 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
7
|
const engine = new PostgresEngine({
|
|
8
8
|
url: 'postgres://postgres:postgres@localhost:5433/mastra',
|
|
9
9
|
});
|
|
@@ -11,6 +11,7 @@ export const mastra = new Mastra({
|
|
|
11
11
|
agents: {
|
|
12
12
|
dane,
|
|
13
13
|
daneIssueLabeler,
|
|
14
|
+
daneCommitMessage,
|
|
14
15
|
},
|
|
15
16
|
engine,
|
|
16
17
|
memory: new UpstashKVMemory({
|
|
@@ -21,11 +22,9 @@ export const mastra = new Mastra({
|
|
|
21
22
|
workflows: {
|
|
22
23
|
message: messageWorkflow,
|
|
23
24
|
githubIssueLabeler: githubIssueLabeler,
|
|
25
|
+
commitMessage: commitMessageGenerator,
|
|
24
26
|
},
|
|
25
|
-
logger:
|
|
26
|
-
level: 'DEBUG',
|
|
27
|
-
type: 'CONSOLE'
|
|
28
|
-
}),
|
|
27
|
+
logger: false,
|
|
29
28
|
syncs: {
|
|
30
29
|
...firecrawl.getSyncs(),
|
|
31
30
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/mastra/tools/image.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { createTool } from '@mastra/core';
|
|
3
|
-
import { stabilityai } from "../integrations";
|
|
4
|
-
import { writeFileSync } from "fs";
|
|
5
|
-
import { resolve } from "path";
|
|
6
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
7
|
export const imageTool = createTool({
|
|
8
8
|
id: 'imageTool',
|
|
9
9
|
name: 'imageTool',
|
|
@@ -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',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/chat.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/chat.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,eAAe;;;;;;;;;GAM1B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { input } from '@inquirer/prompts';
|
|
1
2
|
import { Step, Workflow } from '@mastra/core';
|
|
2
3
|
import chalk from 'chalk';
|
|
3
|
-
import inquirer from 'inquirer';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { dane } from '../agents/index.js';
|
|
6
6
|
export const messageWorkflow = new Workflow({
|
|
@@ -16,14 +16,10 @@ const messageStep = new Step({
|
|
|
16
16
|
message: z.string(),
|
|
17
17
|
}),
|
|
18
18
|
execute: async () => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
message: '\n You:',
|
|
24
|
-
validate: input => input.trim().length > 0 || 'Message cannot be empty',
|
|
25
|
-
},
|
|
26
|
-
]);
|
|
19
|
+
const content = await input({
|
|
20
|
+
message: '\n You:',
|
|
21
|
+
validate: input => input.trim().length > 0 || 'Message cannot be empty',
|
|
22
|
+
});
|
|
27
23
|
return { message: content };
|
|
28
24
|
},
|
|
29
25
|
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Workflow } from '@mastra/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const commitMessageGenerator: Workflow<any, z.ZodObject<{
|
|
4
|
+
repoPath: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
repoPath: string;
|
|
7
|
+
}, {
|
|
8
|
+
repoPath: string;
|
|
9
|
+
}>>;
|
|
10
|
+
//# sourceMappingURL=commit-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit-message.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/commit-message.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,sBAAsB;;;;;;GAKjC,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { confirm } from '@inquirer/prompts';
|
|
2
|
+
import { Step, Workflow } from '@mastra/core';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { execSync } from 'child_process';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export const commitMessageGenerator = new Workflow({
|
|
7
|
+
name: 'commit-message',
|
|
8
|
+
triggerSchema: z.object({
|
|
9
|
+
repoPath: z.string(),
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
12
|
+
const getDiff = new Step({
|
|
13
|
+
id: 'getDiff',
|
|
14
|
+
outputSchema: z.object({
|
|
15
|
+
diff: z.string(),
|
|
16
|
+
}),
|
|
17
|
+
execute: async ({ context }) => {
|
|
18
|
+
const repoPath = context?.machineContext?.triggerData?.repoPath;
|
|
19
|
+
// Get the git diff of staged changes
|
|
20
|
+
const diff = execSync('git diff --staged', {
|
|
21
|
+
cwd: repoPath,
|
|
22
|
+
encoding: 'utf-8',
|
|
23
|
+
});
|
|
24
|
+
return { diff };
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
const generateMessage = new Step({
|
|
28
|
+
id: 'generateMessage',
|
|
29
|
+
outputSchema: z.object({
|
|
30
|
+
commitMessage: z.string(),
|
|
31
|
+
generated: z.boolean(),
|
|
32
|
+
}),
|
|
33
|
+
execute: async ({ context, mastra }) => {
|
|
34
|
+
const parentStep = context?.machineContext?.stepResults?.getDiff;
|
|
35
|
+
if (!parentStep || parentStep.status !== 'success') {
|
|
36
|
+
return { commitMessage: '', generated: false };
|
|
37
|
+
}
|
|
38
|
+
const daneCommitGenerator = mastra?.agents?.daneCommitMessage;
|
|
39
|
+
const res = await daneCommitGenerator?.generate(`
|
|
40
|
+
Given this git diff:
|
|
41
|
+
${parentStep.payload.diff}
|
|
42
|
+
|
|
43
|
+
IF THE DIFF IS EMPTY, RETURN "No staged changes found", AND SET GENERATED TO FALSE,
|
|
44
|
+
OTHERWISE, SET GENERATED TO TRUE
|
|
45
|
+
|
|
46
|
+
Please generate a concise and descriptive commit message that follows these guidelines:
|
|
47
|
+
- Start with a verb in the present tense
|
|
48
|
+
- Be specific but concise
|
|
49
|
+
- Focus on the "what" and "why" of the changes
|
|
50
|
+
- Keep the first line under 50 characters
|
|
51
|
+
- If needed, add more detailed description after a blank line
|
|
52
|
+
`, {
|
|
53
|
+
schema: z.object({
|
|
54
|
+
commitMessage: z.string(),
|
|
55
|
+
generated: z.boolean(),
|
|
56
|
+
}),
|
|
57
|
+
});
|
|
58
|
+
if (!res?.object?.generated) {
|
|
59
|
+
throw new Error(res?.object?.commitMessage);
|
|
60
|
+
}
|
|
61
|
+
return { commitMessage: res?.object?.commitMessage, generated: res?.object?.generated };
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
const confirmationStep = new Step({
|
|
65
|
+
id: 'confirmation',
|
|
66
|
+
outputSchema: z.object({
|
|
67
|
+
confirm: z.boolean(),
|
|
68
|
+
}),
|
|
69
|
+
execute: async ({ context }) => {
|
|
70
|
+
const parentStep = context?.machineContext?.stepResults?.generateMessage;
|
|
71
|
+
if (!parentStep || parentStep.status !== 'success') {
|
|
72
|
+
return { confirm: false };
|
|
73
|
+
}
|
|
74
|
+
if (!parentStep.payload.generated) {
|
|
75
|
+
return { confirm: false };
|
|
76
|
+
}
|
|
77
|
+
const commitMessage = parentStep.payload.commitMessage;
|
|
78
|
+
const confirmationMessage = await confirm({
|
|
79
|
+
message: `\n Would you like to use this commit message? \n\n ${chalk.yellow(commitMessage)}\n\n`,
|
|
80
|
+
});
|
|
81
|
+
return { confirm: confirmationMessage };
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
const commitStep = new Step({
|
|
85
|
+
id: 'commit',
|
|
86
|
+
outputSchema: z.object({
|
|
87
|
+
commit: z.boolean(),
|
|
88
|
+
}),
|
|
89
|
+
execute: async ({ context }) => {
|
|
90
|
+
const parentStep = context?.machineContext?.stepResults?.confirmation;
|
|
91
|
+
if (!parentStep || parentStep.status !== 'success' || !parentStep.payload.confirm) {
|
|
92
|
+
throw new Error('Commit message generation cancelled');
|
|
93
|
+
}
|
|
94
|
+
if (context?.machineContext?.stepResults?.generateMessage?.status !== 'success') {
|
|
95
|
+
throw new Error('Failed to generate commit message');
|
|
96
|
+
}
|
|
97
|
+
const commitMessage = context?.machineContext?.stepResults?.generateMessage?.payload?.commitMessage;
|
|
98
|
+
execSync(`git commit -m "${commitMessage}"`, {
|
|
99
|
+
cwd: context?.machineContext?.triggerData?.repoPath,
|
|
100
|
+
encoding: 'utf-8',
|
|
101
|
+
});
|
|
102
|
+
return { commit: true };
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
commitMessageGenerator.step(getDiff).then(generateMessage).then(confirmationStep).then(commitStep).commit();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
|
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.14",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"tsx": "^4.19.2"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"@inquirer/prompts": "^7.2.1",
|
|
24
25
|
"boxen": "^8.0.1",
|
|
25
26
|
"chalk": "^5.3.0",
|
|
26
27
|
"cli-table3": "^0.6.5",
|
|
27
28
|
"commander": "^12.1.0",
|
|
28
29
|
"dotenv": "^16.4.7",
|
|
29
30
|
"execa": "^9.3.1",
|
|
30
|
-
"inquirer": "^12.2.0",
|
|
31
31
|
"luxon": "^3.5.0",
|
|
32
32
|
"node-ical": "^0.20.1",
|
|
33
33
|
"node-screenshots": "^0.2.1",
|
|
@@ -37,17 +37,16 @@
|
|
|
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/firecrawl": "1.0.4-alpha.
|
|
43
|
-
"@mastra/github": "1.0.3-alpha.
|
|
44
|
-
"@mastra/
|
|
45
|
-
"@mastra/
|
|
46
|
-
"@mastra/
|
|
40
|
+
"@mastra/core": "0.1.27-alpha.45",
|
|
41
|
+
"@mastra/engine": "0.0.5-alpha.39",
|
|
42
|
+
"@mastra/firecrawl": "1.0.4-alpha.30",
|
|
43
|
+
"@mastra/github": "1.0.3-alpha.29",
|
|
44
|
+
"@mastra/memory": "0.0.2-alpha.24",
|
|
45
|
+
"@mastra/rag": "0.0.2-alpha.29",
|
|
46
|
+
"@mastra/stabilityai": "1.0.1-alpha.20"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "npx tsc",
|
|
50
|
-
"issue-labeler": "npx bun src/issue-labeler.ts",
|
|
51
50
|
"start": "npx bun src/index.ts",
|
|
52
51
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
53
52
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=commit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/commit.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|