@mastra/dane 0.0.3 → 0.0.4
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/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 +2 -0
- package/dist/commands/issue-labeler.d.ts.map +1 -0
- package/dist/commands/issue-labeler.js +35 -0
- 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 +2 -0
- package/dist/commands/message.d.ts.map +1 -0
- package/dist/commands/message.js +14 -0
- 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 +30 -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.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/mastra/agents/index.d.ts +165 -0
- package/dist/mastra/agents/index.d.ts.map +1 -0
- package/dist/mastra/agents/index.js +111 -0
- package/dist/mastra/agents/memory.d.ts +3 -0
- package/dist/mastra/agents/memory.d.ts.map +1 -0
- package/dist/mastra/agents/memory.js +10 -0
- package/dist/mastra/agents/model.d.ts +2 -0
- package/dist/mastra/agents/model.d.ts.map +1 -0
- package/dist/mastra/agents/model.js +8 -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 +14 -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 +170 -0
- package/dist/mastra/index.d.ts +291 -0
- package/dist/mastra/index.d.ts.map +1 -0
- package/dist/mastra/index.js +37 -0
- package/dist/mastra/integrations/index.d.ts +5 -0
- package/dist/mastra/integrations/index.d.ts.map +1 -0
- package/dist/mastra/integrations/index.js +23 -0
- package/dist/mastra/tools/browser.d.ts +40 -0
- package/dist/mastra/tools/browser.d.ts.map +1 -0
- package/dist/mastra/tools/browser.js +116 -0
- package/dist/mastra/tools/calendar.d.ts +21 -0
- package/dist/mastra/tools/calendar.d.ts.map +1 -0
- package/dist/mastra/tools/calendar.js +134 -0
- package/dist/mastra/tools/crawl.d.ts +36 -0
- package/dist/mastra/tools/crawl.d.ts.map +1 -0
- package/dist/mastra/tools/crawl.js +27 -0
- package/dist/mastra/tools/execa.d.ts +27 -0
- package/dist/mastra/tools/execa.d.ts.map +1 -0
- package/dist/mastra/tools/execa.js +43 -0
- package/dist/mastra/tools/fs.d.ts +33 -0
- package/dist/mastra/tools/fs.d.ts.map +1 -0
- package/dist/mastra/tools/fs.js +36 -0
- 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 +21 -0
- package/dist/mastra/tools/pdf.d.ts.map +1 -0
- package/dist/mastra/tools/pdf.js +42 -0
- 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 +239 -0
- package/dist/mastra/workflows/chat.d.ts +13 -0
- package/dist/mastra/workflows/chat.d.ts.map +1 -0
- package/dist/mastra/workflows/chat.js +90 -0
- 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 +141 -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 +124 -0
- package/dist/mastra/workflows/index.d.ts +4 -0
- package/dist/mastra/workflows/index.d.ts.map +1 -0
- package/dist/mastra/workflows/index.js +3 -0
- package/dist/mastra/workflows/issue-labeler.d.ts +16 -0
- package/dist/mastra/workflows/issue-labeler.d.ts.map +1 -0
- package/dist/mastra/workflows/issue-labeler.js +85 -0
- 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 +252 -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 +97 -0
- package/package.json +4 -4
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { anthropic } from '@ai-sdk/anthropic';
|
|
2
|
+
import { input } from '@inquirer/prompts';
|
|
3
|
+
import { Agent } from '@mastra/core/agent';
|
|
4
|
+
import { Step, Workflow, getStepResult } from '@mastra/core/workflows';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
const llm = anthropic('claude-3-5-sonnet-20241022');
|
|
7
|
+
const agent = new Agent({
|
|
8
|
+
name: 'telephoneGameAgent',
|
|
9
|
+
instructions: `Telephone game agent`,
|
|
10
|
+
model: llm,
|
|
11
|
+
});
|
|
12
|
+
export const telephoneGameWorkflow = new Workflow({
|
|
13
|
+
name: 'telephoneGame',
|
|
14
|
+
});
|
|
15
|
+
const stepA1 = new Step({
|
|
16
|
+
id: 'stepA1',
|
|
17
|
+
description: 'Starts the message',
|
|
18
|
+
outputSchema: z.object({
|
|
19
|
+
message: z.string(),
|
|
20
|
+
}),
|
|
21
|
+
execute: async () => {
|
|
22
|
+
return {
|
|
23
|
+
message: 'Test',
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
const stepA2 = new Step({
|
|
28
|
+
id: 'stepA2',
|
|
29
|
+
description: 'Pass the message through',
|
|
30
|
+
outputSchema: z.object({
|
|
31
|
+
message: z.string(),
|
|
32
|
+
}),
|
|
33
|
+
execute: async () => {
|
|
34
|
+
const content = await input({
|
|
35
|
+
message: 'Give me a message',
|
|
36
|
+
validate: input => input.trim().length > 0 || 'Message cannot be empty',
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
message: content,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
const stepB2 = new Step({
|
|
44
|
+
id: 'stepB2',
|
|
45
|
+
description: 'Checks if the file exists',
|
|
46
|
+
outputSchema: z.object({
|
|
47
|
+
message: z.string(),
|
|
48
|
+
}),
|
|
49
|
+
execute: async ({ context }) => {
|
|
50
|
+
if (context?.steps.stepA2?.status !== 'success') {
|
|
51
|
+
throw new Error('Message not found');
|
|
52
|
+
}
|
|
53
|
+
const msg = context.steps.stepA2.output.message;
|
|
54
|
+
return {
|
|
55
|
+
message: msg,
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
const stepC2 = new Step({
|
|
60
|
+
id: 'stepC2',
|
|
61
|
+
description: 'Ask if you should modify the message',
|
|
62
|
+
outputSchema: z.object({
|
|
63
|
+
message: z.string(),
|
|
64
|
+
}),
|
|
65
|
+
execute: async ({ suspend, context }) => {
|
|
66
|
+
const oMsg = getStepResult(context?.steps.stepA2);
|
|
67
|
+
if (context?.steps.stepC2?.status === 'success') {
|
|
68
|
+
const msg = getStepResult(context?.steps.stepC2);
|
|
69
|
+
if (msg.confirm) {
|
|
70
|
+
const result = await agent.generate(`
|
|
71
|
+
You are playing a game of telephone.
|
|
72
|
+
Here is the message the previous person sent ${oMsg.message}.
|
|
73
|
+
But you want to change the message.
|
|
74
|
+
Only return the message
|
|
75
|
+
`);
|
|
76
|
+
return {
|
|
77
|
+
message: result.text,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return oMsg;
|
|
81
|
+
}
|
|
82
|
+
await suspend();
|
|
83
|
+
return { message: 'Suspended' };
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
const stepD2 = new Step({
|
|
87
|
+
id: 'stepD2',
|
|
88
|
+
description: 'Pass the message',
|
|
89
|
+
outputSchema: z.object({
|
|
90
|
+
message: z.string(),
|
|
91
|
+
}),
|
|
92
|
+
execute: async ({ context }) => {
|
|
93
|
+
const msg = getStepResult(context?.steps.stepC2);
|
|
94
|
+
return msg;
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
telephoneGameWorkflow.step(stepA1).step(stepA2).then(stepB2).then(stepC2).then(stepD2).commit();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/dane",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"sqlite3": "^5.1.7",
|
|
43
43
|
"typescript": "^5.7.3",
|
|
44
44
|
"zod": "^3.24.0",
|
|
45
|
+
"@mastra/core": "0.4.4",
|
|
46
|
+
"@mastra/memory": "0.1.7",
|
|
45
47
|
"@mastra/github": "1.1.7",
|
|
46
48
|
"@mastra/mcp": "0.2.6",
|
|
47
|
-
"@mastra/core": "0.4.4",
|
|
48
49
|
"@mastra/rag": "0.1.7",
|
|
49
50
|
"@mastra/stabilityai": "1.1.7",
|
|
50
|
-
"@mastra/upstash": "0.1.7"
|
|
51
|
-
"@mastra/memory": "0.1.7"
|
|
51
|
+
"@mastra/upstash": "0.1.7"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "npx tsc",
|