@aephia/atlas-kit 0.6.0-next.98 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cargo/actions/deposit.d.ts +4 -1
- package/dist/cargo/actions/deposit.d.ts.map +1 -1
- package/dist/cargo/actions/deposit.js +56 -133
- package/dist/cargo/actions/deposit.js.map +1 -1
- package/dist/cargo/actions/index.d.ts +14 -7
- package/dist/cargo/actions/index.d.ts.map +1 -1
- package/dist/cargo/actions/index.js +105 -93
- package/dist/cargo/actions/index.js.map +1 -1
- package/dist/cargo/actions/wallet-context.d.ts +52 -3
- package/dist/cargo/actions/wallet-context.d.ts.map +1 -1
- package/dist/cargo/actions/wallet-context.js +118 -7
- package/dist/cargo/actions/wallet-context.js.map +1 -1
- package/dist/cargo/actions/wallet-token.d.ts +1 -6
- package/dist/cargo/actions/wallet-token.d.ts.map +1 -1
- package/dist/cargo/actions/wallet-token.js +0 -45
- package/dist/cargo/actions/wallet-token.js.map +1 -1
- package/dist/cargo/actions/withdrawal.d.ts +1 -1
- package/dist/cargo/actions/withdrawal.d.ts.map +1 -1
- package/dist/cargo/actions/withdrawal.js +37 -163
- package/dist/cargo/actions/withdrawal.js.map +1 -1
- package/dist/cargo/index.d.ts.map +1 -1
- package/dist/cargo/index.js +2 -10
- package/dist/cargo/index.js.map +1 -1
- package/dist/claim-stakes/actions/index.d.ts +80 -14
- package/dist/claim-stakes/actions/index.d.ts.map +1 -1
- package/dist/claim-stakes/actions/index.js +668 -717
- package/dist/claim-stakes/actions/index.js.map +1 -1
- package/dist/claim-stakes/index.d.ts +8 -6
- package/dist/claim-stakes/index.d.ts.map +1 -1
- package/dist/claim-stakes/index.js +12 -18
- package/dist/claim-stakes/index.js.map +1 -1
- package/dist/client/context.d.ts.map +1 -1
- package/dist/client/context.js +353 -37
- package/dist/client/context.js.map +1 -1
- package/dist/client/contracts.d.ts +54 -1
- package/dist/client/contracts.d.ts.map +1 -1
- package/dist/client/deployments.d.ts +17 -0
- package/dist/client/deployments.d.ts.map +1 -1
- package/dist/client/deployments.js +17 -0
- package/dist/client/deployments.js.map +1 -1
- package/dist/client/index.d.ts +22 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +21 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/rpc-subscription-provider.d.ts +2 -0
- package/dist/client/rpc-subscription-provider.d.ts.map +1 -1
- package/dist/client/rpc-subscription-provider.js +135 -101
- package/dist/client/rpc-subscription-provider.js.map +1 -1
- package/dist/combat/actions/index.d.ts +30 -12
- package/dist/combat/actions/index.d.ts.map +1 -1
- package/dist/combat/actions/index.js +266 -256
- package/dist/combat/actions/index.js.map +1 -1
- package/dist/combat/index.d.ts +25 -8
- package/dist/combat/index.d.ts.map +1 -1
- package/dist/combat/index.js +21 -18
- package/dist/combat/index.js.map +1 -1
- package/dist/crafting/actions/fee-rate.d.ts +47 -0
- package/dist/crafting/actions/fee-rate.d.ts.map +1 -0
- package/dist/crafting/actions/fee-rate.js +58 -0
- package/dist/crafting/actions/fee-rate.js.map +1 -0
- package/dist/crafting/actions/index.d.ts +28 -28
- package/dist/crafting/actions/index.d.ts.map +1 -1
- package/dist/crafting/actions/index.js +246 -317
- package/dist/crafting/actions/index.js.map +1 -1
- package/dist/crafting/estimate.d.ts +101 -0
- package/dist/crafting/estimate.d.ts.map +1 -0
- package/dist/crafting/estimate.js +108 -0
- package/dist/crafting/estimate.js.map +1 -0
- package/dist/crafting/index.d.ts +6 -5
- package/dist/crafting/index.d.ts.map +1 -1
- package/dist/crafting/index.js +6 -13
- package/dist/crafting/index.js.map +1 -1
- package/dist/factions/actions/index.d.ts +1 -1
- package/dist/factions/actions/index.d.ts.map +1 -1
- package/dist/factions/actions/index.js +5 -4
- package/dist/factions/actions/index.js.map +1 -1
- package/dist/factions/index.d.ts +18 -1
- package/dist/factions/index.d.ts.map +1 -1
- package/dist/factions/index.js +24 -18
- package/dist/factions/index.js.map +1 -1
- package/dist/fleets/actions/add-ship.d.ts +18 -5
- package/dist/fleets/actions/add-ship.d.ts.map +1 -1
- package/dist/fleets/actions/add-ship.js +35 -48
- package/dist/fleets/actions/add-ship.js.map +1 -1
- package/dist/fleets/actions/create-fleet.d.ts +1 -1
- package/dist/fleets/actions/create-fleet.d.ts.map +1 -1
- package/dist/fleets/actions/create-fleet.js +8 -38
- package/dist/fleets/actions/create-fleet.js.map +1 -1
- package/dist/fleets/actions/crew-transfer.d.ts +8 -4
- package/dist/fleets/actions/crew-transfer.d.ts.map +1 -1
- package/dist/fleets/actions/crew-transfer.js +27 -42
- package/dist/fleets/actions/crew-transfer.js.map +1 -1
- package/dist/fleets/actions/deployment-storage.d.ts +161 -0
- package/dist/fleets/actions/deployment-storage.d.ts.map +1 -0
- package/dist/fleets/actions/deployment-storage.js +297 -0
- package/dist/fleets/actions/deployment-storage.js.map +1 -0
- package/dist/fleets/actions/disband.d.ts +42 -0
- package/dist/fleets/actions/disband.d.ts.map +1 -0
- package/dist/fleets/actions/disband.js +107 -0
- package/dist/fleets/actions/disband.js.map +1 -0
- package/dist/fleets/actions/index.d.ts +55 -11
- package/dist/fleets/actions/index.d.ts.map +1 -1
- package/dist/fleets/actions/index.js +288 -241
- package/dist/fleets/actions/index.js.map +1 -1
- package/dist/fleets/actions/respawn.d.ts +1 -1
- package/dist/fleets/actions/respawn.d.ts.map +1 -1
- package/dist/fleets/actions/respawn.js +8 -37
- package/dist/fleets/actions/respawn.js.map +1 -1
- package/dist/fleets/actions/ship-import.d.ts +1 -1
- package/dist/fleets/actions/ship-import.d.ts.map +1 -1
- package/dist/fleets/actions/ship-import.js +39 -91
- package/dist/fleets/actions/ship-import.js.map +1 -1
- package/dist/fleets/actions/sync.d.ts +24 -0
- package/dist/fleets/actions/sync.d.ts.map +1 -0
- package/dist/fleets/actions/sync.js +55 -0
- package/dist/fleets/actions/sync.js.map +1 -0
- package/dist/fleets/composition-stats.d.ts +101 -0
- package/dist/fleets/composition-stats.d.ts.map +1 -0
- package/dist/fleets/composition-stats.js +354 -0
- package/dist/fleets/composition-stats.js.map +1 -0
- package/dist/fleets/cooldown.d.ts +7 -4
- package/dist/fleets/cooldown.d.ts.map +1 -1
- package/dist/fleets/cooldown.js +11 -6
- package/dist/fleets/cooldown.js.map +1 -1
- package/dist/fleets/index.d.ts +1 -0
- package/dist/fleets/index.d.ts.map +1 -1
- package/dist/fleets/index.js +3 -10
- package/dist/fleets/index.js.map +1 -1
- package/dist/fleets/movement-arithmetic.d.ts.map +1 -1
- package/dist/fleets/movement-arithmetic.js +4 -0
- package/dist/fleets/movement-arithmetic.js.map +1 -1
- package/dist/fleets/subwarp-estimate.d.ts +3 -1
- package/dist/fleets/subwarp-estimate.d.ts.map +1 -1
- package/dist/fleets/subwarp-estimate.js +3 -1
- package/dist/fleets/subwarp-estimate.js.map +1 -1
- package/dist/fleets/warp-lane-policy.d.ts +13 -7
- package/dist/fleets/warp-lane-policy.d.ts.map +1 -1
- package/dist/fleets/warp-lane-policy.js +19 -7
- package/dist/fleets/warp-lane-policy.js.map +1 -1
- package/dist/identity/actions/create-profile.d.ts +1 -1
- package/dist/identity/actions/create-profile.d.ts.map +1 -1
- package/dist/identity/actions/create-profile.js +2 -2
- package/dist/identity/actions/create-profile.js.map +1 -1
- package/dist/identity/actions/index.d.ts +2 -1
- package/dist/identity/actions/index.d.ts.map +1 -1
- package/dist/identity/actions/index.js +6 -4
- package/dist/identity/actions/index.js.map +1 -1
- package/dist/identity/actions/research-unlock.d.ts +61 -0
- package/dist/identity/actions/research-unlock.d.ts.map +1 -0
- package/dist/identity/actions/research-unlock.js +166 -0
- package/dist/identity/actions/research-unlock.js.map +1 -0
- package/dist/identity/index.d.ts +62 -2
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +63 -12
- package/dist/identity/index.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/c4/account-decoding.d.ts +49 -0
- package/dist/internal/c4/account-decoding.d.ts.map +1 -0
- package/dist/internal/c4/account-decoding.js +74 -0
- package/dist/internal/c4/account-decoding.js.map +1 -0
- package/dist/internal/c4/career-xp.d.ts +58 -0
- package/dist/internal/c4/career-xp.d.ts.map +1 -0
- package/dist/internal/c4/career-xp.js +80 -0
- package/dist/internal/c4/career-xp.js.map +1 -0
- package/dist/internal/c4/cargo-instructions.d.ts +24 -0
- package/dist/internal/c4/cargo-instructions.d.ts.map +1 -0
- package/dist/internal/c4/cargo-instructions.js +30 -0
- package/dist/internal/c4/cargo-instructions.js.map +1 -0
- package/dist/internal/c4/cargo-pod.d.ts +15 -0
- package/dist/internal/c4/cargo-pod.d.ts.map +1 -0
- package/dist/internal/c4/cargo-pod.js +13 -0
- package/dist/internal/c4/cargo-pod.js.map +1 -0
- package/dist/internal/c4/character-modifier.d.ts +1 -1
- package/dist/internal/c4/character-modifier.d.ts.map +1 -1
- package/dist/internal/c4/character.d.ts +157 -0
- package/dist/internal/c4/character.d.ts.map +1 -0
- package/dist/internal/c4/character.js +64 -0
- package/dist/internal/c4/character.js.map +1 -0
- package/dist/internal/c4/claim-stake-building-definitions.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake-building-definitions.js +2 -1
- package/dist/internal/c4/claim-stake-building-definitions.js.map +1 -1
- package/dist/internal/c4/claim-stake-configuration.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake-configuration.js +5 -36
- package/dist/internal/c4/claim-stake-configuration.js.map +1 -1
- package/dist/internal/c4/claim-stake-definitions.d.ts +4 -0
- package/dist/internal/c4/claim-stake-definitions.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake-definitions.js +6 -2
- package/dist/internal/c4/claim-stake-definitions.js.map +1 -1
- package/dist/internal/c4/claim-stake-plots.d.ts +17 -0
- package/dist/internal/c4/claim-stake-plots.d.ts.map +1 -0
- package/dist/internal/c4/claim-stake-plots.js +29 -0
- package/dist/internal/c4/claim-stake-plots.js.map +1 -0
- package/dist/internal/c4/claim-stake-standing.d.ts +80 -0
- package/dist/internal/c4/claim-stake-standing.d.ts.map +1 -0
- package/dist/internal/c4/claim-stake-standing.js +61 -0
- package/dist/internal/c4/claim-stake-standing.js.map +1 -0
- package/dist/internal/c4/claim-stake-storage.d.ts +45 -0
- package/dist/internal/c4/claim-stake-storage.d.ts.map +1 -0
- package/dist/internal/c4/claim-stake-storage.js +207 -0
- package/dist/internal/c4/claim-stake-storage.js.map +1 -0
- package/dist/internal/c4/claim-stake.d.ts +9 -6
- package/dist/internal/c4/claim-stake.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake.js +24 -56
- package/dist/internal/c4/claim-stake.js.map +1 -1
- package/dist/internal/c4/combat-storage.d.ts +20 -0
- package/dist/internal/c4/combat-storage.d.ts.map +1 -0
- package/dist/internal/c4/combat-storage.js +43 -0
- package/dist/internal/c4/combat-storage.js.map +1 -0
- package/dist/internal/c4/combat.d.ts +1 -55
- package/dist/internal/c4/combat.d.ts.map +1 -1
- package/dist/internal/c4/combat.js +16 -180
- package/dist/internal/c4/combat.js.map +1 -1
- package/dist/internal/c4/crafting-storage.d.ts +20 -0
- package/dist/internal/c4/crafting-storage.d.ts.map +1 -0
- package/dist/internal/c4/crafting-storage.js +54 -0
- package/dist/internal/c4/crafting-storage.js.map +1 -0
- package/dist/internal/c4/crafting.d.ts +9 -1
- package/dist/internal/c4/crafting.d.ts.map +1 -1
- package/dist/internal/c4/crafting.js +38 -98
- package/dist/internal/c4/crafting.js.map +1 -1
- package/dist/internal/c4/currency-cache.d.ts +1 -1
- package/dist/internal/c4/currency-cache.d.ts.map +1 -1
- package/dist/internal/c4/currency-cache.js +6 -9
- package/dist/internal/c4/currency-cache.js.map +1 -1
- package/dist/internal/c4/discriminators.d.ts +93 -0
- package/dist/internal/c4/discriminators.d.ts.map +1 -0
- package/dist/internal/c4/discriminators.js +190 -0
- package/dist/internal/c4/discriminators.js.map +1 -0
- package/dist/internal/c4/faction-epoch-meter.d.ts.map +1 -1
- package/dist/internal/c4/faction-epoch-meter.js +5 -10
- package/dist/internal/c4/faction-epoch-meter.js.map +1 -1
- package/dist/internal/c4/faction-treasury.d.ts.map +1 -1
- package/dist/internal/c4/faction-treasury.js +11 -18
- package/dist/internal/c4/faction-treasury.js.map +1 -1
- package/dist/internal/c4/faction.d.ts +21 -0
- package/dist/internal/c4/faction.d.ts.map +1 -0
- package/dist/internal/c4/faction.js +23 -0
- package/dist/internal/c4/faction.js.map +1 -0
- package/dist/internal/c4/factions.d.ts +31 -3
- package/dist/internal/c4/factions.d.ts.map +1 -1
- package/dist/internal/c4/factions.js +103 -104
- package/dist/internal/c4/factions.js.map +1 -1
- package/dist/internal/c4/fleet-creation.d.ts +9 -2
- package/dist/internal/c4/fleet-creation.d.ts.map +1 -1
- package/dist/internal/c4/fleet-creation.js +15 -18
- package/dist/internal/c4/fleet-creation.js.map +1 -1
- package/dist/internal/c4/fleet-crew-binding.d.ts.map +1 -1
- package/dist/internal/c4/fleet-crew-binding.js +21 -49
- package/dist/internal/c4/fleet-crew-binding.js.map +1 -1
- package/dist/internal/c4/fleet-disband-layout.d.ts +7 -0
- package/dist/internal/c4/fleet-disband-layout.d.ts.map +1 -0
- package/dist/internal/c4/fleet-disband-layout.js +7 -0
- package/dist/internal/c4/fleet-disband-layout.js.map +1 -0
- package/dist/internal/c4/fleet-disband.d.ts +41 -0
- package/dist/internal/c4/fleet-disband.d.ts.map +1 -0
- package/dist/internal/c4/fleet-disband.js +86 -0
- package/dist/internal/c4/fleet-disband.js.map +1 -0
- package/dist/internal/c4/fleet-points.d.ts +3 -0
- package/dist/internal/c4/fleet-points.d.ts.map +1 -0
- package/dist/internal/c4/fleet-points.js +8 -0
- package/dist/internal/c4/fleet-points.js.map +1 -0
- package/dist/internal/c4/fleet-ship-assembly.d.ts +20 -5
- package/dist/internal/c4/fleet-ship-assembly.d.ts.map +1 -1
- package/dist/internal/c4/fleet-ship-assembly.js +62 -10
- package/dist/internal/c4/fleet-ship-assembly.js.map +1 -1
- package/dist/internal/c4/fleet-storage.d.ts +44 -0
- package/dist/internal/c4/fleet-storage.d.ts.map +1 -0
- package/dist/internal/c4/fleet-storage.js +108 -0
- package/dist/internal/c4/fleet-storage.js.map +1 -0
- package/dist/internal/c4/fleet-sync.d.ts +5 -0
- package/dist/internal/c4/fleet-sync.d.ts.map +1 -0
- package/dist/internal/c4/fleet-sync.js +15 -0
- package/dist/internal/c4/fleet-sync.js.map +1 -0
- package/dist/internal/c4/fleet.d.ts +20 -5
- package/dist/internal/c4/fleet.d.ts.map +1 -1
- package/dist/internal/c4/fleet.js +24 -84
- package/dist/internal/c4/fleet.js.map +1 -1
- package/dist/internal/c4/game.d.ts +76 -21
- package/dist/internal/c4/game.d.ts.map +1 -1
- package/dist/internal/c4/game.js +127 -116
- package/dist/internal/c4/game.js.map +1 -1
- package/dist/internal/c4/identity.d.ts +2 -153
- package/dist/internal/c4/identity.d.ts.map +1 -1
- package/dist/internal/c4/identity.js +19 -126
- package/dist/internal/c4/identity.js.map +1 -1
- package/dist/internal/c4/local-market-order.d.ts +4 -6
- package/dist/internal/c4/local-market-order.d.ts.map +1 -1
- package/dist/internal/c4/local-market-order.js +5 -6
- package/dist/internal/c4/local-market-order.js.map +1 -1
- package/dist/internal/c4/loot-layout.js +1 -1
- package/dist/internal/c4/loot-layout.js.map +1 -1
- package/dist/internal/c4/loot.d.ts +89 -0
- package/dist/internal/c4/loot.d.ts.map +1 -0
- package/dist/internal/c4/loot.js +109 -0
- package/dist/internal/c4/loot.js.map +1 -0
- package/dist/internal/c4/loyalty.d.ts +7 -3
- package/dist/internal/c4/loyalty.d.ts.map +1 -1
- package/dist/internal/c4/loyalty.js +41 -130
- package/dist/internal/c4/loyalty.js.map +1 -1
- package/dist/internal/c4/market-storage.d.ts +25 -0
- package/dist/internal/c4/market-storage.d.ts.map +1 -0
- package/dist/internal/c4/market-storage.js +53 -0
- package/dist/internal/c4/market-storage.js.map +1 -0
- package/dist/internal/c4/market.d.ts +3 -0
- package/dist/internal/c4/market.d.ts.map +1 -1
- package/dist/internal/c4/market.js +20 -76
- package/dist/internal/c4/market.js.map +1 -1
- package/dist/internal/c4/mining-instructions.d.ts +1 -1
- package/dist/internal/c4/mining-instructions.d.ts.map +1 -1
- package/dist/internal/c4/mining-instructions.js +1 -1
- package/dist/internal/c4/mining-instructions.js.map +1 -1
- package/dist/internal/c4/open-signal.d.ts +1 -1
- package/dist/internal/c4/open-signal.d.ts.map +1 -1
- package/dist/internal/c4/open-signal.js +1 -1
- package/dist/internal/c4/open-signal.js.map +1 -1
- package/dist/internal/c4/pda.d.ts +49 -1
- package/dist/internal/c4/pda.d.ts.map +1 -1
- package/dist/internal/c4/pda.js +122 -17
- package/dist/internal/c4/pda.js.map +1 -1
- package/dist/internal/c4/profile-faction.d.ts +2 -1
- package/dist/internal/c4/profile-faction.d.ts.map +1 -1
- package/dist/internal/c4/profile-faction.js +36 -72
- package/dist/internal/c4/profile-faction.js.map +1 -1
- package/dist/internal/c4/profile-permissions.d.ts +1 -1
- package/dist/internal/c4/profile-permissions.d.ts.map +1 -1
- package/dist/internal/c4/profile-permissions.js +16 -1
- package/dist/internal/c4/profile-permissions.js.map +1 -1
- package/dist/internal/c4/rewards.d.ts +1 -34
- package/dist/internal/c4/rewards.d.ts.map +1 -1
- package/dist/internal/c4/rewards.js +23 -170
- package/dist/internal/c4/rewards.js.map +1 -1
- package/dist/internal/c4/runtime-bindings.d.ts +2 -1
- package/dist/internal/c4/runtime-bindings.d.ts.map +1 -1
- package/dist/internal/c4/runtime-bindings.js +1 -1
- package/dist/internal/c4/runtime-bindings.js.map +1 -1
- package/dist/internal/c4/scan-lifecycle.d.ts +21 -3
- package/dist/internal/c4/scan-lifecycle.d.ts.map +1 -1
- package/dist/internal/c4/scan-lifecycle.js +35 -44
- package/dist/internal/c4/scan-lifecycle.js.map +1 -1
- package/dist/internal/c4/scan-storage.d.ts +7 -0
- package/dist/internal/c4/scan-storage.d.ts.map +1 -0
- package/dist/internal/c4/scan-storage.js +10 -0
- package/dist/internal/c4/scan-storage.js.map +1 -0
- package/dist/internal/c4/scanning.d.ts +3 -13
- package/dist/internal/c4/scanning.d.ts.map +1 -1
- package/dist/internal/c4/scanning.js +25 -75
- package/dist/internal/c4/scanning.js.map +1 -1
- package/dist/internal/c4/ship-stats.d.ts.map +1 -1
- package/dist/internal/c4/ship-stats.js +24 -26
- package/dist/internal/c4/ship-stats.js.map +1 -1
- package/dist/internal/c4/starbase.d.ts.map +1 -1
- package/dist/internal/c4/starbase.js +24 -96
- package/dist/internal/c4/starbase.js.map +1 -1
- package/dist/internal/c4/stimulant.d.ts +26 -0
- package/dist/internal/c4/stimulant.d.ts.map +1 -0
- package/dist/internal/c4/stimulant.js +36 -0
- package/dist/internal/c4/stimulant.js.map +1 -0
- package/dist/internal/c4/wallet-cargo-cache.js +2 -1
- package/dist/internal/c4/wallet-cargo-cache.js.map +1 -1
- package/dist/internal/c4/world.d.ts +6 -2
- package/dist/internal/c4/world.d.ts.map +1 -1
- package/dist/internal/c4/world.js +32 -107
- package/dist/internal/c4/world.js.map +1 -1
- package/dist/internal/fleet-route.d.ts +12 -0
- package/dist/internal/fleet-route.d.ts.map +1 -0
- package/dist/internal/fleet-route.js +11 -0
- package/dist/internal/fleet-route.js.map +1 -0
- package/dist/internal/fleet.d.ts +3 -3
- package/dist/internal/fleet.d.ts.map +1 -1
- package/dist/internal/fleet.js +1 -5
- package/dist/internal/fleet.js.map +1 -1
- package/dist/internal/loyalty-atlas-bank-state.d.ts +3 -2
- package/dist/internal/loyalty-atlas-bank-state.d.ts.map +1 -1
- package/dist/internal/loyalty-atlas-bank-state.js +4 -3
- package/dist/internal/loyalty-atlas-bank-state.js.map +1 -1
- package/dist/internal/planning/account-state.d.ts +6 -0
- package/dist/internal/planning/account-state.d.ts.map +1 -1
- package/dist/internal/planning/account-state.js +13 -0
- package/dist/internal/planning/account-state.js.map +1 -1
- package/dist/internal/planning/arrival-guards.d.ts +0 -1
- package/dist/internal/planning/arrival-guards.d.ts.map +1 -1
- package/dist/internal/planning/arrival-guards.js +3 -18
- package/dist/internal/planning/arrival-guards.js.map +1 -1
- package/dist/internal/planning/authorization-adapter.d.ts +59 -36
- package/dist/internal/planning/authorization-adapter.d.ts.map +1 -1
- package/dist/internal/planning/authorization-adapter.js +165 -71
- package/dist/internal/planning/authorization-adapter.js.map +1 -1
- package/dist/internal/planning/cargo-storage-actions.d.ts +8 -0
- package/dist/internal/planning/cargo-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/cargo-storage-actions.js +97 -0
- package/dist/internal/planning/cargo-storage-actions.js.map +1 -0
- package/dist/internal/planning/character-access.d.ts +28 -0
- package/dist/internal/planning/character-access.d.ts.map +1 -0
- package/dist/internal/planning/character-access.js +41 -0
- package/dist/internal/planning/character-access.js.map +1 -0
- package/dist/internal/planning/character-registration-guard.d.ts.map +1 -1
- package/dist/internal/planning/character-registration-guard.js +2 -1
- package/dist/internal/planning/character-registration-guard.js.map +1 -1
- package/dist/internal/planning/character-registration.d.ts.map +1 -1
- package/dist/internal/planning/character-registration.js +2 -1
- package/dist/internal/planning/character-registration.js.map +1 -1
- package/dist/internal/planning/claim-stake-storage-actions.d.ts +12 -0
- package/dist/internal/planning/claim-stake-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/claim-stake-storage-actions.js +63 -0
- package/dist/internal/planning/claim-stake-storage-actions.js.map +1 -0
- package/dist/internal/planning/combat-storage-actions.d.ts +9 -0
- package/dist/internal/planning/combat-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/combat-storage-actions.js +55 -0
- package/dist/internal/planning/combat-storage-actions.js.map +1 -0
- package/dist/internal/planning/crafting-storage-actions.d.ts +7 -0
- package/dist/internal/planning/crafting-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/crafting-storage-actions.js +64 -0
- package/dist/internal/planning/crafting-storage-actions.js.map +1 -0
- package/dist/internal/planning/currency-cache-guard.d.ts +3 -1
- package/dist/internal/planning/currency-cache-guard.d.ts.map +1 -1
- package/dist/internal/planning/currency-cache-guard.js +47 -2
- package/dist/internal/planning/currency-cache-guard.js.map +1 -1
- package/dist/internal/planning/democracy-history.d.ts.map +1 -1
- package/dist/internal/planning/democracy-history.js +6 -15
- package/dist/internal/planning/democracy-history.js.map +1 -1
- package/dist/internal/planning/direct-options.d.ts +17 -0
- package/dist/internal/planning/direct-options.d.ts.map +1 -0
- package/dist/internal/planning/direct-options.js +43 -0
- package/dist/internal/planning/direct-options.js.map +1 -0
- package/dist/internal/planning/disband-storage-actions.d.ts +9 -0
- package/dist/internal/planning/disband-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/disband-storage-actions.js +24 -0
- package/dist/internal/planning/disband-storage-actions.js.map +1 -0
- package/dist/internal/planning/faction-enrollment.d.ts +0 -2
- package/dist/internal/planning/faction-enrollment.d.ts.map +1 -1
- package/dist/internal/planning/faction-enrollment.js +0 -9
- package/dist/internal/planning/faction-enrollment.js.map +1 -1
- package/dist/internal/planning/fleet-arrival.d.ts.map +1 -1
- package/dist/internal/planning/fleet-arrival.js +10 -8
- package/dist/internal/planning/fleet-arrival.js.map +1 -1
- package/dist/internal/planning/fleet-attack-xp.d.ts.map +1 -1
- package/dist/internal/planning/fleet-attack-xp.js +5 -11
- package/dist/internal/planning/fleet-attack-xp.js.map +1 -1
- package/dist/internal/planning/fleet-creation.d.ts.map +1 -1
- package/dist/internal/planning/fleet-creation.js +17 -36
- package/dist/internal/planning/fleet-creation.js.map +1 -1
- package/dist/internal/planning/fleet-crew-guard.d.ts +2 -1
- package/dist/internal/planning/fleet-crew-guard.d.ts.map +1 -1
- package/dist/internal/planning/fleet-crew-guard.js +2 -1
- package/dist/internal/planning/fleet-crew-guard.js.map +1 -1
- package/dist/internal/planning/fleet-crew-transfer.d.ts +1 -1
- package/dist/internal/planning/fleet-crew-transfer.d.ts.map +1 -1
- package/dist/internal/planning/fleet-crew-transfer.js +45 -24
- package/dist/internal/planning/fleet-crew-transfer.js.map +1 -1
- package/dist/internal/planning/fleet-disband-guard.d.ts +12 -0
- package/dist/internal/planning/fleet-disband-guard.d.ts.map +1 -0
- package/dist/internal/planning/fleet-disband-guard.js +54 -0
- package/dist/internal/planning/fleet-disband-guard.js.map +1 -0
- package/dist/internal/planning/fleet-disband.d.ts +36 -0
- package/dist/internal/planning/fleet-disband.d.ts.map +1 -0
- package/dist/internal/planning/fleet-disband.js +82 -0
- package/dist/internal/planning/fleet-disband.js.map +1 -0
- package/dist/internal/planning/fleet-dock-funding-guard.d.ts +3 -3
- package/dist/internal/planning/fleet-dock-funding-guard.d.ts.map +1 -1
- package/dist/internal/planning/fleet-dock-funding-guard.js +87 -96
- package/dist/internal/planning/fleet-dock-funding-guard.js.map +1 -1
- package/dist/internal/planning/fleet-dock-funding.d.ts.map +1 -1
- package/dist/internal/planning/fleet-dock-funding.js +10 -0
- package/dist/internal/planning/fleet-dock-funding.js.map +1 -1
- package/dist/internal/planning/fleet-docking-guard.d.ts.map +1 -1
- package/dist/internal/planning/fleet-docking-guard.js +3 -1
- package/dist/internal/planning/fleet-docking-guard.js.map +1 -1
- package/dist/internal/planning/fleet-docking.d.ts +17 -2
- package/dist/internal/planning/fleet-docking.d.ts.map +1 -1
- package/dist/internal/planning/fleet-docking.js +83 -62
- package/dist/internal/planning/fleet-docking.js.map +1 -1
- package/dist/internal/planning/fleet-rental.d.ts +5 -0
- package/dist/internal/planning/fleet-rental.d.ts.map +1 -0
- package/dist/internal/planning/fleet-rental.js +9 -0
- package/dist/internal/planning/fleet-rental.js.map +1 -0
- package/dist/internal/planning/fleet-respawn.d.ts.map +1 -1
- package/dist/internal/planning/fleet-respawn.js +10 -12
- package/dist/internal/planning/fleet-respawn.js.map +1 -1
- package/dist/internal/planning/fleet-ship-assembly.d.ts +2 -0
- package/dist/internal/planning/fleet-ship-assembly.d.ts.map +1 -1
- package/dist/internal/planning/fleet-ship-assembly.js +94 -64
- package/dist/internal/planning/fleet-ship-assembly.js.map +1 -1
- package/dist/internal/planning/fleet-state.d.ts +25 -0
- package/dist/internal/planning/fleet-state.d.ts.map +1 -0
- package/dist/internal/planning/fleet-state.js +28 -0
- package/dist/internal/planning/fleet-state.js.map +1 -0
- package/dist/internal/planning/governance-fees.d.ts.map +1 -1
- package/dist/internal/planning/governance-fees.js +7 -15
- package/dist/internal/planning/governance-fees.js.map +1 -1
- package/dist/internal/planning/local-market-order-funding.d.ts.map +1 -1
- package/dist/internal/planning/local-market-order-funding.js +4 -2
- package/dist/internal/planning/local-market-order-funding.js.map +1 -1
- package/dist/internal/planning/local-market-order.d.ts +4 -4
- package/dist/internal/planning/local-market-order.d.ts.map +1 -1
- package/dist/internal/planning/local-market-order.js +82 -109
- package/dist/internal/planning/local-market-order.js.map +1 -1
- package/dist/internal/planning/market-storage-actions.d.ts +7 -0
- package/dist/internal/planning/market-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/market-storage-actions.js +71 -0
- package/dist/internal/planning/market-storage-actions.js.map +1 -0
- package/dist/internal/planning/mining-stop.d.ts.map +1 -1
- package/dist/internal/planning/mining-stop.js +2 -1
- package/dist/internal/planning/mining-stop.js.map +1 -1
- package/dist/internal/planning/mining-storage-actions.d.ts +11 -0
- package/dist/internal/planning/mining-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/mining-storage-actions.js +57 -0
- package/dist/internal/planning/mining-storage-actions.js.map +1 -0
- package/dist/internal/planning/movement-storage-actions.d.ts +7 -0
- package/dist/internal/planning/movement-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/movement-storage-actions.js +38 -0
- package/dist/internal/planning/movement-storage-actions.js.map +1 -0
- package/dist/internal/planning/movement-xp-guard.d.ts.map +1 -1
- package/dist/internal/planning/movement-xp-guard.js +3 -2
- package/dist/internal/planning/movement-xp-guard.js.map +1 -1
- package/dist/internal/planning/open-signal-guard.d.ts.map +1 -1
- package/dist/internal/planning/open-signal-guard.js +2 -1
- package/dist/internal/planning/open-signal-guard.js.map +1 -1
- package/dist/internal/planning/open-signal.d.ts.map +1 -1
- package/dist/internal/planning/open-signal.js +16 -7
- package/dist/internal/planning/open-signal.js.map +1 -1
- package/dist/internal/planning/original-token.d.ts +40 -0
- package/dist/internal/planning/original-token.d.ts.map +1 -0
- package/dist/internal/planning/original-token.js +112 -0
- package/dist/internal/planning/original-token.js.map +1 -0
- package/dist/internal/planning/own-starbase-facts.d.ts +37 -0
- package/dist/internal/planning/own-starbase-facts.d.ts.map +1 -0
- package/dist/internal/planning/own-starbase-facts.js +52 -0
- package/dist/internal/planning/own-starbase-facts.js.map +1 -0
- package/dist/internal/planning/plan-fields.d.ts +60 -0
- package/dist/internal/planning/plan-fields.d.ts.map +1 -0
- package/dist/internal/planning/plan-fields.js +159 -0
- package/dist/internal/planning/plan-fields.js.map +1 -0
- package/dist/internal/planning/plan-guards.d.ts +4 -0
- package/dist/internal/planning/plan-guards.d.ts.map +1 -0
- package/dist/internal/planning/plan-guards.js +184 -0
- package/dist/internal/planning/plan-guards.js.map +1 -0
- package/dist/internal/planning/profile-key.d.ts +13 -0
- package/dist/internal/planning/profile-key.d.ts.map +1 -0
- package/dist/internal/planning/profile-key.js +20 -0
- package/dist/internal/planning/profile-key.js.map +1 -0
- package/dist/internal/planning/profile-storage-funding-guard.d.ts +29 -0
- package/dist/internal/planning/profile-storage-funding-guard.d.ts.map +1 -0
- package/dist/internal/planning/profile-storage-funding-guard.js +115 -0
- package/dist/internal/planning/profile-storage-funding-guard.js.map +1 -0
- package/dist/internal/planning/profile-storage-funding.d.ts +46 -0
- package/dist/internal/planning/profile-storage-funding.d.ts.map +1 -0
- package/dist/internal/planning/profile-storage-funding.js +58 -0
- package/dist/internal/planning/profile-storage-funding.js.map +1 -0
- package/dist/internal/planning/recipe-state.d.ts +4 -1
- package/dist/internal/planning/recipe-state.d.ts.map +1 -1
- package/dist/internal/planning/recipe-state.js +7 -4
- package/dist/internal/planning/recipe-state.js.map +1 -1
- package/dist/internal/planning/region-access.d.ts +30 -0
- package/dist/internal/planning/region-access.d.ts.map +1 -0
- package/dist/internal/planning/region-access.js +94 -0
- package/dist/internal/planning/region-access.js.map +1 -0
- package/dist/internal/planning/rent-catalog.d.ts +37 -0
- package/dist/internal/planning/rent-catalog.d.ts.map +1 -0
- package/dist/internal/planning/rent-catalog.js +165 -0
- package/dist/internal/planning/rent-catalog.js.map +1 -0
- package/dist/internal/planning/research-unlock.d.ts +69 -0
- package/dist/internal/planning/research-unlock.d.ts.map +1 -0
- package/dist/internal/planning/research-unlock.js +287 -0
- package/dist/internal/planning/research-unlock.js.map +1 -0
- package/dist/internal/planning/respawn-guards.js +2 -1
- package/dist/internal/planning/respawn-guards.js.map +1 -1
- package/dist/internal/planning/runtime-guards.d.ts +0 -2
- package/dist/internal/planning/runtime-guards.d.ts.map +1 -1
- package/dist/internal/planning/runtime-guards.js +49 -29
- package/dist/internal/planning/runtime-guards.js.map +1 -1
- package/dist/internal/planning/scan-completion-guard.d.ts +6 -6
- package/dist/internal/planning/scan-completion-guard.d.ts.map +1 -1
- package/dist/internal/planning/scan-completion-guard.js +8 -7
- package/dist/internal/planning/scan-completion-guard.js.map +1 -1
- package/dist/internal/planning/scan-completion.d.ts.map +1 -1
- package/dist/internal/planning/scan-completion.js +9 -7
- package/dist/internal/planning/scan-completion.js.map +1 -1
- package/dist/internal/planning/scan-detect-guard.d.ts +1 -1
- package/dist/internal/planning/scan-detect-guard.d.ts.map +1 -1
- package/dist/internal/planning/scan-detect-guard.js +2 -2
- package/dist/internal/planning/scan-detect-guard.js.map +1 -1
- package/dist/internal/planning/scan-detect.d.ts +1 -1
- package/dist/internal/planning/scan-detect.d.ts.map +1 -1
- package/dist/internal/planning/scan-detect.js +10 -8
- package/dist/internal/planning/scan-detect.js.map +1 -1
- package/dist/internal/planning/scan-idle-scope.d.ts +5 -0
- package/dist/internal/planning/scan-idle-scope.d.ts.map +1 -0
- package/dist/internal/planning/scan-idle-scope.js +5 -0
- package/dist/internal/planning/scan-idle-scope.js.map +1 -0
- package/dist/internal/planning/scan-storage-actions.d.ts +9 -0
- package/dist/internal/planning/scan-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/scan-storage-actions.js +27 -0
- package/dist/internal/planning/scan-storage-actions.js.map +1 -0
- package/dist/internal/planning/ship-import-funding.js +3 -2
- package/dist/internal/planning/ship-import-funding.js.map +1 -1
- package/dist/internal/planning/ship-token.d.ts +1 -5
- package/dist/internal/planning/ship-token.d.ts.map +1 -1
- package/dist/internal/planning/ship-token.js +0 -36
- package/dist/internal/planning/ship-token.js.map +1 -1
- package/dist/internal/planning/starbase-player-owner.d.ts +21 -0
- package/dist/internal/planning/starbase-player-owner.d.ts.map +1 -0
- package/dist/internal/planning/starbase-player-owner.js +17 -0
- package/dist/internal/planning/starbase-player-owner.js.map +1 -0
- package/dist/internal/planning/starbase-player-recovery-guard.d.ts +7 -0
- package/dist/internal/planning/starbase-player-recovery-guard.d.ts.map +1 -0
- package/dist/internal/planning/starbase-player-recovery-guard.js +39 -0
- package/dist/internal/planning/starbase-player-recovery-guard.js.map +1 -0
- package/dist/internal/planning/starbase-system-guard.d.ts.map +1 -1
- package/dist/internal/planning/starbase-system-guard.js +2 -1
- package/dist/internal/planning/starbase-system-guard.js.map +1 -1
- package/dist/internal/planning/starbase-system.d.ts +5 -2
- package/dist/internal/planning/starbase-system.d.ts.map +1 -1
- package/dist/internal/planning/starbase-system.js +6 -3
- package/dist/internal/planning/starbase-system.js.map +1 -1
- package/dist/internal/planning/storage-action-readers.d.ts +10 -0
- package/dist/internal/planning/storage-action-readers.d.ts.map +1 -0
- package/dist/internal/planning/storage-action-readers.js +58 -0
- package/dist/internal/planning/storage-action-readers.js.map +1 -0
- package/dist/internal/planning/storage-actions.d.ts +89 -0
- package/dist/internal/planning/storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/storage-actions.js +183 -0
- package/dist/internal/planning/storage-actions.js.map +1 -0
- package/dist/internal/planning/token-mint.d.ts.map +1 -1
- package/dist/internal/planning/token-mint.js +2 -1
- package/dist/internal/planning/token-mint.js.map +1 -1
- package/dist/internal/planning/trade-faction-market.d.ts.map +1 -1
- package/dist/internal/planning/trade-faction-market.js +4 -4
- package/dist/internal/planning/trade-faction-market.js.map +1 -1
- package/dist/internal/planning/wallet-starbase.d.ts +34 -0
- package/dist/internal/planning/wallet-starbase.d.ts.map +1 -0
- package/dist/internal/planning/wallet-starbase.js +39 -0
- package/dist/internal/planning/wallet-starbase.js.map +1 -0
- package/dist/internal/planning/xp-runtime.d.ts.map +1 -1
- package/dist/internal/planning/xp-runtime.js +16 -20
- package/dist/internal/planning/xp-runtime.js.map +1 -1
- package/dist/internal/read-meta.d.ts +12 -0
- package/dist/internal/read-meta.d.ts.map +1 -1
- package/dist/internal/read-meta.js +10 -0
- package/dist/internal/read-meta.js.map +1 -1
- package/dist/loyalty/actions/index.d.ts +1 -1
- package/dist/loyalty/actions/index.d.ts.map +1 -1
- package/dist/loyalty/actions/index.js +12 -43
- package/dist/loyalty/actions/index.js.map +1 -1
- package/dist/loyalty/index.d.ts +4 -0
- package/dist/loyalty/index.d.ts.map +1 -1
- package/dist/loyalty/index.js +19 -27
- package/dist/loyalty/index.js.map +1 -1
- package/dist/markets/actions/index.d.ts +1 -1
- package/dist/markets/actions/index.d.ts.map +1 -1
- package/dist/markets/actions/index.js +140 -178
- package/dist/markets/actions/index.js.map +1 -1
- package/dist/markets/actions/trade-faction-market.d.ts +4 -2
- package/dist/markets/actions/trade-faction-market.d.ts.map +1 -1
- package/dist/markets/actions/trade-faction-market.js +59 -39
- package/dist/markets/actions/trade-faction-market.js.map +1 -1
- package/dist/markets/index.d.ts.map +1 -1
- package/dist/markets/index.js +3 -11
- package/dist/markets/index.js.map +1 -1
- package/dist/mining/actions/index.d.ts +1 -1
- package/dist/mining/actions/index.d.ts.map +1 -1
- package/dist/mining/actions/index.js +84 -47
- package/dist/mining/actions/index.js.map +1 -1
- package/dist/mining/estimate-input.d.ts +103 -0
- package/dist/mining/estimate-input.d.ts.map +1 -0
- package/dist/mining/estimate-input.js +86 -0
- package/dist/mining/estimate-input.js.map +1 -0
- package/dist/mining/index.d.ts +1 -0
- package/dist/mining/index.d.ts.map +1 -1
- package/dist/mining/index.js +4 -11
- package/dist/mining/index.js.map +1 -1
- package/dist/planning/assembly.d.ts +1 -1
- package/dist/planning/assembly.d.ts.map +1 -1
- package/dist/planning/assembly.js +6 -30
- package/dist/planning/assembly.js.map +1 -1
- package/dist/planning/execution.d.ts +1 -0
- package/dist/planning/execution.d.ts.map +1 -1
- package/dist/planning/execution.js +149 -45
- package/dist/planning/execution.js.map +1 -1
- package/dist/planning/index.d.ts +70 -7
- package/dist/planning/index.d.ts.map +1 -1
- package/dist/planning/index.js +28 -1141
- package/dist/planning/index.js.map +1 -1
- package/dist/planning/plan-construction.d.ts +25 -0
- package/dist/planning/plan-construction.d.ts.map +1 -0
- package/dist/planning/plan-construction.js +143 -0
- package/dist/planning/plan-construction.js.map +1 -0
- package/dist/planning/plan-sequence-execution.d.ts.map +1 -1
- package/dist/planning/plan-sequence-execution.js +1 -11
- package/dist/planning/plan-sequence-execution.js.map +1 -1
- package/dist/planning/plan-validation.d.ts +17 -0
- package/dist/planning/plan-validation.d.ts.map +1 -0
- package/dist/planning/plan-validation.js +147 -0
- package/dist/planning/plan-validation.js.map +1 -0
- package/dist/registry/cargo.d.ts +2 -2
- package/dist/registry/cargo.d.ts.map +1 -1
- package/dist/registry/cargo.js +3 -4
- package/dist/registry/cargo.js.map +1 -1
- package/dist/registry/definition-section-snapshot.d.ts +1 -1
- package/dist/registry/definition-section-snapshot.d.ts.map +1 -1
- package/dist/registry/definition-section-snapshot.js +10 -3
- package/dist/registry/definition-section-snapshot.js.map +1 -1
- package/dist/registry/index.d.ts +31 -4
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +226 -227
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/onboarding.d.ts.map +1 -1
- package/dist/registry/onboarding.js +4 -2
- package/dist/registry/onboarding.js.map +1 -1
- package/dist/registry/ship-stats-snapshot.d.ts.map +1 -1
- package/dist/registry/ship-stats-snapshot.js +19 -5
- package/dist/registry/ship-stats-snapshot.js.map +1 -1
- package/dist/registry/ships.js +1 -1
- package/dist/registry/ships.js.map +1 -1
- package/dist/rewards/index.d.ts +11 -5
- package/dist/rewards/index.d.ts.map +1 -1
- package/dist/rewards/index.js +10 -21
- package/dist/rewards/index.js.map +1 -1
- package/dist/scanning/actions/index.d.ts +1 -1
- package/dist/scanning/actions/index.d.ts.map +1 -1
- package/dist/scanning/actions/index.js +38 -8
- package/dist/scanning/actions/index.js.map +1 -1
- package/dist/scanning/index.d.ts +6 -11
- package/dist/scanning/index.d.ts.map +1 -1
- package/dist/scanning/index.js +7 -15
- package/dist/scanning/index.js.map +1 -1
- package/dist/scanning/odds.d.ts +5 -1
- package/dist/scanning/odds.d.ts.map +1 -1
- package/dist/scanning/odds.js.map +1 -1
- package/dist/scanning/signals.d.ts +6 -1
- package/dist/scanning/signals.d.ts.map +1 -1
- package/dist/scanning/signals.js +3 -1
- package/dist/scanning/signals.js.map +1 -1
- package/dist/starbases/actions/index.d.ts +49 -4
- package/dist/starbases/actions/index.d.ts.map +1 -1
- package/dist/starbases/actions/index.js +120 -69
- package/dist/starbases/actions/index.js.map +1 -1
- package/dist/starbases/index.d.ts +18 -0
- package/dist/starbases/index.d.ts.map +1 -1
- package/dist/starbases/index.js +24 -11
- package/dist/starbases/index.js.map +1 -1
- package/dist/world/index.d.ts +87 -13
- package/dist/world/index.d.ts.map +1 -1
- package/dist/world/index.js +88 -22
- package/dist/world/index.js.map +1 -1
- package/dist/world/planet-claim-stake-plots.d.ts +49 -40
- package/dist/world/planet-claim-stake-plots.d.ts.map +1 -1
- package/dist/world/planet-claim-stake-plots.js +47 -40
- package/dist/world/planet-claim-stake-plots.js.map +1 -1
- package/dist/world/starbase-status.d.ts +54 -13
- package/dist/world/starbase-status.d.ts.map +1 -1
- package/dist/world/starbase-status.js +65 -0
- package/dist/world/starbase-status.js.map +1 -1
- package/package.json +2 -2
- package/dist/internal/c4/faction-adapter.d.ts +0 -12
- package/dist/internal/c4/faction-adapter.d.ts.map +0 -1
- package/dist/internal/c4/faction-adapter.js +0 -52
- package/dist/internal/c4/faction-adapter.js.map +0 -1
- package/dist/internal/planning/movement-character.d.ts +0 -7
- package/dist/internal/planning/movement-character.d.ts.map +0 -1
- package/dist/internal/planning/movement-character.js +0 -41
- package/dist/internal/planning/movement-character.js.map +0 -1
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import { deriveCurrencyCache, validateCurrencyCache, } from '../../internal/c4/currency-cache.js';
|
|
2
2
|
import { validateStarbaseSystem } from '../../internal/planning/starbase-system.js';
|
|
3
3
|
import { SYSTEM_PROGRAM } from '../../internal/system-program.js';
|
|
4
|
-
import {
|
|
4
|
+
import { isAddress } from '@solana/kit';
|
|
5
5
|
import { resolveActionRuntime } from '../../internal/planning/action-runtime.js';
|
|
6
|
+
import { requireProfileStarbasePlayer } from '../../internal/planning/starbase-player-owner.js';
|
|
6
7
|
import { InvalidActionInputError, SageSdkError } from '../../client/errors.js';
|
|
7
8
|
import { readContextRawAccounts } from '../../client/reconciliation.js';
|
|
8
|
-
import {
|
|
9
|
+
import { SAGE_PROGRAM_ADDRESS } from '../../internal/c4/runtime-bindings.js';
|
|
9
10
|
import { craftingHabAccountDefinition, craftingProcessAccountDefinition, deriveRecipeAddress, recipeAccountDefinition, } from '../../internal/c4/crafting.js';
|
|
10
|
-
import { characterAccountDefinition, findCharacterPda, } from '../../internal/c4/
|
|
11
|
+
import { characterAccountDefinition, findCharacterPda, } from '../../internal/c4/character.js';
|
|
11
12
|
import { deriveStarbasePlayerAddress, starbasePlayerAccountDefinition, } from '../../internal/c4/starbase.js';
|
|
12
13
|
import { deriveInternalCraftingProcessState } from '../../internal/crafting-process-state.js';
|
|
13
14
|
import { requireGameAddress } from '../../internal/game-context.js';
|
|
14
|
-
import { adaptCancelCraftingProcessInstruction, adaptStartCraftingProcessInstruction, adaptCompleteCraftingProcessInstruction,
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { adaptCancelCraftingProcessInstruction, adaptStartCraftingProcessInstruction, adaptCompleteCraftingProcessInstruction, readPlanAuthorization, } from '../../internal/planning/authorization-adapter.js';
|
|
16
|
+
import { starSystemAccountDefinition } from '../../internal/c4/world.js';
|
|
17
|
+
import { buildPlannerPlan } from '../../planning/plan-construction.js';
|
|
17
18
|
import { hashRecipeConfiguration, validateRecipeUsage, } from '../../internal/planning/recipe-state.js';
|
|
19
|
+
import { accountStatePrecondition } from '../../internal/planning/account-state.js';
|
|
20
|
+
import { GAME_DISCRIMINATOR } from '../../internal/c4/discriminators.js';
|
|
21
|
+
import { readCraftingStorageAction } from '../../internal/planning/crafting-storage-actions.js';
|
|
22
|
+
import { planStorageFunding } from '../../internal/planning/storage-actions.js';
|
|
23
|
+
import { RENT_ADDRESS } from '../../internal/planning/rent.js';
|
|
18
24
|
const U64_MAX = (1n << 64n) - 1n;
|
|
19
25
|
const U32_MAX = 4_294_967_295;
|
|
20
26
|
function invalid(field, value, acceptedRange, remedy) {
|
|
@@ -43,15 +49,7 @@ function readAddress(value, field) {
|
|
|
43
49
|
function validateStartOptions(value) {
|
|
44
50
|
const options = readRecord(value, 'options');
|
|
45
51
|
assertKeys(options, 'options', ['authorization', 'craftingProcess', 'quantity', 'numCrew'], ['craftingHab']);
|
|
46
|
-
const
|
|
47
|
-
assertKeys(authorizationRecord, 'authorization', ['profile', 'authority', 'keyIndex'], ['certificate']);
|
|
48
|
-
const authorization = authorizationRecord;
|
|
49
|
-
readAddress(authorization.profile, 'authorization.profile');
|
|
50
|
-
readAddress(authorization.authority, 'authorization.authority');
|
|
51
|
-
if (authorization.certificate !== undefined) {
|
|
52
|
-
readAddress(authorization.certificate, 'authorization.certificate');
|
|
53
|
-
}
|
|
54
|
-
validatePlanAuthorization(authorization);
|
|
52
|
+
const authorization = readPlanAuthorization(options.authorization);
|
|
55
53
|
if (typeof options.quantity !== 'bigint' ||
|
|
56
54
|
options.quantity <= 0n ||
|
|
57
55
|
options.quantity > U64_MAX) {
|
|
@@ -59,9 +57,9 @@ function validateStartOptions(value) {
|
|
|
59
57
|
}
|
|
60
58
|
if (typeof options.numCrew !== 'number' ||
|
|
61
59
|
!Number.isInteger(options.numCrew) ||
|
|
62
|
-
options.numCrew <
|
|
60
|
+
options.numCrew < 1 ||
|
|
63
61
|
options.numCrew > U32_MAX) {
|
|
64
|
-
invalid('numCrew', options.numCrew, `an integer from
|
|
62
|
+
invalid('numCrew', options.numCrew, `an integer from 1 through ${String(U32_MAX)} (unsigned u32)`, 'Set numCrew to at least one crew member, within the instruction codec range; a Crafting Process cannot start without crew.');
|
|
65
63
|
}
|
|
66
64
|
return {
|
|
67
65
|
authorization,
|
|
@@ -73,18 +71,11 @@ function validateStartOptions(value) {
|
|
|
73
71
|
: { craftingHab: options.craftingHab }),
|
|
74
72
|
};
|
|
75
73
|
}
|
|
76
|
-
|
|
74
|
+
/** Validates completion or cancellation options, which share one shape. */
|
|
75
|
+
function validateProcessOptions(value) {
|
|
77
76
|
const options = readRecord(value, 'options');
|
|
78
77
|
assertKeys(options, 'options', ['authorization', 'atUnixSeconds']);
|
|
79
|
-
const
|
|
80
|
-
assertKeys(authorizationRecord, 'authorization', ['profile', 'authority', 'keyIndex'], ['certificate']);
|
|
81
|
-
const authorization = authorizationRecord;
|
|
82
|
-
readAddress(authorization.profile, 'authorization.profile');
|
|
83
|
-
readAddress(authorization.authority, 'authorization.authority');
|
|
84
|
-
if (authorization.certificate !== undefined) {
|
|
85
|
-
readAddress(authorization.certificate, 'authorization.certificate');
|
|
86
|
-
}
|
|
87
|
-
validatePlanAuthorization(authorization);
|
|
78
|
+
const authorization = readPlanAuthorization(options.authorization);
|
|
88
79
|
if (typeof options.atUnixSeconds !== 'bigint' || options.atUnixSeconds < 0n) {
|
|
89
80
|
invalid('atUnixSeconds', options.atUnixSeconds, 'a non-negative bigint Unix timestamp', 'Set atUnixSeconds to the explicit current Unix timestamp before retrying.');
|
|
90
81
|
}
|
|
@@ -92,20 +83,8 @@ function validateCompleteOptions(value) {
|
|
|
92
83
|
}
|
|
93
84
|
function validateCancelOptions(value) {
|
|
94
85
|
const options = readRecord(value, 'options');
|
|
95
|
-
assertKeys(options, 'options', ['authorization'
|
|
96
|
-
|
|
97
|
-
assertKeys(authorizationRecord, 'authorization', ['profile', 'authority', 'keyIndex'], ['certificate']);
|
|
98
|
-
const authorization = authorizationRecord;
|
|
99
|
-
readAddress(authorization.profile, 'authorization.profile');
|
|
100
|
-
readAddress(authorization.authority, 'authorization.authority');
|
|
101
|
-
if (authorization.certificate !== undefined) {
|
|
102
|
-
readAddress(authorization.certificate, 'authorization.certificate');
|
|
103
|
-
}
|
|
104
|
-
validatePlanAuthorization(authorization);
|
|
105
|
-
if (typeof options.atUnixSeconds !== 'bigint' || options.atUnixSeconds < 0n) {
|
|
106
|
-
invalid('atUnixSeconds', options.atUnixSeconds, 'a non-negative bigint Unix timestamp', 'Set atUnixSeconds to the explicit current Unix timestamp before retrying.');
|
|
107
|
-
}
|
|
108
|
-
return { atUnixSeconds: options.atUnixSeconds, authorization };
|
|
86
|
+
assertKeys(options, 'options', ['authorization']);
|
|
87
|
+
return { authorization: readPlanAuthorization(options.authorization) };
|
|
109
88
|
}
|
|
110
89
|
function fail(message, address) {
|
|
111
90
|
throw new SageSdkError('ACTION_PRECONDITION_FAILED', message, { address });
|
|
@@ -139,22 +118,6 @@ function validateKnownInputs(recipe, items, quantity, source, sourceAddress) {
|
|
|
139
118
|
}
|
|
140
119
|
}
|
|
141
120
|
}
|
|
142
|
-
async function hashAccountState(account) {
|
|
143
|
-
const owner = getAddressEncoder().encode(account.owner);
|
|
144
|
-
const canonical = new Uint8Array(owner.length + account.data.length);
|
|
145
|
-
canonical.set(owner);
|
|
146
|
-
canonical.set(account.data, owner.length);
|
|
147
|
-
const digest = new Uint8Array(await globalThis.crypto.subtle.digest('SHA-256', canonical));
|
|
148
|
-
return [...digest].map((byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
149
|
-
}
|
|
150
|
-
async function precondition(account, describes) {
|
|
151
|
-
return Object.freeze({
|
|
152
|
-
address: account.address,
|
|
153
|
-
dataHash: await hashAccountState(account),
|
|
154
|
-
describes,
|
|
155
|
-
kind: 'account-state',
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
121
|
async function recipePrecondition(account, describes, requiredUses = 0n) {
|
|
159
122
|
return {
|
|
160
123
|
kind: 'recipe-state',
|
|
@@ -164,8 +127,7 @@ async function recipePrecondition(account, describes, requiredUses = 0n) {
|
|
|
164
127
|
describes,
|
|
165
128
|
};
|
|
166
129
|
}
|
|
167
|
-
async function resolveAccounts(ctx, recipe, player, options, game) {
|
|
168
|
-
const character = await findCharacterPda(options.authorization.profile, game);
|
|
130
|
+
async function resolveAccounts(ctx, recipe, player, options, game, character) {
|
|
169
131
|
const currencyCache = options.craftingHab === undefined
|
|
170
132
|
? undefined
|
|
171
133
|
: await deriveCurrencyCache(game).then(([address]) => address);
|
|
@@ -215,7 +177,8 @@ async function resolveAccounts(ctx, recipe, player, options, game) {
|
|
|
215
177
|
!sameBalances(recipe.ingredients, recipeData.inputs)) {
|
|
216
178
|
fail(`Recipe ${recipe.address} changed or does not match the configured Game, canonical PDA, status, limits, or ingredients. Refresh the Recipe through this context and retry.`, recipe.address);
|
|
217
179
|
}
|
|
218
|
-
|
|
180
|
+
// One start consumes one Recipe use, independent of the crafted quantity.
|
|
181
|
+
validateRecipeUsage(recipeAccount, 1n);
|
|
219
182
|
if (options.craftingHab === undefined) {
|
|
220
183
|
return { character, characterAccount, playerAccount, recipeAccount };
|
|
221
184
|
}
|
|
@@ -227,11 +190,20 @@ async function resolveAccounts(ctx, recipe, player, options, game) {
|
|
|
227
190
|
habData.ownerProfile !== options.authorization.profile ||
|
|
228
191
|
habData.system !== player.system.address ||
|
|
229
192
|
habData.state.kind !== options.craftingHab.state.kind ||
|
|
193
|
+
// The crew reservation was computed from the snapshot's modifier.
|
|
194
|
+
habData.modifiers.crewCount.raw !==
|
|
195
|
+
options.craftingHab.modifiers.crewCount.raw ||
|
|
230
196
|
Math.max(0, habData.jobCapacity - habData.jobsRunning) !==
|
|
231
197
|
options.craftingHab.availableJobSlots ||
|
|
232
198
|
!habData.unlockedRecipeIds.includes(recipe.id) ||
|
|
233
199
|
!sameBalances(options.craftingHab.production.inventory.items, habData.production.inventory.amounts)) {
|
|
234
|
-
fail(`Crafting Hab ${options.craftingHab.address} changed or does not match its Game, Profile, System, active capacity, unlocked Recipe, or production inventory. Refresh the Crafting Hab through this context and retry.`, options.craftingHab.address);
|
|
200
|
+
fail(`Crafting Hab ${options.craftingHab.address} changed or does not match its Game, Profile, System, active capacity, crew-count modifier, unlocked Recipe, or production inventory. Refresh the Crafting Hab through this context and retry.`, options.craftingHab.address);
|
|
201
|
+
}
|
|
202
|
+
// The Character's research concurrency bonus raises the Hab's job limit.
|
|
203
|
+
const jobLimit = habData.jobCapacity +
|
|
204
|
+
characterData.modifiers.values.craftingJobConcurrencyBonus;
|
|
205
|
+
if (habData.jobsRunning >= jobLimit) {
|
|
206
|
+
fail(`Crafting Hab ${options.craftingHab.address} runs ${String(habData.jobsRunning)} jobs, its limit including the Character's concurrency bonus (${String(jobLimit)}). Complete or cancel another Hab job, refresh it, and retry.`, options.craftingHab.address);
|
|
235
207
|
}
|
|
236
208
|
await validateCurrencyCache(currencyCacheAccount, game, 'crafting');
|
|
237
209
|
return {
|
|
@@ -247,20 +219,16 @@ async function resolveAccounts(ctx, recipe, player, options, game) {
|
|
|
247
219
|
/** Plans one Crafting Process start without signing, simulation, or writes.
|
|
248
220
|
*
|
|
249
221
|
* The planner validates the loaded Recipe and Starbase Player, optional Hab,
|
|
250
|
-
* known ingredient balances,
|
|
251
|
-
*
|
|
252
|
-
*
|
|
222
|
+
* known ingredient balances, the crew the job reserves, the Hab job limit
|
|
223
|
+
* including the Character's research concurrency bonus, and exact
|
|
224
|
+
* whole-account state. The ATLAS fee and any crew-roster bonuses remain
|
|
225
|
+
* chain-authoritative. It returns one inert Plan whose two required signer
|
|
226
|
+
* roles are bound only during execution.
|
|
253
227
|
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
* this recipe can be used", and every Recipe observed on z.ink PTR stores
|
|
259
|
-
* `9007199254740991` (2^53 - 1) as its limit, so no zero-limit Recipe has been
|
|
260
|
-
* simulated or executed. If the program enforces a limit the SDK did not,
|
|
261
|
-
* simulation or execution surfaces its `UsageLimitExceeded` error
|
|
262
|
-
* (`1367932950`) instead of a local precondition failure. See
|
|
263
|
-
* `docs/evidence/crafting-zero-usage-limit.md`.
|
|
228
|
+
* Each start consumes exactly one Recipe use, whatever its quantity, and needs
|
|
229
|
+
* the Recipe's fresh `usageCountRaw` to be below `usageLimitRaw`. A stored
|
|
230
|
+
* limit of `0n` is therefore never usable. Cancelling or destroying a process
|
|
231
|
+
* returns its use. See `docs/evidence/crafting-zero-usage-limit.md`.
|
|
264
232
|
*
|
|
265
233
|
* @example
|
|
266
234
|
* ```ts
|
|
@@ -279,18 +247,19 @@ export async function planStartCraftingProcess(ctx, recipe, player, input) {
|
|
|
279
247
|
if (recipe.game.address !== game || canonicalRecipe !== recipe.address) {
|
|
280
248
|
fail(`Recipe ${recipe.address} does not match the configured Game ${game} or its canonical recipe-id PDA. Refresh the Recipe through this context and retry.`, recipe.address);
|
|
281
249
|
}
|
|
282
|
-
|
|
283
|
-
fail(`Starbase Player ${player.address} does not belong to authorization Profile ${options.authorization.profile}. Refresh the Starbase Player for that Profile and retry.`, player.address);
|
|
284
|
-
}
|
|
285
|
-
const canonicalPlayer = await deriveStarbasePlayerAddress(player.system.address, player.character.address);
|
|
286
|
-
if (canonicalPlayer !== player.address) {
|
|
287
|
-
fail(`Starbase Player ${player.address} is not canonical for its Character and System. Refresh the Starbase Player through this context and retry.`, player.address);
|
|
288
|
-
}
|
|
250
|
+
const character = await requireProfileStarbasePlayer(player, options.authorization.profile, game);
|
|
289
251
|
if (recipe.status !== 'active') {
|
|
290
252
|
fail(`Recipe ${recipe.name} is ${recipe.status}, so it cannot start a Crafting Process. Choose an active Recipe, refresh it, and retry.`, recipe.address);
|
|
291
253
|
}
|
|
292
|
-
|
|
293
|
-
|
|
254
|
+
// A Crafting Hab scales the reserved crew by its crew-count modifier
|
|
255
|
+
// (U26F6, 64 raw units per 1.0), rounded up.
|
|
256
|
+
const reservedCrew = options.craftingHab === undefined
|
|
257
|
+
? BigInt(options.numCrew)
|
|
258
|
+
: (BigInt(options.numCrew) * options.craftingHab.modifiers.crewCount.raw +
|
|
259
|
+
63n) /
|
|
260
|
+
64n;
|
|
261
|
+
if (reservedCrew > BigInt(player.availableCrew)) {
|
|
262
|
+
fail(`Starbase Player ${player.address} has only ${String(player.availableCrew)} crew available, but this job reserves ${String(reservedCrew)} (numCrew ${String(options.numCrew)}${options.craftingHab === undefined ? '' : ' scaled by the Crafting Hab crew-count modifier'}). Reduce numCrew or free crew, refresh the Starbase Player, and retry.`, player.address);
|
|
294
263
|
}
|
|
295
264
|
if (recipe.habRequired && options.craftingHab === undefined) {
|
|
296
265
|
fail(`Recipe ${recipe.name} requires a Crafting Hab. Provide craftingHab from the same Profile and Star System before retrying.`, recipe.address);
|
|
@@ -308,18 +277,13 @@ export async function planStartCraftingProcess(ctx, recipe, player, input) {
|
|
|
308
277
|
if (options.craftingHab.state.kind !== 'active') {
|
|
309
278
|
fail(`Crafting Hab ${options.craftingHab.address} is ${options.craftingHab.state.kind}; it must be active before starting a Crafting Process. Refresh or reactivate the Hab and retry.`, options.craftingHab.address);
|
|
310
279
|
}
|
|
311
|
-
if (options.craftingHab.availableJobSlots < 1) {
|
|
312
|
-
fail(`Crafting Hab ${options.craftingHab.address} has no available job slots. Complete or cancel another Hab job, refresh it, and retry.`, options.craftingHab.address);
|
|
313
|
-
}
|
|
314
280
|
if (!options.craftingHab.unlockedRecipes.some(({ address }) => address === recipe.address)) {
|
|
315
281
|
fail(`Crafting Hab ${options.craftingHab.address} has not unlocked Recipe ${recipe.name}. Choose an unlocked Recipe or update the Hab before retrying.`, options.craftingHab.address);
|
|
316
282
|
}
|
|
317
|
-
validateKnownInputs(recipe, options.craftingHab.production.inventory.items, options.quantity, 'Crafting Hab', options.craftingHab.address);
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
validateKnownInputs(recipe, player.cargo.items, options.quantity, 'Starbase Player', player.address);
|
|
321
283
|
}
|
|
322
|
-
|
|
284
|
+
// Inputs come from the Starbase Player's cargo whether or not a Hab is used.
|
|
285
|
+
validateKnownInputs(recipe, player.cargo.items, options.quantity, 'Starbase Player', player.address);
|
|
286
|
+
const resolved = await resolveAccounts(ctx, recipe, player, options, game, character);
|
|
323
287
|
const [runtimeSystem] = await readContextRawAccounts(ctx, [
|
|
324
288
|
player.system.address,
|
|
325
289
|
]);
|
|
@@ -336,44 +300,67 @@ export async function planStartCraftingProcess(ctx, recipe, player, input) {
|
|
|
336
300
|
});
|
|
337
301
|
const description = `Start crafting ${String(options.quantity)} units of ${recipe.name} with ${String(options.numCrew)} crew at Starbase Player ${player.address}.`;
|
|
338
302
|
const preconditions = [
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
recipePrecondition(resolved.recipeAccount, `Recipe ${recipe.name} retains its configuration and
|
|
303
|
+
accountStatePrecondition(resolved.characterAccount, `The canonical Character remains assigned to Profile ${options.authorization.profile} in the configured Game.`),
|
|
304
|
+
accountStatePrecondition(resolved.playerAccount, `Starbase Player ${player.address} retains its Character, Profile, System, crew, and input inventory.`),
|
|
305
|
+
recipePrecondition(resolved.recipeAccount, `Recipe ${recipe.name} retains its configuration and at least one remaining use for this job.`, 1n),
|
|
342
306
|
...(resolved.habAccount === undefined
|
|
343
307
|
? []
|
|
344
308
|
: [
|
|
345
|
-
|
|
309
|
+
accountStatePrecondition(resolved.habAccount, `Crafting Hab ${resolved.habAccount.address} remains active with an available job slot and the Recipe unlocked; inputs come from the Starbase Player's cargo.`),
|
|
346
310
|
]),
|
|
347
311
|
];
|
|
348
|
-
|
|
312
|
+
const instruction = adaptStartCraftingProcessInstruction({
|
|
313
|
+
...runtime.accounts,
|
|
314
|
+
starbaseGovernance: runtime.accounts.starbaseGovernance,
|
|
315
|
+
authorization: options.authorization,
|
|
316
|
+
character: resolved.character,
|
|
317
|
+
craftingProcess: options.craftingProcess,
|
|
318
|
+
game,
|
|
319
|
+
numCrew: options.numCrew,
|
|
320
|
+
quantity: options.quantity,
|
|
321
|
+
recipe: recipe.address,
|
|
322
|
+
starbasePlayer: player.address,
|
|
323
|
+
system: player.system.address,
|
|
324
|
+
...(options.craftingHab === undefined
|
|
325
|
+
? {}
|
|
326
|
+
: {
|
|
327
|
+
craftingHabInstance: options.craftingHab.address,
|
|
328
|
+
currencyCache: resolved.currencyCache,
|
|
329
|
+
}),
|
|
330
|
+
});
|
|
331
|
+
// A start creates the Crafting Process and consumes inputs from the Starbase
|
|
332
|
+
// Player; the program funds the net growth from the Profile vault with the
|
|
333
|
+
// signing key.
|
|
334
|
+
const [profileAccount, rentAccount] = await readContextRawAccounts(ctx, [
|
|
335
|
+
options.authorization.profile,
|
|
336
|
+
RENT_ADDRESS,
|
|
337
|
+
]);
|
|
338
|
+
const storageAccounts = new Map([
|
|
339
|
+
[resolved.recipeAccount.address, resolved.recipeAccount],
|
|
340
|
+
[resolved.playerAccount.address, resolved.playerAccount],
|
|
341
|
+
[options.authorization.profile, profileAccount],
|
|
342
|
+
[RENT_ADDRESS, rentAccount],
|
|
343
|
+
]);
|
|
344
|
+
const storage = planStorageFunding({
|
|
345
|
+
action: readCraftingStorageAction(instruction, storageAccounts),
|
|
346
|
+
accounts: storageAccounts,
|
|
347
|
+
label: 'Crafting Process start',
|
|
348
|
+
});
|
|
349
|
+
return buildPlannerPlan({
|
|
349
350
|
kind: 'crafting.start-process',
|
|
350
|
-
preconditions: [
|
|
351
|
+
preconditions: [
|
|
352
|
+
...runtime.guards,
|
|
353
|
+
...(await Promise.all(preconditions)),
|
|
354
|
+
storage.guard,
|
|
355
|
+
],
|
|
351
356
|
steps: [
|
|
352
357
|
{
|
|
353
|
-
describes: `${description} ${runtime.description}`,
|
|
354
|
-
instruction
|
|
355
|
-
...runtime.accounts,
|
|
356
|
-
starbaseGovernance: runtime.accounts.starbaseGovernance,
|
|
357
|
-
authorization: options.authorization,
|
|
358
|
-
character: resolved.character,
|
|
359
|
-
craftingProcess: options.craftingProcess,
|
|
360
|
-
game,
|
|
361
|
-
numCrew: options.numCrew,
|
|
362
|
-
quantity: options.quantity,
|
|
363
|
-
recipe: recipe.address,
|
|
364
|
-
starbasePlayer: player.address,
|
|
365
|
-
system: player.system.address,
|
|
366
|
-
...(options.craftingHab === undefined
|
|
367
|
-
? {}
|
|
368
|
-
: {
|
|
369
|
-
craftingHabInstance: options.craftingHab.address,
|
|
370
|
-
currencyCache: resolved.currencyCache,
|
|
371
|
-
}),
|
|
372
|
-
}),
|
|
358
|
+
describes: `${description} ${runtime.description} ${storage.disclosure}`,
|
|
359
|
+
instruction,
|
|
373
360
|
signers: [options.authorization.authority, options.craftingProcess],
|
|
374
361
|
},
|
|
375
362
|
],
|
|
376
|
-
summary: `${description} ${runtime.description}`,
|
|
363
|
+
summary: `${description} ${runtime.description} ${storage.disclosure}`,
|
|
377
364
|
});
|
|
378
365
|
}
|
|
379
366
|
function sameProcessSnapshot(process, account) {
|
|
@@ -404,41 +391,53 @@ function processHabAddress(process) {
|
|
|
404
391
|
}
|
|
405
392
|
function validateGameRead(account, game) {
|
|
406
393
|
if (account.address !== game ||
|
|
407
|
-
account.owner !==
|
|
408
|
-
account.data.length <
|
|
409
|
-
!
|
|
394
|
+
account.owner !== SAGE_PROGRAM_ADDRESS ||
|
|
395
|
+
account.data.length < GAME_DISCRIMINATOR.length ||
|
|
396
|
+
!GAME_DISCRIMINATOR.every((byte, index) => account.data[index] === byte)) {
|
|
410
397
|
fail(`Game ${account.address} does not match the configured address, owner, or pinned account layout. Refresh the configured Game and retry.`, account.address);
|
|
411
398
|
}
|
|
412
399
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
400
|
+
/** Reads and validates the Crafting Process graph shared by completion and
|
|
401
|
+
* cancellation, with `extra` in the same read: the unchanged Process, its
|
|
402
|
+
* canonical System and Starbase, the unchanged Recipe and its Hab policy, the
|
|
403
|
+
* Profile's canonical Starbase Player and Character, and the Process Hab,
|
|
404
|
+
* active and owned, when present. `action` completes the remedies, and
|
|
405
|
+
* `staleStarbaseGuidance` adds advice for a replaced Starbase. With
|
|
406
|
+
* `readHab` false the Hab is passed by its stored address only and is not
|
|
407
|
+
* read, as cancellation tolerates a Hab in any state or none at all. */
|
|
408
|
+
async function resolveProcessAccounts(ctx, process, profile, game, action, extra, staleStarbaseGuidance, readHab = true) {
|
|
409
|
+
const character = await findCharacterPda(profile, game);
|
|
416
410
|
const habAddress = processHabAddress(process);
|
|
417
|
-
const
|
|
411
|
+
const habRead = readHab ? habAddress : undefined;
|
|
412
|
+
// The SAGE program address is the omitted-account placeholder, so the
|
|
413
|
+
// program would see no Hab where the Process stores one.
|
|
414
|
+
if (!readHab && habAddress === SAGE_PROGRAM_ADDRESS)
|
|
415
|
+
fail(`Crafting Process ${process.address} stores the SAGE program address as its Crafting Hab, which the instruction cannot pass as a Hab. Refresh the Crafting Process; it cannot be cancelled while it stores that address.`, process.address);
|
|
416
|
+
const [processCandidate, recipeCandidate, playerCandidate, systemCandidate, characterCandidate, extraAccount, habCandidate,] = await readContextRawAccounts(ctx, [
|
|
418
417
|
process.address,
|
|
419
418
|
process.recipe.address,
|
|
420
419
|
process.starbasePlayer.address,
|
|
421
420
|
process.system.address,
|
|
422
|
-
...(habAddress === undefined ? [] : [habAddress]),
|
|
423
421
|
character,
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
const
|
|
428
|
-
const processAccount = requireAccount(byAddress.get(process.address), process.address, `Crafting Process ${process.address} is missing, so it may already be cancelled or closed. Refresh the Crafting Process and retry only if it still exists.`);
|
|
429
|
-
const recipeAccount = requireAccount(byAddress.get(process.recipe.address), process.recipe.address, `Recipe ${process.recipe.address} is missing. Refresh the Crafting Process and its Recipe before retrying completion.`);
|
|
430
|
-
const playerAccount = requireAccount(byAddress.get(process.starbasePlayer.address), process.starbasePlayer.address, `Starbase Player ${process.starbasePlayer.address} is missing. Refresh the Crafting Process and Starbase Player before retrying completion.`);
|
|
431
|
-
const systemAccount = requireAccount(byAddress.get(process.system.address), process.system.address, `Star System ${process.system.address} is missing. Refresh the Crafting Process and Star System before retrying completion.`);
|
|
432
|
-
const characterAccount = requireAccount(byAddress.get(character), character, `Canonical Character ${character} is missing for Profile ${options.authorization.profile}. Create or repair the Character in the configured Game before retrying completion.`);
|
|
433
|
-
const currencyCacheAccount = requireAccount(byAddress.get(currencyCache), currencyCache, `Canonical CurrencyCache ${currencyCache} is missing for the configured Game. Refresh the Game currency configuration before retrying completion.`);
|
|
434
|
-
const habAccount = habAddress === undefined
|
|
435
|
-
? undefined
|
|
436
|
-
: requireAccount(byAddress.get(habAddress), habAddress, `Crafting Hab ${habAddress} is missing. Refresh the Crafting Process and Hab before retrying completion.`);
|
|
437
|
-
const processData = craftingProcessAccountDefinition.decode(processAccount);
|
|
422
|
+
extra,
|
|
423
|
+
...(habRead === undefined ? [] : [habRead]),
|
|
424
|
+
]);
|
|
425
|
+
const processAccount = requireAccount(processCandidate, process.address, `Crafting Process ${process.address} is missing, so it may already be completed, cancelled, or closed. Refresh the Crafting Process and retry only if it still exists.`);
|
|
438
426
|
if (processAccount.address !== process.address ||
|
|
439
|
-
!sameProcessSnapshot(process,
|
|
427
|
+
!sameProcessSnapshot(process, craftingProcessAccountDefinition.decode(processAccount))) {
|
|
440
428
|
fail(`Crafting Process ${process.address} changed or no longer matches its relationships, timing, crew, quantity, fee, or inputs. Refresh the Crafting Process and retry.`, process.address);
|
|
441
429
|
}
|
|
430
|
+
await validateStarbaseSystem(requireAccount(systemCandidate, process.system.address, `Star System ${process.system.address} is missing. Refresh the Crafting Process and Star System before retrying ${action}.`), {
|
|
431
|
+
address: process.system.address,
|
|
432
|
+
game,
|
|
433
|
+
starbaseSequenceId: process.starbaseSequenceId,
|
|
434
|
+
}, staleStarbaseGuidance);
|
|
435
|
+
const recipeAccount = requireAccount(recipeCandidate, process.recipe.address, `Recipe ${process.recipe.address} is missing. Refresh the Crafting Process and its Recipe before retrying ${action}.`);
|
|
436
|
+
const playerAccount = requireAccount(playerCandidate, process.starbasePlayer.address, `Starbase Player ${process.starbasePlayer.address} is missing. Refresh the Crafting Process and Starbase Player before retrying ${action}.`);
|
|
437
|
+
const characterAccount = requireAccount(characterCandidate, character, `Canonical Character ${character} is missing for Profile ${profile}. Create or repair the Character in the configured Game before retrying ${action}.`);
|
|
438
|
+
const habAccount = habRead === undefined
|
|
439
|
+
? undefined
|
|
440
|
+
: requireAccount(habCandidate, habRead, `Crafting Hab ${habAddress} is missing. Refresh the Crafting Process and Hab before retrying ${action}.`);
|
|
442
441
|
const recipeData = recipeAccountDefinition.decode(recipeAccount);
|
|
443
442
|
const canonicalRecipe = await deriveRecipeAddress(game, recipeData.id);
|
|
444
443
|
if (recipeAccount.address !== process.recipe.address ||
|
|
@@ -451,59 +450,70 @@ async function resolveCompleteAccounts(ctx, process, options, game) {
|
|
|
451
450
|
recipeData.usageLimitRaw !== process.recipe.usageLimitRaw ||
|
|
452
451
|
!sameBalances(process.recipe.ingredients, recipeData.inputs) ||
|
|
453
452
|
!sameBalances(process.recipe.outputs, recipeData.outputs)) {
|
|
454
|
-
fail(`Recipe ${process.recipe.address} changed or does not match the configured Game, canonical recipe-id PDA, status, Hab policy, limits, ingredients, or outputs. Refresh the Crafting Process and Recipe before retrying
|
|
453
|
+
fail(`Recipe ${process.recipe.address} changed or does not match the configured Game, canonical recipe-id PDA, status, Hab policy, limits, ingredients, or outputs. Refresh the Crafting Process and Recipe before retrying ${action}.`, process.recipe.address);
|
|
455
454
|
}
|
|
456
455
|
if (recipeData.habRequired && habAddress === undefined) {
|
|
457
|
-
fail(`Recipe ${recipeData.name} requires a Crafting Hab, but Crafting Process ${process.address} omits one. Refresh or repair the Process relationship before retrying
|
|
456
|
+
fail(`Recipe ${recipeData.name} requires a Crafting Hab, but Crafting Process ${process.address} omits one. Refresh or repair the Process relationship before retrying ${action}.`, process.address);
|
|
458
457
|
}
|
|
459
458
|
const playerData = starbasePlayerAccountDefinition.decode(playerAccount);
|
|
460
459
|
const canonicalPlayer = await deriveStarbasePlayerAddress(process.system.address, character);
|
|
461
460
|
if (playerAccount.address !== process.starbasePlayer.address ||
|
|
462
461
|
canonicalPlayer !== process.starbasePlayer.address ||
|
|
463
|
-
playerData.playerProfile !==
|
|
462
|
+
playerData.playerProfile !== profile ||
|
|
464
463
|
playerData.character !== character ||
|
|
465
464
|
playerData.system !== process.system.address) {
|
|
466
|
-
fail(`Starbase Player ${process.starbasePlayer.address} does not match the authorization Profile, canonical Character, or Crafting Process System. Refresh the Crafting Process and Starbase Player before retrying
|
|
467
|
-
}
|
|
468
|
-
const systemData = starSystemAccountDefinition.decode(systemAccount);
|
|
469
|
-
const canonicalSystem = await deriveStarSystemAddress(game, systemData.systemId);
|
|
470
|
-
if (systemAccount.address !== process.system.address ||
|
|
471
|
-
canonicalSystem !== process.system.address ||
|
|
472
|
-
systemData.game !== game ||
|
|
473
|
-
systemData.sequenceId !== process.starbaseSequenceId ||
|
|
474
|
-
systemData.starbase === undefined) {
|
|
475
|
-
fail(`Star System ${process.system.address} does not match the configured Game, canonical system-id PDA, active Starbase, or Crafting Process Starbase sequence. Refresh the Crafting Process and Star System before retrying completion.`, process.system.address);
|
|
465
|
+
fail(`Starbase Player ${process.starbasePlayer.address} does not match the authorization Profile, canonical Character, or Crafting Process System. Refresh the Crafting Process and Starbase Player before retrying ${action}.`, process.starbasePlayer.address);
|
|
476
466
|
}
|
|
477
467
|
if (habAccount !== undefined) {
|
|
478
468
|
const habData = craftingHabAccountDefinition.decode(habAccount);
|
|
479
469
|
if (habAccount.address !== habAddress ||
|
|
480
470
|
habData.game !== game ||
|
|
481
|
-
habData.ownerProfile !==
|
|
471
|
+
habData.ownerProfile !== profile ||
|
|
482
472
|
habData.system !== process.system.address ||
|
|
483
473
|
habData.systemSequenceId !== process.starbaseSequenceId ||
|
|
484
474
|
habData.state.kind !== 'active') {
|
|
485
|
-
fail(`Crafting Hab ${habAddress} is not active or does not match the configured Game, authorization Profile, Crafting Process System, or Starbase sequence. Refresh the Crafting Process and Hab before retrying
|
|
475
|
+
fail(`Crafting Hab ${habAddress} is not active or does not match the configured Game, authorization Profile, Crafting Process System, or Starbase sequence. Refresh the Crafting Process and Hab before retrying ${action}.`, habAccount.address);
|
|
486
476
|
}
|
|
487
477
|
}
|
|
488
478
|
const characterData = characterAccountDefinition.decode(characterAccount);
|
|
489
479
|
if (characterAccount.address !== character ||
|
|
490
|
-
characterData.playerProfile !==
|
|
480
|
+
characterData.playerProfile !== profile ||
|
|
491
481
|
characterData.game !== game) {
|
|
492
|
-
fail(`The canonical Character does not match Profile ${
|
|
482
|
+
fail(`The canonical Character does not match Profile ${profile} and the configured Game ${game}. Refresh or repair the Character relationship before retrying ${action}.`, characterAccount.address);
|
|
493
483
|
}
|
|
494
|
-
await validateCurrencyCache(currencyCacheAccount, game, 'crafting');
|
|
495
484
|
return {
|
|
496
485
|
character,
|
|
497
486
|
characterAccount,
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
487
|
+
extraAccount,
|
|
488
|
+
habAccount,
|
|
489
|
+
habAddress,
|
|
501
490
|
playerAccount,
|
|
502
491
|
processAccount,
|
|
503
492
|
recipeAccount,
|
|
504
|
-
systemAccount,
|
|
505
493
|
};
|
|
506
494
|
}
|
|
495
|
+
/** The validated Process graph preconditions, with `systemGuard` after the
|
|
496
|
+
* Starbase Player when the action guards the Starbase separately. */
|
|
497
|
+
function processPreconditions(process, resolved, profile, systemGuard = []) {
|
|
498
|
+
return [
|
|
499
|
+
accountStatePrecondition(resolved.processAccount, `Crafting Process ${process.address} retains its validated relationships, timing, crew, quantity, fee, and inputs.`),
|
|
500
|
+
recipePrecondition(resolved.recipeAccount, `Recipe ${process.recipe.name} retains its validated Game, Hab policy, ingredients, and outputs.`),
|
|
501
|
+
accountStatePrecondition(resolved.playerAccount, `Starbase Player ${process.starbasePlayer.address} retains its Profile, Character, and System relationships.`),
|
|
502
|
+
...systemGuard.map((guard) => Promise.resolve(guard)),
|
|
503
|
+
...(resolved.habAccount === undefined
|
|
504
|
+
? []
|
|
505
|
+
: [
|
|
506
|
+
accountStatePrecondition(resolved.habAccount, `Crafting Hab ${resolved.habAccount.address} remains active in the validated Game, Profile, System, and Starbase sequence.`),
|
|
507
|
+
]),
|
|
508
|
+
accountStatePrecondition(resolved.characterAccount, `The canonical Character remains assigned to Profile ${profile} in the configured Game.`),
|
|
509
|
+
];
|
|
510
|
+
}
|
|
511
|
+
/** Requires the authorization Profile to own the Process. */
|
|
512
|
+
function requireProcessOwner(process, profile) {
|
|
513
|
+
if (process.profile.address !== profile) {
|
|
514
|
+
fail(`Crafting Process ${process.address} does not belong to authorization Profile ${profile}. Use the owning Profile, refresh the Process, and retry.`, process.address);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
507
517
|
/** Plans completion of one Crafting Process without signing, simulation, or writes.
|
|
508
518
|
*
|
|
509
519
|
* The planner resolves and validates the Process account graph, requires Profile
|
|
@@ -521,11 +531,10 @@ async function resolveCompleteAccounts(ctx, process, options, game) {
|
|
|
521
531
|
* ```
|
|
522
532
|
*/
|
|
523
533
|
export async function planCompleteCraftingProcess(ctx, process, input) {
|
|
524
|
-
const options =
|
|
534
|
+
const options = validateProcessOptions(input);
|
|
525
535
|
const game = requireGameAddress(ctx);
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
}
|
|
536
|
+
const { profile } = options.authorization;
|
|
537
|
+
requireProcessOwner(process, profile);
|
|
529
538
|
const state = deriveInternalCraftingProcessState(process, options.atUnixSeconds);
|
|
530
539
|
if (state.kind !== 'complete') {
|
|
531
540
|
const timing = state.kind === 'scheduled'
|
|
@@ -533,13 +542,14 @@ export async function planCompleteCraftingProcess(ctx, process, input) {
|
|
|
533
542
|
: `in-progress and not complete with ${String(state.remainingSeconds)} seconds remaining`;
|
|
534
543
|
fail(`Crafting Process ${process.address} is ${timing} at Unix timestamp ${String(options.atUnixSeconds)}. Wait until it is complete, provide a current timestamp, and retry.`, process.address);
|
|
535
544
|
}
|
|
536
|
-
const
|
|
545
|
+
const [currencyCache] = await deriveCurrencyCache(game);
|
|
546
|
+
const resolved = await resolveProcessAccounts(ctx, process, profile, game, 'completion', currencyCache);
|
|
547
|
+
await validateCurrencyCache(requireAccount(resolved.extraAccount, currencyCache, `Canonical CurrencyCache ${currencyCache} is missing for the configured Game. Refresh the Game currency configuration before retrying completion.`), game, 'crafting');
|
|
537
548
|
const runtime = await resolveActionRuntime(ctx, {
|
|
538
549
|
mode: 'crafting-complete',
|
|
539
550
|
game,
|
|
540
551
|
system: process.system.address,
|
|
541
|
-
starbaseSeqId:
|
|
542
|
-
.sequenceId,
|
|
552
|
+
starbaseSeqId: process.starbaseSequenceId,
|
|
543
553
|
character: resolved.character,
|
|
544
554
|
process: process.address,
|
|
545
555
|
...(resolved.habAccount === undefined
|
|
@@ -547,20 +557,12 @@ export async function planCompleteCraftingProcess(ctx, process, input) {
|
|
|
547
557
|
: { structure: resolved.habAccount.address }),
|
|
548
558
|
});
|
|
549
559
|
const description = `Complete crafting ${String(process.quantityRaw)} units of ${process.recipe.name} at Starbase Player ${process.starbasePlayer.address}, returning ${String(process.numCrew)} crew and producing the Recipe outputs.`;
|
|
550
|
-
|
|
551
|
-
precondition(resolved.processAccount, `Crafting Process ${process.address} retains its validated relationships, timing, crew, quantity, fee, and inputs.`),
|
|
552
|
-
recipePrecondition(resolved.recipeAccount, `Recipe ${process.recipe.name} retains its validated Game, Hab policy, ingredients, and outputs.`),
|
|
553
|
-
precondition(resolved.playerAccount, `Starbase Player ${process.starbasePlayer.address} retains its Profile, Character, and System relationships.`),
|
|
554
|
-
...(resolved.habAccount === undefined
|
|
555
|
-
? []
|
|
556
|
-
: [
|
|
557
|
-
precondition(resolved.habAccount, `Crafting Hab ${resolved.habAccount.address} remains active in the validated Game, Profile, System, and Starbase sequence.`),
|
|
558
|
-
]),
|
|
559
|
-
precondition(resolved.characterAccount, `The canonical Character remains assigned to Profile ${options.authorization.profile} in the configured Game.`),
|
|
560
|
-
];
|
|
561
|
-
return createPlan({
|
|
560
|
+
return buildPlannerPlan({
|
|
562
561
|
kind: 'crafting.complete-process',
|
|
563
|
-
preconditions: [
|
|
562
|
+
preconditions: [
|
|
563
|
+
...runtime.guards,
|
|
564
|
+
...(await Promise.all(processPreconditions(process, resolved, profile))),
|
|
565
|
+
],
|
|
564
566
|
steps: [
|
|
565
567
|
{
|
|
566
568
|
describes: `${description} ${runtime.description}`,
|
|
@@ -569,7 +571,7 @@ export async function planCompleteCraftingProcess(ctx, process, input) {
|
|
|
569
571
|
authorization: options.authorization,
|
|
570
572
|
character: resolved.character,
|
|
571
573
|
craftingProcess: process.address,
|
|
572
|
-
currencyCache
|
|
574
|
+
currencyCache,
|
|
573
575
|
game,
|
|
574
576
|
recipe: process.recipe.address,
|
|
575
577
|
starbasePlayer: process.starbasePlayer.address,
|
|
@@ -584,99 +586,15 @@ export async function planCompleteCraftingProcess(ctx, process, input) {
|
|
|
584
586
|
summary: `${description} ${runtime.description}`,
|
|
585
587
|
});
|
|
586
588
|
}
|
|
587
|
-
|
|
588
|
-
const character = await findCharacterPda(options.authorization.profile, game);
|
|
589
|
-
const habAddress = processHabAddress(process);
|
|
590
|
-
const addresses = [
|
|
591
|
-
process.address,
|
|
592
|
-
process.recipe.address,
|
|
593
|
-
process.starbasePlayer.address,
|
|
594
|
-
process.system.address,
|
|
595
|
-
...(habAddress === undefined ? [] : [habAddress]),
|
|
596
|
-
character,
|
|
597
|
-
game,
|
|
598
|
-
];
|
|
599
|
-
const reads = await readContextRawAccounts(ctx, addresses);
|
|
600
|
-
const byAddress = new Map(addresses.map((address, index) => [address, reads[index]]));
|
|
601
|
-
const processAccount = requireAccount(byAddress.get(process.address), process.address, `Crafting Process ${process.address} is missing, so it may already be completed, cancelled, or closed. Refresh the Crafting Process and retry only if it still exists.`);
|
|
602
|
-
const systemAccount = requireAccount(byAddress.get(process.system.address), process.system.address, `Star System ${process.system.address} is missing. Refresh the Crafting Process and Star System before retrying cancellation.`);
|
|
603
|
-
const processData = craftingProcessAccountDefinition.decode(processAccount);
|
|
604
|
-
if (processAccount.address !== process.address ||
|
|
605
|
-
!sameProcessSnapshot(process, processData)) {
|
|
606
|
-
fail(`Crafting Process ${process.address} changed or no longer matches its relationships, timing, crew, quantity, fee, or inputs. Refresh the Crafting Process and retry.`, process.address);
|
|
607
|
-
}
|
|
608
|
-
await validateStarbaseSystem(systemAccount, {
|
|
609
|
-
address: process.system.address,
|
|
610
|
-
game,
|
|
611
|
-
starbaseSequenceId: process.starbaseSequenceId,
|
|
612
|
-
});
|
|
613
|
-
const recipeAccount = requireAccount(byAddress.get(process.recipe.address), process.recipe.address, `Recipe ${process.recipe.address} is missing. Refresh the Crafting Process and its Recipe before retrying cancellation.`);
|
|
614
|
-
const playerAccount = requireAccount(byAddress.get(process.starbasePlayer.address), process.starbasePlayer.address, `Starbase Player ${process.starbasePlayer.address} is missing. Refresh the Crafting Process and Starbase Player before retrying cancellation.`);
|
|
615
|
-
const characterAccount = requireAccount(byAddress.get(character), character, `Canonical Character ${character} is missing for Profile ${options.authorization.profile}. Create or repair the Character in the configured Game before retrying cancellation.`);
|
|
616
|
-
const gameAccount = requireAccount(byAddress.get(game), game, `Configured Game ${game} is missing. Refresh the configured Game before retrying cancellation.`);
|
|
617
|
-
const habAccount = habAddress === undefined
|
|
618
|
-
? undefined
|
|
619
|
-
: requireAccount(byAddress.get(habAddress), habAddress, `Crafting Hab ${habAddress} is missing. Refresh the Crafting Process and Hab before retrying cancellation.`);
|
|
620
|
-
const recipeData = recipeAccountDefinition.decode(recipeAccount);
|
|
621
|
-
const canonicalRecipe = await deriveRecipeAddress(game, recipeData.id);
|
|
622
|
-
if (recipeAccount.address !== process.recipe.address ||
|
|
623
|
-
canonicalRecipe !== process.recipe.address ||
|
|
624
|
-
recipeData.game !== game ||
|
|
625
|
-
recipeData.id !== process.recipe.id ||
|
|
626
|
-
recipeData.name !== process.recipe.name ||
|
|
627
|
-
recipeData.status !== process.recipe.status ||
|
|
628
|
-
recipeData.habRequired !== process.recipe.habRequired ||
|
|
629
|
-
recipeData.usageLimitRaw !== process.recipe.usageLimitRaw ||
|
|
630
|
-
!sameBalances(process.recipe.ingredients, recipeData.inputs) ||
|
|
631
|
-
!sameBalances(process.recipe.outputs, recipeData.outputs)) {
|
|
632
|
-
fail(`Recipe ${process.recipe.address} changed or does not match the configured Game, canonical recipe-id PDA, status, Hab policy, limits, ingredients, or outputs. Refresh the Crafting Process and Recipe before retrying cancellation.`, process.recipe.address);
|
|
633
|
-
}
|
|
634
|
-
if (recipeData.habRequired && habAddress === undefined) {
|
|
635
|
-
fail(`Recipe ${recipeData.name} requires a Crafting Hab, but Crafting Process ${process.address} omits one. Refresh or repair the Process relationship before retrying cancellation.`, process.address);
|
|
636
|
-
}
|
|
637
|
-
const playerData = starbasePlayerAccountDefinition.decode(playerAccount);
|
|
638
|
-
const canonicalPlayer = await deriveStarbasePlayerAddress(process.system.address, character);
|
|
639
|
-
if (playerAccount.address !== process.starbasePlayer.address ||
|
|
640
|
-
canonicalPlayer !== process.starbasePlayer.address ||
|
|
641
|
-
playerData.playerProfile !== options.authorization.profile ||
|
|
642
|
-
playerData.character !== character ||
|
|
643
|
-
playerData.system !== process.system.address) {
|
|
644
|
-
fail(`Starbase Player ${process.starbasePlayer.address} does not match the authorization Profile, canonical Character, or Crafting Process System. Refresh the Crafting Process and Starbase Player before retrying cancellation.`, process.starbasePlayer.address);
|
|
645
|
-
}
|
|
646
|
-
if (habAccount !== undefined) {
|
|
647
|
-
const habData = craftingHabAccountDefinition.decode(habAccount);
|
|
648
|
-
if (habAccount.address !== habAddress ||
|
|
649
|
-
habData.game !== game ||
|
|
650
|
-
habData.ownerProfile !== options.authorization.profile ||
|
|
651
|
-
habData.system !== process.system.address ||
|
|
652
|
-
habData.systemSequenceId !== process.starbaseSequenceId ||
|
|
653
|
-
habData.state.kind !== 'active') {
|
|
654
|
-
fail(`Crafting Hab ${habAddress} is not active or does not match the configured Game, authorization Profile, Crafting Process System, or Starbase sequence. Refresh the Crafting Process and Hab before retrying cancellation.`, habAccount.address);
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
const characterData = characterAccountDefinition.decode(characterAccount);
|
|
658
|
-
if (characterAccount.address !== character ||
|
|
659
|
-
characterData.playerProfile !== options.authorization.profile ||
|
|
660
|
-
characterData.game !== game) {
|
|
661
|
-
fail(`The canonical Character does not match Profile ${options.authorization.profile} and the configured Game ${game}. Refresh or repair the Character relationship before retrying cancellation.`, characterAccount.address);
|
|
662
|
-
}
|
|
663
|
-
validateGameRead(gameAccount, game);
|
|
664
|
-
return {
|
|
665
|
-
character,
|
|
666
|
-
characterAccount,
|
|
667
|
-
gameAccount,
|
|
668
|
-
...(habAccount === undefined ? {} : { habAccount }),
|
|
669
|
-
playerAccount,
|
|
670
|
-
processAccount,
|
|
671
|
-
recipeAccount,
|
|
672
|
-
};
|
|
673
|
-
}
|
|
674
|
-
/** Plans cancellation of one unfinished Crafting Process without signing or writes.
|
|
589
|
+
/** Plans cancellation of one Crafting Process without signing or writes.
|
|
675
590
|
*
|
|
676
591
|
* The planner resolves and validates the Process account graph, requires Profile
|
|
677
|
-
* ownership, and rejects
|
|
678
|
-
*
|
|
679
|
-
*
|
|
592
|
+
* ownership, and rejects a Process whose Starbase was destroyed. Cancellation
|
|
593
|
+
* has no timing rule: a finished Process can still be cancelled, which returns
|
|
594
|
+
* its inputs and crew instead of producing outputs. A Process Hab is passed by
|
|
595
|
+
* its stored address in whatever state it is in, or even if it no longer
|
|
596
|
+
* exists. Final inventory capacity, permissions, returned inputs and crew, and
|
|
597
|
+
* account closure remain chain-authoritative.
|
|
680
598
|
*
|
|
681
599
|
* @example
|
|
682
600
|
* ```ts
|
|
@@ -690,56 +608,67 @@ async function resolveCancelAccounts(ctx, process, options, game) {
|
|
|
690
608
|
export async function planCancelCraftingProcess(ctx, process, input) {
|
|
691
609
|
const options = validateCancelOptions(input);
|
|
692
610
|
const game = requireGameAddress(ctx);
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
611
|
+
const { profile } = options.authorization;
|
|
612
|
+
requireProcessOwner(process, profile);
|
|
613
|
+
const resolved = await resolveProcessAccounts(ctx, process, profile, game, 'cancellation', game, 'For a Crafting Process belonging to the destroyed Starbase, use destroyCraftingProcess; do not cancel the Process.', false);
|
|
614
|
+
const gameAccount = requireAccount(resolved.extraAccount, game, `Configured Game ${game} is missing. Refresh the configured Game before retrying cancellation.`);
|
|
615
|
+
validateGameRead(gameAccount, game);
|
|
616
|
+
const instruction = adaptCancelCraftingProcessInstruction({
|
|
617
|
+
authorization: options.authorization,
|
|
618
|
+
character: resolved.character,
|
|
619
|
+
craftingProcess: process.address,
|
|
620
|
+
game,
|
|
621
|
+
recipe: process.recipe.address,
|
|
622
|
+
starbasePlayer: process.starbasePlayer.address,
|
|
623
|
+
system: process.system.address,
|
|
624
|
+
...(resolved.habAddress === undefined
|
|
625
|
+
? {}
|
|
626
|
+
: { craftingHabInstance: resolved.habAddress }),
|
|
627
|
+
});
|
|
628
|
+
// Returned inputs can reopen Starbase Player lines, which the program funds
|
|
629
|
+
// from the Profile vault before the closed Process refunds its rent.
|
|
630
|
+
const [profileAccount, rentAccount] = await readContextRawAccounts(ctx, [
|
|
631
|
+
profile,
|
|
632
|
+
RENT_ADDRESS,
|
|
633
|
+
]);
|
|
634
|
+
const storageAccounts = new Map([
|
|
635
|
+
[resolved.playerAccount.address, resolved.playerAccount],
|
|
636
|
+
[resolved.processAccount.address, resolved.processAccount],
|
|
637
|
+
[profile, profileAccount],
|
|
638
|
+
[RENT_ADDRESS, rentAccount],
|
|
639
|
+
]);
|
|
640
|
+
const storage = planStorageFunding({
|
|
641
|
+
action: readCraftingStorageAction(instruction, storageAccounts),
|
|
642
|
+
accounts: storageAccounts,
|
|
643
|
+
label: 'Crafting Process cancellation',
|
|
644
|
+
});
|
|
645
|
+
const description = `Cancel crafting ${String(process.quantityRaw)} units of ${process.recipe.name} at Starbase Player ${process.starbasePlayer.address}, returning all inputs and ${String(process.numCrew)} crew and closing the Crafting Process. ${storage.disclosure}`;
|
|
646
|
+
return buildPlannerPlan({
|
|
722
647
|
kind: 'crafting.cancel-process',
|
|
723
|
-
preconditions:
|
|
648
|
+
preconditions: [
|
|
649
|
+
...(await Promise.all([
|
|
650
|
+
...processPreconditions(process, resolved, profile, [
|
|
651
|
+
{
|
|
652
|
+
kind: 'starbase-system',
|
|
653
|
+
address: process.system.address,
|
|
654
|
+
game,
|
|
655
|
+
starbaseSequenceId: process.starbaseSequenceId,
|
|
656
|
+
describes: `Star System ${process.system.address} retains its canonical Game identity, active Starbase and sequence ${process.starbaseSequenceId}; unrelated shared activity may change.`,
|
|
657
|
+
},
|
|
658
|
+
]),
|
|
659
|
+
accountStatePrecondition(gameAccount, `Game ${game} retains its pinned owner and account layout.`),
|
|
660
|
+
])),
|
|
661
|
+
storage.guard,
|
|
662
|
+
],
|
|
724
663
|
steps: [
|
|
725
664
|
{
|
|
726
665
|
describes: description,
|
|
727
|
-
instruction
|
|
728
|
-
authorization: options.authorization,
|
|
729
|
-
character: resolved.character,
|
|
730
|
-
craftingProcess: process.address,
|
|
731
|
-
game,
|
|
732
|
-
recipe: process.recipe.address,
|
|
733
|
-
starbasePlayer: process.starbasePlayer.address,
|
|
734
|
-
system: process.system.address,
|
|
735
|
-
...(resolved.habAccount === undefined
|
|
736
|
-
? {}
|
|
737
|
-
: { craftingHabInstance: resolved.habAccount.address }),
|
|
738
|
-
}),
|
|
666
|
+
instruction,
|
|
739
667
|
signers: [options.authorization.authority],
|
|
740
668
|
},
|
|
741
669
|
],
|
|
742
670
|
summary: description,
|
|
743
671
|
});
|
|
744
672
|
}
|
|
673
|
+
export { getCraftingFeeRate } from './fee-rate.js';
|
|
745
674
|
//# sourceMappingURL=index.js.map
|