@shipload/sdk 1.0.0-next.3 → 1.0.0-next.30

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 (99) hide show
  1. package/lib/shipload.d.ts +1847 -962
  2. package/lib/shipload.js +9088 -4854
  3. package/lib/shipload.js.map +1 -1
  4. package/lib/shipload.m.js +8957 -4805
  5. package/lib/shipload.m.js.map +1 -1
  6. package/lib/testing.d.ts +856 -0
  7. package/lib/testing.js +3739 -0
  8. package/lib/testing.js.map +1 -0
  9. package/lib/testing.m.js +3733 -0
  10. package/lib/testing.m.js.map +1 -0
  11. package/package.json +15 -2
  12. package/src/capabilities/craftable.ts +51 -0
  13. package/src/capabilities/crafting.test.ts +7 -0
  14. package/src/capabilities/crafting.ts +3 -3
  15. package/src/capabilities/gathering.ts +17 -7
  16. package/src/capabilities/index.ts +0 -1
  17. package/src/capabilities/modules.ts +6 -0
  18. package/src/capabilities/storage.ts +16 -1
  19. package/src/contracts/platform.ts +231 -3
  20. package/src/contracts/server.ts +816 -471
  21. package/src/data/capabilities.ts +14 -329
  22. package/src/data/capability-formulas.ts +76 -0
  23. package/src/data/catalog.ts +0 -5
  24. package/src/data/colors.ts +14 -47
  25. package/src/data/entities.json +46 -10
  26. package/src/data/item-ids.ts +15 -12
  27. package/src/data/items.json +302 -38
  28. package/src/data/kind-registry.json +85 -0
  29. package/src/data/kind-registry.ts +150 -0
  30. package/src/data/metadata.ts +100 -31
  31. package/src/data/recipes-runtime.ts +3 -23
  32. package/src/data/recipes.json +250 -113
  33. package/src/derivation/build-methods.ts +45 -0
  34. package/src/derivation/capabilities.ts +415 -0
  35. package/src/derivation/capability-mappings.ts +117 -0
  36. package/src/derivation/crafting.ts +23 -24
  37. package/src/derivation/index.ts +17 -2
  38. package/src/derivation/reserve-regen.ts +34 -0
  39. package/src/derivation/resources.ts +125 -38
  40. package/src/derivation/stars.test.ts +51 -0
  41. package/src/derivation/stars.ts +15 -0
  42. package/src/derivation/stats.ts +6 -6
  43. package/src/derivation/stratum.ts +15 -19
  44. package/src/derivation/tiers.ts +28 -7
  45. package/src/entities/entity.ts +98 -0
  46. package/src/entities/gamestate.ts +3 -28
  47. package/src/entities/makers.ts +91 -136
  48. package/src/entities/slot-multiplier.ts +39 -0
  49. package/src/errors.ts +10 -15
  50. package/src/format.ts +26 -4
  51. package/src/index-module.ts +189 -47
  52. package/src/managers/actions.ts +252 -83
  53. package/src/managers/base.ts +6 -2
  54. package/src/managers/construction-types.ts +79 -0
  55. package/src/managers/construction.ts +396 -0
  56. package/src/managers/context.ts +11 -1
  57. package/src/managers/entities.ts +18 -66
  58. package/src/managers/epochs.ts +40 -0
  59. package/src/managers/index.ts +17 -1
  60. package/src/managers/locations.ts +25 -29
  61. package/src/managers/nft.ts +28 -0
  62. package/src/managers/plot.ts +127 -0
  63. package/src/nft/atomicassets.abi.json +1342 -0
  64. package/src/nft/atomicassets.ts +237 -0
  65. package/src/nft/atomicdata.ts +130 -0
  66. package/src/nft/buildImmutableData.ts +321 -0
  67. package/src/nft/description.ts +37 -15
  68. package/src/nft/index.ts +3 -0
  69. package/src/resolution/describe-module.ts +5 -8
  70. package/src/resolution/display-name.ts +38 -10
  71. package/src/resolution/resolve-item.ts +22 -20
  72. package/src/scheduling/accessor.ts +68 -22
  73. package/src/scheduling/availability.ts +108 -0
  74. package/src/scheduling/energy.ts +48 -0
  75. package/src/scheduling/lane-core.ts +130 -0
  76. package/src/scheduling/lanes.ts +60 -0
  77. package/src/scheduling/projection.ts +121 -94
  78. package/src/scheduling/schedule.ts +237 -103
  79. package/src/scheduling/task-cargo.ts +46 -0
  80. package/src/shipload.ts +16 -1
  81. package/src/subscriptions/manager.ts +40 -6
  82. package/src/subscriptions/mappers.ts +3 -8
  83. package/src/subscriptions/types.ts +3 -2
  84. package/src/testing/catalog-hash.ts +19 -0
  85. package/src/testing/index.ts +2 -0
  86. package/src/testing/projection-parity.ts +143 -0
  87. package/src/travel/travel.ts +90 -13
  88. package/src/types/capabilities.ts +1 -0
  89. package/src/types/index.ts +0 -1
  90. package/src/types.ts +19 -12
  91. package/src/utils/cargo.ts +27 -0
  92. package/src/utils/display-name.ts +61 -0
  93. package/src/utils/system.ts +25 -24
  94. package/src/capabilities/loading.ts +0 -8
  95. package/src/entities/container.ts +0 -108
  96. package/src/entities/ship-deploy.ts +0 -258
  97. package/src/entities/ship.ts +0 -204
  98. package/src/entities/warehouse.ts +0 -119
  99. package/src/types/entity-traits.ts +0 -69
@@ -1,12 +1,11 @@
1
1
  [
2
2
  {
3
3
  "outputItemId": 10001,
4
- "outputMass": 50000,
4
+ "outputMass": 4000,
5
5
  "inputs": [
6
6
  {
7
- "category": "ore",
8
- "tier": 1,
9
- "quantity": 15
7
+ "itemId": 101,
8
+ "quantity": 10
10
9
  }
11
10
  ],
12
11
  "statSlots": [
@@ -31,17 +30,15 @@
31
30
  },
32
31
  {
33
32
  "outputItemId": 10002,
34
- "outputMass": 30000,
33
+ "outputMass": 6000,
35
34
  "inputs": [
36
35
  {
37
- "category": "regolith",
38
- "tier": 1,
39
- "quantity": 10
36
+ "itemId": 401,
37
+ "quantity": 6
40
38
  },
41
39
  {
42
- "category": "biomass",
43
- "tier": 1,
44
- "quantity": 20
40
+ "itemId": 501,
41
+ "quantity": 9
45
42
  }
46
43
  ],
47
44
  "statSlots": [
@@ -56,8 +53,8 @@
56
53
  {
57
54
  "sources": [
58
55
  {
59
- "inputIndex": 1,
60
- "statIndex": 2
56
+ "inputIndex": 0,
57
+ "statIndex": 0
61
58
  }
62
59
  ]
63
60
  }
@@ -66,12 +63,11 @@
66
63
  },
67
64
  {
68
65
  "outputItemId": 10003,
69
- "outputMass": 50000,
66
+ "outputMass": 4000,
70
67
  "inputs": [
71
68
  {
72
- "category": "gas",
73
- "tier": 1,
74
- "quantity": 32
69
+ "itemId": 301,
70
+ "quantity": 10
75
71
  }
76
72
  ],
77
73
  "statSlots": [
@@ -96,12 +92,15 @@
96
92
  },
97
93
  {
98
94
  "outputItemId": 10004,
99
- "outputMass": 30000,
95
+ "outputMass": 6000,
100
96
  "inputs": [
101
97
  {
102
- "category": "regolith",
103
- "tier": 1,
104
- "quantity": 20
98
+ "itemId": 201,
99
+ "quantity": 6
100
+ },
101
+ {
102
+ "itemId": 101,
103
+ "quantity": 9
105
104
  }
106
105
  ],
107
106
  "statSlots": [
@@ -109,7 +108,7 @@
109
108
  "sources": [
110
109
  {
111
110
  "inputIndex": 0,
112
- "statIndex": 0
111
+ "statIndex": 1
113
112
  }
114
113
  ]
115
114
  },
@@ -126,12 +125,15 @@
126
125
  },
127
126
  {
128
127
  "outputItemId": 10005,
129
- "outputMass": 50000,
128
+ "outputMass": 6000,
130
129
  "inputs": [
131
130
  {
132
- "category": "ore",
133
- "tier": 1,
134
- "quantity": 15
131
+ "itemId": 101,
132
+ "quantity": 6
133
+ },
134
+ {
135
+ "itemId": 301,
136
+ "quantity": 9
135
137
  }
136
138
  ],
137
139
  "statSlots": [
@@ -156,11 +158,10 @@
156
158
  },
157
159
  {
158
160
  "outputItemId": 10006,
159
- "outputMass": 30000,
161
+ "outputMass": 4000,
160
162
  "inputs": [
161
163
  {
162
- "category": "crystal",
163
- "tier": 1,
164
+ "itemId": 201,
164
165
  "quantity": 10
165
166
  }
166
167
  ],
@@ -186,12 +187,11 @@
186
187
  },
187
188
  {
188
189
  "outputItemId": 10007,
189
- "outputMass": 30000,
190
+ "outputMass": 4000,
190
191
  "inputs": [
191
192
  {
192
- "category": "biomass",
193
- "tier": 1,
194
- "quantity": 32
193
+ "itemId": 501,
194
+ "quantity": 10
195
195
  }
196
196
  ],
197
197
  "statSlots": [
@@ -216,12 +216,11 @@
216
216
  },
217
217
  {
218
218
  "outputItemId": 10008,
219
- "outputMass": 30000,
219
+ "outputMass": 4000,
220
220
  "inputs": [
221
221
  {
222
- "category": "regolith",
223
- "tier": 1,
224
- "quantity": 20
222
+ "itemId": 401,
223
+ "quantity": 10
225
224
  }
226
225
  ],
227
226
  "statSlots": [
@@ -246,12 +245,15 @@
246
245
  },
247
246
  {
248
247
  "outputItemId": 10009,
249
- "outputMass": 50000,
248
+ "outputMass": 6000,
250
249
  "inputs": [
251
250
  {
252
- "category": "gas",
253
- "tier": 1,
254
- "quantity": 32
251
+ "itemId": 301,
252
+ "quantity": 6
253
+ },
254
+ {
255
+ "itemId": 401,
256
+ "quantity": 9
255
257
  }
256
258
  ],
257
259
  "statSlots": [
@@ -276,12 +278,15 @@
276
278
  },
277
279
  {
278
280
  "outputItemId": 10010,
279
- "outputMass": 40000,
281
+ "outputMass": 6000,
280
282
  "inputs": [
281
283
  {
282
- "category": "crystal",
283
- "tier": 1,
284
- "quantity": 25
284
+ "itemId": 501,
285
+ "quantity": 6
286
+ },
287
+ {
288
+ "itemId": 201,
289
+ "quantity": 9
285
290
  }
286
291
  ],
287
292
  "statSlots": [
@@ -289,7 +294,7 @@
289
294
  "sources": [
290
295
  {
291
296
  "inputIndex": 0,
292
- "statIndex": 0
297
+ "statIndex": 2
293
298
  }
294
299
  ]
295
300
  },
@@ -297,7 +302,7 @@
297
302
  "sources": [
298
303
  {
299
304
  "inputIndex": 0,
300
- "statIndex": 1
305
+ "statIndex": 0
301
306
  }
302
307
  ]
303
308
  }
@@ -306,11 +311,11 @@
306
311
  },
307
312
  {
308
313
  "outputItemId": 10100,
309
- "outputMass": 150000,
314
+ "outputMass": 900000,
310
315
  "inputs": [
311
316
  {
312
317
  "itemId": 10003,
313
- "quantity": 6
318
+ "quantity": 600
314
319
  }
315
320
  ],
316
321
  "statSlots": [
@@ -335,11 +340,11 @@
335
340
  },
336
341
  {
337
342
  "outputItemId": 10101,
338
- "outputMass": 75000,
343
+ "outputMass": 1400000,
339
344
  "inputs": [
340
345
  {
341
346
  "itemId": 10004,
342
- "quantity": 5
347
+ "quantity": 600
343
348
  }
344
349
  ],
345
350
  "statSlots": [
@@ -364,15 +369,15 @@
364
369
  },
365
370
  {
366
371
  "outputItemId": 10102,
367
- "outputMass": 145000,
372
+ "outputMass": 1200000,
368
373
  "inputs": [
369
374
  {
370
375
  "itemId": 10005,
371
- "quantity": 4
376
+ "quantity": 300
372
377
  },
373
378
  {
374
379
  "itemId": 10006,
375
- "quantity": 3
380
+ "quantity": 300
376
381
  }
377
382
  ],
378
383
  "statSlots": [
@@ -392,14 +397,6 @@
392
397
  }
393
398
  ]
394
399
  },
395
- {
396
- "sources": [
397
- {
398
- "inputIndex": 1,
399
- "statIndex": 1
400
- }
401
- ]
402
- },
403
400
  {
404
401
  "sources": [
405
402
  {
@@ -421,15 +418,11 @@
421
418
  },
422
419
  {
423
420
  "outputItemId": 10103,
424
- "outputMass": 90000,
421
+ "outputMass": 1000000,
425
422
  "inputs": [
426
- {
427
- "itemId": 10002,
428
- "quantity": 3
429
- },
430
423
  {
431
424
  "itemId": 10007,
432
- "quantity": 3
425
+ "quantity": 600
433
426
  }
434
427
  ],
435
428
  "statSlots": [
@@ -437,14 +430,14 @@
437
430
  "sources": [
438
431
  {
439
432
  "inputIndex": 0,
440
- "statIndex": 0
433
+ "statIndex": 1
441
434
  }
442
435
  ]
443
436
  },
444
437
  {
445
438
  "sources": [
446
439
  {
447
- "inputIndex": 1,
440
+ "inputIndex": 0,
448
441
  "statIndex": 0
449
442
  }
450
443
  ]
@@ -454,15 +447,15 @@
454
447
  },
455
448
  {
456
449
  "outputItemId": 10104,
457
- "outputMass": 120000,
450
+ "outputMass": 1200000,
458
451
  "inputs": [
459
452
  {
460
453
  "itemId": 10008,
461
- "quantity": 3
454
+ "quantity": 300
462
455
  },
463
456
  {
464
457
  "itemId": 10009,
465
- "quantity": 3
458
+ "quantity": 300
466
459
  }
467
460
  ],
468
461
  "statSlots": [
@@ -487,15 +480,15 @@
487
480
  },
488
481
  {
489
482
  "outputItemId": 10105,
490
- "outputMass": 100000,
483
+ "outputMass": 1200000,
491
484
  "inputs": [
492
485
  {
493
486
  "itemId": 10001,
494
- "quantity": 8
487
+ "quantity": 300
495
488
  },
496
489
  {
497
490
  "itemId": 10002,
498
- "quantity": 4
491
+ "quantity": 300
499
492
  }
500
493
  ],
501
494
  "statSlots": [
@@ -536,15 +529,15 @@
536
529
  },
537
530
  {
538
531
  "outputItemId": 10106,
539
- "outputMass": 120000,
532
+ "outputMass": 1400000,
540
533
  "inputs": [
541
534
  {
542
535
  "itemId": 10004,
543
- "quantity": 3
536
+ "quantity": 300
544
537
  },
545
538
  {
546
539
  "itemId": 10010,
547
- "quantity": 3
540
+ "quantity": 300
548
541
  }
549
542
  ],
550
543
  "statSlots": [
@@ -560,7 +553,7 @@
560
553
  "sources": [
561
554
  {
562
555
  "inputIndex": 1,
563
- "statIndex": 0
556
+ "statIndex": 1
564
557
  }
565
558
  ]
566
559
  },
@@ -571,9 +564,30 @@
571
564
  "statIndex": 1
572
565
  }
573
566
  ]
567
+ }
568
+ ],
569
+ "blendWeights": []
570
+ },
571
+ {
572
+ "outputItemId": 10107,
573
+ "outputMass": 1400000,
574
+ "inputs": [
575
+ {
576
+ "itemId": 10004,
577
+ "quantity": 300
574
578
  },
579
+ {
580
+ "itemId": 10009,
581
+ "quantity": 300
582
+ }
583
+ ],
584
+ "statSlots": [
575
585
  {
576
586
  "sources": [
587
+ {
588
+ "inputIndex": 0,
589
+ "statIndex": 0
590
+ },
577
591
  {
578
592
  "inputIndex": 1,
579
593
  "statIndex": 1
@@ -581,28 +595,51 @@
581
595
  ]
582
596
  }
583
597
  ],
584
- "blendWeights": []
598
+ "blendWeights": [
599
+ 1,
600
+ 1
601
+ ]
585
602
  },
586
603
  {
587
- "outputItemId": 10107,
588
- "outputMass": 180000,
604
+ "outputItemId": 10108,
605
+ "outputMass": 1000000,
589
606
  "inputs": [
590
607
  {
591
- "itemId": 10010,
592
- "quantity": 6
608
+ "itemId": 10003,
609
+ "quantity": 300
593
610
  },
594
611
  {
595
- "itemId": 10009,
596
- "quantity": 4
612
+ "itemId": 10007,
613
+ "quantity": 300
597
614
  }
598
615
  ],
599
616
  "statSlots": [
617
+ {
618
+ "sources": [
619
+ {
620
+ "inputIndex": 0,
621
+ "statIndex": 0
622
+ }
623
+ ]
624
+ },
600
625
  {
601
626
  "sources": [
602
627
  {
603
628
  "inputIndex": 0,
604
629
  "statIndex": 1
605
- },
630
+ }
631
+ ]
632
+ },
633
+ {
634
+ "sources": [
635
+ {
636
+ "inputIndex": 1,
637
+ "statIndex": 0
638
+ }
639
+ ]
640
+ },
641
+ {
642
+ "sources": [
606
643
  {
607
644
  "inputIndex": 1,
608
645
  "statIndex": 1
@@ -610,22 +647,19 @@
610
647
  ]
611
648
  }
612
649
  ],
613
- "blendWeights": [
614
- 1,
615
- 1
616
- ]
650
+ "blendWeights": []
617
651
  },
618
652
  {
619
653
  "outputItemId": 10200,
620
- "outputMass": 80000,
654
+ "outputMass": 1500000,
621
655
  "inputs": [
622
656
  {
623
657
  "itemId": 10001,
624
- "quantity": 6
658
+ "quantity": 600
625
659
  },
626
660
  {
627
661
  "itemId": 10002,
628
- "quantity": 2
662
+ "quantity": 200
629
663
  }
630
664
  ],
631
665
  "statSlots": [
@@ -666,15 +700,15 @@
666
700
  },
667
701
  {
668
702
  "outputItemId": 10201,
669
- "outputMass": 100000,
703
+ "outputMass": 2300000,
670
704
  "inputs": [
671
705
  {
672
706
  "itemId": 10001,
673
- "quantity": 8
707
+ "quantity": 800
674
708
  },
675
709
  {
676
710
  "itemId": 10002,
677
- "quantity": 4
711
+ "quantity": 400
678
712
  }
679
713
  ],
680
714
  "statSlots": [
@@ -715,15 +749,121 @@
715
749
  },
716
750
  {
717
751
  "outputItemId": 10202,
718
- "outputMass": 1300000,
752
+ "outputMass": 5800000,
719
753
  "inputs": [
720
754
  {
721
755
  "itemId": 10001,
722
- "quantity": 20
756
+ "quantity": 2000
723
757
  },
724
758
  {
725
759
  "itemId": 10002,
726
- "quantity": 10
760
+ "quantity": 1000
761
+ }
762
+ ],
763
+ "statSlots": [
764
+ {
765
+ "sources": [
766
+ {
767
+ "inputIndex": 0,
768
+ "statIndex": 0
769
+ }
770
+ ]
771
+ },
772
+ {
773
+ "sources": [
774
+ {
775
+ "inputIndex": 0,
776
+ "statIndex": 1
777
+ }
778
+ ]
779
+ },
780
+ {
781
+ "sources": [
782
+ {
783
+ "inputIndex": 1,
784
+ "statIndex": 0
785
+ }
786
+ ]
787
+ },
788
+ {
789
+ "sources": [
790
+ {
791
+ "inputIndex": 1,
792
+ "statIndex": 1
793
+ }
794
+ ]
795
+ }
796
+ ],
797
+ "blendWeights": []
798
+ },
799
+ {
800
+ "outputItemId": 10203,
801
+ "outputMass": 4400000,
802
+ "inputs": [
803
+ {
804
+ "itemId": 10001,
805
+ "quantity": 1500
806
+ },
807
+ {
808
+ "itemId": 10002,
809
+ "quantity": 800
810
+ }
811
+ ],
812
+ "statSlots": [
813
+ {
814
+ "sources": [
815
+ {
816
+ "inputIndex": 0,
817
+ "statIndex": 0
818
+ }
819
+ ]
820
+ },
821
+ {
822
+ "sources": [
823
+ {
824
+ "inputIndex": 0,
825
+ "statIndex": 1
826
+ }
827
+ ]
828
+ },
829
+ {
830
+ "sources": [
831
+ {
832
+ "inputIndex": 1,
833
+ "statIndex": 0
834
+ }
835
+ ]
836
+ },
837
+ {
838
+ "sources": [
839
+ {
840
+ "inputIndex": 1,
841
+ "statIndex": 1
842
+ }
843
+ ]
844
+ }
845
+ ],
846
+ "blendWeights": []
847
+ },
848
+ {
849
+ "outputItemId": 10204,
850
+ "outputMass": 5500000,
851
+ "inputs": [
852
+ {
853
+ "itemId": 10001,
854
+ "quantity": 1500
855
+ },
856
+ {
857
+ "itemId": 10002,
858
+ "quantity": 600
859
+ },
860
+ {
861
+ "itemId": 10008,
862
+ "quantity": 400
863
+ },
864
+ {
865
+ "itemId": 10009,
866
+ "quantity": 400
727
867
  }
728
868
  ],
729
869
  "statSlots": [
@@ -764,15 +904,14 @@
764
904
  },
765
905
  {
766
906
  "outputItemId": 20001,
767
- "outputMass": 50000,
907
+ "outputMass": 500,
768
908
  "inputs": [
769
909
  {
770
910
  "itemId": 10001,
771
- "quantity": 2
911
+ "quantity": 200
772
912
  },
773
913
  {
774
- "category": "ore",
775
- "tier": 2,
914
+ "itemId": 102,
776
915
  "quantity": 15
777
916
  }
778
917
  ],
@@ -809,20 +948,18 @@
809
948
  },
810
949
  {
811
950
  "outputItemId": 20002,
812
- "outputMass": 30000,
951
+ "outputMass": 300,
813
952
  "inputs": [
814
953
  {
815
954
  "itemId": 10002,
816
- "quantity": 2
955
+ "quantity": 200
817
956
  },
818
957
  {
819
- "category": "regolith",
820
- "tier": 2,
958
+ "itemId": 402,
821
959
  "quantity": 10
822
960
  },
823
961
  {
824
- "category": "biomass",
825
- "tier": 2,
962
+ "itemId": 502,
826
963
  "quantity": 20
827
964
  }
828
965
  ],
@@ -864,11 +1001,11 @@
864
1001
  "inputs": [
865
1002
  {
866
1003
  "itemId": 20001,
867
- "quantity": 6
1004
+ "quantity": 600
868
1005
  },
869
1006
  {
870
1007
  "itemId": 20002,
871
- "quantity": 2
1008
+ "quantity": 200
872
1009
  }
873
1010
  ],
874
1011
  "statSlots": [