udi-yac 0.2.3 → 0.3.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 (36) hide show
  1. package/README.md +38 -25
  2. package/dist/{ce-entry-CLKEbGj8.js → ce-entry-BN36qTNy.js} +21608 -21351
  3. package/dist/src/app/ErrorBoundary.d.ts +1 -1
  4. package/dist/src/app/UDIChatConfig.d.ts +9 -0
  5. package/dist/src/app/validateConfig.d.ts +0 -12
  6. package/dist/src/components/FieldTooltipContent.d.ts +12 -0
  7. package/dist/src/components/ui/accordion.d.ts +8 -1
  8. package/dist/src/features/chat/components/BrushFilterWidgets.d.ts +8 -0
  9. package/dist/src/features/dashboard/components/VizTweakComponent.types.d.ts +9 -0
  10. package/dist/src/features/dashboard/hooks/useBrushFilters.d.ts +45 -0
  11. package/dist/src/features/dashboard/hooks/useBrushFilters.test.d.ts +1 -0
  12. package/dist/src/features/dashboard/index.d.ts +1 -0
  13. package/dist/src/features/dashboard/utils/relevantTableMapping.d.ts +21 -0
  14. package/dist/src/features/dashboard/utils/relevantTableMapping.test.d.ts +1 -0
  15. package/dist/src/features/dashboard/utils/tweakability.d.ts +31 -14
  16. package/dist/src/features/data-package/components/DataOverviewPanel.d.ts +10 -0
  17. package/dist/src/features/data-package/components/DataOverviewPanel.test.d.ts +1 -0
  18. package/dist/src/features/data-package/components/EntityOverview.d.ts +10 -0
  19. package/dist/src/features/data-package/index.d.ts +1 -0
  20. package/dist/src/features/data-package/stores/dataPackageStore.d.ts +14 -0
  21. package/dist/src/features/data-package/utils/entityOverview.d.ts +136 -0
  22. package/dist/src/features/data-package/utils/entityOverview.test.d.ts +1 -0
  23. package/dist/src/features/tool-calls/components/IntervalFilterComponent.d.ts +8 -1
  24. package/dist/src/features/tool-calls/components/PointFilterComponent.d.ts +7 -1
  25. package/dist/src/features/tool-calls/components/PointFilterComponent.test.d.ts +1 -0
  26. package/dist/src/features/tool-calls/index.d.ts +2 -0
  27. package/dist/src/lib/chatRoot.d.ts +7 -0
  28. package/dist/src/stores/globalStore.d.ts +10 -0
  29. package/dist/src/utils/entityIcons.d.ts +10 -0
  30. package/dist/src/utils/highlightMatch.d.ts +7 -0
  31. package/dist/src/utils/httpError.d.ts +11 -0
  32. package/dist/src/utils/httpError.test.d.ts +1 -0
  33. package/dist/src/utils/specMutations.d.ts +73 -17
  34. package/dist/udi-yac.css +1 -1
  35. package/dist/udi-yac.js +29202 -27869
  36. package/package.json +5 -5
package/README.md CHANGED
@@ -59,35 +59,48 @@ The project builds as both a **library** and a **standalone app**:
59
59
  import { UDIChat } from 'udi-yac';
60
60
  import 'udi-yac/style.css';
61
61
 
62
- <UDIChat
63
- apiBaseUrl="http://localhost:8007"
64
- dataPackagePath="./data/hubmap_2025-05-05/datapackage_udi.json"
65
- authToken="your-jwt-token" // optional
66
- requireApiKey // optional — prompts for OpenAI key
67
- model="agenticx/UDI-VIS-Beta-v2" // optional
68
- />;
62
+ // UDIChat fills its parent, so that parent needs a definite height — with an
63
+ // `auto`-height ancestor it collapses to nothing.
64
+ <div className="h-screen">
65
+ <UDIChat
66
+ apiBaseUrl="http://localhost:8007"
67
+ dataPackagePath="./data/hubmap/datapackage.json"
68
+ authToken="your-jwt-token" // optional
69
+ requireApiKey // optional — prompts for OpenAI key
70
+ />
71
+ </div>;
69
72
  ```
70
73
 
74
+ Embedding in another app? Two things worth knowing up front:
75
+
76
+ - **`apiBaseUrl` accepts a same-origin path** (`/api/yac`), so agent traffic can go
77
+ through your own reverse proxy and let your server attach auth — no CORS, no token in
78
+ the browser. `authToken` is then unnecessary.
79
+ - **Every style is scoped** to the root element's `udi-yac` class, so the stylesheet
80
+ won't touch your app's own shadcn tokens or typography. Dark mode follows a `.dark`
81
+ class on any ancestor (the usual shadcn convention).
82
+
71
83
  ### Config Props
72
84
 
73
- | Prop | Type | Description |
74
- | ------------------ | -------------------- | --------------------------------------------------------------------------------------------------------------- |
75
- | `apiBaseUrl` | `string` | Base URL for the UDIAgent API |
76
- | `dataPackagePath` | `string?` | URL/path to `datapackage_udi.json`. Ignored when `dataPackage` is provided. |
77
- | `dataPackage` | `DataPackage?` | Provide a data package object directly instead of fetching from a URL. Takes precedence over `dataPackagePath`. |
78
- | `dataFieldDomains` | `DataFieldDomain[]?` | Pre-computed field domains. Skips CSV loading for domain computation when provided with `dataPackage`. |
79
- | `fetchOptions` | `RequestInit?` | Custom fetch options (headers, credentials, etc.) forwarded to all data-loading fetch calls. |
80
- | `authToken` | `string?` | JWT bearer token for API auth |
81
- | `requireApiKey` | `boolean?` | Show API key input before chatting |
82
- | `model` | `string?` | LLM model name override |
83
- | `downloadActions` | `DownloadAction[]?` | Extra items appended to the Download Data dropdown. See [Custom download actions](#custom-download-actions). |
84
- | `entityIcons` | `EntityIconMap?` | Icon overrides for entity count chips. See [Custom entity icons](#custom-entity-icons). |
85
- | `mascot` | `ReactNode \| null?` | Replace or hide the welcome mascot. See [Custom mascot](#custom-mascot). |
86
- | `splashMessages` | `readonly string[]?` | Override or hide the randomised prompt above the mascot. See [Custom splash messages](#custom-splash-messages). |
87
- | `onEvent` | `TrackerFn?` | Analytics callback invoked on key user actions. See [Analytics events](#analytics-events). |
88
- | `palette` | `UDIPalette?` | Default color palette for every chart and table. See [Custom color palette](#custom-color-palette). |
89
- | `className` | `string?` | CSS class for the root element |
90
- | `style` | `CSSProperties?` | Inline styles for the root element |
85
+ | Prop | Type | Description |
86
+ | ------------------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
87
+ | `apiBaseUrl` | `string` | Base URL for the UDIAgent API. Absolute (`https://agent.example.org`) or a same-origin path (`/api/yac`). |
88
+ | `remotePackage` | `string?` | Server-side data package name. Schema/domains come from `GET /v1/yac/metadata` and queries from `POST /v1/yac/query`; no CSVs load in the browser and cross-filtering becomes commit-on-mouse-up. Takes precedence over both data-package props. |
89
+ | `dataPackagePath` | `string?` | URL/path to `datapackage_udi.json`. Ignored when `dataPackage` is provided. |
90
+ | `dataPackage` | `DataPackage?` | Provide a data package object directly instead of fetching from a URL. Takes precedence over `dataPackagePath`. |
91
+ | `dataFieldDomains` | `DataFieldDomain[]?` | Pre-computed field domains. Skips CSV loading for domain computation when provided with `dataPackage`. |
92
+ | `fetchOptions` | `RequestInit?` | Custom fetch options (headers, credentials, etc.) forwarded to all data-loading fetch calls. |
93
+ | `authToken` | `string?` | JWT bearer token for API auth |
94
+ | `requireApiKey` | `boolean?` | Show API key input before chatting |
95
+ | `model` | `string?` | LLM model name override |
96
+ | `downloadActions` | `DownloadAction[]?` | Extra items appended to the Download Data dropdown. See [Custom download actions](#custom-download-actions). |
97
+ | `entityIcons` | `EntityIconMap?` | Icon overrides for entity count chips. See [Custom entity icons](#custom-entity-icons). |
98
+ | `mascot` | `ReactNode \| null?` | Replace or hide the welcome mascot. See [Custom mascot](#custom-mascot). |
99
+ | `splashMessages` | `readonly string[]?` | Override or hide the randomised prompt above the mascot. See [Custom splash messages](#custom-splash-messages). |
100
+ | `onEvent` | `TrackerFn?` | Analytics callback invoked on key user actions. See [Analytics events](#analytics-events). |
101
+ | `palette` | `UDIPalette?` | Default color palette for every chart and table. See [Custom color palette](#custom-color-palette). |
102
+ | `className` | `string?` | CSS class for the root element |
103
+ | `style` | `CSSProperties?` | Inline styles for the root element |
91
104
 
92
105
  ### Data Source Configuration
93
106