@dbx-tools/ui-mastra 0.9.214 → 0.11.2

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.
@@ -2,8 +2,7 @@ import {
2
2
  ReasoningEffort as ReasoningEffortValue,
3
3
  type ReasoningEffort,
4
4
  } from "@dbx-tools/shared-model";
5
-
6
- type StorageLike = Pick<Storage, "getItem" | "setItem">;
5
+ import { readStoredItem, writeStoredItem, type StorageLike } from "@dbx-tools/ui/react";
7
6
 
8
7
  /** Default reasoning on for capable models while preserving an explicit off choice. */
9
8
  export const defaultReasoningEffort = (
@@ -17,35 +16,10 @@ export const defaultReasoningEffort = (
17
16
  export const modelStorageKey = (basePath: string, agentId: string): string =>
18
17
  `dbx-mastra-model:${basePath}:${agentId}`;
19
18
 
20
- const browserStorage = (): StorageLike | undefined => {
21
- try {
22
- return typeof window === "undefined" ? undefined : window.localStorage;
23
- } catch {
24
- return undefined;
25
- }
26
- };
27
-
28
19
  /** Read the last-selected model, tolerating unavailable browser storage. */
29
- export const readStoredModel = (
30
- key: string,
31
- storage: StorageLike | undefined = browserStorage(),
32
- ): string => {
33
- try {
34
- return storage?.getItem(key) ?? "";
35
- } catch {
36
- return "";
37
- }
38
- };
20
+ export const readStoredModel = (key: string, storage?: StorageLike): string =>
21
+ readStoredItem(key, storage) ?? "";
39
22
 
40
23
  /** Persist the selected model, including the empty server-default choice. */
41
- export const storeSelectedModel = (
42
- key: string,
43
- model: string,
44
- storage: StorageLike | undefined = browserStorage(),
45
- ): void => {
46
- try {
47
- storage?.setItem(key, model);
48
- } catch {
49
- // Best-effort; the in-memory selection still works without persistence.
50
- }
51
- };
24
+ export const storeSelectedModel = (key: string, model: string, storage?: StorageLike): void =>
25
+ void writeStoredItem(key, model, storage);
@@ -15,7 +15,7 @@ import type { ThreadSummary } from "../react/types.ts";
15
15
  * time the thread list arrives. Sized to fill a typical strip without pushing
16
16
  * the active tab off-screen behind horizontal scroll.
17
17
  */
18
- export const THREAD_TAB_SEED_MAX = 5;
18
+ const THREAD_TAB_SEED_MAX = 5;
19
19
 
20
20
  /** Controls one reconciliation pass for the top conversation tabs. */
21
21
  interface SyncThreadTabsOptions {