@aephia/atlas-kit 0.6.0-next.99 → 0.6.1

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 (762) hide show
  1. package/README.md +5 -0
  2. package/dist/cargo/actions/deposit.d.ts +4 -1
  3. package/dist/cargo/actions/deposit.d.ts.map +1 -1
  4. package/dist/cargo/actions/deposit.js +56 -133
  5. package/dist/cargo/actions/deposit.js.map +1 -1
  6. package/dist/cargo/actions/index.d.ts +14 -7
  7. package/dist/cargo/actions/index.d.ts.map +1 -1
  8. package/dist/cargo/actions/index.js +101 -89
  9. package/dist/cargo/actions/index.js.map +1 -1
  10. package/dist/cargo/actions/wallet-context.d.ts +52 -3
  11. package/dist/cargo/actions/wallet-context.d.ts.map +1 -1
  12. package/dist/cargo/actions/wallet-context.js +118 -7
  13. package/dist/cargo/actions/wallet-context.js.map +1 -1
  14. package/dist/cargo/actions/wallet-token.d.ts +1 -6
  15. package/dist/cargo/actions/wallet-token.d.ts.map +1 -1
  16. package/dist/cargo/actions/wallet-token.js +0 -45
  17. package/dist/cargo/actions/wallet-token.js.map +1 -1
  18. package/dist/cargo/actions/withdrawal.d.ts +1 -1
  19. package/dist/cargo/actions/withdrawal.d.ts.map +1 -1
  20. package/dist/cargo/actions/withdrawal.js +37 -163
  21. package/dist/cargo/actions/withdrawal.js.map +1 -1
  22. package/dist/cargo/index.d.ts.map +1 -1
  23. package/dist/cargo/index.js +2 -10
  24. package/dist/cargo/index.js.map +1 -1
  25. package/dist/claim-stakes/actions/index.d.ts +80 -14
  26. package/dist/claim-stakes/actions/index.d.ts.map +1 -1
  27. package/dist/claim-stakes/actions/index.js +660 -709
  28. package/dist/claim-stakes/actions/index.js.map +1 -1
  29. package/dist/claim-stakes/index.d.ts +8 -6
  30. package/dist/claim-stakes/index.d.ts.map +1 -1
  31. package/dist/claim-stakes/index.js +12 -18
  32. package/dist/claim-stakes/index.js.map +1 -1
  33. package/dist/client/context.d.ts.map +1 -1
  34. package/dist/client/context.js +353 -37
  35. package/dist/client/context.js.map +1 -1
  36. package/dist/client/contracts.d.ts +54 -1
  37. package/dist/client/contracts.d.ts.map +1 -1
  38. package/dist/client/deployments.d.ts +17 -0
  39. package/dist/client/deployments.d.ts.map +1 -1
  40. package/dist/client/deployments.js +17 -0
  41. package/dist/client/deployments.js.map +1 -1
  42. package/dist/client/index.d.ts +22 -1
  43. package/dist/client/index.d.ts.map +1 -1
  44. package/dist/client/index.js +21 -0
  45. package/dist/client/index.js.map +1 -1
  46. package/dist/client/rpc-subscription-provider.d.ts +2 -0
  47. package/dist/client/rpc-subscription-provider.d.ts.map +1 -1
  48. package/dist/client/rpc-subscription-provider.js +135 -101
  49. package/dist/client/rpc-subscription-provider.js.map +1 -1
  50. package/dist/combat/actions/index.d.ts +30 -12
  51. package/dist/combat/actions/index.d.ts.map +1 -1
  52. package/dist/combat/actions/index.js +264 -252
  53. package/dist/combat/actions/index.js.map +1 -1
  54. package/dist/combat/index.d.ts +25 -8
  55. package/dist/combat/index.d.ts.map +1 -1
  56. package/dist/combat/index.js +21 -18
  57. package/dist/combat/index.js.map +1 -1
  58. package/dist/crafting/actions/fee-rate.d.ts +47 -0
  59. package/dist/crafting/actions/fee-rate.d.ts.map +1 -0
  60. package/dist/crafting/actions/fee-rate.js +58 -0
  61. package/dist/crafting/actions/fee-rate.js.map +1 -0
  62. package/dist/crafting/actions/index.d.ts +28 -28
  63. package/dist/crafting/actions/index.d.ts.map +1 -1
  64. package/dist/crafting/actions/index.js +243 -314
  65. package/dist/crafting/actions/index.js.map +1 -1
  66. package/dist/crafting/estimate.d.ts +101 -0
  67. package/dist/crafting/estimate.d.ts.map +1 -0
  68. package/dist/crafting/estimate.js +108 -0
  69. package/dist/crafting/estimate.js.map +1 -0
  70. package/dist/crafting/index.d.ts +6 -5
  71. package/dist/crafting/index.d.ts.map +1 -1
  72. package/dist/crafting/index.js +6 -13
  73. package/dist/crafting/index.js.map +1 -1
  74. package/dist/factions/actions/index.d.ts +1 -1
  75. package/dist/factions/actions/index.d.ts.map +1 -1
  76. package/dist/factions/actions/index.js +5 -4
  77. package/dist/factions/actions/index.js.map +1 -1
  78. package/dist/factions/index.d.ts +18 -1
  79. package/dist/factions/index.d.ts.map +1 -1
  80. package/dist/factions/index.js +24 -18
  81. package/dist/factions/index.js.map +1 -1
  82. package/dist/fleets/actions/add-ship.d.ts +18 -5
  83. package/dist/fleets/actions/add-ship.d.ts.map +1 -1
  84. package/dist/fleets/actions/add-ship.js +35 -48
  85. package/dist/fleets/actions/add-ship.js.map +1 -1
  86. package/dist/fleets/actions/create-fleet.d.ts +1 -1
  87. package/dist/fleets/actions/create-fleet.d.ts.map +1 -1
  88. package/dist/fleets/actions/create-fleet.js +8 -38
  89. package/dist/fleets/actions/create-fleet.js.map +1 -1
  90. package/dist/fleets/actions/crew-transfer.d.ts +8 -4
  91. package/dist/fleets/actions/crew-transfer.d.ts.map +1 -1
  92. package/dist/fleets/actions/crew-transfer.js +27 -42
  93. package/dist/fleets/actions/crew-transfer.js.map +1 -1
  94. package/dist/fleets/actions/deployment-storage.d.ts +161 -0
  95. package/dist/fleets/actions/deployment-storage.d.ts.map +1 -0
  96. package/dist/fleets/actions/deployment-storage.js +297 -0
  97. package/dist/fleets/actions/deployment-storage.js.map +1 -0
  98. package/dist/fleets/actions/disband.d.ts +42 -0
  99. package/dist/fleets/actions/disband.d.ts.map +1 -0
  100. package/dist/fleets/actions/disband.js +107 -0
  101. package/dist/fleets/actions/disband.js.map +1 -0
  102. package/dist/fleets/actions/index.d.ts +55 -11
  103. package/dist/fleets/actions/index.d.ts.map +1 -1
  104. package/dist/fleets/actions/index.js +282 -235
  105. package/dist/fleets/actions/index.js.map +1 -1
  106. package/dist/fleets/actions/respawn.d.ts +1 -1
  107. package/dist/fleets/actions/respawn.d.ts.map +1 -1
  108. package/dist/fleets/actions/respawn.js +8 -37
  109. package/dist/fleets/actions/respawn.js.map +1 -1
  110. package/dist/fleets/actions/ship-import.d.ts +1 -1
  111. package/dist/fleets/actions/ship-import.d.ts.map +1 -1
  112. package/dist/fleets/actions/ship-import.js +39 -91
  113. package/dist/fleets/actions/ship-import.js.map +1 -1
  114. package/dist/fleets/actions/sync.d.ts +24 -0
  115. package/dist/fleets/actions/sync.d.ts.map +1 -0
  116. package/dist/fleets/actions/sync.js +55 -0
  117. package/dist/fleets/actions/sync.js.map +1 -0
  118. package/dist/fleets/composition-stats.d.ts +101 -0
  119. package/dist/fleets/composition-stats.d.ts.map +1 -0
  120. package/dist/fleets/composition-stats.js +354 -0
  121. package/dist/fleets/composition-stats.js.map +1 -0
  122. package/dist/fleets/cooldown.d.ts +7 -4
  123. package/dist/fleets/cooldown.d.ts.map +1 -1
  124. package/dist/fleets/cooldown.js +11 -6
  125. package/dist/fleets/cooldown.js.map +1 -1
  126. package/dist/fleets/index.d.ts +1 -0
  127. package/dist/fleets/index.d.ts.map +1 -1
  128. package/dist/fleets/index.js +3 -10
  129. package/dist/fleets/index.js.map +1 -1
  130. package/dist/fleets/movement-arithmetic.d.ts.map +1 -1
  131. package/dist/fleets/movement-arithmetic.js +4 -0
  132. package/dist/fleets/movement-arithmetic.js.map +1 -1
  133. package/dist/fleets/subwarp-estimate.d.ts +3 -1
  134. package/dist/fleets/subwarp-estimate.d.ts.map +1 -1
  135. package/dist/fleets/subwarp-estimate.js +3 -1
  136. package/dist/fleets/subwarp-estimate.js.map +1 -1
  137. package/dist/fleets/warp-lane-policy.d.ts +13 -7
  138. package/dist/fleets/warp-lane-policy.d.ts.map +1 -1
  139. package/dist/fleets/warp-lane-policy.js +19 -7
  140. package/dist/fleets/warp-lane-policy.js.map +1 -1
  141. package/dist/identity/actions/create-profile.d.ts +1 -1
  142. package/dist/identity/actions/create-profile.d.ts.map +1 -1
  143. package/dist/identity/actions/create-profile.js +2 -2
  144. package/dist/identity/actions/create-profile.js.map +1 -1
  145. package/dist/identity/actions/index.d.ts +2 -1
  146. package/dist/identity/actions/index.d.ts.map +1 -1
  147. package/dist/identity/actions/index.js +6 -4
  148. package/dist/identity/actions/index.js.map +1 -1
  149. package/dist/identity/actions/research-unlock.d.ts +61 -0
  150. package/dist/identity/actions/research-unlock.d.ts.map +1 -0
  151. package/dist/identity/actions/research-unlock.js +166 -0
  152. package/dist/identity/actions/research-unlock.js.map +1 -0
  153. package/dist/identity/index.d.ts +62 -2
  154. package/dist/identity/index.d.ts.map +1 -1
  155. package/dist/identity/index.js +63 -12
  156. package/dist/identity/index.js.map +1 -1
  157. package/dist/index.d.ts +2 -1
  158. package/dist/index.d.ts.map +1 -1
  159. package/dist/index.js +4 -4
  160. package/dist/index.js.map +1 -1
  161. package/dist/internal/c4/account-decoding.d.ts +49 -0
  162. package/dist/internal/c4/account-decoding.d.ts.map +1 -0
  163. package/dist/internal/c4/account-decoding.js +74 -0
  164. package/dist/internal/c4/account-decoding.js.map +1 -0
  165. package/dist/internal/c4/career-xp.d.ts +58 -0
  166. package/dist/internal/c4/career-xp.d.ts.map +1 -0
  167. package/dist/internal/c4/career-xp.js +80 -0
  168. package/dist/internal/c4/career-xp.js.map +1 -0
  169. package/dist/internal/c4/cargo-instructions.d.ts +24 -0
  170. package/dist/internal/c4/cargo-instructions.d.ts.map +1 -0
  171. package/dist/internal/c4/cargo-instructions.js +30 -0
  172. package/dist/internal/c4/cargo-instructions.js.map +1 -0
  173. package/dist/internal/c4/cargo-pod.d.ts +15 -0
  174. package/dist/internal/c4/cargo-pod.d.ts.map +1 -0
  175. package/dist/internal/c4/cargo-pod.js +13 -0
  176. package/dist/internal/c4/cargo-pod.js.map +1 -0
  177. package/dist/internal/c4/character-modifier.d.ts +1 -1
  178. package/dist/internal/c4/character-modifier.d.ts.map +1 -1
  179. package/dist/internal/c4/character.d.ts +157 -0
  180. package/dist/internal/c4/character.d.ts.map +1 -0
  181. package/dist/internal/c4/character.js +64 -0
  182. package/dist/internal/c4/character.js.map +1 -0
  183. package/dist/internal/c4/claim-stake-building-definitions.d.ts.map +1 -1
  184. package/dist/internal/c4/claim-stake-building-definitions.js +2 -1
  185. package/dist/internal/c4/claim-stake-building-definitions.js.map +1 -1
  186. package/dist/internal/c4/claim-stake-configuration.d.ts.map +1 -1
  187. package/dist/internal/c4/claim-stake-configuration.js +5 -36
  188. package/dist/internal/c4/claim-stake-configuration.js.map +1 -1
  189. package/dist/internal/c4/claim-stake-definitions.d.ts +4 -0
  190. package/dist/internal/c4/claim-stake-definitions.d.ts.map +1 -1
  191. package/dist/internal/c4/claim-stake-definitions.js +6 -2
  192. package/dist/internal/c4/claim-stake-definitions.js.map +1 -1
  193. package/dist/internal/c4/claim-stake-plots.d.ts +17 -0
  194. package/dist/internal/c4/claim-stake-plots.d.ts.map +1 -0
  195. package/dist/internal/c4/claim-stake-plots.js +29 -0
  196. package/dist/internal/c4/claim-stake-plots.js.map +1 -0
  197. package/dist/internal/c4/claim-stake-standing.d.ts +80 -0
  198. package/dist/internal/c4/claim-stake-standing.d.ts.map +1 -0
  199. package/dist/internal/c4/claim-stake-standing.js +61 -0
  200. package/dist/internal/c4/claim-stake-standing.js.map +1 -0
  201. package/dist/internal/c4/claim-stake-storage.d.ts +45 -0
  202. package/dist/internal/c4/claim-stake-storage.d.ts.map +1 -0
  203. package/dist/internal/c4/claim-stake-storage.js +207 -0
  204. package/dist/internal/c4/claim-stake-storage.js.map +1 -0
  205. package/dist/internal/c4/claim-stake.d.ts +9 -6
  206. package/dist/internal/c4/claim-stake.d.ts.map +1 -1
  207. package/dist/internal/c4/claim-stake.js +24 -56
  208. package/dist/internal/c4/claim-stake.js.map +1 -1
  209. package/dist/internal/c4/combat-storage.d.ts +20 -0
  210. package/dist/internal/c4/combat-storage.d.ts.map +1 -0
  211. package/dist/internal/c4/combat-storage.js +43 -0
  212. package/dist/internal/c4/combat-storage.js.map +1 -0
  213. package/dist/internal/c4/combat.d.ts +1 -55
  214. package/dist/internal/c4/combat.d.ts.map +1 -1
  215. package/dist/internal/c4/combat.js +16 -180
  216. package/dist/internal/c4/combat.js.map +1 -1
  217. package/dist/internal/c4/crafting-storage.d.ts +20 -0
  218. package/dist/internal/c4/crafting-storage.d.ts.map +1 -0
  219. package/dist/internal/c4/crafting-storage.js +54 -0
  220. package/dist/internal/c4/crafting-storage.js.map +1 -0
  221. package/dist/internal/c4/crafting.d.ts +9 -1
  222. package/dist/internal/c4/crafting.d.ts.map +1 -1
  223. package/dist/internal/c4/crafting.js +38 -98
  224. package/dist/internal/c4/crafting.js.map +1 -1
  225. package/dist/internal/c4/currency-cache.d.ts +1 -1
  226. package/dist/internal/c4/currency-cache.d.ts.map +1 -1
  227. package/dist/internal/c4/currency-cache.js +6 -9
  228. package/dist/internal/c4/currency-cache.js.map +1 -1
  229. package/dist/internal/c4/discriminators.d.ts +93 -0
  230. package/dist/internal/c4/discriminators.d.ts.map +1 -0
  231. package/dist/internal/c4/discriminators.js +190 -0
  232. package/dist/internal/c4/discriminators.js.map +1 -0
  233. package/dist/internal/c4/faction-epoch-meter.d.ts.map +1 -1
  234. package/dist/internal/c4/faction-epoch-meter.js +5 -10
  235. package/dist/internal/c4/faction-epoch-meter.js.map +1 -1
  236. package/dist/internal/c4/faction-treasury.d.ts.map +1 -1
  237. package/dist/internal/c4/faction-treasury.js +11 -18
  238. package/dist/internal/c4/faction-treasury.js.map +1 -1
  239. package/dist/internal/c4/faction.d.ts +21 -0
  240. package/dist/internal/c4/faction.d.ts.map +1 -0
  241. package/dist/internal/c4/faction.js +23 -0
  242. package/dist/internal/c4/faction.js.map +1 -0
  243. package/dist/internal/c4/factions.d.ts +31 -3
  244. package/dist/internal/c4/factions.d.ts.map +1 -1
  245. package/dist/internal/c4/factions.js +103 -104
  246. package/dist/internal/c4/factions.js.map +1 -1
  247. package/dist/internal/c4/fleet-creation.d.ts +9 -2
  248. package/dist/internal/c4/fleet-creation.d.ts.map +1 -1
  249. package/dist/internal/c4/fleet-creation.js +15 -18
  250. package/dist/internal/c4/fleet-creation.js.map +1 -1
  251. package/dist/internal/c4/fleet-crew-binding.d.ts.map +1 -1
  252. package/dist/internal/c4/fleet-crew-binding.js +21 -49
  253. package/dist/internal/c4/fleet-crew-binding.js.map +1 -1
  254. package/dist/internal/c4/fleet-disband-layout.d.ts +7 -0
  255. package/dist/internal/c4/fleet-disband-layout.d.ts.map +1 -0
  256. package/dist/internal/c4/fleet-disband-layout.js +7 -0
  257. package/dist/internal/c4/fleet-disband-layout.js.map +1 -0
  258. package/dist/internal/c4/fleet-disband.d.ts +41 -0
  259. package/dist/internal/c4/fleet-disband.d.ts.map +1 -0
  260. package/dist/internal/c4/fleet-disband.js +86 -0
  261. package/dist/internal/c4/fleet-disband.js.map +1 -0
  262. package/dist/internal/c4/fleet-points.d.ts +3 -0
  263. package/dist/internal/c4/fleet-points.d.ts.map +1 -0
  264. package/dist/internal/c4/fleet-points.js +8 -0
  265. package/dist/internal/c4/fleet-points.js.map +1 -0
  266. package/dist/internal/c4/fleet-ship-assembly.d.ts +20 -5
  267. package/dist/internal/c4/fleet-ship-assembly.d.ts.map +1 -1
  268. package/dist/internal/c4/fleet-ship-assembly.js +62 -10
  269. package/dist/internal/c4/fleet-ship-assembly.js.map +1 -1
  270. package/dist/internal/c4/fleet-storage.d.ts +44 -0
  271. package/dist/internal/c4/fleet-storage.d.ts.map +1 -0
  272. package/dist/internal/c4/fleet-storage.js +108 -0
  273. package/dist/internal/c4/fleet-storage.js.map +1 -0
  274. package/dist/internal/c4/fleet-sync.d.ts +5 -0
  275. package/dist/internal/c4/fleet-sync.d.ts.map +1 -0
  276. package/dist/internal/c4/fleet-sync.js +15 -0
  277. package/dist/internal/c4/fleet-sync.js.map +1 -0
  278. package/dist/internal/c4/fleet.d.ts +20 -5
  279. package/dist/internal/c4/fleet.d.ts.map +1 -1
  280. package/dist/internal/c4/fleet.js +24 -84
  281. package/dist/internal/c4/fleet.js.map +1 -1
  282. package/dist/internal/c4/game.d.ts +76 -21
  283. package/dist/internal/c4/game.d.ts.map +1 -1
  284. package/dist/internal/c4/game.js +127 -116
  285. package/dist/internal/c4/game.js.map +1 -1
  286. package/dist/internal/c4/identity.d.ts +2 -153
  287. package/dist/internal/c4/identity.d.ts.map +1 -1
  288. package/dist/internal/c4/identity.js +19 -126
  289. package/dist/internal/c4/identity.js.map +1 -1
  290. package/dist/internal/c4/local-market-order.d.ts +4 -6
  291. package/dist/internal/c4/local-market-order.d.ts.map +1 -1
  292. package/dist/internal/c4/local-market-order.js +5 -6
  293. package/dist/internal/c4/local-market-order.js.map +1 -1
  294. package/dist/internal/c4/loot-layout.js +1 -1
  295. package/dist/internal/c4/loot-layout.js.map +1 -1
  296. package/dist/internal/c4/loot.d.ts +89 -0
  297. package/dist/internal/c4/loot.d.ts.map +1 -0
  298. package/dist/internal/c4/loot.js +109 -0
  299. package/dist/internal/c4/loot.js.map +1 -0
  300. package/dist/internal/c4/loyalty.d.ts +7 -3
  301. package/dist/internal/c4/loyalty.d.ts.map +1 -1
  302. package/dist/internal/c4/loyalty.js +41 -130
  303. package/dist/internal/c4/loyalty.js.map +1 -1
  304. package/dist/internal/c4/market-storage.d.ts +25 -0
  305. package/dist/internal/c4/market-storage.d.ts.map +1 -0
  306. package/dist/internal/c4/market-storage.js +53 -0
  307. package/dist/internal/c4/market-storage.js.map +1 -0
  308. package/dist/internal/c4/market.d.ts +3 -0
  309. package/dist/internal/c4/market.d.ts.map +1 -1
  310. package/dist/internal/c4/market.js +20 -76
  311. package/dist/internal/c4/market.js.map +1 -1
  312. package/dist/internal/c4/mining-instructions.d.ts +1 -1
  313. package/dist/internal/c4/mining-instructions.d.ts.map +1 -1
  314. package/dist/internal/c4/mining-instructions.js +1 -1
  315. package/dist/internal/c4/mining-instructions.js.map +1 -1
  316. package/dist/internal/c4/open-signal.d.ts +1 -1
  317. package/dist/internal/c4/open-signal.d.ts.map +1 -1
  318. package/dist/internal/c4/open-signal.js +1 -1
  319. package/dist/internal/c4/open-signal.js.map +1 -1
  320. package/dist/internal/c4/pda.d.ts +49 -1
  321. package/dist/internal/c4/pda.d.ts.map +1 -1
  322. package/dist/internal/c4/pda.js +122 -17
  323. package/dist/internal/c4/pda.js.map +1 -1
  324. package/dist/internal/c4/profile-faction.d.ts +2 -1
  325. package/dist/internal/c4/profile-faction.d.ts.map +1 -1
  326. package/dist/internal/c4/profile-faction.js +36 -72
  327. package/dist/internal/c4/profile-faction.js.map +1 -1
  328. package/dist/internal/c4/profile-permissions.d.ts +1 -1
  329. package/dist/internal/c4/profile-permissions.d.ts.map +1 -1
  330. package/dist/internal/c4/profile-permissions.js +16 -1
  331. package/dist/internal/c4/profile-permissions.js.map +1 -1
  332. package/dist/internal/c4/rewards.d.ts +1 -34
  333. package/dist/internal/c4/rewards.d.ts.map +1 -1
  334. package/dist/internal/c4/rewards.js +23 -170
  335. package/dist/internal/c4/rewards.js.map +1 -1
  336. package/dist/internal/c4/runtime-bindings.d.ts +1 -1
  337. package/dist/internal/c4/runtime-bindings.d.ts.map +1 -1
  338. package/dist/internal/c4/runtime-bindings.js +1 -1
  339. package/dist/internal/c4/runtime-bindings.js.map +1 -1
  340. package/dist/internal/c4/scan-lifecycle.d.ts +21 -3
  341. package/dist/internal/c4/scan-lifecycle.d.ts.map +1 -1
  342. package/dist/internal/c4/scan-lifecycle.js +35 -44
  343. package/dist/internal/c4/scan-lifecycle.js.map +1 -1
  344. package/dist/internal/c4/scan-storage.d.ts +7 -0
  345. package/dist/internal/c4/scan-storage.d.ts.map +1 -0
  346. package/dist/internal/c4/scan-storage.js +10 -0
  347. package/dist/internal/c4/scan-storage.js.map +1 -0
  348. package/dist/internal/c4/scanning.d.ts +3 -13
  349. package/dist/internal/c4/scanning.d.ts.map +1 -1
  350. package/dist/internal/c4/scanning.js +25 -75
  351. package/dist/internal/c4/scanning.js.map +1 -1
  352. package/dist/internal/c4/ship-stats.d.ts.map +1 -1
  353. package/dist/internal/c4/ship-stats.js +24 -26
  354. package/dist/internal/c4/ship-stats.js.map +1 -1
  355. package/dist/internal/c4/starbase.d.ts.map +1 -1
  356. package/dist/internal/c4/starbase.js +24 -96
  357. package/dist/internal/c4/starbase.js.map +1 -1
  358. package/dist/internal/c4/stimulant.d.ts +26 -0
  359. package/dist/internal/c4/stimulant.d.ts.map +1 -0
  360. package/dist/internal/c4/stimulant.js +36 -0
  361. package/dist/internal/c4/stimulant.js.map +1 -0
  362. package/dist/internal/c4/wallet-cargo-cache.js +2 -1
  363. package/dist/internal/c4/wallet-cargo-cache.js.map +1 -1
  364. package/dist/internal/c4/world.d.ts +6 -2
  365. package/dist/internal/c4/world.d.ts.map +1 -1
  366. package/dist/internal/c4/world.js +32 -107
  367. package/dist/internal/c4/world.js.map +1 -1
  368. package/dist/internal/fleet-route.d.ts +12 -0
  369. package/dist/internal/fleet-route.d.ts.map +1 -0
  370. package/dist/internal/fleet-route.js +11 -0
  371. package/dist/internal/fleet-route.js.map +1 -0
  372. package/dist/internal/fleet.d.ts +3 -3
  373. package/dist/internal/fleet.d.ts.map +1 -1
  374. package/dist/internal/fleet.js +1 -5
  375. package/dist/internal/fleet.js.map +1 -1
  376. package/dist/internal/loyalty-atlas-bank-state.d.ts +3 -2
  377. package/dist/internal/loyalty-atlas-bank-state.d.ts.map +1 -1
  378. package/dist/internal/loyalty-atlas-bank-state.js +4 -3
  379. package/dist/internal/loyalty-atlas-bank-state.js.map +1 -1
  380. package/dist/internal/planning/account-state.d.ts +6 -0
  381. package/dist/internal/planning/account-state.d.ts.map +1 -1
  382. package/dist/internal/planning/account-state.js +13 -0
  383. package/dist/internal/planning/account-state.js.map +1 -1
  384. package/dist/internal/planning/arrival-guards.d.ts +0 -1
  385. package/dist/internal/planning/arrival-guards.d.ts.map +1 -1
  386. package/dist/internal/planning/arrival-guards.js +3 -18
  387. package/dist/internal/planning/arrival-guards.js.map +1 -1
  388. package/dist/internal/planning/authorization-adapter.d.ts +34 -11
  389. package/dist/internal/planning/authorization-adapter.d.ts.map +1 -1
  390. package/dist/internal/planning/authorization-adapter.js +116 -12
  391. package/dist/internal/planning/authorization-adapter.js.map +1 -1
  392. package/dist/internal/planning/cargo-storage-actions.d.ts +8 -0
  393. package/dist/internal/planning/cargo-storage-actions.d.ts.map +1 -0
  394. package/dist/internal/planning/cargo-storage-actions.js +97 -0
  395. package/dist/internal/planning/cargo-storage-actions.js.map +1 -0
  396. package/dist/internal/planning/character-access.d.ts +28 -0
  397. package/dist/internal/planning/character-access.d.ts.map +1 -0
  398. package/dist/internal/planning/character-access.js +41 -0
  399. package/dist/internal/planning/character-access.js.map +1 -0
  400. package/dist/internal/planning/character-registration-guard.d.ts.map +1 -1
  401. package/dist/internal/planning/character-registration-guard.js +2 -1
  402. package/dist/internal/planning/character-registration-guard.js.map +1 -1
  403. package/dist/internal/planning/character-registration.d.ts.map +1 -1
  404. package/dist/internal/planning/character-registration.js +2 -1
  405. package/dist/internal/planning/character-registration.js.map +1 -1
  406. package/dist/internal/planning/claim-stake-storage-actions.d.ts +12 -0
  407. package/dist/internal/planning/claim-stake-storage-actions.d.ts.map +1 -0
  408. package/dist/internal/planning/claim-stake-storage-actions.js +63 -0
  409. package/dist/internal/planning/claim-stake-storage-actions.js.map +1 -0
  410. package/dist/internal/planning/combat-storage-actions.d.ts +9 -0
  411. package/dist/internal/planning/combat-storage-actions.d.ts.map +1 -0
  412. package/dist/internal/planning/combat-storage-actions.js +55 -0
  413. package/dist/internal/planning/combat-storage-actions.js.map +1 -0
  414. package/dist/internal/planning/crafting-storage-actions.d.ts +7 -0
  415. package/dist/internal/planning/crafting-storage-actions.d.ts.map +1 -0
  416. package/dist/internal/planning/crafting-storage-actions.js +64 -0
  417. package/dist/internal/planning/crafting-storage-actions.js.map +1 -0
  418. package/dist/internal/planning/currency-cache-guard.d.ts +3 -1
  419. package/dist/internal/planning/currency-cache-guard.d.ts.map +1 -1
  420. package/dist/internal/planning/currency-cache-guard.js +47 -2
  421. package/dist/internal/planning/currency-cache-guard.js.map +1 -1
  422. package/dist/internal/planning/democracy-history.d.ts.map +1 -1
  423. package/dist/internal/planning/democracy-history.js +6 -15
  424. package/dist/internal/planning/democracy-history.js.map +1 -1
  425. package/dist/internal/planning/direct-options.d.ts +17 -0
  426. package/dist/internal/planning/direct-options.d.ts.map +1 -0
  427. package/dist/internal/planning/direct-options.js +43 -0
  428. package/dist/internal/planning/direct-options.js.map +1 -0
  429. package/dist/internal/planning/disband-storage-actions.d.ts +9 -0
  430. package/dist/internal/planning/disband-storage-actions.d.ts.map +1 -0
  431. package/dist/internal/planning/disband-storage-actions.js +24 -0
  432. package/dist/internal/planning/disband-storage-actions.js.map +1 -0
  433. package/dist/internal/planning/faction-enrollment.d.ts +0 -2
  434. package/dist/internal/planning/faction-enrollment.d.ts.map +1 -1
  435. package/dist/internal/planning/faction-enrollment.js +0 -9
  436. package/dist/internal/planning/faction-enrollment.js.map +1 -1
  437. package/dist/internal/planning/fleet-arrival.d.ts.map +1 -1
  438. package/dist/internal/planning/fleet-arrival.js +10 -8
  439. package/dist/internal/planning/fleet-arrival.js.map +1 -1
  440. package/dist/internal/planning/fleet-attack-xp.d.ts.map +1 -1
  441. package/dist/internal/planning/fleet-attack-xp.js +5 -11
  442. package/dist/internal/planning/fleet-attack-xp.js.map +1 -1
  443. package/dist/internal/planning/fleet-creation.d.ts.map +1 -1
  444. package/dist/internal/planning/fleet-creation.js +17 -36
  445. package/dist/internal/planning/fleet-creation.js.map +1 -1
  446. package/dist/internal/planning/fleet-crew-guard.d.ts +2 -1
  447. package/dist/internal/planning/fleet-crew-guard.d.ts.map +1 -1
  448. package/dist/internal/planning/fleet-crew-guard.js +2 -1
  449. package/dist/internal/planning/fleet-crew-guard.js.map +1 -1
  450. package/dist/internal/planning/fleet-crew-transfer.d.ts +1 -1
  451. package/dist/internal/planning/fleet-crew-transfer.d.ts.map +1 -1
  452. package/dist/internal/planning/fleet-crew-transfer.js +45 -24
  453. package/dist/internal/planning/fleet-crew-transfer.js.map +1 -1
  454. package/dist/internal/planning/fleet-disband-guard.d.ts +12 -0
  455. package/dist/internal/planning/fleet-disband-guard.d.ts.map +1 -0
  456. package/dist/internal/planning/fleet-disband-guard.js +54 -0
  457. package/dist/internal/planning/fleet-disband-guard.js.map +1 -0
  458. package/dist/internal/planning/fleet-disband.d.ts +36 -0
  459. package/dist/internal/planning/fleet-disband.d.ts.map +1 -0
  460. package/dist/internal/planning/fleet-disband.js +82 -0
  461. package/dist/internal/planning/fleet-disband.js.map +1 -0
  462. package/dist/internal/planning/fleet-dock-funding-guard.d.ts +3 -3
  463. package/dist/internal/planning/fleet-dock-funding-guard.d.ts.map +1 -1
  464. package/dist/internal/planning/fleet-dock-funding-guard.js +87 -96
  465. package/dist/internal/planning/fleet-dock-funding-guard.js.map +1 -1
  466. package/dist/internal/planning/fleet-dock-funding.d.ts.map +1 -1
  467. package/dist/internal/planning/fleet-dock-funding.js +10 -0
  468. package/dist/internal/planning/fleet-dock-funding.js.map +1 -1
  469. package/dist/internal/planning/fleet-docking-guard.d.ts.map +1 -1
  470. package/dist/internal/planning/fleet-docking-guard.js +3 -1
  471. package/dist/internal/planning/fleet-docking-guard.js.map +1 -1
  472. package/dist/internal/planning/fleet-docking.d.ts +17 -2
  473. package/dist/internal/planning/fleet-docking.d.ts.map +1 -1
  474. package/dist/internal/planning/fleet-docking.js +83 -62
  475. package/dist/internal/planning/fleet-docking.js.map +1 -1
  476. package/dist/internal/planning/fleet-rental.d.ts +5 -0
  477. package/dist/internal/planning/fleet-rental.d.ts.map +1 -0
  478. package/dist/internal/planning/fleet-rental.js +9 -0
  479. package/dist/internal/planning/fleet-rental.js.map +1 -0
  480. package/dist/internal/planning/fleet-respawn.d.ts.map +1 -1
  481. package/dist/internal/planning/fleet-respawn.js +10 -12
  482. package/dist/internal/planning/fleet-respawn.js.map +1 -1
  483. package/dist/internal/planning/fleet-ship-assembly.d.ts +2 -0
  484. package/dist/internal/planning/fleet-ship-assembly.d.ts.map +1 -1
  485. package/dist/internal/planning/fleet-ship-assembly.js +94 -64
  486. package/dist/internal/planning/fleet-ship-assembly.js.map +1 -1
  487. package/dist/internal/planning/fleet-state.d.ts +25 -0
  488. package/dist/internal/planning/fleet-state.d.ts.map +1 -0
  489. package/dist/internal/planning/fleet-state.js +28 -0
  490. package/dist/internal/planning/fleet-state.js.map +1 -0
  491. package/dist/internal/planning/governance-fees.d.ts.map +1 -1
  492. package/dist/internal/planning/governance-fees.js +7 -15
  493. package/dist/internal/planning/governance-fees.js.map +1 -1
  494. package/dist/internal/planning/local-market-order-funding.d.ts.map +1 -1
  495. package/dist/internal/planning/local-market-order-funding.js +4 -2
  496. package/dist/internal/planning/local-market-order-funding.js.map +1 -1
  497. package/dist/internal/planning/local-market-order.d.ts +4 -4
  498. package/dist/internal/planning/local-market-order.d.ts.map +1 -1
  499. package/dist/internal/planning/local-market-order.js +82 -109
  500. package/dist/internal/planning/local-market-order.js.map +1 -1
  501. package/dist/internal/planning/market-storage-actions.d.ts +7 -0
  502. package/dist/internal/planning/market-storage-actions.d.ts.map +1 -0
  503. package/dist/internal/planning/market-storage-actions.js +71 -0
  504. package/dist/internal/planning/market-storage-actions.js.map +1 -0
  505. package/dist/internal/planning/mining-stop.d.ts.map +1 -1
  506. package/dist/internal/planning/mining-stop.js +2 -1
  507. package/dist/internal/planning/mining-stop.js.map +1 -1
  508. package/dist/internal/planning/mining-storage-actions.d.ts +11 -0
  509. package/dist/internal/planning/mining-storage-actions.d.ts.map +1 -0
  510. package/dist/internal/planning/mining-storage-actions.js +57 -0
  511. package/dist/internal/planning/mining-storage-actions.js.map +1 -0
  512. package/dist/internal/planning/movement-storage-actions.d.ts +7 -0
  513. package/dist/internal/planning/movement-storage-actions.d.ts.map +1 -0
  514. package/dist/internal/planning/movement-storage-actions.js +38 -0
  515. package/dist/internal/planning/movement-storage-actions.js.map +1 -0
  516. package/dist/internal/planning/movement-xp-guard.d.ts.map +1 -1
  517. package/dist/internal/planning/movement-xp-guard.js +3 -2
  518. package/dist/internal/planning/movement-xp-guard.js.map +1 -1
  519. package/dist/internal/planning/open-signal-guard.d.ts.map +1 -1
  520. package/dist/internal/planning/open-signal-guard.js +2 -1
  521. package/dist/internal/planning/open-signal-guard.js.map +1 -1
  522. package/dist/internal/planning/open-signal.d.ts.map +1 -1
  523. package/dist/internal/planning/open-signal.js +16 -7
  524. package/dist/internal/planning/open-signal.js.map +1 -1
  525. package/dist/internal/planning/original-token.d.ts +40 -0
  526. package/dist/internal/planning/original-token.d.ts.map +1 -0
  527. package/dist/internal/planning/original-token.js +112 -0
  528. package/dist/internal/planning/original-token.js.map +1 -0
  529. package/dist/internal/planning/own-starbase-facts.d.ts +37 -0
  530. package/dist/internal/planning/own-starbase-facts.d.ts.map +1 -0
  531. package/dist/internal/planning/own-starbase-facts.js +52 -0
  532. package/dist/internal/planning/own-starbase-facts.js.map +1 -0
  533. package/dist/internal/planning/plan-fields.d.ts +60 -0
  534. package/dist/internal/planning/plan-fields.d.ts.map +1 -0
  535. package/dist/internal/planning/plan-fields.js +159 -0
  536. package/dist/internal/planning/plan-fields.js.map +1 -0
  537. package/dist/internal/planning/plan-guards.d.ts +4 -0
  538. package/dist/internal/planning/plan-guards.d.ts.map +1 -0
  539. package/dist/internal/planning/plan-guards.js +184 -0
  540. package/dist/internal/planning/plan-guards.js.map +1 -0
  541. package/dist/internal/planning/profile-key.d.ts +13 -0
  542. package/dist/internal/planning/profile-key.d.ts.map +1 -0
  543. package/dist/internal/planning/profile-key.js +20 -0
  544. package/dist/internal/planning/profile-key.js.map +1 -0
  545. package/dist/internal/planning/profile-storage-funding-guard.d.ts +29 -0
  546. package/dist/internal/planning/profile-storage-funding-guard.d.ts.map +1 -0
  547. package/dist/internal/planning/profile-storage-funding-guard.js +115 -0
  548. package/dist/internal/planning/profile-storage-funding-guard.js.map +1 -0
  549. package/dist/internal/planning/profile-storage-funding.d.ts +46 -0
  550. package/dist/internal/planning/profile-storage-funding.d.ts.map +1 -0
  551. package/dist/internal/planning/profile-storage-funding.js +58 -0
  552. package/dist/internal/planning/profile-storage-funding.js.map +1 -0
  553. package/dist/internal/planning/recipe-state.d.ts +4 -1
  554. package/dist/internal/planning/recipe-state.d.ts.map +1 -1
  555. package/dist/internal/planning/recipe-state.js +7 -4
  556. package/dist/internal/planning/recipe-state.js.map +1 -1
  557. package/dist/internal/planning/region-access.d.ts +30 -0
  558. package/dist/internal/planning/region-access.d.ts.map +1 -0
  559. package/dist/internal/planning/region-access.js +94 -0
  560. package/dist/internal/planning/region-access.js.map +1 -0
  561. package/dist/internal/planning/rent-catalog.d.ts +37 -0
  562. package/dist/internal/planning/rent-catalog.d.ts.map +1 -0
  563. package/dist/internal/planning/rent-catalog.js +165 -0
  564. package/dist/internal/planning/rent-catalog.js.map +1 -0
  565. package/dist/internal/planning/research-unlock.d.ts +69 -0
  566. package/dist/internal/planning/research-unlock.d.ts.map +1 -0
  567. package/dist/internal/planning/research-unlock.js +287 -0
  568. package/dist/internal/planning/research-unlock.js.map +1 -0
  569. package/dist/internal/planning/respawn-guards.js +2 -1
  570. package/dist/internal/planning/respawn-guards.js.map +1 -1
  571. package/dist/internal/planning/runtime-guards.d.ts +0 -2
  572. package/dist/internal/planning/runtime-guards.d.ts.map +1 -1
  573. package/dist/internal/planning/runtime-guards.js +49 -29
  574. package/dist/internal/planning/runtime-guards.js.map +1 -1
  575. package/dist/internal/planning/scan-completion-guard.d.ts +6 -6
  576. package/dist/internal/planning/scan-completion-guard.d.ts.map +1 -1
  577. package/dist/internal/planning/scan-completion-guard.js +8 -7
  578. package/dist/internal/planning/scan-completion-guard.js.map +1 -1
  579. package/dist/internal/planning/scan-completion.d.ts.map +1 -1
  580. package/dist/internal/planning/scan-completion.js +9 -7
  581. package/dist/internal/planning/scan-completion.js.map +1 -1
  582. package/dist/internal/planning/scan-detect-guard.d.ts +1 -1
  583. package/dist/internal/planning/scan-detect-guard.d.ts.map +1 -1
  584. package/dist/internal/planning/scan-detect-guard.js +2 -2
  585. package/dist/internal/planning/scan-detect-guard.js.map +1 -1
  586. package/dist/internal/planning/scan-detect.d.ts +1 -1
  587. package/dist/internal/planning/scan-detect.d.ts.map +1 -1
  588. package/dist/internal/planning/scan-detect.js +10 -8
  589. package/dist/internal/planning/scan-detect.js.map +1 -1
  590. package/dist/internal/planning/scan-idle-scope.d.ts +5 -0
  591. package/dist/internal/planning/scan-idle-scope.d.ts.map +1 -0
  592. package/dist/internal/planning/scan-idle-scope.js +5 -0
  593. package/dist/internal/planning/scan-idle-scope.js.map +1 -0
  594. package/dist/internal/planning/scan-storage-actions.d.ts +9 -0
  595. package/dist/internal/planning/scan-storage-actions.d.ts.map +1 -0
  596. package/dist/internal/planning/scan-storage-actions.js +27 -0
  597. package/dist/internal/planning/scan-storage-actions.js.map +1 -0
  598. package/dist/internal/planning/ship-import-funding.js +3 -2
  599. package/dist/internal/planning/ship-import-funding.js.map +1 -1
  600. package/dist/internal/planning/ship-token.d.ts +1 -5
  601. package/dist/internal/planning/ship-token.d.ts.map +1 -1
  602. package/dist/internal/planning/ship-token.js +0 -36
  603. package/dist/internal/planning/ship-token.js.map +1 -1
  604. package/dist/internal/planning/starbase-player-owner.d.ts +21 -0
  605. package/dist/internal/planning/starbase-player-owner.d.ts.map +1 -0
  606. package/dist/internal/planning/starbase-player-owner.js +17 -0
  607. package/dist/internal/planning/starbase-player-owner.js.map +1 -0
  608. package/dist/internal/planning/starbase-player-recovery-guard.d.ts +7 -0
  609. package/dist/internal/planning/starbase-player-recovery-guard.d.ts.map +1 -0
  610. package/dist/internal/planning/starbase-player-recovery-guard.js +39 -0
  611. package/dist/internal/planning/starbase-player-recovery-guard.js.map +1 -0
  612. package/dist/internal/planning/starbase-system-guard.d.ts.map +1 -1
  613. package/dist/internal/planning/starbase-system-guard.js +2 -1
  614. package/dist/internal/planning/starbase-system-guard.js.map +1 -1
  615. package/dist/internal/planning/starbase-system.d.ts +5 -2
  616. package/dist/internal/planning/starbase-system.d.ts.map +1 -1
  617. package/dist/internal/planning/starbase-system.js +6 -3
  618. package/dist/internal/planning/starbase-system.js.map +1 -1
  619. package/dist/internal/planning/storage-action-readers.d.ts +10 -0
  620. package/dist/internal/planning/storage-action-readers.d.ts.map +1 -0
  621. package/dist/internal/planning/storage-action-readers.js +58 -0
  622. package/dist/internal/planning/storage-action-readers.js.map +1 -0
  623. package/dist/internal/planning/storage-actions.d.ts +89 -0
  624. package/dist/internal/planning/storage-actions.d.ts.map +1 -0
  625. package/dist/internal/planning/storage-actions.js +183 -0
  626. package/dist/internal/planning/storage-actions.js.map +1 -0
  627. package/dist/internal/planning/token-mint.d.ts.map +1 -1
  628. package/dist/internal/planning/token-mint.js +2 -1
  629. package/dist/internal/planning/token-mint.js.map +1 -1
  630. package/dist/internal/planning/wallet-starbase.d.ts +34 -0
  631. package/dist/internal/planning/wallet-starbase.d.ts.map +1 -0
  632. package/dist/internal/planning/wallet-starbase.js +39 -0
  633. package/dist/internal/planning/wallet-starbase.js.map +1 -0
  634. package/dist/internal/planning/xp-runtime.d.ts.map +1 -1
  635. package/dist/internal/planning/xp-runtime.js +16 -20
  636. package/dist/internal/planning/xp-runtime.js.map +1 -1
  637. package/dist/internal/read-meta.d.ts +12 -0
  638. package/dist/internal/read-meta.d.ts.map +1 -1
  639. package/dist/internal/read-meta.js +10 -0
  640. package/dist/internal/read-meta.js.map +1 -1
  641. package/dist/loyalty/actions/index.d.ts +1 -1
  642. package/dist/loyalty/actions/index.d.ts.map +1 -1
  643. package/dist/loyalty/actions/index.js +12 -43
  644. package/dist/loyalty/actions/index.js.map +1 -1
  645. package/dist/loyalty/index.d.ts +4 -0
  646. package/dist/loyalty/index.d.ts.map +1 -1
  647. package/dist/loyalty/index.js +19 -27
  648. package/dist/loyalty/index.js.map +1 -1
  649. package/dist/markets/actions/index.d.ts +1 -1
  650. package/dist/markets/actions/index.d.ts.map +1 -1
  651. package/dist/markets/actions/index.js +138 -176
  652. package/dist/markets/actions/index.js.map +1 -1
  653. package/dist/markets/actions/trade-faction-market.d.ts +4 -2
  654. package/dist/markets/actions/trade-faction-market.d.ts.map +1 -1
  655. package/dist/markets/actions/trade-faction-market.js +59 -39
  656. package/dist/markets/actions/trade-faction-market.js.map +1 -1
  657. package/dist/markets/index.d.ts.map +1 -1
  658. package/dist/markets/index.js +3 -11
  659. package/dist/markets/index.js.map +1 -1
  660. package/dist/mining/actions/index.d.ts +1 -1
  661. package/dist/mining/actions/index.d.ts.map +1 -1
  662. package/dist/mining/actions/index.js +81 -44
  663. package/dist/mining/actions/index.js.map +1 -1
  664. package/dist/mining/estimate-input.d.ts +103 -0
  665. package/dist/mining/estimate-input.d.ts.map +1 -0
  666. package/dist/mining/estimate-input.js +86 -0
  667. package/dist/mining/estimate-input.js.map +1 -0
  668. package/dist/mining/index.d.ts +1 -0
  669. package/dist/mining/index.d.ts.map +1 -1
  670. package/dist/mining/index.js +4 -11
  671. package/dist/mining/index.js.map +1 -1
  672. package/dist/planning/assembly.d.ts +1 -1
  673. package/dist/planning/assembly.d.ts.map +1 -1
  674. package/dist/planning/assembly.js +6 -30
  675. package/dist/planning/assembly.js.map +1 -1
  676. package/dist/planning/execution.d.ts +1 -0
  677. package/dist/planning/execution.d.ts.map +1 -1
  678. package/dist/planning/execution.js +149 -45
  679. package/dist/planning/execution.js.map +1 -1
  680. package/dist/planning/index.d.ts +70 -7
  681. package/dist/planning/index.d.ts.map +1 -1
  682. package/dist/planning/index.js +28 -1141
  683. package/dist/planning/index.js.map +1 -1
  684. package/dist/planning/plan-construction.d.ts +25 -0
  685. package/dist/planning/plan-construction.d.ts.map +1 -0
  686. package/dist/planning/plan-construction.js +143 -0
  687. package/dist/planning/plan-construction.js.map +1 -0
  688. package/dist/planning/plan-sequence-execution.d.ts.map +1 -1
  689. package/dist/planning/plan-sequence-execution.js +1 -11
  690. package/dist/planning/plan-sequence-execution.js.map +1 -1
  691. package/dist/planning/plan-validation.d.ts +17 -0
  692. package/dist/planning/plan-validation.d.ts.map +1 -0
  693. package/dist/planning/plan-validation.js +147 -0
  694. package/dist/planning/plan-validation.js.map +1 -0
  695. package/dist/registry/cargo.d.ts +2 -2
  696. package/dist/registry/cargo.d.ts.map +1 -1
  697. package/dist/registry/cargo.js +3 -4
  698. package/dist/registry/cargo.js.map +1 -1
  699. package/dist/registry/definition-section-snapshot.d.ts +1 -1
  700. package/dist/registry/definition-section-snapshot.d.ts.map +1 -1
  701. package/dist/registry/definition-section-snapshot.js +10 -3
  702. package/dist/registry/definition-section-snapshot.js.map +1 -1
  703. package/dist/registry/index.d.ts +31 -4
  704. package/dist/registry/index.d.ts.map +1 -1
  705. package/dist/registry/index.js +226 -227
  706. package/dist/registry/index.js.map +1 -1
  707. package/dist/registry/onboarding.d.ts.map +1 -1
  708. package/dist/registry/onboarding.js +4 -2
  709. package/dist/registry/onboarding.js.map +1 -1
  710. package/dist/registry/ship-stats-snapshot.d.ts.map +1 -1
  711. package/dist/registry/ship-stats-snapshot.js +19 -5
  712. package/dist/registry/ship-stats-snapshot.js.map +1 -1
  713. package/dist/registry/ships.js +1 -1
  714. package/dist/registry/ships.js.map +1 -1
  715. package/dist/rewards/index.d.ts +11 -5
  716. package/dist/rewards/index.d.ts.map +1 -1
  717. package/dist/rewards/index.js +10 -21
  718. package/dist/rewards/index.js.map +1 -1
  719. package/dist/scanning/actions/index.d.ts +1 -1
  720. package/dist/scanning/actions/index.d.ts.map +1 -1
  721. package/dist/scanning/actions/index.js +38 -8
  722. package/dist/scanning/actions/index.js.map +1 -1
  723. package/dist/scanning/index.d.ts +6 -11
  724. package/dist/scanning/index.d.ts.map +1 -1
  725. package/dist/scanning/index.js +7 -15
  726. package/dist/scanning/index.js.map +1 -1
  727. package/dist/scanning/odds.d.ts +5 -1
  728. package/dist/scanning/odds.d.ts.map +1 -1
  729. package/dist/scanning/odds.js.map +1 -1
  730. package/dist/scanning/signals.d.ts +6 -1
  731. package/dist/scanning/signals.d.ts.map +1 -1
  732. package/dist/scanning/signals.js +3 -1
  733. package/dist/scanning/signals.js.map +1 -1
  734. package/dist/starbases/actions/index.d.ts +49 -4
  735. package/dist/starbases/actions/index.d.ts.map +1 -1
  736. package/dist/starbases/actions/index.js +120 -69
  737. package/dist/starbases/actions/index.js.map +1 -1
  738. package/dist/starbases/index.d.ts +18 -0
  739. package/dist/starbases/index.d.ts.map +1 -1
  740. package/dist/starbases/index.js +24 -11
  741. package/dist/starbases/index.js.map +1 -1
  742. package/dist/world/index.d.ts +87 -13
  743. package/dist/world/index.d.ts.map +1 -1
  744. package/dist/world/index.js +88 -22
  745. package/dist/world/index.js.map +1 -1
  746. package/dist/world/planet-claim-stake-plots.d.ts +49 -40
  747. package/dist/world/planet-claim-stake-plots.d.ts.map +1 -1
  748. package/dist/world/planet-claim-stake-plots.js +47 -40
  749. package/dist/world/planet-claim-stake-plots.js.map +1 -1
  750. package/dist/world/starbase-status.d.ts +54 -13
  751. package/dist/world/starbase-status.d.ts.map +1 -1
  752. package/dist/world/starbase-status.js +65 -0
  753. package/dist/world/starbase-status.js.map +1 -1
  754. package/package.json +62 -32
  755. package/dist/internal/c4/faction-adapter.d.ts +0 -12
  756. package/dist/internal/c4/faction-adapter.d.ts.map +0 -1
  757. package/dist/internal/c4/faction-adapter.js +0 -52
  758. package/dist/internal/c4/faction-adapter.js.map +0 -1
  759. package/dist/internal/planning/movement-character.d.ts +0 -7
  760. package/dist/internal/planning/movement-character.d.ts.map +0 -1
  761. package/dist/internal/planning/movement-character.js +0 -41
  762. package/dist/internal/planning/movement-character.js.map +0 -1
@@ -1,24 +1,32 @@
1
1
  import { deriveCurrencyCache, validateCurrencyCache, } from '../../internal/c4/currency-cache.js';
2
2
  import { resolveDockFunding } from '../../internal/planning/fleet-dock-funding.js';
3
3
  import { validateFleetDockingPolicy } from '../../internal/planning/fleet-docking.js';
4
+ import { factionValue } from '../../internal/c4/faction.js';
4
5
  import { deriveFactionOwnershipAddress } from '../../internal/c4/factions.js';
5
6
  import { regionContainsCoordinate } from '../../internal/c4/region-geometry.js';
6
- import { hashMovementCharacter } from '../../internal/planning/movement-character.js';
7
+ import { hashRegionAccess, hashRegionPath, } from '../../internal/planning/region-access.js';
7
8
  import { resolveXpRuntime } from '../../internal/planning/xp-runtime.js';
8
- import { getAddressEncoder, isAddress } from '@solana/kit';
9
+ import { isAddress } from '@solana/kit';
9
10
  import { InvalidActionInputError, SageSdkError } from '../../client/errors.js';
10
11
  import { readContextRawAccounts } from '../../client/reconciliation.js';
12
+ import { readMovementStorageAction } from '../../internal/planning/movement-storage-actions.js';
13
+ import { planStorageFunding } from '../../internal/planning/storage-actions.js';
14
+ import { RENT_ADDRESS } from '../../internal/planning/rent.js';
11
15
  import { deriveFleetAddress, fleetAccountDefinition, } from '../../internal/c4/fleet.js';
12
16
  import { deriveFleetCrewBindingAddress, fleetCrewBindingAccountDefinition, matchesFleetCrewBindingIdentity, } from '../../internal/c4/fleet-crew-binding.js';
13
17
  import { deriveFactionRelationTrackerAddress, deriveRegionTrackerAddress, factionRelationTrackerAccountDefinition, regionTrackerAccountDefinition, } from '../../internal/c4/factions.js';
14
18
  import { FixedPoint, getFleetDecoder, getRegionTrackerDecoder, getStarSystemDecoder, } from '../../internal/c4/runtime-bindings.js';
15
- import { characterAccountDefinition, findCharacterPda, } from '../../internal/c4/identity.js';
19
+ import { characterAccountDefinition, findCharacterPda, } from '../../internal/c4/character.js';
16
20
  import { deriveStarbasePlayerAddress, starbasePlayerAccountDefinition, } from '../../internal/c4/starbase.js';
17
21
  import { buildStarSystemDiscoveryFilters, deriveStarSystemAddress, starSystemAccountDefinition, } from '../../internal/c4/world.js';
18
22
  import { requireGameAddress } from '../../internal/game-context.js';
19
23
  import { adaptDockedToIdleInstruction, adaptIdleToDockedInstruction, adaptStartSubwarpInstruction, adaptStopSubwarpInstruction, adaptWarpLaneInstruction, adaptWarpToCoordinateInstruction, validatePlanAuthorization, } from '../../internal/planning/authorization-adapter.js';
20
- import { createPlan, } from '../../planning/index.js';
24
+ import { buildPlannerPlan } from '../../planning/plan-construction.js';
21
25
  import { resolveFleetArrival } from '../../internal/planning/fleet-arrival.js';
26
+ import { failFleetState, requireActionCoordinate, } from '../../internal/planning/fleet-state.js';
27
+ import { isSubPrecisionRoute } from '../../internal/fleet-route.js';
28
+ import { accountStatePrecondition } from '../../internal/planning/account-state.js';
29
+ import { characterAccessPrecondition } from '../../internal/planning/character-access.js';
22
30
  const FLEET_STATE_IDLE = 'fleet.state.idle';
23
31
  const FLEET_STATE_MOVEMENT_STARTED = 'fleet.state.movement-started';
24
32
  function movementStartSemantics(fleet) {
@@ -70,20 +78,6 @@ function validateSettleArrivalOptions(value) {
70
78
  }
71
79
  throw new InvalidActionInputError('options', value, 'direct Profile authorization', remedy);
72
80
  }
73
- const STOP_SUBWARP_REMEDIES = {
74
- claimStakeTransfer: 'Finish the Claim Stake transfer',
75
- destroyed: 'Respawn it',
76
- docked: 'Undock it',
77
- mining: 'Stop mining',
78
- respawn: 'Wait for it to finish respawning',
79
- warp: 'Let warp finish and settle its arrival',
80
- };
81
- function requireStopSubwarpState(fleet) {
82
- const state = fleet.state.kind;
83
- if (state === 'subwarp' || state === 'idle')
84
- return;
85
- fail(`Fleet ${fleet.name} is ${state} and cannot stop subwarp. ${STOP_SUBWARP_REMEDIES[state]}, start subwarp, refresh it, and retry.`, fleet.address);
86
- }
87
81
  function assertFleetOwner(fleet, authorization) {
88
82
  if (fleet.ownerProfile.address !== authorization.profile) {
89
83
  fail(`Fleet ${fleet.name} belongs to Profile ${fleet.ownerProfile.address}, not authorized Profile ${authorization.profile}. Use the owning Profile in PlanAuthorization, refresh the Fleet, and retry.`, fleet.address);
@@ -95,30 +89,29 @@ function requireDockedState(fleet) {
95
89
  }
96
90
  return fleet.state;
97
91
  }
98
- const REFRESH_TO_IDLE_REMEDIES = {
99
- claimStakeTransfer: 'Wait for or complete the claim-stake transfer, refresh the Fleet, and retry.',
100
- destroyed: 'Respawn the Fleet, refresh it, and retry.',
101
- docked: 'Undock the Fleet, refresh it, and retry.',
102
- mining: 'Stop mining, refresh the Fleet, and retry.',
103
- respawn: 'Wait for the Fleet to recover, refresh it, and retry.',
104
- };
105
92
  function requireRefreshableIdleState(fleet, action) {
106
- if (fleet.state.kind === 'idle')
107
- return fleet.location;
108
- if (fleet.state.kind === 'warp' || fleet.state.kind === 'subwarp') {
109
- return fleet.state.to;
93
+ // Docking refreshes the Fleet without its Character, and a subwarp journey
94
+ // cannot be settled without one, so a dock Plan from a subwarp snapshot
95
+ // always fails on chain. Movement starts carry the Character and may refresh
96
+ // either journey.
97
+ if (action === 'dock' && fleet.state.kind === 'subwarp') {
98
+ fail(`Fleet ${fleet.name} is subwarp and cannot dock; docking refreshes the Fleet without its Character, so it cannot settle a subwarp journey. Settle the arrival with planFleetSettleArrival or stop the subwarp with planFleetStopSubwarp, refresh the Fleet, and retry.`, fleet.address);
110
99
  }
111
- const remedy = REFRESH_TO_IDLE_REMEDIES[fleet.state.kind];
112
- const requirement = action === 'dock'
113
- ? 'the Fleet must be idle or in a refreshable warp/subwarp state at a Starbase System coordinate'
114
- : action === 'warp through a lane'
115
- ? 'the Fleet must be idle or in a refreshable warp/subwarp state at a Star System coordinate'
116
- : 'the Fleet must be idle or in a refreshable warp/subwarp state at a coordinate';
117
- fail(`Fleet ${fleet.name} is ${fleet.state.kind}, so it cannot ${action}; ${requirement}. ${remedy} Then retry ${action === 'dock' ? 'docking' : action}.`, fleet.address);
100
+ return requireActionCoordinate(fleet, action, `it must be idle or in a refreshable warp/subwarp state at ${action === 'dock' ? 'a Starbase System coordinate' : action === 'warp through a lane' ? 'a Star System coordinate' : 'a coordinate'}`);
118
101
  }
119
102
  function requireRawAccount(account, message, address) {
120
103
  return account ?? fail(message, address);
121
104
  }
105
+ /** The program moves and undocks a Fleet only with at least its required
106
+ * crew aboard; undocking also needs a non-empty ship map. The program counts
107
+ * map entries, not quantities, and leaves zero-quantity entries behind when
108
+ * ships are removed, so such a Fleet still undocks. */
109
+ function requireNormalizedCrew(data, fleet, action, requireShips = false) {
110
+ if (data.crewCount < data.stats.misc.requiredCrew)
111
+ fail(`Fleet ${fleet.name} has ${String(data.crewCount)} crew aboard but needs at least ${String(data.stats.misc.requiredCrew)} to ${action}. Load crew while docked (planLoadFleetCrew), refresh the Fleet, and retry.`, fleet.address);
112
+ if (requireShips && data.fleetShips.length === 0)
113
+ fail(`Fleet ${fleet.name} has no ships and cannot ${action}. Add ships while docked, refresh the Fleet, and retry.`, fleet.address);
114
+ }
122
115
  function validateFleetRead(account, fleet, game, system, systemSequenceId) {
123
116
  const data = fleetAccountDefinition.decode(account);
124
117
  if (account.address !== fleet.address ||
@@ -129,22 +122,17 @@ function validateFleetRead(account, fleet, game, system, systemSequenceId) {
129
122
  data.state.systemSeqId !== systemSequenceId) {
130
123
  fail(`Fleet ${fleet.name} changed or no longer matches its configured Game, owner, address, or docked Star System. Refresh the Fleet and create a new undock Plan before retrying.`, fleet.address);
131
124
  }
125
+ requireNormalizedCrew(data, fleet, 'undock', true);
132
126
  return data;
133
127
  }
134
- function validateCharacterRead(account, fleet, profile, game) {
135
- const data = characterAccountDefinition.decode(account);
136
- if (data.playerProfile !== profile || data.game !== game) {
137
- fail(`Fleet ${fleet.name} cannot undock because the canonical Character does not match Profile ${profile} and the configured Game ${game}. Refresh or repair the Character registration for this Profile and Game before retrying.`, account.address);
138
- }
139
- return data;
140
- }
141
- async function validateSystemRead(account, fleet, game, systemSequenceId) {
128
+ /** Requires a Star System of the configured Game at its canonical PDA and,
129
+ * for a docked Fleet, at the docked sequence. */
130
+ async function validateFleetSystemRead(account, fleet, game, action, label = 'Star System', sequenceId) {
142
131
  const data = starSystemAccountDefinition.decode(account);
143
- const canonicalAddress = await deriveStarSystemAddress(game, data.systemId);
144
132
  if (data.game !== game ||
145
- canonicalAddress !== account.address ||
146
- data.sequenceId !== systemSequenceId) {
147
- fail(`Fleet ${fleet.name} cannot undock because Star System ${account.address} does not match its configured Game, PDA, or docked sequence. Refresh the Fleet and System state before retrying.`, account.address);
133
+ (await deriveStarSystemAddress(game, data.systemId)) !== account.address ||
134
+ (sequenceId !== undefined && data.sequenceId !== sequenceId)) {
135
+ fail(`Fleet ${fleet.name} cannot ${action} because ${label} ${account.address} does not match the configured Game${sequenceId === undefined ? ' or its canonical PDA' : ', its canonical PDA or the docked sequence'}. Refresh the Fleet and galaxy, then retry.`, account.address);
148
136
  }
149
137
  return data;
150
138
  }
@@ -158,36 +146,9 @@ function validateStarbasePlayerRead(account, fleet, profile, character, system,
158
146
  }
159
147
  return data;
160
148
  }
161
- async function validateDockSystemRead(account, fleet, game, canonicalAddress, exactLocation) {
162
- const data = starSystemAccountDefinition.decode(account);
163
- const derivedAddress = await deriveStarSystemAddress(game, data.systemId);
164
- if (account.address !== canonicalAddress ||
165
- account.address !== derivedAddress ||
166
- data.game !== game ||
167
- !hasExactSystemLocation(account, exactLocation)) {
168
- fail(`Fleet ${fleet.name} cannot dock because Star System ${canonicalAddress} does not match the configured Game, Fleet coordinate, or canonical PDA. Refresh the Fleet and galaxy before retrying.`, canonicalAddress);
169
- }
170
- return data;
171
- }
172
149
  function failNoDockableStarbase(fleet, location) {
173
150
  return fail(`Fleet ${fleet.name} action coordinate (${String(location.x)}, ${String(location.y)}) has no Starbase to dock at. Move the Fleet to a Starbase system first, refresh the Fleet and galaxy, and retry.`, fleet.address);
174
151
  }
175
- async function hashAccountState(account) {
176
- const owner = getAddressEncoder().encode(account.owner);
177
- const canonical = new Uint8Array(owner.length + account.data.length);
178
- canonical.set(owner);
179
- canonical.set(account.data, owner.length);
180
- const digest = new Uint8Array(await globalThis.crypto.subtle.digest('SHA-256', canonical));
181
- return [...digest].map((byte) => byte.toString(16).padStart(2, '0')).join('');
182
- }
183
- async function precondition(account, describes) {
184
- return Object.freeze({
185
- address: account.address,
186
- dataHash: await hashAccountState(account),
187
- describes,
188
- kind: 'account-state',
189
- });
190
- }
191
152
  function validateCoordinateComponent(field, value) {
192
153
  if (!Number.isFinite(value)) {
193
154
  throw new InvalidActionInputError(field, value, 'a finite SAGE coordinate', `Set ${field} to a finite number before planning coordinate movement.`);
@@ -196,25 +157,73 @@ function validateCoordinateComponent(field, value) {
196
157
  throw new InvalidActionInputError(field, value, 'an I8F56-encodable SAGE coordinate from -128 inclusive to 128 exclusive', `Set ${field} within the pinned movement instruction codec range before retrying.`);
197
158
  }
198
159
  }
199
- function validateDestination(fleet, actionLocation, destination) {
160
+ function validateDisplayDestination(fleet, actionLocation, destination) {
200
161
  validateCoordinateComponent('destination.x', destination.x);
201
162
  validateCoordinateComponent('destination.y', destination.y);
202
163
  if (destination.x === actionLocation.x &&
203
164
  destination.y === actionLocation.y) {
204
- failSameCoordinate(fleet, destination);
165
+ failSameCoordinate(fleet, `destination (${String(destination.x)}, ${String(destination.y)})`);
205
166
  }
206
167
  }
207
168
  function failSameCoordinate(fleet, destination) {
208
- return fail(`Fleet ${fleet.name} destination (${String(destination.x)}, ${String(destination.y)}) is its action coordinate. Choose a different coordinate and retry.`, fleet.address);
169
+ return fail(`Fleet ${fleet.name} ${destination} is its action coordinate. Choose a different coordinate and retry.`, fleet.address);
209
170
  }
210
- function validateCharacterForCoordinateMovement(account, fleet, profile, game, canonicalAddress, action = 'move') {
211
- const data = characterAccountDefinition.decode(account);
212
- if (account.address !== canonicalAddress ||
171
+ const SIGNED_I64_MIN = -(1n << 63n);
172
+ const SIGNED_I64_MAX = (1n << 63n) - 1n;
173
+ function validateRawCoordinateComponent(field, value) {
174
+ if (typeof value !== 'bigint') {
175
+ throw new InvalidActionInputError(field, value, 'a bigint containing the exact raw I8F56 axis', `Set ${field} to the signed 64-bit raw coordinate from the selected game value before retrying.`);
176
+ }
177
+ if (value < SIGNED_I64_MIN || value > SIGNED_I64_MAX) {
178
+ throw new InvalidActionInputError(field, value, `a signed 64-bit raw I8F56 bigint from ${String(SIGNED_I64_MIN)} through ${String(SIGNED_I64_MAX)}`, `Set ${field} within the exact movement instruction range before retrying.`);
179
+ }
180
+ return value;
181
+ }
182
+ function resolveCoordinateDestination(fleet, actionLocation, options) {
183
+ const hasDisplay = Object.hasOwn(options, 'destination');
184
+ const hasRaw = Object.hasOwn(options, 'destinationRaw');
185
+ if (hasDisplay === hasRaw) {
186
+ throw new InvalidActionInputError('destination/destinationRaw', options, 'exactly one of destination or destinationRaw', 'Set destination for caller-selected display rounding or destinationRaw for exact signed-I8F56 intent, omit the other property entirely, then retry.');
187
+ }
188
+ if (hasDisplay) {
189
+ const destination = options.destination;
190
+ if (destination === undefined || destination === null) {
191
+ throw new InvalidActionInputError('destination', destination, 'an object with finite numeric x and y axes', 'Set destination to display coordinates, or replace it with destinationRaw for exact signed-I8F56 intent.');
192
+ }
193
+ validateDisplayDestination(fleet, actionLocation, destination);
194
+ return {
195
+ description: `(${String(destination.x)}, ${String(destination.y)})`,
196
+ exact: exactCoordinate(destination),
197
+ field: 'destination',
198
+ };
199
+ }
200
+ const destinationRaw = options.destinationRaw;
201
+ if (destinationRaw === undefined ||
202
+ destinationRaw === null ||
203
+ typeof destinationRaw !== 'object') {
204
+ throw new InvalidActionInputError('destinationRaw', destinationRaw, 'an object with bigint x and y axes', 'Set destinationRaw to exact signed-I8F56 coordinates, or replace it with destination display coordinates.');
205
+ }
206
+ const exact = {
207
+ x: validateRawCoordinateComponent('destinationRaw.x', destinationRaw.x),
208
+ y: validateRawCoordinateComponent('destinationRaw.y', destinationRaw.y),
209
+ };
210
+ return {
211
+ description: `(${FixedPoint.fromRaw(exact.x, 56).toString()}, ${FixedPoint.fromRaw(exact.y, 56).toString()})`,
212
+ exact,
213
+ field: 'destinationRaw',
214
+ };
215
+ }
216
+ /** Requires the authorization Profile's canonical Character in the
217
+ * configured Game. */
218
+ function requireFleetCharacter(account, fleet, profile, game, address, action) {
219
+ const character = requireRawAccount(account, `Fleet ${fleet.name} cannot ${action} because its Profile has no canonical Character at ${address}. Create the Character for Profile ${profile} in the configured Game, refresh the Fleet, and retry.`, address);
220
+ const data = characterAccountDefinition.decode(character);
221
+ if (character.address !== address ||
213
222
  data.playerProfile !== profile ||
214
223
  data.game !== game) {
215
- fail(`Fleet ${fleet.name} cannot ${action} because the canonical Character does not match Profile ${profile} and the configured Game ${game}. Refresh or repair the Character registration for this Profile and Game before retrying.`, account.address);
224
+ fail(`Fleet ${fleet.name} cannot ${action} because the canonical Character does not match Profile ${profile} and the configured Game ${game}. Refresh or repair the Character registration for this Profile and Game before retrying.`, address);
216
225
  }
217
- return data;
226
+ return character;
218
227
  }
219
228
  async function validateIdleFleetRead(account, fleet, game, actionLocation, planName = 'coordinate movement') {
220
229
  const data = fleetAccountDefinition.decode(account);
@@ -244,10 +253,12 @@ async function validateIdleFleetRead(account, fleet, game, actionLocation, planN
244
253
  exactLocation = exact.state.fields[0].journey.to;
245
254
  }
246
255
  return {
256
+ data,
247
257
  location: {
248
258
  x: exactLocation[0].raw,
249
259
  y: exactLocation[1].raw,
250
260
  },
261
+ npc: data.npcFactionId !== 0,
251
262
  };
252
263
  }
253
264
  function validateRegionTrackerRead(account, fleet, game, canonicalAddress, action = 'move') {
@@ -265,12 +276,9 @@ function validateCrewBindingRead(account, fleet, canonicalAddress) {
265
276
  }
266
277
  return data;
267
278
  }
268
- function resolveRegionId(tracker, coordinate, displayCoordinate, label, fleet, trackerAddress) {
269
- const region = tracker.regions.unsizedList.find((candidate) => regionContainsCoordinate(candidate, coordinate));
270
- if (region === undefined) {
271
- fail(`Fleet ${fleet.name} ${label} coordinate (${String(displayCoordinate.x)}, ${String(displayCoordinate.y)}) cannot be mapped by RegionTracker ${trackerAddress}. Refresh the world region data or choose a coordinate inside a configured Region before retrying.`, trackerAddress);
272
- }
273
- return region.id;
279
+ /** The Region containing a coordinate, or `null` for deep space. */
280
+ function resolveRegionId(tracker, coordinate) {
281
+ return (tracker.regions.unsizedList.find((candidate) => regionContainsCoordinate(candidate, coordinate))?.id ?? null);
274
282
  }
275
283
  function exactCoordinate(coordinate) {
276
284
  const spec = { fractionalBits: 56, signed: true, totalBits: 64 };
@@ -279,7 +287,7 @@ function exactCoordinate(coordinate) {
279
287
  y: FixedPoint.fromNumber(coordinate.y, spec).raw,
280
288
  };
281
289
  }
282
- async function resolveCoordinateMovement(ctx, fleet, authorization, actionLocation, destination) {
290
+ async function resolveCoordinateMovement(mode, ctx, fleet, authorization, actionLocation, destination) {
283
291
  const game = requireGameAddress(ctx);
284
292
  const [character, regionTracker, crewBinding] = await Promise.all([
285
293
  findCharacterPda(authorization.profile, game),
@@ -293,39 +301,70 @@ async function resolveCoordinateMovement(ctx, fleet, authorization, actionLocati
293
301
  crewBinding,
294
302
  ]);
295
303
  const fleetAccount = requireRawAccount(fleetCandidate, `Fleet ${fleet.name} is no longer available at ${fleet.address}. Refresh the Fleet and retry planning coordinate movement.`, fleet.address);
296
- const characterAccount = requireRawAccount(characterCandidate, `Fleet ${fleet.name} cannot move because its Profile has no canonical Character at ${character}. Create the Character for Profile ${authorization.profile} in the configured Game, refresh the Fleet, and retry.`, character);
304
+ const characterAccount = requireFleetCharacter(characterCandidate, fleet, authorization.profile, game, character, 'move');
297
305
  const regionTrackerAccount = requireRawAccount(regionCandidate, `Fleet ${fleet.name} cannot move because the canonical RegionTracker ${regionTracker} is missing. Verify the configured Game and cluster, refresh the world region data, and retry.`, regionTracker);
298
306
  const validatedFleet = await validateIdleFleetRead(fleetAccount, fleet, game, actionLocation);
299
- const exactDestination = exactCoordinate(destination);
300
- if (exactDestination.x === validatedFleet.location.x &&
301
- exactDestination.y === validatedFleet.location.y) {
302
- failSameCoordinate(fleet, destination);
307
+ requireNormalizedCrew(validatedFleet.data, fleet, mode);
308
+ if (destination.exact.x === validatedFleet.location.x &&
309
+ destination.exact.y === validatedFleet.location.y) {
310
+ failSameCoordinate(fleet, `${destination.field} ${destination.description}`);
311
+ }
312
+ if (mode === 'subwarp' &&
313
+ isSubPrecisionRoute(validatedFleet.location, destination.exact)) {
314
+ fail(`Fleet ${fleet.name} ${destination.field} ${destination.description} is closer to its action coordinate than the program can measure, so this subwarp would be refused. Choose a destination farther away and retry.`, fleet.address);
303
315
  }
304
- validateCharacterForCoordinateMovement(characterAccount, fleet, authorization.profile, game, character);
305
316
  const tracker = validateRegionTrackerRead(regionTrackerAccount, fleet, game, regionTracker);
306
317
  if (crewCandidate !== undefined) {
307
318
  validateCrewBindingRead(crewCandidate, fleet, crewBinding);
308
319
  }
320
+ const destinationRegionId = resolveRegionId(tracker, destination.exact);
321
+ // A player Fleet may cross deep space, but stopping there needs High Risk
322
+ // zone access.
323
+ if (destinationRegionId === null &&
324
+ !validatedFleet.npc &&
325
+ characterAccountDefinition.decode(characterAccount).modifiers.values
326
+ .securityZoneAccess !== 'high') {
327
+ fail(`Fleet ${fleet.name} ${destination.field} ${destination.field === 'destinationRaw' ? `(${String(destination.exact.x)}, ${String(destination.exact.y)}) raw I8F56` : destination.description} is in deep space, outside every Region, and its Character lacks the High Risk zone access needed to stop there. Research High Risk zone access or choose a destination inside a Region, then retry.`, character);
328
+ }
309
329
  return {
310
330
  character,
311
331
  characterAccount,
312
332
  ...(crewCandidate === undefined
313
333
  ? {}
314
334
  : { crewBinding, crewBindingAccount: crewCandidate }),
315
- destinationRegionId: resolveRegionId(tracker, exactDestination, destination, 'destination', fleet, regionTracker),
335
+ destinationRegionId,
316
336
  fleetAccount,
317
337
  regionTracker,
318
338
  regionTrackerAccount,
319
- startRegionId: resolveRegionId(tracker, validatedFleet.location, actionLocation, 'current', fleet, regionTracker),
339
+ from: validatedFleet.location,
340
+ startRegionId: resolveRegionId(tracker, validatedFleet.location),
320
341
  };
321
342
  }
343
+ /** Starting a journey changes the Fleet to its movement state; the program
344
+ * funds any growth from the Profile vault with the signing key. */
345
+ async function planMovementStorage(ctx, instruction, fleetAccount, profile) {
346
+ const [profileAccount, rentAccount] = await readContextRawAccounts(ctx, [
347
+ profile,
348
+ RENT_ADDRESS,
349
+ ]);
350
+ const accounts = new Map([
351
+ [fleetAccount.address, fleetAccount],
352
+ [profile, profileAccount],
353
+ [RENT_ADDRESS, rentAccount],
354
+ ]);
355
+ return planStorageFunding({
356
+ action: readMovementStorageAction(instruction, accounts),
357
+ accounts,
358
+ label: 'movement start',
359
+ });
360
+ }
322
361
  async function planCoordinateMovement(mode, ctx, fleet, options) {
323
362
  validatePlanAuthorization(options.authorization);
324
363
  assertFleetOwner(fleet, options.authorization);
325
364
  const actionLocation = requireRefreshableIdleState(fleet, 'start coordinate movement');
326
- validateDestination(fleet, actionLocation, options.destination);
365
+ const destination = resolveCoordinateDestination(fleet, actionLocation, options);
327
366
  const game = requireGameAddress(ctx);
328
- const resolved = await resolveCoordinateMovement(ctx, fleet, options.authorization, actionLocation, options.destination);
367
+ const resolved = await resolveCoordinateMovement(mode, ctx, fleet, options.authorization, actionLocation, destination);
329
368
  const xp = await resolveXpRuntime(ctx, {
330
369
  game,
331
370
  character: resolved.character,
@@ -347,14 +386,15 @@ async function planCoordinateMovement(mode, ctx, fleet, options) {
347
386
  const instruction = mode === 'subwarp'
348
387
  ? adaptStartSubwarpInstruction({
349
388
  ...common,
350
- toCoordinate: [options.destination.x, options.destination.y],
389
+ toCoordinate: [destination.exact.x, destination.exact.y],
351
390
  })
352
391
  : adaptWarpToCoordinateInstruction({
353
392
  ...common,
354
- destination: [options.destination.x, options.destination.y],
393
+ destination: [destination.exact.x, destination.exact.y],
355
394
  });
356
395
  const verb = mode === 'subwarp' ? 'Subwarp' : 'Warp';
357
- const description = `${verb} fleet ${fleet.name} to coordinate (${String(options.destination.x)}, ${String(options.destination.y)}).`;
396
+ const storage = await planMovementStorage(ctx, instruction, resolved.fleetAccount, options.authorization.profile);
397
+ const description = `${verb} fleet ${fleet.name} to coordinate ${destination.description}. ${storage.disclosure}`;
358
398
  const accounts = [
359
399
  {
360
400
  kind: 'xp-runtime',
@@ -363,28 +403,30 @@ async function planCoordinateMovement(mode, ctx, fleet, options) {
363
403
  accounts: xp.accounts,
364
404
  describes: 'The configured Game and canonical Character XP accounts remain eligible for movement.',
365
405
  },
366
- await precondition(resolved.fleetAccount, fleet.state.kind === 'idle'
406
+ await accountStatePrecondition(resolved.fleetAccount, fleet.state.kind === 'idle'
367
407
  ? `Fleet ${fleet.name} remains idle at coordinate (${String(actionLocation.x)}, ${String(actionLocation.y)}).`
368
408
  : `Fleet ${fleet.name} remains ${fleet.state.kind} with action coordinate (${String(actionLocation.x)}, ${String(actionLocation.y)}).`),
409
+ await characterAccessPrecondition(resolved.characterAccount, { game, profile: options.authorization.profile }, `The canonical Character remains assigned to Profile ${options.authorization.profile} in the configured Game with the research modifiers that set its movement and Region access; its ATLAS, XP and asset counts may change.`),
369
410
  {
370
- kind: 'movement-character',
371
- address: resolved.character,
411
+ kind: 'region-path',
412
+ address: resolved.regionTracker,
372
413
  game,
373
- profile: options.authorization.profile,
374
- stateHash: await hashMovementCharacter(resolved.characterAccount, {
375
- game,
376
- profile: options.authorization.profile,
377
- }),
378
- describes: 'The canonical Character retains its movement modifiers and non-accrual state.',
414
+ fleet: fleet.address,
415
+ fromX: resolved.from.x,
416
+ fromY: resolved.from.y,
417
+ toX: destination.exact.x,
418
+ toY: destination.exact.y,
419
+ pathHash: await hashRegionPath(resolved.regionTrackerAccount, game, resolved.from, destination.exact),
420
+ describes: `The Regions Fleet ${fleet.name}'s straight path to ${destination.description} can cross keep their borders, owner, safety status and risk zone, and no Region is added or removed; other Regions may change.`,
379
421
  },
380
- await precondition(resolved.regionTrackerAccount, `The configured RegionTracker continues to map Fleet ${fleet.name}'s current and destination coordinates.`),
381
422
  ...(resolved.crewBindingAccount === undefined
382
423
  ? []
383
424
  : [
384
- await precondition(resolved.crewBindingAccount, `Fleet ${fleet.name}'s optional FleetCrewBinding remains assigned to the Fleet and owner Profile.`),
425
+ await accountStatePrecondition(resolved.crewBindingAccount, `Fleet ${fleet.name}'s optional FleetCrewBinding remains assigned to the Fleet and owner Profile.`),
385
426
  ]),
427
+ storage.guard,
386
428
  ];
387
- return createPlan({
429
+ return buildPlannerPlan({
388
430
  kind: mode === 'subwarp' ? 'fleet.subwarp' : 'fleet.warp-to-coordinate',
389
431
  preconditions: accounts,
390
432
  steps: [
@@ -398,20 +440,35 @@ async function planCoordinateMovement(mode, ctx, fleet, options) {
398
440
  summary: description,
399
441
  });
400
442
  }
401
- async function validateLaneSystemRead(account, fleet, game, label) {
402
- const data = starSystemAccountDefinition.decode(account);
403
- const canonicalAddress = await deriveStarSystemAddress(game, data.systemId);
404
- if (data.game !== game || account.address !== canonicalAddress) {
405
- fail(`Fleet ${fleet.name} cannot use a warp lane because the ${label} Star System ${account.address} does not match the configured Game or canonical PDA. Refresh the galaxy and retry with a Star System from the configured Game.`, account.address);
406
- }
407
- return data;
408
- }
409
443
  function hasExactSystemLocation(account, location) {
410
444
  starSystemAccountDefinition.decode(account);
411
445
  const exact = getStarSystemDecoder().decode(account.data);
412
446
  return (exact.coordinates[0].raw === location.x &&
413
447
  exact.coordinates[1].raw === location.y);
414
448
  }
449
+ /** The Star Systems of the configured Game discovered at a Fleet's displayed
450
+ * action coordinate. */
451
+ async function discoverSystemsAt(ctx, game, location) {
452
+ const systems = await ctx.data.discover(starSystemAccountDefinition, {
453
+ filters: buildStarSystemDiscoveryFilters(game),
454
+ strategy: 'targeted-program-accounts',
455
+ });
456
+ return systems
457
+ .filter(({ data }) => data.coordinates.x === location.x && data.coordinates.y === location.y)
458
+ .map(({ address }) => address);
459
+ }
460
+ /** Selects the one fresh candidate whose exact coordinate is the Fleet's. */
461
+ function selectSystemAt(fleet, location, exact, candidates, accounts) {
462
+ const matches = accounts.filter((account) => account !== undefined && hasExactSystemLocation(account, exact));
463
+ if (matches.length === 1)
464
+ return matches[0];
465
+ const coordinate = `Fleet ${fleet.name} action coordinate (${String(location.x)}, ${String(location.y)})`;
466
+ if (candidates.length === 1) {
467
+ const [only] = accounts;
468
+ fail(`${coordinate} no longer matches Star System ${only === undefined ? candidates[0] : starSystemAccountDefinition.decode(only).name}. Refresh the Fleet and galaxy, then retry.`, candidates[0]);
469
+ }
470
+ return fail(`${coordinate} matches multiple Star Systems in the configured Game. Refresh the galaxy and repair the contradictory System data before retrying.`, fleet.address);
471
+ }
415
472
  function validateFactionRelationTrackerRead(account, fleet, game, canonicalAddress) {
416
473
  const data = factionRelationTrackerAccountDefinition.decode(account);
417
474
  if (account.address !== canonicalAddress || data.game !== game) {
@@ -420,12 +477,7 @@ function validateFactionRelationTrackerRead(account, fleet, game, canonicalAddre
420
477
  }
421
478
  async function resolveWarpLane(ctx, fleet, actionLocation, options) {
422
479
  const game = requireGameAddress(ctx);
423
- const systems = await ctx.data.discover(starSystemAccountDefinition, {
424
- filters: buildStarSystemDiscoveryFilters(game),
425
- strategy: 'targeted-program-accounts',
426
- });
427
- const sourceCandidates = systems.filter((system) => system.data.coordinates.x === actionLocation.x &&
428
- system.data.coordinates.y === actionLocation.y);
480
+ const sourceCandidates = await discoverSystemsAt(ctx, game, actionLocation);
429
481
  if (sourceCandidates.length === 0) {
430
482
  fail(`Fleet ${fleet.name} action coordinate (${String(actionLocation.x)}, ${String(actionLocation.y)}) does not match a Star System in the configured Game. Refresh the galaxy or move the Fleet to a Star System before retrying.`, fleet.address);
431
483
  }
@@ -440,7 +492,7 @@ async function resolveWarpLane(ctx, fleet, actionLocation, options) {
440
492
  const reads = await readContextRawAccounts(ctx, [
441
493
  fleet.address,
442
494
  character,
443
- ...sourceCandidates.map((candidate) => candidate.address),
495
+ ...sourceCandidates,
444
496
  options.destinationSystem,
445
497
  currencyCache,
446
498
  factionRelationTracker,
@@ -454,31 +506,16 @@ async function resolveWarpLane(ctx, fleet, actionLocation, options) {
454
506
  const regionCandidate = reads[destinationOffset + 3];
455
507
  const fleetAccount = requireRawAccount(fleetCandidate, `Fleet ${fleet.name} is no longer available at ${fleet.address}. Refresh the Fleet and retry planning the warp lane.`, fleet.address);
456
508
  const validatedFleet = await validateIdleFleetRead(fleetAccount, fleet, game, actionLocation, 'warp lane');
457
- const exactSourceCandidates = sourceCandidates.flatMap((candidate, index) => {
458
- const account = reads[sourceOffset + index];
459
- return account !== undefined &&
460
- hasExactSystemLocation(account, validatedFleet.location)
461
- ? [{ account, address: candidate.address }]
462
- : [];
463
- });
464
- if (exactSourceCandidates.length !== 1) {
465
- if (sourceCandidates.length === 1) {
466
- const sourceSystem = sourceCandidates[0].address;
467
- const sourceAccount = requireRawAccount(reads[sourceOffset], `Fleet ${fleet.name} cannot use a warp lane because source Star System ${sourceSystem} is missing. Refresh the Fleet and galaxy, then retry.`, sourceSystem);
468
- const source = starSystemAccountDefinition.decode(sourceAccount);
469
- fail(`Fleet ${fleet.name} action coordinate (${String(actionLocation.x)}, ${String(actionLocation.y)}) no longer matches source Star System ${source.name}. Refresh the Fleet and galaxy before retrying.`, sourceSystem);
470
- }
471
- fail(`Fleet ${fleet.name} action coordinate (${String(actionLocation.x)}, ${String(actionLocation.y)}) matches multiple Star Systems in the configured Game. Refresh the galaxy and repair the contradictory System data before retrying.`, fleet.address);
472
- }
473
- const { account: sourceAccount, address: sourceSystem } = exactSourceCandidates[0];
474
- const characterAccount = requireRawAccount(characterCandidate, `Fleet ${fleet.name} cannot use a warp lane because its Profile has no canonical Character at ${character}. Create the Character for Profile ${options.authorization.profile} in the configured Game, refresh the Fleet, and retry.`, character);
509
+ requireNormalizedCrew(validatedFleet.data, fleet, 'use a warp lane');
510
+ const sourceAccount = selectSystemAt(fleet, actionLocation, validatedFleet.location, sourceCandidates, reads.slice(sourceOffset, destinationOffset));
511
+ const sourceSystem = sourceAccount.address;
512
+ const characterAccount = requireFleetCharacter(characterCandidate, fleet, options.authorization.profile, game, character, 'use a warp lane');
475
513
  const destinationAccount = requireRawAccount(destinationCandidate, `Fleet ${fleet.name} cannot use a warp lane because destination Star System ${options.destinationSystem} is missing. Choose a Star System in the configured Game, refresh the galaxy, and retry.`, options.destinationSystem);
476
514
  const currencyCacheAccount = requireRawAccount(currencyCandidate, `Fleet ${fleet.name} cannot use a warp lane because canonical CurrencyCache ${currencyCache} is missing. Verify the configured Game and cluster, refresh the Game currency configuration, and retry.`, currencyCache);
477
515
  const factionRelationTrackerAccount = requireRawAccount(factionCandidate, `Fleet ${fleet.name} cannot use a warp lane because canonical FactionRelationTracker ${factionRelationTracker} is missing. Verify the configured Game and cluster, refresh the faction relation data, and retry.`, factionRelationTracker);
478
516
  const regionTrackerAccount = requireRawAccount(regionCandidate, `Fleet ${fleet.name} cannot use a warp lane because canonical RegionTracker ${regionTracker} is missing. Verify the configured Game and cluster, refresh the world region data, and retry.`, regionTracker);
479
- validateCharacterForCoordinateMovement(characterAccount, fleet, options.authorization.profile, game, character);
480
- const source = await validateLaneSystemRead(sourceAccount, fleet, game, 'source');
481
- const destination = await validateLaneSystemRead(destinationAccount, fleet, game, 'destination');
517
+ const source = await validateFleetSystemRead(sourceAccount, fleet, game, 'use a warp lane', 'source Star System');
518
+ const destination = await validateFleetSystemRead(destinationAccount, fleet, game, 'use a warp lane', 'destination Star System');
482
519
  await validateCurrencyCache(currencyCacheAccount, game, 'warp lane');
483
520
  validateFactionRelationTrackerRead(factionRelationTrackerAccount, fleet, game, factionRelationTracker);
484
521
  validateRegionTrackerRead(regionTrackerAccount, fleet, game, regionTracker);
@@ -511,7 +548,9 @@ async function resolveWarpLane(ctx, fleet, actionLocation, options) {
511
548
  * proves connectivity from that System's decoded connections, and resolves all
512
549
  * generated instruction accounts internally. CurrencyCache shared accounting may
513
550
  * change; canonical identity/layout and the existing toll-input guards remain
514
- * checked before signing. Refresh and recreate older Plans to use this guard.
551
+ * checked before signing. The Regions containing the destination keep their
552
+ * owner, safety status and risk zone, which decide destination access; other
553
+ * Regions may change. Refresh and recreate older Plans to use these guards.
515
554
  *
516
555
  * Connectivity does not guarantee eligibility. The program remains authoritative
517
556
  * for faction-relationship and destination-risk checks and any ATLAS toll.
@@ -542,8 +581,21 @@ export async function planFleetWarpLane(ctx, fleet, options) {
542
581
  character: resolved.character,
543
582
  profile: options.authorization.profile,
544
583
  });
545
- const description = `Warp fleet ${fleet.name} from Star System ${resolved.source.name} to Star System ${resolved.destination.name} via warp lane.`;
546
- return createPlan({
584
+ const instruction = adaptWarpLaneInstruction({
585
+ ...xp.accounts,
586
+ authorization: options.authorization,
587
+ character: resolved.character,
588
+ currencyCache: resolved.currencyCache,
589
+ factionRelationTracker: resolved.factionRelationTracker,
590
+ fleet: fleet.address,
591
+ fromSystem: resolved.sourceSystem,
592
+ game,
593
+ regionTracker: resolved.regionTracker,
594
+ toSystem: options.destinationSystem,
595
+ });
596
+ const storage = await planMovementStorage(ctx, instruction, resolved.fleetAccount, options.authorization.profile);
597
+ const description = `Warp fleet ${fleet.name} from Star System ${resolved.source.name} to Star System ${resolved.destination.name} via warp lane. ${storage.disclosure}`;
598
+ return buildPlannerPlan({
547
599
  kind: 'fleet.warp-lane',
548
600
  preconditions: [
549
601
  {
@@ -554,47 +606,34 @@ export async function planFleetWarpLane(ctx, fleet, options) {
554
606
  describes: 'The configured Game and canonical Character XP accounts remain eligible for movement.',
555
607
  },
556
608
  ...(await Promise.all([
557
- precondition(resolved.fleetAccount, fleet.state.kind === 'idle'
609
+ accountStatePrecondition(resolved.fleetAccount, fleet.state.kind === 'idle'
558
610
  ? `Fleet ${fleet.name} remains idle at Star System ${resolved.source.name}.`
559
611
  : `Fleet ${fleet.name} remains ${fleet.state.kind} at action source Star System ${resolved.source.name}.`),
560
- hashMovementCharacter(resolved.characterAccount, {
561
- game,
562
- profile: options.authorization.profile,
563
- }).then((stateHash) => ({
564
- kind: 'movement-character',
565
- address: resolved.character,
566
- game,
567
- profile: options.authorization.profile,
568
- stateHash,
569
- describes: 'The canonical Character retains its movement modifiers and non-accrual state.',
570
- })),
571
- precondition(resolved.sourceAccount, `Source Star System ${resolved.source.name} remains at Fleet ${fleet.name}'s action coordinate with a connection to system id ${String(resolved.destination.systemId)}.`),
572
- precondition(resolved.destinationAccount, `Destination Star System ${resolved.destination.name} remains system id ${String(resolved.destination.systemId)} in the configured Game.`),
612
+ characterAccessPrecondition(resolved.characterAccount, { game, profile: options.authorization.profile }, `The canonical Character remains assigned to Profile ${options.authorization.profile} in the configured Game with the research modifiers that set its movement and Region access; its ATLAS, XP and asset counts may change.`),
613
+ accountStatePrecondition(resolved.sourceAccount, `Source Star System ${resolved.source.name} remains at Fleet ${fleet.name}'s action coordinate with a connection to system id ${String(resolved.destination.systemId)}.`),
614
+ accountStatePrecondition(resolved.destinationAccount, `Destination Star System ${resolved.destination.name} remains system id ${String(resolved.destination.systemId)} in the configured Game.`),
573
615
  Promise.resolve({
574
616
  kind: 'currency-cache',
575
617
  address: resolved.currencyCacheAccount.address,
576
618
  game,
577
619
  describes: 'The canonical CurrencyCache retains its supported Game identity and layout; shared accounting may change.',
578
620
  }),
579
- precondition(resolved.factionRelationTrackerAccount, 'The canonical FactionRelationTracker remains assigned to the configured Game.'),
580
- precondition(resolved.regionTrackerAccount, 'The canonical RegionTracker remains assigned to the configured Game.'),
621
+ accountStatePrecondition(resolved.factionRelationTrackerAccount, 'The canonical FactionRelationTracker remains assigned to the configured Game.'),
622
+ hashRegionAccess(resolved.regionTrackerAccount, resolved.destinationAccount, game).then((accessHash) => ({
623
+ kind: 'region-access',
624
+ address: resolved.regionTracker,
625
+ game,
626
+ system: options.destinationSystem,
627
+ accessHash,
628
+ describes: `The Regions containing destination Star System ${resolved.destination.name} keep their owner, safety status and risk zone; other Regions may change.`,
629
+ })),
581
630
  ])),
631
+ storage.guard,
582
632
  ],
583
633
  steps: [
584
634
  {
585
635
  describes: description,
586
- instruction: adaptWarpLaneInstruction({
587
- ...xp.accounts,
588
- authorization: options.authorization,
589
- character: resolved.character,
590
- currencyCache: resolved.currencyCache,
591
- factionRelationTracker: resolved.factionRelationTracker,
592
- fleet: fleet.address,
593
- fromSystem: resolved.sourceSystem,
594
- game,
595
- regionTracker: resolved.regionTracker,
596
- toSystem: options.destinationSystem,
597
- }),
636
+ instruction,
598
637
  semantics: movementStartSemantics(fleet.address),
599
638
  signers: [options.authorization.authority],
600
639
  },
@@ -602,7 +641,13 @@ export async function planFleetWarpLane(ctx, fleet, options) {
602
641
  summary: description,
603
642
  });
604
643
  }
605
- /** Plans one explicit Fleet subwarp to a coordinate without movement estimates.
644
+ /** Plans one explicit Fleet subwarp to a display or exact raw coordinate without movement estimates.
645
+ *
646
+ * A coordinate outside every Region is deep space and carries no Region hint.
647
+ * A player Fleet may cross deep space, but stopping there needs the Character's
648
+ * High Risk zone access; NPC Fleets need none. The Plan guards only the
649
+ * Regions whose bounding boxes overlap the straight path's, plus the Region
650
+ * count, so a Starbase capture or upgrade elsewhere leaves it valid.
606
651
  *
607
652
  * @example
608
653
  * ```ts
@@ -611,14 +656,20 @@ export async function planFleetWarpLane(ctx, fleet, options) {
611
656
  * declare const authorization: PlanAuthorization;
612
657
  * const plan = await planFleetSubwarp(ctx, fleet, {
613
658
  * authorization,
614
- * destination: { x: 12, y: -7 },
659
+ * destinationRaw: { x: 12n << 56n, y: -(7n << 56n) },
615
660
  * });
616
661
  * ```
617
662
  */
618
663
  export function planFleetSubwarp(ctx, fleet, options) {
619
664
  return planCoordinateMovement('subwarp', ctx, fleet, options);
620
665
  }
621
- /** Plans one explicit Fleet coordinate warp without movement estimates.
666
+ /** Plans one explicit Fleet coordinate warp to a display or exact raw coordinate without movement estimates.
667
+ *
668
+ * A coordinate outside every Region is deep space and carries no Region hint.
669
+ * A player Fleet may cross deep space, but stopping there needs the Character's
670
+ * High Risk zone access; NPC Fleets need none. The Plan guards only the
671
+ * Regions whose bounding boxes overlap the straight path's, plus the Region
672
+ * count, so a Starbase capture or upgrade elsewhere leaves it valid.
622
673
  *
623
674
  * @example
624
675
  * ```ts
@@ -627,7 +678,7 @@ export function planFleetSubwarp(ctx, fleet, options) {
627
678
  * declare const authorization: PlanAuthorization;
628
679
  * const plan = await planFleetWarpToCoordinate(ctx, fleet, {
629
680
  * authorization,
630
- * destination: { x: 12, y: -7 },
681
+ * destinationRaw: { x: 12n << 56n, y: -(7n << 56n) },
631
682
  * });
632
683
  * ```
633
684
  */
@@ -674,7 +725,7 @@ export async function planFleetSettleArrival(ctx, fleet, input) {
674
725
  regionTracker,
675
726
  ...xp.accounts,
676
727
  });
677
- return createPlan({
728
+ return buildPlannerPlan({
678
729
  kind: 'fleet.settle-arrival',
679
730
  preconditions: [
680
731
  {
@@ -723,7 +774,8 @@ export async function planFleetSettleArrival(ctx, fleet, input) {
723
774
  export async function planFleetStopSubwarp(ctx, fleet, options) {
724
775
  validatePlanAuthorization(options.authorization);
725
776
  assertFleetOwner(fleet, options.authorization);
726
- requireStopSubwarpState(fleet);
777
+ if (fleet.state.kind !== 'subwarp' && fleet.state.kind !== 'idle')
778
+ failFleetState(fleet, fleet.state.kind, 'stop subwarp', 'it must be subwarping or idle');
727
779
  const game = requireGameAddress(ctx);
728
780
  const character = await findCharacterPda(options.authorization.profile, game);
729
781
  const regionTracker = await deriveRegionTrackerAddress(game);
@@ -736,7 +788,7 @@ export async function planFleetStopSubwarp(ctx, fleet, options) {
736
788
  profile: options.authorization.profile,
737
789
  });
738
790
  const description = `Stop subwarp early for fleet ${fleet.name}; leave it idle if the trip already completed.`;
739
- return createPlan({
791
+ return buildPlannerPlan({
740
792
  kind: 'fleet.stop-subwarp',
741
793
  preconditions: [
742
794
  {
@@ -793,12 +845,11 @@ export async function planFleetUndock(ctx, fleet, options) {
793
845
  starbasePlayerAddress,
794
846
  ]);
795
847
  const fleetAccount = requireRawAccount(fleetCandidate, `Fleet ${fleet.name} is no longer available at ${fleet.address}. Refresh the Fleet and retry planning the undock action.`, fleet.address);
796
- const characterAccount = requireRawAccount(characterCandidate, `Fleet ${fleet.name} cannot undock because its Profile has no canonical Character at ${characterAddress}. Create the Character for Profile ${options.authorization.profile} in the configured Game, refresh the Fleet, and retry.`, characterAddress);
848
+ const characterAccount = requireFleetCharacter(characterCandidate, fleet, options.authorization.profile, game, characterAddress, 'undock');
797
849
  const systemAccount = requireRawAccount(systemCandidate, `Fleet ${fleet.name} is docked at Star System ${docked.system.address}, but that System account is missing. Verify the configured Game and cluster, refresh the Fleet, and retry.`, docked.system.address);
798
850
  const playerAccount = requireRawAccount(playerCandidate, `Fleet ${fleet.name} cannot undock because its Starbase Player registration is missing at ${starbasePlayerAddress}. Register the Character at this Starbase, refresh the Fleet, and retry.`, starbasePlayerAddress);
799
851
  validateFleetRead(fleetAccount, fleet, game, docked.system.address, docked.systemSeqId);
800
- validateCharacterRead(characterAccount, fleet, options.authorization.profile, game);
801
- const system = await validateSystemRead(systemAccount, fleet, game, docked.systemSeqId);
852
+ const system = await validateFleetSystemRead(systemAccount, fleet, game, 'undock', 'Star System', docked.systemSeqId);
802
853
  validateStarbasePlayerRead(playerAccount, fleet, options.authorization.profile, characterAddress, docked.system.address, starbasePlayerAddress);
803
854
  const instruction = adaptDockedToIdleInstruction({
804
855
  authorization: options.authorization,
@@ -808,13 +859,13 @@ export async function planFleetUndock(ctx, fleet, options) {
808
859
  systemAndStarbasePlayerSystem: docked.system.address,
809
860
  });
810
861
  const description = `Undock fleet ${fleet.name} from the Starbase in Star System ${system.name}.`;
811
- return createPlan({
862
+ return buildPlannerPlan({
812
863
  kind: 'fleet.undock',
813
864
  preconditions: await Promise.all([
814
- precondition(fleetAccount, `Fleet ${fleet.name} remains docked at Star System ${system.name}.`),
815
- precondition(characterAccount, `The canonical Character remains assigned to Profile ${options.authorization.profile} in the configured Game.`),
816
- precondition(systemAccount, `Star System ${system.name} remains the docked System for Fleet ${fleet.name}.`),
817
- precondition(playerAccount, `The Starbase Player remains registered for Fleet ${fleet.name} at Star System ${system.name}.`),
865
+ accountStatePrecondition(fleetAccount, `Fleet ${fleet.name} remains docked at Star System ${system.name}.`),
866
+ characterAccessPrecondition(characterAccount, { game, profile: options.authorization.profile }, `The canonical Character remains assigned to Profile ${options.authorization.profile} in the configured Game with its research modifiers; its ATLAS, XP and asset counts may change.`),
867
+ accountStatePrecondition(systemAccount, `Star System ${system.name} remains the docked System for Fleet ${fleet.name}.`),
868
+ accountStatePrecondition(playerAccount, `The Starbase Player remains registered for Fleet ${fleet.name} at Star System ${system.name}.`),
818
869
  ]),
819
870
  steps: [
820
871
  {
@@ -828,10 +879,18 @@ export async function planFleetUndock(ctx, fleet, options) {
828
879
  }
829
880
  /** Plans one explicit Fleet dock without signing, simulation, or write RPC.
830
881
  *
831
- * The planner accepts a loaded idle or refreshable movement Fleet snapshot,
882
+ * The planner accepts a loaded idle or refreshable warp Fleet snapshot,
832
883
  * resolves the only canonical Character, Star System at its action coordinate,
833
884
  * and Starbase Player internally, and returns one inspectable idle-to-docked
834
- * Plan.
885
+ * Plan. A subwarp snapshot is refused: the dock step refreshes the Fleet
886
+ * without its Character and cannot settle a subwarp journey, so settle the
887
+ * arrival or stop the subwarp first.
888
+ *
889
+ * Docking is admitted when the Starbase Player belongs to the Starbase's
890
+ * controlling faction, whatever the territory and economics settings. A
891
+ * foreign Starbase Player is refused while territory access is off; foreign
892
+ * docking under territory access and dynamic-faction Starbases are refused as
893
+ * unsupported.
835
894
  *
836
895
  * @example
837
896
  * ```ts
@@ -854,34 +913,13 @@ export async function planFleetDock(ctx, fleet, options) {
854
913
  const [characterCandidate] = await readContextRawAccounts(ctx, [
855
914
  characterAddress,
856
915
  ]);
857
- const characterAccount = requireRawAccount(characterCandidate, `Fleet ${fleet.name} cannot dock because its Profile has no canonical Character at ${characterAddress}. Create the Character for Profile ${options.authorization.profile} in the configured Game, refresh the Fleet, and retry.`, characterAddress);
858
- validateCharacterForCoordinateMovement(characterAccount, fleet, options.authorization.profile, game, characterAddress, 'dock');
859
- const discoveredSystems = await ctx.data.discover(starSystemAccountDefinition, {
860
- filters: buildStarSystemDiscoveryFilters(game),
861
- strategy: 'targeted-program-accounts',
862
- });
863
- const matchingSystems = discoveredSystems.filter((system) => system.data.coordinates.x === actionLocation.x &&
864
- system.data.coordinates.y === actionLocation.y);
865
- if (matchingSystems.length === 0)
916
+ const characterAccount = requireFleetCharacter(characterCandidate, fleet, options.authorization.profile, game, characterAddress, 'dock');
917
+ const candidates = await discoverSystemsAt(ctx, game, actionLocation);
918
+ if (candidates.length === 0)
866
919
  failNoDockableStarbase(fleet, actionLocation);
867
- const systemCandidates = await readContextRawAccounts(ctx, matchingSystems.map((candidate) => candidate.address));
868
- const exactSystems = matchingSystems.flatMap((candidate, index) => {
869
- const account = systemCandidates[index];
870
- return account !== undefined &&
871
- hasExactSystemLocation(account, validatedFleet.location)
872
- ? [{ account, address: candidate.address }]
873
- : [];
874
- });
875
- if (exactSystems.length !== 1) {
876
- if (matchingSystems.length === 1) {
877
- const systemAddress = matchingSystems[0].address;
878
- const systemAccount = systemCandidates[0] ?? failNoDockableStarbase(fleet, actionLocation);
879
- await validateDockSystemRead(systemAccount, fleet, game, systemAddress, validatedFleet.location);
880
- }
881
- fail(`Fleet ${fleet.name} action coordinate (${String(actionLocation.x)}, ${String(actionLocation.y)}) matches multiple Star Systems in the configured Game, so there is no canonical Starbase to dock at. Refresh the galaxy and repair the contradictory System data before retrying.`, fleet.address);
882
- }
883
- const { account: systemAccount, address: systemAddress } = exactSystems[0];
884
- const system = await validateDockSystemRead(systemAccount, fleet, game, systemAddress, validatedFleet.location);
920
+ const systemAccount = selectSystemAt(fleet, actionLocation, validatedFleet.location, candidates, await readContextRawAccounts(ctx, candidates));
921
+ const systemAddress = systemAccount.address;
922
+ const system = await validateFleetSystemRead(systemAccount, fleet, game, 'dock');
885
923
  if (system.starbase === undefined)
886
924
  failNoDockableStarbase(fleet, actionLocation);
887
925
  const starbasePlayerAddress = await deriveStarbasePlayerAddress(systemAddress, characterAddress);
@@ -889,7 +927,7 @@ export async function planFleetDock(ctx, fleet, options) {
889
927
  starbasePlayerAddress,
890
928
  ]);
891
929
  const playerAccount = requireRawAccount(playerCandidate, `Fleet ${fleet.name} cannot dock because Character ${characterAddress} is not registered at Starbase ${system.name} in Star System ${systemAddress}. Register the Character at this Starbase before docking, refresh the Fleet, and retry.`, starbasePlayerAddress);
892
- validateStarbasePlayerRead(playerAccount, fleet, options.authorization.profile, characterAddress, systemAddress, starbasePlayerAddress, 'dock');
930
+ const playerData = validateStarbasePlayerRead(playerAccount, fleet, options.authorization.profile, characterAddress, systemAddress, starbasePlayerAddress, 'dock');
893
931
  const [tracker, ownership] = await Promise.all([
894
932
  deriveFactionRelationTrackerAddress(game),
895
933
  deriveFactionOwnershipAddress(game, 'starbase', systemAddress),
@@ -900,13 +938,19 @@ export async function planFleetDock(ctx, fleet, options) {
900
938
  game,
901
939
  system: systemAddress,
902
940
  ownership,
903
- describes: 'Docking retains qualified default faction gating and legacy System control.',
941
+ starbasePlayer: starbasePlayerAddress,
942
+ describes: 'Docking keeps the same Starbase controller, Starbase Player faction and faction admission.',
904
943
  };
905
944
  const [trackerAccount, ownershipAccount] = await readContextRawAccounts(ctx, [
906
945
  tracker,
907
946
  ownership,
908
947
  ]);
909
- await validateFleetDockingPolicy(trackerAccount, ownershipAccount, policy);
948
+ await validateFleetDockingPolicy({
949
+ tracker: trackerAccount,
950
+ ownership: ownershipAccount,
951
+ system: systemAccount,
952
+ starbasePlayer: playerAccount,
953
+ }, policy);
910
954
  const instruction = adaptIdleToDockedInstruction({
911
955
  factionRelationTracker: tracker,
912
956
  factionOwnership: ownership,
@@ -922,10 +966,10 @@ export async function planFleetDock(ctx, fleet, options) {
922
966
  profile: options.authorization.profile,
923
967
  authority: options.authorization.authority,
924
968
  certificate: instruction.accounts[2].address,
925
- keyIndex: options.authorization.keyIndex,
926
969
  character: characterAddress,
927
970
  system: systemAddress,
928
971
  starbasePlayer: starbasePlayerAddress,
972
+ keyIndex: options.authorization.keyIndex,
929
973
  };
930
974
  const amounts = await resolveDockFunding(ctx, fundingIntent, [
931
975
  fleetAccount,
@@ -941,17 +985,17 @@ export async function planFleetDock(ctx, fleet, options) {
941
985
  : `Docking storage debit bounds are unavailable (${amounts.reason}); this does not imply zero Profile debit. Inspect simulation and fund the Profile explicitly if needed; transaction fees are separate.`,
942
986
  };
943
987
  const description = `Dock fleet ${fleet.name} at the Starbase in Star System ${system.name}.`;
944
- return createPlan({
988
+ return buildPlannerPlan({
945
989
  kind: 'fleet.dock',
946
990
  preconditions: [
947
991
  policy,
948
992
  ...(await Promise.all([
949
- precondition(fleetAccount, fleet.state.kind === 'idle'
993
+ accountStatePrecondition(fleetAccount, fleet.state.kind === 'idle'
950
994
  ? `Fleet ${fleet.name} remains idle at Starbase System ${system.name} coordinate (${String(actionLocation.x)}, ${String(actionLocation.y)}).`
951
995
  : `Fleet ${fleet.name} remains ${fleet.state.kind} at Starbase System ${system.name} action coordinate (${String(actionLocation.x)}, ${String(actionLocation.y)}).`),
952
- precondition(characterAccount, `The canonical Character remains assigned to Profile ${options.authorization.profile} in the configured Game.`),
953
- precondition(systemAccount, `Star System ${system.name} remains the Starbase System at Fleet ${fleet.name} coordinate (${String(actionLocation.x)}, ${String(actionLocation.y)}).`),
954
- precondition(playerAccount, `The Starbase Player remains registered for Fleet ${fleet.name} at Starbase ${system.name}.`),
996
+ characterAccessPrecondition(characterAccount, { game, profile: options.authorization.profile }, `The canonical Character remains assigned to Profile ${options.authorization.profile} in the configured Game with its research modifiers; its ATLAS, XP and asset counts may change.`),
997
+ accountStatePrecondition(systemAccount, `Star System ${system.name} remains the Starbase System at Fleet ${fleet.name} coordinate (${String(actionLocation.x)}, ${String(actionLocation.y)}).`),
998
+ accountStatePrecondition(playerAccount, `The Starbase Player remains registered for Fleet ${fleet.name} at Starbase ${system.name}.`),
955
999
  ])),
956
1000
  funding,
957
1001
  ],
@@ -968,7 +1012,10 @@ export async function planFleetDock(ctx, fleet, options) {
968
1012
  export { planDepositShipsToGame, } from './ship-import.js';
969
1013
  export { planCreateFleet, } from './create-fleet.js';
970
1014
  export { planAddShipToFleet, } from './add-ship.js';
1015
+ export { planFleetDisband } from './disband.js';
1016
+ export { planSyncFleetWithGame } from './sync.js';
971
1017
  export { planFleetStartRespawn, planFleetCompleteRespawn, } from './respawn.js';
972
1018
  export { planLoadFleetCrew, planUnloadFleetCrew, } from './crew-transfer.js';
1019
+ export { estimateFleetDeploymentStorage, } from './deployment-storage.js';
973
1020
  export { getFleetDockDebitBounds, } from './dock-bounds.js';
974
1021
  //# sourceMappingURL=index.js.map