@viamrobotics/sdk 0.4.0 → 0.5.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.
@@ -1,8 +1,14 @@
1
+ import { type Duration as PBDuration } from 'google-protobuf/google/protobuf/duration_pb';
2
+ import pb from '../../gen/component/board/v1/board_pb';
1
3
  import type { Resource, StructType } from '../../types';
2
4
  interface Status {
3
5
  analogs: Record<string, number>;
4
6
  digitalInterrupts: Record<string, number>;
5
7
  }
8
+ type ValueOf<T> = T[keyof T];
9
+ export declare const PowerMode: pb.PowerModeMap;
10
+ export type PowerMode = ValueOf<typeof pb.PowerMode>;
11
+ export type Duration = PBDuration.AsObject;
6
12
  /**
7
13
  * Represents a physical general purpose compute board that contains various
8
14
  * components such as analog readers, and digital interrupts.
@@ -48,7 +54,7 @@ export interface Board extends Resource {
48
54
  * Set the PWM frequency of the given pin of a board.
49
55
  *
50
56
  * @param pin - The pin.
51
- * @param frequencyHz - The PWN frequency, in hertz. 0 will use the board's
57
+ * @param frequencyHz - The PWM frequency, in hertz. 0 will use the board's
52
58
  * default PWM frequency.
53
59
  */
54
60
  setPWMFrequency(pin: string, frequencyHz: number, extra?: StructType): Promise<void>;
@@ -58,6 +64,13 @@ export interface Board extends Resource {
58
64
  * @param analogReader - The name of the analog reader.
59
65
  */
60
66
  readAnalogReader(analogReader: string, extra?: StructType): Promise<number>;
67
+ /**
68
+ * Write an analog value to a pin on the board.
69
+ *
70
+ * @param pin - The pin name.
71
+ * @param value - An integer value to write.
72
+ */
73
+ writeAnalog(pin: string, value: number, extra?: StructType): Promise<void>;
61
74
  /**
62
75
  * Return the current value of the interrupt which is based on the type of
63
76
  * interrupt.
@@ -65,5 +78,13 @@ export interface Board extends Resource {
65
78
  * @param digitalInterruptName - The name of the digital interrupt.
66
79
  */
67
80
  getDigitalInterruptValue(digitalInterruptName: string, extra?: StructType): Promise<number>;
81
+ /**
82
+ * Set power mode of the board.
83
+ *
84
+ * @param name - The name of the board.
85
+ * @param powerMode - The requested power mode.
86
+ * @param duration - The requested duration to stay in power mode.
87
+ */
88
+ setPowerMode(name: string, powerMode: PowerMode, duration: Duration, extra?: StructType): Promise<void>;
68
89
  }
69
90
  export {};
@@ -1,7 +1,7 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import type { Options, StructType } from '../../types';
3
3
  import pb from '../../gen/component/board/v1/board_pb';
4
- import type { Board } from './board';
4
+ import type { Board, Duration, PowerMode } from './board';
5
5
  /**
6
6
  * A gRPC-web client for the Board component.
7
7
  *
@@ -31,6 +31,8 @@ export declare class BoardClient implements Board {
31
31
  getPWMFrequency(pin: string, extra?: {}): Promise<number>;
32
32
  setPWMFrequency(pin: string, frequencyHz: number, extra?: {}): Promise<void>;
33
33
  readAnalogReader(analogReader: string, extra?: {}): Promise<number>;
34
+ writeAnalog(pin: string, value: number, extra?: {}): Promise<void>;
34
35
  getDigitalInterruptValue(digitalInteruptName: string, extra?: {}): Promise<number>;
36
+ setPowerMode(name: string, powerMode: PowerMode, duration?: Duration, extra?: {}): Promise<void>;
35
37
  doCommand(command: StructType): Promise<StructType>;
36
38
  }
@@ -1,2 +1,2 @@
1
- export type { Board } from './board/board';
1
+ export { type Board, type Duration, PowerMode } from './board/board';
2
2
  export { BoardClient } from './board/client';
@@ -370,7 +370,6 @@ export interface ModeMap {
370
370
  MODE_UNSPECIFIED: 0;
371
371
  MODE_MANUAL: 1;
372
372
  MODE_WAYPOINT: 2;
373
- MODE_EXPLORE: 3;
374
373
  }
375
374
 
376
375
  export const Mode: ModeMap;
package/dist/main.d.ts CHANGED
@@ -59,7 +59,7 @@ export { type Base, type BaseProperties, BaseClient } from './components/base';
59
59
  * @group Raw Protobufs
60
60
  */
61
61
  export { default as boardApi } from './gen/component/board/v1/board_pb';
62
- export { type Board, BoardClient } from './components/board';
62
+ export { type Board, BoardClient, type Duration, PowerMode, } from './components/board';
63
63
  /**
64
64
  * Raw Protobuf interfaces for a Camera component.
65
65
  *
package/dist/main.es.js CHANGED
@@ -13835,11 +13835,11 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
13835
13835
  for (; ; ) {
13836
13836
  if (!u(this.buffer, this.position, 5))
13837
13837
  return b;
13838
- var C = c(this.buffer, this.position, this.position + 5), z = new DataView(C.buffer, C.byteOffset, C.byteLength), A = r(z);
13839
- if (!u(this.buffer, this.position, 5 + A))
13838
+ var C = c(this.buffer, this.position, this.position + 5), z = new DataView(C.buffer, C.byteOffset, C.byteLength), j = r(z);
13839
+ if (!u(this.buffer, this.position, 5 + j))
13840
13840
  return b;
13841
- var L = c(this.buffer, this.position + 5, this.position + 5 + A);
13842
- if (this.position += 5 + A, o(z))
13841
+ var L = c(this.buffer, this.position + 5, this.position + 5 + j);
13842
+ if (this.position += 5 + j, o(z))
13843
13843
  return b.push({ chunkType: l.TRAILERS, trailers: (y = L, new g.Metadata(t(y))) }), b;
13844
13844
  b.push({ chunkType: l.MESSAGE, data: L });
13845
13845
  }
@@ -20368,8 +20368,8 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20368
20368
  h ? (f = h.getCode(), y = h.getMessage(), b.set("grpc-status", "".concat(h.getCode())), y !== void 0 && b.set("grpc-message", h.getMessage())) : (f = 0, b.set("grpc-status", "0"), y = "");
20369
20369
  var R = function(T) {
20370
20370
  var C = "";
20371
- return T.forEach(function(z, A) {
20372
- C += "".concat(z, ": ").concat(A.join(", "), `\r
20371
+ return T.forEach(function(z, j) {
20372
+ C += "".concat(z, ": ").concat(j.join(", "), `\r
20373
20373
  `);
20374
20374
  }), r(C);
20375
20375
  }(b), w = new ArrayBuffer(R.length + 5);
@@ -20408,17 +20408,17 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20408
20408
  return s.__awaiter(this, void 0, void 0, function() {
20409
20409
  var T, C;
20410
20410
  return s.__generator(this, function(z) {
20411
- return h(w), T = function(A) {
20412
- return l.grpc.CrossBrowserHttpTransport({ withCredentials: !1 })(A);
20413
- }, !w?.accessToken || w?.externalAuthAddress && w?.externalAuthToEntity ? w && (w?.credentials || w?.accessToken) ? [2, f(R, T, w)] : [2, T] : ((C = new l.grpc.Metadata()).set("authorization", "Bearer ".concat(w.accessToken)), [2, function(A) {
20414
- return new y(A, T, C);
20411
+ return h(w), T = function(j) {
20412
+ return l.grpc.CrossBrowserHttpTransport({ withCredentials: !1 })(j);
20413
+ }, !w?.accessToken || w?.externalAuthAddress && w?.externalAuthToEntity ? w && (w?.credentials || w?.accessToken) ? [2, f(R, T, w)] : [2, T] : ((C = new l.grpc.Metadata()).set("authorization", "Bearer ".concat(w.accessToken)), [2, function(j) {
20414
+ return new y(j, T, C);
20415
20415
  }]);
20416
20416
  });
20417
20417
  });
20418
20418
  }
20419
20419
  function f(R, w, T) {
20420
20420
  return s.__awaiter(this, void 0, void 0, function() {
20421
- var C, z, A, L = this;
20421
+ var C, z, j, L = this;
20422
20422
  return s.__generator(this, function(x) {
20423
20423
  switch (x.label) {
20424
20424
  case 0:
@@ -20428,24 +20428,24 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20428
20428
  return s.__generator(this, function(P) {
20429
20429
  switch (P.label) {
20430
20430
  case 0:
20431
- return C != "" ? [3, 5] : (I = "", T.accessToken && T.accessToken !== "" ? [3, 2] : ((F = new r.AuthenticateRequest()).setEntity(T.authEntity ? T.authEntity : R.replace(/^(.*:\/\/)/, "")), (M = new r.Credentials()).setType((D = T.credentials) === null || D === void 0 ? void 0 : D.type), M.setPayload((O = T.credentials) === null || O === void 0 ? void 0 : O.payload), F.setCredentials(M), B = new Promise(function(W, j) {
20432
- U = W, k = j;
20431
+ return C != "" ? [3, 5] : (I = "", T.accessToken && T.accessToken !== "" ? [3, 2] : ((F = new r.AuthenticateRequest()).setEntity(T.authEntity ? T.authEntity : R.replace(/^(.*:\/\/)/, "")), (M = new r.Credentials()).setType((D = T.credentials) === null || D === void 0 ? void 0 : D.type), M.setPayload((O = T.credentials) === null || O === void 0 ? void 0 : O.payload), F.setCredentials(M), B = new Promise(function(W, A) {
20432
+ U = W, k = A;
20433
20433
  }), l.grpc.invoke(u.AuthService.Authenticate, { request: F, host: T.externalAuthAddress ? T.externalAuthAddress : R, transport: w, onMessage: function(W) {
20434
20434
  I = W.getAccessToken();
20435
- }, onEnd: function(W, j, _) {
20436
- W == l.grpc.Code.OK ? U(E) : k(j);
20435
+ }, onEnd: function(W, A, _) {
20436
+ W == l.grpc.Code.OK ? U(E) : k(A);
20437
20437
  } }), [4, B]));
20438
20438
  case 1:
20439
20439
  return P.sent(), [3, 3];
20440
20440
  case 2:
20441
20441
  I = T.accessToken, P.label = 3;
20442
20442
  case 3:
20443
- return C = I, T.externalAuthAddress && T.externalAuthToEntity ? ((S = new l.grpc.Metadata()).set("authorization", "Bearer ".concat(C)), B = new Promise(function(W, j) {
20444
- U = W, k = j;
20443
+ return C = I, T.externalAuthAddress && T.externalAuthToEntity ? ((S = new l.grpc.Metadata()).set("authorization", "Bearer ".concat(C)), B = new Promise(function(W, A) {
20444
+ U = W, k = A;
20445
20445
  }), I = "", (F = new r.AuthenticateToRequest()).setEntity(T.externalAuthToEntity), l.grpc.invoke(u.ExternalAuthService.AuthenticateTo, { request: F, host: T.externalAuthAddress, transport: w, metadata: S, onMessage: function(W) {
20446
20446
  I = W.getAccessToken();
20447
- }, onEnd: function(W, j, _) {
20448
- W == l.grpc.Code.OK ? U(S) : k(j);
20447
+ }, onEnd: function(W, A, _) {
20448
+ W == l.grpc.Code.OK ? U(S) : k(A);
20449
20449
  } }), [4, B]) : [3, 5];
20450
20450
  case 4:
20451
20451
  P.sent(), C = I, P.label = 5;
@@ -20456,8 +20456,8 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20456
20456
  });
20457
20457
  }, [4, z()];
20458
20458
  case 1:
20459
- return A = x.sent(), [2, function(I) {
20460
- return new y(I, w, A);
20459
+ return j = x.sent(), [2, function(I) {
20460
+ return new y(I, w, j);
20461
20461
  }];
20462
20462
  }
20463
20463
  });
@@ -20482,20 +20482,20 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20482
20482
  }();
20483
20483
  function b(R, w, T) {
20484
20484
  return s.__awaiter(this, void 0, void 0, function() {
20485
- var C, z, A, L, x, I;
20485
+ var C, z, j, L, x, I;
20486
20486
  return s.__generator(this, function(U) {
20487
20487
  switch (U.label) {
20488
20488
  case 0:
20489
20489
  return C = s.__assign({}, T), [4, v(R, C)];
20490
20490
  case 1:
20491
20491
  return z = U.sent(), I = new Promise(function(k, M) {
20492
- A = k, L = M;
20492
+ j = k, L = M;
20493
20493
  }), l.grpc.unary(d.SignalingService.OptionalWebRTCConfig, { request: new c.OptionalWebRTCConfigRequest(), metadata: { "rpc-host": w }, host: R, transport: z, onEnd: function(k) {
20494
20494
  var M = k.status, S = k.statusMessage, B = k.message;
20495
20495
  if (M === l.grpc.Code.OK && B) {
20496
20496
  if (!(x = B.getConfig()))
20497
- return void A(new c.WebRTCConfig());
20498
- A(x);
20497
+ return void j(new c.WebRTCConfig());
20498
+ j(x);
20499
20499
  } else
20500
20500
  L(S);
20501
20501
  } }), [4, I];
@@ -20533,9 +20533,9 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20533
20533
  }
20534
20534
  }
20535
20535
  e.dialWebRTC = function(R, w, T) {
20536
- var C, z, A, L, x, I, U;
20536
+ var C, z, j, L, x, I, U;
20537
20537
  return s.__awaiter(this, void 0, void 0, function() {
20538
- var k, M, S, B, F, E, D, O, P, W, j, _, G, V, Z, oe, re, le, ae, ie, pe, ne, ge, se, ce, ue, de = this;
20538
+ var k, M, S, B, F, E, D, O, P, W, A, _, G, V, Z, oe, re, le, ae, ie, pe, ne, ge, se, ce, ue, de = this;
20539
20539
  return s.__generator(this, function(J) {
20540
20540
  switch (J.label) {
20541
20541
  case 0:
@@ -20547,13 +20547,13 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20547
20547
  case 2:
20548
20548
  B = J.sent(), F = B.pc, E = B.dc, D = !1, J.label = 3;
20549
20549
  case 3:
20550
- return J.trys.push([3, , 10, 11]), O = T, T && (O = s.__assign({}, T), T.accessToken || (O.authEntity = (C = T?.webrtcOptions) === null || C === void 0 ? void 0 : C.signalingAuthEntity, O.authEntity || (O.externalAuthAddress ? O.authEntity = (z = T.externalAuthAddress) === null || z === void 0 ? void 0 : z.replace(/^(.*:\/\/)/, "") : O.authEntity = R.replace(/^(.*:\/\/)/, "")), O.credentials = (A = T?.webrtcOptions) === null || A === void 0 ? void 0 : A.signalingCredentials, O.accessToken = (L = T?.webrtcOptions) === null || L === void 0 ? void 0 : L.signalingAccessToken), O.externalAuthAddress = (x = T?.webrtcOptions) === null || x === void 0 ? void 0 : x.signalingExternalAuthAddress, O.externalAuthToEntity = (I = T?.webrtcOptions) === null || I === void 0 ? void 0 : I.signalingExternalAuthToEntity), [4, v(R, O)];
20550
+ return J.trys.push([3, , 10, 11]), O = T, T && (O = s.__assign({}, T), T.accessToken || (O.authEntity = (C = T?.webrtcOptions) === null || C === void 0 ? void 0 : C.signalingAuthEntity, O.authEntity || (O.externalAuthAddress ? O.authEntity = (z = T.externalAuthAddress) === null || z === void 0 ? void 0 : z.replace(/^(.*:\/\/)/, "") : O.authEntity = R.replace(/^(.*:\/\/)/, "")), O.credentials = (j = T?.webrtcOptions) === null || j === void 0 ? void 0 : j.signalingCredentials, O.accessToken = (L = T?.webrtcOptions) === null || L === void 0 ? void 0 : L.signalingAccessToken), O.externalAuthAddress = (x = T?.webrtcOptions) === null || x === void 0 ? void 0 : x.signalingExternalAuthAddress, O.externalAuthToEntity = (I = T?.webrtcOptions) === null || I === void 0 ? void 0 : I.signalingExternalAuthToEntity), [4, v(R, O)];
20551
20551
  case 4:
20552
- return P = J.sent(), W = l.grpc.client(d.SignalingService.Call, { host: R, transport: P }), j = "", _ = !1, G = function(q) {
20552
+ return P = J.sent(), W = l.grpc.client(d.SignalingService.Call, { host: R, transport: P }), A = "", _ = !1, G = function(q) {
20553
20553
  if (!_) {
20554
20554
  _ = !0;
20555
20555
  var N = new c.CallUpdateRequest();
20556
- N.setUuid(j);
20556
+ N.setUuid(A);
20557
20557
  var $ = new o.Status();
20558
20558
  $.setCode(t.Code.UNKNOWN), $.setMessage(q), N.setError($), l.grpc.unary(d.SignalingService.CallUpdate, { request: N, metadata: { "rpc-host": w }, host: R, transport: P, onEnd: function(K) {
20559
20559
  var H = K.status, Y = K.statusMessage, Q = K.message;
@@ -20564,7 +20564,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20564
20564
  if (!_) {
20565
20565
  _ = !0;
20566
20566
  var q = new c.CallUpdateRequest();
20567
- q.setUuid(j), q.setDone(!0), l.grpc.unary(d.SignalingService.CallUpdate, { request: q, metadata: { "rpc-host": w }, host: R, transport: P, onEnd: function(N) {
20567
+ q.setUuid(A), q.setDone(!0), l.grpc.unary(d.SignalingService.CallUpdate, { request: q, metadata: { "rpc-host": w }, host: R, transport: P, onEnd: function(N) {
20568
20568
  var $ = N.status, K = N.statusMessage, H = N.message;
20569
20569
  $ === l.grpc.Code.OK && H || console.error(K);
20570
20570
  } });
@@ -20581,7 +20581,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20581
20581
  case 0:
20582
20582
  return [4, oe];
20583
20583
  case 1:
20584
- return K.sent(), re ? [2] : q.candidate === null ? (ae = !0, V(), [2]) : (H = q.candidate, (Y = new c.ICECandidate()).setCandidate(H.candidate), H.sdpMid && Y.setSdpMid(H.sdpMid), H.sdpMLineIndex && Y.setSdpmLineIndex(H.sdpMLineIndex), H.usernameFragment && Y.setUsernameFragment(H.usernameFragment), N = Y, ($ = new c.CallUpdateRequest()).setUuid(j), $.setCandidate(N), l.grpc.unary(d.SignalingService.CallUpdate, { request: $, metadata: { "rpc-host": w }, host: R, transport: P, onEnd: function(Q) {
20584
+ return K.sent(), re ? [2] : q.candidate === null ? (ae = !0, V(), [2]) : (H = q.candidate, (Y = new c.ICECandidate()).setCandidate(H.candidate), H.sdpMid && Y.setSdpMid(H.sdpMid), H.sdpMLineIndex && Y.setSdpmLineIndex(H.sdpMLineIndex), H.usernameFragment && Y.setUsernameFragment(H.usernameFragment), N = Y, ($ = new c.CallUpdateRequest()).setUuid(A), $.setCandidate(N), l.grpc.unary(d.SignalingService.CallUpdate, { request: $, metadata: { "rpc-host": w }, host: R, transport: P, onEnd: function(Q) {
20585
20585
  var ee = Q.status, X = Q.statusMessage, te = Q.message;
20586
20586
  ee === l.grpc.Code.OK && te || re || ae || console.error("error sending candidate", X);
20587
20587
  } }), [2]);
@@ -20599,7 +20599,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20599
20599
  return s.__generator(this, function(ee) {
20600
20600
  switch (ee.label) {
20601
20601
  case 0:
20602
- return (N = q).hasInit() ? ie ? (G("got init stage more than once"), [2]) : ($ = N.getInit(), ie = !0, j = N.getUuid(), K = new RTCSessionDescription(JSON.parse(atob($.getSdp()))), [4, F.setRemoteDescription(K)]) : [3, 2];
20602
+ return (N = q).hasInit() ? ie ? (G("got init stage more than once"), [2]) : ($ = N.getInit(), ie = !0, A = N.getUuid(), K = new RTCSessionDescription(JSON.parse(atob($.getSdp()))), [4, F.setRemoteDescription(K)]) : [3, 2];
20603
20603
  case 1:
20604
20604
  return ee.sent(), Z(!0), S?.disableTrickleICE ? (re = !0, V(), [2]) : [3, 8];
20605
20605
  case 2:
@@ -20607,8 +20607,8 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20607
20607
  return [3, 7];
20608
20608
  if (!ie)
20609
20609
  return G("got update stage before init stage"), [2];
20610
- if (N.getUuid() !== j)
20611
- return G("uuid mismatch; have=".concat(N.getUuid(), " want=").concat(j)), [2];
20610
+ if (N.getUuid() !== A)
20611
+ return G("uuid mismatch; have=".concat(N.getUuid(), " want=").concat(A)), [2];
20612
20612
  H = N.getUpdate(), X = H.getCandidate(), te = { candidate: X.getCandidate() }, X.hasSdpMid() && (te.sdpMid = X.getSdpMid()), X.hasSdpmLineIndex() && (te.sdpMLineIndex = X.getSdpmLineIndex()), X.hasUsernameFragment() && (te.usernameFragment = X.getUsernameFragment()), Y = te, ee.label = 3;
20613
20613
  case 3:
20614
20614
  return ee.trys.push([3, 5, , 6]), [4, F.addIceCandidate(Y)];
@@ -20798,23 +20798,23 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20798
20798
  }
20799
20799
  function u(M, S, B, F) {
20800
20800
  return new (B || (B = Promise))(function(E, D) {
20801
- function O(j) {
20801
+ function O(A) {
20802
20802
  try {
20803
- W(F.next(j));
20803
+ W(F.next(A));
20804
20804
  } catch (_) {
20805
20805
  D(_);
20806
20806
  }
20807
20807
  }
20808
- function P(j) {
20808
+ function P(A) {
20809
20809
  try {
20810
- W(F.throw(j));
20810
+ W(F.throw(A));
20811
20811
  } catch (_) {
20812
20812
  D(_);
20813
20813
  }
20814
20814
  }
20815
- function W(j) {
20815
+ function W(A) {
20816
20816
  var _;
20817
- j.done ? E(j.value) : (_ = j.value, _ instanceof B ? _ : new B(function(G) {
20817
+ A.done ? E(A.value) : (_ = A.value, _ instanceof B ? _ : new B(function(G) {
20818
20818
  G(_);
20819
20819
  })).then(O, P);
20820
20820
  }
@@ -20831,7 +20831,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20831
20831
  return this;
20832
20832
  }), D;
20833
20833
  function P(W) {
20834
- return function(j) {
20834
+ return function(A) {
20835
20835
  return function(_) {
20836
20836
  if (B)
20837
20837
  throw new TypeError("Generator is already executing.");
@@ -20881,7 +20881,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20881
20881
  if (5 & _[0])
20882
20882
  throw _[1];
20883
20883
  return { value: _[0] ? _[1] : void 0, done: !0 };
20884
- }([W, j]);
20884
+ }([W, A]);
20885
20885
  };
20886
20886
  }
20887
20887
  }
@@ -20967,7 +20967,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20967
20967
  }
20968
20968
  function P(G, V) {
20969
20969
  try {
20970
- (Z = E[G](V)).value instanceof R ? Promise.resolve(Z.value.v).then(W, j) : _(D[0][2], Z);
20970
+ (Z = E[G](V)).value instanceof R ? Promise.resolve(Z.value.v).then(W, A) : _(D[0][2], Z);
20971
20971
  } catch (oe) {
20972
20972
  _(D[0][3], oe);
20973
20973
  }
@@ -20976,7 +20976,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20976
20976
  function W(G) {
20977
20977
  P("next", G);
20978
20978
  }
20979
- function j(G) {
20979
+ function A(G) {
20980
20980
  P("throw", G);
20981
20981
  }
20982
20982
  function _(G, V) {
@@ -21006,10 +21006,10 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
21006
21006
  function F(E) {
21007
21007
  S[E] = M[E] && function(D) {
21008
21008
  return new Promise(function(O, P) {
21009
- (function(W, j, _, G) {
21009
+ (function(W, A, _, G) {
21010
21010
  Promise.resolve(G).then(function(V) {
21011
21011
  W({ value: V, done: _ });
21012
- }, j);
21012
+ }, A);
21013
21013
  })(O, P, (D = M[E](D)).done, D.value);
21014
21014
  });
21015
21015
  };
@@ -21018,7 +21018,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
21018
21018
  function z(M, S) {
21019
21019
  return Object.defineProperty ? Object.defineProperty(M, "raw", { value: S }) : M.raw = S, M;
21020
21020
  }
21021
- var A = Object.create ? function(M, S) {
21021
+ var j = Object.create ? function(M, S) {
21022
21022
  Object.defineProperty(M, "default", { enumerable: !0, value: S });
21023
21023
  } : function(M, S) {
21024
21024
  M.default = S;
@@ -21030,7 +21030,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
21030
21030
  if (M != null)
21031
21031
  for (var B in M)
21032
21032
  B !== "default" && Object.prototype.hasOwnProperty.call(M, B) && d(S, M, B);
21033
- return A(S, M), S;
21033
+ return j(S, M), S;
21034
21034
  }
21035
21035
  function x(M) {
21036
21036
  return M && M.__esModule ? M : { default: M };
@@ -23254,8 +23254,8 @@ var grpcWebClient_umdExports$1 = {}, grpcWebClient_umd$1 = {
23254
23254
  else {
23255
23255
  var T = this.buffer.byteLength - this.position, C = new Uint8Array(T + b.byteLength), z = v(this.buffer, this.position);
23256
23256
  C.set(z, 0);
23257
- var A = new Uint8Array(b);
23258
- C.set(A, T), this.buffer = C, this.position = 0;
23257
+ var j = new Uint8Array(b);
23258
+ C.set(j, T), this.buffer = C, this.position = 0;
23259
23259
  }
23260
23260
  for (; ; ) {
23261
23261
  if (!m(this.buffer, this.position, 5))
@@ -37366,8 +37366,7 @@ var MovementSensorServiceClient_1 = MovementSensorServiceClient, navigation_pb =
37366
37366
  }, proto.viam.service.navigation.v1.Mode = {
37367
37367
  MODE_UNSPECIFIED: 0,
37368
37368
  MODE_MANUAL: 1,
37369
- MODE_WAYPOINT: 2,
37370
- MODE_EXPLORE: 3
37369
+ MODE_WAYPOINT: 2
37371
37370
  }, n.object.extend(i, proto.viam.service.navigation.v1);
37372
37371
  })(navigation_pb);
37373
37372
  var service_navigation_v1_navigation_pb = navigation_pb, common_v1_common_pb$8 = common_pb, grpc$e = grpcWebClient_umdExports$1.grpc, NavigationService = function() {
@@ -41328,9 +41327,9 @@ class GRPCConnectionManager {
41328
41327
  this.client.getOperations(
41329
41328
  s,
41330
41329
  new grpcWebClient_umdExports$1.grpc.Metadata(),
41331
- (l, g) => {
41330
+ (l) => {
41332
41331
  if (l) {
41333
- console.debug(l, g), events.emit(DISCONNECTED, {});
41332
+ events.emit(DISCONNECTED, {});
41334
41333
  return;
41335
41334
  }
41336
41335
  e ? e.postMessage(this.heartbeatIntervalMs) : setTimeout(() => n(), this.heartbeatIntervalMs);
@@ -42334,7 +42333,7 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
42334
42333
  for (; ; ) {
42335
42334
  if (!d(this.buffer, this.position, 5))
42336
42335
  return R;
42337
- var A = m(this.buffer, this.position, this.position + 5), L = new DataView(A.buffer, A.byteOffset, A.byteLength), x = c(L);
42336
+ var j = m(this.buffer, this.position, this.position + 5), L = new DataView(j.buffer, j.byteOffset, j.byteLength), x = c(L);
42338
42337
  if (!d(this.buffer, this.position, 5 + x))
42339
42338
  return R;
42340
42339
  var I = m(this.buffer, this.position + 5, this.position + 5 + x);
@@ -46328,6 +46327,13 @@ const isPosInt = (i) => !!(i > 0 && Number.isInteger(i)), isLocalConnection = (i
46328
46327
  return typeof e.signalingAddress != "string" ? !1 : !e.iceServers || Array.isArray(e.iceServers);
46329
46328
  }, createRobotClient = async (i) => {
46330
46329
  let e;
46330
+ if (i.authEntity)
46331
+ try {
46332
+ i.authEntity = new URL(i.authEntity).host;
46333
+ } catch (n) {
46334
+ if (!(n instanceof TypeError))
46335
+ throw n;
46336
+ }
46331
46337
  if (i.reconnectMaxAttempts && !isPosInt(i.reconnectMaxAttempts))
46332
46338
  throw new Error(
46333
46339
  `Value of max reconnect attempts (${i.reconnectMaxAttempts}) should be a positive integer`
@@ -50713,6 +50719,7 @@ class BaseClient {
50713
50719
  return s.setName(this.name), s.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(s), (await promisify(n.getProperties.bind(n), s)).toObject();
50714
50720
  }
50715
50721
  }
50722
+ const { PowerMode } = board_pb;
50716
50723
  class BoardClient {
50717
50724
  client;
50718
50725
  name;
@@ -50793,10 +50800,28 @@ class BoardClient {
50793
50800
  const { boardService: s } = this, l = new board_pb.ReadAnalogReaderRequest();
50794
50801
  return l.setBoardName(this.name), l.setAnalogReaderName(e), l.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(l), (await promisify(s.readAnalogReader.bind(s), l)).getValue();
50795
50802
  }
50803
+ async writeAnalog(e, n, s = {}) {
50804
+ const { boardService: l } = this, g = new board_pb.WriteAnalogRequest();
50805
+ g.setName(this.name), g.setPin(e), g.setValue(n), g.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(g), await promisify(
50806
+ l.writeAnalog.bind(l),
50807
+ g
50808
+ );
50809
+ }
50796
50810
  async getDigitalInterruptValue(e, n = {}) {
50797
50811
  const { boardService: s } = this, l = new board_pb.GetDigitalInterruptValueRequest();
50798
50812
  return l.setBoardName(this.name), l.setDigitalInterruptName(e), l.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(l), (await promisify(s.getDigitalInterruptValue.bind(s), l)).getValue();
50799
50813
  }
50814
+ async setPowerMode(e, n, s, l = {}) {
50815
+ const { boardService: g } = this, p = new board_pb.SetPowerModeRequest();
50816
+ if (p.setName(e), p.setPowerMode(n), s) {
50817
+ const t = new duration_pb.Duration();
50818
+ t.setNanos(s.nanos), t.setSeconds(s.seconds), p.setDuration(t);
50819
+ }
50820
+ p.setExtra(struct_pb.Struct.fromJavaScript(l)), this.options.requestLogger?.(p), await promisify(
50821
+ g.setPowerMode.bind(g),
50822
+ p
50823
+ );
50824
+ }
50800
50825
  async doCommand(e) {
50801
50826
  const { boardService: n } = this;
50802
50827
  return doCommandFromClient(n, this.name, e, this.options);
@@ -54398,7 +54423,7 @@ const concatArrayU8 = (i) => {
54398
54423
  for (const l of i)
54399
54424
  n.set(l, s), s += l.length;
54400
54425
  return n;
54401
- }, version = "0.4.0";
54426
+ }, version = "0.5.0";
54402
54427
  export {
54403
54428
  ArmClient,
54404
54429
  BaseClient,
@@ -54414,6 +54439,7 @@ export {
54414
54439
  MotorClient,
54415
54440
  MovementSensorClient,
54416
54441
  NavigationClient,
54442
+ PowerMode,
54417
54443
  PowerSensorClient,
54418
54444
  RobotClient,
54419
54445
  SensorClient,