space-data-module-sdk 0.11.0 → 0.12.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.
|
@@ -216,6 +216,16 @@ setBrowserWasiThreadWorkerBase("js/vendor/space-data-module-sdk/src/host/&q
|
|
|
216
216
|
<h2 id="5-flatsql-partition-store-host-io-sdk-0822"><a class="anchor" href="#5-flatsql-partition-store-host-io-sdk-0822" aria-hidden="true">#</a>5. FlatSQL partition store host I/O (SDK 0.8.22)</h2>
|
|
217
217
|
<p>The FlatSQL partition store (stack design <code>docs/architecture/flatsql-partition-store.md</code>, §5.5, §5.6, §18 T9, A7, A36, A38, A39) runs one wasi-threads artifact as a writer instance and reader instances, each with guest threads that call FlatSQL's seven <code>env.flatsql_io_*</code> imports. This section is the SDK half: the thread pool, the I/O channel and workers, the Node provider, link shim v2, the worker bundles and the browser capability probe.</p>
|
|
218
218
|
<h3 id="explicit-pool-size-partial-spawns-supervision-hooks"><a class="anchor" href="#explicit-pool-size-partial-spawns-supervision-hooks" aria-hidden="true">#</a>Explicit pool size, partial spawns, supervision hooks</h3>
|
|
219
|
+
<p><code>createBrowserModuleHarness</code> accepts <code>wasiThreadProbeTimeoutMs</code>, the browser pool arming deadline in milliseconds. It forwards the value as <code>createWasiThreadSpawn</code>'s <code>probeTimeoutMs</code>. The default is 1500. An explicit value must be a positive finite number; invalid values throw an <code>Error</code> before the artifact is loaded. The option applies to the initial context and each fresh command invocation. It has no effect on Node's on-demand pool startup.</p>
|
|
220
|
+
<p>After harness creation, the read-only <code>harness.wasiThreadPoolReport</code> property returns a frozen <code>{ requested, armed }</code> snapshot. Counts refer to pool workers and exclude the calling thread. With <code>wasiThreadPoolSize</code>, <code>requested</code> is that explicit size, including when threading is unavailable. Without an explicit size, it is the browser's selected pool size. Non-threaded artifacts return <code>null</code>. Node reports its explicit cap (or <code>null</code> without one) and the number of workers started on demand.</p>
|
|
221
|
+
<p>For an explicit browser pool, fewer armed workers do not throw. Workers that miss the deadline are terminated before the harness returns; successfully armed workers remain available. The host uses the report to decide whether the capacity meets its needs. A guest must handle declined spawns to execute successfully with fewer workers. After a command invocation, the property reports that invocation's arming counts, even though its pool is terminated. These are startup counts, not a live-worker health report.</p>
|
|
222
|
+
<div class="codeblock"><div class="codeblock-head">js</div><pre><code>const harness = await createBrowserModuleHarness({
|
|
223
|
+
wasmSource,
|
|
224
|
+
enableBrowserWasiThreads: true,
|
|
225
|
+
wasiThreadPoolSize: 8,
|
|
226
|
+
wasiThreadProbeTimeoutMs: 10000,
|
|
227
|
+
});
|
|
228
|
+
const { requested, armed } = harness.wasiThreadPoolReport;</code></pre></div>
|
|
219
229
|
<p><code>createWasiThreadSpawn</code> options added in 0.8.22:</p>
|
|
220
230
|
<div class="table-wrap"><table><thead><tr><th>Option</th><th>Effect</th></tr></thead><tbody><tr><td><code>poolSize</code></td><td>Browser: pre-start exactly this many workers, independent of <code>hardwareConcurrency - 1</code> (pools are sized for isolation: writers + lanes). Node: cap on live guest threads (the pool grows to it on demand; without it, to 1024). Arming is partial: workers that fail to start are dropped, the rest serve.</td></tr><tr><td><code>extraImports</code></td><td>Per-worker import objects, as structured-cloneable descriptors (below). Factories run once per worker.</td></tr><tr><td><code>instanceId</code>, <code>onGuestError(instanceId, tid, error)</code></td><td>Called when a guest thread traps or its worker dies (A36). A dead pooled worker leaves the pool. In Node, for workers the owning thread started.</td></tr><tr><td><code>onSpawnDeclined({ reason, poolSize, declined })</code></td><td>Called for every spawn from the owning thread that returns -1. Reasons: <code>pool-exhausted</code>, <code>pool-not-armed</code>, <code>threads-unavailable</code>, <code>pool-empty</code>, <code>worker-create-failed</code>, <code>dispatch-failed</code>, <code>hostcall-channel-missing</code>, <code>terminated</code>.</td></tr><tr><td><code>probeTimeoutMs</code></td><td>Browser warm-pool probe deadline.</td></tr><tr><td><code>spawnWaitMs</code></td><td>How long a spawn that finds every pool thread busy waits for one to finish before it returns -1 (default 250; 0 never waits). Added in 0.8.25; see "one pool protocol" in §3.</td></tr><tr><td><code>browserWorkerType: "classic"</code></td><td>Spawn classic workers, for the blob bundles below.</td></tr></tbody></table></div>
|
|
221
231
|
<p>The returned host adds <code>spawnReport()</code>: <code>{ poolSize, armed, failedToArm, spawned, waited, declined, declinedByReason, lastDeclineReason, active, idle }</code> (Node adds <code>workers</code>). The counts cover spawns from every thread of the process. The implicit (no <code>poolSize</code>) path keeps its all-or-nothing arming.</p>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "space-data-module-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Module SDK for building, validating, signing, and deploying WebAssembly modules on the Space Data Network.",
|
|
6
6
|
"type": "module",
|
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
"generate:propagator-abi": "node scripts/generate-propagator-abi.mjs",
|
|
123
123
|
"generate:vectors": "node ./examples/single-file-bundle/generate-vectors.mjs",
|
|
124
124
|
"prepublishOnly": "npm test && npm run check:compliance && npm run check:generated-bindings",
|
|
125
|
+
"e2e:shared-ephemeris-grid": "node scripts/e2e/shared-ephemeris-grid.mjs",
|
|
125
126
|
"playground:build": "node ./playground/build.mjs",
|
|
126
127
|
"playground:serve": "node ./playground/build.mjs && node ./playground/server.mjs",
|
|
127
128
|
"playground:gate": "node ./playground/build.mjs && node ./playground/test/browser-gate.mjs",
|
|
@@ -133,7 +134,7 @@
|
|
|
133
134
|
"flatsql": "3.12.1",
|
|
134
135
|
"hd-wallet-wasm": "2.2.2",
|
|
135
136
|
"sdn-emception": "1.0.0",
|
|
136
|
-
"spacedatastandards.org": "1.
|
|
137
|
+
"spacedatastandards.org": "1.294.1"
|
|
137
138
|
},
|
|
138
139
|
"devDependencies": {
|
|
139
140
|
"esbuild": "^0.28.0",
|
package/src/index.d.ts
CHANGED
|
@@ -461,6 +461,38 @@ export interface RuntimeRegionDescriptor {
|
|
|
461
461
|
recordByteLength: number;
|
|
462
462
|
alignment: number;
|
|
463
463
|
recordCount: number;
|
|
464
|
+
kind?: "owned" | "external" | "contiguous";
|
|
465
|
+
shared?: boolean;
|
|
466
|
+
generation?: number;
|
|
467
|
+
byteLength?: number;
|
|
468
|
+
activeConsumers?: number;
|
|
469
|
+
invalidated?: boolean;
|
|
470
|
+
metadata?: unknown;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export interface RuntimeRegionArena {
|
|
474
|
+
regionId: number;
|
|
475
|
+
buffer: ArrayBufferLike;
|
|
476
|
+
byteOffset: number;
|
|
477
|
+
byteLength: number;
|
|
478
|
+
bytes: Uint8Array;
|
|
479
|
+
shared: boolean;
|
|
480
|
+
alignment: number;
|
|
481
|
+
generation: number;
|
|
482
|
+
recordCount: number;
|
|
483
|
+
recordByteLength: number;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export interface RuntimeRegionConsumerLease {
|
|
487
|
+
readonly leaseId: number;
|
|
488
|
+
readonly regionId: number;
|
|
489
|
+
readonly consumerId: string;
|
|
490
|
+
readonly mode: "read-only";
|
|
491
|
+
readonly roleMask: number | null;
|
|
492
|
+
readonly generation: number;
|
|
493
|
+
isCurrent(): boolean;
|
|
494
|
+
assertCurrent(): boolean;
|
|
495
|
+
detach(): boolean;
|
|
464
496
|
}
|
|
465
497
|
|
|
466
498
|
export interface RuntimeRegionRecord {
|
|
@@ -481,6 +513,9 @@ export interface RuntimeRegionExternalRecordView {
|
|
|
481
513
|
alignment: number;
|
|
482
514
|
byteOffset?: number;
|
|
483
515
|
buffer?: ArrayBufferLike;
|
|
516
|
+
shared?: boolean;
|
|
517
|
+
generation?: number;
|
|
518
|
+
bytes?: Uint8Array;
|
|
484
519
|
elementType?: string;
|
|
485
520
|
elementCount?: number;
|
|
486
521
|
strideElements?: number;
|
|
@@ -499,6 +534,15 @@ export interface RuntimeRegionStore {
|
|
|
499
534
|
alignment?: number;
|
|
500
535
|
initialRecords?: Array<Uint8Array | ArrayBuffer | ArrayBufferView | null | undefined>;
|
|
501
536
|
}): RuntimeRegionDescriptor;
|
|
537
|
+
allocateContiguousRegion(options: {
|
|
538
|
+
layoutId: string;
|
|
539
|
+
recordByteLength: number;
|
|
540
|
+
alignment?: number;
|
|
541
|
+
recordCount?: number;
|
|
542
|
+
shared?: boolean;
|
|
543
|
+
initialBytes?: Uint8Array | ArrayBuffer | ArrayBufferView | null;
|
|
544
|
+
metadata?: unknown;
|
|
545
|
+
}): RuntimeRegionDescriptor;
|
|
502
546
|
registerExternalRegion(options: {
|
|
503
547
|
layoutId: string;
|
|
504
548
|
recordByteLength: number;
|
|
@@ -521,12 +565,342 @@ export interface RuntimeRegionStore {
|
|
|
521
565
|
}): RuntimeRegionDescriptor;
|
|
522
566
|
setRegionRecordCount(regionId: number, recordCount: number): RuntimeRegionDescriptor | null;
|
|
523
567
|
describeRegion(regionId: number): RuntimeRegionDescriptor | null;
|
|
568
|
+
getRegionArena(regionId: number): RuntimeRegionArena | null;
|
|
569
|
+
updateContiguousRecord(options: {
|
|
570
|
+
regionId: number;
|
|
571
|
+
recordIndex: number;
|
|
572
|
+
bytes: Uint8Array | ArrayBuffer | ArrayBufferView | null | undefined;
|
|
573
|
+
bumpGeneration?: boolean;
|
|
574
|
+
}): {
|
|
575
|
+
regionId: number;
|
|
576
|
+
recordIndex: number;
|
|
577
|
+
generation: number;
|
|
578
|
+
byteLength: number;
|
|
579
|
+
};
|
|
580
|
+
resizeContiguousRegion(
|
|
581
|
+
regionId: number,
|
|
582
|
+
newRecordCount: number,
|
|
583
|
+
options?: { shared?: boolean },
|
|
584
|
+
): RuntimeRegionDescriptor | null;
|
|
585
|
+
bumpRegionGeneration(regionId: number): number | null;
|
|
586
|
+
invalidateRegion(regionId: number): boolean;
|
|
587
|
+
attachRegionConsumer(
|
|
588
|
+
regionId: number,
|
|
589
|
+
options: {
|
|
590
|
+
consumerId: string;
|
|
591
|
+
mode?: "read-only";
|
|
592
|
+
roleMask?: number | null;
|
|
593
|
+
},
|
|
594
|
+
): RuntimeRegionConsumerLease;
|
|
595
|
+
detachRegionConsumer(regionId: number, leaseId: number): boolean;
|
|
596
|
+
listRegionConsumers(regionId: number): Array<{
|
|
597
|
+
leaseId: number;
|
|
598
|
+
regionId: number;
|
|
599
|
+
consumerId: string;
|
|
600
|
+
mode: "read-only";
|
|
601
|
+
roleMask: number | null;
|
|
602
|
+
generation: number;
|
|
603
|
+
attachedAt: number;
|
|
604
|
+
}>;
|
|
524
605
|
resolveRecord(options: RuntimeRegionRecordViewRequest): RuntimeRegionRecord | null;
|
|
525
606
|
resolveRecordView(
|
|
526
607
|
options: RuntimeRegionRecordViewRequest,
|
|
527
608
|
): RuntimeRegionRecord | RuntimeRegionExternalRecordView | null;
|
|
528
609
|
}
|
|
529
610
|
|
|
611
|
+
export type DeclaredOrbitTheory = "SGP4" | "SGP4XP" | "AP";
|
|
612
|
+
|
|
613
|
+
export interface EphemerisCatalogRecord {
|
|
614
|
+
id?: string | number;
|
|
615
|
+
ID?: string | number;
|
|
616
|
+
OBJECT_ID?: string;
|
|
617
|
+
NORAD_CAT_ID?: number;
|
|
618
|
+
declaredTheory?: DeclaredOrbitTheory | string;
|
|
619
|
+
MEAN_ELEMENT_THEORY?: DeclaredOrbitTheory | string;
|
|
620
|
+
theory?: DeclaredOrbitTheory | string;
|
|
621
|
+
propagatorId?: string;
|
|
622
|
+
[key: string]: unknown;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
export interface RoutedCatalogRecord {
|
|
626
|
+
index: number;
|
|
627
|
+
recordId: string;
|
|
628
|
+
declaredTheory: DeclaredOrbitTheory;
|
|
629
|
+
propagatorId: string;
|
|
630
|
+
record: EphemerisCatalogRecord;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export interface PropagatorGridContext {
|
|
634
|
+
records: EphemerisCatalogRecord[];
|
|
635
|
+
routedRecords: RoutedCatalogRecord[];
|
|
636
|
+
updatedIndices?: number[];
|
|
637
|
+
statesView: Float32Array;
|
|
638
|
+
bandsView: Float32Array;
|
|
639
|
+
firstStep: number;
|
|
640
|
+
stepCount: number;
|
|
641
|
+
objectCount: number;
|
|
642
|
+
windowStart: number;
|
|
643
|
+
windowEnd: number;
|
|
644
|
+
stepS: number;
|
|
645
|
+
frame: string;
|
|
646
|
+
propagatorId: string;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
export interface PropagatorRecordContext {
|
|
650
|
+
record: EphemerisCatalogRecord;
|
|
651
|
+
objectIndex: number;
|
|
652
|
+
declaredTheory: DeclaredOrbitTheory;
|
|
653
|
+
propagatorId: string;
|
|
654
|
+
statesView: Float32Array;
|
|
655
|
+
bandsView: Float32Array;
|
|
656
|
+
firstStep: number;
|
|
657
|
+
stepCount: number;
|
|
658
|
+
objectCount: number;
|
|
659
|
+
windowStart: number;
|
|
660
|
+
windowEnd: number;
|
|
661
|
+
stepS: number;
|
|
662
|
+
frame: string;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
export interface PropagatorAdapter {
|
|
666
|
+
supportedTheories?: Iterable<DeclaredOrbitTheory | string>;
|
|
667
|
+
strict?: boolean;
|
|
668
|
+
supportsTheory?: (theory: DeclaredOrbitTheory) => boolean;
|
|
669
|
+
propagateGrid?: (
|
|
670
|
+
context: PropagatorGridContext,
|
|
671
|
+
) => { excludedIndices?: number[] } | void;
|
|
672
|
+
propagateRecord?: (
|
|
673
|
+
context: PropagatorRecordContext,
|
|
674
|
+
) => { excluded?: boolean } | void;
|
|
675
|
+
[key: string]: unknown;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export interface RegisteredPropagatorAdapter extends PropagatorAdapter {
|
|
679
|
+
propagatorId: string;
|
|
680
|
+
supportedTheories: Set<DeclaredOrbitTheory> | null;
|
|
681
|
+
supportsTheory(theory: DeclaredOrbitTheory | string): boolean;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
export interface PropagatorRegistry {
|
|
685
|
+
defaultPropagatorId: string;
|
|
686
|
+
supportedPropagatorIds: readonly string[];
|
|
687
|
+
registerPropagator(id: string, adapter: PropagatorAdapter): RegisteredPropagatorAdapter;
|
|
688
|
+
getPropagator(id?: string): RegisteredPropagatorAdapter | null;
|
|
689
|
+
hasPropagator(id?: string): boolean;
|
|
690
|
+
listPropagators(): string[];
|
|
691
|
+
unregisterPropagator(id: string): boolean;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
export interface EphemerisGridDescriptor {
|
|
695
|
+
readonly regionId: number;
|
|
696
|
+
readonly roleMask: number;
|
|
697
|
+
readonly propagatorId: string;
|
|
698
|
+
readonly catalogRevision: string;
|
|
699
|
+
readonly windowStart: number;
|
|
700
|
+
readonly windowEnd: number;
|
|
701
|
+
readonly stepS: number;
|
|
702
|
+
readonly frame: string;
|
|
703
|
+
readonly firstStep: number;
|
|
704
|
+
readonly stepCount: number;
|
|
705
|
+
readonly objectCount: number;
|
|
706
|
+
readonly generation: number;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
export interface PopulateEphemerisGridSpec {
|
|
710
|
+
propagatorId?: string;
|
|
711
|
+
catalogRevision: string | number;
|
|
712
|
+
windowStart: number;
|
|
713
|
+
windowEnd: number;
|
|
714
|
+
stepS: number;
|
|
715
|
+
frame?: string;
|
|
716
|
+
firstStep?: number;
|
|
717
|
+
stepCount?: number;
|
|
718
|
+
roleMask?: number;
|
|
719
|
+
roles?: Uint8Array | number[] | null;
|
|
720
|
+
records?: EphemerisCatalogRecord[];
|
|
721
|
+
objectCount?: number;
|
|
722
|
+
shared?: boolean;
|
|
723
|
+
allowMixedRouting?: boolean;
|
|
724
|
+
populateFn?: (
|
|
725
|
+
context: PropagatorGridContext,
|
|
726
|
+
) => { excludedIndices?: number[] } | void;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
export interface PopulateEphemerisGridResult {
|
|
730
|
+
descriptor: EphemerisGridDescriptor;
|
|
731
|
+
regionId: number;
|
|
732
|
+
cacheHit: boolean;
|
|
733
|
+
propagationCount: number;
|
|
734
|
+
propagatedObjectCount: number;
|
|
735
|
+
excludedIndices: number[];
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
export interface EphemerisGridStatus {
|
|
739
|
+
descriptor: EphemerisGridDescriptor;
|
|
740
|
+
regionId: number;
|
|
741
|
+
shared: boolean;
|
|
742
|
+
generation: number;
|
|
743
|
+
byteLength: number;
|
|
744
|
+
statesByteLength: number;
|
|
745
|
+
bandsByteLength: number;
|
|
746
|
+
propagationCount: number;
|
|
747
|
+
propagatedObjectCount: number;
|
|
748
|
+
spliceCount: number;
|
|
749
|
+
activeConsumers: number;
|
|
750
|
+
invalidated: boolean;
|
|
751
|
+
excludedIndices: number[];
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export interface GridAttachLease {
|
|
755
|
+
readonly leaseId: number;
|
|
756
|
+
readonly regionId: number;
|
|
757
|
+
readonly moduleId: string;
|
|
758
|
+
readonly mode: "read-only";
|
|
759
|
+
readonly shared: boolean;
|
|
760
|
+
readonly generation: number;
|
|
761
|
+
readonly descriptor: EphemerisGridDescriptor;
|
|
762
|
+
readonly arenaBytes: Uint8Array;
|
|
763
|
+
getStatesView(): Float32Array;
|
|
764
|
+
getBandsView(): Float32Array;
|
|
765
|
+
getRolesView(): Uint8Array;
|
|
766
|
+
encodeAlignedExternalFrame(options?: {
|
|
767
|
+
portId?: string;
|
|
768
|
+
typeRef?: PayloadTypeRef;
|
|
769
|
+
}): InvokeFrame & { shared: boolean; regionId: number };
|
|
770
|
+
encodeScrGridFrame(): Uint8Array;
|
|
771
|
+
isCurrent(): boolean;
|
|
772
|
+
assertCurrent(): boolean;
|
|
773
|
+
detach(): boolean;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
export interface SpliceEphemerisGridSpec {
|
|
777
|
+
regionId: number;
|
|
778
|
+
newCatalogRevision: string | number;
|
|
779
|
+
updatedIndices: number[];
|
|
780
|
+
records?: EphemerisCatalogRecord[];
|
|
781
|
+
excludedIndices?: number[];
|
|
782
|
+
allowMixedRouting?: boolean;
|
|
783
|
+
populateFn?: (
|
|
784
|
+
context: PropagatorGridContext & { updatedIndices: number[] },
|
|
785
|
+
) => { excludedIndices?: number[] } | void;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
export interface InvalidateEphemerisGridFilter {
|
|
789
|
+
regionId?: number;
|
|
790
|
+
propagatorId?: string;
|
|
791
|
+
catalogRevision?: string | number;
|
|
792
|
+
windowStart?: number;
|
|
793
|
+
windowEnd?: number;
|
|
794
|
+
stepS?: number;
|
|
795
|
+
frame?: string;
|
|
796
|
+
all?: boolean;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
export interface SharedEphemerisGridManager {
|
|
800
|
+
populateGrid(spec: PopulateEphemerisGridSpec): PopulateEphemerisGridResult;
|
|
801
|
+
getGrid(regionId: number): EphemerisGridStatus | null;
|
|
802
|
+
attachGridModule(
|
|
803
|
+
regionId: number,
|
|
804
|
+
options: {
|
|
805
|
+
moduleId: string;
|
|
806
|
+
roleMask?: number;
|
|
807
|
+
roles?: Uint8Array | number[] | null;
|
|
808
|
+
mode?: "read-only";
|
|
809
|
+
},
|
|
810
|
+
): GridAttachLease;
|
|
811
|
+
spliceGridObjects(spec: SpliceEphemerisGridSpec): {
|
|
812
|
+
descriptor: EphemerisGridDescriptor;
|
|
813
|
+
regionId: number;
|
|
814
|
+
generation: number;
|
|
815
|
+
updatedIndices: number[];
|
|
816
|
+
propagatedObjectCount: number;
|
|
817
|
+
};
|
|
818
|
+
invalidateGrid(filter: number | InvalidateEphemerisGridFilter): {
|
|
819
|
+
invalidatedRegionIds: number[];
|
|
820
|
+
count: number;
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
export const SCR_GRID_STATE_FLOATS: number;
|
|
825
|
+
export const SCR_GRID_STATE_BYTES: number;
|
|
826
|
+
export const SCR_RADIUS_BAND_FLOATS: number;
|
|
827
|
+
export const SCR_RADIUS_BAND_BYTES: number;
|
|
828
|
+
export const SCR_ROLE: Readonly<{ SECONDARY: 0; PRIMARY: 1; SKIP: 2 }>;
|
|
829
|
+
export const SCR_ROLE_MASK_ALL: number;
|
|
830
|
+
export const SCR_GRID_LAYOUT_ID: string;
|
|
831
|
+
export const DEFAULT_PROPAGATOR_ID: string;
|
|
832
|
+
export const SUPPORTED_PROPAGATOR_IDS: readonly string[];
|
|
833
|
+
export const DECLARED_ORBIT_THEORIES: readonly DeclaredOrbitTheory[];
|
|
834
|
+
|
|
835
|
+
export class TheoryMismatchError extends Error {
|
|
836
|
+
code: string;
|
|
837
|
+
recordId: string | null;
|
|
838
|
+
declaredTheory: string | null;
|
|
839
|
+
propagatorId: string | null;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
export class StaleGridLeaseError extends Error {
|
|
843
|
+
code: string;
|
|
844
|
+
regionId: number | null;
|
|
845
|
+
moduleId: string | null;
|
|
846
|
+
attachedGeneration: number | null;
|
|
847
|
+
currentGeneration: number | null;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
export function isSharedBuffer(buffer: unknown): buffer is SharedArrayBuffer;
|
|
851
|
+
export function createArenaBuffer(
|
|
852
|
+
byteLength: number,
|
|
853
|
+
options?: { shared?: boolean },
|
|
854
|
+
): ArrayBuffer | SharedArrayBuffer;
|
|
855
|
+
export function resolvePropagatorId(id?: string): string;
|
|
856
|
+
export function normalizeDeclaredTheory(
|
|
857
|
+
value: unknown,
|
|
858
|
+
recordLabel?: string,
|
|
859
|
+
): DeclaredOrbitTheory;
|
|
860
|
+
export function createPropagatorRegistry(
|
|
861
|
+
initialAdapters?:
|
|
862
|
+
| Map<string, PropagatorAdapter>
|
|
863
|
+
| Record<string, PropagatorAdapter>,
|
|
864
|
+
): PropagatorRegistry;
|
|
865
|
+
export function routeCatalogRecordsByTheory(
|
|
866
|
+
records: EphemerisCatalogRecord[],
|
|
867
|
+
options?: {
|
|
868
|
+
propagatorId?: string;
|
|
869
|
+
registry?: PropagatorRegistry | null;
|
|
870
|
+
allowMixedRouting?: boolean;
|
|
871
|
+
},
|
|
872
|
+
): RoutedCatalogRecord[];
|
|
873
|
+
export function gridCacheKey(spec: {
|
|
874
|
+
propagatorId?: string;
|
|
875
|
+
catalogRevision: string | number;
|
|
876
|
+
windowStart: number;
|
|
877
|
+
windowEnd: number;
|
|
878
|
+
stepS: number;
|
|
879
|
+
frame?: string;
|
|
880
|
+
}): string;
|
|
881
|
+
export function encodeScrGridFlatBuffer(spec: {
|
|
882
|
+
firstStep?: number;
|
|
883
|
+
stepCount: number;
|
|
884
|
+
objectCount: number;
|
|
885
|
+
frame?: string;
|
|
886
|
+
stepS?: number;
|
|
887
|
+
statesView: Float32Array;
|
|
888
|
+
bandsView: Float32Array;
|
|
889
|
+
}): Uint8Array;
|
|
890
|
+
export function decodeScrGridFlatBuffer(bytes: Uint8Array): {
|
|
891
|
+
firstStep: number;
|
|
892
|
+
stepCount: number;
|
|
893
|
+
objectCount: number;
|
|
894
|
+
frame: string;
|
|
895
|
+
stepS: number;
|
|
896
|
+
statesView: Float32Array;
|
|
897
|
+
bandsView: Float32Array;
|
|
898
|
+
};
|
|
899
|
+
export function createSharedEphemerisGridManager(options?: {
|
|
900
|
+
regions?: RuntimeRegionStore;
|
|
901
|
+
propagators?: PropagatorRegistry;
|
|
902
|
+
}): SharedEphemerisGridManager;
|
|
903
|
+
|
|
530
904
|
export interface InstalledRuntimeModule {
|
|
531
905
|
moduleId: string;
|
|
532
906
|
metadata: unknown;
|
|
@@ -557,6 +931,33 @@ export interface RuntimeHost {
|
|
|
557
931
|
rows: FlatSqlRuntimeStore;
|
|
558
932
|
regions: RuntimeRegionStore;
|
|
559
933
|
moduleRegistry: RuntimeModuleRegistry;
|
|
934
|
+
propagators: PropagatorRegistry;
|
|
935
|
+
ephemerisGrids: SharedEphemerisGridManager;
|
|
936
|
+
registerPropagator(id: string, adapter: PropagatorAdapter): RegisteredPropagatorAdapter;
|
|
937
|
+
listPropagators(): string[];
|
|
938
|
+
populateEphemerisGrid(spec: PopulateEphemerisGridSpec): PopulateEphemerisGridResult;
|
|
939
|
+
getEphemerisGrid(regionId: number): EphemerisGridStatus | null;
|
|
940
|
+
attachEphemerisGrid(
|
|
941
|
+
regionId: number,
|
|
942
|
+
options: {
|
|
943
|
+
moduleId: string;
|
|
944
|
+
roleMask?: number;
|
|
945
|
+
roles?: Uint8Array | number[] | null;
|
|
946
|
+
mode?: "read-only";
|
|
947
|
+
},
|
|
948
|
+
): GridAttachLease;
|
|
949
|
+
detachEphemerisGrid(lease: GridAttachLease): boolean;
|
|
950
|
+
spliceEphemerisGrid(spec: SpliceEphemerisGridSpec): {
|
|
951
|
+
descriptor: EphemerisGridDescriptor;
|
|
952
|
+
regionId: number;
|
|
953
|
+
generation: number;
|
|
954
|
+
updatedIndices: number[];
|
|
955
|
+
propagatedObjectCount: number;
|
|
956
|
+
};
|
|
957
|
+
invalidateEphemerisGrid(filter: number | InvalidateEphemerisGridFilter): {
|
|
958
|
+
invalidatedRegionIds: number[];
|
|
959
|
+
count: number;
|
|
960
|
+
};
|
|
560
961
|
listCapabilities(): string[];
|
|
561
962
|
listSupportedCapabilities(): string[];
|
|
562
963
|
listOperations(): string[];
|
|
@@ -600,6 +1001,11 @@ export function createRuntimeHost(options?: {
|
|
|
600
1001
|
rows?: FlatSqlRuntimeStore;
|
|
601
1002
|
regions?: RuntimeRegionStore;
|
|
602
1003
|
moduleRegistry?: RuntimeModuleRegistry;
|
|
1004
|
+
propagators?: PropagatorRegistry;
|
|
1005
|
+
propagatorAdapters?:
|
|
1006
|
+
| Map<string, PropagatorAdapter>
|
|
1007
|
+
| Record<string, PropagatorAdapter>;
|
|
1008
|
+
ephemerisGrids?: SharedEphemerisGridManager;
|
|
603
1009
|
}): RuntimeHost;
|
|
604
1010
|
export function getWasmExportNamesFromFile(wasmPath: string): Promise<string[]>;
|
|
605
1011
|
|