feat: return the view that shows each answer

Tool answers with something to show now include data.view: the view with
the matching layers on, the area framed from above or a single aircraft or
satellite followed, and the link that opens it. Area framing moves to
src/tools/views.js so links and answers frame alike.
This commit is contained in:
Sameh Khamis committed 2026-10-02 15:21:36 -07:00
1 parent 96a8a9addb
commit d6473b6049
20 files changed
+393 -34

No files matched your search

+11
View File
@@ -1,5 +1,6 @@
/** Submarine cables and their landing points. */
import { suggestView } from '../views.js';
import { defineTool, ToolError } from '../catalog.js';
import {
AREA_SCHEMA,
@@ -80,6 +81,16 @@ export const findSubmarineCables = defineTool({
? `, with ${countNoun(landingRows.length, 'landing point')}.`
: '.'),
data: {
view: suggestView(
services,
area
? { area, layers: ['telegeography-submarine-cables'] }
: {
point: { lat: 20, lon: 0 },
altitudeM: 15_000_000,
layers: ['telegeography-submarine-cables'],
},
),
...capRows(rows, args.limit),
landing_points: area ? capRows(landingRows, args.limit) : null,
attribution: ATTRIBUTION,