@spacemolt/lib 15.0.0 → 15.1.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.609.4`). **296 commands across 19 tools.**
4
+ Every command in `@spacemolt/lib`, generated from the live server spec (`v0.612.0`). **296 commands across 19 tools.**
5
5
 
6
6
  ## How to call a command
7
7
 
package/dist/account.d.ts CHANGED
@@ -15,7 +15,7 @@ import type { AuthCredentials } from './auth/credentials.js';
15
15
  import type { LoggedInPayload as LoggedInPayloadSchema, SubscribeMarketResponse, SubscribeObservationResponse } from './generated/openapi/types.gen.js';
16
16
  import type { NotificationPayloads, TypedNotificationType } from './generated/notifications.gen.js';
17
17
  import type { FleetPush, OkPush } from './push-frames.js';
18
- import { type ConnectionClosedError } from './errors.js';
18
+ import { ConnectionClosedError } from './errors.js';
19
19
  import { type MarketBook } from './state/market.js';
20
20
  import { type ObservationView } from './state/observation.js';
21
21
  import type { GameState, MutationAck, MutationResult, QueryResult, RawFrame, StateSection, WelcomeFrame } from './protocol.js';
@@ -1,5 +1,5 @@
1
1
  /** The gameserver spec version this command surface was generated from. */
2
- export declare const GENERATED_SPEC_VERSION = "v0.609.4";
2
+ export declare const GENERATED_SPEC_VERSION = "v0.612.0";
3
3
  export type ToolName = "spacemolt" | "spacemolt_arena" | "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
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" | "challenge" | "challenges" | "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" | "fight" | "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 {
@@ -1,6 +1,6 @@
1
- import type { NotificationAchievementUnlocked, NotificationActionError, NotificationActionResult, NotificationArenaChallenge, NotificationArenaObjective, NotificationBaseDestroyed, NotificationBaseRaidUpdate, NotificationBattleAlert, NotificationBattleDamage, NotificationBattleEnded, NotificationBattleJoined, NotificationBattleLeft, NotificationBattleStarted, NotificationBattleUpdate, NotificationChatMessage, NotificationCloak, NotificationCompleteMission, NotificationCraftingUpdate, NotificationDroneAdrift, NotificationDroneDestroyed, NotificationDroneScan, NotificationDroneSurvey, NotificationDroneUpdate, NotificationError, NotificationFacilityReclaimed, NotificationFacilityRentWarning, NotificationFactionAllianceBroken, NotificationFactionAllianceFormed, NotificationFactionAllianceProposal, NotificationFactionPeaceAccepted, NotificationFactionPeaceProposal, NotificationFactionWarDeclared, NotificationFleet, NotificationMarketUpdate, NotificationMiningYield, NotificationObservationUpdate, NotificationOk, NotificationPersonnelUpdate, NotificationPilotlessShip, NotificationPirateDestroyed, NotificationPirateRadio, NotificationPlayerDied, NotificationPlayerKill, NotificationPrizeUpdate, NotificationRanchPoached, NotificationReconnected, NotificationRefueledBy, NotificationRepairedBy, NotificationScanDetected, NotificationServerRestartWarning, NotificationShipCaptured, NotificationShipCommissionComplete, NotificationSkillLevelUp, NotificationStationRepaired, NotificationTradeCancelled, NotificationTradeComplete, NotificationTradeDeclined, NotificationTradeOfferReceived } from './openapi/types.gen.js';
1
+ import type { NotificationAchievementUnlocked, NotificationActionError, NotificationActionResult, NotificationArenaChallenge, NotificationArenaObjective, NotificationBaseDestroyed, NotificationBaseRaidUpdate, NotificationBattleAlert, NotificationBattleDamage, NotificationBattleEnded, NotificationBattleJoined, NotificationBattleLeft, NotificationBattleStarted, NotificationBattleUpdate, NotificationChatMessage, NotificationCloak, NotificationCompleteMission, NotificationCraftingUpdate, NotificationDroneAdrift, NotificationDroneDestroyed, NotificationDroneScan, NotificationDroneSurvey, NotificationDroneUpdate, NotificationError, NotificationFacilityReclaimed, NotificationFacilityRentWarning, NotificationFactionAllianceBroken, NotificationFactionAllianceFormed, NotificationFactionAllianceProposal, NotificationFactionPeaceAccepted, NotificationFactionPeaceProposal, NotificationFactionWarDeclared, NotificationFleet, NotificationGiftReceived, NotificationMarketUpdate, NotificationMiningYield, NotificationObservationUpdate, NotificationOk, NotificationPersonnelUpdate, NotificationPilotlessShip, NotificationPirateDestroyed, NotificationPirateRadio, NotificationPlayerDied, NotificationPlayerKill, NotificationPrizeUpdate, NotificationRanchPoached, NotificationReconnected, NotificationRefueledBy, NotificationRepairedBy, NotificationScanDetected, NotificationServerRestartWarning, NotificationShipCaptured, NotificationShipCommissionComplete, NotificationSkillLevelUp, NotificationStationRepaired, NotificationTradeCancelled, NotificationTradeComplete, NotificationTradeDeclined, NotificationTradeOfferReceived } from './openapi/types.gen.js';
2
2
  /** msg_type values that have a published payload schema. */
3
- export type TypedNotificationType = "achievement_unlocked" | "action_error" | "action_result" | "arena_challenge" | "arena_objective" | "base_destroyed" | "base_raid_update" | "battle_alert" | "battle_damage" | "battle_ended" | "battle_joined" | "battle_left" | "battle_started" | "battle_update" | "chat_message" | "cloak" | "complete_mission" | "crafting_update" | "drone_adrift" | "drone_destroyed" | "drone_scan" | "drone_survey" | "drone_update" | "error" | "facility_reclaimed" | "facility_rent_warning" | "faction_alliance_broken" | "faction_alliance_formed" | "faction_alliance_proposal" | "faction_peace_accepted" | "faction_peace_proposal" | "faction_war_declared" | "fleet" | "market_update" | "mining_yield" | "observation_update" | "ok" | "personnel_update" | "pilotless_ship" | "pirate_destroyed" | "pirate_radio" | "player_died" | "player_kill" | "prize_update" | "ranch_poached" | "reconnected" | "refueled_by" | "repaired_by" | "scan_detected" | "server_restart_warning" | "ship_captured" | "ship_commission_complete" | "skill_level_up" | "station_repaired" | "trade_cancelled" | "trade_complete" | "trade_declined" | "trade_offer_received";
3
+ export type TypedNotificationType = "achievement_unlocked" | "action_error" | "action_result" | "arena_challenge" | "arena_objective" | "base_destroyed" | "base_raid_update" | "battle_alert" | "battle_damage" | "battle_ended" | "battle_joined" | "battle_left" | "battle_started" | "battle_update" | "chat_message" | "cloak" | "complete_mission" | "crafting_update" | "drone_adrift" | "drone_destroyed" | "drone_scan" | "drone_survey" | "drone_update" | "error" | "facility_reclaimed" | "facility_rent_warning" | "faction_alliance_broken" | "faction_alliance_formed" | "faction_alliance_proposal" | "faction_peace_accepted" | "faction_peace_proposal" | "faction_war_declared" | "fleet" | "gift_received" | "market_update" | "mining_yield" | "observation_update" | "ok" | "personnel_update" | "pilotless_ship" | "pirate_destroyed" | "pirate_radio" | "player_died" | "player_kill" | "prize_update" | "ranch_poached" | "reconnected" | "refueled_by" | "repaired_by" | "scan_detected" | "server_restart_warning" | "ship_captured" | "ship_commission_complete" | "skill_level_up" | "station_repaired" | "trade_cancelled" | "trade_complete" | "trade_declined" | "trade_offer_received";
4
4
  /** Maps a typed push msg_type to its payload type. */
5
5
  export interface NotificationPayloads {
6
6
  "achievement_unlocked": NotificationAchievementUnlocked;
@@ -36,6 +36,7 @@ export interface NotificationPayloads {
36
36
  "faction_peace_proposal": NotificationFactionPeaceProposal;
37
37
  "faction_war_declared": NotificationFactionWarDeclared;
38
38
  "fleet": NotificationFleet;
39
+ "gift_received": NotificationGiftReceived;
39
40
  "market_update": NotificationMarketUpdate;
40
41
  "mining_yield": NotificationMiningYield;
41
42
  "observation_update": NotificationObservationUpdate;
@@ -63,4 +64,4 @@ export interface NotificationPayloads {
63
64
  "trade_offer_received": NotificationTradeOfferReceived;
64
65
  }
65
66
  /** Names of every push msg_type with a published schema, for runtime checks. */
66
- export declare const TYPED_NOTIFICATION_TYPES: readonly ["achievement_unlocked", "action_error", "action_result", "arena_challenge", "arena_objective", "base_destroyed", "base_raid_update", "battle_alert", "battle_damage", "battle_ended", "battle_joined", "battle_left", "battle_started", "battle_update", "chat_message", "cloak", "complete_mission", "crafting_update", "drone_adrift", "drone_destroyed", "drone_scan", "drone_survey", "drone_update", "error", "facility_reclaimed", "facility_rent_warning", "faction_alliance_broken", "faction_alliance_formed", "faction_alliance_proposal", "faction_peace_accepted", "faction_peace_proposal", "faction_war_declared", "fleet", "market_update", "mining_yield", "observation_update", "ok", "personnel_update", "pilotless_ship", "pirate_destroyed", "pirate_radio", "player_died", "player_kill", "prize_update", "ranch_poached", "reconnected", "refueled_by", "repaired_by", "scan_detected", "server_restart_warning", "ship_captured", "ship_commission_complete", "skill_level_up", "station_repaired", "trade_cancelled", "trade_complete", "trade_declined", "trade_offer_received"];
67
+ export declare const TYPED_NOTIFICATION_TYPES: readonly ["achievement_unlocked", "action_error", "action_result", "arena_challenge", "arena_objective", "base_destroyed", "base_raid_update", "battle_alert", "battle_damage", "battle_ended", "battle_joined", "battle_left", "battle_started", "battle_update", "chat_message", "cloak", "complete_mission", "crafting_update", "drone_adrift", "drone_destroyed", "drone_scan", "drone_survey", "drone_update", "error", "facility_reclaimed", "facility_rent_warning", "faction_alliance_broken", "faction_alliance_formed", "faction_alliance_proposal", "faction_peace_accepted", "faction_peace_proposal", "faction_war_declared", "fleet", "gift_received", "market_update", "mining_yield", "observation_update", "ok", "personnel_update", "pilotless_ship", "pirate_destroyed", "pirate_radio", "player_died", "player_kill", "prize_update", "ranch_poached", "reconnected", "refueled_by", "repaired_by", "scan_detected", "server_restart_warning", "ship_captured", "ship_commission_complete", "skill_level_up", "station_repaired", "trade_cancelled", "trade_complete", "trade_declined", "trade_offer_received"];
@@ -5628,7 +5628,7 @@ export type McpNotification = {
5628
5628
  data: NotificationPayload;
5629
5629
  id: string;
5630
5630
  /**
5631
- * Specific frame subtype. Switch on this to pick the matching Notification_<msg_type> payload schema. Routing to the coarse type field: chat_message -> chat. player_died / player_kill / scan_detected / pilotless_ship / drone_update / drone_destroyed / battle_started / battle_update / battle_joined / battle_left / battle_ended / battle_alert / ship_captured / prize_update -> combat. trade_offer_received / trade_complete / trade_declined / trade_cancelled -> trade. market_update -> market. crafting_update -> crafting. observation_update -> observation. personnel_update -> system. Frames not named here also route to system - that includes battle_damage / drone_scan / drone_survey / drone_adrift / action_result / action_error / error / server_restart_warning. A types=combat filter does not carry them.
5631
+ * Specific frame subtype. Switch on this to pick the matching Notification_<msg_type> payload schema. Routing to the coarse type field: chat_message -> chat. player_died / player_kill / scan_detected / pilotless_ship / drone_update / drone_destroyed / battle_started / battle_update / battle_joined / battle_left / battle_ended / battle_alert / ship_captured / prize_update -> combat. trade_offer_received / trade_complete / trade_declined / trade_cancelled / gift_received -> trade. market_update -> market. crafting_update -> crafting. observation_update -> observation. personnel_update -> system. Frames not named here also route to system - that includes battle_damage / drone_scan / drone_survey / drone_adrift / action_result / action_error / error / server_restart_warning. A types=combat filter does not carry them.
5632
5632
  */
5633
5633
  msg_type: string;
5634
5634
  timestamp: string;
@@ -6076,7 +6076,7 @@ export type NotificationChannelInfo = {
6076
6076
  /**
6077
6077
  * Frame payload shared by polling and inline notifications. Select Notification_<msg_type> using the envelope msg_type; payload shapes can overlap so this is an anyOf union. Null means the frame supplied no payload.
6078
6078
  */
6079
- export type NotificationPayload = NotificationAchievementUnlocked | NotificationActionError | NotificationActionResult | NotificationArenaChallenge | NotificationArenaObjective | NotificationBaseDestroyed | NotificationBaseRaidUpdate | NotificationBattleAlert | NotificationBattleDamage | NotificationBattleEnded | NotificationBattleJoined | NotificationBattleLeft | NotificationBattleStarted | NotificationBattleUpdate | NotificationChatMessage | NotificationCloak | NotificationCompleteMission | NotificationCraftingUpdate | NotificationDroneAdrift | NotificationDroneDestroyed | NotificationDroneScan | NotificationDroneSurvey | NotificationDroneUpdate | NotificationError | NotificationFacilityReclaimed | NotificationFacilityRentWarning | NotificationFactionAllianceBroken | NotificationFactionAllianceFormed | NotificationFactionAllianceProposal | NotificationFactionPeaceAccepted | NotificationFactionPeaceProposal | NotificationFactionWarDeclared | NotificationFleet | NotificationMarketUpdate | NotificationMiningYield | NotificationObservationUpdate | NotificationOk | NotificationPersonnelUpdate | NotificationPilotlessShip | NotificationPirateDestroyed | NotificationPirateRadio | NotificationPlayerDied | NotificationPlayerKill | NotificationPrizeUpdate | NotificationRanchPoached | NotificationReconnected | NotificationRefueledBy | NotificationRepairedBy | NotificationScanDetected | NotificationServerRestartWarning | NotificationShipCaptured | NotificationShipCommissionComplete | NotificationSkillLevelUp | NotificationStationRepaired | NotificationTradeCancelled | NotificationTradeComplete | NotificationTradeDeclined | NotificationTradeOfferReceived | null;
6079
+ export type NotificationPayload = NotificationAchievementUnlocked | NotificationActionError | NotificationActionResult | NotificationArenaChallenge | NotificationArenaObjective | NotificationBaseDestroyed | NotificationBaseRaidUpdate | NotificationBattleAlert | NotificationBattleDamage | NotificationBattleEnded | NotificationBattleJoined | NotificationBattleLeft | NotificationBattleStarted | NotificationBattleUpdate | NotificationChatMessage | NotificationCloak | NotificationCompleteMission | NotificationCraftingUpdate | NotificationDroneAdrift | NotificationDroneDestroyed | NotificationDroneScan | NotificationDroneSurvey | NotificationDroneUpdate | NotificationError | NotificationFacilityReclaimed | NotificationFacilityRentWarning | NotificationFactionAllianceBroken | NotificationFactionAllianceFormed | NotificationFactionAllianceProposal | NotificationFactionPeaceAccepted | NotificationFactionPeaceProposal | NotificationFactionWarDeclared | NotificationFleet | NotificationGiftReceived | NotificationMarketUpdate | NotificationMiningYield | NotificationObservationUpdate | NotificationOk | NotificationPersonnelUpdate | NotificationPilotlessShip | NotificationPirateDestroyed | NotificationPirateRadio | NotificationPlayerDied | NotificationPlayerKill | NotificationPrizeUpdate | NotificationRanchPoached | NotificationReconnected | NotificationRefueledBy | NotificationRepairedBy | NotificationScanDetected | NotificationServerRestartWarning | NotificationShipCaptured | NotificationShipCommissionComplete | NotificationSkillLevelUp | NotificationStationRepaired | NotificationTradeCancelled | NotificationTradeComplete | NotificationTradeDeclined | NotificationTradeOfferReceived | null;
6080
6080
  export type NotificationSettingsResponse = {
6081
6081
  action: string;
6082
6082
  channels: Array<NotificationChannelInfo>;
@@ -6592,6 +6592,43 @@ export type NotificationFleet = {
6592
6592
  */
6593
6593
  player_name?: string;
6594
6594
  };
6595
+ /**
6596
+ * Another player's gift has just committed to you. Sent when send_gift delivers items, credits or a ship to you. A ship gift can land at a station other than the one you are docked at; base_id names it. Never mutable. It is the same entry that storage view and dock return in gifts[], plus base_id. That entry stays in storage as the durable copy, so a client that was offline still sees the gift there. items, ships and credits are each omitted when the gift did not include them. base_id is omitted on a credit-only gift.
6597
+ */
6598
+ export type NotificationGiftReceived = {
6599
+ /**
6600
+ * Station where the items or ships wait in your personal storage. Omitted on a credit-only gift: the credits are already in your wallet.
6601
+ */
6602
+ base_id?: string;
6603
+ /**
6604
+ * Credits added to your wallet (not to storage). Omitted when the gift carried no credits.
6605
+ */
6606
+ credits?: number;
6607
+ /**
6608
+ * Items deposited into your storage. Omitted when the gift carried no items.
6609
+ */
6610
+ items?: Array<StorageGiftItem>;
6611
+ /**
6612
+ * Sender's note. Omitted when empty.
6613
+ */
6614
+ message?: string;
6615
+ /**
6616
+ * Sender username.
6617
+ */
6618
+ sender: string;
6619
+ /**
6620
+ * Sender player ID.
6621
+ */
6622
+ sender_id: string;
6623
+ /**
6624
+ * Ships transferred to you. Omitted when the gift carried no ship.
6625
+ */
6626
+ ships?: Array<StorageGiftShip>;
6627
+ /**
6628
+ * When the gift was delivered.
6629
+ */
6630
+ timestamp: string;
6631
+ };
6595
6632
  export type NotificationMarketUpdate = {
6596
6633
  base_id: string;
6597
6634
  base_name?: string;
@@ -9002,6 +9039,9 @@ export type ShipmentContract = {
9002
9039
  breached_at?: string;
9003
9040
  carrier_payout?: number;
9004
9041
  claim_paid?: number;
9042
+ /**
9043
+ * Player or faction carrier that accepted the contract. Absent while the listing is still posted and on a listing canceled or expired before anyone accepted it.
9044
+ */
9005
9045
  contractor?: ShipmentActor;
9006
9046
  covered_value?: number;
9007
9047
  deadline_tick?: number;
@@ -9010,7 +9050,13 @@ export type ShipmentContract = {
9010
9050
  failure_debt: number;
9011
9051
  id: string;
9012
9052
  insurable: boolean;
9053
+ /**
9054
+ * Station that insures the cargo: the origin station. It keeps the premium and pays any claim. Absent when the shipment is uninsured.
9055
+ */
9013
9056
  insurer?: ShipmentActor;
9057
+ /**
9058
+ * The only player or faction carrier allowed to see and accept this listing. Present only when visibility is invited; absent for public, faction and allies listings.
9059
+ */
9014
9060
  invited_carrier?: ShipmentActor;
9015
9061
  latest_beacon_at?: string;
9016
9062
  latest_beacon_fingerprint?: string;
@@ -9028,6 +9074,9 @@ export type ShipmentContract = {
9028
9074
  reward_escrow: number;
9029
9075
  risk_band: 'probationary' | 'licensed' | 'trusted' | 'prime' | 'unpriced';
9030
9076
  route_hops?: number;
9077
+ /**
9078
+ * Salvage claimant recorded for the package: the insurer station, set when an insured contract posts. No current game action reads it. Absent when the shipment is uninsured.
9079
+ */
9031
9080
  salvage_owner?: ShipmentActor;
9032
9081
  service_fee: number;
9033
9082
  service_level: 'standard' | 'priority';
@@ -9044,6 +9093,9 @@ export type ShipmentContract = {
9044
9093
  export type ShipmentTrackingEvent = {
9045
9094
  base_id?: string;
9046
9095
  class: 'shipping_house_escrow' | 'ship' | 'player_storage' | 'faction_storage' | 'faction_bucket' | 'wreck' | 'unpack_job_escrow' | 'destroyed' | 'unknown';
9096
+ /**
9097
+ * Who held the package at this sample: the storage owner, the owner of the carrying ship, or the recipient or shipper at hand-over or return. Absent when the location names no holder (shipping-house escrow, a wreck or an unknown location).
9098
+ */
9047
9099
  custodian?: ShipmentActor;
9048
9100
  fingerprint: string;
9049
9101
  id: string;
@@ -9133,6 +9185,9 @@ export type ShippingQuote = {
9133
9185
  failure_debt: number;
9134
9186
  insurable: boolean;
9135
9187
  insurance_selected: boolean;
9188
+ /**
9189
+ * The only player or faction carrier allowed to see and accept this listing. Present only when visibility is invited; absent for public, faction and allies listings.
9190
+ */
9136
9191
  invited_carrier?: ShipmentActor;
9137
9192
  max_speed_bonus: number;
9138
9193
  origin_base_id: string;
@@ -9174,12 +9229,29 @@ export type ShippingResponse = ({
9174
9229
  action: 'cancel' | 'deliver' | 'return';
9175
9230
  } & ShippingSettlementResponse);
9176
9231
  export type ShippingSettlementResponse = {
9232
+ /**
9233
+ * Which shipping action settled the contract: deliver (the carrier handed the package over at the destination station), return (the carrier surrendered it at the origin station) or cancel (the shipper withdrew a posting no carrier had accepted).
9234
+ */
9177
9235
  action: 'deliver' | 'return' | 'cancel';
9236
+ /**
9237
+ * Credits paid to the carrier (the contractor) for an on-time deliver: base_reward plus the speed bonus earned at the delivery tick. The bonus is the full max_speed_bonus at or before target_tick and decays linearly (rounded down) to 0 at deadline_tick. Same value as contract.carrier_payout. Omitted (0) for a late deliver, for return and for cancel.
9238
+ */
9178
9239
  carrier_payout?: number;
9179
- claim_paid?: number;
9240
+ /**
9241
+ * The contract after settlement. status is delivered, returned or canceled and reward_escrow and speed_bonus_escrow are now 0; after cancel premium is also 0 because it was refunded. The sealed manifest (appraisal_lines) is always omitted.
9242
+ */
9180
9243
  contract: ShipmentContract;
9244
+ /**
9245
+ * Late fee in credits now owed by the carrier as freight debt to the insurer station (or to the shipping house station when the contract is uninsured). Only a late deliver or a late return creates it: 10% of (base_reward plus max_speed_bonus) with a minimum of 100 and a maximum of 2500 and never more than half of the contract's failure_debt. Omitted when 0: always for an on-time settlement and for cancel.
9246
+ */
9181
9247
  debt_created?: number;
9248
+ /**
9249
+ * True when the deliver or return happened after deadline_tick but inside the recovery window: the reward goes back to the shipper and the carrier owes the late fee in debt_created. Omitted (false) when on time and for cancel.
9250
+ */
9182
9251
  late?: boolean;
9252
+ /**
9253
+ * Credits returned to the shipper from escrow. On-time deliver: the unearned part of the speed bonus (max_speed_bonus minus the bonus paid). Late deliver and return: base_reward plus max_speed_bonus. Cancel: base_reward plus max_speed_bonus plus the insurance premium; the service_fee is not refunded. On deliver and return the insurer station keeps the premium. Omitted when 0.
9254
+ */
9183
9255
  shipper_refund?: number;
9184
9256
  };
9185
9257
  export type ShippingTrackResponse = {
@@ -9473,23 +9545,65 @@ export type StationServicePools = {
9473
9545
  personnel?: StationServicePoolStatus;
9474
9546
  };
9475
9547
  export type StorageGift = {
9548
+ /**
9549
+ * Credits added to your wallet (not to storage). Omitted when the gift carried no credits.
9550
+ */
9476
9551
  credits?: number;
9552
+ /**
9553
+ * Items deposited into your storage. Omitted when the gift carried no items.
9554
+ */
9477
9555
  items?: Array<StorageGiftItem>;
9556
+ /**
9557
+ * Sender's note. Omitted when empty.
9558
+ */
9478
9559
  message?: string;
9560
+ /**
9561
+ * Sender username.
9562
+ */
9479
9563
  sender: string;
9564
+ /**
9565
+ * Sender player ID.
9566
+ */
9480
9567
  sender_id: string;
9568
+ /**
9569
+ * Ships transferred to you. Omitted when the gift carried no ship.
9570
+ */
9481
9571
  ships?: Array<StorageGiftShip>;
9572
+ /**
9573
+ * When the gift was delivered.
9574
+ */
9482
9575
  timestamp: string;
9483
9576
  };
9484
9577
  export type StorageGiftItem = {
9578
+ /**
9579
+ * Item ID now in your storage at the gift's station.
9580
+ */
9485
9581
  item_id: string;
9582
+ /**
9583
+ * Item display name.
9584
+ */
9486
9585
  name: string;
9586
+ /**
9587
+ * Units received.
9588
+ */
9487
9589
  quantity: number;
9488
9590
  };
9489
9591
  export type StorageGiftShip = {
9592
+ /**
9593
+ * Ship class ID.
9594
+ */
9490
9595
  class_id: string;
9596
+ /**
9597
+ * Ship class display name. Empty when the class no longer resolves.
9598
+ */
9491
9599
  class_name: string;
9600
+ /**
9601
+ * Name the sender gave the ship with rename_ship; omitted when it has none.
9602
+ */
9492
9603
  custom_name?: string;
9604
+ /**
9605
+ * Ship you now own. It is parked at the gift's station; use switch_ship there to fly it.
9606
+ */
9493
9607
  ship_id: string;
9494
9608
  };
9495
9609
  export type StorageLocation = {
package/dist/index.js CHANGED
@@ -78,7 +78,7 @@ var STATE_SECTIONS = [
78
78
  "prize_recoveries"
79
79
  ];
80
80
  // src/generated/actions.gen.ts
81
- var GENERATED_SPEC_VERSION = "v0.609.4";
81
+ var GENERATED_SPEC_VERSION = "v0.612.0";
82
82
  var ACTIONS = {
83
83
  "spacemolt_arena/accept": {
84
84
  tool: "spacemolt_arena",
@@ -4308,9 +4308,16 @@ class Account {
4308
4308
  });
4309
4309
  }
4310
4310
  makeSocket() {
4311
- this.socket = new Socket({ url: this.url, webSocketFactory: this.webSocketFactory });
4312
- this.socket.onFrame = (frame) => this.routeFrame(frame);
4313
- this.socket.onClose = (err) => this.handleClose(err);
4311
+ const socket = new Socket({ url: this.url, webSocketFactory: this.webSocketFactory });
4312
+ socket.onFrame = (frame) => {
4313
+ if (this.socket === socket)
4314
+ this.routeFrame(frame);
4315
+ };
4316
+ socket.onClose = (err) => {
4317
+ if (this.socket === socket)
4318
+ this.handleClose(err);
4319
+ };
4320
+ this.socket = socket;
4314
4321
  }
4315
4322
  get state() {
4316
4323
  return this.cache.snapshot();
@@ -4451,8 +4458,11 @@ class Account {
4451
4458
  }
4452
4459
  }
4453
4460
  async refresh() {
4461
+ const revision = this.stateRevision;
4454
4462
  const result = await this.commands.spacemolt.get_status();
4455
4463
  const snapshot = requireStructuredContent(result, "spacemolt/get_status");
4464
+ if (revision !== this.stateRevision)
4465
+ return this.cache.snapshot();
4456
4466
  const changed = this.cache.seed(snapshot);
4457
4467
  if (changed.length)
4458
4468
  this.stateRevision++;
@@ -4983,10 +4993,19 @@ class Account {
4983
4993
  async reconnectOnce() {
4984
4994
  if (!this.credentialsProvider)
4985
4995
  throw new Error("reconnectOnce requires credentials");
4996
+ const stopIfClosed = () => {
4997
+ if (!this.userClosing)
4998
+ return;
4999
+ this.socket.close();
5000
+ throw new ConnectionClosedError("account was closed");
5001
+ };
5002
+ stopIfClosed();
4986
5003
  this.socket.close();
4987
5004
  this.makeSocket();
4988
5005
  await this.open();
5006
+ stopIfClosed();
4989
5007
  await this.authenticate(await this.credentialsProvider());
5008
+ stopIfClosed();
4990
5009
  await this.resubscribe();
4991
5010
  }
4992
5011
  async resubscribe() {
@@ -5484,7 +5503,13 @@ class SpacemoltClient {
5484
5503
  return;
5485
5504
  }
5486
5505
  this.reconnectingIds.add(id);
5487
- this.enqueueRateLimited(() => this.withConnectRetry(() => account.reconnectOnce())).then(() => this.notifyAccountReconnected(account)).catch((reconnectErr) => {
5506
+ const wanted = () => this.connected.get(id) === account;
5507
+ this.enqueueRateLimited(() => this.withConnectRetry(async () => wanted() ? account.reconnectOnce() : undefined)).then(() => {
5508
+ if (wanted())
5509
+ this.notifyAccountReconnected(account);
5510
+ }).catch((reconnectErr) => {
5511
+ if (!wanted())
5512
+ return;
5488
5513
  console.warn(`[spacemolt] failed to reconnect "${id}": ${reconnectErr}`);
5489
5514
  this.connected.delete(id);
5490
5515
  this.notifyAccountDisconnected(id, err);
@@ -5574,6 +5599,7 @@ var TYPED_NOTIFICATION_TYPES = [
5574
5599
  "faction_peace_proposal",
5575
5600
  "faction_war_declared",
5576
5601
  "fleet",
5602
+ "gift_received",
5577
5603
  "market_update",
5578
5604
  "mining_yield",
5579
5605
  "observation_update",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spacemolt/lib",
3
- "version": "15.0.0",
3
+ "version": "15.1.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",