@mountaya/studio 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/agent/index.cjs +2561 -2815
  3. package/dist/agent/index.cjs.map +1 -1
  4. package/dist/agent/index.d.cts +766 -786
  5. package/dist/agent/index.d.ts +766 -786
  6. package/dist/agent/index.js +2553 -2790
  7. package/dist/agent/index.js.map +1 -1
  8. package/dist/chunk-3Oi_Zrtm.js +9 -0
  9. package/dist/chunk-3Oi_Zrtm.js.map +1 -0
  10. package/dist/chunk-B18OPIu_.js +6 -0
  11. package/dist/chunk-B18OPIu_.js.map +1 -0
  12. package/dist/chunk-B5Uz3Qct.cjs +15 -0
  13. package/dist/chunk-B5Uz3Qct.cjs.map +1 -0
  14. package/dist/chunk-BBEJwkd3.d.cts +839 -0
  15. package/dist/chunk-BIEc_SkR.cjs +29 -0
  16. package/dist/chunk-BIEc_SkR.cjs.map +1 -0
  17. package/dist/chunk-BKMFOe-N.js +171 -0
  18. package/dist/chunk-BKMFOe-N.js.map +1 -0
  19. package/dist/chunk-BP4uy7E1.d.ts +11583 -0
  20. package/dist/chunk-BSHTsFiB.js +1403 -0
  21. package/dist/chunk-BSHTsFiB.js.map +1 -0
  22. package/dist/chunk-BTUUABGI.js +17 -0
  23. package/dist/chunk-BTUUABGI.js.map +1 -0
  24. package/dist/chunk-BaPiaz5X.cjs +115 -0
  25. package/dist/chunk-BaPiaz5X.cjs.map +1 -0
  26. package/dist/chunk-BeCVpkYr.cjs +542 -0
  27. package/dist/chunk-BeCVpkYr.cjs.map +1 -0
  28. package/dist/chunk-BgngsvK8.cjs +6202 -0
  29. package/dist/chunk-BgngsvK8.cjs.map +1 -0
  30. package/dist/chunk-BhInd7CJ.d.cts +253 -0
  31. package/dist/chunk-Bn6ZbxkS.cjs +27 -0
  32. package/dist/chunk-By9ZnkVI.js +60 -0
  33. package/dist/chunk-By9ZnkVI.js.map +1 -0
  34. package/dist/chunk-BzqPhxsz.cjs +367 -0
  35. package/dist/chunk-BzqPhxsz.cjs.map +1 -0
  36. package/dist/chunk-C2mMX81q.d.ts +443 -0
  37. package/dist/chunk-C2rr9Q0V.cjs +1402 -0
  38. package/dist/chunk-C2rr9Q0V.cjs.map +1 -0
  39. package/dist/{directorThreads-CqmvsV8b.d.cts → chunk-CDJCbwIQ.d.cts} +20 -22
  40. package/dist/chunk-CLGvBOVH.d.cts +1654 -0
  41. package/dist/chunk-COdw1dc6.d.ts +525 -0
  42. package/dist/chunk-CQCJnT2i.d.ts +511 -0
  43. package/dist/chunk-CSyHY67q.cjs +353 -0
  44. package/dist/chunk-CSyHY67q.cjs.map +1 -0
  45. package/dist/chunk-CiK1Iqrv.js +950 -0
  46. package/dist/chunk-CiK1Iqrv.js.map +1 -0
  47. package/dist/chunk-CmJBgSwZ.cjs +24 -0
  48. package/dist/chunk-CmJBgSwZ.cjs.map +1 -0
  49. package/dist/chunk-CnrsRK2u.cjs +83 -0
  50. package/dist/chunk-CnrsRK2u.cjs.map +1 -0
  51. package/dist/chunk-Co782_9r.js +326 -0
  52. package/dist/chunk-Co782_9r.js.map +1 -0
  53. package/dist/chunk-Csr3KDpZ.cjs +32 -0
  54. package/dist/chunk-Csr3KDpZ.cjs.map +1 -0
  55. package/dist/chunk-CwkmccXv.js +89 -0
  56. package/dist/chunk-CwkmccXv.js.map +1 -0
  57. package/dist/chunk-D0Q4iL9B.cjs +255 -0
  58. package/dist/chunk-D0Q4iL9B.cjs.map +1 -0
  59. package/dist/chunk-DFwiSzUS.cjs +72 -0
  60. package/dist/chunk-DFwiSzUS.cjs.map +1 -0
  61. package/dist/chunk-DIFayl2P.d.cts +443 -0
  62. package/dist/chunk-DIGF58ux.d.cts +525 -0
  63. package/dist/chunk-DKuuuld5.js +101 -0
  64. package/dist/chunk-DKuuuld5.js.map +1 -0
  65. package/dist/chunk-DMePkFEo.js +5054 -0
  66. package/dist/chunk-DMePkFEo.js.map +1 -0
  67. package/dist/chunk-DO5SIBgu.js +305 -0
  68. package/dist/chunk-DO5SIBgu.js.map +1 -0
  69. package/dist/chunk-DOQ_7eE5.d.ts +6662 -0
  70. package/dist/{tabs-B2nRO4p_.d.ts → chunk-DThaaNeb.d.cts} +2 -2
  71. package/dist/{tabs-B2nRO4p_.d.cts → chunk-DThaaNeb.d.ts} +2 -2
  72. package/dist/{directorThreads-CqmvsV8b.d.ts → chunk-DUQzjUJy.d.ts} +20 -22
  73. package/dist/chunk-DX37IPhV.cjs +1903 -0
  74. package/dist/chunk-DX37IPhV.cjs.map +1 -0
  75. package/dist/chunk-Damps5Tk.cjs +155 -0
  76. package/dist/chunk-Damps5Tk.cjs.map +1 -0
  77. package/dist/chunk-DbK5PhpJ.d.ts +1654 -0
  78. package/dist/chunk-De0vAASv.d.ts +253 -0
  79. package/dist/chunk-DhSZ7YZt.d.cts +6662 -0
  80. package/dist/chunk-DjEvqvPA.cjs +43 -0
  81. package/dist/chunk-DjEvqvPA.cjs.map +1 -0
  82. package/dist/{saveFile-j-1kkApx.d.cts → chunk-DkwDzwvu.d.cts} +7 -9
  83. package/dist/{saveFile-j-1kkApx.d.ts → chunk-DkwDzwvu.d.ts} +7 -9
  84. package/dist/chunk-Dmszv9If.js +71 -0
  85. package/dist/chunk-Dmszv9If.js.map +1 -0
  86. package/dist/chunk-Dp_ftNWY.d.cts +511 -0
  87. package/dist/chunk-DsHQySz0.js +31 -0
  88. package/dist/chunk-DsHQySz0.js.map +1 -0
  89. package/dist/chunk-DwoUyHHh.js +281 -0
  90. package/dist/chunk-DwoUyHHh.js.map +1 -0
  91. package/dist/chunk-IaIDQflj.d.cts +2315 -0
  92. package/dist/chunk-IaIDQflj.d.ts +2315 -0
  93. package/dist/chunk-cVXLsZfL.d.ts +839 -0
  94. package/dist/chunk-mIaCX9EJ.d.cts +11583 -0
  95. package/dist/chunk-nJQxbOwQ.cjs +8962 -0
  96. package/dist/chunk-nJQxbOwQ.cjs.map +1 -0
  97. package/dist/chunk-o9jaxhCO.js +8852 -0
  98. package/dist/chunk-o9jaxhCO.js.map +1 -0
  99. package/dist/chunk-p-Tt_Lwz.js +14 -0
  100. package/dist/chunk-p-Tt_Lwz.js.map +1 -0
  101. package/dist/engines/index.cjs +2046 -3401
  102. package/dist/engines/index.cjs.map +1 -1
  103. package/dist/engines/index.d.cts +1510 -1550
  104. package/dist/engines/index.d.ts +1510 -1550
  105. package/dist/engines/index.js +2039 -3380
  106. package/dist/engines/index.js.map +1 -1
  107. package/dist/handlers/index.cjs +47 -93
  108. package/dist/handlers/index.cjs.map +1 -1
  109. package/dist/handlers/index.d.cts +61 -103
  110. package/dist/handlers/index.d.ts +61 -103
  111. package/dist/handlers/index.js +27 -36
  112. package/dist/handlers/index.js.map +1 -1
  113. package/dist/index.cjs +3347 -4398
  114. package/dist/index.cjs.map +1 -1
  115. package/dist/index.d.cts +8 -7297
  116. package/dist/index.d.ts +8 -7297
  117. package/dist/index.js +2997 -3187
  118. package/dist/index.js.map +1 -1
  119. package/dist/plugins/index.cjs +482 -949
  120. package/dist/plugins/index.cjs.map +1 -1
  121. package/dist/plugins/index.d.cts +44 -61
  122. package/dist/plugins/index.d.ts +44 -61
  123. package/dist/plugins/index.js +471 -915
  124. package/dist/plugins/index.js.map +1 -1
  125. package/dist/seams/index.cjs +77 -140
  126. package/dist/seams/index.cjs.map +1 -1
  127. package/dist/seams/index.d.cts +125 -158
  128. package/dist/seams/index.d.ts +125 -158
  129. package/dist/seams/index.js +41 -71
  130. package/dist/seams/index.js.map +1 -1
  131. package/dist/strings/fr/index.cjs +2130 -2116
  132. package/dist/strings/fr/index.cjs.map +1 -1
  133. package/dist/strings/fr/index.d.cts +3 -5
  134. package/dist/strings/fr/index.d.ts +3 -5
  135. package/dist/strings/fr/index.js +2125 -2114
  136. package/dist/strings/fr/index.js.map +1 -1
  137. package/dist/strings/index.cjs +2331 -2625
  138. package/dist/strings/index.cjs.map +1 -1
  139. package/dist/strings/index.d.cts +3 -731
  140. package/dist/strings/index.d.ts +3 -731
  141. package/dist/strings/index.js +2324 -2615
  142. package/dist/strings/index.js.map +1 -1
  143. package/dist/testing/index.cjs +214 -276
  144. package/dist/testing/index.cjs.map +1 -1
  145. package/dist/testing/index.d.cts +61 -121
  146. package/dist/testing/index.d.ts +61 -121
  147. package/dist/testing/index.js +208 -273
  148. package/dist/testing/index.js.map +1 -1
  149. package/dist/time/index.cjs +23 -23
  150. package/dist/time/index.cjs.map +1 -1
  151. package/dist/time/index.d.cts +5 -7
  152. package/dist/time/index.d.ts +5 -7
  153. package/dist/time/index.js +18 -21
  154. package/dist/time/index.js.map +1 -1
  155. package/package.json +14 -15
  156. package/src/agent/rules/stateDelta.ts +1 -0
  157. package/src/agent/stores/agentThreads.ts +1 -4
  158. package/src/bus/rules/bus.ts +1 -2
  159. package/src/bus/rules/defineRegistry.ts +3 -5
  160. package/src/bus/rules/types.ts +6 -7
  161. package/src/chrome/stores/uiStore.ts +4 -2
  162. package/src/embed/rules/fieldDependencies.ts +2 -0
  163. package/src/embed/rules/safetyRules.ts +2 -0
  164. package/src/embed/rules/tableCode.ts +4 -3
  165. package/src/index.ts +6 -27
  166. package/src/itinerary/rules/import.ts +6 -8
  167. package/src/plugins/contracts/plugin.ts +4 -2
  168. package/src/seams/rules/formatters.ts +5 -3
  169. package/src/testing/index.ts +1 -5
  170. package/src/viewer/rules/platformViewer.ts +1 -0
  171. package/dist/bus-BwiNiXdH.d.ts +0 -514
  172. package/dist/bus-DzmhPwdK.d.cts +0 -514
  173. package/dist/chainModel-B23pEP_1.d.cts +0 -127
  174. package/dist/chainModel-B23pEP_1.d.ts +0 -127
  175. package/dist/chunk-2HFY7ETU.js +0 -5721
  176. package/dist/chunk-2HFY7ETU.js.map +0 -1
  177. package/dist/chunk-355TOXSB.js +0 -72
  178. package/dist/chunk-355TOXSB.js.map +0 -1
  179. package/dist/chunk-4ZCUZVSV.js +0 -10275
  180. package/dist/chunk-4ZCUZVSV.js.map +0 -1
  181. package/dist/chunk-6HEKY3NF.js +0 -95
  182. package/dist/chunk-6HEKY3NF.js.map +0 -1
  183. package/dist/chunk-7GFLGGBX.cjs +0 -8
  184. package/dist/chunk-7GFLGGBX.cjs.map +0 -1
  185. package/dist/chunk-7NBRCENN.cjs +0 -19
  186. package/dist/chunk-7NBRCENN.cjs.map +0 -1
  187. package/dist/chunk-AF5GCXE3.js +0 -8
  188. package/dist/chunk-AF5GCXE3.js.map +0 -1
  189. package/dist/chunk-CJDIFRGZ.cjs +0 -2005
  190. package/dist/chunk-CJDIFRGZ.cjs.map +0 -1
  191. package/dist/chunk-CNPZY7N3.js +0 -349
  192. package/dist/chunk-CNPZY7N3.js.map +0 -1
  193. package/dist/chunk-DZJHTWSF.cjs +0 -45
  194. package/dist/chunk-DZJHTWSF.cjs.map +0 -1
  195. package/dist/chunk-EABIHHWA.js +0 -42
  196. package/dist/chunk-EABIHHWA.js.map +0 -1
  197. package/dist/chunk-EKZWV6RS.cjs +0 -415
  198. package/dist/chunk-EKZWV6RS.cjs.map +0 -1
  199. package/dist/chunk-EOKRXXAC.cjs +0 -24
  200. package/dist/chunk-EOKRXXAC.cjs.map +0 -1
  201. package/dist/chunk-F73W2ZTJ.js +0 -1126
  202. package/dist/chunk-F73W2ZTJ.js.map +0 -1
  203. package/dist/chunk-H4DVOZ5O.js +0 -1897
  204. package/dist/chunk-H4DVOZ5O.js.map +0 -1
  205. package/dist/chunk-HI52PBFT.cjs +0 -10314
  206. package/dist/chunk-HI52PBFT.cjs.map +0 -1
  207. package/dist/chunk-IDBXFBLG.cjs +0 -1225
  208. package/dist/chunk-IDBXFBLG.cjs.map +0 -1
  209. package/dist/chunk-LBWTJZUJ.js +0 -297
  210. package/dist/chunk-LBWTJZUJ.js.map +0 -1
  211. package/dist/chunk-NCLA6DKD.cjs +0 -310
  212. package/dist/chunk-NCLA6DKD.cjs.map +0 -1
  213. package/dist/chunk-O4MC5DPD.js +0 -19
  214. package/dist/chunk-O4MC5DPD.js.map +0 -1
  215. package/dist/chunk-OP37FKW6.cjs +0 -98
  216. package/dist/chunk-OP37FKW6.cjs.map +0 -1
  217. package/dist/chunk-OQSYFH3Z.cjs +0 -5945
  218. package/dist/chunk-OQSYFH3Z.cjs.map +0 -1
  219. package/dist/chunk-PACIO4NS.cjs +0 -26
  220. package/dist/chunk-PACIO4NS.cjs.map +0 -1
  221. package/dist/chunk-PSZ2R3TC.cjs +0 -75
  222. package/dist/chunk-PSZ2R3TC.cjs.map +0 -1
  223. package/dist/chunk-QFO5CZG2.cjs +0 -136
  224. package/dist/chunk-QFO5CZG2.cjs.map +0 -1
  225. package/dist/chunk-QL63MUEW.cjs +0 -140
  226. package/dist/chunk-QL63MUEW.cjs.map +0 -1
  227. package/dist/chunk-RFUPPVZO.js +0 -17
  228. package/dist/chunk-RFUPPVZO.js.map +0 -1
  229. package/dist/chunk-RPG2LWMP.js +0 -23
  230. package/dist/chunk-RPG2LWMP.js.map +0 -1
  231. package/dist/chunk-TIBXK6B7.cjs +0 -12
  232. package/dist/chunk-TIBXK6B7.cjs.map +0 -1
  233. package/dist/chunk-UU65VNEV.js +0 -381
  234. package/dist/chunk-UU65VNEV.js.map +0 -1
  235. package/dist/chunk-VGX6TR2I.js +0 -209
  236. package/dist/chunk-VGX6TR2I.js.map +0 -1
  237. package/dist/chunk-WUTDDBVP.js +0 -130
  238. package/dist/chunk-WUTDDBVP.js.map +0 -1
  239. package/dist/chunk-WVQQLKCI.cjs +0 -224
  240. package/dist/chunk-WVQQLKCI.cjs.map +0 -1
  241. package/dist/chunk-WZYXG3SE.js +0 -111
  242. package/dist/chunk-WZYXG3SE.js.map +0 -1
  243. package/dist/chunk-XDI2X3KE.js +0 -6
  244. package/dist/chunk-XDI2X3KE.js.map +0 -1
  245. package/dist/chunk-XKHLRIC7.cjs +0 -381
  246. package/dist/chunk-XKHLRIC7.cjs.map +0 -1
  247. package/dist/context-DNtd2WUv.d.cts +0 -11666
  248. package/dist/context-DgB72Bur.d.ts +0 -11666
  249. package/dist/en-Bu4Ti9Ev.d.cts +0 -2315
  250. package/dist/en-Bu4Ti9Ev.d.ts +0 -2315
  251. package/dist/shareLink-B6hlt942.d.ts +0 -144
  252. package/dist/shareLink-C7rIMb7x.d.ts +0 -527
  253. package/dist/shareLink-CnTxxXjp.d.cts +0 -144
  254. package/dist/shareLink-DyZVYH2V.d.cts +0 -527
  255. package/dist/studioPlugin-C3C7VjMy.d.ts +0 -847
  256. package/dist/studioPlugin-Cf3OBNUv.d.cts +0 -847
  257. package/dist/types-BzJRV6UI.d.cts +0 -845
  258. package/dist/types-BzJRV6UI.d.ts +0 -845
  259. package/dist/zoneForm-CdYNtnnA.d.cts +0 -320
  260. package/dist/zoneForm-mG85yt5e.d.ts +0 -320
@@ -0,0 +1,253 @@
1
+ import * as z$1 from "zod";
2
+ import { LngLat as LngLat$1 } from "@mountaya/elements/geo";
3
+ import { LngLat } from "@mountaya/elements/camera";
4
+ import { Polygon, Position } from "geojson";
5
+ /**
6
+ * wrapZoneGeometryPastRange answers a zone's Polygon inside -180 and 180 where it lies whole
7
+ * past that range, and as it is written otherwise.
8
+ *
9
+ * A zone astride the antimeridian is one ring whose longitudes run past 180, or below -180
10
+ * ({@link zoneCircleGeometry}), and an editor answers a ring on whichever copy of the world its
11
+ * reader dragged it over. A ring from 170 to 175 dragged fourteen degrees east is answered from
12
+ * 184 to 189: no longitude of it is inside the range, and the same place is written from -176 to
13
+ * -171. So a Polygon whose every longitude is above 180 loses whole turns, and one whose every
14
+ * longitude is below -180 gains them, as many as bring its nearest edge inside the range and the
15
+ * same number for every position of every ring.
16
+ *
17
+ * A Polygon that straddles the antimeridian keeps the side its builder or its edit gave it, and
18
+ * so does one that touches the line: neither lies whole past the range, and moved by a turn it
19
+ * would straddle the other end. It is answered by identity, as is a Polygon inside the range,
20
+ * one that holds no position and one that holds a longitude that is no finite number.
21
+ *
22
+ * It is read where the studio takes an editor's answer: {@link recordZoneDraftChange} for a
23
+ * draft the map reports, and `studio.zone.editCommit` for the shape it saves.
24
+ *
25
+ * @param geometry The Polygon as an editor answers it, its longitudes continuous.
26
+ * @returns The same shape with every longitude moved by the same whole number of turns, or
27
+ * `geometry` itself where nothing moves. Latitudes and any member past the second are kept.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * import { wrapZoneGeometryPastRange } from "@mountaya/studio";
32
+ *
33
+ * // A zone dragged east across the antimeridian is answered on the copy it was dragged over.
34
+ * const recorded = wrapZoneGeometryPastRange({
35
+ * coordinates: [
36
+ * [
37
+ * [184, -17],
38
+ * [189, -17],
39
+ * [189, -16],
40
+ * [184, -17],
41
+ * ],
42
+ * ],
43
+ * type: "Polygon",
44
+ * });
45
+ *
46
+ * recorded.coordinates[0]; // [[-176, -17], [-171, -17], [-171, -16], [-176, -17]]
47
+ * ```
48
+ */
49
+ declare const wrapZoneGeometryPastRange: (geometry: Polygon) => Polygon;
50
+ /**
51
+ * ZonePole names one of the planet's two poles: `north`, at latitude 90, and `south`, at -90.
52
+ */
53
+ type ZonePole = "north" | "south";
54
+ /**
55
+ * zoneReachPole names the pole a parametric zone's reach holds, or null when it holds none.
56
+ *
57
+ * A reach is what a shape sweeps from its center: the disc of a circle, the slice of a sector,
58
+ * and for a sensor the slice out to its outer radius, the part nearer than its inner radius
59
+ * included. It holds a pole when the pole is no farther from the center than the reach is long,
60
+ * on the sphere of radius `EARTH_RADIUS_METERS`, and the pole's bearing, due north for the one
61
+ * and due south for the other, is within the sweep, both of its ends included. A circle sweeps
62
+ * every bearing, and a shape centred on a pole holds it whatever its sweep.
63
+ *
64
+ * It answers for a center on the sphere and a reach that is a length. A center whose latitude
65
+ * is no number within -90 and 90 is no point of the sphere, and a reach that is no number is no
66
+ * length: each answers null, and the schema that bounds the member refuses it under its own
67
+ * name, with no pole named beside it. An infinite reach holds the nearer pole within its sweep.
68
+ *
69
+ * A ring round a pole is no shape a planar reader draws. Its longitudes, counted on from its
70
+ * center's, run a whole turn and its closing edge steps back across the map, so a map, an
71
+ * editor and a tile draw a band where the caller meant a cap. A sensor whose band lies beyond
72
+ * the pole breaks the same way: its arcs cross the meridian behind the pole, where a longitude
73
+ * counted on from the center's jumps a turn. So the parametric schemas refuse such a reach,
74
+ * with the pole named ({@link zoneCircleParamsSchema}, {@link zoneSectorParamsSchema},
75
+ * {@link zoneSensorParamsSchema}), and `studio.zone.editPropose` answers `invalid-input`.
76
+ *
77
+ * @param center The shape's center, `[longitude, latitude]` in degrees.
78
+ * @param reachMeters How far the shape reaches from its center, in meters: the radius of a
79
+ * circle or a sector, and a sensor's outer radius.
80
+ * @param sweep The bearings a sector or a sensor sweeps between, in degrees clockwise from
81
+ * north, read clockwise from `bearingStart` and as a full turn where the two are equal. Left
82
+ * out for a circle.
83
+ * @returns The pole the reach holds, the nearer one where it holds both, or null.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * import { zoneReachPole } from "@mountaya/studio";
88
+ *
89
+ * zoneReachPole([20, 60], 3_400_000); // "north": the pole is about 3336 km away
90
+ * zoneReachPole([20, 60], 3_400_000, { bearingStart: 45, bearingEnd: 135 }); // null
91
+ * ```
92
+ */
93
+ declare const zoneReachPole: (center: LngLat, reachMeters: number, sweep?: {
94
+ readonly bearingEnd: number;
95
+ readonly bearingStart: number;
96
+ } | undefined) => ZonePole | null;
97
+ /**
98
+ * zoneCircleParamsSchema validates the parametric inputs to a circle zone: a center [lng, lat],
99
+ * a positive radius in meters, and an optional edge count. It is the Zod source of truth shared
100
+ * by the runtime builder, its TS type, and the JSON Schema the agent tool hands a model, so
101
+ * "blast radius / danger radius / exclusion radius from a point + radius" is one validated
102
+ * shape end to end.
103
+ *
104
+ * A circle whose reach holds a pole is refused on `radiusMeters`, with the pole named
105
+ * ({@link zoneReachPole}), and so is one too small to enclose an area a zone is stored as, a
106
+ * circle under about a meter across.
107
+ */
108
+ declare const zoneCircleParamsSchema: z$1.ZodObject<{
109
+ center: z$1.ZodTuple<[z$1.ZodNumber, z$1.ZodNumber], null>;
110
+ radiusMeters: z$1.ZodNumber;
111
+ segments: z$1.ZodOptional<z$1.ZodNumber>;
112
+ }, z$1.core.$strip>;
113
+ /**
114
+ * ZoneCircleParams is the parametric circle input, derived from
115
+ * zoneCircleParamsSchema.
116
+ */
117
+ type ZoneCircleParams = z$1.infer<typeof zoneCircleParamsSchema>;
118
+ /**
119
+ * zoneSectorParamsSchema validates the parametric inputs to a sector (pie-slice)
120
+ * zone: a center, a positive radius, the start and end compass bearings of the
121
+ * sweep, and an optional arc-point count. It backs "avalanche aspect / wind /
122
+ * search bearing / line-of-sight cone from a center + bearing range + radius".
123
+ *
124
+ * A sector whose reach holds a pole, the pole within its sweep and its radius, is refused on
125
+ * `radiusMeters`, with the pole named ({@link zoneReachPole}). So is one too small to enclose an
126
+ * area a zone is stored as: a radius or a sweep that leaves the slice under about a meter
127
+ * across, and a radius that reaches the far side of the planet, where the arc is one place.
128
+ */
129
+ declare const zoneSectorParamsSchema: z$1.ZodObject<{
130
+ arcPoints: z$1.ZodOptional<z$1.ZodNumber>;
131
+ bearingEnd: z$1.ZodNumber;
132
+ bearingStart: z$1.ZodNumber;
133
+ center: z$1.ZodTuple<[z$1.ZodNumber, z$1.ZodNumber], null>;
134
+ radiusMeters: z$1.ZodNumber;
135
+ }, z$1.core.$strip>;
136
+ /**
137
+ * ZoneSectorParams is the parametric sector input, derived from
138
+ * zoneSectorParamsSchema.
139
+ */
140
+ type ZoneSectorParams = z$1.infer<typeof zoneSectorParamsSchema>;
141
+ /**
142
+ * zoneSensorParamsSchema validates the parametric inputs to a sensor (annular sector or
143
+ * swept-coverage) zone: a center, an inner and outer radius, the start and end bearings of the
144
+ * sweep, and an optional arc-point count. A refine enforces the outer radius exceeds the inner
145
+ * so the annulus has positive width. It backs "antenna / drone / observation coverage": the
146
+ * same swept-polygon family TerraDrawSensorMode draws interactively, expressed as a closed form
147
+ * the agent can specify directly.
148
+ *
149
+ * A sensor whose reach holds a pole, the pole within its sweep and its outer radius, is refused
150
+ * on `outerRadiusMeters`, with the pole named ({@link zoneReachPole}). So is one too small to
151
+ * enclose an area a zone is stored as: an outer radius, a sweep or a band between the two radii
152
+ * that leaves the footprint under about a meter across.
153
+ */
154
+ declare const zoneSensorParamsSchema: z$1.ZodObject<{
155
+ arcPoints: z$1.ZodOptional<z$1.ZodNumber>;
156
+ bearingEnd: z$1.ZodNumber;
157
+ bearingStart: z$1.ZodNumber;
158
+ center: z$1.ZodTuple<[z$1.ZodNumber, z$1.ZodNumber], null>;
159
+ innerRadiusMeters: z$1.ZodNumber;
160
+ outerRadiusMeters: z$1.ZodNumber;
161
+ }, z$1.core.$strip>;
162
+ /**
163
+ * ZoneSensorParams is the parametric sensor input, derived from
164
+ * zoneSensorParamsSchema.
165
+ */
166
+ type ZoneSensorParams = z$1.infer<typeof zoneSensorParamsSchema>;
167
+ /**
168
+ * destinationPoint returns the [lng, lat] reached by travelling distanceMeters from origin along
169
+ * bearingDeg (0 = north, clockwise), on a sphere of radius EARTH_RADIUS_METERS.
170
+ *
171
+ * It is the spherical law-of-cosines destination formula, the great-circle model the haversine
172
+ * distance uses, inverted. An offset is therefore geodesically reasonable at the city-to-region
173
+ * radii a zone covers, well within a degree of the planar approximation the rest of the studio
174
+ * relies on.
175
+ *
176
+ * It answers one position, so its longitude is brought within -180 (included) and 180
177
+ * (excluded): 50 km east of `[179.9, 0]` is near `[-179.65, 0]`. A ring is another matter. The
178
+ * builders below offset every position of a ring from its center and keep each longitude
179
+ * counted on from the center's ({@link zoneCircleGeometry}), since two positions wrapped one by
180
+ * one land on opposite edges of the map.
181
+ */
182
+ declare const destinationPoint: (origin: LngLat, distanceMeters: number, bearingDeg: number) => Position;
183
+ /**
184
+ * zoneCircleGeometry builds a GeoJSON Polygon approximating a geodesic circle of radiusMeters
185
+ * around center, sampled at `segments` evenly spaced bearings. The ring is closed: its last
186
+ * position repeats its first. It is the geometry behind a circle zone (a blast, danger or
187
+ * exclusion radius), shared by the agent's parametric proposal and any in-app default, and the
188
+ * shape the TerraDraw circle mode draws interactively.
189
+ *
190
+ * A ring's longitudes are counted on from its center's, in this builder and in
191
+ * {@link zoneSectorGeometry} and {@link zoneSensorGeometry}. A zone astride the antimeridian is
192
+ * therefore one ring whose longitudes run past 180, or below -180: a circle of 50 km around
193
+ * `[179.9, -16.8]` spans about 179.43 to 180.37. No two neighbours on a ring stand half a turn
194
+ * apart, so a planar reader (a map, a geometry column) draws the disc, where a ring wrapped
195
+ * position by position jumps across the map and encloses every other longitude. A reader that
196
+ * needs each longitude within -180 and 180 brings it back by whole turns, and cuts the shape at
197
+ * the antimeridian if it needs a ring to stay on one side.
198
+ *
199
+ * A circle that holds a pole is outside the rule: its ring goes once round the pole, and no
200
+ * planar ring states that. {@link zoneCircleParamsSchema} refuses one, as the sector's and the
201
+ * sensor's schemas refuse theirs ({@link zoneReachPole}), so a builder is handed parameters its
202
+ * schema took and checks none of this again.
203
+ */
204
+ declare const zoneCircleGeometry: (params: ZoneCircleParams) => Polygon;
205
+ /**
206
+ * zoneSectorGeometry builds a GeoJSON Polygon pie-slice: the center, an arc of
207
+ * `arcPoints` positions swept from bearingStart to bearingEnd at radiusMeters,
208
+ * and back to the center. The ring is explicitly closed. It is the geometry behind a sector
209
+ * zone: an avalanche-aspect band, a search-bearing or line-of-sight cone.
210
+ *
211
+ * A full-turn sweep (equal bearings, or 0 and 360) is the disc, and answers the ring
212
+ * {@link zoneCircleGeometry} builds, in `arcPoints` edges and never fewer than a circle takes.
213
+ * Built as a slice it would run out to the arc along one radius and back along the same one,
214
+ * a ring that touches itself. A sweep that stops short of the whole turn by less than an outline
215
+ * can hold, its far end within about a meter of the radius it set out along, is the disc too,
216
+ * for the same reason.
217
+ *
218
+ * Arc positions that land on one place are one position of the ring, so a sweep of next to no
219
+ * angle is drawn in fewer positions than `arcPoints`. {@link zoneSectorParamsSchema} refuses a
220
+ * sector too small to enclose an area, and a builder is handed parameters its schema took.
221
+ */
222
+ declare const zoneSectorGeometry: (params: ZoneSectorParams) => Polygon;
223
+ /**
224
+ * zoneSensorGeometry builds a GeoJSON Polygon annular sector (a swept-coverage
225
+ * "sensor" footprint): the outer arc swept from bearingStart to bearingEnd at
226
+ * outerRadiusMeters, then the inner arc swept back at innerRadiusMeters, closing
227
+ * the band. The ring is explicitly closed. It is the geometry behind a sensor zone: an
228
+ * antenna, a drone or an observation coverage footprint, the closed-form expression of the
229
+ * swept polygon TerraDrawSensorMode draws interactively.
230
+ *
231
+ * A full-turn sweep (equal bearings, or 0 and 360) answers one ring, cut by a slit along the
232
+ * start bearing: the outer circle, in along one edge of the slit, the inner circle backwards, and
233
+ * out along the other edge. The area inside the inner radius is no part of the zone, and it is
234
+ * not stated as a Polygon of two rings, the inner circle as a hole: a zone's shape is one ring,
235
+ * and the zone editor holds no ring with a hole. The slit has a width, so the ring neither
236
+ * retraces nor touches itself, which the API refuses: its two edges open to either side of the
237
+ * start bearing by the least angle that keeps them about two meters apart at the inner radius,
238
+ * where they are nearest, and the band keeps the rest of its turn. Each circle is drawn in
239
+ * `arcPoints` positions, and in nine at least, the fewest that go round. A sweep that stops
240
+ * short of the whole turn by less than an outline can hold, on either arc, is that ring too.
241
+ *
242
+ * A full turn whose inner circle is too small to cut a slit beside, one under a few meters
243
+ * across, is the disc of the outer radius, the ring {@link zoneCircleGeometry} builds there, as
244
+ * a full-turn sector is: an inner circle that small is one place on the map, and no hole a ring
245
+ * goes round.
246
+ *
247
+ * Arc positions that land on one place are one position of the ring, so a band whose inner
248
+ * radius is next to nothing is drawn as the slice it is. {@link zoneSensorParamsSchema} refuses
249
+ * a sensor too small to enclose an area, and a builder is handed parameters its schema took.
250
+ */
251
+ declare const zoneSensorGeometry: (params: ZoneSensorParams) => Polygon;
252
+ export { ZoneSensorParams as a, zoneCircleGeometry as c, zoneSectorGeometry as d, zoneSectorParamsSchema as f, ZoneSectorParams as i, zoneCircleParamsSchema as l, zoneSensorParamsSchema as m, ZoneCircleParams as n, destinationPoint as o, zoneSensorGeometry as p, ZonePole as r, wrapZoneGeometryPastRange as s, LngLat$1 as t, zoneReachPole as u };
253
+ //# sourceMappingURL=chunk-De0vAASv.d.ts.map