@ksp-gonogo/sitrep-sdk 1.0.0-rc.47 → 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/dist/__generated__/contract.d.ts +232 -79
- package/dist/__generated__/contract.d.ts.map +1 -1
- package/dist/__generated__/contract.js.map +1 -1
- package/dist/__generated__/delay-roles.d.ts +1 -1
- package/dist/__generated__/delay-roles.d.ts.map +1 -1
- package/dist/__generated__/delay-roles.js +2 -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__/sample-kinds.d.ts +3 -1
- package/dist/__generated__/sample-kinds.d.ts.map +1 -1
- package/dist/__generated__/sample-kinds.js +3 -1
- package/dist/__generated__/sample-kinds.js.map +1 -1
- package/dist/__generated__/topic-map.d.ts +15 -11
- package/dist/__generated__/topic-map.d.ts.map +1 -1
- package/dist/__generated__/topic-map.js +3 -1
- package/dist/__generated__/topic-map.js.map +1 -1
- package/dist/__generated__/units.d.ts +2 -0
- package/dist/__generated__/units.d.ts.map +1 -1
- package/dist/__generated__/units.js +66 -35
- package/dist/__generated__/units.js.map +1 -1
- package/dist/api/contribution-slots.d.ts +28 -30
- 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/index.d.ts +9 -7
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +7 -5
- 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/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/slots.d.ts +37 -37
- package/dist/api/slots.d.ts.map +1 -1
- package/dist/api/station-brokers.d.ts +12 -10
- package/dist/api/station-brokers.d.ts.map +1 -1
- package/dist/api/station-brokers.js +12 -10
- 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/types.d.ts +26 -21
- package/dist/api/types.d.ts.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/compat-versions.d.ts +1 -1
- package/dist/compat-versions.js +3 -3
- package/dist/contract-enum-names.d.ts +2 -2
- package/dist/contract-enum-names.js +2 -2
- package/dist/delay-roles.d.ts +6 -0
- package/dist/delay-roles.d.ts.map +1 -1
- package/dist/delay-roles.js +1 -0
- package/dist/delay-roles.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/ksp-enum-names.d.ts +4 -3
- package/dist/ksp-enum-names.d.ts.map +1 -1
- package/dist/ksp-enum-names.js +4 -3
- 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/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/perf/PerfBudget.d.ts +2 -2
- package/dist/perf/PerfBudget.js +2 -2
- 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 +28 -0
- package/dist/spine/capability-lock.d.ts +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/centre-commands.d.ts +4 -0
- package/dist/spine/centre-commands.d.ts.map +1 -1
- package/dist/spine/centre-commands.js +13 -1
- package/dist/spine/centre-commands.js.map +1 -1
- package/dist/spine/client-timeline.d.ts +21 -4
- package/dist/spine/client-timeline.d.ts.map +1 -1
- package/dist/spine/client-timeline.js +69 -7
- package/dist/spine/client-timeline.js.map +1 -1
- package/dist/spine/client.d.ts +4 -0
- package/dist/spine/client.d.ts.map +1 -1
- package/dist/spine/client.js +59 -4
- package/dist/spine/client.js.map +1 -1
- package/dist/spine/command-gate.d.ts +1 -1
- package/dist/spine/command-gate.d.ts.map +1 -1
- package/dist/spine/command-gate.js +2 -1
- package/dist/spine/command-gate.js.map +1 -1
- package/dist/spine/command-outcomes.d.ts +13 -0
- package/dist/spine/command-outcomes.d.ts.map +1 -1
- package/dist/spine/command-outcomes.js +58 -1
- package/dist/spine/command-outcomes.js.map +1 -1
- package/dist/spine/context.d.ts +19 -1
- package/dist/spine/context.d.ts.map +1 -1
- package/dist/spine/context.js +26 -0
- package/dist/spine/context.js.map +1 -1
- package/dist/spine/core-reckoners.d.ts.map +1 -1
- package/dist/spine/core-reckoners.js +1 -34
- package/dist/spine/core-reckoners.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/index.d.ts +1 -0
- package/dist/spine/index.d.ts.map +1 -1
- package/dist/spine/index.js +1 -0
- package/dist/spine/index.js.map +1 -1
- package/dist/spine/lock-scope.d.ts +2 -2
- package/dist/spine/processors.d.ts +1 -1
- package/dist/spine/processors.d.ts.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 +4 -4
- package/dist/spine/slot-ids.js.map +1 -1
- package/dist/spine/timeline-store.d.ts +103 -5
- package/dist/spine/timeline-store.d.ts.map +1 -1
- package/dist/spine/timeline-store.js +392 -21
- package/dist/spine/timeline-store.js.map +1 -1
- package/dist/spine/uplink-clients.d.ts +1 -1
- package/dist/spine/uplink-clients.d.ts.map +1 -1
- package/dist/spine/uplink-health.d.ts +15 -4
- package/dist/spine/uplink-health.d.ts.map +1 -1
- package/dist/spine/uplink-health.js +4 -1
- 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 +51 -3
- package/dist/spine/use-command.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/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/topics.d.ts +10 -11
- package/dist/topics.d.ts.map +1 -1
- package/dist/topics.js +9 -10
- package/dist/topics.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-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/package.json +1 -1
- package/src/__generated__/contract.ts +230 -76
- package/src/__generated__/delay-roles.ts +2 -0
- package/src/__generated__/error-codes.ts +13 -13
- package/src/__generated__/sample-kinds.ts +3 -1
- package/src/__generated__/topic-map.ts +19 -11
- package/src/__generated__/units.json +66 -35
- package/src/__generated__/units.ts +66 -35
- package/src/api/contribution-slots.ts +32 -34
- package/src/api/error-codes.ts +3 -2
- package/src/api/index.ts +15 -13
- package/src/api/logger-contract.ts +2 -1
- package/src/api/logger.ts +6 -3
- package/src/api/plot-layers.ts +1 -1
- package/src/api/registry.ts +4 -2
- package/src/api/slots.ts +37 -37
- package/src/api/station-brokers.ts +12 -10
- package/src/api/tiny-size.ts +2 -1
- package/src/api/tone.ts +1 -1
- package/src/api/types.ts +26 -21
- package/src/binary-frame.ts +4 -4
- package/src/combine-readings.ts +4 -3
- package/src/compat-versions.ts +3 -3
- package/src/contract-enum-names.ts +2 -2
- package/src/delay-roles.ts +7 -0
- package/src/index.ts +1 -1
- package/src/ksp-enum-names.ts +4 -3
- package/src/locked.ts +1 -1
- package/src/media/radio-support.ts +8 -7
- package/src/perf/PerfBudget.ts +2 -2
- package/src/raw-field-split.ts +1 -1
- package/src/reading.ts +6 -6
- 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/capability-lock.ts +1 -1
- package/src/spine/catalog-fallback.ts +152 -0
- package/src/spine/centre-commands.ts +25 -1
- package/src/spine/client-timeline.ts +73 -7
- package/src/spine/client.ts +74 -4
- package/src/spine/command-gate.ts +3 -2
- package/src/spine/command-outcomes.ts +62 -1
- package/src/spine/context.tsx +35 -2
- package/src/spine/core-reckoners.ts +1 -40
- package/src/spine/delay-estimate.ts +88 -0
- package/src/spine/index.ts +1 -0
- package/src/spine/lock-scope.ts +2 -2
- package/src/spine/processors.ts +1 -1
- package/src/spine/slot-ids.ts +4 -4
- package/src/spine/timeline-store.ts +461 -18
- package/src/spine/uplink-clients.ts +1 -1
- package/src/spine/uplink-health.ts +16 -3
- package/src/spine/use-command.ts +67 -2
- package/src/testing/install-act-gate-stretch.ts +1 -2
- package/src/testing/render.tsx +16 -3
- package/src/topics.ts +9 -10
- package/src/uplink-externals.ts +17 -7
- package/src/uplink-manifest.ts +8 -3
package/dist/perf/PerfBudget.js
CHANGED
|
@@ -27,7 +27,7 @@ const PERF_BUDGET_REGISTRY_KEY = "__GONOGO_PERF_BUDGETS__";
|
|
|
27
27
|
* on the page.
|
|
28
28
|
*
|
|
29
29
|
* Make one at module scope beside the code it measures and call `record()` on
|
|
30
|
-
* each event.
|
|
30
|
+
* each event. The three
|
|
31
31
|
* static members are called on the class: `PerfBudget.getAll()`,
|
|
32
32
|
* `PerfBudget.clearRegistry()` and `PerfBudget.installTestGate()`.
|
|
33
33
|
*
|
|
@@ -181,7 +181,7 @@ export class PerfBudget {
|
|
|
181
181
|
* Makes every test fail that pushes a budget over its threshold. Each test
|
|
182
182
|
* notes every budget's exceedance count before it runs, and fails afterwards
|
|
183
183
|
* if any count rose. Call it once from a test setup file (`setupFiles` in a
|
|
184
|
-
* Vitest config) so it applies to every test.
|
|
184
|
+
* Vitest config, or your test runner's equivalent) so it applies to every test.
|
|
185
185
|
*
|
|
186
186
|
* It checks the budgets registered in the page the tests run in, which is
|
|
187
187
|
* every budget made with `new PerfBudget` or `createPerfBudget` there, an
|
|
@@ -15,7 +15,7 @@ export interface RawFieldSubtopic {
|
|
|
15
15
|
* Splits a dotted key into a Topic and the field path under it, or returns
|
|
16
16
|
* `undefined` when the key is a whole Topic. Useful for reading one field of a
|
|
17
17
|
* Topic, such as in a saved graph that names a field by its dotted key. Used by
|
|
18
|
-
* the graph widget's saved configuration and the
|
|
18
|
+
* the graph widget's saved configuration and the app's field catalogue.
|
|
19
19
|
*
|
|
20
20
|
* The Topic is the longest known Topic id the key starts with, counting ids
|
|
21
21
|
* an Uplink has registered, so `"alarm.scet.fired.firedAtUt"` splits into
|
package/dist/raw-field-split.js
CHANGED
|
@@ -7,7 +7,7 @@ const isKnownTopicId = (id) => KNOWN_TOPIC_IDS.has(id) || isRuntimeRegisteredTop
|
|
|
7
7
|
* Splits a dotted key into a Topic and the field path under it, or returns
|
|
8
8
|
* `undefined` when the key is a whole Topic. Useful for reading one field of a
|
|
9
9
|
* Topic, such as in a saved graph that names a field by its dotted key. Used by
|
|
10
|
-
* the graph widget's saved configuration and the
|
|
10
|
+
* the graph widget's saved configuration and the app's field catalogue.
|
|
11
11
|
*
|
|
12
12
|
* The Topic is the longest known Topic id the key starts with, counting ids
|
|
13
13
|
* an Uplink has registered, so `"alarm.scet.fired.firedAtUt"` splits into
|
package/dist/reading.d.ts
CHANGED
|
@@ -623,7 +623,7 @@ export type ReadingReckoning = Reckoning<unknown>["status"];
|
|
|
623
623
|
* Use it for a readout that shows the last observed number, marked as held
|
|
624
624
|
* when it is, and never a modelled one. Never use it for anything that draws a
|
|
625
625
|
* position or an attitude: a marker placed at a last-known value claims to
|
|
626
|
-
* know where the vessel is now. Used by the
|
|
626
|
+
* know where the vessel is now. Used by the vessel schematic and the target picker.
|
|
627
627
|
*
|
|
628
628
|
* @category Reading telemetry
|
|
629
629
|
*/
|
|
@@ -723,14 +723,14 @@ export declare function deriveReading<Payload, Derived>(source: TopicCurrency<Pa
|
|
|
723
723
|
* runs on the observed value and on the modelled value alike. Where `pick`
|
|
724
724
|
* returns `undefined` for the modelled value, the result has no model. Useful
|
|
725
725
|
* for showing one figure of a reading with its age and model. Used by the
|
|
726
|
-
* maneuver planner
|
|
726
|
+
* maneuver planner.
|
|
727
727
|
*
|
|
728
728
|
* @category Reading telemetry
|
|
729
729
|
*/
|
|
730
730
|
export declare function pickReading<Payload, Picked>(reading: Reading<Payload>, pick: (value: Payload) => Picked | undefined): Reading<Picked>;
|
|
731
731
|
/**
|
|
732
732
|
* Returns the {@link Reckoning} of one field of a Topic, taken from the Topic's
|
|
733
|
-
* own model: the modelled value at `path`, the
|
|
733
|
+
* own model: the modelled value at `path`, the {@link ReckoningBasis} that moved it, and the
|
|
734
734
|
* band the model gives at exactly that path.
|
|
735
735
|
*
|
|
736
736
|
* `path` is dotted from the payload root, such as `"verticalSpeed"`. A path the
|
|
@@ -1013,9 +1013,9 @@ export interface ReckonerFrame<Payload = unknown> {
|
|
|
1013
1013
|
readonly history: readonly TimelinePoint<Payload>[];
|
|
1014
1014
|
}
|
|
1015
1015
|
/**
|
|
1016
|
-
* Returns whether a reckoner is asked
|
|
1017
|
-
* received at
|
|
1018
|
-
* the value across. Under signal delay it is `false`: a live observation is
|
|
1016
|
+
* Returns whether a reckoner is asked about the instant its observation was
|
|
1017
|
+
* received at and the observation is still live, meaning there is no gap to
|
|
1018
|
+
* carry the value across. Under signal delay it is `false`: a live observation is
|
|
1019
1019
|
* still the signal delay behind the vessel. Useful for a model deciding whether
|
|
1020
1020
|
* there is any delay to carry a value across. Used by the built-in atmospheric
|
|
1021
1021
|
* and core models.
|
package/dist/reading.js
CHANGED
|
@@ -184,7 +184,7 @@ function derivedReckoning(value, reckoning, reckoned) {
|
|
|
184
184
|
* runs on the observed value and on the modelled value alike. Where `pick`
|
|
185
185
|
* returns `undefined` for the modelled value, the result has no model. Useful
|
|
186
186
|
* for showing one figure of a reading with its age and model. Used by the
|
|
187
|
-
* maneuver planner
|
|
187
|
+
* maneuver planner.
|
|
188
188
|
*
|
|
189
189
|
* @category Reading telemetry
|
|
190
190
|
*/
|
|
@@ -244,7 +244,7 @@ function walkField(payload, path) {
|
|
|
244
244
|
}
|
|
245
245
|
/**
|
|
246
246
|
* Returns the {@link Reckoning} of one field of a Topic, taken from the Topic's
|
|
247
|
-
* own model: the modelled value at `path`, the
|
|
247
|
+
* own model: the modelled value at `path`, the {@link ReckoningBasis} that moved it, and the
|
|
248
248
|
* band the model gives at exactly that path.
|
|
249
249
|
*
|
|
250
250
|
* `path` is dotted from the payload root, such as `"verticalSpeed"`. A path the
|
|
@@ -532,9 +532,9 @@ export function observedAt(reading) {
|
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
/**
|
|
535
|
-
* Returns whether a reckoner is asked
|
|
536
|
-
* received at
|
|
537
|
-
* the value across. Under signal delay it is `false`: a live observation is
|
|
535
|
+
* Returns whether a reckoner is asked about the instant its observation was
|
|
536
|
+
* received at and the observation is still live, meaning there is no gap to
|
|
537
|
+
* carry the value across. Under signal delay it is `false`: a live observation is
|
|
538
538
|
* still the signal delay behind the vessel. Useful for a model deciding whether
|
|
539
539
|
* there is any delay to carry a value across. Used by the built-in atmospheric
|
|
540
540
|
* and core models.
|
package/dist/reads-index.json
CHANGED
|
@@ -1169,6 +1169,13 @@
|
|
|
1169
1169
|
"arguments": [],
|
|
1170
1170
|
"unresolved": []
|
|
1171
1171
|
},
|
|
1172
|
+
"estimateOneWayDelaySeconds": {
|
|
1173
|
+
"reads": [],
|
|
1174
|
+
"families": [],
|
|
1175
|
+
"commands": [],
|
|
1176
|
+
"arguments": [],
|
|
1177
|
+
"unresolved": []
|
|
1178
|
+
},
|
|
1172
1179
|
"expectedAtCraft": {
|
|
1173
1180
|
"reads": [],
|
|
1174
1181
|
"families": [],
|
|
@@ -1463,6 +1470,13 @@
|
|
|
1463
1470
|
"arguments": [],
|
|
1464
1471
|
"unresolved": []
|
|
1465
1472
|
},
|
|
1473
|
+
"getGameUtNow": {
|
|
1474
|
+
"reads": [],
|
|
1475
|
+
"families": [],
|
|
1476
|
+
"commands": [],
|
|
1477
|
+
"arguments": [],
|
|
1478
|
+
"unresolved": []
|
|
1479
|
+
},
|
|
1466
1480
|
"getImagingWindow": {
|
|
1467
1481
|
"reads": [],
|
|
1468
1482
|
"families": [],
|
|
@@ -1722,6 +1736,13 @@
|
|
|
1722
1736
|
"arguments": [],
|
|
1723
1737
|
"unresolved": []
|
|
1724
1738
|
},
|
|
1739
|
+
"hasActiveCraftReadingArrived": {
|
|
1740
|
+
"reads": [],
|
|
1741
|
+
"families": [],
|
|
1742
|
+
"commands": [],
|
|
1743
|
+
"arguments": [],
|
|
1744
|
+
"unresolved": []
|
|
1745
|
+
},
|
|
1725
1746
|
"hasAnswered": {
|
|
1726
1747
|
"reads": [],
|
|
1727
1748
|
"families": [],
|
|
@@ -2142,6 +2163,13 @@
|
|
|
2142
2163
|
"arguments": [],
|
|
2143
2164
|
"unresolved": []
|
|
2144
2165
|
},
|
|
2166
|
+
"lightSecondsPerMetre": {
|
|
2167
|
+
"reads": [],
|
|
2168
|
+
"families": [],
|
|
2169
|
+
"commands": [],
|
|
2170
|
+
"arguments": [],
|
|
2171
|
+
"unresolved": []
|
|
2172
|
+
},
|
|
2145
2173
|
"loadedCoastEvidence": {
|
|
2146
2174
|
"reads": [],
|
|
2147
2175
|
"families": [],
|
|
@@ -3,7 +3,7 @@ import { type Capability, type LockScopeRegistry } from "./lock-scope.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Why a capability is locked: the unlocks it is missing, and a sentence from
|
|
5
5
|
* the mod saying why, for when it named none. Useful for telling the operator
|
|
6
|
-
* what the save has not unlocked yet. Used by the ui-kit
|
|
6
|
+
* what the save has not unlocked yet. Used by `LockScope` in the ui-kit, which
|
|
7
7
|
* shows one lock message for a group of controls.
|
|
8
8
|
*
|
|
9
9
|
* @category Readings
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SystemBodies, TrackingStationCatalog, VesselIdentity, VesselOrbit } from "../__generated__/contract.js";
|
|
2
|
+
import type { TimelinePoint } from "../timeline.js";
|
|
3
|
+
import type { CommsPeerOrbit } from "./comms-path-geometry.js";
|
|
4
|
+
/**
|
|
5
|
+
* What the command centre's catalog says about the craft the game names as
|
|
6
|
+
* active, shaped as that craft's own `vessel.orbit` and `vessel.identity`.
|
|
7
|
+
*
|
|
8
|
+
* The catalog is the centre's record of every craft it tracks, heard or sighted,
|
|
9
|
+
* link or none, so it holds an orbit for a craft whose own telemetry has not
|
|
10
|
+
* arrived. Stock keeps an unloaded craft on rails, so the elements are an exact
|
|
11
|
+
* conic. A point built from them stands in until the craft's own sample
|
|
12
|
+
* arrives, and is only ever read through the orbit model, which marks every
|
|
13
|
+
* figure it carries forward as modelled.
|
|
14
|
+
*/
|
|
15
|
+
/** The topics a fallback is built from, besides the active vessel's id. */
|
|
16
|
+
export declare const CATALOG_FALLBACK_INPUTS: readonly ["trackingStation.catalog", "trackingStation.bodies"];
|
|
17
|
+
/** The topics a fallback can stand in for. */
|
|
18
|
+
export declare const CATALOG_FALLBACK_TOPICS: string[];
|
|
19
|
+
export declare function catalogOrbitPoint(catalog: TimelinePoint<TrackingStationCatalog> | undefined, bodies: TimelinePoint<SystemBodies> | undefined, vesselId: string): TimelinePoint<VesselOrbit> | undefined;
|
|
20
|
+
export declare function catalogIdentityPoint(catalog: TimelinePoint<TrackingStationCatalog> | undefined, vesselId: string): TimelinePoint<VesselIdentity> | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* The orbit the command centre's catalog records for the relay `vesselId`,
|
|
23
|
+
* with the gravitational parameter of the body it orbits, or `undefined` when
|
|
24
|
+
* the entry, any element the solve needs, or that body's parameter is unread.
|
|
25
|
+
* An unread element is never filled with a zero.
|
|
26
|
+
*/
|
|
27
|
+
export declare function catalogRelayOrbit(catalog: TrackingStationCatalog | null | undefined, bodies: SystemBodies | null | undefined, vesselId: string): CommsPeerOrbit | undefined;
|
|
28
|
+
//# sourceMappingURL=catalog-fallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-fallback.d.ts","sourceRoot":"","sources":["../../src/spine/catalog-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,YAAY,EACZ,sBAAsB,EACtB,cAAc,EACd,WAAW,EACZ,MAAM,2BAA2B,CAAC;AAMnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;;;;GAUG;AAEH,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,gEAG1B,CAAC;AAEX,8CAA8C;AAC9C,eAAO,MAAM,uBAAuB,UAAsC,CAAC;AAE3E,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,aAAa,CAAC,sBAAsB,CAAC,GAAG,SAAS,EAC1D,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,SAAS,EAC/C,QAAQ,EAAE,MAAM,GACf,aAAa,CAAC,WAAW,CAAC,GAAG,SAAS,CAgDxC;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,aAAa,CAAC,sBAAsB,CAAC,GAAG,SAAS,EAC1D,QAAQ,EAAE,MAAM,GACf,aAAa,CAAC,cAAc,CAAC,GAAG,SAAS,CAkB3C;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,sBAAsB,GAAG,IAAI,GAAG,SAAS,EAClD,MAAM,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,EACvC,QAAQ,EAAE,MAAM,GACf,cAAc,GAAG,SAAS,CA4B5B"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { PropagationHorizonKind, Quality, TrajectoryKind, } from "../__generated__/contract.js";
|
|
2
|
+
/**
|
|
3
|
+
* What the command centre's catalog says about the craft the game names as
|
|
4
|
+
* active, shaped as that craft's own `vessel.orbit` and `vessel.identity`.
|
|
5
|
+
*
|
|
6
|
+
* The catalog is the centre's record of every craft it tracks, heard or sighted,
|
|
7
|
+
* link or none, so it holds an orbit for a craft whose own telemetry has not
|
|
8
|
+
* arrived. Stock keeps an unloaded craft on rails, so the elements are an exact
|
|
9
|
+
* conic. A point built from them stands in until the craft's own sample
|
|
10
|
+
* arrives, and is only ever read through the orbit model, which marks every
|
|
11
|
+
* figure it carries forward as modelled.
|
|
12
|
+
*/
|
|
13
|
+
/** The topics a fallback is built from, besides the active vessel's id. */
|
|
14
|
+
export const CATALOG_FALLBACK_INPUTS = [
|
|
15
|
+
"trackingStation.catalog",
|
|
16
|
+
"trackingStation.bodies",
|
|
17
|
+
];
|
|
18
|
+
/** The topics a fallback can stand in for. */
|
|
19
|
+
export const CATALOG_FALLBACK_TOPICS = ["vessel.orbit", "vessel.identity"];
|
|
20
|
+
export function catalogOrbitPoint(catalog, bodies, vesselId) {
|
|
21
|
+
const entry = catalog?.payload?.entries?.find((e) => e.vesselId === vesselId);
|
|
22
|
+
const orbit = entry?.orbit;
|
|
23
|
+
const bodyIndex = entry?.bodyIndex;
|
|
24
|
+
if (!catalog || orbit == null || bodyIndex == null)
|
|
25
|
+
return undefined;
|
|
26
|
+
const mu = bodies?.payload?.bodies?.find((b) => b.index === bodyIndex)?.gravParameter;
|
|
27
|
+
const { sma, ecc, inc, meanAnomalyAtEpoch, epoch } = orbit;
|
|
28
|
+
if (sma == null ||
|
|
29
|
+
ecc == null ||
|
|
30
|
+
inc == null ||
|
|
31
|
+
meanAnomalyAtEpoch == null ||
|
|
32
|
+
epoch == null ||
|
|
33
|
+
mu == null) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
const payload = {
|
|
37
|
+
referenceBodyIndex: bodyIndex,
|
|
38
|
+
sma,
|
|
39
|
+
ecc,
|
|
40
|
+
inc,
|
|
41
|
+
lan: orbit.lan,
|
|
42
|
+
argPe: orbit.argPe,
|
|
43
|
+
meanAnomalyAtEpoch,
|
|
44
|
+
epoch,
|
|
45
|
+
mu,
|
|
46
|
+
timeToAp: null,
|
|
47
|
+
timeToPe: null,
|
|
48
|
+
encounter: null,
|
|
49
|
+
patches: [],
|
|
50
|
+
horizon: {
|
|
51
|
+
kind: PropagationHorizonKind.Unbounded,
|
|
52
|
+
trajectoryKind: TrajectoryKind.Analytic,
|
|
53
|
+
},
|
|
54
|
+
meta: { source: `vessel:${vesselId}`, quality: Quality.OnRails },
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
...catalog,
|
|
58
|
+
payload,
|
|
59
|
+
meta: {
|
|
60
|
+
...catalog.meta,
|
|
61
|
+
source: `vessel:${vesselId}`,
|
|
62
|
+
quality: Quality.OnRails,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export function catalogIdentityPoint(catalog, vesselId) {
|
|
67
|
+
const entry = catalog?.payload?.entries?.find((e) => e.vesselId === vesselId);
|
|
68
|
+
if (!catalog || !entry)
|
|
69
|
+
return undefined;
|
|
70
|
+
const meta = { source: `vessel:${vesselId}` };
|
|
71
|
+
const payload = {
|
|
72
|
+
vesselId,
|
|
73
|
+
name: entry.name,
|
|
74
|
+
vesselType: entry.vesselType,
|
|
75
|
+
situation: entry.situation,
|
|
76
|
+
parentBodyIndex: entry.bodyIndex ?? null,
|
|
77
|
+
launchUt: null,
|
|
78
|
+
meta,
|
|
79
|
+
};
|
|
80
|
+
return {
|
|
81
|
+
...catalog,
|
|
82
|
+
payload,
|
|
83
|
+
meta: { ...catalog.meta, source: `vessel:${vesselId}` },
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The orbit the command centre's catalog records for the relay `vesselId`,
|
|
88
|
+
* with the gravitational parameter of the body it orbits, or `undefined` when
|
|
89
|
+
* the entry, any element the solve needs, or that body's parameter is unread.
|
|
90
|
+
* An unread element is never filled with a zero.
|
|
91
|
+
*/
|
|
92
|
+
export function catalogRelayOrbit(catalog, bodies, vesselId) {
|
|
93
|
+
const entry = catalog?.entries?.find((e) => e.vesselId === vesselId);
|
|
94
|
+
const orbit = entry?.orbit;
|
|
95
|
+
const bodyIndex = entry?.bodyIndex;
|
|
96
|
+
if (orbit == null || bodyIndex == null)
|
|
97
|
+
return undefined;
|
|
98
|
+
const mu = bodies?.bodies?.find((b) => b.index === bodyIndex)?.gravParameter;
|
|
99
|
+
const { sma, ecc, inc, meanAnomalyAtEpoch, epoch } = orbit;
|
|
100
|
+
if (sma == null ||
|
|
101
|
+
ecc == null ||
|
|
102
|
+
inc == null ||
|
|
103
|
+
meanAnomalyAtEpoch == null ||
|
|
104
|
+
epoch == null ||
|
|
105
|
+
mu == null) {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
sma,
|
|
110
|
+
ecc,
|
|
111
|
+
inc,
|
|
112
|
+
lan: orbit.lan,
|
|
113
|
+
argPe: orbit.argPe,
|
|
114
|
+
meanAnomalyAtEpoch,
|
|
115
|
+
epoch,
|
|
116
|
+
mu,
|
|
117
|
+
referenceBodyIndex: bodyIndex,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=catalog-fallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-fallback.js","sourceRoot":"","sources":["../../src/spine/catalog-fallback.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,sBAAsB,EACtB,OAAO,EACP,cAAc,GACf,MAAM,2BAA2B,CAAC;AAInC;;;;;;;;;;GAUG;AAEH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,yBAAyB;IACzB,wBAAwB;CAChB,CAAC;AAEX,8CAA8C;AAC9C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAE3E,MAAM,UAAU,iBAAiB,CAC/B,OAA0D,EAC1D,MAA+C,EAC/C,QAAgB;IAEhB,MAAM,KAAK,GAAG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;IAC9E,MAAM,KAAK,GAAG,KAAK,EAAE,KAAK,CAAC;IAC3B,MAAM,SAAS,GAAG,KAAK,EAAE,SAAS,CAAC;IACnC,IAAI,CAAC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S,CAAC,EAAE,aAAa,CAAC;IAC7E,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC3D,IACE,GAAG,IAAI,IAAI;QACX,GAAG,IAAI,IAAI;QACX,GAAG,IAAI,IAAI;QACX,kBAAkB,IAAI,IAAI;QAC1B,KAAK,IAAI,IAAI;QACb,EAAE,IAAI,IAAI,EACV,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO;QACL,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,kBAAkB;QAClB,KAAK;QACL,EAAE;QACF,kBAAkB,EAAE,SAAS;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -29,6 +29,8 @@ export interface CentreCommandMemory {
|
|
|
29
29
|
since: Value<"ut"> | null;
|
|
30
30
|
/** The timeline epoch `since` was taken in; a quickload starts a new one and `since` with it. */
|
|
31
31
|
sinceEpoch: number | null;
|
|
32
|
+
/** The last vessel the outcomes were reported under; a switch to another drops them. */
|
|
33
|
+
vesselId: string | null;
|
|
32
34
|
}
|
|
33
35
|
export declare function createCentreCommandMemory(): CentreCommandMemory;
|
|
34
36
|
/**
|
|
@@ -47,6 +49,8 @@ export declare function centreCommandOutcomes(args: {
|
|
|
47
49
|
nowUt: number | null;
|
|
48
50
|
/** The timeline epoch the view clock is in; a UT from an earlier epoch says nothing about this one. */
|
|
49
51
|
epoch?: number;
|
|
52
|
+
/** The vessel the view names as active, or `null` while it names none; outcomes reported for an earlier vessel are dropped when it changes. */
|
|
53
|
+
vesselId?: string | null;
|
|
50
54
|
/** When set, only outcomes of commands sent with this topic are listed. */
|
|
51
55
|
topic?: string;
|
|
52
56
|
}): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"centre-commands.d.ts","sourceRoot":"","sources":["../../src/spine/centre-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,KAAK,EAAS,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAEvD;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAI5E;AAaD,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAClC,kFAAkF;IAClF,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACnC,4EAA4E;IAC5E,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,yEAAyE;IACzE,QAAQ,EAAE,GAAG,CACX,MAAM,EACN;QAAE,KAAK,EAAE,YAAY,CAAC;QAAC,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAC5D,CAAC;IACF,0FAA0F;IAC1F,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,2FAA2F;IAC3F,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1B,iGAAiG;IACjG,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"centre-commands.d.ts","sourceRoot":"","sources":["../../src/spine/centre-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAA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AM,CAAC;IAChB,KAAK,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAC1C,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,wHAAwH;IACxH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,uGAAuG;IACvG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+IAA+I;IAC/I,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG;IACF,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB,CA8EA;AA0BD,kFAAkF;AAClF,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,mBAAmB,EAC3B,EAAE,EAAE,MAAM,GACT,IAAI,CAGN;AAUD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAC1C,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAC3D,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,eAAe,EAAE,CAkEpB"}
|
|
@@ -32,6 +32,7 @@ export function createCentreCommandMemory() {
|
|
|
32
32
|
unanswered: new Set(),
|
|
33
33
|
since: null,
|
|
34
34
|
sinceEpoch: null,
|
|
35
|
+
vesselId: null,
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
const NO_REFUSALS = [];
|
|
@@ -49,8 +50,19 @@ function settledId(entry) {
|
|
|
49
50
|
* {@link dismissCentreOutcome}, after the centre has stopped listing it.
|
|
50
51
|
*/
|
|
51
52
|
export function centreCommandOutcomes(args) {
|
|
52
|
-
const { command, queue, own, memory, nowUt, epoch = 0, topic } = args;
|
|
53
|
+
const { command, queue, own, memory, nowUt, epoch = 0, vesselId = null, topic, } = args;
|
|
54
|
+
if (vesselId !== null && vesselId !== memory.vesselId) {
|
|
55
|
+
if (memory.vesselId !== null) {
|
|
56
|
+
memory.outcomes.clear();
|
|
57
|
+
// What the centre still lists was reported about the vessel left.
|
|
58
|
+
memory.since = null;
|
|
59
|
+
}
|
|
60
|
+
memory.vesselId = vesselId;
|
|
61
|
+
}
|
|
53
62
|
if (memory.sinceEpoch !== epoch) {
|
|
63
|
+
// A game load abandons the flight the outcomes held so far were reported for.
|
|
64
|
+
if (memory.sinceEpoch !== null)
|
|
65
|
+
memory.outcomes.clear();
|
|
54
66
|
memory.since = null;
|
|
55
67
|
memory.sinceEpoch = epoch;
|
|
56
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"centre-commands.js","sourceRoot":"","sources":["../../src/spine/centre-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,GAKjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAc,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAIzD;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAmB;IAC7C,OAAO,KAAK,CAAC,eAAe,IAAI,UAAU,KAAK,CAAC,EAAE,EAAE,CAAC;AACvD,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,cAAc,CAAC,KAAmB,EAAE,OAAe;IACjE,OAAO,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC;QAC5D,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC;QACxC,CA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GAAG,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3D,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC1B,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC5B,+DAA+D;YAC/D,IAAI,CAAC,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBAAE,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACnE,SAAS;QACX,CAAC;QACD,IAAI,OAAO,KAAK,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;YAC7C,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,EAAE,CAAC;QACzD,CAAC;QACD,IAAI,UAAU;YAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;;YACrC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAClC,IAAI,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBAC1B,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC9B,CAAC;YACD,SAAS;QACX,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -65,6 +65,7 @@ export declare class ClientTimeline<Payload = unknown> {
|
|
|
65
65
|
private droppedThrough;
|
|
66
66
|
/** How many of the oldest points `supersedeBefore` has already passed over. */
|
|
67
67
|
private superseded;
|
|
68
|
+
private bridged;
|
|
68
69
|
/** Bumped on every append that changes the buffer (insert or epoch-reset). Memo key for later tasks. */
|
|
69
70
|
revision: number;
|
|
70
71
|
constructor(options?: ClientTimelineOptions);
|
|
@@ -86,10 +87,24 @@ export declare class ClientTimeline<Payload = unknown> {
|
|
|
86
87
|
get droppedThroughUt(): number | undefined;
|
|
87
88
|
/** The epoch this timeline currently holds points for. */
|
|
88
89
|
get epoch(): number;
|
|
90
|
+
/**
|
|
91
|
+
* Whether the points held are from before a load that kept history. They
|
|
92
|
+
* stay readable across the store's epoch sweep until the load ends or this
|
|
93
|
+
* timeline's first sample of the new timeline lands.
|
|
94
|
+
*/
|
|
95
|
+
get bridging(): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Answer a `timeline-reset` for this Topic: keep the points validated at or
|
|
98
|
+
* before `keptThroughUt` and drop the rest. With no `keptThroughUt` the load
|
|
99
|
+
* kept no history and everything goes at once.
|
|
100
|
+
*/
|
|
101
|
+
retainThrough(keptThroughUt: number | undefined): void;
|
|
89
102
|
/** Insert a delivered sample, sorted by `validAt` (tie-break: `meta.seq`). */
|
|
90
103
|
append(point: TimelinePoint<Payload>): void;
|
|
91
104
|
/** Latest point with `validAt <= ut` (current epoch only, the buffer never holds stale-epoch points). */
|
|
92
105
|
at(ut: number): TimelinePoint<Payload> | undefined;
|
|
106
|
+
/** Latest point with `validAt <= ut` that `matches`, walking back past the points that do not. */
|
|
107
|
+
lastMatchingAt(ut: number, matches: (point: TimelinePoint<Payload>) => boolean): TimelinePoint<Payload> | undefined;
|
|
93
108
|
/**
|
|
94
109
|
* The pair of points straddling `ut`, `[before, after]` where
|
|
95
110
|
* `before.validAt <= ut < after.validAt`. Undefined when `ut` is before
|
|
@@ -124,11 +139,13 @@ export declare class ClientTimeline<Payload = unknown> {
|
|
|
124
139
|
earliest(): TimelinePoint<Payload> | undefined;
|
|
125
140
|
/**
|
|
126
141
|
* Drop every point older than the newest one at or before `ut`, which stays so
|
|
127
|
-
* a hold-last read at `ut` still answers.
|
|
128
|
-
*
|
|
129
|
-
*
|
|
142
|
+
* a hold-last read at `ut` still answers. With `keepNewestOf`, the newest
|
|
143
|
+
* dropped point of each key it names stays too, so a read that walks back to
|
|
144
|
+
* one key's own points still finds that key's newest. What was dropped is
|
|
145
|
+
* recorded in `droppedThroughUt`, so a reader of an older range knows the data
|
|
146
|
+
* existed and is no longer held here.
|
|
130
147
|
*/
|
|
131
|
-
trimBefore(ut: number): void;
|
|
148
|
+
trimBefore(ut: number, keepNewestOf?: (point: TimelinePoint<Payload>) => string | undefined): void;
|
|
132
149
|
/** Drop every point with `validAt < ut`. Used to enforce an externally-computed retention bound (e.g. the real delay window). */
|
|
133
150
|
evictBelow(ut: number): void;
|
|
134
151
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-timeline.d.ts","sourceRoot":"","sources":["../../src/spine/client-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;GAIG;AAEH,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;;;;;OAYG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,cAAc,CAAC,OAAO,GAAG,OAAO;IAC3C,OAAO,CAAC,MAAM,CAAgC;IAC9C,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;IACtD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,cAAc,CAAqB;IAC3C,+EAA+E;IAC/E,OAAO,CAAC,UAAU,CAAK;
|
|
1
|
+
{"version":3,"file":"client-timeline.d.ts","sourceRo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ClientTimeline {
|
|
|
26
26
|
droppedThrough;
|
|
27
27
|
/** How many of the oldest points `supersedeBefore` has already passed over. */
|
|
28
28
|
superseded = 0;
|
|
29
|
+
bridged = false;
|
|
29
30
|
/** Bumped on every append that changes the buffer (insert or epoch-reset). Memo key for later tasks. */
|
|
30
31
|
revision = 0;
|
|
31
32
|
constructor(options = {}) {
|
|
@@ -55,6 +56,30 @@ export class ClientTimeline {
|
|
|
55
56
|
get epoch() {
|
|
56
57
|
return this.currentEpoch;
|
|
57
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Whether the points held are from before a load that kept history. They
|
|
61
|
+
* stay readable across the store's epoch sweep until the load ends or this
|
|
62
|
+
* timeline's first sample of the new timeline lands.
|
|
63
|
+
*/
|
|
64
|
+
get bridging() {
|
|
65
|
+
return this.bridged;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Answer a `timeline-reset` for this Topic: keep the points validated at or
|
|
69
|
+
* before `keptThroughUt` and drop the rest. With no `keptThroughUt` the load
|
|
70
|
+
* kept no history and everything goes at once.
|
|
71
|
+
*/
|
|
72
|
+
retainThrough(keptThroughUt) {
|
|
73
|
+
const keep = keptThroughUt === undefined
|
|
74
|
+
? 0
|
|
75
|
+
: this.firstIndexAfter(keptThroughUt, true);
|
|
76
|
+
if (keep < this.points.length) {
|
|
77
|
+
this.points.splice(keep);
|
|
78
|
+
this.superseded = Math.min(this.superseded, keep);
|
|
79
|
+
this.revision++;
|
|
80
|
+
}
|
|
81
|
+
this.bridged = this.points.length > 0;
|
|
82
|
+
}
|
|
58
83
|
/** Insert a delivered sample, sorted by `validAt` (tie-break: `meta.seq`). */
|
|
59
84
|
append(point) {
|
|
60
85
|
if (point.epoch < this.currentEpoch) {
|
|
@@ -69,6 +94,7 @@ export class ClientTimeline {
|
|
|
69
94
|
this.currentEpoch = point.epoch;
|
|
70
95
|
this.droppedThrough = undefined;
|
|
71
96
|
this.superseded = 0;
|
|
97
|
+
this.bridged = false;
|
|
72
98
|
}
|
|
73
99
|
const index = this.insertionIndex(point);
|
|
74
100
|
this.points.splice(index, 0, point);
|
|
@@ -90,6 +116,23 @@ export class ClientTimeline {
|
|
|
90
116
|
}
|
|
91
117
|
return low === 0 ? undefined : this.points[low - 1];
|
|
92
118
|
}
|
|
119
|
+
/** Latest point with `validAt <= ut` that `matches`, walking back past the points that do not. */
|
|
120
|
+
lastMatchingAt(ut, matches) {
|
|
121
|
+
let low = 0;
|
|
122
|
+
let high = this.points.length;
|
|
123
|
+
while (low < high) {
|
|
124
|
+
const mid = (low + high) >>> 1;
|
|
125
|
+
if (this.points[mid].validAt <= ut)
|
|
126
|
+
low = mid + 1;
|
|
127
|
+
else
|
|
128
|
+
high = mid;
|
|
129
|
+
}
|
|
130
|
+
for (let i = low - 1; i >= 0; i--) {
|
|
131
|
+
if (matches(this.points[i]))
|
|
132
|
+
return this.points[i];
|
|
133
|
+
}
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
93
136
|
/**
|
|
94
137
|
* The pair of points straddling `ut`, `[before, after]` where
|
|
95
138
|
* `before.validAt <= ut < after.validAt`. Undefined when `ut` is before
|
|
@@ -145,7 +188,7 @@ export class ClientTimeline {
|
|
|
145
188
|
* than waiting for that topic's next sample.
|
|
146
189
|
*/
|
|
147
190
|
adoptEpoch(epoch) {
|
|
148
|
-
if (epoch <= this.currentEpoch)
|
|
191
|
+
if (epoch <= this.currentEpoch || this.bridged)
|
|
149
192
|
return;
|
|
150
193
|
this.points = [];
|
|
151
194
|
this.currentEpoch = epoch;
|
|
@@ -163,17 +206,36 @@ export class ClientTimeline {
|
|
|
163
206
|
}
|
|
164
207
|
/**
|
|
165
208
|
* Drop every point older than the newest one at or before `ut`, which stays so
|
|
166
|
-
* a hold-last read at `ut` still answers.
|
|
167
|
-
*
|
|
168
|
-
*
|
|
209
|
+
* a hold-last read at `ut` still answers. With `keepNewestOf`, the newest
|
|
210
|
+
* dropped point of each key it names stays too, so a read that walks back to
|
|
211
|
+
* one key's own points still finds that key's newest. What was dropped is
|
|
212
|
+
* recorded in `droppedThroughUt`, so a reader of an older range knows the data
|
|
213
|
+
* existed and is no longer held here.
|
|
169
214
|
*/
|
|
170
|
-
trimBefore(ut) {
|
|
215
|
+
trimBefore(ut, keepNewestOf) {
|
|
171
216
|
const keepFrom = this.firstIndexAfter(ut, true) - 1;
|
|
172
217
|
if (keepFrom <= 0)
|
|
173
218
|
return;
|
|
219
|
+
const kept = [];
|
|
220
|
+
if (keepNewestOf) {
|
|
221
|
+
const seen = new Set();
|
|
222
|
+
const onward = keepNewestOf(this.points[keepFrom]);
|
|
223
|
+
if (onward !== undefined)
|
|
224
|
+
seen.add(onward);
|
|
225
|
+
for (let i = keepFrom - 1; i >= 0; i--) {
|
|
226
|
+
const key = keepNewestOf(this.points[i]);
|
|
227
|
+
if (key === undefined || seen.has(key))
|
|
228
|
+
continue;
|
|
229
|
+
seen.add(key);
|
|
230
|
+
kept.unshift(this.points[i]);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
const dropped = keepFrom - kept.length;
|
|
234
|
+
if (dropped === 0)
|
|
235
|
+
return;
|
|
174
236
|
this.droppedThrough = this.points[keepFrom - 1].validAt;
|
|
175
|
-
this.points.
|
|
176
|
-
this.superseded = Math.max(0, this.superseded -
|
|
237
|
+
this.points = [...kept, ...this.points.slice(keepFrom)];
|
|
238
|
+
this.superseded = Math.max(0, this.superseded - dropped);
|
|
177
239
|
this.revision++;
|
|
178
240
|
}
|
|
179
241
|
/** Drop every point with `validAt < ut`. Used to enforce an externally-computed retention bound (e.g. the real delay window). */
|