@dronedeploy/rocos-js-sdk 4.5.1 → 4.6.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.
Files changed (33) hide show
  1. package/cjs/constants/api.d.ts +2 -0
  2. package/cjs/constants/api.js +4 -2
  3. package/cjs/models/index.d.ts +1 -0
  4. package/cjs/models/index.js +1 -0
  5. package/cjs/models/maps/MapLocation.d.ts +60 -0
  6. package/cjs/models/maps/MapLocation.js +2 -0
  7. package/cjs/services/MapService.d.ts +32 -0
  8. package/cjs/services/MapService.js +35 -0
  9. package/cjs/services/RobotStatusService.d.ts +22 -3
  10. package/cjs/services/RobotStatusService.js +79 -13
  11. package/cjs/services/robot-status/connectivity.d.ts +19 -30
  12. package/cjs/services/robot-status/connectivity.js +16 -58
  13. package/cjs/services/robot-status/reportedStatus.d.ts +11 -4
  14. package/cjs/services/robot-status/reportedStatus.js +14 -9
  15. package/cjs/services/robot-status/sharedStreams.d.ts +28 -0
  16. package/cjs/services/robot-status/sharedStreams.js +52 -0
  17. package/esm/constants/api.d.ts +2 -0
  18. package/esm/constants/api.js +2 -0
  19. package/esm/models/index.d.ts +1 -0
  20. package/esm/models/index.js +1 -0
  21. package/esm/models/maps/MapLocation.d.ts +60 -0
  22. package/esm/models/maps/MapLocation.js +1 -0
  23. package/esm/services/MapService.d.ts +32 -0
  24. package/esm/services/MapService.js +36 -1
  25. package/esm/services/RobotStatusService.d.ts +22 -3
  26. package/esm/services/RobotStatusService.js +82 -16
  27. package/esm/services/robot-status/connectivity.d.ts +19 -30
  28. package/esm/services/robot-status/connectivity.js +14 -56
  29. package/esm/services/robot-status/reportedStatus.d.ts +11 -4
  30. package/esm/services/robot-status/reportedStatus.js +12 -7
  31. package/esm/services/robot-status/sharedStreams.d.ts +28 -0
  32. package/esm/services/robot-status/sharedStreams.js +48 -0
  33. package/package.json +1 -1
@@ -1,5 +1,4 @@
1
1
  import { IConnectedCallsign, RobotConnectivity, RobotConnectivityStatus, ServiceConnection } from '../../models';
2
- import { Observable } from 'rxjs';
3
2
  /**
4
3
  * Service id → public path prefix, for services that expose the standard
5
4
  * `connections` endpoint. New services adopting the convention are added here.
@@ -9,12 +8,13 @@ import { Observable } from 'rxjs';
9
8
  export declare const CONNECTION_SERVICE_PREFIXES: Record<string, string>;
10
9
  /**
11
10
  * The telemetry-liveness signal is derived from heartbeat freshness rather than
12
- * an HTTP endpoint, so it is handled specially (its observable is supplied by
13
- * the caller). See `getTelemetryLiveness`.
11
+ * an HTTP endpoint, so it is handled specially. See `getTelemetryLiveness`.
14
12
  */
15
13
  export declare const TELEMETRY_LIVENESS_SERVICE = "telemetry-liveness";
16
14
  /** The services evaluated by default. */
17
15
  export declare const DEFAULT_EXPECTED_SERVICES: string[];
16
+ /** How often the bulk `connections` endpoints are polled by default (ms). */
17
+ export declare const DEFAULT_CONNECTIVITY_POLL_MS = 5000;
18
18
  /**
19
19
  * Floor for the connections-endpoint poll interval. Guards against a caller
20
20
  * passing `0` (or any tiny value), which would otherwise poll the API on every
@@ -23,8 +23,16 @@ export declare const DEFAULT_EXPECTED_SERVICES: string[];
23
23
  export declare const MIN_CONNECTIVITY_POLL_MS = 250;
24
24
  /** Clamps a requested poll interval up to {@link MIN_CONNECTIVITY_POLL_MS}. */
25
25
  export declare const clampPollInterval: (pollMs: number) => number;
26
- /** Authenticated GET used to poll a service's `connections` endpoint. */
27
- export type ConnectionsHttpGet = (url: string) => Promise<IConnectedCallsign>;
26
+ /**
27
+ * A bulk `connections` endpoint response: callsign → connection. A callsign that isn't listed is not
28
+ * connected (Teletubby lists only connected callsigns).
29
+ */
30
+ export type ProjectConnections = Record<string, IConnectedCallsign>;
31
+ /**
32
+ * One poll of a bulk `connections` endpoint: the project's connections, or `undefined` when the poll
33
+ * failed — distinct from a successful but empty response, in which every callsign is disconnected.
34
+ */
35
+ export type ProjectConnectionsPoll = ProjectConnections | undefined;
28
36
  /**
29
37
  * Builds the `connections` endpoint URL for a service — per-callsign when a
30
38
  * callsign is given, otherwise the bulk per-project variant.
@@ -50,29 +58,10 @@ export declare const mapConnectionStatus: (connection?: IConnectedCallsign | nul
50
58
  */
51
59
  export declare const aggregateConnectivity: (services: Record<string, ServiceConnection>) => RobotConnectivity;
52
60
  /**
53
- * Polls a single service's `connections` endpoint on an interval, emitting its
54
- * {@link ServiceConnection} (change-only). A failed/timed-out poll yields
55
- * `UNKNOWN` (held transitional) rather than `DISCONNECTED`, to avoid a spurious
56
- * degraded flash on a transient error.
57
- *
58
- * `pollMs` is floored at {@link MIN_CONNECTIVITY_POLL_MS} so the endpoint can't
59
- * be polled unreasonably fast.
60
- */
61
- export declare const getServiceConnectionChanges: (httpGet: ConnectionsHttpGet, url: string, pollMs?: number) => Observable<ServiceConnection>;
62
- export interface ConnectivityDeps {
63
- httpGet: ConnectionsHttpGet;
64
- baseUrl: string;
65
- insecure?: boolean;
66
- /** The telemetry-liveness signal (from `getTelemetryLiveness`), folded in as one service. */
67
- telemetryLiveness$: Observable<ServiceConnection>;
68
- /** Caller-injected connectivity signals, keyed by service id, folded in on equal footing. */
69
- extraServices?: Record<string, Observable<ServiceConnection>>;
70
- }
71
- /**
72
- * Emits the robot's {@link RobotConnectivityStatus} — the per-service breakdown
73
- * plus the aggregate verdict — for the configured `expectedServices`, plus any
74
- * caller-injected `extraServices` (folded in on equal footing). HTTP services
75
- * are polled; `telemetry-liveness` and injected services use their supplied
76
- * observable; any unrecognised service id resolves to `UNKNOWN`.
61
+ * One callsign's {@link ServiceConnection} from a bulk poll. A failed poll is `UNKNOWN` (held
62
+ * transitional) rather than `DISCONNECTED`, to avoid a spurious degraded flash on a transient error;
63
+ * a callsign missing from a successful poll is `DISCONNECTED`.
77
64
  */
78
- export declare const getConnectivityChanges: (deps: ConnectivityDeps, projectId: string, callsign: string, expectedServices?: string[], pollMs?: number) => Observable<RobotConnectivityStatus>;
65
+ export declare const getCallsignConnection: (poll: ProjectConnectionsPoll, callsign: string) => ServiceConnection;
66
+ /** Whether two connectivity statuses carry the same verdict and per-service breakdown. */
67
+ export declare const connectivityEquals: (a: RobotConnectivityStatus, b: RobotConnectivityStatus) => boolean;
@@ -1,6 +1,5 @@
1
1
  import { API_SERVICE_CONNECTIONS_URL, API_SERVICE_CONNECTION_URL } from '../../constants/api';
2
2
  import { ConnectionStatus, RobotConnectivity, ServiceConnection, } from '../../models';
3
- import { catchError, combineLatest, distinctUntilChanged, from, map, of, startWith, switchMap, timer, } from 'rxjs';
4
3
  import { formatServiceUrl } from '../../helpers/formatServiceUrl';
5
4
  /**
6
5
  * Service id → public path prefix, for services that expose the standard
@@ -15,8 +14,7 @@ export const CONNECTION_SERVICE_PREFIXES = {
15
14
  };
16
15
  /**
17
16
  * The telemetry-liveness signal is derived from heartbeat freshness rather than
18
- * an HTTP endpoint, so it is handled specially (its observable is supplied by
19
- * the caller). See `getTelemetryLiveness`.
17
+ * an HTTP endpoint, so it is handled specially. See `getTelemetryLiveness`.
20
18
  */
21
19
  export const TELEMETRY_LIVENESS_SERVICE = 'telemetry-liveness';
22
20
  /** The services evaluated by default. */
@@ -26,7 +24,8 @@ export const DEFAULT_EXPECTED_SERVICES = [
26
24
  'robot-services',
27
25
  'robot-telemetry',
28
26
  ];
29
- const DEFAULT_CONNECTIVITY_POLL_MS = 5000;
27
+ /** How often the bulk `connections` endpoints are polled by default (ms). */
28
+ export const DEFAULT_CONNECTIVITY_POLL_MS = 5000;
30
29
  /**
31
30
  * Floor for the connections-endpoint poll interval. Guards against a caller
32
31
  * passing `0` (or any tiny value), which would otherwise poll the API on every
@@ -83,20 +82,19 @@ export const aggregateConnectivity = (services) => {
83
82
  return RobotConnectivity.OFFLINE;
84
83
  };
85
84
  /**
86
- * Polls a single service's `connections` endpoint on an interval, emitting its
87
- * {@link ServiceConnection} (change-only). A failed/timed-out poll yields
88
- * `UNKNOWN` (held transitional) rather than `DISCONNECTED`, to avoid a spurious
89
- * degraded flash on a transient error.
90
- *
91
- * `pollMs` is floored at {@link MIN_CONNECTIVITY_POLL_MS} so the endpoint can't
92
- * be polled unreasonably fast.
85
+ * One callsign's {@link ServiceConnection} from a bulk poll. A failed poll is `UNKNOWN` (held
86
+ * transitional) rather than `DISCONNECTED`, to avoid a spurious degraded flash on a transient error;
87
+ * a callsign missing from a successful poll is `DISCONNECTED`.
93
88
  */
94
- export const getServiceConnectionChanges = (httpGet, url, pollMs = DEFAULT_CONNECTIVITY_POLL_MS) => {
95
- return timer(0, clampPollInterval(pollMs)).pipe(switchMap(() => {
96
- return from(httpGet(url)).pipe(map(mapConnectionStatus), catchError(() => of(ServiceConnection.UNKNOWN)));
97
- }), startWith(ServiceConnection.UNKNOWN), distinctUntilChanged());
89
+ export const getCallsignConnection = (poll, callsign) => {
90
+ if (poll === undefined)
91
+ return ServiceConnection.UNKNOWN;
92
+ if (!Object.prototype.hasOwnProperty.call(poll, callsign))
93
+ return ServiceConnection.DISCONNECTED;
94
+ return mapConnectionStatus(poll[callsign]);
98
95
  };
99
- const connectivityEquals = (a, b) => {
96
+ /** Whether two connectivity statuses carry the same verdict and per-service breakdown. */
97
+ export const connectivityEquals = (a, b) => {
100
98
  if (a.overall !== b.overall)
101
99
  return false;
102
100
  const keys = Object.keys(a.services);
@@ -104,43 +102,3 @@ const connectivityEquals = (a, b) => {
104
102
  return false;
105
103
  return keys.every((key) => a.services[key] === b.services[key]);
106
104
  };
107
- /**
108
- * Emits the robot's {@link RobotConnectivityStatus} — the per-service breakdown
109
- * plus the aggregate verdict — for the configured `expectedServices`, plus any
110
- * caller-injected `extraServices` (folded in on equal footing). HTTP services
111
- * are polled; `telemetry-liveness` and injected services use their supplied
112
- * observable; any unrecognised service id resolves to `UNKNOWN`.
113
- */
114
- export const getConnectivityChanges = (deps, projectId, callsign, expectedServices = DEFAULT_EXPECTED_SERVICES, pollMs = DEFAULT_CONNECTIVITY_POLL_MS) => {
115
- const extraServices = deps.extraServices ?? {};
116
- const serviceIds = [...expectedServices, ...Object.keys(extraServices).filter((id) => !expectedServices.includes(id))];
117
- // combineLatest([]) completes without emitting; emit an explicit empty/offline status instead.
118
- if (serviceIds.length === 0) {
119
- return of({ overall: RobotConnectivity.OFFLINE, services: {} });
120
- }
121
- const perService = serviceIds.map((serviceId) => {
122
- let source$;
123
- if (serviceId === TELEMETRY_LIVENESS_SERVICE) {
124
- source$ = deps.telemetryLiveness$;
125
- }
126
- else if (Object.prototype.hasOwnProperty.call(CONNECTION_SERVICE_PREFIXES, serviceId)) {
127
- const url = buildConnectionsUrl(serviceId, deps.baseUrl, projectId, callsign, deps.insecure);
128
- source$ = getServiceConnectionChanges(deps.httpGet, url, pollMs);
129
- }
130
- else if (Object.prototype.hasOwnProperty.call(extraServices, serviceId)) {
131
- // Contain an injected observable's errors as UNKNOWN, mirroring the built-in sources, so a
132
- // faulty caller signal can't error out combineLatest and tear down the whole aggregate.
133
- source$ = extraServices[serviceId].pipe(catchError(() => of(ServiceConnection.UNKNOWN)));
134
- }
135
- else {
136
- source$ = of(ServiceConnection.UNKNOWN);
137
- }
138
- return source$.pipe(startWith(ServiceConnection.UNKNOWN), map((connection) => ({ serviceId, connection })));
139
- });
140
- return combineLatest(perService).pipe(map((entries) => {
141
- const services = {};
142
- for (const { serviceId, connection } of entries)
143
- services[serviceId] = connection;
144
- return { overall: aggregateConnectivity(services), services };
145
- }), distinctUntilChanged(connectivityEquals));
146
- };
@@ -7,6 +7,13 @@ export declare const ROBOT_STATUS_SOURCE = "/diagnostics/robot/status";
7
7
  export declare const LEGACY_HEARTBEAT_SOURCE = "/rocos/agent/telemetry/heartbeat";
8
8
  /** The per-contributor breakdown behind the reported status (health + readiness). */
9
9
  export declare const ROBOT_STATUS_CONTRIBUTORS_SOURCE = "/diagnostics/robot/status/contributors";
10
+ /** How long without a liveness message before `telemetry-liveness` reports `DISCONNECTED` (ms). */
11
+ export declare const DEFAULT_HEARTBEAT_TIMEOUT_MS = 5000;
12
+ /**
13
+ * The telemetry these streams subscribe through. `RobotStatusService` passes a pooled implementation,
14
+ * so every status stream for a robot shares one subscription per topic.
15
+ */
16
+ export type StatusTelemetry = Pick<TelemetryService, 'subscribe'>;
10
17
  export interface ReportedRobotStatus {
11
18
  health: RobotHealth;
12
19
  readiness: RobotReadiness;
@@ -29,7 +36,7 @@ export declare const parseRobotReadiness: (value: unknown) => RobotReadiness;
29
36
  * preserves today's "online ⇒ green" behaviour for agents not yet emitting the
30
37
  * new topic.
31
38
  */
32
- export declare const getReportedStatusChanges: (telemetry: TelemetryService, projectId: string, callsign: string) => Observable<ReportedRobotStatus>;
39
+ export declare const getReportedStatusChanges: (telemetry: StatusTelemetry, projectId: string, callsign: string) => Observable<ReportedRobotStatus>;
33
40
  /**
34
41
  * Emits the per-contributor breakdown behind the robot's reported health and
35
42
  * readiness, from the agent's `robot/status/contributors` topic. Each
@@ -40,7 +47,7 @@ export declare const getReportedStatusChanges: (telemetry: TelemetryService, pro
40
47
  * emit immediately, and — like {@link getReportedStatusChanges} — a telemetry
41
48
  * error falls back to an empty breakdown rather than terminating the stream.
42
49
  */
43
- export declare const getStatusContributorsChanges: (telemetry: TelemetryService, projectId: string, callsign: string) => Observable<RobotStatusContributors>;
50
+ export declare const getStatusContributorsChanges: (telemetry: StatusTelemetry, projectId: string, callsign: string) => Observable<RobotStatusContributors>;
44
51
  /**
45
52
  * Emits the robot's telemetry latency in milliseconds, once per liveness message (from either the
46
53
  * new `robot/status` topic or the legacy heartbeat — the same messages {@link getTelemetryLiveness}
@@ -52,7 +59,7 @@ export declare const getStatusContributorsChanges: (telemetry: TelemetryService,
52
59
  * {@link getTelemetryLiveness} to tell a stale value from a live one. A telemetry error completes
53
60
  * the stream rather than erroring it.
54
61
  */
55
- export declare const getTelemetryLatencyChanges: (telemetry: TelemetryService, projectId: string, callsign: string, now: () => number) => Observable<number>;
62
+ export declare const getTelemetryLatencyChanges: (telemetry: StatusTelemetry, projectId: string, callsign: string, now: () => number) => Observable<number>;
56
63
  /**
57
64
  * Emits the `telemetry-liveness` connectivity signal: whether a heartbeat (from
58
65
  * either the new `robot/status` topic or the legacy heartbeat) has been received
@@ -60,4 +67,4 @@ export declare const getTelemetryLatencyChanges: (telemetry: TelemetryService, p
60
67
  * but spans both topics and maps onto {@link ServiceConnection} so it can be
61
68
  * folded into connectivity aggregation as just another service entry.
62
69
  */
63
- export declare const getTelemetryLiveness: (telemetry: TelemetryService, projectId: string, callsign: string, heartbeatTimeoutMs?: number, intervalMs?: number) => Observable<ServiceConnection>;
70
+ export declare const getTelemetryLiveness: (telemetry: StatusTelemetry, projectId: string, callsign: string, heartbeatTimeoutMs?: number, intervalMs?: number) => Observable<ServiceConnection>;
@@ -6,8 +6,17 @@ export const ROBOT_STATUS_SOURCE = '/diagnostics/robot/status';
6
6
  export const LEGACY_HEARTBEAT_SOURCE = '/rocos/agent/telemetry/heartbeat';
7
7
  /** The per-contributor breakdown behind the reported status (health + readiness). */
8
8
  export const ROBOT_STATUS_CONTRIBUTORS_SOURCE = `${ROBOT_STATUS_SOURCE}/contributors`;
9
- const DEFAULT_HEARTBEAT_TIMEOUT_MS = 5000;
9
+ /** How long without a liveness message before `telemetry-liveness` reports `DISCONNECTED` (ms). */
10
+ export const DEFAULT_HEARTBEAT_TIMEOUT_MS = 5000;
10
11
  const DEFAULT_INTERVAL_MS = 2000;
12
+ /**
13
+ * Every liveness message — the new `robot/status` topic or the legacy heartbeat — as one stream. The
14
+ * topics are subscribed separately, so the subscriptions are the same ones
15
+ * {@link getReportedStatusChanges} makes and can be shared with it.
16
+ */
17
+ const getLivenessMessages = (telemetry, projectId, callsign) => {
18
+ return merge(telemetry.subscribe({ projectId, callsigns: [callsign], sources: [ROBOT_STATUS_SOURCE] }), telemetry.subscribe({ projectId, callsigns: [callsign], sources: [LEGACY_HEARTBEAT_SOURCE] }));
19
+ };
11
20
  /**
12
21
  * Maps a `robot/status` wire value (integer, or its string equivalent) to a
13
22
  * {@link RobotHealth}. Anything unrecognised — including `0` / `'unknown'` —
@@ -124,9 +133,7 @@ export const getStatusContributorsChanges = (telemetry, projectId, callsign) =>
124
133
  * the stream rather than erroring it.
125
134
  */
126
135
  export const getTelemetryLatencyChanges = (telemetry, projectId, callsign, now) => {
127
- return telemetry
128
- .subscribe({ projectId, callsigns: [callsign], sources: [ROBOT_STATUS_SOURCE, LEGACY_HEARTBEAT_SOURCE] })
129
- .pipe(map((message) => now() - message.createdAt.getTime()), catchError(() => EMPTY));
136
+ return getLivenessMessages(telemetry, projectId, callsign).pipe(map((message) => now() - message.createdAt.getTime()), catchError(() => EMPTY));
130
137
  };
131
138
  /**
132
139
  * Emits the `telemetry-liveness` connectivity signal: whether a heartbeat (from
@@ -137,9 +144,7 @@ export const getTelemetryLatencyChanges = (telemetry, projectId, callsign, now)
137
144
  */
138
145
  export const getTelemetryLiveness = (telemetry, projectId, callsign, heartbeatTimeoutMs = DEFAULT_HEARTBEAT_TIMEOUT_MS, intervalMs = DEFAULT_INTERVAL_MS) => {
139
146
  const startedAt = Date.now();
140
- const lastMessageAt$ = telemetry
141
- .subscribe({ projectId, callsigns: [callsign], sources: [ROBOT_STATUS_SOURCE, LEGACY_HEARTBEAT_SOURCE] })
142
- .pipe(map(() => Date.now()));
147
+ const lastMessageAt$ = getLivenessMessages(telemetry, projectId, callsign).pipe(map(() => Date.now()));
143
148
  return combineLatest([lastMessageAt$.pipe(startWith(startedAt)), interval(intervalMs)]).pipe(map(([lastMessageAt]) => {
144
149
  const now = Date.now();
145
150
  // No message yet, but still within the initial grace period.
@@ -0,0 +1,28 @@
1
+ import { Observable } from 'rxjs';
2
+ export interface SharedStreamOptions {
3
+ /**
4
+ * Replay the latest value to a subscriber that joins late. Use it for state (a status, a poll
5
+ * result); leave it off for events (raw telemetry messages), where a replayed message would be
6
+ * mistaken for a fresh one.
7
+ */
8
+ replay: boolean;
9
+ }
10
+ /**
11
+ * Hands out one shared, reference-counted observable per key, so equivalent subscribers (e.g. every
12
+ * status dot for robots in one project) share a single upstream subscription or poll.
13
+ *
14
+ * The upstream is subscribed on the first subscriber and torn down after the last one leaves, at
15
+ * which point the entry is dropped; a later subscriber starts it afresh. An upstream that errors or
16
+ * completes is reset the same way, so one failure never leaves a dead stream in the pool.
17
+ */
18
+ export declare class SharedStreamPool {
19
+ private readonly streams;
20
+ get<T>(key: unknown[], create: () => Observable<T>, options: SharedStreamOptions): Observable<T>;
21
+ /** How many streams are currently pooled (subscribed and live). */
22
+ get size(): number;
23
+ }
24
+ /**
25
+ * The process-wide pool, shared across `RobotStatusService` instances. Keys include the SDK's unique
26
+ * config key, so only equivalent SDK configurations share streams.
27
+ */
28
+ export declare const sharedStreamPool: SharedStreamPool;
@@ -0,0 +1,48 @@
1
+ import { ReplaySubject, Subject, defer, finalize, share } from 'rxjs';
2
+ /**
3
+ * Hands out one shared, reference-counted observable per key, so equivalent subscribers (e.g. every
4
+ * status dot for robots in one project) share a single upstream subscription or poll.
5
+ *
6
+ * The upstream is subscribed on the first subscriber and torn down after the last one leaves, at
7
+ * which point the entry is dropped; a later subscriber starts it afresh. An upstream that errors or
8
+ * completes is reset the same way, so one failure never leaves a dead stream in the pool.
9
+ */
10
+ export class SharedStreamPool {
11
+ constructor() {
12
+ this.streams = new Map();
13
+ }
14
+ get(key, create, options) {
15
+ const id = JSON.stringify(key);
16
+ const existing = this.streams.get(id);
17
+ if (existing)
18
+ return existing;
19
+ // Registered only once subscribed, so a stream handed out but never subscribed leaves no entry
20
+ // behind. Until then (or after the pool dropped it, for a caller that held on to it and
21
+ // resubscribes) another stream may have taken the key: join that rather than run a second upstream.
22
+ const shared$ = defer(() => {
23
+ const current = this.streams.get(id);
24
+ if (current && current !== shared$)
25
+ return current;
26
+ this.streams.set(id, shared$);
27
+ return create();
28
+ }).pipe(finalize(() => {
29
+ if (this.streams.get(id) === shared$)
30
+ this.streams.delete(id);
31
+ }), share({
32
+ connector: () => (options.replay ? new ReplaySubject(1) : new Subject()),
33
+ resetOnError: true,
34
+ resetOnComplete: true,
35
+ resetOnRefCountZero: true,
36
+ }));
37
+ return shared$;
38
+ }
39
+ /** How many streams are currently pooled (subscribed and live). */
40
+ get size() {
41
+ return this.streams.size;
42
+ }
43
+ }
44
+ /**
45
+ * The process-wide pool, shared across `RobotStatusService` instances. Keys include the SDK's unique
46
+ * config key, so only equivalent SDK configurations share streams.
47
+ */
48
+ export const sharedStreamPool = new SharedStreamPool();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dronedeploy/rocos-js-sdk",
3
- "version": "4.5.1",
3
+ "version": "4.6.0",
4
4
  "description": "Javascript SDK for rocos",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",