@mastra/mcp-apps-components 0.1.0-alpha.2 → 0.1.0-alpha.3

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.
@@ -33,6 +33,8 @@ const OBSERVABILITY_DATE_PRESETS = [
33
33
  const OBSERVABILITY_WIDGET_PINNED_CONTEXT_KEY = "mastra.ai/observability-widget-pinned";
34
34
  /** `structuredContent` key of the model context update the app sends when the user (un)pins. */
35
35
  const OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY = "mastra.ai/observability-widget-pin";
36
+ /** Host context key holding what the host's page draws the widgets over (`ObservabilityWidgetView`). */
37
+ const OBSERVABILITY_WIDGET_VIEW_CONTEXT_KEY = "mastra.ai/observability-widget-view";
36
38
  Object.defineProperty(exports, "OBSERVABILITY_DATE_PRESETS", {
37
39
  enumerable: true,
38
40
  get: function() {
@@ -57,6 +59,12 @@ Object.defineProperty(exports, "OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY", {
57
59
  return OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY;
58
60
  }
59
61
  });
62
+ Object.defineProperty(exports, "OBSERVABILITY_WIDGET_VIEW_CONTEXT_KEY", {
63
+ enumerable: true,
64
+ get: function() {
65
+ return OBSERVABILITY_WIDGET_VIEW_CONTEXT_KEY;
66
+ }
67
+ });
60
68
  Object.defineProperty(exports, "QUERY_OBSERVABILITY_TOOL", {
61
69
  enumerable: true,
62
70
  get: function() {
@@ -64,4 +72,4 @@ Object.defineProperty(exports, "QUERY_OBSERVABILITY_TOOL", {
64
72
  }
65
73
  });
66
74
 
67
- //# sourceMappingURL=tool-B4yU6CY0.cjs.map
75
+ //# sourceMappingURL=tool-B9qpVU16.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-B9qpVU16.cjs","names":[],"sources":["../src/apps/observability-widget/tool.ts"],"sourcesContent":["import type { FilterNode } from '@mastra/core/storage/dashboards';\n\n/** The app-only tool the observability widget calls, on the server that opened it, for every read. */\nexport const QUERY_OBSERVABILITY_TOOL = 'queryObservability';\n\n/**\n * Every `MastraClient` method the app sends as a `queryObservability` action. All are reads; allow\n * these and nothing else (`z.enum(OBSERVABILITY_READ_ACTIONS)`).\n */\nexport const OBSERVABILITY_READ_ACTIONS = [\n 'aggregateTraces',\n 'aggregateSpans',\n 'getMetricAggregate',\n 'getMetricBreakdown',\n 'getMetricTimeSeries',\n 'getMetricPercentiles',\n 'getScoreAggregate',\n 'getScoreBreakdown',\n 'getScoreTimeSeries',\n 'getScorePercentiles',\n 'listScores',\n] as const;\n\nexport type ObservabilityReadAction = (typeof OBSERVABILITY_READ_ACTIONS)[number];\n\n/** The windows the widget can show, ending when it opens; the same presets as Studio's metrics. */\nexport const OBSERVABILITY_DATE_PRESETS = ['24h', '3d', '7d', '14d', '30d'] as const;\n\nexport type ObservabilityDatePreset = (typeof OBSERVABILITY_DATE_PRESETS)[number];\n\n/**\n * Host context key holding the ids of the widgets the host has pinned (`string[]`). The pin button\n * only shows when the host sends it and supports `updateModelContext.structuredContent`.\n */\nexport const OBSERVABILITY_WIDGET_PINNED_CONTEXT_KEY = 'mastra.ai/observability-widget-pinned';\n\n/** `structuredContent` key of the model context update the app sends when the user (un)pins. */\nexport const OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY = 'mastra.ai/observability-widget-pin';\n\n/** Host context key holding what the host's page draws the widgets over (`ObservabilityWidgetView`). */\nexport const OBSERVABILITY_WIDGET_VIEW_CONTEXT_KEY = 'mastra.ai/observability-widget-view';\n\n/** A custom window, as ISO date strings. A missing `from` is 24h before `to`; a missing `to` is now. */\nexport type ObservabilityWidgetDateRange = { from?: string; to?: string };\n\n/**\n * What the host's page draws the widgets over, e.g. the Metrics page's date range and filter bar.\n * Each field the host sets wins over the opening tool's result and the dashboard's `defaults`.\n */\nexport type ObservabilityWidgetView = {\n /** One of the presets, or `custom` to draw over `customRange`. */\n datePreset?: ObservabilityDatePreset | 'custom';\n /** The window drawn when `datePreset` is `custom`, as the Metrics page's custom range. */\n customRange?: ObservabilityWidgetDateRange;\n /** Replaces the dashboard's `defaults.filters`; only top-level chips filter, as on the Metrics page. */\n filters?: FilterNode[];\n /** Sent with every `queryObservability` call, so the server reads that project's data. */\n projectId?: string;\n};\n\n/** What the app sends under `OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY`: the state the user asked for. */\nexport type ObservabilityWidgetPin = {\n pinned: boolean;\n /** The stored dashboard widget, as the opening tool returned it. */\n widget: { id: string; [key: string]: unknown };\n datePreset: string;\n /** The window the widget was drawn over, when `datePreset` is `custom`. */\n customRange?: ObservabilityWidgetDateRange;\n /** The filters the widget was drawn under (the host's, else the dashboard's `defaults.filters`), when any. */\n filters?: unknown[];\n};\n"],"mappings":";;AAGA,MAAa,2BAA2B;;;;;AAMxC,MAAa,6BAA6B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAKA,MAAa,6BAA6B;CAAC;CAAO;CAAM;CAAM;CAAO;AAAK;;;;;AAQ1E,MAAa,0CAA0C;;AAGvD,MAAa,uCAAuC;;AAGpD,MAAa,wCAAwC"}
@@ -33,6 +33,8 @@ const OBSERVABILITY_DATE_PRESETS = [
33
33
  const OBSERVABILITY_WIDGET_PINNED_CONTEXT_KEY = "mastra.ai/observability-widget-pinned";
34
34
  /** `structuredContent` key of the model context update the app sends when the user (un)pins. */
35
35
  const OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY = "mastra.ai/observability-widget-pin";
36
- export { QUERY_OBSERVABILITY_TOOL as a, OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY as i, OBSERVABILITY_READ_ACTIONS as n, OBSERVABILITY_WIDGET_PINNED_CONTEXT_KEY as r, OBSERVABILITY_DATE_PRESETS as t };
36
+ /** Host context key holding what the host's page draws the widgets over (`ObservabilityWidgetView`). */
37
+ const OBSERVABILITY_WIDGET_VIEW_CONTEXT_KEY = "mastra.ai/observability-widget-view";
38
+ export { OBSERVABILITY_WIDGET_VIEW_CONTEXT_KEY as a, OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY as i, OBSERVABILITY_READ_ACTIONS as n, QUERY_OBSERVABILITY_TOOL as o, OBSERVABILITY_WIDGET_PINNED_CONTEXT_KEY as r, OBSERVABILITY_DATE_PRESETS as t };
37
39
 
38
- //# sourceMappingURL=tool-C601G1w9.js.map
40
+ //# sourceMappingURL=tool-HqUC6iks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-HqUC6iks.js","names":[],"sources":["../src/apps/observability-widget/tool.ts"],"sourcesContent":["import type { FilterNode } from '@mastra/core/storage/dashboards';\n\n/** The app-only tool the observability widget calls, on the server that opened it, for every read. */\nexport const QUERY_OBSERVABILITY_TOOL = 'queryObservability';\n\n/**\n * Every `MastraClient` method the app sends as a `queryObservability` action. All are reads; allow\n * these and nothing else (`z.enum(OBSERVABILITY_READ_ACTIONS)`).\n */\nexport const OBSERVABILITY_READ_ACTIONS = [\n 'aggregateTraces',\n 'aggregateSpans',\n 'getMetricAggregate',\n 'getMetricBreakdown',\n 'getMetricTimeSeries',\n 'getMetricPercentiles',\n 'getScoreAggregate',\n 'getScoreBreakdown',\n 'getScoreTimeSeries',\n 'getScorePercentiles',\n 'listScores',\n] as const;\n\nexport type ObservabilityReadAction = (typeof OBSERVABILITY_READ_ACTIONS)[number];\n\n/** The windows the widget can show, ending when it opens; the same presets as Studio's metrics. */\nexport const OBSERVABILITY_DATE_PRESETS = ['24h', '3d', '7d', '14d', '30d'] as const;\n\nexport type ObservabilityDatePreset = (typeof OBSERVABILITY_DATE_PRESETS)[number];\n\n/**\n * Host context key holding the ids of the widgets the host has pinned (`string[]`). The pin button\n * only shows when the host sends it and supports `updateModelContext.structuredContent`.\n */\nexport const OBSERVABILITY_WIDGET_PINNED_CONTEXT_KEY = 'mastra.ai/observability-widget-pinned';\n\n/** `structuredContent` key of the model context update the app sends when the user (un)pins. */\nexport const OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY = 'mastra.ai/observability-widget-pin';\n\n/** Host context key holding what the host's page draws the widgets over (`ObservabilityWidgetView`). */\nexport const OBSERVABILITY_WIDGET_VIEW_CONTEXT_KEY = 'mastra.ai/observability-widget-view';\n\n/** A custom window, as ISO date strings. A missing `from` is 24h before `to`; a missing `to` is now. */\nexport type ObservabilityWidgetDateRange = { from?: string; to?: string };\n\n/**\n * What the host's page draws the widgets over, e.g. the Metrics page's date range and filter bar.\n * Each field the host sets wins over the opening tool's result and the dashboard's `defaults`.\n */\nexport type ObservabilityWidgetView = {\n /** One of the presets, or `custom` to draw over `customRange`. */\n datePreset?: ObservabilityDatePreset | 'custom';\n /** The window drawn when `datePreset` is `custom`, as the Metrics page's custom range. */\n customRange?: ObservabilityWidgetDateRange;\n /** Replaces the dashboard's `defaults.filters`; only top-level chips filter, as on the Metrics page. */\n filters?: FilterNode[];\n /** Sent with every `queryObservability` call, so the server reads that project's data. */\n projectId?: string;\n};\n\n/** What the app sends under `OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY`: the state the user asked for. */\nexport type ObservabilityWidgetPin = {\n pinned: boolean;\n /** The stored dashboard widget, as the opening tool returned it. */\n widget: { id: string; [key: string]: unknown };\n datePreset: string;\n /** The window the widget was drawn over, when `datePreset` is `custom`. */\n customRange?: ObservabilityWidgetDateRange;\n /** The filters the widget was drawn under (the host's, else the dashboard's `defaults.filters`), when any. */\n filters?: unknown[];\n};\n"],"mappings":";;AAGA,MAAa,2BAA2B;;;;;AAMxC,MAAa,6BAA6B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAKA,MAAa,6BAA6B;CAAC;CAAO;CAAM;CAAM;CAAO;AAAK;;;;;AAQ1E,MAAa,0CAA0C;;AAGvD,MAAa,uCAAuC;;AAGpD,MAAa,wCAAwC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-apps-components",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.0-alpha.3",
4
4
  "description": "Prebuilt MCP Apps, ready to register as MCP server app resources",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -69,11 +69,11 @@
69
69
  "zod": "^4.6.7",
70
70
  "@internal/lint": "0.0.148",
71
71
  "@internal/types-builder": "0.0.123",
72
- "@mastra/client-js": "1.60.0-alpha.1",
73
- "@mastra/core": "1.83.0-alpha.1",
72
+ "@mastra/client-js": "1.60.0-alpha.3",
73
+ "@mastra/core": "1.83.0-alpha.3",
74
74
  "@mastra/mcp": "2.9.0-alpha.1",
75
- "@mastra/playground-ui": "69.0.0-alpha.2",
76
- "@mastra/react": "1.15.0-alpha.1"
75
+ "@mastra/playground-ui": "69.0.0-alpha.4",
76
+ "@mastra/react": "1.15.0-alpha.3"
77
77
  },
78
78
  "engines": {
79
79
  "node": ">=22.13.0"
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-B4yU6CY0.cjs","names":[],"sources":["../src/apps/observability-widget/tool.ts"],"sourcesContent":["/** The app-only tool the observability widget calls, on the server that opened it, for every read. */\nexport const QUERY_OBSERVABILITY_TOOL = 'queryObservability';\n\n/**\n * Every `MastraClient` method the app sends as a `queryObservability` action. All are reads; allow\n * these and nothing else (`z.enum(OBSERVABILITY_READ_ACTIONS)`).\n */\nexport const OBSERVABILITY_READ_ACTIONS = [\n 'aggregateTraces',\n 'aggregateSpans',\n 'getMetricAggregate',\n 'getMetricBreakdown',\n 'getMetricTimeSeries',\n 'getMetricPercentiles',\n 'getScoreAggregate',\n 'getScoreBreakdown',\n 'getScoreTimeSeries',\n 'getScorePercentiles',\n 'listScores',\n] as const;\n\nexport type ObservabilityReadAction = (typeof OBSERVABILITY_READ_ACTIONS)[number];\n\n/** The windows the widget can show, ending when it opens; the same presets as Studio's metrics. */\nexport const OBSERVABILITY_DATE_PRESETS = ['24h', '3d', '7d', '14d', '30d'] as const;\n\nexport type ObservabilityDatePreset = (typeof OBSERVABILITY_DATE_PRESETS)[number];\n\n/**\n * Host context key holding the ids of the widgets the host has pinned (`string[]`). The pin button\n * only shows when the host sends it and supports `updateModelContext.structuredContent`.\n */\nexport const OBSERVABILITY_WIDGET_PINNED_CONTEXT_KEY = 'mastra.ai/observability-widget-pinned';\n\n/** `structuredContent` key of the model context update the app sends when the user (un)pins. */\nexport const OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY = 'mastra.ai/observability-widget-pin';\n\n/** What the app sends under `OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY`: the state the user asked for. */\nexport type ObservabilityWidgetPin = {\n pinned: boolean;\n /** The stored dashboard widget, as the opening tool returned it. */\n widget: { id: string; [key: string]: unknown };\n datePreset: string;\n /** The dashboard's `defaults.filters` the widget was drawn under, when it has any. */\n filters?: unknown[];\n};\n"],"mappings":";;AACA,MAAa,2BAA2B;;;;;AAMxC,MAAa,6BAA6B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAKA,MAAa,6BAA6B;CAAC;CAAO;CAAM;CAAM;CAAO;AAAK;;;;;AAQ1E,MAAa,0CAA0C;;AAGvD,MAAa,uCAAuC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-C601G1w9.js","names":[],"sources":["../src/apps/observability-widget/tool.ts"],"sourcesContent":["/** The app-only tool the observability widget calls, on the server that opened it, for every read. */\nexport const QUERY_OBSERVABILITY_TOOL = 'queryObservability';\n\n/**\n * Every `MastraClient` method the app sends as a `queryObservability` action. All are reads; allow\n * these and nothing else (`z.enum(OBSERVABILITY_READ_ACTIONS)`).\n */\nexport const OBSERVABILITY_READ_ACTIONS = [\n 'aggregateTraces',\n 'aggregateSpans',\n 'getMetricAggregate',\n 'getMetricBreakdown',\n 'getMetricTimeSeries',\n 'getMetricPercentiles',\n 'getScoreAggregate',\n 'getScoreBreakdown',\n 'getScoreTimeSeries',\n 'getScorePercentiles',\n 'listScores',\n] as const;\n\nexport type ObservabilityReadAction = (typeof OBSERVABILITY_READ_ACTIONS)[number];\n\n/** The windows the widget can show, ending when it opens; the same presets as Studio's metrics. */\nexport const OBSERVABILITY_DATE_PRESETS = ['24h', '3d', '7d', '14d', '30d'] as const;\n\nexport type ObservabilityDatePreset = (typeof OBSERVABILITY_DATE_PRESETS)[number];\n\n/**\n * Host context key holding the ids of the widgets the host has pinned (`string[]`). The pin button\n * only shows when the host sends it and supports `updateModelContext.structuredContent`.\n */\nexport const OBSERVABILITY_WIDGET_PINNED_CONTEXT_KEY = 'mastra.ai/observability-widget-pinned';\n\n/** `structuredContent` key of the model context update the app sends when the user (un)pins. */\nexport const OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY = 'mastra.ai/observability-widget-pin';\n\n/** What the app sends under `OBSERVABILITY_WIDGET_PIN_CONTEXT_KEY`: the state the user asked for. */\nexport type ObservabilityWidgetPin = {\n pinned: boolean;\n /** The stored dashboard widget, as the opening tool returned it. */\n widget: { id: string; [key: string]: unknown };\n datePreset: string;\n /** The dashboard's `defaults.filters` the widget was drawn under, when it has any. */\n filters?: unknown[];\n};\n"],"mappings":";;AACA,MAAa,2BAA2B;;;;;AAMxC,MAAa,6BAA6B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAKA,MAAa,6BAA6B;CAAC;CAAO;CAAM;CAAM;CAAO;AAAK;;;;;AAQ1E,MAAa,0CAA0C;;AAGvD,MAAa,uCAAuC"}