@gram-ai/elements 1.33.2 → 1.35.0

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.
Files changed (243) hide show
  1. package/dist/compat-shims-CO9JXXV4.cjs.map +1 -1
  2. package/dist/compat-shims-DxtUrORi.js.map +1 -1
  3. package/dist/compat-shims.d.ts +9 -8
  4. package/dist/components/Chat/index.d.ts +2 -1
  5. package/dist/components/ChatHistory.d.ts +1 -1
  6. package/dist/components/FrontendTools/index.d.ts +1 -1
  7. package/dist/components/Replay.d.ts +1 -1
  8. package/dist/components/Replay.stories.d.ts +2 -2
  9. package/dist/components/ShadowRoot.d.ts +1 -1
  10. package/dist/components/ShareButton/index.d.ts +1 -1
  11. package/dist/components/ui/avatar.d.ts +3 -3
  12. package/dist/components/ui/button.d.ts +2 -2
  13. package/dist/components/ui/buttonVariants.d.ts +2 -2
  14. package/dist/components/ui/calendar.d.ts +2 -1
  15. package/dist/components/ui/collapsible.d.ts +3 -3
  16. package/dist/components/ui/dialog.d.ts +10 -10
  17. package/dist/components/ui/popover.d.ts +4 -4
  18. package/dist/components/ui/skeleton.d.ts +1 -1
  19. package/dist/components/ui/time-range-picker.d.ts +18 -1
  20. package/dist/components/ui/time-range-picker.test.d.ts +1 -0
  21. package/dist/components/ui/tool-ui.d.ts +7 -7
  22. package/dist/components/ui/tooltip.d.ts +4 -4
  23. package/dist/contexts/ConnectionStatusContext.d.ts +1 -1
  24. package/dist/contexts/ElementsProvider.d.ts +1 -1
  25. package/dist/contexts/ToolApprovalContext.d.ts +2 -2
  26. package/dist/contexts/ToolExecutionContext.d.ts +1 -1
  27. package/dist/contexts/portal-container.d.ts +1 -1
  28. package/dist/elements.cjs +1 -1
  29. package/dist/elements.css +1 -1
  30. package/dist/elements.js +19 -16
  31. package/dist/hooks/useDensity.d.ts +1 -1
  32. package/dist/hooks/useElements.d.ts +2 -1
  33. package/dist/hooks/useGramThreadListAdapter.d.ts +26 -0
  34. package/dist/hooks/useRadius.d.ts +1 -1
  35. package/dist/hooks/useThemeProps.d.ts +1 -1
  36. package/dist/hooks/useToolApproval.d.ts +2 -1
  37. package/dist/{index-reVrRxP1.js → index-BhIowiZF.js} +9744 -9493
  38. package/dist/index-BhIowiZF.js.map +1 -0
  39. package/dist/{index-DAWGW1Nj.cjs → index-D0jIGQr7.cjs} +43 -43
  40. package/dist/index-D0jIGQr7.cjs.map +1 -0
  41. package/dist/{index-CGoLfO5p.js → index-Dz13dSDa.js} +108 -51
  42. package/dist/index-Dz13dSDa.js.map +1 -0
  43. package/dist/index-PXd3rs95.cjs +194 -0
  44. package/dist/index-PXd3rs95.cjs.map +1 -0
  45. package/dist/index.d.ts +4 -1
  46. package/dist/lib/errorTracking.d.ts +1 -1
  47. package/dist/lib/messageConverter.d.ts +58 -8
  48. package/dist/lib/models.d.ts +1 -1
  49. package/dist/lib/tools.d.ts +11 -10
  50. package/dist/lib/utils.d.ts +2 -0
  51. package/dist/plugins/generative-ui/catalog.d.ts +3 -3
  52. package/dist/plugins/generative-ui/ui/accordion-wrapper.d.ts +2 -2
  53. package/dist/plugins/generative-ui/ui/accordion.d.ts +4 -4
  54. package/dist/plugins/generative-ui/ui/action-button.d.ts +1 -1
  55. package/dist/plugins/generative-ui/ui/alert-wrapper.d.ts +2 -1
  56. package/dist/plugins/generative-ui/ui/alert.d.ts +3 -3
  57. package/dist/plugins/generative-ui/ui/avatar-wrapper.d.ts +2 -1
  58. package/dist/plugins/generative-ui/ui/avatar.d.ts +6 -6
  59. package/dist/plugins/generative-ui/ui/badge.d.ts +2 -2
  60. package/dist/plugins/generative-ui/ui/button-wrapper.d.ts +2 -1
  61. package/dist/plugins/generative-ui/ui/button.d.ts +3 -3
  62. package/dist/plugins/generative-ui/ui/card-wrapper.d.ts +1 -1
  63. package/dist/plugins/generative-ui/ui/card.d.ts +7 -7
  64. package/dist/plugins/generative-ui/ui/checkbox-wrapper.d.ts +2 -1
  65. package/dist/plugins/generative-ui/ui/checkbox.d.ts +1 -1
  66. package/dist/plugins/generative-ui/ui/data-table.d.ts +1 -1
  67. package/dist/plugins/generative-ui/ui/dialog.d.ts +10 -10
  68. package/dist/plugins/generative-ui/ui/dropdown-menu.d.ts +15 -15
  69. package/dist/plugins/generative-ui/ui/grid.d.ts +1 -1
  70. package/dist/plugins/generative-ui/ui/index.d.ts +57 -40
  71. package/dist/plugins/generative-ui/ui/input-wrapper.d.ts +2 -1
  72. package/dist/plugins/generative-ui/ui/input.d.ts +1 -1
  73. package/dist/plugins/generative-ui/ui/label.d.ts +1 -1
  74. package/dist/plugins/generative-ui/ui/list.d.ts +2 -1
  75. package/dist/plugins/generative-ui/ui/metric.d.ts +1 -1
  76. package/dist/plugins/generative-ui/ui/pagination.d.ts +7 -7
  77. package/dist/plugins/generative-ui/ui/popover.d.ts +7 -7
  78. package/dist/plugins/generative-ui/ui/progress.d.ts +1 -1
  79. package/dist/plugins/generative-ui/ui/radio-group.d.ts +2 -2
  80. package/dist/plugins/generative-ui/ui/select-wrapper.d.ts +2 -1
  81. package/dist/plugins/generative-ui/ui/select.d.ts +10 -10
  82. package/dist/plugins/generative-ui/ui/separator.d.ts +1 -1
  83. package/dist/plugins/generative-ui/ui/skeleton-wrapper.d.ts +2 -1
  84. package/dist/plugins/generative-ui/ui/skeleton.d.ts +1 -1
  85. package/dist/plugins/generative-ui/ui/stack.d.ts +1 -1
  86. package/dist/plugins/generative-ui/ui/switch.d.ts +1 -1
  87. package/dist/plugins/generative-ui/ui/table.d.ts +8 -8
  88. package/dist/plugins/generative-ui/ui/tabs-wrapper.d.ts +2 -2
  89. package/dist/plugins/generative-ui/ui/tabs.d.ts +4 -4
  90. package/dist/plugins/generative-ui/ui/text.d.ts +1 -1
  91. package/dist/plugins/generative-ui/ui/textarea.d.ts +1 -1
  92. package/dist/plugins/generative-ui/ui/tooltip.d.ts +4 -4
  93. package/dist/plugins.cjs +1 -1
  94. package/dist/plugins.js +1 -1
  95. package/dist/{profiler-noho3NG9.js → profiler-CtGKTWWP.js} +2 -2
  96. package/dist/{profiler-noho3NG9.js.map → profiler-CtGKTWWP.js.map} +1 -1
  97. package/dist/{profiler-B3tfiOx4.cjs → profiler-l7_HjTyw.cjs} +2 -2
  98. package/dist/{profiler-B3tfiOx4.cjs.map → profiler-l7_HjTyw.cjs.map} +1 -1
  99. package/dist/react-shim.cjs.map +1 -1
  100. package/dist/react-shim.d.ts +1 -1
  101. package/dist/react-shim.js +1 -4
  102. package/dist/react-shim.js.map +1 -1
  103. package/dist/server/bun.cjs.map +1 -1
  104. package/dist/server/bun.js.map +1 -1
  105. package/dist/server/express.cjs.map +1 -1
  106. package/dist/server/express.js.map +1 -1
  107. package/dist/server/fastify.cjs.map +1 -1
  108. package/dist/server/fastify.js.map +1 -1
  109. package/dist/server/hono.cjs.map +1 -1
  110. package/dist/server/hono.js.map +1 -1
  111. package/dist/server/nextjs.cjs.map +1 -1
  112. package/dist/server/nextjs.js.map +1 -1
  113. package/dist/server/tanstack-start.cjs.map +1 -1
  114. package/dist/server/tanstack-start.js.map +1 -1
  115. package/dist/{startRecording-7Oy6wM18.cjs → startRecording-DEw2Aeq4.cjs} +2 -2
  116. package/dist/{startRecording-7Oy6wM18.cjs.map → startRecording-DEw2Aeq4.cjs.map} +1 -1
  117. package/dist/{startRecording-mkmig-2n.js → startRecording-iYEL0-vr.js} +2 -2
  118. package/dist/{startRecording-mkmig-2n.js.map → startRecording-iYEL0-vr.js.map} +1 -1
  119. package/dist/types/index.d.ts +93 -4
  120. package/package.json +8 -9
  121. package/src/compat-shims.ts +16 -2
  122. package/src/components/Chat/index.tsx +4 -1
  123. package/src/components/Chat/stories/FrontendTools.stories.tsx +1 -1
  124. package/src/components/Chat/stories/ToolApproval.stories.tsx +2 -2
  125. package/src/components/Chat/stories/Tools.stories.tsx +13 -5
  126. package/src/components/ChatHistory.tsx +3 -1
  127. package/src/components/FrontendTools/index.tsx +1 -1
  128. package/src/components/MessageContent.tsx +1 -0
  129. package/src/components/Replay.stories.tsx +2 -3
  130. package/src/components/Replay.tsx +17 -10
  131. package/src/components/ShadowRoot.tsx +2 -2
  132. package/src/components/ShareButton/index.tsx +4 -2
  133. package/src/components/assistant-ui/assistant-modal.tsx +5 -3
  134. package/src/components/assistant-ui/attachment.tsx +1 -1
  135. package/src/components/assistant-ui/error-boundary.tsx +1 -1
  136. package/src/components/assistant-ui/markdown-text.tsx +1 -1
  137. package/src/components/assistant-ui/thread.tsx +256 -14
  138. package/src/components/assistant-ui/tool-mention-autocomplete.tsx +1 -1
  139. package/src/components/ui/avatar.tsx +3 -3
  140. package/src/components/ui/calendar.tsx +1 -1
  141. package/src/components/ui/collapsible.tsx +7 -3
  142. package/src/components/ui/dialog.tsx +18 -10
  143. package/src/components/ui/generative-ui.tsx +9 -4
  144. package/src/components/ui/popover.tsx +4 -4
  145. package/src/components/ui/skeleton.tsx +4 -1
  146. package/src/components/ui/time-range-picker.stories.tsx +164 -154
  147. package/src/components/ui/time-range-picker.test.ts +57 -0
  148. package/src/components/ui/time-range-picker.tsx +40 -9
  149. package/src/components/ui/tool-ui.tsx +18 -9
  150. package/src/components/ui/tooltip.tsx +4 -4
  151. package/src/contexts/ChatIdContext.tsx +1 -1
  152. package/src/contexts/ConnectionStatusContext.tsx +6 -5
  153. package/src/contexts/ElementsProvider.tsx +109 -37
  154. package/src/contexts/ReplayContext.ts +1 -1
  155. package/src/contexts/ToolApprovalContext.tsx +5 -1
  156. package/src/contexts/ToolExecutionContext.tsx +1 -1
  157. package/src/contexts/portal-container.tsx +1 -1
  158. package/src/hooks/useAuth.ts +2 -1
  159. package/src/hooks/useDensity.ts +1 -1
  160. package/src/hooks/useElements.ts +2 -1
  161. package/src/hooks/useFollowOnSuggestions.ts +3 -6
  162. package/src/hooks/useGramThreadListAdapter.tsx +118 -9
  163. package/src/hooks/useMCPTools.ts +2 -2
  164. package/src/hooks/useModel.ts +1 -3
  165. package/src/hooks/usePluginComponents.ts +3 -1
  166. package/src/hooks/useRadius.ts +1 -1
  167. package/src/hooks/useSession.ts +3 -1
  168. package/src/hooks/useThemeProps.ts +5 -5
  169. package/src/hooks/useToolApproval.ts +2 -1
  170. package/src/index.ts +16 -0
  171. package/src/lib/cassette.ts +21 -27
  172. package/src/lib/contextCompaction.test.ts +2 -2
  173. package/src/lib/contextCompaction.ts +20 -8
  174. package/src/lib/errorTracking.ts +1 -4
  175. package/src/lib/messageConverter.test.ts +11 -13
  176. package/src/lib/messageConverter.ts +105 -58
  177. package/src/lib/models.ts +19 -7
  178. package/src/lib/token.ts +2 -5
  179. package/src/lib/tool-mentions.ts +5 -2
  180. package/src/lib/tools.byte-cap.test.ts +1 -1
  181. package/src/lib/tools.test.ts +1 -1
  182. package/src/lib/tools.ts +15 -5
  183. package/src/lib/utils.ts +22 -2
  184. package/src/lib.d.ts +8 -1
  185. package/src/plugins/chart/chart.test.ts +3 -4
  186. package/src/plugins/chart/component.tsx +7 -6
  187. package/src/plugins/chart/ui/area-chart.tsx +1 -1
  188. package/src/plugins/chart/ui/line-chart.tsx +1 -1
  189. package/src/plugins/generative-ui/ui/accordion-wrapper.tsx +2 -2
  190. package/src/plugins/generative-ui/ui/accordion.tsx +4 -4
  191. package/src/plugins/generative-ui/ui/action-button.tsx +4 -2
  192. package/src/plugins/generative-ui/ui/alert-wrapper.tsx +1 -1
  193. package/src/plugins/generative-ui/ui/alert.tsx +7 -3
  194. package/src/plugins/generative-ui/ui/avatar-wrapper.tsx +5 -1
  195. package/src/plugins/generative-ui/ui/avatar.tsx +12 -6
  196. package/src/plugins/generative-ui/ui/badge.tsx +1 -1
  197. package/src/plugins/generative-ui/ui/button-wrapper.tsx +1 -1
  198. package/src/plugins/generative-ui/ui/button.tsx +1 -1
  199. package/src/plugins/generative-ui/ui/card-wrapper.tsx +1 -1
  200. package/src/plugins/generative-ui/ui/card.tsx +28 -7
  201. package/src/plugins/generative-ui/ui/checkbox-wrapper.tsx +1 -1
  202. package/src/plugins/generative-ui/ui/checkbox.tsx +1 -1
  203. package/src/plugins/generative-ui/ui/data-table.tsx +1 -1
  204. package/src/plugins/generative-ui/ui/dialog.tsx +15 -10
  205. package/src/plugins/generative-ui/ui/dropdown-menu.tsx +33 -15
  206. package/src/plugins/generative-ui/ui/grid.tsx +1 -1
  207. package/src/plugins/generative-ui/ui/index.ts +154 -40
  208. package/src/plugins/generative-ui/ui/input-wrapper.tsx +1 -1
  209. package/src/plugins/generative-ui/ui/input.tsx +5 -1
  210. package/src/plugins/generative-ui/ui/label.tsx +1 -1
  211. package/src/plugins/generative-ui/ui/list.tsx +5 -1
  212. package/src/plugins/generative-ui/ui/metric.tsx +2 -1
  213. package/src/plugins/generative-ui/ui/pagination.tsx +12 -7
  214. package/src/plugins/generative-ui/ui/popover.tsx +13 -7
  215. package/src/plugins/generative-ui/ui/progress.tsx +1 -1
  216. package/src/plugins/generative-ui/ui/radio-group.tsx +2 -2
  217. package/src/plugins/generative-ui/ui/select-wrapper.tsx +1 -1
  218. package/src/plugins/generative-ui/ui/select.tsx +14 -10
  219. package/src/plugins/generative-ui/ui/separator.tsx +1 -1
  220. package/src/plugins/generative-ui/ui/skeleton-wrapper.tsx +1 -1
  221. package/src/plugins/generative-ui/ui/skeleton.tsx +4 -1
  222. package/src/plugins/generative-ui/ui/stack.tsx +1 -1
  223. package/src/plugins/generative-ui/ui/switch.tsx +1 -1
  224. package/src/plugins/generative-ui/ui/table.tsx +29 -8
  225. package/src/plugins/generative-ui/ui/tabs-wrapper.tsx +5 -2
  226. package/src/plugins/generative-ui/ui/tabs.tsx +4 -4
  227. package/src/plugins/generative-ui/ui/text.tsx +1 -1
  228. package/src/plugins/generative-ui/ui/textarea.tsx +4 -1
  229. package/src/plugins/generative-ui/ui/tooltip.tsx +4 -4
  230. package/src/react-shim.ts +9 -4
  231. package/src/server/bun.ts +1 -1
  232. package/src/server/express.ts +1 -1
  233. package/src/server/fastify.ts +1 -1
  234. package/src/server/hono.ts +1 -1
  235. package/src/server/nextjs.ts +1 -1
  236. package/src/server/tanstack-start.ts +1 -1
  237. package/src/storybook.d.ts +5 -0
  238. package/src/types/index.ts +112 -4
  239. package/dist/index-BCV7Zf9E.cjs +0 -194
  240. package/dist/index-BCV7Zf9E.cjs.map +0 -1
  241. package/dist/index-CGoLfO5p.js.map +0 -1
  242. package/dist/index-DAWGW1Nj.cjs.map +0 -1
  243. package/dist/index-reVrRxP1.js.map +0 -1
package/dist/elements.js CHANGED
@@ -1,5 +1,5 @@
1
- import { aj as s, ap as r, aa as t, ab as o, a8 as n, a8 as E, al as d, ae as l, ao as m, af as S, ac as i, am as C, ad as T, ah as c, ak as h, an as u, ai as R, ag as g, a9 as P } from "./index-reVrRxP1.js";
2
- import { V as k, H as p, H } from "./index-CGoLfO5p.js";
1
+ import { aj as s, ar as r, aa as t, ab as o, a8 as n, a8 as E, al as m, ae as d, aq as l, af as S, ac as T, ao as c, ad as g, an as i, am as C, ah as h, ak as p, ap as u, ai as I, ag as M, a9 as R } from "./index-BhIowiZF.js";
2
+ import { s as P, W as f, I as k, I as v } from "./index-Dz13dSDa.js";
3
3
  export {
4
4
  s as CREDITS_EXHAUSTED_MESSAGE,
5
5
  r as Calendar,
@@ -7,21 +7,24 @@ export {
7
7
  o as ChatHistory,
8
8
  n as ElementsProvider,
9
9
  E as GramElementsProvider,
10
- d as MODELS,
11
- l as MessageContent,
12
- m as PRESETS,
10
+ m as MODELS,
11
+ d as MessageContent,
12
+ l as PRESETS,
13
13
  S as Replay,
14
- i as ShareButton,
15
- C as TimeRangePicker,
16
- T as ToolFallback,
17
- c as defineFrontendTool,
18
- h as describeStreamError,
14
+ T as ShareButton,
15
+ c as TimeRangePicker,
16
+ g as ToolFallback,
17
+ i as convertGramMessagesToExported,
18
+ C as convertGramMessagesToUIMessages,
19
+ h as defineFrontendTool,
20
+ p as describeStreamError,
19
21
  u as getPresetRange,
20
- R as trackError,
21
- k as useChatId,
22
- p as useElements,
23
- H as useGramElements,
24
- g as useRecordCassette,
25
- P as useThreadId
22
+ P as sleep,
23
+ I as trackError,
24
+ f as useChatId,
25
+ k as useElements,
26
+ v as useGramElements,
27
+ M as useRecordCassette,
28
+ R as useThreadId
26
29
  };
27
30
  //# sourceMappingURL=elements.js.map
@@ -86,5 +86,5 @@ type DensityToken = keyof (typeof densityClasses)["normal"];
86
86
  * Hook to get density classes based on theme config
87
87
  * Use: const d = useDensity(); then d('p-md') returns the appropriate padding class
88
88
  */
89
- export declare const useDensity: () => (token: DensityToken) => "p-1" | "p-1.5" | "p-2" | "p-2.5" | "p-3" | "px-1" | "px-1.5" | "px-2" | "px-2.5" | "px-3" | "py-1" | "py-1.5" | "py-2" | "py-2.5" | "py-3" | "gap-1" | "gap-1.5" | "gap-2" | "gap-2.5" | "h-10" | "min-h-10" | "text-sm" | "text-xl" | "p-4" | "p-6" | "px-4" | "px-6" | "py-4" | "py-6" | "gap-3" | "gap-4" | "h-12" | "min-h-12" | "text-base" | "text-2xl" | "p-10" | "px-10" | "py-10" | "gap-6" | "h-14" | "min-h-16" | "text-lg" | "text-3xl";
89
+ export declare const useDensity: () => ((token: DensityToken) => string);
90
90
  export {};
@@ -1,5 +1,6 @@
1
+ import { ElementsContextType } from '../types';
1
2
  /**
2
3
  * @private Internal hook to access the ElementsContext
3
4
  *
4
5
  */
5
- export declare const useElements: () => import('../types').ElementsContextType;
6
+ export declare const useElements: () => ElementsContextType;
@@ -1,14 +1,40 @@
1
1
  import { unstable_RemoteThreadListAdapter as RemoteThreadListAdapter } from '@assistant-ui/react';
2
+ import { GramChatMessage } from '../lib/messageConverter';
2
3
  /**
3
4
  * Checks if a thread ID is a local (unpersisted) thread ID.
4
5
  * Local IDs are generated by assistant-ui before the thread is initialized with a remote ID.
5
6
  */
6
7
  export declare function isLocalThreadId(threadId: string | null | undefined): boolean;
8
+ /**
9
+ * Transforms or drops a persisted chat message before it is rendered from
10
+ * history. Return the (possibly rewritten) message, or `null` to omit it.
11
+ */
12
+ export type ChatMessageTransform = (message: GramChatMessage) => GramChatMessage | null;
7
13
  export interface ThreadListAdapterOptions {
8
14
  apiUrl: string;
9
15
  headers: Record<string, string>;
10
16
  /** Map to translate local thread IDs to UUIDs (shared with transport) */
11
17
  localIdToUuidMap?: Map<string, string>;
18
+ /**
19
+ * Extra query parameters forwarded to `chat.list` to filter which threads are
20
+ * listed. Opaque to the adapter — the consumer chooses the keys.
21
+ */
22
+ threadListFilters?: Record<string, string>;
23
+ /**
24
+ * Don't client-mint a chat id for a brand-new thread. When true, `initialize`
25
+ * waits for the transport to assign the id (via the shared `localIdToUuidMap`,
26
+ * e.g. a server-minted id reported through the transport context's
27
+ * `adoptChatId` bind closure) instead of generating one with
28
+ * `crypto.randomUUID()`. Use this when the backend owns chat-id creation.
29
+ */
30
+ deferThreadIdMinting?: boolean;
31
+ /**
32
+ * Optional hook to transform or drop each persisted message before it is
33
+ * converted for rendering. Return a message to render it (possibly rewritten),
34
+ * or `null` to omit it. Keeps product-specific transcript conventions out of
35
+ * the library — see {@link HistoryConfig.transformChatMessage}.
36
+ */
37
+ transformChatMessage?: ChatMessageTransform;
12
38
  }
13
39
  /**
14
40
  * Hook that creates a RemoteThreadListAdapter for the Gram API.
@@ -3,5 +3,5 @@ type RadiusSize = "sm" | "md" | "lg" | "xl" | "full";
3
3
  * Hook to get radius classes based on theme config
4
4
  * Use: const r = useRadius(); then r('lg') returns the appropriate rounded class
5
5
  */
6
- export declare const useRadius: () => (size: RadiusSize) => string;
6
+ export declare const useRadius: () => ((size: RadiusSize) => string);
7
7
  export {};
@@ -2,5 +2,5 @@
2
2
  * Hook to get theme-related props including dark mode class
3
3
  */
4
4
  export declare const useThemeProps: () => {
5
- readonly className: "dark" | undefined;
5
+ readonly className: string | undefined;
6
6
  };
@@ -1,5 +1,6 @@
1
+ import { ToolApprovalContextType } from '../contexts/ToolApprovalContext';
1
2
  /**
2
3
  * Hook to access the tool approval context for managing human-in-the-loop
3
4
  * tool execution approval.
4
5
  */
5
- export declare const useToolApproval: () => import('../contexts/ToolApprovalContext').ToolApprovalContextType;
6
+ export declare const useToolApproval: () => ToolApprovalContextType;