@magemetrics/ai 0.11.0 → 0.11.1

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.
@@ -94,6 +94,46 @@ export declare interface ChatContextValue {
94
94
  enableSpeechToText?: boolean;
95
95
  }
96
96
 
97
+ /**
98
+ * Optional provider that allows the host application to pass dynamic runtime hints
99
+ * to the chat. The hints are sent with every message and injected ephemerally into
100
+ * the LLM prompt — they are not persisted or shown in the UI.
101
+ * Place this anywhere inside `MageMetricsContextProvider` and around the `Chat` component.
102
+ * When the `value` prop changes, the next message sent will carry the updated hints.
103
+ * If this provider is not used, no hints are sent — everything works as before.
104
+ * @param props - The provider props
105
+ * @param props.value - The chat hints value to provide
106
+ * @param props.children - The child components
107
+ * @returns The provider component wrapping children
108
+ */
109
+ export declare const ChatHintsProvider: default_2.FC<ChatHintsProviderProps>;
110
+
111
+ declare interface ChatHintsProviderProps {
112
+ /**
113
+ * Arbitrary key-value hints from the host application.
114
+ * These are sent alongside every chat message and injected into the LLM prompt.
115
+ * @example
116
+ * ```tsx
117
+ * <ChatHintsProvider value={{
118
+ * selectedLocation: { lat: 48.8566, lng: 2.3522, name: "Paris" },
119
+ * activeFilters: ["revenue > 1M"],
120
+ * }}>
121
+ * <Chat flowId="..." />
122
+ * </ChatHintsProvider>
123
+ * ```
124
+ */
125
+ value: ChatHintsValue;
126
+ children: default_2.ReactNode;
127
+ }
128
+
129
+ /**
130
+ * The value type for chat hints — a free-form key-value object
131
+ * that the host application can use to pass runtime information to the LLM.
132
+ * These hints are injected ephemerally into each chat message (not persisted)
133
+ * so the LLM is aware of the host application's current state.
134
+ */
135
+ export declare type ChatHintsValue = Record<string, unknown>;
136
+
97
137
  export declare interface ChatInputContextValue {
98
138
  flowId: string | undefined;
99
139
  isLoading: boolean;
@@ -625,6 +665,12 @@ is_public: boolean;
625
665
 
626
666
  export declare const useChatContext: () => ChatContextValue;
627
667
 
668
+ /**
669
+ * Returns the current chat hints value, or `null` if no `ChatHintsProvider` is present.
670
+ * @returns The current chat hints value or null
671
+ */
672
+ export declare const useChatHints: () => ChatHintsValue | null;
673
+
628
674
  export declare const useChatInputContext: () => ChatInputContextValue;
629
675
 
630
676
  export declare const useCreateFlow: (options?: UseMutationOptions<{
@@ -94,6 +94,46 @@ export declare interface ChatContextValue {
94
94
  enableSpeechToText?: boolean;
95
95
  }
96
96
 
97
+ /**
98
+ * Optional provider that allows the host application to pass dynamic runtime hints
99
+ * to the chat. The hints are sent with every message and injected ephemerally into
100
+ * the LLM prompt — they are not persisted or shown in the UI.
101
+ * Place this anywhere inside `MageMetricsContextProvider` and around the `Chat` component.
102
+ * When the `value` prop changes, the next message sent will carry the updated hints.
103
+ * If this provider is not used, no hints are sent — everything works as before.
104
+ * @param props - The provider props
105
+ * @param props.value - The chat hints value to provide
106
+ * @param props.children - The child components
107
+ * @returns The provider component wrapping children
108
+ */
109
+ export declare const ChatHintsProvider: default_2.FC<ChatHintsProviderProps>;
110
+
111
+ declare interface ChatHintsProviderProps {
112
+ /**
113
+ * Arbitrary key-value hints from the host application.
114
+ * These are sent alongside every chat message and injected into the LLM prompt.
115
+ * @example
116
+ * ```tsx
117
+ * <ChatHintsProvider value={{
118
+ * selectedLocation: { lat: 48.8566, lng: 2.3522, name: "Paris" },
119
+ * activeFilters: ["revenue > 1M"],
120
+ * }}>
121
+ * <Chat flowId="..." />
122
+ * </ChatHintsProvider>
123
+ * ```
124
+ */
125
+ value: ChatHintsValue;
126
+ children: default_2.ReactNode;
127
+ }
128
+
129
+ /**
130
+ * The value type for chat hints — a free-form key-value object
131
+ * that the host application can use to pass runtime information to the LLM.
132
+ * These hints are injected ephemerally into each chat message (not persisted)
133
+ * so the LLM is aware of the host application's current state.
134
+ */
135
+ export declare type ChatHintsValue = Record<string, unknown>;
136
+
97
137
  export declare interface ChatInputContextValue {
98
138
  flowId: string | undefined;
99
139
  isLoading: boolean;
@@ -625,6 +665,12 @@ export declare const useCanvas: (canvasId: string | undefined | null, options?:
625
665
 
626
666
  export declare const useChatContext: () => ChatContextValue;
627
667
 
668
+ /**
669
+ * Returns the current chat hints value, or `null` if no `ChatHintsProvider` is present.
670
+ * @returns The current chat hints value or null
671
+ */
672
+ export declare const useChatHints: () => ChatHintsValue | null;
673
+
628
674
  export declare const useChatInputContext: () => ChatInputContextValue;
629
675
 
630
676
  export declare const useCreateFlow: (options?: UseMutationOptions<{