feat(agent): refine ready state actions

This commit is contained in:
2026-07-15 18:30:21 +08:00
parent 055335e404
commit df2fb3ca38
10 changed files with 149 additions and 41 deletions
@@ -55,6 +55,14 @@ describe("toTrustedMapAction", () => {
});
});
it("converts EPSG:3857 zoom coordinates", () => {
const action = toTrustedMapAction("zoom_to_map", { x: 13046644.321, y: 4736005.854, source_crs: "EPSG:3857" });
expect(action?.type).toBe("zoom_to_map");
expect(action?.type === "zoom_to_map" ? action.center[0] : undefined).toBeCloseTo(117.2, 3);
expect(action?.type === "zoom_to_map" ? action.center[1] : undefined).toBeCloseTo(39.1, 3);
});
it("normalizes legacy locate tool actions", () => {
expect(toTrustedMapAction("locate_pipes", { pipe_ids: "P1,P2" })).toEqual({
type: "locate_features",