fix: count every mapped installation in tool answers

The installation source keeps one named site per display cell for the map.
Queries now ask for every site and the exact box, and report when the
source returned only part of the mapped sites.
This commit is contained in:
Sameh Khamis committed 2026-10-02 15:21:36 -07:00
1 parent 2e071b62d3
commit 7ddee426e7
5 files changed
+63 -14

No files matched your search

+12 -2
View File
@@ -355,8 +355,12 @@ export const findMilitaryInstallations = defineTool({
);
const center = areaCenter(area);
const result = await services.installations.getMappedSites(area, {
exact: true,
thinned: false,
signal,
});
// A saturated source returned only part of the mapped sites.
const complete = !result.saturated;
const rows = (result.records || [])
.map((site) => ({
site,
@@ -374,8 +378,14 @@ export const findMilitaryInstallations = defineTool({
}))
.sort((a, b) => a.distance_km - b.distance_km);
return {
summary: `${countNoun(rows.length, 'mapped military installation')} in ${area.label}.`,
data: { ...capRows(rows, args.limit), source: result.source ?? null },
summary:
`${countNoun(rows.length, 'mapped military installation')} in ${area.label}` +
(complete ? '.' : ' (partial: the source returned only some sites).'),
data: {
...capRows(rows, args.limit),
complete,
source: result.source ?? null,
},
};
},
});