udi-yac 0.2.4 → 0.4.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.
- package/README.md +114 -57
- package/dist/{ce-entry-CLKEbGj8.js → ce-entry-DhrrSL9F.js} +22435 -22001
- package/dist/index.d.ts +318 -0
- package/dist/{rolldown-runtime-CWhphoD1.js → rolldown-runtime-DArdT4gl.js} +2 -2
- package/dist/udi-yac.css +1 -1
- package/dist/udi-yac.js +24852 -19847
- package/package.json +26 -25
- package/dist/favicon.svg +0 -22
- package/dist/icons.svg +0 -24
- package/dist/src/app/ErrorBoundary.d.ts +0 -19
- package/dist/src/app/UDIChat.d.ts +0 -3
- package/dist/src/app/UDIChatConfig.d.ts +0 -95
- package/dist/src/app/UDIChatContext.d.ts +0 -57
- package/dist/src/app/snapshotRegistry.d.ts +0 -19
- package/dist/src/app/snapshotRegistry.test.d.ts +0 -1
- package/dist/src/app/validateConfig.d.ts +0 -14
- package/dist/src/app/validateConfig.test.d.ts +0 -1
- package/dist/src/components/MarkdownText.d.ts +0 -6
- package/dist/src/components/ui/accordion.d.ts +0 -6
- package/dist/src/components/ui/badge.d.ts +0 -7
- package/dist/src/components/ui/button.d.ts +0 -9
- package/dist/src/components/ui/card.d.ts +0 -11
- package/dist/src/components/ui/checkbox.d.ts +0 -3
- package/dist/src/components/ui/dialog.d.ts +0 -17
- package/dist/src/components/ui/dropdown-menu.d.ts +0 -29
- package/dist/src/components/ui/input.d.ts +0 -3
- package/dist/src/components/ui/label.d.ts +0 -3
- package/dist/src/components/ui/popover.d.ts +0 -9
- package/dist/src/components/ui/scroll-area.d.ts +0 -8
- package/dist/src/components/ui/select.d.ts +0 -15
- package/dist/src/components/ui/separator.d.ts +0 -3
- package/dist/src/components/ui/slider.d.ts +0 -4
- package/dist/src/components/ui/switch.d.ts +0 -5
- package/dist/src/components/ui/tabs.d.ts +0 -10
- package/dist/src/components/ui/textarea.d.ts +0 -3
- package/dist/src/components/ui/tooltip.d.ts +0 -6
- package/dist/src/features/chat/api/completions.d.ts +0 -27
- package/dist/src/features/chat/components/ApiKeyInput.d.ts +0 -5
- package/dist/src/features/chat/components/ChatHeaderBar.d.ts +0 -20
- package/dist/src/features/chat/components/ChatInput.d.ts +0 -7
- package/dist/src/features/chat/components/ChatPanel.d.ts +0 -18
- package/dist/src/features/chat/components/ClosedVisualizationsPanel.d.ts +0 -6
- package/dist/src/features/chat/components/ConversationList.d.ts +0 -1
- package/dist/src/features/chat/components/DebugToggleSection.d.ts +0 -13
- package/dist/src/features/chat/components/InlineExamplePrompts.d.ts +0 -13
- package/dist/src/features/chat/components/MemoryBankButton.d.ts +0 -6
- package/dist/src/features/chat/components/MessageBubble.d.ts +0 -8
- package/dist/src/features/chat/components/MessageList.d.ts +0 -7
- package/dist/src/features/chat/components/SessionStatusDialog.d.ts +0 -13
- package/dist/src/features/chat/hooks/useApiKey.d.ts +0 -24
- package/dist/src/features/chat/hooks/useChatApi.d.ts +0 -26
- package/dist/src/features/chat/hooks/useDebugExports.d.ts +0 -11
- package/dist/src/features/chat/hooks/useExamplePrompts.d.ts +0 -7
- package/dist/src/features/chat/hooks/useMessageListScroll.d.ts +0 -20
- package/dist/src/features/chat/hooks/useResetHandlers.d.ts +0 -8
- package/dist/src/features/chat/index.d.ts +0 -9
- package/dist/src/features/chat/stores/conversationStore.d.ts +0 -34
- package/dist/src/features/chat/stores/conversationStore.test.d.ts +0 -1
- package/dist/src/features/dashboard/components/DashboardCard.d.ts +0 -9
- package/dist/src/features/dashboard/components/DashboardGrid.d.ts +0 -6
- package/dist/src/features/dashboard/components/DashboardPanel.d.ts +0 -1
- package/dist/src/features/dashboard/components/DataCounts.d.ts +0 -1
- package/dist/src/features/dashboard/components/DownloadButton.d.ts +0 -1
- package/dist/src/features/dashboard/components/FilterToolbar.d.ts +0 -1
- package/dist/src/features/dashboard/components/GridSettingsButton.d.ts +0 -1
- package/dist/src/features/dashboard/components/ScrollAffordances.d.ts +0 -15
- package/dist/src/features/dashboard/components/SessionImportExportButton.d.ts +0 -1
- package/dist/src/features/dashboard/components/VizTweakComponent.d.ts +0 -8
- package/dist/src/features/dashboard/components/VizTweakComponent.types.d.ts +0 -20
- package/dist/src/features/dashboard/components/WelcomeSplash.d.ts +0 -1
- package/dist/src/features/dashboard/hooks/useLayoutPersistence.d.ts +0 -1
- package/dist/src/features/dashboard/index.d.ts +0 -10
- package/dist/src/features/dashboard/stores/dashboardStore.d.ts +0 -110
- package/dist/src/features/dashboard/stores/dashboardStore.test.d.ts +0 -1
- package/dist/src/features/dashboard/stores/dataFiltersStore.d.ts +0 -34
- package/dist/src/features/dashboard/stores/dataFiltersStore.test.d.ts +0 -1
- package/dist/src/features/dashboard/stores/memoryBankStore.d.ts +0 -8
- package/dist/src/features/dashboard/stores/memoryBankStore.test.d.ts +0 -1
- package/dist/src/features/dashboard/types.d.ts +0 -50
- package/dist/src/features/dashboard/utils/dashboardSerialization.d.ts +0 -49
- package/dist/src/features/dashboard/utils/dashboardSerialization.test.d.ts +0 -1
- package/dist/src/features/dashboard/utils/gridDefaults.d.ts +0 -17
- package/dist/src/features/dashboard/utils/gridPacking.d.ts +0 -56
- package/dist/src/features/dashboard/utils/gridPacking.test.d.ts +0 -1
- package/dist/src/features/dashboard/utils/initialCardSize.d.ts +0 -27
- package/dist/src/features/dashboard/utils/tweakability.d.ts +0 -20
- package/dist/src/features/data-package/index.d.ts +0 -7
- package/dist/src/features/data-package/stores/dataPackageStore.d.ts +0 -25
- package/dist/src/features/data-package/stores/dataPackageStore.test.d.ts +0 -1
- package/dist/src/features/data-package/utils/joinDataPath.d.ts +0 -7
- package/dist/src/features/data-package/utils/joinDataPath.test.d.ts +0 -1
- package/dist/src/features/data-package/utils/structuredTextParser.d.ts +0 -14
- package/dist/src/features/data-package/utils/structuredTextParser.test.d.ts +0 -1
- package/dist/src/features/tool-calls/components/ClarifyVariable.d.ts +0 -6
- package/dist/src/features/tool-calls/components/FieldListChip.d.ts +0 -13
- package/dist/src/features/tool-calls/components/FilterComponent.d.ts +0 -9
- package/dist/src/features/tool-calls/components/FreeTextExplain.d.ts +0 -2
- package/dist/src/features/tool-calls/components/IntervalFilterComponent.d.ts +0 -9
- package/dist/src/features/tool-calls/components/PointFilterComponent.d.ts +0 -8
- package/dist/src/features/tool-calls/components/RebuffNotice.d.ts +0 -5
- package/dist/src/features/tool-calls/components/ToolCallRenderer.d.ts +0 -11
- package/dist/src/features/tool-calls/components/VisualizationCard.d.ts +0 -10
- package/dist/src/features/tool-calls/index.d.ts +0 -6
- package/dist/src/features/tool-calls/types.d.ts +0 -60
- package/dist/src/index.d.ts +0 -6
- package/dist/src/lib/utils.d.ts +0 -8
- package/dist/src/stores/globalStore.d.ts +0 -6
- package/dist/src/stores/globalStore.test.d.ts +0 -1
- package/dist/src/test/setup.d.ts +0 -0
- package/dist/src/types/dataPackage.d.ts +0 -50
- package/dist/src/types/messages.d.ts +0 -24
- package/dist/src/types/usage.d.ts +0 -18
- package/dist/src/utils/specMutations.d.ts +0 -45
- package/dist/src/utils/specMutations.test.d.ts +0 -1
package/README.md
CHANGED
|
@@ -18,20 +18,24 @@ pnpm test:watch # vitest in watch mode
|
|
|
18
18
|
|
|
19
19
|
### Standalone app config (env vars)
|
|
20
20
|
|
|
21
|
-
The standalone `App.tsx` reads these Vite env vars
|
|
21
|
+
The standalone `App.tsx` reads these Vite env vars. Copy `.env.example` to `.env.local` to override locally — all are optional.
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
| -------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
25
|
-
| `VITE_UDI_API_BASE_URL` | `http://localhost:8007` | UDIAgent FastAPI server URL |
|
|
26
|
-
| `VITE_UDI_DATA_PACKAGE` | (unset → inline HuBMAP API package from `src/data/hubmapRemote.ts`) | Optional path/URL to a `datapackage_udi.json`. Overrides the inline default when set. |
|
|
27
|
-
| `VITE_UDI_REQUIRE_API_KEY` | `true` | Set to `false` to skip the in-app OpenAI key prompt |
|
|
28
|
-
| `VITE_UDI_MODEL` | (unset) | Optional LLM model override |
|
|
23
|
+
Each is described once in [`src/app/envVars.ts`](src/app/envVars.ts); this table, `.env.example`, and `src/env.d.ts` are generated from it by `node scripts/gen-chat-env-docs.mjs`, and CI fails if they drift.
|
|
29
24
|
|
|
30
|
-
|
|
25
|
+
<!-- BEGIN generated: env vars (scripts/gen-chat-env-docs.mjs) -->
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
| Variable | Default | Description |
|
|
28
|
+
| -------------------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
29
|
+
| `VITE_UDI_API_BASE_URL` | `http://localhost:8007` | UDIAgent FastAPI server URL. May also be a same-origin path (e.g. `/api/yac`) when the chat sits behind the host app’s reverse proxy. |
|
|
30
|
+
| `VITE_UDI_DATA_PACKAGE` | `/data/hubmap/datapackage.json` | Path or URL to a `datapackage.json`. Defaults to the bundled HuBMAP snapshot synced from `sample-data/`. Ignored when `VITE_UDI_REMOTE_PACKAGE` is set. |
|
|
31
|
+
| `VITE_UDI_REMOTE_PACKAGE` | — | Name of a server-side data package (configured on the agent via `UDI_QUERY_BACKENDS`). When set, no CSVs load in the browser: metadata comes from `/v1/yac/metadata` and queries go to `/v1/yac/query`. Takes precedence over `VITE_UDI_DATA_PACKAGE`. |
|
|
32
|
+
| `VITE_UDI_REQUIRE_API_KEY` | `true` | Prompt the user for an OpenAI key in the UI. Defaults to `true`, but `.env.example` ships `false` because local dev runs against an agent that has its own `OPENAI_API_KEY`. |
|
|
33
|
+
| `VITE_UDI_MODEL` | — | LLM model override. Sent **only when the user supplies their own OpenAI key** — the agent honors a requested model only alongside an `X-OpenAI-Key`, so whoever pays for the tokens picks the model. Otherwise the agent’s `GPT_MODEL_NAME` applies. |
|
|
34
|
+
| `VITE_BASE` | `/` | Public base path for the built SPA (read in `vite.config.ts`, build-time only). The library build always uses `./`. |
|
|
35
|
+
|
|
36
|
+
<!-- END generated: env vars -->
|
|
37
|
+
|
|
38
|
+
To switch between bundled data packages and server-side (remote) mode, use `node scripts/set-chat-data-source.mjs <package> [--remote]` rather than editing `.env.local` by hand — the repo-root README and `dev/duckdb/README.md` cover the full flow.
|
|
35
39
|
|
|
36
40
|
> **Note on `build` vs `build:lib`**: `pnpm build` produces a deployable standalone SPA — this is the default so CI/deploy pipelines behave as expected. To build the publishable library bundle (the `UDIChat` React component), use `pnpm build:lib`, which invokes `vite build --mode lib` and emits both JS and `.d.ts` files under `dist/`.
|
|
37
41
|
|
|
@@ -44,6 +48,20 @@ VITE_UDI_DATA_PACKAGE=/data/hubmap_2025-05-05/datapackage_udi.json
|
|
|
44
48
|
- **Arquero** for client-side data loading and domain computation
|
|
45
49
|
- **Vite** for dev server and library builds
|
|
46
50
|
|
|
51
|
+
### Agent version pairing
|
|
52
|
+
|
|
53
|
+
`udi-yac` and `udiagent` share a private contract beyond the HTTP shape: the
|
|
54
|
+
agent sends a chart's title and summary **tokenized** (`{enc:x}`, `{ent:entity3}`,
|
|
55
|
+
`{col:entity2_field}`, …) and this package resolves them against the spec, the
|
|
56
|
+
template's bindings and the data package's display labels. The vocabulary grows
|
|
57
|
+
as templates need new wording, so **run an agent no newer than your `udi-yac`**.
|
|
58
|
+
|
|
59
|
+
A newer client against an older agent is always fine. The other way round, a
|
|
60
|
+
token this version does not know makes the wording fall back to a title derived
|
|
61
|
+
from the spec — readable, just less specific. Builds from before that fallback
|
|
62
|
+
landed print the unknown token instead, so an old enough `udi-yac` shows
|
|
63
|
+
`{col:entity2_field}` in a card title where a current one degrades cleanly.
|
|
64
|
+
|
|
47
65
|
## Architecture
|
|
48
66
|
|
|
49
67
|
### Dual Build Modes
|
|
@@ -59,35 +77,60 @@ The project builds as both a **library** and a **standalone app**:
|
|
|
59
77
|
import { UDIChat } from 'udi-yac';
|
|
60
78
|
import 'udi-yac/style.css';
|
|
61
79
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
80
|
+
// UDIChat fills its parent, so that parent needs a definite height — with an
|
|
81
|
+
// `auto`-height ancestor it collapses to nothing.
|
|
82
|
+
<div className="h-screen">
|
|
83
|
+
<UDIChat
|
|
84
|
+
apiBaseUrl="http://localhost:8007"
|
|
85
|
+
dataPackagePath="./data/hubmap/datapackage.json"
|
|
86
|
+
authToken="your-jwt-token" // optional
|
|
87
|
+
requireApiKey // optional — prompts for OpenAI key
|
|
88
|
+
/>
|
|
89
|
+
</div>;
|
|
69
90
|
```
|
|
70
91
|
|
|
92
|
+
Embedding in another app? Two things worth knowing up front:
|
|
93
|
+
|
|
94
|
+
- **`apiBaseUrl` accepts a same-origin path** (`/api/yac`), so agent traffic can go
|
|
95
|
+
through your own reverse proxy and let your server attach auth — no CORS, no token in
|
|
96
|
+
the browser. Leave `authToken` unset and the chat sends no `Authorization` header at
|
|
97
|
+
all, so there is nothing for the proxy to strip. This is the only workable shape when
|
|
98
|
+
your portal keeps its identity-provider token server-side; forward the body, the
|
|
99
|
+
`X-Conversation-Id` and `X-OpenAI-Key` request headers, and the `X-Usage-*` response
|
|
100
|
+
headers.
|
|
101
|
+
- **Every style is scoped.** Design tokens and element resets are confined to the root
|
|
102
|
+
element's `udi-yac` class, and every Tailwind utility we emit carries a `udi:` prefix
|
|
103
|
+
(`udi:flex`), so nothing collides with your own Tailwind build whichever stylesheet
|
|
104
|
+
loads last. The sheet ships no preflight, so it cannot reset your typography or box
|
|
105
|
+
model. Dark mode follows a `.dark` class on any ancestor (the usual shadcn convention).
|
|
106
|
+
- **The bundle is server-safe.** `import 'udi-yac'` evaluates without a DOM, so a route
|
|
107
|
+
file that imports it does not break SSR. Rendering `<UDIChat>` still requires a
|
|
108
|
+
browser — mount it client-side.
|
|
109
|
+
- **`react` and `react-dom` are the only runtime dependencies.** Everything else,
|
|
110
|
+
`udi-toolkit` included, is bundled into the published file. Types are bundled too:
|
|
111
|
+
import `UDIPalette` from `udi-yac`, not from `udi-toolkit`.
|
|
112
|
+
|
|
71
113
|
### Config Props
|
|
72
114
|
|
|
73
|
-
| Prop | Type | Description
|
|
74
|
-
| ------------------ | -------------------- |
|
|
75
|
-
| `apiBaseUrl` | `string` | Base URL for the UDIAgent API
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
115
|
+
| Prop | Type | Description |
|
|
116
|
+
| ------------------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
117
|
+
| `apiBaseUrl` | `string` | Base URL for the UDIAgent API. Absolute (`https://agent.example.org`) or a same-origin path (`/api/yac`). |
|
|
118
|
+
| `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. |
|
|
119
|
+
| `dataPackagePath` | `string?` | URL/path to `datapackage_udi.json`. Ignored when `dataPackage` is provided. |
|
|
120
|
+
| `dataPackage` | `DataPackage?` | Provide a data package object directly instead of fetching from a URL. Takes precedence over `dataPackagePath`. |
|
|
121
|
+
| `dataFieldDomains` | `DataFieldDomain[]?` | Pre-computed field domains. Skips CSV loading for domain computation when provided with `dataPackage`. |
|
|
122
|
+
| `fetchOptions` | `RequestInit?` | Custom fetch options (headers, credentials, etc.) forwarded to all data-loading fetch calls. |
|
|
123
|
+
| `authToken` | `string?` | JWT bearer token for API auth. Omit it when a backend proxy attaches the header instead; no `Authorization` header is then sent. |
|
|
124
|
+
| `requireApiKey` | `boolean?` | Show API key input before chatting |
|
|
125
|
+
| `model` | `string?` | LLM model name override |
|
|
126
|
+
| `downloadActions` | `DownloadAction[]?` | Extra items appended to the Download Data dropdown. See [Custom download actions](#custom-download-actions). |
|
|
127
|
+
| `entityIcons` | `EntityIconMap?` | Icon overrides for entity count chips. See [Custom entity icons](#custom-entity-icons). |
|
|
128
|
+
| `mascot` | `ReactNode \| null?` | Replace or hide the welcome mascot. See [Custom mascot](#custom-mascot). |
|
|
129
|
+
| `splashMessages` | `readonly string[]?` | Override or hide the randomised prompt above the mascot. See [Custom splash messages](#custom-splash-messages). |
|
|
130
|
+
| `onEvent` | `TrackerFn?` | Analytics callback invoked on key user actions. See [Analytics events](#analytics-events). |
|
|
131
|
+
| `palette` | `UDIPalette?` | Default color palette for every chart and table. See [Custom color palette](#custom-color-palette). |
|
|
132
|
+
| `className` | `string?` | CSS class for the root element |
|
|
133
|
+
| `style` | `CSSProperties?` | Inline styles for the root element |
|
|
91
134
|
|
|
92
135
|
### Data Source Configuration
|
|
93
136
|
|
|
@@ -285,8 +328,7 @@ Consumer entries are merged on top of the built-in icons (`donors`, `samples`, `
|
|
|
285
328
|
Pass `palette` on `UDIChatConfig` to set the default colors used by every chart and table (dashboard cards, chat-message previews, and the memory bank). A spec-level per-encoding `range` still overrides the palette.
|
|
286
329
|
|
|
287
330
|
```tsx
|
|
288
|
-
import { UDIChat } from 'udi-yac';
|
|
289
|
-
import type { UDIPalette } from 'udi-toolkit/react';
|
|
331
|
+
import { UDIChat, type UDIPalette } from 'udi-yac';
|
|
290
332
|
import { interpolateViridis } from 'd3-scale-chromatic';
|
|
291
333
|
|
|
292
334
|
const palette: UDIPalette = {
|
|
@@ -304,6 +346,20 @@ const palette: UDIPalette = {
|
|
|
304
346
|
|
|
305
347
|
The `category`/`ordinal` fields accept a color array or a Vega scheme name. The `ramp` accepts a scheme name, a color array, or an interpolator function. Note: in the **table** renderer, function and array ramps are honored, while a bare scheme-name ramp falls back to the default (scheme names apply fully to Vega charts).
|
|
306
348
|
|
|
349
|
+
#### Chart chrome follows your theme automatically
|
|
350
|
+
|
|
351
|
+
Everything above colors the _data_. The surrounding chrome — plot background, axis lines, gridlines, tick labels, table text — is derived from the design tokens in effect on the chat root (`--foreground`, `--muted-foreground`, `--border`), and re-read whenever a `dark` class is toggled on any ancestor. So charts and tables follow light/dark mode, and follow your own token overrides, with no configuration.
|
|
352
|
+
|
|
353
|
+
Supply any of these to take over a channel; each one you set wins, and the rest stay theme-derived:
|
|
354
|
+
|
|
355
|
+
| Field | Controls |
|
|
356
|
+
| ------------ | ------------------------------------------------------------- |
|
|
357
|
+
| `background` | Plot and table background. `'transparent'` inherits the card. |
|
|
358
|
+
| `axis` | Axis domain lines and ticks. |
|
|
359
|
+
| `grid` | Gridlines, the plot frame, and table rules. |
|
|
360
|
+
| `text` | Tick labels, axis and legend titles, table text. |
|
|
361
|
+
| `mutedText` | Empty cells and truncation notices. |
|
|
362
|
+
|
|
307
363
|
### Custom mascot
|
|
308
364
|
|
|
309
365
|
The empty-dashboard welcome splash renders a YAC mascot by default. Consumers can replace it or hide it via the `mascot` prop on `UDIChatConfig`:
|
|
@@ -379,25 +435,26 @@ Event names are stable, snake_case strings. **Properties carry metadata only —
|
|
|
379
435
|
|
|
380
436
|
**Correlation ids.** Every event carries a `sessionId` (minted once per `UDIChat` mount) so all events from one chat instance can be stitched together and two tabs can be told apart. A subset of events — the ones bound to a single send↔response round trip — also carries a shared `turnId`, making it trivial to match a `message_sent` to the `response_received`, `rebuff_received`, or `request_failed` it produced. A retry after entering an API key reuses the original `turnId` so the retry's response still pairs back to the originating send.
|
|
381
437
|
|
|
382
|
-
| Event
|
|
383
|
-
|
|
|
384
|
-
| `message_sent`
|
|
385
|
-
| `response_received`
|
|
386
|
-
| `rebuff_received`
|
|
387
|
-
| `request_failed`
|
|
388
|
-
| `api_key_set`
|
|
389
|
-
| `api_key_cleared`
|
|
390
|
-
| `conversation_reset`
|
|
391
|
-
| `visualization_pinned`
|
|
392
|
-
| `visualization_closed`
|
|
393
|
-
| `download_raw_data`
|
|
394
|
-
| `download_manifest`
|
|
395
|
-
| `download_<slug>`
|
|
396
|
-
| `filter_range_changed`
|
|
397
|
-
| `filter_selection_changed`
|
|
398
|
-
| `filter_entity_changed`
|
|
399
|
-
| `filter_field_changed`
|
|
400
|
-
| `visualization_tweaked`
|
|
438
|
+
| Event | Fired when | Properties |
|
|
439
|
+
| ---------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
440
|
+
| `message_sent` | User submits a message through the chat input | `turnId: string`<br>`charCount: number` — length of the text, not the text itself<br>`conversationLength: number` — messages already in the conversation when this one was added<br>`hasUserApiKey: boolean` — whether the request will carry the user's key |
|
|
441
|
+
| `response_received` | Server completes a `/v1/yac/completions` call (including rebuffs) | `turnId: string` — matches the originating `message_sent`<br>`durationMs: number`<br>`toolCallNames: string[]` — e.g. `["RenderVisualization", "FreeTextExplain"]`<br>`toolCallCount: number`<br>`hadUserKey: boolean`<br>`hasRebuff: boolean` |
|
|
442
|
+
| `rebuff_received` | The response contains a `Rebuff` tool_call | `turnId: string`<br>`reason?: string` — machine-readable discriminator; `"budget_exceeded"` for quota rebuffs, absent for ordinary rebuffs<br>`hadUserKey: boolean` |
|
|
443
|
+
| `request_failed` | `/v1/yac/completions` throws (network error, HTTP !ok) | `turnId: string`<br>`durationMs: number`<br>`hadUserKey: boolean` |
|
|
444
|
+
| `api_key_set` | User submits a key through the `ApiKeyInput` | `inResponseToQuota: boolean` — true if a budget-exceeded rebuff had triggered the prompt (distinguishes first-time entry from quota-recovery entry) |
|
|
445
|
+
| `api_key_cleared` | User clears their stored key via the header icon | _(none)_ |
|
|
446
|
+
| `conversation_reset` | User clicks the Reset button (clears messages, pinned viz, filters, memory bank) | `conversationLength: number` — message count at the moment of reset |
|
|
447
|
+
| `visualization_pinned` | A new visualization is auto-pinned from an assistant response | `hasTitle: boolean`<br>`toolCallIndex: number` — position within the assistant message's tool_calls |
|
|
448
|
+
| `visualization_closed` | User clicks the × on a pinned visualization card | `hasTitle: boolean` |
|
|
449
|
+
| `download_raw_data` | User clicks "Download Raw Data" in the Download Data dropdown | `sources: number` — count of sources contributing rows<br>`rowsTotal: number` |
|
|
450
|
+
| `download_manifest` | User clicks "Download Manifest" | `idsTotal: number` — count of `hubmap_id` values in the exported manifest |
|
|
451
|
+
| `download_<slug>` | User clicks a custom `downloadActions` entry | `label: string` — the original menu label |
|
|
452
|
+
| `filter_range_changed` | User commits a new range on a quantitative (interval) filter slider, including the reset button | `entity: string`<br>`field: string`<br>`isReset: boolean` — true when triggered by the reset button<br>`isFullRange: boolean` — true when the new range covers the full domain |
|
|
453
|
+
| `filter_selection_changed` | User toggles a checkbox or clicks "Clear all" on a categorical (point) filter | `entity: string`<br>`field: string`<br>`action: 'toggle' \| 'clear_all'`<br>`checked?: boolean` — present only when `action === 'toggle'`<br>`selectionCount: number` — count of selected values after the change (no values themselves) |
|
|
454
|
+
| `filter_entity_changed` | User changes the target entity on a tweakable filter card | `filterType: 'interval' \| 'point'`<br>`entity: string` — the newly selected entity<br>`field: string` — the field carried over to the new entity (may be empty) |
|
|
455
|
+
| `filter_field_changed` | User changes the target field on a tweakable filter card | `filterType: 'interval' \| 'point'`<br>`entity: string`<br>`field: string` — the newly selected field |
|
|
456
|
+
| `visualization_tweaked` | User changes the field a `VizTweakComponent` dropdown controls | `encoding: string` — the channel, or the template parameter for a re-bind<br>`kind: 'field' \| 'dimension' \| 'measure' \| 'binding'` — `binding` means the agent re-instantiated the template; the rest are local spec rewrites |
|
|
457
|
+
| `visualization_tweak_failed` | The agent refused a template re-bind (invalid binding, unknown template, transport failure) | `encoding: string`<br>`kind: 'binding'` |
|
|
401
458
|
|
|
402
459
|
Every row in the table above also includes `sessionId: string`; it's omitted from the per-event cells to keep the table scannable.
|
|
403
460
|
|