@cyanheads/eurostat-mcp-server 0.11.1 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +6 -4
- package/CLAUDE.md +6 -4
- package/README.md +20 -17
- package/changelog/0.11.x/0.11.2.md +27 -0
- package/changelog/0.11.x/0.11.3.md +45 -0
- package/changelog/template.md +10 -3
- package/dist/config/server-config.js +1 -1
- package/dist/config/server-config.js.map +1 -1
- package/dist/mcp-server/resources/definitions/eurostat-dataset.resource.d.ts +14 -1
- package/dist/mcp-server/resources/definitions/eurostat-dataset.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/eurostat-dataset.resource.js +17 -0
- package/dist/mcp-server/resources/definitions/eurostat-dataset.resource.js.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-describe.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-drop.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-drop.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-query.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-dataframe-query.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-download-dataset.tool.d.ts +26 -12
- package/dist/mcp-server/tools/definitions/eurostat-download-dataset.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-download-dataset.tool.js +181 -47
- package/dist/mcp-server/tools/definitions/eurostat-download-dataset.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.js +11 -2
- package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.d.ts +8 -6
- package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.js +149 -54
- package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.d.ts +22 -8
- package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.js +215 -43
- package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.d.ts +16 -6
- package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.js +67 -16
- package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.js.map +1 -1
- package/dist/mcp-server/tools/narrowing-advice.d.ts +64 -3
- package/dist/mcp-server/tools/narrowing-advice.d.ts.map +1 -1
- package/dist/mcp-server/tools/narrowing-advice.js +160 -4
- package/dist/mcp-server/tools/narrowing-advice.js.map +1 -1
- package/dist/mcp-server/tools/notice-text.d.ts +18 -0
- package/dist/mcp-server/tools/notice-text.d.ts.map +1 -0
- package/dist/mcp-server/tools/notice-text.js +40 -0
- package/dist/mcp-server/tools/notice-text.js.map +1 -0
- package/dist/mcp-server/tools/value-list-paging.d.ts +11 -1
- package/dist/mcp-server/tools/value-list-paging.d.ts.map +1 -1
- package/dist/mcp-server/tools/value-list-paging.js +13 -1
- package/dist/mcp-server/tools/value-list-paging.js.map +1 -1
- package/dist/services/eurostat-bulk/eurostat-bulk-service.d.ts +7 -5
- package/dist/services/eurostat-bulk/eurostat-bulk-service.d.ts.map +1 -1
- package/dist/services/eurostat-bulk/eurostat-bulk-service.js +145 -40
- package/dist/services/eurostat-bulk/eurostat-bulk-service.js.map +1 -1
- package/dist/services/eurostat-bulk/types.d.ts +44 -4
- package/dist/services/eurostat-bulk/types.d.ts.map +1 -1
- package/dist/services/eurostat-bulk/types.js.map +1 -1
- package/dist/services/eurostat-catalogue/dimension-value-index.d.ts +81 -0
- package/dist/services/eurostat-catalogue/dimension-value-index.d.ts.map +1 -0
- package/dist/services/eurostat-catalogue/dimension-value-index.js +410 -0
- package/dist/services/eurostat-catalogue/dimension-value-index.js.map +1 -0
- package/dist/services/eurostat-catalogue/eurostat-catalogue-service.d.ts +100 -14
- package/dist/services/eurostat-catalogue/eurostat-catalogue-service.d.ts.map +1 -1
- package/dist/services/eurostat-catalogue/eurostat-catalogue-service.js +359 -90
- package/dist/services/eurostat-catalogue/eurostat-catalogue-service.js.map +1 -1
- package/dist/services/eurostat-catalogue/search-text.d.ts +12 -0
- package/dist/services/eurostat-catalogue/search-text.d.ts.map +1 -0
- package/dist/services/eurostat-catalogue/search-text.js +31 -0
- package/dist/services/eurostat-catalogue/search-text.js.map +1 -0
- package/dist/services/eurostat-catalogue/types.d.ts +11 -0
- package/dist/services/eurostat-catalogue/types.d.ts.map +1 -1
- package/dist/services/eurostat-codelists.d.ts +2 -1
- package/dist/services/eurostat-codelists.d.ts.map +1 -1
- package/dist/services/eurostat-codelists.js +2 -1
- package/dist/services/eurostat-codelists.js.map +1 -1
- package/dist/services/eurostat-data/eurostat-data-service.d.ts +30 -2
- package/dist/services/eurostat-data/eurostat-data-service.d.ts.map +1 -1
- package/dist/services/eurostat-data/eurostat-data-service.js +209 -19
- package/dist/services/eurostat-data/eurostat-data-service.js.map +1 -1
- package/dist/services/eurostat-data/sdmx-metadata.d.ts.map +1 -1
- package/dist/services/eurostat-data/sdmx-metadata.js +4 -20
- package/dist/services/eurostat-data/sdmx-metadata.js.map +1 -1
- package/dist/services/eurostat-data/types.d.ts +108 -4
- package/dist/services/eurostat-data/types.d.ts.map +1 -1
- package/dist/services/eurostat-data/types.js.map +1 -1
- package/dist/services/eurostat-filters.d.ts +18 -6
- package/dist/services/eurostat-filters.d.ts.map +1 -1
- package/dist/services/eurostat-filters.js +24 -7
- package/dist/services/eurostat-filters.js.map +1 -1
- package/dist/services/eurostat-periods.d.ts +54 -1
- package/dist/services/eurostat-periods.d.ts.map +1 -1
- package/dist/services/eurostat-periods.js +101 -1
- package/dist/services/eurostat-periods.js.map +1 -1
- package/dist/services/xml-entities.d.ts +13 -0
- package/dist/services/xml-entities.d.ts.map +1 -0
- package/dist/services/xml-entities.js +31 -0
- package/dist/services/xml-entities.js.map +1 -0
- package/package.json +7 -7
- package/server.json +5 -5
- package/skills/eurostat-guide/SKILL.md +6 -5
- package/skills/eurostat-guide/references/sql-analysis.md +21 -5
|
@@ -1,14 +1,74 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Recovery wording
|
|
3
|
-
*
|
|
4
|
-
* Eurostat refused as too large
|
|
2
|
+
* @fileoverview Recovery wording shared by the two data tools: the best-effort reads
|
|
3
|
+
* behind a hint that names a dataset's own dimensions or values, the advice for a
|
|
4
|
+
* request Eurostat refused as too large, and the wording for a filter key or value that
|
|
5
|
+
* cannot match the dataset.
|
|
5
6
|
* @module mcp-server/tools/narrowing-advice
|
|
6
7
|
*/
|
|
7
8
|
import { getEurostatDataService } from '../../services/eurostat-data/eurostat-data-service.js';
|
|
9
|
+
import { isComextDataset } from '../../services/eurostat-hosts.js';
|
|
10
|
+
/**
|
|
11
|
+
* The opening of both data tools' `invalid_dimension` `when`. Each tool appends the
|
|
12
|
+
* further causes its own path raises.
|
|
13
|
+
*/
|
|
14
|
+
export const UNKNOWN_FILTER_KEY_WHEN = "A filter key is not a dimension of this dataset; the error names every such key and lists the dataset's dimensions in key order";
|
|
15
|
+
/** The hint for a filter key that names no dimension, shared by both data tools. */
|
|
16
|
+
export const RENAME_FILTER_KEYS_HINT = 'Rename each filter key the error names to one of the dimensions it lists.';
|
|
17
|
+
/**
|
|
18
|
+
* Advice for filter values holding ".", which no Eurostat code contains, as one hint:
|
|
19
|
+
* the opening sentence once, then one piece of advice per value. A Comext `DS-*`
|
|
20
|
+
* collection's classification codes are bare digits, so there a value of digits and dots
|
|
21
|
+
* is a code printed with separators and its stripped form is the code to send
|
|
22
|
+
* (`2204.21` → `220421`). Elsewhere stripping can yield a non-code (COICOP `01.1.1` is
|
|
23
|
+
* `CP0111`), so the advice is a value search on the stripped form instead. `literals`
|
|
24
|
+
* holds the values the hint quotes for the caller to send back.
|
|
25
|
+
*/
|
|
26
|
+
export function dottedValueAdvice(datasetCode, entries) {
|
|
27
|
+
const advise = ({ dimension, value }) => {
|
|
28
|
+
const stripped = value.replaceAll('.', '');
|
|
29
|
+
if (isComextDataset(datasetCode) && value.split('.').every((part) => /^\d+$/.test(part))) {
|
|
30
|
+
return {
|
|
31
|
+
joiner: '. ',
|
|
32
|
+
literals: [stripped, value, dimension],
|
|
33
|
+
text: `Write "${stripped}" for "${value}" in filters.${dimension}.`,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
if (stripped.trim() === '') {
|
|
37
|
+
return {
|
|
38
|
+
joiner: '. ',
|
|
39
|
+
literals: [dimension],
|
|
40
|
+
text: `List the codes of "${dimension}" with eurostat_get_dimension_values.`,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
joiner: ', and ',
|
|
45
|
+
literals: [value, stripped, dimension],
|
|
46
|
+
text: `"${value}" without its dots may not be a code of "${datasetCode}" either. Find the code with eurostat_get_dimension_values, dimension "${dimension}" and filter "${stripped}".`,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
const [head, ...tail] = entries;
|
|
50
|
+
const first = advise(head);
|
|
51
|
+
const rest = tail.map(advise);
|
|
52
|
+
return {
|
|
53
|
+
hint: `No Eurostat code contains "."${first.joiner}${first.text}${rest.map(({ text }) => ` ${text}`).join('')}`,
|
|
54
|
+
literals: [first, ...rest].flatMap(({ literals }) => literals),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* `geo=[DE, XX]; age=[ZZZ]`, each dimension code and value passed through `encode`.
|
|
59
|
+
* Authored Markdown (a notice, a `format()` line, the filters trailer) passes
|
|
60
|
+
* `escapeMarkdownInline`, so a caller's value renders as sent; an error message stays
|
|
61
|
+
* raw, as the framework escapes it.
|
|
62
|
+
*/
|
|
63
|
+
export function formatValues(values, encode = (text) => text) {
|
|
64
|
+
return Object.entries(values)
|
|
65
|
+
.map(([dim, codes]) => `${encode(dim)}=[${codes.map((code) => encode(code)).join(', ')}]`)
|
|
66
|
+
.join('; ');
|
|
67
|
+
}
|
|
8
68
|
/**
|
|
9
69
|
* Total allowance for the read behind a hint, every attempt and backoff included. It
|
|
10
70
|
* runs after the request it explains, which can have spent its own 30 s, and MCP SDK
|
|
11
|
-
* clients give up at 60 s.
|
|
71
|
+
* clients give up at 60 s.
|
|
12
72
|
*/
|
|
13
73
|
const HINT_READ_DEADLINE_MS = 5_000;
|
|
14
74
|
/**
|
|
@@ -35,6 +95,102 @@ export async function dimensionsToNarrow(datasetCode, known, ctx) {
|
|
|
35
95
|
return;
|
|
36
96
|
}
|
|
37
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* The dataset's metadata, for a recovery hint to name its dimension values, or
|
|
100
|
+
* `undefined` when it is not in hand within {@link HINT_READ_DEADLINE_MS}. The metadata
|
|
101
|
+
* load is shared and takes no deadline of its own (a cold Comext dataflow outlasts the
|
|
102
|
+
* allowance several times over), so the read races a timer instead; a load the timer
|
|
103
|
+
* beats keeps running and fills the cache, so a follow-up value lookup is served from
|
|
104
|
+
* it. A failed read degrades the hint the same way, and a cancelled call is rethrown.
|
|
105
|
+
*/
|
|
106
|
+
export async function dimensionValuesForHint(datasetCode, ctx) {
|
|
107
|
+
let timer;
|
|
108
|
+
const late = new Promise((resolve) => {
|
|
109
|
+
timer = setTimeout(() => resolve(undefined), HINT_READ_DEADLINE_MS);
|
|
110
|
+
});
|
|
111
|
+
try {
|
|
112
|
+
return await Promise.race([getEurostatDataService().getSdmxMetadata(datasetCode, ctx), late]);
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
if (ctx.signal.aborted)
|
|
116
|
+
throw error;
|
|
117
|
+
ctx.log.debug('Could not read dimension values for a recovery hint', {
|
|
118
|
+
datasetCode,
|
|
119
|
+
error: error instanceof Error ? error.message : String(error),
|
|
120
|
+
});
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
finally {
|
|
124
|
+
clearTimeout(timer);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Most values a hint lists for one dimension: eurostat_get_dimension_values' default
|
|
129
|
+
* page. A longer list is not cut to its first values, which in Eurostat's order say
|
|
130
|
+
* nothing about the value sent (a CN product list opens with confidential-trade totals).
|
|
131
|
+
*/
|
|
132
|
+
const VALUES_LISTED_MAX = 25;
|
|
133
|
+
/**
|
|
134
|
+
* What to send instead of each unmatched filter value, from the dataset's own value
|
|
135
|
+
* lists. A dimension with at most {@link VALUES_LISTED_MAX} values has every code and
|
|
136
|
+
* label listed; a longer one has its total and, per value sent, a value search for it,
|
|
137
|
+
* or {@link dottedValueAdvice} for a value holding ".". `totalCount` counts every value
|
|
138
|
+
* the dimension lists, every `geo` level included, where eurostat_get_dimension_values
|
|
139
|
+
* defaults `geo` to countries. A key the metadata lists no values for lands in
|
|
140
|
+
* `unresolved`, for the caller's generic sentence. `literals` holds the codes and values
|
|
141
|
+
* the sentences quote for sending back.
|
|
142
|
+
*/
|
|
143
|
+
export function unmatchedValuesAdvice(datasetCode, unmatched, { meta, valuesByDimension }) {
|
|
144
|
+
const sentences = [];
|
|
145
|
+
const literals = new Set();
|
|
146
|
+
const validValues = {};
|
|
147
|
+
const unresolved = [];
|
|
148
|
+
const dotted = [];
|
|
149
|
+
let dottedAt = -1;
|
|
150
|
+
for (const [key, sent] of Object.entries(unmatched)) {
|
|
151
|
+
const folded = key.toLowerCase();
|
|
152
|
+
const dimension = meta.dimensions.find(({ code }) => code === key) ??
|
|
153
|
+
meta.dimensions.find(({ code }) => code.toLowerCase() === folded);
|
|
154
|
+
const values = dimension && valuesByDimension[dimension.code];
|
|
155
|
+
if (!dimension || !values?.length) {
|
|
156
|
+
unresolved.push(key);
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
if (values.length <= VALUES_LISTED_MAX) {
|
|
160
|
+
validValues[key] = {
|
|
161
|
+
totalCount: values.length,
|
|
162
|
+
values: values.map(({ code, label }) => ({ code, label })),
|
|
163
|
+
};
|
|
164
|
+
const listed = values.map(({ code, label }) => `${code} (${label})`).join(', ');
|
|
165
|
+
sentences.push(`"${key}" has ${values.length === 1 ? '1 code' : `${values.length} codes`}: ${listed}.`);
|
|
166
|
+
for (const { code } of values)
|
|
167
|
+
literals.add(code);
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
validValues[key] = { totalCount: values.length };
|
|
171
|
+
sentences.push(`"${key}" has ${values.length.toLocaleString('en-US')} codes, too many to list here.`);
|
|
172
|
+
for (const value of sent) {
|
|
173
|
+
if (value.includes('.')) {
|
|
174
|
+
dotted.push({ dimension: key, value });
|
|
175
|
+
if (dotted.length === 1) {
|
|
176
|
+
dottedAt = sentences.length;
|
|
177
|
+
sentences.push('');
|
|
178
|
+
}
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
sentences.push(`Find the code for "${value}" with eurostat_get_dimension_values, dimension "${key}" and filter "${value}"${dimension.code === 'geo' ? ', adding geo_level for a code below country level' : ''}.`);
|
|
182
|
+
literals.add(value).add(key);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
const [firstDotted, ...otherDotted] = dotted;
|
|
186
|
+
if (firstDotted) {
|
|
187
|
+
const advice = dottedValueAdvice(datasetCode, [firstDotted, ...otherDotted]);
|
|
188
|
+
sentences[dottedAt] = advice.hint;
|
|
189
|
+
for (const literal of advice.literals)
|
|
190
|
+
literals.add(literal);
|
|
191
|
+
}
|
|
192
|
+
return { literals: [...literals], sentences, unresolved, validValues };
|
|
193
|
+
}
|
|
38
194
|
/**
|
|
39
195
|
* Tell the caller how to shrink a refused request, naming the dimensions of this
|
|
40
196
|
* dataset it left unfiltered. `dimensions` is the dataset's key dimensions, or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"narrowing-advice.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/narrowing-advice.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"narrowing-advice.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/narrowing-advice.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAG3F,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAClC,iIAAiI,CAAC;AAEpI,oFAAoF;AACpF,MAAM,CAAC,MAAM,uBAAuB,GAClC,2EAA2E,CAAC;AAK9E;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,WAAmB,EACnB,OAAwC;IAExC,MAAM,MAAM,GAAG,CAAC,EAAE,SAAS,EAAE,KAAK,EAAe,EAAE,EAAE;QACnD,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC3C,IAAI,eAAe,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YACzF,OAAO;gBACL,MAAM,EAAE,IAAI;gBACZ,Q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AE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;AACzE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,WAAmB,EACnB,UAAgC,EAChC,QAAkB;IAElB,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,8EAA8E,WAAW,oDAAoD,CAAC;IACvJ,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IACxF,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC;QACpB,CAAC,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAyB,WAAW,uEAAuE;QACzI,CAAC,CAAC,uBAAuB,WAAW,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,0GAA0G,CAAC;AAC9K,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Wording the two data tools' notices share: counts, period spans, and the
|
|
3
|
+
* listing of filter values that matched no data.
|
|
4
|
+
* @module mcp-server/tools/notice-text
|
|
5
|
+
*/
|
|
6
|
+
/** `1 period`, `3 periods`. */
|
|
7
|
+
export declare const countOf: (n: number, noun: string) => string;
|
|
8
|
+
/** `2026-08`, or `1975 – 1980` for several periods. */
|
|
9
|
+
export declare function spanOf(periods: string[]): string;
|
|
10
|
+
/**
|
|
11
|
+
* The filter values that matched no data: their total, and the first {@link VALUES_LISTED}
|
|
12
|
+
* as `geo=[DE, XX]; age=[ZZZ]` (escaped for Markdown) with a count of those left out.
|
|
13
|
+
*/
|
|
14
|
+
export declare function listEmptyValues(values: Record<string, string[]>): {
|
|
15
|
+
list: string;
|
|
16
|
+
total: number;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=notice-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notice-text.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/notice-text.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,+BAA+B;AAC/B,eAAO,MAAM,OAAO,MAAO,MAAM,QAAQ,MAAM,KAAG,MACW,CAAC;AAE9D,uDAAuD;AACvD,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAEhD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAejG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Wording the two data tools' notices share: counts, period spans, and the
|
|
3
|
+
* listing of filter values that matched no data.
|
|
4
|
+
* @module mcp-server/tools/notice-text
|
|
5
|
+
*/
|
|
6
|
+
import { escapeMarkdownInline } from '@cyanheads/mcp-ts-core/utils';
|
|
7
|
+
import { formatValues } from './narrowing-advice.js';
|
|
8
|
+
/**
|
|
9
|
+
* Filter values named in a notice; the structured `emptyValues` keeps every one. A
|
|
10
|
+
* `geo_level` query can have hundreds.
|
|
11
|
+
*/
|
|
12
|
+
const VALUES_LISTED = 24;
|
|
13
|
+
/** `1 period`, `3 periods`. */
|
|
14
|
+
export const countOf = (n, noun) => `${n.toLocaleString('en-US')} ${noun}${n === 1 ? '' : 's'}`;
|
|
15
|
+
/** `2026-08`, or `1975 – 1980` for several periods. */
|
|
16
|
+
export function spanOf(periods) {
|
|
17
|
+
return periods.length === 1 ? (periods[0] ?? '') : `${periods[0]} – ${periods.at(-1)}`;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The filter values that matched no data: their total, and the first {@link VALUES_LISTED}
|
|
21
|
+
* as `geo=[DE, XX]; age=[ZZZ]` (escaped for Markdown) with a count of those left out.
|
|
22
|
+
*/
|
|
23
|
+
export function listEmptyValues(values) {
|
|
24
|
+
const total = Object.values(values).reduce((n, codes) => n + codes.length, 0);
|
|
25
|
+
const listed = {};
|
|
26
|
+
let room = VALUES_LISTED;
|
|
27
|
+
for (const [key, codes] of Object.entries(values)) {
|
|
28
|
+
if (room === 0)
|
|
29
|
+
break;
|
|
30
|
+
const shown = codes.slice(0, room);
|
|
31
|
+
listed[key] = shown;
|
|
32
|
+
room -= shown.length;
|
|
33
|
+
}
|
|
34
|
+
const omitted = total - (VALUES_LISTED - room);
|
|
35
|
+
return {
|
|
36
|
+
list: `${formatValues(listed, escapeMarkdownInline)}${omitted ? ` (${omitted.toLocaleString('en-US')} more omitted; emptyValues lists all ${total.toLocaleString('en-US')})` : ''}`,
|
|
37
|
+
total,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=notice-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notice-text.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/notice-text.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;GAGG;AACH,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,+BAA+B;AAC/B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAS,EAAE,IAAY,EAAU,EAAE,CACzD,GAAG,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAA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ACJ,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Case- and accent-blind word filtering
|
|
2
|
+
* @fileoverview Case- and accent-blind word filtering, and case-blind code-prefix
|
|
3
|
+
* matching, for dimension code/label lists.
|
|
3
4
|
* @module mcp-server/tools/value-list-paging
|
|
4
5
|
*/
|
|
5
6
|
/** Lowercase, compatibility-decompose, and drop combining marks: "Zürich" → "zurich". */
|
|
@@ -18,4 +19,13 @@ export declare function matchValues<T extends {
|
|
|
18
19
|
code: string;
|
|
19
20
|
label: string;
|
|
20
21
|
}>(values: readonly T[], tokens: readonly string[]): T[];
|
|
22
|
+
/**
|
|
23
|
+
* A code prefix folded for comparison: trimmed and lowercased. Eurostat codes are
|
|
24
|
+
* uppercase ASCII letters, digits, `-` and `_`, so case is the only fold they need.
|
|
25
|
+
*/
|
|
26
|
+
export declare function foldCodePrefix(prefix: string): string;
|
|
27
|
+
/** The values whose code starts with a folded prefix, ignoring case, in the list's own order. */
|
|
28
|
+
export declare function matchCodePrefix<T extends {
|
|
29
|
+
code: string;
|
|
30
|
+
}>(values: readonly T[], foldedPrefix: string): T[];
|
|
21
31
|
//# sourceMappingURL=value-list-paging.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-list-paging.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/value-list-paging.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"value-list-paging.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/value-list-paging.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,yFAAyF;AACzF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAErD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACnE,MAAM,EAAE,SAAS,CAAC,EAAE,EACpB,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,CAAC,EAAE,CAKL;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,iGAAiG;AACjG,wBAAgB,eAAe,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EACxD,MAAM,EAAE,SAAS,CAAC,EAAE,EACpB,YAAY,EAAE,MAAM,GACnB,CAAC,EAAE,CAEL"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Case- and accent-blind word filtering
|
|
2
|
+
* @fileoverview Case- and accent-blind word filtering, and case-blind code-prefix
|
|
3
|
+
* matching, for dimension code/label lists.
|
|
3
4
|
* @module mcp-server/tools/value-list-paging
|
|
4
5
|
*/
|
|
5
6
|
/** Lowercase, compatibility-decompose, and drop combining marks: "Zürich" → "zurich". */
|
|
@@ -24,4 +25,15 @@ export function matchValues(values, tokens) {
|
|
|
24
25
|
return tokens.every((token) => haystack.includes(token));
|
|
25
26
|
});
|
|
26
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* A code prefix folded for comparison: trimmed and lowercased. Eurostat codes are
|
|
30
|
+
* uppercase ASCII letters, digits, `-` and `_`, so case is the only fold they need.
|
|
31
|
+
*/
|
|
32
|
+
export function foldCodePrefix(prefix) {
|
|
33
|
+
return prefix.trim().toLowerCase();
|
|
34
|
+
}
|
|
35
|
+
/** The values whose code starts with a folded prefix, ignoring case, in the list's own order. */
|
|
36
|
+
export function matchCodePrefix(values, foldedPrefix) {
|
|
37
|
+
return values.filter(({ code }) => code.toLowerCase().startsWith(foldedPrefix));
|
|
38
|
+
}
|
|
27
39
|
//# sourceMappingURL=value-list-paging.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-list-paging.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/value-list-paging.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"value-list-paging.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/value-list-paging.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,yFAAyF;AACzF,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AACrE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACzE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,MAAoB,EACpB,MAAyB;IAEzB,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QAC7B,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;QAC9D,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACrC,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,eAAe,CAC7B,MAAoB,EACpB,YAAoB;IAEpB,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* dissemination endpoint. Builds the positional dimension key, sniffs gzip off
|
|
4
4
|
* the stream, enforces a byte budget mid-transfer, classifies XML SOAP faults
|
|
5
5
|
* and the asynchronous queue envelope, and expands the wide TSV layout into
|
|
6
|
-
* one row per
|
|
6
|
+
* one row per non-blank cell.
|
|
7
7
|
* @module services/eurostat-bulk/eurostat-bulk-service
|
|
8
8
|
*/
|
|
9
9
|
import type { Context } from '@cyanheads/mcp-ts-core';
|
|
@@ -29,9 +29,10 @@ export declare function classifyXmlBody(xml: string, datasetCode: string): never
|
|
|
29
29
|
* The grammar, read off live responses, is `<value>` `SPACE` `<flags>`, where
|
|
30
30
|
* flags is `<obs_flag>` optionally followed by `@<conf_status>` and either part
|
|
31
31
|
* may be empty: `429634.3 `, `3853937.0 p`, `: `, `: @C`. A cell that is empty
|
|
32
|
-
* on both sides of the split
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* on both sides of the split yields `undefined` — distinct from `: `, an unflagged
|
|
33
|
+
* `:` that comes back with every field null: a period the series has no cell in, where
|
|
34
|
+
* the Statistics API has none either. A flagged `:` (`: u`, `: @C`) is an observation
|
|
35
|
+
* Eurostat publishes without a value.
|
|
35
36
|
*
|
|
36
37
|
* A value that is not a number is read by {@link decodeTextValue}: PRODCOM's flag
|
|
37
38
|
* and unit indicators publish `:C` (confidential, no space before the `C`) and `KG`
|
|
@@ -63,7 +64,8 @@ export declare function parseHeader(line: string): TsvHeader;
|
|
|
63
64
|
*
|
|
64
65
|
* A filter key names its dimension in any case (`GEO` places the same as `geo`),
|
|
65
66
|
* as the Statistics API reads it; keys that differ only in case pool their values.
|
|
66
|
-
* A blank value is unset rather than an empty member of the `+` list
|
|
67
|
+
* A blank value is unset rather than an empty member of the `+` list, and a value
|
|
68
|
+
* holding `+` arrives here already split into its codes.
|
|
67
69
|
*
|
|
68
70
|
* Returns `undefined` when no filter applies. An all-wildcard key is accepted
|
|
69
71
|
* by Eurostat, but omitting the segment asks the same question without staking
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eurostat-bulk-service.d.ts","sourceRoot":"","sources":["../../../src/services/eurostat-bulk/eurostat-bulk-service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAS/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"eurostat-bulk-service.d.ts","sourceRoot":"","sources":["../../../src/services/eurostat-bulk/eurostat-bulk-service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAS/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AA+BrE,OAAO,EACL,KAAK,YAAY,EAIjB,KAAK,SAAS,EACf,MAAM,YAAY,CAAC;AAmCpB;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,KAAK,CAqEvE;AAuBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,GACX;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAA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