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