@mastra/dane 0.0.2-alpha.59 → 0.0.2-alpha.61

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.
@@ -1 +1 @@
1
- {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/commands/changelog.ts"],"names":[],"mappings":"AAIA,wBAAsB,SAAS,kBAa9B"}
1
+ {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/commands/changelog.ts"],"names":[],"mappings":"AAIA,wBAAsB,SAAS,kBAiB9B"}
@@ -5,7 +5,11 @@ export async function changelog() {
5
5
  console.log(chalk.green('Lets make the changelog..\n'));
6
6
  const workflow = mastra.getWorkflow('changelog');
7
7
  const { start } = workflow.createRun();
8
- const res = await start();
8
+ const res = await start({
9
+ triggerData: {
10
+ channelId: process.env.CHANNEL_ID,
11
+ },
12
+ });
9
13
  console.log(res);
10
14
  process.exit(0);
11
15
  }
@@ -79,11 +79,22 @@ const stepA2 = new Step({
79
79
  }
80
80
  const today = new Date().toISOString().split('T')[0];
81
81
  const weekAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString().split('T')[0];
82
+ const tools = await slack.tools();
82
83
  if (existsSync(`changelog-${today}`)) {
84
+ const existing = readFileSync(`changelog-${today}`, 'utf-8');
85
+ await agent.generate(`
86
+ Send this ${existing} to this slack channel: "${context.machineContext.triggerData.channelId}" with the tool slack_post_message.
87
+ Format it in markdown so it displays nicely in slack.
88
+ `, {
89
+ toolsets: {
90
+ slack: tools,
91
+ },
92
+ });
83
93
  return {
84
- message: readFileSync(`changelog-${today}`, 'utf-8'),
94
+ message: existing,
85
95
  };
86
96
  }
97
+ const channelId = context.machineContext.triggerData.channelId;
87
98
  const prompt = `
88
99
  Time: ${weekAgo} - ${today}
89
100
 
@@ -118,9 +129,16 @@ const stepA2 = new Step({
118
129
  - Notable bug fixes
119
130
  - Build/deployment improvements
120
131
  - Performance optimizations
132
+
133
+
134
+ Finally send this to this slack channel: "${channelId}" with the tool slack_post_message
121
135
  `;
122
136
  console.log(chalk.green(`Generating...`));
123
- const result = await agent.generate(prompt);
137
+ const result = await agent.generate(prompt, {
138
+ toolsets: {
139
+ slack: tools,
140
+ },
141
+ });
124
142
  console.log(chalk.green(result.text));
125
143
  writeFileSync(`changelog-${today}`, result.text);
126
144
  return {
@@ -128,33 +146,4 @@ const stepA2 = new Step({
128
146
  };
129
147
  },
130
148
  });
131
- const stepA3 = new Step({
132
- id: 'stepA3',
133
- description: 'Send to slack',
134
- execute: async ({ context, mastra }) => {
135
- if (context.machineContext?.stepResults.stepA2?.status !== 'success') {
136
- throw new Error('Message not found');
137
- }
138
- const agent = mastra?.agents?.daneChangeLog;
139
- if (!agent) {
140
- throw new Error('LLM not found');
141
- }
142
- const message = context.machineContext.stepResults.stepA2.payload.message;
143
- try {
144
- const tools = await slack.tools();
145
- const channelId = context.machineContext.triggerData.channelId;
146
- await agent.generate(`
147
- Send this ${message} to this slack channel: "${channelId}" with the tool slack_post_message
148
- `, {
149
- toolsets: {
150
- slack: tools,
151
- },
152
- });
153
- await slack.disconnect();
154
- }
155
- catch (e) {
156
- console.error(e);
157
- }
158
- },
159
- });
160
- changelogWorkflow.step(stepA1).then(stepA2).then(stepA3).commit();
149
+ changelogWorkflow.step(stepA1).then(stepA2).commit();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/dane",
3
- "version": "0.0.2-alpha.59",
3
+ "version": "0.0.2-alpha.61",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -40,13 +40,13 @@
40
40
  "typescript": "^5.5.4",
41
41
  "zod": "^3.24.0",
42
42
  "@mastra/core": "0.1.27-alpha.64",
43
- "@mastra/engine": "0.0.5-alpha.58",
44
- "@mastra/firecrawl": "1.0.4-alpha.51",
45
- "@mastra/github": "1.0.3-alpha.48",
46
43
  "@mastra/memory": "0.0.2-alpha.44",
44
+ "@mastra/github": "1.0.3-alpha.48",
45
+ "@mastra/rag": "0.0.2-alpha.49",
47
46
  "@mastra/stabilityai": "1.0.1-alpha.39",
48
47
  "@mastra/mcp": "0.0.1-alpha.4",
49
- "@mastra/rag": "0.0.2-alpha.49"
48
+ "@mastra/engine": "0.0.5-alpha.58",
49
+ "@mastra/firecrawl": "1.0.4-alpha.51"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "npx tsc",