@spacemolt/lib 15.0.1 → 15.2.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 +1 -1
- package/README.md +51 -0
- package/dist/account.d.ts +62 -1
- package/dist/client.d.ts +24 -1
- package/dist/data/catalog.d.ts +10 -5
- package/dist/data/http.d.ts +36 -0
- package/dist/data/map.d.ts +3 -2
- package/dist/data/mobile-base.d.ts +3 -2
- package/dist/data/stations.d.ts +3 -2
- package/dist/errors.d.ts +19 -0
- package/dist/generated/actions.gen.d.ts +1 -1
- package/dist/generated/notifications.gen.d.ts +4 -3
- package/dist/generated/openapi/types.gen.d.ts +117 -3
- package/dist/index.d.ts +3 -2
- package/dist/index.js +234 -70
- package/dist/jitter.d.ts +8 -0
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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.d.ts
CHANGED
|
@@ -10,17 +10,18 @@
|
|
|
10
10
|
* subsequent milestones.
|
|
11
11
|
*/
|
|
12
12
|
export * from './protocol.js';
|
|
13
|
-
export { Account, type AccountOptions, type ReconnectOptions, type RegisterParams, type RegisterResult, type LoggedInPayload, } from './account.js';
|
|
13
|
+
export { Account, type AccountOptions, type ReconnectOptions, type RegisterParams, type RegisterResult, type LoggedInPayload, type RateLimitedInfo, } from './account.js';
|
|
14
14
|
export { SpacemoltClient, type SpacemoltClientOptions } from './client.js';
|
|
15
15
|
export { ClerkSource, mintWsToken, type ClerkAuth, type ClerkAuthHeaders, type ClerkPlayer, type ClerkRegistration, type ClerkSourceOptions, } from './auth/clerk.js';
|
|
16
16
|
export { type CredentialStore, type StoredAccount, type AuthCredentials, MemoryCredentialStore, } from './auth/credentials.js';
|
|
17
|
-
export { SpacemoltError, ConnectionClosedError, CLOSE_CODE, retryAfterMsFromClose } from './errors.js';
|
|
17
|
+
export { SpacemoltError, ConnectionClosedError, HttpError, CLOSE_CODE, retryAfterMsFromClose } from './errors.js';
|
|
18
18
|
export { StateCache } from './state/cache.js';
|
|
19
19
|
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
23
|
export { CatalogCache, fetchCatalog, fetchCatalogConditional, type Catalog, type CatalogAchievement, type CatalogFacility, type CatalogFetchResult, type CatalogItem, type CatalogRecipe, type CatalogShip, type CatalogSkill, } from './data/catalog.js';
|
|
24
|
+
export type { FetchOptions } from './data/http.js';
|
|
24
25
|
export { MapCache, fetchMap, httpBaseFromWs, type GalaxyMap, type MapSystem } from './data/map.js';
|
|
25
26
|
export { fetchStations, type StationEmpire, type StationList, type StationSummary } from './data/stations.js';
|
|
26
27
|
export { fetchMobileBase, type MobileBaseLocation } from './data/mobile-base.js';
|