@ksp-gonogo/sitrep-sdk 1.0.0 → 1.1.0-rc.52
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.
- package/dist/__generated__/command-map.d.ts +118 -2
- package/dist/__generated__/command-map.d.ts.map +1 -1
- package/dist/__generated__/command-map.js +36 -0
- package/dist/__generated__/command-map.js.map +1 -1
- package/dist/__generated__/contract.d.ts +2380 -186
- package/dist/__generated__/contract.d.ts.map +1 -1
- package/dist/__generated__/contract.js +39 -3
- package/dist/__generated__/contract.js.map +1 -1
- package/dist/__generated__/delay-roles.d.ts +2 -2
- package/dist/__generated__/delay-roles.d.ts.map +1 -1
- package/dist/__generated__/delay-roles.js +8 -0
- package/dist/__generated__/delay-roles.js.map +1 -1
- package/dist/__generated__/error-codes.d.ts +2 -3
- package/dist/__generated__/error-codes.d.ts.map +1 -1
- package/dist/__generated__/error-codes.js +6 -7
- package/dist/__generated__/error-codes.js.map +1 -1
- package/dist/__generated__/frames.d.ts +72 -0
- package/dist/__generated__/frames.d.ts.map +1 -1
- package/dist/__generated__/frames.js +36 -0
- package/dist/__generated__/frames.js.map +1 -1
- package/dist/__generated__/reckonability.d.ts +3 -3
- package/dist/__generated__/reckonability.d.ts.map +1 -1
- package/dist/__generated__/reckonability.js +2 -2
- package/dist/__generated__/reckonability.js.map +1 -1
- package/dist/__generated__/sample-kinds.d.ts +9 -0
- package/dist/__generated__/sample-kinds.d.ts.map +1 -1
- package/dist/__generated__/sample-kinds.js +9 -0
- package/dist/__generated__/sample-kinds.js.map +1 -1
- package/dist/__generated__/test-theme.d.ts +145 -0
- package/dist/__generated__/test-theme.d.ts.map +1 -1
- package/dist/__generated__/test-theme.js +172 -2
- package/dist/__generated__/test-theme.js.map +1 -1
- package/dist/__generated__/topic-map.d.ts +21 -3
- package/dist/__generated__/topic-map.d.ts.map +1 -1
- package/dist/__generated__/topic-map.js +9 -0
- package/dist/__generated__/topic-map.js.map +1 -1
- package/dist/__generated__/units.d.ts +210 -27
- package/dist/__generated__/units.d.ts.map +1 -1
- package/dist/__generated__/units.js +757 -7
- package/dist/__generated__/units.js.map +1 -1
- package/dist/api/aero-models.d.ts +198 -0
- package/dist/api/aero-models.d.ts.map +1 -0
- package/dist/api/aero-models.js +67 -0
- package/dist/api/aero-models.js.map +1 -0
- package/dist/api/biome-knowledge.d.ts +79 -0
- package/dist/api/biome-knowledge.d.ts.map +1 -0
- package/dist/api/biome-knowledge.js +61 -0
- package/dist/api/biome-knowledge.js.map +1 -0
- package/dist/api/bodies.d.ts +2 -0
- package/dist/api/bodies.d.ts.map +1 -1
- package/dist/api/bodies.js +2 -0
- package/dist/api/bodies.js.map +1 -1
- package/dist/api/comms-models.d.ts +264 -0
- package/dist/api/comms-models.d.ts.map +1 -0
- package/dist/api/comms-models.js +86 -0
- package/dist/api/comms-models.js.map +1 -0
- package/dist/api/flight-sources.d.ts +143 -0
- package/dist/api/flight-sources.d.ts.map +1 -0
- package/dist/api/flight-sources.js +76 -0
- package/dist/api/flight-sources.js.map +1 -0
- package/dist/api/flight-tags.d.ts +52 -0
- package/dist/api/flight-tags.d.ts.map +1 -0
- package/dist/api/flight-tags.js +43 -0
- package/dist/api/flight-tags.js.map +1 -0
- package/dist/api/index.d.ts +13 -2
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +11 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/modes.d.ts +1067 -0
- package/dist/api/modes.d.ts.map +1 -0
- package/dist/api/modes.js +73 -0
- package/dist/api/modes.js.map +1 -0
- package/dist/api/pilots.d.ts +656 -0
- package/dist/api/pilots.d.ts.map +1 -0
- package/dist/api/pilots.js +90 -0
- package/dist/api/pilots.js.map +1 -0
- package/dist/api/planning-events.d.ts +27 -0
- package/dist/api/planning-events.d.ts.map +1 -0
- package/dist/api/planning-events.js +38 -0
- package/dist/api/planning-events.js.map +1 -0
- package/dist/api/planning-resources.d.ts +83 -0
- package/dist/api/planning-resources.d.ts.map +1 -0
- package/dist/api/planning-resources.js +42 -0
- package/dist/api/planning-resources.js.map +1 -0
- package/dist/api/prediction-models.d.ts +1031 -0
- package/dist/api/prediction-models.d.ts.map +1 -0
- package/dist/api/prediction-models.js +77 -0
- package/dist/api/prediction-models.js.map +1 -0
- package/dist/api/slots.d.ts +32 -2
- package/dist/api/slots.d.ts.map +1 -1
- package/dist/api/stock-bodies.d.ts +4 -3
- package/dist/api/stock-bodies.d.ts.map +1 -1
- package/dist/api/stock-bodies.js +6 -19
- package/dist/api/stock-bodies.js.map +1 -1
- package/dist/api/theme.d.ts +453 -6
- package/dist/api/theme.d.ts.map +1 -1
- package/dist/api/types.d.ts +146 -11
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/wait-ends.d.ts +215 -0
- package/dist/api/wait-ends.d.ts.map +1 -0
- package/dist/api/wait-ends.js +78 -0
- package/dist/api/wait-ends.js.map +1 -0
- package/dist/command-delay.d.ts +2 -0
- package/dist/command-delay.d.ts.map +1 -1
- package/dist/command-delay.js.map +1 -1
- package/dist/commands.d.ts +1 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/compat-versions.d.ts.map +1 -1
- package/dist/compat-versions.js +1 -1
- package/dist/compat-versions.js.map +1 -1
- package/dist/contract-tags.d.ts.map +1 -1
- package/dist/contract-tags.js +1 -0
- package/dist/contract-tags.js.map +1 -1
- package/dist/delay-roles.d.ts +43 -0
- package/dist/delay-roles.d.ts.map +1 -1
- package/dist/delay-roles.js +58 -0
- package/dist/delay-roles.js.map +1 -1
- package/dist/event-timeline.d.ts.map +1 -1
- package/dist/event-timeline.js +14 -3
- package/dist/event-timeline.js.map +1 -1
- package/dist/flight/types.d.ts +30 -0
- package/dist/flight/types.d.ts.map +1 -1
- package/dist/flight/types.js.map +1 -1
- package/dist/frames/index.d.ts +2 -1
- package/dist/frames/index.d.ts.map +1 -1
- package/dist/frames/index.js +2 -1
- package/dist/frames/index.js.map +1 -1
- package/dist/index.d.ts +11 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/maths/index.d.ts +16 -0
- package/dist/maths/index.d.ts.map +1 -0
- package/dist/maths/index.js +16 -0
- package/dist/maths/index.js.map +1 -0
- package/dist/reading.d.ts +61 -2
- package/dist/reading.d.ts.map +1 -1
- package/dist/reading.js +29 -0
- package/dist/reading.js.map +1 -1
- package/dist/reads-index.json +955 -86
- package/dist/registry/index.d.ts +14 -0
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +14 -0
- package/dist/registry/index.js.map +1 -1
- package/dist/runtime-topic-registry.d.ts.map +1 -1
- package/dist/runtime-topic-registry.js +11 -0
- package/dist/runtime-topic-registry.js.map +1 -1
- package/dist/spine/__fixtures__/stock-catalogue.d.ts +4 -0
- package/dist/spine/__fixtures__/stock-catalogue.d.ts.map +1 -0
- package/dist/spine/__fixtures__/stock-catalogue.js +29 -0
- package/dist/spine/__fixtures__/stock-catalogue.js.map +1 -0
- package/dist/spine/body-derivations.d.ts +21 -0
- package/dist/spine/body-derivations.d.ts.map +1 -1
- package/dist/spine/body-derivations.js +34 -1
- package/dist/spine/body-derivations.js.map +1 -1
- package/dist/spine/body-ephemeris.d.ts +152 -0
- package/dist/spine/body-ephemeris.d.ts.map +1 -0
- package/dist/spine/body-ephemeris.js +579 -0
- package/dist/spine/body-ephemeris.js.map +1 -0
- package/dist/spine/body-orbit-curve.d.ts +19 -0
- package/dist/spine/body-orbit-curve.d.ts.map +1 -0
- package/dist/spine/body-orbit-curve.js +53 -0
- package/dist/spine/body-orbit-curve.js.map +1 -0
- package/dist/spine/body-pose.d.ts +21 -0
- package/dist/spine/body-pose.d.ts.map +1 -1
- package/dist/spine/body-pose.js +98 -31
- package/dist/spine/body-pose.js.map +1 -1
- package/dist/spine/capability-lock.d.ts +5 -1
- package/dist/spine/capability-lock.d.ts.map +1 -1
- package/dist/spine/capability-lock.js +9 -1
- package/dist/spine/capability-lock.js.map +1 -1
- package/dist/spine/catalogue-elements.d.ts +1 -1
- package/dist/spine/catalogue-elements.d.ts.map +1 -1
- package/dist/spine/catalogue-elements.js +10 -5
- package/dist/spine/catalogue-elements.js.map +1 -1
- package/dist/spine/celestial-facts.d.ts +27 -1
- package/dist/spine/celestial-facts.d.ts.map +1 -1
- package/dist/spine/celestial-facts.js +37 -2
- package/dist/spine/celestial-facts.js.map +1 -1
- package/dist/spine/client-reading.d.ts +3 -3
- package/dist/spine/client-reading.d.ts.map +1 -1
- package/dist/spine/client-reading.js +9 -1
- package/dist/spine/client-reading.js.map +1 -1
- package/dist/spine/client-timeline.js +7 -4
- package/dist/spine/client-timeline.js.map +1 -1
- package/dist/spine/client.d.ts +43 -11
- package/dist/spine/client.d.ts.map +1 -1
- package/dist/spine/client.js +221 -40
- package/dist/spine/client.js.map +1 -1
- package/dist/spine/comms-path-geometry.d.ts +4 -4
- package/dist/spine/comms-path-geometry.js +5 -5
- package/dist/spine/comms-path-geometry.js.map +1 -1
- package/dist/spine/context.d.ts +7 -0
- package/dist/spine/context.d.ts.map +1 -1
- package/dist/spine/context.js +35 -6
- package/dist/spine/context.js.map +1 -1
- package/dist/spine/core-reckoners.d.ts +5 -0
- package/dist/spine/core-reckoners.d.ts.map +1 -1
- package/dist/spine/core-reckoners.js +5 -959
- package/dist/spine/core-reckoners.js.map +1 -1
- package/dist/spine/delay-estimate.js +2 -2
- package/dist/spine/delay-estimate.js.map +1 -1
- package/dist/spine/elements-from-state.d.ts +22 -0
- package/dist/spine/elements-from-state.d.ts.map +1 -0
- package/dist/spine/elements-from-state.js +97 -0
- package/dist/spine/elements-from-state.js.map +1 -0
- package/dist/spine/hermite.d.ts +9 -0
- package/dist/spine/hermite.d.ts.map +1 -0
- package/dist/spine/hermite.js +34 -0
- package/dist/spine/hermite.js.map +1 -0
- package/dist/spine/impact-point.d.ts +33 -0
- package/dist/spine/impact-point.d.ts.map +1 -1
- package/dist/spine/impact-point.js +157 -45
- package/dist/spine/impact-point.js.map +1 -1
- package/dist/spine/index.d.ts +17 -1
- package/dist/spine/index.d.ts.map +1 -1
- package/dist/spine/index.js +17 -1
- package/dist/spine/index.js.map +1 -1
- package/dist/spine/kepler-reckoning.d.ts.map +1 -1
- package/dist/spine/kepler-reckoning.js +4 -3
- package/dist/spine/kepler-reckoning.js.map +1 -1
- package/dist/spine/kepler.d.ts +2 -0
- package/dist/spine/kepler.d.ts.map +1 -1
- package/dist/spine/kepler.js +2 -0
- package/dist/spine/kepler.js.map +1 -1
- package/dist/spine/live-run-reckoners.d.ts +6 -0
- package/dist/spine/live-run-reckoners.d.ts.map +1 -0
- package/dist/spine/live-run-reckoners.js +596 -0
- package/dist/spine/live-run-reckoners.js.map +1 -0
- package/dist/spine/live-run-relay.d.ts +160 -0
- package/dist/spine/live-run-relay.d.ts.map +1 -0
- package/dist/spine/live-run-relay.js +292 -0
- package/dist/spine/live-run-relay.js.map +1 -0
- package/dist/spine/live-run.d.ts +185 -0
- package/dist/spine/live-run.d.ts.map +1 -0
- package/dist/spine/live-run.js +69 -0
- package/dist/spine/live-run.js.map +1 -0
- package/dist/spine/lock-scope.d.ts +7 -0
- package/dist/spine/lock-scope.d.ts.map +1 -1
- package/dist/spine/lock-scope.js +12 -1
- package/dist/spine/lock-scope.js.map +1 -1
- package/dist/spine/mode-command-gate.d.ts +16 -0
- package/dist/spine/mode-command-gate.d.ts.map +1 -0
- package/dist/spine/mode-command-gate.js +43 -0
- package/dist/spine/mode-command-gate.js.map +1 -0
- package/dist/spine/mode-view.d.ts +38 -0
- package/dist/spine/mode-view.d.ts.map +1 -0
- package/dist/spine/mode-view.js +335 -0
- package/dist/spine/mode-view.js.map +1 -0
- package/dist/spine/orbit-patches.d.ts +12 -0
- package/dist/spine/orbit-patches.d.ts.map +1 -1
- package/dist/spine/orbit-patches.js +12 -0
- package/dist/spine/orbit-patches.js.map +1 -1
- package/dist/spine/orbit-speed.d.ts +20 -0
- package/dist/spine/orbit-speed.d.ts.map +1 -0
- package/dist/spine/orbit-speed.js +29 -0
- package/dist/spine/orbit-speed.js.map +1 -0
- package/dist/spine/orbit-states.d.ts +54 -0
- package/dist/spine/orbit-states.d.ts.map +1 -0
- package/dist/spine/orbit-states.js +251 -0
- package/dist/spine/orbit-states.js.map +1 -0
- package/dist/spine/orbit-trajectory.d.ts +40 -4
- package/dist/spine/orbit-trajectory.d.ts.map +1 -1
- package/dist/spine/orbit-trajectory.js +82 -44
- package/dist/spine/orbit-trajectory.js.map +1 -1
- package/dist/spine/orbital-solve.d.ts +79 -9
- package/dist/spine/orbital-solve.d.ts.map +1 -1
- package/dist/spine/orbital-solve.js +157 -59
- package/dist/spine/orbital-solve.js.map +1 -1
- package/dist/spine/overlay-context.d.ts +105 -0
- package/dist/spine/overlay-context.d.ts.map +1 -0
- package/dist/spine/overlay-context.js +34 -0
- package/dist/spine/overlay-context.js.map +1 -0
- package/dist/spine/own-craft-vantage.js +6 -3
- package/dist/spine/own-craft-vantage.js.map +1 -1
- package/dist/spine/patch-chain.d.ts +33 -4
- package/dist/spine/patch-chain.d.ts.map +1 -1
- package/dist/spine/patch-chain.js +26 -6
- package/dist/spine/patch-chain.js.map +1 -1
- package/dist/spine/path-source-state.d.ts +243 -0
- package/dist/spine/path-source-state.d.ts.map +1 -0
- package/dist/spine/path-source-state.js +75 -0
- package/dist/spine/path-source-state.js.map +1 -0
- package/dist/spine/path-source.d.ts +18 -0
- package/dist/spine/path-source.d.ts.map +1 -0
- package/dist/spine/path-source.js +23 -0
- package/dist/spine/path-source.js.map +1 -0
- package/dist/spine/phase-angle.d.ts.map +1 -1
- package/dist/spine/phase-angle.js +1 -10
- package/dist/spine/phase-angle.js.map +1 -1
- package/dist/spine/plan.d.ts +11 -0
- package/dist/spine/plan.d.ts.map +1 -0
- package/dist/spine/plan.js +85 -0
- package/dist/spine/plan.js.map +1 -0
- package/dist/spine/pressure-profile.d.ts +38 -0
- package/dist/spine/pressure-profile.d.ts.map +1 -0
- package/dist/spine/pressure-profile.js +43 -0
- package/dist/spine/pressure-profile.js.map +1 -0
- package/dist/spine/provider-arc.d.ts +75 -0
- package/dist/spine/provider-arc.d.ts.map +1 -0
- package/dist/spine/provider-arc.js +187 -0
- package/dist/spine/provider-arc.js.map +1 -0
- package/dist/spine/provider-declines.d.ts +10 -0
- package/dist/spine/provider-declines.d.ts.map +1 -0
- package/dist/spine/provider-declines.js +35 -0
- package/dist/spine/provider-declines.js.map +1 -0
- package/dist/spine/provider-orbit-solver.d.ts +27 -0
- package/dist/spine/provider-orbit-solver.d.ts.map +1 -0
- package/dist/spine/provider-orbit-solver.js +55 -0
- package/dist/spine/provider-orbit-solver.js.map +1 -0
- package/dist/spine/provider-patches.d.ts +32 -0
- package/dist/spine/provider-patches.d.ts.map +1 -0
- package/dist/spine/provider-patches.js +119 -0
- package/dist/spine/provider-patches.js.map +1 -0
- package/dist/spine/reference-frame.d.ts +19 -0
- package/dist/spine/reference-frame.d.ts.map +1 -1
- package/dist/spine/reference-frame.js +55 -22
- package/dist/spine/reference-frame.js.map +1 -1
- package/dist/spine/replay-recorder.d.ts +11 -1
- package/dist/spine/replay-recorder.d.ts.map +1 -1
- package/dist/spine/replay-recorder.js +21 -0
- package/dist/spine/replay-recorder.js.map +1 -1
- package/dist/spine/replay-session.d.ts +5 -21
- package/dist/spine/replay-session.d.ts.map +1 -1
- package/dist/spine/replay-session.js +7 -31
- package/dist/spine/replay-session.js.map +1 -1
- package/dist/spine/replay-transport.d.ts +0 -1
- package/dist/spine/replay-transport.d.ts.map +1 -1
- package/dist/spine/replay-transport.js +32 -15
- package/dist/spine/replay-transport.js.map +1 -1
- package/dist/spine/screen-mode.d.ts +50 -0
- package/dist/spine/screen-mode.d.ts.map +1 -0
- package/dist/spine/screen-mode.js +121 -0
- package/dist/spine/screen-mode.js.map +1 -0
- package/dist/spine/screen.d.ts +14 -0
- package/dist/spine/screen.d.ts.map +1 -1
- package/dist/spine/screen.js +16 -0
- package/dist/spine/screen.js.map +1 -1
- package/dist/spine/slot-ids.d.ts +1 -1
- package/dist/spine/slot-ids.d.ts.map +1 -1
- package/dist/spine/slot-ids.js +11 -0
- package/dist/spine/slot-ids.js.map +1 -1
- package/dist/spine/soi-exit.d.ts +8 -0
- package/dist/spine/soi-exit.d.ts.map +1 -0
- package/dist/spine/soi-exit.js +33 -0
- package/dist/spine/soi-exit.js.map +1 -0
- package/dist/spine/state-at-epoch.d.ts +31 -0
- package/dist/spine/state-at-epoch.d.ts.map +1 -0
- package/dist/spine/state-at-epoch.js +44 -0
- package/dist/spine/state-at-epoch.js.map +1 -0
- package/dist/spine/telemetry-overlay.d.ts +15 -0
- package/dist/spine/telemetry-overlay.d.ts.map +1 -0
- package/dist/spine/telemetry-overlay.js +20 -0
- package/dist/spine/telemetry-overlay.js.map +1 -0
- package/dist/spine/timeline-store.d.ts +58 -0
- package/dist/spine/timeline-store.d.ts.map +1 -1
- package/dist/spine/timeline-store.js +144 -12
- package/dist/spine/timeline-store.js.map +1 -1
- package/dist/spine/uplink-health.d.ts +8 -0
- package/dist/spine/uplink-health.d.ts.map +1 -1
- package/dist/spine/uplink-health.js +1 -0
- package/dist/spine/uplink-health.js.map +1 -1
- package/dist/spine/use-command.d.ts.map +1 -1
- package/dist/spine/use-command.js +26 -4
- package/dist/spine/use-command.js.map +1 -1
- package/dist/spine/use-events.d.ts +29 -0
- package/dist/spine/use-events.d.ts.map +1 -0
- package/dist/spine/use-events.js +57 -0
- package/dist/spine/use-events.js.map +1 -0
- package/dist/spine/use-orbit-solve-at.d.ts +19 -0
- package/dist/spine/use-orbit-solve-at.d.ts.map +1 -0
- package/dist/spine/use-orbit-solve-at.js +50 -0
- package/dist/spine/use-orbit-solve-at.js.map +1 -0
- package/dist/spine/use-orbit-trajectory.d.ts.map +1 -1
- package/dist/spine/use-orbit-trajectory.js +261 -17
- package/dist/spine/use-orbit-trajectory.js.map +1 -1
- package/dist/spine/use-patch-chain.d.ts +4 -0
- package/dist/spine/use-patch-chain.d.ts.map +1 -1
- package/dist/spine/use-patch-chain.js +73 -5
- package/dist/spine/use-patch-chain.js.map +1 -1
- package/dist/spine/use-phase-angle.d.ts.map +1 -1
- package/dist/spine/use-phase-angle.js +81 -20
- package/dist/spine/use-phase-angle.js.map +1 -1
- package/dist/spine/use-processor.d.ts +1 -1
- package/dist/spine/use-processor.d.ts.map +1 -1
- package/dist/spine/use-processor.js +24 -2
- package/dist/spine/use-processor.js.map +1 -1
- package/dist/spine/use-stream.d.ts.map +1 -1
- package/dist/spine/use-stream.js +3 -3
- package/dist/spine/use-stream.js.map +1 -1
- package/dist/spine/use-telemetry.d.ts.map +1 -1
- package/dist/spine/use-telemetry.js +2 -3
- package/dist/spine/use-telemetry.js.map +1 -1
- package/dist/spine/vector-parts.d.ts +11 -0
- package/dist/spine/vector-parts.d.ts.map +1 -0
- package/dist/spine/vector-parts.js +19 -0
- package/dist/spine/vector-parts.js.map +1 -0
- package/dist/spine/vector.d.ts +38 -0
- package/dist/spine/vector.d.ts.map +1 -0
- package/dist/spine/vector.js +53 -0
- package/dist/spine/vector.js.map +1 -0
- package/dist/testing/body-ephemeris-stand-in.d.ts +14 -0
- package/dist/testing/body-ephemeris-stand-in.d.ts.map +1 -0
- package/dist/testing/body-ephemeris-stand-in.js +39 -0
- package/dist/testing/body-ephemeris-stand-in.js.map +1 -0
- package/dist/testing/index.d.ts +13 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +13 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/legacy-orbit-solve.d.ts +18 -0
- package/dist/testing/legacy-orbit-solve.d.ts.map +1 -0
- package/dist/testing/legacy-orbit-solve.js +29 -0
- package/dist/testing/legacy-orbit-solve.js.map +1 -0
- package/dist/{spine/powered-reckoning.d.ts → testing/legacy-powered-reckoning.d.ts} +3 -14
- package/dist/testing/legacy-powered-reckoning.d.ts.map +1 -0
- package/dist/{spine/powered-reckoning.js → testing/legacy-powered-reckoning.js} +5 -106
- package/dist/testing/legacy-powered-reckoning.js.map +1 -0
- package/dist/testing/legacy-reckoners.d.ts +78 -0
- package/dist/testing/legacy-reckoners.d.ts.map +1 -0
- package/dist/testing/legacy-reckoners.js +729 -0
- package/dist/testing/legacy-reckoners.js.map +1 -0
- package/dist/{spine/target-range-reckoning.d.ts → testing/legacy-target-range-reckoning.d.ts} +4 -4
- package/dist/testing/legacy-target-range-reckoning.d.ts.map +1 -0
- package/dist/{spine/target-range-reckoning.js → testing/legacy-target-range-reckoning.js} +3 -3
- package/dist/testing/legacy-target-range-reckoning.js.map +1 -0
- package/dist/testing/orbit-live-run-stand-in.d.ts +23 -0
- package/dist/testing/orbit-live-run-stand-in.d.ts.map +1 -0
- package/dist/testing/orbit-live-run-stand-in.js +33 -0
- package/dist/testing/orbit-live-run-stand-in.js.map +1 -0
- package/dist/testing/path-source-stand-in.d.ts +15 -0
- package/dist/testing/path-source-stand-in.d.ts.map +1 -0
- package/dist/testing/path-source-stand-in.js +90 -0
- package/dist/testing/path-source-stand-in.js.map +1 -0
- package/dist/testing/recorded-live-run.d.ts +19 -0
- package/dist/testing/recorded-live-run.d.ts.map +1 -0
- package/dist/testing/recorded-live-run.js +23 -0
- package/dist/testing/recorded-live-run.js.map +1 -0
- package/dist/testing/render.d.ts +1 -1
- package/dist/testing/render.js +3 -3
- package/dist/testing/render.js.map +1 -1
- package/dist/testing/stream-fixture.d.ts +6 -0
- package/dist/testing/stream-fixture.d.ts.map +1 -1
- package/dist/testing/stream-fixture.js +7 -0
- package/dist/testing/stream-fixture.js.map +1 -1
- package/dist/testing/theme.d.ts +195 -8
- package/dist/testing/theme.d.ts.map +1 -1
- package/dist/testing/theme.js +35 -8
- package/dist/testing/theme.js.map +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/topics.d.ts.map +1 -1
- package/dist/unit-system/definitions.d.ts +14 -0
- package/dist/unit-system/definitions.d.ts.map +1 -1
- package/dist/unit-system/definitions.js +11 -0
- package/dist/unit-system/definitions.js.map +1 -1
- package/dist/unit-system/registry.d.ts.map +1 -1
- package/dist/unit-system/registry.js +20 -0
- package/dist/unit-system/registry.js.map +1 -1
- package/dist/uplink-load.d.ts +6 -0
- package/dist/uplink-load.d.ts.map +1 -1
- package/dist/uplink-load.js.map +1 -1
- package/dist/uplink-manifest.d.ts +20 -1
- package/dist/uplink-manifest.d.ts.map +1 -1
- package/dist/uplink-manifest.js +11 -2
- package/dist/uplink-manifest.js.map +1 -1
- package/package.json +7 -2
- package/src/__generated__/command-map.ts +97 -0
- package/src/__generated__/contract.ts +2374 -120
- package/src/__generated__/delay-roles.ts +8 -0
- package/src/__generated__/error-codes.ts +6 -7
- package/src/__generated__/frames.ts +36 -0
- package/src/__generated__/reckonability.ts +3 -2
- package/src/__generated__/sample-kinds.ts +9 -0
- package/src/__generated__/test-theme.ts +172 -2
- package/src/__generated__/topic-map.ts +37 -1
- package/src/__generated__/units.json +749 -14
- package/src/__generated__/units.ts +759 -7
- package/src/api/aero-models.ts +273 -0
- package/src/api/biome-knowledge.ts +125 -0
- package/src/api/bodies.ts +2 -0
- package/src/api/comms-models.ts +356 -0
- package/src/api/flight-sources.ts +219 -0
- package/src/api/flight-tags.ts +80 -0
- package/src/api/index.ts +197 -0
- package/src/api/modes.ts +1178 -0
- package/src/api/pilots.ts +759 -0
- package/src/api/planning-events.ts +66 -0
- package/src/api/planning-resources.ts +122 -0
- package/src/api/prediction-models.ts +1127 -0
- package/src/api/slots.ts +28 -2
- package/src/api/stock-bodies.ts +6 -20
- package/src/api/theme.ts +470 -6
- package/src/api/types.ts +153 -11
- package/src/api/wait-ends.ts +300 -0
- package/src/command-delay.ts +2 -0
- package/src/compat-versions.ts +1 -1
- package/src/contract-tags.ts +1 -0
- package/src/delay-roles.ts +74 -0
- package/src/event-timeline.ts +12 -3
- package/src/flight/types.ts +19 -0
- package/src/frames/index.ts +2 -0
- package/src/index.ts +43 -18
- package/src/maths/index.ts +32 -0
- package/src/reading.ts +77 -1
- package/src/registry/index.ts +23 -1
- package/src/runtime-topic-registry.ts +11 -0
- package/src/spine/__fixtures__/late-first-state-descent.json +504 -0
- package/src/spine/__fixtures__/n-body-bodies.json +1607 -0
- package/src/spine/__fixtures__/stock-catalogue.ts +29 -0
- package/src/spine/body-derivations.ts +45 -1
- package/src/spine/body-ephemeris.ts +828 -0
- package/src/spine/body-orbit-curve.ts +72 -0
- package/src/spine/body-pose.ts +129 -28
- package/src/spine/capability-lock.ts +13 -1
- package/src/spine/catalogue-elements.ts +14 -6
- package/src/spine/celestial-facts.ts +65 -3
- package/src/spine/client-reading.ts +12 -0
- package/src/spine/client-timeline.ts +7 -7
- package/src/spine/client.ts +228 -39
- package/src/spine/comms-path-geometry.ts +5 -5
- package/src/spine/context.tsx +35 -6
- package/src/spine/core-reckoners.ts +5 -1192
- package/src/spine/delay-estimate.ts +2 -2
- package/src/spine/elements-from-state.ts +127 -0
- package/src/spine/hermite.ts +53 -0
- package/src/spine/impact-point.ts +188 -55
- package/src/spine/index.ts +17 -1
- package/src/spine/kepler-reckoning.ts +4 -3
- package/src/spine/kepler.ts +2 -0
- package/src/spine/live-run-reckoners.ts +682 -0
- package/src/spine/live-run-relay.ts +484 -0
- package/src/spine/live-run.ts +234 -0
- package/src/spine/lock-scope.ts +15 -1
- package/src/spine/mode-command-gate.ts +45 -0
- package/src/spine/mode-view.ts +413 -0
- package/src/spine/orbit-patches.ts +12 -0
- package/src/spine/orbit-speed.ts +31 -0
- package/src/spine/orbit-states.ts +346 -0
- package/src/spine/orbit-trajectory.ts +123 -49
- package/src/spine/orbital-solve.ts +224 -88
- package/src/spine/overlay-context.ts +136 -0
- package/src/spine/own-craft-vantage.tsx +9 -3
- package/src/spine/patch-chain.ts +55 -6
- package/src/spine/path-source-state.ts +285 -0
- package/src/spine/path-source.ts +34 -0
- package/src/spine/phase-angle.ts +1 -12
- package/src/spine/plan.ts +98 -0
- package/src/spine/pressure-profile.ts +58 -0
- package/src/spine/provider-arc.ts +245 -0
- package/src/spine/provider-declines.ts +40 -0
- package/src/spine/provider-orbit-solver.ts +67 -0
- package/src/spine/provider-patches.ts +145 -0
- package/src/spine/reference-frame.ts +64 -28
- package/src/spine/replay-recorder.ts +21 -1
- package/src/spine/replay-session.tsx +7 -47
- package/src/spine/replay-transport.ts +33 -19
- package/src/spine/screen-mode.ts +158 -0
- package/src/spine/screen.tsx +29 -0
- package/src/spine/slot-ids.ts +11 -0
- package/src/spine/soi-exit.ts +37 -0
- package/src/spine/state-at-epoch.ts +51 -0
- package/src/spine/telemetry-overlay.tsx +55 -0
- package/src/spine/timeline-store.ts +207 -8
- package/src/spine/uplink-health.ts +9 -0
- package/src/spine/use-command.ts +29 -4
- package/src/spine/use-events.ts +88 -0
- package/src/spine/use-orbit-solve-at.ts +62 -0
- package/src/spine/use-orbit-trajectory.ts +342 -15
- package/src/spine/use-patch-chain.ts +106 -11
- package/src/spine/use-phase-angle.ts +117 -21
- package/src/spine/use-processor.ts +28 -3
- package/src/spine/use-stream.ts +3 -6
- package/src/spine/use-telemetry.ts +2 -6
- package/src/spine/vector-parts.ts +23 -0
- package/src/spine/vector.ts +59 -0
- package/src/testing/body-ephemeris-stand-in.ts +53 -0
- package/src/testing/index.ts +14 -1
- package/src/testing/legacy-orbit-solve.ts +56 -0
- package/src/{spine/powered-reckoning.ts → testing/legacy-powered-reckoning.ts} +13 -131
- package/src/testing/legacy-reckoners.ts +954 -0
- package/src/{spine/target-range-reckoning.ts → testing/legacy-target-range-reckoning.ts} +5 -5
- package/src/testing/orbit-live-run-stand-in.ts +45 -0
- package/src/testing/path-source-stand-in.ts +110 -0
- package/src/testing/recorded-live-run.ts +23 -0
- package/src/testing/render.tsx +3 -3
- package/src/testing/stream-fixture.tsx +13 -0
- package/src/testing/theme.ts +37 -8
- package/src/unit-system/definitions.ts +11 -0
- package/src/unit-system/registry.ts +21 -0
- package/src/uplink-load.ts +6 -0
- package/src/uplink-manifest.ts +34 -3
- package/dist/spine/powered-reckoning.d.ts.map +0 -1
- package/dist/spine/powered-reckoning.js.map +0 -1
- package/dist/spine/replay-session-controller.d.ts +0 -73
- package/dist/spine/replay-session-controller.d.ts.map +0 -1
- package/dist/spine/replay-session-controller.js +0 -253
- package/dist/spine/replay-session-controller.js.map +0 -1
- package/dist/spine/target-range-reckoning.d.ts.map +0 -1
- package/dist/spine/target-range-reckoning.js.map +0 -1
- package/src/spine/replay-session-controller.ts +0 -317
package/src/spine/client.ts
CHANGED
|
@@ -159,6 +159,14 @@ const ANSWERED_COMMAND_CAP = 256;
|
|
|
159
159
|
/** The record count at which the oldest answered commands are dropped, set above the cap so a sweep runs once per many dispatches and not on each. */
|
|
160
160
|
const ANSWERED_COMMAND_SWEEP_AT = 2 * ANSWERED_COMMAND_CAP;
|
|
161
161
|
|
|
162
|
+
/*
|
|
163
|
+
* The most characters of replies, as JSON, the records of confirmed commands
|
|
164
|
+
* hold together. A simulation asks hundreds of commands whose replies run to
|
|
165
|
+
* hundreds of kilobytes, so a count alone would keep a great deal more than a
|
|
166
|
+
* reader of a command's status needs.
|
|
167
|
+
*/
|
|
168
|
+
const ANSWERED_REPLIES_MOST = 4_000_000;
|
|
169
|
+
|
|
162
170
|
/**
|
|
163
171
|
* The phases nothing further can happen to. A command still in flight awaits
|
|
164
172
|
* its reply, and one reported lost can still be found, so neither is here.
|
|
@@ -350,6 +358,48 @@ export interface OutstandingCommandStore {
|
|
|
350
358
|
*/
|
|
351
359
|
export const OUTSTANDING_COMMAND_CAP = 256;
|
|
352
360
|
|
|
361
|
+
/*
|
|
362
|
+
* The longest arguments, as JSON, an outstanding command is stored with. The
|
|
363
|
+
* list is written whole on every change to it, so a stream of commands with
|
|
364
|
+
* large arguments, such as a simulation's states, would write their whole size
|
|
365
|
+
* many times over. A claim needs only the request id, and the arguments only
|
|
366
|
+
* name what was sent.
|
|
367
|
+
*/
|
|
368
|
+
const STORED_ARGS_MOST = 4_096;
|
|
369
|
+
|
|
370
|
+
/*
|
|
371
|
+
* True when `value` written as JSON is at most `most` characters, give or
|
|
372
|
+
* take its punctuation. It is asked of every command, and a simulation's
|
|
373
|
+
* arguments run to megabytes, so it counts as it walks and stops once past
|
|
374
|
+
* `most` rather than writing them out.
|
|
375
|
+
*/
|
|
376
|
+
function writesWithin(value: unknown, most: number): boolean {
|
|
377
|
+
return writtenSize(value, most) <= most;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/* About how many characters `value` writes as JSON, or just past `most` once it is past it, so a reply of megabytes is not walked whole. */
|
|
381
|
+
function writtenSize(value: unknown, most: number): number {
|
|
382
|
+
let left = most;
|
|
383
|
+
const walk = (v: unknown): boolean => {
|
|
384
|
+
left -= sizeOfOwn(v);
|
|
385
|
+
if (left < 0 || typeof v !== "object" || v === null) return left >= 0;
|
|
386
|
+
if (Array.isArray(v)) return v.every(walk);
|
|
387
|
+
for (const k of Object.keys(v)) {
|
|
388
|
+
left -= k.length + 3;
|
|
389
|
+
if (left < 0 || !walk(Reflect.get(v, k))) return false;
|
|
390
|
+
}
|
|
391
|
+
return left >= 0;
|
|
392
|
+
};
|
|
393
|
+
return walk(value) ? most - left : most + 1;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/* What `v` adds to its JSON before anything it holds: a string's characters and quotes, a number's few digits, a bracket pair. */
|
|
397
|
+
function sizeOfOwn(v: unknown): number {
|
|
398
|
+
if (typeof v === "string") return v.length + 2;
|
|
399
|
+
if (typeof v === "number" || typeof v === "boolean") return 8;
|
|
400
|
+
return typeof v === "object" && v !== null ? 2 : 0;
|
|
401
|
+
}
|
|
402
|
+
|
|
353
403
|
/**
|
|
354
404
|
* Construction options for the Sitrep client: the prefix of the request ids it
|
|
355
405
|
* mints and where it keeps its outstanding commands. Taken by `TelemetryClient`.
|
|
@@ -376,22 +426,37 @@ function randomIdPrefix(): string {
|
|
|
376
426
|
*/
|
|
377
427
|
const UNKNOWN_CRAFT_ID = "unknown";
|
|
378
428
|
|
|
429
|
+
/** The vessel id a `ksp.activeVessel` or `vessel.identity` payload names, or `undefined` for one that names none. */
|
|
430
|
+
function vesselIdOf(payload: unknown): string | undefined {
|
|
431
|
+
if (typeof payload !== "object" || payload === null) return undefined;
|
|
432
|
+
if (!("vesselId" in payload)) return undefined;
|
|
433
|
+
const id = payload.vesselId;
|
|
434
|
+
return typeof id === "string" && id !== "" ? id : undefined;
|
|
435
|
+
}
|
|
436
|
+
|
|
379
437
|
/**
|
|
380
438
|
* The vessel the operator's screen shows as active, as the optional
|
|
381
|
-
* `seenVesselId` of a command frame.
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
439
|
+
* `seenVesselId` of a command frame. The mod refuses an order for the active
|
|
440
|
+
* vessel when the game has since switched to another one.
|
|
441
|
+
*
|
|
442
|
+
* The game's own statement of the active vessel (`ksp.activeVessel`) is the
|
|
443
|
+
* one the screen names the craft by and it arrives with no signal delay, so
|
|
444
|
+
* it is the vessel seen whenever it names one. `vessel.identity` is the
|
|
445
|
+
* craft's own telemetry and can be seconds or minutes behind it after a
|
|
446
|
+
* switch. Without the game's statement the newest `vessel.identity` reading
|
|
447
|
+
* stands: nothing when none has ever arrived, {@link UNKNOWN_CRAFT_ID} when
|
|
448
|
+
* one has arrived and been withdrawn.
|
|
385
449
|
*/
|
|
386
450
|
function seenVessel(
|
|
451
|
+
active: unknown,
|
|
387
452
|
identity: unknown,
|
|
388
453
|
read: boolean,
|
|
389
454
|
): { seenVesselId?: string } {
|
|
455
|
+
const shown = vesselIdOf(active);
|
|
456
|
+
if (shown !== undefined) return { seenVesselId: shown };
|
|
390
457
|
if (identity === null && read) return { seenVesselId: UNKNOWN_CRAFT_ID };
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
const id = identity.vesselId;
|
|
394
|
-
return typeof id === "string" && id !== "" ? { seenVesselId: id } : {};
|
|
458
|
+
const id = vesselIdOf(identity);
|
|
459
|
+
return id !== undefined ? { seenVesselId: id } : {};
|
|
395
460
|
}
|
|
396
461
|
|
|
397
462
|
type SampleFrame = Extract<
|
|
@@ -474,6 +539,10 @@ export class TelemetryClient {
|
|
|
474
539
|
private readonly unsubscribeFromLost: () => void;
|
|
475
540
|
private readonly commands = new Map<string, PendingCommand>();
|
|
476
541
|
private readonly heldCommands = new Map<string, number>();
|
|
542
|
+
/** About how many characters of JSON the reply on each confirmed command's record writes, by request id. */
|
|
543
|
+
private readonly replySizes = new Map<string, number>();
|
|
544
|
+
/** The sum of `replySizes`. */
|
|
545
|
+
private answeredReplies = 0;
|
|
477
546
|
private readonly outstandingStore: OutstandingCommandStore | undefined;
|
|
478
547
|
private outstandingDirty = false;
|
|
479
548
|
private lastOutstanding = "";
|
|
@@ -499,7 +568,9 @@ export class TelemetryClient {
|
|
|
499
568
|
*/
|
|
500
569
|
private readonly stores = new Set<TimelineStore>();
|
|
501
570
|
/** The game UT of the newest frame, with the reading of the client's clock it arrived at and its timeline. */
|
|
502
|
-
private gameClock:
|
|
571
|
+
private gameClock:
|
|
572
|
+
| { ut: number; at: number; epoch: number; seq?: number }
|
|
573
|
+
| undefined;
|
|
503
574
|
/**
|
|
504
575
|
* Whether the newest `time.warp` said the game is paused. A paused game can
|
|
505
576
|
* go quiet on every channel, so its UT is held still rather than carried
|
|
@@ -520,9 +591,15 @@ export class TelemetryClient {
|
|
|
520
591
|
private newestDelivered:
|
|
521
592
|
| { ut: number; epoch: number; seq: number | undefined }
|
|
522
593
|
| undefined;
|
|
523
|
-
/**
|
|
524
|
-
|
|
594
|
+
/**
|
|
595
|
+
* How many rewinds the client has inferred on the mod's current epoch. They
|
|
596
|
+
* lie between that epoch and the next, so an inference can never take the
|
|
597
|
+
* number the mod's next timeline arrives under.
|
|
598
|
+
*/
|
|
599
|
+
private inferredRewinds = 0;
|
|
525
600
|
private lastWireEpoch = 0;
|
|
601
|
+
/** What the mod's newest timeline reset kept: readings of an older epoch validated later than this are of the timeline it abandoned. */
|
|
602
|
+
private newestReset: { epoch: number; keptThroughUt: number } | undefined;
|
|
526
603
|
/** The mod's run this client last heard from, empty until it has. */
|
|
527
604
|
private wireBootId = "";
|
|
528
605
|
private readonly timelineListeners = new Set<() => void>();
|
|
@@ -604,6 +681,7 @@ export class TelemetryClient {
|
|
|
604
681
|
this.followTimeline(incoming);
|
|
605
682
|
const message = replayed ? incoming : this.followRewind(incoming);
|
|
606
683
|
if (message.type === "stream-data") this.restoreUnchanged(message);
|
|
684
|
+
if (!replayed && this.isOfAnAbandonedTimeline(incoming)) return;
|
|
607
685
|
const asSent = stampedAsSent(message, incoming);
|
|
608
686
|
for (const listener of this.rawMessageListeners) listener(asSent);
|
|
609
687
|
this.handleMessage(message, replayed);
|
|
@@ -749,7 +827,10 @@ export class TelemetryClient {
|
|
|
749
827
|
list.push({
|
|
750
828
|
requestId,
|
|
751
829
|
command: pending.command,
|
|
752
|
-
args:
|
|
830
|
+
args:
|
|
831
|
+
pending.restored || writesWithin(pending.args, STORED_ARGS_MOST)
|
|
832
|
+
? pending.args
|
|
833
|
+
: undefined,
|
|
753
834
|
label: pending.label,
|
|
754
835
|
replyDueUt: pending.replyDueUt,
|
|
755
836
|
});
|
|
@@ -1517,11 +1598,32 @@ export class TelemetryClient {
|
|
|
1517
1598
|
if (!FINAL_PHASES.has(pending.status.phase)) continue;
|
|
1518
1599
|
if (this.heldCommands.has(requestId)) continue;
|
|
1519
1600
|
if (pending.awaitingDelay) this.awaitingDelayCount -= 1;
|
|
1601
|
+
this.answeredReplies -= this.replySizes.get(requestId) ?? 0;
|
|
1602
|
+
this.replySizes.delete(requestId);
|
|
1520
1603
|
this.commands.delete(requestId);
|
|
1521
1604
|
excess -= 1;
|
|
1522
1605
|
}
|
|
1523
1606
|
}
|
|
1524
1607
|
|
|
1608
|
+
/**
|
|
1609
|
+
* Drops the records of the oldest confirmed commands while the replies they
|
|
1610
|
+
* hold come to more than {@link ANSWERED_REPLIES_MOST}. A command still
|
|
1611
|
+
* waiting, a refused one, one a reader holds, and `newest` keep theirs.
|
|
1612
|
+
*/
|
|
1613
|
+
private dropOldestReplies(newest: string): void {
|
|
1614
|
+
if (this.answeredReplies <= ANSWERED_REPLIES_MOST) return;
|
|
1615
|
+
for (const [requestId, pending] of this.commands) {
|
|
1616
|
+
if (this.answeredReplies <= ANSWERED_REPLIES_MOST) return;
|
|
1617
|
+
const size = this.replySizes.get(requestId);
|
|
1618
|
+
if (pending.status.phase !== "confirmed" || !size) continue;
|
|
1619
|
+
if (requestId === newest || this.heldCommands.has(requestId)) continue;
|
|
1620
|
+
if (pending.awaitingDelay) this.awaitingDelayCount -= 1;
|
|
1621
|
+
this.answeredReplies -= size;
|
|
1622
|
+
this.replySizes.delete(requestId);
|
|
1623
|
+
this.commands.delete(requestId);
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1525
1627
|
/**
|
|
1526
1628
|
* Keeps the records of these commands past the sweep of answered ones, for a
|
|
1527
1629
|
* reader that reports their status later (a group of commands). Returns the
|
|
@@ -1632,6 +1734,8 @@ export class TelemetryClient {
|
|
|
1632
1734
|
this.unownedListeners.clear();
|
|
1633
1735
|
this.subscriberLabels.clear();
|
|
1634
1736
|
this.commands.clear();
|
|
1737
|
+
this.answeredReplies = 0;
|
|
1738
|
+
this.replySizes.clear();
|
|
1635
1739
|
this.awaitingDelayCount = 0;
|
|
1636
1740
|
this.stores.clear();
|
|
1637
1741
|
}
|
|
@@ -1691,13 +1795,15 @@ export class TelemetryClient {
|
|
|
1691
1795
|
*/
|
|
1692
1796
|
private restoreUnchanged(message: StreamData<unknown>): void {
|
|
1693
1797
|
const { unchanged } = message;
|
|
1694
|
-
|
|
1798
|
+
/* A frame relayed over PeerJS carries `unchanged: null` when none was named, because the wire packs an absent field as null. */
|
|
1799
|
+
if (unchanged != null && unchanged.length > 0) {
|
|
1695
1800
|
fillUnchangedFields(
|
|
1696
1801
|
message.payload,
|
|
1697
1802
|
unchanged,
|
|
1698
1803
|
this.lastDeliveredWithHeldFields.get(message.topic),
|
|
1699
1804
|
);
|
|
1700
|
-
|
|
1805
|
+
/* Deleted, not set to undefined: the frame is relayed on, and the wire would turn an undefined field into null. */
|
|
1806
|
+
delete message.unchanged;
|
|
1701
1807
|
}
|
|
1702
1808
|
if (fieldsSentOnChange(message.topic).length > 0) {
|
|
1703
1809
|
this.lastDeliveredWithHeldFields.set(message.topic, message.payload);
|
|
@@ -2043,6 +2149,7 @@ export class TelemetryClient {
|
|
|
2043
2149
|
: (this.gameUtNow() ?? anchor.ut),
|
|
2044
2150
|
at: this.clock.now(),
|
|
2045
2151
|
epoch,
|
|
2152
|
+
seq: anchor.seq,
|
|
2046
2153
|
};
|
|
2047
2154
|
}
|
|
2048
2155
|
this.gamePaused = paused;
|
|
@@ -2052,13 +2159,14 @@ export class TelemetryClient {
|
|
|
2052
2159
|
* Gives a live sample the timeline epoch the client holds it under.
|
|
2053
2160
|
*
|
|
2054
2161
|
* A quickload or revert starts a new timeline, which the mod announces with
|
|
2055
|
-
* a higher epoch
|
|
2056
|
-
* behind the game's UT already seen on
|
|
2057
|
-
* the
|
|
2058
|
-
*
|
|
2059
|
-
*
|
|
2060
|
-
*
|
|
2061
|
-
*
|
|
2162
|
+
* a higher epoch, and that epoch decides. Only when a load has ended with no
|
|
2163
|
+
* new epoch, and a live sample's UT is behind the game's UT already seen on
|
|
2164
|
+
* the same epoch, is the sample taken as a new timeline: the client moves to
|
|
2165
|
+
* an epoch of its own, after the mod's and before the mod's next, so every
|
|
2166
|
+
* store and the view clock drop the abandoned one and the mod's next epoch
|
|
2167
|
+
* still replaces it. While a load runs nothing is inferred, because the mod
|
|
2168
|
+
* announces its epoch before it says the game is ready and the frames of both
|
|
2169
|
+
* timelines can be interleaved until then.
|
|
2062
2170
|
*/
|
|
2063
2171
|
private followRewind(message: ServerMessage): ServerMessage {
|
|
2064
2172
|
if (message.type !== "stream-data" && message.type !== "stream-binary") {
|
|
@@ -2067,7 +2175,7 @@ export class TelemetryClient {
|
|
|
2067
2175
|
const meta = message.meta;
|
|
2068
2176
|
const wire = meta.timelineEpoch ?? 0;
|
|
2069
2177
|
this.absorbWireEpoch(wire);
|
|
2070
|
-
let epoch =
|
|
2178
|
+
let epoch = this.heldEpoch(wire);
|
|
2071
2179
|
/*
|
|
2072
2180
|
* Behind what has actually been delivered on this timeline, not behind the
|
|
2073
2181
|
* clock's estimate of the game's UT. The estimate runs on through a dialog
|
|
@@ -2101,10 +2209,10 @@ export class TelemetryClient {
|
|
|
2101
2209
|
epoch === delivered.epoch &&
|
|
2102
2210
|
Number.isFinite(meta.deliveredAt) &&
|
|
2103
2211
|
meta.deliveredAt < delivered.ut - REWIND_TOLERANCE_SECONDS;
|
|
2104
|
-
const rewound = this.loadSinceLastSample && behind;
|
|
2212
|
+
const rewound = this.loadSinceLastSample && !this.gameLoading && behind;
|
|
2105
2213
|
if (rewound) {
|
|
2106
|
-
this.
|
|
2107
|
-
epoch
|
|
2214
|
+
this.inferredRewinds += 1;
|
|
2215
|
+
epoch = this.heldEpoch(wire);
|
|
2108
2216
|
/* Every Topic starts again on a rewind, so the frame that made the call is named, to be found when one was not a rewind at all. */
|
|
2109
2217
|
console.warn(
|
|
2110
2218
|
`[sitrep] read a load as a rewind from ${message.topic} (source ${String(meta.source)}, ` +
|
|
@@ -2115,8 +2223,8 @@ export class TelemetryClient {
|
|
|
2115
2223
|
if (
|
|
2116
2224
|
Number.isFinite(meta.deliveredAt) &&
|
|
2117
2225
|
(delivered === undefined ||
|
|
2118
|
-
epoch
|
|
2119
|
-
meta.deliveredAt > delivered.ut)
|
|
2226
|
+
epoch > delivered.epoch ||
|
|
2227
|
+
(epoch === delivered.epoch && meta.deliveredAt > delivered.ut))
|
|
2120
2228
|
) {
|
|
2121
2229
|
this.newestDelivered = {
|
|
2122
2230
|
ut: meta.deliveredAt,
|
|
@@ -2131,6 +2239,30 @@ export class TelemetryClient {
|
|
|
2131
2239
|
return { ...message, meta: { ...meta, timelineEpoch: epoch } };
|
|
2132
2240
|
}
|
|
2133
2241
|
|
|
2242
|
+
/** The epoch the client holds a frame of the mod's epoch `wire` under. */
|
|
2243
|
+
private heldEpoch(wire: number): number {
|
|
2244
|
+
return wire === this.lastWireEpoch
|
|
2245
|
+
? wire + this.inferredRewinds / (this.inferredRewinds + 1)
|
|
2246
|
+
: wire;
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2249
|
+
/**
|
|
2250
|
+
* Whether a live sample is of the timeline the mod's newest reset abandoned.
|
|
2251
|
+
* What the reset kept is the new timeline's own past, whatever epoch it was
|
|
2252
|
+
* recorded under, so a sample from no later than that is still taken.
|
|
2253
|
+
*/
|
|
2254
|
+
private isOfAnAbandonedTimeline(message: ServerMessage): boolean {
|
|
2255
|
+
if (message.type !== "stream-data" && message.type !== "stream-binary") {
|
|
2256
|
+
return false;
|
|
2257
|
+
}
|
|
2258
|
+
const reset = this.newestReset;
|
|
2259
|
+
return (
|
|
2260
|
+
reset !== undefined &&
|
|
2261
|
+
(message.meta.timelineEpoch ?? 0) < reset.epoch &&
|
|
2262
|
+
message.meta.validAt > reset.keptThroughUt
|
|
2263
|
+
);
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2134
2266
|
/**
|
|
2135
2267
|
* Learns the mod's run and timeline from the frames that carry them outside a
|
|
2136
2268
|
* sample. A quiet connection hears no stream data after a load, so without
|
|
@@ -2144,7 +2276,16 @@ export class TelemetryClient {
|
|
|
2144
2276
|
return;
|
|
2145
2277
|
}
|
|
2146
2278
|
if (message.type === "event" && message.name === "timeline-reset") {
|
|
2147
|
-
|
|
2279
|
+
const epoch = message.meta.timelineEpoch ?? 0;
|
|
2280
|
+
this.absorbWireEpoch(epoch);
|
|
2281
|
+
if (epoch >= (this.newestReset?.epoch ?? 0)) {
|
|
2282
|
+
const kept: unknown = message.keptThroughUt;
|
|
2283
|
+
this.newestReset = {
|
|
2284
|
+
epoch,
|
|
2285
|
+
keptThroughUt:
|
|
2286
|
+
typeof kept === "number" ? kept : Number.NEGATIVE_INFINITY,
|
|
2287
|
+
};
|
|
2288
|
+
}
|
|
2148
2289
|
}
|
|
2149
2290
|
}
|
|
2150
2291
|
|
|
@@ -2155,23 +2296,21 @@ export class TelemetryClient {
|
|
|
2155
2296
|
this.wireBootId = bootId;
|
|
2156
2297
|
if (!restarted) return;
|
|
2157
2298
|
this.lastWireEpoch = 0;
|
|
2158
|
-
this.
|
|
2299
|
+
this.inferredRewinds = 0;
|
|
2300
|
+
this.newestReset = undefined;
|
|
2301
|
+
this.newestDelivered = undefined;
|
|
2159
2302
|
this.notifyTimeline();
|
|
2160
2303
|
}
|
|
2161
2304
|
|
|
2162
|
-
/** Takes a wire epoch,
|
|
2305
|
+
/** Takes a wire epoch, which replaces any rewind the client had inferred for itself. */
|
|
2163
2306
|
private absorbWireEpoch(wire: number): void {
|
|
2164
2307
|
if (wire <= this.lastWireEpoch) return;
|
|
2165
|
-
this.
|
|
2166
|
-
0,
|
|
2167
|
-
this.epochShift - (wire - this.lastWireEpoch),
|
|
2168
|
-
);
|
|
2308
|
+
this.inferredRewinds = 0;
|
|
2169
2309
|
this.lastWireEpoch = wire;
|
|
2170
2310
|
/*
|
|
2171
2311
|
* The mod has announced the timeline the load started, so the load needs no
|
|
2172
2312
|
* inferring. Left set, a frame delayed to an earlier UT than another on the
|
|
2173
|
-
* new epoch reads as a second rewind
|
|
2174
|
-
* every frame the mod sends.
|
|
2313
|
+
* new epoch reads as a second rewind.
|
|
2175
2314
|
*/
|
|
2176
2315
|
this.loadSinceLastSample = false;
|
|
2177
2316
|
this.notifyTimeline();
|
|
@@ -2205,6 +2344,7 @@ export class TelemetryClient {
|
|
|
2205
2344
|
seenBootId: this.wireBootId,
|
|
2206
2345
|
seenEpoch: this.lastWireEpoch,
|
|
2207
2346
|
...seenVessel(
|
|
2347
|
+
this.lastValues.get("ksp.activeVessel"),
|
|
2208
2348
|
this.lastValues.get("vessel.identity"),
|
|
2209
2349
|
this.lastValues.has("vessel.identity"),
|
|
2210
2350
|
),
|
|
@@ -2218,7 +2358,12 @@ export class TelemetryClient {
|
|
|
2218
2358
|
const anchor = this.gameClock;
|
|
2219
2359
|
const ut = this.gameUtNow();
|
|
2220
2360
|
if (anchor && ut !== undefined) {
|
|
2221
|
-
this.gameClock = {
|
|
2361
|
+
this.gameClock = {
|
|
2362
|
+
ut,
|
|
2363
|
+
at: this.clock.now(),
|
|
2364
|
+
epoch: anchor.epoch,
|
|
2365
|
+
seq: anchor.seq,
|
|
2366
|
+
};
|
|
2222
2367
|
}
|
|
2223
2368
|
this.gameLoading = loading;
|
|
2224
2369
|
}
|
|
@@ -2258,10 +2403,31 @@ export class TelemetryClient {
|
|
|
2258
2403
|
const epoch = meta.timelineEpoch ?? 0;
|
|
2259
2404
|
const prior = this.gameClock;
|
|
2260
2405
|
if (prior && epoch < prior.epoch) return;
|
|
2261
|
-
|
|
2406
|
+
const seq = Number.isFinite(meta.seq) ? meta.seq : undefined;
|
|
2407
|
+
if (prior && epoch === prior.epoch && ut < prior.ut) {
|
|
2408
|
+
/*
|
|
2409
|
+
* Earlier by more than a frame delayed from a craft's node can trail, and
|
|
2410
|
+
* built after the frame the estimate stands on: the game's UT went back
|
|
2411
|
+
* within the timeline, as it does from the editor into a flight. Held
|
|
2412
|
+
* where it was, the estimate would place every deadline in the past until
|
|
2413
|
+
* the game's UT climbed back to it.
|
|
2414
|
+
*/
|
|
2415
|
+
const fromACraftsNode =
|
|
2416
|
+
typeof meta.source === "string" &&
|
|
2417
|
+
meta.source.startsWith(CRAFT_NODE_SOURCE_PREFIX);
|
|
2418
|
+
const builtLater =
|
|
2419
|
+
seq !== undefined && prior.seq !== undefined && seq > prior.seq;
|
|
2420
|
+
if (
|
|
2421
|
+
fromACraftsNode ||
|
|
2422
|
+
!builtLater ||
|
|
2423
|
+
ut >= prior.ut - REWIND_TOLERANCE_SECONDS
|
|
2424
|
+
) {
|
|
2425
|
+
return;
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2262
2428
|
/* A new timeline has its own pause state, which its own `time.warp` will say. */
|
|
2263
2429
|
if (prior && epoch > prior.epoch) this.gamePaused = false;
|
|
2264
|
-
this.gameClock = { ut, at: this.clock.now(), epoch };
|
|
2430
|
+
this.gameClock = { ut, at: this.clock.now(), epoch, seq };
|
|
2265
2431
|
/* The deadlines of commands in flight are in the old timeline's UT, so the mod is asked what became of them. */
|
|
2266
2432
|
if (prior && epoch > prior.epoch) this.scheduleClaim();
|
|
2267
2433
|
if (prior) return;
|
|
@@ -2403,6 +2569,12 @@ export class TelemetryClient {
|
|
|
2403
2569
|
}
|
|
2404
2570
|
|
|
2405
2571
|
pending.status = { phase: "confirmed", requestId, result };
|
|
2572
|
+
/* Nothing reads a confirmed command's arguments again, and its record is kept with hundreds of others. */
|
|
2573
|
+
pending.args = undefined;
|
|
2574
|
+
const size = writtenSize(result, ANSWERED_REPLIES_MOST);
|
|
2575
|
+
this.replySizes.set(requestId, size);
|
|
2576
|
+
this.answeredReplies += size;
|
|
2577
|
+
this.dropOldestReplies(requestId);
|
|
2406
2578
|
this.traceSettled(pending);
|
|
2407
2579
|
resolve(result);
|
|
2408
2580
|
this.notifyStore();
|
|
@@ -2623,3 +2795,20 @@ export class TelemetryClient {
|
|
|
2623
2795
|
}
|
|
2624
2796
|
}
|
|
2625
2797
|
}
|
|
2798
|
+
|
|
2799
|
+
/**
|
|
2800
|
+
* The newest frame `client` holds of every Topic something is subscribed to,
|
|
2801
|
+
* each with the `Meta` it arrived with. Useful for starting a recording from
|
|
2802
|
+
* the state the stream is in, since a Topic the mod sends only on change may
|
|
2803
|
+
* not be sent again while the recording runs. Used by {@link StreamRecorder}.
|
|
2804
|
+
*/
|
|
2805
|
+
export function heldFrames(client: TelemetryClient): StreamData<unknown>[] {
|
|
2806
|
+
/* A function beside the class and not a member of it: a member added to a published class is one more thing every stand-in for it must carry. */
|
|
2807
|
+
// biome-ignore lint/complexity/useLiteralKeys: reads the class's own private state from its own module
|
|
2808
|
+
return [...client["lastPoints"]].map(([topic, point]) => ({
|
|
2809
|
+
type: "stream-data",
|
|
2810
|
+
topic,
|
|
2811
|
+
payload: point.payload,
|
|
2812
|
+
meta: point.meta,
|
|
2813
|
+
}));
|
|
2814
|
+
}
|
|
@@ -163,10 +163,10 @@ export function firstHopPeer(
|
|
|
163
163
|
* ground station or relay at the far end of a hop. Used by the `comms.delay`
|
|
164
164
|
* reckoner.
|
|
165
165
|
*
|
|
166
|
-
* A ground-station endpoint joins to `commandCentre.roster` by
|
|
167
|
-
*
|
|
168
|
-
* `"ground
|
|
169
|
-
*
|
|
166
|
+
* A ground-station endpoint joins to `commandCentre.roster` by id: a hop names
|
|
167
|
+
* a station by its centre id without `"ground:"`, so the entry is the one whose
|
|
168
|
+
* id is `"ground:" + endpoint.id`. The entry's display name is never the join,
|
|
169
|
+
* since it can be localised and two stations can share one.
|
|
170
170
|
*
|
|
171
171
|
* A relay endpoint is placed by `orbitOf`, called with the bare vessel guid
|
|
172
172
|
* the hop carries.
|
|
@@ -177,7 +177,7 @@ export function locateCommsPeer(
|
|
|
177
177
|
orbitOf: (vesselId: string) => CommsPeerOrbit | undefined,
|
|
178
178
|
): CommsPeerLocation | null {
|
|
179
179
|
if (endpoint.isHome) {
|
|
180
|
-
const entry = roster?.find((e) => e.
|
|
180
|
+
const entry = roster?.find((e) => e.id === `ground:${endpoint.id}`);
|
|
181
181
|
if (entry == null || entry.bodyIndex == null) return null;
|
|
182
182
|
const lat = magnitudeOr(entry.latitude, Number.NaN);
|
|
183
183
|
const lon = magnitudeOr(entry.longitude, Number.NaN);
|
package/src/spine/context.tsx
CHANGED
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
LATE_ARRIVAL_DETAIL,
|
|
31
31
|
LATE_ARRIVAL_ERROR_CODE,
|
|
32
32
|
} from "./arrival-deadline";
|
|
33
|
+
import { BODY_EPHEMERIS } from "./body-ephemeris";
|
|
33
34
|
import type { TelemetryClient } from "./client";
|
|
34
35
|
import { noteUndeclaredRead } from "./contribution-scope";
|
|
35
36
|
import { registerCoreReckoners } from "./core-reckoners";
|
|
@@ -42,6 +43,7 @@ import {
|
|
|
42
43
|
import { commandDelayed } from "./map-command";
|
|
43
44
|
import { DYNAMIC_WHOLE_TOPIC_PREFIXES, resolveValueTopic } from "./map-topic";
|
|
44
45
|
import { type OrbitalSolve, solveSelfOrbit } from "./orbital-solve";
|
|
46
|
+
import { useTelemetryOverlay } from "./overlay-context";
|
|
45
47
|
import { OwnCraftDelayGate } from "./own-craft-vantage";
|
|
46
48
|
import { processorRuntimeFor } from "./processorEvaluator";
|
|
47
49
|
import {
|
|
@@ -50,6 +52,7 @@ import {
|
|
|
50
52
|
type PublishedProcessorDefinition,
|
|
51
53
|
publishedDefinitionOf,
|
|
52
54
|
} from "./processors";
|
|
55
|
+
import { getReckonedTopics } from "./reckoners";
|
|
53
56
|
import { StreamRecorder, type StreamRecorderOptions } from "./replay-recorder";
|
|
54
57
|
import { SPACE_CENTER_STATE } from "./space-center-state";
|
|
55
58
|
import { type ReadTopicResolver, subscribeTopicRead } from "./subscribe-read";
|
|
@@ -170,11 +173,12 @@ export function TelemetryProvider({
|
|
|
170
173
|
publishProcessorsOn(built);
|
|
171
174
|
/*
|
|
172
175
|
* Core's own forward models, through the same registry an Uplink's go
|
|
173
|
-
* through.
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
+
* through. Re-asserted here rather than left to the module side effect
|
|
177
|
+
* alone so a suite that cleared the registry between tests gets the
|
|
178
|
+
* vanilla back with its store, and only into an empty registry so a model
|
|
179
|
+
* a suite put there on purpose is the one that answers.
|
|
176
180
|
*/
|
|
177
|
-
registerCoreReckoners();
|
|
181
|
+
if (getReckonedTopics().length === 0) registerCoreReckoners();
|
|
178
182
|
return { store: built, delayAuthority: authority, warp: warpSlope };
|
|
179
183
|
}, [providedStore, client]);
|
|
180
184
|
|
|
@@ -354,9 +358,17 @@ export function TelemetryProvider({
|
|
|
354
358
|
// `scheduled` gate, so an ingest and a tick in one animation frame still
|
|
355
359
|
// mint one frame between them, and the ingest path is untouched.
|
|
356
360
|
const unsubscribeClock = store.clock.onFrame(scheduleBeginFrame);
|
|
361
|
+
// A provider's answer about the bodies changes what the poses compute to, and arrives on no stream.
|
|
362
|
+
const unsubscribeEphemeris = BODY_EPHEMERIS.subscribe(scheduleBeginFrame);
|
|
363
|
+
// A load or revert starts another timeline, in which the provider may place a body it refused in this one.
|
|
364
|
+
const unsubscribeTimeline = client.onTimelineChange(() =>
|
|
365
|
+
BODY_EPHEMERIS.clear(),
|
|
366
|
+
);
|
|
357
367
|
return () => {
|
|
358
368
|
unsubscribe();
|
|
359
369
|
unsubscribeClock();
|
|
370
|
+
unsubscribeEphemeris();
|
|
371
|
+
unsubscribeTimeline();
|
|
360
372
|
cancelScheduled?.();
|
|
361
373
|
};
|
|
362
374
|
}, [client, store]);
|
|
@@ -589,7 +601,8 @@ function removeLast<Item>(stack: Item[], item: Item): void {
|
|
|
589
601
|
|
|
590
602
|
export function useViewClock(): ViewClockView {
|
|
591
603
|
// gonogo:reads none
|
|
592
|
-
|
|
604
|
+
const live = useTelemetryStore();
|
|
605
|
+
return (useTelemetryOverlay()?.store ?? live).clock;
|
|
593
606
|
}
|
|
594
607
|
|
|
595
608
|
/**
|
|
@@ -603,7 +616,8 @@ export function useViewClock(): ViewClockView {
|
|
|
603
616
|
*/
|
|
604
617
|
export function useViewClockOptional(): ViewClockView | undefined {
|
|
605
618
|
// gonogo:reads none
|
|
606
|
-
|
|
619
|
+
const live = useTelemetryStoreOptional();
|
|
620
|
+
return (useTelemetryOverlay()?.store ?? live)?.clock;
|
|
607
621
|
}
|
|
608
622
|
|
|
609
623
|
/**
|
|
@@ -1038,6 +1052,21 @@ export function getVesselTarget(): VesselTarget | undefined {
|
|
|
1038
1052
|
return sampleActiveTopic<VesselTarget>("vessel.target");
|
|
1039
1053
|
}
|
|
1040
1054
|
|
|
1055
|
+
/**
|
|
1056
|
+
* The game time `vessel.target` was observed at, or the time a held reading is
|
|
1057
|
+
* as of, as a single read for a caller that cannot use hooks. Useful for asking
|
|
1058
|
+
* where the target was on its orbit at the instant its own figures are for.
|
|
1059
|
+
* Used by the maneuver-trigger services. Undefined with no reading.
|
|
1060
|
+
*/
|
|
1061
|
+
export function getVesselTargetAt(): Value<"ut"> | undefined {
|
|
1062
|
+
if (!activeTimelineStore) return undefined;
|
|
1063
|
+
const reading =
|
|
1064
|
+
activeTimelineStore.sampleReading<VesselTarget>("vessel.target");
|
|
1065
|
+
if (reading.state === "observed") return reading.atUt;
|
|
1066
|
+
if (reading.state === "held") return reading.asOfUt;
|
|
1067
|
+
return undefined;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1041
1070
|
/**
|
|
1042
1071
|
* The vessel's name, type, situation and parent body index from
|
|
1043
1072
|
* `vessel.identity`, as a single read for a caller that cannot use hooks.
|