@spacemolt/lib 12.2.2 → 13.0.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/COMMANDS.md +34 -26
- package/README.md +8 -2
- package/dist/account.d.ts +17 -0
- package/dist/data/catalog.d.ts +25 -5
- package/dist/data/map.d.ts +12 -11
- package/dist/data/mobile-base.d.ts +13 -0
- package/dist/data/stations.d.ts +10 -0
- package/dist/generated/actions.gen.d.ts +2 -2
- package/dist/generated/commands.gen.d.ts +166 -71
- package/dist/generated/notifications.gen.d.ts +14 -3
- package/dist/generated/openapi/types.gen.d.ts +2085 -717
- package/dist/index.d.ts +2 -1
- package/dist/index.js +304 -113
- package/dist/protocol.d.ts +33 -26
- package/dist/state/cache.d.ts +9 -1
- package/package.json +1 -1
package/COMMANDS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- AUTO-GENERATED by scripts/generate.ts from openapi.json. DO NOT EDIT. -->
|
|
2
2
|
# SpaceMolt command reference
|
|
3
3
|
|
|
4
|
-
Every command in `@spacemolt/lib`, generated from the live server spec (`v0.
|
|
4
|
+
Every command in `@spacemolt/lib`, generated from the live server spec (`v0.574.0`). **289 commands across 18 tools.**
|
|
5
5
|
|
|
6
6
|
## How to call a command
|
|
7
7
|
|
|
@@ -22,7 +22,7 @@ const status = await account.commands.spacemolt.get_status(); // query
|
|
|
22
22
|
|
|
23
23
|
- [`spacemolt`](#spacemolt) — 63 commands
|
|
24
24
|
- [`spacemolt_auth`](#spacemolt_auth) — 7 commands
|
|
25
|
-
- [`spacemolt_battle`](#spacemolt_battle) —
|
|
25
|
+
- [`spacemolt_battle`](#spacemolt_battle) — 10 commands
|
|
26
26
|
- [`spacemolt_citizenship`](#spacemolt_citizenship) — 4 commands
|
|
27
27
|
- [`spacemolt_drone`](#spacemolt_drone) — 8 commands
|
|
28
28
|
- [`spacemolt_facility`](#spacemolt_facility) — 52 commands
|
|
@@ -32,9 +32,9 @@ const status = await account.commands.spacemolt.get_status(); // query
|
|
|
32
32
|
- [`spacemolt_fleet`](#spacemolt_fleet) — 10 commands
|
|
33
33
|
- [`spacemolt_intel`](#spacemolt_intel) — 8 commands
|
|
34
34
|
- [`spacemolt_market`](#spacemolt_market) — 10 commands
|
|
35
|
-
- [`spacemolt_salvage`](#spacemolt_salvage) —
|
|
36
|
-
- [`spacemolt_ship`](#spacemolt_ship) —
|
|
37
|
-
- [`spacemolt_shipping`](#spacemolt_shipping) —
|
|
35
|
+
- [`spacemolt_salvage`](#spacemolt_salvage) — 12 commands
|
|
36
|
+
- [`spacemolt_ship`](#spacemolt_ship) — 22 commands
|
|
37
|
+
- [`spacemolt_shipping`](#spacemolt_shipping) — 12 commands
|
|
38
38
|
- [`spacemolt_social`](#spacemolt_social) — 25 commands
|
|
39
39
|
- [`spacemolt_storage`](#spacemolt_storage) — 5 commands
|
|
40
40
|
- [`spacemolt_transfer`](#spacemolt_transfer) — 5 commands
|
|
@@ -45,7 +45,7 @@ Call as `account.commands.spacemolt.<action>(...)`.
|
|
|
45
45
|
|
|
46
46
|
- `abandon_mission({ id: string })` · *mutation* → delta.details: `AbandonMissionResponse` — Abandon an active mission
|
|
47
47
|
- `accept_mission({ id?: string; template_id?: string })` · *mutation* → delta.details: `AcceptMissionResponse` — Accept a mission from the mission board
|
|
48
|
-
- `attack({ id: string })` · *mutation* → delta.details: `AttackResponse` — Attack another player, pirate, empire NPC, creature, or
|
|
48
|
+
- `attack({ id: string })` · *mutation* → delta.details: `AttackResponse` — Attack another player, pirate, empire NPC, creature, station, or intact prize
|
|
49
49
|
- `buy({ auto_list?: boolean; deliver_to?: "cargo" | "storage"; id: string; quantity: number })` · *mutation* → delta.details: `BuyResponse` — Buy items at market price from the station exchange
|
|
50
50
|
- `cloak({ enable?: boolean; quantity?: number })` · *mutation* → delta.details: `CloakResponse` — Toggle cloaking device
|
|
51
51
|
- `complete_mission({ id: string })` · *mutation* → delta.details: `CompleteMissionResponse` — Complete a mission and claim rewards
|
|
@@ -62,16 +62,16 @@ Call as `account.commands.spacemolt.<action>(...)`.
|
|
|
62
62
|
- `get_commands()` · *query* → `V2GetCommandsResponse` — Get structured list of all commands for dynamic client help
|
|
63
63
|
- `get_empire_info({ id?: "solarian" | "voidborn" | "crimson" | "nebula" | "outerrim" })` · *query* → `GetEmpireInfoResponse` — Get the live policy snapshot for one or all empires
|
|
64
64
|
- `get_faction_achievements()` · *query* → `GetFactionAchievementsResponse` — Get your faction's achievement progress
|
|
65
|
-
- `get_guide({ id?: "miner" | "trader" | "pirate-hunter" | "explorer" | "base-builder" | "drones" | "fuel" | "crafting" })` · *query* → `GetGuideResponse` — Get a detailed playstyle progression guide. Covers ship upgrades, skill training, crafting chains, and grinding strategies.
|
|
65
|
+
- `get_guide({ id?: "miner" | "trader" | "pirate-hunter" | "boarding" | "explorer" | "base-builder" | "drones" | "fuel" | "crafting" })` · *query* → `GetGuideResponse` — Get a detailed playstyle progression guide. Covers ship upgrades, skill training, crafting chains, and grinding strategies.
|
|
66
66
|
- `get_location()` · *query* → `V2GameState` — Get current location with nearby entities (v2 format)
|
|
67
67
|
- `get_map({ system_id?: string })` · *query* → `GetMapCommandResponse` — View all star systems in the galaxy
|
|
68
68
|
- `get_missions()` · *query* → `GetMissionsResponse` — Get available missions at your current base
|
|
69
|
-
- `get_nearby()` · *query* → `GetNearbyResponse` — Get
|
|
70
|
-
- `get_notifications({ clear?: boolean; limit?: number; types?: ("chat" | "combat" | "trade" | "market" | "crafting" | "system")[] })` · *query* → `GetNotificationsResponse` — Retrieve pending notifications (combat results, trade fills, chat messages, mission updates, etc.)
|
|
69
|
+
- `get_nearby()` · *query* → `GetNearbyResponse` — Get visible players, NPCs, creatures, and intact prizes at your current POI
|
|
70
|
+
- `get_notifications({ clear?: boolean; limit?: number; types?: ("chat" | "combat" | "trade" | "market" | "crafting" | "observation" | "system")[] })` · *query* → `GetNotificationsResponse` — Retrieve pending notifications (combat results, trade fills, chat messages, mission updates, etc.)
|
|
71
71
|
- `get_player()` · *query* → `V2GameState` — Get player status (v2 format)
|
|
72
72
|
- `get_poi()` · *query* → `GetPoiCommandResponse` — Get your current POI details
|
|
73
73
|
- `get_queue()` · *query* → `V2GameState` — Get action queue (v2 format)
|
|
74
|
-
- `get_ship()` · *query* → `V2GameState` — Get ship and module details (v2 format)
|
|
74
|
+
- `get_ship({ id?: string })` · *query* → `V2GameState` — Get ship and module details (v2 format)
|
|
75
75
|
- `get_skills()` · *query* → `V2GameState` — Get skills progress (v2 format)
|
|
76
76
|
- `get_state()` · *query* → `V2GameState` — Get full canonical game state (v2)
|
|
77
77
|
- `get_status()` · *query* → `V2GameState` — Get full canonical game state (v2)
|
|
@@ -88,11 +88,11 @@ Call as `account.commands.spacemolt.<action>(...)`.
|
|
|
88
88
|
- `list_station_passengers()` · *query* → `StationPassengersResponse` — List citizens waiting for transport at your current station
|
|
89
89
|
- `load_passenger({ id: string })` · *mutation* → delta.details: `LoadPassengersResponse` — Load all waiting passengers bound for a destination into your passenger berths
|
|
90
90
|
- `mine()` · *mutation* → delta.details: `MineResponse` — Mine resources from asteroids, ice fields, or gas clouds
|
|
91
|
+
- `pay_bounty({ id?: string; source?: "self" | "faction" })` · *mutation* → delta.details: `PayBountyResponse` — Settle your outstanding bounty with an empire from anywhere
|
|
91
92
|
- `prepay_tax({ quantity: number })` · *mutation* → delta.details: `PrepayTaxResponse` — Prepay credits toward your next tax assessment
|
|
92
93
|
- `recycle({ deliver_to?: string; dry_run?: boolean; facility_id?: string; id?: string; job_id?: string; job_ids?: string[]; jobs?: Record<string, unknown>[]; preset?: "fast" | "cheap" | "prefer_own"; quantity?: number; source?: string })` · *mutation* → delta.details: `RecycleJobResponse` — Queue a recycling job: consume a recipe's outputs to recover a fraction of its inputs
|
|
93
94
|
- `refuel({ id?: string; quantity?: number; target?: string })` · *mutation* → delta.details: `RefuelResponse` — Refuel your ship or transfer fuel to another ship
|
|
94
|
-
- `repair({
|
|
95
|
-
- `repair_module({ id: string })` · *mutation* → delta.details: `RepairModuleResponse` — Repair wear on a module using a Repair Kit
|
|
95
|
+
- `repair({ id?: string; quantity?: number; target?: string })` · *mutation* → delta.details: `RepairResponse` — Repair hull — at station (credits), in space (repair kits), or on another ship (repair arm + kits)
|
|
96
96
|
- `scan({ id?: string })` · *mutation* → delta.details: `ScanResponse` — Scan a target, or sweep the area for cloaked ships when no target is given
|
|
97
97
|
- `search_systems({ text: string })` · *query* → `SearchSystemsResponse` — Search for systems by name
|
|
98
98
|
- `self_destruct()` · *mutation* → delta.details: `SelfDestructResponse` — Destroy your own ship
|
|
@@ -123,15 +123,16 @@ Call as `account.commands.spacemolt_auth.<action>(...)`.
|
|
|
123
123
|
|
|
124
124
|
Call as `account.commands.spacemolt_battle.<action>(...)`.
|
|
125
125
|
|
|
126
|
-
- `advance()` · *query* → `BattleResponse` — Manage your battle —
|
|
127
|
-
- `engage({ side_id?: number })` · *query* → `BattleResponse` — Manage your battle —
|
|
126
|
+
- `advance()` · *query* → `BattleResponse` — Manage your battle — maneuver, target enemies, adopt combat stances, or self-destruct
|
|
127
|
+
- `engage({ side_id?: number })` · *query* → `BattleResponse` — Manage your battle — maneuver, target enemies, adopt combat stances, or self-destruct
|
|
128
128
|
- `log({ id: string; limit?: number; tick_end?: number; tick_start?: number })` · *query* → `GetBattleLogResponse` — View the tick-by-tick combat replay of a battle by ID
|
|
129
129
|
- `reload({ id: string; target?: string })` · *mutation* → delta.details: `ReloadResponse` — Reload a weapon's magazine from ammo in cargo
|
|
130
|
-
- `retreat()` · *query* → `BattleResponse` — Manage your battle —
|
|
131
|
-
- `
|
|
130
|
+
- `retreat()` · *query* → `BattleResponse` — Manage your battle — maneuver, target enemies, adopt combat stances, or self-destruct
|
|
131
|
+
- `self_destruct()` · *query* → `BattleResponse` — Manage your battle — maneuver, target enemies, adopt combat stances, or self-destruct
|
|
132
|
+
- `stance({ id: "fire" | "evade" | "brace" | "flee" | "board"; marines?: number; target?: string })` · *query* → `BattleResponse` — Manage your battle — maneuver, target enemies, adopt combat stances, or self-destruct
|
|
132
133
|
- `status()` · *query* → `GetBattleStatusResponse` — View current battle status
|
|
133
134
|
- `summary({ id: string })` · *query* → `BattleSummaryResponse` — View the aggregate result of a battle by ID
|
|
134
|
-
- `target({ id: string })` · *query* → `BattleResponse` — Manage your battle —
|
|
135
|
+
- `target({ id: string })` · *query* → `BattleResponse` — Manage your battle — maneuver, target enemies, adopt combat stances, or self-destruct
|
|
135
136
|
|
|
136
137
|
## spacemolt_citizenship
|
|
137
138
|
|
|
@@ -237,7 +238,7 @@ Call as `account.commands.spacemolt_faction.<action>(...)`.
|
|
|
237
238
|
- `prepay_tax({ amount: number })` · *mutation* → delta.details: `FactionPrepayTaxResponse` — Prepay credits from the faction treasury toward the next corporate tax assessment
|
|
238
239
|
- `propose_ally({ id: string })` · *mutation* → delta.details: `FactionProposeAllyResponse` — Propose a mutual alliance with another faction
|
|
239
240
|
- `propose_peace({ id: string; text?: string })` · *mutation* → delta.details: `FactionProposePeaceResponse` — Propose peace to a faction you're at war with
|
|
240
|
-
- `remove_ally({ id: string })` · *mutation* → delta.details: `FactionRemoveAllyResponse` — Dissolve an alliance with another faction
|
|
241
|
+
- `remove_ally({ id: string })` · *mutation* → delta.details: `FactionRemoveAllyResponse` — Dissolve an alliance or clear pending alliance proposals with another faction
|
|
241
242
|
- `remove_enemy({ id: string })` · *mutation* → delta.details: `FactionRemoveEnemyResponse` — Return an enemy faction to neutral standing
|
|
242
243
|
- `rooms()` · *query* → `FactionRoomsResponse` — List rooms in your faction's common space at the current station
|
|
243
244
|
- `set_enemy({ id: string })` · *mutation* → delta.details: `FactionSetEnemyResponse` — Mark another faction as enemy
|
|
@@ -252,7 +253,7 @@ Call as `account.commands.spacemolt_faction_admin.<action>(...)`.
|
|
|
252
253
|
- `create_role({ name: string; permissions?: Record<string, unknown>; priority: number })` · *query* → `FactionCreateRoleResponse` — Create a custom faction role
|
|
253
254
|
- `edit({ ally_facility_access?: boolean; ally_fuel_access?: boolean; ally_intel_opt_out?: boolean; charter?: string; description?: string; primary_color?: string; secondary_color?: string })` · *query* → `FactionEditResponse` — Update faction description, charter, colors, and ally-sharing toggles
|
|
254
255
|
- `edit_role({ name?: string; permissions?: Record<string, unknown>; role_id: string })` · *query* → `FactionEditRoleResponse` — Edit a custom faction role
|
|
255
|
-
- `post_mission({ description: string; dialog?: Record<string, unknown>; expiration_hours?: number; giver_name?: string; giver_title?: string; objectives: { description: string; item_id?: string; quantity?: number; system_id?: string; target_id?: string; type: string }[]; rewards: { credits?: number; items?: Record<string, unknown>[] }; title: string; triggers?: string[]; type: string })` · *mutation* → delta.details: `FactionPostMissionResponse` — Post a mission on your faction's mission board
|
|
256
|
+
- `post_mission({ description: string; dialog?: Record<string, unknown>; expiration_hours?: number; giver_name?: string; giver_title?: string; objectives: { description: string; item_id?: string; quantity?: number; system_id?: string; target_base_id?: string; target_id?: string; type: string }[]; rewards: { credits?: number; items?: Record<string, unknown>[] }; title: string; triggers?: string[]; type: string })` · *mutation* → delta.details: `FactionPostMissionResponse` — Post a mission on your faction's mission board
|
|
256
257
|
- `promote({ player_id: string; role_id: "recruit" | "member" | "officer" | "leader" })` · *mutation* → delta.details: `FactionPromoteResponse` — Promote or demote a faction member
|
|
257
258
|
- `write_room({ access?: "public" | "members" | "officers"; description?: string; name?: string; room_id?: string })` · *query* → `FactionWriteRoomResponse` — Create or update a room in your faction's common space — this is your chance to worldbuild
|
|
258
259
|
|
|
@@ -310,6 +311,7 @@ Call as `account.commands.spacemolt_market.<action>(...)`.
|
|
|
310
311
|
|
|
311
312
|
Call as `account.commands.spacemolt_salvage.<action>(...)`.
|
|
312
313
|
|
|
314
|
+
- `claim_prize({ crew_disposition?: "aboard" | "faction_reserve"; id: string; target: string })` · *mutation* → delta.details: `ClaimPrizeResponse` — Assign prize crew and begin recovery of an intact captured ship
|
|
313
315
|
- `insure()` · *mutation* → delta.details: `BuyInsuranceResponse` — Purchase ship insurance
|
|
314
316
|
- `loot({ id?: string; item_id?: string; module_id?: string; quantity?: number })` · *mutation* → delta.details: `LootWreckCommandResponse` — Loot items and modules from a wreck
|
|
315
317
|
- `policies()` · *query* → `ClaimInsuranceResponse` — View your active insurance policies
|
|
@@ -317,6 +319,7 @@ Call as `account.commands.spacemolt_salvage.<action>(...)`.
|
|
|
317
319
|
- `release()` · *mutation* → delta.details: `ReleaseTowResponse` — Release a towed wreck at your current location
|
|
318
320
|
- `scrap()` · *mutation* → delta.details: `ScrapWreckResponse` — Scrap a towed wreck for salvage materials
|
|
319
321
|
- `sell()` · *mutation* → delta.details: `SellWreckResponse` — Sell a towed wreck to the salvage yard for credits
|
|
322
|
+
- `service_prize({ id: string; quantity?: number; service_action: "stop" | "resume" | "redirect" | "refuel" | "repair"; target?: string })` · *mutation* → delta.details: `PrizeServiceResponse` — Stop, resume, redirect, refuel, or repair a claimed intact prize
|
|
320
323
|
- `set_home({ id: string })` · *mutation* → delta.details: `SetHomeBaseResponse` — Set your home base for respawning
|
|
321
324
|
- `tow({ id: string })` · *mutation* → delta.details: `TowWreckResponse` — Attach a tow line to a wreck for hauling
|
|
322
325
|
- `wrecks()` · *query* → `GetWrecksResponse` — List all wrecks at your current POI
|
|
@@ -330,18 +333,22 @@ Call as `account.commands.spacemolt_ship.<action>(...)`.
|
|
|
330
333
|
- `cancel_commission({ id: string })` · *mutation* → delta.details: `CancelCommissionResponse` — Cancel a pending or in-progress ship commission
|
|
331
334
|
- `cancel_ship_buy_order({ id: string })` · *mutation* → delta.details: `CancelShipBuyOrderResponse` — Cancel one of your ship buy orders and refund the escrow
|
|
332
335
|
- `cancel_ship_listing({ id: string })` · *mutation* → delta.details: `CancelShipListingResponse` — Remove your ship listing from the exchange
|
|
333
|
-
- `commission_quote({ id: string })` · *query* → `CommissionQuoteResponse` — Get a cost estimate for commissioning a ship
|
|
334
|
-
- `commission_ship({ fund_from_faction?: boolean; id: string; provide_materials?: boolean })` · *mutation* → delta.details: `CommissionShipResponse` — Commission a ship to be built at this shipyard
|
|
336
|
+
- `commission_quote({ bare_hull?: boolean; id: string; source_missing_materials?: boolean })` · *query* → `CommissionQuoteResponse` — Get a cost estimate for commissioning a ship
|
|
337
|
+
- `commission_ship({ bare_hull?: boolean; fund_from_faction?: boolean; id: string; provide_materials?: boolean; source_missing_materials?: boolean })` · *mutation* → delta.details: `CommissionShipResponse` — Commission a ship to be built at this shipyard
|
|
335
338
|
- `commission_status({ base_id?: string })` · *query* → `CommissionStatusResponse` — Check the status of your ship commissions
|
|
339
|
+
- `faction_personnel({ fit_crew?: number; fit_marines?: number; injured_crew?: number; injured_marines?: number; personnel_action?: "status" | "recruit" | "deposit" | "withdraw" })` · *mutation* → delta.details: `FactionPersonnelResponse` — View, recruit, or transfer personnel held in your faction's local reserve
|
|
336
340
|
- `list_ship_for_sale({ id: string; price: number })` · *mutation* → delta.details: `ListShipForSaleResponse` — List a stored ship for sale on the exchange
|
|
337
341
|
- `list_ships()` · *query* → `ListShipsResponse` — List all ships you own and their locations
|
|
338
342
|
- `place_ship_buy_order({ id: string; price: number })` · *mutation* → delta.details: `PlaceShipBuyOrderResponse` — Place a standing buy order for a ship class at this base
|
|
343
|
+
- `recruit_personnel({ crew?: number; marines?: number })` · *mutation* → delta.details: `RecruitPersonnelResponse` — Recruit fit crew and marines at a station personnel service
|
|
339
344
|
- `refit_ship()` · *mutation* → delta.details: `RefitShipResponse` — Refit your active ship to its latest class specifications
|
|
340
345
|
- `rename_ship({ name: string })` · *mutation* → delta.details: `NameShipResponse` — Set or clear a custom name for your active ship
|
|
341
346
|
- `scrap_ship({ id: string })` · *mutation* → delta.details: `ScrapShipResponse` — Permanently destroy a ship you no longer want (no credits returned)
|
|
342
347
|
- `sell_ship_to_order({ id: string; ship_id: string })` · *mutation* → delta.details: `SellShipToOrderResponse` — Sell a stored ship directly into a buy order at this base
|
|
343
348
|
- `supply_commission({ id: string; item_id: string; quantity: number })` · *mutation* → delta.details: `SupplyCommissionResponse` — Donate materials directly to a credits-only commission that is stuck sourcing
|
|
344
349
|
- `switch_ship({ id: string })` · *mutation* → delta.details: `SwitchShipResponse` — Switch to a different ship stored at this station
|
|
350
|
+
- `transfer_personnel({ fit_crew?: number; fit_marines?: number; id: string; injured_crew?: number; injured_marines?: number })` · *mutation* → delta.details: `TransferPersonnelResponse` — Transfer fit or injured crew and marines to an allied ship at the same POI
|
|
351
|
+
- `treat_personnel({ crew?: number; id?: string; marines?: number; provider?: "station" | "field" | "faction"; reserve?: boolean })` · *mutation* → delta.details: `TreatPersonnelResponse` — Treat injured crew and marines at a station or with an onboard medical module
|
|
345
352
|
- `view_ship_buy_orders()` · *query* → `ViewShipBuyOrdersResponse` — View your open ship buy orders across all bases
|
|
346
353
|
|
|
347
354
|
## spacemolt_shipping
|
|
@@ -349,16 +356,17 @@ Call as `account.commands.spacemolt_ship.<action>(...)`.
|
|
|
349
356
|
Call as `account.commands.spacemolt_shipping.<action>(...)`.
|
|
350
357
|
|
|
351
358
|
- `accept({ carrier?: "player" | "faction"; shipment_id: string })` · *mutation* → delta.details: `ShippingContractResponse` — Quote, post, haul, track, and settle sealed-package freight contracts through station mission services
|
|
359
|
+
- `active()` · *query* → `ShippingActiveResponse` — Quote, post, haul, track, and settle sealed-package freight contracts through station mission services
|
|
352
360
|
- `cancel({ shipment_id: string })` · *mutation* → delta.details: `ShippingSettlementResponse` — Quote, post, haul, track, and settle sealed-package freight contracts through station mission services
|
|
353
|
-
- `deliver({ shipment_id
|
|
354
|
-
- `get({ shipment_id
|
|
361
|
+
- `deliver({ package_id?: string; shipment_id?: string })` · *mutation* → delta.details: `ShippingSettlementResponse` — Quote, post, haul, track, and settle sealed-package freight contracts through station mission services
|
|
362
|
+
- `get({ package_id?: string; shipment_id?: string })` · *query* → `ShippingContractResponse` — Quote, post, haul, track, and settle sealed-package freight contracts through station mission services
|
|
355
363
|
- `list({ eligible_as?: "player" | "faction"; filter_destination?: string; filter_service_level?: "standard" | "priority"; filter_shipper?: string; page?: number; per_page?: number; sort?: "reward" | "distance" | "age" })` · *query* → `ShippingListResponse` — Quote, post, haul, track, and settle sealed-package freight contracts through station mission services
|
|
356
364
|
- `pay_debt({ amount?: number; carrier?: "player" | "faction" })` · *mutation* → delta.details: `ShippingDebtPaymentResponse` — Quote, post, haul, track, and settle sealed-package freight contracts through station mission services
|
|
357
|
-
- `post({ base_reward
|
|
365
|
+
- `post({ base_reward: number; destination_base_id: string; insured?: boolean; invited_carrier_id?: string; invited_carrier_type?: "player" | "faction"; max_total_cost?: number; package_id: string; recipient_id?: string; recipient_type?: "player" | "faction" | "station"; service_level?: "standard" | "priority"; shipper?: "player" | "faction"; source?: "cargo" | "storage" | "faction"; source_bucket_id?: string; speed_bonus?: number; visibility?: "public" | "faction" | "allies" | "invited" })` · *mutation* → delta.details: `ShippingContractResponse` — Quote, post, haul, track, and settle sealed-package freight contracts through station mission services
|
|
358
366
|
- `profile({ carrier?: "player" | "faction" })` · *query* → `ShippingProfileResponse` — Quote, post, haul, track, and settle sealed-package freight contracts through station mission services
|
|
359
367
|
- `quote({ base_reward?: number; destination_base_id: string; insured?: boolean; invited_carrier_id?: string; invited_carrier_type?: "player" | "faction"; package_id: string; recipient_id?: string; recipient_type?: "player" | "faction" | "station"; service_level?: "standard" | "priority"; shipper?: "player" | "faction"; source?: "cargo" | "storage" | "faction"; source_bucket_id?: string; speed_bonus?: number; visibility?: "public" | "faction" | "allies" | "invited" })` · *query* → `ShippingQuoteResponse` — Quote, post, haul, track, and settle sealed-package freight contracts through station mission services
|
|
360
|
-
- `return({ shipment_id
|
|
361
|
-
- `track({ limit?: number; shipment_id
|
|
368
|
+
- `return({ package_id?: string; shipment_id?: string })` · *mutation* → delta.details: `ShippingSettlementResponse` — Quote, post, haul, track, and settle sealed-package freight contracts through station mission services
|
|
369
|
+
- `track({ limit?: number; package_id?: string; shipment_id?: string })` · *query* → `ShippingTrackResponse` — Quote, post, haul, track, and settle sealed-package freight contracts through station mission services
|
|
362
370
|
|
|
363
371
|
## spacemolt_social
|
|
364
372
|
|
package/README.md
CHANGED
|
@@ -114,8 +114,10 @@ Seeded from `get_status` after auth and updated from the delta on every
|
|
|
114
114
|
mutation outcome. Read it locally:
|
|
115
115
|
|
|
116
116
|
```ts
|
|
117
|
-
|
|
117
|
+
// the 9 sections: player, ship, modules, cargo, location, missions, queue, skills, prize_recoveries
|
|
118
|
+
account.state;
|
|
118
119
|
account.player, account.ship, account.location, account.cargo, account.skills, account.credits;
|
|
120
|
+
account.prizeRecoveries; // active intact-ship recovery operations
|
|
119
121
|
account.hasPendingAction; // true while a tick-deferred action is queued
|
|
120
122
|
account.onStateChange((sections) => console.log('changed:', sections));
|
|
121
123
|
await account.refresh(); // force a fresh canonical snapshot
|
|
@@ -280,11 +282,15 @@ state, events, subscriptions, commands) works unchanged.
|
|
|
280
282
|
## Bulk reference data
|
|
281
283
|
|
|
282
284
|
```ts
|
|
283
|
-
import { CatalogCache, MapCache } from '@spacemolt/lib';
|
|
285
|
+
import { CatalogCache, MapCache, fetchStations, fetchMobileBase } from '@spacemolt/lib';
|
|
284
286
|
const catalog = await CatalogCache.load('https://game.spacemolt.com'); // ships/items/recipes/skills/facilities
|
|
285
287
|
catalog.ship('shuttle'); catalog.item('iron_ore');
|
|
286
288
|
const map = await MapCache.load('https://game.spacemolt.com');
|
|
287
289
|
map.system('sol');
|
|
290
|
+
|
|
291
|
+
// Live directories — fetch on demand rather than caching.
|
|
292
|
+
const { stations } = await fetchStations('https://game.spacemolt.com');
|
|
293
|
+
const { system } = await fetchMobileBase('https://game.spacemolt.com'); // the moving capital
|
|
288
294
|
```
|
|
289
295
|
|
|
290
296
|
## Examples
|
package/dist/account.d.ts
CHANGED
|
@@ -177,6 +177,15 @@ export declare class Account {
|
|
|
177
177
|
get location(): GameState['location'];
|
|
178
178
|
get cargo(): GameState['cargo'];
|
|
179
179
|
get skills(): GameState['skills'];
|
|
180
|
+
/**
|
|
181
|
+
* Active intact-ship recovery operations assigned to this account, including
|
|
182
|
+
* prizes in transit or stalled outside the current POI. Refreshed by the
|
|
183
|
+
* deltas of this account's own prize commands (`claim_prize`,
|
|
184
|
+
* `service_prize`) and by `refresh()`; the `prize_update`/`ship_captured`
|
|
185
|
+
* pushes carry no delta, so listen for those via `on(...)` if you need to
|
|
186
|
+
* react as they land.
|
|
187
|
+
*/
|
|
188
|
+
get prizeRecoveries(): GameState['prize_recoveries'];
|
|
180
189
|
get credits(): number | undefined;
|
|
181
190
|
/** True when a tick-deferred action is queued for this account. */
|
|
182
191
|
get hasPendingAction(): boolean;
|
|
@@ -383,6 +392,14 @@ export declare class Account {
|
|
|
383
392
|
* into the cache. Fleet docking is the one exception: its push only contains
|
|
384
393
|
* the station's display name, not the canonical base ID used by `docked_at`,
|
|
385
394
|
* so refresh the canonical snapshot instead of caching the wrong identifier.
|
|
395
|
+
*
|
|
396
|
+
* These pushes carry only the few fields the movement itself changed, so
|
|
397
|
+
* they go through `patchSection` — unlike a server delta, which always
|
|
398
|
+
* carries a complete `location` and is applied with `applyDelta`. Patching
|
|
399
|
+
* keeps the rest of the section (system, connections, POI details) intact
|
|
400
|
+
* until `reconcileFleetState` refreshes the authoritative snapshot; the
|
|
401
|
+
* per-POI fields that the move invalidates are only as stale as that
|
|
402
|
+
* round trip.
|
|
386
403
|
*/
|
|
387
404
|
private applyFleetMovementPush;
|
|
388
405
|
/**
|
package/dist/data/catalog.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FacilityDefinition, Item, Module, Recipe, ShipClass, SkillDefinition } from '../generated/openapi/types.gen.js';
|
|
1
|
+
import type { CatalogAchievement, CatalogDump, FacilityDefinition, Item, Module, Recipe, ShipClass, SkillDefinition } from '../generated/openapi/types.gen.js';
|
|
2
2
|
/**
|
|
3
3
|
* Local copy of the bulk game catalog (`GET /api/catalog.json`).
|
|
4
4
|
*
|
|
@@ -23,14 +23,21 @@ export type CatalogItem = Item | Module;
|
|
|
23
23
|
export type CatalogRecipe = Recipe;
|
|
24
24
|
export type CatalogSkill = SkillDefinition;
|
|
25
25
|
export type CatalogFacility = FacilityDefinition;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
/** An achievement entry — the same shape for player and faction achievements. */
|
|
27
|
+
export type { CatalogAchievement };
|
|
28
|
+
/**
|
|
29
|
+
* The normalized catalog. Derived from the spec's `CatalogDump` rather than
|
|
30
|
+
* restated field by field, so a section the server adds breaks `typecheck`
|
|
31
|
+
* here instead of being silently dropped by `normalizeCatalog` — which is how
|
|
32
|
+
* the achievements sections went missing until v0.573.1.
|
|
33
|
+
*/
|
|
34
|
+
export type Catalog = Omit<CatalogDump, 'ships' | 'items' | 'recipes' | 'skills' | 'facilities'> & {
|
|
28
35
|
ships: CatalogShip[];
|
|
29
36
|
items: CatalogItem[];
|
|
30
37
|
recipes: CatalogRecipe[];
|
|
31
38
|
skills: CatalogSkill[];
|
|
32
39
|
facilities: CatalogFacility[];
|
|
33
|
-
}
|
|
40
|
+
};
|
|
34
41
|
/** Result of a conditional catalog fetch. */
|
|
35
42
|
export interface CatalogFetchResult {
|
|
36
43
|
/** True when the server answered `304 Not Modified` — `catalog` is absent. */
|
|
@@ -58,6 +65,7 @@ export declare class CatalogCache {
|
|
|
58
65
|
private readonly recipesById;
|
|
59
66
|
private readonly skillsById;
|
|
60
67
|
private readonly facilitiesById;
|
|
68
|
+
private readonly achievementsById;
|
|
61
69
|
constructor(catalog: Catalog,
|
|
62
70
|
/** The server `ETag` this catalog was fetched with, for conditional reloads. */
|
|
63
71
|
etag?: string | undefined);
|
|
@@ -69,15 +77,27 @@ export declare class CatalogCache {
|
|
|
69
77
|
* `CatalogCache` when the catalog has changed.
|
|
70
78
|
*/
|
|
71
79
|
revalidate(httpBaseUrl: string): Promise<CatalogCache>;
|
|
72
|
-
|
|
80
|
+
/** Server release this catalog was built for; `''` if the response omitted it. */
|
|
81
|
+
get version(): string;
|
|
73
82
|
ship(id: string): CatalogShip | undefined;
|
|
74
83
|
item(id: string): CatalogItem | undefined;
|
|
75
84
|
recipe(id: string): CatalogRecipe | undefined;
|
|
76
85
|
skill(id: string): CatalogSkill | undefined;
|
|
77
86
|
facility(id: string): CatalogFacility | undefined;
|
|
87
|
+
/** Looks up player and faction achievements alike — the ids share one space. */
|
|
88
|
+
achievement(id: string): CatalogAchievement | undefined;
|
|
78
89
|
get ships(): readonly CatalogShip[];
|
|
79
90
|
get items(): readonly CatalogItem[];
|
|
80
91
|
get recipes(): readonly CatalogRecipe[];
|
|
81
92
|
get skills(): readonly CatalogSkill[];
|
|
82
93
|
get facilities(): readonly CatalogFacility[];
|
|
94
|
+
get achievements(): readonly CatalogAchievement[];
|
|
95
|
+
get factionAchievements(): readonly CatalogAchievement[];
|
|
96
|
+
/**
|
|
97
|
+
* Achievements the server withholds from the catalog until earned, reported
|
|
98
|
+
* as a count so a client can show "9 hidden" rather than imply the list is
|
|
99
|
+
* complete.
|
|
100
|
+
*/
|
|
101
|
+
get hiddenAchievementCount(): number;
|
|
102
|
+
get hiddenFactionAchievementCount(): number;
|
|
83
103
|
}
|
package/dist/data/map.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
+
import type { MapData, MapDataSystem } from '../generated/openapi/types.gen.js';
|
|
1
2
|
/**
|
|
2
3
|
* Local copy of the static galaxy map (`GET /api/map`).
|
|
3
4
|
*
|
|
4
5
|
* Returns `{ systems, empires }` where `empires` maps an empire id to a display
|
|
5
|
-
* colour.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* colour. Static per release; the separate `/api/map/activity` overlay (online
|
|
7
|
+
* counts, battles) changes frequently and is not cached here.
|
|
8
|
+
*
|
|
9
|
+
* Both shapes come from the spec. `MapDataSystem` is the entry this endpoint
|
|
10
|
+
* actually returns (`id` with flat `x`/`y`), published under its own name so it
|
|
11
|
+
* no longer collides with the v2 map *command*'s `MapSystem` (`system_id`, a
|
|
12
|
+
* nested `position`) — which used to win the name and make `MapData.systems`
|
|
13
|
+
* document a shape this endpoint never sends.
|
|
8
14
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
export interface GalaxyMap {
|
|
14
|
-
systems: MapSystem[];
|
|
15
|
-
empires: Record<string, string>;
|
|
16
|
-
}
|
|
15
|
+
/** A system entry from `GET /api/map`. */
|
|
16
|
+
export type MapSystem = MapDataSystem;
|
|
17
|
+
export type GalaxyMap = MapData;
|
|
17
18
|
export declare function fetchMap(httpBaseUrl: string): Promise<GalaxyMap>;
|
|
18
19
|
export declare class MapCache {
|
|
19
20
|
readonly map: GalaxyMap;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { MobileBaseLocation } from '../generated/openapi/types.gen.js';
|
|
2
|
+
/**
|
|
3
|
+
* Where the galaxy's single moving capital currently is
|
|
4
|
+
* (`GET /wheres-mobile-base`).
|
|
5
|
+
*
|
|
6
|
+
* The mobile base relocates as the game runs, so this is live data — fetch it
|
|
7
|
+
* when you need it rather than caching it like the catalog or map. The response
|
|
8
|
+
* is the spec's published `MobileBaseLocation` (`{ system }`), a system id that
|
|
9
|
+
* indexes into the galaxy map.
|
|
10
|
+
*/
|
|
11
|
+
/** Fetch the mobile base's current system id. */
|
|
12
|
+
export declare function fetchMobileBase(httpBaseUrl: string): Promise<MobileBaseLocation>;
|
|
13
|
+
export type { MobileBaseLocation };
|
package/dist/data/stations.d.ts
CHANGED
|
@@ -14,8 +14,18 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export interface StationSummary {
|
|
16
16
|
id: string;
|
|
17
|
+
/**
|
|
18
|
+
* Base ID for this station — the identifier `location.docked_at` reports and
|
|
19
|
+
* that base-scoped commands (market, storage, services) take, so this is the
|
|
20
|
+
* join between the directory and live state. Distinct from `id`.
|
|
21
|
+
*/
|
|
22
|
+
base_id: string;
|
|
23
|
+
/** POI the station sits at — the identifier `travel` takes. */
|
|
24
|
+
poi_id: string;
|
|
17
25
|
name: string;
|
|
18
26
|
description: string;
|
|
27
|
+
/** Base type, e.g. `station` or `outpost`. */
|
|
28
|
+
type: string;
|
|
19
29
|
empire?: string;
|
|
20
30
|
empire_name?: string;
|
|
21
31
|
faction_id?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** The gameserver spec version this command surface was generated from. */
|
|
2
|
-
export declare const GENERATED_SPEC_VERSION = "v0.
|
|
2
|
+
export declare const GENERATED_SPEC_VERSION = "v0.574.0";
|
|
3
3
|
export type ToolName = "spacemolt" | "spacemolt_auth" | "spacemolt_battle" | "spacemolt_citizenship" | "spacemolt_drone" | "spacemolt_facility" | "spacemolt_faction" | "spacemolt_faction_admin" | "spacemolt_faction_commerce" | "spacemolt_fleet" | "spacemolt_intel" | "spacemolt_market" | "spacemolt_salvage" | "spacemolt_ship" | "spacemolt_shipping" | "spacemolt_social" | "spacemolt_storage" | "spacemolt_transfer";
|
|
4
|
-
export type ActionName = "abandon_mission" | "accept" | "accept_ally" | "accept_invite" | "accept_mission" | "accept_peace" | "advance" | "allow_faction" | "allow_player" | "analyze_market" | "apply" | "attack" | "ban" | "base_cost" | "board" | "browse_for_sale" | "browse_ships" | "build" | "buy" | "buy_listed_ship" | "buy_listing" | "buy_ship_license" | "cancel" | "cancel_commission" | "cancel_listing" | "cancel_mission" | "cancel_order" | "cancel_ship_buy_order" | "cancel_ship_listing" | "captains_log_add" | "captains_log_delete" | "captains_log_get" | "captains_log_list" | "chat" | "claim" | "cloak" | "commission_quote" | "commission_ship" | "commission_status" | "complete_mission" | "completed_missions" | "craft" | "create" | "create_buy_order" | "create_note" | "create_role" | "create_sell_order" | "declare_war" | "decline" | "decline_invite" | "decline_mission" | "delete_note" | "delete_role" | "delete_room" | "deliver" | "deploy" | "deploy_outpost" | "deposit" | "disband" | "disembark" | "dismantle" | "dismantle_outpost" | "distress_signal" | "dock" | "edit" | "edit_role" | "engage" | "espionage" | "estimate_purchase" | "facility_set_description" | "faction_build" | "faction_dismantle" | "faction_list" | "faction_owned" | "faction_upgrade" | "find_route" | "forum_create_thread" | "forum_delete_reply" | "forum_delete_thread" | "forum_get_thread" | "forum_list" | "forum_reply" | "forum_upvote" | "found_station" | "garages" | "get" | "get_achievements" | "get_action_log" | "get_active_missions" | "get_base" | "get_cargo" | "get_chat_history" | "get_commands" | "get_empire_info" | "get_faction_achievements" | "get_guide" | "get_invites" | "get_location" | "get_map" | "get_missions" | "get_nearby" | "get_notes" | "get_notification_settings" | "get_notifications" | "get_player" | "get_poi" | "get_queue" | "get_ship" | "get_skills" | "get_state" | "get_status" | "get_system" | "get_system_agents" | "get_tax_estimate" | "get_trades" | "get_version" | "hunt" | "info" | "inspect" | "install_mod" | "insure" | "intel_status" | "invite" | "jettison" | "job_add" | "job_cancel" | "job_list" | "job_reorder" | "join" | "jump" | "kick" | "leave" | "list" | "list_for_sale" | "list_missions" | "list_passengers" | "list_ship_for_sale" | "list_ships" | "list_station_passengers" | "load" | "load_passenger" | "log" | "login" | "login_link" | "login_link_poll" | "login_token" | "logout" | "loot" | "mine" | "modify_order" | "mute_notifications" | "name" | "owned" | "pay_debt" | "personal_build" | "personal_decorate" | "personal_visit" | "petition" | "place_ship_buy_order" | "policies" | "post" | "post_mission" | "prepay_tax" | "profile" | "promote" | "propose_ally" | "propose_peace" | "query_intel" | "query_trade_intel" | "quote" | "ranch_set_cull" | "ranch_status" | "read_note" | "recall" | "recycle" | "refit_ship" | "refuel" | "register" | "release" | "reload" | "remove_ally" | "remove_enemy" | "remove_faction" | "remove_player" | "rename_ship" | "renounce" | "repair" | "
|
|
4
|
+
export type ActionName = "abandon_mission" | "accept" | "accept_ally" | "accept_invite" | "accept_mission" | "accept_peace" | "active" | "advance" | "allow_faction" | "allow_player" | "analyze_market" | "apply" | "attack" | "ban" | "base_cost" | "board" | "browse_for_sale" | "browse_ships" | "build" | "buy" | "buy_listed_ship" | "buy_listing" | "buy_ship_license" | "cancel" | "cancel_commission" | "cancel_listing" | "cancel_mission" | "cancel_order" | "cancel_ship_buy_order" | "cancel_ship_listing" | "captains_log_add" | "captains_log_delete" | "captains_log_get" | "captains_log_list" | "chat" | "claim" | "claim_prize" | "cloak" | "commission_quote" | "commission_ship" | "commission_status" | "complete_mission" | "completed_missions" | "craft" | "create" | "create_buy_order" | "create_note" | "create_role" | "create_sell_order" | "declare_war" | "decline" | "decline_invite" | "decline_mission" | "delete_note" | "delete_role" | "delete_room" | "deliver" | "deploy" | "deploy_outpost" | "deposit" | "disband" | "disembark" | "dismantle" | "dismantle_outpost" | "distress_signal" | "dock" | "edit" | "edit_role" | "engage" | "espionage" | "estimate_purchase" | "facility_set_description" | "faction_build" | "faction_dismantle" | "faction_list" | "faction_owned" | "faction_personnel" | "faction_upgrade" | "find_route" | "forum_create_thread" | "forum_delete_reply" | "forum_delete_thread" | "forum_get_thread" | "forum_list" | "forum_reply" | "forum_upvote" | "found_station" | "garages" | "get" | "get_achievements" | "get_action_log" | "get_active_missions" | "get_base" | "get_cargo" | "get_chat_history" | "get_commands" | "get_empire_info" | "get_faction_achievements" | "get_guide" | "get_invites" | "get_location" | "get_map" | "get_missions" | "get_nearby" | "get_notes" | "get_notification_settings" | "get_notifications" | "get_player" | "get_poi" | "get_queue" | "get_ship" | "get_skills" | "get_state" | "get_status" | "get_system" | "get_system_agents" | "get_tax_estimate" | "get_trades" | "get_version" | "hunt" | "info" | "inspect" | "install_mod" | "insure" | "intel_status" | "invite" | "jettison" | "job_add" | "job_cancel" | "job_list" | "job_reorder" | "join" | "jump" | "kick" | "leave" | "list" | "list_for_sale" | "list_missions" | "list_passengers" | "list_ship_for_sale" | "list_ships" | "list_station_passengers" | "load" | "load_passenger" | "log" | "login" | "login_link" | "login_link_poll" | "login_token" | "logout" | "loot" | "mine" | "modify_order" | "mute_notifications" | "name" | "owned" | "pay_bounty" | "pay_debt" | "personal_build" | "personal_decorate" | "personal_visit" | "petition" | "place_ship_buy_order" | "policies" | "post" | "post_mission" | "prepay_tax" | "profile" | "promote" | "propose_ally" | "propose_peace" | "query_intel" | "query_trade_intel" | "quote" | "ranch_set_cull" | "ranch_status" | "read_note" | "recall" | "recruit_personnel" | "recycle" | "refit_ship" | "refuel" | "register" | "release" | "reload" | "remove_ally" | "remove_enemy" | "remove_faction" | "remove_player" | "rename_ship" | "renounce" | "repair" | "retreat" | "return" | "rooms" | "scan" | "scan_poi" | "scrap" | "scrap_ship" | "search_systems" | "self_destruct" | "sell" | "sell_ship_to_order" | "service_prize" | "set_access" | "set_auto_buy_fuel" | "set_build_policy" | "set_colors" | "set_description" | "set_enemy" | "set_home" | "set_market_fee" | "set_name" | "set_output_price" | "set_public" | "set_refuel_price" | "set_repair_price" | "set_service_access" | "set_status" | "stance" | "station_info" | "station_set_name" | "status" | "submit_intel" | "submit_trade_intel" | "subscribe_market" | "subscribe_observation" | "summary" | "supply_commission" | "survey_system" | "switch_ship" | "target" | "tax_estimate" | "tow" | "track" | "trade_accept" | "trade_cancel" | "trade_decline" | "trade_intel_status" | "trade_offer" | "transfer" | "transfer_personnel" | "travel" | "treat_personnel" | "types" | "unban" | "undock" | "uninstall_mod" | "unload" | "unload_passenger" | "unmute_notifications" | "unsubscribe_market" | "unsubscribe_observation" | "upgrade" | "upgrades" | "upload" | "use_item" | "view" | "view_completed_mission" | "view_market" | "view_orders" | "view_ship_buy_orders" | "visit_room" | "withdraw" | "withdraw_invite" | "wrecks" | "write_note" | "write_room";
|
|
5
5
|
export interface ActionParam {
|
|
6
6
|
readonly name: string;
|
|
7
7
|
readonly type: string;
|