@shipload/sdk 1.0.0-next.73 → 1.0.0-next.75

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 (42) hide show
  1. package/lib/shipload.d.ts +514 -127
  2. package/lib/shipload.js +5952 -4948
  3. package/lib/shipload.js.map +1 -1
  4. package/lib/shipload.m.js +5936 -4942
  5. package/lib/shipload.m.js.map +1 -1
  6. package/lib/testing.d.ts +174 -47
  7. package/lib/testing.js +539 -147
  8. package/lib/testing.js.map +1 -1
  9. package/lib/testing.m.js +539 -147
  10. package/lib/testing.m.js.map +1 -1
  11. package/package.json +1 -1
  12. package/src/contracts/server.ts +457 -134
  13. package/src/data/component-process.test.ts +119 -0
  14. package/src/data/component-process.ts +33 -0
  15. package/src/data/entities.json +2 -2
  16. package/src/data/metadata.ts +18 -5
  17. package/src/index-module.ts +29 -2
  18. package/src/influence/civic-shuttle.test.ts +58 -0
  19. package/src/influence/civic-shuttle.ts +52 -6
  20. package/src/influence/duration.ts +0 -65
  21. package/src/influence/index.ts +4 -5
  22. package/src/influence/influence.test.ts +51 -136
  23. package/src/influence/valuation.ts +75 -0
  24. package/src/managers/actions.ts +37 -10
  25. package/src/managers/balances.test.ts +33 -0
  26. package/src/managers/balances.ts +15 -0
  27. package/src/managers/context.ts +50 -11
  28. package/src/managers/index.ts +14 -0
  29. package/src/managers/jobs.test.ts +82 -1
  30. package/src/managers/jobs.ts +41 -2
  31. package/src/managers/nft.test.ts +173 -1
  32. package/src/managers/nft.ts +35 -2
  33. package/src/managers/shuttle.test.ts +562 -0
  34. package/src/managers/shuttle.ts +397 -0
  35. package/src/resolution/resolve-item.ts +4 -0
  36. package/src/scheduling/availability.ts +10 -0
  37. package/src/scheduling/energy.ts +55 -1
  38. package/src/scheduling/jobs.test.ts +171 -1
  39. package/src/scheduling/jobs.ts +110 -13
  40. package/src/scheduling/projection.ts +2 -1
  41. package/src/scheduling/task-effects.ts +38 -0
  42. package/src/shipload.ts +23 -4
package/lib/testing.d.ts CHANGED
@@ -49,6 +49,56 @@ declare namespace Types {
49
49
  class addoracle extends Struct {
50
50
  oracle_id: Name;
51
51
  }
52
+ class placement extends Struct {
53
+ task_index: UInt8;
54
+ starts_at: TimePoint;
55
+ completes_at: TimePoint;
56
+ schedule_started: TimePoint;
57
+ }
58
+ class coordinates extends Struct {
59
+ x: Int64;
60
+ y: Int64;
61
+ z?: UInt16;
62
+ }
63
+ class entity_ref extends Struct {
64
+ entity_type: Name;
65
+ entity_id: UInt64;
66
+ }
67
+ class coupling extends Struct {
68
+ counterpart: entity_ref;
69
+ hold: UInt64;
70
+ kind: UInt8;
71
+ }
72
+ class refit_op extends Struct {
73
+ op: UInt8;
74
+ slot: UInt8;
75
+ }
76
+ class task extends Struct {
77
+ type: UInt8;
78
+ duration: UInt32;
79
+ cancelable: UInt8;
80
+ coordinates?: coordinates;
81
+ cargo: cargo_item[];
82
+ couplings: coupling[];
83
+ subject?: entity_ref;
84
+ entitygroup?: UInt64;
85
+ energy_cost?: UInt32;
86
+ target_item_id?: UInt16;
87
+ refit?: refit_op;
88
+ charter_node?: UInt32;
89
+ }
90
+ class schedule extends Struct {
91
+ started: TimePoint;
92
+ tasks: task[];
93
+ }
94
+ class lane extends Struct {
95
+ lane_key: UInt8;
96
+ schedule: schedule;
97
+ }
98
+ class append_result extends Struct {
99
+ placed: placement;
100
+ lanes: lane[];
101
+ }
52
102
  class ballot_credit extends Struct {
53
103
  account: Name;
54
104
  amount: UInt64;
@@ -107,11 +157,7 @@ declare namespace Types {
107
157
  dock_id: UInt64;
108
158
  target_item_id: UInt16;
109
159
  inputs: cargo_item[];
110
- }
111
- class coordinates extends Struct {
112
- x: Int64;
113
- y: Int64;
114
- z?: UInt16;
160
+ shuttled_by?: UInt64;
115
161
  }
116
162
  class buildjob_row extends Struct {
117
163
  id: UInt64;
@@ -139,10 +185,6 @@ declare namespace Types {
139
185
  lane_key: UInt8;
140
186
  count: UInt64;
141
187
  }
142
- class entity_ref extends Struct {
143
- entity_type: Name;
144
- entity_id: UInt64;
145
- }
146
188
  class cancel_results extends Struct {
147
189
  entity_id: UInt64;
148
190
  entity_type: Name;
@@ -153,6 +195,7 @@ declare namespace Types {
153
195
  }
154
196
  class cancelbuild extends Struct {
155
197
  job_id: UInt64;
198
+ shuttled_by?: UInt64;
156
199
  }
157
200
  class cancelcivic extends Struct {
158
201
  building: UInt64;
@@ -179,6 +222,17 @@ declare namespace Types {
179
222
  id: UInt64;
180
223
  entity_id?: UInt64;
181
224
  }
225
+ class cargoreserve_row extends Struct {
226
+ id: UInt64;
227
+ entity_id: UInt64;
228
+ hold: UInt64;
229
+ owner: Name;
230
+ item_id: UInt64;
231
+ quantity: UInt64;
232
+ stats: UInt64;
233
+ modules: module_entry[];
234
+ sequence_id?: UInt64;
235
+ }
182
236
  class castballot extends Struct {
183
237
  player: Name;
184
238
  ballot_id: UInt64;
@@ -267,6 +321,7 @@ declare namespace Types {
267
321
  class claimcraft extends Struct {
268
322
  job_id: UInt64;
269
323
  ship_id: UInt64;
324
+ shuttled_by?: UInt64;
270
325
  }
271
326
  class cluster_slot extends Struct {
272
327
  hub: UInt64;
@@ -344,11 +399,6 @@ declare namespace Types {
344
399
  class configlog extends Struct {
345
400
  config: game_config;
346
401
  }
347
- class coupling extends Struct {
348
- counterpart: entity_ref;
349
- hold: UInt64;
350
- kind: UInt8;
351
- }
352
402
  class craft extends Struct {
353
403
  id: UInt64;
354
404
  recipe_id: UInt16;
@@ -369,6 +419,7 @@ declare namespace Types {
369
419
  recipe_id: UInt16;
370
420
  quantity: UInt32;
371
421
  inputs: cargo_item[];
422
+ shuttled_by?: UInt64;
372
423
  }
373
424
  class craftjob_row extends Struct {
374
425
  id: UInt64;
@@ -389,6 +440,27 @@ declare namespace Types {
389
440
  class craftjobs_result extends Struct {
390
441
  jobs: craftjob_row[];
391
442
  }
443
+ class hold extends Struct {
444
+ id: UInt64;
445
+ kind: UInt8;
446
+ counterpart: entity_ref;
447
+ until: TimePoint;
448
+ incoming_mass: UInt32;
449
+ }
450
+ class dbgappend extends Struct {
451
+ lanes: lane[];
452
+ holds: hold[];
453
+ new_task: task;
454
+ lane_key: UInt8;
455
+ now: TimePoint;
456
+ min_starts_at?: TimePoint;
457
+ }
458
+ class dbgbarrier extends Struct {
459
+ lanes: lane[];
460
+ holds: hold[];
461
+ new_task: task;
462
+ lane_key: UInt8;
463
+ }
392
464
  class dbgcredit extends Struct {
393
465
  owner: Name;
394
466
  x: Int64;
@@ -445,6 +517,14 @@ declare namespace Types {
445
517
  y: Int64;
446
518
  seats: UInt32;
447
519
  }
520
+ class dbgstart extends Struct {
521
+ lanes: lane[];
522
+ holds: hold[];
523
+ new_task: task;
524
+ lane_key: UInt8;
525
+ now: TimePoint;
526
+ min_starts_at?: TimePoint;
527
+ }
448
528
  class decomp_bucket extends Struct {
449
529
  category: UInt8;
450
530
  tier: UInt8;
@@ -492,11 +572,13 @@ declare namespace Types {
492
572
  ship_id: UInt64;
493
573
  depot_id: UInt64;
494
574
  items: cargo_item[];
575
+ shuttled_by?: UInt64;
495
576
  }
496
577
  class depottake extends Struct {
497
578
  ship_id: UInt64;
498
579
  depot_id: UInt64;
499
580
  items: cargo_item[];
581
+ shuttled_by?: UInt64;
500
582
  }
501
583
  class descentity extends Struct {
502
584
  item_id: UInt16;
@@ -550,39 +632,6 @@ declare namespace Types {
550
632
  velocity: UInt16;
551
633
  drain: UInt16;
552
634
  }
553
- class refit_op extends Struct {
554
- op: UInt8;
555
- slot: UInt8;
556
- }
557
- class task extends Struct {
558
- type: UInt8;
559
- duration: UInt32;
560
- cancelable: UInt8;
561
- coordinates?: coordinates;
562
- cargo: cargo_item[];
563
- couplings: coupling[];
564
- subject?: entity_ref;
565
- entitygroup?: UInt64;
566
- energy_cost?: UInt32;
567
- target_item_id?: UInt16;
568
- refit?: refit_op;
569
- charter_node?: UInt32;
570
- }
571
- class schedule extends Struct {
572
- started: TimePoint;
573
- tasks: task[];
574
- }
575
- class lane extends Struct {
576
- lane_key: UInt8;
577
- schedule: schedule;
578
- }
579
- class hold extends Struct {
580
- id: UInt64;
581
- kind: UInt8;
582
- counterpart: entity_ref;
583
- until: TimePoint;
584
- incoming_mass: UInt32;
585
- }
586
635
  class entity_info extends Struct {
587
636
  type: Name;
588
637
  id: UInt64;
@@ -722,6 +771,17 @@ declare namespace Types {
722
771
  class getbuildjobs extends Struct {
723
772
  building_id: UInt64;
724
773
  }
774
+ class getbuildopts extends Struct {
775
+ target_id: UInt64;
776
+ dock_id: UInt64;
777
+ target_item_id: UInt16;
778
+ inputs: cargo_item[];
779
+ candidates: UInt64[];
780
+ }
781
+ class getcbldopts extends Struct {
782
+ job_id: UInt64;
783
+ candidates: UInt64[];
784
+ }
725
785
  class getcharter extends Struct {
726
786
  x: Int64;
727
787
  y: Int64;
@@ -730,6 +790,11 @@ declare namespace Types {
730
790
  }
731
791
  class getchrtready extends Struct {
732
792
  }
793
+ class getclaimopts extends Struct {
794
+ job_id: UInt64;
795
+ ship_id: UInt64;
796
+ candidates: UInt64[];
797
+ }
733
798
  class getcluster extends Struct {
734
799
  hub_id: UInt64;
735
800
  }
@@ -738,6 +803,15 @@ declare namespace Types {
738
803
  class getcraftjobs extends Struct {
739
804
  building_id: UInt64;
740
805
  }
806
+ class getcraftopts extends Struct {
807
+ ship_id: UInt64;
808
+ workshop_id: UInt64;
809
+ recipe_id: UInt16;
810
+ quantity: UInt32;
811
+ inputs: cargo_item[];
812
+ candidates: UInt64[];
813
+ recharge: boolean;
814
+ }
741
815
  class getdecomp extends Struct {
742
816
  item_id: UInt16;
743
817
  }
@@ -856,6 +930,12 @@ declare namespace Types {
856
930
  }
857
931
  class getslots extends Struct {
858
932
  }
933
+ class getstoreopts extends Struct {
934
+ ship_id: UInt64;
935
+ depot_id: UInt64;
936
+ items: cargo_item[];
937
+ candidates: UInt64[];
938
+ }
859
939
  class getstratum extends Struct {
860
940
  x: Int64;
861
941
  y: Int64;
@@ -865,6 +945,14 @@ declare namespace Types {
865
945
  owner: Name;
866
946
  entity_type?: Name;
867
947
  }
948
+ class gettakeopts extends Struct {
949
+ ship_id: UInt64;
950
+ depot_id: UInt64;
951
+ items: cargo_item[];
952
+ candidates: UInt64[];
953
+ }
954
+ class gettasktypes extends Struct {
955
+ }
868
956
  class getvoteready extends Struct {
869
957
  }
870
958
  class getvotes extends Struct {
@@ -1405,6 +1493,33 @@ declare namespace Types {
1405
1493
  to_id: UInt64;
1406
1494
  items: cargo_item[];
1407
1495
  }
1496
+ class shuttle_rejection extends Struct {
1497
+ reason: string;
1498
+ at?: TimePoint;
1499
+ until?: TimePoint;
1500
+ have?: UInt64;
1501
+ need?: UInt64;
1502
+ cap?: UInt64;
1503
+ task_type?: UInt8;
1504
+ }
1505
+ class shuttle_option extends Struct {
1506
+ shuttled_by?: UInt64;
1507
+ mode: UInt8;
1508
+ host_id: UInt64;
1509
+ lane_key: UInt8;
1510
+ duration: UInt32;
1511
+ start: TimePoint;
1512
+ finish: TimePoint;
1513
+ bays: UInt8;
1514
+ window_starts_at?: TimePoint;
1515
+ window_completes_at?: TimePoint;
1516
+ energy_cost?: UInt32;
1517
+ rejection?: shuttle_rejection;
1518
+ resolved: boolean;
1519
+ }
1520
+ class shuttle_options extends Struct {
1521
+ options: shuttle_option[];
1522
+ }
1408
1523
  class socket_pick extends Struct {
1409
1524
  found: boolean;
1410
1525
  socket: UInt8;
@@ -1459,6 +1574,18 @@ declare namespace Types {
1459
1574
  class task_results extends Struct {
1460
1575
  entities: entity_task_info[];
1461
1576
  }
1577
+ class task_type_info extends Struct {
1578
+ type: UInt8;
1579
+ position_bound: boolean;
1580
+ mobility: boolean;
1581
+ consumer: boolean;
1582
+ is_terminal: boolean;
1583
+ caps_plan: boolean;
1584
+ cargo_effect_resolve: boolean;
1585
+ }
1586
+ class task_types_result extends Struct {
1587
+ types: task_type_info[];
1588
+ }
1462
1589
  class transit extends Struct {
1463
1590
  id: UInt64;
1464
1591
  ax: Int64;