@mastra/playground-ui 51.1.0-alpha.7 → 51.1.0-alpha.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 51.1.0-alpha.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Stop observability filter discovery from re-scanning all history on every refresh ([#22136](https://github.com/mastra-ai/mastra/pull/22136))
8
+
9
+ Discovery queries that build Studio's Traces, Logs, and Metrics filter suggestions scanned every span, metric, and log event each time the cache went stale, which grew unbounded with retained data. Refreshes are now bounded to the last 30 days by default (configurable via `observability.discovery.lookbackSeconds`, `0` restores the previous unbounded behaviour), so the planner can prune partitions instead of reading all of them. Only one process refreshes a given cache entry at a time, so running several server instances no longer multiplies the work, and Studio holds discovery results for five minutes instead of refetching on every page mount.
10
+
11
+ - Updated dependencies [[`aa3a85d`](https://github.com/mastra-ai/mastra/commit/aa3a85daf094c683bb97efdf4b6a696d2e474af5), [`d29d06f`](https://github.com/mastra-ai/mastra/commit/d29d06fe00bbd35b4571150ea04c59d2ed783c71), [`e6516df`](https://github.com/mastra-ai/mastra/commit/e6516dfcdae4f4ac0e7971d84359a81385ee602f), [`0b2a3d1`](https://github.com/mastra-ai/mastra/commit/0b2a3d1783875c5b97b7b36ab3d03d7360e0dde7), [`6bb5d71`](https://github.com/mastra-ai/mastra/commit/6bb5d7193fe9166b219f0fccae17db7a5ae86e65), [`57de7d6`](https://github.com/mastra-ai/mastra/commit/57de7d644ba7146edb4e9e6111ec4fa98c3a59e9), [`6bb5d71`](https://github.com/mastra-ai/mastra/commit/6bb5d7193fe9166b219f0fccae17db7a5ae86e65), [`e8e299c`](https://github.com/mastra-ai/mastra/commit/e8e299cc6abdfc39947e2fec25803493015d3882), [`edfc548`](https://github.com/mastra-ai/mastra/commit/edfc548886bc7bae17b681f8b6b41a47eb32bcd2), [`a8a4871`](https://github.com/mastra-ai/mastra/commit/a8a4871215f51da95c47129602157ce5372f634a), [`5165cdc`](https://github.com/mastra-ai/mastra/commit/5165cdcdcf50e144bb8113278535196cc9b07065), [`6bb5d71`](https://github.com/mastra-ai/mastra/commit/6bb5d7193fe9166b219f0fccae17db7a5ae86e65), [`9c984f9`](https://github.com/mastra-ai/mastra/commit/9c984f9152c0ded45453f21cb1f517fe12f8beae), [`9ee8120`](https://github.com/mastra-ai/mastra/commit/9ee8120ce17f76b9f617489e05a283353742690a), [`d975e92`](https://github.com/mastra-ai/mastra/commit/d975e924d4936f46c386bd3dee39c671720289f6), [`1cfa878`](https://github.com/mastra-ai/mastra/commit/1cfa8784d8da0dfaa0317e5048bc48b6084a5ea5), [`c118318`](https://github.com/mastra-ai/mastra/commit/c1183181c9804303db4b511c2e2648f8b714712b), [`fc07c64`](https://github.com/mastra-ai/mastra/commit/fc07c6465043e08e99193a6751a01c56ffc2e7a1), [`542dee2`](https://github.com/mastra-ai/mastra/commit/542dee254167f974ff8cbbbfc0ce10f9a2616a7b), [`8dcd635`](https://github.com/mastra-ai/mastra/commit/8dcd6357f0d9557cebc727d7abc6901af6231e4f), [`a58483c`](https://github.com/mastra-ai/mastra/commit/a58483cff1a9d41fce7c931843f48cb0ac450f64), [`a58483c`](https://github.com/mastra-ai/mastra/commit/a58483cff1a9d41fce7c931843f48cb0ac450f64), [`895e9df`](https://github.com/mastra-ai/mastra/commit/895e9dfc17d6f34299eca64e317ded9e5f5e5ef8)]:
12
+ - @mastra/core@1.62.0-alpha.8
13
+ - @mastra/client-js@1.42.1-alpha.8
14
+ - @mastra/memory@1.28.0-alpha.3
15
+ - @mastra/react@1.4.6-alpha.8
16
+
3
17
  ## 51.1.0-alpha.7
4
18
 
5
19
  ### Patch Changes
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const DISCOVERY_STALE_TIME = 5 * 60 * 1e3;
6
+
7
+ exports.DISCOVERY_STALE_TIME = DISCOVERY_STALE_TIME;
8
+ //# sourceMappingURL=discovery-cache.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery-cache.cjs.js","sources":["../../../../src/domains/traces/hooks/discovery-cache.ts"],"sourcesContent":["/**\n * How long discovery results (tags, environments, service names, entity\n * names) stay fresh on the client.\n *\n * Discovery values are filter suggestions that change slowly, and the server\n * caches them for 5 minutes anyway. Without a staleTime, React Query refetches\n * on every mount and window focus, which pushes those refetches straight\n * through to the store's discovery refresh. Matching the server TTL keeps the\n * client from asking more often than the answer can change.\n */\nexport const DISCOVERY_STALE_TIME = 5 * 60 * 1000;\n"],"names":[],"mappings":";;;;AAUO,MAAM,oBAAA,GAAuB,IAAI,EAAA,GAAK;;;;"}
@@ -0,0 +1,2 @@
1
+ export * from '../../../src/domains/traces/hooks/discovery-cache'
2
+ export {}
@@ -0,0 +1,4 @@
1
+ const DISCOVERY_STALE_TIME = 5 * 60 * 1e3;
2
+
3
+ export { DISCOVERY_STALE_TIME };
4
+ //# sourceMappingURL=discovery-cache.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery-cache.es.js","sources":["../../../../src/domains/traces/hooks/discovery-cache.ts"],"sourcesContent":["/**\n * How long discovery results (tags, environments, service names, entity\n * names) stay fresh on the client.\n *\n * Discovery values are filter suggestions that change slowly, and the server\n * caches them for 5 minutes anyway. Without a staleTime, React Query refetches\n * on every mount and window focus, which pushes those refetches straight\n * through to the store's discovery refresh. Matching the server TTL keeps the\n * client from asking more often than the answer can change.\n */\nexport const DISCOVERY_STALE_TIME = 5 * 60 * 1000;\n"],"names":[],"mappings":"AAUO,MAAM,oBAAA,GAAuB,IAAI,EAAA,GAAK;;;;"}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
  const observability = require('@mastra/core/observability');
6
6
  const react = require('@mastra/react');
7
7
  const reactQuery = require('@tanstack/react-query');
8
+ const domains_traces_hooks_discoveryCache = require('./discovery-cache.cjs.js');
8
9
  const domains_traces_traceFilters = require('../trace-filters.cjs.js');
9
10
 
10
11
  function resolveEntityType(entityType) {
@@ -40,7 +41,8 @@ const useEntityNames = ({ entityType, rootOnly = false } = {}) => {
40
41
  }
41
42
  },
42
43
  select: (data) => data?.names ?? [],
43
- retry: false
44
+ retry: false,
45
+ staleTime: domains_traces_hooks_discoveryCache.DISCOVERY_STALE_TIME
44
46
  });
45
47
  };
46
48
 
@@ -1 +1 @@
1
- {"version":3,"file":"use-entity-names.cjs.js","sources":["../../../../src/domains/traces/hooks/use-entity-names.ts"],"sourcesContent":["import { EntityType } from '@mastra/core/observability';\nimport { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport { ROOT_ENTITY_TYPE_OPTIONS } from '@/domains/traces/trace-filters';\n\ntype EntityTypeValue = `${EntityType}`;\n\ntype UseEntityNamesOptions = {\n entityType?: EntityTypeValue;\n rootOnly?: boolean;\n};\n\nfunction resolveEntityType(entityType: EntityTypeValue) {\n return Object.values(EntityType).find(candidate => candidate === entityType);\n}\n\nexport const useEntityNames = ({ entityType, rootOnly = false }: UseEntityNamesOptions = {}) => {\n const client = useMastraClient();\n\n // Mirror the queryFn branches so the cache key reflects what the server\n // actually returns. rootOnly only matters when entityType is not set; when\n // entityType is set, the query ignores rootOnly entirely.\n const queryKey = entityType\n ? ['observability-entity-names', 'by-type', entityType]\n : ['observability-entity-names', 'all', rootOnly ? 'root-only' : 'all-types'];\n\n return useQuery({\n queryKey,\n queryFn: async () => {\n try {\n if (entityType) {\n const resolvedEntityType = resolveEntityType(entityType);\n if (!resolvedEntityType) return { names: [] };\n return await client.getEntityNames({ entityType: resolvedEntityType });\n }\n\n if (!rootOnly) {\n return await client.getEntityNames();\n }\n\n const responses = await Promise.all(\n ROOT_ENTITY_TYPE_OPTIONS.map(option => {\n const resolvedEntityType = resolveEntityType(option.entityType);\n if (!resolvedEntityType) return { names: [] };\n return client.getEntityNames({ entityType: resolvedEntityType });\n }),\n );\n\n return {\n names: Array.from(new Set(responses.flatMap(response => response?.names ?? []))).sort(),\n };\n } catch {\n return { names: [] };\n }\n },\n select: data => data?.names ?? [],\n retry: false,\n });\n};\n"],"names":["EntityType","useMastraClient","useQuery","ROOT_ENTITY_TYPE_OPTIONS"],"mappings":";;;;;;;;;AAYA,SAAS,kBAAkB,UAAA,EAA6B;AACtD,EAAA,OAAO,OAAO,MAAA,CAAOA,wBAAU,EAAE,IAAA,CAAK,CAAA,SAAA,KAAa,cAAc,UAAU,CAAA;AAC7E;AAEO,MAAM,cAAA,GAAiB,CAAC,EAAE,UAAA,EAAY,WAAW,KAAA,EAAM,GAA2B,EAAC,KAAM;AAC9F,EAAA,MAAM,SAASC,qBAAA,EAAgB;AAK/B,EAAA,MAAM,QAAA,GAAW,UAAA,GACb,CAAC,4BAAA,EAA8B,SAAA,EAAW,UAAU,CAAA,GACpD,CAAC,4BAAA,EAA8B,KAAA,EAAO,QAAA,GAAW,WAAA,GAAc,WAAW,CAAA;AAE9E,EAAA,OAAOC,mBAAA,CAAS;AAAA,IACd,QAAA;AAAA,IACA,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,IAAI,UAAA,EAAY;AACd,UAAA,MAAM,kBAAA,GAAqB,kBAAkB,UAAU,CAAA;AACvD,UAAA,IAAI,CAAC,kBAAA,EAAoB,OAAO,EAAE,KAAA,EAAO,EAAC,EAAE;AAC5C,UAAA,OAAO,MAAM,MAAA,CAAO,cAAA,CAAe,EAAE,UAAA,EAAY,oBAAoB,CAAA;AAAA,QACvE;AAEA,QAAA,IAAI,CAAC,QAAA,EAAU;AACb,UAAA,OAAO,MAAM,OAAO,cAAA,EAAe;AAAA,QACrC;AAEA,QAAA,MAAM,SAAA,GAAY,MAAM,OAAA,CAAQ,GAAA;AAAA,UAC9BC,oDAAA,CAAyB,IAAI,CAAA,MAAA,KAAU;AACrC,YAAA,MAAM,kBAAA,GAAqB,iBAAA,CAAkB,MAAA,CAAO,UAAU,CAAA;AAC9D,YAAA,IAAI,CAAC,kBAAA,EAAoB,OAAO,EAAE,KAAA,EAAO,EAAC,EAAE;AAC5C,YAAA,OAAO,MAAA,CAAO,cAAA,CAAe,EAAE,UAAA,EAAY,oBAAoB,CAAA;AAAA,UACjE,CAAC;AAAA,SACH;AAEA,QAAA,OAAO;AAAA,UACL,KAAA,EAAO,KAAA,CAAM,IAAA,CAAK,IAAI,IAAI,SAAA,CAAU,OAAA,CAAQ,CAAA,QAAA,KAAY,QAAA,EAAU,SAAS,EAAE,CAAC,CAAC,EAAE,IAAA;AAAK,SACxF;AAAA,MACF,CAAA,CAAA,MAAQ;AACN,QAAA,OAAO,EAAE,KAAA,EAAO,EAAC,EAAE;AAAA,MACrB;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,KAAA,IAAS,EAAC;AAAA,IAChC,KAAA,EAAO;AAAA,GACR,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"use-entity-names.cjs.js","sources":["../../../../src/domains/traces/hooks/use-entity-names.ts"],"sourcesContent":["import { EntityType } from '@mastra/core/observability';\nimport { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport { DISCOVERY_STALE_TIME } from './discovery-cache';\nimport { ROOT_ENTITY_TYPE_OPTIONS } from '@/domains/traces/trace-filters';\n\ntype EntityTypeValue = `${EntityType}`;\n\ntype UseEntityNamesOptions = {\n entityType?: EntityTypeValue;\n rootOnly?: boolean;\n};\n\nfunction resolveEntityType(entityType: EntityTypeValue) {\n return Object.values(EntityType).find(candidate => candidate === entityType);\n}\n\nexport const useEntityNames = ({ entityType, rootOnly = false }: UseEntityNamesOptions = {}) => {\n const client = useMastraClient();\n\n // Mirror the queryFn branches so the cache key reflects what the server\n // actually returns. rootOnly only matters when entityType is not set; when\n // entityType is set, the query ignores rootOnly entirely.\n const queryKey = entityType\n ? ['observability-entity-names', 'by-type', entityType]\n : ['observability-entity-names', 'all', rootOnly ? 'root-only' : 'all-types'];\n\n return useQuery({\n queryKey,\n queryFn: async () => {\n try {\n if (entityType) {\n const resolvedEntityType = resolveEntityType(entityType);\n if (!resolvedEntityType) return { names: [] };\n return await client.getEntityNames({ entityType: resolvedEntityType });\n }\n\n if (!rootOnly) {\n return await client.getEntityNames();\n }\n\n const responses = await Promise.all(\n ROOT_ENTITY_TYPE_OPTIONS.map(option => {\n const resolvedEntityType = resolveEntityType(option.entityType);\n if (!resolvedEntityType) return { names: [] };\n return client.getEntityNames({ entityType: resolvedEntityType });\n }),\n );\n\n return {\n names: Array.from(new Set(responses.flatMap(response => response?.names ?? []))).sort(),\n };\n } catch {\n return { names: [] };\n }\n },\n select: data => data?.names ?? [],\n retry: false,\n staleTime: DISCOVERY_STALE_TIME,\n });\n};\n"],"names":["EntityType","useMastraClient","useQuery","ROOT_ENTITY_TYPE_OPTIONS","DISCOVERY_STALE_TIME"],"mappings":";;;;;;;;;;AAaA,SAAS,kBAAkB,UAAA,EAA6B;AACtD,EAAA,OAAO,OAAO,MAAA,CAAOA,wBAAU,EAAE,IAAA,CAAK,CAAA,SAAA,KAAa,cAAc,UAAU,CAAA;AAC7E;AAEO,MAAM,cAAA,GAAiB,CAAC,EAAE,UAAA,EAAY,WAAW,KAAA,EAAM,GAA2B,EAAC,KAAM;AAC9F,EAAA,MAAM,SAASC,qBAAA,EAAgB;AAK/B,EAAA,MAAM,QAAA,GAAW,UAAA,GACb,CAAC,4BAAA,EAA8B,SAAA,EAAW,UAAU,CAAA,GACpD,CAAC,4BAAA,EAA8B,KAAA,EAAO,QAAA,GAAW,WAAA,GAAc,WAAW,CAAA;AAE9E,EAAA,OAAOC,mBAAA,CAAS;AAAA,IACd,QAAA;AAAA,IACA,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,IAAI,UAAA,EAAY;AACd,UAAA,MAAM,kBAAA,GAAqB,kBAAkB,UAAU,CAAA;AACvD,UAAA,IAAI,CAAC,kBAAA,EAAoB,OAAO,EAAE,KAAA,EAAO,EAAC,EAAE;AAC5C,UAAA,OAAO,MAAM,MAAA,CAAO,cAAA,CAAe,EAAE,UAAA,EAAY,oBAAoB,CAAA;AAAA,QACvE;AAEA,QAAA,IAAI,CAAC,QAAA,EAAU;AACb,UAAA,OAAO,MAAM,OAAO,cAAA,EAAe;AAAA,QACrC;AAEA,QAAA,MAAM,SAAA,GAAY,MAAM,OAAA,CAAQ,GAAA;AAAA,UAC9BC,oDAAA,CAAyB,IAAI,CAAA,MAAA,KAAU;AACrC,YAAA,MAAM,kBAAA,GAAqB,iBAAA,CAAkB,MAAA,CAAO,UAAU,CAAA;AAC9D,YAAA,IAAI,CAAC,kBAAA,EAAoB,OAAO,EAAE,KAAA,EAAO,EAAC,EAAE;AAC5C,YAAA,OAAO,MAAA,CAAO,cAAA,CAAe,EAAE,UAAA,EAAY,oBAAoB,CAAA;AAAA,UACjE,CAAC;AAAA,SACH;AAEA,QAAA,OAAO;AAAA,UACL,KAAA,EAAO,KAAA,CAAM,IAAA,CAAK,IAAI,IAAI,SAAA,CAAU,OAAA,CAAQ,CAAA,QAAA,KAAY,QAAA,EAAU,SAAS,EAAE,CAAC,CAAC,EAAE,IAAA;AAAK,SACxF;AAAA,MACF,CAAA,CAAA,MAAQ;AACN,QAAA,OAAO,EAAE,KAAA,EAAO,EAAC,EAAE;AAAA,MACrB;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,KAAA,IAAS,EAAC;AAAA,IAChC,KAAA,EAAO,KAAA;AAAA,IACP,SAAA,EAAWC;AAAA,GACZ,CAAA;AACH;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { EntityType } from '@mastra/core/observability';
2
2
  import { useMastraClient } from '@mastra/react';
3
3
  import { useQuery } from '@tanstack/react-query';
4
+ import { DISCOVERY_STALE_TIME } from './discovery-cache.es.js';
4
5
  import { ROOT_ENTITY_TYPE_OPTIONS } from '../trace-filters.es.js';
5
6
 
6
7
  function resolveEntityType(entityType) {
@@ -36,7 +37,8 @@ const useEntityNames = ({ entityType, rootOnly = false } = {}) => {
36
37
  }
37
38
  },
38
39
  select: (data) => data?.names ?? [],
39
- retry: false
40
+ retry: false,
41
+ staleTime: DISCOVERY_STALE_TIME
40
42
  });
41
43
  };
42
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"use-entity-names.es.js","sources":["../../../../src/domains/traces/hooks/use-entity-names.ts"],"sourcesContent":["import { EntityType } from '@mastra/core/observability';\nimport { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport { ROOT_ENTITY_TYPE_OPTIONS } from '@/domains/traces/trace-filters';\n\ntype EntityTypeValue = `${EntityType}`;\n\ntype UseEntityNamesOptions = {\n entityType?: EntityTypeValue;\n rootOnly?: boolean;\n};\n\nfunction resolveEntityType(entityType: EntityTypeValue) {\n return Object.values(EntityType).find(candidate => candidate === entityType);\n}\n\nexport const useEntityNames = ({ entityType, rootOnly = false }: UseEntityNamesOptions = {}) => {\n const client = useMastraClient();\n\n // Mirror the queryFn branches so the cache key reflects what the server\n // actually returns. rootOnly only matters when entityType is not set; when\n // entityType is set, the query ignores rootOnly entirely.\n const queryKey = entityType\n ? ['observability-entity-names', 'by-type', entityType]\n : ['observability-entity-names', 'all', rootOnly ? 'root-only' : 'all-types'];\n\n return useQuery({\n queryKey,\n queryFn: async () => {\n try {\n if (entityType) {\n const resolvedEntityType = resolveEntityType(entityType);\n if (!resolvedEntityType) return { names: [] };\n return await client.getEntityNames({ entityType: resolvedEntityType });\n }\n\n if (!rootOnly) {\n return await client.getEntityNames();\n }\n\n const responses = await Promise.all(\n ROOT_ENTITY_TYPE_OPTIONS.map(option => {\n const resolvedEntityType = resolveEntityType(option.entityType);\n if (!resolvedEntityType) return { names: [] };\n return client.getEntityNames({ entityType: resolvedEntityType });\n }),\n );\n\n return {\n names: Array.from(new Set(responses.flatMap(response => response?.names ?? []))).sort(),\n };\n } catch {\n return { names: [] };\n }\n },\n select: data => data?.names ?? [],\n retry: false,\n });\n};\n"],"names":[],"mappings":";;;;;AAYA,SAAS,kBAAkB,UAAA,EAA6B;AACtD,EAAA,OAAO,OAAO,MAAA,CAAO,UAAU,EAAE,IAAA,CAAK,CAAA,SAAA,KAAa,cAAc,UAAU,CAAA;AAC7E;AAEO,MAAM,cAAA,GAAiB,CAAC,EAAE,UAAA,EAAY,WAAW,KAAA,EAAM,GAA2B,EAAC,KAAM;AAC9F,EAAA,MAAM,SAAS,eAAA,EAAgB;AAK/B,EAAA,MAAM,QAAA,GAAW,UAAA,GACb,CAAC,4BAAA,EAA8B,SAAA,EAAW,UAAU,CAAA,GACpD,CAAC,4BAAA,EAA8B,KAAA,EAAO,QAAA,GAAW,WAAA,GAAc,WAAW,CAAA;AAE9E,EAAA,OAAO,QAAA,CAAS;AAAA,IACd,QAAA;AAAA,IACA,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,IAAI,UAAA,EAAY;AACd,UAAA,MAAM,kBAAA,GAAqB,kBAAkB,UAAU,CAAA;AACvD,UAAA,IAAI,CAAC,kBAAA,EAAoB,OAAO,EAAE,KAAA,EAAO,EAAC,EAAE;AAC5C,UAAA,OAAO,MAAM,MAAA,CAAO,cAAA,CAAe,EAAE,UAAA,EAAY,oBAAoB,CAAA;AAAA,QACvE;AAEA,QAAA,IAAI,CAAC,QAAA,EAAU;AACb,UAAA,OAAO,MAAM,OAAO,cAAA,EAAe;AAAA,QACrC;AAEA,QAAA,MAAM,SAAA,GAAY,MAAM,OAAA,CAAQ,GAAA;AAAA,UAC9B,wBAAA,CAAyB,IAAI,CAAA,MAAA,KAAU;AACrC,YAAA,MAAM,kBAAA,GAAqB,iBAAA,CAAkB,MAAA,CAAO,UAAU,CAAA;AAC9D,YAAA,IAAI,CAAC,kBAAA,EAAoB,OAAO,EAAE,KAAA,EAAO,EAAC,EAAE;AAC5C,YAAA,OAAO,MAAA,CAAO,cAAA,CAAe,EAAE,UAAA,EAAY,oBAAoB,CAAA;AAAA,UACjE,CAAC;AAAA,SACH;AAEA,QAAA,OAAO;AAAA,UACL,KAAA,EAAO,KAAA,CAAM,IAAA,CAAK,IAAI,IAAI,SAAA,CAAU,OAAA,CAAQ,CAAA,QAAA,KAAY,QAAA,EAAU,SAAS,EAAE,CAAC,CAAC,EAAE,IAAA;AAAK,SACxF;AAAA,MACF,CAAA,CAAA,MAAQ;AACN,QAAA,OAAO,EAAE,KAAA,EAAO,EAAC,EAAE;AAAA,MACrB;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,KAAA,IAAS,EAAC;AAAA,IAChC,KAAA,EAAO;AAAA,GACR,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"use-entity-names.es.js","sources":["../../../../src/domains/traces/hooks/use-entity-names.ts"],"sourcesContent":["import { EntityType } from '@mastra/core/observability';\nimport { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport { DISCOVERY_STALE_TIME } from './discovery-cache';\nimport { ROOT_ENTITY_TYPE_OPTIONS } from '@/domains/traces/trace-filters';\n\ntype EntityTypeValue = `${EntityType}`;\n\ntype UseEntityNamesOptions = {\n entityType?: EntityTypeValue;\n rootOnly?: boolean;\n};\n\nfunction resolveEntityType(entityType: EntityTypeValue) {\n return Object.values(EntityType).find(candidate => candidate === entityType);\n}\n\nexport const useEntityNames = ({ entityType, rootOnly = false }: UseEntityNamesOptions = {}) => {\n const client = useMastraClient();\n\n // Mirror the queryFn branches so the cache key reflects what the server\n // actually returns. rootOnly only matters when entityType is not set; when\n // entityType is set, the query ignores rootOnly entirely.\n const queryKey = entityType\n ? ['observability-entity-names', 'by-type', entityType]\n : ['observability-entity-names', 'all', rootOnly ? 'root-only' : 'all-types'];\n\n return useQuery({\n queryKey,\n queryFn: async () => {\n try {\n if (entityType) {\n const resolvedEntityType = resolveEntityType(entityType);\n if (!resolvedEntityType) return { names: [] };\n return await client.getEntityNames({ entityType: resolvedEntityType });\n }\n\n if (!rootOnly) {\n return await client.getEntityNames();\n }\n\n const responses = await Promise.all(\n ROOT_ENTITY_TYPE_OPTIONS.map(option => {\n const resolvedEntityType = resolveEntityType(option.entityType);\n if (!resolvedEntityType) return { names: [] };\n return client.getEntityNames({ entityType: resolvedEntityType });\n }),\n );\n\n return {\n names: Array.from(new Set(responses.flatMap(response => response?.names ?? []))).sort(),\n };\n } catch {\n return { names: [] };\n }\n },\n select: data => data?.names ?? [],\n retry: false,\n staleTime: DISCOVERY_STALE_TIME,\n });\n};\n"],"names":[],"mappings":";;;;;;AAaA,SAAS,kBAAkB,UAAA,EAA6B;AACtD,EAAA,OAAO,OAAO,MAAA,CAAO,UAAU,EAAE,IAAA,CAAK,CAAA,SAAA,KAAa,cAAc,UAAU,CAAA;AAC7E;AAEO,MAAM,cAAA,GAAiB,CAAC,EAAE,UAAA,EAAY,WAAW,KAAA,EAAM,GAA2B,EAAC,KAAM;AAC9F,EAAA,MAAM,SAAS,eAAA,EAAgB;AAK/B,EAAA,MAAM,QAAA,GAAW,UAAA,GACb,CAAC,4BAAA,EAA8B,SAAA,EAAW,UAAU,CAAA,GACpD,CAAC,4BAAA,EAA8B,KAAA,EAAO,QAAA,GAAW,WAAA,GAAc,WAAW,CAAA;AAE9E,EAAA,OAAO,QAAA,CAAS;AAAA,IACd,QAAA;AAAA,IACA,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,IAAI,UAAA,EAAY;AACd,UAAA,MAAM,kBAAA,GAAqB,kBAAkB,UAAU,CAAA;AACvD,UAAA,IAAI,CAAC,kBAAA,EAAoB,OAAO,EAAE,KAAA,EAAO,EAAC,EAAE;AAC5C,UAAA,OAAO,MAAM,MAAA,CAAO,cAAA,CAAe,EAAE,UAAA,EAAY,oBAAoB,CAAA;AAAA,QACvE;AAEA,QAAA,IAAI,CAAC,QAAA,EAAU;AACb,UAAA,OAAO,MAAM,OAAO,cAAA,EAAe;AAAA,QACrC;AAEA,QAAA,MAAM,SAAA,GAAY,MAAM,OAAA,CAAQ,GAAA;AAAA,UAC9B,wBAAA,CAAyB,IAAI,CAAA,MAAA,KAAU;AACrC,YAAA,MAAM,kBAAA,GAAqB,iBAAA,CAAkB,MAAA,CAAO,UAAU,CAAA;AAC9D,YAAA,IAAI,CAAC,kBAAA,EAAoB,OAAO,EAAE,KAAA,EAAO,EAAC,EAAE;AAC5C,YAAA,OAAO,MAAA,CAAO,cAAA,CAAe,EAAE,UAAA,EAAY,oBAAoB,CAAA;AAAA,UACjE,CAAC;AAAA,SACH;AAEA,QAAA,OAAO;AAAA,UACL,KAAA,EAAO,KAAA,CAAM,IAAA,CAAK,IAAI,IAAI,SAAA,CAAU,OAAA,CAAQ,CAAA,QAAA,KAAY,QAAA,EAAU,SAAS,EAAE,CAAC,CAAC,EAAE,IAAA;AAAK,SACxF;AAAA,MACF,CAAA,CAAA,MAAQ;AACN,QAAA,OAAO,EAAE,KAAA,EAAO,EAAC,EAAE;AAAA,MACrB;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,KAAA,IAAS,EAAC;AAAA,IAChC,KAAA,EAAO,KAAA;AAAA,IACP,SAAA,EAAW;AAAA,GACZ,CAAA;AACH;;;;"}
@@ -4,6 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  const react = require('@mastra/react');
6
6
  const reactQuery = require('@tanstack/react-query');
7
+ const domains_traces_hooks_discoveryCache = require('./discovery-cache.cjs.js');
7
8
 
8
9
  const useEnvironments = () => {
9
10
  const client = react.useMastraClient();
@@ -17,7 +18,8 @@ const useEnvironments = () => {
17
18
  }
18
19
  },
19
20
  select: (data) => data?.environments ?? [],
20
- retry: false
21
+ retry: false,
22
+ staleTime: domains_traces_hooks_discoveryCache.DISCOVERY_STALE_TIME
21
23
  });
22
24
  };
23
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"use-environments.cjs.js","sources":["../../../../src/domains/traces/hooks/use-environments.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\n\nexport const useEnvironments = () => {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['observability-environments'],\n queryFn: async () => {\n try {\n return await client.getEnvironments();\n } catch {\n return { environments: [] };\n }\n },\n select: data => data?.environments ?? [],\n retry: false,\n });\n};\n"],"names":["useMastraClient","useQuery"],"mappings":";;;;;;;AAGO,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,SAASA,qBAAA,EAAgB;AAE/B,EAAA,OAAOC,mBAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,4BAA4B,CAAA;AAAA,IACvC,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,OAAO,MAAM,OAAO,eAAA,EAAgB;AAAA,MACtC,CAAA,CAAA,MAAQ;AACN,QAAA,OAAO,EAAE,YAAA,EAAc,EAAC,EAAE;AAAA,MAC5B;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,YAAA,IAAgB,EAAC;AAAA,IACvC,KAAA,EAAO;AAAA,GACR,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"use-environments.cjs.js","sources":["../../../../src/domains/traces/hooks/use-environments.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport { DISCOVERY_STALE_TIME } from './discovery-cache';\n\nexport const useEnvironments = () => {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['observability-environments'],\n queryFn: async () => {\n try {\n return await client.getEnvironments();\n } catch {\n return { environments: [] };\n }\n },\n select: data => data?.environments ?? [],\n retry: false,\n staleTime: DISCOVERY_STALE_TIME,\n });\n};\n"],"names":["useMastraClient","useQuery","DISCOVERY_STALE_TIME"],"mappings":";;;;;;;;AAIO,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,SAASA,qBAAA,EAAgB;AAE/B,EAAA,OAAOC,mBAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,4BAA4B,CAAA;AAAA,IACvC,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,OAAO,MAAM,OAAO,eAAA,EAAgB;AAAA,MACtC,CAAA,CAAA,MAAQ;AACN,QAAA,OAAO,EAAE,YAAA,EAAc,EAAC,EAAE;AAAA,MAC5B;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,YAAA,IAAgB,EAAC;AAAA,IACvC,KAAA,EAAO,KAAA;AAAA,IACP,SAAA,EAAWC;AAAA,GACZ,CAAA;AACH;;;;"}
@@ -1,5 +1,6 @@
1
1
  import { useMastraClient } from '@mastra/react';
2
2
  import { useQuery } from '@tanstack/react-query';
3
+ import { DISCOVERY_STALE_TIME } from './discovery-cache.es.js';
3
4
 
4
5
  const useEnvironments = () => {
5
6
  const client = useMastraClient();
@@ -13,7 +14,8 @@ const useEnvironments = () => {
13
14
  }
14
15
  },
15
16
  select: (data) => data?.environments ?? [],
16
- retry: false
17
+ retry: false,
18
+ staleTime: DISCOVERY_STALE_TIME
17
19
  });
18
20
  };
19
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"use-environments.es.js","sources":["../../../../src/domains/traces/hooks/use-environments.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\n\nexport const useEnvironments = () => {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['observability-environments'],\n queryFn: async () => {\n try {\n return await client.getEnvironments();\n } catch {\n return { environments: [] };\n }\n },\n select: data => data?.environments ?? [],\n retry: false,\n });\n};\n"],"names":[],"mappings":";;;AAGO,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,SAAS,eAAA,EAAgB;AAE/B,EAAA,OAAO,QAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,4BAA4B,CAAA;AAAA,IACvC,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,OAAO,MAAM,OAAO,eAAA,EAAgB;AAAA,MACtC,CAAA,CAAA,MAAQ;AACN,QAAA,OAAO,EAAE,YAAA,EAAc,EAAC,EAAE;AAAA,MAC5B;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,YAAA,IAAgB,EAAC;AAAA,IACvC,KAAA,EAAO;AAAA,GACR,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"use-environments.es.js","sources":["../../../../src/domains/traces/hooks/use-environments.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport { DISCOVERY_STALE_TIME } from './discovery-cache';\n\nexport const useEnvironments = () => {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['observability-environments'],\n queryFn: async () => {\n try {\n return await client.getEnvironments();\n } catch {\n return { environments: [] };\n }\n },\n select: data => data?.environments ?? [],\n retry: false,\n staleTime: DISCOVERY_STALE_TIME,\n });\n};\n"],"names":[],"mappings":";;;;AAIO,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,SAAS,eAAA,EAAgB;AAE/B,EAAA,OAAO,QAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,4BAA4B,CAAA;AAAA,IACvC,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,OAAO,MAAM,OAAO,eAAA,EAAgB;AAAA,MACtC,CAAA,CAAA,MAAQ;AACN,QAAA,OAAO,EAAE,YAAA,EAAc,EAAC,EAAE;AAAA,MAC5B;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,YAAA,IAAgB,EAAC;AAAA,IACvC,KAAA,EAAO,KAAA;AAAA,IACP,SAAA,EAAW;AAAA,GACZ,CAAA;AACH;;;;"}
@@ -4,6 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  const react = require('@mastra/react');
6
6
  const reactQuery = require('@tanstack/react-query');
7
+ const domains_traces_hooks_discoveryCache = require('./discovery-cache.cjs.js');
7
8
 
8
9
  const useServiceNames = () => {
9
10
  const client = react.useMastraClient();
@@ -17,7 +18,8 @@ const useServiceNames = () => {
17
18
  }
18
19
  },
19
20
  select: (data) => data?.serviceNames ?? [],
20
- retry: false
21
+ retry: false,
22
+ staleTime: domains_traces_hooks_discoveryCache.DISCOVERY_STALE_TIME
21
23
  });
22
24
  };
23
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"use-service-names.cjs.js","sources":["../../../../src/domains/traces/hooks/use-service-names.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\n\nexport const useServiceNames = () => {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['observability-service-names'],\n queryFn: async () => {\n try {\n return await client.getServiceNames();\n } catch {\n return { serviceNames: [] };\n }\n },\n select: data => data?.serviceNames ?? [],\n retry: false,\n });\n};\n"],"names":["useMastraClient","useQuery"],"mappings":";;;;;;;AAGO,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,SAASA,qBAAA,EAAgB;AAE/B,EAAA,OAAOC,mBAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,6BAA6B,CAAA;AAAA,IACxC,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,OAAO,MAAM,OAAO,eAAA,EAAgB;AAAA,MACtC,CAAA,CAAA,MAAQ;AACN,QAAA,OAAO,EAAE,YAAA,EAAc,EAAC,EAAE;AAAA,MAC5B;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,YAAA,IAAgB,EAAC;AAAA,IACvC,KAAA,EAAO;AAAA,GACR,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"use-service-names.cjs.js","sources":["../../../../src/domains/traces/hooks/use-service-names.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport { DISCOVERY_STALE_TIME } from './discovery-cache';\n\nexport const useServiceNames = () => {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['observability-service-names'],\n queryFn: async () => {\n try {\n return await client.getServiceNames();\n } catch {\n return { serviceNames: [] };\n }\n },\n select: data => data?.serviceNames ?? [],\n retry: false,\n staleTime: DISCOVERY_STALE_TIME,\n });\n};\n"],"names":["useMastraClient","useQuery","DISCOVERY_STALE_TIME"],"mappings":";;;;;;;;AAIO,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,SAASA,qBAAA,EAAgB;AAE/B,EAAA,OAAOC,mBAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,6BAA6B,CAAA;AAAA,IACxC,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,OAAO,MAAM,OAAO,eAAA,EAAgB;AAAA,MACtC,CAAA,CAAA,MAAQ;AACN,QAAA,OAAO,EAAE,YAAA,EAAc,EAAC,EAAE;AAAA,MAC5B;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,YAAA,IAAgB,EAAC;AAAA,IACvC,KAAA,EAAO,KAAA;AAAA,IACP,SAAA,EAAWC;AAAA,GACZ,CAAA;AACH;;;;"}
@@ -1,5 +1,6 @@
1
1
  import { useMastraClient } from '@mastra/react';
2
2
  import { useQuery } from '@tanstack/react-query';
3
+ import { DISCOVERY_STALE_TIME } from './discovery-cache.es.js';
3
4
 
4
5
  const useServiceNames = () => {
5
6
  const client = useMastraClient();
@@ -13,7 +14,8 @@ const useServiceNames = () => {
13
14
  }
14
15
  },
15
16
  select: (data) => data?.serviceNames ?? [],
16
- retry: false
17
+ retry: false,
18
+ staleTime: DISCOVERY_STALE_TIME
17
19
  });
18
20
  };
19
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"use-service-names.es.js","sources":["../../../../src/domains/traces/hooks/use-service-names.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\n\nexport const useServiceNames = () => {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['observability-service-names'],\n queryFn: async () => {\n try {\n return await client.getServiceNames();\n } catch {\n return { serviceNames: [] };\n }\n },\n select: data => data?.serviceNames ?? [],\n retry: false,\n });\n};\n"],"names":[],"mappings":";;;AAGO,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,SAAS,eAAA,EAAgB;AAE/B,EAAA,OAAO,QAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,6BAA6B,CAAA;AAAA,IACxC,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,OAAO,MAAM,OAAO,eAAA,EAAgB;AAAA,MACtC,CAAA,CAAA,MAAQ;AACN,QAAA,OAAO,EAAE,YAAA,EAAc,EAAC,EAAE;AAAA,MAC5B;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,YAAA,IAAgB,EAAC;AAAA,IACvC,KAAA,EAAO;AAAA,GACR,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"use-service-names.es.js","sources":["../../../../src/domains/traces/hooks/use-service-names.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport { DISCOVERY_STALE_TIME } from './discovery-cache';\n\nexport const useServiceNames = () => {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['observability-service-names'],\n queryFn: async () => {\n try {\n return await client.getServiceNames();\n } catch {\n return { serviceNames: [] };\n }\n },\n select: data => data?.serviceNames ?? [],\n retry: false,\n staleTime: DISCOVERY_STALE_TIME,\n });\n};\n"],"names":[],"mappings":";;;;AAIO,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,SAAS,eAAA,EAAgB;AAE/B,EAAA,OAAO,QAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,6BAA6B,CAAA;AAAA,IACxC,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,OAAO,MAAM,OAAO,eAAA,EAAgB;AAAA,MACtC,CAAA,CAAA,MAAQ;AACN,QAAA,OAAO,EAAE,YAAA,EAAc,EAAC,EAAE;AAAA,MAC5B;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,YAAA,IAAgB,EAAC;AAAA,IACvC,KAAA,EAAO,KAAA;AAAA,IACP,SAAA,EAAW;AAAA,GACZ,CAAA;AACH;;;;"}
@@ -4,6 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  const react = require('@mastra/react');
6
6
  const reactQuery = require('@tanstack/react-query');
7
+ const domains_traces_hooks_discoveryCache = require('./discovery-cache.cjs.js');
7
8
 
8
9
  const useTags = () => {
9
10
  const client = react.useMastraClient();
@@ -17,7 +18,8 @@ const useTags = () => {
17
18
  }
18
19
  },
19
20
  select: (data) => data?.tags ?? [],
20
- retry: false
21
+ retry: false,
22
+ staleTime: domains_traces_hooks_discoveryCache.DISCOVERY_STALE_TIME
21
23
  });
22
24
  };
23
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"use-tags.cjs.js","sources":["../../../../src/domains/traces/hooks/use-tags.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\n\nexport const useTags = () => {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['observability-tags'],\n queryFn: async () => {\n try {\n return await client.getTags();\n } catch {\n // Storage provider may not support tag discovery (e.g. LibSQL)\n return { tags: [] };\n }\n },\n select: data => data?.tags ?? [],\n retry: false,\n });\n};\n"],"names":["useMastraClient","useQuery"],"mappings":";;;;;;;AAGO,MAAM,UAAU,MAAM;AAC3B,EAAA,MAAM,SAASA,qBAAA,EAAgB;AAE/B,EAAA,OAAOC,mBAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,oBAAoB,CAAA;AAAA,IAC/B,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,OAAO,MAAM,OAAO,OAAA,EAAQ;AAAA,MAC9B,CAAA,CAAA,MAAQ;AAEN,QAAA,OAAO,EAAE,IAAA,EAAM,EAAC,EAAE;AAAA,MACpB;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,IAAA,IAAQ,EAAC;AAAA,IAC/B,KAAA,EAAO;AAAA,GACR,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"use-tags.cjs.js","sources":["../../../../src/domains/traces/hooks/use-tags.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport { DISCOVERY_STALE_TIME } from './discovery-cache';\n\nexport const useTags = () => {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['observability-tags'],\n queryFn: async () => {\n try {\n return await client.getTags();\n } catch {\n // Storage provider may not support tag discovery (e.g. LibSQL)\n return { tags: [] };\n }\n },\n select: data => data?.tags ?? [],\n retry: false,\n staleTime: DISCOVERY_STALE_TIME,\n });\n};\n"],"names":["useMastraClient","useQuery","DISCOVERY_STALE_TIME"],"mappings":";;;;;;;;AAIO,MAAM,UAAU,MAAM;AAC3B,EAAA,MAAM,SAASA,qBAAA,EAAgB;AAE/B,EAAA,OAAOC,mBAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,oBAAoB,CAAA;AAAA,IAC/B,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,OAAO,MAAM,OAAO,OAAA,EAAQ;AAAA,MAC9B,CAAA,CAAA,MAAQ;AAEN,QAAA,OAAO,EAAE,IAAA,EAAM,EAAC,EAAE;AAAA,MACpB;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,IAAA,IAAQ,EAAC;AAAA,IAC/B,KAAA,EAAO,KAAA;AAAA,IACP,SAAA,EAAWC;AAAA,GACZ,CAAA;AACH;;;;"}
@@ -1,5 +1,6 @@
1
1
  import { useMastraClient } from '@mastra/react';
2
2
  import { useQuery } from '@tanstack/react-query';
3
+ import { DISCOVERY_STALE_TIME } from './discovery-cache.es.js';
3
4
 
4
5
  const useTags = () => {
5
6
  const client = useMastraClient();
@@ -13,7 +14,8 @@ const useTags = () => {
13
14
  }
14
15
  },
15
16
  select: (data) => data?.tags ?? [],
16
- retry: false
17
+ retry: false,
18
+ staleTime: DISCOVERY_STALE_TIME
17
19
  });
18
20
  };
19
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"use-tags.es.js","sources":["../../../../src/domains/traces/hooks/use-tags.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\n\nexport const useTags = () => {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['observability-tags'],\n queryFn: async () => {\n try {\n return await client.getTags();\n } catch {\n // Storage provider may not support tag discovery (e.g. LibSQL)\n return { tags: [] };\n }\n },\n select: data => data?.tags ?? [],\n retry: false,\n });\n};\n"],"names":[],"mappings":";;;AAGO,MAAM,UAAU,MAAM;AAC3B,EAAA,MAAM,SAAS,eAAA,EAAgB;AAE/B,EAAA,OAAO,QAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,oBAAoB,CAAA;AAAA,IAC/B,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,OAAO,MAAM,OAAO,OAAA,EAAQ;AAAA,MAC9B,CAAA,CAAA,MAAQ;AAEN,QAAA,OAAO,EAAE,IAAA,EAAM,EAAC,EAAE;AAAA,MACpB;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,IAAA,IAAQ,EAAC;AAAA,IAC/B,KAAA,EAAO;AAAA,GACR,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"use-tags.es.js","sources":["../../../../src/domains/traces/hooks/use-tags.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport { DISCOVERY_STALE_TIME } from './discovery-cache';\n\nexport const useTags = () => {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['observability-tags'],\n queryFn: async () => {\n try {\n return await client.getTags();\n } catch {\n // Storage provider may not support tag discovery (e.g. LibSQL)\n return { tags: [] };\n }\n },\n select: data => data?.tags ?? [],\n retry: false,\n staleTime: DISCOVERY_STALE_TIME,\n });\n};\n"],"names":[],"mappings":";;;;AAIO,MAAM,UAAU,MAAM;AAC3B,EAAA,MAAM,SAAS,eAAA,EAAgB;AAE/B,EAAA,OAAO,QAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,oBAAoB,CAAA;AAAA,IAC/B,SAAS,YAAY;AACnB,MAAA,IAAI;AACF,QAAA,OAAO,MAAM,OAAO,OAAA,EAAQ;AAAA,MAC9B,CAAA,CAAA,MAAQ;AAEN,QAAA,OAAO,EAAE,IAAA,EAAM,EAAC,EAAE;AAAA,MACpB;AAAA,IACF,CAAA;AAAA,IACA,MAAA,EAAQ,CAAA,IAAA,KAAQ,IAAA,EAAM,IAAA,IAAQ,EAAC;AAAA,IAC/B,KAAA,EAAO,KAAA;AAAA,IACP,SAAA,EAAW;AAAA,GACZ,CAAA;AACH;;;;"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * How long discovery results (tags, environments, service names, entity
3
+ * names) stay fresh on the client.
4
+ *
5
+ * Discovery values are filter suggestions that change slowly, and the server
6
+ * caches them for 5 minutes anyway. Without a staleTime, React Query refetches
7
+ * on every mount and window focus, which pushes those refetches straight
8
+ * through to the store's discovery refresh. Matching the server TTL keeps the
9
+ * client from asking more often than the answer can change.
10
+ */
11
+ export declare const DISCOVERY_STALE_TIME: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mastra/playground-ui",
3
3
  "type": "module",
4
- "version": "51.1.0-alpha.7",
4
+ "version": "51.1.0-alpha.8",
5
5
  "description": "Mastra Playground components",
6
6
  "sideEffects": [
7
7
  "**/*.css"
@@ -151,8 +151,8 @@
151
151
  "react": ">=19.0.0",
152
152
  "react-dom": ">=19.0.0",
153
153
  "tailwindcss": "^4.0.0",
154
- "@mastra/client-js": "^1.42.1-alpha.7",
155
- "@mastra/react": "1.4.6-alpha.7"
154
+ "@mastra/client-js": "^1.42.1-alpha.8",
155
+ "@mastra/react": "1.4.6-alpha.8"
156
156
  },
157
157
  "devDependencies": {
158
158
  "@storybook/addon-a11y": "^10.4.1",
@@ -193,10 +193,10 @@
193
193
  "vite-plugin-lib-inject-css": "^2.2.2",
194
194
  "vitest": "4.1.10",
195
195
  "@internal/lint": "0.0.125",
196
- "@mastra/client-js": "^1.42.1-alpha.7",
197
- "@mastra/memory": "1.28.0-alpha.2",
198
- "@mastra/react": "1.4.6-alpha.7",
199
- "@mastra/core": "1.62.0-alpha.7"
196
+ "@mastra/client-js": "^1.42.1-alpha.8",
197
+ "@mastra/react": "1.4.6-alpha.8",
198
+ "@mastra/memory": "1.28.0-alpha.3",
199
+ "@mastra/core": "1.62.0-alpha.8"
200
200
  },
201
201
  "homepage": "https://mastra.ai",
202
202
  "repository": {