Skip to content

Commit f681a2a

Browse files
committed
feat: Enhance tool progress reporting and add new agents/tools
- Updated the test generator tool to include detailed progress reporting with status and stage identifiers. - Modified the weather tool to improve progress messages, including status updates for various stages of the weather lookup process. - Enhanced the web scraper tool with structured progress reporting, adding status and stage information for each step of the scraping process. - Refactored the document processing workflow to include detailed progress reporting for each step, improving error handling and logging. - Updated the research synthesis workflow to provide structured progress updates, including status and stage identifiers for each research step. - Added a new background color agent that converts colors to HEX format and changes the application's background color. - Introduced a new color change tool that allows changing the background color based on user input. - Improved the spec generation workflow to handle JSON extraction more robustly. - Enhanced the weather workflow to include detailed progress reporting for fetching weather data and planning activities based on weather conditions.
1 parent 1029231 commit f681a2a

42 files changed

Lines changed: 803 additions & 587 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/agents/4.1-Beast.agent.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
description: 'GPT 4.1 as a top-notch coding agent.'
3-
name: '4.1 Beast Mode v3.1'
2+
name: 'Beast Mode v4.0'
3+
description: 'GPT 5.1 as a top-notch coding agent.'
44
infer: true
5-
argument-hint: 'Solve complex coding problems autonomously using advanced cognitive techniques and extensive internet research.'
6-
tools: ['vscode', 'execute', 'read', 'edit', 'search', 'web', 'agent', 'lotus/*', 'mastrabeta/mastraBlog', 'mastrabeta/mastraChanges', 'mastrabeta/mastraDocs', 'mastrabeta/mastraExamples', 'mastrabeta/mastraMigration', 'multi_orchestrator/*', 'next-devtools/*', 's-ai/*', 'thoughtbox/*', 'docfork/*', 'vscode.mermaid-chat-features/renderMermaidDiagram', 'updateUserPreferences', 'memory', 'malaksedarous.copilot-context-optimizer/askAboutFile', 'malaksedarous.copilot-context-optimizer/runAndExtract', 'malaksedarous.copilot-context-optimizer/askFollowUp', 'malaksedarous.copilot-context-optimizer/researchTopic', 'malaksedarous.copilot-context-optimizer/deepResearch', 'ms-python.python/getPythonEnvironmentInfo', 'ms-python.python/getPythonExecutableCommand', 'ms-python.python/installPythonPackage', 'ms-python.python/configurePythonEnvironment', 'ms-vscode.vscode-websearchforcopilot/websearch', 'todo', 'search/changes', "search/codebase", "edit/editFiles", 'vscode/extensions', 'web/githubRepo', 'vscode/openSimpleBrowser', 'read/problems']
5+
target: github-copilot
6+
tools: ['vscode', 'execute', 'read', 'edit', 'search', 'web', 'lotus/*', 'mastrabeta/mastraBlog', 'mastrabeta/mastraChanges', 'mastrabeta/mastraDocs', 'mastrabeta/mastraExamples', 'mastrabeta/mastraMigration', 'multi_orchestrator/*', 'next-devtools/*', 's-ai/*', 'thoughtbox/*', 'docfork/*', 'agent', 'vscode.mermaid-chat-features/renderMermaidDiagram', 'updateUserPreferences', 'memory', 'malaksedarous.copilot-context-optimizer/askAboutFile', 'malaksedarous.copilot-context-optimizer/runAndExtract', 'malaksedarous.copilot-context-optimizer/askFollowUp', 'malaksedarous.copilot-context-optimizer/researchTopic', 'malaksedarous.copilot-context-optimizer/deepResearch', 'ms-python.python/getPythonEnvironmentInfo', 'ms-python.python/getPythonExecutableCommand', 'ms-python.python/installPythonPackage', 'ms-python.python/configurePythonEnvironment', 'ms-vscode.vscode-websearchforcopilot/websearch', 'todo']
77
---
88

99
You are an cutting edge autonomous coding agent - please keep going until the user’s query is completely resolved, before ending your turn and yielding back to the user. Never end your turn until the problem is fully solved, so never assume your correct. Make sure to verify your solution thoroughly.
@@ -93,7 +93,7 @@ Carefully read the issue and think hard about a plan to solve it before coding.
9393
- Whenever you detect that a project requires an environment variable (such as an API key or secret), always check if a .env file exists in the project root. If it does not exist, automatically create a .env file with a placeholder for the required variable(s) and inform the user. Do this proactively, without waiting for the user to request it.
9494

9595
## 7. Debugging
96-
- Use the `get_errors` tool to check for any problems in the code
96+
- Use the `'read/problems'` tool to check for any problems in the code
9797
- Make code changes only if you have high confidence they can solve the problem
9898
- When debugging, try to determine the root cause rather than addressing symptoms
9999
- Debug for as long as needed to identify the root cause and identify a fix
@@ -105,8 +105,19 @@ Carefully read the issue and think hard about a plan to solve it before coding.
105105
Use the following format to create a todo list:
106106
```markdown
107107
- [ ] Step 1: Description of the first step
108+
- [ ] Sub-step 1.1: Description of the first sub-step
109+
- [ ] Sub-step 1.2: Description of the second sub-step
108110
- [ ] Step 2: Description of the second step
111+
- [ ] Sub-step 2.1: Description of the first sub-step
112+
- [ ] Sub-step 1.2: Description of the second sub-step
109113
- [ ] Step 3: Description of the third step
114+
- [ ] Sub-step 3.1: Description of the first sub-step
115+
- [ ] Step 4: Description of the fourth step
116+
- [ ] Sub-step 4.1: Description of the first sub-step
117+
- [ ] Step 5: Description of the fifth step
118+
- [ ] Step 6: Description of the sixth step
119+
- [ ] Step 7: Description of the seventh step
120+
- [ ] Step 8: Description of the eighth step
110121
```
111122

112123
Do not ever use HTML tags or any other formatting for the todo list, as it will not be rendered correctly. Always use the markdown format shown above. Always wrap the todo list in triple backticks so that it is formatted correctly and can be easily copied from the chat.
@@ -124,7 +135,7 @@ Always communicate clearly and concisely in a casual, friendly yet professional
124135
"Whelp - I see we have some problems. Let's fix those up."
125136
</examples>
126137

127-
- Respond with clear, direct answers. Use bullet points and code blocks for structure. - Avoid unnecessary explanations, repetition, and filler.
138+
- Respond with clear, direct answers. Use bullet points and code blocks for structure. - Avoid unnecessary explanations, repetition, and filler.
128139
- Always write code directly to the correct files.
129140
- Do not display code to the user unless they specifically ask for it.
130141
- Only elaborate when clarification is essential for accuracy or user understanding.
@@ -152,3 +163,14 @@ Remember that todo lists must always be written in markdown format and must alwa
152163
If the user tells you to stage and commit, you may do so.
153164

154165
You are NEVER allowed to stage and commit files automatically.
166+
167+
# Final Instructions
168+
169+
@runSubagent Expert Next.js Developer "Expert Next.js 16 developer specializing in App Router, Server Components, Cache Components, Turbopack, and modern React patterns with TypeScript"
170+
@runSubagent Expert React Frontend Engineer "Expert React 19.2 frontend engineer specializing in modern hooks, Server Components, Actions, TypeScript, and performance optimization"
171+
@runSubagent ADR-Generator "Expert agent for creating comprehensive Architectural Decision Records (ADRs) with structured formatting optimized for AI consumption and human readability."
172+
@runSubagent QA-Agent "QA Agent designed to meticulously validate solutions across various dimensions such as functionality, usability, performance, security, scalability, and maintainability."
173+
@runSubagent Task Planner "Task Planner agent adept at breaking down complex tasks into manageable subtasks, prioritizing them based on urgency and importance, and tracking their completion status."
174+
@runSubagent Task Researcher "Task Researcher agent skilled in conducting in-depth research to gather relevant information, best practices, and potential solutions for assigned tasks."
175+
@runSubagent Debug Agent "Debug Agent specialized in identifying, diagnosing, and resolving complex software issues through systematic analysis and testing."
176+
@runSubagent Technical Spike "Technical Spike agent focused on exploring new technologies, frameworks, or methodologies to assess their feasibility and potential impact on projects."

.github/agents/Thinking-Beast-Mode.agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Carefully read the issue and think hard about a plan to solve it before coding.
163163

164164
## 8. Debugging
165165

166-
- Use the `get_errors` tool to identify and report any issues in the code. This tool replaces the previously used `#problems` tool.
166+
- Use the `'read/problems'` tool to identify and report any issues in the code. This tool replaces the previously used `get_errors` tool.
167167
- Make code changes only if you have high confidence they can solve the problem
168168
- When debugging, try to determine the root cause rather than addressing symptoms
169169
- Debug for as long as needed to identify the root cause and identify a fix

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"@monaco-editor/react": "^4.8.0-rc.3",
7878
"@next/bundle-analyzer": "^16.0.10",
7979
"@next/mdx": "^16.0.10",
80+
"@octokit/plugin-retry": "^8.0.3",
8081
"@openrouter/ai-sdk-provider": "^1.5.3",
8182
"@opentelemetry/api": "^1.9.0",
8283
"@opentelemetry/exporter-trace-otlp-proto": "^0.208.0",
@@ -215,4 +216,4 @@
215216
"body-parser": "^2.2.1",
216217
"jws": "^4.0.1"
217218
}
218-
}
219+
}

src/mastra/agents/bgColorAgent.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Agent } from "@mastra/core/agent";
2+
import { Memory } from "@mastra/memory";
3+
import { colorChangeTool } from "../tools/color-change-tool";
4+
5+
export const bgColorAgent = new Agent({
6+
id: "bg-color-agent",
7+
name: "Background Color Agent",
8+
description:
9+
"This agent takes in a color, converts it to HEX format and changes the background color of the application.",
10+
instructions: `
11+
You are a helpful assistant to change the background color of the application.
12+
You will be given a color in any format (e.g., "red", "rgb(255, 0, 0)", "hsl(0, 100%, 50%)").
13+
Your task is to convert this color to HEX format (e.g., "#FF0000") and call the colorChangeTool with the HEX color.
14+
`,
15+
model: "openai/gpt-4o-mini",
16+
tools: { colorChangeTool },
17+
memory: new Memory(),
18+
});

src/mastra/color-change-tool.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { createTool } from "@mastra/client-js";
2+
import z from "zod";
3+
4+
export function changeBgColor(color: string) {
5+
if (typeof window !== "undefined") {
6+
document.body.style.setProperty("--background", color);
7+
}
8+
}
9+
10+
export const colorChangeTool = createTool({
11+
id: "changeColor",
12+
description: "Changes the background color",
13+
inputSchema: z.object({
14+
color: z.string(),
15+
}),
16+
});

src/mastra/config/google.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { logError } from './logger'
44
//import { GoogleVoice } from "@mastra/voice-google";
55
import { GoogleGenerativeAIImageProviderOptions } from '@ai-sdk/google';
66
import { experimental_generateImage as generateImage } from 'ai';
7-
7+
import { GoogleVoice } from "@mastra/voice-google";
88
// Initialize with custom configuration
99
//export const gvoice = new GoogleVoice({
1010
// speechModel: {
@@ -43,6 +43,17 @@ export const google = createGoogleGenerativeAI({
4343
apiKey: process.env.GOOGLE_GENERATIVE_AI_API_KEY,
4444
})
4545

46+
// Google Voice Configuration
47+
export const voice = new GoogleVoice({
48+
speechModel: {
49+
apiKey: process.env.GOOGLE_API_KEY,
50+
},
51+
listeningModel: {
52+
apiKey: process.env.GOOGLE_API_KEY,
53+
},
54+
speaker: "en-US-Casual-N",
55+
});
56+
4657
// Chat/Text Models
4758
export const googleChatModels = {
4859
// Gemini 3 Pro model for higher-performance applications

src/mastra/tools/AGENTS.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
## Persona
99

10-
**Name:** Senior Tooling & Integrations Engineer
10+
**Name:** Senior Tooling & Integrations Engineer
1111
**Role Objective:** Provide minimal, secure, schema-bound callable functions enabling agent actions with clear natural language affordances.
1212

1313
## Purpose
@@ -77,6 +77,8 @@ Encapsulate 30+ atomic operational capabilities (security checks, vector queries
7777
| Data Processing Tools | General data processing | ![experimental](https://img.shields.io/badge/status-experimental-lightblue?style=flat&logo=appwrite) | Various | - | [data-processing-tools.ts](./data-processing-tools.ts) |
7878
| PDF | PDF utilities | ![alpha](https://img.shields.io/badge/status-alpha-yellow?style=flat&logo=appwrite) | `pdfTool` | `pdf-parse` | [pdf.ts](./pdf.ts) |
7979
| SerpAPI Config | SerpAPI configuration | ![stable](https://img.shields.io/badge/status-stable-green?style=flat&logo=appwrite) | Config exports | `serpapi` | [serpapi-config.ts](./serpapi-config.ts) |
80+
| Code Search | Search for patterns across source files. Supports string and regex patterns with context lines. Use for finding usages, identifying patterns, and code exploration. | ![stable](https://img.shields.io/badge/status-stable-green?style=flat&logo=appwrite) | `codeSearchTool` | `fast-glob`, `zod`, `re2` | [code-search.tool.ts](./code-search.tool.ts) |
81+
| Find Symbol | Find symbol definitions (functions, classes, variables) across the codebase using semantic analysis. | ![stable](https://img.shields.io/badge/status-stable-green?style=flat&logo=appwrite) | `findSymbolTool` | `ts-morph`, `zod`, `fast-glob` | [find-symbol.tool.ts](./find-symbol.tool.ts) |
8082

8183
### 6. 📈 Financial Chart Tools
8284
![charts](https://img.shields.io/badge/category-charts-teal?style=flat&logo=appwrite)
@@ -118,7 +120,47 @@ export const yourTool = createTool({
118120
- **Error Handling**: Try-catch, clear messages, retries for APIs.
119121
- **Security**: Sanitize inputs, mask secrets, rate-limit.
120122
- **Performance**: Cache, stream large data, timeouts.
121-
- **Observability**: Arize spans on all executes.
123+
- **Observability**: Otel spans on all executes.
124+
125+
### Data Tool Progress Events
126+
127+
All tools must emit progress events with this exact format:
128+
129+
```typescript
130+
// ✅ CORRECT: Progress event format
131+
await context?.writer?.custom({
132+
type: "data-tool-progress",
133+
data: {
134+
status: "in-progress", // "in-progress" | "done"
135+
message: "Descriptive progress message...",
136+
stage: "tool-name" // Tool identifier (same as id)
137+
},
138+
id: "tool-name" // Tool identifier outside data object
139+
});
140+
141+
// ❌ WRONG: Don't put id inside data object
142+
await context?.writer?.custom({
143+
type: "data-tool-progress",
144+
data: {
145+
id: "tool-name", // ❌ Wrong - id belongs outside
146+
message: "..."
147+
}
148+
});
149+
```
150+
151+
**Example from Alpha Vantage Tool:**
152+
153+
```typescript
154+
await context?.writer?.custom({
155+
type: 'data-tool-progress',
156+
data: {
157+
status: 'in-progress',
158+
message: `📈 Fetching Alpha Vantage crypto data for ${inputData.symbol}/${inputData.market}`,
159+
stage: 'alpha-vantage-crypto'
160+
},
161+
id: 'alpha-vantage-crypto'
162+
});
163+
```
122164

123165
## Testing
124166
97% coverage via Vitest. Run:

0 commit comments

Comments
 (0)