@aephia/atlas-kit 0.8.0-next.2 → 0.8.0-next.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/dist/claim-stakes/actions/index.d.ts +2 -1
  2. package/dist/claim-stakes/actions/index.d.ts.map +1 -1
  3. package/dist/claim-stakes/actions/index.js +10 -11
  4. package/dist/claim-stakes/actions/index.js.map +1 -1
  5. package/dist/client/contracts.d.ts +1 -1
  6. package/dist/client/contracts.d.ts.map +1 -1
  7. package/dist/client/deployments.d.ts +1 -1
  8. package/dist/client/deployments.js +1 -1
  9. package/dist/client/errors.d.ts +1 -1
  10. package/dist/client/errors.d.ts.map +1 -1
  11. package/dist/client/errors.js.map +1 -1
  12. package/dist/combat/actions/index.d.ts.map +1 -1
  13. package/dist/combat/actions/index.js +6 -0
  14. package/dist/combat/actions/index.js.map +1 -1
  15. package/dist/crafting/actions/habs.d.ts +319 -0
  16. package/dist/crafting/actions/habs.d.ts.map +1 -0
  17. package/dist/crafting/actions/habs.js +931 -0
  18. package/dist/crafting/actions/habs.js.map +1 -0
  19. package/dist/crafting/actions/index.d.ts +22 -9
  20. package/dist/crafting/actions/index.d.ts.map +1 -1
  21. package/dist/crafting/actions/index.js +68 -20
  22. package/dist/crafting/actions/index.js.map +1 -1
  23. package/dist/crafting/index.d.ts +21 -2
  24. package/dist/crafting/index.d.ts.map +1 -1
  25. package/dist/crafting/index.js +5 -1
  26. package/dist/crafting/index.js.map +1 -1
  27. package/dist/fleets/actions/index.d.ts +10 -8
  28. package/dist/fleets/actions/index.d.ts.map +1 -1
  29. package/dist/fleets/actions/index.js +15 -13
  30. package/dist/fleets/actions/index.js.map +1 -1
  31. package/dist/identity/index.d.ts +169 -17
  32. package/dist/identity/index.d.ts.map +1 -1
  33. package/dist/identity/index.js +142 -9
  34. package/dist/identity/index.js.map +1 -1
  35. package/dist/internal/c4/career-xp.d.ts +113 -26
  36. package/dist/internal/c4/career-xp.d.ts.map +1 -1
  37. package/dist/internal/c4/career-xp.js +101 -38
  38. package/dist/internal/c4/career-xp.js.map +1 -1
  39. package/dist/internal/c4/character-registration.d.ts.map +1 -1
  40. package/dist/internal/c4/character-registration.js +3 -0
  41. package/dist/internal/c4/character-registration.js.map +1 -1
  42. package/dist/internal/c4/character.d.ts +68 -0
  43. package/dist/internal/c4/character.d.ts.map +1 -1
  44. package/dist/internal/c4/character.js +46 -2
  45. package/dist/internal/c4/character.js.map +1 -1
  46. package/dist/internal/c4/claim-stake.d.ts +0 -1
  47. package/dist/internal/c4/claim-stake.d.ts.map +1 -1
  48. package/dist/internal/c4/claim-stake.js +23 -1
  49. package/dist/internal/c4/claim-stake.js.map +1 -1
  50. package/dist/internal/c4/crafting-hab-storage.d.ts +38 -0
  51. package/dist/internal/c4/crafting-hab-storage.d.ts.map +1 -0
  52. package/dist/internal/c4/crafting-hab-storage.js +164 -0
  53. package/dist/internal/c4/crafting-hab-storage.js.map +1 -0
  54. package/dist/internal/c4/crafting.d.ts +3 -1
  55. package/dist/internal/c4/crafting.d.ts.map +1 -1
  56. package/dist/internal/c4/crafting.js.map +1 -1
  57. package/dist/internal/c4/discriminators.d.ts +30 -0
  58. package/dist/internal/c4/discriminators.d.ts.map +1 -1
  59. package/dist/internal/c4/discriminators.js +61 -1
  60. package/dist/internal/c4/discriminators.js.map +1 -1
  61. package/dist/internal/c4/fleet-storage.d.ts +2 -1
  62. package/dist/internal/c4/fleet-storage.d.ts.map +1 -1
  63. package/dist/internal/c4/fleet-storage.js +14 -5
  64. package/dist/internal/c4/fleet-storage.js.map +1 -1
  65. package/dist/internal/c4/fleet.d.ts +49 -0
  66. package/dist/internal/c4/fleet.d.ts.map +1 -1
  67. package/dist/internal/c4/fleet.js +88 -5
  68. package/dist/internal/c4/fleet.js.map +1 -1
  69. package/dist/internal/c4/game.d.ts +12 -0
  70. package/dist/internal/c4/game.d.ts.map +1 -1
  71. package/dist/internal/c4/game.js +17 -0
  72. package/dist/internal/c4/game.js.map +1 -1
  73. package/dist/internal/c4/governance.d.ts +313 -0
  74. package/dist/internal/c4/governance.d.ts.map +1 -0
  75. package/dist/internal/c4/governance.js +471 -0
  76. package/dist/internal/c4/governance.js.map +1 -0
  77. package/dist/internal/c4/runtime-bindings.d.ts +1 -1
  78. package/dist/internal/c4/runtime-bindings.d.ts.map +1 -1
  79. package/dist/internal/c4/runtime-bindings.js +1 -1
  80. package/dist/internal/c4/runtime-bindings.js.map +1 -1
  81. package/dist/internal/c4/starbase-upgrade.d.ts +20 -0
  82. package/dist/internal/c4/starbase-upgrade.d.ts.map +1 -0
  83. package/dist/internal/c4/starbase-upgrade.js +44 -0
  84. package/dist/internal/c4/starbase-upgrade.js.map +1 -0
  85. package/dist/internal/c4/world.d.ts +3 -2
  86. package/dist/internal/c4/world.d.ts.map +1 -1
  87. package/dist/internal/c4/world.js +4 -18
  88. package/dist/internal/c4/world.js.map +1 -1
  89. package/dist/internal/crafting-process-state.d.ts +16 -3
  90. package/dist/internal/crafting-process-state.d.ts.map +1 -1
  91. package/dist/internal/crafting-process-state.js +44 -0
  92. package/dist/internal/crafting-process-state.js.map +1 -1
  93. package/dist/internal/fleet.d.ts.map +1 -1
  94. package/dist/internal/fleet.js +1 -0
  95. package/dist/internal/fleet.js.map +1 -1
  96. package/dist/internal/planning/authorization-adapter.d.ts +279 -1
  97. package/dist/internal/planning/authorization-adapter.d.ts.map +1 -1
  98. package/dist/internal/planning/authorization-adapter.js +398 -1
  99. package/dist/internal/planning/authorization-adapter.js.map +1 -1
  100. package/dist/internal/planning/crafting-hab-storage-actions.d.ts +10 -0
  101. package/dist/internal/planning/crafting-hab-storage-actions.d.ts.map +1 -0
  102. package/dist/internal/planning/crafting-hab-storage-actions.js +46 -0
  103. package/dist/internal/planning/crafting-hab-storage-actions.js.map +1 -0
  104. package/dist/internal/planning/democracy-storage-actions.d.ts +12 -0
  105. package/dist/internal/planning/democracy-storage-actions.d.ts.map +1 -0
  106. package/dist/internal/planning/democracy-storage-actions.js +81 -0
  107. package/dist/internal/planning/democracy-storage-actions.js.map +1 -0
  108. package/dist/internal/planning/fleet-state.d.ts.map +1 -1
  109. package/dist/internal/planning/fleet-state.js +1 -0
  110. package/dist/internal/planning/fleet-state.js.map +1 -1
  111. package/dist/internal/planning/governance-storage-actions.d.ts +9 -0
  112. package/dist/internal/planning/governance-storage-actions.d.ts.map +1 -0
  113. package/dist/internal/planning/governance-storage-actions.js +89 -0
  114. package/dist/internal/planning/governance-storage-actions.js.map +1 -0
  115. package/dist/internal/planning/placement-fee.d.ts +6 -0
  116. package/dist/internal/planning/placement-fee.d.ts.map +1 -0
  117. package/dist/internal/planning/placement-fee.js +9 -0
  118. package/dist/internal/planning/placement-fee.js.map +1 -0
  119. package/dist/internal/planning/plan-guards.d.ts.map +1 -1
  120. package/dist/internal/planning/plan-guards.js +7 -0
  121. package/dist/internal/planning/plan-guards.js.map +1 -1
  122. package/dist/internal/planning/profile-storage-funding-guard.d.ts +1 -1
  123. package/dist/internal/planning/profile-storage-funding-guard.d.ts.map +1 -1
  124. package/dist/internal/planning/profile-storage-funding-guard.js +65 -1
  125. package/dist/internal/planning/profile-storage-funding-guard.js.map +1 -1
  126. package/dist/internal/planning/rent-catalog.d.ts.map +1 -1
  127. package/dist/internal/planning/rent-catalog.js +10 -1
  128. package/dist/internal/planning/rent-catalog.js.map +1 -1
  129. package/dist/internal/planning/research-unlock.d.ts.map +1 -1
  130. package/dist/internal/planning/research-unlock.js.map +1 -1
  131. package/dist/internal/planning/runtime-guards.d.ts.map +1 -1
  132. package/dist/internal/planning/runtime-guards.js +45 -3
  133. package/dist/internal/planning/runtime-guards.js.map +1 -1
  134. package/dist/internal/planning/starbase-system-guard.d.ts.map +1 -1
  135. package/dist/internal/planning/starbase-system-guard.js +22 -2
  136. package/dist/internal/planning/starbase-system-guard.js.map +1 -1
  137. package/dist/internal/planning/starbase-upgrade-storage-actions.d.ts +7 -0
  138. package/dist/internal/planning/starbase-upgrade-storage-actions.d.ts.map +1 -0
  139. package/dist/internal/planning/starbase-upgrade-storage-actions.js +71 -0
  140. package/dist/internal/planning/starbase-upgrade-storage-actions.js.map +1 -0
  141. package/dist/internal/planning/starbase-upgrade-window.d.ts +47 -0
  142. package/dist/internal/planning/starbase-upgrade-window.d.ts.map +1 -0
  143. package/dist/internal/planning/starbase-upgrade-window.js +122 -0
  144. package/dist/internal/planning/starbase-upgrade-window.js.map +1 -0
  145. package/dist/internal/planning/storage-action-readers.d.ts.map +1 -1
  146. package/dist/internal/planning/storage-action-readers.js +24 -0
  147. package/dist/internal/planning/storage-action-readers.js.map +1 -1
  148. package/dist/mining/actions/index.d.ts +6 -1
  149. package/dist/mining/actions/index.d.ts.map +1 -1
  150. package/dist/mining/actions/index.js +14 -1
  151. package/dist/mining/actions/index.js.map +1 -1
  152. package/dist/mining/exit-fuel.d.ts +47 -0
  153. package/dist/mining/exit-fuel.d.ts.map +1 -0
  154. package/dist/mining/exit-fuel.js +47 -0
  155. package/dist/mining/exit-fuel.js.map +1 -0
  156. package/dist/mining/index.d.ts +1 -0
  157. package/dist/mining/index.d.ts.map +1 -1
  158. package/dist/mining/index.js +1 -0
  159. package/dist/mining/index.js.map +1 -1
  160. package/dist/mining/profile.d.ts +2 -1
  161. package/dist/mining/profile.d.ts.map +1 -1
  162. package/dist/mining/profile.js +2 -1
  163. package/dist/mining/profile.js.map +1 -1
  164. package/dist/planning/assembly.d.ts +2 -0
  165. package/dist/planning/assembly.d.ts.map +1 -1
  166. package/dist/planning/assembly.js +5 -1
  167. package/dist/planning/assembly.js.map +1 -1
  168. package/dist/planning/execution.d.ts.map +1 -1
  169. package/dist/planning/execution.js +85 -5
  170. package/dist/planning/execution.js.map +1 -1
  171. package/dist/planning/index.d.ts +21 -0
  172. package/dist/planning/index.d.ts.map +1 -1
  173. package/dist/planning/index.js +1 -0
  174. package/dist/planning/index.js.map +1 -1
  175. package/dist/planning/plan-validation.d.ts.map +1 -1
  176. package/dist/planning/plan-validation.js +4 -0
  177. package/dist/planning/plan-validation.js.map +1 -1
  178. package/dist/planning/selected-references.d.ts +83 -1
  179. package/dist/planning/selected-references.d.ts.map +1 -1
  180. package/dist/planning/selected-references.js +192 -2
  181. package/dist/planning/selected-references.js.map +1 -1
  182. package/dist/planning/simulation.d.ts.map +1 -1
  183. package/dist/planning/simulation.js +11 -3
  184. package/dist/planning/simulation.js.map +1 -1
  185. package/dist/starbases/actions/democracy.d.ts +205 -0
  186. package/dist/starbases/actions/democracy.d.ts.map +1 -0
  187. package/dist/starbases/actions/democracy.js +861 -0
  188. package/dist/starbases/actions/democracy.js.map +1 -0
  189. package/dist/starbases/actions/governance.d.ts +78 -0
  190. package/dist/starbases/actions/governance.d.ts.map +1 -0
  191. package/dist/starbases/actions/governance.js +382 -0
  192. package/dist/starbases/actions/governance.js.map +1 -0
  193. package/dist/starbases/actions/index.d.ts +3 -1
  194. package/dist/starbases/actions/index.d.ts.map +1 -1
  195. package/dist/starbases/actions/index.js +3 -0
  196. package/dist/starbases/actions/index.js.map +1 -1
  197. package/dist/starbases/actions/upgrades.d.ts +116 -0
  198. package/dist/starbases/actions/upgrades.d.ts.map +1 -0
  199. package/dist/starbases/actions/upgrades.js +546 -0
  200. package/dist/starbases/actions/upgrades.js.map +1 -0
  201. package/dist/starbases/governance.d.ts +445 -0
  202. package/dist/starbases/governance.d.ts.map +1 -0
  203. package/dist/starbases/governance.js +503 -0
  204. package/dist/starbases/governance.js.map +1 -0
  205. package/dist/starbases/index.d.ts +1 -0
  206. package/dist/starbases/index.d.ts.map +1 -1
  207. package/dist/starbases/index.js +1 -0
  208. package/dist/starbases/index.js.map +1 -1
  209. package/package.json +2 -2
@@ -0,0 +1,546 @@
1
+ import { isAddress } from '@solana/kit';
2
+ import { InvalidActionInputError, SageSdkError } from '../../client/errors.js';
3
+ import { readContextRawAccounts } from '../../client/reconciliation.js';
4
+ import { findCharacterPda } from '../../internal/c4/character.js';
5
+ import { factionValue } from '../../internal/c4/faction.js';
6
+ import { deriveFactionOwnershipAddress, deriveKingSystemTrackerAddress, deriveRegionTrackerAddress, } from '../../internal/c4/factions.js';
7
+ import { deriveLoyaltyContributionAddress, deriveLoyaltyEpochAddress, loyaltyContributionAccountDefinition, loyaltyEpochAccountDefinition, } from '../../internal/c4/loyalty.js';
8
+ import { deriveAtlasRewardConfigAddress } from '../../internal/c4/pda.js';
9
+ import { atlasRewardConfigAccountDefinition, atlasRewardRegistryAccountDefinition, deriveAtlasRewardRegistryAddress, } from '../../internal/c4/rewards.js';
10
+ import { deriveStarbasePlayerAddress, starbasePlayerAccountDefinition, starbaseUpgradeProcessAccountDefinition, } from '../../internal/c4/starbase.js';
11
+ import { currentUpgradeMaterials, installableUpgradeQuantity, } from '../../internal/c4/starbase-upgrade.js';
12
+ import { deriveStarSystemAddress, starSystemAccountDefinition, } from '../../internal/c4/world.js';
13
+ import { requireGameAddress } from '../../internal/game-context.js';
14
+ import { accountAbsentPrecondition, accountStatePrecondition, } from '../../internal/planning/account-state.js';
15
+ import { resolveDemocracyHistory } from '../../internal/planning/democracy-history.js';
16
+ import { adaptCancelStarbaseUpgradeContributionInstruction, adaptContributeToStarbaseUpgradeInstruction, adaptInitLoyaltyContributionInstruction, adaptInitLoyaltyEpochInstruction, adaptInstallStarbaseUpgradeResourceInstruction, readPlanAuthorization, } from '../../internal/planning/authorization-adapter.js';
17
+ import { CLOCK_ADDRESS, readClock, } from '../../internal/planning/faction-enrollment.js';
18
+ import { requireDisabledLevelRent } from '../../internal/planning/rent-catalog.js';
19
+ import { RENT_ADDRESS } from '../../internal/planning/rent.js';
20
+ import { readStarbaseUpgradeStorageAction } from '../../internal/planning/starbase-upgrade-storage-actions.js';
21
+ import { planStorageFunding } from '../../internal/planning/storage-actions.js';
22
+ import { buildPlannerPlan } from '../../planning/plan-construction.js';
23
+ const U16_MAX = 65_535;
24
+ const U64_MAX = 18446744073709551615n;
25
+ function fail(message, address) {
26
+ throw new SageSdkError('ACTION_PRECONDITION_FAILED', message, { address });
27
+ }
28
+ function invalid(field, value, accepted, remedy) {
29
+ throw new InvalidActionInputError(field, value, accepted, remedy);
30
+ }
31
+ function readOptions(value, required) {
32
+ if (value === null || typeof value !== 'object' || Array.isArray(value))
33
+ return invalid('options', value, 'a plain object', 'Provide the documented options object before retrying.');
34
+ const options = value;
35
+ const missing = required.find((key) => !Object.hasOwn(options, key));
36
+ const unexpected = Object.keys(options).find((key) => !required.includes(key));
37
+ if (missing !== undefined || unexpected !== undefined)
38
+ invalid('options', missing === undefined ? unexpected : `missing ${missing}`, `exactly the fields ${required.join(', ')}`, 'Remove unknown fields and provide every required option before retrying.');
39
+ return options;
40
+ }
41
+ function present(account, address, message) {
42
+ return account ?? fail(message, address);
43
+ }
44
+ /** Decodes the fresh Star System and requires its current Starbase in the
45
+ * configured Game at `sequenceId`. */
46
+ async function readStarbaseSystem(ctx, game, raw, sequenceId, staleRemedy) {
47
+ const system = starSystemAccountDefinition.decode(raw, ctx.programs);
48
+ if (system.game !== game ||
49
+ (await deriveStarSystemAddress(ctx.programs, game, system.systemId)) !==
50
+ raw.address)
51
+ fail(`Star System ${raw.address} is not the canonical System of its id in configured Game ${game}. Refresh it through this context and retry.`, raw.address);
52
+ if (system.starbase === undefined)
53
+ fail(`Star System ${system.name} (${raw.address}) has no Starbase. Choose a System with a Starbase and retry.`, raw.address);
54
+ if (system.sequenceId !== sequenceId)
55
+ fail(`The Starbase at Star System ${system.name} (${raw.address}) is at sequence ${String(system.sequenceId)}, not ${String(sequenceId)}: it was destroyed or replaced. ${staleRemedy}`, raw.address);
56
+ return system;
57
+ }
58
+ function starbaseSystemGuard(system, game, sequenceId) {
59
+ return {
60
+ kind: 'starbase-system',
61
+ address: system,
62
+ game,
63
+ starbaseSequenceId: sequenceId,
64
+ describes: `Star System ${system} retains its canonical Game identity, active Starbase and sequence ${String(sequenceId)}; unrelated shared activity may change.`,
65
+ };
66
+ }
67
+ /** The game's contribution time: the material's base duration per unit of
68
+ * crew, rounded up, and never less than the base duration. */
69
+ function contributionSeconds(baseSeconds, quantity, crew) {
70
+ const base = BigInt(baseSeconds);
71
+ const scaled = (base * quantity + BigInt(crew) - 1n) / BigInt(crew);
72
+ return scaled > base ? scaled : base;
73
+ }
74
+ /** Plans one Starbase upgrade contribution: one material and idle crew from a
75
+ * Starbase Player go into a new StarbaseUpgradeProcess, which can be installed
76
+ * once its time has passed.
77
+ *
78
+ * The planner requires a Starbase below its maximum level whose current
79
+ * upgrade still needs the material, refuses more than the Starbase still
80
+ * needs, fewer crew than the material requires or than are idle, and cargo the
81
+ * Starbase Player does not hold. Running contributions reserve nothing: the
82
+ * game counts only installed material, and returns at installation whatever
83
+ * the Starbase no longer needs. Key permissions and research access to the
84
+ * material remain chain-authoritative.
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * declare const ctx: SageContext;
89
+ * declare const player: StarbasePlayerSnapshot;
90
+ * declare const options: PlanContributeToStarbaseUpgradeOptions;
91
+ * const plan = await planContributeToStarbaseUpgrade(ctx, player, options);
92
+ * console.log(plan.describe());
93
+ * ```
94
+ */
95
+ export async function planContributeToStarbaseUpgrade(ctx, starbasePlayer, input) {
96
+ const options = readOptions(input, [
97
+ 'authorization',
98
+ 'upgradeProcess',
99
+ 'cargoId',
100
+ 'quantity',
101
+ 'crew',
102
+ ]);
103
+ const authorization = readPlanAuthorization(options.authorization);
104
+ const { upgradeProcess, cargoId, quantity, crew } = options;
105
+ if (typeof upgradeProcess !== 'string' || !isAddress(upgradeProcess))
106
+ invalid('upgradeProcess', upgradeProcess, 'one valid z.ink/Solana account address', 'Generate a new signer for the StarbaseUpgradeProcess and pass its address before retrying.');
107
+ if (!Number.isSafeInteger(cargoId) ||
108
+ cargoId < 0 ||
109
+ cargoId > U16_MAX)
110
+ invalid('cargoId', cargoId, 'a cargo id from the Starbase upgrade materials', 'Choose one of the materials the Starbase still needs before retrying.');
111
+ if (typeof quantity !== 'bigint' || quantity <= 0n || quantity > U64_MAX)
112
+ invalid('quantity', quantity, 'a positive u64 bigint', 'Provide the number of raw units to contribute before retrying.');
113
+ if (!Number.isSafeInteger(crew) ||
114
+ crew < 1 ||
115
+ crew > U16_MAX)
116
+ invalid('crew', crew, 'a positive integer of at most 65,535', 'Assign at least the crew the material requires before retrying.');
117
+ const amount = quantity;
118
+ const crewCount = crew;
119
+ const material = cargoId;
120
+ if (upgradeProcess === authorization.authority)
121
+ invalid('upgradeProcess', upgradeProcess, 'a new signer address other than the authorization key', 'Generate a new signer for the StarbaseUpgradeProcess before retrying.');
122
+ const game = requireGameAddress(ctx);
123
+ const { profile } = authorization;
124
+ if (starbasePlayer.playerProfile.address !== profile)
125
+ fail(`Starbase Player ${starbasePlayer.address} belongs to Profile ${starbasePlayer.playerProfile.address}, not authorization Profile ${profile}. Use the owning Profile and retry.`, starbasePlayer.address);
126
+ const system = starbasePlayer.system.address;
127
+ const character = await findCharacterPda(ctx.programs, profile, game);
128
+ const [systemCandidate, playerCandidate, profileCandidate, characterCandidate, processCandidate, rent,] = await readContextRawAccounts(ctx, [
129
+ system,
130
+ starbasePlayer.address,
131
+ profile,
132
+ character,
133
+ upgradeProcess,
134
+ RENT_ADDRESS,
135
+ ]);
136
+ const playerRaw = present(playerCandidate, starbasePlayer.address, `Starbase Player ${starbasePlayer.address} is missing. Refresh it and retry.`);
137
+ present(characterCandidate, character, `Profile ${profile} has no Character ${character}. Register the Character and retry.`);
138
+ const player = starbasePlayerAccountDefinition.decode(playerRaw, ctx.programs);
139
+ if (player.playerProfile !== profile ||
140
+ player.system !== system ||
141
+ player.character !== character ||
142
+ (await deriveStarbasePlayerAddress(ctx.programs, system, character)) !==
143
+ starbasePlayer.address)
144
+ fail(`Starbase Player ${starbasePlayer.address} is not the canonical registration of Profile ${profile} and its Character at Star System ${system}. Refresh it and retry.`, starbasePlayer.address);
145
+ const systemData = await readStarbaseSystem(ctx, game, present(systemCandidate, system, `Star System ${system} is missing. Refresh it and retry.`), player.sequenceId, 'Register a Starbase Player at the current Starbase and retry.');
146
+ const materials = currentUpgradeMaterials(systemData.starbase);
147
+ if (materials === undefined)
148
+ fail(`The Starbase at ${systemData.name} (${system}) is at its maximum level, ${systemData.starbase.level}, so it takes no upgrade materials.`, system);
149
+ const requirement = materials.find((entry) => entry.cargoId === material);
150
+ if (requirement === undefined)
151
+ invalid('cargoId', material, `one of the upgrade materials ${materials.map((entry) => entry.cargoId).join(', ')}`, `Choose a material the ${systemData.starbase.level} Starbase at ${systemData.name} needs before retrying.`);
152
+ const remaining = requirement.needed > requirement.deposited
153
+ ? requirement.needed - requirement.deposited
154
+ : 0n;
155
+ if (remaining === 0n)
156
+ fail(`The Starbase at ${systemData.name} (${system}) already has all ${String(requirement.needed)} of cargo ${String(material)} installed. Contribute another material, or install finished contributions to complete the upgrade.`, system);
157
+ if (amount > remaining)
158
+ fail(`The Starbase at ${systemData.name} (${system}) needs ${String(remaining)} more of cargo ${String(material)} (${String(requirement.deposited)} of ${String(requirement.needed)} installed); contribute at most that and retry.`, system);
159
+ if (crewCount < requirement.crew)
160
+ fail(`Cargo ${String(material)} needs at least ${String(requirement.crew)} crew per contribution, more than the ${String(crewCount)} requested. Assign more crew and retry.`, system);
161
+ const idle = player.totalCrew - player.busyCrew;
162
+ if (crewCount > idle)
163
+ fail(`Starbase Player ${starbasePlayer.address} has ${String(idle)} idle crew, fewer than the ${String(crewCount)} requested. Assign fewer crew or wait for busy crew to return, then retry.`, starbasePlayer.address);
164
+ const held = player.cargo.amounts.find((entry) => entry.cargoId === material)?.amount ??
165
+ 0n;
166
+ if (held < amount)
167
+ fail(`Starbase Player ${starbasePlayer.address} holds ${String(held)} of cargo ${String(material)}, fewer than the ${String(amount)} to contribute. Bring more to the Starbase or contribute less, then retry.`, starbasePlayer.address);
168
+ if (processCandidate !== undefined)
169
+ fail(`Account ${upgradeProcess} already exists. Generate a new signer for the StarbaseUpgradeProcess and retry.`, upgradeProcess);
170
+ const instruction = adaptContributeToStarbaseUpgradeInstruction(ctx.programs, {
171
+ authorization,
172
+ character,
173
+ system,
174
+ starbasePlayer: starbasePlayer.address,
175
+ upgradeProcess,
176
+ game,
177
+ cargoId: material,
178
+ quantity: amount,
179
+ crew: crewCount,
180
+ });
181
+ const accounts = new Map([
182
+ [playerRaw.address, playerRaw],
183
+ [system, systemCandidate],
184
+ [profile, profileCandidate],
185
+ [RENT_ADDRESS, rent],
186
+ ]);
187
+ const funding = planStorageFunding(ctx.programs, {
188
+ action: readStarbaseUpgradeStorageAction(ctx.programs, instruction, accounts),
189
+ accounts,
190
+ label: 'Starbase upgrade contribution',
191
+ });
192
+ const seconds = contributionSeconds(requirement.durationSeconds, amount, crewCount);
193
+ const description = `Contribute ${String(amount)} of cargo ${String(material)} and ${String(crewCount)} crew from Starbase Player ${starbasePlayer.address} to the ${systemData.starbase.level} Starbase at ${systemData.name} (${String(requirement.deposited)} of ${String(requirement.needed)} installed). The game takes the cargo now, caps it at what the Starbase still needs when the transaction executes, and keeps the crew busy until the contribution is installed or cancelled; it can be installed ${String(seconds)} seconds after the transaction. ${funding.disclosure} Key permissions and research access to the material remain chain-authoritative.`;
194
+ return buildPlannerPlan(ctx.programs, {
195
+ kind: 'starbases.contribute-upgrade',
196
+ preconditions: [
197
+ await accountStatePrecondition(playerRaw, `Starbase Player ${starbasePlayer.address} keeps its cargo, crew and Starbase.`),
198
+ starbaseSystemGuard(system, game, player.sequenceId),
199
+ accountAbsentPrecondition(upgradeProcess, `StarbaseUpgradeProcess ${upgradeProcess} remains absent until execution.`),
200
+ funding.guard,
201
+ ],
202
+ steps: [
203
+ {
204
+ describes: description,
205
+ instruction,
206
+ signers: [authorization.authority, upgradeProcess],
207
+ },
208
+ ],
209
+ summary: `Contribute ${String(amount)} of cargo ${String(material)} to the Starbase at ${systemData.name}.`,
210
+ });
211
+ }
212
+ /** Reads and validates a contribution, its Starbase Player and Star System,
213
+ * and the chain Clock, for cancellation or installation. */
214
+ async function readProcess(ctx, process, input) {
215
+ const options = readOptions(input, ['authorization']);
216
+ const authorization = readPlanAuthorization(options.authorization);
217
+ const game = requireGameAddress(ctx);
218
+ const { profile } = authorization;
219
+ if (process.playerProfile.address !== profile)
220
+ fail(`StarbaseUpgradeProcess ${process.address} belongs to Profile ${process.playerProfile.address}; only that Profile can cancel or install it.`, process.address);
221
+ const character = await findCharacterPda(ctx.programs, profile, game);
222
+ const [processCandidate, playerCandidate, systemCandidate, clock] = await readContextRawAccounts(ctx, [
223
+ process.address,
224
+ process.starbasePlayer.address,
225
+ process.system.address,
226
+ CLOCK_ADDRESS,
227
+ ]);
228
+ const processRaw = present(processCandidate, process.address, `StarbaseUpgradeProcess ${process.address} is missing, so it was already cancelled or installed. Refresh the Starbase Player's upgrade processes.`);
229
+ const data = starbaseUpgradeProcessAccountDefinition.decode(processRaw, ctx.programs);
230
+ if (data.playerProfile !== profile ||
231
+ data.starbasePlayer !== process.starbasePlayer.address ||
232
+ data.system !== process.system.address ||
233
+ data.starbaseSequenceId !== process.starbaseSequenceId ||
234
+ data.resourceId !== process.resource.id ||
235
+ data.quantityRaw !== process.resource.quantityRaw ||
236
+ data.numCrew !== process.numCrew ||
237
+ data.endsAtUnixSeconds !== process.endsAtUnixSeconds)
238
+ fail(`StarbaseUpgradeProcess ${process.address} no longer matches its Profile, Starbase Player, System, material, crew or end time. Refresh it and retry.`, process.address);
239
+ const playerRaw = present(playerCandidate, process.starbasePlayer.address, `Starbase Player ${process.starbasePlayer.address} is missing. Refresh it and retry.`);
240
+ const player = starbasePlayerAccountDefinition.decode(playerRaw, ctx.programs);
241
+ if (player.playerProfile !== profile ||
242
+ player.character !== character ||
243
+ player.system !== process.system.address ||
244
+ (await deriveStarbasePlayerAddress(ctx.programs, process.system.address, character)) !== process.starbasePlayer.address)
245
+ fail(`Starbase Player ${process.starbasePlayer.address} is not the canonical registration of Profile ${profile} and its Character at Star System ${process.system.address}. Refresh it and retry.`, process.starbasePlayer.address);
246
+ const systemRaw = present(systemCandidate, process.system.address, `Star System ${process.system.address} is missing. Refresh it and retry.`);
247
+ const system = await readStarbaseSystem(ctx, game, systemRaw, process.starbaseSequenceId, 'A contribution to an earlier Starbase can be neither cancelled nor installed; Atlas Kit does not plan its removal yet.');
248
+ if (player.sequenceId !== process.starbaseSequenceId)
249
+ fail(`Starbase Player ${process.starbasePlayer.address} belongs to an earlier Starbase at Star System ${process.system.address}. Refresh it and retry.`, process.starbasePlayer.address);
250
+ const [profileCandidate, rent] = await readContextRawAccounts(ctx, [
251
+ profile,
252
+ RENT_ADDRESS,
253
+ ]);
254
+ return {
255
+ authorization,
256
+ game,
257
+ now: readClock(present(clock, CLOCK_ADDRESS, 'The chain Clock is missing. Retry against a complete RPC provider.')),
258
+ processRaw,
259
+ playerRaw,
260
+ player,
261
+ systemRaw,
262
+ system,
263
+ storageAccounts: new Map([
264
+ [playerRaw.address, playerRaw],
265
+ [processRaw.address, processRaw],
266
+ [profile, profileCandidate],
267
+ [RENT_ADDRESS, rent],
268
+ ]),
269
+ };
270
+ }
271
+ /** Plans the cancellation of a running Starbase upgrade contribution: the game
272
+ * returns its whole material and crew to the Starbase Player and closes the
273
+ * StarbaseUpgradeProcess.
274
+ *
275
+ * The game cancels only a contribution whose time has not yet passed, so the
276
+ * planner refuses a finished one, which can be installed instead. The Plan
277
+ * must execute before the contribution ends.
278
+ *
279
+ * @example
280
+ * ```ts
281
+ * declare const ctx: SageContext;
282
+ * declare const process: StarbaseUpgradeProcessSnapshot;
283
+ * declare const authorization: PlanAuthorization;
284
+ * const plan = await planCancelStarbaseUpgradeContribution(ctx, process, {
285
+ * authorization,
286
+ * });
287
+ * console.log(plan.describe());
288
+ * ```
289
+ */
290
+ export async function planCancelStarbaseUpgradeContribution(ctx, process, input) {
291
+ const context = await readProcess(ctx, process, input);
292
+ const { authorization, game, now } = context;
293
+ if (now >= process.endsAtUnixSeconds)
294
+ fail(`StarbaseUpgradeProcess ${process.address} finished at ${String(process.endsAtUnixSeconds)} (chain time ${String(now)}), and the game cancels only a running contribution. Install it instead with planInstallStarbaseUpgradeResource.`, process.address);
295
+ const instruction = adaptCancelStarbaseUpgradeContributionInstruction(ctx.programs, {
296
+ authorization,
297
+ system: process.system.address,
298
+ starbasePlayer: process.starbasePlayer.address,
299
+ upgradeProcess: process.address,
300
+ game,
301
+ });
302
+ const funding = planStorageFunding(ctx.programs, {
303
+ action: readStarbaseUpgradeStorageAction(ctx.programs, instruction, context.storageAccounts),
304
+ accounts: context.storageAccounts,
305
+ label: 'Starbase upgrade cancellation',
306
+ });
307
+ const description = `Cancel the contribution of ${String(process.resource.quantityRaw)} ${process.resource.name} to the Starbase at ${context.system.name}, returning the material and ${String(process.numCrew)} crew to Starbase Player ${process.starbasePlayer.address} and closing StarbaseUpgradeProcess ${process.address}. The game refuses the cancellation once the contribution ends at ${String(process.endsAtUnixSeconds)}. ${funding.disclosure}`;
308
+ return buildPlannerPlan(ctx.programs, {
309
+ kind: 'starbases.cancel-upgrade-contribution',
310
+ preconditions: [
311
+ {
312
+ kind: 'starbase-upgrade-cancel-window',
313
+ address: process.address,
314
+ endsAtUnixSeconds: process.endsAtUnixSeconds,
315
+ describes: `StarbaseUpgradeProcess ${process.address} is still running when the cancellation executes, before ${String(process.endsAtUnixSeconds)}; afterwards install it instead.`,
316
+ },
317
+ await accountStatePrecondition(context.processRaw, `StarbaseUpgradeProcess ${process.address} keeps its material, crew and end time.`),
318
+ starbaseSystemGuard(process.system.address, game, process.starbaseSequenceId),
319
+ funding.guard,
320
+ ],
321
+ steps: [
322
+ {
323
+ describes: description,
324
+ instruction,
325
+ signers: [authorization.authority],
326
+ },
327
+ ],
328
+ summary: `Cancel the ${process.resource.name} contribution to the Starbase at ${context.system.name}.`,
329
+ });
330
+ }
331
+ /** Plans the installation of a finished Starbase upgrade contribution: the
332
+ * game applies the material to the Starbase's current upgrade, returns what it
333
+ * no longer needs and the crew to the Starbase Player, closes the
334
+ * StarbaseUpgradeProcess and raises the Starbase's level once every material
335
+ * is installed.
336
+ *
337
+ * A Starbase rebuilt from level 0 joins the contributor's faction when it
338
+ * reaches level 1, except in a sanctuary System. Installed material can earn
339
+ * the contributor Loyalty Points for the current reward epoch; for a material
340
+ * with a configured rate, the game then needs the faction's Loyalty epoch and
341
+ * the Profile's contribution record, and the Plan opens whichever is missing
342
+ * first, its rent paid by the authorization key's wallet. The game refuses
343
+ * the installation outside the current reward epoch while rewards are
344
+ * enabled. Requires Disabled rent: the Game's rent catalog and the System's
345
+ * Starbase-level rent history must not exist.
346
+ *
347
+ * @example
348
+ * ```ts
349
+ * declare const ctx: SageContext;
350
+ * declare const process: StarbaseUpgradeProcessSnapshot;
351
+ * declare const authorization: PlanAuthorization;
352
+ * const plan = await planInstallStarbaseUpgradeResource(ctx, process, {
353
+ * authorization,
354
+ * });
355
+ * console.log(plan.describe());
356
+ * ```
357
+ */
358
+ export async function planInstallStarbaseUpgradeResource(ctx, process, input) {
359
+ const context = await readProcess(ctx, process, input);
360
+ const { authorization, game, now, system } = context;
361
+ const systemAddress = process.system.address;
362
+ if (now < process.endsAtUnixSeconds)
363
+ fail(`StarbaseUpgradeProcess ${process.address} runs until ${String(process.endsAtUnixSeconds)} (chain time ${String(now)}). Wait until it ends and retry, or cancel it with planCancelStarbaseUpgradeContribution.`, process.address);
364
+ const materials = currentUpgradeMaterials(system.starbase);
365
+ const installed = installableUpgradeQuantity(materials, process.resource.id, process.resource.quantityRaw);
366
+ const returned = process.resource.quantityRaw - installed;
367
+ const completes = installed > 0n &&
368
+ materials.every((entry) => entry.deposited +
369
+ (entry.cargoId === process.resource.id ? installed : 0n) >=
370
+ entry.needed);
371
+ const [registryAddress, kingTracker, regionTracker, factionOwnership, rentState,] = await Promise.all([
372
+ deriveAtlasRewardRegistryAddress(ctx.programs, game),
373
+ deriveKingSystemTrackerAddress(ctx.programs, game),
374
+ deriveRegionTrackerAddress(ctx.programs, game),
375
+ deriveFactionOwnershipAddress(ctx.programs, game, 'starbase', systemAddress),
376
+ requireDisabledLevelRent(ctx, game, { address: systemAddress, systemId: system.systemId }, 'the Starbase upgrade installation'),
377
+ ]);
378
+ const [registryCandidate, kingCandidate, regionCandidate] = await readContextRawAccounts(ctx, [
379
+ registryAddress,
380
+ kingTracker,
381
+ regionTracker,
382
+ ]);
383
+ const registry = atlasRewardRegistryAccountDefinition.decode(present(registryCandidate, registryAddress, `AtlasRewardRegistry ${registryAddress} is missing. Refresh reward configuration and retry.`), ctx.programs);
384
+ if (registry.game !== game)
385
+ fail(`AtlasRewardRegistry ${registryAddress} belongs to another Game. Refresh the configured reward registry and retry.`, registryAddress);
386
+ const rewardConfig = await deriveAtlasRewardConfigAddress(ctx.programs, game, registry.activeConfigVersion);
387
+ const [configCandidate] = await readContextRawAccounts(ctx, [rewardConfig]);
388
+ const config = atlasRewardConfigAccountDefinition.decode(present(configCandidate, rewardConfig, `AtlasRewardConfig ${rewardConfig} is missing. Refresh reward configuration and retry.`), ctx.programs);
389
+ if (config.game !== game ||
390
+ config.configVersion !== registry.activeConfigVersion)
391
+ fail(`AtlasRewardConfig ${rewardConfig} does not match the configured Game and active registry version. Refresh reward configuration and retry.`, rewardConfig);
392
+ if ((config.enabled || registry.pendingConfig.kind === 'pending') &&
393
+ (now < registry.currentEpochStartedAtUnixSeconds ||
394
+ now >= registry.currentEpochEndsAtUnixSeconds))
395
+ fail(`Reward epoch ${String(registry.currentEpoch)} ended at ${String(registry.currentEpochEndsAtUnixSeconds)} (chain time ${String(now)}), and the game refuses installations until the next epoch opens. Retry after it does.`, registryAddress);
396
+ // Both trackers are the Game's own by derivation; the game validates them.
397
+ for (const [candidate, address, name] of [
398
+ [kingCandidate, kingTracker, 'KingSystemTracker'],
399
+ [regionCandidate, regionTracker, 'RegionTracker'],
400
+ ]) {
401
+ if (candidate === undefined || candidate.owner !== ctx.programs.sage)
402
+ fail(`${name} ${address} is missing for configured Game ${game}. Refresh world ownership and retry.`, address);
403
+ }
404
+ // Loyalty Points need the faction's epoch and the Profile's record; only
405
+ // the three major factions earn them.
406
+ const rate = config.upgradeLpRates.find((entry) => entry.cargoId === process.resource.id)
407
+ ?.lpPerRawUnit ?? 0n;
408
+ const faction = factionValue(context.player.faction);
409
+ const earns = installed > 0n && rate > 0n && faction >= 1 && faction <= 3;
410
+ const steps = [];
411
+ const preconditions = [];
412
+ let loyaltyEpoch;
413
+ let loyaltyContribution;
414
+ if (faction >= 1 && faction <= 3) {
415
+ const epochIndex = registry.currentEpoch;
416
+ const [epochAddress, contributionAddress] = await Promise.all([
417
+ deriveLoyaltyEpochAddress(ctx.programs, game, faction, epochIndex),
418
+ deriveLoyaltyContributionAddress(ctx.programs, game, authorization.profile, faction, epochIndex),
419
+ ]);
420
+ const [epochCandidate, contributionCandidate] = await readContextRawAccounts(ctx, [epochAddress, contributionAddress]);
421
+ if (epochCandidate !== undefined) {
422
+ const epoch = loyaltyEpochAccountDefinition.decode(epochCandidate, ctx.programs);
423
+ if (epoch.game !== game ||
424
+ epoch.factionId !== faction ||
425
+ epoch.epochIndex !== epochIndex)
426
+ fail(`LoyaltyEpoch ${epochAddress} does not match the configured Game, faction ${String(faction)} and reward epoch ${String(epochIndex)}. Refresh reward relationships and retry.`, epochAddress);
427
+ if (earns && epoch.status !== 'open')
428
+ fail(`LoyaltyEpoch ${epochAddress} is ${epoch.status}, and the game records Loyalty Points only in an open epoch. Retry after the next reward epoch opens.`, epochAddress);
429
+ loyaltyEpoch = epochAddress;
430
+ }
431
+ else if (earns) {
432
+ steps.push({
433
+ describes: `Open faction ${String(faction)}'s Loyalty epoch ${String(epochIndex)}, its rent paid by wallet ${authorization.authority}.`,
434
+ instruction: adaptInitLoyaltyEpochInstruction(ctx.programs, {
435
+ funder: authorization.authority,
436
+ game,
437
+ rewardRegistry: registryAddress,
438
+ rewardConfig,
439
+ loyaltyEpoch: epochAddress,
440
+ factionId: faction,
441
+ epochIndex,
442
+ }),
443
+ signers: [authorization.authority],
444
+ });
445
+ preconditions.push(accountAbsentPrecondition(epochAddress, `Faction ${String(faction)}'s Loyalty epoch ${String(epochIndex)} is still unopened.`));
446
+ loyaltyEpoch = epochAddress;
447
+ }
448
+ if (contributionCandidate !== undefined) {
449
+ const record = loyaltyContributionAccountDefinition.decode(contributionCandidate, ctx.programs);
450
+ if (record.game !== game ||
451
+ record.profile !== authorization.profile ||
452
+ record.factionId !== faction ||
453
+ record.epochIndex !== epochIndex)
454
+ fail(`LoyaltyContribution ${contributionAddress} does not match Profile ${authorization.profile}, the configured Game, faction ${String(faction)} and reward epoch ${String(epochIndex)}. Refresh reward relationships and retry.`, contributionAddress);
455
+ loyaltyContribution = contributionAddress;
456
+ }
457
+ else if (earns) {
458
+ steps.push({
459
+ describes: `Open Profile ${authorization.profile}'s Loyalty contribution for faction ${String(faction)} in epoch ${String(epochIndex)}, its rent paid by wallet ${authorization.authority}.`,
460
+ instruction: adaptInitLoyaltyContributionInstruction(ctx.programs, {
461
+ funder: authorization.authority,
462
+ game,
463
+ profile: authorization.profile,
464
+ loyaltyEpoch: epochAddress,
465
+ loyaltyContribution: contributionAddress,
466
+ factionId: faction,
467
+ epochIndex,
468
+ }),
469
+ signers: [authorization.authority],
470
+ });
471
+ preconditions.push(accountAbsentPrecondition(contributionAddress, `Profile ${authorization.profile}'s Loyalty contribution for epoch ${String(epochIndex)} is still unopened.`));
472
+ loyaltyContribution = contributionAddress;
473
+ }
474
+ }
475
+ // The installation records the System's history and takes no Career XP or
476
+ // fee accounts.
477
+ const history = await resolveDemocracyHistory(ctx, {
478
+ game,
479
+ system: systemAddress,
480
+ });
481
+ const instruction = adaptInstallStarbaseUpgradeResourceInstruction(ctx.programs, {
482
+ ...history.accounts,
483
+ ...rentState.accounts,
484
+ authorization,
485
+ system: systemAddress,
486
+ starbasePlayer: process.starbasePlayer.address,
487
+ upgradeProcess: process.address,
488
+ regionTracker,
489
+ game,
490
+ rewardRegistry: registryAddress,
491
+ rewardConfig,
492
+ ...(loyaltyEpoch === undefined ? {} : { loyaltyEpoch }),
493
+ ...(loyaltyContribution === undefined ? {} : { loyaltyContribution }),
494
+ kingTracker,
495
+ factionOwnership,
496
+ });
497
+ const funding = planStorageFunding(ctx.programs, {
498
+ action: readStarbaseUpgradeStorageAction(ctx.programs, instruction, context.storageAccounts),
499
+ accounts: context.storageAccounts,
500
+ label: 'Starbase upgrade installation',
501
+ });
502
+ const material = `${String(process.resource.quantityRaw)} ${process.resource.name}`;
503
+ const outcome = installed === 0n
504
+ ? `The Starbase no longer needs ${process.resource.name}, so the game returns all ${material} to the Starbase Player.`
505
+ : `The game installs ${String(installed)} ${process.resource.name}${returned > 0n ? ` and returns the other ${String(returned)}` : ''}${completes ? `, which completes the ${system.starbase.level} upgrade and raises the Starbase's level` : ''}.`;
506
+ const loyalty = earns
507
+ ? ` The installed material can earn up to ${String(installed * rate)} Loyalty Points in reward epoch ${String(registry.currentEpoch)}.`
508
+ : installed > 0n && rate > 0n
509
+ ? ` This material earns Loyalty Points only for MUD, ONI or Ustur players, so the game may refuse this installation for an unaligned Starbase Player.`
510
+ : '';
511
+ const description = `Install the contribution of ${material} to the Starbase at ${system.name}, returning ${String(process.numCrew)} crew to Starbase Player ${process.starbasePlayer.address} and closing StarbaseUpgradeProcess ${process.address}. ${outcome}${loyalty} The amount installed follows the Starbase's state when the transaction executes. ${funding.disclosure}`;
512
+ steps.push({
513
+ describes: description,
514
+ instruction,
515
+ signers: [authorization.authority],
516
+ });
517
+ return buildPlannerPlan(ctx.programs, {
518
+ kind: 'starbases.install-upgrade-resource',
519
+ preconditions: [
520
+ {
521
+ kind: 'starbase-upgrade-install-window',
522
+ address: process.address,
523
+ game,
524
+ rewardRegistry: registryAddress,
525
+ rewardConfig,
526
+ rewardEpoch: registry.currentEpoch,
527
+ endsAtUnixSeconds: process.endsAtUnixSeconds,
528
+ describes: `StarbaseUpgradeProcess ${process.address} has ended, and the installation executes in reward epoch ${String(registry.currentEpoch)} under the same active reward configuration, while the game accepts installations.`,
529
+ },
530
+ await accountStatePrecondition(context.processRaw, `StarbaseUpgradeProcess ${process.address} keeps its material, crew and end time.`),
531
+ ...preconditions,
532
+ ...rentState.guards,
533
+ {
534
+ kind: 'democracy-history',
535
+ address: history.intent.address,
536
+ intent: history.intent,
537
+ accounts: history.accounts,
538
+ describes: 'The canonical System history remains eligible on the observed chain day; initialized history and effective policy must still match. Close pending checkpoints and recreate the Plan if the day changes.',
539
+ },
540
+ funding.guard,
541
+ ],
542
+ steps,
543
+ summary: `Install the ${process.resource.name} contribution to the Starbase at ${system.name}.`,
544
+ });
545
+ }
546
+ //# sourceMappingURL=upgrades.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrades.js","sourceRoot":"","sources":["../../../src/starbases/actions/upgrades.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,MAAM,aAAa,CAAC;AAGtD,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,0BAA0B,GAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gCAAgC,EAChC,yBAAyB,EACzB,oCAAoC,EACpC,6BAA6B,GAC9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EACL,kCAAkC,EAClC,oCAAoC,EACpC,gCAAgC,GACjC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,uCAAuC,GAExC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,uBAAuB,EACvB,2BAA2B,GAG5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EACL,y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