space-data-module-sdk 0.8.15 → 0.8.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/bin/space-data-module.js +24 -6
  2. package/docs/_shell/consumer-assets.html +5 -0
  3. package/docs/browser-wasmedge-isomorphic.html +261 -0
  4. package/docs/byo-wasm-quickstart.html +226 -0
  5. package/docs/byo-wasm-quickstart.md +204 -0
  6. package/docs/conformance.html +162 -0
  7. package/docs/conformance.md +20 -4
  8. package/docs/emception-shared-memory-verdict.md +209 -0
  9. package/docs/events-abi.html +313 -0
  10. package/docs/events-abi.md +530 -0
  11. package/docs/families/analytics.html +178 -0
  12. package/docs/families/analytics.md +104 -0
  13. package/docs/families/attitude.html +157 -0
  14. package/docs/families/attitude.md +36 -0
  15. package/docs/families/behavior.html +157 -0
  16. package/docs/families/behavior.md +36 -0
  17. package/docs/families/breakup.html +157 -0
  18. package/docs/families/breakup.md +36 -0
  19. package/docs/families/conjunction.html +186 -0
  20. package/docs/families/conjunction.md +121 -0
  21. package/docs/families/data-source.html +323 -0
  22. package/docs/families/effects.html +157 -0
  23. package/docs/families/effects.md +36 -0
  24. package/docs/families/environment.html +170 -0
  25. package/docs/families/environment.md +73 -0
  26. package/docs/families/estimation.html +192 -0
  27. package/docs/families/estimation.md +158 -0
  28. package/docs/families/gnc.html +157 -0
  29. package/docs/families/gnc.md +36 -0
  30. package/docs/families/maneuver.html +209 -0
  31. package/docs/families/maneuver.md +206 -0
  32. package/docs/families/obstruction.html +191 -0
  33. package/docs/families/obstruction.md +96 -0
  34. package/docs/families/propagator.html +347 -0
  35. package/docs/families/propulsion.html +157 -0
  36. package/docs/families/propulsion.md +36 -0
  37. package/docs/families/reentry.html +157 -0
  38. package/docs/families/reentry.md +36 -0
  39. package/docs/families/rf.html +193 -0
  40. package/docs/families/rf.md +136 -0
  41. package/docs/families/scheduler.html +157 -0
  42. package/docs/families/scheduler.md +36 -0
  43. package/docs/families/sensor.html +157 -0
  44. package/docs/families/sensor.md +36 -0
  45. package/docs/families/signature.html +157 -0
  46. package/docs/families/signature.md +36 -0
  47. package/docs/flatsql-host-contract.html +176 -0
  48. package/docs/flatsql-streaming-standard.html +375 -0
  49. package/docs/gpu-module-abi.html +233 -0
  50. package/docs/harness-family-matrix.md +135 -0
  51. package/docs/index.html +216 -85
  52. package/docs/isomorphic-pthreads.html +228 -0
  53. package/docs/isomorphic-pthreads.md +84 -0
  54. package/docs/isomorphic-sdn-runtime-plan.html +274 -0
  55. package/docs/language-runtime-matrix.html +182 -0
  56. package/docs/llms.txt +86 -0
  57. package/docs/module-bundle-runtime-plan.html +146 -0
  58. package/docs/module-publication-standard.html +503 -0
  59. package/docs/node-red-default-node-parity.html +201 -0
  60. package/docs/propagator-abi.md +97 -12
  61. package/docs/protect-and-sign.html +181 -0
  62. package/docs/protect-and-sign.md +120 -0
  63. package/docs/protocol-installation.html +296 -0
  64. package/docs/provider-access-abi.md +25 -0
  65. package/docs/publication-submission.html +158 -0
  66. package/docs/publication-submission.md +78 -0
  67. package/docs/secrets-capability.html +206 -0
  68. package/docs/styles.css +860 -167
  69. package/docs/testing-harness.html +408 -0
  70. package/docs/tri-runtime-parity-gate.html +182 -0
  71. package/docs/tri-runtime-parity.html +203 -0
  72. package/include/orbpro/orbpro_estimation_abi.h +883 -0
  73. package/include/orbpro/orbpro_event_runner.h +951 -0
  74. package/include/orbpro/orbpro_events_abi.h +565 -0
  75. package/include/orbpro/orbpro_propagator_abi.h +75 -0
  76. package/package.json +13 -4
  77. package/schemas/orbpro/Estimation.fbs +244 -0
  78. package/schemas/orbpro/Events.fbs +501 -0
  79. package/schemas/orbpro/Propagator.fbs +136 -9
  80. package/schemas/orbpro/reference-frame-crosswalk.json +108 -0
  81. package/schemas/orbpro/reference-frame.lock.json +98 -0
  82. package/src/browser.js +13 -0
  83. package/src/conformance/estimationReference.js +81 -0
  84. package/src/conformance/estimationSuite.js +134 -0
  85. package/src/conformance/index.js +39 -2
  86. package/src/generated/orbpro/events-abi.js +206 -0
  87. package/src/generated/orbpro/events-abi.ts +319 -0
  88. package/src/generated/orbpro/propagator/reference-frame.js +17 -0
  89. package/src/generated/orbpro/propagator/reference-frame.ts +91 -1
  90. package/src/generated/orbpro/propagator-abi.js +38 -0
  91. package/src/generated/orbpro/propagator-abi.ts +67 -0
  92. package/src/generated/spacedatastandards/plg/CCT.d.ts +94 -0
  93. package/src/generated/spacedatastandards/plg/CCT.d.ts.map +1 -0
  94. package/src/generated/spacedatastandards/plg/CCT.js +208 -0
  95. package/src/generated/spacedatastandards/plg/CCT.ts +281 -0
  96. package/src/generated/spacedatastandards/plg/CCTCategory.d.ts +98 -0
  97. package/src/generated/spacedatastandards/plg/CCTCategory.d.ts.map +1 -0
  98. package/src/generated/spacedatastandards/plg/CCTCategory.js +177 -0
  99. package/src/generated/spacedatastandards/plg/CCTCategory.ts +269 -0
  100. package/src/generated/spacedatastandards/plg/CCTCategoryRollup.d.ts +54 -0
  101. package/src/generated/spacedatastandards/plg/CCTCategoryRollup.d.ts.map +1 -0
  102. package/src/generated/spacedatastandards/plg/CCTCategoryRollup.js +106 -0
  103. package/src/generated/spacedatastandards/plg/CCTCategoryRollup.ts +144 -0
  104. package/src/generated/spacedatastandards/plg/PLG.d.ts +46 -2
  105. package/src/generated/spacedatastandards/plg/PLG.d.ts.map +1 -1
  106. package/src/generated/spacedatastandards/plg/PLG.js +78 -5
  107. package/src/generated/spacedatastandards/plg/PLG.ts +90 -5
  108. package/src/generated/spacedatastandards/plg/capabilityClass.d.ts +181 -0
  109. package/src/generated/spacedatastandards/plg/capabilityClass.d.ts.map +1 -0
  110. package/src/generated/spacedatastandards/plg/capabilityClass.js +183 -0
  111. package/src/generated/spacedatastandards/plg/capabilityClass.ts +208 -0
  112. package/src/generated/spacedatastandards/plg/main.d.ts +4 -0
  113. package/src/generated/spacedatastandards/plg/main.d.ts.map +1 -1
  114. package/src/generated/spacedatastandards/plg/main.js +4 -0
  115. package/src/generated/spacedatastandards/plg/main.ts +4 -0
  116. package/src/generated/spacedatastandards/plg/pluginCategory.d.ts +40 -2
  117. package/src/generated/spacedatastandards/plg/pluginCategory.d.ts.map +1 -1
  118. package/src/generated/spacedatastandards/plg/pluginCategory.js +40 -2
  119. package/src/generated/spacedatastandards/plg/pluginCategory.ts +40 -2
  120. package/src/host/browserModuleHarness.js +8 -0
  121. package/src/host/wasiThreadHost.js +189 -14
  122. package/src/index.d.ts +18 -1
  123. package/src/standards/sharedCatalog.js +7 -0
  124. package/src/transport/index.js +16 -0
  125. package/src/transport/records.js +1015 -3
  126. package/templates/estimation-module/README.md +24 -0
  127. package/templates/estimation-module/build.mjs +32 -0
  128. package/templates/estimation-module/package.json +12 -0
  129. package/templates/estimation-module/plugin-manifest.json +34 -0
  130. package/templates/estimation-module/src/reference_estimation.cpp +53 -0
@@ -19,6 +19,8 @@ import path from "node:path";
19
19
 
20
20
  import { loadPropagatorArtifact } from "./abiDriver.js";
21
21
  import { computeVerdict, runPropagatorSuite } from "./propagatorSuite.js";
22
+ import { runEstimationSuite } from "./estimationSuite.js";
23
+ import { makeEstimationReferenceEvidence } from "./estimationReference.js";
22
24
 
23
25
  export { ErrorCode, REQUIRED_ABI_EXPORTS } from "./abiDriver.js";
24
26
  export {
@@ -34,14 +36,14 @@ export { runPropagatorSelfTest, formatSelfTestReport } from "./selfTest.js";
34
36
  * never coerced — the ANALYSIS fallback was the namespace corruption the
35
37
  * finding killed.
36
38
  */
37
- export const CONFORMANCE_FAMILIES = Object.freeze(["propagator"]);
39
+ export const CONFORMANCE_FAMILIES = Object.freeze(["estimation", "propagator"]);
38
40
 
39
41
  export class UnknownConformanceFamilyError extends Error {
40
42
  constructor(family) {
41
43
  super(
42
44
  `no conformance kit for family "${family}" — kits exist for: ` +
43
45
  `${CONFORMANCE_FAMILIES.join(", ")}. A family with no kit can never be CORE ` +
44
- "(finding §5); maneuver is Wave 2 (EXPERIMENTAL), OD is deferred by ruling.",
46
+ "(finding §5); maneuver remains Wave 2.",
45
47
  );
46
48
  this.name = "UnknownConformanceFamilyError";
47
49
  this.family = family;
@@ -93,6 +95,23 @@ export async function runConformance(options) {
93
95
  if (!CONFORMANCE_FAMILIES.includes(family)) {
94
96
  throw new UnknownConformanceFamilyError(options.family);
95
97
  }
98
+ if (family === "estimation") {
99
+ const evidence = options.evidence ?? JSON.parse(
100
+ await fs.readFile(path.resolve(options.evidencePath), "utf8"),
101
+ );
102
+ const evaluated = runEstimationSuite(evidence);
103
+ let artifact = evidence.artifact ?? null;
104
+ if (options.artifactPath) {
105
+ const artifactPath = path.resolve(options.artifactPath);
106
+ const artifactBytes = await fs.readFile(artifactPath);
107
+ artifact = {
108
+ path: artifactPath,
109
+ sha256: crypto.createHash("sha256").update(artifactBytes).digest("hex"),
110
+ };
111
+ }
112
+ return { family, artifact, corpus: null, evidence: options.evidencePath ?? null, ...evaluated };
113
+ }
114
+
96
115
  const artifactPath = path.resolve(options.artifactPath);
97
116
  const artifactBytes = await fs.readFile(artifactPath);
98
117
  const artifactSha256 = crypto
@@ -129,6 +148,24 @@ export async function runConformance(options) {
129
148
  };
130
149
  }
131
150
 
151
+ export { runEstimationSuite } from "./estimationSuite.js";
152
+ export { makeEstimationReferenceEvidence } from "./estimationReference.js";
153
+
154
+ export async function runEstimationSelfTest() {
155
+ const controls = [];
156
+ for (const [id, mutate] of [
157
+ ["runtime-divergence", (e) => { e.runtime.threads["8"] = "different"; }],
158
+ ["ekf-ukf-alias", (e) => { e.filter.ekfUkfCovarianceDifference = 0; }],
159
+ ["covariance-placeholder", (e) => { e.invariants.actualOcmCovariance = false; }],
160
+ ]) {
161
+ const evidence = makeEstimationReferenceEvidence();
162
+ mutate(evidence);
163
+ const report = runEstimationSuite(evidence);
164
+ controls.push({ id, caught: report.verdict === "FAIL" });
165
+ }
166
+ return { ok: controls.every((control) => control.caught), controls };
167
+ }
168
+
132
169
  export function formatConformanceReport(report) {
133
170
  const lines = [];
134
171
  lines.push(`conformance ${report.family} — ${report.verdict}`);
@@ -0,0 +1,206 @@
1
+ // ===========================================================================
2
+ // GENERATED FILE — DO NOT EDIT.
3
+ //
4
+ // Source of truth : schemas/orbpro/Events.fbs
5
+ // Generator : scripts/generate-events-abi.mjs
6
+ // Drift gate : scripts/check-events-abi.mjs (runs in `npm test`)
7
+ // Contract : docs/events-abi.md
8
+ //
9
+ // These constants exist so that no JavaScript consumer ever hard-codes a byte
10
+ // offset again. Read a state vector with ORBPRO_STATE_VECTOR.offsets.position,
11
+ // never with the literal 8.
12
+ // ===========================================================================
13
+
14
+ export { ReferenceFrame } from "./propagator-abi.js";
15
+
16
+ export const RootMethod = Object.freeze({
17
+ BRENT: 0,
18
+ BISECTION: 1,
19
+ ILLINOIS: 2,
20
+ });
21
+
22
+ export const CrossingDirection = Object.freeze({
23
+ FALLING: -1,
24
+ ANY: 0,
25
+ RISING: 1,
26
+ });
27
+
28
+ export const RootStatus = Object.freeze({
29
+ CONVERGED: 0,
30
+ MAX_ITERATIONS: 1,
31
+ FLAT_BRACKET: 2,
32
+ DISCONTINUOUS: 3,
33
+ TRUNCATED: 4,
34
+ EPOCH_RESOLUTION_LIMITED: 5,
35
+ });
36
+
37
+ export const Sign = Object.freeze({
38
+ NEGATIVE: -1,
39
+ ZERO: 0,
40
+ POSITIVE: 1,
41
+ });
42
+
43
+ export const EventFlags = Object.freeze({
44
+ NONE: 0,
45
+ INTERVAL_OPEN_AT_START: 1,
46
+ INTERVAL_OPEN_AT_END: 2,
47
+ TANGENTIAL: 4,
48
+ ON_SCAN_BOUNDARY: 8,
49
+ BACKWARD: 16,
50
+ STOP_CONDITION: 32,
51
+ });
52
+
53
+ export const EventError = Object.freeze({
54
+ INTERNAL: -25,
55
+ SUPPLY_COUNT_MISMATCH: -24,
56
+ PROTOCOL_ORDER: -23,
57
+ BUFFER_TOO_SMALL: -22,
58
+ UNKNOWN_COMPONENT: -21,
59
+ NOT_STARTED: -20,
60
+ UNPHYSICAL: -6,
61
+ NOT_CONVERGED: -5,
62
+ BAD_INPUT: -4,
63
+ NULL_OUTPUT: -3,
64
+ BAD_OBJECT_INDEX: -2,
65
+ NOT_CONFIGURED: -1,
66
+ OK: 0,
67
+ });
68
+
69
+ export const ComponentContinuity = Object.freeze({
70
+ SMOOTH: 0,
71
+ PIECEWISE: 1,
72
+ DISCRETE: 2,
73
+ });
74
+
75
+ export const ORBPRO_ROOT_POLICY = Object.freeze({
76
+ name: "RootPolicy",
77
+ cName: "OrbProRootPolicy",
78
+ size: 32,
79
+ alignment: 8,
80
+ offsets: Object.freeze({
81
+ scan_step_seconds: 0,
82
+ epoch_tolerance_seconds: 8,
83
+ value_tolerance: 16,
84
+ max_iterations: 24,
85
+ method: 28,
86
+ }),
87
+ fields: Object.freeze({
88
+ scan_step_seconds: Object.freeze({ offset: 0, size: 8, length: 1, view: "Float64" }),
89
+ epoch_tolerance_seconds: Object.freeze({ offset: 8, size: 8, length: 1, view: "Float64" }),
90
+ value_tolerance: Object.freeze({ offset: 16, size: 8, length: 1, view: "Float64" }),
91
+ max_iterations: Object.freeze({ offset: 24, size: 4, length: 1, view: "Uint32" }),
92
+ method: Object.freeze({ offset: 28, size: 1, length: 1, view: "Uint8" }),
93
+ }),
94
+ });
95
+
96
+ export const ORBPRO_EVENT_INTERVAL = Object.freeze({
97
+ name: "EventInterval",
98
+ cName: "OrbProEventInterval",
99
+ size: 56,
100
+ alignment: 8,
101
+ offsets: Object.freeze({
102
+ start_jd_day: 0,
103
+ start_seconds: 8,
104
+ stop_jd_day: 16,
105
+ stop_seconds: 24,
106
+ max_events: 32,
107
+ max_evaluations: 36,
108
+ occurrence: 40,
109
+ component: 44,
110
+ flags: 48,
111
+ direction: 52,
112
+ }),
113
+ fields: Object.freeze({
114
+ start_jd_day: Object.freeze({ offset: 0, size: 8, length: 1, view: "Float64" }),
115
+ start_seconds: Object.freeze({ offset: 8, size: 8, length: 1, view: "Float64" }),
116
+ stop_jd_day: Object.freeze({ offset: 16, size: 8, length: 1, view: "Float64" }),
117
+ stop_seconds: Object.freeze({ offset: 24, size: 8, length: 1, view: "Float64" }),
118
+ max_events: Object.freeze({ offset: 32, size: 4, length: 1, view: "Uint32" }),
119
+ max_evaluations: Object.freeze({ offset: 36, size: 4, length: 1, view: "Uint32" }),
120
+ occurrence: Object.freeze({ offset: 40, size: 4, length: 1, view: "Uint32" }),
121
+ component: Object.freeze({ offset: 44, size: 4, length: 1, view: "Uint32" }),
122
+ flags: Object.freeze({ offset: 48, size: 4, length: 1, view: "Uint32" }),
123
+ direction: Object.freeze({ offset: 52, size: 1, length: 1, view: "Int8" }),
124
+ }),
125
+ });
126
+
127
+ export const ORBPRO_EVENT_HIT = Object.freeze({
128
+ name: "EventHit",
129
+ cName: "OrbProEventHit",
130
+ size: 48,
131
+ alignment: 8,
132
+ offsets: Object.freeze({
133
+ epoch_jd_day: 0,
134
+ epoch_seconds: 8,
135
+ value: 16,
136
+ component: 24,
137
+ iterations: 28,
138
+ evaluations: 32,
139
+ flags: 36,
140
+ direction: 40,
141
+ status: 41,
142
+ }),
143
+ fields: Object.freeze({
144
+ epoch_jd_day: Object.freeze({ offset: 0, size: 8, length: 1, view: "Float64" }),
145
+ epoch_seconds: Object.freeze({ offset: 8, size: 8, length: 1, view: "Float64" }),
146
+ value: Object.freeze({ offset: 16, size: 8, length: 1, view: "Float64" }),
147
+ component: Object.freeze({ offset: 24, size: 4, length: 1, view: "Uint32" }),
148
+ iterations: Object.freeze({ offset: 28, size: 4, length: 1, view: "Uint32" }),
149
+ evaluations: Object.freeze({ offset: 32, size: 4, length: 1, view: "Uint32" }),
150
+ flags: Object.freeze({ offset: 36, size: 4, length: 1, view: "Uint32" }),
151
+ direction: Object.freeze({ offset: 40, size: 1, length: 1, view: "Int8" }),
152
+ status: Object.freeze({ offset: 41, size: 1, length: 1, view: "Uint8" }),
153
+ }),
154
+ });
155
+
156
+ export const ORBPRO_EVENT_SCAN_SUMMARY = Object.freeze({
157
+ name: "EventScanSummary",
158
+ cName: "OrbProEventScanSummary",
159
+ size: 32,
160
+ alignment: 8,
161
+ offsets: Object.freeze({
162
+ initial_value: 0,
163
+ final_value: 8,
164
+ component: 16,
165
+ crossing_count: 20,
166
+ evaluation_count: 24,
167
+ initial_sign: 28,
168
+ final_sign: 29,
169
+ }),
170
+ fields: Object.freeze({
171
+ initial_value: Object.freeze({ offset: 0, size: 8, length: 1, view: "Float64" }),
172
+ final_value: Object.freeze({ offset: 8, size: 8, length: 1, view: "Float64" }),
173
+ component: Object.freeze({ offset: 16, size: 4, length: 1, view: "Uint32" }),
174
+ crossing_count: Object.freeze({ offset: 20, size: 4, length: 1, view: "Uint32" }),
175
+ evaluation_count: Object.freeze({ offset: 24, size: 4, length: 1, view: "Uint32" }),
176
+ initial_sign: Object.freeze({ offset: 28, size: 1, length: 1, view: "Int8" }),
177
+ final_sign: Object.freeze({ offset: 29, size: 1, length: 1, view: "Int8" }),
178
+ }),
179
+ });
180
+
181
+ export const ORBPRO_EVENT_STATE_REQUEST = Object.freeze({
182
+ name: "EventStateRequest",
183
+ cName: "OrbProEventStateRequest",
184
+ size: 16,
185
+ alignment: 4,
186
+ offsets: Object.freeze({
187
+ epoch_count: 0,
188
+ object_count: 4,
189
+ reference_frame: 8,
190
+ flags: 12,
191
+ }),
192
+ fields: Object.freeze({
193
+ epoch_count: Object.freeze({ offset: 0, size: 4, length: 1, view: "Uint32" }),
194
+ object_count: Object.freeze({ offset: 4, size: 4, length: 1, view: "Uint32" }),
195
+ reference_frame: Object.freeze({ offset: 8, size: 1, length: 1, view: "Uint8" }),
196
+ flags: Object.freeze({ offset: 12, size: 4, length: 1, view: "Uint32" }),
197
+ }),
198
+ });
199
+
200
+ export const ORBPRO_EVENTS_ABI = Object.freeze({
201
+ RootPolicy: ORBPRO_ROOT_POLICY,
202
+ EventInterval: ORBPRO_EVENT_INTERVAL,
203
+ EventHit: ORBPRO_EVENT_HIT,
204
+ EventScanSummary: ORBPRO_EVENT_SCAN_SUMMARY,
205
+ EventStateRequest: ORBPRO_EVENT_STATE_REQUEST,
206
+ });
@@ -0,0 +1,319 @@
1
+ // ===========================================================================
2
+ // GENERATED FILE — DO NOT EDIT.
3
+ //
4
+ // Source of truth : schemas/orbpro/Events.fbs
5
+ // Generator : scripts/generate-events-abi.mjs
6
+ // Drift gate : scripts/check-events-abi.mjs (runs in `npm test`)
7
+ // Contract : docs/events-abi.md
8
+ //
9
+ // These constants exist so that no JavaScript consumer ever hard-codes a byte
10
+ // offset again. Read a state vector with ORBPRO_STATE_VECTOR.offsets.position,
11
+ // never with the literal 8.
12
+ // ===========================================================================
13
+
14
+ import { ReferenceFrame } from "./propagator-abi.js";
15
+
16
+ export { ReferenceFrame };
17
+
18
+ /**
19
+ * The refinement algorithm the runner uses on a bracketed root. All three are
20
+ * bracketing methods: a root that is bracketed stays bracketed, so a locator
21
+ * can never report a root outside the interval that produced it.
22
+ */
23
+ export enum RootMethod {
24
+ BRENT = 0,
25
+ BISECTION = 1,
26
+ ILLINOIS = 2,
27
+ }
28
+
29
+ /**
30
+ * Which way g crosses zero. SIGNED on purpose: a crossing qualifies when
31
+ * `direction * (g_after - g_before) > 0`, so the filter is arithmetic rather
32
+ * than a branch table, and ANY = 0 falls out of the same expression.
33
+ */
34
+ export enum CrossingDirection {
35
+ FALLING = -1,
36
+ ANY = 0,
37
+ RISING = 1,
38
+ }
39
+
40
+ /**
41
+ * How a refinement ended. NEVER folded into the returned root: a root that
42
+ * stopped on the iteration cap and a root that converged are different
43
+ * answers, and a consumer that cannot tell them apart will publish the first
44
+ * as if it were the second.
45
+ */
46
+ export enum RootStatus {
47
+ CONVERGED = 0,
48
+ MAX_ITERATIONS = 1,
49
+ FLAT_BRACKET = 2,
50
+ DISCONTINUOUS = 3,
51
+ TRUNCATED = 4,
52
+ EPOCH_RESOLUTION_LIMITED = 5,
53
+ }
54
+
55
+ /**
56
+ * The sign of a scalar at an interval endpoint. Its only job is to make an
57
+ * interval that is ALREADY OPEN at the scan start representable: a
58
+ * crossing-only report loses that interval entirely, which is the classic
59
+ * event-scan defect (the pass you were already inside when the scan began).
60
+ */
61
+ export enum Sign {
62
+ NEGATIVE = -1,
63
+ ZERO = 0,
64
+ POSITIVE = 1,
65
+ }
66
+
67
+ /**
68
+ * EventHit.flags and EventInterval.flags are BITFIELDS carrying any
69
+ * OR-combination of these, so both are declared `uint` on their structs
70
+ * rather than typed to this enum. The C enumerators are generated from here
71
+ * anyway — they are the contract.
72
+ */
73
+ export enum EventFlags {
74
+ NONE = 0,
75
+ INTERVAL_OPEN_AT_START = 1,
76
+ INTERVAL_OPEN_AT_END = 2,
77
+ TANGENTIAL = 4,
78
+ ON_SCAN_BOUNDARY = 8,
79
+ BACKWARD = 16,
80
+ STOP_CONDITION = 32,
81
+ }
82
+
83
+ /**
84
+ * Named negative return codes for every export in this family. A locator that
85
+ * answers -1 for everything is unconformable: the consumer cannot place the
86
+ * failure on the degradation ladder, so it cannot decide between retrying,
87
+ * widening the interval, and refusing. Codes -1..-6 are deliberately the SAME
88
+ * numbers and the same meanings as the propagator family's
89
+ * (docs/propagator-abi.md §Error codes); the events-specific codes start at
90
+ * -20 so no consumer can confuse the two tables by value.
91
+ */
92
+ export enum EventError {
93
+ INTERNAL = -25,
94
+ SUPPLY_COUNT_MISMATCH = -24,
95
+ PROTOCOL_ORDER = -23,
96
+ BUFFER_TOO_SMALL = -22,
97
+ UNKNOWN_COMPONENT = -21,
98
+ NOT_STARTED = -20,
99
+ UNPHYSICAL = -6,
100
+ NOT_CONVERGED = -5,
101
+ BAD_INPUT = -4,
102
+ NULL_OUTPUT = -3,
103
+ BAD_OBJECT_INDEX = -2,
104
+ NOT_CONFIGURED = -1,
105
+ OK = 0,
106
+ }
107
+
108
+ /**
109
+ * Whether a component's g is safe to refine, and with which method. A locator
110
+ * that lies here produces roots that look converged and are not, which is why
111
+ * it is declared per component rather than assumed for the family.
112
+ */
113
+ export enum ComponentContinuity {
114
+ SMOOTH = 0,
115
+ PIECEWISE = 1,
116
+ DISCRETE = 2,
117
+ }
118
+
119
+ /** One field's placement inside an ABI struct. */
120
+ export interface AbiField {
121
+ readonly offset: number;
122
+ readonly size: number;
123
+ /** Element count for array fields, 1 for scalars. */
124
+ readonly length: number;
125
+ /** DataView accessor suffix, e.g. "Float64" for getFloat64. */
126
+ readonly view: string;
127
+ }
128
+
129
+ /** One ABI struct's byte layout. */
130
+ export interface AbiStruct {
131
+ readonly name: string;
132
+ readonly cName: string;
133
+ readonly size: number;
134
+ readonly alignment: number;
135
+ readonly offsets: Readonly<Record<string, number>>;
136
+ readonly fields: Readonly<Record<string, AbiField>>;
137
+ }
138
+
139
+ /**
140
+ * The root-refinement policy — the SAME parameters for every locator, which
141
+ * is what makes two locators' epochs comparable. 32 bytes, 8-byte aligned.
142
+ *
143
+ * A zeroed policy is NOT a default: `orbpro_root_policy_init` zeroes it and
144
+ * `plugin_event_begin` refuses a zero `scan_step_seconds` with `BAD_INPUT`.
145
+ * A silent default step is how a scan misses every event shorter than it.
146
+ */
147
+ export const ORBPRO_ROOT_POLICY: AbiStruct = {
148
+ name: "RootPolicy",
149
+ cName: "OrbProRootPolicy",
150
+ size: 32,
151
+ alignment: 8,
152
+ offsets: {
153
+ scan_step_seconds: 0,
154
+ epoch_tolerance_seconds: 8,
155
+ value_tolerance: 16,
156
+ max_iterations: 24,
157
+ method: 28,
158
+ },
159
+ fields: {
160
+ scan_step_seconds: { offset: 0, size: 8, length: 1, view: "Float64" },
161
+ epoch_tolerance_seconds: { offset: 8, size: 8, length: 1, view: "Float64" },
162
+ value_tolerance: { offset: 16, size: 8, length: 1, view: "Float64" },
163
+ max_iterations: { offset: 24, size: 4, length: 1, view: "Uint32" },
164
+ method: { offset: 28, size: 1, length: 1, view: "Uint8" },
165
+ },
166
+ } as const;
167
+
168
+ /**
169
+ * The interval to scan, and the filter applied to what is found. 56 bytes,
170
+ * 8-byte aligned.
171
+ *
172
+ * EPOCHS ARE SPLIT PAIRS: `*_jd_day` is an exactly-representable Julian day
173
+ * (an integer, or an integer + 0.5) and `*_seconds` is the offset from it in
174
+ * seconds. Do not collapse them into one double before comparing — that is
175
+ * the forty-microsecond quantization this pair exists to avoid.
176
+ *
177
+ * BACKWARD PROPAGATION IS NOT A MODE. It is `stop` earlier than `start`. The
178
+ * runner steps negatively, the consumer's propagator is asked for earlier
179
+ * epochs, and every hit carries `BACKWARD`. There is no second code path to
180
+ * keep in agreement with the first.
181
+ */
182
+ export const ORBPRO_EVENT_INTERVAL: AbiStruct = {
183
+ name: "EventInterval",
184
+ cName: "OrbProEventInterval",
185
+ size: 56,
186
+ alignment: 8,
187
+ offsets: {
188
+ start_jd_day: 0,
189
+ start_seconds: 8,
190
+ stop_jd_day: 16,
191
+ stop_seconds: 24,
192
+ max_events: 32,
193
+ max_evaluations: 36,
194
+ occurrence: 40,
195
+ component: 44,
196
+ flags: 48,
197
+ direction: 52,
198
+ },
199
+ fields: {
200
+ start_jd_day: { offset: 0, size: 8, length: 1, view: "Float64" },
201
+ start_seconds: { offset: 8, size: 8, length: 1, view: "Float64" },
202
+ stop_jd_day: { offset: 16, size: 8, length: 1, view: "Float64" },
203
+ stop_seconds: { offset: 24, size: 8, length: 1, view: "Float64" },
204
+ max_events: { offset: 32, size: 4, length: 1, view: "Uint32" },
205
+ max_evaluations: { offset: 36, size: 4, length: 1, view: "Uint32" },
206
+ occurrence: { offset: 40, size: 4, length: 1, view: "Uint32" },
207
+ component: { offset: 44, size: 4, length: 1, view: "Uint32" },
208
+ flags: { offset: 48, size: 4, length: 1, view: "Uint32" },
209
+ direction: { offset: 52, size: 1, length: 1, view: "Int8" },
210
+ },
211
+ } as const;
212
+
213
+ /**
214
+ * One refined crossing. 48 bytes, 8-byte aligned.
215
+ *
216
+ * A HIT IS A CROSSING, NOT AN INTERVAL. Apsides and node crossings are
217
+ * instants; eclipse and contact are intervals. Emitting crossings and pairing
218
+ * them by direction is total over both, whereas an interval-shaped hit puts a
219
+ * sentinel in half the family. Pairing is deterministic and is specified in
220
+ * docs/events-abi.md §Interval pairing; `EventScanSummary` carries the
221
+ * endpoint signs that make the pairing total.
222
+ */
223
+ export const ORBPRO_EVENT_HIT: AbiStruct = {
224
+ name: "EventHit",
225
+ cName: "OrbProEventHit",
226
+ size: 48,
227
+ alignment: 8,
228
+ offsets: {
229
+ epoch_jd_day: 0,
230
+ epoch_seconds: 8,
231
+ value: 16,
232
+ component: 24,
233
+ iterations: 28,
234
+ evaluations: 32,
235
+ flags: 36,
236
+ direction: 40,
237
+ status: 41,
238
+ },
239
+ fields: {
240
+ epoch_jd_day: { offset: 0, size: 8, length: 1, view: "Float64" },
241
+ epoch_seconds: { offset: 8, size: 8, length: 1, view: "Float64" },
242
+ value: { offset: 16, size: 8, length: 1, view: "Float64" },
243
+ component: { offset: 24, size: 4, length: 1, view: "Uint32" },
244
+ iterations: { offset: 28, size: 4, length: 1, view: "Uint32" },
245
+ evaluations: { offset: 32, size: 4, length: 1, view: "Uint32" },
246
+ flags: { offset: 36, size: 4, length: 1, view: "Uint32" },
247
+ direction: { offset: 40, size: 1, length: 1, view: "Int8" },
248
+ status: { offset: 41, size: 1, length: 1, view: "Uint8" },
249
+ },
250
+ } as const;
251
+
252
+ /**
253
+ * What one component did across the whole interval. 32 bytes, 8-byte aligned.
254
+ *
255
+ * This is what makes a crossing list interpretable. Without the endpoint
256
+ * signs, "no hits" is ambiguous between "never in eclipse" and "in eclipse the
257
+ * entire time", and those are opposite answers.
258
+ */
259
+ export const ORBPRO_EVENT_SCAN_SUMMARY: AbiStruct = {
260
+ name: "EventScanSummary",
261
+ cName: "OrbProEventScanSummary",
262
+ size: 32,
263
+ alignment: 8,
264
+ offsets: {
265
+ initial_value: 0,
266
+ final_value: 8,
267
+ component: 16,
268
+ crossing_count: 20,
269
+ evaluation_count: 24,
270
+ initial_sign: 28,
271
+ final_sign: 29,
272
+ },
273
+ fields: {
274
+ initial_value: { offset: 0, size: 8, length: 1, view: "Float64" },
275
+ final_value: { offset: 8, size: 8, length: 1, view: "Float64" },
276
+ component: { offset: 16, size: 4, length: 1, view: "Uint32" },
277
+ crossing_count: { offset: 20, size: 4, length: 1, view: "Uint32" },
278
+ evaluation_count: { offset: 24, size: 4, length: 1, view: "Uint32" },
279
+ initial_sign: { offset: 28, size: 1, length: 1, view: "Int8" },
280
+ final_sign: { offset: 29, size: 1, length: 1, view: "Int8" },
281
+ },
282
+ } as const;
283
+
284
+ /**
285
+ * What the locator wants evaluated next — the guest-to-consumer half of the
286
+ * pull protocol. 16 bytes, 4-byte aligned.
287
+ *
288
+ * The consumer reads this, propagates the requested epochs through whatever
289
+ * module is wired to the propagator port, and returns the states through
290
+ * `plugin_event_supply`. The consumer chooses NOTHING: not the epochs, not
291
+ * the order, not when the scan ends.
292
+ */
293
+ export const ORBPRO_EVENT_STATE_REQUEST: AbiStruct = {
294
+ name: "EventStateRequest",
295
+ cName: "OrbProEventStateRequest",
296
+ size: 16,
297
+ alignment: 4,
298
+ offsets: {
299
+ epoch_count: 0,
300
+ object_count: 4,
301
+ reference_frame: 8,
302
+ flags: 12,
303
+ },
304
+ fields: {
305
+ epoch_count: { offset: 0, size: 4, length: 1, view: "Uint32" },
306
+ object_count: { offset: 4, size: 4, length: 1, view: "Uint32" },
307
+ reference_frame: { offset: 8, size: 1, length: 1, view: "Uint8" },
308
+ flags: { offset: 12, size: 4, length: 1, view: "Uint32" },
309
+ },
310
+ } as const;
311
+
312
+ /** Every ABI struct, keyed by its IDL name. */
313
+ export const ORBPRO_EVENTS_ABI: Readonly<Record<string, AbiStruct>> = {
314
+ RootPolicy: ORBPRO_ROOT_POLICY,
315
+ EventInterval: ORBPRO_EVENT_INTERVAL,
316
+ EventHit: ORBPRO_EVENT_HIT,
317
+ EventScanSummary: ORBPRO_EVENT_SCAN_SUMMARY,
318
+ EventStateRequest: ORBPRO_EVENT_STATE_REQUEST,
319
+ } as const;
@@ -5,6 +5,23 @@ var ReferenceFrame = /* @__PURE__ */ ((ReferenceFrame2) => {
5
5
  ReferenceFrame2[ReferenceFrame2["ECEF"] = 3] = "ECEF";
6
6
  ReferenceFrame2[ReferenceFrame2["MCI"] = 4] = "MCI";
7
7
  ReferenceFrame2[ReferenceFrame2["MCMF"] = 5] = "MCMF";
8
+ ReferenceFrame2[ReferenceFrame2["MJ2000EC"] = 6] = "MJ2000EC";
9
+ ReferenceFrame2[ReferenceFrame2["MOD"] = 7] = "MOD";
10
+ ReferenceFrame2[ReferenceFrame2["TOD"] = 8] = "TOD";
11
+ ReferenceFrame2[ReferenceFrame2["MOE"] = 9] = "MOE";
12
+ ReferenceFrame2[ReferenceFrame2["TOE"] = 10] = "TOE";
13
+ ReferenceFrame2[ReferenceFrame2["BODY_FIXED"] = 11] = "BODY_FIXED";
14
+ ReferenceFrame2[ReferenceFrame2["BODY_INERTIAL"] = 12] = "BODY_INERTIAL";
15
+ ReferenceFrame2[ReferenceFrame2["OBJECT_REFERENCED"] = 13] = "OBJECT_REFERENCED";
16
+ ReferenceFrame2[ReferenceFrame2["LOCAL_ALIGNED_CONSTRAINED"] = 14] = "LOCAL_ALIGNED_CONSTRAINED";
17
+ ReferenceFrame2[ReferenceFrame2["EQUATOR"] = 15] = "EQUATOR";
18
+ ReferenceFrame2[ReferenceFrame2["GSE"] = 16] = "GSE";
19
+ ReferenceFrame2[ReferenceFrame2["GSM"] = 17] = "GSM";
20
+ ReferenceFrame2[ReferenceFrame2["TOPOCENTRIC"] = 18] = "TOPOCENTRIC";
21
+ ReferenceFrame2[ReferenceFrame2["BODY_SPIN_SUN"] = 19] = "BODY_SPIN_SUN";
22
+ ReferenceFrame2[ReferenceFrame2["SPICE_DEFINED"] = 20] = "SPICE_DEFINED";
23
+ ReferenceFrame2[ReferenceFrame2["MOD_FK5"] = 21] = "MOD_FK5";
24
+ ReferenceFrame2[ReferenceFrame2["TOD_FK5"] = 22] = "TOD_FK5";
8
25
  return ReferenceFrame2;
9
26
  })(ReferenceFrame || {});
10
27
  export {