@pollen-robotics/reachy-mini-sdk 1.10.0-dev.0.main.9f78da7 → 1.10.0-dev.0.main.c8367cd
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/APP_CREATION_GUIDE.md +98 -0
- package/dist/lib/central-listener.d.ts +71 -0
- package/dist/lib/central-listener.d.ts.map +1 -0
- package/dist/lib/central-listener.js +277 -0
- package/dist/lib/central-listener.js.map +1 -0
- package/dist/lib/central-listener.test.d.ts +2 -0
- package/dist/lib/central-listener.test.d.ts.map +1 -0
- package/dist/lib/central-listener.test.js +378 -0
- package/dist/lib/central-listener.test.js.map +1 -0
- package/dist/lib/dc-watchdog.test.d.ts +2 -0
- package/dist/lib/dc-watchdog.test.d.ts.map +1 -0
- package/dist/lib/dc-watchdog.test.js +154 -0
- package/dist/lib/dc-watchdog.test.js.map +1 -0
- package/dist/lib/ensure-awake.test.d.ts +2 -0
- package/dist/lib/ensure-awake.test.d.ts.map +1 -0
- package/dist/lib/ensure-awake.test.js +117 -0
- package/dist/lib/ensure-awake.test.js.map +1 -0
- package/dist/lib/ice-grace.test.d.ts +2 -0
- package/dist/lib/ice-grace.test.d.ts.map +1 -0
- package/dist/lib/ice-grace.test.js +211 -0
- package/dist/lib/ice-grace.test.js.map +1 -0
- package/dist/lib/imu.test.d.ts +2 -0
- package/dist/lib/imu.test.d.ts.map +1 -0
- package/dist/lib/imu.test.js +78 -0
- package/dist/lib/imu.test.js.map +1 -0
- package/dist/lib/logger.d.ts +38 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +81 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/pending-replies.d.ts +127 -0
- package/dist/lib/pending-replies.d.ts.map +1 -0
- package/dist/lib/pending-replies.js +255 -0
- package/dist/lib/pending-replies.js.map +1 -0
- package/dist/lib/pending-replies.test.d.ts +2 -0
- package/dist/lib/pending-replies.test.d.ts.map +1 -0
- package/dist/lib/pending-replies.test.js +217 -0
- package/dist/lib/pending-replies.test.js.map +1 -0
- package/dist/lib/reachy-mini.d.ts +118 -94
- package/dist/lib/reachy-mini.d.ts.map +1 -1
- package/dist/lib/reachy-mini.js +427 -690
- package/dist/lib/reachy-mini.js.map +1 -1
- package/dist/lib/redial.test.d.ts +2 -0
- package/dist/lib/redial.test.d.ts.map +1 -0
- package/dist/lib/redial.test.js +206 -0
- package/dist/lib/redial.test.js.map +1 -0
- package/dist/lib/request.test.d.ts +2 -0
- package/dist/lib/request.test.d.ts.map +1 -0
- package/dist/lib/request.test.js +90 -0
- package/dist/lib/request.test.js.map +1 -0
- package/dist/lib/session-supervisor.d.ts +201 -0
- package/dist/lib/session-supervisor.d.ts.map +1 -0
- package/dist/lib/session-supervisor.js +520 -0
- package/dist/lib/session-supervisor.js.map +1 -0
- package/dist/lib/token-store.d.ts +50 -0
- package/dist/lib/token-store.d.ts.map +1 -0
- package/dist/lib/token-store.js +120 -0
- package/dist/lib/token-store.js.map +1 -0
- package/dist/lib/token-store.test.d.ts +2 -0
- package/dist/lib/token-store.test.d.ts.map +1 -0
- package/dist/lib/token-store.test.js +82 -0
- package/dist/lib/token-store.test.js.map +1 -0
- package/dist/lib/types.d.ts +261 -6
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/url-helpers.d.ts.map +1 -1
- package/dist/lib/url-helpers.js +3 -1
- package/dist/lib/url-helpers.js.map +1 -1
- package/dist/lib/version.d.ts +2 -0
- package/dist/lib/version.d.ts.map +1 -0
- package/dist/lib/version.js +5 -0
- package/dist/lib/version.js.map +1 -0
- package/dist/reachy-mini-sdk.d.ts +15 -1
- package/dist/reachy-mini-sdk.d.ts.map +1 -1
- package/dist/reachy-mini-sdk.js +12 -0
- package/dist/reachy-mini-sdk.js.map +1 -1
- package/host/dist/ReachyHost.d.ts.map +1 -1
- package/host/dist/chunks/centralRest-uXNMidlL.js +2315 -0
- package/host/dist/chunks/index-Beu4GNzi.js +821 -0
- package/host/dist/chunks/{mountHost-DztGlWwu.js → mountHost-BTTF4Uu9.js} +26739 -29305
- package/host/dist/components/DaemonUpdateGate.d.ts +65 -0
- package/host/dist/components/DaemonUpdateGate.d.ts.map +1 -0
- package/host/dist/components/ErrorView.d.ts.map +1 -1
- package/host/dist/components/HostErrorBoundary.d.ts +30 -0
- package/host/dist/components/HostErrorBoundary.d.ts.map +1 -0
- package/host/dist/components/PickerView.d.ts +16 -14
- package/host/dist/components/PickerView.d.ts.map +1 -1
- package/host/dist/components/PostOAuthSplash.d.ts +14 -9
- package/host/dist/components/PostOAuthSplash.d.ts.map +1 -1
- package/host/dist/components/ReachyHostShell.d.ts.map +1 -1
- package/host/dist/components/SignInView.d.ts.map +1 -1
- package/host/dist/components/TopBar.d.ts +5 -6
- package/host/dist/components/TopBar.d.ts.map +1 -1
- package/host/dist/embed/index.d.ts +8 -5
- package/host/dist/embed/index.d.ts.map +1 -1
- package/host/dist/entry/auto.js +2 -2
- package/host/dist/entry/embed.js +2 -2
- package/host/dist/hooks/useHostBridge.d.ts +35 -1
- package/host/dist/hooks/useHostBridge.d.ts.map +1 -1
- package/host/dist/hooks/useLatestDaemonVersion.d.ts +7 -0
- package/host/dist/hooks/useLatestDaemonVersion.d.ts.map +1 -0
- package/host/dist/hooks/useOAuth.d.ts +18 -0
- package/host/dist/hooks/useOAuth.d.ts.map +1 -1
- package/host/dist/hooks/useRobots.d.ts +0 -2
- package/host/dist/hooks/useRobots.d.ts.map +1 -1
- package/host/dist/index.js +3 -3
- package/host/dist/lib/daemonRelease.d.ts +84 -0
- package/host/dist/lib/daemonRelease.d.ts.map +1 -0
- package/host/dist/lib/protocol.d.ts +141 -7
- package/host/dist/lib/protocol.d.ts.map +1 -1
- package/host/dist/lib/rebootWatch.d.ts +51 -0
- package/host/dist/lib/rebootWatch.d.ts.map +1 -0
- package/host/dist/lib/sdk-types.d.ts +1 -1
- package/host/dist/lib/sdk-types.d.ts.map +1 -1
- package/host/dist/lib/sdkStaleness.d.ts +78 -0
- package/host/dist/lib/sdkStaleness.d.ts.map +1 -0
- package/host/dist/lib/settings.d.ts +16 -5
- package/host/dist/lib/settings.d.ts.map +1 -1
- package/package.json +9 -2
- package/host/dist/chunks/index-rW7LY0k3.js +0 -530
- package/host/dist/chunks/reachy-mini-DblK_lhG.js +0 -1749
- package/host/dist/lib/centralListener.d.ts +0 -73
- package/host/dist/lib/centralListener.d.ts.map +0 -1
|
@@ -3,16 +3,8 @@
|
|
|
3
3
|
* See `../reachy-mini-sdk.ts` for the package's barrel and the README for
|
|
4
4
|
* a quick-start guide.
|
|
5
5
|
*/
|
|
6
|
-
import type { ApplyAudioConfigOptions, AudioConfigEntry, AutoConnectOptions, AutoConnectResult, FaceTarget, MotionAwaitOptions, MoveData, PlayMoveOptions, PlayMoveResult, PlayUploadedAudioOptions, ReachyMiniInstance, ReachyMiniOptions, RobotInfo, RobotState, SubscribeLogsOptions, UploadAudioOptions } from './types.js';
|
|
7
|
-
|
|
8
|
-
export interface UpdateProgressEvent {
|
|
9
|
-
status: 'in_progress' | 'done' | 'failed';
|
|
10
|
-
/** A log line of the underlying update job (when `in_progress`). */
|
|
11
|
-
line?: string;
|
|
12
|
-
/** Set when `status === 'failed'`. */
|
|
13
|
-
error?: string;
|
|
14
|
-
}
|
|
15
|
-
type UpdateProgressCallback = (event: UpdateProgressEvent) => void;
|
|
6
|
+
import type { ApplyAudioConfigOptions, AudioConfigEntry, AutoConnectOptions, AutoConnectResult, FaceTarget, ImuData, LoginOptions, MotionAwaitOptions, MoveData, PlayMoveOptions, PlayMoveResult, PlayUploadedAudioOptions, ReachyMiniInstance, ReachyMiniOptions, RequestOptions, RobotInfo, RobotState, StartDaemonUpdateOptions, SubscribeLogsOptions, UpdateProgressEvent, UploadAudioOptions } from './types.js';
|
|
7
|
+
export type { UpdateProgressEvent };
|
|
16
8
|
export declare class ReachyMini extends EventTarget implements ReachyMiniInstance {
|
|
17
9
|
private readonly _signalingUrl;
|
|
18
10
|
private readonly _clientId;
|
|
@@ -42,35 +34,17 @@ export declare class ReachyMini extends EventTarget implements ReachyMiniInstanc
|
|
|
42
34
|
private _micSupported;
|
|
43
35
|
private _latencyMonitorId;
|
|
44
36
|
private _stateRefreshInterval;
|
|
45
|
-
private
|
|
46
|
-
private _hardwareIdResolve;
|
|
47
|
-
private _volumeResolve;
|
|
48
|
-
private _micVolumeResolve;
|
|
49
|
-
private _firstWakeUpResolve;
|
|
50
|
-
private _trackedFaceResolve;
|
|
51
|
-
private _robotNameResolve;
|
|
52
|
-
private _deleteHfTokenResolve;
|
|
53
|
-
private _applyAudioConfigResolve;
|
|
54
|
-
private _readAudioParameterResolve;
|
|
37
|
+
private readonly _pending;
|
|
55
38
|
private readonly _logSubscribers;
|
|
56
39
|
private readonly _updateProgressSubscribers;
|
|
57
|
-
private _rpcCounter;
|
|
58
|
-
private readonly _pendingRpc;
|
|
59
40
|
private readonly _rpcListeners;
|
|
60
|
-
private _broadcastWaiters;
|
|
61
41
|
private _activeMoveUploadId;
|
|
62
42
|
private _activeAudioUploadId;
|
|
63
43
|
private _sessionResolve;
|
|
64
44
|
private _sessionReject;
|
|
65
45
|
private _iceConnected;
|
|
66
46
|
private _dcOpen;
|
|
67
|
-
private
|
|
68
|
-
private _iceGraceReason;
|
|
69
|
-
private _pendingVisibilityHandler;
|
|
70
|
-
private _onlineHandler;
|
|
71
|
-
private _offlineHandler;
|
|
72
|
-
private _connectionChangeHandler;
|
|
73
|
-
private readonly _pendingMotionCompletions;
|
|
47
|
+
private readonly _supervisor;
|
|
74
48
|
private _videoElement;
|
|
75
49
|
constructor(options?: ReachyMiniOptions);
|
|
76
50
|
get state(): 'disconnected' | 'connected' | 'streaming';
|
|
@@ -83,6 +57,24 @@ export declare class ReachyMini extends EventTarget implements ReachyMiniInstanc
|
|
|
83
57
|
get audioMuted(): boolean;
|
|
84
58
|
get preselectedRobotId(): string | null;
|
|
85
59
|
get isEmbedded(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Live RTCPeerConnection, or `null` between sessions. Read-only escape
|
|
62
|
+
* hatch for stats sampling (`getStats()`); mutating it is unsupported.
|
|
63
|
+
* Auto-reconnect re-dials REPLACE this object, so re-read it on every
|
|
64
|
+
* use — never capture it across ticks.
|
|
65
|
+
*/
|
|
66
|
+
get peerConnection(): RTCPeerConnection | null;
|
|
67
|
+
/**
|
|
68
|
+
* Build version of this SDK (npm package `version`), injected from
|
|
69
|
+
* package.json at build time. This is the JS SDK's OWN version and is
|
|
70
|
+
* distinct from `getVersion()`, which asks the DAEMON its version over
|
|
71
|
+
* the data channel. `0.0.0-managed-by-ci` means an unreleased/branch
|
|
72
|
+
* build (npm releases carry a real semver).
|
|
73
|
+
*/
|
|
74
|
+
get sdkVersion(): string;
|
|
75
|
+
/** Same value as the instance `sdkVersion`, reachable without an
|
|
76
|
+
* instance: `ReachyMini.version`. */
|
|
77
|
+
static get version(): string;
|
|
86
78
|
/**
|
|
87
79
|
* Internal: try to honour the `autoStartFromUrl` constructor
|
|
88
80
|
* option. Called from the signaling-message handler after every
|
|
@@ -91,65 +83,55 @@ export declare class ReachyMini extends EventTarget implements ReachyMiniInstanc
|
|
|
91
83
|
*/
|
|
92
84
|
_maybeAutoStart(): void;
|
|
93
85
|
authenticate(): Promise<boolean>;
|
|
94
|
-
login(): Promise<void>;
|
|
86
|
+
login(options?: LoginOptions): Promise<void>;
|
|
95
87
|
logout(): void;
|
|
96
88
|
connect(token?: string): Promise<void>;
|
|
97
89
|
autoConnect(options?: AutoConnectOptions): Promise<AutoConnectResult>;
|
|
98
90
|
private _fetchOwnedRobots;
|
|
99
91
|
private _waitForRobotInList;
|
|
100
92
|
startSession(robotId: string): Promise<void>;
|
|
93
|
+
private _startSessionInternal;
|
|
94
|
+
/**
|
|
95
|
+
* Common transport teardown shared by every session-ending path
|
|
96
|
+
* (stopSession, disconnect, the auto-redial, a session rejection):
|
|
97
|
+
* settle the pending-reply ledger and the startSession() resolvers
|
|
98
|
+
* with `settleErr`, stand the resilience plumbing down, stop the
|
|
99
|
+
* session-scoped timers, release the mic placeholder and close the
|
|
100
|
+
* pc/dc. Returns the session id (already cleared on the instance)
|
|
101
|
+
* so each caller decides whether and how to send `endSession`.
|
|
102
|
+
* What else differs — events, subscriber wipes, where `_state`
|
|
103
|
+
* lands — stays with the callers.
|
|
104
|
+
*/
|
|
105
|
+
private _closeTransport;
|
|
101
106
|
private _failSessionRejected;
|
|
102
107
|
stopSession(): Promise<void>;
|
|
103
108
|
disconnect(): void;
|
|
104
109
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* - If we're still in the originally-observed bad state (or
|
|
117
|
-
* worse), surface the error and reject any pending session
|
|
118
|
-
* promise. The original code path is preserved verbatim so
|
|
119
|
-
* downstream consumers see the same `error` payload shape.
|
|
110
|
+
* Enable/disable the automatic session re-dial at runtime.
|
|
111
|
+
* Disabling also aborts any re-dial already in flight. Used by
|
|
112
|
+
* flows that EXPECT the transport to die — e.g. the daemon
|
|
113
|
+
* self-update, whose `systemctl restart` teardown must surface as
|
|
114
|
+
* `sessionStopped` immediately (it's the "install done, rebooting"
|
|
115
|
+
* signal), not get absorbed by ~22 s of doomed reconnect attempts
|
|
116
|
+
* against a robot that is rebooting anyway.
|
|
117
|
+
*
|
|
118
|
+
* Sharp edge: cancelling an in-flight re-dial leaves the session
|
|
119
|
+
* torn down without emitting `sessionStopped` or `error` — the
|
|
120
|
+
* caller owns the terminal event (see `ReachyMiniInstance`).
|
|
120
121
|
*/
|
|
121
|
-
|
|
122
|
+
setAutoReconnect(enabled: boolean): void;
|
|
122
123
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
124
|
+
* Transport-only teardown: everything stopSession() does EXCEPT the
|
|
125
|
+
* user-facing state flip (`sessionStopped` is not emitted, `_state`
|
|
126
|
+
* falls back to 'connected' so the re-dial can start a session).
|
|
127
|
+
* Pending promises that ride the dead channel are settled just like
|
|
128
|
+
* stopSession() settles them — callers see the same failure shape a
|
|
129
|
+
* manual stop would produce; that includes a timed-out dial
|
|
130
|
+
* attempt's own startSession() promise (its resolvers were left
|
|
131
|
+
* armed, and a late signaling reply could otherwise settle them
|
|
132
|
+
* against a closed pc).
|
|
128
133
|
*/
|
|
129
|
-
private
|
|
130
|
-
/**
|
|
131
|
-
* Install browser-level network listeners and forward them as
|
|
132
|
-
* public `networkOnline` / `networkOffline` / `networkChange`
|
|
133
|
-
* events on this instance. Idempotent: called from
|
|
134
|
-
* `startSession()`, removed by `_uninstallNetworkListeners` on
|
|
135
|
-
* teardown. Reachable only when there's a live `window`
|
|
136
|
-
* (defensive guard for SSR / test environments).
|
|
137
|
-
*
|
|
138
|
-
* `online` / `offline` are semantically about CONNECTIVITY:
|
|
139
|
-
* "does the OS think we can reach the internet". They flip
|
|
140
|
-
* symmetrically.
|
|
141
|
-
*
|
|
142
|
-
* `connection.change` (NetworkInformation API, Chrome / Android
|
|
143
|
-
* WebView only) is semantically about the TRANSPORT: it fires
|
|
144
|
-
* on Wi-Fi → 4G swaps, AP roams, etc. without necessarily going
|
|
145
|
-
* through `offline`. We forward it as its own `networkChange`
|
|
146
|
-
* event rather than aliasing it onto `networkOnline`, so
|
|
147
|
-
* consumers don't have to guess whether they're seeing a real
|
|
148
|
-
* connectivity recovery or a silent transport swap.
|
|
149
|
-
*/
|
|
150
|
-
private _installNetworkListeners;
|
|
151
|
-
/** Counterpart to `_installNetworkListeners`. */
|
|
152
|
-
private _uninstallNetworkListeners;
|
|
134
|
+
private _teardownForRedial;
|
|
153
135
|
/**
|
|
154
136
|
* Atomic raw-units pose update over the data channel. Channels you
|
|
155
137
|
* omit are held at their last commanded value (per-axis, independent).
|
|
@@ -208,6 +190,31 @@ export declare class ReachyMini extends EventTarget implements ReachyMiniInstanc
|
|
|
208
190
|
setAntennasDeg(rightDeg: number, leftDeg: number): boolean;
|
|
209
191
|
setBodyYawDeg(yawDeg: number): boolean;
|
|
210
192
|
playSound(file: string): boolean;
|
|
193
|
+
playRecordedMove(moveName: string, { dataset, initialGotoDuration, }?: {
|
|
194
|
+
dataset?: string;
|
|
195
|
+
initialGotoDuration?: number;
|
|
196
|
+
}): boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Stop whatever move is currently playing on the daemon (recorded move,
|
|
199
|
+
* uploaded move, goto). Fire-and-forget and idempotent: the daemon acks
|
|
200
|
+
* ok with `stopped: false` when nothing was running. Returns `false` if
|
|
201
|
+
* the data channel is not open.
|
|
202
|
+
*/
|
|
203
|
+
stopMove(): boolean;
|
|
204
|
+
preloadDataset(dataset: string): boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Like `preloadDataset()`, but resolves once the daemon acks the preload
|
|
207
|
+
* (`{command: "preload_dataset", ...}` on the data channel), i.e. when the
|
|
208
|
+
* dataset is actually in the local HF cache. Resolves `true` on success,
|
|
209
|
+
* `false` when the daemon reports a download failure, and `null` on the
|
|
210
|
+
* fail-open timeout (download slower than `timeoutMs`, or a daemon that
|
|
211
|
+
* predates the command and never replies) - callers should proceed in all
|
|
212
|
+
* three cases, `playRecordedMove` still downloads on demand. Rejects when
|
|
213
|
+
* the data channel isn't open or the session tears down mid-flight.
|
|
214
|
+
*/
|
|
215
|
+
preloadDatasetAndWait(dataset: string, { timeoutMs }?: {
|
|
216
|
+
timeoutMs?: number;
|
|
217
|
+
}): Promise<boolean | null>;
|
|
211
218
|
clearIncomingAudio(): boolean;
|
|
212
219
|
startHeadTracking(weight?: number): boolean;
|
|
213
220
|
stopHeadTracking(): boolean;
|
|
@@ -226,20 +233,27 @@ export declare class ReachyMini extends EventTarget implements ReachyMiniInstanc
|
|
|
226
233
|
*
|
|
227
234
|
* Returns `false` if the data channel isn't open.
|
|
228
235
|
*/
|
|
229
|
-
startDaemonUpdate({ preRelease, onProgress }?:
|
|
230
|
-
preRelease?: boolean;
|
|
231
|
-
onProgress?: UpdateProgressCallback;
|
|
232
|
-
}): boolean;
|
|
236
|
+
startDaemonUpdate({ preRelease, onProgress }?: StartDaemonUpdateOptions): boolean;
|
|
233
237
|
setMotorMode(mode: 'enabled' | 'disabled' | 'gravity_compensation'): boolean;
|
|
234
238
|
setMotorTorque(on: boolean, ids?: string[] | null): boolean;
|
|
235
239
|
wakeUp({ timeoutMs }?: MotionAwaitOptions): Promise<void>;
|
|
236
240
|
gotoSleep({ timeoutMs }?: MotionAwaitOptions): Promise<void>;
|
|
237
241
|
private _sendCommandAwaitCompletion;
|
|
238
|
-
private _rejectPendingMotionCompletions;
|
|
239
242
|
isAwake(): boolean;
|
|
240
243
|
ensureAwake(timeoutMs?: number): Promise<boolean>;
|
|
244
|
+
/**
|
|
245
|
+
* Query the daemon version. Resolves `null` when the daemon predates
|
|
246
|
+
* `get_version` (fail-open on the shared slot timeout) or the reply is
|
|
247
|
+
* superseded by session teardown.
|
|
248
|
+
*/
|
|
241
249
|
getVersion(): Promise<string | null>;
|
|
242
250
|
getHardwareId(): Promise<string | null>;
|
|
251
|
+
/**
|
|
252
|
+
* One-shot IMU reading (BMI088, wireless version only). Resolves `null`
|
|
253
|
+
* when the robot has no IMU (Lite, simulation) or the daemon predates
|
|
254
|
+
* the `get_imu` command (fail-open on the shared slot timeout).
|
|
255
|
+
*/
|
|
256
|
+
getImu(): Promise<ImuData | null>;
|
|
243
257
|
getVolume(): Promise<number | null>;
|
|
244
258
|
setVolume(volume: number): Promise<number | null>;
|
|
245
259
|
getMicrophoneVolume(): Promise<number | null>;
|
|
@@ -292,20 +306,32 @@ export declare class ReachyMini extends EventTarget implements ReachyMiniInstanc
|
|
|
292
306
|
readAudioParameter(name: string): Promise<number[] | null>;
|
|
293
307
|
/**
|
|
294
308
|
* Internal: send a command and await the matching daemon response in a
|
|
295
|
-
* named single-resolver slot
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
* sufficient. If a previous request on the same slot is still
|
|
299
|
-
* pending when a new one comes in, the older promise is resolved to
|
|
300
|
-
* `null` so its caller doesn't hang forever.
|
|
301
|
-
*
|
|
302
|
-
* Slot access is passed in as getter/setter closures rather than a
|
|
303
|
-
* key into `this`: that keeps the helper fully generic-checked (T is
|
|
304
|
-
* inferred from the slot's resolver type at each call site) with no
|
|
305
|
-
* indexed-property casts.
|
|
309
|
+
* named single-resolver slot (see `PendingReplies.slotRoundtrip`).
|
|
310
|
+
* Every caller has a strict request/response shape where a single
|
|
311
|
+
* in-flight call per slot is sufficient.
|
|
306
312
|
*/
|
|
307
313
|
private _slotRoundtrip;
|
|
308
314
|
sendRaw(data: unknown): boolean;
|
|
315
|
+
/**
|
|
316
|
+
* Generic command round-trip for daemon commands the SDK has no typed
|
|
317
|
+
* wrapper for (yet). Escape hatch so an app can use a newer daemon
|
|
318
|
+
* feature without waiting for an SDK release: sends `command` and
|
|
319
|
+
* resolves with the first robot message whose `command` field equals
|
|
320
|
+
* the sent `type` - the daemon's reply convention - or with `null` on
|
|
321
|
+
* the fail-open timeout (daemon predates the command, or the command
|
|
322
|
+
* is fire-and-forget and never replies).
|
|
323
|
+
*
|
|
324
|
+
* Rejects when the data channel isn't open or the session tears down
|
|
325
|
+
* mid-flight, mirroring the typed wrappers.
|
|
326
|
+
*
|
|
327
|
+
* Replies the SDK already consumes internally (`get_imu`,
|
|
328
|
+
* `get_volume`, ...) are swallowed by their own handlers and never
|
|
329
|
+
* reach this matcher - use the typed wrappers for those. Pass `match`
|
|
330
|
+
* for replies that don't follow the `command` echo convention.
|
|
331
|
+
*/
|
|
332
|
+
request(command: {
|
|
333
|
+
type: string;
|
|
334
|
+
} & Record<string, unknown>, { timeoutMs, match }?: RequestOptions): Promise<Record<string, unknown> | null>;
|
|
309
335
|
subscribeLogs({ onLine, onError }: SubscribeLogsOptions): () => void;
|
|
310
336
|
requestState(): boolean;
|
|
311
337
|
/**
|
|
@@ -353,7 +379,6 @@ export declare class ReachyMini extends EventTarget implements ReachyMiniInstanc
|
|
|
353
379
|
* robot/app, e.g. `conversation.turn`. Returns an unsubscribe function.
|
|
354
380
|
*/
|
|
355
381
|
onNotification(method: string, cb: (params: Record<string, unknown>) => void): () => void;
|
|
356
|
-
private _rejectPendingRpc;
|
|
357
382
|
private _handleRpcMessage;
|
|
358
383
|
private _checkSessionReady;
|
|
359
384
|
private _handleSignalingMessage;
|
|
@@ -368,5 +393,4 @@ export declare class ReachyMini extends EventTarget implements ReachyMiniInstanc
|
|
|
368
393
|
/** Snap video playback to live edge if buffered lag exceeds 0.5 s. */
|
|
369
394
|
private _startLatencyMonitor;
|
|
370
395
|
}
|
|
371
|
-
export {};
|
|
372
396
|
//# sourceMappingURL=reachy-mini.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reachy-mini.d.ts","sourceRoot":"","sources":["../../lib/reachy-mini.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"reachy-mini.d.ts","sourceRoot":"","sources":["../../lib/reachy-mini.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmCH,OAAO,KAAK,EACR,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EAEjB,UAAU,EACV,OAAO,EACP,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,eAAe,EACf,cAAc,EACd,wBAAwB,EAExB,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,UAAU,EAEV,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EACrB,MAAM,YAAY,CAAC;AASpB,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAyDpC,qBAAa,UAAW,SAAQ,WAAY,YAAW,kBAAkB;IAGrE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgB;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;I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