feat(mcp): подготовить сервер и доступ к приёмке

This commit is contained in:
Denozordec committed 2026-11-03 03:12:03 +07:00
commit bf3d50e1ff
3835 files changed
+537122

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
export interface MapPoint {x:number;y:number}
export function fitNetworkMapCamera(points:readonly MapPoint[],width:number,height:number) {
const valid=points.filter(p=>Number.isFinite(p.x)&&Number.isFinite(p.y))
if(!valid.length||width<=0||height<=0)return {pan:{x:0,y:0},zoom:1}
const xs=valid.map(p=>p.x),ys=valid.map(p=>p.y),left=Math.min(...xs)-120,right=Math.max(...xs)+120,top=Math.min(...ys)-100,bottom=Math.max(...ys)+100
const zoom=Math.max(.2,Math.min(3,width/(right-left),height/(bottom-top)))
return {pan:{x:(left+right)/2-width/(2*zoom),y:(top+bottom)/2-height/(2*zoom)},zoom}
}