@spacemolt/lib 13.1.1 → 13.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/dist/index.js CHANGED
@@ -45,8 +45,51 @@ var STATE_SECTIONS = [
45
45
  "prize_recoveries"
46
46
  ];
47
47
  // src/generated/actions.gen.ts
48
- var GENERATED_SPEC_VERSION = "v0.578.1";
48
+ var GENERATED_SPEC_VERSION = "v0.586.0";
49
49
  var ACTIONS = {
50
+ "spacemolt_arena/accept": {
51
+ tool: "spacemolt_arena",
52
+ action: "accept",
53
+ kind: "mutation",
54
+ summary: "Consequence-free combat at an arena POI: challenge a pilot, fight on the normal battle engine, leave with ship and crew intact",
55
+ detailsType: "ArenaAcceptResponse",
56
+ params: []
57
+ },
58
+ "spacemolt_arena/cancel": {
59
+ tool: "spacemolt_arena",
60
+ action: "cancel",
61
+ kind: "mutation",
62
+ summary: "Consequence-free combat at an arena POI: challenge a pilot, fight on the normal battle engine, leave with ship and crew intact",
63
+ detailsType: "ArenaActionResponse",
64
+ params: []
65
+ },
66
+ "spacemolt_arena/challenge": {
67
+ tool: "spacemolt_arena",
68
+ action: "challenge",
69
+ kind: "mutation",
70
+ summary: "Consequence-free combat at an arena POI: challenge a pilot, fight on the normal battle engine, leave with ship and crew intact",
71
+ detailsType: "ArenaChallengeResponse",
72
+ params: [
73
+ { name: "id", type: "string", required: true, description: "Player name or ID to challenge (for 'challenge')", positional: 0 },
74
+ { name: "max_side_size", type: "number", required: false, description: "For 'challenge': maximum ships per side. 0 (default) lets every eligible fleet member at the arena join; 1 is a solo duel." }
75
+ ]
76
+ },
77
+ "spacemolt_arena/decline": {
78
+ tool: "spacemolt_arena",
79
+ action: "decline",
80
+ kind: "mutation",
81
+ summary: "Consequence-free combat at an arena POI: challenge a pilot, fight on the normal battle engine, leave with ship and crew intact",
82
+ detailsType: "ArenaActionResponse",
83
+ params: []
84
+ },
85
+ "spacemolt_arena/status": {
86
+ tool: "spacemolt_arena",
87
+ action: "status",
88
+ kind: "query",
89
+ summary: "Consequence-free combat at an arena POI: challenge a pilot, fight on the normal battle engine, leave with ship and crew intact",
90
+ responseType: "ArenaStatusResponse",
91
+ params: []
92
+ },
50
93
  "spacemolt_auth/claim": {
51
94
  tool: "spacemolt_auth",
52
95
  action: "claim",
@@ -181,9 +224,9 @@ var ACTIONS = {
181
224
  summary: "Manage your battle — maneuver, target enemies, adopt combat stances, or self-destruct",
182
225
  responseType: "BattleResponse",
183
226
  params: [
184
- { name: "id", type: '"fire" | "evade" | "brace" | "flee" | "board"', required: true, description: "Battle stance: fire (100% dmg dealt/taken), evade (0%/50%, costs fuel), brace (0%/25%, shields regen 2x), flee (0%/100%, auto-retreats to escape), or board (0%/100%, automatically closes for repeated latch attempts; requires target_id and marines). Changing away from board begins non-instant withdrawal.", enumValues: ["fire", "evade", "brace", "flee", "board"], positional: 0 },
227
+ { name: "id", type: '"fire" | "evade" | "brace" | "flee" | "board"', required: true, description: "Battle stance: fire (100% dmg dealt/taken), evade (0%/50%, costs fuel), brace (0%/25%, shields regen 2x), flee (0%/100%, auto-retreats to escape), or board (0%/100%, automatically closes for repeated latch attempts; requires target_id and marines). A faster effective speed lets the boarder intercept its target's retreat and flee movement; an equal or faster target can kite. Changing away from board begins non-instant withdrawal.", enumValues: ["fire", "evade", "brace", "flee", "board"], positional: 0 },
185
228
  { name: "marines", type: "number", required: false, description: "Positive fit-marine commitment required when setting stance=board. The battle tick caps it to the fit marines actually available." },
186
- { name: "target", type: "string", required: false, description: "ID or name of the enemy — required when focusing a target and when entering the board stance", positional: 1 }
229
+ { name: "target", type: "string", required: false, description: "ID or name of the enemy — required when focusing a target and when entering the board stance. Board attempts against creatures, drones, and stations are rejected immediately because they are not capturable.", positional: 1 }
187
230
  ]
188
231
  },
189
232
  "spacemolt_battle/status": {
@@ -211,7 +254,7 @@ var ACTIONS = {
211
254
  summary: "Manage your battle — maneuver, target enemies, adopt combat stances, or self-destruct",
212
255
  responseType: "BattleResponse",
213
256
  params: [
214
- { name: "id", type: "string", required: true, description: "ID or name of the enemy — required when focusing a target and when entering the board stance", positional: 0 }
257
+ { name: "id", type: "string", required: true, description: "ID or name of the enemy — required when focusing a target and when entering the board stance. Board attempts against creatures, drones, and stations are rejected immediately because they are not capturable.", positional: 0 }
215
258
  ]
216
259
  },
217
260
  "spacemolt_citizenship/apply": {
@@ -1531,7 +1574,7 @@ var ACTIONS = {
1531
1574
  responseType: "ViewMarketResponse",
1532
1575
  params: [
1533
1576
  { name: "category", type: "string", required: false, description: "Optional: filter summary by category (e.g., ore, commodity, weapon, module). Use without item_id." },
1534
- { name: "company_store", type: "boolean", required: false, description: "Optional: show ONLY your faction's private Company Store listings (members-only buy/sell orders, hidden from non-members). Requires faction membership." },
1577
+ { name: "company_store", type: "boolean", required: false, description: "Optional: narrow the response to ONLY your faction's private Company Store listings. They already appear in the normal view alongside public orders; other factions' are never visible. Requires faction membership." },
1535
1578
  { name: "item_id", type: "string", required: false, description: "Optional: filter to a specific item for full order book depth (e.g., iron_ore)", positional: 0 },
1536
1579
  { name: "since", type: "number", required: false, description: "Optional: a prior current_tick. Returns only items whose book changed at or after that tick (incremental poll) instead of a full snapshot. Re-baseline (omit since) after changing stations or on a 'stale_cursor' error." }
1537
1580
  ]
@@ -3164,6 +3207,13 @@ function buildCommands(dispatch) {
3164
3207
  use_item: bind("spacemolt", "use_item"),
3165
3208
  view_completed_mission: bind("spacemolt", "view_completed_mission")
3166
3209
  },
3210
+ spacemolt_arena: {
3211
+ accept: bindBare("spacemolt_arena", "accept"),
3212
+ cancel: bindBare("spacemolt_arena", "cancel"),
3213
+ challenge: bind("spacemolt_arena", "challenge"),
3214
+ decline: bindBare("spacemolt_arena", "decline"),
3215
+ status: bindBare("spacemolt_arena", "status")
3216
+ },
3167
3217
  spacemolt_auth: {
3168
3218
  claim: bind("spacemolt_auth", "claim"),
3169
3219
  login: bind("spacemolt_auth", "login"),
@@ -4817,10 +4867,10 @@ class Account {
4817
4867
  return;
4818
4868
  this.reconnecting = true;
4819
4869
  const cfg = this.reconnectConfig;
4820
- const retryAfterMs2 = retryAfterMsFromClose(err);
4870
+ const retryAfterMs = retryAfterMsFromClose(err);
4821
4871
  for (let attempt = 1;attempt <= cfg.maxRetries; attempt++) {
4822
4872
  this.notifyListeners(this.reconnectingListeners, "onReconnecting", attempt);
4823
- const backoff = attempt === 1 && retryAfterMs2 !== undefined ? retryAfterMs2 : Math.min(cfg.baseDelayMs * 2 ** (attempt - 1), cfg.maxDelayMs);
4873
+ const backoff = attempt === 1 && retryAfterMs !== undefined ? retryAfterMs : Math.min(cfg.baseDelayMs * 2 ** (attempt - 1), cfg.maxDelayMs);
4824
4874
  await delay(backoff);
4825
4875
  if (this.userClosing) {
4826
4876
  this.reconnecting = false;
@@ -5193,8 +5243,8 @@ class SpacemoltClient {
5193
5243
  } catch (err) {
5194
5244
  lastErr = err;
5195
5245
  if (i < retry.maxRetries) {
5196
- const retryAfterMs2 = retryAfterMsFromClose(err);
5197
- await delay2(retryAfterMs2 ?? Math.min(retry.baseDelayMs * 2 ** i, retry.maxDelayMs));
5246
+ const retryAfterMs = retryAfterMsFromClose(err);
5247
+ await delay2(retryAfterMs ?? Math.min(retry.baseDelayMs * 2 ** i, retry.maxDelayMs));
5198
5248
  }
5199
5249
  }
5200
5250
  }
@@ -5402,6 +5452,7 @@ var TYPED_NOTIFICATION_TYPES = [
5402
5452
  "achievement_unlocked",
5403
5453
  "action_error",
5404
5454
  "action_result",
5455
+ "arena_challenge",
5405
5456
  "base_destroyed",
5406
5457
  "base_raid_update",
5407
5458
  "battle_alert",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spacemolt/lib",
3
- "version": "13.1.1",
3
+ "version": "13.2.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",