Skip to content

Commit 7f9ef9b

Browse files
committed
feat: Enhance weather tool and introduce agent builder
- Refactored weather tool to utilize linked abort controllers for improved signal handling during execution. - Added utility functions for creating and resolving abort signals to streamline abort handling in the weather tool. - Introduced a new Agent Builder page for creating stored agents with live provider, model, and tool metadata. - Implemented form state management for agent creation, including validation for required fields. - Added runtime chat catalog to manage agent configurations and features dynamically based on live metadata. - Created a tool status component to display the state of various tool parts with appropriate icons and labels. - Added market update and global conflicts markdown files to provide real-time data and insights.
1 parent 35c4442 commit 7f9ef9b

59 files changed

Lines changed: 2840 additions & 728 deletions

Some content is hidden

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

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,8 @@ start-dev.js
226226
.playwright-mcp/page-2026-04-15T07-24-17-682Z.yml
227227
.playwright-mcp/page-2026-04-15T07-20-32-715Z.yml
228228
.playwright-mcp/page-2026-04-15T07-18-30-461Z.yml
229+
src/mastra/public/workspace/swingtimer.lua
230+
.playwright-mcp/page-2026-04-16T00-19-52-354Z.yml
231+
.playwright-mcp/*.yml
232+
src/mastra/public/workspace/swingtimer.md
233+
src/mastra/public/workspace/tbc-shaman.md

app/chat/AGENTS.md

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,55 @@
44

55
## Recent Update (2026-04-15)
66

7+
- The main chat shell no longer relies on `app/chat/config/agents.ts` / `app/chat/config/models.ts` for the active agent/model presentation layer:
8+
- `app/chat/lib/runtime-chat-catalog.ts` now derives chat UI metadata from live Mastra agent payloads.
9+
- `app/chat/providers/chat-context.tsx` now builds `agentConfig` from `useAgent(selectedAgent)`.
10+
- `app/chat/components/chat-header.tsx` now groups agents from `useAgents()` and models from `useAgentModelProviders()`.
11+
- `app/chat/components/chat-sidebar.tsx` now exposes runtime browser/workspace/skill counts from the active agent payload.
12+
- The installed `@mastra/client-js` package exposes capability metadata like `browserTools`, `workspaceTools`, and `skills`, but this repo still does not have a first-class browser/editor runtime-control client resource comparable to tool providers; UI work in this area should assume capability display first and add server routes only if real session/control features are needed.
713
- Settings pages are now modular route groups instead of two monolithic screens:
814
- `/chat/user` overview + focused routes for profile, security, sessions, API keys, and danger zone
915
- `/chat/admin` overview + focused routes for runtime and user operations
1016
- Use `app/chat/components/chat-settings-shell.tsx` when a chat route needs the shared `ChatProvider` + `ChatPageShell` + `MainSidebar` composition plus an in-section settings nav.
1117
- Use the same shared shell composition for non-settings dashboard surfaces that need the persistent chat sidebar; the current wrapped set includes datasets, evaluation, observability, tools, logs, harness, MCP/A2A, workflows, and workflow detail pages.
1218
- `UserSettingsPanel` and `AdminSettingsPanel` now support section-based rendering so new routes can reuse the same Better Auth mutations without duplicating form logic.
1319
- `useWorkspaces()` in `lib/hooks/use-mastra-query.ts` now returns normalized `WorkspaceItem[]`; new chat UI code should consume that array directly instead of re-decoding `{ workspaces: [...] }` response shapes in components.
20+
- `lib/hooks/use-mastra-query.ts` was also tightened to track the installed `@mastra/client-js` API more closely:
21+
- `useToolProvider(...)` now returns the real provider resource instead of duplicating the toolkits query
22+
- stored resource update/version mutations now accept explicit request-context-aware inputs
23+
- workspace skill hooks now support `skillPath?: string` for disambiguating duplicate skill names
24+
- `useCompareStoredScorerVersions(...)` now uses the scorer-specific compare response type
25+
- The chat provider/runtime UX now also exposes provider readiness directly through `ChatContext`:
26+
- active provider connection state and env-var hint come from live `useAgentModelProviders()` data
27+
- the composer shows a green/amber provider status light and avoids presenting provider-level model options that the current agent cannot actually use
28+
- the message surface shows provider/model/runtime capability badges and a configuration warning when the provider is unavailable
29+
- `/chat/builder` now uses the exact stored-agent creation contract from `@mastra/client-js`:
30+
- live provider/model options instead of hardcoded Gemini defaults
31+
- typed tool-map payloads instead of `unknown` casts
32+
- save is gated on a connected provider so users cannot submit an obviously invalid agent snapshot
33+
- Tool cancellation now depends on the runtime `abortSignal` that comes from `createTool()` / `useChat.stop()`, not on a shared global controller.
1434
- Prefer shared tooltip and scroll affordances on high-density chat surfaces:
1535
- add tooltip descriptions for navigation items and overview cards when a route’s purpose is not obvious
1636
- use `ScrollArea` for long sidebars, thread lists, or horizontally dense settings navs rather than letting layout overflow
1737
- keep shell spacing consistent through `ChatPageShell` instead of per-page padding drift
1838

39+
## Recent Update (2026-04-16)
40+
41+
- The shared chat visual system was tightened around `ChatPageShell`, `ChatSettingsShell`, and `MainSidebar` instead of route-level bespoke chrome.
42+
- `ChatPageShell` now supports `fullBleed` mode for immersive routes that still need the persistent shared sidebar, and `/chat/workflows` now uses that path.
43+
- `/chat/builder` no longer uses its own standalone header/layout; it now mounts inside the same shared shell/sidebar composition as the rest of the chat workspace.
44+
- `app/layout.tsx` no longer applies `mesh-gradient` to the entire app body, and `app/globals.css` now defines calmer chat-specific surface utilities:
45+
- `chat-shell-bg`
46+
- `chat-sidebar-surface`
47+
- `chat-panel`
48+
- `chat-panel-muted`
49+
- `chat-toolbar`
50+
- `chat-canvas-surface`
51+
- The older glow/glass/bento utilities were softened rather than removed blindly so existing routes keep working while the chat area adopts a more restrained professional theme.
52+
- Live runtime verification also fixed two important chat-shell contracts:
53+
- `lib/mastra-client.ts` exports `MASTRA_API_BASE_URL` for frontend consumers like `chat-context.tsx`
54+
- `ChatProvider` now derives runtime agent ids from the `useAgents()` array payload instead of array indexes, which prevents invalid `/api/agents/0` fetches on shell pages
55+
1956
## Overview
2057

2158
The `/chat` route provides a rich AI chat interface built with **AI Elements** (52 components) integrated with **26+ Mastra agents**. Uses `@ai-sdk/react` with `useChat` and `DefaultChatTransport` to stream responses from Mastra's `/chat` route.
@@ -69,8 +106,8 @@ graph TB
69106
AgentArtifact["agent-artifact.tsx<br/>Code artifacts"]
70107
end
71108

72-
subgraph Config["config/"]
73-
AgentConfig["agents.ts<br/>26+ agent configs"]
109+
subgraph RuntimeCatalog["runtime metadata"]
110+
RuntimeAgentConfig["runtime-chat-catalog.ts<br/>live-derived agent metadata"]
74111
end
75112

76113
subgraph AIElements["AI Elements (imported)"]
@@ -91,7 +128,7 @@ graph TB
91128

92129
ChatPage --> Providers
93130
ChatPage --> Components
94-
Components --> Config
131+
Components --> RuntimeCatalog
95132
Components --> AIElements
96133
```
97134

@@ -104,8 +141,8 @@ app/chat/
104141
├── providers/
105142
│ ├── chat-context.tsx # React Context with AI SDK v5 types
106143
│ └── chat-context-types.ts # Type definitions
107-
├── config/
108-
│ └── agents.ts # 26+ agent configurations with feature flags
144+
├── lib/
145+
│ └── runtime-chat-catalog.ts # Runtime-derived chat agent/model metadata
109146
└── components/
110147
├── chat-header.tsx # Header with ModelSelector
111148
├── chat-messages.tsx # Message list with streaming, Attachments, AudioPlayer

0 commit comments

Comments
 (0)