@ksp-gonogo/sitrep-sdk 1.0.0-rc.45 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -93
- package/dist/__generated__/command-map.d.ts +247 -2
- package/dist/__generated__/command-map.d.ts.map +1 -1
- package/dist/__generated__/command-map.js +91 -19
- package/dist/__generated__/command-map.js.map +1 -1
- package/dist/__generated__/contract.d.ts +3062 -352
- package/dist/__generated__/contract.d.ts.map +1 -1
- package/dist/__generated__/contract.js +187 -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 +12 -0
- package/dist/__generated__/delay-roles.js.map +1 -1
- package/dist/__generated__/error-codes.d.ts +11 -11
- package/dist/__generated__/error-codes.d.ts.map +1 -1
- package/dist/__generated__/error-codes.js +12 -12
- package/dist/__generated__/error-codes.js.map +1 -1
- package/dist/__generated__/frames.d.ts +40 -4
- package/dist/__generated__/frames.d.ts.map +1 -1
- package/dist/__generated__/frames.js +20 -4
- package/dist/__generated__/frames.js.map +1 -1
- package/dist/__generated__/reckonability.d.ts +3 -1
- package/dist/__generated__/reckonability.d.ts.map +1 -1
- package/dist/__generated__/reckonability.js +1 -1
- package/dist/__generated__/reckonability.js.map +1 -1
- package/dist/__generated__/sample-kinds.d.ts +18 -2
- package/dist/__generated__/sample-kinds.d.ts.map +1 -1
- package/dist/__generated__/sample-kinds.js +18 -2
- package/dist/__generated__/sample-kinds.js.map +1 -1
- package/dist/__generated__/topic-map.d.ts +41 -17
- package/dist/__generated__/topic-map.d.ts.map +1 -1
- package/dist/__generated__/topic-map.js +16 -3
- package/dist/__generated__/topic-map.js.map +1 -1
- package/dist/__generated__/units.d.ts +247 -6
- package/dist/__generated__/units.d.ts.map +1 -1
- package/dist/__generated__/units.js +949 -76
- package/dist/__generated__/units.js.map +1 -1
- package/dist/api/command-rejection.d.ts +2 -2
- package/dist/api/command-rejection.js +1 -1
- package/dist/api/contribution-slots.d.ts +122 -21
- package/dist/api/contribution-slots.d.ts.map +1 -1
- package/dist/api/contribution-slots.js +4 -4
- package/dist/api/contribution-slots.js.map +1 -1
- package/dist/api/error-codes.d.ts +3 -2
- package/dist/api/error-codes.d.ts.map +1 -1
- package/dist/api/error-codes.js +3 -2
- package/dist/api/error-codes.js.map +1 -1
- package/dist/api/framework-reads.d.ts +2 -2
- package/dist/api/framework-reads.d.ts.map +1 -1
- package/dist/api/framework-reads.js +6 -1
- package/dist/api/framework-reads.js.map +1 -1
- package/dist/api/host.d.ts +14 -6
- package/dist/api/host.d.ts.map +1 -1
- package/dist/api/host.js.map +1 -1
- package/dist/api/index.d.ts +70 -60
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +66 -54
- package/dist/api/index.js.map +1 -1
- package/dist/api/logger-contract.d.ts +2 -1
- package/dist/api/logger-contract.d.ts.map +1 -1
- package/dist/api/logger.d.ts +6 -3
- package/dist/api/logger.d.ts.map +1 -1
- package/dist/api/logger.js +6 -3
- package/dist/api/logger.js.map +1 -1
- package/dist/api/part-panels.d.ts +143 -0
- package/dist/api/part-panels.d.ts.map +1 -0
- package/dist/api/part-panels.js +104 -0
- package/dist/api/part-panels.js.map +1 -0
- package/dist/api/plot-layers.d.ts +1 -1
- package/dist/api/plot-layers.js +1 -1
- package/dist/api/registry.d.ts +4 -2
- package/dist/api/registry.d.ts.map +1 -1
- package/dist/api/registry.js +4 -2
- package/dist/api/registry.js.map +1 -1
- package/dist/api/settings/store.d.ts +1 -1
- package/dist/api/settings/store.d.ts.map +1 -1
- package/dist/api/settings/store.js +7 -2
- package/dist/api/settings/store.js.map +1 -1
- package/dist/api/slots.d.ts +150 -70
- package/dist/api/slots.d.ts.map +1 -1
- package/dist/api/station-brokers.d.ts +24 -15
- package/dist/api/station-brokers.d.ts.map +1 -1
- package/dist/api/station-brokers.js +24 -15
- package/dist/api/station-brokers.js.map +1 -1
- package/dist/api/tiny-size.d.ts +2 -1
- package/dist/api/tiny-size.d.ts.map +1 -1
- package/dist/api/tiny-size.js +2 -1
- package/dist/api/tiny-size.js.map +1 -1
- package/dist/api/tone.d.ts +1 -1
- package/dist/api/transport.d.ts +9 -0
- package/dist/api/transport.d.ts.map +1 -1
- package/dist/api/types.d.ts +356 -68
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/uplink-banner.d.ts +113 -0
- package/dist/api/uplink-banner.d.ts.map +1 -0
- package/dist/api/uplink-banner.js +69 -0
- package/dist/api/uplink-banner.js.map +1 -0
- package/dist/api/uplink-handles.d.ts +2 -12
- package/dist/api/uplink-handles.d.ts.map +1 -1
- package/dist/api/uplink-handles.js +2 -1
- package/dist/api/uplink-handles.js.map +1 -1
- package/dist/binary-frame.d.ts +4 -4
- package/dist/binary-frame.js +2 -2
- package/dist/combine-readings.d.ts +4 -3
- package/dist/combine-readings.d.ts.map +1 -1
- package/dist/combine-readings.js +4 -3
- package/dist/combine-readings.js.map +1 -1
- package/dist/command-delay.d.ts +81 -2
- package/dist/command-delay.d.ts.map +1 -1
- package/dist/command-delay.js +51 -8
- package/dist/command-delay.js.map +1 -1
- package/dist/command-value.d.ts +98 -0
- package/dist/command-value.d.ts.map +1 -0
- package/dist/command-value.js +87 -0
- package/dist/command-value.js.map +1 -0
- package/dist/commands.d.ts +1 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/compat-versions.d.ts +1 -1
- package/dist/compat-versions.d.ts.map +1 -1
- package/dist/compat-versions.js +3 -3
- package/dist/compat-versions.js.map +1 -1
- package/dist/contract-enum-names.d.ts +2 -2
- package/dist/contract-enum-names.js +2 -2
- package/dist/contract-tags.d.ts +33 -2
- package/dist/contract-tags.d.ts.map +1 -1
- package/dist/contract-tags.js +54 -5
- package/dist/contract-tags.js.map +1 -1
- package/dist/data-rate.d.ts +84 -0
- package/dist/data-rate.d.ts.map +1 -0
- package/dist/data-rate.js +133 -0
- package/dist/data-rate.js.map +1 -0
- package/dist/delay-roles.d.ts +14 -1
- package/dist/delay-roles.d.ts.map +1 -1
- package/dist/delay-roles.js +5 -1
- package/dist/delay-roles.js.map +1 -1
- package/dist/dock-markers.d.ts +126 -0
- package/dist/dock-markers.d.ts.map +1 -0
- package/dist/dock-markers.js +100 -0
- package/dist/dock-markers.js.map +1 -0
- package/dist/envelope.d.ts +2 -2
- package/dist/envelope.d.ts.map +1 -1
- package/dist/flight/types.d.ts +31 -2
- package/dist/flight/types.d.ts.map +1 -1
- package/dist/flight/types.js.map +1 -1
- package/dist/frames/index.d.ts +1 -4
- package/dist/frames/index.d.ts.map +1 -1
- package/dist/frames/index.js +0 -3
- package/dist/frames/index.js.map +1 -1
- package/dist/go-no-go-countdown.d.ts +65 -0
- package/dist/go-no-go-countdown.d.ts.map +1 -0
- package/dist/go-no-go-countdown.js +71 -0
- package/dist/go-no-go-countdown.js.map +1 -0
- package/dist/index.d.ts +13 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/dist/ksp-enum-names.d.ts +35 -4
- package/dist/ksp-enum-names.d.ts.map +1 -1
- package/dist/ksp-enum-names.js +31 -4
- package/dist/ksp-enum-names.js.map +1 -1
- package/dist/locked.d.ts +1 -1
- package/dist/locked.js +1 -1
- package/dist/media/delayed-playout-buffer.d.ts +29 -4
- package/dist/media/delayed-playout-buffer.d.ts.map +1 -1
- package/dist/media/delayed-playout-buffer.js +12 -5
- package/dist/media/delayed-playout-buffer.js.map +1 -1
- package/dist/media/encoded-frame-delay.d.ts +21 -16
- package/dist/media/encoded-frame-delay.d.ts.map +1 -1
- package/dist/media/encoded-frame-delay.js +21 -14
- package/dist/media/encoded-frame-delay.js.map +1 -1
- package/dist/media/frame-delay.d.ts +119 -5
- package/dist/media/frame-delay.d.ts.map +1 -1
- package/dist/media/frame-delay.js +201 -15
- package/dist/media/frame-delay.js.map +1 -1
- package/dist/media/frame-stamp-timeline.d.ts +119 -0
- package/dist/media/frame-stamp-timeline.d.ts.map +1 -0
- package/dist/media/frame-stamp-timeline.js +194 -0
- package/dist/media/frame-stamp-timeline.js.map +1 -0
- package/dist/media/index.d.ts +4 -3
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +1 -1
- package/dist/media/index.js.map +1 -1
- package/dist/media/radio-support.d.ts +8 -7
- package/dist/media/radio-support.d.ts.map +1 -1
- package/dist/media/radio-support.js +5 -6
- package/dist/media/radio-support.js.map +1 -1
- package/dist/media/worker/delay-worker-client.d.ts +27 -1
- package/dist/media/worker/delay-worker-client.d.ts.map +1 -1
- package/dist/media/worker/delay-worker-client.js +53 -5
- package/dist/media/worker/delay-worker-client.js.map +1 -1
- package/dist/media/worker/delay-worker.d.ts +45 -8
- package/dist/media/worker/delay-worker.d.ts.map +1 -1
- package/dist/media/worker/delay-worker.js +644 -56
- package/dist/media/worker/delay-worker.js.map +4 -4
- package/dist/media/worker/frame-delay-report.d.ts +25 -0
- package/dist/media/worker/frame-delay-report.d.ts.map +1 -0
- package/dist/media/worker/frame-delay-report.js +112 -0
- package/dist/media/worker/frame-delay-report.js.map +1 -0
- package/dist/media/worker/lead-limit-report.d.ts +13 -0
- package/dist/media/worker/lead-limit-report.d.ts.map +1 -0
- package/dist/media/worker/lead-limit-report.js +19 -0
- package/dist/media/worker/lead-limit-report.js.map +1 -0
- package/dist/media/worker/presentation-pacer.d.ts +70 -1
- package/dist/media/worker/presentation-pacer.d.ts.map +1 -1
- package/dist/media/worker/presentation-pacer.js +167 -9
- package/dist/media/worker/presentation-pacer.js.map +1 -1
- package/dist/media/worker/worker-delay-clock.d.ts +4 -5
- package/dist/media/worker/worker-delay-clock.d.ts.map +1 -1
- package/dist/media/worker/worker-delay-clock.js +6 -2
- package/dist/media/worker/worker-delay-clock.js.map +1 -1
- package/dist/perf/PerfBudget.d.ts +2 -2
- package/dist/perf/PerfBudget.js +2 -2
- package/dist/rail-tags.d.ts +7 -0
- package/dist/rail-tags.d.ts.map +1 -1
- package/dist/rail-tags.js.map +1 -1
- package/dist/raw-field-split.d.ts +1 -1
- package/dist/raw-field-split.js +1 -1
- package/dist/reading.d.ts +6 -6
- package/dist/reading.js +5 -5
- package/dist/reads-index.json +446 -37
- package/dist/resource-transfer.d.ts +177 -0
- package/dist/resource-transfer.d.ts.map +1 -0
- package/dist/resource-transfer.js +190 -0
- package/dist/resource-transfer.js.map +1 -0
- package/dist/runtime-topic-registry.d.ts +2 -2
- package/dist/runtime-topic-registry.d.ts.map +1 -1
- package/dist/runtime-topic-registry.js +23 -2
- package/dist/runtime-topic-registry.js.map +1 -1
- package/dist/sample-step-tracker.d.ts +17 -0
- package/dist/sample-step-tracker.d.ts.map +1 -0
- package/dist/sample-step-tracker.js +38 -0
- package/dist/sample-step-tracker.js.map +1 -0
- package/dist/sha256-fallback.d.ts +6 -0
- package/dist/sha256-fallback.d.ts.map +1 -0
- package/dist/sha256-fallback.js +68 -0
- package/dist/sha256-fallback.js.map +1 -0
- package/dist/spine/arrival-deadline.d.ts +7 -0
- package/dist/spine/arrival-deadline.d.ts.map +1 -1
- package/dist/spine/arrival-deadline.js +12 -0
- package/dist/spine/arrival-deadline.js.map +1 -1
- package/dist/spine/bound-command.d.ts +58 -0
- package/dist/spine/bound-command.d.ts.map +1 -0
- package/dist/spine/bound-command.js +162 -0
- package/dist/spine/bound-command.js.map +1 -0
- package/dist/spine/capability-lock.d.ts +6 -1
- package/dist/spine/capability-lock.d.ts.map +1 -1
- package/dist/spine/capability-lock.js +56 -5
- package/dist/spine/capability-lock.js.map +1 -1
- package/dist/spine/catalog-fallback.d.ts +28 -0
- package/dist/spine/catalog-fallback.d.ts.map +1 -0
- package/dist/spine/catalog-fallback.js +120 -0
- package/dist/spine/catalog-fallback.js.map +1 -0
- package/dist/spine/celestial-facts.d.ts.map +1 -1
- package/dist/spine/celestial-facts.js +5 -2
- package/dist/spine/celestial-facts.js.map +1 -1
- package/dist/spine/centre-commands.d.ts +84 -0
- package/dist/spine/centre-commands.d.ts.map +1 -0
- package/dist/spine/centre-commands.js +236 -0
- package/dist/spine/centre-commands.js.map +1 -0
- package/dist/spine/client-reading.js +1 -1
- package/dist/spine/client-timeline.d.ts +48 -1
- package/dist/spine/client-timeline.d.ts.map +1 -1
- package/dist/spine/client-timeline.js +151 -3
- package/dist/spine/client-timeline.js.map +1 -1
- package/dist/spine/client.d.ts +154 -4
- package/dist/spine/client.d.ts.map +1 -1
- package/dist/spine/client.js +530 -34
- package/dist/spine/client.js.map +1 -1
- package/dist/spine/command-gate.d.ts +8 -0
- package/dist/spine/command-gate.d.ts.map +1 -1
- package/dist/spine/command-gate.js +36 -3
- package/dist/spine/command-gate.js.map +1 -1
- package/dist/spine/command-outcomes.d.ts +60 -0
- package/dist/spine/command-outcomes.d.ts.map +1 -0
- package/dist/spine/command-outcomes.js +256 -0
- package/dist/spine/command-outcomes.js.map +1 -0
- package/dist/spine/connectivity-history.d.ts +5 -3
- package/dist/spine/connectivity-history.d.ts.map +1 -1
- package/dist/spine/connectivity-history.js.map +1 -1
- package/dist/spine/context.d.ts +62 -11
- package/dist/spine/context.d.ts.map +1 -1
- package/dist/spine/context.js +125 -39
- package/dist/spine/context.js.map +1 -1
- package/dist/spine/core-reckoners.d.ts.map +1 -1
- package/dist/spine/core-reckoners.js +16 -39
- package/dist/spine/core-reckoners.js.map +1 -1
- package/dist/spine/delay-authority-context.d.ts +5 -0
- package/dist/spine/delay-authority-context.d.ts.map +1 -0
- package/dist/spine/delay-authority-context.js +7 -0
- package/dist/spine/delay-authority-context.js.map +1 -0
- package/dist/spine/delay-authority.d.ts +76 -1
- package/dist/spine/delay-authority.d.ts.map +1 -1
- package/dist/spine/delay-authority.js +217 -3
- package/dist/spine/delay-authority.js.map +1 -1
- package/dist/spine/delay-estimate.d.ts +41 -0
- package/dist/spine/delay-estimate.d.ts.map +1 -0
- package/dist/spine/delay-estimate.js +70 -0
- package/dist/spine/delay-estimate.js.map +1 -0
- package/dist/spine/delta-v-budget.js +2 -2
- package/dist/spine/delta-v-budget.js.map +1 -1
- package/dist/spine/dv-stage-resources.d.ts +32 -17
- package/dist/spine/dv-stage-resources.d.ts.map +1 -1
- package/dist/spine/dv-stage-resources.js +44 -37
- package/dist/spine/dv-stage-resources.js.map +1 -1
- package/dist/spine/index.d.ts +7 -1
- package/dist/spine/index.d.ts.map +1 -1
- package/dist/spine/index.js +11 -5
- package/dist/spine/index.js.map +1 -1
- package/dist/spine/kepler-reckoning.d.ts +56 -0
- package/dist/spine/kepler-reckoning.d.ts.map +1 -1
- package/dist/spine/kepler-reckoning.js +179 -3
- package/dist/spine/kepler-reckoning.js.map +1 -1
- package/dist/spine/kepler.d.ts +1 -1
- package/dist/spine/kepler.js +1 -1
- package/dist/spine/known-holds.d.ts +8 -0
- package/dist/spine/known-holds.d.ts.map +1 -0
- package/dist/spine/known-holds.js +78 -0
- package/dist/spine/known-holds.js.map +1 -0
- package/dist/spine/lagrange.d.ts +9 -34
- package/dist/spine/lagrange.d.ts.map +1 -1
- package/dist/spine/lagrange.js +4 -24
- package/dist/spine/lagrange.js.map +1 -1
- package/dist/spine/lifecycle.d.ts +21 -0
- package/dist/spine/lifecycle.d.ts.map +1 -1
- package/dist/spine/lifecycle.js.map +1 -1
- package/dist/spine/lock-scope.d.ts +2 -2
- package/dist/spine/map-topic.d.ts +3 -3
- package/dist/spine/map-topic.js +3 -3
- package/dist/spine/never-reckonable.js +1 -1
- package/dist/spine/never-reckonable.js.map +1 -1
- package/dist/spine/orbit-patches.d.ts +6 -4
- package/dist/spine/orbit-patches.d.ts.map +1 -1
- package/dist/spine/orbit-patches.js +45 -10
- package/dist/spine/orbit-patches.js.map +1 -1
- package/dist/spine/orbital-solve.d.ts +1 -1
- package/dist/spine/orbital-solve.d.ts.map +1 -1
- package/dist/spine/orbital-solve.js +35 -0
- package/dist/spine/orbital-solve.js.map +1 -1
- package/dist/spine/powered-reckoning.d.ts +5 -0
- package/dist/spine/powered-reckoning.d.ts.map +1 -1
- package/dist/spine/powered-reckoning.js.map +1 -1
- package/dist/spine/processorEvaluator.d.ts +29 -0
- package/dist/spine/processorEvaluator.d.ts.map +1 -1
- package/dist/spine/processorEvaluator.js +94 -71
- package/dist/spine/processorEvaluator.js.map +1 -1
- package/dist/spine/processors.d.ts +56 -4
- package/dist/spine/processors.d.ts.map +1 -1
- package/dist/spine/processors.js +110 -0
- package/dist/spine/processors.js.map +1 -1
- package/dist/spine/rail-registry.d.ts +1 -1
- package/dist/spine/rail-registry.d.ts.map +1 -1
- package/dist/spine/reckoner-generation.d.ts +5 -0
- package/dist/spine/reckoner-generation.d.ts.map +1 -0
- package/dist/spine/reckoner-generation.js +10 -0
- package/dist/spine/reckoner-generation.js.map +1 -0
- package/dist/spine/reckoners.d.ts.map +1 -1
- package/dist/spine/reckoners.js +3 -0
- package/dist/spine/reckoners.js.map +1 -1
- package/dist/spine/replay-session-controller.d.ts +1 -1
- package/dist/spine/replay-session-controller.d.ts.map +1 -1
- package/dist/spine/replay-session-controller.js +4 -6
- package/dist/spine/replay-session-controller.js.map +1 -1
- package/dist/spine/resolve-tracked.d.ts +20 -2
- package/dist/spine/resolve-tracked.d.ts.map +1 -1
- package/dist/spine/resolve-tracked.js +32 -2
- package/dist/spine/resolve-tracked.js.map +1 -1
- package/dist/spine/send-status.d.ts +2 -0
- package/dist/spine/send-status.d.ts.map +1 -1
- package/dist/spine/send-status.js.map +1 -1
- package/dist/spine/settings-registry.d.ts +7 -0
- package/dist/spine/settings-registry.d.ts.map +1 -1
- package/dist/spine/settings-registry.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 +6 -3
- package/dist/spine/slot-ids.js.map +1 -1
- package/dist/spine/space-center-state.d.ts +17 -9
- package/dist/spine/space-center-state.d.ts.map +1 -1
- package/dist/spine/space-center-state.js +14 -15
- package/dist/spine/space-center-state.js.map +1 -1
- package/dist/spine/stage-countdown-store.d.ts +38 -0
- package/dist/spine/stage-countdown-store.d.ts.map +1 -0
- package/dist/spine/stage-countdown-store.js +53 -0
- package/dist/spine/stage-countdown-store.js.map +1 -0
- package/dist/spine/stream-status.d.ts +3 -3
- package/dist/spine/stream-status.js +3 -3
- package/dist/spine/subscribe-read.d.ts +1 -1
- package/dist/spine/subscribe-read.js +2 -2
- package/dist/spine/system-state.d.ts +13 -13
- package/dist/spine/system-state.d.ts.map +1 -1
- package/dist/spine/system-state.js +18 -18
- package/dist/spine/system-state.js.map +1 -1
- package/dist/spine/timeline-store.d.ts +304 -113
- package/dist/spine/timeline-store.d.ts.map +1 -1
- package/dist/spine/timeline-store.js +921 -223
- package/dist/spine/timeline-store.js.map +1 -1
- package/dist/spine/uplink-clients.d.ts +32 -16
- package/dist/spine/uplink-clients.d.ts.map +1 -1
- package/dist/spine/uplink-clients.js +8 -4
- package/dist/spine/uplink-clients.js.map +1 -1
- package/dist/spine/uplink-delays.d.ts +31 -0
- package/dist/spine/uplink-delays.d.ts.map +1 -0
- package/dist/spine/uplink-delays.js +46 -0
- package/dist/spine/uplink-delays.js.map +1 -0
- package/dist/spine/uplink-health.d.ts +109 -14
- package/dist/spine/uplink-health.d.ts.map +1 -1
- package/dist/spine/uplink-health.js +21 -17
- package/dist/spine/uplink-health.js.map +1 -1
- package/dist/spine/use-action-input.d.ts.map +1 -1
- package/dist/spine/use-action-input.js +14 -9
- package/dist/spine/use-action-input.js.map +1 -1
- package/dist/spine/use-body-states.d.ts.map +1 -1
- package/dist/spine/use-body-states.js +3 -3
- package/dist/spine/use-body-states.js.map +1 -1
- package/dist/spine/use-command.d.ts +94 -31
- package/dist/spine/use-command.d.ts.map +1 -1
- package/dist/spine/use-command.js +409 -197
- package/dist/spine/use-command.js.map +1 -1
- package/dist/spine/use-last-known-path.d.ts +36 -0
- package/dist/spine/use-last-known-path.d.ts.map +1 -0
- package/dist/spine/use-last-known-path.js +46 -0
- package/dist/spine/use-last-known-path.js.map +1 -0
- package/dist/spine/use-observed-vantage.d.ts +13 -0
- package/dist/spine/use-observed-vantage.d.ts.map +1 -0
- package/dist/spine/use-observed-vantage.js +20 -0
- package/dist/spine/use-observed-vantage.js.map +1 -0
- package/dist/spine/use-orbit-trajectory.d.ts +1 -1
- package/dist/spine/use-orbit-trajectory.d.ts.map +1 -1
- package/dist/spine/use-orbit-trajectory.js +17 -3
- package/dist/spine/use-orbit-trajectory.js.map +1 -1
- package/dist/spine/use-stream-connected.d.ts +8 -0
- package/dist/spine/use-stream-connected.d.ts.map +1 -0
- package/dist/spine/use-stream-connected.js +16 -0
- package/dist/spine/use-stream-connected.js.map +1 -0
- package/dist/spine/use-stream-event.d.ts +6 -1
- package/dist/spine/use-stream-event.d.ts.map +1 -1
- package/dist/spine/use-stream-event.js +5 -1
- package/dist/spine/use-stream-event.js.map +1 -1
- package/dist/spine/use-stream.d.ts +5 -2
- package/dist/spine/use-stream.d.ts.map +1 -1
- package/dist/spine/use-stream.js +7 -4
- package/dist/spine/use-stream.js.map +1 -1
- package/dist/spine/use-telemetry.d.ts +5 -1
- package/dist/spine/use-telemetry.d.ts.map +1 -1
- package/dist/spine/use-telemetry.js.map +1 -1
- package/dist/spine/use-topic-clock.d.ts +54 -0
- package/dist/spine/use-topic-clock.d.ts.map +1 -0
- package/dist/spine/use-topic-clock.js +137 -0
- package/dist/spine/use-topic-clock.js.map +1 -0
- package/dist/spine/use-transmissions.d.ts.map +1 -1
- package/dist/spine/use-transmissions.js +9 -4
- package/dist/spine/use-transmissions.js.map +1 -1
- package/dist/spine/vantage.d.ts +6 -0
- package/dist/spine/vantage.d.ts.map +1 -1
- package/dist/spine/vantage.js +6 -0
- package/dist/spine/vantage.js.map +1 -1
- package/dist/spine/view-clock.d.ts +23 -3
- package/dist/spine/view-clock.d.ts.map +1 -1
- package/dist/spine/view-clock.js +80 -2
- package/dist/spine/view-clock.js.map +1 -1
- package/dist/testing/fake-command.d.ts +48 -0
- package/dist/testing/fake-command.d.ts.map +1 -0
- package/dist/testing/fake-command.js +63 -0
- package/dist/testing/fake-command.js.map +1 -0
- package/dist/testing/index.d.ts +5 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +6 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/install-act-gate-stretch.d.ts +1 -2
- package/dist/testing/install-act-gate-stretch.d.ts.map +1 -1
- package/dist/testing/install-act-gate-stretch.js +1 -2
- package/dist/testing/install-act-gate-stretch.js.map +1 -1
- package/dist/testing/install-dom-stubs.d.ts +2 -5
- package/dist/testing/install-dom-stubs.d.ts.map +1 -1
- package/dist/testing/install-dom-stubs.js +2 -34
- package/dist/testing/install-dom-stubs.js.map +1 -1
- package/dist/testing/install-real-test-host.d.ts.map +1 -1
- package/dist/testing/install-real-test-host.js +7 -6
- package/dist/testing/install-real-test-host.js.map +1 -1
- package/dist/testing/recorded-uplink-banners.d.ts +49 -0
- package/dist/testing/recorded-uplink-banners.d.ts.map +1 -0
- package/dist/testing/recorded-uplink-banners.js +45 -0
- package/dist/testing/recorded-uplink-banners.js.map +1 -0
- package/dist/testing/render.d.ts +16 -3
- package/dist/testing/render.d.ts.map +1 -1
- package/dist/testing/render.js +16 -3
- package/dist/testing/render.js.map +1 -1
- package/dist/testing/stream-fixture.js +3 -3
- package/dist/testing/stream-fixture.js.map +1 -1
- package/dist/testing/stub-transport.d.ts +6 -0
- package/dist/testing/stub-transport.d.ts.map +1 -1
- package/dist/testing/stub-transport.js +3 -0
- package/dist/testing/stub-transport.js.map +1 -1
- package/dist/timeline.d.ts +2 -98
- package/dist/timeline.d.ts.map +1 -1
- package/dist/topics.d.ts +68 -28
- package/dist/topics.d.ts.map +1 -1
- package/dist/topics.js +21 -18
- package/dist/topics.js.map +1 -1
- package/dist/unit-system/index.d.ts +1 -1
- package/dist/unit-system/index.d.ts.map +1 -1
- package/dist/unit-system/index.js +1 -1
- package/dist/unit-system/index.js.map +1 -1
- package/dist/unit-system/value.d.ts +26 -5
- package/dist/unit-system/value.d.ts.map +1 -1
- package/dist/unit-system/value.js +41 -21
- package/dist/unit-system/value.js.map +1 -1
- package/dist/units.d.ts.map +1 -1
- package/dist/units.js +2 -1
- package/dist/units.js.map +1 -1
- package/dist/uplink-externals.d.ts +17 -7
- package/dist/uplink-externals.d.ts.map +1 -1
- package/dist/uplink-externals.js +17 -7
- package/dist/uplink-externals.js.map +1 -1
- package/dist/uplink-load.d.ts +3 -2
- package/dist/uplink-load.d.ts.map +1 -1
- package/dist/uplink-load.js +9 -6
- package/dist/uplink-load.js.map +1 -1
- package/dist/uplink-manifest.d.ts +8 -3
- package/dist/uplink-manifest.d.ts.map +1 -1
- package/dist/uplink-manifest.js +5 -1
- package/dist/uplink-manifest.js.map +1 -1
- package/dist/wrap-units.d.ts.map +1 -1
- package/dist/wrap-units.js +3 -2
- package/dist/wrap-units.js.map +1 -1
- package/package.json +1 -1
- package/src/__generated__/command-map.ts +215 -19
- package/src/__generated__/contract.ts +3102 -330
- package/src/__generated__/delay-roles.ts +12 -0
- package/src/__generated__/error-codes.ts +13 -13
- package/src/__generated__/frames.ts +20 -4
- package/src/__generated__/reckonability.ts +3 -1
- package/src/__generated__/sample-kinds.ts +18 -2
- package/src/__generated__/topic-map.ts +68 -19
- package/src/__generated__/units.json +958 -94
- package/src/__generated__/units.ts +949 -76
- package/src/api/command-rejection.ts +2 -2
- package/src/api/contribution-slots.ts +128 -25
- package/src/api/error-codes.ts +3 -2
- package/src/api/framework-reads.ts +6 -1
- package/src/api/host.ts +14 -6
- package/src/api/index.ts +127 -67
- package/src/api/logger-contract.ts +2 -1
- package/src/api/logger.ts +6 -3
- package/src/api/part-panels.ts +221 -0
- package/src/api/plot-layers.ts +1 -1
- package/src/api/registry.ts +4 -2
- package/src/api/settings/store.ts +7 -2
- package/src/api/slots.ts +153 -70
- package/src/api/station-brokers.ts +24 -15
- package/src/api/tiny-size.ts +2 -1
- package/src/api/tone.ts +1 -1
- package/src/api/transport.ts +13 -0
- package/src/api/types.ts +388 -68
- package/src/api/uplink-banner.ts +128 -0
- package/src/api/uplink-handles.ts +4 -1
- package/src/binary-frame.ts +4 -4
- package/src/combine-readings.ts +4 -3
- package/src/command-delay.ts +144 -11
- package/src/command-value.ts +181 -0
- package/src/compat-versions.ts +3 -3
- package/src/contract-enum-names.ts +2 -2
- package/src/contract-tags.ts +67 -5
- package/src/data-rate.ts +178 -0
- package/src/delay-roles.ts +19 -2
- package/src/dock-markers.ts +182 -0
- package/src/envelope.ts +4 -0
- package/src/flight/types.ts +31 -2
- package/src/frames/index.ts +0 -4
- package/src/go-no-go-countdown.ts +116 -0
- package/src/index.ts +64 -4
- package/src/ksp-enum-names.ts +48 -3
- package/src/locked.ts +1 -1
- package/src/media/__fixtures__/hull-after-revert.json +1506 -0
- package/src/media/delayed-playout-buffer.ts +41 -9
- package/src/media/encoded-frame-delay.ts +29 -17
- package/src/media/frame-delay.ts +328 -22
- package/src/media/frame-stamp-timeline.ts +270 -0
- package/src/media/index.ts +5 -0
- package/src/media/radio-support.ts +8 -7
- package/src/media/worker/delay-worker-client.ts +104 -6
- package/src/media/worker/delay-worker.ts +228 -27
- package/src/media/worker/frame-delay-report.ts +141 -0
- package/src/media/worker/lead-limit-report.ts +27 -0
- package/src/media/worker/presentation-pacer.ts +216 -9
- package/src/media/worker/worker-delay-clock.ts +9 -6
- package/src/perf/PerfBudget.ts +2 -2
- package/src/rail-tags.ts +8 -0
- package/src/raw-field-split.ts +1 -1
- package/src/reading.ts +6 -6
- package/src/resource-transfer.ts +352 -0
- package/src/runtime-topic-registry.ts +23 -2
- package/src/sample-step-tracker.ts +38 -0
- package/src/sha256-fallback.ts +69 -0
- package/src/spine/__fixtures__/crash/crash-eva.json +224 -0
- package/src/spine/__fixtures__/crash/crash-separated-pod-pod-root.json +144 -0
- package/src/spine/__fixtures__/crash/crash-separated-pod.json +111 -0
- package/src/spine/__fixtures__/switch/back-to-craft.jsonl +101 -0
- package/src/spine/__fixtures__/switch/late-sent-frame.jsonl +16 -0
- package/src/spine/__fixtures__/switch/linked-craft.jsonl +63 -0
- package/src/spine/__fixtures__/switch/station-trim.jsonl +229 -0
- package/src/spine/__fixtures__/switch/switch-with-scene.jsonl +110 -0
- package/src/spine/__fixtures__/switch/unlinked-craft.jsonl +46 -0
- package/src/spine/arrival-deadline.ts +15 -0
- package/src/spine/bound-command.ts +243 -0
- package/src/spine/capability-lock.ts +65 -6
- package/src/spine/catalog-fallback.ts +152 -0
- package/src/spine/celestial-facts.ts +4 -2
- package/src/spine/centre-commands.ts +314 -0
- package/src/spine/client-reading.ts +1 -1
- package/src/spine/client-timeline.ts +165 -4
- package/src/spine/client.ts +615 -32
- package/src/spine/command-gate.ts +44 -3
- package/src/spine/command-outcomes.ts +303 -0
- package/src/spine/connectivity-history.ts +5 -3
- package/src/spine/context.tsx +154 -50
- package/src/spine/core-reckoners.ts +31 -50
- package/src/spine/delay-authority-context.ts +9 -0
- package/src/spine/delay-authority.ts +227 -3
- package/src/spine/delay-estimate.ts +88 -0
- package/src/spine/delta-v-budget.ts +2 -2
- package/src/spine/dv-stage-resources.ts +55 -43
- package/src/spine/index.ts +11 -5
- package/src/spine/kepler-reckoning.ts +245 -3
- package/src/spine/kepler.ts +1 -1
- package/src/spine/known-holds.ts +96 -0
- package/src/spine/lagrange.ts +10 -46
- package/src/spine/lifecycle.ts +22 -0
- package/src/spine/lock-scope.ts +2 -2
- package/src/spine/map-topic.ts +3 -3
- package/src/spine/never-reckonable.ts +1 -1
- package/src/spine/orbit-patches.ts +54 -10
- package/src/spine/orbital-solve.ts +53 -1
- package/src/spine/powered-reckoning.ts +5 -1
- package/src/spine/processorEvaluator.ts +106 -72
- package/src/spine/processors.ts +144 -4
- package/src/spine/rail-registry.ts +1 -1
- package/src/spine/reckoner-generation.ts +11 -0
- package/src/spine/reckoners.ts +3 -0
- package/src/spine/replay-session-controller.ts +4 -6
- package/src/spine/resolve-tracked.ts +50 -1
- package/src/spine/send-status.ts +2 -0
- package/src/spine/settings-registry.ts +7 -0
- package/src/spine/slot-ids.ts +6 -3
- package/src/spine/space-center-state.ts +17 -20
- package/src/spine/stage-countdown-store.ts +76 -0
- package/src/spine/stream-status.ts +4 -4
- package/src/spine/subscribe-read.ts +2 -2
- package/src/spine/system-state.ts +19 -21
- package/src/spine/timeline-store.ts +1119 -247
- package/src/spine/uplink-clients.ts +44 -22
- package/src/spine/uplink-delays.ts +57 -0
- package/src/spine/uplink-health.ts +59 -27
- package/src/spine/use-action-input.ts +13 -9
- package/src/spine/use-body-states.ts +5 -4
- package/src/spine/use-command.ts +620 -239
- package/src/spine/use-last-known-path.ts +75 -0
- package/src/spine/use-observed-vantage.ts +24 -0
- package/src/spine/use-orbit-trajectory.ts +22 -3
- package/src/spine/use-stream-connected.ts +23 -0
- package/src/spine/use-stream-event.ts +6 -2
- package/src/spine/use-stream.ts +7 -4
- package/src/spine/use-telemetry.ts +5 -1
- package/src/spine/use-topic-clock.ts +196 -0
- package/src/spine/use-transmissions.ts +37 -18
- package/src/spine/vantage.ts +7 -0
- package/src/spine/view-clock.ts +89 -3
- package/src/testing/fake-command.ts +109 -0
- package/src/testing/index.ts +12 -1
- package/src/testing/install-act-gate-stretch.ts +1 -2
- package/src/testing/install-dom-stubs.ts +2 -38
- package/src/testing/install-real-test-host.ts +10 -6
- package/src/testing/recorded-uplink-banners.ts +71 -0
- package/src/testing/render.tsx +16 -3
- package/src/testing/stream-fixture.tsx +3 -3
- package/src/testing/stub-transport.ts +9 -0
- package/src/timeline.ts +2 -103
- package/src/topics.ts +87 -26
- package/src/unit-system/index.ts +2 -0
- package/src/unit-system/value.ts +61 -21
- package/src/units.ts +2 -1
- package/src/uplink-externals.ts +17 -7
- package/src/uplink-load.ts +9 -8
- package/src/uplink-manifest.ts +8 -3
- package/src/wrap-units.ts +3 -9
- package/dist/spine/contributed-channels.d.ts +0 -56
- package/dist/spine/contributed-channels.d.ts.map +0 -1
- package/dist/spine/contributed-channels.js +0 -108
- package/dist/spine/contributed-channels.js.map +0 -1
- package/src/spine/contributed-channels.ts +0 -134
package/src/spine/view-clock.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DelayLane } from "../delay-roles";
|
|
2
|
+
import { SampleStepTracker } from "../sample-step-tracker";
|
|
2
3
|
import {
|
|
3
4
|
type ClockFormulaInputs,
|
|
4
5
|
type ClockFormulaSnapshot,
|
|
@@ -47,7 +48,9 @@ export type ViewClockConfidence = "locked" | "coasting" | "degraded";
|
|
|
47
48
|
export interface ViewClockOptions {
|
|
48
49
|
/** One delay authority: the default is a fixed/zero delay; a real `DelayAuthority` can be swapped in. */
|
|
49
50
|
delaySeconds?: () => number;
|
|
50
|
-
/**
|
|
51
|
+
/** A count that rises when the delay was a stand-in and a measured figure has replaced it: the view then starts afresh at that figure instead of holding for one delay. Default none. */
|
|
52
|
+
delayEpoch?: () => number;
|
|
53
|
+
/** The game's nominal UT per wall second: its warp rate, 0 while paused. Default 1. The clock scales it by the pace it measures from live deliveries, so a game running slower than its warp rate is followed at the speed it really runs. */
|
|
51
54
|
warpRate?: () => number;
|
|
52
55
|
/** Injectable wall clock (seconds), defaulting to `performance.now() / 1000`. Tests inject a controllable one. */
|
|
53
56
|
nowWall?: () => number;
|
|
@@ -57,6 +60,18 @@ export interface ViewClockOptions {
|
|
|
57
60
|
coastingAfterSeconds?: number;
|
|
58
61
|
}
|
|
59
62
|
|
|
63
|
+
/** Shortest wall-clock span over which the game's own rate is measured, long enough that a physics tick's rounding of `deliveredAt` stays under half a percent. */
|
|
64
|
+
const RATE_WINDOW_SECONDS = 10;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The range of game-to-nominal rate a measurement may report and still be
|
|
68
|
+
* believed. Outside it the span held something other than a running game: a
|
|
69
|
+
* pause the warp state had not reported yet, or a burst of frames held up in
|
|
70
|
+
* transit.
|
|
71
|
+
*/
|
|
72
|
+
const MIN_RATE_RATIO = 0.25;
|
|
73
|
+
const MAX_RATE_RATIO = 4;
|
|
74
|
+
|
|
60
75
|
function defaultNowWall(): number {
|
|
61
76
|
return performance.now() / 1000;
|
|
62
77
|
}
|
|
@@ -86,6 +101,7 @@ export class ViewClock {
|
|
|
86
101
|
private anchorWall: number | undefined;
|
|
87
102
|
private anchorUt: number | undefined;
|
|
88
103
|
private maxSampleUt = Number.NEGATIVE_INFINITY;
|
|
104
|
+
private readonly sampleSteps = new SampleStepTracker();
|
|
89
105
|
private lastObservedWall: number | undefined;
|
|
90
106
|
/**
|
|
91
107
|
* Monotonic cursor behind {@link viewUt}, kept apart from {@link scetUt}'s so
|
|
@@ -104,6 +120,16 @@ export class ViewClock {
|
|
|
104
120
|
};
|
|
105
121
|
/** Monotonic cursor for {@link scetUt}, reset with the others on an epoch bump. */
|
|
106
122
|
private lastScetUt = Number.NEGATIVE_INFINITY;
|
|
123
|
+
/**
|
|
124
|
+
* The game's measured pace as a fraction of its nominal warp rate. A game
|
|
125
|
+
* the machine cannot keep up with runs slower than its warp rate says, and
|
|
126
|
+
* an estimate carried forward at the nominal rate through a silence (a loss
|
|
127
|
+
* of signal, where the craft's own readings stop) runs ahead of the game by
|
|
128
|
+
* the difference, so the view would show instants light has not yet carried.
|
|
129
|
+
*/
|
|
130
|
+
private rateRatio = 1;
|
|
131
|
+
/** The live delivery the current rate measurement started from, with the nominal rate in force then. */
|
|
132
|
+
private rateFrom: { wall: number; ut: number; warp: number } | undefined;
|
|
107
133
|
/** Manual history-scrub target, `null` = live. Set via `scrubTo`. */
|
|
108
134
|
private scrubTarget: number | null = null;
|
|
109
135
|
|
|
@@ -132,11 +158,13 @@ export class ViewClock {
|
|
|
132
158
|
if (epoch > this.epoch) {
|
|
133
159
|
this.epoch = epoch;
|
|
134
160
|
this.maxSampleUt = Number.NEGATIVE_INFINITY;
|
|
161
|
+
this.sampleSteps.reset();
|
|
135
162
|
this.lastConfirmedViewUt.delayed = Number.NEGATIVE_INFINITY;
|
|
136
163
|
this.lastConfirmedViewUt["true-now"] = Number.NEGATIVE_INFINITY;
|
|
137
164
|
this.lastScetUt = Number.NEGATIVE_INFINITY;
|
|
138
165
|
this.anchorWall = undefined;
|
|
139
166
|
this.anchorUt = undefined;
|
|
167
|
+
this.rateFrom = undefined;
|
|
140
168
|
// A scrub target from the dead pre-rewind timeline must not survive, same per-epoch hygiene as every other reset here.
|
|
141
169
|
this.scrubTarget = null;
|
|
142
170
|
}
|
|
@@ -156,8 +184,42 @@ export class ViewClock {
|
|
|
156
184
|
this.anchorWall = wallNow;
|
|
157
185
|
this.anchorUt = deliveredAt;
|
|
158
186
|
}
|
|
187
|
+
if (!replayed) this.measureRate(wallNow, deliveredAt);
|
|
159
188
|
this.lastObservedWall = wallNow;
|
|
160
189
|
if (validAt > this.maxSampleUt) this.maxSampleUt = validAt;
|
|
190
|
+
this.sampleSteps.observe(this.maxSampleUt, wallNow);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/*
|
|
194
|
+
* One live delivery's contribution to the measured game rate: the UT the
|
|
195
|
+
* game advanced over at least RATE_WINDOW_SECONDS of wall time, against the
|
|
196
|
+
* nominal rate. A change of nominal rate (a warp step, a pause) starts the
|
|
197
|
+
* span again, since a span across it measures neither rate.
|
|
198
|
+
*/
|
|
199
|
+
private measureRate(wallNow: number, deliveredAt: number): void {
|
|
200
|
+
const warp = this.nominalWarpRate();
|
|
201
|
+
const from = this.rateFrom;
|
|
202
|
+
if (
|
|
203
|
+
from === undefined ||
|
|
204
|
+
warp <= 0 ||
|
|
205
|
+
warp !== from.warp ||
|
|
206
|
+
deliveredAt < from.ut
|
|
207
|
+
) {
|
|
208
|
+
this.rateFrom = { wall: wallNow, ut: deliveredAt, warp };
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const wallSpan = wallNow - from.wall;
|
|
212
|
+
if (wallSpan < RATE_WINDOW_SECONDS) return;
|
|
213
|
+
const ratio = (deliveredAt - from.ut) / wallSpan / warp;
|
|
214
|
+
if (ratio >= MIN_RATE_RATIO && ratio <= MAX_RATE_RATIO) {
|
|
215
|
+
this.rateRatio = ratio;
|
|
216
|
+
}
|
|
217
|
+
this.rateFrom = { wall: wallNow, ut: deliveredAt, warp };
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** How often the latest sample time advances, in wall-clock seconds, or `undefined` until two advances have been seen. */
|
|
221
|
+
sampleStepSeconds(): number | undefined {
|
|
222
|
+
return this.sampleSteps.stepSeconds();
|
|
161
223
|
}
|
|
162
224
|
|
|
163
225
|
/** The client's epoch generation: bumped by `observeSample` on a rewind. Read-only mirror of `ClientTimeline.epoch`'s reset generation. */
|
|
@@ -170,8 +232,8 @@ export class ViewClock {
|
|
|
170
232
|
return this.options.delaySeconds?.() ?? 0;
|
|
171
233
|
}
|
|
172
234
|
|
|
173
|
-
/** Estimated "vessel now": a piecewise-linear UT(wall) fit, coasting
|
|
174
|
-
* the
|
|
235
|
+
/** Estimated "vessel now": a piecewise-linear UT(wall) fit, coasting
|
|
236
|
+
* between observations at the game's own measured rate. Delegates to the shared
|
|
175
237
|
* pure formula (`view-clock-formula.ts`) so a second context (the
|
|
176
238
|
* kerbcast per-frame video-delay worker) can mirror this exactly; see
|
|
177
239
|
* that module's doc. */
|
|
@@ -273,6 +335,7 @@ export class ViewClock {
|
|
|
273
335
|
* while scrubbed, where a scrub target is a past instant both lanes agree on.
|
|
274
336
|
*/
|
|
275
337
|
viewUt(lane: DelayLane = "delayed"): number {
|
|
338
|
+
this.rebaseOnDelayEpoch();
|
|
276
339
|
const live = Math.max(
|
|
277
340
|
this.lastConfirmedViewUt[lane],
|
|
278
341
|
this.confirmedEdgeUt(lane),
|
|
@@ -281,6 +344,24 @@ export class ViewClock {
|
|
|
281
344
|
return this.scrubTarget !== null ? this.scrubTarget : live;
|
|
282
345
|
}
|
|
283
346
|
|
|
347
|
+
private seenDelayEpoch: number | undefined;
|
|
348
|
+
|
|
349
|
+
/*
|
|
350
|
+
* The monotonic cursor never lets the view fall back, so a delay that grows
|
|
351
|
+
* from a stand-in zero to its measured size would hold the view for the whole
|
|
352
|
+
* of that size. The stand-in was never a lag the view had, so the cursors
|
|
353
|
+
* start again when the figure replaces it.
|
|
354
|
+
*/
|
|
355
|
+
private rebaseOnDelayEpoch(): void {
|
|
356
|
+
const epoch = this.options.delayEpoch?.();
|
|
357
|
+
if (epoch === undefined) return;
|
|
358
|
+
if (this.seenDelayEpoch !== undefined && epoch !== this.seenDelayEpoch) {
|
|
359
|
+
this.lastConfirmedViewUt.delayed = Number.NEGATIVE_INFINITY;
|
|
360
|
+
this.lastConfirmedViewUt["true-now"] = Number.NEGATIVE_INFINITY;
|
|
361
|
+
}
|
|
362
|
+
this.seenDelayEpoch = epoch;
|
|
363
|
+
}
|
|
364
|
+
|
|
284
365
|
/**
|
|
285
366
|
* The craft's present (SCET) for a frame whose delayed view time is `viewUt`:
|
|
286
367
|
* the instant every reading is reckoned to.
|
|
@@ -438,7 +519,12 @@ export class ViewClock {
|
|
|
438
519
|
return this.wallNow();
|
|
439
520
|
}
|
|
440
521
|
|
|
522
|
+
/** Game seconds per wall second as the game is actually running: the nominal rate scaled by the measured pace. */
|
|
441
523
|
private warpRate(): number {
|
|
524
|
+
return this.nominalWarpRate() * this.rateRatio;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
private nominalWarpRate(): number {
|
|
442
528
|
return this.options.warpRate?.() ?? 1;
|
|
443
529
|
}
|
|
444
530
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { UseCommandResult } from "../api/types";
|
|
2
|
+
import type { AnyCommandReply } from "../commands";
|
|
3
|
+
import { UNDECLARED_COMMAND_RAIL_TAGS } from "../rail-tags";
|
|
4
|
+
import { bindCommand, bindValue } from "../spine/bound-command";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A command handle for a test: it records what was sent, answers each send as
|
|
8
|
+
* the test says, and lets the test change any field a kit input reads.
|
|
9
|
+
* Useful for testing a widget or an input against a command without a stream to
|
|
10
|
+
* the mod. Returned by {@link createFakeCommand}.
|
|
11
|
+
*
|
|
12
|
+
* @category Test doubles
|
|
13
|
+
*/
|
|
14
|
+
export interface FakeCommand<Args = unknown, Reply = AnyCommandReply> {
|
|
15
|
+
/** The handle to give to the code under test, or to take `with` and `toArgs` from. */
|
|
16
|
+
readonly handle: UseCommandResult<Args, Reply>;
|
|
17
|
+
/** Every send so far, in order. */
|
|
18
|
+
readonly sent: { args: Args | undefined; label?: string; topic?: string }[];
|
|
19
|
+
/** Answers every held send with `reply`, and returns how many it answered. */
|
|
20
|
+
confirm(reply?: Reply): number;
|
|
21
|
+
/** Rejects every held send as the game refusing it, with the game's own words in `detail`. */
|
|
22
|
+
refuse(detail?: string): number;
|
|
23
|
+
/** Rejects every held send as having got no reply. */
|
|
24
|
+
lose(): number;
|
|
25
|
+
/** Changes fields of the handle in place, such as `status`, `gate` or `streamDown`. */
|
|
26
|
+
patch(fields: Partial<UseCommandResult<Args, Reply>>): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Options for {@link createFakeCommand}: whether a send is answered at once
|
|
31
|
+
* with `reply` or held until the test confirms, refuses or loses it.
|
|
32
|
+
*
|
|
33
|
+
* @category Test doubles
|
|
34
|
+
*/
|
|
35
|
+
export interface FakeCommandOptions<Reply = AnyCommandReply> {
|
|
36
|
+
/** `"hold"` keeps each send pending. Default `"confirm"`. */
|
|
37
|
+
answer?: "confirm" | "hold";
|
|
38
|
+
/** The reply a confirmed send resolves with. Default `{ success: true }`. */
|
|
39
|
+
reply?: Reply;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Makes a {@link FakeCommand}. Useful for testing a widget's use of a command,
|
|
44
|
+
* or a kit input given a `with` or `toArgs` of it, with no stream to the mod.
|
|
45
|
+
*
|
|
46
|
+
* @category Test doubles
|
|
47
|
+
*/
|
|
48
|
+
export function createFakeCommand<Args = unknown, Reply = AnyCommandReply>(
|
|
49
|
+
options: FakeCommandOptions<Reply> = {},
|
|
50
|
+
): FakeCommand<Args, Reply> {
|
|
51
|
+
const reply = options.reply ?? ({ success: true } as Reply);
|
|
52
|
+
const sent: FakeCommand<Args, Reply>["sent"] = [];
|
|
53
|
+
const held: { resolve(r: Reply): void; reject(e: unknown): void }[] = [];
|
|
54
|
+
const handle: UseCommandResult<Args, Reply> = {
|
|
55
|
+
dangerouslySendWithoutInput: (args, opts) => {
|
|
56
|
+
sent.push({ args, ...opts });
|
|
57
|
+
if (options.answer !== "hold") return Promise.resolve(reply);
|
|
58
|
+
return new Promise<Reply>((resolve, reject) => {
|
|
59
|
+
held.push({ resolve, reject });
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
status: { phase: "idle" },
|
|
63
|
+
inFlight: [],
|
|
64
|
+
warnings: [],
|
|
65
|
+
tags: UNDECLARED_COMMAND_RAIL_TAGS,
|
|
66
|
+
effectiveDelaySeconds: 0,
|
|
67
|
+
delayReading: null,
|
|
68
|
+
delayMode: null,
|
|
69
|
+
sendStatus: undefined,
|
|
70
|
+
dismiss: () => {},
|
|
71
|
+
railed: false,
|
|
72
|
+
refusals: [],
|
|
73
|
+
losses: [],
|
|
74
|
+
founds: [],
|
|
75
|
+
undelivered: [],
|
|
76
|
+
streamDown: false,
|
|
77
|
+
failures: [],
|
|
78
|
+
gateFor: () => handle.gate,
|
|
79
|
+
with: (args, opts) => bindCommand(handle, args, opts),
|
|
80
|
+
toArgs: (toArgs, opts) => bindValue(handle, toArgs, opts),
|
|
81
|
+
};
|
|
82
|
+
const settle = (act: (h: (typeof held)[number]) => void) => {
|
|
83
|
+
const pending = held.splice(0);
|
|
84
|
+
for (const h of pending) act(h);
|
|
85
|
+
return pending.length;
|
|
86
|
+
};
|
|
87
|
+
return {
|
|
88
|
+
handle,
|
|
89
|
+
sent,
|
|
90
|
+
confirm: (r) => settle((h) => h.resolve(r ?? reply)),
|
|
91
|
+
refuse: (detail) =>
|
|
92
|
+
settle((h) =>
|
|
93
|
+
h.reject(
|
|
94
|
+
Object.assign(new Error("refused"), {
|
|
95
|
+
code: "E_REFUSED",
|
|
96
|
+
errorCode: "wrongState",
|
|
97
|
+
detail,
|
|
98
|
+
}),
|
|
99
|
+
),
|
|
100
|
+
),
|
|
101
|
+
lose: () =>
|
|
102
|
+
settle((h) =>
|
|
103
|
+
h.reject(Object.assign(new Error("lost"), { code: "E_LOST" })),
|
|
104
|
+
),
|
|
105
|
+
patch: (fields) => {
|
|
106
|
+
Object.assign(handle, fields);
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
}
|
package/src/testing/index.ts
CHANGED
|
@@ -45,6 +45,8 @@ export {
|
|
|
45
45
|
getAugmentsForSlot,
|
|
46
46
|
} from "../api/index";
|
|
47
47
|
export { clearMapPoiProviders } from "../api/map-poi";
|
|
48
|
+
// The observation half of `registerStationBroker`, for a test asserting its Uplink registered a broker.
|
|
49
|
+
export { watchStationBrokers } from "../api/station-brokers";
|
|
48
50
|
export { clearUplinkHandles } from "../api/uplink-handles";
|
|
49
51
|
// The transport double. It named nothing above this leaf (wire messages, `Meta`,
|
|
50
52
|
// `wrapTopicPayload`), so its old home in the unpublished `@ksp-gonogo/sitrep-client`
|
|
@@ -62,7 +64,6 @@ export { clearUplinkHandles } from "../api/uplink-handles";
|
|
|
62
64
|
// freeze the store's internals as third-party API. A test is a different audience
|
|
63
65
|
// from a widget, and this subpath is where that difference is expressed.
|
|
64
66
|
export {
|
|
65
|
-
type DerivedGet,
|
|
66
67
|
mapTopic,
|
|
67
68
|
processorRuntimeFor,
|
|
68
69
|
setActiveTelemetryClientForTests,
|
|
@@ -105,6 +106,13 @@ export {
|
|
|
105
106
|
getRequestedAlarms,
|
|
106
107
|
type RecordedAlarmRequest,
|
|
107
108
|
} from "./recorded-alarm-requests";
|
|
109
|
+
// What `raiseUplinkBanner` was asked for under the real test host. The app owns
|
|
110
|
+
// the banner stack, so a test below the app asserts on the banners raised.
|
|
111
|
+
export {
|
|
112
|
+
clearRaisedBanners,
|
|
113
|
+
getRaisedBanners,
|
|
114
|
+
type RecordedUplinkBanner,
|
|
115
|
+
} from "./recorded-uplink-banners";
|
|
108
116
|
export { probeText, render, renderHook } from "./render";
|
|
109
117
|
// The stream fixture: a real `TelemetryProvider` over a real
|
|
110
118
|
// `TelemetryClient`/`TimelineStore`/`ViewClock`, fed by hand-authored emissions.
|
|
@@ -143,3 +151,6 @@ export function commandArgs<Command extends CommandId>(
|
|
|
143
151
|
): CommandArgs<Command> {
|
|
144
152
|
return args as CommandArgs<Command>;
|
|
145
153
|
}
|
|
154
|
+
|
|
155
|
+
export type { FakeCommand, FakeCommandOptions } from "./fake-command";
|
|
156
|
+
export { createFakeCommand } from "./fake-command";
|
|
@@ -29,8 +29,7 @@ const FRAME_MS = 1000 / 60;
|
|
|
29
29
|
* returns and a widget under test keeps updating (a timer, a socket reply).
|
|
30
30
|
* Call it last in a vitest setup file, after Testing Library is imported, and
|
|
31
31
|
* await it. Useful for finding the update warnings that appear after a test has
|
|
32
|
-
* finished. Used by the test setup of the app and of each
|
|
33
|
-
* client.
|
|
32
|
+
* finished. Used by the test setup of the app and of each Uplink shipped with it.
|
|
34
33
|
*
|
|
35
34
|
* @example
|
|
36
35
|
* ```ts
|
|
@@ -3,11 +3,8 @@
|
|
|
3
3
|
* widget renders in a jsdom test: a `ResizeObserver` that does nothing, a
|
|
4
4
|
* canvas `getContext` that returns `null` (so a widget takes its no-canvas
|
|
5
5
|
* path), a `HTMLMediaElement.play` that resolves, a `matchMedia` that never
|
|
6
|
-
* matches, a `WebSocket` that connects to nothing
|
|
7
|
-
*
|
|
8
|
-
* through. The `/ice-config` path is the one the app asks its relay for
|
|
9
|
-
* peer-connection settings on; the 503 makes it carry on without them. Safe to
|
|
10
|
-
* call more than once. Call it from a test setup file. Useful for testing how a
|
|
6
|
+
* matches, and a `WebSocket` that connects to nothing. Safe to call more than
|
|
7
|
+
* once. Call it from a test setup file. Useful for testing how a
|
|
11
8
|
* widget mounts, as the operator sees it, in a jsdom test. Used by the test setup of the app and of each bundled Uplink's client.
|
|
12
9
|
*
|
|
13
10
|
* @example
|
|
@@ -76,39 +73,6 @@ export function installDomStubs(): void {
|
|
|
76
73
|
dispatchEvent: () => false,
|
|
77
74
|
}) as MediaQueryList;
|
|
78
75
|
}
|
|
79
|
-
|
|
80
|
-
// Same problem with `fetch`: PeerHostService now fetches /ice-config
|
|
81
|
-
// from the relay on start(). Tests run with no relay listening, so an
|
|
82
|
-
// un-mocked fetch hangs until the abort timeout, slowing every host
|
|
83
|
-
// test by 4 seconds. A 503-returning stub closes the loop instantly
|
|
84
|
-
// and gives the host the same "no TURN, run direct/STUN-only"
|
|
85
|
-
// fallback it'd take if the relay were genuinely unreachable.
|
|
86
|
-
installRelayFetchStub();
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function installRelayFetchStub(): void {
|
|
90
|
-
if (typeof globalThis === "undefined") return;
|
|
91
|
-
const original = (globalThis as { fetch?: typeof fetch }).fetch;
|
|
92
|
-
// Wrap whatever's there; install a stand-in that returns 503 if no
|
|
93
|
-
// `fetch` exists at all. Either way `/ice-config` resolves
|
|
94
|
-
// synchronously-fast so PeerHostService.start() doesn't hang under
|
|
95
|
-
// tests on the abort-timeout path.
|
|
96
|
-
(globalThis as { fetch: typeof fetch }).fetch = (async (
|
|
97
|
-
input: Parameters<typeof fetch>[0],
|
|
98
|
-
init: Parameters<typeof fetch>[1],
|
|
99
|
-
) => {
|
|
100
|
-
const url = typeof input === "string" ? input : (input as Request).url;
|
|
101
|
-
if (url.endsWith("/ice-config")) {
|
|
102
|
-
return new Response(JSON.stringify({ error: "test stub" }), {
|
|
103
|
-
status: 503,
|
|
104
|
-
headers: { "content-type": "application/json" },
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
if (!original) {
|
|
108
|
-
throw new Error(`no fetch available for ${url}`);
|
|
109
|
-
}
|
|
110
|
-
return original(input as RequestInfo, init);
|
|
111
|
-
}) as typeof fetch;
|
|
112
76
|
}
|
|
113
77
|
|
|
114
78
|
function installNoopWebSocket(): void {
|
|
@@ -25,14 +25,20 @@ import { useActionInput } from "../spine/use-action-input";
|
|
|
25
25
|
import { useCommand } from "../spine/use-command";
|
|
26
26
|
import { useDataSources } from "../spine/use-data-sources";
|
|
27
27
|
import { useLateTelemetrySubscribe } from "../spine/use-late-telemetry-subscribe";
|
|
28
|
+
import { useObservedVantage } from "../spine/use-observed-vantage";
|
|
28
29
|
import { useProcessor } from "../spine/use-processor";
|
|
29
30
|
import { useRouteCommands } from "../spine/use-route-commands";
|
|
30
31
|
import { useLatestValue, useStream } from "../spine/use-stream";
|
|
31
32
|
import { useStreamEvent } from "../spine/use-stream-event";
|
|
32
33
|
import { useTelemetry } from "../spine/use-telemetry";
|
|
34
|
+
import { useTopicClock } from "../spine/use-topic-clock";
|
|
33
35
|
import { consoleLogger } from "./console-logger";
|
|
34
36
|
import { installTestHost } from "./install-test-host";
|
|
35
37
|
import { recordAlarmRequest } from "./recorded-alarm-requests";
|
|
38
|
+
import {
|
|
39
|
+
recordClearedBanner,
|
|
40
|
+
recordRaisedBanner,
|
|
41
|
+
} from "./recorded-uplink-banners";
|
|
36
42
|
|
|
37
43
|
/**
|
|
38
44
|
* The four parts of a test host that come from `@ksp-gonogo/ui-kit`, which
|
|
@@ -112,12 +118,6 @@ export function installRealTestHost(uiKit: UiKitHostPieces): () => void {
|
|
|
112
118
|
// An Uplink's own test run has no peer client, so a call goes straight to
|
|
113
119
|
// the handle, which is what the main screen does too. The station's relayed
|
|
114
120
|
// route is the app's to supply.
|
|
115
|
-
// An Uplink's own test run has no host broadcasting credentials, and the
|
|
116
|
-
// honest answer there is none rather than a fabricated server.
|
|
117
|
-
useHostIceServers: () => ({
|
|
118
|
-
current: () => [],
|
|
119
|
-
onChange: () => () => {},
|
|
120
|
-
}),
|
|
121
121
|
useUplinkRelay: (uplinkId) => (method, args) => {
|
|
122
122
|
const handle = getUplinkHandle<{
|
|
123
123
|
relay?: (method: string, args: unknown) => Promise<unknown>;
|
|
@@ -139,6 +139,8 @@ export function installRealTestHost(uiKit: UiKitHostPieces): () => void {
|
|
|
139
139
|
useViewClock: () => useViewClock(),
|
|
140
140
|
// Records rather than creates: see `./recorded-alarm-requests.ts`.
|
|
141
141
|
useAlarmRequest: (owner) => recordAlarmRequest(owner),
|
|
142
|
+
raiseUplinkBanner: recordRaisedBanner,
|
|
143
|
+
clearUplinkBanner: recordClearedBanner,
|
|
142
144
|
useActionInput: (handlers) =>
|
|
143
145
|
useActionInput(handlers as Parameters<typeof useActionInput>[0]),
|
|
144
146
|
useDataSources: () => useDataSources(),
|
|
@@ -152,6 +154,8 @@ export function installRealTestHost(uiKit: UiKitHostPieces): () => void {
|
|
|
152
154
|
useUtNow: () => useUtNow(),
|
|
153
155
|
useTelemetryStoreOptional: () => useTelemetryStoreOptional(),
|
|
154
156
|
useViewClockOptional: () => useViewClockOptional(),
|
|
157
|
+
useTopicClock: (topic) => useTopicClock(topic),
|
|
158
|
+
useObservedVantage: () => useObservedVantage(),
|
|
155
159
|
getActiveTelemetryClient: () =>
|
|
156
160
|
getActiveTelemetryClient() as ReturnType<
|
|
157
161
|
GonogoHost["getActiveTelemetryClient"]
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { UplinkClientHandle } from "../api/types";
|
|
2
|
+
import type { UplinkBanner } from "../api/uplink-banner";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A banner an Uplink raised through `raiseUplinkBanner` under a test host,
|
|
6
|
+
* with the id of the Uplink that raised it. Read them with
|
|
7
|
+
* {@link getRaisedBanners}. Useful for testing that a condition in an Uplink's
|
|
8
|
+
* client raises the banner the operator should see.
|
|
9
|
+
*
|
|
10
|
+
* @category Test doubles
|
|
11
|
+
*/
|
|
12
|
+
export interface RecordedUplinkBanner extends UplinkBanner {
|
|
13
|
+
/** The id of the Uplink client handle passed to `raiseUplinkBanner`. */
|
|
14
|
+
uplinkId: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const raised = new Map<string, RecordedUplinkBanner>();
|
|
18
|
+
|
|
19
|
+
const keyOf = (uplinkId: string, id: string) => `${uplinkId}\u0000${id}`;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The banners raised and not cleared since the last reset, in the order they
|
|
23
|
+
* were first raised. Raising an id again replaces its entry, as the app does,
|
|
24
|
+
* and the app's limits and the operator's dismissal are not applied. Useful for
|
|
25
|
+
* testing that an Uplink raises a banner when a condition starts and clears it
|
|
26
|
+
* when the condition ends.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { clearRaisedBanners, getRaisedBanners } from "@ksp-gonogo/sitrep-sdk/testing";
|
|
31
|
+
* import { afterEach, expect, it } from "vitest";
|
|
32
|
+
*
|
|
33
|
+
* afterEach(clearRaisedBanners);
|
|
34
|
+
*
|
|
35
|
+
* it("raises one banner", () => {
|
|
36
|
+
* // ...make the condition happen, then:
|
|
37
|
+
* expect(getRaisedBanners().map((b) => b.id)).toEqual(["link-lost"]);
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @category Test doubles
|
|
42
|
+
*/
|
|
43
|
+
export function getRaisedBanners(): readonly RecordedUplinkBanner[] {
|
|
44
|
+
return [...raised.values()];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Forgets every recorded banner. Call it between tests. Useful for starting
|
|
49
|
+
* each test of an Uplink's banners with none raised.
|
|
50
|
+
*
|
|
51
|
+
* @category Test doubles
|
|
52
|
+
*/
|
|
53
|
+
export function clearRaisedBanners(): void {
|
|
54
|
+
raised.clear();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** The `raiseUplinkBanner` member `installRealTestHost` wires. */
|
|
58
|
+
export function recordRaisedBanner(
|
|
59
|
+
owner: UplinkClientHandle,
|
|
60
|
+
banner: UplinkBanner,
|
|
61
|
+
): void {
|
|
62
|
+
raised.set(keyOf(owner.id, banner.id), { ...banner, uplinkId: owner.id });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** The `clearUplinkBanner` member `installRealTestHost` wires. */
|
|
66
|
+
export function recordClearedBanner(
|
|
67
|
+
owner: UplinkClientHandle,
|
|
68
|
+
id: string,
|
|
69
|
+
): void {
|
|
70
|
+
raised.delete(keyOf(owner.id, id));
|
|
71
|
+
}
|
package/src/testing/render.tsx
CHANGED
|
@@ -38,9 +38,10 @@ function withTheme(Extra?: Wrapper): Wrapper {
|
|
|
38
38
|
* {@link installDomStubs} to have run. Any test runner works; the example uses
|
|
39
39
|
* vitest, installed with `npm install -D vitest jsdom` and set to
|
|
40
40
|
* `environment: "jsdom"` in its config.
|
|
41
|
-
* Its options and result are Testing Library's
|
|
42
|
-
*
|
|
43
|
-
*
|
|
41
|
+
* Its options and result are the ones Testing Library's `render` takes and
|
|
42
|
+
* returns, with its default queries, which the signature shows as `queries`.
|
|
43
|
+
* The kit's theme here is the small stand-in {@link harnessTheme}, so this
|
|
44
|
+
* package does not depend on the kit. Useful for testing what an operator sees of a ui-kit
|
|
44
45
|
* component or a widget.
|
|
45
46
|
*
|
|
46
47
|
* @example
|
|
@@ -112,6 +113,18 @@ export function renderHook<Result, Props>(
|
|
|
112
113
|
* for what a reader sees. Useful for testing that a value reached a widget,
|
|
113
114
|
* such as a reading the operator is shown.
|
|
114
115
|
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```tsx
|
|
118
|
+
* import { probeText } from "@ksp-gonogo/sitrep-sdk/testing";
|
|
119
|
+
* import { useTelemetry } from "@ksp-gonogo/sitrep-sdk";
|
|
120
|
+
*
|
|
121
|
+
* function Probe() {
|
|
122
|
+
* const reading = useTelemetry("vessel.flight");
|
|
123
|
+
* const altitude = reading.state === "observed" ? reading.value.altitudeAsl : undefined;
|
|
124
|
+
* return <p>{probeText(altitude)}</p>;
|
|
125
|
+
* }
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
115
128
|
* @category Rendering
|
|
116
129
|
*/
|
|
117
130
|
export function probeText(v: unknown): string {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { JSX, ReactNode } from "react";
|
|
2
2
|
import type { Meta } from "../__generated__/contract";
|
|
3
3
|
import {
|
|
4
|
+
CORE_PUBLISHED_PROCESSORS,
|
|
4
5
|
DYNAMIC_WHOLE_TOPIC_PREFIXES,
|
|
5
|
-
PRODUCTION_DERIVED_CHANNELS,
|
|
6
6
|
TelemetryClient,
|
|
7
7
|
TelemetryProvider,
|
|
8
8
|
TimelineStore,
|
|
@@ -103,8 +103,8 @@ export function setupStreamFixture(
|
|
|
103
103
|
// of the other four got `undefined` from a store the app would have answered
|
|
104
104
|
// from, and the test agreed with itself. Registering the same list the provider
|
|
105
105
|
// registers is the only version of this that stays true as the list grows.
|
|
106
|
-
for (const
|
|
107
|
-
store.
|
|
106
|
+
for (const processor of CORE_PUBLISHED_PROCESSORS) {
|
|
107
|
+
store.publishProcessor(processor);
|
|
108
108
|
}
|
|
109
109
|
if (opts.pinnedUt !== undefined) clock.scrubTo(opts.pinnedUt);
|
|
110
110
|
|
|
@@ -91,6 +91,12 @@ export interface SentCommand {
|
|
|
91
91
|
topic: string;
|
|
92
92
|
/** Per-call vantage override, `""` when the dispatch omitted it. */
|
|
93
93
|
vantage: string;
|
|
94
|
+
/** The run of the mod the sender last heard from. */
|
|
95
|
+
seenBootId: string;
|
|
96
|
+
/** The timeline epoch the sender last received. */
|
|
97
|
+
seenEpoch: number;
|
|
98
|
+
/** The vessel the sender showed as active, absent when it stated none. */
|
|
99
|
+
seenVesselId?: string;
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
/**
|
|
@@ -167,6 +173,9 @@ export class StubTransport implements Transport {
|
|
|
167
173
|
label: message.label,
|
|
168
174
|
topic: message.topic,
|
|
169
175
|
vantage: message.vantage ?? "",
|
|
176
|
+
seenBootId: message.seenBootId,
|
|
177
|
+
seenEpoch: message.seenEpoch,
|
|
178
|
+
...(message.seenVesselId ? { seenVesselId: message.seenVesselId } : {}),
|
|
170
179
|
});
|
|
171
180
|
// Answer on a later microtask, not inline within this `send()` call.
|
|
172
181
|
// Even at zero simulated latency, a command response must not
|