@shipload/sdk 1.0.0-next.5 → 1.0.0-next.50

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 (144) hide show
  1. package/lib/scan.d.ts +52 -0
  2. package/lib/scan.js +162 -0
  3. package/lib/scan.js.map +1 -0
  4. package/lib/scan.m.js +152 -0
  5. package/lib/scan.m.js.map +1 -0
  6. package/lib/shipload.d.ts +2881 -1149
  7. package/lib/shipload.js +13031 -5511
  8. package/lib/shipload.js.map +1 -1
  9. package/lib/shipload.m.js +12807 -5460
  10. package/lib/shipload.m.js.map +1 -1
  11. package/lib/testing.d.ts +1028 -0
  12. package/lib/testing.js +4336 -0
  13. package/lib/testing.js.map +1 -0
  14. package/lib/testing.m.js +4330 -0
  15. package/lib/testing.m.js.map +1 -0
  16. package/package.json +20 -2
  17. package/src/capabilities/craftable.ts +51 -0
  18. package/src/capabilities/crafting.test.ts +7 -0
  19. package/src/capabilities/crafting.ts +6 -7
  20. package/src/capabilities/gathering.test.ts +29 -0
  21. package/src/capabilities/gathering.ts +37 -19
  22. package/src/capabilities/index.ts +0 -1
  23. package/src/capabilities/modules.ts +22 -0
  24. package/src/capabilities/storage.ts +16 -1
  25. package/src/contracts/platform.ts +231 -3
  26. package/src/contracts/server.ts +1160 -520
  27. package/src/coordinates/address.ts +88 -0
  28. package/src/coordinates/constants.test.ts +15 -0
  29. package/src/coordinates/constants.ts +23 -0
  30. package/src/coordinates/index.ts +15 -0
  31. package/src/coordinates/memo.test.ts +47 -0
  32. package/src/coordinates/memo.ts +20 -0
  33. package/src/coordinates/permutation.ts +77 -0
  34. package/src/coordinates/regions.ts +48 -0
  35. package/src/coordinates/sectors.ts +115 -0
  36. package/src/data/capabilities.ts +31 -16
  37. package/src/data/capability-formulas.ts +21 -14
  38. package/src/data/catalog.ts +0 -5
  39. package/src/data/colors.ts +13 -47
  40. package/src/data/entities.json +154 -10
  41. package/src/data/item-ids.ts +31 -12
  42. package/src/data/items.json +192 -74
  43. package/src/data/kind-registry.json +131 -0
  44. package/src/data/kind-registry.ts +172 -0
  45. package/src/data/metadata.ts +166 -48
  46. package/src/data/recipes-runtime.ts +5 -23
  47. package/src/data/recipes.json +1003 -163
  48. package/src/derivation/build-methods.test.ts +13 -0
  49. package/src/derivation/build-methods.ts +48 -0
  50. package/src/derivation/capabilities.test.ts +151 -0
  51. package/src/derivation/capabilities.ts +527 -0
  52. package/src/derivation/capability-mappings.ts +58 -16
  53. package/src/derivation/crafting.ts +36 -33
  54. package/src/derivation/index.ts +28 -2
  55. package/src/derivation/recipe-usage.test.ts +81 -0
  56. package/src/derivation/recipe-usage.ts +141 -0
  57. package/src/derivation/reserve-regen.ts +34 -0
  58. package/src/derivation/resources.ts +98 -19
  59. package/src/derivation/rollups.test.ts +55 -0
  60. package/src/derivation/rollups.ts +56 -0
  61. package/src/derivation/stars.test.ts +67 -0
  62. package/src/derivation/stars.ts +25 -0
  63. package/src/derivation/stats.ts +6 -6
  64. package/src/derivation/stratum.ts +26 -22
  65. package/src/derivation/tiers.ts +40 -7
  66. package/src/derivation/upgrades.ts +14 -0
  67. package/src/derivation/wormhole.ts +141 -0
  68. package/src/entities/entity.ts +98 -0
  69. package/src/entities/gamestate.ts +3 -28
  70. package/src/entities/makers.ts +131 -134
  71. package/src/entities/slot-multiplier.ts +43 -0
  72. package/src/errors.ts +12 -16
  73. package/src/format.ts +26 -4
  74. package/src/index-module.ts +290 -34
  75. package/src/managers/actions.ts +602 -105
  76. package/src/managers/base.ts +6 -2
  77. package/src/managers/cluster.test.ts +39 -0
  78. package/src/managers/cluster.ts +53 -0
  79. package/src/managers/construction-types.ts +80 -0
  80. package/src/managers/construction.ts +412 -0
  81. package/src/managers/context.ts +29 -1
  82. package/src/managers/coordinates.ts +14 -0
  83. package/src/managers/entities.ts +27 -66
  84. package/src/managers/epochs.ts +40 -0
  85. package/src/managers/flatten-gather-plan.test.ts +80 -0
  86. package/src/managers/index.ts +20 -1
  87. package/src/managers/locations.ts +25 -29
  88. package/src/managers/nft.test.ts +14 -0
  89. package/src/managers/nft.ts +70 -0
  90. package/src/managers/players.ts +25 -0
  91. package/src/managers/plot.ts +122 -0
  92. package/src/nft/atomicassets.abi.json +1342 -0
  93. package/src/nft/atomicassets.ts +237 -0
  94. package/src/nft/atomicdata.ts +130 -0
  95. package/src/nft/buildImmutableData.ts +336 -0
  96. package/src/nft/description.ts +104 -36
  97. package/src/nft/index.ts +3 -0
  98. package/src/planner/index.ts +242 -0
  99. package/src/planner/planner.test.ts +325 -0
  100. package/src/resolution/describe-module.ts +43 -25
  101. package/src/resolution/display-name.ts +38 -10
  102. package/src/resolution/resolve-item.test.ts +48 -0
  103. package/src/resolution/resolve-item.ts +74 -47
  104. package/src/scan/index.ts +244 -0
  105. package/src/scan/scan-wasm.base64.ts +2 -0
  106. package/src/scheduling/accessor.ts +65 -23
  107. package/src/scheduling/availability.ts +108 -0
  108. package/src/scheduling/cancel.test.ts +348 -0
  109. package/src/scheduling/cancel.ts +209 -0
  110. package/src/scheduling/energy.ts +47 -0
  111. package/src/scheduling/idle-resolve.ts +45 -0
  112. package/src/scheduling/lane-core.ts +128 -0
  113. package/src/scheduling/lanes.test.ts +249 -0
  114. package/src/scheduling/lanes.ts +198 -0
  115. package/src/scheduling/projection.ts +210 -107
  116. package/src/scheduling/schedule.ts +240 -117
  117. package/src/scheduling/task-cargo.ts +46 -0
  118. package/src/scheduling/unwrap.test.ts +86 -0
  119. package/src/scheduling/unwrap.ts +190 -0
  120. package/src/shipload.ts +26 -1
  121. package/src/subscriptions/manager.cluster.test.ts +51 -0
  122. package/src/subscriptions/manager.ts +245 -172
  123. package/src/subscriptions/mappers.ts +5 -8
  124. package/src/subscriptions/types.ts +28 -3
  125. package/src/testing/catalog-hash.ts +19 -0
  126. package/src/testing/index.ts +2 -0
  127. package/src/testing/projection-parity.ts +167 -0
  128. package/src/travel/reach.ts +23 -0
  129. package/src/travel/route-planner.ts +277 -0
  130. package/src/travel/travel.ts +148 -117
  131. package/src/types/capabilities.ts +29 -6
  132. package/src/types/entity.ts +3 -3
  133. package/src/types/index.ts +0 -1
  134. package/src/types.ts +36 -14
  135. package/src/utils/cargo.test.ts +14 -0
  136. package/src/utils/cargo.ts +29 -0
  137. package/src/utils/display-name.ts +70 -0
  138. package/src/utils/system.ts +36 -24
  139. package/src/capabilities/loading.ts +0 -8
  140. package/src/entities/container.ts +0 -123
  141. package/src/entities/ship-deploy.ts +0 -295
  142. package/src/entities/ship.ts +0 -221
  143. package/src/entities/warehouse.ts +0 -127
  144. package/src/types/entity-traits.ts +0 -69
@@ -3,7 +3,7 @@ import type {ResourceCategory} from '../types'
3
3
  export const categoryColors: Record<ResourceCategory, string> = {
4
4
  ore: '#C26D3F',
5
5
  crystal: '#4ADBFF',
6
- gas: '#B8E4A0',
6
+ gas: '#B877FF',
7
7
  regolith: '#C4A57B',
8
8
  biomass: '#5A8B3E',
9
9
  }
@@ -21,54 +21,20 @@ export const tierColors: Record<number, string> = {
21
21
  10: '#ffffff',
22
22
  }
23
23
 
24
- // Rarity-tier names (badge labels). Kept disjoint from TIER_ADJECTIVES in
25
- // types.ts (resource descriptors like "Pristine Ore") so the two vocabularies
26
- // never collide at any tier.
27
- export const tierLabels: Record<number, string> = {
28
- 1: 'Common',
29
- 2: 'Uncommon',
30
- 3: 'Rare',
31
- 4: 'Epic',
32
- 5: 'Legendary',
33
- 6: 'Mythic',
34
- 7: 'Divine',
35
- 8: 'Celestial',
36
- 9: 'Eternal',
37
- 10: 'Transcendent',
38
- }
39
-
40
- export const categoryIcons: Record<ResourceCategory, string> = {
41
- ore: '⬡',
42
- crystal: '◈',
43
- gas: '◎',
44
- regolith: '■',
45
- biomass: '❋',
46
- }
47
-
48
- export type CategoryIconShape = 'hex' | 'diamond' | 'star' | 'circle' | 'square'
49
-
50
- export const categoryIconShapes: Record<ResourceCategory, CategoryIconShape> = {
51
- ore: 'hex',
52
- crystal: 'diamond',
53
- gas: 'circle',
54
- regolith: 'square',
55
- biomass: 'star',
56
- }
57
-
58
24
  export const componentIcon = '▣'
59
25
  export const moduleIcon = '⬢'
60
26
 
61
27
  export const itemAbbreviations: Record<number, string> = {
62
- 10001: 'HP',
63
- 10002: 'CL',
64
- 10003: 'TC',
65
- 10004: 'PC',
66
- 10005: 'DS',
67
- 10006: 'EP',
68
- 10007: 'CA',
69
- 10008: 'TB',
70
- 10009: 'RC',
71
- 10010: 'FA',
28
+ 10001: 'PL',
29
+ 10002: 'FR',
30
+ 10003: 'PC',
31
+ 10004: 'RS',
32
+ 10005: 'BM',
33
+ 10006: 'SN',
34
+ 10007: 'PM',
35
+ 10008: 'CR',
36
+ 10009: 'RX',
37
+ 10010: 'RE',
72
38
  10100: 'EN',
73
39
  10101: 'GN',
74
40
  10102: 'EX',
@@ -80,7 +46,7 @@ export const itemAbbreviations: Record<number, string> = {
80
46
  10200: 'CT',
81
47
  10201: 'SH',
82
48
  10202: 'WH',
83
- 20001: 'HP',
84
- 20002: 'CL',
49
+ 20001: 'PL',
50
+ 20002: 'FR',
85
51
  20200: 'CT',
86
52
  }
@@ -7,19 +7,29 @@
7
7
  "entityItemId": 10201,
8
8
  "slots": [
9
9
  {
10
- "type": "any"
10
+ "type": "any",
11
+ "outputPct": 80,
12
+ "maxTier": 1
11
13
  },
12
14
  {
13
- "type": "any"
15
+ "type": "any",
16
+ "outputPct": 80,
17
+ "maxTier": 1
14
18
  },
15
19
  {
16
- "type": "any"
20
+ "type": "any",
21
+ "outputPct": 80,
22
+ "maxTier": 1
17
23
  },
18
24
  {
19
- "type": "any"
25
+ "type": "any",
26
+ "outputPct": 80,
27
+ "maxTier": 1
20
28
  },
21
29
  {
22
- "type": "any"
30
+ "type": "any",
31
+ "outputPct": 80,
32
+ "maxTier": 1
23
33
  }
24
34
  ]
25
35
  },
@@ -27,24 +37,158 @@
27
37
  "entityItemId": 10202,
28
38
  "slots": [
29
39
  {
30
- "type": "loader"
40
+ "type": "loader",
41
+ "outputPct": 100,
42
+ "maxTier": 1
31
43
  },
32
44
  {
33
- "type": "storage"
45
+ "type": "storage",
46
+ "outputPct": 100,
47
+ "maxTier": 1
34
48
  },
35
49
  {
36
- "type": "storage"
50
+ "type": "storage",
51
+ "outputPct": 100,
52
+ "maxTier": 1
37
53
  },
38
54
  {
39
- "type": "storage"
55
+ "type": "storage",
56
+ "outputPct": 100,
57
+ "maxTier": 1
40
58
  },
41
59
  {
42
- "type": "storage"
60
+ "type": "storage",
61
+ "outputPct": 100,
62
+ "maxTier": 1
43
63
  }
44
64
  ]
45
65
  },
66
+ {
67
+ "entityItemId": 10203,
68
+ "slots": [
69
+ {
70
+ "type": "generator",
71
+ "outputPct": 200,
72
+ "maxTier": 1
73
+ },
74
+ {
75
+ "type": "gatherer",
76
+ "outputPct": 200,
77
+ "maxTier": 1
78
+ }
79
+ ]
80
+ },
81
+ {
82
+ "entityItemId": 10204,
83
+ "slots": [
84
+ {
85
+ "type": "generator",
86
+ "outputPct": 200,
87
+ "maxTier": 1
88
+ },
89
+ {
90
+ "type": "crafter",
91
+ "outputPct": 200,
92
+ "maxTier": 1
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ "entityItemId": 10205,
98
+ "slots": [
99
+ {
100
+ "type": "generator",
101
+ "outputPct": 200,
102
+ "maxTier": 1
103
+ },
104
+ {
105
+ "type": "launcher",
106
+ "outputPct": 200,
107
+ "maxTier": 1
108
+ }
109
+ ]
110
+ },
111
+ {
112
+ "entityItemId": 10206,
113
+ "slots": [
114
+ {
115
+ "type": "storage",
116
+ "outputPct": 100,
117
+ "maxTier": 1
118
+ },
119
+ {
120
+ "type": "storage",
121
+ "outputPct": 100,
122
+ "maxTier": 1
123
+ },
124
+ {
125
+ "type": "storage",
126
+ "outputPct": 100,
127
+ "maxTier": 1
128
+ }
129
+ ]
130
+ },
131
+ {
132
+ "entityItemId": 10207,
133
+ "slots": []
134
+ },
46
135
  {
47
136
  "entityItemId": 20200,
48
137
  "slots": []
138
+ },
139
+ {
140
+ "entityItemId": 20210,
141
+ "slots": [
142
+ {
143
+ "type": "engine",
144
+ "outputPct": 100,
145
+ "maxTier": 2
146
+ },
147
+ {
148
+ "type": "generator",
149
+ "outputPct": 100,
150
+ "maxTier": 2
151
+ },
152
+ {
153
+ "type": "gatherer",
154
+ "outputPct": 100,
155
+ "maxTier": 2
156
+ },
157
+ {
158
+ "type": "gatherer",
159
+ "outputPct": 100,
160
+ "maxTier": 2
161
+ },
162
+ {
163
+ "type": "any",
164
+ "outputPct": 80,
165
+ "maxTier": 1
166
+ }
167
+ ]
168
+ },
169
+ {
170
+ "entityItemId": 20211,
171
+ "slots": [
172
+ {
173
+ "type": "engine",
174
+ "outputPct": 100,
175
+ "maxTier": 2
176
+ },
177
+ {
178
+ "type": "generator",
179
+ "outputPct": 100,
180
+ "maxTier": 2
181
+ },
182
+ {
183
+ "type": "hauler",
184
+ "outputPct": 100,
185
+ "maxTier": 2
186
+ },
187
+ {
188
+ "type": "hauler",
189
+ "outputPct": 100,
190
+ "maxTier": 2
191
+ }
192
+ ]
49
193
  }
50
194
  ]
@@ -50,16 +50,16 @@ export const ITEM_BIOMASS_T7 = 507
50
50
  export const ITEM_BIOMASS_T8 = 508
51
51
  export const ITEM_BIOMASS_T9 = 509
52
52
  export const ITEM_BIOMASS_T10 = 510
53
- export const ITEM_HULL_PLATES = 10001
54
- export const ITEM_CARGO_LINING = 10002
55
- export const ITEM_THRUSTER_CORE = 10003
56
- export const ITEM_POWER_CELL = 10004
57
- export const ITEM_MATTER_CONDUIT = 10005
58
- export const ITEM_SURVEY_PROBE = 10006
59
- export const ITEM_CARGO_ARM = 10007
60
- export const ITEM_TOOL_BIT = 10008
61
- export const ITEM_REACTION_CHAMBER = 10009
62
- export const ITEM_FOCUSING_ARRAY = 10010
53
+ export const ITEM_PLATE = 10001
54
+ export const ITEM_FRAME = 10002
55
+ export const ITEM_PLASMA_CELL = 10003
56
+ export const ITEM_RESONATOR = 10004
57
+ export const ITEM_BEAM = 10005
58
+ export const ITEM_SENSOR = 10006
59
+ export const ITEM_POLYMER = 10007
60
+ export const ITEM_CERAMIC = 10008
61
+ export const ITEM_REACTOR = 10009
62
+ export const ITEM_RESIN = 10010
63
63
  export const ITEM_ENGINE_T1 = 10100
64
64
  export const ITEM_GENERATOR_T1 = 10101
65
65
  export const ITEM_GATHERER_T1 = 10102
@@ -68,9 +68,28 @@ export const ITEM_CRAFTER_T1 = 10104
68
68
  export const ITEM_STORAGE_T1 = 10105
69
69
  export const ITEM_HAULER_T1 = 10106
70
70
  export const ITEM_WARP_T1 = 10107
71
+ export const ITEM_BATTERY_T1 = 10108
72
+ export const ITEM_LAUNCHER_T1 = 10109
71
73
  export const ITEM_CONTAINER_T1_PACKED = 10200
72
74
  export const ITEM_SHIP_T1_PACKED = 10201
73
75
  export const ITEM_WAREHOUSE_T1_PACKED = 10202
74
- export const ITEM_HULL_PLATES_T2 = 20001
75
- export const ITEM_CARGO_LINING_T2 = 20002
76
+ export const ITEM_EXTRACTOR_T1_PACKED = 10203
77
+ export const ITEM_FACTORY_T1_PACKED = 10204
78
+ export const ITEM_MASS_DRIVER_T1_PACKED = 10205
79
+ export const ITEM_MASS_CATCHER_T1_PACKED = 10206
80
+ export const ITEM_HUB_T1_PACKED = 10207
81
+ export const ITEM_PLATE_T2 = 20001
82
+ export const ITEM_FRAME_T2 = 20002
83
+ export const ITEM_PLASMA_CELL_T2 = 20003
84
+ export const ITEM_RESONATOR_T2 = 20004
85
+ export const ITEM_BEAM_T2 = 20005
86
+ export const ITEM_SENSOR_T2 = 20006
87
+ export const ITEM_POLYMER_T2 = 20007
88
+ export const ITEM_CERAMIC_T2 = 20008
89
+ export const ITEM_REACTOR_T2 = 20009
90
+ export const ITEM_RESIN_T2 = 20010
91
+ export const ITEM_GATHERER_T2 = 20102
92
+ export const ITEM_HAULER_T2 = 20106
76
93
  export const ITEM_CONTAINER_T2_PACKED = 20200
94
+ export const ITEM_PROSPECTOR_T2_PACKED = 20210
95
+ export const ITEM_HAULER_SHIP_T2_PACKED = 20211