@shipload/sdk 1.0.0-next.34 → 1.0.0-next.36
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/lib/shipload.d.ts +398 -51
- package/lib/shipload.js +1481 -400
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +1442 -401
- package/lib/shipload.m.js.map +1 -1
- package/lib/testing.d.ts +101 -20
- package/lib/testing.js +201 -57
- package/lib/testing.js.map +1 -1
- package/lib/testing.m.js +201 -57
- package/lib/testing.m.js.map +1 -1
- package/package.json +1 -1
- package/src/capabilities/crafting.ts +2 -3
- package/src/capabilities/gathering.test.ts +16 -0
- package/src/capabilities/gathering.ts +8 -11
- package/src/contracts/server.ts +147 -29
- package/src/coordinates/address.ts +88 -0
- package/src/coordinates/constants.test.ts +15 -0
- package/src/coordinates/constants.ts +23 -0
- package/src/coordinates/index.ts +15 -0
- package/src/coordinates/memo.test.ts +47 -0
- package/src/coordinates/memo.ts +20 -0
- package/src/coordinates/permutation.ts +77 -0
- package/src/coordinates/regions.ts +48 -0
- package/src/coordinates/sectors.ts +115 -0
- package/src/data/capability-formulas.ts +0 -1
- package/src/data/entities.json +4 -4
- package/src/data/items.json +5 -5
- package/src/data/recipes.json +39 -65
- package/src/derivation/capabilities.test.ts +133 -0
- package/src/derivation/capabilities.ts +66 -14
- package/src/derivation/rollups.test.ts +55 -0
- package/src/derivation/rollups.ts +56 -0
- package/src/derivation/wormhole.ts +115 -0
- package/src/entities/makers.ts +30 -3
- package/src/errors.ts +2 -0
- package/src/index-module.ts +38 -2
- package/src/managers/actions.ts +79 -5
- package/src/managers/construction.ts +6 -4
- package/src/managers/context.ts +9 -0
- package/src/managers/coordinates.ts +14 -0
- package/src/managers/plot.ts +2 -4
- package/src/nft/description.ts +25 -6
- package/src/planner/index.ts +127 -0
- package/src/planner/planner.test.ts +319 -0
- package/src/resolution/resolve-item.ts +4 -1
- package/src/scheduling/availability.ts +1 -1
- package/src/scheduling/cancel.test.ts +348 -0
- package/src/scheduling/cancel.ts +209 -0
- package/src/scheduling/lanes.test.ts +249 -0
- package/src/scheduling/lanes.ts +140 -2
- package/src/scheduling/projection.ts +75 -16
- package/src/scheduling/schedule.ts +3 -1
- package/src/shipload.ts +5 -0
- package/src/testing/projection-parity.ts +26 -2
- package/src/travel/travel.ts +116 -105
- package/src/types/capabilities.ts +23 -6
- package/src/types/entity.ts +3 -3
- package/src/types.ts +2 -1
- package/src/utils/system.ts +11 -0
package/lib/testing.d.ts
CHANGED
|
@@ -142,10 +142,13 @@ declare namespace Types {
|
|
|
142
142
|
quantity: UInt32;
|
|
143
143
|
inputs: cargo_item[];
|
|
144
144
|
target?: UInt64;
|
|
145
|
+
slot?: UInt8;
|
|
145
146
|
}
|
|
146
|
-
class
|
|
147
|
+
class crafter_lane extends Struct {
|
|
148
|
+
slot_index: UInt8;
|
|
147
149
|
speed: UInt16;
|
|
148
150
|
drain: UInt32;
|
|
151
|
+
output_pct: UInt16;
|
|
149
152
|
}
|
|
150
153
|
class demolish extends Struct {
|
|
151
154
|
entity_id: UInt64;
|
|
@@ -178,20 +181,23 @@ declare namespace Types {
|
|
|
178
181
|
class warp_stats extends Struct {
|
|
179
182
|
range: UInt32;
|
|
180
183
|
}
|
|
181
|
-
class
|
|
184
|
+
class hauler_stats extends Struct {
|
|
185
|
+
capacity: UInt8;
|
|
186
|
+
efficiency: UInt16;
|
|
187
|
+
drain: UInt32;
|
|
188
|
+
}
|
|
189
|
+
class gatherer_lane extends Struct {
|
|
190
|
+
slot_index: UInt8;
|
|
182
191
|
yield: UInt16;
|
|
183
192
|
drain: UInt32;
|
|
184
193
|
depth: UInt16;
|
|
194
|
+
output_pct: UInt16;
|
|
185
195
|
}
|
|
186
|
-
class
|
|
196
|
+
class loader_lane extends Struct {
|
|
197
|
+
slot_index: UInt8;
|
|
187
198
|
mass: UInt32;
|
|
188
199
|
thrust: UInt16;
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
class hauler_stats extends Struct {
|
|
192
|
-
capacity: UInt8;
|
|
193
|
-
efficiency: UInt16;
|
|
194
|
-
drain: UInt32;
|
|
200
|
+
output_pct: UInt16;
|
|
195
201
|
}
|
|
196
202
|
class task extends Struct {
|
|
197
203
|
type: UInt8;
|
|
@@ -235,10 +241,10 @@ declare namespace Types {
|
|
|
235
241
|
engines?: movement_stats;
|
|
236
242
|
warp?: warp_stats;
|
|
237
243
|
generator?: energy_stats;
|
|
238
|
-
gatherer?: gatherer_stats;
|
|
239
|
-
loaders?: loader_stats;
|
|
240
244
|
hauler?: hauler_stats;
|
|
241
|
-
|
|
245
|
+
gatherer_lanes: gatherer_lane[];
|
|
246
|
+
crafter_lanes: crafter_lane[];
|
|
247
|
+
loader_lanes: loader_lane[];
|
|
242
248
|
lanes: lane[];
|
|
243
249
|
holds: hold[];
|
|
244
250
|
}
|
|
@@ -314,6 +320,7 @@ declare namespace Types {
|
|
|
314
320
|
destination_id: UInt64;
|
|
315
321
|
stratum: UInt16;
|
|
316
322
|
quantity: UInt32;
|
|
323
|
+
slot?: UInt8;
|
|
317
324
|
}
|
|
318
325
|
class genesisfleet extends Struct {
|
|
319
326
|
entities: entity_row[];
|
|
@@ -324,6 +331,12 @@ declare namespace Types {
|
|
|
324
331
|
owner: Name;
|
|
325
332
|
asset_id: UInt64;
|
|
326
333
|
}
|
|
334
|
+
class getdistance extends Struct {
|
|
335
|
+
ax: Int64;
|
|
336
|
+
ay: Int64;
|
|
337
|
+
bx: Int64;
|
|
338
|
+
by: Int64;
|
|
339
|
+
}
|
|
327
340
|
class geteligible extends Struct {
|
|
328
341
|
coords: coordinates;
|
|
329
342
|
stratum: UInt16;
|
|
@@ -403,6 +416,17 @@ declare namespace Types {
|
|
|
403
416
|
owner: Name;
|
|
404
417
|
entity_type?: Name;
|
|
405
418
|
}
|
|
419
|
+
class getwormhole extends Struct {
|
|
420
|
+
x: Int64;
|
|
421
|
+
y: Int64;
|
|
422
|
+
}
|
|
423
|
+
class grouptransit extends Struct {
|
|
424
|
+
entities: entity_ref[];
|
|
425
|
+
ax: Int64;
|
|
426
|
+
ay: Int64;
|
|
427
|
+
bx: Int64;
|
|
428
|
+
by: Int64;
|
|
429
|
+
}
|
|
406
430
|
class grouptravel extends Struct {
|
|
407
431
|
entities: entity_ref[];
|
|
408
432
|
x: Int64;
|
|
@@ -525,6 +549,7 @@ declare namespace Types {
|
|
|
525
549
|
class location_info extends Struct {
|
|
526
550
|
coords: coordinates;
|
|
527
551
|
is_system: boolean;
|
|
552
|
+
is_wormhole: boolean;
|
|
528
553
|
}
|
|
529
554
|
class module_info extends Struct {
|
|
530
555
|
id: UInt16;
|
|
@@ -634,10 +659,10 @@ declare namespace Types {
|
|
|
634
659
|
engines?: movement_stats;
|
|
635
660
|
warp?: warp_stats;
|
|
636
661
|
generator?: energy_stats;
|
|
637
|
-
gatherer?: gatherer_stats;
|
|
638
|
-
loaders?: loader_stats;
|
|
639
662
|
hauler?: hauler_stats;
|
|
640
|
-
|
|
663
|
+
gatherer_lanes: gatherer_lane[];
|
|
664
|
+
crafter_lanes: crafter_lane[];
|
|
665
|
+
loader_lanes: loader_lane[];
|
|
641
666
|
}
|
|
642
667
|
class recharge extends Struct {
|
|
643
668
|
id: UInt64;
|
|
@@ -704,6 +729,11 @@ declare namespace Types {
|
|
|
704
729
|
class rmnftcfg extends Struct {
|
|
705
730
|
item_id: UInt16;
|
|
706
731
|
}
|
|
732
|
+
class setcoords extends Struct {
|
|
733
|
+
entity_id: UInt64;
|
|
734
|
+
x: Int64;
|
|
735
|
+
y: Int64;
|
|
736
|
+
}
|
|
707
737
|
class setnftcfg extends Struct {
|
|
708
738
|
item_id: UInt16;
|
|
709
739
|
template_id: Int32;
|
|
@@ -757,6 +787,13 @@ declare namespace Types {
|
|
|
757
787
|
class task_results extends Struct {
|
|
758
788
|
entities: entity_task_info[];
|
|
759
789
|
}
|
|
790
|
+
class transit extends Struct {
|
|
791
|
+
id: UInt64;
|
|
792
|
+
ax: Int64;
|
|
793
|
+
ay: Int64;
|
|
794
|
+
bx: Int64;
|
|
795
|
+
by: Int64;
|
|
796
|
+
}
|
|
760
797
|
class travel extends Struct {
|
|
761
798
|
id: UInt64;
|
|
762
799
|
x: Int64;
|
|
@@ -786,6 +823,11 @@ declare namespace Types {
|
|
|
786
823
|
}
|
|
787
824
|
class wipe extends Struct {
|
|
788
825
|
}
|
|
826
|
+
class wormhole_info extends Struct {
|
|
827
|
+
coords: coordinates;
|
|
828
|
+
is_wormhole: boolean;
|
|
829
|
+
destination: coordinates;
|
|
830
|
+
}
|
|
789
831
|
class wrapconfig_row extends Struct {
|
|
790
832
|
fee_pct: UInt16;
|
|
791
833
|
fee_account: Name;
|
|
@@ -807,14 +849,49 @@ declare class Coordinates extends Types.coordinates {
|
|
|
807
849
|
toLocationId(): UInt64;
|
|
808
850
|
}
|
|
809
851
|
|
|
852
|
+
interface LoaderStats {
|
|
853
|
+
mass: {
|
|
854
|
+
toNumber(): number;
|
|
855
|
+
multiplying(v: unknown): {
|
|
856
|
+
toNumber(): number;
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
thrust: {
|
|
860
|
+
toNumber(): number;
|
|
861
|
+
};
|
|
862
|
+
quantity: {
|
|
863
|
+
toNumber(): number;
|
|
864
|
+
gt(v: unknown): boolean;
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
interface GathererStats {
|
|
868
|
+
yield: {
|
|
869
|
+
toNumber(): number;
|
|
870
|
+
};
|
|
871
|
+
drain: {
|
|
872
|
+
toNumber(): number;
|
|
873
|
+
};
|
|
874
|
+
depth: {
|
|
875
|
+
toNumber(): number;
|
|
876
|
+
toString(): string;
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
interface CrafterStats {
|
|
880
|
+
speed: {
|
|
881
|
+
toNumber(): number;
|
|
882
|
+
};
|
|
883
|
+
drain: {
|
|
884
|
+
toNumber(): number;
|
|
885
|
+
};
|
|
886
|
+
}
|
|
810
887
|
interface EntityCapabilities {
|
|
811
888
|
hullmass?: UInt32;
|
|
812
889
|
capacity?: UInt32;
|
|
813
890
|
engines?: Types.movement_stats;
|
|
814
891
|
generator?: Types.energy_stats;
|
|
815
|
-
loaders?:
|
|
816
|
-
gatherer?:
|
|
817
|
-
crafter?:
|
|
892
|
+
loaders?: LoaderStats;
|
|
893
|
+
gatherer?: GathererStats;
|
|
894
|
+
crafter?: CrafterStats;
|
|
818
895
|
hauler?: Types.hauler_stats;
|
|
819
896
|
}
|
|
820
897
|
interface EntityState {
|
|
@@ -839,11 +916,13 @@ interface ProjectedEntity {
|
|
|
839
916
|
shipMass: UInt32;
|
|
840
917
|
capacity?: UInt64;
|
|
841
918
|
engines?: Types.movement_stats;
|
|
842
|
-
|
|
919
|
+
loaderLanes: Types.loader_lane[];
|
|
843
920
|
generator?: Types.energy_stats;
|
|
844
921
|
hauler?: Types.hauler_stats;
|
|
845
922
|
readonly cargoMass: UInt64;
|
|
846
923
|
readonly totalMass: UInt64;
|
|
924
|
+
readonly gathererLanes: Types.gatherer_lane[];
|
|
925
|
+
readonly crafterLanes: Types.crafter_lane[];
|
|
847
926
|
hasMovement(): boolean;
|
|
848
927
|
hasStorage(): boolean;
|
|
849
928
|
hasLoaders(): boolean;
|
|
@@ -862,9 +941,11 @@ interface ContractProjectedState {
|
|
|
862
941
|
hullmass?: UInt32;
|
|
863
942
|
capacity?: UInt32;
|
|
864
943
|
engines?: Types.movement_stats;
|
|
865
|
-
loaders?: Types.loader_stats;
|
|
866
944
|
generator?: Types.energy_stats;
|
|
867
945
|
hauler?: Types.hauler_stats;
|
|
946
|
+
gatherer_lanes: Types.gatherer_lane[];
|
|
947
|
+
crafter_lanes: Types.crafter_lane[];
|
|
948
|
+
loader_lanes: Types.loader_lane[];
|
|
868
949
|
}
|
|
869
950
|
interface ProjectionComparisonOptions {
|
|
870
951
|
step?: number;
|