@shipload/sdk 1.0.0-next.50 → 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.
Files changed (58) hide show
  1. package/lib/shipload.d.ts +544 -149
  2. package/lib/shipload.js +2424 -448
  3. package/lib/shipload.js.map +1 -1
  4. package/lib/shipload.m.js +2390 -447
  5. package/lib/shipload.m.js.map +1 -1
  6. package/lib/testing.d.ts +131 -7
  7. package/lib/testing.js +469 -11
  8. package/lib/testing.js.map +1 -1
  9. package/lib/testing.m.js +470 -12
  10. package/lib/testing.m.js.map +1 -1
  11. package/package.json +1 -1
  12. package/src/capabilities/crafting.ts +10 -1
  13. package/src/capabilities/gathering.ts +1 -1
  14. package/src/capabilities/hauling.ts +0 -5
  15. package/src/capabilities/modules.ts +6 -0
  16. package/src/capabilities/movement.ts +1 -1
  17. package/src/contracts/server.ts +315 -8
  18. package/src/data/capabilities.ts +11 -2
  19. package/src/data/entities.json +235 -20
  20. package/src/data/item-ids.ts +10 -0
  21. package/src/data/items.json +61 -0
  22. package/src/data/kind-registry.json +53 -1
  23. package/src/data/kind-registry.ts +5 -0
  24. package/src/data/metadata.ts +74 -5
  25. package/src/data/recipes-runtime.ts +1 -0
  26. package/src/data/recipes.json +887 -118
  27. package/src/derivation/capabilities.test.ts +81 -4
  28. package/src/derivation/capabilities.ts +162 -57
  29. package/src/derivation/crafting.ts +2 -0
  30. package/src/derivation/recipe-usage.test.ts +10 -7
  31. package/src/derivation/rollups.ts +16 -0
  32. package/src/derivation/stat-scaling.ts +12 -0
  33. package/src/entities/makers.ts +10 -1
  34. package/src/index-module.ts +33 -3
  35. package/src/managers/actions.ts +89 -44
  36. package/src/managers/construction-types.ts +2 -2
  37. package/src/managers/construction.ts +15 -15
  38. package/src/managers/plot.ts +1 -1
  39. package/src/nft/buildImmutableData.ts +55 -9
  40. package/src/nft/description.ts +99 -36
  41. package/src/planner/planner.test.ts +50 -41
  42. package/src/resolution/resolve-item.test.ts +1 -1
  43. package/src/resolution/resolve-item.ts +26 -11
  44. package/src/scheduling/availability.ts +7 -6
  45. package/src/scheduling/cancel.test.ts +40 -6
  46. package/src/scheduling/cancel.ts +21 -29
  47. package/src/scheduling/jobs.ts +71 -0
  48. package/src/scheduling/lanes.ts +29 -0
  49. package/src/scheduling/projection.ts +42 -25
  50. package/src/scheduling/task-cargo.ts +1 -1
  51. package/src/testing/projection-parity.ts +2 -2
  52. package/src/travel/reach.ts +4 -6
  53. package/src/travel/route-planner.ts +60 -49
  54. package/src/travel/route-simulator.ts +170 -0
  55. package/src/travel/travel.ts +40 -5
  56. package/src/types/capabilities.ts +9 -3
  57. package/src/types.ts +8 -3
  58. 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, BlockTimestamp, Bytes, Int32, Int64Type } from '@wharfkit/antelope';
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
- entitytarget?: entity_ref;
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: UInt8;
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;
@@ -785,6 +869,20 @@ declare namespace Types {
785
869
  class rmnftcfg extends Struct {
786
870
  item_id: UInt16;
787
871
  }
872
+ class route_waypoint extends Struct {
873
+ x: Int64;
874
+ y: Int64;
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
+ }
788
886
  class setcoords extends Struct {
789
887
  entity_id: UInt64;
790
888
  x: Int64;
@@ -795,6 +893,11 @@ declare namespace Types {
795
893
  template_id: Int32;
796
894
  schema_name: Name;
797
895
  }
896
+ class setsocket extends Struct {
897
+ workshop_id: UInt64;
898
+ slot: UInt8;
899
+ open: boolean;
900
+ }
798
901
  class setthreshold extends Struct {
799
902
  threshold: UInt8;
800
903
  }
@@ -807,6 +910,12 @@ declare namespace Types {
807
910
  fee_pct: UInt16;
808
911
  fee_account: Name;
809
912
  }
913
+ class shuttle extends Struct {
914
+ carrier: UInt64;
915
+ from_id: UInt64;
916
+ to_id: UInt64;
917
+ items: cargo_item[];
918
+ }
810
919
  class stowcargo extends Struct {
811
920
  owner: Name;
812
921
  entity_id: UInt64;
@@ -863,6 +972,11 @@ declare namespace Types {
863
972
  y: Int64;
864
973
  recharge: boolean;
865
974
  }
975
+ class travelplan extends Struct {
976
+ entities: entity_ref[];
977
+ waypoints: route_waypoint[];
978
+ recharge: boolean;
979
+ }
866
980
  class types_row extends Struct {
867
981
  id: UInt64;
868
982
  entity_summary_type: entity_summary;
@@ -954,6 +1068,14 @@ interface CrafterStats {
954
1068
  toNumber(): number;
955
1069
  };
956
1070
  }
1071
+ interface BuilderStats {
1072
+ speed: {
1073
+ toNumber(): number;
1074
+ };
1075
+ drain: {
1076
+ toNumber(): number;
1077
+ };
1078
+ }
957
1079
  interface EntityCapabilities {
958
1080
  hullmass?: UInt32;
959
1081
  capacity?: UInt32;
@@ -962,13 +1084,14 @@ interface EntityCapabilities {
962
1084
  loaders?: LoaderStats;
963
1085
  gatherer?: GathererStats;
964
1086
  crafter?: CrafterStats;
1087
+ builder?: BuilderStats;
965
1088
  hauler?: Types.hauler_stats;
966
1089
  launcher?: Types.launcher_stats;
967
1090
  }
968
1091
  interface EntityState {
969
1092
  owner: Name;
970
1093
  location: Types.coordinates;
971
- energy?: UInt16;
1094
+ energy?: UInt32;
972
1095
  cargomass: UInt32;
973
1096
  cargo: Types.cargo_item[];
974
1097
  }
@@ -982,7 +1105,7 @@ interface CargoStack {
982
1105
 
983
1106
  interface ProjectedEntity {
984
1107
  location: Coordinates;
985
- energy: UInt16;
1108
+ energy: UInt32;
986
1109
  cargo: CargoStack[];
987
1110
  shipMass: UInt32;
988
1111
  capacity?: UInt64;
@@ -995,6 +1118,7 @@ interface ProjectedEntity {
995
1118
  readonly totalMass: UInt64;
996
1119
  readonly gathererLanes: Types.gatherer_lane[];
997
1120
  readonly crafterLanes: Types.crafter_lane[];
1121
+ readonly builderLanes: Types.builder_lane[];
998
1122
  hasMovement(): boolean;
999
1123
  hasStorage(): boolean;
1000
1124
  hasLoaders(): boolean;
@@ -1008,7 +1132,7 @@ interface ContractProjectedState {
1008
1132
  toString(): string;
1009
1133
  };
1010
1134
  coordinates: Types.coordinates;
1011
- energy?: UInt16;
1135
+ energy?: UInt32;
1012
1136
  cargomass: UInt32;
1013
1137
  cargo: Types.cargo_view[];
1014
1138
  hullmass?: UInt32;