@cyanheads/geonames-mcp-server 0.1.1 → 0.1.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 +13 -12
- package/CLAUDE.md +13 -12
- package/Dockerfile +16 -7
- package/README.md +75 -43
- package/changelog/0.1.x/0.1.2.md +26 -0
- package/changelog/0.1.x/0.1.3.md +45 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/find-postal-codes.tool.d.ts +13 -4
- package/dist/mcp-server/tools/definitions/find-postal-codes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/find-postal-codes.tool.js +87 -38
- package/dist/mcp-server/tools/definitions/find-postal-codes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-children.tool.d.ts +6 -4
- package/dist/mcp-server/tools/definitions/get-children.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-children.tool.js +65 -20
- package/dist/mcp-server/tools/definitions/get-children.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-countries.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-countries.tool.js +21 -13
- package/dist/mcp-server/tools/definitions/get-countries.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-hierarchy.tool.js +3 -3
- package/dist/mcp-server/tools/definitions/get-hierarchy.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-place.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-place.tool.js +18 -9
- package/dist/mcp-server/tools/definitions/get-place.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +41 -4
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/list-reference.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/list-reference.tool.js +22 -12
- package/dist/mcp-server/tools/definitions/list-reference.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/reverse-geocode.tool.d.ts +8 -0
- package/dist/mcp-server/tools/definitions/reverse-geocode.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/reverse-geocode.tool.js +93 -39
- package/dist/mcp-server/tools/definitions/reverse-geocode.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-places.tool.d.ts +23 -1
- package/dist/mcp-server/tools/definitions/search-places.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-places.tool.js +143 -25
- package/dist/mcp-server/tools/definitions/search-places.tool.js.map +1 -1
- package/dist/mcp-server/tools/shared-inputs.d.ts +93 -12
- package/dist/mcp-server/tools/shared-inputs.d.ts.map +1 -1
- package/dist/mcp-server/tools/shared-inputs.js +164 -21
- package/dist/mcp-server/tools/shared-inputs.js.map +1 -1
- package/dist/services/geonames/country-codes.d.ts +32 -0
- package/dist/services/geonames/country-codes.d.ts.map +1 -0
- package/dist/services/geonames/country-codes.js +298 -0
- package/dist/services/geonames/country-codes.js.map +1 -0
- package/dist/services/geonames/geonames-service.d.ts +14 -5
- package/dist/services/geonames/geonames-service.d.ts.map +1 -1
- package/dist/services/geonames/geonames-service.js +98 -42
- package/dist/services/geonames/geonames-service.js.map +1 -1
- package/dist/services/geonames/response-parsers.d.ts +12 -4
- package/dist/services/geonames/response-parsers.d.ts.map +1 -1
- package/dist/services/geonames/response-parsers.js +122 -23
- package/dist/services/geonames/response-parsers.js.map +1 -1
- package/dist/services/geonames/types.d.ts +37 -12
- package/dist/services/geonames/types.d.ts.map +1 -1
- package/dist/services/geonames/types.js +4 -3
- package/dist/services/geonames/types.js.map +1 -1
- package/dist/utils/inline-text.d.ts +52 -12
- package/dist/utils/inline-text.d.ts.map +1 -1
- package/dist/utils/inline-text.js +129 -14
- package/dist/utils/inline-text.js.map +1 -1
- package/package.json +12 -12
- package/server.json +16 -24
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview geonames_search_places — searches the GeoNames gazetteer by name and
|
|
3
|
-
* filters (country, feature class or code, population tier, bounding box) through
|
|
3
|
+
* filters (country, admin code, feature class or code, population tier, bounding box) through
|
|
4
4
|
* `searchJSON`, one credit a call, cached for an hour.
|
|
5
5
|
* @module mcp-server/tools/definitions/search-places.tool
|
|
6
6
|
*/
|
|
7
7
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
8
8
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
9
|
-
import { blankAsUnset, citiesInput, countriesInput, featureClassesInput, featureCodesInput, geonamesUsernameInput, isBlank,
|
|
9
|
+
import { blankAsUnset, citiesInput, clampedLimitInput, clampLimit, countriesInput, featureClassesInput, featureCodesInput, featureFilterMismatch, geonamesUsernameInput, isBlank, lowerCased, offsetInput, USERNAME_ALIASES, unknownCountryCodes, unlistedCountriesFragment, } from '../shared-inputs.js';
|
|
10
10
|
import { getFeatureCode } from '../../../services/geonames/feature-codes.js';
|
|
11
11
|
import { getGeoNamesService } from '../../../services/geonames/geonames-service.js';
|
|
12
|
-
import { inlineText, tableCell } from '../../../utils/inline-text.js';
|
|
12
|
+
import { inlineText, renderNotice, tableCell } from '../../../utils/inline-text.js';
|
|
13
13
|
const MATCHES = ['name_required', 'any_field', 'exact_name', 'name_prefix'];
|
|
14
14
|
/** GeoNames' free service pages no further than `startRow=5000` (status 25 beyond). */
|
|
15
15
|
const MAX_OFFSET = 5000;
|
|
16
|
+
/** Most places a call returns. GeoNames allows `maxRows=1000`; 100 keeps a page near 45 KB. */
|
|
17
|
+
const MAX_LIMIT = 100;
|
|
16
18
|
/** The search row as this tool returns it: the gazetteer fields minus nearby and country-id extras. */
|
|
17
19
|
const toPlace = ({ countryGeonameId: _countryId, distanceInKm: _distance, ...place }) => place;
|
|
18
20
|
const orNotAvailable = (value) => value === undefined ? 'Not available' : tableCell(value);
|
|
21
|
+
/** feature_filter_mismatch recovery, one sentence per restriction; a throw carries those its call breaks. */
|
|
22
|
+
const MISMATCH_RECOVERY = {
|
|
23
|
+
lists: 'Call geonames_search_places again with featureCodes alone (each code implies its class) or featureClasses alone; for a whole class plus codes of another class, make one call per class.',
|
|
24
|
+
cities: 'cities keeps only class P: beside it, list only P or class-P codes such as PPLC, or drop cities.',
|
|
25
|
+
};
|
|
19
26
|
/**
|
|
20
27
|
* A boundingBox bound. A blank or missing bound fails with a message that says so and
|
|
21
28
|
* names both ways out, instead of the bare number-type error.
|
|
@@ -25,14 +32,50 @@ const bound = () => z.number({
|
|
|
25
32
|
? `${input === undefined ? 'Missing' : 'Blank'} bound: give all four bounds as numbers, or omit boundingBox to search without a box`
|
|
26
33
|
: undefined,
|
|
27
34
|
});
|
|
35
|
+
/**
|
|
36
|
+
* An admin code as GeoNames writes it, 1 to 20 letters or digits. It is trimmed and its
|
|
37
|
+
* ASCII letters upper-cased before the pattern runs, otherwise kept verbatim, since zero
|
|
38
|
+
* padding is significant (`02` is Bavaria, `2` matches nothing). The advertised pattern
|
|
39
|
+
* admits the whitespace and lower case that normalization removes, so a validating client
|
|
40
|
+
* sends every form the tool accepts; only ASCII is upper-cased, so a letter whose upper
|
|
41
|
+
* case is ASCII (`ſ`) stays refused, as the pattern refuses it.
|
|
42
|
+
*/
|
|
43
|
+
const adminCodeInput = (description) => blankAsUnset(z.preprocess((value) => typeof value === 'string'
|
|
44
|
+
? value.replace(/[a-z]+/g, (letters) => letters.toUpperCase())
|
|
45
|
+
: value, z
|
|
46
|
+
.string()
|
|
47
|
+
.regex(/^\s*[A-Za-z0-9]{1,20}\s*$/)
|
|
48
|
+
.optional())).describe(description);
|
|
49
|
+
const LIST = new Intl.ListFormat('en', { type: 'conjunction' });
|
|
50
|
+
/** The admin_code_unscoped message: the codes given, what they lack, and why it matters. */
|
|
51
|
+
function unscopedMessage(codes, missing, countries) {
|
|
52
|
+
const needsCountry = missing.includes('countries');
|
|
53
|
+
const needs = [
|
|
54
|
+
missing.includes('adminCode1') && 'adminCode1',
|
|
55
|
+
needsCountry && 'exactly one country in countries',
|
|
56
|
+
].filter(Boolean);
|
|
57
|
+
const why = missing.length === 2
|
|
58
|
+
? 'admin codes repeat across countries and lower-level codes across first-level divisions'
|
|
59
|
+
: needsCountry
|
|
60
|
+
? 'admin codes repeat across countries'
|
|
61
|
+
: 'lower-level codes repeat across first-level divisions';
|
|
62
|
+
const has = needsCountry
|
|
63
|
+
? `; countries has ${countries.length === 0 ? 'none' : countries.join(', ')}`
|
|
64
|
+
: '';
|
|
65
|
+
return `${LIST.format(codes)} ${codes.length === 1 ? 'needs' : 'need'} ${needs.join(' and ')}, since ${why}${has}.`;
|
|
66
|
+
}
|
|
28
67
|
export const searchPlacesTool = tool('geonames_search_places', {
|
|
29
68
|
title: 'Search GeoNames places',
|
|
30
|
-
description: 'Search the GeoNames gazetteer of 13M+ places by name and filters: country, feature class (P populated places, A admin divisions, T mountains and terrain, H water, S buildings and spots), feature code (PPLC capitals, ADM1 states, MT mountains, AIRP airports), population tier, and bounding box. Results carry the geonameId that geonames_get_place, geonames_get_hierarchy, and geonames_get_children take. The default match requires a query term in the place name while letting other terms match the country or admin names ("Berlin, Germany"). Costs 1 GeoNames credit per call.',
|
|
69
|
+
description: 'Search the GeoNames gazetteer of 13M+ places by name and filters: country, admin division by its GeoNames code (adminCode1 TX with countries US for Texas), feature class (P populated places, A admin divisions, T mountains and terrain, H water, S buildings and spots), feature code (PPLC capitals, ADM1 states, MT mountains, AIRP airports), population tier, and bounding box. Results carry the geonameId that geonames_get_place, geonames_get_hierarchy, and geonames_get_children take. The default match requires a query term in the place name while letting other terms match the country or admin names ("Berlin, Germany"). Costs 1 GeoNames credit per call.',
|
|
31
70
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
32
71
|
input: z.object({
|
|
33
72
|
query: blankAsUnset(z.string().max(200).optional()).describe('Place name to search for, such as Springfield or "Berlin, Germany", up to 200 characters. match sets how it is compared. Omit it to search by filters alone, which then needs at least one of countries, featureClasses, featureCodes, or boundingBox (cities alone is not enough).'),
|
|
34
|
-
match: blankAsUnset(lowerCased(z.enum(MATCHES).optional())).describe('How query is matched. name_required (the default) needs at least one query term in the place name while other terms may match the country or admin names; any_field lets every term match any of those fields; exact_name matches the whole name exactly, alternate and historical names included; name_prefix matches names that start with query. Needs query.
|
|
73
|
+
match: blankAsUnset(lowerCased(z.enum(MATCHES).optional())).describe('How query is matched. name_required (the default) needs at least one query term in the place name while other terms may match the country or admin names; any_field lets every term match any of those fields; exact_name matches the whole name exactly, alternate and historical names included; name_prefix matches names that start with query. Needs query.'),
|
|
35
74
|
countries: countriesInput,
|
|
75
|
+
adminCode1: adminCodeInput('First-level admin division (state, province, region) to search inside, by its GeoNames admin code: TX is Texas in US. Take it from geonames_get_place or geonames_reverse_geocode (adminLevels[].code at level 1), or from adminCode1 on rows of geonames_search_places, geonames_get_hierarchy, and geonames_get_children. GeoNames codes are neither ISO 3166-2 nor postal admin codes: Bavaria is 02, not BY. Needs exactly one country in countries. 1 to 20 letters or digits, zero padding kept (02, not 2). Case-insensitive.'),
|
|
76
|
+
adminCode2: adminCodeInput('Second-level admin division (a US county, a French département) to search inside, by its GeoNames admin code: 033 is King County in WA. Take it from geonames_get_place or geonames_reverse_geocode (adminLevels[].code at level 2). Needs adminCode1 and exactly one country in countries. 1 to 20 letters or digits, zero padding kept (033, not 33). Case-insensitive.'),
|
|
77
|
+
adminCode3: adminCodeInput('Third-level admin division to search inside, by its GeoNames admin code: 09162 is Munich in DE. Take it from geonames_get_place or geonames_reverse_geocode (adminLevels[].code at level 3). Needs adminCode1 and exactly one country in countries. 1 to 20 letters or digits, zero padding kept. Case-insensitive.'),
|
|
78
|
+
adminCode4: adminCodeInput('Fourth-level admin division to search inside, by its GeoNames admin code: 92012 is Boulogne-Billancourt in FR. Take it from geonames_get_place or geonames_reverse_geocode (adminLevels[].code at level 4). Needs adminCode1 and exactly one country in countries. 1 to 20 letters or digits, zero padding kept. Case-insensitive.'),
|
|
36
79
|
featureClasses: featureClassesInput,
|
|
37
80
|
featureCodes: featureCodesInput,
|
|
38
81
|
cities: citiesInput,
|
|
@@ -57,8 +100,8 @@ export const searchPlacesTool = tool('geonames_search_places', {
|
|
|
57
100
|
})
|
|
58
101
|
.strict()
|
|
59
102
|
.optional()).describe('Keep only places inside this box. The box cannot cross the 180° meridian: split such an area into two searches.'),
|
|
60
|
-
orderBy: blankAsUnset(lowerCased(z.enum(['relevance', 'population']).optional())).describe("Result order: relevance
|
|
61
|
-
limit:
|
|
103
|
+
orderBy: blankAsUnset(lowerCased(z.enum(['relevance', 'population']).optional())).describe("Result order: relevance or population, largest first. Omit it for GeoNames' own order, which matches relevance except with match name_prefix."),
|
|
104
|
+
limit: clampedLimitInput(MAX_LIMIT, 10),
|
|
62
105
|
offset: offsetInput(MAX_OFFSET),
|
|
63
106
|
geonamesUsername: geonamesUsernameInput,
|
|
64
107
|
}),
|
|
@@ -128,8 +171,15 @@ export const searchPlacesTool = tool('geonames_search_places', {
|
|
|
128
171
|
.describe('The match mode, query, and filters as the server sent them to GeoNames.'),
|
|
129
172
|
truncated: z.boolean().describe('True when more matching places remain past this page.'),
|
|
130
173
|
shown: z.number().describe('Places returned on this page.'),
|
|
131
|
-
cap: z.number().describe('The limit
|
|
132
|
-
notice: z
|
|
174
|
+
cap: z.number().describe('The limit applied: limit as given, or 100 when it asked for more.'),
|
|
175
|
+
notice: z
|
|
176
|
+
.string()
|
|
177
|
+
.optional()
|
|
178
|
+
.describe('Guidance: why nothing matched, or how to reach the next page (naming a limit held to 100), and which places on the page lie in countries that countries does not list.'),
|
|
179
|
+
},
|
|
180
|
+
enrichmentTrailer: {
|
|
181
|
+
effectiveQuery: { render: (value) => `**effectiveQuery:** ${inlineText(value)}` },
|
|
182
|
+
notice: { render: renderNotice },
|
|
133
183
|
},
|
|
134
184
|
errors: [
|
|
135
185
|
{
|
|
@@ -146,6 +196,13 @@ export const searchPlacesTool = tool('geonames_search_places', {
|
|
|
146
196
|
recovery: 'Call geonames_search_places again with query text for the chosen match mode, or drop match to search by filters alone.',
|
|
147
197
|
severity: 'notice',
|
|
148
198
|
},
|
|
199
|
+
{
|
|
200
|
+
reason: 'unknown_country_code',
|
|
201
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
202
|
+
when: 'A countries entry, once mapped to alpha-2, is none of the 250 country codes or the retired AN, CS, and YU: an alpha-2 such as EL or EU, or an unassigned alpha-3 or numeric code.',
|
|
203
|
+
recovery: 'Find the country with geonames_get_countries (nameContains matches its name), then call again with its alpha-2, alpha-3, or numeric code.',
|
|
204
|
+
severity: 'notice',
|
|
205
|
+
},
|
|
149
206
|
{
|
|
150
207
|
reason: 'unknown_feature_code',
|
|
151
208
|
code: JsonRpcErrorCode.ValidationError,
|
|
@@ -153,6 +210,20 @@ export const searchPlacesTool = tool('geonames_search_places', {
|
|
|
153
210
|
recovery: 'Look up valid codes with geonames_list_reference topic feature_codes, then retry with a listed code.',
|
|
154
211
|
severity: 'notice',
|
|
155
212
|
},
|
|
213
|
+
{
|
|
214
|
+
reason: 'admin_code_unscoped',
|
|
215
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
216
|
+
when: 'An admin code is set without exactly one country in countries, or adminCode2 to adminCode4 without adminCode1: codes repeat across countries, and lower-level codes across first-level divisions.',
|
|
217
|
+
recovery: 'Call geonames_search_places again with exactly one country in countries and, beside adminCode2 to adminCode4, the adminCode1 they belong to; geonames_get_place lists the codes of every level in adminLevels.',
|
|
218
|
+
severity: 'notice',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
reason: 'feature_filter_mismatch',
|
|
222
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
223
|
+
when: "featureClasses and featureCodes are both set and a code's class is not listed or a listed class has no listed code, or cities (class P only) is set beside another class or a code outside class P. GeoNames intersects the filters, so those entries match nothing.",
|
|
224
|
+
recovery: `${MISMATCH_RECOVERY.lists} ${MISMATCH_RECOVERY.cities}`,
|
|
225
|
+
severity: 'notice',
|
|
226
|
+
},
|
|
156
227
|
{
|
|
157
228
|
reason: 'invalid_bounding_box',
|
|
158
229
|
code: JsonRpcErrorCode.ValidationError,
|
|
@@ -202,10 +273,15 @@ export const searchPlacesTool = tool('geonames_search_places', {
|
|
|
202
273
|
],
|
|
203
274
|
async handler(input, ctx) {
|
|
204
275
|
const { query, countries, featureClasses, featureCodes, cities, boundingBox, orderBy } = input;
|
|
276
|
+
const { adminCode1, adminCode2, adminCode3, adminCode4 } = input;
|
|
205
277
|
const match = query === undefined ? undefined : (input.match ?? 'name_required');
|
|
278
|
+
/** The admin codes given, first level first, each as `adminCodeN CODE`. */
|
|
279
|
+
const adminCodes = Object.entries({ adminCode1, adminCode2, adminCode3, adminCode4 }).flatMap(([name, code]) => (code === undefined ? [] : [`${name} ${code}`]));
|
|
280
|
+
const limit = clampLimit(input.limit, MAX_LIMIT);
|
|
206
281
|
const effectiveQuery = [
|
|
207
|
-
query === undefined ? undefined : `${match} "${
|
|
282
|
+
query === undefined ? undefined : `${match} "${query}"`,
|
|
208
283
|
countries && `countries ${countries.join(',')}`,
|
|
284
|
+
...adminCodes,
|
|
209
285
|
featureClasses && `featureClasses ${featureClasses.join(',')}`,
|
|
210
286
|
featureCodes && `featureCodes ${featureCodes.join(',')}`,
|
|
211
287
|
cities && `cities ${cities}`,
|
|
@@ -215,7 +291,7 @@ export const searchPlacesTool = tool('geonames_search_places', {
|
|
|
215
291
|
]
|
|
216
292
|
.filter(Boolean)
|
|
217
293
|
.join(' · ');
|
|
218
|
-
ctx.enrich({ totalCount: 0, truncated: false, shown: 0, cap:
|
|
294
|
+
ctx.enrich({ totalCount: 0, truncated: false, shown: 0, cap: limit.applied, effectiveQuery });
|
|
219
295
|
if (input.match !== undefined && query === undefined) {
|
|
220
296
|
throw ctx.fail('query_required', `match ${input.match} needs query text to match.`);
|
|
221
297
|
}
|
|
@@ -224,23 +300,57 @@ export const searchPlacesTool = tool('geonames_search_places', {
|
|
|
224
300
|
featureClasses === undefined &&
|
|
225
301
|
featureCodes === undefined &&
|
|
226
302
|
boundingBox === undefined) {
|
|
227
|
-
throw ctx.fail('query_or_filter_required', `geonames_search_places needs query or a narrowing filter (countries, featureClasses, featureCodes, boundingBox)${cities === undefined ? '' : '; cities alone does not narrow enough'}.`);
|
|
303
|
+
throw ctx.fail('query_or_filter_required', `geonames_search_places needs query or a narrowing filter (countries, featureClasses, featureCodes, boundingBox)${cities === undefined ? '' : '; cities alone does not narrow enough'}${adminCodes.length === 0 ? '' : '; admin codes also need exactly one country in countries'}.`);
|
|
304
|
+
}
|
|
305
|
+
const unknownCountries = unknownCountryCodes(countries);
|
|
306
|
+
if (unknownCountries !== undefined) {
|
|
307
|
+
const { message, ...offending } = unknownCountries;
|
|
308
|
+
throw ctx.fail('unknown_country_code', message, offending);
|
|
228
309
|
}
|
|
229
310
|
const unknownCodes = featureCodes?.filter((code) => getFeatureCode(code) === undefined) ?? [];
|
|
230
311
|
if (unknownCodes.length > 0) {
|
|
231
312
|
throw ctx.fail('unknown_feature_code', `Not a GeoNames feature code: ${unknownCodes.join(', ')}.`, { featureCodes: unknownCodes });
|
|
232
313
|
}
|
|
314
|
+
if (adminCodes.length > 0) {
|
|
315
|
+
const scope = [...new Set(countries)];
|
|
316
|
+
const missing = [
|
|
317
|
+
adminCode1 === undefined && 'adminCode1',
|
|
318
|
+
scope.length !== 1 && 'countries',
|
|
319
|
+
].filter((gap) => gap !== false);
|
|
320
|
+
if (missing.length > 0) {
|
|
321
|
+
throw ctx.fail('admin_code_unscoped', unscopedMessage(adminCodes, missing, scope), {
|
|
322
|
+
missing,
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
const mismatch = featureFilterMismatch({ featureClasses, featureCodes, cities });
|
|
327
|
+
if (mismatch !== undefined) {
|
|
328
|
+
const { message, ...offending } = mismatch;
|
|
329
|
+
const listsDisagree = cities === undefined ||
|
|
330
|
+
featureFilterMismatch({ featureClasses, featureCodes }) !== undefined;
|
|
331
|
+
const hint = [
|
|
332
|
+
listsDisagree && MISMATCH_RECOVERY.lists,
|
|
333
|
+
cities !== undefined && MISMATCH_RECOVERY.cities,
|
|
334
|
+
]
|
|
335
|
+
.filter(Boolean)
|
|
336
|
+
.join(' ');
|
|
337
|
+
throw ctx.fail('feature_filter_mismatch', message, { ...offending, recovery: { hint } });
|
|
338
|
+
}
|
|
233
339
|
if (boundingBox !== undefined &&
|
|
234
340
|
(boundingBox.south >= boundingBox.north || boundingBox.west >= boundingBox.east)) {
|
|
235
341
|
throw ctx.fail('invalid_bounding_box', `boundingBox needs south below north and west below east; got north ${boundingBox.north}, south ${boundingBox.south}, east ${boundingBox.east}, west ${boundingBox.west}.`);
|
|
236
342
|
}
|
|
237
343
|
const service = getGeoNamesService();
|
|
238
344
|
const { places, totalCount } = await service.search({
|
|
239
|
-
limit:
|
|
345
|
+
limit: limit.applied,
|
|
240
346
|
offset: input.offset,
|
|
241
347
|
query,
|
|
242
348
|
match,
|
|
243
349
|
countries,
|
|
350
|
+
adminCode1,
|
|
351
|
+
adminCode2,
|
|
352
|
+
adminCode3,
|
|
353
|
+
adminCode4,
|
|
244
354
|
featureClasses,
|
|
245
355
|
featureCodes,
|
|
246
356
|
cities,
|
|
@@ -252,34 +362,40 @@ export const searchPlacesTool = tool('geonames_search_places', {
|
|
|
252
362
|
const more = shown > 0 && next < totalCount;
|
|
253
363
|
/** Past the cap, offset 5000 is still a page: it repeats this page's tail, then reaches row `next`. */
|
|
254
364
|
const nextOffset = more && input.offset < MAX_OFFSET ? Math.min(next, MAX_OFFSET) : undefined;
|
|
365
|
+
/** The notice's fragments: clamp, continuation, outside countries; or the zero-hit notice alone. */
|
|
366
|
+
const fragments = [];
|
|
255
367
|
ctx.enrich.total(totalCount);
|
|
256
368
|
ctx.enrich({ shown });
|
|
257
369
|
if (more) {
|
|
370
|
+
ctx.enrich.truncated({ shown, cap: limit.applied });
|
|
258
371
|
const remaining = `${(totalCount - next).toLocaleString('en-US')} more ${totalCount - next === 1 ? 'place' : 'places'}`;
|
|
259
372
|
const repeated = next - MAX_OFFSET;
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
:
|
|
266
|
-
|
|
267
|
-
: `${remaining}; call again with offset ${next}.`,
|
|
268
|
-
});
|
|
373
|
+
if (limit.fragment !== undefined)
|
|
374
|
+
fragments.push(limit.fragment);
|
|
375
|
+
fragments.push(nextOffset === undefined
|
|
376
|
+
? "GeoNames' free service accepts no offset past 5,000, so no later page is reachable; narrow with countries, featureCodes, or boundingBox to reach the rest."
|
|
377
|
+
: nextOffset < next
|
|
378
|
+
? `${remaining}; call again with offset ${MAX_OFFSET}, the last offset GeoNames' free service accepts (its first ${repeated} ${repeated === 1 ? 'row repeats' : 'rows repeat'} this page).`
|
|
379
|
+
: `${remaining}; call again with offset ${next}.`);
|
|
269
380
|
}
|
|
381
|
+
const unlisted = unlistedCountriesFragment(places.map(({ countryCode }) => countryCode), countries, 'place');
|
|
382
|
+
if (unlisted !== undefined)
|
|
383
|
+
fragments.push(unlisted);
|
|
270
384
|
if (shown === 0) {
|
|
271
|
-
|
|
385
|
+
fragments.push(totalCount > 0
|
|
272
386
|
? `offset ${input.offset} is past the last result (${totalCount}); call again with a smaller offset.`
|
|
273
387
|
: [
|
|
274
388
|
`No GeoNames place matched ${effectiveQuery}.`,
|
|
275
389
|
match === 'exact_name' &&
|
|
276
|
-
`No place is named exactly "${
|
|
390
|
+
`No place is named exactly "${query ?? ''}"; retry with match name_prefix or name_required.`,
|
|
277
391
|
match === 'name_required' &&
|
|
278
392
|
'At least one query term must appear in the place name; retry with match any_field to also match country and admin names.',
|
|
279
393
|
(featureCodes || featureClasses) &&
|
|
280
394
|
'The feature filter may be too narrow; drop it, or check codes with geonames_list_reference topic feature_codes.',
|
|
281
395
|
countries &&
|
|
282
|
-
`Only ${countries.join(', ')} were searched
|
|
396
|
+
`Only ${countries.join(', ')} were searched; check the codes with geonames_get_countries, or drop countries to search worldwide.`,
|
|
397
|
+
adminCodes.length > 0 &&
|
|
398
|
+
`Only places with ${adminCodes.join(', ')} were searched; admin codes match exactly, zero padding included: copy them from adminLevels of geonames_get_place, or drop the deepest to widen the search.`,
|
|
283
399
|
boundingBox &&
|
|
284
400
|
'Only places inside the bounding box were searched; widen or drop boundingBox.',
|
|
285
401
|
cities && `${cities} excludes smaller populated places; drop cities to include them.`,
|
|
@@ -287,6 +403,8 @@ export const searchPlacesTool = tool('geonames_search_places', {
|
|
|
287
403
|
.filter(Boolean)
|
|
288
404
|
.join(' '));
|
|
289
405
|
}
|
|
406
|
+
if (fragments.length > 0)
|
|
407
|
+
ctx.enrich.notice(fragments.join(' '));
|
|
290
408
|
return { places: places.map(toPlace), ...(nextOffset === undefined ? {} : { nextOffset }) };
|
|
291
409
|
},
|
|
292
410
|
format: (result) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-places.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-places.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,OAAO,EACP,UAAU,EACV,UAAU,EACV,WAAW,EACX,gBAAgB,GACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,OAAO,GAAG,CAAC,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,CAAU,CAAC;AAErF,uFAAuF;AACvF,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,uGAAuG;AACvG,MAAM,OAAO,GA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AAC,EAAE;qBACvD;yBACE,MAAM,CAAC,OAAO,CAAC;yBACf,IAAI,CAAC,GAAG,CAAC,CAAC;gBACnB,MAAM,WAAW,GACf,KAAK,CAAC,GAAG,KAAK,SAAS,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS;oBAChD,CAAC,CAAC,eAAe;oBACjB,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,EAAE,CAAC;gBACnC,KAAK,CAAC,IAAI,CACR,KAAK;oBACH,KAAK,CAAC,SAAS;oBACf,IAAI;oBACJ,OAAO;oBACP,OAAO;oBACP,MAAM;oBACN,KAAK,CAAC,UAAU,KAAK,SAAS;wBAC5B,CAAC,CAAC,eAAe;wBACjB,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC;oBAC5C,WAAW;iBACZ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAClB,CAAC;YACJ,CAAC;QACH,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,qBAAqB,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;QAC/F,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":"search-places.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-places.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,E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AAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAClB,CAAC;YACJ,CAAC;QACH,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,qBAAqB,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;QAC/F,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Input schemas and local list semantics shared by every GeoNames tool.
|
|
3
3
|
* Normalizations run in the schema, before validation: blanks from form clients
|
|
4
|
-
* become unset, lists accept a comma-separated string, codes are upper-cased
|
|
5
|
-
* word enums are lower-cased.
|
|
4
|
+
* become unset, lists accept a comma-separated string, codes are upper-cased (country
|
|
5
|
+
* codes mapped to alpha-2), and word enums are lower-cased. Also the checks tools run
|
|
6
|
+
* before any request: country codes GeoNames files no feature under, feature filters
|
|
7
|
+
* that intersect to nothing, and the clamp that holds a limit to the tool's cap; and, once
|
|
8
|
+
* a page is back, the notice fragment naming the territories a country filter also returned.
|
|
6
9
|
* @module mcp-server/tools/shared-inputs
|
|
7
10
|
*/
|
|
8
11
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
12
|
+
import { type FeatureClass } from '../../services/geonames/feature-codes.js';
|
|
9
13
|
/** Blank when absent, null, or a whitespace-only string. */
|
|
10
14
|
export declare const isBlank: (value: unknown) => boolean;
|
|
11
15
|
/**
|
|
@@ -22,12 +26,20 @@ export interface ListInputOptions {
|
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* An optional list that also accepts a comma-separated string. Items are trimmed and
|
|
25
|
-
* normalized, blanks dropped, and an empty list is unset.
|
|
29
|
+
* normalized, blanks dropped, and an empty list is unset. The advertised schema is the array
|
|
30
|
+
* alone, so a description offers only the list; the joined string is tolerated.
|
|
26
31
|
*/
|
|
27
32
|
export declare function listInput<T extends z.ZodType>(item: T, { max, normalize }: ListInputOptions): z.ZodPreprocess<z.ZodOptional<z.ZodArray<T>>, unknown>;
|
|
28
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Lower-cases a string before `schema` validates it, so a word enum accepts any case (`Tourism`).
|
|
35
|
+
* The advertised enum lists only the lower-case members, so the description offers only those.
|
|
36
|
+
*/
|
|
29
37
|
export declare const lowerCased: <T extends z.ZodType>(schema: T) => z.ZodPreprocess<T, unknown>;
|
|
30
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Upper-cases a country code and maps it to the alpha-2 GeoNames keys countries by: `UK`
|
|
40
|
+
* to `GB` and `FL` to `LI` (see {@link COUNTRY_ALIASES}), and an alpha-3 or three-digit
|
|
41
|
+
* numeric code to its country's alpha-2. A code no country has stays, upper-cased.
|
|
42
|
+
*/
|
|
31
43
|
export declare const toAlpha2: (item: string) => string;
|
|
32
44
|
/** Optional caller GeoNames account; never logged, cached, or echoed. */
|
|
33
45
|
export declare const geonamesUsernameInput: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
@@ -38,19 +50,50 @@ export declare const USERNAME_ALIASES: {
|
|
|
38
50
|
/**
|
|
39
51
|
* Argument names `setup()` registers with `sanitization.setSensitiveFields`, so the
|
|
40
52
|
* failed-call payload record redacts a username sent under a near-miss key. The framework
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
53
|
+
* splits a key into lower-cased words at separators, camelCase boundaries, the end of a run
|
|
54
|
+
* of capitals, and around digits, and matches every run of adjacent words, joined:
|
|
55
|
+
* `user` and `account` cover `geonames_user`, `GEONAMES_USER`, and `GeoNamesAccount`, and
|
|
56
|
+
* the run-together names cover a key written as one word, such as `geonamesuser` or
|
|
57
|
+
* `GEONAMESUSER`, which the word split leaves whole.
|
|
45
58
|
*/
|
|
46
59
|
export declare const USERNAME_LOG_FIELDS: string[];
|
|
47
60
|
/**
|
|
48
61
|
* Required GeoNames feature id, as a digit string of at most {@link MAX_GEONAME_ID}. A
|
|
49
62
|
* JSON integer becomes its digit string here, so an out-of-range one gets the range message.
|
|
63
|
+
* The advertised pattern admits only the digit string, so the description offers only that;
|
|
64
|
+
* the URL and integer forms are tolerated.
|
|
50
65
|
*/
|
|
51
66
|
export declare const geonameIdInput: z.ZodPreprocess<z.ZodString, unknown>;
|
|
52
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Optional country filter, up to 10 codes, each mapped to alpha-2 by {@link toAlpha2}. A
|
|
69
|
+
* well-formed code GeoNames files no feature under passes the schema for the tool to
|
|
70
|
+
* reject before any request; see {@link unknownCountryCodes}. GeoNames' `country` filter
|
|
71
|
+
* also returns the territories it files under a listed country, and the tools relay those
|
|
72
|
+
* rows as returned, so the description says so.
|
|
73
|
+
*/
|
|
53
74
|
export declare const countriesInput: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
75
|
+
/** `countries` entries GeoNames files no feature under, and the message naming them. */
|
|
76
|
+
export interface UnknownCountryCodes {
|
|
77
|
+
/** Each entry as normalized, in input order. */
|
|
78
|
+
countries: string[];
|
|
79
|
+
message: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The `countries` entries GeoNames files no feature under: after {@link toAlpha2}, each
|
|
83
|
+
* entry outside the 250 country codes and the retired `AN`, `CS`, and `YU`, whether an
|
|
84
|
+
* alpha-2 such as `EL` or an alpha-3 or numeric code the table could not map. Returns
|
|
85
|
+
* `undefined` when every entry is one of those codes.
|
|
86
|
+
*/
|
|
87
|
+
export declare function unknownCountryCodes(countries: readonly string[] | undefined): UnknownCountryCodes | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* The notice fragment naming the countries on a page that `countries` (as the schema
|
|
90
|
+
* normalized it, alpha-2) does not list: the territories GeoNames' `country` filter returns
|
|
91
|
+
* under a listed country, relayed rather than dropped. Each code appears once, in page
|
|
92
|
+
* order, read from the page's own rows, so no parent-to-territory table is needed; a row
|
|
93
|
+
* with no `countryCode` is skipped. `noun` names one row of the page. Returns `undefined`
|
|
94
|
+
* without `countries` or when every code on the page is listed.
|
|
95
|
+
*/
|
|
96
|
+
export declare function unlistedCountriesFragment(countryCodes: readonly (string | undefined)[], countries: readonly string[] | undefined, noun: 'place' | 'postal code'): string | undefined;
|
|
54
97
|
/** Optional feature-class filter, up to all nine classes. */
|
|
55
98
|
export declare const featureClassesInput: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
56
99
|
A: "A";
|
|
@@ -71,14 +114,52 @@ export declare const citiesInput: z.ZodPreprocess<z.ZodPreprocess<z.ZodOptional<
|
|
|
71
114
|
cities15000: "cities15000";
|
|
72
115
|
cities5000: "cities5000";
|
|
73
116
|
}>>, unknown>, unknown>;
|
|
117
|
+
/** Feature-filter entries GeoNames can never match, and the message naming them. */
|
|
118
|
+
export interface FeatureFilterMismatch {
|
|
119
|
+
/** Listed classes with no listed code, or other than P beside `cities`; each once, in input order. */
|
|
120
|
+
featureClasses: FeatureClass[];
|
|
121
|
+
/** Listed codes outside the listed classes, or outside class P beside `cities`; each once, in input order. */
|
|
122
|
+
featureCodes: string[];
|
|
123
|
+
message: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* GeoNames applies `featureClass`, `featureCode`, and `cities` (class P only) together,
|
|
127
|
+
* so a code whose class is not listed, a listed class with no listed code, and a class or
|
|
128
|
+
* code other than P beside `cities` each match nothing. Returns those entries, or
|
|
129
|
+
* `undefined` when every entry can match. A code the bundled table lacks has no class to
|
|
130
|
+
* compare and is skipped: tools reject it first as `unknown_feature_code`.
|
|
131
|
+
*/
|
|
132
|
+
export declare function featureFilterMismatch({ featureClasses, featureCodes, cities, }: {
|
|
133
|
+
cities?: string | undefined;
|
|
134
|
+
featureClasses: readonly FeatureClass[] | undefined;
|
|
135
|
+
featureCodes: readonly string[] | undefined;
|
|
136
|
+
}): FeatureFilterMismatch | undefined;
|
|
74
137
|
/** Latitude in decimal degrees. */
|
|
75
138
|
export declare const latInput: z.ZodNumber;
|
|
76
139
|
/** Longitude in decimal degrees. */
|
|
77
140
|
export declare const lngInput: z.ZodNumber;
|
|
78
141
|
/** Optional local name filter; see {@link nameMatcher}. */
|
|
79
142
|
export declare const nameContainsInput: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
80
|
-
/**
|
|
81
|
-
|
|
143
|
+
/**
|
|
144
|
+
* A `limit` input for a tool that returns at most `cap` entries a call: 1 to 1,000, `fallback`
|
|
145
|
+
* when omitted or blank. The handler holds a value above `cap` to `cap` with {@link clampLimit}
|
|
146
|
+
* instead of rejecting a request it can answer up to the cap.
|
|
147
|
+
*/
|
|
148
|
+
export declare const clampedLimitInput: (cap: number, fallback: number) => z.ZodPreprocess<z.ZodDefault<z.ZodNumber>, unknown>;
|
|
149
|
+
/** A requested limit held to a tool's cap. */
|
|
150
|
+
export interface ClampedLimit {
|
|
151
|
+
/** The limit the tool applies and reports as `cap`: the request, or the cap when it asked for more. */
|
|
152
|
+
applied: number;
|
|
153
|
+
/** Names the requested value and the cap; present only when the request was above the cap. */
|
|
154
|
+
fragment?: string;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Holds `requested` to `cap`, before any request or slice. The tool writes `applied` as its
|
|
158
|
+
* `cap` enrichment, and puts `fragment` in its notice ahead of its continuation only on a page
|
|
159
|
+
* with entries remaining past it: a clamped call whose entries all fit says nothing of the
|
|
160
|
+
* clamp. `field` is the input's name as the fragment prints it.
|
|
161
|
+
*/
|
|
162
|
+
export declare function clampLimit(requested: number, cap: number, field?: string): ClampedLimit;
|
|
82
163
|
/** An `offset` input: entries to skip, 0 when omitted or blank. */
|
|
83
164
|
export declare const offsetInput: (max?: number) => z.ZodPreprocess<z.ZodDefault<z.ZodNumber>, unknown>;
|
|
84
165
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-inputs.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/shared-inputs.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"shared-inputs.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/shared-inputs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE3C,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,sCAAsC,CAAC;AAE9C,4DAA4D;AAC5D,eAAO,MAAM,OAAO,UAAW,OAAO,KAAG,OACoD,CAAC;AAc9F;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,CAAC,OAAO,UAAU,CAAC,gCAAuC,CAAC;AAEnG,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,6FAA6F;IAC7F,GAAG,EAAE,MAAM,CAAC;IACZ,wEAAwE;IACxE,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACrC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,gBAAgB,0DAU3F;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,CAAC,CAAC,OAAO,UAAU,CAAC,gCAItD,CAAC;AASJ;;;;GAIG;AACH,eAAO,MAAM,QAAQ,SAAU,MAAM,WAGpC,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,sDAOjC,CAAC;AAEF,2CAA2C;AAC3C,eAAO,MAAM,gBAAgB;aAAK,QAAQ,EAAE,kBAAkB;CAAW,CAAC;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,UAO/B,CAAC;AAQF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,uCAoBxB,C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