udi-yac 0.1.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 (102) hide show
  1. package/README.md +373 -0
  2. package/dist/app/ErrorBoundary.d.ts +18 -0
  3. package/dist/app/UDIChat.d.ts +3 -0
  4. package/dist/app/UDIChatConfig.d.ts +23 -0
  5. package/dist/app/UDIChatContext.d.ts +26 -0
  6. package/dist/app/validateConfig.d.ts +14 -0
  7. package/dist/app/validateConfig.test.d.ts +1 -0
  8. package/dist/assets/domainWorker-Cd9KoNXV.js +16 -0
  9. package/dist/ce-entry-C4ngOj0B.js +42577 -0
  10. package/dist/components/ui/badge.d.ts +7 -0
  11. package/dist/components/ui/button.d.ts +8 -0
  12. package/dist/components/ui/card.d.ts +11 -0
  13. package/dist/components/ui/checkbox.d.ts +3 -0
  14. package/dist/components/ui/dialog.d.ts +17 -0
  15. package/dist/components/ui/dropdown-menu.d.ts +29 -0
  16. package/dist/components/ui/input.d.ts +3 -0
  17. package/dist/components/ui/label.d.ts +3 -0
  18. package/dist/components/ui/scroll-area.d.ts +4 -0
  19. package/dist/components/ui/select.d.ts +15 -0
  20. package/dist/components/ui/separator.d.ts +3 -0
  21. package/dist/components/ui/slider.d.ts +3 -0
  22. package/dist/components/ui/switch.d.ts +5 -0
  23. package/dist/components/ui/tabs.d.ts +10 -0
  24. package/dist/components/ui/textarea.d.ts +3 -0
  25. package/dist/components/ui/tooltip.d.ts +6 -0
  26. package/dist/data/hubmap_2025-05-05/datapackage_udi.json +19606 -0
  27. package/dist/data/hubmap_2025-05-05/datasets.csv +6324 -0
  28. package/dist/data/hubmap_2025-05-05/datasets.tsv +6324 -0
  29. package/dist/data/hubmap_2025-05-05/donors.csv +433 -0
  30. package/dist/data/hubmap_2025-05-05/donors.tsv +433 -0
  31. package/dist/data/hubmap_2025-05-05/samples.csv +4490 -0
  32. package/dist/data/hubmap_2025-05-05/samples.tsv +4490 -0
  33. package/dist/data/hubmap_api/datapackage.json +14110 -0
  34. package/dist/data/readme.md +41 -0
  35. package/dist/favicon.svg +1 -0
  36. package/dist/features/chat/api/completions.d.ts +12 -0
  37. package/dist/features/chat/components/ApiKeyInput.d.ts +5 -0
  38. package/dist/features/chat/components/ChatHeaderBar.d.ts +19 -0
  39. package/dist/features/chat/components/ChatInput.d.ts +7 -0
  40. package/dist/features/chat/components/ChatPanel.d.ts +13 -0
  41. package/dist/features/chat/components/ClosedVisualizationsPanel.d.ts +6 -0
  42. package/dist/features/chat/components/ConversationList.d.ts +1 -0
  43. package/dist/features/chat/components/DebugToggleSection.d.ts +13 -0
  44. package/dist/features/chat/components/MessageBubble.d.ts +8 -0
  45. package/dist/features/chat/components/MessageList.d.ts +7 -0
  46. package/dist/features/chat/hooks/useChatApi.d.ts +6 -0
  47. package/dist/features/chat/hooks/useDebugExports.d.ts +11 -0
  48. package/dist/features/chat/hooks/useExamplePrompts.d.ts +7 -0
  49. package/dist/features/chat/hooks/useResetHandlers.d.ts +8 -0
  50. package/dist/features/chat/index.d.ts +9 -0
  51. package/dist/features/chat/stores/conversationStore.d.ts +10 -0
  52. package/dist/features/chat/stores/conversationStore.test.d.ts +1 -0
  53. package/dist/features/dashboard/components/DashboardCard.d.ts +9 -0
  54. package/dist/features/dashboard/components/DashboardPanel.d.ts +1 -0
  55. package/dist/features/dashboard/components/DataCounts.d.ts +1 -0
  56. package/dist/features/dashboard/components/DownloadButton.d.ts +1 -0
  57. package/dist/features/dashboard/components/FilterToolbar.d.ts +1 -0
  58. package/dist/features/dashboard/components/VizTweakComponent.d.ts +8 -0
  59. package/dist/features/dashboard/components/VizTweakComponent.types.d.ts +20 -0
  60. package/dist/features/dashboard/components/WelcomeSplash.d.ts +1 -0
  61. package/dist/features/dashboard/index.d.ts +10 -0
  62. package/dist/features/dashboard/stores/dashboardStore.d.ts +70 -0
  63. package/dist/features/dashboard/stores/dashboardStore.test.d.ts +1 -0
  64. package/dist/features/dashboard/stores/dataFiltersStore.d.ts +34 -0
  65. package/dist/features/dashboard/stores/dataFiltersStore.test.d.ts +1 -0
  66. package/dist/features/dashboard/stores/memoryBankStore.d.ts +8 -0
  67. package/dist/features/dashboard/stores/memoryBankStore.test.d.ts +1 -0
  68. package/dist/features/dashboard/stores/selectionsStore.d.ts +7 -0
  69. package/dist/features/dashboard/stores/selectionsStore.test.d.ts +1 -0
  70. package/dist/features/data-package/index.d.ts +7 -0
  71. package/dist/features/data-package/stores/dataPackageStore.d.ts +25 -0
  72. package/dist/features/data-package/stores/dataPackageStore.test.d.ts +1 -0
  73. package/dist/features/data-package/types.d.ts +27 -0
  74. package/dist/features/data-package/utils/joinDataPath.d.ts +7 -0
  75. package/dist/features/data-package/utils/joinDataPath.test.d.ts +1 -0
  76. package/dist/features/data-package/utils/structuredTextParser.d.ts +7 -0
  77. package/dist/features/data-package/utils/structuredTextParser.test.d.ts +1 -0
  78. package/dist/features/data-package/workers/domainWorker.d.ts +13 -0
  79. package/dist/features/tool-calls/components/ClarifyVariable.d.ts +6 -0
  80. package/dist/features/tool-calls/components/FilterComponent.d.ts +9 -0
  81. package/dist/features/tool-calls/components/FreeTextExplain.d.ts +2 -0
  82. package/dist/features/tool-calls/components/IntervalFilterComponent.d.ts +9 -0
  83. package/dist/features/tool-calls/components/PointFilterComponent.d.ts +8 -0
  84. package/dist/features/tool-calls/components/RebuffNotice.d.ts +7 -0
  85. package/dist/features/tool-calls/components/ToolCallRenderer.d.ts +11 -0
  86. package/dist/features/tool-calls/components/VisualizationCard.d.ts +10 -0
  87. package/dist/features/tool-calls/index.d.ts +6 -0
  88. package/dist/features/tool-calls/types.d.ts +52 -0
  89. package/dist/icons.svg +24 -0
  90. package/dist/images/yac-mascot.svg +22 -0
  91. package/dist/index.d.ts +5 -0
  92. package/dist/lib/utils.d.ts +2 -0
  93. package/dist/stores/globalStore.d.ts +6 -0
  94. package/dist/stores/globalStore.test.d.ts +1 -0
  95. package/dist/test/setup.d.ts +0 -0
  96. package/dist/types/dataPackage.d.ts +64 -0
  97. package/dist/types/messages.d.ts +24 -0
  98. package/dist/udi-yac.css +3 -0
  99. package/dist/udi-yac.js +25877 -0
  100. package/dist/utils/specMutations.d.ts +45 -0
  101. package/dist/utils/specMutations.test.d.ts +1 -0
  102. package/package.json +110 -0
@@ -0,0 +1,11 @@
1
+ import { FlatToolCall, Message } from '../../../types/messages';
2
+ interface ToolCallRendererProps {
3
+ toolCall: FlatToolCall;
4
+ isPinned?: boolean;
5
+ onSelectSuggestion?: (suggestion: string) => void;
6
+ message?: Message;
7
+ messageIndex?: number;
8
+ toolCallIndex?: number;
9
+ }
10
+ export declare function ToolCallRenderer({ toolCall, isPinned, onSelectSuggestion, message, messageIndex, toolCallIndex, }: ToolCallRendererProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,10 @@
1
+ import { UDIGrammar } from 'udi-toolkit/react';
2
+ interface VisualizationCardProps {
3
+ spec: UDIGrammar;
4
+ isPinned: boolean;
5
+ title?: string;
6
+ messageIndex?: number;
7
+ toolCallIndex?: number;
8
+ }
9
+ export declare function VisualizationCard({ spec, isPinned, title, messageIndex, toolCallIndex, }: VisualizationCardProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Public API of the `tool-calls` feature. Cross-feature and app-layer imports
3
+ * must go through this barrel; intra-feature imports use relative paths.
4
+ */
5
+ export { ToolCallRenderer } from './components/ToolCallRenderer';
6
+ export type { FreeTextExplainArgs, RebuffArgs, ClarifyVariableArgs, FilterDataArgs, TextSegment, CreateVisualizationArgs, } from './types';
@@ -0,0 +1,52 @@
1
+ /**
2
+ * TypeScript interfaces for orchestrator tool call arguments.
3
+ *
4
+ * These match the OpenAI function-calling schemas defined in the backend's
5
+ * ORCHESTRATOR_TOOLS list and represent the payload the frontend receives
6
+ * inside `tool_calls[].function.arguments`.
7
+ */
8
+ export interface RebuffArgs {
9
+ message: string;
10
+ suggestions: string[];
11
+ }
12
+ export interface ClarifyCandidate {
13
+ field_name: string;
14
+ entity: string;
15
+ description?: string;
16
+ }
17
+ export interface AmbiguousVariable {
18
+ query_term: string;
19
+ candidates: ClarifyCandidate[];
20
+ }
21
+ export interface ClarifyVariableArgs {
22
+ message: string;
23
+ ambiguous_variables: AmbiguousVariable[];
24
+ }
25
+ export type FreeTextResponseType = 'capabilities' | 'data_summary' | 'general';
26
+ export interface StructuredTextElement {
27
+ value: string;
28
+ [key: string]: unknown;
29
+ }
30
+ export type TextSegment = string | StructuredTextElement;
31
+ export interface FreeTextExplainArgs {
32
+ response_type: FreeTextResponseType;
33
+ text: TextSegment[];
34
+ has_structured_elements: boolean;
35
+ }
36
+ export interface FilterDataArgs {
37
+ title: string;
38
+ entity: string;
39
+ field: string;
40
+ filter: {
41
+ filterType: 'point' | 'interval';
42
+ intervalRange: {
43
+ min: number;
44
+ max: number;
45
+ };
46
+ pointValues: string[];
47
+ };
48
+ }
49
+ export interface CreateVisualizationArgs {
50
+ description: string;
51
+ title: string;
52
+ }
package/dist/icons.svg ADDED
@@ -0,0 +1,24 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg">
2
+ <symbol id="bluesky-icon" viewBox="0 0 16 17">
3
+ <g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
4
+ <defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
5
+ </symbol>
6
+ <symbol id="discord-icon" viewBox="0 0 20 19">
7
+ <path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
8
+ </symbol>
9
+ <symbol id="documentation-icon" viewBox="0 0 21 20">
10
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
11
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
12
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
13
+ </symbol>
14
+ <symbol id="github-icon" viewBox="0 0 19 19">
15
+ <path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
16
+ </symbol>
17
+ <symbol id="social-icon" viewBox="0 0 20 20">
18
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
19
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
20
+ </symbol>
21
+ <symbol id="x-icon" viewBox="0 0 19 19">
22
+ <path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
23
+ </symbol>
24
+ </svg>
@@ -0,0 +1,22 @@
1
+ <svg width="228" height="201" viewBox="0 0 228 201" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="68.1169" height="110.326" transform="matrix(-1 0 0 1 122.628 24.4895)" fill="black"/>
3
+ <rect width="103.954" height="89.8096" transform="matrix(4.42268e-08 -1 -1 -4.3202e-08 211.374 148.233)" fill="black"/>
4
+ <rect width="31.0632" height="44.0713" transform="matrix(-1 0 0 1 131.04 120.704)" fill="black"/>
5
+ <rect width="13.3442" height="31.4281" transform="matrix(-1 0 0 1 205.192 147.407)" fill="black"/>
6
+ <rect width="13.3442" height="31.4281" transform="matrix(-1 0 0 1 122.628 157.056)" fill="black"/>
7
+ <rect width="17.9186" height="12.1301" transform="matrix(-1 0 0 1 203.923 178.834)" fill="black"/>
8
+ <rect width="17.9186" height="12.1301" transform="matrix(-1 0 0 1 124.468 188.484)" fill="black"/>
9
+ <rect width="17.9186" height="12.1301" transform="matrix(-1 0 0 1 91.4121 184.9)" fill="black"/>
10
+ <rect width="13.3442" height="23.4332" transform="matrix(-1 0 0 1 89.2246 161.466)" fill="black"/>
11
+ <path d="M15.0644 35.5426C15.2803 39.6533 41.2177 38.1897 50.4195 37.0025L50.4192 44.6928L51.2377 58.0953L37.6969 56.6849C26.7709 56.2424 1.14031 47.7274 0.0295581 34.1057C-0.859046 23.2083 18.5004 11.8219 28.2912 7.49093C23.7923 15.1287 14.8485 31.4318 15.0644 35.5426Z" fill="#57B4E9"/>
12
+ <path d="M89.8105 2.53698C94.7488 3.82333 102.208 6.40017 108.561 9.96733C111.737 11.7506 114.679 13.8046 116.892 16.1013C119.102 18.3945 120.655 21.0033 120.889 23.8843C121.178 27.4241 119.794 30.6198 117.513 33.4035C115.24 36.1789 112.032 38.6014 108.531 40.6489C101.546 44.7341 93.1787 47.448 88.0444 48.5041L75.6992 51.8597L74.847 52.0913L74.5109 51.274L70.1157 40.5585L67.449 36.0323L66.5949 34.5819L68.2775 34.525C72.585 34.3818 82.099 33.3658 90.4864 31.9024C94.6813 31.1705 98.5512 30.3345 101.33 29.4522C102.728 29.0082 103.792 28.5702 104.474 28.1582C104.816 27.9513 105.008 27.783 105.101 27.6685C105.116 27.6503 105.124 27.634 105.131 27.6229C105.083 27.2996 104.924 26.8 104.611 26.1151C104.285 25.4018 103.826 24.5561 103.259 23.6056C102.124 21.7055 100.585 19.4455 98.8816 17.0889C95.4765 12.3786 91.4544 7.34248 88.7903 4.14504L86.7973 1.75214L89.8105 2.53698Z" fill="#57B4E9" stroke="white" stroke-width="2"/>
13
+ <rect width="31.0632" height="44.0713" transform="matrix(-1 0 0 1 91.4121 117.395)" fill="black"/>
14
+ <rect width="44.3591" height="43.8421" transform="matrix(-1 0 0 1 84.7998 40.4111)" fill="black"/>
15
+ <rect width="30.9491" height="10.4551" transform="matrix(-1 0 0 1 74.8291 29.9563)" fill="black"/>
16
+ <rect width="35.348" height="14.5105" transform="matrix(-1 0 0 1 78.0957 84.2534)" fill="black"/>
17
+ <rect width="20.3335" height="20.6172" transform="matrix(-1 0 0 1 71.3896 84.2534)" fill="black"/>
18
+ <rect width="16.2667" height="55.7096" transform="matrix(-1 0 0 1 227.273 70.1934)" fill="black"/>
19
+ <rect width="9.97089" height="13.1067" transform="matrix(-1 0 0 1 40.4414 51.3379)" fill="black"/>
20
+ <rect width="9.97089" height="12.5623" transform="matrix(-1 0 0 1 94.7705 46.4106)" fill="black"/>
21
+ <path d="M51.0579 105.181H71.4275V99.1139H78.459V84.0837H84.8209V59.1253H95.0059V46.715H84.8209V40.5098H75.0545V30.03H42.9378V39.8679H39.3644V51.422H29.3587V55.4719" stroke="white" stroke-width="2"/>
22
+ </svg>
@@ -0,0 +1,5 @@
1
+ export { UDIChat } from './app/UDIChat';
2
+ export type { UDIChatConfig } from './app/UDIChatConfig';
3
+ export type { DataPackage, DataPackageResource, DataFieldDomain, IntervalDomain, CategoricalDomain, } from './types/dataPackage';
4
+ export { joinDataPath } from './features/data-package/utils/joinDataPath';
5
+ export type { LoadingPhase } from './features/data-package/stores/dataPackageStore';
@@ -0,0 +1,2 @@
1
+ import { ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,6 @@
1
+ export interface GlobalState {
2
+ debugMode: boolean;
3
+ isProduction: boolean;
4
+ toggleDebugMode: () => void;
5
+ }
6
+ export declare function createGlobalStore(): import('zustand').StoreApi<GlobalState>;
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -0,0 +1,64 @@
1
+ export interface IntervalDomain {
2
+ min: number;
3
+ max: number;
4
+ }
5
+ export interface CategoricalDomain {
6
+ values: string[];
7
+ }
8
+ export interface DataFieldDomain {
9
+ entity: string;
10
+ field: string;
11
+ type: 'interval' | 'point';
12
+ domain: IntervalDomain | CategoricalDomain;
13
+ fieldDescription: string;
14
+ }
15
+ export interface DataPackageResource {
16
+ name: string;
17
+ path: string;
18
+ schema: {
19
+ fields: Array<{
20
+ name: string;
21
+ description?: string;
22
+ type?: string;
23
+ 'udi:cardinality'?: number;
24
+ 'udi:data_type'?: string;
25
+ 'udi:overlapping_fields'?: string[] | 'all';
26
+ 'udi:unique'?: boolean;
27
+ }>;
28
+ primaryKey?: string[];
29
+ foreignKeys?: Array<{
30
+ fields: string[];
31
+ 'udi:cardinality'?: {
32
+ from: 'one' | 'many';
33
+ to: 'one' | 'many';
34
+ };
35
+ reference: {
36
+ resource: string;
37
+ fields: string[];
38
+ };
39
+ }>;
40
+ };
41
+ encoding?: string;
42
+ format?: string;
43
+ mediatype?: string;
44
+ scheme?: string;
45
+ type?: string;
46
+ 'udi:column_count'?: number;
47
+ 'udi:row_count'?: number;
48
+ }
49
+ export interface DataPackage {
50
+ 'udi:path': string;
51
+ resources: DataPackageResource[];
52
+ }
53
+ export type Row = Record<string, unknown>;
54
+ export type ExportRowSet = {
55
+ displayRows: Row[];
56
+ allRows: Row[];
57
+ };
58
+ export interface ValidStatus {
59
+ isValid: 'yes' | 'no' | 'unknown';
60
+ }
61
+ export interface EntityRelationship {
62
+ originKey: string;
63
+ targetKey: string;
64
+ }
@@ -0,0 +1,24 @@
1
+ export interface Message {
2
+ role: 'user' | 'system' | 'assistant';
3
+ content: string;
4
+ tool_calls?: ToolCall[];
5
+ linkedVisFilterId?: string;
6
+ }
7
+ export interface ToolCall {
8
+ function: FlatToolCall;
9
+ name?: string;
10
+ arguments?: Arguments;
11
+ }
12
+ export interface FlatToolCall {
13
+ name: string;
14
+ arguments: Arguments;
15
+ meta?: Record<string, unknown>;
16
+ }
17
+ /**
18
+ * Tool-call arguments can contain arbitrary nested JSON values (e.g.
19
+ * `filter: { intervalRange: { min, max } }` on FilterData, or `spec: string`
20
+ * on RenderVisualization). The previous `{ [key: string]: string }` typing
21
+ * did not match the reality. Callers should narrow to a specific
22
+ * tool-call-args interface from `@/features/tool-calls/types` before use.
23
+ */
24
+ export type Arguments = Record<string, unknown>;