@spacemolt/lib 8.0.0 → 10.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 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.512.0`). **267 commands across 17 tools.**
4
+ Every command in `@spacemolt/lib`, generated from the live server spec (`v0.516.0`). **265 commands across 17 tools.**
5
5
 
6
6
  ## How to call a command
7
7
 
@@ -25,7 +25,7 @@ const status = await account.commands.spacemolt.get_status(); // query
25
25
  - [`spacemolt_battle`](#spacemolt_battle) — 9 commands
26
26
  - [`spacemolt_citizenship`](#spacemolt_citizenship) — 4 commands
27
27
  - [`spacemolt_drone`](#spacemolt_drone) — 8 commands
28
- - [`spacemolt_facility`](#spacemolt_facility) — 51 commands
28
+ - [`spacemolt_facility`](#spacemolt_facility) — 49 commands
29
29
  - [`spacemolt_faction`](#spacemolt_faction) — 28 commands
30
30
  - [`spacemolt_faction_admin`](#spacemolt_faction_admin) — 6 commands
31
31
  - [`spacemolt_faction_commerce`](#spacemolt_faction_commerce) — 2 commands
@@ -166,12 +166,10 @@ Call as `account.commands.spacemolt_facility.<action>(...)`.
166
166
  - `buy_ship_license({ ship_class: string })` · *mutation* → delta.details: `ShipLicenseResponse` — License a specific ship design so your faction can build it at its own stations
167
167
  - `cancel_listing({ listing_id: string })` · *mutation* → delta.details: `FacilityResponse` — Manage facilities at stations (production, faction, personal, sales, and more)
168
168
  - `deploy_outpost({ name: string })` · *mutation* → delta.details: `BuildBaseResponse` — Deploy a lightweight, members-only faction outpost at your current point of interest in lawless space
169
- - `disassemble({ facility_id: string })` · *mutation* → delta.details: `FacilityResponse` — Manage facilities at stations (production, faction, personal, sales, and more)
170
- - `dismantle({ facility_id: string })` · *mutation* → delta.details: `FacilityResponse` — Manage facilities at stations (production, faction, personal, sales, and more)
169
+ - `dismantle({ facility_id: string })` · *mutation* → delta.details: `FacilityDismantleResponse` — Manage facilities at stations (production, faction, personal, sales, and more)
171
170
  - `facility_set_description({ description?: string; facility_id: string })` · *query* → `FacilityResponse` — Manage facilities at stations (production, faction, personal, sales, and more)
172
171
  - `faction_build({ bucket?: string; facility_type: string })` · *mutation* → delta.details: `FacilityResponse` — Manage facilities at stations (production, faction, personal, sales, and more)
173
- - `faction_disassemble({ facility_id: string })` · *mutation* → delta.details: `FacilityResponse` — Manage facilities at stations (production, faction, personal, sales, and more)
174
- - `faction_dismantle({ facility_id: string })` · *mutation* → delta.details: `FacilityResponse` — Manage facilities at stations (production, faction, personal, sales, and more)
172
+ - `faction_dismantle({ facility_id: string })` · *mutation* → delta.details: `FacilityDismantleResponse` — Manage facilities at stations (production, faction, personal, sales, and more)
175
173
  - `faction_list()` · *query* → `FacilityResponse` — Manage facilities at stations (production, faction, personal, sales, and more)
176
174
  - `faction_owned()` · *query* → `FacilityResponse` — Manage facilities at stations (production, faction, personal, sales, and more)
177
175
  - `faction_upgrade({ bucket?: string; facility_id: string; facility_type: string })` · *mutation* → delta.details: `FacilityResponse` — Manage facilities at stations (production, faction, personal, sales, and more)
@@ -1,9 +1,13 @@
1
+ import type { FacilityDefinition, Item, Module, Recipe, ShipClass, SkillDefinition } from '../generated/openapi/types.gen.js';
1
2
  /**
2
3
  * Local copy of the bulk game catalog (`GET /api/catalog.json`).
3
4
  *
4
5
  * Reference data — ships, items, recipes, skills, facilities — that changes
5
- * only on a server release. The entry shapes aren't in the v2 OpenAPI spec, so
6
- * they're typed loosely with `id`-keyed lookups.
6
+ * only on a server release. Entry shapes come from the spec's published
7
+ * `CatalogDump` component types (`ShipClass`, `Item`/`Module`, `Recipe`,
8
+ * `SkillDefinition`, `FacilityDefinition`), so they track the server via the
9
+ * spec sync. Entries are structurally validated as JSON objects and then
10
+ * trusted to match the spec — the same trust model as state-cache deltas.
7
11
  *
8
12
  * The payload is large (multiple MB), so the server ships it `public,
9
13
  * max-age=3600` with a content-hash `ETag`. We keep that ETag on the cache and
@@ -12,17 +16,20 @@
12
16
  * catalog after a server release instead of holding the copy it fetched at
13
17
  * startup forever (see `SpacemoltClient.catalog`).
14
18
  */
15
- export interface CatalogEntry {
16
- id?: string;
17
- [key: string]: unknown;
18
- }
19
+ /** A ship entry — the spec's `ShipClass` (the dump omits live prices). */
20
+ export type CatalogShip = ShipClass;
21
+ /** An item entry — regular items and modules share the merged `items` list. */
22
+ export type CatalogItem = Item | Module;
23
+ export type CatalogRecipe = Recipe;
24
+ export type CatalogSkill = SkillDefinition;
25
+ export type CatalogFacility = FacilityDefinition;
19
26
  export interface Catalog {
20
27
  version?: string;
21
- ships: CatalogEntry[];
22
- items: CatalogEntry[];
23
- recipes: CatalogEntry[];
24
- skills: CatalogEntry[];
25
- facilities: CatalogEntry[];
28
+ ships: CatalogShip[];
29
+ items: CatalogItem[];
30
+ recipes: CatalogRecipe[];
31
+ skills: CatalogSkill[];
32
+ facilities: CatalogFacility[];
26
33
  }
27
34
  /** Result of a conditional catalog fetch. */
28
35
  export interface CatalogFetchResult {
@@ -46,7 +53,11 @@ export declare class CatalogCache {
46
53
  readonly catalog: Catalog;
47
54
  /** The server `ETag` this catalog was fetched with, for conditional reloads. */
48
55
  readonly etag?: string | undefined;
49
- private readonly indexes;
56
+ private readonly shipsById;
57
+ private readonly itemsById;
58
+ private readonly recipesById;
59
+ private readonly skillsById;
60
+ private readonly facilitiesById;
50
61
  constructor(catalog: Catalog,
51
62
  /** The server `ETag` this catalog was fetched with, for conditional reloads. */
52
63
  etag?: string | undefined);
@@ -59,14 +70,14 @@ export declare class CatalogCache {
59
70
  */
60
71
  revalidate(httpBaseUrl: string): Promise<CatalogCache>;
61
72
  get version(): string | undefined;
62
- ship(id: string): CatalogEntry | undefined;
63
- item(id: string): CatalogEntry | undefined;
64
- recipe(id: string): CatalogEntry | undefined;
65
- skill(id: string): CatalogEntry | undefined;
66
- facility(id: string): CatalogEntry | undefined;
67
- get ships(): readonly CatalogEntry[];
68
- get items(): readonly CatalogEntry[];
69
- get recipes(): readonly CatalogEntry[];
70
- get skills(): readonly CatalogEntry[];
71
- get facilities(): readonly CatalogEntry[];
73
+ ship(id: string): CatalogShip | undefined;
74
+ item(id: string): CatalogItem | undefined;
75
+ recipe(id: string): CatalogRecipe | undefined;
76
+ skill(id: string): CatalogSkill | undefined;
77
+ facility(id: string): CatalogFacility | undefined;
78
+ get ships(): readonly CatalogShip[];
79
+ get items(): readonly CatalogItem[];
80
+ get recipes(): readonly CatalogRecipe[];
81
+ get skills(): readonly CatalogSkill[];
82
+ get facilities(): readonly CatalogFacility[];
72
83
  }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Station directory (`GET /api/stations`).
3
+ *
4
+ * A public summary of every station in the galaxy — identity, owning
5
+ * empire/faction, system, offered services, condition, and defensive posture —
6
+ * plus the empire display list the server sends alongside it. Live data (the
7
+ * server caches it for ~10s), so fetch on demand rather than caching like the
8
+ * catalog or map.
9
+ *
10
+ * These shapes mirror the server's station list response; they aren't
11
+ * published in the OpenAPI spec yet (see docs/gameserver-todo.md), so they're
12
+ * hand-typed here and kept tolerant of server-side additions via the index
13
+ * signature.
14
+ */
15
+ export interface StationSummary {
16
+ id: string;
17
+ name: string;
18
+ description: string;
19
+ empire?: string;
20
+ empire_name?: string;
21
+ faction_id?: string;
22
+ faction_name?: string;
23
+ faction_tag?: string;
24
+ faction_color?: string;
25
+ system_id: string;
26
+ system_name: string;
27
+ services: string[];
28
+ condition: string;
29
+ condition_text: string;
30
+ satisfaction_pct: number;
31
+ facility_count: number;
32
+ /** Damage per tick the station's armed guns can actually deliver — zero when its batteries are out of shells. */
33
+ weapon_dps: number;
34
+ wrecked: boolean;
35
+ [key: string]: unknown;
36
+ }
37
+ /** An empire display entry from the station list (`{ id, name }`). */
38
+ export interface StationEmpire {
39
+ id: string;
40
+ name: string;
41
+ }
42
+ export interface StationList {
43
+ stations: StationSummary[];
44
+ empires: StationEmpire[];
45
+ }
46
+ /** Fetch the public station directory. */
47
+ export declare function fetchStations(httpBaseUrl: string): Promise<StationList>;
@@ -1,7 +1,7 @@
1
1
  /** The gameserver spec version this command surface was generated from. */
2
- export declare const GENERATED_SPEC_VERSION = "v0.512.0";
2
+ export declare const GENERATED_SPEC_VERSION = "v0.516.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_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_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" | "deploy" | "deploy_outpost" | "deposit" | "disassemble" | "disband" | "disembark" | "dismantle" | "distress_signal" | "dock" | "edit" | "edit_role" | "engage" | "espionage" | "estimate_purchase" | "facility_set_description" | "faction_build" | "faction_disassemble" | "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_token" | "logout" | "loot" | "mine" | "modify_order" | "mute_notifications" | "name" | "owned" | "personal_build" | "personal_decorate" | "personal_visit" | "petition" | "place_ship_buy_order" | "policies" | "post_mission" | "prepay_tax" | "promote" | "propose_ally" | "propose_peace" | "query_intel" | "query_trade_intel" | "quote" | "read_note" | "recall" | "recycle" | "refit_ship" | "refuel" | "register" | "release" | "reload" | "remove_ally" | "remove_enemy" | "remove_faction" | "remove_player" | "rename_ship" | "renounce" | "repair" | "repair_module" | "retreat" | "rooms" | "scan" | "scan_poi" | "scrap" | "scrap_ship" | "search_systems" | "self_destruct" | "sell" | "sell_ship_to_order" | "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" | "trade_accept" | "trade_cancel" | "trade_decline" | "trade_intel_status" | "trade_offer" | "transfer" | "travel" | "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";
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_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" | "deploy" | "deploy_outpost" | "deposit" | "disband" | "disembark" | "dismantle" | "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_token" | "logout" | "loot" | "mine" | "modify_order" | "mute_notifications" | "name" | "owned" | "personal_build" | "personal_decorate" | "personal_visit" | "petition" | "place_ship_buy_order" | "policies" | "post_mission" | "prepay_tax" | "promote" | "propose_ally" | "propose_peace" | "query_intel" | "query_trade_intel" | "quote" | "read_note" | "recall" | "recycle" | "refit_ship" | "refuel" | "register" | "release" | "reload" | "remove_ally" | "remove_enemy" | "remove_faction" | "remove_player" | "rename_ship" | "renounce" | "repair" | "repair_module" | "retreat" | "rooms" | "scan" | "scan_poi" | "scrap" | "scrap_ship" | "search_systems" | "self_destruct" | "sell" | "sell_ship_to_order" | "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" | "trade_accept" | "trade_cancel" | "trade_decline" | "trade_intel_status" | "trade_offer" | "transfer" | "travel" | "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;
@@ -1,5 +1,5 @@
1
1
  import type { MutationResult, QueryResult } from '../protocol.js';
2
- import type { AbandonMissionResponse, AcceptMissionResponse, AnalyzeMarketResponse, AttackResponse, BaseCostResponse, BattleResponse, BattleSummaryResponse, BrowseShipsResponse, BuildBaseResponse, BuyInsuranceResponse, BuyListedShipResponse, BuyResponse, CancelCommissionResponse, CancelOrderResponse, CancelShipBuyOrderResponse, CancelShipListingResponse, CaptainsLogAddResponse, CaptainsLogDeleteResponse, CaptainsLogGetResponse, CaptainsLogListResponse, ChatResponse, CitizenshipResponse, ClaimInsuranceResponse, CloakResponse, CommissionQuoteResponse, CommissionShipResponse, CommissionStatusResponse, CompleteMissionResponse, CompletedMissionsResponse, CraftJobResponse, CreateBuyOrderResponse, CreateFactionResponse, CreateNoteResponse, CreateSellOrderResponse, DeclineMissionResponse, DeleteNoteResponse, DeployDroneResponse, DepositItemsResponse, DistressSignalResponse, DockResponse, EspionageResponse, EstimatePurchaseResponse, FacilityResponse, FactionAcceptAllyResponse, FactionAcceptPeaceResponse, FactionCancelMissionResponse, FactionCreateBuyOrderResponse, FactionCreateRoleResponse, FactionCreateSellOrderResponse, FactionDeclareWarResponse, FactionDeclineInviteResponse, FactionDeleteRoleResponse, FactionDeleteRoomResponse, FactionEditResponse, FactionEditRoleResponse, FactionGaragesResponse, FactionGetInvitesResponse, FactionInfoResponse, FactionIntelStatusResponse, FactionInviteResponse, FactionKickResponse, FactionListMissionsResponse, FactionListResponse, FactionPostMissionResponse, FactionPrepayTaxResponse, FactionPromoteResponse, FactionProposeAllyResponse, FactionProposePeaceResponse, FactionQueryIntelResponse, FactionQueryTradeIntelResponse, FactionRemoveAllyResponse, FactionRemoveEnemyResponse, FactionRoomsResponse, FactionScanPoiResponse, FactionSetEnemyResponse, FactionSubmitIntelResponse, FactionSubmitTradeIntelResponse, FactionTaxEstimateResponse, FactionTradeIntelStatusResponse, FactionVisitRoomResponse, FactionWithdrawInviteResponse, FactionWriteRoomResponse, FindRouteResponse, FleetCreateResponse, FleetResponse, FleetStatusResponse, ForumCreateThreadResponse, ForumDeleteReplyResponse, ForumDeleteThreadResponse, ForumGetThreadResponse, ForumListResponse, ForumReplyResponse, ForumUpvoteResponse, GetAchievementsResponse, GetActionLogResponse, GetBaseResponse, GetBattleLogResponse, GetBattleStatusResponse, GetChatHistoryResponse, GetDroneResponse, GetDronesResponse, GetEmpireInfoResponse, GetFactionAchievementsResponse, GetGuideResponse, GetInsuranceQuoteResponse, GetMapResponse, GetMissionsResponse, GetNearbyResponse, GetNotesResponse, GetNotificationsResponse, GetPoiResponse, GetSystemAgentsResponse, GetSystemResponse, GetTradesResponse, GetVersionResponse, GetWrecksResponse, HuntResponse, InspectResponse, InstallModResponse, JettisonResponse, JoinFactionResponse, JumpResponse, ListPassengersResponse, ListShipForSaleResponse, ListShipsResponse, LoadDroneResponse, LoadPassengersResponse, LoginResponse, LootWreckResponse, MessageResponse, MineResponse, ModifyOrderResponse, NameShipResponse, NotificationSettingsResponse, PetitionResponse, PlaceShipBuyOrderResponse, PrepayTaxResponse, ReadNoteResponse, RecallDroneResponse, RecycleJobResponse, RefitShipResponse, RefuelResponse, RegisterResponse, ReleaseTowResponse, ReloadResponse, RepairModuleResponse, RepairResponse, ScanResponse, ScrapShipResponse, ScrapWreckResponse, SearchSystemsResponse, SelfDestructResponse, SellResponse, SellShipToOrderResponse, SellWreckResponse, SetColorsResponse, SetDroneNameResponse, SetHomeBaseResponse, SetStatusResponse, ShipLicenseResponse, StationConfigResponse, StationPassengersResponse, StorageResponse, SubscribeMarketResponse, SubscribeObservationResponse, SupplyCommissionResponse, SurveySystemResponse, SwitchShipResponse, TaxEstimateResponse, TowWreckResponse, TradeAcceptResponse, TradeOfferResponse, TravelResponse, UndockResponse, UninstallModResponse, UnloadDroneResponse, UnloadPassengerResponse, UnsubscribeMarketResponse, UnsubscribeObservationResponse, UploadDroneScriptResponse, UseItemResponse, V2GameState, V2GetCommandsResponse, ViewCompletedMissionResponse, ViewMarketResponse, ViewOrdersResponse, ViewShipBuyOrdersResponse, WithdrawItemsResponse, WriteNoteResponse } from './openapi/types.gen.js';
2
+ import type { AbandonMissionResponse, AcceptMissionResponse, AnalyzeMarketResponse, AttackResponse, BaseCostResponse, BattleResponse, BattleSummaryResponse, BrowseShipsResponse, BuildBaseResponse, BuyInsuranceResponse, BuyListedShipResponse, BuyResponse, CancelCommissionResponse, CancelOrderResponse, CancelShipBuyOrderResponse, CancelShipListingResponse, CaptainsLogAddResponse, CaptainsLogDeleteResponse, CaptainsLogGetResponse, CaptainsLogListResponse, ChatResponse, CitizenshipResponse, ClaimInsuranceResponse, CloakResponse, CommissionQuoteResponse, CommissionShipResponse, CommissionStatusResponse, CompleteMissionResponse, CompletedMissionsResponse, CraftJobResponse, CreateBuyOrderResponse, CreateFactionResponse, CreateNoteResponse, CreateSellOrderResponse, DeclineMissionResponse, DeleteNoteResponse, DeployDroneResponse, DepositItemsResponse, DistressSignalResponse, DockResponse, EspionageResponse, EstimatePurchaseResponse, FacilityDismantleResponse, FacilityResponse, FactionAcceptAllyResponse, FactionAcceptPeaceResponse, FactionCancelMissionResponse, FactionCreateBuyOrderResponse, FactionCreateRoleResponse, FactionCreateSellOrderResponse, FactionDeclareWarResponse, FactionDeclineInviteResponse, FactionDeleteRoleResponse, FactionDeleteRoomResponse, FactionEditResponse, FactionEditRoleResponse, FactionGaragesResponse, FactionGetInvitesResponse, FactionInfoResponse, FactionIntelStatusResponse, FactionInviteResponse, FactionKickResponse, FactionListMissionsResponse, FactionListResponse, FactionPostMissionResponse, FactionPrepayTaxResponse, FactionPromoteResponse, FactionProposeAllyResponse, FactionProposePeaceResponse, FactionQueryIntelResponse, FactionQueryTradeIntelResponse, FactionRemoveAllyResponse, FactionRemoveEnemyResponse, FactionRoomsResponse, FactionScanPoiResponse, FactionSetEnemyResponse, FactionSubmitIntelResponse, FactionSubmitTradeIntelResponse, FactionTaxEstimateResponse, FactionTradeIntelStatusResponse, FactionVisitRoomResponse, FactionWithdrawInviteResponse, FactionWriteRoomResponse, FindRouteResponse, FleetCreateResponse, FleetResponse, FleetStatusResponse, ForumCreateThreadResponse, ForumDeleteReplyResponse, ForumDeleteThreadResponse, ForumGetThreadResponse, ForumListResponse, ForumReplyResponse, ForumUpvoteResponse, GetAchievementsResponse, GetActionLogResponse, GetBaseResponse, GetBattleLogResponse, GetBattleStatusResponse, GetChatHistoryResponse, GetDroneResponse, GetDronesResponse, GetEmpireInfoResponse, GetFactionAchievementsResponse, GetGuideResponse, GetInsuranceQuoteResponse, GetMapResponse, GetMissionsResponse, GetNearbyResponse, GetNotesResponse, GetNotificationsResponse, GetPoiResponse, GetSystemAgentsResponse, GetSystemResponse, GetTradesResponse, GetVersionResponse, GetWrecksResponse, HuntResponse, InspectResponse, InstallModResponse, JettisonResponse, JoinFactionResponse, JumpResponse, ListPassengersResponse, ListShipForSaleResponse, ListShipsResponse, LoadDroneResponse, LoadPassengersResponse, LoginResponse, LootWreckResponse, MessageResponse, MineResponse, ModifyOrderResponse, NameShipResponse, NotificationSettingsResponse, PetitionResponse, PlaceShipBuyOrderResponse, PrepayTaxResponse, ReadNoteResponse, RecallDroneResponse, RecycleJobResponse, RefitShipResponse, RefuelResponse, RegisterResponse, ReleaseTowResponse, ReloadResponse, RepairModuleResponse, RepairResponse, ScanResponse, ScrapShipResponse, ScrapWreckResponse, SearchSystemsResponse, SelfDestructResponse, SellResponse, SellShipToOrderResponse, SellWreckResponse, SetColorsResponse, SetDroneNameResponse, SetHomeBaseResponse, SetStatusResponse, ShipLicenseResponse, StationConfigResponse, StationPassengersResponse, StorageResponse, SubscribeMarketResponse, SubscribeObservationResponse, SupplyCommissionResponse, SurveySystemResponse, SwitchShipResponse, TaxEstimateResponse, TowWreckResponse, TradeAcceptResponse, TradeOfferResponse, TravelResponse, UndockResponse, UninstallModResponse, UnloadDroneResponse, UnloadPassengerResponse, UnsubscribeMarketResponse, UnsubscribeObservationResponse, UploadDroneScriptResponse, UseItemResponse, V2GameState, V2GetCommandsResponse, ViewCompletedMissionResponse, ViewMarketResponse, ViewOrdersResponse, ViewShipBuyOrdersResponse, WithdrawItemsResponse, WriteNoteResponse } from './openapi/types.gen.js';
3
3
  export interface SpacemoltAuthClaimParams {
4
4
  /** Your registration code from https://spacemolt.com/dashboard */
5
5
  registration_code: string;
@@ -142,18 +142,14 @@ export interface SpacemoltFacilityDeployOutpostParams {
142
142
  /** Name for the new faction outpost */
143
143
  name: string;
144
144
  }
145
- export interface SpacemoltFacilityDisassembleParams {
146
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
147
- facility_id: string;
148
- }
149
145
  export interface SpacemoltFacilityDismantleParams {
150
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
146
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
151
147
  facility_id: string;
152
148
  }
153
149
  export interface SpacemoltFacilityFacilitySetDescriptionParams {
154
150
  /** For 'personal_decorate': a text description of your personal quarters (what visitors see, hear, and feel). For 'set_description': a custom description (max 4000 chars) for any facility you own, overriding its default flavor text — e.g. re-flavoring your faction's bar. Send empty to clear it. */
155
151
  description?: string;
156
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
152
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
157
153
  facility_id: string;
158
154
  }
159
155
  export interface SpacemoltFacilityFactionBuildParams {
@@ -162,18 +158,14 @@ export interface SpacemoltFacilityFactionBuildParams {
162
158
  /** Facility type ID. For 'types' action: get full details for this specific type. For 'build'/'upgrade': the type to build/upgrade to. */
163
159
  facility_type: string;
164
160
  }
165
- export interface SpacemoltFacilityFactionDisassembleParams {
166
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
167
- facility_id: string;
168
- }
169
161
  export interface SpacemoltFacilityFactionDismantleParams {
170
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
162
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
171
163
  facility_id: string;
172
164
  }
173
165
  export interface SpacemoltFacilityFactionUpgradeParams {
174
166
  /** For 'faction_build'/'faction_upgrade': a Storage Extension bucket (name or id) to source build/upgrade MATERIALS from, instead of the faction main store. Ship cargo backfills either way. */
175
167
  bucket?: string;
176
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
168
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
177
169
  facility_id: string;
178
170
  /** Facility type ID. For 'types' action: get full details for this specific type. For 'build'/'upgrade': the type to build/upgrade to. */
179
171
  facility_type: string;
@@ -189,7 +181,7 @@ export interface SpacemoltFacilityJobAddParams {
189
181
  deliver_to?: string;
190
182
  /** Job direction: 'forward' runs the recipe normally (craft); 'reverse' recycles existing items back to inputs. */
191
183
  direction?: "forward" | "reverse";
192
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
184
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
193
185
  facility_id: string;
194
186
  /** For job_add pack_package: selected manifest items. */
195
187
  items?: {
@@ -216,11 +208,11 @@ export interface SpacemoltFacilityJobCancelParams {
216
208
  job_ids?: string[];
217
209
  }
218
210
  export interface SpacemoltFacilityJobListParams {
219
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
211
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
220
212
  facility_id: string;
221
213
  }
222
214
  export interface SpacemoltFacilityJobReorderParams {
223
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
215
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
224
216
  facility_id: string;
225
217
  /** Job ID (for 'job_cancel', 'job_reorder'). Use action 'job_list' to see job IDs. */
226
218
  job_id: string;
@@ -228,7 +220,7 @@ export interface SpacemoltFacilityJobReorderParams {
228
220
  position?: number;
229
221
  }
230
222
  export interface SpacemoltFacilityListForSaleParams {
231
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
223
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
232
224
  facility_id: string;
233
225
  /** For 'list_for_sale': set true to list a faction-owned facility (requires manage_facilities permission). */
234
226
  faction?: boolean;
@@ -258,13 +250,13 @@ export interface SpacemoltFacilityRemovePlayerParams {
258
250
  player: string;
259
251
  }
260
252
  export interface SpacemoltFacilityRepairParams {
261
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
253
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
262
254
  facility_id: string;
263
255
  }
264
256
  export interface SpacemoltFacilitySetAccessParams {
265
257
  /** For 'personal_decorate': who can visit your quarters. For 'set_access': 'public' opens your facility to renters, 'private' closes it. */
266
258
  access: "private" | "public";
267
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
259
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
268
260
  facility_id: string;
269
261
  }
270
262
  export interface SpacemoltFacilitySetAutoBuyFuelParams {
@@ -286,11 +278,11 @@ export interface SpacemoltFacilitySetMarketFeeParams {
286
278
  export interface SpacemoltFacilitySetNameParams {
287
279
  /** For 'set_name': a custom name for the facility (3-32 chars) so multiple facilities of the same type stand out. Send empty to clear it. */
288
280
  custom_name?: string;
289
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
281
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
290
282
  facility_id: string;
291
283
  }
292
284
  export interface SpacemoltFacilitySetOutputPriceParams {
293
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
285
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
294
286
  facility_id: string;
295
287
  /** For 'list_for_sale': asking price in whole credits. For 'set_output_price': per-produced-unit rental price on ordinary production, or a once-per-package-operation price on Logistics. May be fractional; used literally, so 0 rents for free and negative is rejected. */
296
288
  price?: number;
@@ -320,7 +312,7 @@ export interface SpacemoltFacilityStationSetNameParams {
320
312
  export interface SpacemoltFacilityTransferParams {
321
313
  /** Transfer direction: 'to_faction' moves the facility to faction ownership; 'to_player' transfers it to a specific player. */
322
314
  direction: "to_faction" | "to_player";
323
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
315
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
324
316
  facility_id: string;
325
317
  /** Target player ID for 'transfer' action with direction 'to_player'. */
326
318
  player_id?: string;
@@ -346,7 +338,7 @@ export interface SpacemoltFacilityUnbanParams {
346
338
  export interface SpacemoltFacilityUpgradeParams {
347
339
  /** For 'faction_build'/'faction_upgrade': a Storage Extension bucket (name or id) to source build/upgrade MATERIALS from, instead of the faction main store. Ship cargo backfills either way. */
348
340
  bucket?: string;
349
- /** Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
341
+ /** Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs. */
350
342
  facility_id: string;
351
343
  /** Facility type ID. For 'types' action: get full details for this specific type. For 'build'/'upgrade': the type to build/upgrade to. */
352
344
  facility_type: string;
@@ -1507,17 +1499,13 @@ export interface Commands {
1507
1499
  /** Deploy a lightweight, members-only faction outpost at your current point of interest in lawless space */
1508
1500
  deploy_outpost(params: SpacemoltFacilityDeployOutpostParams): Promise<MutationResult<BuildBaseResponse>>;
1509
1501
  /** Manage facilities at stations (production, faction, personal, sales, and more) */
1510
- disassemble(params: SpacemoltFacilityDisassembleParams): Promise<MutationResult<FacilityResponse>>;
1511
- /** Manage facilities at stations (production, faction, personal, sales, and more) */
1512
- dismantle(params: SpacemoltFacilityDismantleParams): Promise<MutationResult<FacilityResponse>>;
1502
+ dismantle(params: SpacemoltFacilityDismantleParams): Promise<MutationResult<FacilityDismantleResponse>>;
1513
1503
  /** Manage facilities at stations (production, faction, personal, sales, and more) */
1514
1504
  facility_set_description(params: SpacemoltFacilityFacilitySetDescriptionParams): Promise<QueryResult<FacilityResponse>>;
1515
1505
  /** Manage facilities at stations (production, faction, personal, sales, and more) */
1516
1506
  faction_build(params: SpacemoltFacilityFactionBuildParams): Promise<MutationResult<FacilityResponse>>;
1517
1507
  /** Manage facilities at stations (production, faction, personal, sales, and more) */
1518
- faction_disassemble(params: SpacemoltFacilityFactionDisassembleParams): Promise<MutationResult<FacilityResponse>>;
1519
- /** Manage facilities at stations (production, faction, personal, sales, and more) */
1520
- faction_dismantle(params: SpacemoltFacilityFactionDismantleParams): Promise<MutationResult<FacilityResponse>>;
1508
+ faction_dismantle(params: SpacemoltFacilityFactionDismantleParams): Promise<MutationResult<FacilityDismantleResponse>>;
1521
1509
  /** Manage facilities at stations (production, faction, personal, sales, and more) */
1522
1510
  faction_list(): Promise<QueryResult<FacilityResponse>>;
1523
1511
  /** Manage facilities at stations (production, faction, personal, sales, and more) */
@@ -1042,6 +1042,8 @@ export type CraftJobResponse = {
1042
1042
  } | {
1043
1043
  action: string;
1044
1044
  jobs: Array<{
1045
+ base_id?: string;
1046
+ base_name?: string;
1045
1047
  eta_ticks: number;
1046
1048
  external?: boolean;
1047
1049
  facility_id: string;
@@ -1710,6 +1712,21 @@ export type FacilityDefinition = {
1710
1712
  weapon_damage_type?: string;
1711
1713
  weapon_reach?: number;
1712
1714
  };
1715
+ export type FacilityDismantleResponse = {
1716
+ action: string;
1717
+ base_id: string;
1718
+ complete_tick: number;
1719
+ facility_id: string;
1720
+ facility_name: string;
1721
+ facility_type: string;
1722
+ hint: string;
1723
+ materials_to_package: Array<{
1724
+ item_id: string;
1725
+ quantity: number;
1726
+ }>;
1727
+ package_count: number;
1728
+ ticks_to_complete: number;
1729
+ };
1713
1730
  export type FacilityResponse = {
1714
1731
  action: string;
1715
1732
  base_id: string;
@@ -2212,18 +2229,6 @@ export type FacilityResponse = {
2212
2229
  personal_service?: string;
2213
2230
  recipe_id?: string;
2214
2231
  rent_per_cycle: number;
2215
- } | {
2216
- action: string;
2217
- base_id: string;
2218
- complete_tick: number;
2219
- crate_count: number;
2220
- crate_item_id: string;
2221
- crate_name: string;
2222
- facility_id: string;
2223
- facility_name: string;
2224
- facility_type: string;
2225
- hint: string;
2226
- ticks_to_complete: number;
2227
2232
  } | {
2228
2233
  action: string;
2229
2234
  base_id: string;
@@ -2232,10 +2237,11 @@ export type FacilityResponse = {
2232
2237
  facility_name: string;
2233
2238
  facility_type: string;
2234
2239
  hint: string;
2235
- materials_to_recover: Array<{
2240
+ materials_to_package: Array<{
2236
2241
  item_id: string;
2237
2242
  quantity: number;
2238
2243
  }>;
2244
+ package_count: number;
2239
2245
  ticks_to_complete: number;
2240
2246
  } | {
2241
2247
  action: string;
@@ -2529,6 +2535,8 @@ export type FacilityResponse = {
2529
2535
  action: string;
2530
2536
  facility_id: string;
2531
2537
  jobs: Array<{
2538
+ base_id?: string;
2539
+ base_name?: string;
2532
2540
  eta_ticks: number;
2533
2541
  external?: boolean;
2534
2542
  facility_id: string;
@@ -13648,46 +13656,10 @@ export type SpacemoltFacilityDeployOutpostResponses = {
13648
13656
  };
13649
13657
  };
13650
13658
  export type SpacemoltFacilityDeployOutpostResponse = SpacemoltFacilityDeployOutpostResponses[keyof SpacemoltFacilityDeployOutpostResponses];
13651
- export type SpacemoltFacilityDisassembleData = {
13652
- body?: {
13653
- /**
13654
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
13655
- */
13656
- facility_id: string;
13657
- };
13658
- path?: never;
13659
- query?: never;
13660
- url: '/api/v2/spacemolt_facility/disassemble';
13661
- };
13662
- export type SpacemoltFacilityDisassembleErrors = {
13663
- /**
13664
- * Bad request — invalid params, unknown command, or game error
13665
- */
13666
- 400: unknown;
13667
- /**
13668
- * Not authenticated — missing or invalid session
13669
- */
13670
- 401: unknown;
13671
- /**
13672
- * Rate limited — mutations allow 1 per tick (10 seconds)
13673
- */
13674
- 429: unknown;
13675
- };
13676
- export type SpacemoltFacilityDisassembleResponses = {
13677
- /**
13678
- * Result. structuredContent: V2GameState post-mutation delta (changed ship/cargo/location/queue sections); the command result is under `details` (FacilityResponse)
13679
- */
13680
- 200: V2Response & {
13681
- structuredContent?: V2GameState & {
13682
- details?: FacilityResponse;
13683
- };
13684
- };
13685
- };
13686
- export type SpacemoltFacilityDisassembleResponse = SpacemoltFacilityDisassembleResponses[keyof SpacemoltFacilityDisassembleResponses];
13687
13659
  export type SpacemoltFacilityDismantleData = {
13688
13660
  body?: {
13689
13661
  /**
13690
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
13662
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
13691
13663
  */
13692
13664
  facility_id: string;
13693
13665
  };
@@ -13711,11 +13683,11 @@ export type SpacemoltFacilityDismantleErrors = {
13711
13683
  };
13712
13684
  export type SpacemoltFacilityDismantleResponses = {
13713
13685
  /**
13714
- * Result. structuredContent: V2GameState post-mutation delta (changed ship/cargo/location/queue sections); the command result is under `details` (FacilityResponse)
13686
+ * Result. structuredContent: V2GameState post-mutation delta (changed ship/cargo/location/queue sections); the command result is under `details` (FacilityDismantleResponse)
13715
13687
  */
13716
13688
  200: V2Response & {
13717
13689
  structuredContent?: V2GameState & {
13718
- details?: FacilityResponse;
13690
+ details?: FacilityDismantleResponse;
13719
13691
  };
13720
13692
  };
13721
13693
  };
@@ -13727,7 +13699,7 @@ export type SpacemoltFacilityFacilitySetDescriptionData = {
13727
13699
  */
13728
13700
  description?: string;
13729
13701
  /**
13730
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
13702
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
13731
13703
  */
13732
13704
  facility_id: string;
13733
13705
  };
@@ -13798,46 +13770,10 @@ export type SpacemoltFacilityFactionBuildResponses = {
13798
13770
  };
13799
13771
  };
13800
13772
  export type SpacemoltFacilityFactionBuildResponse = SpacemoltFacilityFactionBuildResponses[keyof SpacemoltFacilityFactionBuildResponses];
13801
- export type SpacemoltFacilityFactionDisassembleData = {
13802
- body?: {
13803
- /**
13804
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
13805
- */
13806
- facility_id: string;
13807
- };
13808
- path?: never;
13809
- query?: never;
13810
- url: '/api/v2/spacemolt_facility/faction_disassemble';
13811
- };
13812
- export type SpacemoltFacilityFactionDisassembleErrors = {
13813
- /**
13814
- * Bad request — invalid params, unknown command, or game error
13815
- */
13816
- 400: unknown;
13817
- /**
13818
- * Not authenticated — missing or invalid session
13819
- */
13820
- 401: unknown;
13821
- /**
13822
- * Rate limited — mutations allow 1 per tick (10 seconds)
13823
- */
13824
- 429: unknown;
13825
- };
13826
- export type SpacemoltFacilityFactionDisassembleResponses = {
13827
- /**
13828
- * Result. structuredContent: V2GameState post-mutation delta (changed ship/cargo/location/queue sections); the command result is under `details` (FacilityResponse)
13829
- */
13830
- 200: V2Response & {
13831
- structuredContent?: V2GameState & {
13832
- details?: FacilityResponse;
13833
- };
13834
- };
13835
- };
13836
- export type SpacemoltFacilityFactionDisassembleResponse = SpacemoltFacilityFactionDisassembleResponses[keyof SpacemoltFacilityFactionDisassembleResponses];
13837
13773
  export type SpacemoltFacilityFactionDismantleData = {
13838
13774
  body?: {
13839
13775
  /**
13840
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
13776
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
13841
13777
  */
13842
13778
  facility_id: string;
13843
13779
  };
@@ -13861,11 +13797,11 @@ export type SpacemoltFacilityFactionDismantleErrors = {
13861
13797
  };
13862
13798
  export type SpacemoltFacilityFactionDismantleResponses = {
13863
13799
  /**
13864
- * Result. structuredContent: V2GameState post-mutation delta (changed ship/cargo/location/queue sections); the command result is under `details` (FacilityResponse)
13800
+ * Result. structuredContent: V2GameState post-mutation delta (changed ship/cargo/location/queue sections); the command result is under `details` (FacilityDismantleResponse)
13865
13801
  */
13866
13802
  200: V2Response & {
13867
13803
  structuredContent?: V2GameState & {
13868
- details?: FacilityResponse;
13804
+ details?: FacilityDismantleResponse;
13869
13805
  };
13870
13806
  };
13871
13807
  };
@@ -13939,7 +13875,7 @@ export type SpacemoltFacilityFactionUpgradeData = {
13939
13875
  */
13940
13876
  bucket?: string;
13941
13877
  /**
13942
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
13878
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
13943
13879
  */
13944
13880
  facility_id: string;
13945
13881
  /**
@@ -14063,7 +13999,7 @@ export type SpacemoltFacilityJobAddData = {
14063
13999
  */
14064
14000
  direction?: 'forward' | 'reverse';
14065
14001
  /**
14066
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14002
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14067
14003
  */
14068
14004
  facility_id: string;
14069
14005
  /**
@@ -14170,7 +14106,7 @@ export type SpacemoltFacilityJobCancelResponse = SpacemoltFacilityJobCancelRespo
14170
14106
  export type SpacemoltFacilityJobListData = {
14171
14107
  body?: {
14172
14108
  /**
14173
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14109
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14174
14110
  */
14175
14111
  facility_id: string;
14176
14112
  };
@@ -14204,7 +14140,7 @@ export type SpacemoltFacilityJobListResponse = SpacemoltFacilityJobListResponses
14204
14140
  export type SpacemoltFacilityJobReorderData = {
14205
14141
  body?: {
14206
14142
  /**
14207
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14143
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14208
14144
  */
14209
14145
  facility_id: string;
14210
14146
  /**
@@ -14279,7 +14215,7 @@ export type SpacemoltFacilityListResponse = SpacemoltFacilityListResponses[keyof
14279
14215
  export type SpacemoltFacilityListForSaleData = {
14280
14216
  body?: {
14281
14217
  /**
14282
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14218
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14283
14219
  */
14284
14220
  facility_id: string;
14285
14221
  /**
@@ -14536,7 +14472,7 @@ export type SpacemoltFacilityRemovePlayerResponse = SpacemoltFacilityRemovePlaye
14536
14472
  export type SpacemoltFacilityRepairData = {
14537
14473
  body?: {
14538
14474
  /**
14539
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14475
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14540
14476
  */
14541
14477
  facility_id: string;
14542
14478
  };
@@ -14576,7 +14512,7 @@ export type SpacemoltFacilitySetAccessData = {
14576
14512
  */
14577
14513
  access: 'private' | 'public';
14578
14514
  /**
14579
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14515
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14580
14516
  */
14581
14517
  facility_id: string;
14582
14518
  };
@@ -14760,7 +14696,7 @@ export type SpacemoltFacilitySetNameData = {
14760
14696
  */
14761
14697
  custom_name?: string;
14762
14698
  /**
14763
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14699
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14764
14700
  */
14765
14701
  facility_id: string;
14766
14702
  };
@@ -14796,7 +14732,7 @@ export type SpacemoltFacilitySetNameResponse = SpacemoltFacilitySetNameResponses
14796
14732
  export type SpacemoltFacilitySetOutputPriceData = {
14797
14733
  body?: {
14798
14734
  /**
14799
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14735
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14800
14736
  */
14801
14737
  facility_id: string;
14802
14738
  /**
@@ -15053,7 +14989,7 @@ export type SpacemoltFacilityTransferData = {
15053
14989
  */
15054
14990
  direction: 'to_faction' | 'to_player';
15055
14991
  /**
15056
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
14992
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
15057
14993
  */
15058
14994
  facility_id: string;
15059
14995
  /**
@@ -15187,7 +15123,7 @@ export type SpacemoltFacilityUpgradeData = {
15187
15123
  */
15188
15124
  bucket?: string;
15189
15125
  /**
15190
- * Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
15126
+ * Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.
15191
15127
  */
15192
15128
  facility_id: string;
15193
15129
  /**
package/dist/index.d.ts CHANGED
@@ -20,8 +20,9 @@ export { MarketCache, type MarketBook, type MarketItem } from './state/market.js
20
20
  export { ObservationCache, type ObservationView, type ObservedPlayer, type CloakedContact, } from './state/observation.js';
21
21
  export { TypedEmitter, EventStream } from './events/emitter.js';
22
22
  export { type Commands, type CommandDispatch, buildCommands } from './generated/commands.gen.js';
23
- export { CatalogCache, fetchCatalog, fetchCatalogConditional, type Catalog, type CatalogEntry, type CatalogFetchResult, } from './data/catalog.js';
23
+ export { CatalogCache, fetchCatalog, fetchCatalogConditional, type Catalog, type CatalogFacility, type CatalogFetchResult, type CatalogItem, type CatalogRecipe, type CatalogShip, type CatalogSkill, } from './data/catalog.js';
24
24
  export { MapCache, fetchMap, httpBaseFromWs, type GalaxyMap, type MapSystem } from './data/map.js';
25
+ export { fetchStations, type StationEmpire, type StationList, type StationSummary } from './data/stations.js';
25
26
  export { Socket, type SocketOptions, type WebSocketLike, type WebSocketFactory, type MessageEventLike, type CloseEventLike, } from './transport/socket.js';
26
27
  export { ACTIONS, GENERATED_SPEC_VERSION } from './generated/actions.gen.js';
27
28
  export type { ToolName, ActionName, ActionDef, ActionParam } from './generated/actions.gen.js';
package/dist/index.js CHANGED
@@ -44,7 +44,7 @@ var STATE_SECTIONS = [
44
44
  "skills"
45
45
  ];
46
46
  // src/generated/actions.gen.ts
47
- var GENERATED_SPEC_VERSION = "v0.512.0";
47
+ var GENERATED_SPEC_VERSION = "v0.516.0";
48
48
  var ACTIONS = {
49
49
  "spacemolt_auth/claim": {
50
50
  tool: "spacemolt_auth",
@@ -405,24 +405,14 @@ var ACTIONS = {
405
405
  { name: "name", type: "string", required: true, description: "Name for the new faction outpost" }
406
406
  ]
407
407
  },
408
- "spacemolt_facility/disassemble": {
409
- tool: "spacemolt_facility",
410
- action: "disassemble",
411
- kind: "mutation",
412
- summary: "Manage facilities at stations (production, faction, personal, sales, and more)",
413
- detailsType: "FacilityResponse",
414
- params: [
415
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
416
- ]
417
- },
418
408
  "spacemolt_facility/dismantle": {
419
409
  tool: "spacemolt_facility",
420
410
  action: "dismantle",
421
411
  kind: "mutation",
422
412
  summary: "Manage facilities at stations (production, faction, personal, sales, and more)",
423
- detailsType: "FacilityResponse",
413
+ detailsType: "FacilityDismantleResponse",
424
414
  params: [
425
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
415
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
426
416
  ]
427
417
  },
428
418
  "spacemolt_facility/facility_set_description": {
@@ -433,7 +423,7 @@ var ACTIONS = {
433
423
  responseType: "FacilityResponse",
434
424
  params: [
435
425
  { name: "description", type: "string", required: false, description: "For 'personal_decorate': a text description of your personal quarters (what visitors see, hear, and feel). For 'set_description': a custom description (max 4000 chars) for any facility you own, overriding its default flavor text — e.g. re-flavoring your faction's bar. Send empty to clear it." },
436
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
426
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
437
427
  ]
438
428
  },
439
429
  "spacemolt_facility/faction_build": {
@@ -447,24 +437,14 @@ var ACTIONS = {
447
437
  { name: "facility_type", type: "string", required: true, description: "Facility type ID. For 'types' action: get full details for this specific type. For 'build'/'upgrade': the type to build/upgrade to.", positional: 0 }
448
438
  ]
449
439
  },
450
- "spacemolt_facility/faction_disassemble": {
451
- tool: "spacemolt_facility",
452
- action: "faction_disassemble",
453
- kind: "mutation",
454
- summary: "Manage facilities at stations (production, faction, personal, sales, and more)",
455
- detailsType: "FacilityResponse",
456
- params: [
457
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
458
- ]
459
- },
460
440
  "spacemolt_facility/faction_dismantle": {
461
441
  tool: "spacemolt_facility",
462
442
  action: "faction_dismantle",
463
443
  kind: "mutation",
464
444
  summary: "Manage facilities at stations (production, faction, personal, sales, and more)",
465
- detailsType: "FacilityResponse",
445
+ detailsType: "FacilityDismantleResponse",
466
446
  params: [
467
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
447
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
468
448
  ]
469
449
  },
470
450
  "spacemolt_facility/faction_list": {
@@ -491,7 +471,7 @@ var ACTIONS = {
491
471
  detailsType: "FacilityResponse",
492
472
  params: [
493
473
  { name: "bucket", type: "string", required: false, description: "For 'faction_build'/'faction_upgrade': a Storage Extension bucket (name or id) to source build/upgrade MATERIALS from, instead of the faction main store. Ship cargo backfills either way." },
494
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
474
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
495
475
  { name: "facility_type", type: "string", required: true, description: "Facility type ID. For 'types' action: get full details for this specific type. For 'build'/'upgrade': the type to build/upgrade to.", positional: 0 }
496
476
  ]
497
477
  },
@@ -515,7 +495,7 @@ var ACTIONS = {
515
495
  params: [
516
496
  { name: "deliver_to", type: "string", required: false, description: "Output destination for 'job_add': 'storage' (default), 'faction' (faction main store), or 'faction:<bucket name or id>' for a Storage Extension bucket." },
517
497
  { name: "direction", type: '"forward" | "reverse"', required: false, description: "Job direction: 'forward' runs the recipe normally (craft); 'reverse' recycles existing items back to inputs.", enumValues: ["forward", "reverse"] },
518
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
498
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
519
499
  { name: "items", type: "{ item_id: string; quantity: number }[]", required: false, description: "For job_add pack_package: selected manifest items." },
520
500
  { name: "label", type: "string", required: false, description: "For job_add pack_package: player label." },
521
501
  { name: "package_id", type: "string", required: false, description: "For job_add unpack_package: package ID." },
@@ -543,7 +523,7 @@ var ACTIONS = {
543
523
  summary: "Manage facilities at stations (production, faction, personal, sales, and more)",
544
524
  responseType: "FacilityResponse",
545
525
  params: [
546
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
526
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
547
527
  ]
548
528
  },
549
529
  "spacemolt_facility/job_reorder": {
@@ -553,7 +533,7 @@ var ACTIONS = {
553
533
  summary: "Manage facilities at stations (production, faction, personal, sales, and more)",
554
534
  detailsType: "FacilityResponse",
555
535
  params: [
556
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
536
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
557
537
  { name: "job_id", type: "string", required: true, description: "Job ID (for 'job_cancel', 'job_reorder'). Use action 'job_list' to see job IDs." },
558
538
  { name: "position", type: "number", required: false, description: "New queue position for 'job_reorder' (1-based)." }
559
539
  ]
@@ -573,7 +553,7 @@ var ACTIONS = {
573
553
  summary: "Manage facilities at stations (production, faction, personal, sales, and more)",
574
554
  detailsType: "FacilityResponse",
575
555
  params: [
576
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
556
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
577
557
  { name: "faction", type: "boolean", required: false, description: "For 'list_for_sale': set true to list a faction-owned facility (requires manage_facilities permission)." },
578
558
  { name: "price", type: "number", required: true, description: "For 'list_for_sale': asking price in whole credits. For 'set_output_price': per-produced-unit rental price on ordinary production, or a once-per-package-operation price on Logistics. May be fractional; used literally, so 0 rents for free and negative is rejected." }
579
559
  ]
@@ -644,7 +624,7 @@ var ACTIONS = {
644
624
  summary: "Manage facilities at stations (production, faction, personal, sales, and more)",
645
625
  detailsType: "FacilityResponse",
646
626
  params: [
647
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
627
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
648
628
  ]
649
629
  },
650
630
  "spacemolt_facility/set_access": {
@@ -655,7 +635,7 @@ var ACTIONS = {
655
635
  detailsType: "FacilityResponse",
656
636
  params: [
657
637
  { name: "access", type: '"private" | "public"', required: true, description: "For 'personal_decorate': who can visit your quarters. For 'set_access': 'public' opens your facility to renters, 'private' closes it.", enumValues: ["private", "public"] },
658
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
638
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
659
639
  ]
660
640
  },
661
641
  "spacemolt_facility/set_auto_buy_fuel": {
@@ -706,7 +686,7 @@ var ACTIONS = {
706
686
  detailsType: "FacilityResponse",
707
687
  params: [
708
688
  { name: "custom_name", type: "string", required: false, description: "For 'set_name': a custom name for the facility (3-32 chars) so multiple facilities of the same type stand out. Send empty to clear it." },
709
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
689
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 }
710
690
  ]
711
691
  },
712
692
  "spacemolt_facility/set_output_price": {
@@ -716,7 +696,7 @@ var ACTIONS = {
716
696
  summary: "Manage facilities at stations (production, faction, personal, sales, and more)",
717
697
  detailsType: "FacilityResponse",
718
698
  params: [
719
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
699
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
720
700
  { name: "price", type: "number", required: false, description: "For 'list_for_sale': asking price in whole credits. For 'set_output_price': per-produced-unit rental price on ordinary production, or a once-per-package-operation price on Logistics. May be fractional; used literally, so 0 rents for free and negative is rejected." }
721
701
  ]
722
702
  },
@@ -787,7 +767,7 @@ var ACTIONS = {
787
767
  detailsType: "FacilityResponse",
788
768
  params: [
789
769
  { name: "direction", type: '"to_faction" | "to_player"', required: true, description: "Transfer direction: 'to_faction' moves the facility to faction ownership; 'to_player' transfers it to a specific player.", enumValues: ["to_faction", "to_player"] },
790
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
770
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
791
771
  { name: "player_id", type: "string", required: false, description: "Target player ID for 'transfer' action with direction 'to_player'." }
792
772
  ]
793
773
  },
@@ -824,7 +804,7 @@ var ACTIONS = {
824
804
  detailsType: "FacilityResponse",
825
805
  params: [
826
806
  { name: "bucket", type: "string", required: false, description: "For 'faction_build'/'faction_upgrade': a Storage Extension bucket (name or id) to source build/upgrade MATERIALS from, instead of the faction main store. Ship cargo backfills either way." },
827
- { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'disassemble', 'faction_dismantle', 'faction_disassemble', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
807
+ { name: "facility_id", type: "string", required: true, description: "Facility instance ID (required for 'upgrade', 'dismantle', 'faction_dismantle', 'job_add', 'job_list', 'set_output_price', 'set_access', 'set_name', 'set_description' actions). Use action 'list' to see facility IDs.", positional: 1 },
828
808
  { name: "facility_type", type: "string", required: true, description: "Facility type ID. For 'types' action: get full details for this specific type. For 'build'/'upgrade': the type to build/upgrade to.", positional: 0 }
829
809
  ]
830
810
  },
@@ -2916,11 +2896,9 @@ function buildCommands(dispatch) {
2916
2896
  buy_ship_license: bind("spacemolt_facility", "buy_ship_license"),
2917
2897
  cancel_listing: bind("spacemolt_facility", "cancel_listing"),
2918
2898
  deploy_outpost: bind("spacemolt_facility", "deploy_outpost"),
2919
- disassemble: bind("spacemolt_facility", "disassemble"),
2920
2899
  dismantle: bind("spacemolt_facility", "dismantle"),
2921
2900
  facility_set_description: bind("spacemolt_facility", "facility_set_description"),
2922
2901
  faction_build: bind("spacemolt_facility", "faction_build"),
2923
- faction_disassemble: bind("spacemolt_facility", "faction_disassemble"),
2924
2902
  faction_dismantle: bind("spacemolt_facility", "faction_dismantle"),
2925
2903
  faction_list: bind("spacemolt_facility", "faction_list"),
2926
2904
  faction_owned: bind("spacemolt_facility", "faction_owned"),
@@ -4411,7 +4389,7 @@ class MemoryCredentialStore {
4411
4389
 
4412
4390
  // src/data/catalog.ts
4413
4391
  function catalogEntries(value) {
4414
- return Array.isArray(value) ? value.filter((entry) => isRecord(entry)) : [];
4392
+ return Array.isArray(value) ? value.filter(isRecord) : [];
4415
4393
  }
4416
4394
  function normalizeCatalog(value) {
4417
4395
  const data = requireRecord(value, "catalog response");
@@ -4451,17 +4429,19 @@ async function fetchCatalog(httpBaseUrl) {
4451
4429
  class CatalogCache {
4452
4430
  catalog;
4453
4431
  etag;
4454
- indexes;
4432
+ shipsById;
4433
+ itemsById;
4434
+ recipesById;
4435
+ skillsById;
4436
+ facilitiesById;
4455
4437
  constructor(catalog, etag) {
4456
4438
  this.catalog = catalog;
4457
4439
  this.etag = etag;
4458
- this.indexes = {
4459
- ships: index(catalog.ships),
4460
- items: index(catalog.items),
4461
- recipes: index(catalog.recipes),
4462
- skills: index(catalog.skills),
4463
- facilities: index(catalog.facilities)
4464
- };
4440
+ this.shipsById = index(catalog.ships);
4441
+ this.itemsById = index(catalog.items);
4442
+ this.recipesById = index(catalog.recipes);
4443
+ this.skillsById = index(catalog.skills);
4444
+ this.facilitiesById = index(catalog.facilities);
4465
4445
  }
4466
4446
  static async load(httpBaseUrl) {
4467
4447
  const { catalog, etag } = await fetchCatalogConditional(httpBaseUrl);
@@ -4481,19 +4461,19 @@ class CatalogCache {
4481
4461
  return this.catalog.version;
4482
4462
  }
4483
4463
  ship(id) {
4484
- return this.indexes.ships.get(id);
4464
+ return this.shipsById.get(id);
4485
4465
  }
4486
4466
  item(id) {
4487
- return this.indexes.items.get(id);
4467
+ return this.itemsById.get(id);
4488
4468
  }
4489
4469
  recipe(id) {
4490
- return this.indexes.recipes.get(id);
4470
+ return this.recipesById.get(id);
4491
4471
  }
4492
4472
  skill(id) {
4493
- return this.indexes.skills.get(id);
4473
+ return this.skillsById.get(id);
4494
4474
  }
4495
4475
  facility(id) {
4496
- return this.indexes.facilities.get(id);
4476
+ return this.facilitiesById.get(id);
4497
4477
  }
4498
4478
  get ships() {
4499
4479
  return this.catalog.ships;
@@ -4514,7 +4494,7 @@ class CatalogCache {
4514
4494
  function index(entries) {
4515
4495
  const map = new Map;
4516
4496
  for (const entry of entries) {
4517
- const id = typeof entry.id === "string" ? entry.id : undefined;
4497
+ const id = isRecord(entry) && typeof entry.id === "string" ? entry.id : undefined;
4518
4498
  if (id)
4519
4499
  map.set(id, entry);
4520
4500
  }
@@ -4862,6 +4842,17 @@ class SpacemoltClient {
4862
4842
  }
4863
4843
  }
4864
4844
  }
4845
+ // src/data/stations.ts
4846
+ async function fetchStations(httpBaseUrl) {
4847
+ const url = `${httpBaseUrl.replace(/\/$/, "")}/api/stations`;
4848
+ const res = await fetch(url, { headers: { accept: "application/json" } });
4849
+ if (!res.ok)
4850
+ throw new Error(`GET ${url} -> ${res.status} ${res.statusText}`);
4851
+ const data = requireRecord(await res.json(), "stations response");
4852
+ const stations = Array.isArray(data.stations) ? data.stations.filter(isRecord) : [];
4853
+ const empires = Array.isArray(data.empires) ? data.empires.filter((empire) => isRecord(empire) && typeof empire.id === "string" && typeof empire.name === "string") : [];
4854
+ return { stations, empires };
4855
+ }
4865
4856
  // src/generated/notifications.gen.ts
4866
4857
  var TYPED_NOTIFICATION_TYPES = [
4867
4858
  "achievement_unlocked",
@@ -4910,6 +4901,7 @@ export {
4910
4901
  isActionResultFrame,
4911
4902
  isActionErrorFrame,
4912
4903
  httpBaseFromWs,
4904
+ fetchStations,
4913
4905
  fetchMap,
4914
4906
  fetchCatalogConditional,
4915
4907
  fetchCatalog,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spacemolt/lib",
3
- "version": "8.0.0",
3
+ "version": "10.0.0",
4
4
  "description": "The definitive TypeScript library for SpaceMolt. WebSocket-v2-first, multi-account, with local state caches. Internals are regenerated from the server's OpenAPI spec.",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",