@spacemolt/lib 15.2.1 → 16.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 +11 -6
- package/README.md +8 -4
- package/dist/account.d.ts +23 -23
- package/dist/generated/actions.gen.d.ts +2 -2
- package/dist/generated/commands.gen.d.ts +27 -7
- package/dist/generated/notifications.gen.d.ts +4 -3
- package/dist/generated/openapi/types.gen.d.ts +923 -149
- package/dist/index.js +76 -47
- package/dist/index.js.map +7 -7
- package/dist/state/observation.d.ts +17 -9
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Local cache of the subscribed observation watch (current POI
|
|
2
|
+
* Local cache of the subscribed observation watch (current POI).
|
|
3
3
|
*
|
|
4
4
|
* Seeded from the `subscribe_observation` baseline and kept current by merging
|
|
5
5
|
* `observation_update` pushes: `*_changed` arrays upsert entities (keyed by
|
|
@@ -7,13 +7,17 @@
|
|
|
7
7
|
* cloaked-contact / signature hints are tracked alongside.
|
|
8
8
|
*
|
|
9
9
|
* Not a players-only feed: the baseline and every update also carry the
|
|
10
|
-
* pirate, empire-NPC, wildlife
|
|
11
|
-
* each with the same changed/departed delta shape as players
|
|
12
|
-
* of `get_nearby`'s
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* pirate, empire-NPC, wildlife, intact-prize and arena-NPC presence at the
|
|
11
|
+
* watched POI, each with the same changed/departed delta shape as players —
|
|
12
|
+
* all six of `get_nearby`'s classes. The player list matches `get_nearby`:
|
|
13
|
+
* above 10 players, offline ones collapse into `offlineCollapsed`.
|
|
14
|
+
*
|
|
15
|
+
* Nothing here is system-wide except `shipCounts`: with a working ship
|
|
16
|
+
* scanner, the per-POI ship count for every charted POI in the system. The
|
|
17
|
+
* server sends the full map whenever any count changes, so it replaces the
|
|
18
|
+
* previous map rather than merging.
|
|
15
19
|
*/
|
|
16
|
-
import type { CreatureInfo, EmpireNpcInfo, NotificationObservationUpdate, PirateInfo, PrizeInfo, SubscribeObservationResponse } from '../generated/openapi/types.gen.js';
|
|
20
|
+
import type { ArenaNpcInfo, CreatureInfo, EmpireNpcInfo, NotificationObservationUpdate, PirateInfo, PrizeInfo, SubscribeObservationResponse } from '../generated/openapi/types.gen.js';
|
|
17
21
|
export type ObservedPlayer = NonNullable<NotificationObservationUpdate['nearby_changed']>[number];
|
|
18
22
|
export type CloakedContact = NonNullable<NotificationObservationUpdate['cloaked_resolved']>[number];
|
|
19
23
|
export interface ObservationView {
|
|
@@ -23,8 +27,6 @@ export interface ObservationView {
|
|
|
23
27
|
tick: number;
|
|
24
28
|
/** Uncloaked players at the watched POI, keyed by player_id. */
|
|
25
29
|
nearby: Map<string, ObservedPlayer>;
|
|
26
|
-
/** Uncloaked players system-wide, keyed by player_id. */
|
|
27
|
-
system: Map<string, ObservedPlayer>;
|
|
28
30
|
/** Pirate NPCs at the watched POI, keyed by pirate_id. */
|
|
29
31
|
pirates: Map<string, PirateInfo>;
|
|
30
32
|
/** Empire NPCs at the watched POI, keyed by npc_id. */
|
|
@@ -33,6 +35,12 @@ export interface ObservationView {
|
|
|
33
35
|
creatures: Map<string, CreatureInfo>;
|
|
34
36
|
/** Intact captured ships at the watched POI, keyed by prize_id. */
|
|
35
37
|
prizes: Map<string, PrizeInfo>;
|
|
38
|
+
/** Arena challenge enemies at the watched POI, keyed by npc_id. */
|
|
39
|
+
arenaNpcs: Map<string, ArenaNpcInfo>;
|
|
40
|
+
/** Offline players at the watched POI not listed in `nearby` (0 when all are listed). */
|
|
41
|
+
offlineCollapsed: number;
|
|
42
|
+
/** Ship scanner counts per charted POI in the system, keyed by POI ID. Empty without a working ship scanner. */
|
|
43
|
+
shipCounts: Map<string, number>;
|
|
36
44
|
/** Cloaked contacts resolved by an active sensor sweep, keyed by target_id. */
|
|
37
45
|
cloaked: Map<string, CloakedContact>;
|
|
38
46
|
/** A faint cloaked-ship signature is present at the watched POI. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spacemolt/lib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.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
|
"types": "./dist/index.d.ts",
|