@ksp-gonogo/sitrep-sdk 1.0.0-rc.45 → 1.0.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 (690) hide show
  1. package/README.md +48 -93
  2. package/dist/__generated__/command-map.d.ts +247 -2
  3. package/dist/__generated__/command-map.d.ts.map +1 -1
  4. package/dist/__generated__/command-map.js +91 -19
  5. package/dist/__generated__/command-map.js.map +1 -1
  6. package/dist/__generated__/contract.d.ts +3062 -352
  7. package/dist/__generated__/contract.d.ts.map +1 -1
  8. package/dist/__generated__/contract.js +187 -3
  9. package/dist/__generated__/contract.js.map +1 -1
  10. package/dist/__generated__/delay-roles.d.ts +2 -2
  11. package/dist/__generated__/delay-roles.d.ts.map +1 -1
  12. package/dist/__generated__/delay-roles.js +12 -0
  13. package/dist/__generated__/delay-roles.js.map +1 -1
  14. package/dist/__generated__/error-codes.d.ts +11 -11
  15. package/dist/__generated__/error-codes.d.ts.map +1 -1
  16. package/dist/__generated__/error-codes.js +12 -12
  17. package/dist/__generated__/error-codes.js.map +1 -1
  18. package/dist/__generated__/frames.d.ts +40 -4
  19. package/dist/__generated__/frames.d.ts.map +1 -1
  20. package/dist/__generated__/frames.js +20 -4
  21. package/dist/__generated__/frames.js.map +1 -1
  22. package/dist/__generated__/reckonability.d.ts +3 -1
  23. package/dist/__generated__/reckonability.d.ts.map +1 -1
  24. package/dist/__generated__/reckonability.js +1 -1
  25. package/dist/__generated__/reckonability.js.map +1 -1
  26. package/dist/__generated__/sample-kinds.d.ts +18 -2
  27. package/dist/__generated__/sample-kinds.d.ts.map +1 -1
  28. package/dist/__generated__/sample-kinds.js +18 -2
  29. package/dist/__generated__/sample-kinds.js.map +1 -1
  30. package/dist/__generated__/topic-map.d.ts +41 -17
  31. package/dist/__generated__/topic-map.d.ts.map +1 -1
  32. package/dist/__generated__/topic-map.js +16 -3
  33. package/dist/__generated__/topic-map.js.map +1 -1
  34. package/dist/__generated__/units.d.ts +247 -6
  35. package/dist/__generated__/units.d.ts.map +1 -1
  36. package/dist/__generated__/units.js +949 -76
  37. package/dist/__generated__/units.js.map +1 -1
  38. package/dist/api/command-rejection.d.ts +2 -2
  39. package/dist/api/command-rejection.js +1 -1
  40. package/dist/api/contribution-slots.d.ts +122 -21
  41. package/dist/api/contribution-slots.d.ts.map +1 -1
  42. package/dist/api/contribution-slots.js +4 -4
  43. package/dist/api/contribution-slots.js.map +1 -1
  44. package/dist/api/error-codes.d.ts +3 -2
  45. package/dist/api/error-codes.d.ts.map +1 -1
  46. package/dist/api/error-codes.js +3 -2
  47. package/dist/api/error-codes.js.map +1 -1
  48. package/dist/api/framework-reads.d.ts +2 -2
  49. package/dist/api/framework-reads.d.ts.map +1 -1
  50. package/dist/api/framework-reads.js +6 -1
  51. package/dist/api/framework-reads.js.map +1 -1
  52. package/dist/api/host.d.ts +14 -6
  53. package/dist/api/host.d.ts.map +1 -1
  54. package/dist/api/host.js.map +1 -1
  55. package/dist/api/index.d.ts +70 -60
  56. package/dist/api/index.d.ts.map +1 -1
  57. package/dist/api/index.js +66 -54
  58. package/dist/api/index.js.map +1 -1
  59. package/dist/api/logger-contract.d.ts +2 -1
  60. package/dist/api/logger-contract.d.ts.map +1 -1
  61. package/dist/api/logger.d.ts +6 -3
  62. package/dist/api/logger.d.ts.map +1 -1
  63. package/dist/api/logger.js +6 -3
  64. package/dist/api/logger.js.map +1 -1
  65. package/dist/api/part-panels.d.ts +143 -0
  66. package/dist/api/part-panels.d.ts.map +1 -0
  67. package/dist/api/part-panels.js +104 -0
  68. package/dist/api/part-panels.js.map +1 -0
  69. package/dist/api/plot-layers.d.ts +1 -1
  70. package/dist/api/plot-layers.js +1 -1
  71. package/dist/api/registry.d.ts +4 -2
  72. package/dist/api/registry.d.ts.map +1 -1
  73. package/dist/api/registry.js +4 -2
  74. package/dist/api/registry.js.map +1 -1
  75. package/dist/api/settings/store.d.ts +1 -1
  76. package/dist/api/settings/store.d.ts.map +1 -1
  77. package/dist/api/settings/store.js +7 -2
  78. package/dist/api/settings/store.js.map +1 -1
  79. package/dist/api/slots.d.ts +150 -70
  80. package/dist/api/slots.d.ts.map +1 -1
  81. package/dist/api/station-brokers.d.ts +24 -15
  82. package/dist/api/station-brokers.d.ts.map +1 -1
  83. package/dist/api/station-brokers.js +24 -15
  84. package/dist/api/station-brokers.js.map +1 -1
  85. package/dist/api/tiny-size.d.ts +2 -1
  86. package/dist/api/tiny-size.d.ts.map +1 -1
  87. package/dist/api/tiny-size.js +2 -1
  88. package/dist/api/tiny-size.js.map +1 -1
  89. package/dist/api/tone.d.ts +1 -1
  90. package/dist/api/transport.d.ts +9 -0
  91. package/dist/api/transport.d.ts.map +1 -1
  92. package/dist/api/types.d.ts +356 -68
  93. package/dist/api/types.d.ts.map +1 -1
  94. package/dist/api/uplink-banner.d.ts +113 -0
  95. package/dist/api/uplink-banner.d.ts.map +1 -0
  96. package/dist/api/uplink-banner.js +69 -0
  97. package/dist/api/uplink-banner.js.map +1 -0
  98. package/dist/api/uplink-handles.d.ts +2 -12
  99. package/dist/api/uplink-handles.d.ts.map +1 -1
  100. package/dist/api/uplink-handles.js +2 -1
  101. package/dist/api/uplink-handles.js.map +1 -1
  102. package/dist/binary-frame.d.ts +4 -4
  103. package/dist/binary-frame.js +2 -2
  104. package/dist/combine-readings.d.ts +4 -3
  105. package/dist/combine-readings.d.ts.map +1 -1
  106. package/dist/combine-readings.js +4 -3
  107. package/dist/combine-readings.js.map +1 -1
  108. package/dist/command-delay.d.ts +81 -2
  109. package/dist/command-delay.d.ts.map +1 -1
  110. package/dist/command-delay.js +51 -8
  111. package/dist/command-delay.js.map +1 -1
  112. package/dist/command-value.d.ts +98 -0
  113. package/dist/command-value.d.ts.map +1 -0
  114. package/dist/command-value.js +87 -0
  115. package/dist/command-value.js.map +1 -0
  116. package/dist/commands.d.ts +1 -1
  117. package/dist/commands.d.ts.map +1 -1
  118. package/dist/compat-versions.d.ts +1 -1
  119. package/dist/compat-versions.d.ts.map +1 -1
  120. package/dist/compat-versions.js +3 -3
  121. package/dist/compat-versions.js.map +1 -1
  122. package/dist/contract-enum-names.d.ts +2 -2
  123. package/dist/contract-enum-names.js +2 -2
  124. package/dist/contract-tags.d.ts +33 -2
  125. package/dist/contract-tags.d.ts.map +1 -1
  126. package/dist/contract-tags.js +54 -5
  127. package/dist/contract-tags.js.map +1 -1
  128. package/dist/data-rate.d.ts +84 -0
  129. package/dist/data-rate.d.ts.map +1 -0
  130. package/dist/data-rate.js +133 -0
  131. package/dist/data-rate.js.map +1 -0
  132. package/dist/delay-roles.d.ts +14 -1
  133. package/dist/delay-roles.d.ts.map +1 -1
  134. package/dist/delay-roles.js +5 -1
  135. package/dist/delay-roles.js.map +1 -1
  136. package/dist/dock-markers.d.ts +126 -0
  137. package/dist/dock-markers.d.ts.map +1 -0
  138. package/dist/dock-markers.js +100 -0
  139. package/dist/dock-markers.js.map +1 -0
  140. package/dist/envelope.d.ts +2 -2
  141. package/dist/envelope.d.ts.map +1 -1
  142. package/dist/flight/types.d.ts +31 -2
  143. package/dist/flight/types.d.ts.map +1 -1
  144. package/dist/flight/types.js.map +1 -1
  145. package/dist/frames/index.d.ts +1 -4
  146. package/dist/frames/index.d.ts.map +1 -1
  147. package/dist/frames/index.js +0 -3
  148. package/dist/frames/index.js.map +1 -1
  149. package/dist/go-no-go-countdown.d.ts +65 -0
  150. package/dist/go-no-go-countdown.d.ts.map +1 -0
  151. package/dist/go-no-go-countdown.js +71 -0
  152. package/dist/go-no-go-countdown.js.map +1 -0
  153. package/dist/index.d.ts +13 -4
  154. package/dist/index.d.ts.map +1 -1
  155. package/dist/index.js +14 -4
  156. package/dist/index.js.map +1 -1
  157. package/dist/ksp-enum-names.d.ts +35 -4
  158. package/dist/ksp-enum-names.d.ts.map +1 -1
  159. package/dist/ksp-enum-names.js +31 -4
  160. package/dist/ksp-enum-names.js.map +1 -1
  161. package/dist/locked.d.ts +1 -1
  162. package/dist/locked.js +1 -1
  163. package/dist/media/delayed-playout-buffer.d.ts +29 -4
  164. package/dist/media/delayed-playout-buffer.d.ts.map +1 -1
  165. package/dist/media/delayed-playout-buffer.js +12 -5
  166. package/dist/media/delayed-playout-buffer.js.map +1 -1
  167. package/dist/media/encoded-frame-delay.d.ts +21 -16
  168. package/dist/media/encoded-frame-delay.d.ts.map +1 -1
  169. package/dist/media/encoded-frame-delay.js +21 -14
  170. package/dist/media/encoded-frame-delay.js.map +1 -1
  171. package/dist/media/frame-delay.d.ts +119 -5
  172. package/dist/media/frame-delay.d.ts.map +1 -1
  173. package/dist/media/frame-delay.js +201 -15
  174. package/dist/media/frame-delay.js.map +1 -1
  175. package/dist/media/frame-stamp-timeline.d.ts +119 -0
  176. package/dist/media/frame-stamp-timeline.d.ts.map +1 -0
  177. package/dist/media/frame-stamp-timeline.js +194 -0
  178. package/dist/media/frame-stamp-timeline.js.map +1 -0
  179. package/dist/media/index.d.ts +4 -3
  180. package/dist/media/index.d.ts.map +1 -1
  181. package/dist/media/index.js +1 -1
  182. package/dist/media/index.js.map +1 -1
  183. package/dist/media/radio-support.d.ts +8 -7
  184. package/dist/media/radio-support.d.ts.map +1 -1
  185. package/dist/media/radio-support.js +5 -6
  186. package/dist/media/radio-support.js.map +1 -1
  187. package/dist/media/worker/delay-worker-client.d.ts +27 -1
  188. package/dist/media/worker/delay-worker-client.d.ts.map +1 -1
  189. package/dist/media/worker/delay-worker-client.js +53 -5
  190. package/dist/media/worker/delay-worker-client.js.map +1 -1
  191. package/dist/media/worker/delay-worker.d.ts +45 -8
  192. package/dist/media/worker/delay-worker.d.ts.map +1 -1
  193. package/dist/media/worker/delay-worker.js +644 -56
  194. package/dist/media/worker/delay-worker.js.map +4 -4
  195. package/dist/media/worker/frame-delay-report.d.ts +25 -0
  196. package/dist/media/worker/frame-delay-report.d.ts.map +1 -0
  197. package/dist/media/worker/frame-delay-report.js +112 -0
  198. package/dist/media/worker/frame-delay-report.js.map +1 -0
  199. package/dist/media/worker/lead-limit-report.d.ts +13 -0
  200. package/dist/media/worker/lead-limit-report.d.ts.map +1 -0
  201. package/dist/media/worker/lead-limit-report.js +19 -0
  202. package/dist/media/worker/lead-limit-report.js.map +1 -0
  203. package/dist/media/worker/presentation-pacer.d.ts +70 -1
  204. package/dist/media/worker/presentation-pacer.d.ts.map +1 -1
  205. package/dist/media/worker/presentation-pacer.js +167 -9
  206. package/dist/media/worker/presentation-pacer.js.map +1 -1
  207. package/dist/media/worker/worker-delay-clock.d.ts +4 -5
  208. package/dist/media/worker/worker-delay-clock.d.ts.map +1 -1
  209. package/dist/media/worker/worker-delay-clock.js +6 -2
  210. package/dist/media/worker/worker-delay-clock.js.map +1 -1
  211. package/dist/perf/PerfBudget.d.ts +2 -2
  212. package/dist/perf/PerfBudget.js +2 -2
  213. package/dist/rail-tags.d.ts +7 -0
  214. package/dist/rail-tags.d.ts.map +1 -1
  215. package/dist/rail-tags.js.map +1 -1
  216. package/dist/raw-field-split.d.ts +1 -1
  217. package/dist/raw-field-split.js +1 -1
  218. package/dist/reading.d.ts +6 -6
  219. package/dist/reading.js +5 -5
  220. package/dist/reads-index.json +446 -37
  221. package/dist/resource-transfer.d.ts +177 -0
  222. package/dist/resource-transfer.d.ts.map +1 -0
  223. package/dist/resource-transfer.js +190 -0
  224. package/dist/resource-transfer.js.map +1 -0
  225. package/dist/runtime-topic-registry.d.ts +2 -2
  226. package/dist/runtime-topic-registry.d.ts.map +1 -1
  227. package/dist/runtime-topic-registry.js +23 -2
  228. package/dist/runtime-topic-registry.js.map +1 -1
  229. package/dist/sample-step-tracker.d.ts +17 -0
  230. package/dist/sample-step-tracker.d.ts.map +1 -0
  231. package/dist/sample-step-tracker.js +38 -0
  232. package/dist/sample-step-tracker.js.map +1 -0
  233. package/dist/sha256-fallback.d.ts +6 -0
  234. package/dist/sha256-fallback.d.ts.map +1 -0
  235. package/dist/sha256-fallback.js +68 -0
  236. package/dist/sha256-fallback.js.map +1 -0
  237. package/dist/spine/arrival-deadline.d.ts +7 -0
  238. package/dist/spine/arrival-deadline.d.ts.map +1 -1
  239. package/dist/spine/arrival-deadline.js +12 -0
  240. package/dist/spine/arrival-deadline.js.map +1 -1
  241. package/dist/spine/bound-command.d.ts +58 -0
  242. package/dist/spine/bound-command.d.ts.map +1 -0
  243. package/dist/spine/bound-command.js +162 -0
  244. package/dist/spine/bound-command.js.map +1 -0
  245. package/dist/spine/capability-lock.d.ts +6 -1
  246. package/dist/spine/capability-lock.d.ts.map +1 -1
  247. package/dist/spine/capability-lock.js +56 -5
  248. package/dist/spine/capability-lock.js.map +1 -1
  249. package/dist/spine/catalog-fallback.d.ts +28 -0
  250. package/dist/spine/catalog-fallback.d.ts.map +1 -0
  251. package/dist/spine/catalog-fallback.js +120 -0
  252. package/dist/spine/catalog-fallback.js.map +1 -0
  253. package/dist/spine/celestial-facts.d.ts.map +1 -1
  254. package/dist/spine/celestial-facts.js +5 -2
  255. package/dist/spine/celestial-facts.js.map +1 -1
  256. package/dist/spine/centre-commands.d.ts +84 -0
  257. package/dist/spine/centre-commands.d.ts.map +1 -0
  258. package/dist/spine/centre-commands.js +236 -0
  259. package/dist/spine/centre-commands.js.map +1 -0
  260. package/dist/spine/client-reading.js +1 -1
  261. package/dist/spine/client-timeline.d.ts +48 -1
  262. package/dist/spine/client-timeline.d.ts.map +1 -1
  263. package/dist/spine/client-timeline.js +151 -3
  264. package/dist/spine/client-timeline.js.map +1 -1
  265. package/dist/spine/client.d.ts +154 -4
  266. package/dist/spine/client.d.ts.map +1 -1
  267. package/dist/spine/client.js +530 -34
  268. package/dist/spine/client.js.map +1 -1
  269. package/dist/spine/command-gate.d.ts +8 -0
  270. package/dist/spine/command-gate.d.ts.map +1 -1
  271. package/dist/spine/command-gate.js +36 -3
  272. package/dist/spine/command-gate.js.map +1 -1
  273. package/dist/spine/command-outcomes.d.ts +60 -0
  274. package/dist/spine/command-outcomes.d.ts.map +1 -0
  275. package/dist/spine/command-outcomes.js +256 -0
  276. package/dist/spine/command-outcomes.js.map +1 -0
  277. package/dist/spine/connectivity-history.d.ts +5 -3
  278. package/dist/spine/connectivity-history.d.ts.map +1 -1
  279. package/dist/spine/connectivity-history.js.map +1 -1
  280. package/dist/spine/context.d.ts +62 -11
  281. package/dist/spine/context.d.ts.map +1 -1
  282. package/dist/spine/context.js +125 -39
  283. package/dist/spine/context.js.map +1 -1
  284. package/dist/spine/core-reckoners.d.ts.map +1 -1
  285. package/dist/spine/core-reckoners.js +16 -39
  286. package/dist/spine/core-reckoners.js.map +1 -1
  287. package/dist/spine/delay-authority-context.d.ts +5 -0
  288. package/dist/spine/delay-authority-context.d.ts.map +1 -0
  289. package/dist/spine/delay-authority-context.js +7 -0
  290. package/dist/spine/delay-authority-context.js.map +1 -0
  291. package/dist/spine/delay-authority.d.ts +76 -1
  292. package/dist/spine/delay-authority.d.ts.map +1 -1
  293. package/dist/spine/delay-authority.js +217 -3
  294. package/dist/spine/delay-authority.js.map +1 -1
  295. package/dist/spine/delay-estimate.d.ts +41 -0
  296. package/dist/spine/delay-estimate.d.ts.map +1 -0
  297. package/dist/spine/delay-estimate.js +70 -0
  298. package/dist/spine/delay-estimate.js.map +1 -0
  299. package/dist/spine/delta-v-budget.js +2 -2
  300. package/dist/spine/delta-v-budget.js.map +1 -1
  301. package/dist/spine/dv-stage-resources.d.ts +32 -17
  302. package/dist/spine/dv-stage-resources.d.ts.map +1 -1
  303. package/dist/spine/dv-stage-resources.js +44 -37
  304. package/dist/spine/dv-stage-resources.js.map +1 -1
  305. package/dist/spine/index.d.ts +7 -1
  306. package/dist/spine/index.d.ts.map +1 -1
  307. package/dist/spine/index.js +11 -5
  308. package/dist/spine/index.js.map +1 -1
  309. package/dist/spine/kepler-reckoning.d.ts +56 -0
  310. package/dist/spine/kepler-reckoning.d.ts.map +1 -1
  311. package/dist/spine/kepler-reckoning.js +179 -3
  312. package/dist/spine/kepler-reckoning.js.map +1 -1
  313. package/dist/spine/kepler.d.ts +1 -1
  314. package/dist/spine/kepler.js +1 -1
  315. package/dist/spine/known-holds.d.ts +8 -0
  316. package/dist/spine/known-holds.d.ts.map +1 -0
  317. package/dist/spine/known-holds.js +78 -0
  318. package/dist/spine/known-holds.js.map +1 -0
  319. package/dist/spine/lagrange.d.ts +9 -34
  320. package/dist/spine/lagrange.d.ts.map +1 -1
  321. package/dist/spine/lagrange.js +4 -24
  322. package/dist/spine/lagrange.js.map +1 -1
  323. package/dist/spine/lifecycle.d.ts +21 -0
  324. package/dist/spine/lifecycle.d.ts.map +1 -1
  325. package/dist/spine/lifecycle.js.map +1 -1
  326. package/dist/spine/lock-scope.d.ts +2 -2
  327. package/dist/spine/map-topic.d.ts +3 -3
  328. package/dist/spine/map-topic.js +3 -3
  329. package/dist/spine/never-reckonable.js +1 -1
  330. package/dist/spine/never-reckonable.js.map +1 -1
  331. package/dist/spine/orbit-patches.d.ts +6 -4
  332. package/dist/spine/orbit-patches.d.ts.map +1 -1
  333. package/dist/spine/orbit-patches.js +45 -10
  334. package/dist/spine/orbit-patches.js.map +1 -1
  335. package/dist/spine/orbital-solve.d.ts +1 -1
  336. package/dist/spine/orbital-solve.d.ts.map +1 -1
  337. package/dist/spine/orbital-solve.js +35 -0
  338. package/dist/spine/orbital-solve.js.map +1 -1
  339. package/dist/spine/powered-reckoning.d.ts +5 -0
  340. package/dist/spine/powered-reckoning.d.ts.map +1 -1
  341. package/dist/spine/powered-reckoning.js.map +1 -1
  342. package/dist/spine/processorEvaluator.d.ts +29 -0
  343. package/dist/spine/processorEvaluator.d.ts.map +1 -1
  344. package/dist/spine/processorEvaluator.js +94 -71
  345. package/dist/spine/processorEvaluator.js.map +1 -1
  346. package/dist/spine/processors.d.ts +56 -4
  347. package/dist/spine/processors.d.ts.map +1 -1
  348. package/dist/spine/processors.js +110 -0
  349. package/dist/spine/processors.js.map +1 -1
  350. package/dist/spine/rail-registry.d.ts +1 -1
  351. package/dist/spine/rail-registry.d.ts.map +1 -1
  352. package/dist/spine/reckoner-generation.d.ts +5 -0
  353. package/dist/spine/reckoner-generation.d.ts.map +1 -0
  354. package/dist/spine/reckoner-generation.js +10 -0
  355. package/dist/spine/reckoner-generation.js.map +1 -0
  356. package/dist/spine/reckoners.d.ts.map +1 -1
  357. package/dist/spine/reckoners.js +3 -0
  358. package/dist/spine/reckoners.js.map +1 -1
  359. package/dist/spine/replay-session-controller.d.ts +1 -1
  360. package/dist/spine/replay-session-controller.d.ts.map +1 -1
  361. package/dist/spine/replay-session-controller.js +4 -6
  362. package/dist/spine/replay-session-controller.js.map +1 -1
  363. package/dist/spine/resolve-tracked.d.ts +20 -2
  364. package/dist/spine/resolve-tracked.d.ts.map +1 -1
  365. package/dist/spine/resolve-tracked.js +32 -2
  366. package/dist/spine/resolve-tracked.js.map +1 -1
  367. package/dist/spine/send-status.d.ts +2 -0
  368. package/dist/spine/send-status.d.ts.map +1 -1
  369. package/dist/spine/send-status.js.map +1 -1
  370. package/dist/spine/settings-registry.d.ts +7 -0
  371. package/dist/spine/settings-registry.d.ts.map +1 -1
  372. package/dist/spine/settings-registry.js.map +1 -1
  373. package/dist/spine/slot-ids.d.ts +1 -1
  374. package/dist/spine/slot-ids.d.ts.map +1 -1
  375. package/dist/spine/slot-ids.js +6 -3
  376. package/dist/spine/slot-ids.js.map +1 -1
  377. package/dist/spine/space-center-state.d.ts +17 -9
  378. package/dist/spine/space-center-state.d.ts.map +1 -1
  379. package/dist/spine/space-center-state.js +14 -15
  380. package/dist/spine/space-center-state.js.map +1 -1
  381. package/dist/spine/stage-countdown-store.d.ts +38 -0
  382. package/dist/spine/stage-countdown-store.d.ts.map +1 -0
  383. package/dist/spine/stage-countdown-store.js +53 -0
  384. package/dist/spine/stage-countdown-store.js.map +1 -0
  385. package/dist/spine/stream-status.d.ts +3 -3
  386. package/dist/spine/stream-status.js +3 -3
  387. package/dist/spine/subscribe-read.d.ts +1 -1
  388. package/dist/spine/subscribe-read.js +2 -2
  389. package/dist/spine/system-state.d.ts +13 -13
  390. package/dist/spine/system-state.d.ts.map +1 -1
  391. package/dist/spine/system-state.js +18 -18
  392. package/dist/spine/system-state.js.map +1 -1
  393. package/dist/spine/timeline-store.d.ts +304 -113
  394. package/dist/spine/timeline-store.d.ts.map +1 -1
  395. package/dist/spine/timeline-store.js +921 -223
  396. package/dist/spine/timeline-store.js.map +1 -1
  397. package/dist/spine/uplink-clients.d.ts +32 -16
  398. package/dist/spine/uplink-clients.d.ts.map +1 -1
  399. package/dist/spine/uplink-clients.js +8 -4
  400. package/dist/spine/uplink-clients.js.map +1 -1
  401. package/dist/spine/uplink-delays.d.ts +31 -0
  402. package/dist/spine/uplink-delays.d.ts.map +1 -0
  403. package/dist/spine/uplink-delays.js +46 -0
  404. package/dist/spine/uplink-delays.js.map +1 -0
  405. package/dist/spine/uplink-health.d.ts +109 -14
  406. package/dist/spine/uplink-health.d.ts.map +1 -1
  407. package/dist/spine/uplink-health.js +21 -17
  408. package/dist/spine/uplink-health.js.map +1 -1
  409. package/dist/spine/use-action-input.d.ts.map +1 -1
  410. package/dist/spine/use-action-input.js +14 -9
  411. package/dist/spine/use-action-input.js.map +1 -1
  412. package/dist/spine/use-body-states.d.ts.map +1 -1
  413. package/dist/spine/use-body-states.js +3 -3
  414. package/dist/spine/use-body-states.js.map +1 -1
  415. package/dist/spine/use-command.d.ts +94 -31
  416. package/dist/spine/use-command.d.ts.map +1 -1
  417. package/dist/spine/use-command.js +409 -197
  418. package/dist/spine/use-command.js.map +1 -1
  419. package/dist/spine/use-last-known-path.d.ts +36 -0
  420. package/dist/spine/use-last-known-path.d.ts.map +1 -0
  421. package/dist/spine/use-last-known-path.js +46 -0
  422. package/dist/spine/use-last-known-path.js.map +1 -0
  423. package/dist/spine/use-observed-vantage.d.ts +13 -0
  424. package/dist/spine/use-observed-vantage.d.ts.map +1 -0
  425. package/dist/spine/use-observed-vantage.js +20 -0
  426. package/dist/spine/use-observed-vantage.js.map +1 -0
  427. package/dist/spine/use-orbit-trajectory.d.ts +1 -1
  428. package/dist/spine/use-orbit-trajectory.d.ts.map +1 -1
  429. package/dist/spine/use-orbit-trajectory.js +17 -3
  430. package/dist/spine/use-orbit-trajectory.js.map +1 -1
  431. package/dist/spine/use-stream-connected.d.ts +8 -0
  432. package/dist/spine/use-stream-connected.d.ts.map +1 -0
  433. package/dist/spine/use-stream-connected.js +16 -0
  434. package/dist/spine/use-stream-connected.js.map +1 -0
  435. package/dist/spine/use-stream-event.d.ts +6 -1
  436. package/dist/spine/use-stream-event.d.ts.map +1 -1
  437. package/dist/spine/use-stream-event.js +5 -1
  438. package/dist/spine/use-stream-event.js.map +1 -1
  439. package/dist/spine/use-stream.d.ts +5 -2
  440. package/dist/spine/use-stream.d.ts.map +1 -1
  441. package/dist/spine/use-stream.js +7 -4
  442. package/dist/spine/use-stream.js.map +1 -1
  443. package/dist/spine/use-telemetry.d.ts +5 -1
  444. package/dist/spine/use-telemetry.d.ts.map +1 -1
  445. package/dist/spine/use-telemetry.js.map +1 -1
  446. package/dist/spine/use-topic-clock.d.ts +54 -0
  447. package/dist/spine/use-topic-clock.d.ts.map +1 -0
  448. package/dist/spine/use-topic-clock.js +137 -0
  449. package/dist/spine/use-topic-clock.js.map +1 -0
  450. package/dist/spine/use-transmissions.d.ts.map +1 -1
  451. package/dist/spine/use-transmissions.js +9 -4
  452. package/dist/spine/use-transmissions.js.map +1 -1
  453. package/dist/spine/vantage.d.ts +6 -0
  454. package/dist/spine/vantage.d.ts.map +1 -1
  455. package/dist/spine/vantage.js +6 -0
  456. package/dist/spine/vantage.js.map +1 -1
  457. package/dist/spine/view-clock.d.ts +23 -3
  458. package/dist/spine/view-clock.d.ts.map +1 -1
  459. package/dist/spine/view-clock.js +80 -2
  460. package/dist/spine/view-clock.js.map +1 -1
  461. package/dist/testing/fake-command.d.ts +48 -0
  462. package/dist/testing/fake-command.d.ts.map +1 -0
  463. package/dist/testing/fake-command.js +63 -0
  464. package/dist/testing/fake-command.js.map +1 -0
  465. package/dist/testing/index.d.ts +5 -1
  466. package/dist/testing/index.d.ts.map +1 -1
  467. package/dist/testing/index.js +6 -0
  468. package/dist/testing/index.js.map +1 -1
  469. package/dist/testing/install-act-gate-stretch.d.ts +1 -2
  470. package/dist/testing/install-act-gate-stretch.d.ts.map +1 -1
  471. package/dist/testing/install-act-gate-stretch.js +1 -2
  472. package/dist/testing/install-act-gate-stretch.js.map +1 -1
  473. package/dist/testing/install-dom-stubs.d.ts +2 -5
  474. package/dist/testing/install-dom-stubs.d.ts.map +1 -1
  475. package/dist/testing/install-dom-stubs.js +2 -34
  476. package/dist/testing/install-dom-stubs.js.map +1 -1
  477. package/dist/testing/install-real-test-host.d.ts.map +1 -1
  478. package/dist/testing/install-real-test-host.js +7 -6
  479. package/dist/testing/install-real-test-host.js.map +1 -1
  480. package/dist/testing/recorded-uplink-banners.d.ts +49 -0
  481. package/dist/testing/recorded-uplink-banners.d.ts.map +1 -0
  482. package/dist/testing/recorded-uplink-banners.js +45 -0
  483. package/dist/testing/recorded-uplink-banners.js.map +1 -0
  484. package/dist/testing/render.d.ts +16 -3
  485. package/dist/testing/render.d.ts.map +1 -1
  486. package/dist/testing/render.js +16 -3
  487. package/dist/testing/render.js.map +1 -1
  488. package/dist/testing/stream-fixture.js +3 -3
  489. package/dist/testing/stream-fixture.js.map +1 -1
  490. package/dist/testing/stub-transport.d.ts +6 -0
  491. package/dist/testing/stub-transport.d.ts.map +1 -1
  492. package/dist/testing/stub-transport.js +3 -0
  493. package/dist/testing/stub-transport.js.map +1 -1
  494. package/dist/timeline.d.ts +2 -98
  495. package/dist/timeline.d.ts.map +1 -1
  496. package/dist/topics.d.ts +68 -28
  497. package/dist/topics.d.ts.map +1 -1
  498. package/dist/topics.js +21 -18
  499. package/dist/topics.js.map +1 -1
  500. package/dist/unit-system/index.d.ts +1 -1
  501. package/dist/unit-system/index.d.ts.map +1 -1
  502. package/dist/unit-system/index.js +1 -1
  503. package/dist/unit-system/index.js.map +1 -1
  504. package/dist/unit-system/value.d.ts +26 -5
  505. package/dist/unit-system/value.d.ts.map +1 -1
  506. package/dist/unit-system/value.js +41 -21
  507. package/dist/unit-system/value.js.map +1 -1
  508. package/dist/units.d.ts.map +1 -1
  509. package/dist/units.js +2 -1
  510. package/dist/units.js.map +1 -1
  511. package/dist/uplink-externals.d.ts +17 -7
  512. package/dist/uplink-externals.d.ts.map +1 -1
  513. package/dist/uplink-externals.js +17 -7
  514. package/dist/uplink-externals.js.map +1 -1
  515. package/dist/uplink-load.d.ts +3 -2
  516. package/dist/uplink-load.d.ts.map +1 -1
  517. package/dist/uplink-load.js +9 -6
  518. package/dist/uplink-load.js.map +1 -1
  519. package/dist/uplink-manifest.d.ts +8 -3
  520. package/dist/uplink-manifest.d.ts.map +1 -1
  521. package/dist/uplink-manifest.js +5 -1
  522. package/dist/uplink-manifest.js.map +1 -1
  523. package/dist/wrap-units.d.ts.map +1 -1
  524. package/dist/wrap-units.js +3 -2
  525. package/dist/wrap-units.js.map +1 -1
  526. package/package.json +1 -1
  527. package/src/__generated__/command-map.ts +215 -19
  528. package/src/__generated__/contract.ts +3102 -330
  529. package/src/__generated__/delay-roles.ts +12 -0
  530. package/src/__generated__/error-codes.ts +13 -13
  531. package/src/__generated__/frames.ts +20 -4
  532. package/src/__generated__/reckonability.ts +3 -1
  533. package/src/__generated__/sample-kinds.ts +18 -2
  534. package/src/__generated__/topic-map.ts +68 -19
  535. package/src/__generated__/units.json +958 -94
  536. package/src/__generated__/units.ts +949 -76
  537. package/src/api/command-rejection.ts +2 -2
  538. package/src/api/contribution-slots.ts +128 -25
  539. package/src/api/error-codes.ts +3 -2
  540. package/src/api/framework-reads.ts +6 -1
  541. package/src/api/host.ts +14 -6
  542. package/src/api/index.ts +127 -67
  543. package/src/api/logger-contract.ts +2 -1
  544. package/src/api/logger.ts +6 -3
  545. package/src/api/part-panels.ts +221 -0
  546. package/src/api/plot-layers.ts +1 -1
  547. package/src/api/registry.ts +4 -2
  548. package/src/api/settings/store.ts +7 -2
  549. package/src/api/slots.ts +153 -70
  550. package/src/api/station-brokers.ts +24 -15
  551. package/src/api/tiny-size.ts +2 -1
  552. package/src/api/tone.ts +1 -1
  553. package/src/api/transport.ts +13 -0
  554. package/src/api/types.ts +388 -68
  555. package/src/api/uplink-banner.ts +128 -0
  556. package/src/api/uplink-handles.ts +4 -1
  557. package/src/binary-frame.ts +4 -4
  558. package/src/combine-readings.ts +4 -3
  559. package/src/command-delay.ts +144 -11
  560. package/src/command-value.ts +181 -0
  561. package/src/compat-versions.ts +3 -3
  562. package/src/contract-enum-names.ts +2 -2
  563. package/src/contract-tags.ts +67 -5
  564. package/src/data-rate.ts +178 -0
  565. package/src/delay-roles.ts +19 -2
  566. package/src/dock-markers.ts +182 -0
  567. package/src/envelope.ts +4 -0
  568. package/src/flight/types.ts +31 -2
  569. package/src/frames/index.ts +0 -4
  570. package/src/go-no-go-countdown.ts +116 -0
  571. package/src/index.ts +64 -4
  572. package/src/ksp-enum-names.ts +48 -3
  573. package/src/locked.ts +1 -1
  574. package/src/media/__fixtures__/hull-after-revert.json +1506 -0
  575. package/src/media/delayed-playout-buffer.ts +41 -9
  576. package/src/media/encoded-frame-delay.ts +29 -17
  577. package/src/media/frame-delay.ts +328 -22
  578. package/src/media/frame-stamp-timeline.ts +270 -0
  579. package/src/media/index.ts +5 -0
  580. package/src/media/radio-support.ts +8 -7
  581. package/src/media/worker/delay-worker-client.ts +104 -6
  582. package/src/media/worker/delay-worker.ts +228 -27
  583. package/src/media/worker/frame-delay-report.ts +141 -0
  584. package/src/media/worker/lead-limit-report.ts +27 -0
  585. package/src/media/worker/presentation-pacer.ts +216 -9
  586. package/src/media/worker/worker-delay-clock.ts +9 -6
  587. package/src/perf/PerfBudget.ts +2 -2
  588. package/src/rail-tags.ts +8 -0
  589. package/src/raw-field-split.ts +1 -1
  590. package/src/reading.ts +6 -6
  591. package/src/resource-transfer.ts +352 -0
  592. package/src/runtime-topic-registry.ts +23 -2
  593. package/src/sample-step-tracker.ts +38 -0
  594. package/src/sha256-fallback.ts +69 -0
  595. package/src/spine/__fixtures__/crash/crash-eva.json +224 -0
  596. package/src/spine/__fixtures__/crash/crash-separated-pod-pod-root.json +144 -0
  597. package/src/spine/__fixtures__/crash/crash-separated-pod.json +111 -0
  598. package/src/spine/__fixtures__/switch/back-to-craft.jsonl +101 -0
  599. package/src/spine/__fixtures__/switch/late-sent-frame.jsonl +16 -0
  600. package/src/spine/__fixtures__/switch/linked-craft.jsonl +63 -0
  601. package/src/spine/__fixtures__/switch/station-trim.jsonl +229 -0
  602. package/src/spine/__fixtures__/switch/switch-with-scene.jsonl +110 -0
  603. package/src/spine/__fixtures__/switch/unlinked-craft.jsonl +46 -0
  604. package/src/spine/arrival-deadline.ts +15 -0
  605. package/src/spine/bound-command.ts +243 -0
  606. package/src/spine/capability-lock.ts +65 -6
  607. package/src/spine/catalog-fallback.ts +152 -0
  608. package/src/spine/celestial-facts.ts +4 -2
  609. package/src/spine/centre-commands.ts +314 -0
  610. package/src/spine/client-reading.ts +1 -1
  611. package/src/spine/client-timeline.ts +165 -4
  612. package/src/spine/client.ts +615 -32
  613. package/src/spine/command-gate.ts +44 -3
  614. package/src/spine/command-outcomes.ts +303 -0
  615. package/src/spine/connectivity-history.ts +5 -3
  616. package/src/spine/context.tsx +154 -50
  617. package/src/spine/core-reckoners.ts +31 -50
  618. package/src/spine/delay-authority-context.ts +9 -0
  619. package/src/spine/delay-authority.ts +227 -3
  620. package/src/spine/delay-estimate.ts +88 -0
  621. package/src/spine/delta-v-budget.ts +2 -2
  622. package/src/spine/dv-stage-resources.ts +55 -43
  623. package/src/spine/index.ts +11 -5
  624. package/src/spine/kepler-reckoning.ts +245 -3
  625. package/src/spine/kepler.ts +1 -1
  626. package/src/spine/known-holds.ts +96 -0
  627. package/src/spine/lagrange.ts +10 -46
  628. package/src/spine/lifecycle.ts +22 -0
  629. package/src/spine/lock-scope.ts +2 -2
  630. package/src/spine/map-topic.ts +3 -3
  631. package/src/spine/never-reckonable.ts +1 -1
  632. package/src/spine/orbit-patches.ts +54 -10
  633. package/src/spine/orbital-solve.ts +53 -1
  634. package/src/spine/powered-reckoning.ts +5 -1
  635. package/src/spine/processorEvaluator.ts +106 -72
  636. package/src/spine/processors.ts +144 -4
  637. package/src/spine/rail-registry.ts +1 -1
  638. package/src/spine/reckoner-generation.ts +11 -0
  639. package/src/spine/reckoners.ts +3 -0
  640. package/src/spine/replay-session-controller.ts +4 -6
  641. package/src/spine/resolve-tracked.ts +50 -1
  642. package/src/spine/send-status.ts +2 -0
  643. package/src/spine/settings-registry.ts +7 -0
  644. package/src/spine/slot-ids.ts +6 -3
  645. package/src/spine/space-center-state.ts +17 -20
  646. package/src/spine/stage-countdown-store.ts +76 -0
  647. package/src/spine/stream-status.ts +4 -4
  648. package/src/spine/subscribe-read.ts +2 -2
  649. package/src/spine/system-state.ts +19 -21
  650. package/src/spine/timeline-store.ts +1119 -247
  651. package/src/spine/uplink-clients.ts +44 -22
  652. package/src/spine/uplink-delays.ts +57 -0
  653. package/src/spine/uplink-health.ts +59 -27
  654. package/src/spine/use-action-input.ts +13 -9
  655. package/src/spine/use-body-states.ts +5 -4
  656. package/src/spine/use-command.ts +620 -239
  657. package/src/spine/use-last-known-path.ts +75 -0
  658. package/src/spine/use-observed-vantage.ts +24 -0
  659. package/src/spine/use-orbit-trajectory.ts +22 -3
  660. package/src/spine/use-stream-connected.ts +23 -0
  661. package/src/spine/use-stream-event.ts +6 -2
  662. package/src/spine/use-stream.ts +7 -4
  663. package/src/spine/use-telemetry.ts +5 -1
  664. package/src/spine/use-topic-clock.ts +196 -0
  665. package/src/spine/use-transmissions.ts +37 -18
  666. package/src/spine/vantage.ts +7 -0
  667. package/src/spine/view-clock.ts +89 -3
  668. package/src/testing/fake-command.ts +109 -0
  669. package/src/testing/index.ts +12 -1
  670. package/src/testing/install-act-gate-stretch.ts +1 -2
  671. package/src/testing/install-dom-stubs.ts +2 -38
  672. package/src/testing/install-real-test-host.ts +10 -6
  673. package/src/testing/recorded-uplink-banners.ts +71 -0
  674. package/src/testing/render.tsx +16 -3
  675. package/src/testing/stream-fixture.tsx +3 -3
  676. package/src/testing/stub-transport.ts +9 -0
  677. package/src/timeline.ts +2 -103
  678. package/src/topics.ts +87 -26
  679. package/src/unit-system/index.ts +2 -0
  680. package/src/unit-system/value.ts +61 -21
  681. package/src/units.ts +2 -1
  682. package/src/uplink-externals.ts +17 -7
  683. package/src/uplink-load.ts +9 -8
  684. package/src/uplink-manifest.ts +8 -3
  685. package/src/wrap-units.ts +3 -9
  686. package/dist/spine/contributed-channels.d.ts +0 -56
  687. package/dist/spine/contributed-channels.d.ts.map +0 -1
  688. package/dist/spine/contributed-channels.js +0 -108
  689. package/dist/spine/contributed-channels.js.map +0 -1
  690. package/src/spine/contributed-channels.ts +0 -134
@@ -1,7 +1,8 @@
1
1
  // The value tags each contract declares, registered by the client that owns it.
2
2
  //
3
3
  // A tag is a fact about a published value that a reader acts on: how it relates
4
- // in time (`kind`), whether it identifies its list entry (`entryKey`), and which
4
+ // in time (`kind`), whether it identifies its list entry (`entryKey`), what a
5
+ // picker lists it as (`displayName`, and `names` for a whole Topic), and which
5
6
  // models carry it forward (`reckonable`). Each contract's codegen writes them
6
7
  // into one table, `GENERATED_CONTRACT_TAGS` in its generated `units.ts`, and the
7
8
  // owning client registers that table here under its own id. Core's is
@@ -14,6 +15,7 @@ import type {
14
15
  GeneratedReckoningBasis,
15
16
  } from "./__generated__/reckonability";
16
17
  import { GENERATED_CONTRACT_TAGS } from "./__generated__/units";
18
+ import { noteRuntimeTopicMetadata } from "./runtime-topic-registry";
17
19
 
18
20
  /**
19
21
  * The owner id that Gonogo's own contract registers its value tags under, and
@@ -50,6 +52,8 @@ export interface ValueTags {
50
52
  readonly kind?: Exclude<SampleKind, "event">;
51
53
  /** Present when this value identifies its entry of a list across samples. */
52
54
  readonly entryKey?: true;
55
+ /** The name the value is listed under where the operator picks one, such as "Altitude (sea level)". */
56
+ readonly displayName?: string;
53
57
  }
54
58
 
55
59
  /**
@@ -67,6 +71,8 @@ export interface ContractReckonableRow {
67
71
  readonly field: string;
68
72
  /** The model that carries it forward, one of the reckoning bases. */
69
73
  readonly basis: string;
74
+ /** `"stepped"` for a value that changes only at a boundary the sample states and is never interpolated; absent for a continuous one. */
75
+ readonly carried?: "stepped";
70
76
  /** The published inputs the model needs beyond the value itself. */
71
77
  readonly inputs: readonly GeneratedReckonableInput[];
72
78
  }
@@ -85,6 +91,8 @@ export interface ContractTagTable {
85
91
  readonly topics?: Readonly<
86
92
  Record<string, Readonly<Record<string, ValueTags>>>
87
93
  >;
94
+ /** What each Topic describes, by Topic id, such as "Active vessel" for `vessel.flight`. */
95
+ readonly names?: Readonly<Record<string, string>>;
88
96
  /** Every value a declared model carries forward. */
89
97
  readonly reckonable?: readonly ContractReckonableRow[];
90
98
  }
@@ -123,6 +131,12 @@ const topicTags = new Map<
123
131
  { readonly owner: string; readonly paths: ReadonlyMap<string, ValueTags> }
124
132
  >();
125
133
 
134
+ /** Each Topic's display name and the owner that declared it, held to the same one-owner rule as the value tags. */
135
+ const topicNames = new Map<
136
+ string,
137
+ { readonly owner: string; readonly name: string }
138
+ >();
139
+
126
140
  /**
127
141
  * Reckonable rows by the owner that declared them. Unlike value tags these
128
142
  * may name another owner's Topic: a model belongs to whoever supplies it, so
@@ -148,8 +162,11 @@ export function registerContractTags(
148
162
  owner: string,
149
163
  table: ContractTagTable,
150
164
  ): void {
151
- for (const topic of Object.keys(table.topics ?? {})) {
152
- const existing = topicTags.get(topic);
165
+ for (const topic of [
166
+ ...Object.keys(table.topics ?? {}),
167
+ ...Object.keys(table.names ?? {}),
168
+ ]) {
169
+ const existing = topicTags.get(topic) ?? topicNames.get(topic);
153
170
  if (existing && existing.owner !== owner) {
154
171
  throw new Error(
155
172
  `registerContractTags("${owner}"): the values of ${topic} are already described by "${existing.owner}". ` +
@@ -175,8 +192,16 @@ export function registerContractTags(
175
192
  for (const [topic, paths] of Object.entries(table.topics ?? {})) {
176
193
  topicTags.set(topic, { owner, paths: new Map(Object.entries(paths)) });
177
194
  }
195
+ for (const [topic, entry] of topicNames) {
196
+ if (entry.owner === owner) topicNames.delete(topic);
197
+ }
198
+ for (const [topic, name] of Object.entries(table.names ?? {})) {
199
+ topicNames.set(topic, { owner, name });
200
+ }
178
201
  reckonableByOwner.set(owner, rows);
179
202
  generation += 1;
203
+ // A picker memoised on the registered Topics relabels only when that list's identity moves.
204
+ noteRuntimeTopicMetadata();
180
205
  }
181
206
 
182
207
  /**
@@ -215,8 +240,42 @@ export function valueTagsOf(
215
240
  }
216
241
 
217
242
  /**
218
- * A number that changes whenever a contract's tags are registered, so a cache
219
- * built from them knows when it is stale.
243
+ * What `topic` describes, in the game's own nouns ("Active vessel" for
244
+ * `vessel.flight`), as the contract that publishes it names it, or `undefined`
245
+ * when that contract names none. Useful for listing a Topic where the operator
246
+ * picks a value by what it measures. Used by the graph's series picker. A
247
+ * field's own name is read with {@link fieldDisplayNameOf}.
248
+ *
249
+ * @category Registering
250
+ */
251
+ export function topicDisplayNameOf(topic: string): string | undefined {
252
+ return topicNames.get(topic)?.name;
253
+ }
254
+
255
+ /**
256
+ * The name the value at `path` of `topic` is listed under ("Altitude (sea
257
+ * level)" for `altitudeAsl` of `vessel.flight`), as the contract that publishes
258
+ * the Topic names it, or `undefined` when it names none. `path` is the dotted
259
+ * camelCase path from the payload root, `*` for each list or dictionary it
260
+ * crosses. Useful for labelling a value the operator picks or reads off a plot.
261
+ * Used by the graph's series picker, title and legend.
262
+ *
263
+ * @category Registering
264
+ */
265
+ export function fieldDisplayNameOf(
266
+ topic: string,
267
+ path: string,
268
+ ): string | undefined {
269
+ return topicTags.get(topic)?.paths.get(path)?.displayName;
270
+ }
271
+
272
+ /**
273
+ * A number that changes whenever a contract's value tags or names are
274
+ * registered. Useful for knowing when something built from
275
+ * {@link topicDisplayNameOf} or {@link fieldDisplayNameOf} is stale. Used by
276
+ * the graph's series picker.
277
+ *
278
+ * @category Registering
220
279
  */
221
280
  export function contractTagsGeneration(): number {
222
281
  return generation;
@@ -251,6 +310,9 @@ export function clearRegisteredContractTags(): void {
251
310
  for (const [topic, entry] of topicTags) {
252
311
  if (entry.owner !== CORE_CONTRACT_OWNER) topicTags.delete(topic);
253
312
  }
313
+ for (const [topic, entry] of topicNames) {
314
+ if (entry.owner !== CORE_CONTRACT_OWNER) topicNames.delete(topic);
315
+ }
254
316
  for (const owner of reckonableByOwner.keys()) {
255
317
  if (owner !== CORE_CONTRACT_OWNER) reckonableByOwner.delete(owner);
256
318
  }
@@ -0,0 +1,178 @@
1
+ import type { DataRateReport, SetRate } from "./__generated__/contract";
2
+ import { magnitudeOr } from "./magnitude";
3
+
4
+ /**
5
+ * A rate a widget can ask the mod to send a Topic at: `"base"`, the rate every
6
+ * Topic runs at, or `"fast"`. The tier names how much the widget needs the
7
+ * Topic; what each tier is in samples a second is set by the mod and reported
8
+ * on `system.dataRates`.
9
+ *
10
+ * @category Reading telemetry
11
+ */
12
+ export type DataRateTier = SetRate["tier"];
13
+
14
+ /**
15
+ * The faster rates a widget can ask for on Topics it reads, each a list of the
16
+ * Values or whole Topics it wants at that tier (`"vessel.flight.altitude"` or
17
+ * `"vessel.flight"`). The mod sends a whole Topic at a time, so naming one Value
18
+ * puts its Topic at that tier. Useful for a widget that plots or models a Value
19
+ * closely and draws it in steps at one sample a second. Used by the Landing
20
+ * Status and Graph widgets.
21
+ *
22
+ * @category Registering widgets and themes
23
+ */
24
+ export interface WidgetDataRates {
25
+ /** Values or Topics to send at the fast tier while the widget is open. */
26
+ readonly fast?: readonly string[];
27
+ }
28
+
29
+ /**
30
+ * The samples a game second a Topic arrives at, read off a `system.dataRates`
31
+ * report: the Topic's own row when it is above the base tier, otherwise the base
32
+ * tier's rate. One a second when `report` is absent or not a report, which is
33
+ * the base rate the mod sends at until it says otherwise. Useful for sizing how many samples
34
+ * of a Topic to keep so a plot spans the same game time at any rate.
35
+ *
36
+ * @category Reading telemetry
37
+ */
38
+ export function samplesPerSecondOf(report: unknown, topic: string): number {
39
+ if (!isDataRateReport(report)) return 1;
40
+ return rateOf(
41
+ report.topics.find((entry) => entry.topic === topic) ??
42
+ report.tiers.find((entry) => entry.tier === "base"),
43
+ );
44
+ }
45
+
46
+ /* Read as a report only when both lists are present, so any other payload reads as none. */
47
+ function isDataRateReport(value: unknown): value is DataRateReport {
48
+ return (
49
+ typeof value === "object" &&
50
+ value !== null &&
51
+ Array.isArray(Reflect.get(value, "tiers")) &&
52
+ Array.isArray(Reflect.get(value, "topics"))
53
+ );
54
+ }
55
+
56
+ /**
57
+ * The samples a game second a rate tier carries now, read off a
58
+ * `system.dataRates` report. One a second when `report` is absent or not a
59
+ * report, or names no such tier. Useful for knowing how fast the mod sends the
60
+ * Topics at a tier, such as the fastest a screen can be sent them. Used by the
61
+ * main screen's pacing of its stations.
62
+ *
63
+ * @category Reading telemetry
64
+ */
65
+ export function tierSamplesPerSecondOf(
66
+ report: unknown,
67
+ tier: DataRateTier,
68
+ ): number {
69
+ if (!isDataRateReport(report)) return 1;
70
+ return rateOf(report.tiers.find((entry) => entry.tier === tier));
71
+ }
72
+
73
+ /* A sample rate becomes the plain number samples are counted in, such as how many a timeline keeps. */
74
+ function rateOf(
75
+ row: Pick<DataRateReport["tiers"][number], "samplesPerSecond"> | undefined,
76
+ ): number {
77
+ return magnitudeOr(row?.samplesPerSecond, 1);
78
+ }
79
+
80
+ /*
81
+ * Fields too large to keep on every sample of a Topic sent above the base
82
+ * rate, and read only from the sample on screen. A vessel.landing sample is
83
+ * about 61 KB with its terrain and 1.4 KB without, so at ten a second its
84
+ * history would hold close to a gigabyte if every sample kept them.
85
+ */
86
+ const SUPERSEDED_FIELDS: ReadonlyMap<string, readonly string[]> = new Map([
87
+ [
88
+ "vessel.landing",
89
+ [
90
+ "siteHeights",
91
+ "horizonAngles",
92
+ "groundTrackDistances",
93
+ "groundTrackElevations",
94
+ ],
95
+ ],
96
+ ]);
97
+
98
+ /**
99
+ * True for a Topic whose history drops some fields once a sample is no longer
100
+ * the one on screen, as {@link supersededPayload} drops them. Useful for
101
+ * skipping that work on every other Topic. Used by every screen's timelines and
102
+ * by the main screen's relay to stations.
103
+ *
104
+ * @category Reading telemetry
105
+ */
106
+ export function hasSupersededFields(topic: string): boolean {
107
+ return SUPERSEDED_FIELDS.has(topic);
108
+ }
109
+
110
+ /**
111
+ * A sample's payload once a newer sample of its Topic is on screen: the same
112
+ * payload without the fields only the sample on screen is read for, such as
113
+ * Landing Status's terrain on `vessel.landing`. The payload itself, unchanged,
114
+ * for any other Topic or when none of those fields are present. Useful for
115
+ * keeping a long history of a fast Topic without holding its largest fields on
116
+ * every sample. Used by every screen's timelines and by the main screen's
117
+ * relay to stations.
118
+ *
119
+ * @category Reading telemetry
120
+ */
121
+ export function supersededPayload<Payload>(
122
+ topic: string,
123
+ payload: Payload,
124
+ ): Payload {
125
+ const fields = SUPERSEDED_FIELDS.get(topic);
126
+ if (!fields || payload === null || typeof payload !== "object") {
127
+ return payload;
128
+ }
129
+ const record = payload as Record<string, unknown>;
130
+ if (!fields.some((field) => field in record)) return payload;
131
+ const kept: Record<string, unknown> = {};
132
+ for (const key of Object.keys(record)) {
133
+ if (!fields.includes(key)) kept[key] = record[key];
134
+ }
135
+ return kept as Payload;
136
+ }
137
+
138
+ /*
139
+ * The mod's own list of fields it sends on a connection only when they change:
140
+ * values the game retakes about once a second or less, which would otherwise
141
+ * repeat unchanged on every sample of a Topic sent ten times a second.
142
+ */
143
+ const SENT_ON_CHANGE: ReadonlyMap<string, readonly string[]> = new Map([
144
+ ["vessel.landing", ["siteHeights", "horizonAngles"]],
145
+ ]);
146
+
147
+ /**
148
+ * The payload fields of a Topic that the mod sends on a connection only when
149
+ * they change, such as Landing Status's terrain grid and skyline on
150
+ * `vessel.landing`. Empty for every other Topic. A sample that leaves one out
151
+ * names it in the `stream-data` frame's `unchanged` list. Useful for passing a
152
+ * Topic's samples on to another screen without repeating those fields on every
153
+ * sample. Used by the main screen's relay to stations.
154
+ *
155
+ * @category Reading telemetry
156
+ */
157
+ export function fieldsSentOnChange(topic: string): readonly string[] {
158
+ return SENT_ON_CHANGE.get(topic) ?? [];
159
+ }
160
+
161
+ /**
162
+ * Puts back into `payload` each field `unchanged` names, taken from `previous`,
163
+ * the last payload of the same Topic received on the same connection. A field
164
+ * `previous` does not hold stays absent, since its value is not known. Changes
165
+ * `payload` in place.
166
+ */
167
+ export function fillUnchangedFields(
168
+ payload: unknown,
169
+ unchanged: readonly string[],
170
+ previous: unknown,
171
+ ): void {
172
+ if (typeof payload !== "object" || payload === null) return;
173
+ if (typeof previous !== "object" || previous === null) return;
174
+ for (const field of unchanged) {
175
+ if (field in previous)
176
+ Reflect.set(payload, field, Reflect.get(previous, field));
177
+ }
178
+ }
@@ -79,7 +79,7 @@ export type HeldAtHomeTopic = GeneratedHeldAtHomeTopic;
79
79
  * How the running mod says each Topic is delayed, as carried on the
80
80
  * `delayRoles` field of `system.uplinks`. It covers Uplink Topics as well as
81
81
  * Gonogo's own. A Topic in none of the sets, and not under a prefix in
82
- * `trueNowPrefixes`, is delayed. Useful for reading an Uplink's Topics in the
82
+ * `trueNowPrefixes` or `heldAtHomePrefixes`, is delayed. Useful for reading an Uplink's Topics in the
83
83
  * right delay lane. Returned by {@link readDeclaredDelayRoles} and taken by
84
84
  * {@link delayLaneOf}.
85
85
  *
@@ -92,12 +92,25 @@ export interface DeclaredDelayRoles {
92
92
  readonly heldAtHome: ReadonlySet<string>;
93
93
  /** Prefixes under which every Topic is read with no signal delay. */
94
94
  readonly trueNowPrefixes: readonly string[];
95
+ /**
96
+ * Prefixes under which every Topic is held at the home command centre, such
97
+ * as one record per saved craft. The mod applies each centre's delay home
98
+ * before it sends them, so they are read as received. A mod that predates the
99
+ * list sends none.
100
+ */
101
+ readonly heldAtHomePrefixes?: readonly string[];
95
102
  /**
96
103
  * Addressed Topics: those whose values are each sent to one particular
97
104
  * command centre, such as that centre's own contact plan. The mod delivers
98
105
  * each value after its own delay, so it is read as received.
99
106
  */
100
107
  readonly addressed: ReadonlySet<string>;
108
+ /**
109
+ * Topics that describe whichever craft is active, each kept per craft, such
110
+ * as an Uplink's life-support reading. A screen shows the active craft's own
111
+ * newest reading of each. A mod that predates the list sends none.
112
+ */
113
+ readonly followsActiveCraft?: ReadonlySet<string>;
101
114
  }
102
115
 
103
116
  const GENERATED_ROLES: DeclaredDelayRoles = {
@@ -140,7 +153,9 @@ export function readDeclaredDelayRoles(
140
153
  trueNow: new Set(trueNow),
141
154
  heldAtHome: new Set(heldAtHome),
142
155
  trueNowPrefixes,
156
+ heldAtHomePrefixes: stringsOf(raw.heldAtHomePrefixes) ?? [],
143
157
  addressed: new Set(stringsOf(raw.addressed) ?? []),
158
+ followsActiveCraft: new Set(stringsOf(raw.followsActiveCraft) ?? []),
144
159
  };
145
160
  }
146
161
 
@@ -196,7 +211,9 @@ export function delayLaneOf(
196
211
  ) {
197
212
  return "true-now";
198
213
  }
199
- return roles.trueNowPrefixes.some((prefix) => topic.startsWith(prefix))
214
+ const heldPrefixes = roles.heldAtHomePrefixes ?? [];
215
+ return roles.trueNowPrefixes.some((prefix) => topic.startsWith(prefix)) ||
216
+ heldPrefixes.some((prefix) => topic.startsWith(prefix))
200
217
  ? "true-now"
201
218
  : "delayed";
202
219
  }
@@ -0,0 +1,182 @@
1
+ /**
2
+ * Degrees either axis may be off the port's line for a docking mark to read as
3
+ * lined up. Useful for colouring an alignment cue the same way as the four
4
+ * triangles. Used by the Rendezvous widget's border cue.
5
+ *
6
+ * @category Widget slots
7
+ */
8
+ export const DOCK_LINED_UP_DEG = 1;
9
+
10
+ /**
11
+ * The four marks around a docking port, named for the side of the port each
12
+ * sits on. Useful for drawing or styling one triangle at a time. Used by
13
+ * {@link dockMarkStyles} and {@link dockMarkPath}.
14
+ *
15
+ * @category Widget slots
16
+ */
17
+ export type DockMarkSide = "top" | "right" | "bottom" | "left";
18
+
19
+ /**
20
+ * How one of the four triangles around the target port is drawn: its colour as
21
+ * a CSS colour, whether it is outlined and dashed rather than filled, and
22
+ * whether it is left out. A field left out keeps the drawer's default.
23
+ * Useful for painting the same triangles on a camera picture and on a drawn
24
+ * view. Used by the Rendezvous widget and its camera augment.
25
+ *
26
+ * @category Widget slots
27
+ */
28
+ export interface DockMarkStyle {
29
+ /** The CSS colour of the triangle. */
30
+ colour?: string;
31
+ /** Whether the triangle is outlined and dashed rather than filled. */
32
+ dashed?: boolean;
33
+ /** Whether the triangle is left out. */
34
+ hidden?: boolean;
35
+ }
36
+
37
+ /**
38
+ * What the four triangles around the target port are drawn from: whether they
39
+ * show, the horizontal and vertical angles off the port's line, and whether the
40
+ * ports are aligned or docked. Useful for styling the triangles the same on a
41
+ * camera picture and a drawn view. Taken by {@link dockMarkStyles}.
42
+ *
43
+ * @category Widget slots
44
+ */
45
+ export interface DockMarkInput {
46
+ /** Whether the port is in front of the lens, in frame and not hidden behind something; with no camera, whether the port is inside the drawn circle. */
47
+ visible: boolean;
48
+ /** Horizontal line-of-sight angle to the target port in degrees, `undefined` while it is not reported. */
49
+ ax: number | undefined;
50
+ /** Vertical line-of-sight angle to the target port in degrees, `undefined` while it is not reported. */
51
+ ay: number | undefined;
52
+ /** True while the two ports face each other head-on. */
53
+ aligned: boolean;
54
+ /** True once the own port has captured the target port or is joined to it. */
55
+ docked: boolean;
56
+ }
57
+
58
+ const LINED_UP = "var(--color-accent-fg)";
59
+ const OFF = "var(--color-warn-mark)";
60
+ const HIDDEN: DockMarkStyle = { hidden: true };
61
+
62
+ /**
63
+ * The look of the four triangles around the target port: top and bottom
64
+ * follow the vertical angle, left and right the horizontal one. A triangle is
65
+ * green while its angle is within {@link DOCK_LINED_UP_DEG} and amber outside
66
+ * it, and all four are green once the port has captured or joined the target.
67
+ * Filled while the ports face each other head-on, outlined and dashed while
68
+ * they do not. None is drawn unless the port is visible.
69
+ * Useful for giving a camera picture and a drawn view the same markers. Used
70
+ * by the Rendezvous widget and its camera augment.
71
+ *
72
+ * @category Widget slots
73
+ */
74
+ export function dockMarkStyles(
75
+ input: DockMarkInput,
76
+ ): Record<DockMarkSide, DockMarkStyle> {
77
+ const { visible, ax, ay, aligned, docked } = input;
78
+ if (!visible) {
79
+ return { top: HIDDEN, right: HIDDEN, bottom: HIDDEN, left: HIDDEN };
80
+ }
81
+ const side = (angle: number | undefined): DockMarkStyle => {
82
+ if (docked) return { colour: LINED_UP, dashed: false };
83
+ if (angle === undefined || !Number.isFinite(angle)) return HIDDEN;
84
+ return {
85
+ colour: Math.abs(angle) <= DOCK_LINED_UP_DEG ? LINED_UP : OFF,
86
+ dashed: !aligned,
87
+ };
88
+ };
89
+ const vertical = side(ay);
90
+ const horizontal = side(ax);
91
+ return {
92
+ top: vertical,
93
+ bottom: vertical,
94
+ left: horizontal,
95
+ right: horizontal,
96
+ };
97
+ }
98
+
99
+ /**
100
+ * Where the four triangles sit, in pixels: the centre of the port, half the
101
+ * side of the box they surround, the side of each triangle, and the stroke.
102
+ * Useful for drawing the triangles on a picture at any size. Taken by
103
+ * {@link dockMarkPath}.
104
+ *
105
+ * @category Widget slots
106
+ */
107
+ export interface DockMarkGeometry {
108
+ /** The horizontal centre of the port. */
109
+ cx: number;
110
+ /** The vertical centre of the port. */
111
+ cy: number;
112
+ /** Half the side of the box the triangles surround. */
113
+ half: number;
114
+ /** The side of each triangle. */
115
+ arm: number;
116
+ /** The stroke width. */
117
+ stroke: number;
118
+ }
119
+
120
+ /**
121
+ * The smallest size the triangles keep on a camera picture, in the picture's
122
+ * pixels, so they stay readable when the port is far away. Useful for an Uplink
123
+ * that draws the marks over its own video.
124
+ *
125
+ * @category Widget slots
126
+ * @intent an Uplink drawing the dock marks over its own camera picture passes these as the floors of {@link dockMarkGeometry}
127
+ */
128
+ export const DOCK_MARK_CAMERA_FLOORS = {
129
+ half: 14,
130
+ arm: 6,
131
+ stroke: 2,
132
+ } as const;
133
+
134
+ /** The share of the box's side one triangle takes. */
135
+ const ARM_FRACTION = 0.3;
136
+
137
+ /**
138
+ * The geometry of the triangles for a port at `centre` whose apparent radius
139
+ * is `radiusPx`: the box is that radius on a side half, never below a floor,
140
+ * and each triangle is a share of the box's side. A camera picture keeps the
141
+ * floors {@link DOCK_MARK_CAMERA_FLOORS}; a smaller drawing passes its own.
142
+ * Useful for sizing the triangles with the port's range. Used by the
143
+ * Rendezvous widget's drawn view.
144
+ *
145
+ * @category Widget slots
146
+ */
147
+ export function dockMarkGeometry(
148
+ centre: { x: number; y: number },
149
+ radiusPx: number,
150
+ floors: {
151
+ half: number;
152
+ arm: number;
153
+ stroke: number;
154
+ } = DOCK_MARK_CAMERA_FLOORS,
155
+ ): DockMarkGeometry {
156
+ const half = Math.max(floors.half, radiusPx);
157
+ const arm = Math.max(floors.arm, ARM_FRACTION * half * 2);
158
+ return { cx: centre.x, cy: centre.y, half, arm, stroke: floors.stroke };
159
+ }
160
+
161
+ /**
162
+ * The outline of one triangle: outside the box on its side, its tip on the
163
+ * box's edge pointing at the port. Useful for drawing the marks in an SVG.
164
+ * Used by the Rendezvous widget's drawn view.
165
+ *
166
+ * @category Widget slots
167
+ */
168
+ export function dockMarkPath(side: DockMarkSide, g: DockMarkGeometry): string {
169
+ const { cx, cy, half: h, arm: a } = g;
170
+ const t = a * 0.8;
171
+ const w = a / 2;
172
+ switch (side) {
173
+ case "top":
174
+ return `M${cx} ${cy - h}L${cx - w} ${cy - h - t}L${cx + w} ${cy - h - t}Z`;
175
+ case "right":
176
+ return `M${cx + h} ${cy}L${cx + h + t} ${cy - w}L${cx + h + t} ${cy + w}Z`;
177
+ case "bottom":
178
+ return `M${cx} ${cy + h}L${cx + w} ${cy + h + t}L${cx - w} ${cy + h + t}Z`;
179
+ default:
180
+ return `M${cx - h} ${cy}L${cx - h - t} ${cy + w}L${cx - h - t} ${cy - w}Z`;
181
+ }
182
+ }
package/src/envelope.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  // Hand-owned: RT cannot derive the union alias from C# generics. Under the drift gate.
2
2
 
3
3
  import type {
4
+ CapRate,
4
5
  ClaimRequest,
5
6
  CommandAccepted,
6
7
  CommandGroupRequest,
@@ -12,6 +13,7 @@ import type {
12
13
  Hello,
13
14
  Ping,
14
15
  Pong,
16
+ SetRate,
15
17
  SetVantage,
16
18
  StreamData,
17
19
  Subscribe,
@@ -56,4 +58,6 @@ export type ClientMessage =
56
58
  | CommandRequest<unknown>
57
59
  | CommandGroupRequest
58
60
  | ClaimRequest
61
+ | SetRate
62
+ | CapRate
59
63
  | Ping;
@@ -1,3 +1,4 @@
1
+ import type { FlightEndReason } from "../__generated__/contract";
1
2
  import type { DataKey, StreamStatusValue } from "../api/types";
2
3
  import type { BandKind, Reading, ReckoningBasis } from "../reading";
3
4
  import type { TopicId } from "../topics";
@@ -328,8 +329,10 @@ export interface ReadingSeriesRange<Payload = unknown> {
328
329
  export interface FlightRecord {
329
330
  /** This flight's identifier. */
330
331
  id: string;
331
- /** The vessel's name when the recording began. */
332
+ /** The vessel's name now, or when the flight ended. */
332
333
  vesselName: string;
334
+ /** The name the vessel launched with. Absent while it is the same as `vesselName`. */
335
+ launchName?: string;
333
336
  /** The game's identifier for the vessel, when it has one. */
334
337
  vesselUid?: string | null;
335
338
  /** Wall-clock ms when the recording began. */
@@ -362,6 +365,18 @@ export interface FlightRecord {
362
365
  * vessel and the operator might still recover its remains.
363
366
  */
364
367
  outcome?: FlightOutcome;
368
+ /**
369
+ * Why the flight ended, as the `flight.ended` notice named it. Absent while the
370
+ * flight is open and for a recording that stopped without one, such as the
371
+ * operator leaving the flight scene.
372
+ */
373
+ endReason?: FlightEndReason;
374
+ /** The names of the kerbals who went on EVA from this vessel during the flight, in the order they went. Absent when none did. */
375
+ evaKerbals?: string[];
376
+ /** The id of the craft the vessel joined, when `endReason` is `FlightEndReason.Docked`. */
377
+ joinedVesselId?: string;
378
+ /** The name of the craft the vessel joined, when `endReason` is `FlightEndReason.Docked`. */
379
+ joinedVesselName?: string;
365
380
  /**
366
381
  * The UT, in seconds, of the first captured frame, set only by a recorder
367
382
  * that works in UT. A graph of such a record queries its range with these:
@@ -468,8 +483,10 @@ export interface FlightChapterRecord {
468
483
  export interface MissionMeta {
469
484
  /** This mission's identifier. */
470
485
  id: string;
471
- /** The vessel's name. */
486
+ /** The vessel's name now, or when the flight ended. */
472
487
  vesselName: string;
488
+ /** The name the vessel launched with. Absent while it is the same as `vesselName`. */
489
+ launchName?: string;
473
490
  /** Wall-clock ms when recording started. */
474
491
  launchedAt: number;
475
492
  /** UT (seconds) of the first captured frame. */
@@ -497,6 +514,18 @@ export interface MissionMeta {
497
514
  * automatically, but can still be deleted by hand. Absent means not starred.
498
515
  */
499
516
  starred?: boolean;
517
+ /**
518
+ * Why the flight ended, as the `flight.ended` notice named it. Absent for a
519
+ * recording that stopped without one, such as the operator leaving the flight
520
+ * scene, and for a mission recorded before it was kept.
521
+ */
522
+ endReason?: FlightEndReason;
523
+ /** The names of the kerbals who went on EVA from this vessel during the flight, in the order they went. Absent when none did. */
524
+ evaKerbals?: string[];
525
+ /** The id of the craft the vessel joined, when `endReason` is `FlightEndReason.Docked`. */
526
+ joinedVesselId?: string;
527
+ /** The name of the craft the vessel joined, when `endReason` is `FlightEndReason.Docked`. */
528
+ joinedVesselName?: string;
500
529
  /**
501
530
  * User-authored chapters / markers, as `FlightChapterRecord`. Its
502
531
  * `startMs`/`endMs` are literal milliseconds elapsed since `firstFrameUt`,
@@ -101,9 +101,6 @@
101
101
  * - `frameSides` and `FrameSides`, which replicate the in-game frame selector's
102
102
  * own notion of which bodies sit on each side, and so track something outside
103
103
  * this repo
104
- * - the two station-keeping thresholds behind `LibrationStationKeeping`, which
105
- * are tuning rather than physics: read the meaning, not the distance it was
106
- * cut at
107
104
  * - `CelestialFacts` and `CelestialBody`, the catalogue every function below
108
105
  * takes. Already on the root barrel, which is where the catalogue is produced,
109
106
  * and a type reachable through two paths raises a canonicality question for no
@@ -130,7 +127,6 @@ export {
130
127
  type LibrationPair,
131
128
  type LibrationPoint,
132
129
  type LibrationRefusal,
133
- type LibrationStationKeeping,
134
130
  lagrangePointsAt,
135
131
  librationOffsetOf,
136
132
  librationPairLabel,