feat(voice): add reusable geometry actions

- turn named places and mapped landmarks into reusable bounded areas
- count loaded records inside resolved, drawn and annotated geometry
- find recent imagery for an area, the view or the pointer snapshot
- keep osm place search behind an operator-configured overpass endpoint
- preserve cancellation, ownership and follow-up memory across every action
- cover geometry, provider lifecycle, cache isolation and voice routing
This commit is contained in:
manjunath22466 committed 2026-10-03 10:23:38 +05:30
1 parent 01979bba1e
commit b234d7b427
84 files changed
+14262 -1681

No files matched your search

+47
View File
@@ -8,6 +8,7 @@ import {
progressStepLabel,
spokenLabel,
} from './speech.js';
import { presentResult } from './resultDisplay.js';
import { countWords, findHedges } from './speechLint.js';
function envelope(name, result, args) {
@@ -390,6 +391,52 @@ test('analyst speech preserves exact counts, lower bounds and partial status', (
}).say,
'At least 250,000 aircraft anywhere in the loaded data. Partial; military not answered.',
);
assert.equal(
attachVoiceResult('analyst_query', {
...raw,
count: 7,
coverage: {
layersQueried: [{ layerKey: 'flights' }, { layerKey: 'military' }],
},
}).say,
'7 aircraft anywhere in the loaded data.',
'combined Contacts aircraft layers retain their shared semantic noun',
);
for (const [feedState, spoken] of [
['stale', 'Feed stale.'],
['degraded', 'Feed degraded.'],
['unavailable', 'Feed unavailable.'],
]) {
const result = attachVoiceResult('analyst_query', {
...raw,
feedState,
feedProvenance: { overall: feedState },
});
assert.equal(
result.say,
`3 aircraft anywhere in the loaded data. ${spoken}`,
);
assert.equal(
presentResult('analyst_query', result).display.chips[0].label,
feedState,
'speech and card carry the same material feed state',
);
}
const longScope = `within the selected operational corridor ${'north-east '.repeat(8).trim()}`;
const longResult = attachVoiceResult('analyst_query', {
...raw,
scopeLabel: longScope,
});
assert.equal(
presentResult('analyst_query', longResult).display.title,
longResult.say.replace(/[.]$/, ''),
'card and speech consume the exact same long headline',
);
assert.ok(
longResult.say.length <= 64,
'the shared headline fits the voice card without a second truncation',
);
assert.match(longResult.say, /…$/);
});
test('builders never break an action and callers can override analyst speech', () => {