@shipload/sdk 1.0.0-next.51 → 1.0.0-next.52
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 +470 -157
- package/lib/shipload.js +2309 -492
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +2279 -491
- package/lib/shipload.m.js.map +1 -1
- package/lib/testing.d.ts +123 -8
- package/lib/testing.js +450 -19
- package/lib/testing.js.map +1 -1
- package/lib/testing.m.js +451 -20
- package/lib/testing.m.js.map +1 -1
- package/package.json +1 -1
- package/src/capabilities/crafting.ts +10 -1
- package/src/capabilities/gathering.ts +1 -1
- package/src/capabilities/hauling.ts +0 -5
- package/src/capabilities/modules.ts +6 -0
- package/src/capabilities/movement.ts +1 -1
- package/src/contracts/server.ts +293 -13
- package/src/data/capabilities.ts +11 -2
- package/src/data/entities.json +235 -20
- package/src/data/item-ids.ts +10 -0
- package/src/data/items.json +61 -0
- package/src/data/kind-registry.json +53 -1
- package/src/data/kind-registry.ts +5 -0
- package/src/data/metadata.ts +74 -5
- package/src/data/recipes-runtime.ts +1 -0
- package/src/data/recipes.json +887 -118
- package/src/derivation/capabilities.test.ts +81 -4
- package/src/derivation/capabilities.ts +162 -57
- package/src/derivation/crafting.ts +2 -0
- package/src/derivation/recipe-usage.test.ts +10 -7
- package/src/derivation/rollups.ts +16 -0
- package/src/derivation/stat-scaling.ts +12 -0
- package/src/entities/makers.ts +10 -1
- package/src/index-module.ts +29 -3
- package/src/managers/actions.ts +77 -46
- package/src/managers/construction-types.ts +2 -2
- package/src/managers/construction.ts +15 -15
- package/src/managers/plot.ts +1 -1
- package/src/nft/buildImmutableData.ts +55 -9
- package/src/nft/description.ts +99 -36
- package/src/planner/planner.test.ts +50 -41
- package/src/resolution/resolve-item.test.ts +1 -1
- package/src/resolution/resolve-item.ts +26 -11
- package/src/scheduling/availability.ts +7 -6
- package/src/scheduling/cancel.test.ts +40 -6
- package/src/scheduling/cancel.ts +21 -29
- package/src/scheduling/jobs.ts +71 -0
- package/src/scheduling/lanes.ts +29 -0
- package/src/scheduling/projection.ts +42 -25
- package/src/scheduling/task-cargo.ts +1 -1
- package/src/testing/projection-parity.ts +2 -2
- package/src/travel/reach.ts +4 -6
- package/src/travel/route-planner.ts +60 -49
- package/src/travel/route-simulator.ts +3 -7
- package/src/travel/travel.ts +14 -5
- package/src/types/capabilities.ts +9 -3
- package/src/types.ts +5 -3
- package/src/managers/flatten-gather-plan.test.ts +0 -80
package/lib/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Struct, UInt16, UInt64, UInt8, Int64, Name, UInt32, TimePoint, Int8, Checksum256,
|
|
1
|
+
import { Struct, UInt16, UInt64, UInt8, Int64, Name, UInt32, TimePoint, Int8, Checksum256, Bytes, BlockTimestamp, Int32, Int64Type } from '@wharfkit/antelope';
|
|
2
2
|
|
|
3
3
|
declare const CATALOG_FILES_REL: readonly ["items.json", "recipes.json", "entities.json", "kind-registry.json", "item-ids.ts"];
|
|
4
4
|
declare function computeCatalogHash(filePaths: ReadonlyArray<string>): string;
|
|
@@ -43,6 +43,12 @@ declare namespace Types {
|
|
|
43
43
|
id: UInt64;
|
|
44
44
|
inputs: cargo_item[];
|
|
45
45
|
}
|
|
46
|
+
class builder_lane extends Struct {
|
|
47
|
+
slot_index: UInt8;
|
|
48
|
+
speed: UInt16;
|
|
49
|
+
drain: UInt32;
|
|
50
|
+
output_pct: UInt16;
|
|
51
|
+
}
|
|
46
52
|
class buildplot extends Struct {
|
|
47
53
|
builder_id: UInt64;
|
|
48
54
|
plot_id: UInt64;
|
|
@@ -64,6 +70,10 @@ declare namespace Types {
|
|
|
64
70
|
entitygroup?: UInt64;
|
|
65
71
|
group_members?: entity_ref[];
|
|
66
72
|
}
|
|
73
|
+
class canceljob extends Struct {
|
|
74
|
+
job_id: UInt64;
|
|
75
|
+
ship_id: UInt64;
|
|
76
|
+
}
|
|
67
77
|
class cargo_row extends Struct {
|
|
68
78
|
id: UInt64;
|
|
69
79
|
entity_id: UInt64;
|
|
@@ -81,9 +91,16 @@ declare namespace Types {
|
|
|
81
91
|
id: UInt64;
|
|
82
92
|
entity_id?: UInt64;
|
|
83
93
|
}
|
|
94
|
+
class civicconfig_row extends Struct {
|
|
95
|
+
civic_owner: Name;
|
|
96
|
+
}
|
|
84
97
|
class claim_row extends Struct {
|
|
85
98
|
owner: Name;
|
|
86
99
|
}
|
|
100
|
+
class claimjob extends Struct {
|
|
101
|
+
job_id: UInt64;
|
|
102
|
+
ship_id: UInt64;
|
|
103
|
+
}
|
|
87
104
|
class cluster_slot extends Struct {
|
|
88
105
|
hub: UInt64;
|
|
89
106
|
gx: Int8;
|
|
@@ -150,6 +167,11 @@ declare namespace Types {
|
|
|
150
167
|
y: Int64;
|
|
151
168
|
z?: UInt16;
|
|
152
169
|
}
|
|
170
|
+
class coupling extends Struct {
|
|
171
|
+
counterpart: entity_ref;
|
|
172
|
+
hold: UInt64;
|
|
173
|
+
kind: UInt8;
|
|
174
|
+
}
|
|
153
175
|
class craft extends Struct {
|
|
154
176
|
id: UInt64;
|
|
155
177
|
recipe_id: UInt16;
|
|
@@ -164,6 +186,17 @@ declare namespace Types {
|
|
|
164
186
|
drain: UInt32;
|
|
165
187
|
output_pct: UInt16;
|
|
166
188
|
}
|
|
189
|
+
class craftjob extends Struct {
|
|
190
|
+
ship_id: UInt64;
|
|
191
|
+
workshop_id: UInt64;
|
|
192
|
+
slot: UInt8;
|
|
193
|
+
recipe_id: UInt16;
|
|
194
|
+
quantity: UInt32;
|
|
195
|
+
inputs: cargo_item[];
|
|
196
|
+
}
|
|
197
|
+
class delentity extends Struct {
|
|
198
|
+
entity_id: UInt64;
|
|
199
|
+
}
|
|
167
200
|
class demolish extends Struct {
|
|
168
201
|
entity_id: UInt64;
|
|
169
202
|
}
|
|
@@ -230,10 +263,10 @@ declare namespace Types {
|
|
|
230
263
|
cancelable: UInt8;
|
|
231
264
|
coordinates?: coordinates;
|
|
232
265
|
cargo: cargo_item[];
|
|
233
|
-
|
|
266
|
+
couplings: coupling[];
|
|
267
|
+
subject?: entity_ref;
|
|
234
268
|
entitygroup?: UInt64;
|
|
235
269
|
energy_cost?: UInt32;
|
|
236
|
-
hold?: UInt64;
|
|
237
270
|
target_item_id?: UInt16;
|
|
238
271
|
}
|
|
239
272
|
class schedule extends Struct {
|
|
@@ -270,6 +303,7 @@ declare namespace Types {
|
|
|
270
303
|
hauler?: hauler_stats;
|
|
271
304
|
gatherer_lanes: gatherer_lane[];
|
|
272
305
|
crafter_lanes: crafter_lane[];
|
|
306
|
+
builder_lanes: builder_lane[];
|
|
273
307
|
loader_lanes: loader_lane[];
|
|
274
308
|
launcher?: launcher_stats;
|
|
275
309
|
lanes: lane[];
|
|
@@ -283,6 +317,7 @@ declare namespace Types {
|
|
|
283
317
|
class entity_layout extends Struct {
|
|
284
318
|
entity_item_id: UInt16;
|
|
285
319
|
slots: slot_def[];
|
|
320
|
+
base_hullmass: UInt32;
|
|
286
321
|
}
|
|
287
322
|
class entity_layouts_result extends Struct {
|
|
288
323
|
entities: entity_layout[];
|
|
@@ -317,7 +352,7 @@ declare namespace Types {
|
|
|
317
352
|
class entity_task_info extends Struct {
|
|
318
353
|
entity_id: UInt64;
|
|
319
354
|
entity_type: Name;
|
|
320
|
-
task_count:
|
|
355
|
+
task_count: UInt32;
|
|
321
356
|
schedule_started: TimePoint;
|
|
322
357
|
}
|
|
323
358
|
class entitygroup_row extends Struct {
|
|
@@ -357,6 +392,14 @@ declare namespace Types {
|
|
|
357
392
|
quantity: UInt32;
|
|
358
393
|
slot?: UInt8;
|
|
359
394
|
}
|
|
395
|
+
class gatherplan extends Struct {
|
|
396
|
+
source_id: UInt64;
|
|
397
|
+
destination_id: UInt64;
|
|
398
|
+
stratum: UInt16;
|
|
399
|
+
quantity: UInt32;
|
|
400
|
+
recharge: boolean;
|
|
401
|
+
slots: Bytes;
|
|
402
|
+
}
|
|
360
403
|
class genesisfleet extends Struct {
|
|
361
404
|
entities: entity_row[];
|
|
362
405
|
}
|
|
@@ -402,6 +445,9 @@ declare namespace Types {
|
|
|
402
445
|
}
|
|
403
446
|
class getitemtypes extends Struct {
|
|
404
447
|
}
|
|
448
|
+
class getjobs extends Struct {
|
|
449
|
+
workshop_id: UInt64;
|
|
450
|
+
}
|
|
405
451
|
class getkindmeta extends Struct {
|
|
406
452
|
}
|
|
407
453
|
class getlocation extends Struct {
|
|
@@ -446,6 +492,9 @@ declare namespace Types {
|
|
|
446
492
|
}
|
|
447
493
|
class getresources extends Struct {
|
|
448
494
|
}
|
|
495
|
+
class getservice extends Struct {
|
|
496
|
+
workshop_id: UInt64;
|
|
497
|
+
}
|
|
449
498
|
class getslots extends Struct {
|
|
450
499
|
}
|
|
451
500
|
class getstratum extends Struct {
|
|
@@ -483,6 +532,12 @@ declare namespace Types {
|
|
|
483
532
|
class importcargo extends Struct {
|
|
484
533
|
row: cargo_row;
|
|
485
534
|
}
|
|
535
|
+
class importcell extends Struct {
|
|
536
|
+
root: UInt64;
|
|
537
|
+
gx: Int8;
|
|
538
|
+
gy: Int8;
|
|
539
|
+
entity_id: UInt64;
|
|
540
|
+
}
|
|
486
541
|
class importentity extends Struct {
|
|
487
542
|
row: entity_row;
|
|
488
543
|
}
|
|
@@ -553,6 +608,28 @@ declare namespace Types {
|
|
|
553
608
|
class items_info extends Struct {
|
|
554
609
|
items: item_def[];
|
|
555
610
|
}
|
|
611
|
+
class job_receipt extends Struct {
|
|
612
|
+
job_id: UInt64;
|
|
613
|
+
starts_at: TimePoint;
|
|
614
|
+
completes_at: TimePoint;
|
|
615
|
+
}
|
|
616
|
+
class job_row extends Struct {
|
|
617
|
+
id: UInt64;
|
|
618
|
+
workshop: UInt64;
|
|
619
|
+
socket: UInt8;
|
|
620
|
+
owner: Name;
|
|
621
|
+
ship_id: UInt64;
|
|
622
|
+
coords: coordinates;
|
|
623
|
+
starts_at: TimePoint;
|
|
624
|
+
completes_at: TimePoint;
|
|
625
|
+
recipe_id: UInt16;
|
|
626
|
+
quantity: UInt32;
|
|
627
|
+
energy_paid: UInt32;
|
|
628
|
+
cargo: cargo_item[];
|
|
629
|
+
}
|
|
630
|
+
class jobs_result extends Struct {
|
|
631
|
+
jobs: job_row[];
|
|
632
|
+
}
|
|
556
633
|
class join extends Struct {
|
|
557
634
|
account: Name;
|
|
558
635
|
}
|
|
@@ -598,6 +675,12 @@ declare namespace Types {
|
|
|
598
675
|
is_system: boolean;
|
|
599
676
|
is_wormhole: boolean;
|
|
600
677
|
}
|
|
678
|
+
class migratetasks extends Struct {
|
|
679
|
+
batch: UInt32;
|
|
680
|
+
}
|
|
681
|
+
class migswap extends Struct {
|
|
682
|
+
batch: UInt32;
|
|
683
|
+
}
|
|
601
684
|
class module_info extends Struct {
|
|
602
685
|
id: UInt16;
|
|
603
686
|
mass: UInt32;
|
|
@@ -716,6 +799,7 @@ declare namespace Types {
|
|
|
716
799
|
hauler?: hauler_stats;
|
|
717
800
|
gatherer_lanes: gatherer_lane[];
|
|
718
801
|
crafter_lanes: crafter_lane[];
|
|
802
|
+
builder_lanes: builder_lane[];
|
|
719
803
|
loader_lanes: loader_lane[];
|
|
720
804
|
launcher?: launcher_stats;
|
|
721
805
|
tier: UInt8;
|
|
@@ -789,6 +873,16 @@ declare namespace Types {
|
|
|
789
873
|
x: Int64;
|
|
790
874
|
y: Int64;
|
|
791
875
|
}
|
|
876
|
+
class service_socket extends Struct {
|
|
877
|
+
open: boolean;
|
|
878
|
+
}
|
|
879
|
+
class service_row extends Struct {
|
|
880
|
+
entity: UInt64;
|
|
881
|
+
sockets: service_socket[];
|
|
882
|
+
}
|
|
883
|
+
class setcivic extends Struct {
|
|
884
|
+
account: Name;
|
|
885
|
+
}
|
|
792
886
|
class setcoords extends Struct {
|
|
793
887
|
entity_id: UInt64;
|
|
794
888
|
x: Int64;
|
|
@@ -799,6 +893,11 @@ declare namespace Types {
|
|
|
799
893
|
template_id: Int32;
|
|
800
894
|
schema_name: Name;
|
|
801
895
|
}
|
|
896
|
+
class setsocket extends Struct {
|
|
897
|
+
workshop_id: UInt64;
|
|
898
|
+
slot: UInt8;
|
|
899
|
+
open: boolean;
|
|
900
|
+
}
|
|
802
901
|
class setthreshold extends Struct {
|
|
803
902
|
threshold: UInt8;
|
|
804
903
|
}
|
|
@@ -811,6 +910,12 @@ declare namespace Types {
|
|
|
811
910
|
fee_pct: UInt16;
|
|
812
911
|
fee_account: Name;
|
|
813
912
|
}
|
|
913
|
+
class shuttle extends Struct {
|
|
914
|
+
carrier: UInt64;
|
|
915
|
+
from_id: UInt64;
|
|
916
|
+
to_id: UInt64;
|
|
917
|
+
items: cargo_item[];
|
|
918
|
+
}
|
|
814
919
|
class stowcargo extends Struct {
|
|
815
920
|
owner: Name;
|
|
816
921
|
entity_id: UInt64;
|
|
@@ -867,7 +972,7 @@ declare namespace Types {
|
|
|
867
972
|
y: Int64;
|
|
868
973
|
recharge: boolean;
|
|
869
974
|
}
|
|
870
|
-
class
|
|
975
|
+
class travelplan extends Struct {
|
|
871
976
|
entities: entity_ref[];
|
|
872
977
|
waypoints: route_waypoint[];
|
|
873
978
|
recharge: boolean;
|
|
@@ -963,6 +1068,14 @@ interface CrafterStats {
|
|
|
963
1068
|
toNumber(): number;
|
|
964
1069
|
};
|
|
965
1070
|
}
|
|
1071
|
+
interface BuilderStats {
|
|
1072
|
+
speed: {
|
|
1073
|
+
toNumber(): number;
|
|
1074
|
+
};
|
|
1075
|
+
drain: {
|
|
1076
|
+
toNumber(): number;
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
966
1079
|
interface EntityCapabilities {
|
|
967
1080
|
hullmass?: UInt32;
|
|
968
1081
|
capacity?: UInt32;
|
|
@@ -971,13 +1084,14 @@ interface EntityCapabilities {
|
|
|
971
1084
|
loaders?: LoaderStats;
|
|
972
1085
|
gatherer?: GathererStats;
|
|
973
1086
|
crafter?: CrafterStats;
|
|
1087
|
+
builder?: BuilderStats;
|
|
974
1088
|
hauler?: Types.hauler_stats;
|
|
975
1089
|
launcher?: Types.launcher_stats;
|
|
976
1090
|
}
|
|
977
1091
|
interface EntityState {
|
|
978
1092
|
owner: Name;
|
|
979
1093
|
location: Types.coordinates;
|
|
980
|
-
energy?:
|
|
1094
|
+
energy?: UInt32;
|
|
981
1095
|
cargomass: UInt32;
|
|
982
1096
|
cargo: Types.cargo_item[];
|
|
983
1097
|
}
|
|
@@ -991,7 +1105,7 @@ interface CargoStack {
|
|
|
991
1105
|
|
|
992
1106
|
interface ProjectedEntity {
|
|
993
1107
|
location: Coordinates;
|
|
994
|
-
energy:
|
|
1108
|
+
energy: UInt32;
|
|
995
1109
|
cargo: CargoStack[];
|
|
996
1110
|
shipMass: UInt32;
|
|
997
1111
|
capacity?: UInt64;
|
|
@@ -1004,6 +1118,7 @@ interface ProjectedEntity {
|
|
|
1004
1118
|
readonly totalMass: UInt64;
|
|
1005
1119
|
readonly gathererLanes: Types.gatherer_lane[];
|
|
1006
1120
|
readonly crafterLanes: Types.crafter_lane[];
|
|
1121
|
+
readonly builderLanes: Types.builder_lane[];
|
|
1007
1122
|
hasMovement(): boolean;
|
|
1008
1123
|
hasStorage(): boolean;
|
|
1009
1124
|
hasLoaders(): boolean;
|
|
@@ -1017,7 +1132,7 @@ interface ContractProjectedState {
|
|
|
1017
1132
|
toString(): string;
|
|
1018
1133
|
};
|
|
1019
1134
|
coordinates: Types.coordinates;
|
|
1020
|
-
energy?:
|
|
1135
|
+
energy?: UInt32;
|
|
1021
1136
|
cargomass: UInt32;
|
|
1022
1137
|
cargo: Types.cargo_view[];
|
|
1023
1138
|
hullmass?: UInt32;
|