udi-yac 0.1.2 → 0.1.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.
@@ -0,0 +1,6 @@
1
+ interface MarkdownTextProps {
2
+ children: string;
3
+ className?: string;
4
+ }
5
+ export declare function MarkdownText({ children, className }: MarkdownTextProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,13 @@
1
+ interface InlineExamplePromptsProps {
2
+ apiBaseUrl: string;
3
+ onExampleClick: (prompt: string) => void;
4
+ isLoading: boolean;
5
+ }
6
+ /**
7
+ * Renders the example prompts list inline in the chat area whenever the
8
+ * conversation has no messages. Self-contained subscription so this
9
+ * component does not drag MessageList/ChatPanel into re-rendering when
10
+ * prompts load.
11
+ */
12
+ export declare function InlineExamplePrompts({ apiBaseUrl, onExampleClick, isLoading, }: InlineExamplePromptsProps): import("react/jsx-runtime").JSX.Element | null;
13
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Opens a modal listing every visualization in the memory bank with a per-item
3
+ * restore action. Subscribes to `memoryBank.closedVisualizations` directly so
4
+ * opening/closing the modal does not re-render the rest of the chat header.
5
+ */
6
+ export declare function MemoryBankButton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { RefObject } from 'react';
2
+ import { Message } from '../../../types/messages';
3
+ export interface MessageListScrollResult {
4
+ contentRef: RefObject<HTMLDivElement | null>;
5
+ firstUnreadIndex: number | null;
6
+ scrollToBottom: () => void;
7
+ }
8
+ /**
9
+ * Owns the scroll-pin / new-message-arrival / streaming-tail behavior for
10
+ * the chat message list. Tracks whether the user is "pinned" near the bottom
11
+ * (within PIN_THRESHOLD_PX), aligns newly-arrived messages to the top of the
12
+ * viewport when pinned, keeps the tail glued to the bottom while a streamed
13
+ * message grows in place, and exposes a firstUnreadIndex marker for the
14
+ * divider + "new message" pill rendered by the consumer.
15
+ *
16
+ * The unread marker is anchored to the first message that arrived
17
+ * out-of-view and is cleared on two re-engagement signals: scrolling back
18
+ * within the pin threshold, or sending a new user message.
19
+ */
20
+ export declare function useMessageListScroll(messages: Message[]): MessageListScrollResult;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Bundles the "reset everything" action — clears the active conversation,
3
- * all pinned visualizations, selections, the closed-viz memory bank, and
3
+ * all active visualizations, selections, the closed-viz memory bank, and
4
4
  * all cross-chart filters.
5
5
  */
6
6
  export declare function useResetHandlers(): {
@@ -1,8 +1,8 @@
1
1
  import { DataSelections } from 'udi-toolkit/react';
2
- import { PinnedVisualization } from '../stores/dashboardStore';
2
+ import { ActiveVisualization } from '../stores/dashboardStore';
3
3
  interface DashboardCardProps {
4
4
  vizKey: string;
5
- viz: PinnedVisualization;
5
+ viz: ActiveVisualization;
6
6
  selections: DataSelections;
7
7
  }
8
8
  export declare function DashboardCard({ vizKey, viz, selections }: DashboardCardProps): import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export { DashboardPanel } from './components/DashboardPanel';
6
6
  export { VizTweakComponent } from './components/VizTweakComponent';
7
- export { createDashboardStore, extractAllUdiSpecsFromMessage, type DashboardState, type PinnedVisualization, } from './stores/dashboardStore';
7
+ export { createDashboardStore, extractAllUdiSpecsFromMessage, type DashboardState, type ActiveVisualization, } from './stores/dashboardStore';
8
8
  export { createDataFiltersStore, extractFilterSpecFromMessage, messageFilterKeyWithToolCall, messageFilterKey, type DataFiltersState, type DataSelection, type DataSelections, } from './stores/dataFiltersStore';
9
9
  export { createSelectionsStore, type SelectionsState } from './stores/selectionsStore';
10
10
  export { createMemoryBankStore, type MemoryBankState } from './stores/memoryBankStore';
@@ -4,7 +4,7 @@ import { Message } from '../../../types/messages';
4
4
  import { DataFiltersState } from './dataFiltersStore';
5
5
  import { DataPackageState } from '../../data-package';
6
6
  import { MemoryBankState } from './memoryBankStore';
7
- export interface PinnedVisualization {
7
+ export interface ActiveVisualization {
8
8
  index: number;
9
9
  toolCallIndex: number;
10
10
  spec: UDIGrammar;
@@ -19,14 +19,14 @@ export interface ExtractedSpec {
19
19
  title?: string;
20
20
  }
21
21
  export interface DashboardState {
22
- pinnedVisualizations: Map<string, PinnedVisualization>;
22
+ activeVisualizations: Map<string, ActiveVisualization>;
23
23
  filterAllNullValues: boolean;
24
24
  expandedVisualizations: Set<string>;
25
25
  tableViewKeys: Set<string>;
26
26
  hoveredVisualizationIndex: string | null;
27
- pinKey: (messageIndex: number, toolCallIndex: number) => string;
28
- pinVisualization: (index: number, toolCallIndex: number, spec: UDIGrammar, userPrompt: string, sourceFields: Record<string, string[]> | null, title?: string) => void;
29
- pinVisualizationBatch: (items: Array<{
27
+ vizKey: (messageIndex: number, toolCallIndex: number) => string;
28
+ addActiveVisualization: (index: number, toolCallIndex: number, spec: UDIGrammar, userPrompt: string, sourceFields: Record<string, string[]> | null, title?: string) => void;
29
+ addActiveVisualizationBatch: (items: Array<{
30
30
  index: number;
31
31
  toolCallIndex: number;
32
32
  spec: UDIGrammar;
@@ -34,9 +34,9 @@ export interface DashboardState {
34
34
  sourceFields: Record<string, string[]> | null;
35
35
  title?: string;
36
36
  }>) => void;
37
- unpinVisualization: (key: string, memoryBankStore?: StoreApi<MemoryBankState>) => void;
37
+ closeVisualization: (key: string, memoryBankStore?: StoreApi<MemoryBankState>) => void;
38
38
  restoreFromMemoryBank: (key: string, memoryBankStore: StoreApi<MemoryBankState>) => void;
39
- isPinned: (key: string) => boolean;
39
+ isActive: (key: string) => boolean;
40
40
  clearAllVisualizations: () => void;
41
41
  setFilterAllNullValues: (value: boolean) => void;
42
42
  toggleExpanded: (key: string) => void;
@@ -48,7 +48,7 @@ export interface DashboardState {
48
48
  updateSpecFilters: (dataFiltersStore: StoreApi<DataFiltersState>, dataPackageStore: StoreApi<DataPackageState>) => void;
49
49
  getNamedFilters: (filterIdList: string[], currentSourceName: string, dataFiltersStore: StoreApi<DataFiltersState>, dataPackageStore: StoreApi<DataPackageState>) => object[];
50
50
  getFilterIds: (dataFiltersStore: StoreApi<DataFiltersState>) => string[];
51
- updatePinnedVisualizationSpec: (key: string, newSpec: UDIGrammar, sourceFields: Record<string, string[]> | null) => void;
51
+ updateActiveVisualizationSpec: (key: string, newSpec: UDIGrammar, sourceFields: Record<string, string[]> | null) => void;
52
52
  }
53
53
  interface InteractiveSpec extends UDIGrammar {
54
54
  config?: {
@@ -1,7 +1,7 @@
1
- import { PinnedVisualization } from './dashboardStore';
1
+ import { ActiveVisualization } from './dashboardStore';
2
2
  export interface MemoryBankState {
3
- closedVisualizations: Map<string, PinnedVisualization>;
4
- addToMemoryBank: (key: string, viz: PinnedVisualization) => void;
3
+ closedVisualizations: Map<string, ActiveVisualization>;
4
+ addToMemoryBank: (key: string, viz: ActiveVisualization) => void;
5
5
  removeFromMemoryBank: (key: string) => void;
6
6
  clearMemoryBank: () => void;
7
7
  }
@@ -4,4 +4,4 @@
4
4
  */
5
5
  export { createDataPackageStore, type DataPackageState, type LoadingPhase, } from './stores/dataPackageStore';
6
6
  export { joinDataPath } from './utils/joinDataPath';
7
- export { evaluateStructuredText, hasStructuredReferences } from './utils/structuredTextParser';
7
+ export { evaluateStructuredText, hasStructuredReferences, type StructuredTextSegment, } from './utils/structuredTextParser';
@@ -1,7 +1,14 @@
1
1
  import { DataPackageState } from '..';
2
- export interface StructuredTextSegment {
3
- type: 'text' | 'value';
2
+ export type StructuredTextSegment = {
3
+ type: 'text';
4
4
  content: string;
5
- }
5
+ } | {
6
+ type: 'value';
7
+ content: string;
8
+ } | {
9
+ type: 'field_list';
10
+ entity: string;
11
+ fields: string[];
12
+ };
6
13
  export declare function evaluateStructuredText(text: string, store: DataPackageState): StructuredTextSegment[];
7
14
  export declare function hasStructuredReferences(text: string): boolean;
@@ -0,0 +1,13 @@
1
+ interface FieldListChipProps {
2
+ entity: string;
3
+ fields: string[];
4
+ }
5
+ /**
6
+ * Renders a field list as a compact chip cluster. The first DEFAULT_VISIBLE
7
+ * fields are shown by default; the rest are hidden behind an expand toggle so
8
+ * datasets with hundreds of fields (e.g. HubMap) don't flood the chat. Each
9
+ * chip carries a tooltip with the field's description and data type, and the
10
+ * expanded view exposes a substring filter that highlights matches.
11
+ */
12
+ export declare function FieldListChip({ entity, fields }: FieldListChipProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -1,2 +1,2 @@
1
1
  import { FreeTextExplainArgs } from '../types';
2
- export declare function FreeTextExplain({ text, has_structured_elements }: FreeTextExplainArgs): import("react/jsx-runtime").JSX.Element;
2
+ export declare function FreeTextExplain({ text }: FreeTextExplainArgs): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import { FlatToolCall, Message } from '../../../types/messages';
2
2
  interface ToolCallRendererProps {
3
3
  toolCall: FlatToolCall;
4
- isPinned?: boolean;
4
+ isActive?: boolean;
5
5
  onSelectSuggestion?: (suggestion: string) => void;
6
6
  message?: Message;
7
7
  messageIndex?: number;
8
8
  toolCallIndex?: number;
9
9
  }
10
- export declare function ToolCallRenderer({ toolCall, isPinned, onSelectSuggestion, message, messageIndex, toolCallIndex, }: ToolCallRendererProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function ToolCallRenderer({ toolCall, isActive, onSelectSuggestion, message, messageIndex, toolCallIndex, }: ToolCallRendererProps): import("react/jsx-runtime").JSX.Element;
11
11
  export {};
@@ -1,10 +1,10 @@
1
1
  import { UDIGrammar } from 'udi-toolkit/react';
2
2
  interface VisualizationCardProps {
3
3
  spec: UDIGrammar;
4
- isPinned: boolean;
4
+ isActive: boolean;
5
5
  title?: string;
6
6
  messageIndex?: number;
7
7
  toolCallIndex?: number;
8
8
  }
9
- export declare function VisualizationCard({ spec, isPinned, title, messageIndex, toolCallIndex, }: VisualizationCardProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function VisualizationCard({ spec, isActive, title, messageIndex, toolCallIndex, }: VisualizationCardProps): import("react/jsx-runtime").JSX.Element;
10
10
  export {};