@aephia/atlas-kit 0.6.0-next.98 → 0.6.0
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/dist/cargo/actions/deposit.d.ts +4 -1
- package/dist/cargo/actions/deposit.d.ts.map +1 -1
- package/dist/cargo/actions/deposit.js +56 -133
- package/dist/cargo/actions/deposit.js.map +1 -1
- package/dist/cargo/actions/index.d.ts +14 -7
- package/dist/cargo/actions/index.d.ts.map +1 -1
- package/dist/cargo/actions/index.js +105 -93
- 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 +37 -163
- 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 +80 -14
- package/dist/claim-stakes/actions/index.d.ts.map +1 -1
- package/dist/claim-stakes/actions/index.js +668 -717
- package/dist/claim-stakes/actions/index.js.map +1 -1
- package/dist/claim-stakes/index.d.ts +8 -6
- package/dist/claim-stakes/index.d.ts.map +1 -1
- package/dist/claim-stakes/index.js +12 -18
- package/dist/claim-stakes/index.js.map +1 -1
- package/dist/client/context.d.ts.map +1 -1
- package/dist/client/context.js +353 -37
- package/dist/client/context.js.map +1 -1
- package/dist/client/contracts.d.ts +54 -1
- package/dist/client/contracts.d.ts.map +1 -1
- package/dist/client/deployments.d.ts +17 -0
- package/dist/client/deployments.d.ts.map +1 -1
- package/dist/client/deployments.js +17 -0
- package/dist/client/deployments.js.map +1 -1
- package/dist/client/index.d.ts +22 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +21 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/rpc-subscription-provider.d.ts +2 -0
- package/dist/client/rpc-subscription-provider.d.ts.map +1 -1
- package/dist/client/rpc-subscription-provider.js +135 -101
- package/dist/client/rpc-subscription-provider.js.map +1 -1
- 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 +266 -256
- 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/fee-rate.d.ts +47 -0
- package/dist/crafting/actions/fee-rate.d.ts.map +1 -0
- package/dist/crafting/actions/fee-rate.js +58 -0
- package/dist/crafting/actions/fee-rate.js.map +1 -0
- package/dist/crafting/actions/index.d.ts +28 -28
- package/dist/crafting/actions/index.d.ts.map +1 -1
- package/dist/crafting/actions/index.js +246 -317
- package/dist/crafting/actions/index.js.map +1 -1
- package/dist/crafting/estimate.d.ts +101 -0
- package/dist/crafting/estimate.d.ts.map +1 -0
- package/dist/crafting/estimate.js +108 -0
- package/dist/crafting/estimate.js.map +1 -0
- package/dist/crafting/index.d.ts +6 -5
- package/dist/crafting/index.d.ts.map +1 -1
- package/dist/crafting/index.js +6 -13
- package/dist/crafting/index.js.map +1 -1
- package/dist/factions/actions/index.d.ts +1 -1
- package/dist/factions/actions/index.d.ts.map +1 -1
- package/dist/factions/actions/index.js +5 -4
- package/dist/factions/actions/index.js.map +1 -1
- package/dist/factions/index.d.ts +18 -1
- package/dist/factions/index.d.ts.map +1 -1
- package/dist/factions/index.js +24 -18
- package/dist/factions/index.js.map +1 -1
- package/dist/fleets/actions/add-ship.d.ts +18 -5
- package/dist/fleets/actions/add-ship.d.ts.map +1 -1
- package/dist/fleets/actions/add-ship.js +35 -48
- package/dist/fleets/actions/add-ship.js.map +1 -1
- package/dist/fleets/actions/create-fleet.d.ts +1 -1
- package/dist/fleets/actions/create-fleet.d.ts.map +1 -1
- package/dist/fleets/actions/create-fleet.js +8 -38
- package/dist/fleets/actions/create-fleet.js.map +1 -1
- package/dist/fleets/actions/crew-transfer.d.ts +8 -4
- package/dist/fleets/actions/crew-transfer.d.ts.map +1 -1
- package/dist/fleets/actions/crew-transfer.js +27 -42
- package/dist/fleets/actions/crew-transfer.js.map +1 -1
- package/dist/fleets/actions/deployment-storage.d.ts +161 -0
- package/dist/fleets/actions/deployment-storage.d.ts.map +1 -0
- package/dist/fleets/actions/deployment-storage.js +297 -0
- package/dist/fleets/actions/deployment-storage.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/index.d.ts +55 -11
- package/dist/fleets/actions/index.d.ts.map +1 -1
- package/dist/fleets/actions/index.js +288 -241
- package/dist/fleets/actions/index.js.map +1 -1
- package/dist/fleets/actions/respawn.d.ts +1 -1
- package/dist/fleets/actions/respawn.d.ts.map +1 -1
- package/dist/fleets/actions/respawn.js +8 -37
- package/dist/fleets/actions/respawn.js.map +1 -1
- 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 +39 -91
- 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 +7 -4
- package/dist/fleets/cooldown.d.ts.map +1 -1
- package/dist/fleets/cooldown.js +11 -6
- package/dist/fleets/cooldown.js.map +1 -1
- package/dist/fleets/index.d.ts +1 -0
- package/dist/fleets/index.d.ts.map +1 -1
- package/dist/fleets/index.js +3 -10
- package/dist/fleets/index.js.map +1 -1
- package/dist/fleets/movement-arithmetic.d.ts.map +1 -1
- package/dist/fleets/movement-arithmetic.js +4 -0
- package/dist/fleets/movement-arithmetic.js.map +1 -1
- package/dist/fleets/subwarp-estimate.d.ts +3 -1
- package/dist/fleets/subwarp-estimate.d.ts.map +1 -1
- package/dist/fleets/subwarp-estimate.js +3 -1
- package/dist/fleets/subwarp-estimate.js.map +1 -1
- package/dist/fleets/warp-lane-policy.d.ts +13 -7
- package/dist/fleets/warp-lane-policy.d.ts.map +1 -1
- package/dist/fleets/warp-lane-policy.js +19 -7
- package/dist/fleets/warp-lane-policy.js.map +1 -1
- 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 +2 -1
- package/dist/identity/actions/index.d.ts.map +1 -1
- package/dist/identity/actions/index.js +6 -4
- 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 +62 -2
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +63 -12
- package/dist/identity/index.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- 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/career-xp.d.ts +58 -0
- package/dist/internal/c4/career-xp.d.ts.map +1 -0
- package/dist/internal/c4/career-xp.js +80 -0
- package/dist/internal/c4/career-xp.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.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 -0
- package/dist/internal/c4/claim-stake-definitions.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake-definitions.js +6 -2
- 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-standing.d.ts +80 -0
- package/dist/internal/c4/claim-stake-standing.d.ts.map +1 -0
- package/dist/internal/c4/claim-stake-standing.js +61 -0
- package/dist/internal/c4/claim-stake-standing.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 +9 -6
- package/dist/internal/c4/claim-stake.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake.js +24 -56
- 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 -55
- package/dist/internal/c4/combat.d.ts.map +1 -1
- package/dist/internal/c4/combat.js +16 -180
- package/dist/internal/c4/combat.js.map +1 -1
- 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 +9 -1
- package/dist/internal/c4/crafting.d.ts.map +1 -1
- package/dist/internal/c4/crafting.js +38 -98
- package/dist/internal/c4/crafting.js.map +1 -1
- package/dist/internal/c4/currency-cache.d.ts +1 -1
- package/dist/internal/c4/currency-cache.d.ts.map +1 -1
- package/dist/internal/c4/currency-cache.js +6 -9
- package/dist/internal/c4/currency-cache.js.map +1 -1
- package/dist/internal/c4/discriminators.d.ts +93 -0
- package/dist/internal/c4/discriminators.d.ts.map +1 -0
- package/dist/internal/c4/discriminators.js +190 -0
- package/dist/internal/c4/discriminators.js.map +1 -0
- package/dist/internal/c4/faction-epoch-meter.d.ts.map +1 -1
- package/dist/internal/c4/faction-epoch-meter.js +5 -10
- package/dist/internal/c4/faction-epoch-meter.js.map +1 -1
- package/dist/internal/c4/faction-treasury.d.ts.map +1 -1
- package/dist/internal/c4/faction-treasury.js +11 -18
- package/dist/internal/c4/faction-treasury.js.map +1 -1
- 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 +31 -3
- package/dist/internal/c4/factions.d.ts.map +1 -1
- package/dist/internal/c4/factions.js +103 -104
- package/dist/internal/c4/factions.js.map +1 -1
- package/dist/internal/c4/fleet-creation.d.ts +9 -2
- package/dist/internal/c4/fleet-creation.d.ts.map +1 -1
- package/dist/internal/c4/fleet-creation.js +15 -18
- package/dist/internal/c4/fleet-creation.js.map +1 -1
- package/dist/internal/c4/fleet-crew-binding.d.ts.map +1 -1
- package/dist/internal/c4/fleet-crew-binding.js +21 -49
- 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 +41 -0
- package/dist/internal/c4/fleet-disband.d.ts.map +1 -0
- package/dist/internal/c4/fleet-disband.js +86 -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-ship-assembly.d.ts +20 -5
- package/dist/internal/c4/fleet-ship-assembly.d.ts.map +1 -1
- package/dist/internal/c4/fleet-ship-assembly.js +62 -10
- package/dist/internal/c4/fleet-ship-assembly.js.map +1 -1
- 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 +20 -5
- package/dist/internal/c4/fleet.d.ts.map +1 -1
- package/dist/internal/c4/fleet.js +24 -84
- package/dist/internal/c4/fleet.js.map +1 -1
- package/dist/internal/c4/game.d.ts +76 -21
- package/dist/internal/c4/game.d.ts.map +1 -1
- package/dist/internal/c4/game.js +127 -116
- package/dist/internal/c4/game.js.map +1 -1
- package/dist/internal/c4/identity.d.ts +2 -153
- 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 +4 -6
- package/dist/internal/c4/local-market-order.d.ts.map +1 -1
- package/dist/internal/c4/local-market-order.js +5 -6
- package/dist/internal/c4/local-market-order.js.map +1 -1
- 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 +7 -3
- package/dist/internal/c4/loyalty.d.ts.map +1 -1
- package/dist/internal/c4/loyalty.js +41 -130
- 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 +3 -0
- package/dist/internal/c4/market.d.ts.map +1 -1
- package/dist/internal/c4/market.js +20 -76
- package/dist/internal/c4/market.js.map +1 -1
- package/dist/internal/c4/mining-instructions.d.ts +1 -1
- package/dist/internal/c4/mining-instructions.d.ts.map +1 -1
- package/dist/internal/c4/mining-instructions.js +1 -1
- package/dist/internal/c4/mining-instructions.js.map +1 -1
- package/dist/internal/c4/open-signal.d.ts +1 -1
- package/dist/internal/c4/open-signal.d.ts.map +1 -1
- package/dist/internal/c4/open-signal.js +1 -1
- package/dist/internal/c4/open-signal.js.map +1 -1
- package/dist/internal/c4/pda.d.ts +49 -1
- package/dist/internal/c4/pda.d.ts.map +1 -1
- package/dist/internal/c4/pda.js +122 -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 +16 -1
- package/dist/internal/c4/profile-permissions.js.map +1 -1
- package/dist/internal/c4/rewards.d.ts +1 -34
- package/dist/internal/c4/rewards.d.ts.map +1 -1
- package/dist/internal/c4/rewards.js +23 -170
- package/dist/internal/c4/rewards.js.map +1 -1
- package/dist/internal/c4/runtime-bindings.d.ts +2 -1
- package/dist/internal/c4/runtime-bindings.d.ts.map +1 -1
- package/dist/internal/c4/runtime-bindings.js +1 -1
- package/dist/internal/c4/runtime-bindings.js.map +1 -1
- package/dist/internal/c4/scan-lifecycle.d.ts +21 -3
- package/dist/internal/c4/scan-lifecycle.d.ts.map +1 -1
- package/dist/internal/c4/scan-lifecycle.js +35 -44
- package/dist/internal/c4/scan-lifecycle.js.map +1 -1
- 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 +3 -13
- package/dist/internal/c4/scanning.d.ts.map +1 -1
- package/dist/internal/c4/scanning.js +25 -75
- package/dist/internal/c4/scanning.js.map +1 -1
- package/dist/internal/c4/ship-stats.d.ts.map +1 -1
- package/dist/internal/c4/ship-stats.js +24 -26
- package/dist/internal/c4/ship-stats.js.map +1 -1
- package/dist/internal/c4/starbase.d.ts.map +1 -1
- package/dist/internal/c4/starbase.js +24 -96
- 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 +6 -2
- package/dist/internal/c4/world.d.ts.map +1 -1
- package/dist/internal/c4/world.js +32 -107
- package/dist/internal/c4/world.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 -3
- package/dist/internal/fleet.d.ts.map +1 -1
- package/dist/internal/fleet.js +1 -5
- package/dist/internal/fleet.js.map +1 -1
- package/dist/internal/loyalty-atlas-bank-state.d.ts +3 -2
- package/dist/internal/loyalty-atlas-bank-state.d.ts.map +1 -1
- package/dist/internal/loyalty-atlas-bank-state.js +4 -3
- package/dist/internal/loyalty-atlas-bank-state.js.map +1 -1
- 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/arrival-guards.d.ts +0 -1
- package/dist/internal/planning/arrival-guards.d.ts.map +1 -1
- package/dist/internal/planning/arrival-guards.js +3 -18
- package/dist/internal/planning/arrival-guards.js.map +1 -1
- package/dist/internal/planning/authorization-adapter.d.ts +59 -36
- package/dist/internal/planning/authorization-adapter.d.ts.map +1 -1
- package/dist/internal/planning/authorization-adapter.js +165 -71
- 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.map +1 -1
- package/dist/internal/planning/character-registration-guard.js +2 -1
- package/dist/internal/planning/character-registration-guard.js.map +1 -1
- package/dist/internal/planning/character-registration.d.ts.map +1 -1
- package/dist/internal/planning/character-registration.js +2 -1
- package/dist/internal/planning/character-registration.js.map +1 -1
- 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 +3 -1
- package/dist/internal/planning/currency-cache-guard.d.ts.map +1 -1
- package/dist/internal/planning/currency-cache-guard.js +47 -2
- package/dist/internal/planning/currency-cache-guard.js.map +1 -1
- package/dist/internal/planning/democracy-history.d.ts.map +1 -1
- package/dist/internal/planning/democracy-history.js +6 -15
- package/dist/internal/planning/democracy-history.js.map +1 -1
- 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 -2
- package/dist/internal/planning/faction-enrollment.d.ts.map +1 -1
- package/dist/internal/planning/faction-enrollment.js +0 -9
- package/dist/internal/planning/faction-enrollment.js.map +1 -1
- package/dist/internal/planning/fleet-arrival.d.ts.map +1 -1
- package/dist/internal/planning/fleet-arrival.js +10 -8
- package/dist/internal/planning/fleet-arrival.js.map +1 -1
- package/dist/internal/planning/fleet-attack-xp.d.ts.map +1 -1
- package/dist/internal/planning/fleet-attack-xp.js +5 -11
- package/dist/internal/planning/fleet-attack-xp.js.map +1 -1
- package/dist/internal/planning/fleet-creation.d.ts.map +1 -1
- package/dist/internal/planning/fleet-creation.js +17 -36
- package/dist/internal/planning/fleet-creation.js.map +1 -1
- package/dist/internal/planning/fleet-crew-guard.d.ts +2 -1
- package/dist/internal/planning/fleet-crew-guard.d.ts.map +1 -1
- package/dist/internal/planning/fleet-crew-guard.js +2 -1
- package/dist/internal/planning/fleet-crew-guard.js.map +1 -1
- package/dist/internal/planning/fleet-crew-transfer.d.ts +1 -1
- package/dist/internal/planning/fleet-crew-transfer.d.ts.map +1 -1
- package/dist/internal/planning/fleet-crew-transfer.js +45 -24
- package/dist/internal/planning/fleet-crew-transfer.js.map +1 -1
- 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 +3 -3
- package/dist/internal/planning/fleet-dock-funding-guard.d.ts.map +1 -1
- package/dist/internal/planning/fleet-dock-funding-guard.js +87 -96
- package/dist/internal/planning/fleet-dock-funding-guard.js.map +1 -1
- package/dist/internal/planning/fleet-dock-funding.d.ts.map +1 -1
- package/dist/internal/planning/fleet-dock-funding.js +10 -0
- package/dist/internal/planning/fleet-dock-funding.js.map +1 -1
- package/dist/internal/planning/fleet-docking-guard.d.ts.map +1 -1
- package/dist/internal/planning/fleet-docking-guard.js +3 -1
- package/dist/internal/planning/fleet-docking-guard.js.map +1 -1
- package/dist/internal/planning/fleet-docking.d.ts +17 -2
- package/dist/internal/planning/fleet-docking.d.ts.map +1 -1
- package/dist/internal/planning/fleet-docking.js +83 -62
- package/dist/internal/planning/fleet-docking.js.map +1 -1
- 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.map +1 -1
- package/dist/internal/planning/fleet-respawn.js +10 -12
- package/dist/internal/planning/fleet-respawn.js.map +1 -1
- package/dist/internal/planning/fleet-ship-assembly.d.ts +2 -0
- package/dist/internal/planning/fleet-ship-assembly.d.ts.map +1 -1
- package/dist/internal/planning/fleet-ship-assembly.js +94 -64
- package/dist/internal/planning/fleet-ship-assembly.js.map +1 -1
- 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.map +1 -1
- package/dist/internal/planning/governance-fees.js +7 -15
- package/dist/internal/planning/governance-fees.js.map +1 -1
- package/dist/internal/planning/local-market-order-funding.d.ts.map +1 -1
- package/dist/internal/planning/local-market-order-funding.js +4 -2
- package/dist/internal/planning/local-market-order-funding.js.map +1 -1
- package/dist/internal/planning/local-market-order.d.ts +4 -4
- package/dist/internal/planning/local-market-order.d.ts.map +1 -1
- package/dist/internal/planning/local-market-order.js +82 -109
- package/dist/internal/planning/local-market-order.js.map +1 -1
- 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.map +1 -1
- package/dist/internal/planning/mining-stop.js +2 -1
- package/dist/internal/planning/mining-stop.js.map +1 -1
- 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-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.map +1 -1
- package/dist/internal/planning/movement-xp-guard.js +3 -2
- package/dist/internal/planning/movement-xp-guard.js.map +1 -1
- package/dist/internal/planning/open-signal-guard.d.ts.map +1 -1
- package/dist/internal/planning/open-signal-guard.js +2 -1
- package/dist/internal/planning/open-signal-guard.js.map +1 -1
- package/dist/internal/planning/open-signal.d.ts.map +1 -1
- package/dist/internal/planning/open-signal.js +16 -7
- package/dist/internal/planning/open-signal.js.map +1 -1
- 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 +184 -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 +4 -1
- package/dist/internal/planning/recipe-state.d.ts.map +1 -1
- package/dist/internal/planning/recipe-state.js +7 -4
- package/dist/internal/planning/recipe-state.js.map +1 -1
- 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/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.js +2 -1
- package/dist/internal/planning/respawn-guards.js.map +1 -1
- package/dist/internal/planning/runtime-guards.d.ts +0 -2
- package/dist/internal/planning/runtime-guards.d.ts.map +1 -1
- package/dist/internal/planning/runtime-guards.js +49 -29
- package/dist/internal/planning/runtime-guards.js.map +1 -1
- package/dist/internal/planning/scan-completion-guard.d.ts +6 -6
- package/dist/internal/planning/scan-completion-guard.d.ts.map +1 -1
- package/dist/internal/planning/scan-completion-guard.js +8 -7
- package/dist/internal/planning/scan-completion-guard.js.map +1 -1
- package/dist/internal/planning/scan-completion.d.ts.map +1 -1
- package/dist/internal/planning/scan-completion.js +9 -7
- package/dist/internal/planning/scan-completion.js.map +1 -1
- package/dist/internal/planning/scan-detect-guard.d.ts +1 -1
- package/dist/internal/planning/scan-detect-guard.d.ts.map +1 -1
- package/dist/internal/planning/scan-detect-guard.js +2 -2
- package/dist/internal/planning/scan-detect-guard.js.map +1 -1
- package/dist/internal/planning/scan-detect.d.ts +1 -1
- package/dist/internal/planning/scan-detect.d.ts.map +1 -1
- package/dist/internal/planning/scan-detect.js +10 -8
- package/dist/internal/planning/scan-detect.js.map +1 -1
- 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-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.js +3 -2
- package/dist/internal/planning/ship-import-funding.js.map +1 -1
- package/dist/internal/planning/ship-token.d.ts +1 -5
- package/dist/internal/planning/ship-token.d.ts.map +1 -1
- package/dist/internal/planning/ship-token.js +0 -36
- 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-player-recovery-guard.d.ts +7 -0
- package/dist/internal/planning/starbase-player-recovery-guard.d.ts.map +1 -0
- package/dist/internal/planning/starbase-player-recovery-guard.js +39 -0
- package/dist/internal/planning/starbase-player-recovery-guard.js.map +1 -0
- package/dist/internal/planning/starbase-system-guard.d.ts.map +1 -1
- package/dist/internal/planning/starbase-system-guard.js +2 -1
- package/dist/internal/planning/starbase-system-guard.js.map +1 -1
- package/dist/internal/planning/starbase-system.d.ts +5 -2
- package/dist/internal/planning/starbase-system.d.ts.map +1 -1
- package/dist/internal/planning/starbase-system.js +6 -3
- package/dist/internal/planning/starbase-system.js.map +1 -1
- 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.map +1 -1
- package/dist/internal/planning/trade-faction-market.js +4 -4
- package/dist/internal/planning/trade-faction-market.js.map +1 -1
- 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.map +1 -1
- package/dist/internal/planning/xp-runtime.js +16 -20
- package/dist/internal/planning/xp-runtime.js.map +1 -1
- 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/loyalty/actions/index.d.ts +1 -1
- package/dist/loyalty/actions/index.d.ts.map +1 -1
- package/dist/loyalty/actions/index.js +12 -43
- 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 +19 -27
- package/dist/loyalty/index.js.map +1 -1
- package/dist/markets/actions/index.d.ts +1 -1
- package/dist/markets/actions/index.d.ts.map +1 -1
- package/dist/markets/actions/index.js +140 -178
- package/dist/markets/actions/index.js.map +1 -1
- package/dist/markets/actions/trade-faction-market.d.ts +4 -2
- package/dist/markets/actions/trade-faction-market.d.ts.map +1 -1
- package/dist/markets/actions/trade-faction-market.js +59 -39
- package/dist/markets/actions/trade-faction-market.js.map +1 -1
- package/dist/markets/index.d.ts.map +1 -1
- package/dist/markets/index.js +3 -11
- package/dist/markets/index.js.map +1 -1
- package/dist/mining/actions/index.d.ts +1 -1
- package/dist/mining/actions/index.d.ts.map +1 -1
- package/dist/mining/actions/index.js +84 -47
- package/dist/mining/actions/index.js.map +1 -1
- package/dist/mining/estimate-input.d.ts +103 -0
- package/dist/mining/estimate-input.d.ts.map +1 -0
- package/dist/mining/estimate-input.js +86 -0
- package/dist/mining/estimate-input.js.map +1 -0
- package/dist/mining/index.d.ts +1 -0
- package/dist/mining/index.d.ts.map +1 -1
- package/dist/mining/index.js +4 -11
- package/dist/mining/index.js.map +1 -1
- package/dist/planning/assembly.d.ts +1 -1
- package/dist/planning/assembly.d.ts.map +1 -1
- package/dist/planning/assembly.js +6 -30
- package/dist/planning/assembly.js.map +1 -1
- package/dist/planning/execution.d.ts +1 -0
- package/dist/planning/execution.d.ts.map +1 -1
- package/dist/planning/execution.js +149 -45
- package/dist/planning/execution.js.map +1 -1
- package/dist/planning/index.d.ts +70 -7
- package/dist/planning/index.d.ts.map +1 -1
- package/dist/planning/index.js +28 -1141
- 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-execution.d.ts.map +1 -1
- package/dist/planning/plan-sequence-execution.js +1 -11
- package/dist/planning/plan-sequence-execution.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 +147 -0
- package/dist/planning/plan-validation.js.map +1 -0
- package/dist/registry/cargo.d.ts +2 -2
- package/dist/registry/cargo.d.ts.map +1 -1
- package/dist/registry/cargo.js +3 -4
- package/dist/registry/cargo.js.map +1 -1
- package/dist/registry/definition-section-snapshot.d.ts +1 -1
- package/dist/registry/definition-section-snapshot.d.ts.map +1 -1
- package/dist/registry/definition-section-snapshot.js +10 -3
- package/dist/registry/definition-section-snapshot.js.map +1 -1
- package/dist/registry/index.d.ts +31 -4
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +226 -227
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/onboarding.d.ts.map +1 -1
- package/dist/registry/onboarding.js +4 -2
- package/dist/registry/onboarding.js.map +1 -1
- package/dist/registry/ship-stats-snapshot.d.ts.map +1 -1
- package/dist/registry/ship-stats-snapshot.js +19 -5
- package/dist/registry/ship-stats-snapshot.js.map +1 -1
- package/dist/registry/ships.js +1 -1
- package/dist/registry/ships.js.map +1 -1
- 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 +1 -1
- package/dist/scanning/actions/index.d.ts.map +1 -1
- package/dist/scanning/actions/index.js +38 -8
- package/dist/scanning/actions/index.js.map +1 -1
- package/dist/scanning/index.d.ts +6 -11
- package/dist/scanning/index.d.ts.map +1 -1
- package/dist/scanning/index.js +7 -15
- package/dist/scanning/index.js.map +1 -1
- package/dist/scanning/odds.d.ts +5 -1
- package/dist/scanning/odds.d.ts.map +1 -1
- package/dist/scanning/odds.js.map +1 -1
- package/dist/scanning/signals.d.ts +6 -1
- package/dist/scanning/signals.d.ts.map +1 -1
- package/dist/scanning/signals.js +3 -1
- package/dist/scanning/signals.js.map +1 -1
- package/dist/starbases/actions/index.d.ts +49 -4
- package/dist/starbases/actions/index.d.ts.map +1 -1
- package/dist/starbases/actions/index.js +120 -69
- package/dist/starbases/actions/index.js.map +1 -1
- package/dist/starbases/index.d.ts +18 -0
- package/dist/starbases/index.d.ts.map +1 -1
- package/dist/starbases/index.js +24 -11
- package/dist/starbases/index.js.map +1 -1
- package/dist/world/index.d.ts +87 -13
- package/dist/world/index.d.ts.map +1 -1
- package/dist/world/index.js +88 -22
- package/dist/world/index.js.map +1 -1
- package/dist/world/planet-claim-stake-plots.d.ts +49 -40
- package/dist/world/planet-claim-stake-plots.d.ts.map +1 -1
- package/dist/world/planet-claim-stake-plots.js +47 -40
- package/dist/world/planet-claim-stake-plots.js.map +1 -1
- package/dist/world/starbase-status.d.ts +54 -13
- package/dist/world/starbase-status.d.ts.map +1 -1
- package/dist/world/starbase-status.js +65 -0
- package/dist/world/starbase-status.js.map +1 -1
- package/package.json +2 -2
- package/dist/internal/c4/faction-adapter.d.ts +0 -12
- package/dist/internal/c4/faction-adapter.d.ts.map +0 -1
- package/dist/internal/c4/faction-adapter.js +0 -52
- package/dist/internal/c4/faction-adapter.js.map +0 -1
- package/dist/internal/planning/movement-character.d.ts +0 -7
- package/dist/internal/planning/movement-character.d.ts.map +0 -1
- package/dist/internal/planning/movement-character.js +0 -41
- package/dist/internal/planning/movement-character.js.map +0 -1
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
import { fleetAttackInstructionKey, validateFleetAttackActors, } from '../../internal/planning/fleet-attack-xp.js';
|
|
2
2
|
import { resolveXpRuntime } from '../../internal/planning/xp-runtime.js';
|
|
3
|
-
import {
|
|
3
|
+
import { hashRegionAccess, regionsContainingSystem, } from '../../internal/planning/region-access.js';
|
|
4
|
+
import { isAddress } from '@solana/kit';
|
|
5
|
+
import { requireDisabledLevelRent } from '../../internal/planning/rent-catalog.js';
|
|
4
6
|
import { resolveActionRuntime } from '../../internal/planning/action-runtime.js';
|
|
5
7
|
import { InvalidActionInputError, SageSdkError } from '../../client/errors.js';
|
|
6
8
|
import { readContextRawAccounts } from '../../client/reconciliation.js';
|
|
7
|
-
import {
|
|
8
|
-
import { lootAccountDefinition, } from '../../internal/c4/
|
|
9
|
+
import { getRetrieveLootInstructionDataEncoder } from '../../internal/c4/runtime-bindings.js';
|
|
10
|
+
import { lootAccountDefinition, } from '../../internal/c4/loot.js';
|
|
9
11
|
import { deriveFleetAddress, fleetAccountDefinition, } from '../../internal/c4/fleet.js';
|
|
10
12
|
import { deriveFleetCrewBindingAddress, fleetCrewBindingAccountDefinition, matchesFleetCrewBindingIdentity, } from '../../internal/c4/fleet-crew-binding.js';
|
|
11
13
|
import { deriveFactionAccountAddress, deriveFactionEconomicsConfigAddress, deriveFactionOwnershipAddress, deriveFactionRelationTrackerAddress, deriveFactionTreasuryAddress, deriveKingSystemTrackerAddress, deriveRegionTrackerAddress, factionAccountDefinition, factionEconomicsConfigAccountDefinition, factionOwnershipAccountDefinition, factionRelationTrackerAccountDefinition, factionTreasuryAccountDefinition, kingSystemTrackerAccountDefinition, regionTrackerAccountDefinition, } from '../../internal/c4/factions.js';
|
|
12
|
-
import {
|
|
14
|
+
import { factionValue } from '../../internal/c4/faction.js';
|
|
15
|
+
import { characterAccountDefinition, findCharacterPda, } from '../../internal/c4/character.js';
|
|
13
16
|
import { deriveLoyaltyContributionAddress, deriveLoyaltyEpochAddress, loyaltyContributionAccountDefinition, loyaltyEpochAccountDefinition, } from '../../internal/c4/loyalty.js';
|
|
14
17
|
import { atlasRewardConfigAccountDefinition, atlasRewardRegistryAccountDefinition, deriveAtlasRewardConfigAddress, deriveAtlasRewardRegistryAddress, } from '../../internal/c4/rewards.js';
|
|
15
18
|
import { deriveStarSystemAddress, starSystemAccountDefinition, } from '../../internal/c4/world.js';
|
|
16
19
|
import { requireGameAddress } from '../../internal/game-context.js';
|
|
17
|
-
import { adaptApplyCombatStimulantInstruction, adaptAttackFleetInstruction, adaptAttackStarbaseInstruction, adaptRetrieveLootInstruction,
|
|
18
|
-
import {
|
|
20
|
+
import { adaptApplyCombatStimulantInstruction, adaptAttackFleetInstruction, adaptAttackStarbaseInstruction, adaptRetrieveLootInstruction, readPlanAuthorization, } from '../../internal/planning/authorization-adapter.js';
|
|
21
|
+
import { buildPlannerPlan } from '../../planning/plan-construction.js';
|
|
19
22
|
import { readGameCombatConfiguration } from '../../registry/combat.js';
|
|
23
|
+
import { CLOCK_ADDRESS, readClock, } from '../../internal/planning/faction-enrollment.js';
|
|
20
24
|
import { resolveCargo, } from '../../registry/index.js';
|
|
25
|
+
import { accountAbsentPrecondition, accountStatePrecondition, } from '../../internal/planning/account-state.js';
|
|
26
|
+
import { stimulantStatId } from '../../internal/c4/stimulant.js';
|
|
27
|
+
import { readCombatStorageAction } from '../../internal/planning/combat-storage-actions.js';
|
|
28
|
+
import { RENT_ADDRESS } from '../../internal/planning/rent.js';
|
|
29
|
+
import { planStorageFunding } from '../../internal/planning/storage-actions.js';
|
|
21
30
|
function invalid(field, value, acceptedRange, remedy) {
|
|
22
31
|
throw new InvalidActionInputError(field, value, acceptedRange, remedy);
|
|
23
32
|
}
|
|
@@ -38,19 +47,13 @@ function assertKeys(value, field, required, optional = []) {
|
|
|
38
47
|
function validateOptions(value) {
|
|
39
48
|
const options = readRecord(value, 'options');
|
|
40
49
|
assertKeys(options, 'options', ['authorization']);
|
|
41
|
-
const
|
|
42
|
-
assertKeys(authorizationRecord, 'authorization', ['profile', 'authority', 'keyIndex'], ['certificate']);
|
|
43
|
-
const authorization = authorizationRecord;
|
|
44
|
-
validatePlanAuthorization(authorization);
|
|
50
|
+
const authorization = readPlanAuthorization(options.authorization);
|
|
45
51
|
return { authorization };
|
|
46
52
|
}
|
|
47
53
|
function validateAttackOptions(value) {
|
|
48
54
|
const options = readRecord(value, 'options');
|
|
49
55
|
assertKeys(options, 'options', ['authorization', 'loot']);
|
|
50
|
-
const
|
|
51
|
-
assertKeys(authorizationRecord, 'authorization', ['profile', 'authority', 'keyIndex'], ['certificate']);
|
|
52
|
-
const authorization = authorizationRecord;
|
|
53
|
-
validatePlanAuthorization(authorization);
|
|
56
|
+
const authorization = readPlanAuthorization(options.authorization);
|
|
54
57
|
if (typeof options.loot !== 'string' || !isAddress(options.loot)) {
|
|
55
58
|
invalid('options.loot', options.loot, 'one valid new Loot account address', 'Generate a new address-only Loot signer and provide its public address before retrying.');
|
|
56
59
|
}
|
|
@@ -69,10 +72,7 @@ function validateAttackStance(value) {
|
|
|
69
72
|
function validateRetrieveOptions(value) {
|
|
70
73
|
const options = readRecord(value, 'options');
|
|
71
74
|
assertKeys(options, 'options', ['authorization', 'atUnixSeconds']);
|
|
72
|
-
const
|
|
73
|
-
assertKeys(authorizationRecord, 'authorization', ['profile', 'authority', 'keyIndex'], ['certificate']);
|
|
74
|
-
const authorization = authorizationRecord;
|
|
75
|
-
validatePlanAuthorization(authorization);
|
|
75
|
+
const authorization = readPlanAuthorization(options.authorization);
|
|
76
76
|
if (typeof options.atUnixSeconds !== 'bigint' || options.atUnixSeconds < 0n) {
|
|
77
77
|
invalid('options.atUnixSeconds', options.atUnixSeconds, 'a non-negative bigint Unix timestamp', 'Provide the explicit current Unix timestamp used to evaluate Loot exclusivity before retrying.');
|
|
78
78
|
}
|
|
@@ -122,13 +122,21 @@ function validateLootSelection(value, loot, fleet, retrievingProfile, atUnixSeco
|
|
|
122
122
|
if (item === undefined) {
|
|
123
123
|
invalid(`${field}.itemIndex`, itemIndex, `an available Loot item index below ${String(loot.items.length)}`, 'Refresh the Loot snapshot and select an existing item before retrying.');
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
// The retriever is the Fleet's controlling Profile. Reward cargo stays
|
|
126
|
+
// locked to the destroying Profile until it expires and is swept; ordinary
|
|
127
|
+
// cargo is exclusive to the destroying Profile only until the unlock time.
|
|
128
|
+
const destroyer = item.destroyer?.address;
|
|
129
|
+
if (item.rewardReclaimAtUnixSeconds > 0n) {
|
|
130
|
+
if (destroyer !== retrievingProfile) {
|
|
131
|
+
fail(`Loot item ${String(itemIndex)} is reward cargo locked to ${destroyer === undefined ? 'no destroying Profile' : `destroying Profile ${destroyer}`}, not Profile ${retrievingProfile}. Reward cargo never opens to other Profiles; it is swept after ${String(item.rewardReclaimAtUnixSeconds)} Unix seconds. Choose another item or use the destroying Profile's Fleet before retrying.`, loot.address);
|
|
132
|
+
}
|
|
133
|
+
if (atUnixSeconds > item.rewardReclaimAtUnixSeconds) {
|
|
134
|
+
fail(`Loot item ${String(itemIndex)} reward cargo expired at ${String(item.rewardReclaimAtUnixSeconds)} Unix seconds and is swept to the reward treasury, not retrievable at ${String(atUnixSeconds)}. Choose another item or refresh the Loot before retrying.`, loot.address);
|
|
135
|
+
}
|
|
128
136
|
}
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
fail(`Loot item ${String(itemIndex)}
|
|
137
|
+
else if (atUnixSeconds < item.exclusivityUnlockAtUnixSeconds &&
|
|
138
|
+
destroyer !== retrievingProfile) {
|
|
139
|
+
fail(`Loot item ${String(itemIndex)} is exclusive to ${destroyer === undefined ? 'no Profile (a Starbase kill)' : `destroying Profile ${destroyer}`} until ${String(item.exclusivityUnlockAtUnixSeconds)} Unix seconds, not Profile ${retrievingProfile}. Use the destroying Profile's Fleet or wait for the exclusivity window to pass before retrying.`, loot.address);
|
|
132
140
|
}
|
|
133
141
|
const cargoRequests = denseArray(target.cargo, `${field}.cargo`);
|
|
134
142
|
if (cargoRequests.length === 0 || cargoRequests.length > 65_536) {
|
|
@@ -165,9 +173,7 @@ function validateLootSelection(value, loot, fleet, retrievingProfile, atUnixSeco
|
|
|
165
173
|
}
|
|
166
174
|
generated.push([itemIndex, encoded]);
|
|
167
175
|
}
|
|
168
|
-
const instructionDataLength =
|
|
169
|
-
.getRetrieveLootInstructionDataEncoder()
|
|
170
|
-
.encode({
|
|
176
|
+
const instructionDataLength = getRetrieveLootInstructionDataEncoder().encode({
|
|
171
177
|
keyIndex: 0,
|
|
172
178
|
want: generated.map(([itemIndex, cargo]) => [
|
|
173
179
|
itemIndex,
|
|
@@ -187,7 +193,7 @@ function requireAccount(account, address, message) {
|
|
|
187
193
|
}
|
|
188
194
|
function stimulantFingerprint(stimulant) {
|
|
189
195
|
const effects = stimulant.effects
|
|
190
|
-
.map(({ charges, deltaBps,
|
|
196
|
+
.map(({ charges, deltaBps, stackRule, stat }) => `${String(charges)}:${String(deltaBps)}:${stackRule}:${stat}`)
|
|
191
197
|
.join(',');
|
|
192
198
|
return [
|
|
193
199
|
stimulant.cargo.id,
|
|
@@ -212,35 +218,14 @@ function rawCargoFingerprint(fleet) {
|
|
|
212
218
|
.join(',');
|
|
213
219
|
return [fleet.cargoHold.seqId, fleet.cargoHold.storageCost, items].join('|');
|
|
214
220
|
}
|
|
215
|
-
async function hashAccountState(account) {
|
|
216
|
-
const owner = getAddressEncoder().encode(account.owner);
|
|
217
|
-
const canonical = new Uint8Array(owner.length + account.data.length);
|
|
218
|
-
canonical.set(owner);
|
|
219
|
-
canonical.set(account.data, owner.length);
|
|
220
|
-
const digest = new Uint8Array(await globalThis.crypto.subtle.digest('SHA-256', canonical));
|
|
221
|
-
return [...digest].map((byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
222
|
-
}
|
|
223
|
-
async function precondition(account, describes) {
|
|
224
|
-
return Object.freeze({
|
|
225
|
-
address: account.address,
|
|
226
|
-
dataHash: await hashAccountState(account),
|
|
227
|
-
describes,
|
|
228
|
-
kind: 'account-state',
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
function absentPrecondition(address, describes) {
|
|
232
|
-
return Object.freeze({
|
|
233
|
-
address,
|
|
234
|
-
describes,
|
|
235
|
-
kind: 'account-absent',
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
221
|
/** Plans application of one configured combat stimulant without predicting its effects.
|
|
239
222
|
*
|
|
240
223
|
* The planner validates Fleet ownership and Game membership, current catalog
|
|
241
|
-
* membership, known cargo balance, crewed
|
|
242
|
-
* whole-account Fleet state.
|
|
243
|
-
*
|
|
224
|
+
* membership, known cargo balance, a crewed Fleet that is neither destroyed
|
|
225
|
+
* nor respawning, and fresh whole-account Fleet state. Only stimulants whose
|
|
226
|
+
* effects use the `refresh` stack rule are planned, as the game applies no
|
|
227
|
+
* other rule yet. Permission, charge application, and combat arithmetic remain
|
|
228
|
+
* chain-authoritative.
|
|
244
229
|
*
|
|
245
230
|
* @example
|
|
246
231
|
* ```ts
|
|
@@ -266,8 +251,13 @@ export async function planFleetApplyCombatStimulant(ctx, fleet, stimulant, input
|
|
|
266
251
|
if (fleet.game !== game) {
|
|
267
252
|
fail(`Fleet ${fleet.address} belongs to Game ${fleet.game}, not configured Game ${game}. Refresh the Fleet through this context and retry.`, fleet.address);
|
|
268
253
|
}
|
|
269
|
-
if (fleet.state.kind === 'destroyed') {
|
|
270
|
-
fail(`Fleet ${fleet.name} (${fleet.address}) is
|
|
254
|
+
if (fleet.state.kind === 'destroyed' || fleet.state.kind === 'respawn') {
|
|
255
|
+
fail(`Fleet ${fleet.name} (${fleet.address}) is ${fleet.state.kind} and cannot apply a combat stimulant. Wait until it is back at a Starbase, refresh it, and retry.`, fleet.address);
|
|
256
|
+
}
|
|
257
|
+
// The game applies only refresh-rule effects and refuses the others.
|
|
258
|
+
const unsupported = stimulant.effects.find(({ stackRule }) => stackRule !== 'refresh');
|
|
259
|
+
if (unsupported !== undefined) {
|
|
260
|
+
fail(`Stimulant ${stimulant.cargo.name} has a ${unsupported.stackRule} effect on ${unsupported.stat}; the game applies only refresh effects. Choose another stimulant.`, fleet.address);
|
|
271
261
|
}
|
|
272
262
|
const combat = await readGameCombatConfiguration(ctx);
|
|
273
263
|
const definitions = await Promise.all(combat.data.stimulantDefinitions.definitions.map(async (definition) => ({
|
|
@@ -313,41 +303,32 @@ export async function planFleetApplyCombatStimulant(ctx, fleet, stimulant, input
|
|
|
313
303
|
if (current.crewCount <= 0) {
|
|
314
304
|
fail(`Fleet ${fleet.name} (${fleet.address}) has no crew and cannot apply a combat stimulant. Crew the Fleet, refresh it through this context, and retry.`, fleet.address);
|
|
315
305
|
}
|
|
316
|
-
const
|
|
317
|
-
|
|
306
|
+
const instruction = adaptApplyCombatStimulantInstruction({
|
|
307
|
+
authorization: options.authorization,
|
|
308
|
+
fleet: fleet.address,
|
|
309
|
+
game,
|
|
310
|
+
stimCargoId: catalogued.cargo.id,
|
|
311
|
+
});
|
|
312
|
+
// A stimulant for a stat without an entry grows the Fleet; the program funds
|
|
313
|
+
// that from the Profile vault with the signing key.
|
|
314
|
+
const storage = await planFleetStorage(ctx, instruction, [account.address], options.authorization.profile, 'combat stimulant', catalogued.effects.map(({ stat }) => stimulantStatId(stat)));
|
|
315
|
+
const description = `Apply one ${catalogued.cargo.name} combat stimulant from Fleet ${fleet.name} (${fleet.address}); permission, stacking, charge application, and combat outcomes remain chain-authoritative. ${storage.disclosure}`;
|
|
316
|
+
return buildPlannerPlan({
|
|
318
317
|
kind: 'combat.apply-stimulant',
|
|
319
318
|
preconditions: [
|
|
320
|
-
await
|
|
319
|
+
await accountStatePrecondition(account, `Fleet ${fleet.name} retains its configured Game, owning Profile, supported crewed state, and known ${catalogued.cargo.name} cargo balance.`),
|
|
320
|
+
storage.guard,
|
|
321
321
|
],
|
|
322
322
|
steps: [
|
|
323
323
|
{
|
|
324
324
|
describes: description,
|
|
325
|
-
instruction
|
|
326
|
-
authorization: options.authorization,
|
|
327
|
-
fleet: fleet.address,
|
|
328
|
-
game,
|
|
329
|
-
stimCargoId: catalogued.cargo.id,
|
|
330
|
-
}),
|
|
325
|
+
instruction,
|
|
331
326
|
signers: [options.authorization.authority],
|
|
332
327
|
},
|
|
333
328
|
],
|
|
334
329
|
summary: description,
|
|
335
330
|
});
|
|
336
331
|
}
|
|
337
|
-
function factionId(fleet) {
|
|
338
|
-
if (fleet.npcFactionId > 0)
|
|
339
|
-
return fleet.npcFactionId;
|
|
340
|
-
switch (fleet.faction) {
|
|
341
|
-
case 'mud':
|
|
342
|
-
return 1;
|
|
343
|
-
case 'oni':
|
|
344
|
-
return 2;
|
|
345
|
-
case 'ustur':
|
|
346
|
-
return 3;
|
|
347
|
-
case 'unaligned':
|
|
348
|
-
return 0;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
332
|
function shipFingerprint(fleet) {
|
|
352
333
|
return fleet.ships
|
|
353
334
|
.map(({ id, quantity }) => `${String(id)}:${String(quantity)}`)
|
|
@@ -403,6 +384,25 @@ async function validateCurrentAttackFleet(fleet, account) {
|
|
|
403
384
|
}
|
|
404
385
|
return currentAccount;
|
|
405
386
|
}
|
|
387
|
+
/** The program attacks only with an attacker that is Idle or subwarping at
|
|
388
|
+
* chain time (a finished warp counts as Idle), carries its required crew, and
|
|
389
|
+
* has usable AP: stored AP refills right after an attack, but stays unusable
|
|
390
|
+
* until the reload completes. */
|
|
391
|
+
function validateAttackerReadiness(fleet, account, clock) {
|
|
392
|
+
const now = readClock(requireAccount(clock, CLOCK_ADDRESS, 'The Clock sysvar is missing. Refresh chain time and retry the attack.'));
|
|
393
|
+
const current = fleetAccountDefinition.decode(account);
|
|
394
|
+
const label = `Attacking Fleet ${fleet.name} (${fleet.address})`;
|
|
395
|
+
const { state } = current;
|
|
396
|
+
if (state.kind !== 'idle' &&
|
|
397
|
+
state.kind !== 'subwarp' &&
|
|
398
|
+
!(state.kind === 'warp' && now >= state.arrivesAtUnixSeconds))
|
|
399
|
+
fail(`${label} is ${state.kind === 'warp' ? 'still warping' : state.kind}; only an Idle or subwarping Fleet can attack. Wait or move it into space, refresh the Fleet, and retry.`, fleet.address);
|
|
400
|
+
if (current.crewCount < current.stats.misc.requiredCrew)
|
|
401
|
+
fail(`${label} has ${String(current.crewCount)} crew but needs ${String(current.stats.misc.requiredCrew)} to attack. Load crew, refresh the Fleet, and retry.`, fleet.address);
|
|
402
|
+
// Zero stored AP is refused earlier, and the fresh account matches the snapshot.
|
|
403
|
+
if (now < current.apReloadExpiresAt)
|
|
404
|
+
fail(`${label} has no usable ability power at chain time ${String(now)}: stored AP ${String(current.ap)} with reload completing at ${String(current.apReloadExpiresAt)}. Wait for the reload, refresh the Fleet, and retry.`, fleet.address);
|
|
405
|
+
}
|
|
406
406
|
async function optionalCrewBinding(ctx, fleet) {
|
|
407
407
|
const address = await deriveFleetCrewBindingAddress(fleet.address);
|
|
408
408
|
const [envelope] = await ctx.data.readMany(fleetCrewBindingAccountDefinition, [address]);
|
|
@@ -413,7 +413,7 @@ async function optionalCrewBinding(ctx, fleet) {
|
|
|
413
413
|
return envelope?.address;
|
|
414
414
|
}
|
|
415
415
|
async function resolveRewardAccounts(ctx, fleet, registry, config, epochIndex) {
|
|
416
|
-
const resolvedFaction =
|
|
416
|
+
const resolvedFaction = fleet.npcFactionId > 0 ? fleet.npcFactionId : factionValue(fleet.faction);
|
|
417
417
|
if (resolvedFaction === 0)
|
|
418
418
|
return { config, registry };
|
|
419
419
|
const [epochAddress, contributionAddress] = await Promise.all([
|
|
@@ -448,35 +448,86 @@ async function resolveRewardAccounts(ctx, fleet, registry, config, epochIndex) {
|
|
|
448
448
|
registry,
|
|
449
449
|
};
|
|
450
450
|
}
|
|
451
|
-
|
|
451
|
+
/** Reads and requires an NPC Fleet's canonical FactionOwnership and, when
|
|
452
|
+
* `withFaction`, its Faction account; a player Fleet has neither. */
|
|
453
|
+
async function resolveNpcAccounts(ctx, fleet, withFaction) {
|
|
452
454
|
if (fleet.npcFactionId === 0)
|
|
453
455
|
return {};
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
+
const addresses = await Promise.all([
|
|
457
|
+
deriveFactionOwnershipAddress(fleet.game, 'fleet', fleet.address),
|
|
458
|
+
...(withFaction
|
|
459
|
+
? [deriveFactionAccountAddress(fleet.game, fleet.npcFactionId)]
|
|
460
|
+
: []),
|
|
461
|
+
]);
|
|
462
|
+
const [ownership, faction] = await readContextRawAccounts(ctx, addresses);
|
|
463
|
+
const ownershipData = ownership && factionOwnershipAccountDefinition.decode(ownership);
|
|
456
464
|
if (ownership === undefined ||
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
fail(`NPC Fleet ${fleet.address} has no matching canonical FactionOwnership for faction ${String(fleet.npcFactionId)}. Refresh the Fleet and faction ownership relationship before retrying.`,
|
|
462
|
-
}
|
|
463
|
-
if (!
|
|
464
|
-
return { ownership
|
|
465
|
-
const
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
fail(`Faction ${
|
|
470
|
-
}
|
|
471
|
-
return {
|
|
465
|
+
ownershipData?.game !== fleet.game ||
|
|
466
|
+
ownershipData.asset.kind !== 'fleet' ||
|
|
467
|
+
ownershipData.asset.fleet !== fleet.address ||
|
|
468
|
+
ownershipData.controllingFactionId !== fleet.npcFactionId) {
|
|
469
|
+
fail(`NPC Fleet ${fleet.address} has no matching canonical FactionOwnership for faction ${String(fleet.npcFactionId)}. Refresh the Fleet and faction ownership relationship before retrying.`, addresses[0]);
|
|
470
|
+
}
|
|
471
|
+
if (!withFaction)
|
|
472
|
+
return { ownership };
|
|
473
|
+
const factionData = faction && factionAccountDefinition.decode(faction);
|
|
474
|
+
if (faction === undefined ||
|
|
475
|
+
factionData?.game !== fleet.game ||
|
|
476
|
+
factionData.factionId !== fleet.npcFactionId) {
|
|
477
|
+
fail(`Faction ${addresses[1]} is missing or does not match NPC Fleet ${fleet.address}'s Game and faction id. Refresh the faction registry relationship before retrying.`, addresses[1]);
|
|
478
|
+
}
|
|
479
|
+
return { faction, ownership };
|
|
472
480
|
}
|
|
473
481
|
function generatedStance(stance) {
|
|
474
482
|
return {
|
|
475
483
|
ammoUsage: stance.ammoUsage === 'none' ? 0 : stance.ammoUsage === 'light' ? 1 : 2,
|
|
476
484
|
};
|
|
477
485
|
}
|
|
486
|
+
/** Requires a live Fleet snapshot of the configured Game with known AP, crew
|
|
487
|
+
* and ship composition; an attacking Fleet also needs AP available. */
|
|
488
|
+
function validateAttackFleet(fleet, role, game) {
|
|
489
|
+
const label = `The ${role} Fleet ${fleet.name} (${fleet.address})`;
|
|
490
|
+
if (fleet.game !== game) {
|
|
491
|
+
fail(`${label} belongs to Game ${fleet.game}, not configured Game ${game}. Refresh the Fleet through this context and retry.`, fleet.address);
|
|
492
|
+
}
|
|
493
|
+
if (fleet.state.kind === 'destroyed') {
|
|
494
|
+
fail(`${label} is destroyed and cannot participate in this attack. Refresh the Fleet after respawn and retry.`, fleet.address);
|
|
495
|
+
}
|
|
496
|
+
if (!Number.isSafeInteger(fleet.ap) ||
|
|
497
|
+
fleet.ap < 0 ||
|
|
498
|
+
!Number.isSafeInteger(fleet.crewCount) ||
|
|
499
|
+
fleet.crewCount <= 0) {
|
|
500
|
+
fail(`${label} has unknown or invalid AP or crew state. Refresh the Fleet through this context and retry.`, fleet.address);
|
|
501
|
+
}
|
|
502
|
+
if (fleet.ships.length === 0 ||
|
|
503
|
+
fleet.ships.some(({ quantity }) => quantity <= 0n)) {
|
|
504
|
+
fail(`${label} has no valid known ship composition. Refresh Fleet composition and retry.`, fleet.address);
|
|
505
|
+
}
|
|
506
|
+
if (role === 'attacking' && fleet.ap === 0) {
|
|
507
|
+
fail(`${label} has no known AP available. Wait for AP reload, refresh the Fleet, and retry.`, fleet.address);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
/** Validates the inputs every attack shares: the stance, an attacking Fleet
|
|
511
|
+
* owned by the authorization Profile that can attack, and a new Loot address
|
|
512
|
+
* distinct from the authorization signers. */
|
|
513
|
+
function validateAttack(ctx, attacker, inputStance, inputOptions) {
|
|
514
|
+
const options = validateAttackOptions(inputOptions);
|
|
515
|
+
const stance = validateAttackStance(inputStance);
|
|
516
|
+
const game = requireGameAddress(ctx);
|
|
517
|
+
if (attacker.ownerProfile.address !== options.authorization.profile) {
|
|
518
|
+
fail(`Attacking Fleet ${attacker.address} does not belong to authorization Profile ${options.authorization.profile}. Choose an owned Fleet and retry.`, attacker.address);
|
|
519
|
+
}
|
|
520
|
+
if (options.loot === options.authorization.authority ||
|
|
521
|
+
options.loot === options.authorization.profile) {
|
|
522
|
+
fail(`The new Loot address ${options.loot} must be distinct from the authorization authority and Profile. Generate a separate Loot signer address and retry.`, options.loot);
|
|
523
|
+
}
|
|
524
|
+
validateAttackFleet(attacker, 'attacking', game);
|
|
525
|
+
return { game, options, stance };
|
|
526
|
+
}
|
|
478
527
|
/** Plans one singleton Fleet-on-Fleet attack without predicting its outcome.
|
|
479
528
|
*
|
|
529
|
+
* At chain time the attacker must be Idle or subwarping (a finished warp
|
|
530
|
+
* counts as Idle), carry its required crew, and have finished reloading AP.
|
|
480
531
|
* Range, randomness, recent slot hashes, final combat arithmetic, and chain
|
|
481
532
|
* races remain authoritative. This Plan cannot be combined with another
|
|
482
533
|
* gameplay instruction because the generated program contract requires a
|
|
@@ -499,47 +550,16 @@ function generatedStance(stance) {
|
|
|
499
550
|
* ```
|
|
500
551
|
*/
|
|
501
552
|
export async function planFleetAttackFleet(ctx, attacker, defender, inputStance, inputOptions) {
|
|
502
|
-
const options =
|
|
503
|
-
const stance = validateAttackStance(inputStance);
|
|
504
|
-
const game = requireGameAddress(ctx);
|
|
553
|
+
const { game, options, stance } = validateAttack(ctx, attacker, inputStance, inputOptions);
|
|
505
554
|
if (attacker.address === defender.address) {
|
|
506
555
|
fail(`Fleet ${attacker.address} cannot attack itself. Choose a distinct defending Fleet and retry.`, attacker.address);
|
|
507
556
|
}
|
|
508
|
-
|
|
509
|
-
fail(`Attacking Fleet ${attacker.address} does not belong to authorization Profile ${options.authorization.profile}. Choose an owned Fleet and retry.`, attacker.address);
|
|
510
|
-
}
|
|
511
|
-
if (options.loot === options.authorization.authority ||
|
|
512
|
-
options.loot === options.authorization.profile) {
|
|
513
|
-
fail(`The new Loot address ${options.loot} must be distinct from the authorization authority and Profile. Generate a separate Loot signer address and retry.`, options.loot);
|
|
514
|
-
}
|
|
515
|
-
for (const [role, fleet] of [
|
|
516
|
-
['attacking', attacker],
|
|
517
|
-
['defending', defender],
|
|
518
|
-
]) {
|
|
519
|
-
if (fleet.game !== game) {
|
|
520
|
-
fail(`The ${role} Fleet ${fleet.address} belongs to Game ${fleet.game}, not configured Game ${game}. Refresh both Fleets through this context and retry.`, fleet.address);
|
|
521
|
-
}
|
|
522
|
-
if (fleet.state.kind === 'destroyed') {
|
|
523
|
-
fail(`The ${role} Fleet ${fleet.name} (${fleet.address}) is destroyed and cannot participate in this attack. Refresh the Fleet after respawn and retry.`, fleet.address);
|
|
524
|
-
}
|
|
525
|
-
if (!Number.isSafeInteger(fleet.ap) ||
|
|
526
|
-
fleet.ap < 0 ||
|
|
527
|
-
!Number.isSafeInteger(fleet.crewCount) ||
|
|
528
|
-
fleet.crewCount <= 0) {
|
|
529
|
-
fail(`The ${role} Fleet ${fleet.name} (${fleet.address}) has unknown or invalid AP or crew state. Refresh the Fleet through this context and retry.`, fleet.address);
|
|
530
|
-
}
|
|
531
|
-
if (fleet.ships.length === 0 ||
|
|
532
|
-
fleet.ships.some(({ quantity }) => quantity <= 0n)) {
|
|
533
|
-
fail(`The ${role} Fleet ${fleet.name} (${fleet.address}) has no valid known ship composition. Refresh Fleet composition and retry.`, fleet.address);
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
if (attacker.ap === 0) {
|
|
537
|
-
fail(`Attacking Fleet ${attacker.name} (${attacker.address}) has no known AP available. Wait for AP reload, refresh the Fleet, and retry.`, attacker.address);
|
|
538
|
-
}
|
|
557
|
+
validateAttackFleet(defender, 'defending', game);
|
|
539
558
|
const currentAccounts = await readContextRawAccounts(ctx, [
|
|
540
559
|
attacker.address,
|
|
541
560
|
defender.address,
|
|
542
561
|
options.loot,
|
|
562
|
+
CLOCK_ADDRESS,
|
|
543
563
|
]);
|
|
544
564
|
if (currentAccounts[2] !== undefined) {
|
|
545
565
|
fail(`Loot account ${options.loot} already exists. Generate a new unused Loot signer address and retry.`, options.loot);
|
|
@@ -548,6 +568,7 @@ export async function planFleetAttackFleet(ctx, attacker, defender, inputStance,
|
|
|
548
568
|
validateCurrentAttackFleet(attacker, currentAccounts[0]),
|
|
549
569
|
validateCurrentAttackFleet(defender, currentAccounts[1]),
|
|
550
570
|
]);
|
|
571
|
+
validateAttackerReadiness(attacker, attackerAccount, currentAccounts[3]);
|
|
551
572
|
const registryAddress = await deriveAtlasRewardRegistryAddress(game);
|
|
552
573
|
const registry = await ctx.data.read(atlasRewardRegistryAccountDefinition, registryAddress);
|
|
553
574
|
if (registry.data.game !== game) {
|
|
@@ -592,12 +613,12 @@ export async function planFleetAttackFleet(ctx, attacker, defender, inputStance,
|
|
|
592
613
|
describes: 'Both operator XP budgets remain canonical and reconciled; earned XP and bank balances may change.',
|
|
593
614
|
}));
|
|
594
615
|
const instruction = adaptAttackFleetInstruction({
|
|
595
|
-
...(attackerNpc.
|
|
616
|
+
...(attackerNpc.faction === undefined
|
|
596
617
|
? {}
|
|
597
|
-
: { attackerFactionAccount: attackerNpc.
|
|
618
|
+
: { attackerFactionAccount: attackerNpc.faction.address }),
|
|
598
619
|
...(attackerNpc.ownership === undefined
|
|
599
620
|
? {}
|
|
600
|
-
: { attackerFleetOwnership: attackerNpc.ownership }),
|
|
621
|
+
: { attackerFleetOwnership: attackerNpc.ownership.address }),
|
|
601
622
|
attackerRewardsConfig: attackerRewards.config,
|
|
602
623
|
...(attackerRewards.contribution === undefined
|
|
603
624
|
? {}
|
|
@@ -618,7 +639,7 @@ export async function planFleetAttackFleet(ctx, attacker, defender, inputStance,
|
|
|
618
639
|
defenderCharacter,
|
|
619
640
|
...(defenderNpc.ownership === undefined
|
|
620
641
|
? {}
|
|
621
|
-
: { defenderFleetOwnership: defenderNpc.ownership }),
|
|
642
|
+
: { defenderFleetOwnership: defenderNpc.ownership.address }),
|
|
622
643
|
defenderRewardsConfig: defenderRewards.config,
|
|
623
644
|
...(defenderRewards.contribution === undefined
|
|
624
645
|
? {}
|
|
@@ -637,7 +658,7 @@ export async function planFleetAttackFleet(ctx, attacker, defender, inputStance,
|
|
|
637
658
|
stance: generatedStance(stance),
|
|
638
659
|
});
|
|
639
660
|
const description = `Attack Fleet ${defender.name} (${defender.address}) with Fleet ${attacker.name} (${attacker.address}) using ${stance.ammoUsage} ammunition; range, randomness, rewards, Loot, damage, and final combat arithmetic remain chain-authoritative.`;
|
|
640
|
-
return
|
|
661
|
+
return buildPlannerPlan({
|
|
641
662
|
kind: 'combat.attack-fleet',
|
|
642
663
|
preconditions: [
|
|
643
664
|
{
|
|
@@ -647,8 +668,8 @@ export async function planFleetAttackFleet(ctx, attacker, defender, inputStance,
|
|
|
647
668
|
describes: 'The exact attack instruction and both canonical operators remain bound.',
|
|
648
669
|
},
|
|
649
670
|
...xpGuards,
|
|
650
|
-
await
|
|
651
|
-
await
|
|
671
|
+
await accountStatePrecondition(attackerAccount, `Attacking Fleet ${attacker.name} retains its owner, Game, live state, crew, AP, faction, and ship composition.`),
|
|
672
|
+
await accountStatePrecondition(defenderAccount, `Defending Fleet ${defender.name} retains its owner, Game, live state, crew, faction, and ship composition.`),
|
|
652
673
|
],
|
|
653
674
|
steps: [
|
|
654
675
|
{
|
|
@@ -676,26 +697,26 @@ function systemFingerprint(system) {
|
|
|
676
697
|
version: system.version,
|
|
677
698
|
}, (_key, value) => typeof value === 'bigint' ? value.toString() : value);
|
|
678
699
|
}
|
|
679
|
-
function starbaseFactionId(owner) {
|
|
680
|
-
switch (owner) {
|
|
681
|
-
case 'mud':
|
|
682
|
-
return 1;
|
|
683
|
-
case 'oni':
|
|
684
|
-
return 2;
|
|
685
|
-
case 'ustur':
|
|
686
|
-
return 3;
|
|
687
|
-
case 'unaligned':
|
|
688
|
-
return null;
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
700
|
/** Plans one singleton Fleet-on-Starbase attack without predicting its outcome.
|
|
692
701
|
*
|
|
702
|
+
* At chain time the attacker must be Idle or subwarping (a finished warp
|
|
703
|
+
* counts as Idle), carry its required crew, and have finished reloading AP.
|
|
693
704
|
* The planner validates the owned attacking Fleet, canonical target System and
|
|
694
705
|
* nested shared Starbase, configured faction ownership mode, reward
|
|
695
706
|
* configuration, and the optional dynamic-NPC capture economy. Range,
|
|
696
707
|
* capture-cost debit outcome, randomness, damage, rewards, and final
|
|
697
708
|
* admissibility remain chain-authoritative.
|
|
698
709
|
*
|
|
710
|
+
* Requires Disabled rent: the Game's rent catalog and the target System's
|
|
711
|
+
* Starbase-level rent history must not exist, and both stay guarded absent until
|
|
712
|
+
* signing.
|
|
713
|
+
*
|
|
714
|
+
* From the RegionTracker, the attack reads only the target System's Region, so
|
|
715
|
+
* the Plan guards only that Region's owner, safety status and risk zone and a
|
|
716
|
+
* Starbase capture or upgrade in another Region leaves it valid. If the
|
|
717
|
+
* System's stored Region disagrees with the Region map, the whole tracker stays
|
|
718
|
+
* guarded.
|
|
719
|
+
*
|
|
699
720
|
* @example
|
|
700
721
|
* ```ts
|
|
701
722
|
* declare const ctx: SageContext;
|
|
@@ -713,32 +734,7 @@ function starbaseFactionId(owner) {
|
|
|
713
734
|
* ```
|
|
714
735
|
*/
|
|
715
736
|
export async function planFleetAttackStarbase(ctx, attacker, target, inputStance, inputOptions) {
|
|
716
|
-
const options =
|
|
717
|
-
const stance = validateAttackStance(inputStance);
|
|
718
|
-
const game = requireGameAddress(ctx);
|
|
719
|
-
if (attacker.ownerProfile.address !== options.authorization.profile) {
|
|
720
|
-
fail(`Attacking Fleet ${attacker.address} does not belong to authorization Profile ${options.authorization.profile}. Choose an owned Fleet and retry.`, attacker.address);
|
|
721
|
-
}
|
|
722
|
-
if (options.loot === options.authorization.authority ||
|
|
723
|
-
options.loot === options.authorization.profile) {
|
|
724
|
-
fail(`The new Loot address ${options.loot} must be distinct from the authorization authority and Profile. Generate a separate Loot signer address and retry.`, options.loot);
|
|
725
|
-
}
|
|
726
|
-
if (attacker.game !== game) {
|
|
727
|
-
fail(`Attacking Fleet ${attacker.address} belongs to Game ${attacker.game}, not configured Game ${game}. Refresh the Fleet through this context and retry.`, attacker.address);
|
|
728
|
-
}
|
|
729
|
-
if (attacker.state.kind === 'destroyed') {
|
|
730
|
-
fail(`Attacking Fleet ${attacker.name} (${attacker.address}) is destroyed and cannot attack a Starbase. Refresh the Fleet after respawn and retry.`, attacker.address);
|
|
731
|
-
}
|
|
732
|
-
if (!Number.isSafeInteger(attacker.ap) ||
|
|
733
|
-
attacker.ap <= 0 ||
|
|
734
|
-
!Number.isSafeInteger(attacker.crewCount) ||
|
|
735
|
-
attacker.crewCount <= 0) {
|
|
736
|
-
fail(`Attacking Fleet ${attacker.name} (${attacker.address}) has no known positive AP or valid crew state. Wait for AP reload, refresh the Fleet, and retry.`, attacker.address);
|
|
737
|
-
}
|
|
738
|
-
if (attacker.ships.length === 0 ||
|
|
739
|
-
attacker.ships.some(({ quantity }) => quantity <= 0n)) {
|
|
740
|
-
fail(`Attacking Fleet ${attacker.name} (${attacker.address}) has no valid known ship composition. Refresh Fleet composition and retry.`, attacker.address);
|
|
741
|
-
}
|
|
737
|
+
const { game, options, stance } = validateAttack(ctx, attacker, inputStance, inputOptions);
|
|
742
738
|
if (target.game !== game) {
|
|
743
739
|
fail(`Target Star System ${target.address} belongs to Game ${target.game}, not configured Game ${game}. Refresh the target through this context and retry.`, target.address);
|
|
744
740
|
}
|
|
@@ -757,9 +753,10 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
757
753
|
deriveRegionTrackerAddress(game),
|
|
758
754
|
deriveFleetCrewBindingAddress(attacker.address),
|
|
759
755
|
]);
|
|
760
|
-
const [probeRelationsAccount, probeRegistryAccount] = await
|
|
761
|
-
relationTrackerAddress,
|
|
762
|
-
|
|
756
|
+
const [[probeRelationsAccount, probeRegistryAccount], attackerNpc, rent] = await Promise.all([
|
|
757
|
+
readContextRawAccounts(ctx, [relationTrackerAddress, registryAddress]),
|
|
758
|
+
resolveNpcAccounts(ctx, attacker, true),
|
|
759
|
+
requireDisabledLevelRent(ctx, game, target, 'the Starbase attack'),
|
|
763
760
|
]);
|
|
764
761
|
const probeRelations = factionRelationTrackerAccountDefinition.decode(requireAccount(probeRelationsAccount, relationTrackerAddress, `FactionRelationTracker ${relationTrackerAddress} is missing. Refresh faction relationships and retry.`));
|
|
765
762
|
const probeRegistry = atlasRewardRegistryAccountDefinition.decode(requireAccount(probeRegistryAccount, registryAddress, `AtlasRewardRegistry ${registryAddress} is missing. Refresh reward configuration and retry.`));
|
|
@@ -770,12 +767,6 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
770
767
|
fail(`AtlasRewardRegistry ${registryAddress} belongs to another Game. Refresh the configured reward registry and retry.`, registryAddress);
|
|
771
768
|
}
|
|
772
769
|
const rewardConfigAddress = await deriveAtlasRewardConfigAddress(game, probeRegistry.activeConfigVersion);
|
|
773
|
-
const attackerOwnership = attacker.npcFactionId === 0
|
|
774
|
-
? undefined
|
|
775
|
-
: await deriveFactionOwnershipAddress(game, 'fleet', attacker.address);
|
|
776
|
-
const attackerFaction = attacker.npcFactionId === 0
|
|
777
|
-
? undefined
|
|
778
|
-
: await deriveFactionAccountAddress(game, attacker.npcFactionId);
|
|
779
770
|
const requiresNpcEconomy = attacker.npcFactionId > 0 &&
|
|
780
771
|
probeRelations.dynamicCaptureEnabled &&
|
|
781
772
|
probeRelations.nemesisActive;
|
|
@@ -799,10 +790,9 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
799
790
|
character,
|
|
800
791
|
regionTracker,
|
|
801
792
|
crewBindingAddress,
|
|
802
|
-
...(attackerOwnership === undefined ? [] : [attackerOwnership]),
|
|
803
|
-
...(attackerFaction === undefined ? [] : [attackerFaction]),
|
|
804
793
|
...(factionEconomicsConfig === undefined ? [] : [factionEconomicsConfig]),
|
|
805
794
|
...(captorTreasury === undefined ? [] : [captorTreasury]),
|
|
795
|
+
CLOCK_ADDRESS,
|
|
806
796
|
];
|
|
807
797
|
const dependencyAccounts = await readContextRawAccounts(ctx, dependencyAddresses);
|
|
808
798
|
const current = new Map(dependencyAddresses.map((address, index) => [
|
|
@@ -813,6 +803,7 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
813
803
|
fail(`Loot account ${options.loot} already exists. Generate a new unused Loot signer address and retry.`, options.loot);
|
|
814
804
|
}
|
|
815
805
|
const attackerAccount = await validateCurrentAttackFleet(attacker, current.get(attacker.address));
|
|
806
|
+
validateAttackerReadiness(attacker, attackerAccount, current.get(CLOCK_ADDRESS));
|
|
816
807
|
const systemAccount = requireAccount(current.get(target.address), target.address, `Target Star System ${target.name} (${target.address}) is missing. Refresh world state and retry the attack.`);
|
|
817
808
|
const currentSystem = starSystemAccountDefinition.decode(systemAccount);
|
|
818
809
|
if ((await deriveStarSystemAddress(currentSystem.game, currentSystem.systemId)) !== target.address ||
|
|
@@ -836,7 +827,8 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
836
827
|
if (ownership === undefined && relations.dynamicCaptureEnabled) {
|
|
837
828
|
fail(`Target Starbase ${target.address} requires canonical FactionOwnership while dynamic capture is enabled. Refresh Starbase ownership and retry.`, ownershipAddress);
|
|
838
829
|
}
|
|
839
|
-
|
|
830
|
+
// KingSystemTracker records an unaligned owner as null.
|
|
831
|
+
const legacyOwner = factionValue(target.starbase.owner) || null;
|
|
840
832
|
if (ownership !== undefined &&
|
|
841
833
|
(ownership.game !== game ||
|
|
842
834
|
ownership.asset.kind !== 'starbase' ||
|
|
@@ -877,6 +869,20 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
877
869
|
if (regionTrackerData.game !== game) {
|
|
878
870
|
fail(`RegionTracker ${regionTracker} does not match configured Game ${game}. Refresh world region data and retry.`, regionTracker);
|
|
879
871
|
}
|
|
872
|
+
// The attack reads the target's stored Region. When the Region map agrees,
|
|
873
|
+
// guard only that Region's access data; otherwise keep the whole tracker.
|
|
874
|
+
const regionAccess = (await regionsContainingSystem(regionTrackerAccount, systemAccount, game))
|
|
875
|
+
.map(({ id }) => id)
|
|
876
|
+
.join() === String(currentSystem.regionId ?? '')
|
|
877
|
+
? {
|
|
878
|
+
kind: 'region-access',
|
|
879
|
+
address: regionTracker,
|
|
880
|
+
game,
|
|
881
|
+
system: target.address,
|
|
882
|
+
accessHash: await hashRegionAccess(regionTrackerAccount, systemAccount, game),
|
|
883
|
+
describes: `The Region holding target Star System ${target.name} keeps its owner, safety status and risk zone; other Regions may change.`,
|
|
884
|
+
}
|
|
885
|
+
: undefined;
|
|
880
886
|
const crewBindingAccount = current.get(crewBindingAddress);
|
|
881
887
|
const crewBinding = crewBindingAccount === undefined ? undefined : crewBindingAddress;
|
|
882
888
|
if (crewBindingAccount !== undefined) {
|
|
@@ -885,27 +891,6 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
885
891
|
fail(`FleetCrewBinding ${crewBindingAddress} does not belong to Fleet ${attacker.address} and Profile ${attacker.ownerProfile.address}. Refresh the Fleet crew relationship and retry.`, crewBindingAddress);
|
|
886
892
|
}
|
|
887
893
|
}
|
|
888
|
-
const attackerNpc = {};
|
|
889
|
-
let attackerOwnershipAccount;
|
|
890
|
-
let attackerFactionAccount;
|
|
891
|
-
if (attackerOwnership !== undefined && attackerFaction !== undefined) {
|
|
892
|
-
attackerOwnershipAccount = requireAccount(current.get(attackerOwnership), attackerOwnership, `NPC Fleet ${attacker.address} has no canonical FactionOwnership. Refresh the Fleet faction relationship and retry.`);
|
|
893
|
-
const npcOwnership = factionOwnershipAccountDefinition.decode(attackerOwnershipAccount);
|
|
894
|
-
if (npcOwnership.game !== game ||
|
|
895
|
-
npcOwnership.asset.kind !== 'fleet' ||
|
|
896
|
-
npcOwnership.asset.fleet !== attacker.address ||
|
|
897
|
-
npcOwnership.controllingFactionId !== attacker.npcFactionId) {
|
|
898
|
-
fail(`NPC Fleet ${attacker.address} has no matching canonical FactionOwnership for faction ${String(attacker.npcFactionId)}. Refresh the Fleet and faction ownership relationship before retrying.`, attackerOwnership);
|
|
899
|
-
}
|
|
900
|
-
attackerFactionAccount = requireAccount(current.get(attackerFaction), attackerFaction, `Faction ${attackerFaction} is missing for NPC Fleet ${attacker.address}. Refresh the faction registry relationship and retry.`);
|
|
901
|
-
const npcFaction = factionAccountDefinition.decode(attackerFactionAccount);
|
|
902
|
-
if (npcFaction.game !== game ||
|
|
903
|
-
npcFaction.factionId !== attacker.npcFactionId) {
|
|
904
|
-
fail(`Faction ${attackerFaction} does not match NPC Fleet ${attacker.address}'s Game and faction id. Refresh the faction registry relationship before retrying.`, attackerFaction);
|
|
905
|
-
}
|
|
906
|
-
attackerNpc.ownership = attackerOwnership;
|
|
907
|
-
attackerNpc.factionAccount = attackerFaction;
|
|
908
|
-
}
|
|
909
894
|
let economicsAccount;
|
|
910
895
|
let treasuryAccount;
|
|
911
896
|
if (factionEconomicsConfig !== undefined && captorTreasury !== undefined) {
|
|
@@ -952,33 +937,29 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
952
937
|
'King-system target membership and ownership remain unchanged.',
|
|
953
938
|
],
|
|
954
939
|
[characterAccount, 'The attacking Profile Character remains canonical.'],
|
|
955
|
-
|
|
956
|
-
regionTrackerAccount,
|
|
957
|
-
'The configured Game RegionTracker remains canonical.',
|
|
958
|
-
],
|
|
959
|
-
...(crewBindingAccount === undefined
|
|
940
|
+
...(regionAccess
|
|
960
941
|
? []
|
|
961
942
|
: [
|
|
962
943
|
[
|
|
963
|
-
|
|
964
|
-
'
|
|
944
|
+
regionTrackerAccount,
|
|
945
|
+
`Target Star System ${target.name}'s stored Region differs from the Region map at its coordinate, so the whole configured Game RegionTracker remains guarded.`,
|
|
965
946
|
],
|
|
966
947
|
]),
|
|
967
|
-
...(
|
|
948
|
+
...(crewBindingAccount === undefined
|
|
968
949
|
? []
|
|
969
950
|
: [
|
|
970
951
|
[
|
|
971
|
-
|
|
972
|
-
'
|
|
952
|
+
crewBindingAccount,
|
|
953
|
+
'The optional Fleet crew binding remains unchanged.',
|
|
973
954
|
],
|
|
974
955
|
]),
|
|
975
|
-
...(
|
|
956
|
+
...(attackerNpc.ownership === undefined
|
|
957
|
+
? []
|
|
958
|
+
: [[attackerNpc.ownership, 'NPC Fleet ownership remains unchanged.']]),
|
|
959
|
+
...(attackerNpc.faction === undefined
|
|
976
960
|
? []
|
|
977
961
|
: [
|
|
978
|
-
[
|
|
979
|
-
attackerFactionAccount,
|
|
980
|
-
'The NPC faction account remains unchanged.',
|
|
981
|
-
],
|
|
962
|
+
[attackerNpc.faction, 'The NPC faction account remains unchanged.'],
|
|
982
963
|
]),
|
|
983
964
|
...(economicsAccount === undefined
|
|
984
965
|
? []
|
|
@@ -996,12 +977,12 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
996
977
|
'The dynamic-capture treasury remains unchanged.',
|
|
997
978
|
],
|
|
998
979
|
]),
|
|
999
|
-
].map(([account, describes]) =>
|
|
980
|
+
].map(([account, describes]) => accountStatePrecondition(account, describes)));
|
|
1000
981
|
const absencePreconditions = [
|
|
1001
|
-
|
|
982
|
+
accountAbsentPrecondition(options.loot, `Loot account ${options.loot} remains absent until execution.`),
|
|
1002
983
|
...(crewBindingAccount === undefined
|
|
1003
984
|
? [
|
|
1004
|
-
|
|
985
|
+
accountAbsentPrecondition(crewBindingAddress, 'Optional Fleet crew binding remains absent.'),
|
|
1005
986
|
]
|
|
1006
987
|
: []),
|
|
1007
988
|
];
|
|
@@ -1013,11 +994,13 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
1013
994
|
character,
|
|
1014
995
|
});
|
|
1015
996
|
const description = `Attack with Fleet ${attacker.name} (${attacker.address}) against the shared Starbase at ${target.name} (${target.address}) using ${stance.ammoUsage} ammunition; range, capture-cost debit outcome, randomness, rewards, Loot, damage, and final admissibility remain chain-authoritative.`;
|
|
1016
|
-
return
|
|
997
|
+
return buildPlannerPlan({
|
|
1017
998
|
kind: 'combat.attack-starbase',
|
|
1018
999
|
preconditions: [
|
|
1019
1000
|
...statePreconditions,
|
|
1001
|
+
...(regionAccess ? [regionAccess] : []),
|
|
1020
1002
|
...absencePreconditions,
|
|
1003
|
+
...rent.guards,
|
|
1021
1004
|
...runtime.guards,
|
|
1022
1005
|
],
|
|
1023
1006
|
steps: [
|
|
@@ -1025,12 +1008,12 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
1025
1008
|
describes: `${description} ${runtime.description}`,
|
|
1026
1009
|
instruction: adaptAttackStarbaseInstruction({
|
|
1027
1010
|
...runtime.accounts,
|
|
1028
|
-
...(attackerNpc.
|
|
1011
|
+
...(attackerNpc.faction === undefined
|
|
1029
1012
|
? {}
|
|
1030
|
-
: { attackerFactionAccount: attackerNpc.
|
|
1013
|
+
: { attackerFactionAccount: attackerNpc.faction.address }),
|
|
1031
1014
|
...(attackerNpc.ownership === undefined
|
|
1032
1015
|
? {}
|
|
1033
|
-
: { attackerFleetOwnership: attackerNpc.ownership }),
|
|
1016
|
+
: { attackerFleetOwnership: attackerNpc.ownership.address }),
|
|
1034
1017
|
authorization: options.authorization,
|
|
1035
1018
|
...(captorTreasury === undefined ? {} : { captorTreasury }),
|
|
1036
1019
|
character,
|
|
@@ -1048,6 +1031,7 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
1048
1031
|
loot: options.loot,
|
|
1049
1032
|
recentSlothashes: 'SysvarS1otHashes111111111111111111111111111',
|
|
1050
1033
|
regionTracker,
|
|
1034
|
+
...rent.accounts,
|
|
1051
1035
|
rewardConfig: rewardConfigAddress,
|
|
1052
1036
|
rewardRegistry: registryAddress,
|
|
1053
1037
|
stance: generatedStance(stance),
|
|
@@ -1069,11 +1053,11 @@ function lootSnapshotFingerprint(loot) {
|
|
|
1069
1053
|
loot.coordinates.x,
|
|
1070
1054
|
loot.coordinates.y,
|
|
1071
1055
|
...loot.items.map((item) => [
|
|
1072
|
-
item.destroyer
|
|
1056
|
+
item.destroyer?.address ?? '',
|
|
1073
1057
|
item.exclusivityUnlockAtUnixSeconds,
|
|
1074
1058
|
item.rewardReclaimAtUnixSeconds,
|
|
1075
1059
|
item.inventory.sequenceId,
|
|
1076
|
-
item.inventory.
|
|
1060
|
+
item.inventory.usedStorageUnitsRaw,
|
|
1077
1061
|
...item.inventory.items
|
|
1078
1062
|
.map(({ cargo, quantityRaw }) => `${String(cargo.id)}:${String(quantityRaw)}`)
|
|
1079
1063
|
.sort(),
|
|
@@ -1089,11 +1073,11 @@ function rawLootFingerprint(address, loot) {
|
|
|
1089
1073
|
loot.coordinates.x,
|
|
1090
1074
|
loot.coordinates.y,
|
|
1091
1075
|
...loot.items.map((item) => [
|
|
1092
|
-
item.destroyer,
|
|
1076
|
+
item.destroyer ?? '',
|
|
1093
1077
|
item.exclusivityUnlockAtUnixSeconds,
|
|
1094
1078
|
item.rewardReclaimAtUnixSeconds,
|
|
1095
1079
|
item.inventory.sequenceId,
|
|
1096
|
-
item.inventory.
|
|
1080
|
+
item.inventory.usedStorageUnitsRaw,
|
|
1097
1081
|
...item.inventory.amounts
|
|
1098
1082
|
.map(({ amount, cargoId }) => `${String(cargoId)}:${String(amount)}`)
|
|
1099
1083
|
.sort(),
|
|
@@ -1102,10 +1086,12 @@ function rawLootFingerprint(address, loot) {
|
|
|
1102
1086
|
}
|
|
1103
1087
|
/** Plans one transaction-exclusive retrieval from a loaded Loot snapshot.
|
|
1104
1088
|
*
|
|
1105
|
-
* The planner validates the owned idle Fleet,
|
|
1106
|
-
*
|
|
1107
|
-
*
|
|
1108
|
-
*
|
|
1089
|
+
* The planner validates the owned idle Fleet, its normalized crew and usable
|
|
1090
|
+
* ability power at `atUnixSeconds`, Loot identity, destroyer exclusivity and
|
|
1091
|
+
* reward locks against the authorization Profile, and every requested known
|
|
1092
|
+
* quantity. Retrieval spends the Fleet's whole ability power pool. Range,
|
|
1093
|
+
* recent-slot inputs, destination capacity, intervening races, and final
|
|
1094
|
+
* acquired quantities remain chain-authoritative.
|
|
1109
1095
|
*
|
|
1110
1096
|
* @example
|
|
1111
1097
|
* ```ts
|
|
@@ -1153,6 +1139,13 @@ export async function planFleetRetrieveLoot(ctx, fleet, loot, inputWant, inputOp
|
|
|
1153
1139
|
currentFleet.crewCount !== fleet.crewCount) {
|
|
1154
1140
|
fail(`Fleet ${fleet.name} (${fleet.address}) changed or no longer matches its canonical Game, owner, label, idle state, or crew. Refresh the Fleet and retry.`, fleet.address);
|
|
1155
1141
|
}
|
|
1142
|
+
if (currentFleet.crewCount < currentFleet.stats.misc.requiredCrew) {
|
|
1143
|
+
fail(`Fleet ${fleet.name} (${fleet.address}) has ${String(currentFleet.crewCount)} crew but needs ${String(currentFleet.stats.misc.requiredCrew)} to retrieve Loot. Load crew, refresh the Fleet, and retry.`, fleet.address);
|
|
1144
|
+
}
|
|
1145
|
+
if (currentFleet.ap <= 0 ||
|
|
1146
|
+
options.atUnixSeconds < currentFleet.apReloadExpiresAt) {
|
|
1147
|
+
fail(`Fleet ${fleet.name} (${fleet.address}) has no usable ability power at ${String(options.atUnixSeconds)} Unix seconds: stored AP ${String(currentFleet.ap)} with reload completing at ${String(currentFleet.apReloadExpiresAt)}. Retrieving Loot spends the whole AP pool; wait for the reload, refresh the Fleet, and retry.`, fleet.address);
|
|
1148
|
+
}
|
|
1156
1149
|
const lootAccount = requireAccount(lootAccountValue, loot.address, `Loot ${loot.address} is no longer available. Refresh Loot discovery and choose an available account before retrying.`);
|
|
1157
1150
|
const currentLoot = lootAccountDefinition.decode(lootAccount);
|
|
1158
1151
|
if (rawLootFingerprint(lootAccount.address, currentLoot) !==
|
|
@@ -1162,28 +1155,33 @@ export async function planFleetRetrieveLoot(ctx, fleet, loot, inputWant, inputOp
|
|
|
1162
1155
|
const lootCreator = loot.profile.address === options.authorization.profile
|
|
1163
1156
|
? undefined
|
|
1164
1157
|
: loot.profile.address;
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1158
|
+
const instruction = adaptRetrieveLootInstruction({
|
|
1159
|
+
authorization: options.authorization,
|
|
1160
|
+
fleet: fleet.address,
|
|
1161
|
+
game,
|
|
1162
|
+
loot: loot.address,
|
|
1163
|
+
...(lootCreator === undefined ? {} : { lootCreator }),
|
|
1164
|
+
recentSlothashes: 'SysvarS1otHashes111111111111111111111111111',
|
|
1165
|
+
want: selection.generated.map(([itemIndex, cargo]) => [
|
|
1166
|
+
itemIndex,
|
|
1167
|
+
cargo.map(([cargoId, quantity]) => [cargoId, quantity]),
|
|
1168
|
+
]),
|
|
1169
|
+
});
|
|
1170
|
+
// Retrieved cargo can open hold lines, which the program funds from the
|
|
1171
|
+
// Profile vault before the emptied Loot refunds its rent.
|
|
1172
|
+
const storage = await planFleetStorage(ctx, instruction, [fleetAccount.address], options.authorization.profile, 'Loot retrieval');
|
|
1173
|
+
const description = `Request ${selection.summary} from Loot ${loot.address} with Fleet ${fleet.name} (${fleet.address}); this spends the Fleet's whole ability power pool. Range, recent-slot randomness, cargo capacity, availability races, and final transfer quantities remain chain-authoritative. ${storage.disclosure}`;
|
|
1174
|
+
return buildPlannerPlan({
|
|
1167
1175
|
kind: 'combat.retrieve-loot',
|
|
1168
1176
|
preconditions: [
|
|
1169
|
-
await
|
|
1170
|
-
await
|
|
1177
|
+
await accountStatePrecondition(fleetAccount, `Fleet ${fleet.name} retains its configured Game, owning Profile, idle state, and normalized crew.`),
|
|
1178
|
+
await accountStatePrecondition(lootAccount, `Loot ${loot.address} retains its identity, creator, destroyer exclusivity, and requested known quantities.`),
|
|
1179
|
+
storage.guard,
|
|
1171
1180
|
],
|
|
1172
1181
|
steps: [
|
|
1173
1182
|
{
|
|
1174
1183
|
describes: description,
|
|
1175
|
-
instruction
|
|
1176
|
-
authorization: options.authorization,
|
|
1177
|
-
fleet: fleet.address,
|
|
1178
|
-
game,
|
|
1179
|
-
loot: loot.address,
|
|
1180
|
-
...(lootCreator === undefined ? {} : { lootCreator }),
|
|
1181
|
-
recentSlothashes: 'SysvarS1otHashes111111111111111111111111111',
|
|
1182
|
-
want: selection.generated.map(([itemIndex, cargo]) => [
|
|
1183
|
-
itemIndex,
|
|
1184
|
-
cargo.map(([cargoId, quantity]) => [cargoId, quantity]),
|
|
1185
|
-
]),
|
|
1186
|
-
}),
|
|
1184
|
+
instruction,
|
|
1187
1185
|
semantics: [{ kind: 'exclusive', scope: 'transaction' }],
|
|
1188
1186
|
signers: [options.authorization.authority],
|
|
1189
1187
|
},
|
|
@@ -1191,4 +1189,16 @@ export async function planFleetRetrieveLoot(ctx, fleet, loot, inputWant, inputOp
|
|
|
1191
1189
|
summary: description,
|
|
1192
1190
|
});
|
|
1193
1191
|
}
|
|
1192
|
+
/** Reads the Profile, Rent and the action's other storage accounts, and plans
|
|
1193
|
+
* its Profile storage funding. */
|
|
1194
|
+
async function planFleetStorage(ctx, instruction, addresses, profile, label, stimulantStats) {
|
|
1195
|
+
const all = [...addresses, profile, RENT_ADDRESS];
|
|
1196
|
+
const rows = await readContextRawAccounts(ctx, all);
|
|
1197
|
+
const accounts = new Map(all.map((address, index) => [address, rows[index]]));
|
|
1198
|
+
return planStorageFunding({
|
|
1199
|
+
action: readCombatStorageAction(instruction, accounts, stimulantStats),
|
|
1200
|
+
accounts,
|
|
1201
|
+
label,
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1194
1204
|
//# sourceMappingURL=index.js.map
|