@mastra/mcp-apps-components 0.0.0-agent-session-20261112221706

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/LICENSE.md ADDED
@@ -0,0 +1,32 @@
1
+ Portions of this software are licensed as follows:
2
+
3
+ - All content that resides under any directory named `ee/` within this
4
+ repository, including but not limited to:
5
+ - `@mastra/core/auth/ee`
6
+ - `@mastra/core/agent-builder/ee`
7
+ - `@mastra/editor/ee`
8
+
9
+ is licensed under the license defined in [`ee/LICENSE`](https://github.com/mastra-ai/mastra/blob/main/ee/LICENSE).
10
+
11
+ - All third-party components incorporated into the Mastra Software are
12
+ licensed under the original license provided by the owner of the
13
+ applicable component.
14
+
15
+ - Content outside of the above-mentioned directories or restrictions is
16
+ available under the "Apache License 2.0" as defined below.
17
+
18
+ # Apache License 2.0
19
+
20
+ Copyright (c) 2025 Kepler Software, Inc.
21
+
22
+ Licensed under the Apache License, Version 2.0 (the "License");
23
+ you may not use this file except in compliance with the License.
24
+ You may obtain a copy of the License at
25
+
26
+ http://www.apache.org/licenses/LICENSE-2.0
27
+
28
+ Unless required by applicable law or agreed to in writing, software
29
+ distributed under the License is distributed on an "AS IS" BASIS,
30
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31
+ See the License for the specific language governing permissions and
32
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,301 @@
1
+ # @mastra/mcp-apps-components
2
+
3
+ Prebuilt [MCP Apps](https://mastra.ai/docs/connections/mcp) that you register as app resources on an `MCPServer`. Each app is a single self-contained HTML page that follows the [MCP Apps spec](https://github.com/modelcontextprotocol/ext-apps), so it runs in any MCP Apps host, such as Mastra Studio.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mastra/mcp-apps-components
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ `greetingApp` greets someone by name. It talks to its host with standard MCP Apps messages only:
14
+
15
+ 1. The model calls the tool that opens the app. The host sends the app that tool's arguments (`ui/notifications/tool-input`); the app reads `name`.
16
+ 2. The app calls the app-only `getGreeting` tool on the same server (`tools/call`) and shows the `greeting` string from its structured content, or the tool's error.
17
+ 3. A **Say hi back** button posts a user message to the conversation (`ui/message`).
18
+
19
+ You write both tools. `getGreeting` runs on your server, so it can call any API with your server's credentials; the app's iframe has no network access.
20
+
21
+ ```typescript
22
+ import { createTool } from '@mastra/core/tools';
23
+ import { MCPServer } from '@mastra/mcp';
24
+ import { greetingApp } from '@mastra/mcp-apps-components';
25
+ import { z } from 'zod';
26
+
27
+ const uri = 'ui://mastra/greeting';
28
+
29
+ export const greetingServer = new MCPServer({
30
+ id: 'greeting',
31
+ name: 'Greeting',
32
+ version: '1.0.0',
33
+ appResources: { [uri]: greetingApp },
34
+ tools: {
35
+ // Visible to the model: opens the app.
36
+ showGreeting: createTool({
37
+ id: 'showGreeting',
38
+ description: 'Shows a greeting card for someone',
39
+ inputSchema: z.object({ name: z.string() }),
40
+ mcp: { _meta: { ui: { resourceUri: uri } } },
41
+ execute: async ({ name }) => ({ name }),
42
+ }),
43
+ // Visible to the app only: returns its data.
44
+ getGreeting: createTool({
45
+ id: 'getGreeting',
46
+ description: 'Returns the greeting for a name',
47
+ inputSchema: z.object({ name: z.string() }),
48
+ outputSchema: z.object({ greeting: z.string() }),
49
+ mcp: { _meta: { ui: { resourceUri: uri, visibility: ['app'] } } },
50
+ execute: async ({ name }) => ({ greeting: `Hello, ${name}!` }),
51
+ }),
52
+ },
53
+ });
54
+ ```
55
+
56
+ ### Observability dashboard
57
+
58
+ `observabilityDashboardApp` draws a Studio dashboard (rows of KPIs, time series, tables and scores widgets) with the same components Studio uses. Each widget loads and fails on its own.
59
+
60
+ 1. The model calls the tool that opens the app. That tool must declare an `outputSchema` so its result reaches the app as structured content: `{ dashboard, datePreset? }`, where `dashboard` passes `dashboardDefinitionSchema` from `@mastra/core/storage/dashboards` and `datePreset` is one of `24h`, `3d`, `7d`, `14d` or `30d`. Without `datePreset`, the app uses the dashboard's `defaults.datePreset` when it is one of those, else `24h`. The window ends when the app opens. The dashboard's top-level `defaults.filters` chips filter every widget.
61
+ 2. The app reads its data through the app-only `queryObservability` tool (exported as `QUERY_OBSERVABILITY_TOOL`). It calls it once per read with `{ action, args, projectId? }`, where `action` is one of `OBSERVABILITY_READ_ACTIONS`, the `MastraClient` observability reads the app sends (`aggregateTraces`, `getMetricBreakdown`, `getScoreTimeSeries`, `listScores`, …), `args` are that method's arguments, with dates as ISO strings, and `projectId` is the project the host passed, if any (see [Drawing over the host page's selection](#drawing-over-the-host-pages-selection)). The tool returns `{ data }`, the method's result; if it throws, that widget shows as failed.
62
+
63
+ Use `observabilityDashboardInputSchema` as the opening tool's input and `toObservabilityDashboard` as its `execute`:
64
+
65
+ - The schema advertises every widget kind's options to the model, so the model can write its own widgets, and a wrong one fails input validation with errors the model can act on.
66
+ - The schema names the metrics Mastra records, but leaves metric names free: a name that doesn't exist reads as zero rather than failing. To make the model pick only metrics that have data, build the schema with `createObservabilityDashboardInputSchema({ metricNames })`, passing the names from `MastraClient#getMetricNames`. Unknown names are then rejected with the list of valid ones. Past `OBSERVABILITY_CATALOG_MAX_METRIC_NAMES` (200) names, or with none, they stay free. The schema is a snapshot, so rebuild the tool (`server.toolActions.add`) when the names change; `examples/agent` does this before each agent run.
67
+ - Label keys and values aren't listed. Give the model a tool that looks them up (for example with `MastraClient#getMetricLabelKeys` and `getMetricLabelValues`).
68
+ - Widgets without an `id` get a fresh UUID on every open, so the host can pin each one by an id that stays stable when the result is shown again.
69
+
70
+ The tools run on your server, so you decide which Mastra server the dashboard reads from and how it authenticates. Allow `OBSERVABILITY_READ_ACTIONS` and nothing else: a widget whose read is missing from the list fails.
71
+
72
+ ```typescript
73
+ import { MastraClient } from '@mastra/client-js';
74
+ import { createTool } from '@mastra/core/tools';
75
+ import { MCPServer } from '@mastra/mcp';
76
+ import {
77
+ OBSERVABILITY_READ_ACTIONS,
78
+ QUERY_OBSERVABILITY_TOOL,
79
+ observabilityDashboardApp,
80
+ observabilityDashboardInputSchema,
81
+ observabilityDashboardOutputSchema,
82
+ toObservabilityDashboard,
83
+ } from '@mastra/mcp-apps-components';
84
+ import { z } from 'zod';
85
+
86
+ const uri = 'ui://mastra/observability-widget';
87
+ const client = new MastraClient({ baseUrl: process.env.MASTRA_URL! });
88
+ // Yours to write: checks the caller can access `projectId`, throws if not, and returns a client
89
+ // whose reads stay in that project.
90
+ declare function projectClient(projectId: string, context: unknown): Promise<MastraClient>;
91
+
92
+ export const observabilityServer = new MCPServer({
93
+ id: 'observability',
94
+ name: 'Observability',
95
+ version: '1.0.0',
96
+ appResources: { [uri]: observabilityDashboardApp },
97
+ tools: {
98
+ // Visible to the model: opens the app with a dashboard.
99
+ showObservabilityDashboard: createTool({
100
+ id: 'showObservabilityDashboard',
101
+ description: 'Shows an observability dashboard of kpis, timeseries, table and scores widgets.',
102
+ inputSchema: observabilityDashboardInputSchema,
103
+ outputSchema: observabilityDashboardOutputSchema,
104
+ mcp: { _meta: { ui: { resourceUri: uri } } },
105
+ execute: async input => toObservabilityDashboard(input),
106
+ }),
107
+ // Visible to the app only: runs one read on the server's client.
108
+ [QUERY_OBSERVABILITY_TOOL]: createTool({
109
+ id: QUERY_OBSERVABILITY_TOOL,
110
+ description: 'Runs one observability read',
111
+ inputSchema: z.object({
112
+ action: z.enum(OBSERVABILITY_READ_ACTIONS),
113
+ args: z.record(z.string(), z.unknown()),
114
+ projectId: z.string().optional(),
115
+ }),
116
+ outputSchema: z.object({ data: z.unknown() }),
117
+ mcp: { _meta: { ui: { resourceUri: uri, visibility: ['app'] } } },
118
+ execute: async ({ action, args, projectId }, context) => {
119
+ const reader = projectId ? await projectClient(projectId, context) : client;
120
+ const read = reader[action].bind(reader) as (args: unknown) => Promise<unknown>;
121
+ return { data: await read(args) };
122
+ },
123
+ }),
124
+ },
125
+ });
126
+ ```
127
+
128
+ `projectId` comes from the app's iframe, so the server can't trust it: check that the caller can access that project before reading. A read that throws shows its widget as failed.
129
+
130
+ The input names each widget, read and column type by a key instead of a `kind`, `source` or `type` field, so a validation error points at the part that's wrong. Each number holds the read it comes from, so nothing points at a query by id:
131
+
132
+ ```ts
133
+ {
134
+ span: 6,
135
+ timeseries: {
136
+ chart: 'stackedBar',
137
+ format: 'count',
138
+ series: [{ label: 'Runs', color: 'green', value: { metricTimeSeries: { name: ['mastra_agent_duration_ms'], aggregation: 'count' } } }],
139
+ },
140
+ }
141
+ ```
142
+
143
+ `toObservabilityDashboard` gathers the reads into each view's queries, one per distinct read, and fills in what the stored definition points at: series keys, a chart's whole-range totals, a table's default sort.
144
+
145
+ A host can also build a dashboard itself: `toObservabilityDashboard({ dashboard: { rows: [{ widgets: [runsWidget] }] }, datePreset: '7d' })` returns `{ dashboard, datePreset? }` as a regular `dashboardDefinitionSchema` definition and throws when the input is invalid.
146
+
147
+ `examples/agent` has a complete version with every read action and an agent that opens dashboards.
148
+
149
+ #### Pinning widgets
150
+
151
+ When the chat host supports it, each widget shows a pin button. The host owns the pinned widgets: it sends their ids to the app, and the app reports each pin and unpin through `ui/update-model-context`. In a host built on `@mastra/playground-ui`, pass `observabilityWidgetPins` from `@mastra/mcp-apps-components/host` to `McpAppHostProvider`:
152
+
153
+ ```tsx
154
+ import { McpAppHostProvider } from '@mastra/playground-ui/domains/mcps';
155
+ import { observabilityWidgetPins } from '@mastra/mcp-apps-components/host';
156
+
157
+ const host = useMemo(
158
+ () =>
159
+ observabilityWidgetPins({
160
+ resourceUri: 'ui://mastra/observability-widget',
161
+ pinnedIds,
162
+ onPin: ({ widget, datePreset, filters }) => savePin(widget, datePreset, filters),
163
+ onUnpin: widgetId => removePin(widgetId),
164
+ }),
165
+ [pinnedIds],
166
+ );
167
+
168
+ <McpAppHostProvider value={host}>{chat}</McpAppHostProvider>;
169
+ ```
170
+
171
+ A pin carries the widget, the date preset it was drawn over (with its `customRange` when `custom`) and, when it had any, the filters it was drawn under (the host's, else the dashboard's `defaults.filters`). The button only shows when the host sends pinned ids and accepts structured model context. A click shows right away and holds until the host sends new ids.
172
+
173
+ #### Drawing over the host page's selection
174
+
175
+ A host page with its own project, date range and filters, such as Studio's Metrics page, passes them down with `observabilityWidgetHost`. Pinning isn't needed for this:
176
+
177
+ ```tsx
178
+ import { McpAppHostProvider } from '@mastra/playground-ui/domains/mcps';
179
+ import { observabilityWidgetHost } from '@mastra/mcp-apps-components/host';
180
+
181
+ const host = useMemo(
182
+ () =>
183
+ observabilityWidgetHost({
184
+ resourceUri: 'ui://mastra/observability-widget',
185
+ projectId,
186
+ datePreset, // '24h' | '3d' | '7d' | '14d' | '30d' | 'custom'
187
+ customRange, // { from?, to? } as Dates or ISO strings, drawn when datePreset is 'custom'
188
+ filters, // FilterNode[], as a dashboard's defaults.filters
189
+ }),
190
+ [projectId, datePreset, customRange, filters],
191
+ );
192
+
193
+ <McpAppHostProvider value={host}>{chat}</McpAppHostProvider>;
194
+ ```
195
+
196
+ `projectId` is sent with every `queryObservability` call, so your server can scope the reads to that project. It also sets the widgets' scope, as on the Metrics page: with a `projectId`, they show at project scope; without one, at org scope. Widgets, views and columns tagged for the other scope are hidden. The host's `datePreset` and `filters` replace the tool result's and the dashboard's defaults. The Metrics page's `datePreset`, `customRange` and `filterTokens` can be passed as they are. With `datePreset: 'custom'`, the widgets read over `customRange`, like the Metrics page: without `from`, the window starts 24 hours before now, and without `to`, it ends now. A value the app can't read (filters that fail the dashboard schema, an unknown preset, a range that ends before it starts) shows an error instead of the dashboard, so the widgets never draw data the host page didn't ask for. When any value changes, the app reads again; a preset window then ends at that moment. Each value is optional: leave one out to fall back to the dashboard's.
197
+
198
+ To let the user pin widgets too, add `pins: { pinnedIds, onPin, onUnpin }`. `observabilityWidgetPins` is the same helper with only pins.
199
+
200
+ #### Configuring a widget
201
+
202
+ Pass `onConfigure` to `observabilityWidgetHost` to show a settings button on each widget, for example to open your own dialog for it:
203
+
204
+ ```tsx
205
+ const host = useMemo(
206
+ () =>
207
+ observabilityWidgetHost({
208
+ resourceUri: 'ui://mastra/observability-widget',
209
+ onConfigure: ({ widget, datePreset, customRange, filters }) =>
210
+ openWidgetSettings(widget, { datePreset, customRange, filters }),
211
+ }),
212
+ [],
213
+ );
214
+ ```
215
+
216
+ The callback gets the widget as the opening tool returned it, with the date preset (and `customRange` when `custom`) and the filters it is drawn with, like a pin. The button only shows when the host passes `onConfigure` and accepts structured model context. It sits before the pin button and appears on the card's hover or keyboard focus, and always shows on touch screens.
217
+
218
+ ### Validating stored dashboards
219
+
220
+ `dashboardDefinitionSchema` from `@mastra/core/storage/dashboards` checks a definition's structure and queries, but not what each widget kind needs. A definition can pass it and still show an error in place of a widget. To store only dashboards that draw, check every write with `strictDashboardDefinitionSchema` in the code that stores them:
221
+
222
+ ```ts
223
+ import { strictDashboardDefinitionSchema } from '@mastra/mcp-apps-components/dashboards';
224
+ import type { StrictDashboardDefinition } from '@mastra/mcp-apps-components/dashboards';
225
+
226
+ const result = strictDashboardDefinitionSchema.safeParse(body.definition);
227
+ if (!result.success) {
228
+ // Each issue has a path to the view, or into its options
229
+ throw new BadRequestError(result.error.issues);
230
+ }
231
+ const definition: StrictDashboardDefinition = result.data;
232
+ ```
233
+
234
+ On top of core's checks, the schema:
235
+
236
+ - Rejects widget kinds other than `kpis`, `table`, `timeseries` and `scores`.
237
+ - Checks each view's `options`, and each table column's `options`, against the kind's own schema.
238
+ - Rejects `columns` on views of widgets that aren't tables. The renderer ignores them, but they usually mean the widget was written as another kind.
239
+ - Runs each kind's checks, such as a KPI reading a query its view has, or a chart's series all fitting its buckets.
240
+ - Checks the widget at both `org` and `project` scope, so a widget that only breaks on one kind of page is rejected too.
241
+
242
+ Problems in a view's options point into them, such as `rows.0.widgets.1.views.0.options.series.0.value`. Problems a kind finds, such as a KPI reading a query its view doesn't have or two views with one label, point at the view, such as `rows.0.widgets.1.views.0`, with a message saying what's wrong, such as `options: reads query 'nope', which the view doesn't have`. All of a definition's problems come back together, so one fix can address them all.
243
+
244
+ `result.data` is the definition you passed in, unchanged; store it as sent. A definition that passes still passes after core's `dashboardDefinitionSchema` has parsed it and filled in its defaults, so you can check what you store either way. Use `strictDashboardWidgetSchema` to check a single widget, such as one being added or pinned; its issue paths start at the widget. Checks across widgets, such as unique ids and the widget limit, need the full definition.
245
+
246
+ Don't use these schemas in a request-body schema. Their input type is `unknown` and their JSON schema is empty, so a request type built from them would type `definition` as `unknown`, and generated API docs would describe it as anything. Keep core's `dashboardDefinitionSchema` there, and check with the strict schemas in the service before storing. Use `StrictDashboardDefinition` to type what you store and return.
247
+
248
+ Dashboards with custom widget kinds should keep using core's `dashboardDefinitionSchema`.
249
+
250
+ ### Saving dashboards a model writes
251
+
252
+ A model writes a widget more reliably from a schema that spells out each kind's options than from an open object. `createObservabilityDraftSchemas` returns the schemas the dashboard tool takes, for a single widget (`widget`) and a whole dashboard (`dashboard`), to use as the input of tools that save them. Convert what the model wrote with `toObservabilityWidget` or `toObservabilityDashboard`:
253
+
254
+ ```ts
255
+ import { createTool } from '@mastra/core/tools';
256
+ import {
257
+ createObservabilityDraftSchemas,
258
+ toObservabilityDashboard,
259
+ toObservabilityWidget,
260
+ } from '@mastra/mcp-apps-components/dashboards';
261
+
262
+ const schemas = createObservabilityDraftSchemas(
263
+ { metricNames: await listMetricNames() },
264
+ { kinds: ['kpis', 'timeseries', 'table'], dashboardFilters: false },
265
+ );
266
+
267
+ const addWidget = createTool({
268
+ id: 'addWidget',
269
+ description: 'Adds a widget to the dashboard',
270
+ inputSchema: schemas.widget,
271
+ execute: async widget => saveWidget(toObservabilityWidget(widget)),
272
+ });
273
+
274
+ const createDashboard = createTool({
275
+ id: 'createDashboard',
276
+ description: 'Creates a dashboard',
277
+ inputSchema: schemas.dashboard,
278
+ execute: async dashboard => saveDashboard(toObservabilityDashboard({ dashboard }).dashboard),
279
+ });
280
+ ```
281
+
282
+ - **Options:** `kinds` lists the widget kinds a model can write, and `dashboardFilters: false` limits a dashboard's `defaults` to `datePreset`. What you leave out is missing from the JSON schema the model sees, and rejected when a model writes it anyway. Narrowing `kinds` doesn't narrow the TypeScript types.
283
+ - **One call per catalog:** Build both tools' schemas from one call. Building takes about a millisecond, so it's fine to build them per request.
284
+ - **Ids:** `toObservabilityWidget` keeps a widget's `id` when the model gives one, so a widget can be pinned or replaced by it, and assigns a fresh UUID otherwise. `toObservabilityDashboard` does the same for each widget.
285
+ - **Converting outside a tool:** `toObservabilityWidget` and `toObservabilityDashboard` check against the default schemas, which allow every kind and metric name. Inside a tool built as above, its input schema has already applied your catalog and options. Anywhere else, check the draft against your schemas first, such as with `schemas.widget.parse(draft)`.
286
+ - **Errors:** As tool input schemas, the schemas reject a draft before `execute` runs, with paths into what the model wrote, such as `timeseries.series.1.value` for a widget or `rows.0.widgets.0.timeseries.series.1.value` for a dashboard. Nested under a field of a larger input, paths start with that field's name. `toObservabilityWidget` throws an error whose `cause` is the `ZodError`, with the same paths. Checks across widgets, such as unique ids and the widget limit, need the whole dashboard.
287
+
288
+ A draft that passes converts to a widget that passes `strictDashboardWidgetSchema`. Keep checking with the strict schemas where you store dashboards, since they also cover writes that don't come from a draft.
289
+
290
+ ## Documentation
291
+
292
+ - [MCP Apps in Mastra](https://mastra.ai/docs/connections/mcp)
293
+ - [MCP Apps spec](https://github.com/modelcontextprotocol/ext-apps)
294
+
295
+ ## Changelog
296
+
297
+ See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/packages/mcp-apps-components/CHANGELOG.md) for version history and release notes.
298
+
299
+ ## Support
300
+
301
+ We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
@@ -0,0 +1,64 @@
1
+ import type { FilterNode } from '@mastra/core/storage/dashboards';
2
+ /** The app-only tool the observability widget calls, on the server that opened it, for every read. */
3
+ export declare const QUERY_OBSERVABILITY_TOOL = "queryObservability";
4
+ /**
5
+ * Every `MastraClient` method the app sends as a `queryObservability` action. All are reads; allow
6
+ * these and nothing else (`z.enum(OBSERVABILITY_READ_ACTIONS)`).
7
+ */
8
+ export declare const OBSERVABILITY_READ_ACTIONS: readonly ['aggregateTraces', 'aggregateSpans', 'getMetricAggregate', 'getMetricBreakdown', 'getMetricTimeSeries', 'getMetricPercentiles', 'getScoreAggregate', 'getScoreBreakdown', 'getScoreTimeSeries', 'getScorePercentiles', 'listScores'];
9
+ export type ObservabilityReadAction = (typeof OBSERVABILITY_READ_ACTIONS)[number];
10
+ /** The windows the widget can show, ending when it opens; the same presets as Studio's metrics. */
11
+ export declare const OBSERVABILITY_DATE_PRESETS: readonly ['24h', '3d', '7d', '14d', '30d'];
12
+ export type ObservabilityDatePreset = (typeof OBSERVABILITY_DATE_PRESETS)[number];
13
+ /**
14
+ * Host context key holding the ids of the widgets the host has pinned (`string[]`). The pin button
15
+ * only shows when the host sends it and supports `updateModelContext.structuredContent`.
16
+ */
17
+ export declare const OBSERVABILITY_WIDGET_PINNED_CONTEXT_KEY = "mastra.ai/observability-widget-pinned";
18
+ /** `structuredContent` key of the model context update the app sends when the user (un)pins. */
19
+ export declare const OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY = "mastra.ai/observability-widget-pin";
20
+ /**
21
+ * Host context key the host sets to `true` when it can configure a widget. The settings button only
22
+ * shows when the host sends it and supports `updateModelContext.structuredContent`.
23
+ */
24
+ export declare const OBSERVABILITY_WIDGET_CONFIGURABLE_CONTEXT_KEY = "mastra.ai/observability-widget-configurable";
25
+ /** `structuredContent` key of the model context update the app sends when the user opens a widget's settings. */
26
+ export declare const OBSERVABILITY_WIDGET_CONFIGURE_CONTEXT_KEY = "mastra.ai/observability-widget-configure";
27
+ /** Host context key holding what the host's page draws the widgets over (`ObservabilityWidgetView`). */
28
+ export declare const OBSERVABILITY_WIDGET_VIEW_CONTEXT_KEY = "mastra.ai/observability-widget-view";
29
+ /** A custom window, as ISO date strings. A missing `from` is 24h before `to`; a missing `to` is now. */
30
+ export type ObservabilityWidgetDateRange = {
31
+ from?: string;
32
+ to?: string;
33
+ };
34
+ /**
35
+ * What the host's page draws the widgets over, e.g. the Metrics page's date range and filter bar.
36
+ * Each field the host sets wins over the opening tool's result and the dashboard's `defaults`.
37
+ */
38
+ export type ObservabilityWidgetView = {
39
+ /** One of the presets, or `custom` to draw over `customRange`. */
40
+ datePreset?: ObservabilityDatePreset | 'custom';
41
+ /** The window drawn when `datePreset` is `custom`, as the Metrics page's custom range. */
42
+ customRange?: ObservabilityWidgetDateRange;
43
+ /** Replaces the dashboard's `defaults.filters`; only top-level chips filter, as on the Metrics page. */
44
+ filters?: FilterNode[];
45
+ /** Sent with every `queryObservability` call, so the server reads that project's data. */
46
+ projectId?: string;
47
+ };
48
+ /** What the app sends under `OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY`: the state the user asked for. */
49
+ export type ObservabilityWidgetPin = {
50
+ pinned: boolean;
51
+ /** The stored dashboard widget, as the opening tool returned it. */
52
+ widget: {
53
+ id: string;
54
+ [key: string]: unknown;
55
+ };
56
+ datePreset: string;
57
+ /** The window the widget was drawn over, when `datePreset` is `custom`. */
58
+ customRange?: ObservabilityWidgetDateRange;
59
+ /** The filters the widget was drawn under (the host's, else the dashboard's `defaults.filters`), when any. */
60
+ filters?: unknown[];
61
+ };
62
+ /** What the app sends under `OBSERVABILITY_WIDGET_CONFIGURE_CONTEXT_KEY`: the widget as the user sees it. */
63
+ export type ObservabilityWidgetConfigure = Omit<ObservabilityWidgetPin, 'pinned'>;
64
+ //# sourceMappingURL=tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/apps/observability-widget/tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,sGAAsG;AACtG,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,0BAA0B,YACrC,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,CACJ,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF,mGAAmG;AACnG,eAAO,MAAM,0BAA0B,YAAI,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAErF,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,uCAAuC,0CAA0C,CAAC;AAE/F,gGAAgG;AAChG,eAAO,MAAM,oCAAoC,uCAAuC,CAAC;AAEzF;;;GAGG;AACH,eAAO,MAAM,6CAA6C,gDAAgD,CAAC;AAE3G,iHAAiH;AACjH,eAAO,MAAM,0CAA0C,6CAA6C,CAAC;AAErG,wGAAwG;AACxG,eAAO,MAAM,qCAAqC,wCAAwC,CAAC;AAE3F,wGAAwG;AACxG,MAAM,MAAM,4BAA4B,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1E;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,kEAAkE;IAClE,UAAU,CAAC,EAAE,uBAAuB,GAAG,QAAQ,CAAC;IAChD,0FAA0F;IAC1F,WAAW,CAAC,EAAE,4BAA4B,CAAC;IAC3C,wGAAwG;IACxG,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,qGAAqG;AACrG,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,oEAAoE;IACpE,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,4BAA4B,CAAC;IAC3C,8GAA8G;IAC9G,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;CACrB,CAAC;AAEF,6GAA6G;AAC7G,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { DashboardBuiltInWidgetKind, DashboardWidget, DashboardWidgetView } from '@mastra/core/storage/dashboards';
2
+ import type { z } from 'zod/v4';
3
+ export type DashboardScope = 'org' | 'project';
4
+ /** A view as a kind's checks read it: its options parsed, its columns those at the scope. */
5
+ type CheckedView = Omit<DashboardWidgetView, 'options'> & {
6
+ options: any;
7
+ };
8
+ export type KindCheck = {
9
+ optionsSchema: z.ZodType;
10
+ issues?: (view: CheckedView) => string[];
11
+ };
12
+ /** A problem with a widget, its path relative to the widget. */
13
+ export type WidgetIssue = {
14
+ path: PropertyKey[];
15
+ message: string;
16
+ };
17
+ /** How each built-in kind checks a view: the options it accepts, then what it checks beyond them. */
18
+ export declare const KIND_CHECKS: Record<DashboardBuiltInWidgetKind, KindCheck>;
19
+ /** Whether a widget, view or column tagged with `scope` shows at the page's scope. */
20
+ export declare const inScope: (item: {
21
+ scope?: DashboardScope;
22
+ }, scope: DashboardScope) => boolean;
23
+ /**
24
+ * What the renderer rejects in the widget's views at `scope`, in the order it finds them: options
25
+ * parsed, then the kind's own issues, then labels unique. Takes a widget core's schema accepts.
26
+ * Views in `skipKindChecks` skip the kind's own issues, for callers that already report them.
27
+ */
28
+ export declare function viewIssues(widget: DashboardWidget, check: KindCheck, scope: DashboardScope, skipKindChecks?: ReadonlySet<number>): WidgetIssue[];
29
+ export declare const zodIssues: (error: z.ZodError, prefix: PropertyKey[]) => WidgetIssue[];
30
+ /**
31
+ * What the renderer would reject in a widget core accepts, paths relative to the widget. Every
32
+ * view's options and columns are parsed; the kind's own checks then run at each scope the widget
33
+ * shows at, as the renderer runs them there, skipping views whose options or columns don't parse.
34
+ * All problems come back together. It also rejects columns on views that aren't tables, which the
35
+ * renderer ignores.
36
+ */
37
+ export declare function widgetIssues(widget: DashboardWidget): WidgetIssue[];
38
+ export {};
39
+ //# sourceMappingURL=dashboard-views.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-views.d.ts","sourceRoot":"","sources":["../src/dashboard-views.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAUxH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAOhC,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,SAAS,CAAC;AAE/C,6FAA6F;AAC7F,KAAK,WAAW,GAAG,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,GAAG;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,SAAS,GAAG;IAAE,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,EAAE,CAAA;CAAE,CAAC;AAE/F,gEAAgE;AAChE,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE,qGAAqG;AACrG,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,0BAA0B,EAAE,SAAS,CAWrE,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,OAAO,SAAU;IAAE,KAAK,CAAC,EAAE,cAAc,CAAA;CAAE,SAAS,cAAc,YAC7B,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,cAAc,EACrB,cAAc,GAAE,WAAW,CAAC,MAAM,CAAa,GAC9C,WAAW,EAAE,CA8Bf;AAID,eAAO,MAAM,SAAS,UAAW,CAAC,CAAC,QAAQ,UAAU,WAAW,EAAE,KAAG,WAAW,EACW,CAAC;AAE5F;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,EAAE,CAuCnE"}
@@ -0,0 +1,60 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_observability_dashboard = require("./observability-dashboard-CUTNAsy0.cjs");
3
+ let _mastra_core_storage_dashboards = require("@mastra/core/storage/dashboards");
4
+ let zod_v4 = require("zod/v4");
5
+ // src/dashboards.ts
6
+ const report = (ctx, issues, prefix = []) => {
7
+ for (const issue of issues) ctx.addIssue({
8
+ code: "custom",
9
+ path: [...prefix, ...issue.path],
10
+ message: issue.message
11
+ });
12
+ };
13
+ /**
14
+ * One widget as the dashboard renderer draws it: core's `dashboardWidgetSchema`, a built-in kind,
15
+ * options that kind accepts, and nothing else it would reject, at every scope the widget shows at.
16
+ * It also rejects columns on views that aren't tables: the renderer ignores them, but they usually
17
+ * mean the widget was written as another kind. Paths are relative to the widget. Unique widget ids, the widget count and the size limit are the
18
+ * definition's to check, so check the whole definition with `strictDashboardDefinitionSchema` too
19
+ * before storing it.
20
+ *
21
+ * Parsing returns the widget as given: no defaults are filled in. It's a validator, not a schema to
22
+ * show a model: its JSON schema is empty. Its input type is `unknown`, so check with it where you
23
+ * store, not in a request schema.
24
+ */
25
+ const strictDashboardWidgetSchema = zod_v4.z.unknown().superRefine((value, ctx) => {
26
+ const core = _mastra_core_storage_dashboards.dashboardWidgetSchema.safeParse(value);
27
+ if (!core.success) return report(ctx, require_observability_dashboard.zodIssues(core.error, []));
28
+ report(ctx, require_observability_dashboard.widgetIssues(value));
29
+ });
30
+ /**
31
+ * A dashboard definition as the dashboard renderer draws it: core's `dashboardDefinitionSchema`,
32
+ * then every widget as `strictDashboardWidgetSchema` checks it, paths from the definition (e.g.
33
+ * `rows.0.widgets.1.views.0.options.series.0.value`; problems a kind finds point at the view).
34
+ * Check every definition with it before storing it, so each stored widget renders. Widgets of a
35
+ * host's own kinds are rejected: check those with core's schema.
36
+ *
37
+ * Parsing returns the definition as given: no defaults are filled in. It's a validator, not a
38
+ * schema to show a model: its JSON schema is empty. Its input type is `unknown`, so check with it
39
+ * where you store, not in a request schema.
40
+ */
41
+ const strictDashboardDefinitionSchema = zod_v4.z.unknown().superRefine((value, ctx) => {
42
+ const core = _mastra_core_storage_dashboards.dashboardDefinitionSchema.safeParse(value);
43
+ if (!core.success) return report(ctx, require_observability_dashboard.zodIssues(core.error, []));
44
+ for (const [r, row] of value.rows.entries()) for (const [w, widget] of row.widgets.entries()) report(ctx, require_observability_dashboard.widgetIssues(widget), [
45
+ "rows",
46
+ r,
47
+ "widgets",
48
+ w
49
+ ]);
50
+ });
51
+ exports.OBSERVABILITY_CATALOG_MAX_METRIC_NAMES = require_observability_dashboard.OBSERVABILITY_CATALOG_MAX_METRIC_NAMES;
52
+ exports.createObservabilityDraftSchemas = require_observability_dashboard.createObservabilityDraftSchemas;
53
+ exports.createObservabilityWidgetInputSchema = require_observability_dashboard.createObservabilityWidgetInputSchema;
54
+ exports.observabilityWidgetInputSchema = require_observability_dashboard.observabilityWidgetInputSchema;
55
+ exports.strictDashboardDefinitionSchema = strictDashboardDefinitionSchema;
56
+ exports.strictDashboardWidgetSchema = strictDashboardWidgetSchema;
57
+ exports.toObservabilityDashboard = require_observability_dashboard.toObservabilityDashboard;
58
+ exports.toObservabilityWidget = require_observability_dashboard.toObservabilityWidget;
59
+
60
+ //# sourceMappingURL=dashboards.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboards.cjs","names":["z","dashboardWidgetSchema","zodIssues","widgetIssues","dashboardDefinitionSchema"],"sources":["../src/dashboards.ts"],"sourcesContent":["import { dashboardDefinitionSchema, dashboardWidgetSchema } from '@mastra/core/storage/dashboards';\nimport type {\n DashboardColumn,\n DashboardDefinition,\n DashboardWidget,\n DashboardWidgetView,\n} from '@mastra/core/storage/dashboards';\nimport { z } from 'zod/v4';\nimport { widgetIssues, zodIssues } from './dashboard-views';\nimport type { WidgetIssue } from './dashboard-views';\n\nexport {\n OBSERVABILITY_CATALOG_MAX_METRIC_NAMES,\n createObservabilityDraftSchemas,\n createObservabilityWidgetInputSchema,\n observabilityWidgetInputSchema,\n toObservabilityDashboard,\n toObservabilityWidget,\n} from './observability-dashboard';\nexport type {\n ObservabilityCatalog,\n ObservabilityDashboardDraft,\n ObservabilityDashboardInput,\n ObservabilityDashboardOpened,\n ObservabilityDraftOptions,\n ObservabilityDraftSchemas,\n ObservabilityWidgetDraft,\n} from './observability-dashboard';\n\n/*\n * Dashboards to store, and the drafts a model writes them as. The stored format is checked at least\n * as strictly as the dashboard renderer checks it: core's `dashboardDefinitionSchema`, then each\n * widget's kind, each view's options and each table column's options, then what each kind checks\n * beyond its schema (queries an option names, labels, ...). It also rejects columns on views that\n * aren't tables, which the renderer ignores. A draft (`createObservabilityDraftSchemas`) converts to\n * a widget or definition that passes those checks.\n *\n * The types are written out here rather than inferred, so this entry's declarations need nothing\n * beyond `@mastra/core` and `zod`; the package's tests check they match the kinds' own schemas.\n */\n\n/** A number read from one of the view's queries, named by its `id`. */\nexport type DashboardValueRef = {\n query: string;\n field?: 'value' | 'estimatedCost';\n measure?: string;\n percentile?: number;\n groups?: string[];\n notGroups?: string[];\n};\n\n/** A number a view shows: a query's value, or a fixed combination of several. */\nexport type DashboardValueExpr =\n | DashboardValueRef\n | { const: number }\n | { sum: DashboardValueExpr[] }\n | { minus: [DashboardValueExpr, DashboardValueExpr] }\n | { ratio: { of: DashboardValueExpr; over: DashboardValueExpr } }\n | { max: DashboardValueExpr[] }\n | { coalesce: DashboardValueExpr[] };\n\nexport type DashboardValueFormat = 'count' | 'usd' | 'duration' | 'percent' | 'score';\n\nexport type DashboardChartColor =\n | 'green'\n | 'sky'\n | 'violet'\n | 'teal'\n | 'indigo'\n | 'warning'\n | 'error'\n | 'neutral'\n | 'blue'\n | 'orange'\n | 'pink'\n | 'yellow'\n | 'red'\n | 'purple';\n\n/** A `kpis` view's options: a row of headline numbers. */\nexport type DashboardKpisOptions = {\n items: {\n label: string;\n icon?: 'bot' | 'coins' | 'hash' | 'threads';\n format: DashboardValueFormat;\n value: DashboardValueExpr;\n detail?: string;\n lowerIsBetter?: boolean;\n }[];\n};\n\n/** A `table` column's options, told apart by `type`. */\nexport type DashboardTableColumnOptions =\n | {\n type: 'name';\n as?: 'project';\n unnamed?: string;\n mark?: { icon: 'agent' | 'workflow' | 'tool' } | { providerDimension: string };\n description?: string;\n width?: string;\n sortable?: boolean;\n }\n | {\n type: 'dimension';\n dimension: string;\n as?: 'project';\n query?: string;\n joinOn?: string;\n description?: string;\n width?: string;\n sortable?: boolean;\n }\n | {\n type: 'value';\n value: DashboardValueExpr;\n format: 'count' | 'usd' | 'duration' | 'percent';\n emphasis?: boolean;\n missing?: number;\n additive?: boolean;\n better?: 'higher' | 'lower';\n unpricedWhen?: string;\n description?: string;\n width?: string;\n sortable?: boolean;\n }\n | { type: 'change'; description?: string };\n\n/** A `table` view's options: one row per group. */\nexport type DashboardTableOptions = {\n groupBy: string[];\n defaultSort: { column: string; direction: 'asc' | 'desc' };\n pageSize?: number;\n emptyMessage?: string;\n ariaLabel?: string;\n hideUnnamed?: boolean;\n dropped?: boolean;\n openWhen?: { minRows: number };\n rowDrilldown?: {\n fields: Record<\n string,\n | 'projectId'\n | 'entityName'\n | 'threadId'\n | 'resourceId'\n | 'environment'\n | 'sessionId'\n | 'userId'\n | 'model'\n | 'provider'\n >;\n spanTypes?: string[];\n keepEmpty?: boolean;\n };\n};\n\n/** A `timeseries` view's options: values per time bucket as stacked bars or lines. */\nexport type DashboardTimeseriesOptions = {\n chart: 'stackedBar' | 'line';\n format: DashboardValueFormat;\n axis?: boolean;\n series: {\n dataKey: string;\n label: string;\n color?: DashboardChartColor;\n emphasis?: boolean;\n value: DashboardValueExpr;\n rangeTotal?: DashboardValueExpr;\n round?: boolean;\n }[];\n buckets?: 'chart' | 'api';\n totals?: string[];\n hideEmpty?: boolean;\n emphasizeFirst?: boolean;\n xLabels?: 'edges';\n flatYDomain?: [number, number];\n yDomain?: [number, number];\n total?: { value: 'total' | { peak: string } | DashboardValueExpr; format?: DashboardValueFormat };\n /** @deprecated Accepted so saved definitions still parse. */\n emptyMessage?: string;\n emptyWhenZero?: DashboardValueExpr;\n};\n\n/** A `scores` view's options: one line per scorer. */\nexport type DashboardScoresOptions = {\n average: string;\n series: string;\n /** @deprecated Accepted so saved definitions still parse. */\n emptyMessage?: string;\n};\n\n/** A table column whose options its kind accepts. */\nexport type StrictDashboardTableColumn = Omit<DashboardColumn, 'options'> & { options: DashboardTableColumnOptions };\n\n/** A view whose options its kind accepts. Only table views have columns. */\nexport type StrictDashboardWidgetView<Options, Column = never> = Omit<DashboardWidgetView, 'options' | 'columns'> & {\n options: Options;\n columns?: Column[];\n};\n\ntype WidgetOf<Kind extends string, Options, Column = never> = Omit<DashboardWidget, 'kind' | 'views'> & {\n kind: Kind;\n views: StrictDashboardWidgetView<Options, Column>[];\n};\n\n/** A widget of a built-in kind that the dashboard renderer can draw. */\nexport type StrictDashboardWidget =\n | WidgetOf<'kpis', DashboardKpisOptions>\n | WidgetOf<'table', DashboardTableOptions, StrictDashboardTableColumn>\n | WidgetOf<'timeseries', DashboardTimeseriesOptions>\n | WidgetOf<'scores', DashboardScoresOptions>;\n\n/** A dashboard definition whose every widget the dashboard renderer can draw. */\nexport type StrictDashboardDefinition = Omit<DashboardDefinition, 'rows'> & {\n rows: { widgets: StrictDashboardWidget[] }[];\n};\n\ntype Issue = WidgetIssue;\n\nconst report = (ctx: z.RefinementCtx, issues: Issue[], prefix: PropertyKey[] = []) => {\n for (const issue of issues) {\n ctx.addIssue({ code: 'custom', path: [...prefix, ...issue.path], message: issue.message });\n }\n};\n\n/**\n * One widget as the dashboard renderer draws it: core's `dashboardWidgetSchema`, a built-in kind,\n * options that kind accepts, and nothing else it would reject, at every scope the widget shows at.\n * It also rejects columns on views that aren't tables: the renderer ignores them, but they usually\n * mean the widget was written as another kind. Paths are relative to the widget. Unique widget ids, the widget count and the size limit are the\n * definition's to check, so check the whole definition with `strictDashboardDefinitionSchema` too\n * before storing it.\n *\n * Parsing returns the widget as given: no defaults are filled in. It's a validator, not a schema to\n * show a model: its JSON schema is empty. Its input type is `unknown`, so check with it where you\n * store, not in a request schema.\n */\nexport const strictDashboardWidgetSchema: z.ZodType<StrictDashboardWidget> = z.unknown().superRefine((value, ctx) => {\n const core = dashboardWidgetSchema.safeParse(value);\n if (!core.success) return report(ctx, zodIssues(core.error, []));\n report(ctx, widgetIssues(value as DashboardWidget));\n}) as z.ZodType<StrictDashboardWidget>;\n\n/**\n * A dashboard definition as the dashboard renderer draws it: core's `dashboardDefinitionSchema`,\n * then every widget as `strictDashboardWidgetSchema` checks it, paths from the definition (e.g.\n * `rows.0.widgets.1.views.0.options.series.0.value`; problems a kind finds point at the view).\n * Check every definition with it before storing it, so each stored widget renders. Widgets of a\n * host's own kinds are rejected: check those with core's schema.\n *\n * Parsing returns the definition as given: no defaults are filled in. It's a validator, not a\n * schema to show a model: its JSON schema is empty. Its input type is `unknown`, so check with it\n * where you store, not in a request schema.\n */\nexport const strictDashboardDefinitionSchema: z.ZodType<StrictDashboardDefinition> = z\n .unknown()\n .superRefine((value, ctx) => {\n const core = dashboardDefinitionSchema.safeParse(value);\n if (!core.success) return report(ctx, zodIssues(core.error, []));\n for (const [r, row] of (value as DashboardDefinition).rows.entries()) {\n for (const [w, widget] of row.widgets.entries()) {\n report(ctx, widgetIssues(widget), ['rows', r, 'widgets', w]);\n }\n }\n }) as z.ZodType<StrictDashboardDefinition>;\n"],"mappings":";;;;;AA0NA,MAAM,UAAU,KAAsB,QAAiB,SAAwB,CAAC,MAAM;CACpF,KAAK,MAAM,SAAS,QAClB,IAAI,SAAS;EAAE,MAAM;EAAU,MAAM,CAAC,GAAG,QAAQ,GAAG,MAAM,IAAI;EAAG,SAAS,MAAM;CAAQ,CAAC;AAE7F;;;;;;;;;;;;;AAcA,MAAa,8BAAgEA,OAAAA,EAAE,QAAQ,CAAC,CAAC,aAAa,OAAO,QAAQ;CACnH,MAAM,OAAOC,gCAAAA,sBAAsB,UAAU,KAAK;CAClD,IAAI,CAAC,KAAK,SAAS,OAAO,OAAO,KAAKC,gCAAAA,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC;CAC/D,OAAO,KAAKC,gCAAAA,aAAa,KAAwB,CAAC;AACpD,CAAC;;;;;;;;;;;;AAaD,MAAa,kCAAwEH,OAAAA,EAClF,QAAQ,CAAC,CACT,aAAa,OAAO,QAAQ;CAC3B,MAAM,OAAOI,gCAAAA,0BAA0B,UAAU,KAAK;CACtD,IAAI,CAAC,KAAK,SAAS,OAAO,OAAO,KAAKF,gCAAAA,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC;CAC/D,KAAK,MAAM,CAAC,GAAG,QAAS,MAA8B,KAAK,QAAQ,GACjE,KAAK,MAAM,CAAC,GAAG,WAAW,IAAI,QAAQ,QAAQ,GAC5C,OAAO,KAAKC,gCAAAA,aAAa,MAAM,GAAG;EAAC;EAAQ;EAAG;EAAW;CAAC,CAAC;AAGjE,CAAC"}