@ksp-gonogo/sitrep-sdk 1.0.0-rc.21 → 2.0.0-rc.23

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 (489) hide show
  1. package/README.md +6 -0
  2. package/dist/__generated__/command-map.d.ts +140 -11
  3. package/dist/__generated__/command-map.d.ts.map +1 -1
  4. package/dist/__generated__/command-map.js +6 -3
  5. package/dist/__generated__/command-map.js.map +1 -1
  6. package/dist/__generated__/contract.d.ts +591 -425
  7. package/dist/__generated__/contract.d.ts.map +1 -1
  8. package/dist/__generated__/contract.js +34 -4
  9. package/dist/__generated__/contract.js.map +1 -1
  10. package/dist/__generated__/error-codes.d.ts +46 -55
  11. package/dist/__generated__/error-codes.d.ts.map +1 -1
  12. package/dist/__generated__/error-codes.js +76 -69
  13. package/dist/__generated__/error-codes.js.map +1 -1
  14. package/dist/__generated__/test-theme.d.ts +3 -0
  15. package/dist/__generated__/test-theme.d.ts.map +1 -1
  16. package/dist/__generated__/test-theme.js +3 -0
  17. package/dist/__generated__/test-theme.js.map +1 -1
  18. package/dist/__generated__/topic-map.d.ts +90 -2
  19. package/dist/__generated__/topic-map.d.ts.map +1 -1
  20. package/dist/__generated__/topic-map.js +2 -0
  21. package/dist/__generated__/topic-map.js.map +1 -1
  22. package/dist/__generated__/units.d.ts.map +1 -1
  23. package/dist/__generated__/units.js +89 -47
  24. package/dist/__generated__/units.js.map +1 -1
  25. package/dist/api/alarm-request.d.ts +6 -1
  26. package/dist/api/alarm-request.d.ts.map +1 -1
  27. package/dist/api/alarm-request.js +7 -1
  28. package/dist/api/alarm-request.js.map +1 -1
  29. package/dist/api/contribution-slots.d.ts +87 -17
  30. package/dist/api/contribution-slots.d.ts.map +1 -1
  31. package/dist/api/coverage/CoverageMaskCache.d.ts +1 -1
  32. package/dist/api/coverage/CoverageMaskCache.js +1 -1
  33. package/dist/api/coverage-source.d.ts +3 -1
  34. package/dist/api/coverage-source.d.ts.map +1 -1
  35. package/dist/api/coverage-source.js +3 -1
  36. package/dist/api/coverage-source.js.map +1 -1
  37. package/dist/api/framework-reads.d.ts +20 -0
  38. package/dist/api/framework-reads.d.ts.map +1 -0
  39. package/dist/api/framework-reads.js +30 -0
  40. package/dist/api/framework-reads.js.map +1 -0
  41. package/dist/api/host.d.ts +8 -5
  42. package/dist/api/host.d.ts.map +1 -1
  43. package/dist/api/host.js.map +1 -1
  44. package/dist/api/index.d.ts +96 -17
  45. package/dist/api/index.d.ts.map +1 -1
  46. package/dist/api/index.js +91 -10
  47. package/dist/api/index.js.map +1 -1
  48. package/dist/api/logger.d.ts +14 -2
  49. package/dist/api/logger.d.ts.map +1 -1
  50. package/dist/api/logger.js +14 -2
  51. package/dist/api/logger.js.map +1 -1
  52. package/dist/api/plot-layers.d.ts +81 -6
  53. package/dist/api/plot-layers.d.ts.map +1 -1
  54. package/dist/api/plot-layers.js +4 -3
  55. package/dist/api/plot-layers.js.map +1 -1
  56. package/dist/api/plots.d.ts +19 -0
  57. package/dist/api/plots.d.ts.map +1 -1
  58. package/dist/api/registry.d.ts +11 -0
  59. package/dist/api/registry.d.ts.map +1 -1
  60. package/dist/api/registry.js.map +1 -1
  61. package/dist/api/settings/SettingsContext.d.ts +5 -4
  62. package/dist/api/settings/SettingsContext.d.ts.map +1 -1
  63. package/dist/api/settings/SettingsContext.js +13 -4
  64. package/dist/api/settings/SettingsContext.js.map +1 -1
  65. package/dist/api/settings/SettingsService.d.ts +3 -0
  66. package/dist/api/settings/SettingsService.d.ts.map +1 -1
  67. package/dist/api/settings/SettingsService.js +3 -0
  68. package/dist/api/settings/SettingsService.js.map +1 -1
  69. package/dist/api/settings/store.d.ts +3 -1
  70. package/dist/api/settings/store.d.ts.map +1 -1
  71. package/dist/api/settings/store.js +3 -1
  72. package/dist/api/settings/store.js.map +1 -1
  73. package/dist/api/slots.d.ts +94 -17
  74. package/dist/api/slots.d.ts.map +1 -1
  75. package/dist/api/station-brokers.d.ts +2 -1
  76. package/dist/api/station-brokers.d.ts.map +1 -1
  77. package/dist/api/station-brokers.js +2 -1
  78. package/dist/api/station-brokers.js.map +1 -1
  79. package/dist/api/stock-bodies.d.ts.map +1 -1
  80. package/dist/api/stock-bodies.js +6 -0
  81. package/dist/api/stock-bodies.js.map +1 -1
  82. package/dist/api/tiny-size.d.ts +2 -0
  83. package/dist/api/tiny-size.d.ts.map +1 -1
  84. package/dist/api/tiny-size.js +6 -1
  85. package/dist/api/tiny-size.js.map +1 -1
  86. package/dist/api/tone.d.ts +7 -4
  87. package/dist/api/tone.d.ts.map +1 -1
  88. package/dist/api/tone.js.map +1 -1
  89. package/dist/api/transport.d.ts +10 -2
  90. package/dist/api/transport.d.ts.map +1 -1
  91. package/dist/api/types.d.ts +179 -120
  92. package/dist/api/types.d.ts.map +1 -1
  93. package/dist/binary-frame.d.ts +26 -25
  94. package/dist/binary-frame.d.ts.map +1 -1
  95. package/dist/binary-frame.js +25 -25
  96. package/dist/binary-frame.js.map +1 -1
  97. package/dist/client.d.ts.map +1 -1
  98. package/dist/client.js +2 -0
  99. package/dist/client.js.map +1 -1
  100. package/dist/combine-readings.d.ts +8 -4
  101. package/dist/combine-readings.d.ts.map +1 -1
  102. package/dist/combine-readings.js +6 -4
  103. package/dist/combine-readings.js.map +1 -1
  104. package/dist/command-delay.d.ts +6 -0
  105. package/dist/command-delay.d.ts.map +1 -1
  106. package/dist/command-delay.js.map +1 -1
  107. package/dist/commands.d.ts +1 -1
  108. package/dist/commands.d.ts.map +1 -1
  109. package/dist/compat-versions.d.ts +1 -1
  110. package/dist/compat-versions.d.ts.map +1 -1
  111. package/dist/compat-versions.js +2 -2
  112. package/dist/compat-versions.js.map +1 -1
  113. package/dist/contract-enum-names.d.ts +2 -3
  114. package/dist/contract-enum-names.d.ts.map +1 -1
  115. package/dist/contract-enum-names.js +2 -3
  116. package/dist/contract-enum-names.js.map +1 -1
  117. package/dist/enum-names.d.ts +5 -3
  118. package/dist/enum-names.d.ts.map +1 -1
  119. package/dist/enum-names.js +5 -3
  120. package/dist/enum-names.js.map +1 -1
  121. package/dist/envelope.d.ts +3 -3
  122. package/dist/envelope.d.ts.map +1 -1
  123. package/dist/flight/BufferedDataSource.d.ts.map +1 -1
  124. package/dist/flight/BufferedDataSource.js +4 -2
  125. package/dist/flight/BufferedDataSource.js.map +1 -1
  126. package/dist/flight/types.d.ts +3 -2
  127. package/dist/flight/types.d.ts.map +1 -1
  128. package/dist/frames/index.d.ts +19 -17
  129. package/dist/frames/index.d.ts.map +1 -1
  130. package/dist/frames/index.js +13 -12
  131. package/dist/frames/index.js.map +1 -1
  132. package/dist/index.d.ts +20 -3
  133. package/dist/index.d.ts.map +1 -1
  134. package/dist/index.js +18 -3
  135. package/dist/index.js.map +1 -1
  136. package/dist/ksp-enum-names.d.ts +23 -8
  137. package/dist/ksp-enum-names.d.ts.map +1 -1
  138. package/dist/ksp-enum-names.js +20 -8
  139. package/dist/ksp-enum-names.js.map +1 -1
  140. package/dist/media/radio-support.d.ts +12 -3
  141. package/dist/media/radio-support.d.ts.map +1 -1
  142. package/dist/media/radio-support.js +12 -3
  143. package/dist/media/radio-support.js.map +1 -1
  144. package/dist/perf/PerfBudget.d.ts +7 -5
  145. package/dist/perf/PerfBudget.d.ts.map +1 -1
  146. package/dist/perf/PerfBudget.js +8 -6
  147. package/dist/perf/PerfBudget.js.map +1 -1
  148. package/dist/reading.d.ts +12 -2
  149. package/dist/reading.d.ts.map +1 -1
  150. package/dist/reading.js +7 -2
  151. package/dist/reading.js.map +1 -1
  152. package/dist/reads-index.json +3675 -0
  153. package/dist/spine/body-pose.d.ts +85 -0
  154. package/dist/spine/body-pose.d.ts.map +1 -0
  155. package/dist/spine/body-pose.js +166 -0
  156. package/dist/spine/body-pose.js.map +1 -0
  157. package/dist/spine/capability-lock.d.ts +6 -2
  158. package/dist/spine/capability-lock.d.ts.map +1 -1
  159. package/dist/spine/capability-lock.js +8 -2
  160. package/dist/spine/capability-lock.js.map +1 -1
  161. package/dist/spine/catalogue-elements.d.ts +28 -0
  162. package/dist/spine/catalogue-elements.d.ts.map +1 -0
  163. package/dist/spine/catalogue-elements.js +63 -0
  164. package/dist/spine/catalogue-elements.js.map +1 -0
  165. package/dist/spine/celestial-facts.d.ts +5 -7
  166. package/dist/spine/celestial-facts.d.ts.map +1 -1
  167. package/dist/spine/celestial-facts.js +10 -21
  168. package/dist/spine/celestial-facts.js.map +1 -1
  169. package/dist/spine/client-timeline.d.ts +10 -12
  170. package/dist/spine/client-timeline.d.ts.map +1 -1
  171. package/dist/spine/client-timeline.js.map +1 -1
  172. package/dist/spine/client.d.ts +31 -0
  173. package/dist/spine/client.d.ts.map +1 -1
  174. package/dist/spine/client.js +97 -19
  175. package/dist/spine/client.js.map +1 -1
  176. package/dist/spine/command-gate.d.ts +13 -11
  177. package/dist/spine/command-gate.d.ts.map +1 -1
  178. package/dist/spine/command-gate.js +2 -2
  179. package/dist/spine/command-gate.js.map +1 -1
  180. package/dist/spine/command-group.d.ts +62 -0
  181. package/dist/spine/command-group.d.ts.map +1 -0
  182. package/dist/spine/command-group.js +172 -0
  183. package/dist/spine/command-group.js.map +1 -0
  184. package/dist/spine/comms-delay-reckoning.js.map +1 -1
  185. package/dist/spine/comms-journey.d.ts +9 -0
  186. package/dist/spine/comms-journey.d.ts.map +1 -1
  187. package/dist/spine/comms-journey.js +27 -0
  188. package/dist/spine/comms-journey.js.map +1 -1
  189. package/dist/spine/comms-path-geometry.d.ts +3 -3
  190. package/dist/spine/comms-path-geometry.d.ts.map +1 -1
  191. package/dist/spine/comms-path-geometry.js.map +1 -1
  192. package/dist/spine/connection-error-warning.d.ts +1 -1
  193. package/dist/spine/connection-error-warning.js +1 -1
  194. package/dist/spine/context.d.ts.map +1 -1
  195. package/dist/spine/context.js +4 -0
  196. package/dist/spine/context.js.map +1 -1
  197. package/dist/spine/contributions.d.ts +13 -13
  198. package/dist/spine/contributions.js +13 -13
  199. package/dist/spine/core-reckoners.d.ts.map +1 -1
  200. package/dist/spine/core-reckoners.js +2 -2
  201. package/dist/spine/core-reckoners.js.map +1 -1
  202. package/dist/spine/held-command-actions.d.ts +3 -0
  203. package/dist/spine/held-command-actions.d.ts.map +1 -1
  204. package/dist/spine/held-command-actions.js +12 -7
  205. package/dist/spine/held-command-actions.js.map +1 -1
  206. package/dist/spine/impact-point.d.ts.map +1 -1
  207. package/dist/spine/impact-point.js +6 -29
  208. package/dist/spine/impact-point.js.map +1 -1
  209. package/dist/spine/index.d.ts +5 -0
  210. package/dist/spine/index.d.ts.map +1 -1
  211. package/dist/spine/index.js +5 -0
  212. package/dist/spine/index.js.map +1 -1
  213. package/dist/spine/kepler-reckoning.d.ts +2 -2
  214. package/dist/spine/kepler-reckoning.d.ts.map +1 -1
  215. package/dist/spine/kepler-reckoning.js.map +1 -1
  216. package/dist/spine/kepler.d.ts +8 -6
  217. package/dist/spine/kepler.d.ts.map +1 -1
  218. package/dist/spine/kepler.js +3 -1
  219. package/dist/spine/kepler.js.map +1 -1
  220. package/dist/spine/lagrange.d.ts +6 -6
  221. package/dist/spine/lagrange.d.ts.map +1 -1
  222. package/dist/spine/lagrange.js.map +1 -1
  223. package/dist/spine/lifecycle.d.ts +14 -0
  224. package/dist/spine/lifecycle.d.ts.map +1 -1
  225. package/dist/spine/lifecycle.js.map +1 -1
  226. package/dist/spine/lock-scope.d.ts +11 -1
  227. package/dist/spine/lock-scope.d.ts.map +1 -1
  228. package/dist/spine/lock-scope.js.map +1 -1
  229. package/dist/spine/map-command.d.ts +3 -11
  230. package/dist/spine/map-command.d.ts.map +1 -1
  231. package/dist/spine/map-command.js +3 -11
  232. package/dist/spine/map-command.js.map +1 -1
  233. package/dist/spine/mod-settings.d.ts.map +1 -1
  234. package/dist/spine/mod-settings.js +1 -0
  235. package/dist/spine/mod-settings.js.map +1 -1
  236. package/dist/spine/never-reckonable.d.ts.map +1 -1
  237. package/dist/spine/never-reckonable.js +8 -6
  238. package/dist/spine/never-reckonable.js.map +1 -1
  239. package/dist/spine/orbit-patches.d.ts +16 -4
  240. package/dist/spine/orbit-patches.d.ts.map +1 -1
  241. package/dist/spine/orbit-patches.js +12 -5
  242. package/dist/spine/orbit-patches.js.map +1 -1
  243. package/dist/spine/orbit-trajectory.d.ts +60 -3
  244. package/dist/spine/orbit-trajectory.d.ts.map +1 -1
  245. package/dist/spine/orbit-trajectory.js +133 -40
  246. package/dist/spine/orbit-trajectory.js.map +1 -1
  247. package/dist/spine/orbital-solve.js +1 -1
  248. package/dist/spine/own-craft-vantage.d.ts.map +1 -1
  249. package/dist/spine/own-craft-vantage.js +1 -0
  250. package/dist/spine/own-craft-vantage.js.map +1 -1
  251. package/dist/spine/past-track.d.ts +7 -7
  252. package/dist/spine/past-track.js +7 -7
  253. package/dist/spine/phase-angle.d.ts +19 -0
  254. package/dist/spine/phase-angle.d.ts.map +1 -0
  255. package/dist/spine/phase-angle.js +47 -0
  256. package/dist/spine/phase-angle.js.map +1 -0
  257. package/dist/spine/powered-reckoning.js.map +1 -1
  258. package/dist/spine/processors.d.ts +4 -1
  259. package/dist/spine/processors.d.ts.map +1 -1
  260. package/dist/spine/processors.js.map +1 -1
  261. package/dist/spine/reckoners.d.ts +3 -6
  262. package/dist/spine/reckoners.d.ts.map +1 -1
  263. package/dist/spine/reckoners.js +3 -6
  264. package/dist/spine/reckoners.js.map +1 -1
  265. package/dist/spine/reference-frame.d.ts +14 -14
  266. package/dist/spine/reference-frame.d.ts.map +1 -1
  267. package/dist/spine/reference-frame.js +3 -64
  268. package/dist/spine/reference-frame.js.map +1 -1
  269. package/dist/spine/settings-registry.d.ts +17 -9
  270. package/dist/spine/settings-registry.d.ts.map +1 -1
  271. package/dist/spine/settings-registry.js.map +1 -1
  272. package/dist/spine/settings-tabs.d.ts +4 -3
  273. package/dist/spine/settings-tabs.d.ts.map +1 -1
  274. package/dist/spine/settings-tabs.js.map +1 -1
  275. package/dist/spine/target-range-reckoning.d.ts.map +1 -1
  276. package/dist/spine/target-range-reckoning.js.map +1 -1
  277. package/dist/spine/timeline-store.d.ts +3 -1
  278. package/dist/spine/timeline-store.d.ts.map +1 -1
  279. package/dist/spine/timeline-store.js +2 -2
  280. package/dist/spine/timeline-store.js.map +1 -1
  281. package/dist/spine/topic-ownership.d.ts +2 -2
  282. package/dist/spine/topic-ownership.js +2 -2
  283. package/dist/spine/uplink-clients.d.ts +4 -4
  284. package/dist/spine/uplink-clients.d.ts.map +1 -1
  285. package/dist/spine/uplink-clients.js +1 -0
  286. package/dist/spine/uplink-clients.js.map +1 -1
  287. package/dist/spine/use-body-states.d.ts +3 -7
  288. package/dist/spine/use-body-states.d.ts.map +1 -1
  289. package/dist/spine/use-body-states.js +3 -7
  290. package/dist/spine/use-body-states.js.map +1 -1
  291. package/dist/spine/use-command.d.ts.map +1 -1
  292. package/dist/spine/use-command.js +151 -109
  293. package/dist/spine/use-command.js.map +1 -1
  294. package/dist/spine/use-data-sources.d.ts +2 -5
  295. package/dist/spine/use-data-sources.d.ts.map +1 -1
  296. package/dist/spine/use-data-sources.js.map +1 -1
  297. package/dist/spine/use-late-telemetry-subscribe.d.ts.map +1 -1
  298. package/dist/spine/use-late-telemetry-subscribe.js +1 -0
  299. package/dist/spine/use-late-telemetry-subscribe.js.map +1 -1
  300. package/dist/spine/use-orbit-curve.d.ts +33 -0
  301. package/dist/spine/use-orbit-curve.d.ts.map +1 -0
  302. package/dist/spine/use-orbit-curve.js +28 -0
  303. package/dist/spine/use-orbit-curve.js.map +1 -0
  304. package/dist/spine/use-orbit-trajectory.d.ts +6 -1
  305. package/dist/spine/use-orbit-trajectory.d.ts.map +1 -1
  306. package/dist/spine/use-orbit-trajectory.js +44 -2
  307. package/dist/spine/use-orbit-trajectory.js.map +1 -1
  308. package/dist/spine/use-selected-vantage.d.ts.map +1 -1
  309. package/dist/spine/use-selected-vantage.js +1 -0
  310. package/dist/spine/use-selected-vantage.js.map +1 -1
  311. package/dist/spine/use-system-instant.d.ts +16 -0
  312. package/dist/spine/use-system-instant.d.ts.map +1 -0
  313. package/dist/spine/use-system-instant.js +20 -0
  314. package/dist/spine/use-system-instant.js.map +1 -0
  315. package/dist/spine/use-transmissions.d.ts.map +1 -1
  316. package/dist/spine/use-transmissions.js +1 -0
  317. package/dist/spine/use-transmissions.js.map +1 -1
  318. package/dist/spine/view-clock.d.ts +1 -1
  319. package/dist/spine/view-clock.d.ts.map +1 -1
  320. package/dist/spine/view-clock.js +13 -3
  321. package/dist/spine/view-clock.js.map +1 -1
  322. package/dist/system-instant.d.ts +16 -0
  323. package/dist/system-instant.d.ts.map +1 -0
  324. package/dist/system-instant.js +20 -0
  325. package/dist/system-instant.js.map +1 -0
  326. package/dist/testing/console-logger.d.ts +3 -3
  327. package/dist/testing/console-logger.js +3 -3
  328. package/dist/testing/fake-wall-clock.d.ts +4 -2
  329. package/dist/testing/fake-wall-clock.d.ts.map +1 -1
  330. package/dist/testing/fake-wall-clock.js +4 -2
  331. package/dist/testing/fake-wall-clock.js.map +1 -1
  332. package/dist/testing/install-act-gate-stretch.d.ts +9 -0
  333. package/dist/testing/install-act-gate-stretch.d.ts.map +1 -1
  334. package/dist/testing/install-act-gate-stretch.js +9 -0
  335. package/dist/testing/install-act-gate-stretch.js.map +1 -1
  336. package/dist/testing/install-real-test-host.d.ts +4 -1
  337. package/dist/testing/install-real-test-host.d.ts.map +1 -1
  338. package/dist/testing/install-real-test-host.js +2 -0
  339. package/dist/testing/install-real-test-host.js.map +1 -1
  340. package/dist/testing/memory-storage.d.ts +2 -3
  341. package/dist/testing/memory-storage.d.ts.map +1 -1
  342. package/dist/testing/memory-storage.js +6 -5
  343. package/dist/testing/memory-storage.js.map +1 -1
  344. package/dist/testing/mock-data-source.d.ts +2 -2
  345. package/dist/testing/render.d.ts +4 -2
  346. package/dist/testing/render.d.ts.map +1 -1
  347. package/dist/testing/render.js +4 -2
  348. package/dist/testing/render.js.map +1 -1
  349. package/dist/testing/stub-transport.d.ts +6 -0
  350. package/dist/testing/stub-transport.d.ts.map +1 -1
  351. package/dist/testing/stub-transport.js +64 -52
  352. package/dist/testing/stub-transport.js.map +1 -1
  353. package/dist/timeline.d.ts +14 -6
  354. package/dist/timeline.d.ts.map +1 -1
  355. package/dist/topic-fields.d.ts +1 -0
  356. package/dist/topic-fields.d.ts.map +1 -1
  357. package/dist/topic-fields.js.map +1 -1
  358. package/dist/topics.d.ts +42 -2
  359. package/dist/topics.d.ts.map +1 -1
  360. package/dist/topics.js +33 -24
  361. package/dist/topics.js.map +1 -1
  362. package/dist/unit-system/registry.d.ts +11 -0
  363. package/dist/unit-system/registry.d.ts.map +1 -1
  364. package/dist/unit-system/registry.js.map +1 -1
  365. package/dist/unit-system/value.d.ts +3 -0
  366. package/dist/unit-system/value.d.ts.map +1 -1
  367. package/dist/unit-system/value.js.map +1 -1
  368. package/dist/units.js +1 -1
  369. package/dist/uplink-externals.d.ts +9 -4
  370. package/dist/uplink-externals.d.ts.map +1 -1
  371. package/dist/uplink-externals.js +9 -4
  372. package/dist/uplink-externals.js.map +1 -1
  373. package/dist/uplink-manifest.d.ts +62 -16
  374. package/dist/uplink-manifest.d.ts.map +1 -1
  375. package/dist/uplink-manifest.js.map +1 -1
  376. package/package.json +4 -3
  377. package/src/__generated__/command-map.ts +140 -10
  378. package/src/__generated__/contract.ts +598 -429
  379. package/src/__generated__/error-codes.ts +76 -69
  380. package/src/__generated__/test-theme.ts +3 -0
  381. package/src/__generated__/topic-map.ts +92 -0
  382. package/src/__generated__/units.json +630 -52
  383. package/src/__generated__/units.ts +89 -47
  384. package/src/api/alarm-request.ts +7 -1
  385. package/src/api/contribution-slots.ts +95 -20
  386. package/src/api/coverage/CoverageMaskCache.ts +1 -1
  387. package/src/api/coverage-source.ts +3 -1
  388. package/src/api/framework-reads.ts +29 -0
  389. package/src/api/host.ts +13 -4
  390. package/src/api/index.ts +113 -14
  391. package/src/api/logger.ts +14 -2
  392. package/src/api/plot-layers.ts +72 -6
  393. package/src/api/plots.ts +19 -0
  394. package/src/api/registry.ts +11 -0
  395. package/src/api/settings/SettingsContext.tsx +17 -5
  396. package/src/api/settings/SettingsService.ts +3 -0
  397. package/src/api/settings/store.ts +3 -1
  398. package/src/api/slots.ts +97 -28
  399. package/src/api/station-brokers.ts +2 -1
  400. package/src/api/stock-bodies.ts +6 -0
  401. package/src/api/tiny-size.ts +6 -1
  402. package/src/api/tone.ts +7 -4
  403. package/src/api/transport.ts +13 -2
  404. package/src/api/types.ts +214 -154
  405. package/src/binary-frame.ts +26 -25
  406. package/src/client.ts +2 -0
  407. package/src/combine-readings.ts +8 -4
  408. package/src/command-delay.ts +6 -0
  409. package/src/compat-versions.ts +2 -2
  410. package/src/contract-enum-names.ts +2 -3
  411. package/src/enum-names.ts +5 -3
  412. package/src/envelope.ts +9 -1
  413. package/src/flight/BufferedDataSource.ts +4 -2
  414. package/src/flight/types.ts +3 -2
  415. package/src/frames/index.ts +29 -16
  416. package/src/index.ts +32 -0
  417. package/src/ksp-enum-names.ts +23 -8
  418. package/src/media/radio-support.ts +12 -3
  419. package/src/perf/PerfBudget.ts +8 -6
  420. package/src/reading.ts +20 -4
  421. package/src/spine/body-pose.ts +251 -0
  422. package/src/spine/capability-lock.ts +17 -4
  423. package/src/spine/catalogue-elements.ts +75 -0
  424. package/src/spine/celestial-facts.ts +10 -35
  425. package/src/spine/client-timeline.ts +10 -12
  426. package/src/spine/client.ts +127 -19
  427. package/src/spine/command-gate.ts +13 -11
  428. package/src/spine/command-group.ts +278 -0
  429. package/src/spine/comms-delay-reckoning.ts +2 -2
  430. package/src/spine/comms-journey.ts +29 -0
  431. package/src/spine/comms-path-geometry.ts +4 -4
  432. package/src/spine/connection-error-warning.ts +1 -1
  433. package/src/spine/context.tsx +4 -0
  434. package/src/spine/contributions.ts +13 -13
  435. package/src/spine/core-reckoners.ts +2 -5
  436. package/src/spine/held-command-actions.ts +18 -6
  437. package/src/spine/impact-point.ts +8 -35
  438. package/src/spine/index.ts +5 -0
  439. package/src/spine/kepler-reckoning.ts +2 -2
  440. package/src/spine/kepler.ts +9 -7
  441. package/src/spine/lagrange.ts +6 -6
  442. package/src/spine/lifecycle.ts +14 -0
  443. package/src/spine/lock-scope.ts +11 -1
  444. package/src/spine/map-command.ts +3 -11
  445. package/src/spine/mod-settings.ts +1 -0
  446. package/src/spine/never-reckonable.ts +8 -6
  447. package/src/spine/orbit-patches.ts +33 -6
  448. package/src/spine/orbit-trajectory.ts +172 -57
  449. package/src/spine/orbital-solve.ts +1 -1
  450. package/src/spine/own-craft-vantage.tsx +1 -0
  451. package/src/spine/past-track.ts +7 -7
  452. package/src/spine/phase-angle.ts +51 -0
  453. package/src/spine/powered-reckoning.ts +16 -16
  454. package/src/spine/processors.ts +4 -1
  455. package/src/spine/reckoners.ts +3 -6
  456. package/src/spine/reference-frame.ts +49 -115
  457. package/src/spine/settings-registry.ts +17 -9
  458. package/src/spine/settings-tabs.ts +4 -3
  459. package/src/spine/target-range-reckoning.ts +3 -3
  460. package/src/spine/timeline-store.ts +6 -1
  461. package/src/spine/topic-ownership.ts +2 -2
  462. package/src/spine/uplink-clients.ts +5 -4
  463. package/src/spine/use-body-states.ts +3 -7
  464. package/src/spine/use-command.ts +167 -125
  465. package/src/spine/use-data-sources.ts +2 -5
  466. package/src/spine/use-late-telemetry-subscribe.ts +1 -0
  467. package/src/spine/use-orbit-curve.ts +49 -0
  468. package/src/spine/use-orbit-trajectory.ts +54 -2
  469. package/src/spine/use-selected-vantage.ts +1 -0
  470. package/src/spine/use-system-instant.ts +20 -0
  471. package/src/spine/use-transmissions.ts +1 -0
  472. package/src/spine/view-clock.ts +20 -3
  473. package/src/system-instant.ts +20 -0
  474. package/src/testing/console-logger.ts +3 -3
  475. package/src/testing/fake-wall-clock.ts +4 -2
  476. package/src/testing/install-act-gate-stretch.ts +9 -0
  477. package/src/testing/install-real-test-host.ts +6 -1
  478. package/src/testing/memory-storage.ts +6 -5
  479. package/src/testing/mock-data-source.ts +2 -2
  480. package/src/testing/render.tsx +4 -2
  481. package/src/testing/stub-transport.ts +66 -52
  482. package/src/timeline.ts +14 -6
  483. package/src/topic-fields.ts +1 -0
  484. package/src/topics.ts +59 -26
  485. package/src/unit-system/registry.ts +11 -0
  486. package/src/unit-system/value.ts +3 -0
  487. package/src/units.ts +1 -1
  488. package/src/uplink-externals.ts +9 -4
  489. package/src/uplink-manifest.ts +62 -16
@@ -406,6 +406,7 @@ export function useTelemetryClientOptional(): TelemetryClient | undefined {
406
406
  export function useStreamRecorder(
407
407
  options?: StreamRecorderOptions,
408
408
  ): StreamRecorder | undefined {
409
+ // gonogo:reads none
409
410
  const client = useTelemetryClientOptional();
410
411
  const recordAllTopics = options?.recordAllTopics ?? false;
411
412
  return useMemo(
@@ -534,6 +535,7 @@ function removeLast<Item>(stack: Item[], item: Item): void {
534
535
  }
535
536
 
536
537
  export function useViewClock(): ViewClockView {
538
+ // gonogo:reads none
537
539
  return useTelemetryStore().clock;
538
540
  }
539
541
 
@@ -546,6 +548,7 @@ export function useViewClock(): ViewClockView {
546
548
  * provider being in the tree.
547
549
  */
548
550
  export function useViewClockOptional(): ViewClockView | undefined {
551
+ // gonogo:reads none
549
552
  return useTelemetryStoreOptional()?.clock;
550
553
  }
551
554
 
@@ -652,6 +655,7 @@ function useFrameInstant(
652
655
  * predicted" distinction to wait out.
653
656
  */
654
657
  export function useUtNow(): number | undefined {
658
+ // gonogo:reads none
655
659
  const store = useTelemetryStoreOptional();
656
660
  const clock = store?.clock;
657
661
  const [utNow, setUtNow] = useState<number | undefined>(() => {
@@ -120,29 +120,29 @@ export const DEFAULT_CONTRIBUTION_PRIORITY = 1;
120
120
  * Every contribution that WINS the slot: the highest priority band present, in
121
121
  * registration order.
122
122
  *
123
- * <p>Equal priority is not a tie to break. Everyone in the winning band renders,
123
+ * Equal priority is not a tie to break. Everyone in the winning band renders,
124
124
  * which is what lets two mutually-unaware mods both put their vessels on one
125
125
  * diagram; only a STRICTLY higher band displaces. Nothing sets a priority unless
126
126
  * it means to, so the ordinary case is one band holding every contributor,
127
- * exactly as before.</p>
127
+ * exactly as before.
128
128
  *
129
- * <p>What the band buys is a host widget filling its OWN slot. It contributes
129
+ * What the band buys is a host widget filling its OWN slot. It contributes
130
130
  * what it can read at one below {@link DEFAULT_CONTRIBUTION_PRIORITY}, so a
131
131
  * career overhaul that can answer where the host cannot displaces it instead of
132
132
  * appearing beside it as a second copy of the same list. It is the contribution
133
133
  * twin of `AugmentDefinition.suppressesVanillaBase`, and it is declared by the
134
134
  * contributor rather than by the host for the same reason: the host cannot know
135
- * which of its guests supersedes it.</p>
135
+ * which of its guests supersedes it.
136
136
  *
137
- * <p>A contribution that means to render ALONGSIDE the host's own rows says so
138
- * by taking the host's band explicitly.</p>
137
+ * A contribution that means to render ALONGSIDE the host's own rows says so
138
+ * by taking the host's band explicitly.
139
139
  *
140
- * <p>Self-contributing has a cost, and it is worth knowing before choosing it: a
140
+ * Self-contributing has a cost, and it is worth knowing before choosing it: a
141
141
  * widget that reads its own data this way no longer renders anything without a
142
142
  * `WidgetMetaContext` and a `ContributionsProvider` above it, and it fails by
143
143
  * drawing an empty widget rather than by raising. See `useContributions`
144
144
  * (`@ksp-gonogo/ui-kit`) for what that costs a test, and `clearContributions`
145
- * below for the other half of it.</p>
145
+ * below for the other half of it.
146
146
  */
147
147
  export function getContributionsForSlot(slot: string): AnyContribution[] {
148
148
  const inSlot = Array.from(state().entries.values()).filter(
@@ -192,18 +192,18 @@ export function getContributionSettings(
192
192
  /**
193
193
  * For use in tests only, resets the contribution registry to empty.
194
194
  *
195
- * <p><b>It empties the registry, which includes the contributions a HOST widget
196
- * makes to its own slot.</b> Those register as a module side effect, at import,
195
+ * **It empties the registry, which includes the contributions a HOST widget
196
+ * makes to its own slot.** Those register as a module side effect, at import,
197
197
  * and nothing re-runs an import. So a test file that clears between cases leaves
198
198
  * every case after the first rendering a host with none of its own data, which
199
199
  * surfaces as a widget that draws its chrome and no content, and reads as a
200
- * telemetry fault rather than as a registry that was emptied on purpose.</p>
200
+ * telemetry fault rather than as a registry that was emptied on purpose.
201
201
  *
202
- * <p>A self-contributing widget therefore exports a function that performs its
202
+ * A self-contributing widget therefore exports a function that performs its
203
203
  * registration, for a test to call after clearing;
204
204
  * `SpaceCenterStatus/facilitiesContribution.ts`'s
205
205
  * `registerStockFacilityContribution` is the worked example. Re-registering the
206
- * identical def is a no-op, so calling it when nothing was cleared is safe.</p>
206
+ * identical def is a no-op, so calling it when nothing was cleared is safe.
207
207
  */
208
208
  export function clearContributions(): void {
209
209
  const s = state();
@@ -716,7 +716,7 @@ function registerCommsDelayReckoner(): void {
716
716
  observed,
717
717
  craft: orbitPoint.payload,
718
718
  peer: located,
719
- facts: deriveCelestialFacts(bodiesPoint?.payload?.bodies, reckonUt),
719
+ facts: deriveCelestialFacts(bodiesPoint?.payload?.bodies),
720
720
  });
721
721
  if ("declined" in fit) return fit;
722
722
  return {
@@ -780,10 +780,7 @@ function registerTargetRosterReckoner(): void {
780
780
  return { declined: { reason: "input-absent", input: "@vessel.orbit" } };
781
781
  }
782
782
  const craft = orbitPoint.payload;
783
- const facts = deriveCelestialFacts(
784
- bodiesPoint?.payload?.bodies,
785
- reckonUt,
786
- );
783
+ const facts = deriveCelestialFacts(bodiesPoint?.payload?.bodies);
787
784
  const known = knownCraftOrbits(entries, facts).filter((k) =>
788
785
  Number.isFinite(knownCraftRangeAt(craft, k, facts, reckonUt)),
789
786
  );
@@ -1,6 +1,7 @@
1
1
  import { useCallback, useMemo } from "react";
2
2
  import { isUnit } from "../unit-system/guards";
3
3
  import { isValue, type Value } from "../unit-system/value";
4
+ import type { TelemetryClient } from "./client";
4
5
  import { type HeldCommand, JOURNEY_TOPIC, readJourney } from "./comms-journey";
5
6
  import { useTelemetryClientOptional } from "./context";
6
7
  import { useLatestValue } from "./use-stream";
@@ -58,6 +59,21 @@ export function readUplinkActionReply(result: unknown): UplinkActionOutcome {
58
59
  };
59
60
  }
60
61
 
62
+ /** Sends a cancel or a send again for timeline `epoch`, and reads the reply. */
63
+ export async function sendUplinkAction(
64
+ client: TelemetryClient,
65
+ epoch: Value<"count">,
66
+ command: string,
67
+ args: Record<string, unknown>,
68
+ ): Promise<UplinkActionOutcome> {
69
+ const { result } = client.dispatch(command, { epoch, ...args });
70
+ try {
71
+ return readUplinkActionReply(await result);
72
+ } catch (error) {
73
+ return { refusal: error instanceof Error ? error.message : "refused" };
74
+ }
75
+ }
76
+
61
77
  /** The two actions a held command offers, bound to this session's client and the current timeline. */
62
78
  export interface HeldCommandActions {
63
79
  /** Cancels the command, or it and every later command on its lane. */
@@ -75,6 +91,7 @@ export interface HeldCommandActions {
75
91
  * game load is refused rather than applied to a different game.
76
92
  */
77
93
  export function useHeldCommandActions(): HeldCommandActions {
94
+ // gonogo:reads none
78
95
  const client = useTelemetryClientOptional();
79
96
  const journeyPayload = useLatestValue<unknown>(JOURNEY_TOPIC);
80
97
  const epoch = useMemo(
@@ -90,12 +107,7 @@ export function useHeldCommandActions(): HeldCommandActions {
90
107
  if (!client || epoch === undefined) {
91
108
  return { refusal: "not connected" };
92
109
  }
93
- const { result } = client.dispatch(command, { epoch, ...args });
94
- try {
95
- return readUplinkActionReply(await result);
96
- } catch (error) {
97
- return { refusal: error instanceof Error ? error.message : "refused" };
98
- }
110
+ return sendUplinkAction(client, epoch, command, args);
99
111
  },
100
112
  [client, epoch],
101
113
  );
@@ -24,12 +24,7 @@ import {
24
24
  Quality,
25
25
  } from "../__generated__/contract";
26
26
  import { magnitudeOr, type Quantityish } from "../magnitude";
27
- import {
28
- canPropagate,
29
- rotatePerifocalToInertial,
30
- type Vector3,
31
- } from "./kepler";
32
- import { buildElements } from "./kepler-reckoning";
27
+ import { canPropagate, type Vec3Tuple } from "./kepler";
33
28
  import {
34
29
  groundTrackSamples,
35
30
  type PatchSpan,
@@ -332,10 +327,9 @@ function lerpPoint(
332
327
  * bound.
333
328
  *
334
329
  * A latitude and longitude need the point in a frame whose z axis is the
335
- * body's spin axis and whose centre is the body itself. The two frames an arc
336
- * can arrive in that give that are the perifocal frame of these elements, which
337
- * the elements' own rotation lifts back into the body-centred inertial frame
338
- * they are measured in, and that inertial frame directly. Any other frame, a
330
+ * body's spin axis and whose centre is the body itself. The one frame an arc
331
+ * can arrive in that gives that is the body-centred inertial frame the elements
332
+ * are measured in. Any other frame, a
339
333
  * different centre, or lengths that are not metres answers no impact rather
340
334
  * than a guess, and never falls back to a conic the provider did not offer.
341
335
  *
@@ -361,29 +355,8 @@ function arcImpact(
361
355
  ) {
362
356
  return null;
363
357
  }
364
- const resolveLift = (): ((p: TrajectoryPoint) => Vector3) | null => {
365
- if (frame.kind === TrajectoryFrameKindLike.BodyCentredInertial) {
366
- return (p) => [p.x, p.y, p.z];
367
- }
368
- if (frame.kind === TrajectoryFrameKindLike.Perifocal) {
369
- const { inc, lan, argPe } = buildElements(orbit);
370
- const pHat = rotatePerifocalToInertial(1, 0, inc, lan, argPe);
371
- const qHat = rotatePerifocalToInertial(0, 1, inc, lan, argPe);
372
- const wHat: Vector3 = [
373
- pHat[1] * qHat[2] - pHat[2] * qHat[1],
374
- pHat[2] * qHat[0] - pHat[0] * qHat[2],
375
- pHat[0] * qHat[1] - pHat[1] * qHat[0],
376
- ];
377
- return (p) => [
378
- p.x * pHat[0] + p.y * qHat[0] + p.z * wHat[0],
379
- p.x * pHat[1] + p.y * qHat[1] + p.z * wHat[1],
380
- p.x * pHat[2] + p.y * qHat[2] + p.z * wHat[2],
381
- ];
382
- }
383
- return null;
384
- };
385
- const lift = resolveLift();
386
- if (!lift) return null;
358
+ if (frame.kind !== TrajectoryFrameKindLike.BodyCentredInertial) return null;
359
+ const lift = (p: TrajectoryPoint): Vec3Tuple => [p.x, p.y, p.z];
387
360
 
388
361
  const surface = bodyRadius + MIN_IMPACT_ALT_M;
389
362
  const endUt = ref.ut + walkSec;
@@ -404,7 +377,7 @@ function arcImpact(
404
377
  rotationPeriod,
405
378
  );
406
379
 
407
- let previous: { at: Vector3; ut: number } = { at: start, ut: ref.ut };
380
+ let previous: { at: Vec3Tuple; ut: number } = { at: start, ut: ref.ut };
408
381
  for (let i = startAt; i < points.length; i++) {
409
382
  const next = { at: lift(points[i]), ut: points[i].ut };
410
383
  if (next.ut <= previous.ut) continue;
@@ -415,7 +388,7 @@ function arcImpact(
415
388
  const f = (rPrev - surface) / (rPrev - rNext);
416
389
  const ut = previous.ut + (next.ut - previous.ut) * f;
417
390
  if (ut > endUt) return null;
418
- const at: Vector3 = [
391
+ const at: Vec3Tuple = [
419
392
  previous.at[0] + (next.at[0] - previous.at[0]) * f,
420
393
  previous.at[1] + (next.at[1] - previous.at[1]) * f,
421
394
  previous.at[2] + (next.at[2] - previous.at[2]) * f,
@@ -50,6 +50,7 @@
50
50
  export * from "../rail-tags";
51
51
  export * from "./atmospheric-reckoning";
52
52
  export * from "./body-derivations";
53
+ export * from "./body-pose";
53
54
  export * from "./capability-lock";
54
55
  export * from "./celestial-facts";
55
56
  export * from "./channel-error-warning";
@@ -58,6 +59,7 @@ export * from "./client-reading";
58
59
  export * from "./client-timeline";
59
60
  export * from "./clock";
60
61
  export * from "./command-gate";
62
+ export * from "./command-group";
61
63
  export * from "./comms-delay-reckoning";
62
64
  export * from "./comms-journey";
63
65
  export * from "./comms-path-geometry";
@@ -91,6 +93,7 @@ export * from "./orbit-trajectory";
91
93
  export * from "./orbital-solve";
92
94
  export * from "./own-craft-vantage";
93
95
  export * from "./past-track";
96
+ export * from "./phase-angle";
94
97
  export * from "./processorEvaluator";
95
98
  export * from "./processors";
96
99
  export * from "./propagation";
@@ -120,12 +123,14 @@ export * from "./use-body-states";
120
123
  export * from "./use-command";
121
124
  export * from "./use-data-sources";
122
125
  export * from "./use-late-telemetry-subscribe";
126
+ export * from "./use-orbit-curve";
123
127
  export * from "./use-orbit-trajectory";
124
128
  export * from "./use-processor";
125
129
  export * from "./use-route-commands";
126
130
  export * from "./use-selected-vantage";
127
131
  export * from "./use-stream";
128
132
  export * from "./use-stream-event";
133
+ export * from "./use-system-instant";
129
134
  export * from "./use-telemetry";
130
135
  export * from "./use-transmissions";
131
136
  export * from "./view-clock";
@@ -8,7 +8,7 @@ import type {
8
8
  OrbitElements,
9
9
  PropagationHorizonLike,
10
10
  StateVector,
11
- Vector3,
11
+ Vec3Tuple,
12
12
  } from "./kepler";
13
13
  import {
14
14
  canPropagate,
@@ -549,7 +549,7 @@ export function underPhysics(input: string, note: string): ReckoningDecline {
549
549
  }
550
550
 
551
551
  /** The length of a bare three-component vector. */
552
- export function magnitude(v: Vector3): number {
552
+ export function magnitude(v: Vec3Tuple): number {
553
553
  return Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
554
554
  }
555
555
 
@@ -189,7 +189,7 @@ export interface OrbitElements {
189
189
  *
190
190
  * @category Frames of reference
191
191
  */
192
- export type Vector3 = readonly [x: number, y: number, z: number];
192
+ export type Vec3Tuple = readonly [x: number, y: number, z: number];
193
193
 
194
194
  /**
195
195
  * A position and velocity relative to the parent body, at one instant, in
@@ -198,8 +198,8 @@ export type Vector3 = readonly [x: number, y: number, z: number];
198
198
  * @category Orbits and trajectories
199
199
  */
200
200
  export interface StateVector {
201
- position: Vector3;
202
- velocity: Vector3;
201
+ position: Vec3Tuple;
202
+ velocity: Vec3Tuple;
203
203
  }
204
204
 
205
205
  /**
@@ -418,7 +418,7 @@ export function solve(orbit: OrbitElements, ut: number): StateVector {
418
418
  * Starts from a high-eccentricity guess where it needs one, so it converges
419
419
  * just after periapsis on a near-parabolic orbit too.
420
420
  *
421
- * <b>Exported as ARITHMETIC, not as propagation.</b> It takes a mean anomaly
421
+ * **Exported as ARITHMETIC, not as propagation.** It takes a mean anomaly
422
422
  * and an eccentricity and returns an angle: no elements, no frame, no time, so
423
423
  * it cannot say "where is this craft" and is not a way around the propagation
424
424
  * seam. That question goes through a provider, and on the C# side the
@@ -484,6 +484,8 @@ function solveWrappedEccentricAnomaly(
484
484
  * `zPf` is the part along the orbit normal. A conic has none, so it is left
485
485
  * out and the vector is planar; an integrated arc leaves the osculating plane
486
486
  * and passes it.
487
+ *
488
+ * @category Orbits and trajectories
487
489
  */
488
490
  export function rotatePerifocalToInertial(
489
491
  xPf: number,
@@ -492,7 +494,7 @@ export function rotatePerifocalToInertial(
492
494
  lan: number,
493
495
  argPe: number,
494
496
  zPf = 0,
495
- ): Vector3 {
497
+ ): Vec3Tuple {
496
498
  const cosLan = Math.cos(lan);
497
499
  const sinLan = Math.sin(lan);
498
500
  const cosArgPe = Math.cos(argPe);
@@ -539,11 +541,11 @@ export function rotatePerifocalToInertial(
539
541
  * a conic does not.
540
542
  */
541
543
  export function rotateInertialToPerifocal(
542
- v: Vector3,
544
+ v: Vec3Tuple,
543
545
  inc: number,
544
546
  lan: number,
545
547
  argPe: number,
546
- ): Vector3 {
548
+ ): Vec3Tuple {
547
549
  const cosLan = Math.cos(lan);
548
550
  const sinLan = Math.sin(lan);
549
551
  const cosArgPe = Math.cos(argPe);
@@ -46,7 +46,7 @@
46
46
 
47
47
  import { PerfBudget } from "../perf/PerfBudget";
48
48
  import type { CelestialBody, CelestialFacts } from "./celestial-facts";
49
- import type { Vector3 } from "./kepler";
49
+ import type { Vec3Tuple } from "./kepler";
50
50
  import {
51
51
  type FrameInstant,
52
52
  frameInstantAt,
@@ -139,9 +139,9 @@ export interface LibrationPoint {
139
139
  * The point in the pair's rotating-pulsating frame: multiples of the pair's
140
140
  * separation, and CONSTANT for as long as the pair's mass ratio is.
141
141
  */
142
- frame: Vector3;
142
+ frame: Vec3Tuple;
143
143
  /** The same point in root-centred inertial metres at the answer's `ut`. */
144
- inertial: Vector3;
144
+ inertial: Vec3Tuple;
145
145
  }
146
146
 
147
147
  /**
@@ -221,7 +221,7 @@ export type LibrationStationKeeping = "on-station" | "drifting" | "elsewhere";
221
221
  export interface LibrationOffset {
222
222
  nearest: LagrangePointName;
223
223
  /** The craft in the pair's frame: multiples of the separation. */
224
- vesselFrame: Vector3;
224
+ vesselFrame: Vec3Tuple;
225
225
  /** Straight-line distance from the craft to that point at the answer's `ut`, metres. */
226
226
  distanceMetres: number;
227
227
  /** The same distance as a multiple of the pair's separation. */
@@ -334,7 +334,7 @@ const COLLINEAR_BRACKET_GAP = 1e-9;
334
334
  */
335
335
  export function librationPositionsFor(
336
336
  massRatio: number,
337
- ): readonly { name: LagrangePointName; frame: Vector3 }[] | null {
337
+ ): readonly { name: LagrangePointName; frame: Vec3Tuple }[] | null {
338
338
  const mu = massRatio;
339
339
  if (!(mu > 0 && mu < 1)) return null;
340
340
  const primaryX = -mu;
@@ -501,7 +501,7 @@ export function lagrangePointsAt(
501
501
  */
502
502
  export function librationOffsetOf(
503
503
  answer: LibrationAnswer,
504
- vesselInertial: Vector3 | null | undefined,
504
+ vesselInertial: Vec3Tuple | null | undefined,
505
505
  ): LibrationOffset | null {
506
506
  if (answer.refusal !== LIBRATION_REFUSALS.NotRefused) return null;
507
507
  if (answer.frame === null || vesselInertial == null) return null;
@@ -13,6 +13,8 @@ import type { CommandErrorCode } from "../__generated__/error-codes";
13
13
  * The code picks the sentence and the breach fills it in. Neither is much use
14
14
  * alone: a code cannot say "16 of 16", and a pair of numbers does not say which
15
15
  * sentence they belong in.
16
+ *
17
+ * @category Commands
16
18
  */
17
19
  export interface CommandRefusalDetail {
18
20
  /** The command id that was dispatched, e.g. `career.facility.upgrade`. */
@@ -47,6 +49,8 @@ export interface CommandRefusalDetail {
47
49
  * The `id` is the dispatch's own `requestId`, so the same `dismiss(id)` clears a
48
50
  * refusal and a dead in-flight command, and the operator has one gesture rather
49
51
  * than two that look alike.
52
+ *
53
+ * @category Commands
50
54
  */
51
55
  export interface CommandRefusal extends CommandRefusalDetail {
52
56
  id: string;
@@ -70,6 +74,8 @@ export interface CommandRefusal extends CommandRefusalDetail {
70
74
  *
71
75
  * The `id` is the dispatch's own `requestId`, so one `dismiss(id)` clears a
72
76
  * loss, a refusal and a dead in-flight command alike.
77
+ *
78
+ * @category Commands
73
79
  */
74
80
  export interface CommandLoss {
75
81
  id: string;
@@ -96,6 +102,8 @@ export interface CommandLoss {
96
102
  *
97
103
  * It carries everything the loss did, so a surface drawing the loss can draw
98
104
  * this in its place, plus the transport's own reason.
105
+ *
106
+ * @category Commands
99
107
  */
100
108
  export interface CommandUndelivered extends CommandLoss {
101
109
  /** Why it will never go, in the transport's own words. */
@@ -110,6 +118,8 @@ export interface CommandUndelivered extends CommandLoss {
110
118
  * Not a refusal, which is the game's verdict on the command itself, and not a
111
119
  * loss, which carries no news at all. The mod said what became of it, and
112
120
  * `code` says which of those it was.
121
+ *
122
+ * @category Commands
113
123
  */
114
124
  export interface CommandFailure extends CommandLoss {
115
125
  /** The fault the mod answered with, a `FaultCode` id. `describeErrorCode` gives its sentence. */
@@ -131,6 +141,8 @@ export interface CommandFailure extends CommandLoss {
131
141
  * that proves it. Nothing here prevents or undoes the execution; the command ran
132
142
  * (or was refused, or broke) exactly as it would have done had the reply arrived
133
143
  * on time, and the only thing that was ever wrong was our silence about it.
144
+ *
145
+ * @category Commands
134
146
  */
135
147
  export type CommandFound = CommandLoss & CommandFoundOutcome;
136
148
 
@@ -152,6 +164,8 @@ export type CommandFound = CommandLoss & CommandFoundOutcome;
152
164
  *
153
165
  * Folding these together would repeat the mistake `CommandStatus` already
154
166
  * refused to make when it kept `refused` out of `failed`.
167
+ *
168
+ * @category Commands
155
169
  */
156
170
  export type CommandFoundOutcome =
157
171
  | { outcome: "ran"; result: unknown }
@@ -1,6 +1,10 @@
1
1
  import { createContext, useContext, useLayoutEffect } from "react";
2
2
 
3
- /** Something a widget uses that the save may not have unlocked: a topic it reads or a command it holds. */
3
+ /**
4
+ * Something a widget uses that the save may not have unlocked: a topic it reads or a command it holds.
5
+ *
6
+ * @category Panel
7
+ */
4
8
  export type Capability =
5
9
  | { kind: "topic"; id: string }
6
10
  | { kind: "command"; id: string };
@@ -14,6 +18,12 @@ export type Capability =
14
18
  export interface LockScopeRegistry {
15
19
  /** Records a capability as used here. Returns its release. */
16
20
  claim(capability: Capability): () => void;
21
+ /**
22
+ * Hears a capability claimed in a scope nested inside this one, without
23
+ * counting it toward this scope's lock. Only a scope that records what a
24
+ * subtree uses needs it, so a scope may leave it out.
25
+ */
26
+ observe?(capability: Capability): void;
17
27
  }
18
28
 
19
29
  /** The nearest lock scope, or `null` where none is mounted. */
@@ -2,17 +2,9 @@
2
2
  * Whether a command rides signal delay at all, read off the mod's own
3
3
  * declaration rather than restated here.
4
4
  *
5
- * This file was the WRITE half of the vocabulary migration: a table from
6
- * widget-facing action keys (`f.ag1`, `t.timeWarp[4]`) onto the typed commands
7
- * the mod actually serves, plus the toggle-to-absolute bridges those keys needed
8
- * because a key cannot carry an argument. Every caller now names its command and
9
- * its arguments directly, so there is nothing left to translate.
10
- *
11
- * What is left is one question, and it is no longer answered by a list written
12
- * here. It used to be: a hand-kept set naming two ids, against the fifty-four
13
- * the mod ran the instant they arrived, so fifty-two commands were drawn with a
14
- * countdown and an in-flight queue row that was a fiction about the operator's
15
- * own order. The answer now comes off `commandRail`, which is fed by
5
+ * A hand-kept list of delayed commands would draw an undeclared command with
6
+ * a countdown and an in-flight queue row that is a fiction about the
7
+ * operator's own order, so the answer comes off `commandRail`, which is fed by
16
8
  * the generated map codegen builds from the SAME `[SitrepCommand(Delayed = ...)]`
17
9
  * the host dispatches by, and by whatever an Uplink registered from its own
18
10
  * generated map. One declaration, both halves reading it.
@@ -19,6 +19,7 @@ export function modSettingsTopic(uplinkId: string): string {
19
19
  export function useModSettings(
20
20
  uplinkId: string,
21
21
  ): TopicReading<ModSettingsModel> {
22
+ // gonogo:reads settings.<uplinkId>
22
23
  return useStream<ModSettingsModel>(modSettingsTopic(uplinkId));
23
24
  }
24
25
 
@@ -97,12 +97,14 @@ export const NEVER_RECKONABLE = [
97
97
  // -- Configuration and catalogues. They change when the GAME changes, never
98
98
  // continuously, so a model has no dimension to move them along.
99
99
  //
100
- // `system.bodies` belongs here even though `systemInstantAt` will put every
101
- // body somewhere at any UT, and the two are not in tension: that function
102
- // EVALUATES the catalogue's own elements when a caller names an instant, which
103
- // is reading a published fact rather than advancing a payload, and the
104
- // catalogue it reads is unchanged by it. A reckoner would have to hand the
105
- // channel a NEW set of elements each frame, and nothing does or should.
100
+ // `system.bodies` belongs here, and the channel is the only thing that does:
101
+ // it never moves, so a reckoner would have to hand it a NEW set of elements
102
+ // each frame, and nothing does or should. Where a body IS at an instant is a
103
+ // different question, answered by `SYSTEM_POSES` on top of the channel the way
104
+ // `vessel.orbit`'s solve is on its own: evaluating the catalogue's elements at
105
+ // an instant reads a published fact rather than advancing a payload, and the
106
+ // pose it returns carries the currency (exact, modelled, held, withdrawn) the
107
+ // bare numbers cannot.
106
108
  "system.bodies",
107
109
  "time.calendar",
108
110
  "game.dlc",
@@ -21,6 +21,20 @@ export type PatchConic = Pick<
21
21
  | "period"
22
22
  >;
23
23
 
24
+ /**
25
+ * A patch with every element a propagation reads present. The wire sends
26
+ * `lan`, `argPe` and `meanAnomalyAtEpoch` as null where KSP left them
27
+ * undefined, and such a patch cannot be propagated.
28
+ */
29
+ export type PropagablePatch = Omit<
30
+ PatchConic,
31
+ "lan" | "argPe" | "meanAnomalyAtEpoch"
32
+ > & {
33
+ [Element in "lan" | "argPe" | "meanAnomalyAtEpoch"]: NonNullable<
34
+ PatchConic[Element]
35
+ >;
36
+ };
37
+
24
38
  /** A patch's conic with the window it holds for and the body it is around. */
25
39
  export type PatchSpan = PatchConic &
26
40
  Pick<OrbitPatch, "startUt" | "endUt" | "referenceBody">;
@@ -88,7 +102,10 @@ const FULL_TURN = value("rad", 2 * Math.PI);
88
102
  * patch's window; nothing is clamped, so picking the patch is the caller's.
89
103
  * Mean motion comes from the patch's own period.
90
104
  */
91
- export function patchStateAt(patch: PatchConic, ut: number): InertialState {
105
+ export function patchStateAt(
106
+ patch: PropagablePatch,
107
+ ut: number,
108
+ ): InertialState {
92
109
  const { trueAnomaly, radius } = solveConic(
93
110
  patch,
94
111
  FULL_TURN.dividedBy(patch.period),
@@ -117,9 +134,18 @@ export function geoFromInertial(
117
134
  return { lat, lonInertial, alt: state.radius - bodyRadius };
118
135
  }
119
136
 
120
- /** Whether the elliptical solve can propagate a patch. Hyperbolic and parabolic patches it cannot. */
121
- export function isPatchElliptical(patch: PatchConic): boolean {
137
+ /**
138
+ * Whether the elliptical solve can propagate a patch. Hyperbolic and parabolic
139
+ * patches it cannot, and neither can one whose `lan`, `argPe` or
140
+ * `meanAnomalyAtEpoch` is null.
141
+ */
142
+ export function canPropagatePatch<Patch extends PatchConic>(
143
+ patch: Patch,
144
+ ): patch is Patch & PropagablePatch {
122
145
  return (
146
+ patch.lan != null &&
147
+ patch.argPe != null &&
148
+ patch.meanAnomalyAtEpoch != null &&
123
149
  patch.ecc.lessThan(1) &&
124
150
  patch.period.isFinite() &&
125
151
  patch.period.isPositive()
@@ -137,7 +163,7 @@ export function patchHolds(patch: PatchSpan, ut: number): boolean {
137
163
  * earlier than `notBeforeUt`. Empty when nothing of the window is left.
138
164
  */
139
165
  export function patchArc(
140
- patch: PatchSpan,
166
+ patch: PatchSpan & PropagablePatch,
141
167
  samples: number,
142
168
  notBeforeUt?: number,
143
169
  ): { ut: number; state: InertialState }[] {
@@ -180,7 +206,8 @@ export function* groundTrackSamples(
180
206
 
181
207
  // Calibration needs a patch around the named body, or the inertial longitude is in another frame.
182
208
  const calCandidates = calibrationPatches.filter(
183
- (p) => p.referenceBody === bodyId && isPatchElliptical(p),
209
+ (p): p is PatchSpan & PropagablePatch =>
210
+ p.referenceBody === bodyId && canPropagatePatch(p),
184
211
  );
185
212
  const refPatch =
186
213
  calCandidates.find((p) => patchHolds(p, ref.ut)) ?? calCandidates[0];
@@ -195,7 +222,7 @@ export function* groundTrackSamples(
195
222
  for (let patchIndex = 0; patchIndex < patches.length; patchIndex++) {
196
223
  const patch = patches[patchIndex];
197
224
  if (patch.referenceBody !== bodyId) return;
198
- if (!isPatchElliptical(patch)) return;
225
+ if (!canPropagatePatch(patch)) return;
199
226
  const { start, end } = windowOf(patch);
200
227
  if (end < ref.ut) continue;
201
228
  if (start > endUT) return;