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