@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
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { bumpReckonerGeneration } from "./reckoner-generation";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The craft's state at one instant of a live run: height above sea level,
|
|
5
|
+
* speed relative to the centre of the body, and the orbit's elements as the
|
|
6
|
+
* run holds them there, about the body whose game number is
|
|
7
|
+
* `referenceBodyIndex`. Returned by {@link LiveRun.stateAt}.
|
|
8
|
+
*
|
|
9
|
+
* @category Reckoners
|
|
10
|
+
*/
|
|
11
|
+
export interface LiveRunState {
|
|
12
|
+
/** Metres. */
|
|
13
|
+
altitudeAsl: number;
|
|
14
|
+
/** Metres a second. */
|
|
15
|
+
orbitalSpeed: number;
|
|
16
|
+
referenceBodyIndex: number;
|
|
17
|
+
/** Metres. */
|
|
18
|
+
sma: number;
|
|
19
|
+
ecc: number;
|
|
20
|
+
/** Degrees. */
|
|
21
|
+
inc: number;
|
|
22
|
+
/** Degrees. */
|
|
23
|
+
lan: number;
|
|
24
|
+
/** Degrees. */
|
|
25
|
+
argPe: number;
|
|
26
|
+
/** Radians at the state's own instant. */
|
|
27
|
+
meanAnomalyAtEpoch: number;
|
|
28
|
+
/** The gravitational parameter of the body, in m³/s². */
|
|
29
|
+
mu: number;
|
|
30
|
+
/** Metres, relative to the body's centre on the game's non-rotating axes. Absent where the run states no place for the body. */
|
|
31
|
+
position?: readonly [number, number, number];
|
|
32
|
+
/** Metres a second, on the same axes. */
|
|
33
|
+
velocity?: readonly [number, number, number];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Where the run's target is relative to the craft at one instant, in the
|
|
38
|
+
* craft's orbit frame: `x` radial (up from the body), `y` along-track, `z`
|
|
39
|
+
* normal to the orbit. Returned by {@link LiveRun.targetAt}.
|
|
40
|
+
*
|
|
41
|
+
* @category Reckoners
|
|
42
|
+
*/
|
|
43
|
+
export interface LiveRunTarget {
|
|
44
|
+
/** The target's id as `vessel.target` names it: a craft's guid, or the body's number as text. */
|
|
45
|
+
id: string;
|
|
46
|
+
/** Metres. */
|
|
47
|
+
orbitRelativePosition: readonly [number, number, number];
|
|
48
|
+
/** Metres a second. */
|
|
49
|
+
orbitRelativeVelocity: readonly [number, number, number];
|
|
50
|
+
/** Metres, in the game's scene axes as `vessel.target` lays them out. Absent where the run cannot state the scene axes. */
|
|
51
|
+
relativePosition?: readonly [number, number, number];
|
|
52
|
+
/** Metres a second, in the same axes. */
|
|
53
|
+
relativeVelocity?: readonly [number, number, number];
|
|
54
|
+
/** True when the scene axes stand still over the run, so a direction fixed in them stays fixed. Absent where they turn with the body. */
|
|
55
|
+
sceneStill?: true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* What the live run states of the signal delay at one instant: the one-way
|
|
60
|
+
* delay along the route home, that no route home is open, or that the route
|
|
61
|
+
* cannot be placed, with the reason as one sentence. Returned by
|
|
62
|
+
* {@link LiveRun.delayAt}.
|
|
63
|
+
*
|
|
64
|
+
* @category Reckoners
|
|
65
|
+
*/
|
|
66
|
+
export type LiveRunDelay =
|
|
67
|
+
| {
|
|
68
|
+
/** Seconds: the length of the route home, as the signal travels it, over the speed signals travel at. */
|
|
69
|
+
oneWaySeconds: number;
|
|
70
|
+
/** The ids of the nodes the route runs through, in order from the craft to the ground station, in the `commandCentre.roster` vocabulary. */
|
|
71
|
+
route: readonly string[];
|
|
72
|
+
/** What the figure takes for granted that the game may not bear out, one sentence each. */
|
|
73
|
+
gaps: readonly string[];
|
|
74
|
+
}
|
|
75
|
+
| {
|
|
76
|
+
/** True when no link home is open at this instant, which is a finding about the network and not a figure that is not known. */
|
|
77
|
+
noRoute: true;
|
|
78
|
+
}
|
|
79
|
+
| {
|
|
80
|
+
/** Why the delay is not known at this instant, as one sentence. */
|
|
81
|
+
notKnown: string;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The most each modelled figure of a live run has differed from the readings
|
|
86
|
+
* that came in at a lead time of the run's age or less, in the figure's own
|
|
87
|
+
* unit. A figure with no measurement at that lead is left out, never zero.
|
|
88
|
+
* Returned by {@link LiveRun.bandAt}.
|
|
89
|
+
*
|
|
90
|
+
* @category Reckoners
|
|
91
|
+
*/
|
|
92
|
+
export interface LiveRunSpread {
|
|
93
|
+
altitudeAsl?: number;
|
|
94
|
+
orbitalSpeed?: number;
|
|
95
|
+
meanAnomalyAtEpoch?: number;
|
|
96
|
+
/** Metres: how far the target's modelled position has been from where it was read. */
|
|
97
|
+
orbitRelativePosition?: number;
|
|
98
|
+
/** Metres a second. */
|
|
99
|
+
orbitRelativeVelocity?: number;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* A simulation of the craft flown forward from its latest readings with its
|
|
104
|
+
* controls held as they are and the commands already sent applied when they
|
|
105
|
+
* arrive, and nothing planned. The reckoning of `vessel.flight` and
|
|
106
|
+
* `vessel.orbit` reads its modelled values from the one that stands.
|
|
107
|
+
*
|
|
108
|
+
* @category Reckoners
|
|
109
|
+
*/
|
|
110
|
+
export interface LiveRun {
|
|
111
|
+
/**
|
|
112
|
+
* Why no run could be flown from the readings, as one sentence, when none
|
|
113
|
+
* could. A run with a reason has no state at any instant, and its figures
|
|
114
|
+
* are not known.
|
|
115
|
+
*/
|
|
116
|
+
readonly notKnown?: string;
|
|
117
|
+
/** The instant of the readings the run was flown from, as UT. */
|
|
118
|
+
readonly startUt: number;
|
|
119
|
+
/** The last instant the run covers, as UT. */
|
|
120
|
+
readonly endUt: number;
|
|
121
|
+
/** Why the run ends at `endUt`, as one sentence. */
|
|
122
|
+
readonly endReason: string;
|
|
123
|
+
/** True when the run ended for want of the time asked of it, so a run flown from newer readings goes further. Absent when it ended at an event of the flight. */
|
|
124
|
+
readonly endsForWantOfTime?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* What the run takes for granted that the game may not bear out, one
|
|
127
|
+
* sentence each, such as the ground being taken as the height below the
|
|
128
|
+
* craft now.
|
|
129
|
+
*/
|
|
130
|
+
readonly gaps: readonly string[];
|
|
131
|
+
/** The craft's state at `ut`, or `undefined` outside the span the run covers. */
|
|
132
|
+
stateAt(ut: number): LiveRunState | undefined;
|
|
133
|
+
/**
|
|
134
|
+
* The amount a store the prediction models keep, such as the science a lab
|
|
135
|
+
* holds, has at `ut`, or `undefined` where the run holds no such store or
|
|
136
|
+
* does not cover that instant.
|
|
137
|
+
*/
|
|
138
|
+
storeAt?(ut: number, resource: string): number | undefined;
|
|
139
|
+
/** What the run has measured of its own error at `ut`, or `undefined` before it has measured any. */
|
|
140
|
+
spreadAt(ut: number): LiveRunSpread | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* The run's target relative to the craft at `ut`, or `undefined` where the
|
|
143
|
+
* run has no target or none at that instant.
|
|
144
|
+
*/
|
|
145
|
+
targetAt?(ut: number): LiveRunTarget | undefined;
|
|
146
|
+
/** Why the run states no target figures when a target is set, as one sentence. Absent when it states them or no target is set. */
|
|
147
|
+
readonly targetNotKnown?: string;
|
|
148
|
+
/** Why the run's scene-axes target figures end before the run does, as one sentence, when they do. The orbit-frame figures go on. */
|
|
149
|
+
readonly targetEndReason?: string;
|
|
150
|
+
/**
|
|
151
|
+
* The signal delay along the route home at `ut`, or `undefined` where the
|
|
152
|
+
* run has no delay column or does not cover that instant.
|
|
153
|
+
*/
|
|
154
|
+
delayAt?(ut: number): LiveRunDelay | undefined;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** The name of the store holding the data a science lab has to process, by the lab's part. */
|
|
158
|
+
export const labDataStore = (partId: string) => `science.lab.data.${partId}`;
|
|
159
|
+
|
|
160
|
+
/** The name of the store holding the science a lab has made, by the lab's part. */
|
|
161
|
+
export const labScienceStore = (partId: string) =>
|
|
162
|
+
`science.lab.science.${partId}`;
|
|
163
|
+
|
|
164
|
+
/** What a reckoning declined for want of a live run names as its input. */
|
|
165
|
+
export const LIVE_RUN_INPUT = "@liveRun";
|
|
166
|
+
|
|
167
|
+
let current: LiveRun | undefined;
|
|
168
|
+
let generation = 0;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Gives the store the live run its reckoning of `vessel.flight` and
|
|
172
|
+
* `vessel.orbit` reads, or takes it away with `undefined`, which leaves both
|
|
173
|
+
* Topics' modelled values not known. Called by the controller that flies it.
|
|
174
|
+
*
|
|
175
|
+
* @category Reckoners
|
|
176
|
+
*/
|
|
177
|
+
export function setLiveRun(run: LiveRun | undefined): void {
|
|
178
|
+
current = run;
|
|
179
|
+
generation++;
|
|
180
|
+
bumpReckonerGeneration();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** The live run that stands, or `undefined` when none has been flown from the readings yet. */
|
|
184
|
+
export function liveRunNow(): LiveRun | undefined {
|
|
185
|
+
return current;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** Counts each live run given or taken away, so a reading built against an earlier one is built again. */
|
|
189
|
+
export function liveRunGeneration(): number {
|
|
190
|
+
return generation;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
let askedPast: ((ut: number) => void) | undefined;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Has `listen` called with the instant asked each time a reading wants a
|
|
197
|
+
* modelled value past where the live run ends, until the returned function is
|
|
198
|
+
* called. Used by the controller that flies the run, to know the run is spent.
|
|
199
|
+
*
|
|
200
|
+
* @category Reckoners
|
|
201
|
+
*/
|
|
202
|
+
export function onLiveRunAskedPast(listen: (ut: number) => void): () => void {
|
|
203
|
+
askedPast = listen;
|
|
204
|
+
return () => {
|
|
205
|
+
if (askedPast === listen) askedPast = undefined;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** Tells the controller a reading asked for a value past the end of the live run. */
|
|
210
|
+
export function noteLiveRunAskedPast(ut: number): void {
|
|
211
|
+
askedPast?.(ut);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
let read: (() => void) | undefined;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Has `listen` called each time a reading takes a modelled value from the live
|
|
218
|
+
* run, or finds none to take, until the returned function is called. Used by
|
|
219
|
+
* the controller that flies the run, to fly it only while something reads it.
|
|
220
|
+
*
|
|
221
|
+
* @category Reckoners
|
|
222
|
+
*/
|
|
223
|
+
export function onLiveRunRead(listen: () => void): () => void {
|
|
224
|
+
read = listen;
|
|
225
|
+
return () => {
|
|
226
|
+
if (read === listen) read = undefined;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** The live run that stands, for a reading that takes a modelled value from it, which tells the controller the run is read. */
|
|
231
|
+
export function liveRunForReading(): LiveRun | undefined {
|
|
232
|
+
read?.();
|
|
233
|
+
return current;
|
|
234
|
+
}
|
package/src/spine/lock-scope.ts
CHANGED
|
@@ -49,6 +49,16 @@ export interface LockScopeRegistry {
|
|
|
49
49
|
*/
|
|
50
50
|
export const LockScopeContext = createContext<LockScopeRegistry | null>(null);
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Hears every capability claimed anywhere below it, whether or not a lock scope
|
|
54
|
+
* holds the claim. Useful for a guard that has to know which commands a widget
|
|
55
|
+
* sends before deciding to draw it. Provided by the dashboard's widget guard and
|
|
56
|
+
* read by `useClaimCapability`.
|
|
57
|
+
*/
|
|
58
|
+
export const ClaimObserverContext = createContext<
|
|
59
|
+
((capability: Capability) => void) | null
|
|
60
|
+
>(null);
|
|
61
|
+
|
|
52
62
|
/**
|
|
53
63
|
* Claims the capability named by `kind` and `id` with the nearest lock scope for
|
|
54
64
|
* as long as the caller is mounted. Useful for a widget that must refuse itself
|
|
@@ -57,6 +67,10 @@ export const LockScopeContext = createContext<LockScopeRegistry | null>(null);
|
|
|
57
67
|
*/
|
|
58
68
|
export function useClaimCapability(kind: Capability["kind"], id: string): void {
|
|
59
69
|
const scope = useContext(LockScopeContext);
|
|
70
|
+
const observer = useContext(ClaimObserverContext);
|
|
60
71
|
// A layout effect, so a scope that locks on this claim does so before the first paint.
|
|
61
|
-
useLayoutEffect(() =>
|
|
72
|
+
useLayoutEffect(() => {
|
|
73
|
+
observer?.({ kind, id });
|
|
74
|
+
return scope?.claim({ kind, id });
|
|
75
|
+
}, [scope, observer, kind, id]);
|
|
62
76
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CommandErrorCode } from "../__generated__/error-codes";
|
|
2
|
+
import { commandRail } from "../commands";
|
|
3
|
+
import type { CommandGateStatus } from "./command-gate";
|
|
4
|
+
import { isDashboardTopic, type TelemetryOverlay } from "./overlay-context";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Names what the screen shows in the sentence a gated control draws, by the
|
|
8
|
+
* mode id of the overlay. A mode this table does not name reads as "another
|
|
9
|
+
* mode".
|
|
10
|
+
*/
|
|
11
|
+
const SHOWN: Readonly<Record<string, string>> = {
|
|
12
|
+
planning: "a predicted flight",
|
|
13
|
+
replay: "a recording",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The standing refusal of a command that is sent to a craft while the screen
|
|
18
|
+
* shows a mode that answers for the craft, or `undefined` when the command goes
|
|
19
|
+
* to the game as usual. A predicted flight or a recording has no craft in the
|
|
20
|
+
* game to act on, so the control draws disabled with the reason as its tip and
|
|
21
|
+
* a press sends nothing. Commands about the dashboard (`mode.`, `system.`,
|
|
22
|
+
* `host.`, `settings.`) and commands the mod runs at once for the program
|
|
23
|
+
* itself, or at home rather than at a craft, are not stopped. Used by
|
|
24
|
+
* `useCommand`.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export function modeAnswersGate(
|
|
29
|
+
overlay: TelemetryOverlay | undefined,
|
|
30
|
+
command: string,
|
|
31
|
+
): CommandGateStatus | undefined {
|
|
32
|
+
if (!overlay?.wholeCraft) return undefined;
|
|
33
|
+
if (isDashboardTopic(command)) return undefined;
|
|
34
|
+
const rail = commandRail(command);
|
|
35
|
+
// A command the declarations do not carry is treated as delayed, as the host does.
|
|
36
|
+
if (rail?.meta === true || rail?.delayed === false) return undefined;
|
|
37
|
+
return {
|
|
38
|
+
command,
|
|
39
|
+
blocked: true,
|
|
40
|
+
undetermined: false,
|
|
41
|
+
errorCode: CommandErrorCode.ModeUnavailable,
|
|
42
|
+
reason: "mode-answers-craft",
|
|
43
|
+
detail: `the screen shows ${SHOWN[overlay.mode] ?? "another mode"}, not the game`,
|
|
44
|
+
};
|
|
45
|
+
}
|