@cyanheads/eurostat-mcp-server 0.4.0 → 0.6.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 (52) hide show
  1. package/CLAUDE.md +1 -1
  2. package/README.md +31 -9
  3. package/dist/config/server-config.d.ts +2 -0
  4. package/dist/config/server-config.d.ts.map +1 -1
  5. package/dist/config/server-config.js +14 -0
  6. package/dist/config/server-config.js.map +1 -1
  7. package/dist/index.js +6 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.js +2 -2
  10. package/dist/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.js.map +1 -1
  11. package/dist/mcp-server/tools/definitions/eurostat-dataframe-query.tool.js +2 -2
  12. package/dist/mcp-server/tools/definitions/eurostat-dataframe-query.tool.js.map +1 -1
  13. package/dist/mcp-server/tools/definitions/eurostat-download-dataset.tool.d.ts +93 -0
  14. package/dist/mcp-server/tools/definitions/eurostat-download-dataset.tool.d.ts.map +1 -0
  15. package/dist/mcp-server/tools/definitions/eurostat-download-dataset.tool.js +362 -0
  16. package/dist/mcp-server/tools/definitions/eurostat-download-dataset.tool.js.map +1 -0
  17. package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.js +2 -2
  18. package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.js.map +1 -1
  19. package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.js +2 -2
  20. package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.js.map +1 -1
  21. package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.d.ts +6 -2
  22. package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.d.ts.map +1 -1
  23. package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.js +28 -20
  24. package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.js.map +1 -1
  25. package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.js +3 -3
  26. package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.js.map +1 -1
  27. package/dist/services/canvas-accessor.d.ts +5 -0
  28. package/dist/services/canvas-accessor.d.ts.map +1 -1
  29. package/dist/services/canvas-accessor.js +7 -0
  30. package/dist/services/canvas-accessor.js.map +1 -1
  31. package/dist/services/eurostat-bulk/eurostat-bulk-service.d.ts +89 -0
  32. package/dist/services/eurostat-bulk/eurostat-bulk-service.d.ts.map +1 -0
  33. package/dist/services/eurostat-bulk/eurostat-bulk-service.js +502 -0
  34. package/dist/services/eurostat-bulk/eurostat-bulk-service.js.map +1 -0
  35. package/dist/services/eurostat-bulk/types.d.ts +72 -0
  36. package/dist/services/eurostat-bulk/types.d.ts.map +1 -0
  37. package/dist/services/eurostat-bulk/types.js +9 -0
  38. package/dist/services/eurostat-bulk/types.js.map +1 -0
  39. package/dist/services/eurostat-codelists.d.ts +45 -0
  40. package/dist/services/eurostat-codelists.d.ts.map +1 -0
  41. package/dist/services/eurostat-codelists.js +92 -0
  42. package/dist/services/eurostat-codelists.js.map +1 -0
  43. package/dist/services/eurostat-data/eurostat-data-service.d.ts +46 -5
  44. package/dist/services/eurostat-data/eurostat-data-service.d.ts.map +1 -1
  45. package/dist/services/eurostat-data/eurostat-data-service.js +85 -14
  46. package/dist/services/eurostat-data/eurostat-data-service.js.map +1 -1
  47. package/dist/services/eurostat-data/types.d.ts +16 -8
  48. package/dist/services/eurostat-data/types.d.ts.map +1 -1
  49. package/dist/services/eurostat-data/types.js +0 -4
  50. package/dist/services/eurostat-data/types.js.map +1 -1
  51. package/package.json +1 -1
  52. package/server.json +34 -6
package/CLAUDE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** @cyanheads/eurostat-mcp-server
4
- **Version:** 0.4.0
4
+ **Version:** 0.6.0
5
5
  **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.1`
6
6
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
7
7
  **Zod:** `^4.4.3`
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <div align="center">
2
2
  <h1>@cyanheads/eurostat-mcp-server</h1>
3
3
  <p><b>Search and query the Eurostat catalogue — EU economy, demography, trade, health, and NUTS regional data via MCP. STDIO or Streamable HTTP.</b>
4
- <div>5 Tools (7 with the dataframe canvas) • 1 Resource</div>
4
+ <div>6 Tools (8 with the dataframe canvas) • 1 Resource</div>
5
5
  </p>
6
6
  </div>
7
7
 
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
 
12
- [![Version](https://img.shields.io/badge/Version-0.4.0-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/eurostat-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.30.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/eurostat-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/eurostat-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.14-blueviolet.svg?style=flat-square)](https://bun.sh/)
12
+ [![Version](https://img.shields.io/badge/Version-0.6.0-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/eurostat-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.30.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/eurostat-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/eurostat-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.14-blueviolet.svg?style=flat-square)](https://bun.sh/)
13
13
 
14
14
  </div>
15
15
 
@@ -31,7 +31,7 @@
31
31
 
32
32
  ## Tools
33
33
 
34
- 5 tools for discovering and querying Eurostat statistical datasets, plus 2 more when the optional dataframe canvas is enabled:
34
+ 6 tools for discovering and querying Eurostat statistical datasets, plus 2 more when the optional dataframe canvas is enabled:
35
35
 
36
36
  | Tool | Description |
37
37
  |:---|:---|
@@ -40,6 +40,7 @@
40
40
  | `eurostat_get_dataset_info` | Fetch metadata for a dataset: dimensions with sample values, time range, observation count, and last-update date |
41
41
  | `eurostat_get_dimension_values` | List all valid codes for a specific dimension (e.g., all geo codes, all unit codes); supports NUTS hierarchy filtering |
42
42
  | `eurostat_query_dataset` | Fetch decoded statistical observations with dimension filters, NUTS geo-level, and time-range controls |
43
+ | `eurostat_download_dataset` | Download a whole dataset through the SDMX 2.1 TSV bulk endpoint and stage every observation on the dataframe canvas |
43
44
  | `eurostat_dataframe_describe` | List the tables staged on a dataframe canvas with their row counts and column types — canvas only |
44
45
  | `eurostat_dataframe_query` | Run a read-only SQL SELECT across staged tables — canvas only |
45
46
 
@@ -99,22 +100,40 @@ Fetch statistical data from a Eurostat dataset.
99
100
  - Accepts dimension filters as a map of `{dimension_code: [value1, value2, ...]}`
100
101
  - NUTS geo-level filter (`aggregate`, `country`, `nuts1`, `nuts2`, `nuts3`) — mutually exclusive with a non-empty `geo` entry in filters; an empty array is treated as no filter and dropped
101
102
  - Time range via `since_period`/`until_period` (e.g., `"2020"`, `"2023-Q1"`) or `last_n_periods` for the N most recent
102
- - Returns decoded observations with dimension codes and labels, numeric values, and status flags (`p` = provisional, `e` = estimated, etc.)
103
+ - Returns decoded observations with dimension codes and labels, numeric values, an `OBS_FLAG` status (`p` = provisional, `e` = estimated, etc.) and a separate `CONF_STATUS` confidentiality marker (`C` = confidential, usually the reason a value is null)
103
104
  - Reports total observation count, missing value count, and the effective time range of the result, each period bound omitted when neither the observations nor Eurostat report it
104
105
  - Inline rows are capped at 5,000, applied while decoding so a broad query never builds the rest; `obsCount`, `missingObsCount` and `timeRange` still describe the whole match, and `truncated` flags when the cap bit. Filter the query to shrink what Eurostat sends — the cap bounds the decode, not the transfer
105
106
  - With the dataframe canvas enabled, a match past the cap is also staged whole as a SQL table and the response returns `canvasId` / `tableName` / `stagedRowCount`; the rows are streamed into the table one at a time from the response body already in memory, so nothing extra is fetched and the match is never materialized as an array. Without a canvas those fields are absent and narrowing the query is the way to the rest
106
107
  - Pass `canvas_id` from an earlier response to stage several results side by side and join across them
107
108
  - Async-response detection — large unfiltered queries return an actionable, non-retryable error with filter guidance rather than silently timing out
109
+ - Fetches a *slice*. When the target is a whole dataset, `eurostat_download_dataset` reads the SDMX bulk endpoint instead, at roughly half the bytes
110
+
111
+ ---
112
+
113
+ ### `eurostat_download_dataset`
114
+
115
+ Download a whole dataset through the SDMX 2.1 TSV bulk endpoint (`/sdmx/2.1/data/{dataset}?format=TSV`).
116
+
117
+ - The TSV wire format runs 48–63% of the JSON-stat body `eurostat_query_dataset` reads for the same data, because the wide layout writes each dimension key once per row instead of once per observation. Measured across four datasets from 1.1M to 12.8M observations
118
+ - Filters take the same `{dimension_code: [value, ...]}` map as `eurostat_query_dataset` and are applied by Eurostat before the body is sent. They become a positional key on the request path, which must carry one position per dimension — the server builds it from the dataset's own dimension order, so a filter naming a dimension the dataset does not have is rejected with the real list rather than sent as a malformed key
119
+ - Narrow periods with `since_period` / `until_period`. There is deliberately no "last N periods": the TSV layout keeps a column for every period whichever selector is used, and `lastNObservations` merely blanks the unselected cells — measured at ~3× the equivalent JSON-stat body. `startPeriod` removes the columns
120
+ - **Byte budget enforced while streaming.** Eurostat sends the body chunked with no `Content-Length`, so the limit is applied as bytes arrive and the transfer is aborted the moment it is spent — not measured after the fact. A truncated download returns its rows with `budgetExceeded: true` rather than an error, so the work already paid for is not discarded. `EUROSTAT_BULK_MAX_BYTES` sets the ceiling
121
+ - **gzip is sniffed off the stream, not read from headers.** Eurostat compresses large bodies with no `Content-Encoding` header; the only header-level tell is a `.tsv.gz` filename on `Content-Disposition`, and the switch does not track dataset size, so the magic bytes are what decide
122
+ - **The asynchronous queue envelope is detected explicitly.** When an extraction is too costly to serve inline Eurostat answers HTTP 200 with a SOAP `syncResponse` ticket instead of data; read as TSV that yields a header row of XML and no observations, so it is classified up front as a non-retryable error naming what to narrow
123
+ - Errors arrive as XML SOAP faults, not JSON: faultcode 100 → `not_found`, 140 → `filter_arity`, 150 → `invalid_dimension` (which also covers a period range outside the dataset's coverage). Each maps to a typed reason with a recovery hint naming the tool to call next
124
+ - With the dataframe canvas enabled, every observation is staged as a SQL table and the response returns `canvasId` / `tableName` / `stagedRowCount`; rows stream into the table one at a time, so a multi-million-row download never materializes as an array. Only `preview_limit` rows (default 50, max 500) come back inline, and they are the leading rows of the staged table
125
+ - Without a canvas the download still runs so `rowCount`, `missingCount` and `periodRange` describe it, but only the preview is retained — the response says so plainly instead of implying the rest is reachable
108
126
 
109
127
  ---
110
128
 
111
129
  ### `eurostat_dataframe_describe` / `eurostat_dataframe_query`
112
130
 
113
- SQL over the results `eurostat_query_dataset` stages. **Listed only when the dataframe canvas is enabled** (`CANVAS_PROVIDER_TYPE=duckdb`); the server is fully functional without it, and clients never see tools they cannot call.
131
+ SQL over the results `eurostat_query_dataset` and `eurostat_download_dataset` stage. **Listed only when the dataframe canvas is enabled** (`CANVAS_PROVIDER_TYPE=duckdb`); the server is fully functional without it, and clients never see tools they cannot call.
114
132
 
115
133
  - `eurostat_dataframe_describe` lists the staged tables with row counts and column names and types — call it before writing SQL
116
134
  - `eurostat_dataframe_query` runs a single read-only `SELECT`. Statement chaining, non-`SELECT` verbs, and functions that read files or external data are rejected with a typed error
117
- - Staged columns are flat: each dimension contributes a code column named after the dimension (`geo`) and a label column beside it (`geo_label`), followed by `obs_value`, `obs_flag`, and `obs_flag_label`
135
+ - Staged columns are flat, and the two stagers write different dimension columns — call `eurostat_dataframe_describe` rather than assuming. `eurostat_query_dataset` gives each dimension a code column named after the dimension (`geo`) plus a label companion (`geo_label`); `eurostat_download_dataset` gives code columns only, since the bulk endpoint carries no labels, plus a `time` column. Both write the same five measure columns: `obs_value`, `obs_flag`, `obs_flag_label`, `conf_status`, `conf_status_label`
136
+ - Tables from the two stagers join on their dimension code columns and `time` — same names, same `VARCHAR` type, `obs_value` `DOUBLE` on both — and their measure columns carry the same codes for the same observation. JSON-stat has no `CONF_STATUS` field and folds the marker into the observation status as `|C`; `eurostat_query_dataset` splits it back out before staging, so a confidential cell reads `obs_flag = NULL` with `conf_status = 'C'` on either table
118
137
  - The DuckDB binding ships with the server, so `CANVAS_PROVIDER_TYPE=duckdb` is the only switch. The exception is the one-click `.mcpb` bundle, which strips platform-specific native bindings to stay portable — a bundle install cannot run the canvas, so reach for the npm, Docker, or from-source install for SQL analytics
119
138
 
120
139
  ## Resource
@@ -140,12 +159,13 @@ Eurostat-specific:
140
159
  - JSON-stat 2.0 stride-based decoder for the Statistics API response format
141
160
  - Async-response detection — Eurostat returns a warning object rather than an error for over-limit queries; the server intercepts it and returns an actionable error with filter guidance
142
161
  - NUTS hierarchy geo-level filtering across query and dimension-value tools
143
- - Status flag decoding (provisional, estimated, definition differs, etc.)
162
+ - Status decoding against both published codelists — the `OBS_FLAG` observation flag (provisional, estimated, definition differs) and the `CONF_STATUS` confidentiality marker, each in its own field. JSON-stat folds the two into one string and SDMX TSV into one cell; both are split on their separator, so a given observation reads the same whichever endpoint served it
144
163
  - Optional DuckDB dataframe canvas — a query matching more than the inline cap is streamed row by row into a SQL table, reaching the observations the cap drops without a second request to Eurostat
164
+ - SDMX 2.1 TSV bulk downloads with streaming gzip detection, a mid-transfer byte budget, wide-to-long expansion, and SOAP fault classification — the whole-dataset counterpart to the per-query path
145
165
 
146
166
  Agent-friendly output:
147
167
 
148
- - Discovery workflow: `eurostat_search_datasets` / `eurostat_browse_themes` → `eurostat_get_dataset_info` → `eurostat_get_dimension_values` → `eurostat_query_dataset`
168
+ - Discovery workflow: `eurostat_search_datasets` / `eurostat_browse_themes` → `eurostat_get_dataset_info` → `eurostat_get_dimension_values` → `eurostat_query_dataset` for a slice, or `eurostat_download_dataset` for the whole dataset
149
169
  - Invalid dimension codes in query filters silently return no data from Eurostat — the `eurostat_get_dimension_values` tool prevents this by letting agents verify codes first
150
170
  - Structured error contracts with typed reasons and recovery hints on all tools
151
171
 
@@ -267,7 +287,9 @@ All configuration is validated at startup via Zod schemas in `src/config/server-
267
287
  | `EUROSTAT_BASE_URL` | Eurostat API base URL | `https://ec.europa.eu/eurostat/api/dissemination` |
268
288
  | `EUROSTAT_REQUEST_TIMEOUT_MS` | HTTP request timeout in ms | `30000` |
269
289
  | `EUROSTAT_TOC_CACHE_TTL_MS` | Catalogue TOC cache lifetime in ms — the first search or browse call past this age refreshes it | `43200000` (12 hours) |
270
- | `CANVAS_PROVIDER_TYPE` | `duckdb` enables the dataframe canvas: lists the two dataframe tools and lets `eurostat_query_dataset` stage a match past its inline cap | `none` |
290
+ | `EUROSTAT_BULK_TIMEOUT_MS` | HTTP timeout for one `eurostat_download_dataset` transfer in ms — held separate because a bulk body streams for minutes | `120000` (2 minutes) |
291
+ | `EUROSTAT_BULK_MAX_BYTES` | Byte budget for one bulk download, counted on the decoded TSV and enforced while streaming | `52428800` (50 MiB) |
292
+ | `CANVAS_PROVIDER_TYPE` | `duckdb` enables the dataframe canvas: lists the two dataframe tools, lets `eurostat_query_dataset` stage a match past its inline cap, and lets `eurostat_download_dataset` retain a bulk download | `none` |
271
293
  | `CANVAS_TEMP_PATH` | Directory DuckDB writes canvas spill files to. Must be writable by the server process | `<os tmpdir>/mcp-canvas` |
272
294
  | `CANVAS_TTL_MS` | Sliding lifetime of a staged canvas in ms; every call against it extends the window | `86400000` (24 hours) |
273
295
  | `CANVAS_DEFAULT_ROW_LIMIT` | Max rows one `eurostat_dataframe_query` returns before reporting `truncated` | `10000` |
@@ -7,6 +7,8 @@ declare const ServerConfigSchema: z.ZodObject<{
7
7
  baseUrl: z.ZodDefault<z.ZodString>;
8
8
  requestTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
9
9
  tocCacheTtlMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
10
+ bulkTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
11
+ bulkMaxBytes: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
10
12
  }, z.core.$strip>;
11
13
  export declare function getServerConfig(): z.infer<typeof ServerConfigSchema>;
12
14
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;;;iBAoBtB,CAAC;AAIH,wBAAgB,eAAe,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAOpE"}
1
+ {"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;;;;;iBAoCtB,CAAC;AAIH,wBAAgB,eAAe,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CASpE"}
@@ -22,6 +22,18 @@ const ServerConfigSchema = z.object({
22
22
  .positive()
23
23
  .default(43_200_000)
24
24
  .describe('How long a fetched catalogue TOC stays usable before the next catalogue call refreshes it, in milliseconds. Defaults to 12 hours, matching the upstream twice-daily update cadence.'),
25
+ bulkTimeoutMs: z.coerce
26
+ .number()
27
+ .int()
28
+ .positive()
29
+ .default(120_000)
30
+ .describe('HTTP timeout for one SDMX bulk download, in milliseconds. Held separate from EUROSTAT_REQUEST_TIMEOUT_MS because a bulk body streams for minutes where a metadata call answers in seconds. Defaults to 2 minutes.'),
31
+ bulkMaxBytes: z.coerce
32
+ .number()
33
+ .int()
34
+ .positive()
35
+ .default(52_428_800)
36
+ .describe('Byte budget for one SDMX bulk download, measured on the decoded TSV rather than on the wire. Eurostat sends the body chunked with no Content-Length, so the budget is enforced while streaming and the transfer is aborted the moment it is reached. Defaults to 50 MiB.'),
25
37
  });
26
38
  let _config;
27
39
  export function getServerConfig() {
@@ -29,6 +41,8 @@ export function getServerConfig() {
29
41
  baseUrl: 'EUROSTAT_BASE_URL',
30
42
  requestTimeoutMs: 'EUROSTAT_REQUEST_TIMEOUT_MS',
31
43
  tocCacheTtlMs: 'EUROSTAT_TOC_CACHE_TTL_MS',
44
+ bulkTimeoutMs: 'EUROSTAT_BULK_TIMEOUT_MS',
45
+ bulkMaxBytes: 'EUROSTAT_BULK_MAX_BYTES',
32
46
  });
33
47
  return _config;
34
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,EAAE;SACL,OAAO,CAAC,iDAAiD,CAAC;SAC1D,QAAQ,CAAC,uBAAuB,CAAC;IACpC,gBAAgB,EAAE,CAAC,CAAC,MAAM;SACvB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,OAAO,CAAC,MAAM,CAAC;SACf,QAAQ,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mN,CACpN;IACH,YAAY,EAAE,CAAC,CAAC,MAAM;SACnB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,OAAO,CAAC,UAAU,CAAC;SACnB,QAAQ,CACP,0QAA0Q,CAC3Q;CACJ,CAAC,CAAC;AAEH,IAAI,OAAuD,CAAC;AAE5D,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,OAAO,EAAE,mBAAmB;QAC5B,gBAAgB,EAAE,6BAA6B;QAC/C,aAAa,EAAE,2BAA2B;QAC1C,aAAa,EAAE,0BAA0B;QACzC,YAAY,EAAE,yBAAyB;KACxC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/dist/index.js CHANGED
@@ -9,11 +9,13 @@ import { eurostatDatasetResource } from './mcp-server/resources/definitions/euro
9
9
  import { eurostatBrowseThemes } from './mcp-server/tools/definitions/eurostat-browse-themes.tool.js';
10
10
  import { eurostatDataframeDescribe } from './mcp-server/tools/definitions/eurostat-dataframe-describe.tool.js';
11
11
  import { eurostatDataframeQuery } from './mcp-server/tools/definitions/eurostat-dataframe-query.tool.js';
12
+ import { eurostatDownloadDataset } from './mcp-server/tools/definitions/eurostat-download-dataset.tool.js';
12
13
  import { eurostatGetDatasetInfo } from './mcp-server/tools/definitions/eurostat-get-dataset-info.tool.js';
13
14
  import { eurostatGetDimensionValues } from './mcp-server/tools/definitions/eurostat-get-dimension-values.tool.js';
14
15
  import { eurostatQueryDataset } from './mcp-server/tools/definitions/eurostat-query-dataset.tool.js';
15
16
  import { eurostatSearchDatasets } from './mcp-server/tools/definitions/eurostat-search-datasets.tool.js';
16
17
  import { setCanvas } from './services/canvas-accessor.js';
18
+ import { initEurostatBulkService } from './services/eurostat-bulk/eurostat-bulk-service.js';
17
19
  import { initEurostatCatalogueService } from './services/eurostat-catalogue/eurostat-catalogue-service.js';
18
20
  import { initEurostatDataService } from './services/eurostat-data/eurostat-data-service.js';
19
21
  /**
@@ -38,6 +40,7 @@ await createApp({
38
40
  eurostatGetDatasetInfo,
39
41
  eurostatGetDimensionValues,
40
42
  eurostatQueryDataset,
43
+ eurostatDownloadDataset,
41
44
  canvasEnabled ? eurostatDataframeDescribe : disabledTool(eurostatDataframeDescribe, CANVAS_OFF),
42
45
  canvasEnabled ? eurostatDataframeQuery : disabledTool(eurostatDataframeQuery, CANVAS_OFF),
43
46
  ],
@@ -46,11 +49,13 @@ await createApp({
46
49
  instructions: `Eurostat MCP server — EU statistical data across the Eurostat catalogue.
47
50
  Workflow: eurostat_search_datasets or eurostat_browse_themes to find a dataset code → eurostat_get_dataset_info to see dimensions → eurostat_get_dimension_values to list valid filter values → eurostat_query_dataset to fetch observations.
48
51
  Apply dimension filters to keep queries small: an unfiltered query on a large dataset is slow and can return an async response error instead of data.
49
- eurostat_query_dataset returns at most 5,000 observations inline. When the match is larger and this deployment runs a dataframe canvas, the whole match is also staged as a SQL table named in the response — read it with eurostat_dataframe_query (eurostat_dataframe_describe lists the table and column names). The dataframe tools are not listed when the canvas is off; there, narrowing the filters is what brings the rest of a capped match into reach.`,
52
+ Two paths past eurostat_query_dataset's 5,000-observation inline cap. For a slice of a dataset, keep using eurostat_query_dataset: when the match is larger than the cap and this deployment runs a dataframe canvas, the whole match is also staged as a SQL table named in the response. For a whole dataset, use eurostat_download_dataset, which reads the SDMX bulk endpoint instead — about half the bytes — and stages every observation the same way, bounded by a byte budget it reports back. Read either staged table with eurostat_dataframe_query (eurostat_dataframe_describe lists the table and column names); the two stage different column sets, since the bulk endpoint carries dimension codes with no labels.
53
+ The dataframe tools are not listed when the canvas is off. There, narrowing the filters is what brings a capped match into reach, and eurostat_download_dataset retains only its inline preview.`,
50
54
  landing: { requireAuth: false },
51
55
  setup(core) {
52
56
  initEurostatCatalogueService(core.config, core.storage);
53
57
  initEurostatDataService(core.config, core.storage);
58
+ initEurostatBulkService(core.config, core.storage);
54
59
  setCanvas(core.canvas);
55
60
  },
56
61
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orCode } from '@cyanheads/mcp-ts-core/errors';
7
7
  import { acquireCanvas, getCanvas } from '../../../services/canvas-accessor.js';
8
8
  export const eurostatDataframeDescribe = tool('eurostat_dataframe_describe', {
9
9
  title: 'Describe Eurostat Dataframes',
10
- description: 'List the tables staged on a Eurostat dataframe canvas, with their row counts and column names and types. Call this before eurostat_dataframe_query to learn the table and column names to write SQL against. The canvas_id comes from a eurostat_query_dataset response that reported a staged table. Every observation column is flat: each dimension contributes a code column named after the dimension (e.g. "geo") and a label column beside it (e.g. "geo_label"), alongside obs_value, obs_flag, and obs_flag_label.',
10
+ description: 'List the tables staged on a Eurostat dataframe canvas, with their row counts and column names and types. Call this before eurostat_dataframe_query to learn the table and column names to write SQL against. The canvas_id comes from a eurostat_query_dataset or eurostat_download_dataset response that reported a staged table. Every observation column is flat, but the two stagers write different dimension columns, so read the columns reported here rather than assuming: eurostat_query_dataset gives each dimension a code column named after the dimension (e.g. "geo") plus a label companion (e.g. "geo_label"); eurostat_download_dataset gives code columns only — the bulk endpoint carries no labels — plus a "time" column. Both write the same five measure columns — obs_value, obs_flag, obs_flag_label, conf_status, conf_status_label — carrying the same codes for the same observation, so tables from the two stagers join on dimension codes and time and compare like with like.',
11
11
  annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
12
12
  input: z.object({
13
13
  canvas_id: z
14
14
  .string()
15
15
  .min(1)
16
- .describe('Canvas identifier returned by eurostat_query_dataset as canvasId. Identifies the workspace holding the staged tables.'),
16
+ .describe('Canvas identifier returned as canvasId by eurostat_query_dataset or eurostat_download_dataset. Identifies the workspace holding the staged tables.'),
17
17
  }),
18
18
  output: z.object({
19
19
  canvasId: z.string().describe('Canvas identifier the tables were read from.'),
@@ -1 +1 @@
1
- {"version":3,"file":"eurostat-dataframe-describe.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAA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,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,KAAK,CAAC,SAAS,EAAE,CAAC;YAC3F,KAAK,CAAC,IAAI,CAAC,QAAQ,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;YACnD,KAAK,CAAC,IAAI,CAAC,aAAa,KAAK,CAAC,QAAQ,GAAG,MAAM,EAAE,CAAC,CAAC;YACnD,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;gBAChC,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,eAAe,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC;YAC1E,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"eurostat-dataframe-describe.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAEzE,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,6BAA6B,EAAE;IAC3E,KAAK,EAAE,8BAA8B;IACrC,WAAW,EACT,g9BAAg9B;IACl9B,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;IAC/E,KAAK,EAA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CAAC,OAAO,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,eAAe,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC;YAC1E,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -8,13 +8,13 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
8
8
  import { acquireCanvas, getCanvas } from '../../../services/canvas-accessor.js';
9
9
  export const eurostatDataframeQuery = tool('eurostat_dataframe_query', {
10
10
  title: 'Query Eurostat Dataframes',
11
- description: 'Run a read-only SQL SELECT against tables staged on a Eurostat dataframe canvas — the way to reach observations past the 5,000-row inline cap of eurostat_query_dataset, and to aggregate, group, or join across staged tables without re-fetching from Eurostat. Call eurostat_dataframe_describe first for the table and column names. Only a single SELECT statement runs: statement chaining, non-SELECT verbs, and functions that read files or external data are rejected. Columns are flat — each dimension appears as a code column named after the dimension plus a "_label" companion, with the measure in obs_value and the status flag in obs_flag / obs_flag_label.',
11
+ description: 'Run a read-only SQL SELECT against tables staged on a Eurostat dataframe canvas — the way to reach observations past the 5,000-row inline cap of eurostat_query_dataset and past the inline preview of a eurostat_download_dataset bulk download, and to aggregate, group, or join across staged tables without re-fetching from Eurostat. Call eurostat_dataframe_describe first for the table and column names, which differ between the two stagers. Only a single SELECT statement runs: statement chaining, non-SELECT verbs, and functions that read files or external data are rejected. Columns are flat — every dimension is a code column named after the dimension, the measure is obs_value, the observation flag is obs_flag / obs_flag_label and the confidentiality marker is conf_status / conf_status_label; a "_label" companion per dimension exists only on tables eurostat_query_dataset staged. Both stagers write the same five measure columns with the same codes, so join their tables on dimension codes and time and compare obs_flag or conf_status across them directly.',
12
12
  annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
13
13
  input: z.object({
14
14
  canvas_id: z
15
15
  .string()
16
16
  .min(1)
17
- .describe('Canvas identifier returned by eurostat_query_dataset as canvasId. Identifies the workspace holding the staged tables.'),
17
+ .describe('Canvas identifier returned as canvasId by eurostat_query_dataset or eurostat_download_dataset. Identifies the workspace holding the staged tables.'),
18
18
  sql: z
19
19
  .string()
20
20
  .min(1)
@@ -1 +1 @@
1
- {"version":3,"file":"eurostat-dataframe-query.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-dataframe-query.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAEzE,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,0BAA0B,EAAE;IACrE,KAAK,EAAE,2BAA2B;IAClC,WAAW,EACT,kpBAAkpB;IACppB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;IAC/E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,uHAAuH,CACxH;QACH,GAAG,EAAE,CAAC;aACH,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,kPAAkP,CACnP;KACJ,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;QACzE,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,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KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"eurostat-dataframe-query.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-dataframe-query.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAEzE,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,0BAA0B,EAAE;IACrE,KAAK,EAAE,2BAA2B;IAClC,WAAW,EACT,wiCAAwiC;IAC1iC,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;IAC/E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,oJAAoJ,CACrJ;QACH,GAAG,EAAE,CAAC;aACH,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,kPAAkP,CACnP;KACJ,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;QACzE,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,mCAAmC,CAAC;QAC1E,IAAI,EAAE,CAAC;aACJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;aACxC,QA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 2.1 TSV bulk endpoint and staging it on the dataframe canvas.
4
+ * @module mcp-server/tools/definitions/eurostat-download-dataset.tool
5
+ */
6
+ import { z } from '@cyanheads/mcp-ts-core';
7
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
8
+ export declare const eurostatDownloadDataset: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
9
+ dataset_code: z.ZodString;
10
+ filters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
11
+ since_period: z.ZodOptional<z.ZodString>;
12
+ until_period: z.ZodOptional<z.ZodString>;
13
+ preview_limit: z.ZodDefault<z.ZodNumber>;
14
+ canvas_id: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$strip>, z.ZodObject<{
16
+ datasetCode: z.ZodString;
17
+ dimensionsUsed: z.ZodArray<z.ZodString>;
18
+ rowCount: z.ZodNumber;
19
+ missingCount: z.ZodNumber;
20
+ periodRange: z.ZodObject<{
21
+ start: z.ZodOptional<z.ZodString>;
22
+ end: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strip>;
24
+ bytesRead: z.ZodNumber;
25
+ compressed: z.ZodBoolean;
26
+ budgetExceeded: z.ZodBoolean;
27
+ observations: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>>;
28
+ canvasId: z.ZodOptional<z.ZodString>;
29
+ tableName: z.ZodOptional<z.ZodString>;
30
+ stagedRowCount: z.ZodOptional<z.ZodNumber>;
31
+ }, z.core.$strip>, readonly [{
32
+ readonly reason: "not_found";
33
+ readonly code: JsonRpcErrorCode.NotFound;
34
+ readonly when: "The dataset code is not available for dissemination (HTTP 404, SDMX faultcode 100).";
35
+ readonly recovery: "Use eurostat_search_datasets or eurostat_browse_themes to find a valid dataset code.";
36
+ }, {
37
+ readonly reason: "invalid_dimension";
38
+ readonly code: JsonRpcErrorCode.ValidationError;
39
+ readonly when: "A filter names a dimension the dataset does not have, or a value or period range Eurostat rejects (SDMX faultcode 150).";
40
+ readonly recovery: "Check dimension codes with eurostat_get_dataset_info and their values with eurostat_get_dimension_values, and keep the period range inside the dataset coverage.";
41
+ }, {
42
+ readonly reason: "filter_arity";
43
+ readonly code: JsonRpcErrorCode.ValidationError;
44
+ readonly when: "Eurostat rejected the positional dimension key because it carried the wrong number of positions (SDMX faultcode 140), meaning the dataset structure has changed since the metadata call.";
45
+ readonly recovery: "Retry without filters to download the whole dataset, or re-read the dimensions with eurostat_get_dataset_info.";
46
+ }, {
47
+ readonly reason: "async_queued";
48
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
49
+ readonly when: "Eurostat answered HTTP 200 with a SOAP syncResponse queue ticket (status SUBMITTED) instead of data, because the extraction was too costly to serve synchronously.";
50
+ readonly retryable: false;
51
+ readonly recovery: "Add dimension filters or a period range so Eurostat serves the extraction inline; the queued result cannot be collected here.";
52
+ }, {
53
+ readonly reason: "no_results";
54
+ readonly code: JsonRpcErrorCode.NotFound;
55
+ readonly when: "The download completed but carried no populated observation cells.";
56
+ readonly recovery: "Verify the filter values with eurostat_get_dimension_values — a combination that exists in no cell returns an empty body.";
57
+ }, {
58
+ readonly reason: "upstream_fault";
59
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
60
+ readonly when: "The SDMX endpoint returned a fault this server does not model, or a body that is not a TSV table.";
61
+ readonly recovery: "Retry in a few minutes, or narrow the request with dimension filters.";
62
+ }, {
63
+ readonly reason: "canvas_not_found";
64
+ readonly code: JsonRpcErrorCode.NotFound;
65
+ readonly when: "A canvas_id was supplied for staging but is unknown or its lifetime has elapsed.";
66
+ readonly recovery: "Omit canvas_id so the download starts a fresh canvas and returns its canvasId.";
67
+ }], {
68
+ readonly appliedQuery: z.ZodObject<{
69
+ filters: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
70
+ sincePeriod: z.ZodOptional<z.ZodString>;
71
+ untilPeriod: z.ZodOptional<z.ZodString>;
72
+ url: z.ZodString;
73
+ }, z.core.$strip>;
74
+ readonly notice: z.ZodOptional<z.ZodString>;
75
+ }>;
76
+ /** Contract reasons the bulk service's classified failures map onto. */
77
+ type MappedReason = 'async_queued' | 'filter_arity' | 'invalid_dimension' | 'not_found' | 'upstream_fault';
78
+ /**
79
+ * Translate a service-layer failure into the tool's declared contract.
80
+ *
81
+ * The bulk service classifies SDMX faults into `data.reason` but throws generic
82
+ * factory errors, because a service has no access to a tool's reason union.
83
+ * This resolves the reason and the caller-facing recovery hint; the handler does
84
+ * the throwing, so `ctx.fail` stays typed against the union rather than taking a
85
+ * bare string.
86
+ */
87
+ export declare function mapBulkFailure(err: unknown, datasetCode: string): {
88
+ hint: string;
89
+ message: string;
90
+ reason: MappedReason;
91
+ } | undefined;
92
+ export {};
93
+ //# sourceMappingURL=eurostat-download-dataset.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eurostat-download-dataset.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/eurostat-download-dataset.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAiB,MAAM,+BAA+B,CAAC;AA6BhF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2WlC,CAAC;AAEH,wEAAwE;AACxE,KAAK,YAAY,GACb,cAAc,GACd,cAAc,GACd,mBAAmB,GACnB,WAAW,GACX,gBAAgB,CAAC;AAErB;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,MAAM,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GAAG,SAAS,CAqCrE"}