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

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 (145) 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 +3167 -1353
  7. package/lib/shipload.js +13319 -5640
  8. package/lib/shipload.js.map +1 -1
  9. package/lib/shipload.m.js +13091 -5589
  10. package/lib/shipload.m.js.map +1 -1
  11. package/lib/testing.d.ts +1037 -0
  12. package/lib/testing.js +4363 -0
  13. package/lib/testing.js.map +1 -0
  14. package/lib/testing.m.js +4357 -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 +1178 -511
  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 +294 -34
  75. package/src/managers/actions.ts +616 -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/route-simulator.ts +174 -0
  131. package/src/travel/travel.ts +175 -118
  132. package/src/types/capabilities.ts +29 -6
  133. package/src/types/entity.ts +3 -3
  134. package/src/types/index.ts +0 -1
  135. package/src/types.ts +39 -14
  136. package/src/utils/cargo.test.ts +14 -0
  137. package/src/utils/cargo.ts +29 -0
  138. package/src/utils/display-name.ts +70 -0
  139. package/src/utils/system.ts +36 -24
  140. package/src/capabilities/loading.ts +0 -8
  141. package/src/entities/container.ts +0 -123
  142. package/src/entities/ship-deploy.ts +0 -295
  143. package/src/entities/ship.ts +0 -221
  144. package/src/entities/warehouse.ts +0 -127
  145. package/src/types/entity-traits.ts +0 -69
@@ -0,0 +1,131 @@
1
+ {
2
+ "kinds": [
3
+ {
4
+ "kind": "ship",
5
+ "classification": "OrbitalVessel",
6
+ "capabilityFlags": 19,
7
+ "zCoord": 800,
8
+ "defaultLabel": "Ship"
9
+ },
10
+ {
11
+ "kind": "warehouse",
12
+ "classification": "OrbitalStructure",
13
+ "capabilityFlags": 20,
14
+ "zCoord": 0,
15
+ "defaultLabel": "Warehouse"
16
+ },
17
+ {
18
+ "kind": "extractor",
19
+ "classification": "OrbitalStructure",
20
+ "capabilityFlags": 20,
21
+ "zCoord": 0,
22
+ "defaultLabel": "Mining Rig"
23
+ },
24
+ {
25
+ "kind": "factory",
26
+ "classification": "OrbitalStructure",
27
+ "capabilityFlags": 20,
28
+ "zCoord": 0,
29
+ "defaultLabel": "Factory"
30
+ },
31
+ {
32
+ "kind": "mdriver",
33
+ "classification": "OrbitalStructure",
34
+ "capabilityFlags": 20,
35
+ "zCoord": 0,
36
+ "defaultLabel": "Mass Driver"
37
+ },
38
+ {
39
+ "kind": "mcatcher",
40
+ "classification": "OrbitalStructure",
41
+ "capabilityFlags": 28,
42
+ "zCoord": 0,
43
+ "defaultLabel": "Mass Catcher"
44
+ },
45
+ {
46
+ "kind": "container",
47
+ "classification": "OrbitalVessel",
48
+ "capabilityFlags": 3,
49
+ "zCoord": 300,
50
+ "defaultLabel": "Container"
51
+ },
52
+ {
53
+ "kind": "nexus",
54
+ "classification": "OrbitalVessel",
55
+ "capabilityFlags": 0,
56
+ "zCoord": 800,
57
+ "defaultLabel": "Nexus"
58
+ },
59
+ {
60
+ "kind": "plot",
61
+ "classification": "Plot",
62
+ "capabilityFlags": 0,
63
+ "zCoord": 0,
64
+ "defaultLabel": "Plot"
65
+ },
66
+ {
67
+ "kind": "hub",
68
+ "classification": "OrbitalStructure",
69
+ "capabilityFlags": 4,
70
+ "zCoord": 0,
71
+ "defaultLabel": "Station Hub"
72
+ }
73
+ ],
74
+ "templates": [
75
+ {
76
+ "itemId": 10201,
77
+ "kind": "ship",
78
+ "displayLabel": "Roustabout"
79
+ },
80
+ {
81
+ "itemId": 10202,
82
+ "kind": "warehouse",
83
+ "displayLabel": ""
84
+ },
85
+ {
86
+ "itemId": 10203,
87
+ "kind": "extractor",
88
+ "displayLabel": ""
89
+ },
90
+ {
91
+ "itemId": 10204,
92
+ "kind": "factory",
93
+ "displayLabel": ""
94
+ },
95
+ {
96
+ "itemId": 10205,
97
+ "kind": "mdriver",
98
+ "displayLabel": ""
99
+ },
100
+ {
101
+ "itemId": 10206,
102
+ "kind": "mcatcher",
103
+ "displayLabel": ""
104
+ },
105
+ {
106
+ "itemId": 10200,
107
+ "kind": "container",
108
+ "displayLabel": ""
109
+ },
110
+ {
111
+ "itemId": 20200,
112
+ "kind": "container",
113
+ "displayLabel": ""
114
+ },
115
+ {
116
+ "itemId": 10207,
117
+ "kind": "hub",
118
+ "displayLabel": ""
119
+ },
120
+ {
121
+ "itemId": 20210,
122
+ "kind": "ship",
123
+ "displayLabel": "Prospector"
124
+ },
125
+ {
126
+ "itemId": 20211,
127
+ "kind": "ship",
128
+ "displayLabel": "Hauler"
129
+ }
130
+ ]
131
+ }
@@ -0,0 +1,172 @@
1
+ import {Name, type NameType} from '@wharfkit/antelope'
2
+ import kindRegistryJson from './kind-registry.json'
3
+
4
+ export const CAP_WRAP = 0x01
5
+ export const CAP_UNDEPLOY = 0x02
6
+ export const CAP_DEMOLISH = 0x04
7
+ export const CAP_CATCH = 0x08
8
+ export const CAP_MODULES = 0x10
9
+
10
+ export enum EntityClass {
11
+ OrbitalVessel = 0,
12
+ PlanetaryStructure = 1,
13
+ Plot = 2,
14
+ OrbitalStructure = 3,
15
+ }
16
+
17
+ const CLASSIFICATION_BY_NAME: Record<string, EntityClass> = {
18
+ OrbitalVessel: EntityClass.OrbitalVessel,
19
+ PlanetaryStructure: EntityClass.PlanetaryStructure,
20
+ Plot: EntityClass.Plot,
21
+ OrbitalStructure: EntityClass.OrbitalStructure,
22
+ }
23
+
24
+ export type EntityTypeName =
25
+ | 'ship'
26
+ | 'warehouse'
27
+ | 'extractor'
28
+ | 'factory'
29
+ | 'container'
30
+ | 'nexus'
31
+ | 'plot'
32
+ | 'mdriver'
33
+ | 'mcatcher'
34
+ | 'hub'
35
+
36
+ export interface KindMeta {
37
+ kind: Name
38
+ classification: EntityClass
39
+ capabilityFlags: number
40
+ zCoord: number
41
+ defaultLabel: string
42
+ }
43
+
44
+ export interface TemplateMeta {
45
+ itemId: number
46
+ kind: Name
47
+ displayLabel: string
48
+ }
49
+
50
+ interface RawKindEntry {
51
+ kind: string
52
+ classification: string
53
+ capabilityFlags: number
54
+ zCoord: number
55
+ defaultLabel: string
56
+ }
57
+
58
+ interface RawTemplateEntry {
59
+ itemId: number
60
+ kind: string
61
+ displayLabel: string
62
+ }
63
+
64
+ const KIND_META: Map<string, KindMeta> = (() => {
65
+ const m = new Map<string, KindMeta>()
66
+ for (const r of kindRegistryJson.kinds as RawKindEntry[]) {
67
+ const cls = CLASSIFICATION_BY_NAME[r.classification]
68
+ if (cls === undefined) {
69
+ throw new Error(
70
+ `kind-registry: unknown classification "${r.classification}" for kind ${r.kind}`
71
+ )
72
+ }
73
+ m.set(r.kind, {
74
+ kind: Name.from(r.kind),
75
+ classification: cls,
76
+ capabilityFlags: r.capabilityFlags,
77
+ zCoord: r.zCoord,
78
+ defaultLabel: r.defaultLabel,
79
+ })
80
+ }
81
+ return m
82
+ })()
83
+
84
+ export const ALL_ENTITY_TYPES: readonly EntityTypeName[] = Object.freeze([
85
+ ...KIND_META.keys(),
86
+ ] as EntityTypeName[])
87
+
88
+ const TEMPLATE_BY_ITEM_ID: Map<number, TemplateMeta> = (() => {
89
+ const m = new Map<number, TemplateMeta>()
90
+ for (const r of kindRegistryJson.templates as RawTemplateEntry[]) {
91
+ m.set(r.itemId, {
92
+ itemId: r.itemId,
93
+ kind: Name.from(r.kind),
94
+ displayLabel: r.displayLabel,
95
+ })
96
+ }
97
+ return m
98
+ })()
99
+
100
+ function nameKey(kind: NameType | EntityTypeName): string {
101
+ if (typeof kind === 'string') return kind
102
+ return Name.from(kind).toString()
103
+ }
104
+
105
+ export function getKindMeta(kind: NameType | EntityTypeName): KindMeta | undefined {
106
+ return KIND_META.get(nameKey(kind))
107
+ }
108
+
109
+ export function getTemplateMeta(itemId: number): TemplateMeta | undefined {
110
+ return TEMPLATE_BY_ITEM_ID.get(itemId)
111
+ }
112
+
113
+ export function getPackedEntityType(itemId: number): Name | null {
114
+ return TEMPLATE_BY_ITEM_ID.get(itemId)?.kind ?? null
115
+ }
116
+
117
+ export function kindCan(kind: NameType | EntityTypeName, cap: number): boolean {
118
+ const m = KIND_META.get(nameKey(kind))
119
+ return m !== undefined && (m.capabilityFlags & cap) !== 0
120
+ }
121
+
122
+ export function canCatch(kind: NameType | EntityTypeName): boolean {
123
+ return kindCan(kind, CAP_CATCH)
124
+ }
125
+
126
+ export function getEntityClass(kind: NameType | EntityTypeName): EntityClass {
127
+ const m = KIND_META.get(nameKey(kind))
128
+ if (!m) throw new Error(`Entity type has no class: ${nameKey(kind)}`)
129
+ return m.classification
130
+ }
131
+
132
+ export const ENTITY_SHIP = Name.from('ship')
133
+ export const ENTITY_WAREHOUSE = Name.from('warehouse')
134
+ export const ENTITY_EXTRACTOR = Name.from('extractor')
135
+ export const ENTITY_FACTORY = Name.from('factory')
136
+ export const ENTITY_CONTAINER = Name.from('container')
137
+ export const ENTITY_NEXUS = Name.from('nexus')
138
+ export const ENTITY_PLOT = Name.from('plot')
139
+ export const ENTITY_MASS_DRIVER = Name.from('mdriver')
140
+ export const ENTITY_MASS_CATCHER = Name.from('mcatcher')
141
+ export const ENTITY_HUB = Name.from('hub')
142
+
143
+ export function isShip(entity: {type?: Name}): boolean {
144
+ return entity.type?.equals(ENTITY_SHIP) ?? false
145
+ }
146
+ export function isWarehouse(entity: {type?: Name}): boolean {
147
+ return entity.type?.equals(ENTITY_WAREHOUSE) ?? false
148
+ }
149
+ export function isExtractor(entity: {type?: Name}): boolean {
150
+ return entity.type?.equals(ENTITY_EXTRACTOR) ?? false
151
+ }
152
+ export function isFactory(entity: {type?: Name}): boolean {
153
+ return entity.type?.equals(ENTITY_FACTORY) ?? false
154
+ }
155
+ export function isContainer(entity: {type?: Name}): boolean {
156
+ return entity.type?.equals(ENTITY_CONTAINER) ?? false
157
+ }
158
+ export function isNexus(entity: {type?: Name}): boolean {
159
+ return entity.type?.equals(ENTITY_NEXUS) ?? false
160
+ }
161
+ export function isPlot(entity: {type?: Name}): boolean {
162
+ return entity.type?.equals(ENTITY_PLOT) ?? false
163
+ }
164
+ export function isMassDriver(entity: {type?: Name}): boolean {
165
+ return entity.type?.equals(ENTITY_MASS_DRIVER) ?? false
166
+ }
167
+ export function isMassCatcher(entity: {type?: Name}): boolean {
168
+ return entity.type?.equals(ENTITY_MASS_CATCHER) ?? false
169
+ }
170
+ export function isHub(entity: {type?: Name}): boolean {
171
+ return entity.type?.equals(ENTITY_HUB) ?? false
172
+ }
@@ -48,24 +48,24 @@ export const itemMetadata: Record<number, ItemMetadata> = {
48
48
  210: {name: 'Crystal', description: '', color: '#4ADBFF'},
49
49
 
50
50
  // === Resources / Gas ===
51
- 301: {name: 'Gas', description: 'Raw volatile gas.', color: '#B8E4A0'},
51
+ 301: {name: 'Gas', description: 'Raw volatile gas.', color: '#B877FF'},
52
52
  302: {
53
53
  name: 'Gas',
54
54
  description: 'Refined volatile gas with improved reactivity.',
55
- color: '#B8E4A0',
55
+ color: '#B877FF',
56
56
  },
57
57
  303: {
58
58
  name: 'Gas',
59
59
  description: 'High-grade volatile gas with exceptional energy density.',
60
- color: '#B8E4A0',
61
- },
62
- 304: {name: 'Gas', description: '', color: '#B8E4A0'},
63
- 305: {name: 'Gas', description: '', color: '#B8E4A0'},
64
- 306: {name: 'Gas', description: '', color: '#B8E4A0'},
65
- 307: {name: 'Gas', description: '', color: '#B8E4A0'},
66
- 308: {name: 'Gas', description: '', color: '#B8E4A0'},
67
- 309: {name: 'Gas', description: '', color: '#B8E4A0'},
68
- 310: {name: 'Gas', description: '', color: '#B8E4A0'},
60
+ color: '#B877FF',
61
+ },
62
+ 304: {name: 'Gas', description: '', color: '#B877FF'},
63
+ 305: {name: 'Gas', description: '', color: '#B877FF'},
64
+ 306: {name: 'Gas', description: '', color: '#B877FF'},
65
+ 307: {name: 'Gas', description: '', color: '#B877FF'},
66
+ 308: {name: 'Gas', description: '', color: '#B877FF'},
67
+ 309: {name: 'Gas', description: '', color: '#B877FF'},
68
+ 310: {name: 'Gas', description: '', color: '#B877FF'},
69
69
 
70
70
  // === Resources / Regolith ===
71
71
  401: {name: 'Regolith', description: 'Crude regolith dust.', color: '#C4A57B'},
@@ -109,57 +109,64 @@ export const itemMetadata: Record<number, ItemMetadata> = {
109
109
 
110
110
  // === Components (T1) ===
111
111
  10001: {
112
- name: 'Hull Plates',
113
- description: 'Structural plating formed from ore. Used in hulls, containers, and frames.',
112
+ name: 'Plate',
113
+ description:
114
+ 'Structural plating formed from ore. Used in hulls, containers, and storage modules.',
114
115
  color: '#7B8D9E',
115
116
  },
116
117
  10002: {
117
- name: 'Cargo Lining',
118
+ name: 'Frame',
118
119
  description:
119
- 'Composite lining formed from fine regolith bound in biomass polymer. Dense enough to seal cargo holds, flexible enough to absorb vibration.',
120
+ 'Composite framing formed from fine regolith bound in biomass polymer. Dense enough to seal cargo holds, flexible enough to absorb vibration.',
120
121
  color: '#C4A57B',
121
122
  },
122
123
  10003: {
123
- name: 'Thruster Core',
124
- description: 'High-energy propulsion component formed from volatile gases.',
124
+ name: 'Plasma Cell',
125
+ description:
126
+ 'High-energy gaseous storage cell. Volatile gas held under controlled thermal conditions.',
125
127
  color: '#E86344',
126
128
  },
127
129
  10004: {
128
- name: 'Power Cell',
130
+ name: 'Resonator',
129
131
  description:
130
- 'Crystalline energy storage matrix. Resonant lattices retain and release charge.',
132
+ 'Crystalline resonance lattice. Stores and releases charge through coherent oscillation.',
131
133
  color: '#4ADBFF',
132
134
  },
133
135
  10005: {
134
- name: 'Matter Conduit',
135
- description: 'Heavy-duty ore shaft used in gathering equipment.',
136
+ name: 'Beam',
137
+ description:
138
+ 'Heavy-duty structural beam machined from refined ore. Strong enough to bear load, tolerant enough to survive harsh environments.',
136
139
  color: '#7B8D9E',
137
140
  },
138
141
  10006: {
139
- name: 'Survey Probe',
140
- description: 'Crystal-lattice sensor array for deep resource detection.',
142
+ name: 'Sensor',
143
+ description:
144
+ 'Crystal-lattice sensing element with conductive and reflective properties. Reads signal and surface alike.',
141
145
  color: '#4ADBFF',
142
146
  },
143
147
  10007: {
144
- name: 'Cargo Arm',
145
- description: 'Flexible biomass composite arm for cargo handling.',
148
+ name: 'Polymer',
149
+ description:
150
+ 'Pliable biomass-derived polymer with high insulation. Flexible, durable, electrically inert.',
146
151
  color: '#5A8B3E',
147
152
  },
148
153
  10008: {
149
- name: 'Tool Bit',
150
- description: 'Dense regolith cutting head for crafting operations.',
154
+ name: 'Ceramic',
155
+ description:
156
+ 'Hardened fine-grained ceramic refined from regolith. Hard enough to cut, fine enough to finish.',
151
157
  color: '#C4A57B',
152
158
  },
153
159
  10009: {
154
- name: 'Reaction Chamber',
155
- description: 'Gas-pressurized vessel for controlled crafting reactions.',
156
- color: '#B8E4A0',
160
+ name: 'Reactor',
161
+ description:
162
+ 'Gas-pressurized vessel for controlled reactions. Vents heat and contains volatility.',
163
+ color: '#B877FF',
157
164
  },
158
165
  10010: {
159
- name: 'Focusing Array',
166
+ name: 'Resin',
160
167
  description:
161
- "Precision-formed crystal lens array. Routes the haul beam's energy efficiently to the target lock.",
162
- color: '#4ADBFF',
168
+ 'Saturated organic binder cured from biomass. A pliable matrix for haulage and field components.',
169
+ color: '#5A8B3E',
163
170
  },
164
171
 
165
172
  // === Modules (T1) ===
@@ -169,43 +176,53 @@ export const itemMetadata: Record<number, ItemMetadata> = {
169
176
  color: '#E86344',
170
177
  },
171
178
  10101: {
172
- name: 'Generator',
179
+ name: 'Power Core',
173
180
  description: 'Basic energy system. Stores and recharges energy from resonant crystals.',
174
181
  color: '#4ADBFF',
175
182
  },
176
183
  10102: {
177
- name: 'Gatherer',
184
+ name: 'Limpet Bay',
178
185
  description: 'Basic gathering system. Probes and conduits for raw resources.',
179
186
  color: '#7B8D9E',
180
187
  },
181
188
  10103: {
182
- name: 'Loader',
189
+ name: 'Shuttle Bay',
183
190
  description: 'Basic cargo handling system. Loads and unloads cargo with articulated arms.',
184
191
  color: '#5A8B3E',
185
192
  },
186
193
  10104: {
187
- name: 'Crafter',
194
+ name: 'Fabricator',
188
195
  description:
189
196
  'Basic crafting system. Processes materials using reaction chambers and cutting tools.',
190
- color: '#B8E4A0',
197
+ color: '#B877FF',
191
198
  },
192
199
  10105: {
193
- name: 'Storage',
194
- description: 'Expands cargo capacity based on hull material quality.',
200
+ name: 'Cargo Hold',
201
+ description: 'Expanded cargo storage with reinforced internal holds.',
195
202
  color: '#8B7355',
196
203
  },
197
204
  10106: {
198
- name: 'Hauler',
205
+ name: 'Tractor Beam',
199
206
  description:
200
207
  'Projects a haul beam to lock onto and transport containers or warehouses through group travel.',
201
208
  color: '#4ADBFF',
202
209
  },
203
210
  10107: {
204
- name: 'Warp',
211
+ name: 'Warp Drive',
205
212
  description:
206
213
  'Folds local space-time around the hull, projecting the ship across vast distances in a single discharge of the entire energy reserve.',
207
214
  color: '#9be4ff',
208
215
  },
216
+ 10108: {
217
+ name: 'Battery Bank',
218
+ description: 'Stores additional charge produced by the power core.',
219
+ color: '#4ADBFF',
220
+ },
221
+ 10109: {
222
+ name: 'Drive Coil',
223
+ description: 'Accelerates and launches cargo payloads toward a remote mass catcher.',
224
+ color: '#E86344',
225
+ },
209
226
 
210
227
  // === Entities (packed, T1) ===
211
228
  10200: {
@@ -214,7 +231,7 @@ export const itemMetadata: Record<number, ItemMetadata> = {
214
231
  color: '#7B8D9E',
215
232
  },
216
233
  10201: {
217
- name: 'Ship',
234
+ name: 'Roustabout',
218
235
  description: 'General-purpose vessel with 5 module slots.',
219
236
  color: '#4AE898',
220
237
  },
@@ -223,19 +240,100 @@ export const itemMetadata: Record<number, ItemMetadata> = {
223
240
  description: 'Massive stationary storage facility with a single loader module slot.',
224
241
  color: '#EAB308',
225
242
  },
243
+ 10203: {
244
+ name: 'Mining Rig',
245
+ description:
246
+ 'Planetary resource extraction facility with generator and gatherer module slots.',
247
+ color: '#D4726F',
248
+ },
249
+ 10204: {
250
+ name: 'Factory',
251
+ description: 'Planetary fabrication facility with generator and crafter module slots.',
252
+ color: '#7BA7D4',
253
+ },
254
+ 10205: {
255
+ name: 'Mass Driver',
256
+ description: 'Planetary launch platform with power core and drive coil module slots.',
257
+ color: '#E86344',
258
+ },
259
+ 10206: {
260
+ name: 'Mass Catcher',
261
+ description:
262
+ 'Planetary receiving platform with storage module slots; catches launched payloads.',
263
+ color: '#4AE898',
264
+ },
265
+ 10207: {
266
+ name: 'Station Hub',
267
+ description: 'Orbital command structure. Anchors a player station cluster.',
268
+ color: '#A0B8D0',
269
+ },
226
270
 
227
271
  // === Components (T2) ===
228
272
  20001: {
229
- name: 'Hull Plates',
273
+ name: 'Plate',
230
274
  description: 'Advanced structural plating reinforced with tier 2 ore.',
231
275
  color: '#9BADB8',
232
276
  },
233
277
  20002: {
234
- name: 'Cargo Lining',
278
+ name: 'Frame',
235
279
  description:
236
- 'Advanced composite lining reinforced with tier 2 regolith and biomass polymer.',
280
+ 'Advanced composite framing reinforced with tier 2 regolith and biomass polymer.',
237
281
  color: '#C4A57B',
238
282
  },
283
+ 20003: {
284
+ name: 'Plasma Cell',
285
+ description: 'Advanced high-energy gaseous storage cell reinforced with tier 2 gas.',
286
+ color: '#E86344',
287
+ },
288
+ 20004: {
289
+ name: 'Resonator',
290
+ description: 'Advanced crystalline resonance lattice reinforced with tier 2 crystal.',
291
+ color: '#4ADBFF',
292
+ },
293
+ 20005: {
294
+ name: 'Beam',
295
+ description: 'Advanced heavy-duty structural beam reinforced with tier 2 ore.',
296
+ color: '#7B8D9E',
297
+ },
298
+ 20006: {
299
+ name: 'Sensor',
300
+ description: 'Advanced crystal-lattice sensing element reinforced with tier 2 crystal.',
301
+ color: '#4ADBFF',
302
+ },
303
+ 20007: {
304
+ name: 'Polymer',
305
+ description: 'Advanced pliable biomass-derived polymer reinforced with tier 2 biomass.',
306
+ color: '#5A8B3E',
307
+ },
308
+ 20008: {
309
+ name: 'Ceramic',
310
+ description: 'Advanced hardened ceramic reinforced with tier 2 regolith.',
311
+ color: '#C4A57B',
312
+ },
313
+ 20009: {
314
+ name: 'Reactor',
315
+ description: 'Advanced gas-pressurized reaction vessel reinforced with tier 2 gas.',
316
+ color: '#B877FF',
317
+ },
318
+ 20010: {
319
+ name: 'Resin',
320
+ description: 'Advanced saturated organic binder reinforced with tier 2 biomass.',
321
+ color: '#5A8B3E',
322
+ },
323
+
324
+ // === Modules (T2) ===
325
+ 20102: {
326
+ name: 'Limpet Bay',
327
+ description: 'Advanced gathering system. Reinforced probes and conduits for deeper yield.',
328
+ color: '#7B8D9E',
329
+ },
330
+
331
+ 20106: {
332
+ name: 'Tractor Beam',
333
+ description:
334
+ 'Advanced haul beam projector reinforced with tier 2 components for greater towing capacity.',
335
+ color: '#4ADBFF',
336
+ },
239
337
 
240
338
  // === Entities (packed, T2) ===
241
339
  20200: {
@@ -243,11 +341,31 @@ export const itemMetadata: Record<number, ItemMetadata> = {
243
341
  description: 'Advanced cargo container with improved capacity formulas.',
244
342
  color: '#9BADB8',
245
343
  },
344
+ 20210: {
345
+ name: 'Prospector',
346
+ description:
347
+ 'Advanced exploration vessel with tiered engine, power core, and limpet bay slots.',
348
+ color: '#4AE898',
349
+ },
350
+ 20211: {
351
+ name: 'Hauler',
352
+ description:
353
+ 'Advanced towing vessel with tiered engine, generator, and tractor beam slots.',
354
+ color: '#4AE898',
355
+ },
246
356
  }
247
357
 
248
358
  export const entityMetadata: Record<number, EntityMetadata> = {
249
- 10201: {moduleSlotLabels: ['Engine', 'Generator', 'Gatherer', 'Loader', 'Storage']},
250
- 10202: {moduleSlotLabels: ['Loader', 'Storage', 'Storage', 'Storage', 'Storage']},
359
+ 10201: {moduleSlotLabels: ['Engine', 'Power Core', 'Limpet Bay', 'Shuttle Bay', 'Cargo Hold']},
360
+ 10202: {
361
+ moduleSlotLabels: ['Shuttle Bay', 'Cargo Hold', 'Cargo Hold', 'Cargo Hold', 'Cargo Hold'],
362
+ },
363
+ 10203: {moduleSlotLabels: ['Power Core', 'Limpet Bay']},
364
+ 10204: {moduleSlotLabels: ['Power Core', 'Fabricator']},
365
+ 10205: {moduleSlotLabels: ['Power Core', 'Drive Coil']},
366
+ 10206: {moduleSlotLabels: ['Cargo Hold', 'Cargo Hold', 'Cargo Hold']},
367
+ 20210: {moduleSlotLabels: ['Engine', 'Power Core', 'Limpet Bay', 'Limpet Bay', 'Flex Slot']},
368
+ 20211: {moduleSlotLabels: ['Engine', 'Power Core', 'Tractor Beam', 'Tractor Beam']},
251
369
  }
252
370
 
253
371
  for (const item of items as Array<{id: number}>) {
@@ -1,20 +1,12 @@
1
- import items from './items.json'
2
1
  import recipes from './recipes.json'
3
2
  import entities from './entities.json'
4
3
 
5
- import {getItem} from './catalog'
6
- import type {Item, ModuleType, ResourceCategory} from '../types'
4
+ import type {ModuleType} from '../types'
7
5
 
8
- export interface RecipeInputItemId {
6
+ export interface RecipeInput {
9
7
  itemId: number
10
8
  quantity: number
11
9
  }
12
- export interface RecipeInputCategory {
13
- category: ResourceCategory
14
- tier: number
15
- quantity: number
16
- }
17
- export type RecipeInput = RecipeInputItemId | RecipeInputCategory
18
10
 
19
11
  export interface StatSlot {
20
12
  sources: {inputIndex: number; statIndex: number}[]
@@ -26,10 +18,13 @@ export interface Recipe {
26
18
  inputs: RecipeInput[]
27
19
  statSlots: StatSlot[]
28
20
  blendWeights: number[]
21
+ sourceSubclass?: number
29
22
  }
30
23
 
31
24
  export interface EntitySlot {
32
25
  type: ModuleType
26
+ outputPct: number
27
+ maxTier: number
33
28
  }
34
29
 
35
30
  export interface EntityLayout {
@@ -43,13 +38,6 @@ for (const r of recipes as any[]) recipesById.set(r.outputItemId, r as Recipe)
43
38
  const entitiesById = new Map<number, EntityLayout>()
44
39
  for (const e of entities as any[]) entitiesById.set(e.entityItemId, e as EntityLayout)
45
40
 
46
- const resourceByCategoryTier = new Map<string, Item>()
47
- for (const raw of items as any[]) {
48
- if (raw.type === 'resource') {
49
- resourceByCategoryTier.set(`${raw.category}:${raw.tier}`, getItem(raw.id))
50
- }
51
- }
52
-
53
41
  export function getRecipe(outputItemId: number): Recipe | undefined {
54
42
  return recipesById.get(outputItemId)
55
43
  }
@@ -57,9 +45,3 @@ export function getRecipe(outputItemId: number): Recipe | undefined {
57
45
  export function getEntityLayout(entityItemId: number): EntityLayout | undefined {
58
46
  return entitiesById.get(entityItemId)
59
47
  }
60
-
61
- export function findItemByCategoryAndTier(category: ResourceCategory, tier: number): Item {
62
- const item = resourceByCategoryTier.get(`${category}:${tier}`)
63
- if (!item) throw new Error(`No resource found for category=${category} tier=${tier}`)
64
- return item
65
- }