@aephia/atlas-kit 0.6.0-next.44 → 0.6.0-next.45
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/claim-stakes/actions/index.d.ts +13 -0
- package/dist/claim-stakes/actions/index.d.ts.map +1 -1
- package/dist/claim-stakes/actions/index.js +77 -30
- package/dist/claim-stakes/actions/index.js.map +1 -1
- package/dist/crafting/actions/index.d.ts.map +1 -1
- package/dist/crafting/actions/index.js +0 -1
- package/dist/crafting/actions/index.js.map +1 -1
- package/dist/internal/c4/fleet.d.ts +14 -0
- package/dist/internal/c4/fleet.d.ts.map +1 -1
- package/dist/internal/c4/fleet.js.map +1 -1
- package/dist/internal/c4/runtime-bindings.d.ts +1 -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/fleet.d.ts +1 -0
- package/dist/internal/fleet.d.ts.map +1 -1
- package/dist/internal/fleet.js.map +1 -1
- package/dist/internal/planning/governance-fees.js +2 -2
- package/dist/internal/planning/governance-fees.js.map +1 -1
- package/dist/internal/planning/runtime-guards.d.ts.map +1 -1
- package/dist/internal/planning/runtime-guards.js +85 -3
- package/dist/internal/planning/runtime-guards.js.map +1 -1
- package/dist/internal/planning/xp-runtime.d.ts +4 -2
- package/dist/internal/planning/xp-runtime.d.ts.map +1 -1
- package/dist/internal/planning/xp-runtime.js +8 -4
- package/dist/internal/planning/xp-runtime.js.map +1 -1
- package/dist/markets/actions/index.d.ts.map +1 -1
- package/dist/markets/actions/index.js +0 -2
- package/dist/markets/actions/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -255,6 +255,9 @@ export declare function planPlaceClaimStake(ctx: SageContext, body: CelestialBod
|
|
|
255
255
|
* construction cargo. Rent synchronization and the final concurrent sequence
|
|
256
256
|
* race remain chain-authoritative.
|
|
257
257
|
*
|
|
258
|
+
* Requires Game 2 and its existing canonical Claim Stake XP ledger.
|
|
259
|
+
* Missing XP state must be repaired outside this Plan; no accounts are created.
|
|
260
|
+
*
|
|
258
261
|
* @example
|
|
259
262
|
* ```ts
|
|
260
263
|
* declare const ctx: SageContext;
|
|
@@ -272,6 +275,10 @@ export declare function planClaimStakeBuildingChanges(ctx: SageContext, stake: C
|
|
|
272
275
|
* CurrencyCache, and a known positive rent balance. Rent timing and the final
|
|
273
276
|
* crew/building validation remain chain-authoritative.
|
|
274
277
|
*
|
|
278
|
+
* Requires Game 2 and its existing canonical Claim Stake XP ledger.
|
|
279
|
+
* The Character XP budget and configuration must also be reconciled.
|
|
280
|
+
* Missing XP state must be repaired outside this Plan; no accounts are created.
|
|
281
|
+
*
|
|
275
282
|
* @example
|
|
276
283
|
* ```ts
|
|
277
284
|
* declare const ctx: SageContext;
|
|
@@ -293,6 +300,9 @@ export declare function planFinalizeClaimStakeBuildingChanges(ctx: SageContext,
|
|
|
293
300
|
* state; rent arithmetic and concurrent state transitions remain
|
|
294
301
|
* chain-authoritative.
|
|
295
302
|
*
|
|
303
|
+
* Requires Game 2 and its existing canonical Claim Stake XP ledger.
|
|
304
|
+
* Missing XP state must be repaired outside this Plan; no accounts are created.
|
|
305
|
+
*
|
|
296
306
|
* @example
|
|
297
307
|
* ```ts
|
|
298
308
|
* declare const ctx: SageContext;
|
|
@@ -352,6 +362,9 @@ export declare function planTopUpClaimStakeRent(ctx: SageContext, stake: ClaimSt
|
|
|
352
362
|
* FleetCrewBinding. The chain remains authoritative for range, duration,
|
|
353
363
|
* permission bits, concurrent state changes, and transfer arithmetic.
|
|
354
364
|
*
|
|
365
|
+
* Requires Game 2 and its existing canonical Claim Stake XP ledger.
|
|
366
|
+
* Missing XP state must be repaired outside this Plan; no accounts are created.
|
|
367
|
+
*
|
|
355
368
|
* @example
|
|
356
369
|
* ```ts
|
|
357
370
|
* declare const ctx: SageContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/claim-stakes/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,OAAO,EACb,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAiCtD,OAAO,EAML,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE7B,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/claim-stakes/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,OAAO,EACb,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAiCtD,OAAO,EAML,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE7B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAUL,KAAK,iBAAiB,EACvB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAEL,KAAK,IAAI,EAEV,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAGxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAwBlC,UAAU,aAAa;IACrB,QAAQ,CAAC,eAAe,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;IACzD,QAAQ,CAAC,sBAAsB,EAAE,SAAS,CAAC,SAAS,eAAe,EAAE,CAAC,EAAE,CAAC;IACzE,QAAQ,CAAC,0BAA0B,EAAE,SAAS,CAAC,SAAS,eAAe,EAAE,CAAC,EAAE,CAAC;IAC7E,QAAQ,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|
|
11
11
|
import { deriveProfileFactionAddress, profileFactionIdentityAccountDefinition, } from '../../internal/c4/profile-faction.js';
|
|
12
12
|
import { deriveStarbasePlayerAddress, starbasePlayerAccountDefinition, } from '../../internal/c4/starbase.js';
|
|
13
13
|
import { celestialBodyAccountDefinition, decodeIndexedCelestialBodyAccount, deriveCelestialBodyAddress, deriveStarSystemAddress, starSystemAccountDefinition, } from '../../internal/c4/world.js';
|
|
14
|
+
import { resolveXpRuntime } from '../../internal/planning/xp-runtime.js';
|
|
14
15
|
import { requireGameAddress } from '../../internal/game-context.js';
|
|
15
16
|
import { adaptCancelClaimStakeBuildingChangesInstruction, adaptClaimStakeBuildingChangesInstruction, adaptDeconstructClaimStakeInstruction, adaptFinalizeClaimStakeBuildingChangesInstruction, adaptPlaceClaimStakeInstruction, adaptRecoverClaimStakeFleetTransferInstruction, adaptStartClaimStakeFleetTransferInstruction, adaptTopUpClaimStakeRentInstruction, validatePlanAuthorization, } from '../../internal/planning/authorization-adapter.js';
|
|
16
17
|
import { createPlan, } from '../../planning/index.js';
|
|
17
18
|
import { readFreshGameCargoDefinitions } from '../../registry/cargo.js';
|
|
18
19
|
import { resolveCargo } from '../../registry/index.js';
|
|
20
|
+
async function resolveClaimStakeXp(ctx, game, structure, character) {
|
|
21
|
+
const xp = await resolveXpRuntime(ctx, {
|
|
22
|
+
game,
|
|
23
|
+
structure,
|
|
24
|
+
...(character === undefined ? {} : { character }),
|
|
25
|
+
});
|
|
26
|
+
const guard = {
|
|
27
|
+
kind: 'xp-runtime',
|
|
28
|
+
address: game,
|
|
29
|
+
intent: xp.intent,
|
|
30
|
+
accounts: xp.accounts,
|
|
31
|
+
describes: 'The Game and canonical Claim Stake XP accounts remain supported; accrued XP may change. Initialize or repair missing XP state using the game client, then recreate the Plan.',
|
|
32
|
+
};
|
|
33
|
+
return { accounts: xp.accounts, guard };
|
|
34
|
+
}
|
|
19
35
|
const U64_MAX = (1n << 64n) - 1n;
|
|
20
36
|
const U16_MAX = 65_535;
|
|
21
37
|
const I32_MAX = 2_147_483_647;
|
|
@@ -509,6 +525,9 @@ function buildingDescription(change, name) {
|
|
|
509
525
|
* construction cargo. Rent synchronization and the final concurrent sequence
|
|
510
526
|
* race remain chain-authoritative.
|
|
511
527
|
*
|
|
528
|
+
* Requires Game 2 and its existing canonical Claim Stake XP ledger.
|
|
529
|
+
* Missing XP state must be repaired outside this Plan; no accounts are created.
|
|
530
|
+
*
|
|
512
531
|
* @example
|
|
513
532
|
* ```ts
|
|
514
533
|
* declare const ctx: SageContext;
|
|
@@ -746,6 +765,7 @@ export async function planClaimStakeBuildingChanges(ctx, stake, input) {
|
|
|
746
765
|
}
|
|
747
766
|
const currencyCache = await deriveCurrencyCacheAddress(game);
|
|
748
767
|
const description = `Change buildings on Claim Stake ${stake.address}: ${descriptions.join('; ')}.`;
|
|
768
|
+
const xp = await resolveClaimStakeXp(ctx, game, stake.address);
|
|
749
769
|
return createPlan({
|
|
750
770
|
kind: 'claim-stakes.building-changes',
|
|
751
771
|
preconditions: [
|
|
@@ -759,11 +779,13 @@ export async function planClaimStakeBuildingChanges(ctx, stake, input) {
|
|
|
759
779
|
precondition(profileFactionAccount, `ProfileFaction ${profileFaction} remains assigned to Profile ${options.authorization.profile} and aligned with the current Starbase controller.`),
|
|
760
780
|
])),
|
|
761
781
|
ownershipPrecondition,
|
|
782
|
+
xp.guard,
|
|
762
783
|
],
|
|
763
784
|
steps: [
|
|
764
785
|
{
|
|
765
786
|
describes: description,
|
|
766
787
|
instruction: adaptClaimStakeBuildingChangesInstruction({
|
|
788
|
+
...xp.accounts,
|
|
767
789
|
authorization: options.authorization,
|
|
768
790
|
buildingChanges: options.buildingChanges.map(({ buildingId, kind, quantity }) => [buildingId, kind === 'add' ? quantity : -quantity]),
|
|
769
791
|
celestialBody: stake.body.address,
|
|
@@ -789,6 +811,10 @@ export async function planClaimStakeBuildingChanges(ctx, stake, input) {
|
|
|
789
811
|
* CurrencyCache, and a known positive rent balance. Rent timing and the final
|
|
790
812
|
* crew/building validation remain chain-authoritative.
|
|
791
813
|
*
|
|
814
|
+
* Requires Game 2 and its existing canonical Claim Stake XP ledger.
|
|
815
|
+
* The Character XP budget and configuration must also be reconciled.
|
|
816
|
+
* Missing XP state must be repaired outside this Plan; no accounts are created.
|
|
817
|
+
*
|
|
792
818
|
* @example
|
|
793
819
|
* ```ts
|
|
794
820
|
* declare const ctx: SageContext;
|
|
@@ -882,21 +908,26 @@ export async function planFinalizeClaimStakeBuildingChanges(ctx, stake, input) {
|
|
|
882
908
|
}
|
|
883
909
|
validateCurrencyCache(currencyAccount, game, currencyCache, 'finalization');
|
|
884
910
|
const description = `Finalize building changes on Claim Stake ${stake.address}.`;
|
|
911
|
+
const xp = await resolveClaimStakeXp(ctx, game, stake.address, character);
|
|
885
912
|
return createPlan({
|
|
886
913
|
kind: 'claim-stakes.finalize-building-changes',
|
|
887
|
-
preconditions:
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
914
|
+
preconditions: [
|
|
915
|
+
xp.guard,
|
|
916
|
+
...(await Promise.all([
|
|
917
|
+
precondition(freshGame.account, 'The configured Game remains current.'),
|
|
918
|
+
precondition(stakeAccount, `Claim Stake ${stake.address} retains its ownership, design sequence, rent balance, Body, and System generation.`),
|
|
919
|
+
precondition(characterAccount, `The canonical Character remains assigned to Profile ${options.authorization.profile} in the configured Game.`),
|
|
920
|
+
precondition(bodyAccount, `The Claim Stake Planet remains assigned to System ${system} at the current generation.`),
|
|
921
|
+
precondition(systemAccount, `Star System ${currentSystem.name} retains its configured Game, sequence, and nested Starbase.`),
|
|
922
|
+
precondition(playerAccount, `Starbase Player ${player} retains its Profile, Character, and System.`),
|
|
923
|
+
precondition(currencyAccount, 'The canonical CurrencyCache remains assigned to the configured Game.'),
|
|
924
|
+
])),
|
|
925
|
+
],
|
|
896
926
|
steps: [
|
|
897
927
|
{
|
|
898
928
|
describes: description,
|
|
899
929
|
instruction: adaptFinalizeClaimStakeBuildingChangesInstruction({
|
|
930
|
+
...xp.accounts,
|
|
900
931
|
authorization: options.authorization,
|
|
901
932
|
celestialBody: stake.body.address,
|
|
902
933
|
character,
|
|
@@ -920,6 +951,9 @@ export async function planFinalizeClaimStakeBuildingChanges(ctx, stake, input) {
|
|
|
920
951
|
* state; rent arithmetic and concurrent state transitions remain
|
|
921
952
|
* chain-authoritative.
|
|
922
953
|
*
|
|
954
|
+
* Requires Game 2 and its existing canonical Claim Stake XP ledger.
|
|
955
|
+
* Missing XP state must be repaired outside this Plan; no accounts are created.
|
|
956
|
+
*
|
|
923
957
|
* @example
|
|
924
958
|
* ```ts
|
|
925
959
|
* declare const ctx: SageContext;
|
|
@@ -995,19 +1029,24 @@ export async function planCancelClaimStakeBuildingChanges(ctx, stake, input) {
|
|
|
995
1029
|
}
|
|
996
1030
|
validateCurrencyCache(currencyAccount, game, currencyCache, 'cancellation');
|
|
997
1031
|
const description = `Cancel the pending building design on Claim Stake ${stake.address} and return it to active state.`;
|
|
1032
|
+
const xp = await resolveClaimStakeXp(ctx, game, stake.address);
|
|
998
1033
|
return createPlan({
|
|
999
1034
|
kind: 'claim-stakes.cancel-building-changes',
|
|
1000
|
-
preconditions:
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1035
|
+
preconditions: [
|
|
1036
|
+
xp.guard,
|
|
1037
|
+
...(await Promise.all([
|
|
1038
|
+
precondition(stakeAccount, `Claim Stake ${stake.address} retains its ownership, design sequence, buildings, Body, and System generation.`),
|
|
1039
|
+
precondition(bodyAccount, `The Claim Stake Planet remains assigned to System ${system} at the current generation.`),
|
|
1040
|
+
precondition(systemAccount, `Star System ${currentSystem.name} retains its configured Game, sequence, and nested Starbase.`),
|
|
1041
|
+
precondition(playerAccount, `Starbase Player ${player} retains its Profile, Character, and System.`),
|
|
1042
|
+
precondition(currencyAccount, 'The canonical CurrencyCache remains assigned to the configured Game.'),
|
|
1043
|
+
])),
|
|
1044
|
+
],
|
|
1007
1045
|
steps: [
|
|
1008
1046
|
{
|
|
1009
1047
|
describes: description,
|
|
1010
1048
|
instruction: adaptCancelClaimStakeBuildingChangesInstruction({
|
|
1049
|
+
...xp.accounts,
|
|
1011
1050
|
authorization: options.authorization,
|
|
1012
1051
|
celestialBody: stake.body.address,
|
|
1013
1052
|
claimStakeInstance: stake.address,
|
|
@@ -1357,6 +1396,9 @@ function describeCargoRequests(direction, requests) {
|
|
|
1357
1396
|
* FleetCrewBinding. The chain remains authoritative for range, duration,
|
|
1358
1397
|
* permission bits, concurrent state changes, and transfer arithmetic.
|
|
1359
1398
|
*
|
|
1399
|
+
* Requires Game 2 and its existing canonical Claim Stake XP ledger.
|
|
1400
|
+
* Missing XP state must be repaired outside this Plan; no accounts are created.
|
|
1401
|
+
*
|
|
1360
1402
|
* @example
|
|
1361
1403
|
* ```ts
|
|
1362
1404
|
* declare const ctx: SageContext;
|
|
@@ -1519,26 +1561,31 @@ export async function planStartClaimStakeFleetTransfer(ctx, fleet, stake, input)
|
|
|
1519
1561
|
...describeCargoRequests('unload', options.unload),
|
|
1520
1562
|
];
|
|
1521
1563
|
const description = `Start fleet ${fleet.name}'s transfer to Claim Stake ${stake.address}: ${descriptions.join('; ')}. Range and transfer duration remain chain-authoritative.`;
|
|
1564
|
+
const xp = await resolveClaimStakeXp(ctx, game, stake.address);
|
|
1522
1565
|
return createPlan({
|
|
1523
1566
|
kind: 'claim-stakes.start-fleet-transfer',
|
|
1524
|
-
preconditions:
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1567
|
+
preconditions: [
|
|
1568
|
+
xp.guard,
|
|
1569
|
+
...(await Promise.all([
|
|
1570
|
+
precondition(fleetAccount, `Fleet ${fleet.name} retains its owner, name, idle state, normalized crew, cargo balances, and destination capacities.`),
|
|
1571
|
+
precondition(stakeAccount, `Claim Stake ${stake.address} retains its owner, active state, cargo balances, destination capacity, Body, and System generation.`),
|
|
1572
|
+
precondition(bodyAccount, `The Claim Stake Planet remains assigned to System ${system} at the current generation.`),
|
|
1573
|
+
precondition(characterAccount, `The canonical Character remains assigned to Profile ${options.authorization.profile} in the configured Game.`),
|
|
1574
|
+
precondition(systemAccount, `Star System ${currentSystem.name} retains its configured Game, sequence, nested Starbase, and Claim Stake Body relationship.`),
|
|
1575
|
+
precondition(playerAccount, `Starbase Player ${player} retains its Profile, Character, and System.`),
|
|
1576
|
+
precondition(currencyAccount, 'The canonical CurrencyCache remains assigned to the configured Game.'),
|
|
1577
|
+
...(crewCandidate === undefined
|
|
1578
|
+
? []
|
|
1579
|
+
: [
|
|
1580
|
+
precondition(crewCandidate, `Fleet ${fleet.name}'s optional FleetCrewBinding remains assigned to the Fleet and owner Profile.`),
|
|
1581
|
+
]),
|
|
1582
|
+
])),
|
|
1583
|
+
],
|
|
1538
1584
|
steps: [
|
|
1539
1585
|
{
|
|
1540
1586
|
describes: description,
|
|
1541
1587
|
instruction: adaptStartClaimStakeFleetTransferInstruction({
|
|
1588
|
+
...xp.accounts,
|
|
1542
1589
|
authorization: options.authorization,
|
|
1543
1590
|
celestialBody: stake.body.address,
|
|
1544
1591
|
character,
|