@viamrobotics/sdk 0.49.0 → 0.50.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/dist/api-version.d.ts +1 -1
  2. package/dist/app/data-client.d.ts +2 -2
  3. package/dist/assert.d.ts +9 -0
  4. package/dist/components/camera/camera.d.ts +30 -1
  5. package/dist/components/camera/client.d.ts +9 -1
  6. package/dist/constants.d.ts +1 -1
  7. package/dist/gen/app/data/v1/data_connect.d.ts +4 -0
  8. package/dist/gen/app/data/v1/data_pb.d.ts +8 -0
  9. package/dist/gen/common/v1/common_pb.d.ts +44 -0
  10. package/dist/gen/service/datamanager/v1/data_manager_connect.d.ts +12 -1
  11. package/dist/gen/service/datamanager/v1/data_manager_pb.d.ts +71 -0
  12. package/dist/gen/service/motion/v1/motion_pb.d.ts +41 -2
  13. package/dist/gen/service/worldstatestore/v1/world_state_store_connect.d.ts +62 -0
  14. package/dist/gen/service/worldstatestore/v1/world_state_store_pb.d.ts +224 -0
  15. package/dist/main.d.ts +1 -0
  16. package/dist/main.es.js +5775 -5389
  17. package/dist/main.umd.js +7 -7
  18. package/dist/robot/client.d.ts +121 -37
  19. package/dist/robot/dial.d.ts +1 -46
  20. package/dist/robot/robot.d.ts +1 -2
  21. package/dist/robot/session-manager.d.ts +2 -1
  22. package/dist/robot.d.ts +2 -2
  23. package/dist/rpc/signaling-exchange.d.ts +2 -2
  24. package/dist/services/data-manager/client.d.ts +27 -0
  25. package/dist/services/data-manager/data-manager.d.ts +2 -0
  26. package/dist/services/motion/types.d.ts +2 -1
  27. package/dist/services/world-state-store/client.d.ts +22 -0
  28. package/dist/services/world-state-store/client.spec.d.ts +1 -0
  29. package/dist/services/world-state-store/index.d.ts +5 -0
  30. package/dist/services/world-state-store/types.d.ts +9 -0
  31. package/dist/services/world-state-store/world-state-store.d.ts +76 -0
  32. package/dist/types.d.ts +2 -1
  33. package/package.json +2 -1
@@ -1,15 +1,59 @@
1
1
  import { type ServiceType } from '@bufbuild/protobuf';
2
- import { type PromiseClient } from '@connectrpc/connect';
2
+ import { type Client } from '@connectrpc/connect';
3
3
  import { type Credentials } from '../app/viam-transport';
4
4
  import { EventDispatcher } from '../events';
5
5
  import type { PoseInFrame, Transform } from '../gen/common/v1/common_pb';
6
6
  import { GetModelsFromModulesRequest, RestartModuleRequest, TransformPCDRequest, TransformPoseRequest } from '../gen/robot/v1/robot_pb';
7
7
  import type { Robot } from './robot';
8
+ import type { AccessToken, Credential } from '../main';
9
+ interface ICEServer {
10
+ urls: string;
11
+ username?: string;
12
+ credential?: string;
13
+ }
14
+ /** Options required to dial a robot via WebRTC. */
15
+ export interface DialWebRTCConf {
16
+ host: string;
17
+ credentials?: Credential | AccessToken;
18
+ disableSessions?: boolean;
19
+ noReconnect?: boolean;
20
+ /** @default 10. */
21
+ reconnectMaxAttempts?: number;
22
+ /** @default Number.POSITIVE_INFINITY */
23
+ reconnectMaxWait?: number;
24
+ reconnectAbortSignal?: {
25
+ abort: boolean;
26
+ };
27
+ serviceHost?: string;
28
+ signalingAddress: string;
29
+ iceServers?: ICEServer[];
30
+ priority?: number;
31
+ /**
32
+ * Set timeout in milliseconds for dialing. Default is defined by
33
+ * DIAL_TIMEOUT. A value of 0 disables the timeout.
34
+ */
35
+ dialTimeout?: number;
36
+ }
37
+ /** Options required to dial a robot via gRPC. */
38
+ export interface DialDirectConf {
39
+ host: string;
40
+ credentials?: Credential | AccessToken;
41
+ disableSessions?: boolean;
42
+ noReconnect?: boolean;
43
+ reconnectMaxAttempts?: number;
44
+ reconnectMaxWait?: number;
45
+ reconnectAbortSignal?: {
46
+ abort: boolean;
47
+ };
48
+ dialTimeout?: number;
49
+ }
50
+ /** Options required to dial a robot. */
51
+ export type DialConf = DialDirectConf | DialWebRTCConf;
8
52
  interface WebRTCOptions {
9
53
  enabled: boolean;
10
54
  host: string;
11
55
  signalingAddress: string;
12
- rtcConfig: RTCConfiguration | undefined;
56
+ rtcConfig: RTCConfiguration;
13
57
  noReconnect?: boolean;
14
58
  reconnectMaxAttempts?: number;
15
59
  reconnectMaxWait?: number;
@@ -27,13 +71,19 @@ export interface ConnectOptions {
27
71
  priority?: number;
28
72
  dialTimeout?: number;
29
73
  }
74
+ export declare const isDialWebRTCConf: (value: DialConf) => value is DialWebRTCConf;
75
+ /**
76
+ * Validates a DialConf passed to createRobotClient. Throws an error for invalid
77
+ * configs.
78
+ */
79
+ export declare const validateDialConf: (conf: DialConf) => void;
30
80
  /**
31
81
  * A gRPC-web client for a Robot.
32
82
  *
33
83
  * @group Clients
34
84
  */
35
85
  export declare class RobotClient extends EventDispatcher implements Robot {
36
- private readonly serviceHost;
86
+ private serviceHost;
37
87
  private readonly webrtcOptions;
38
88
  private readonly directOptions;
39
89
  private readonly sessionOptions;
@@ -64,14 +114,16 @@ export declare class RobotClient extends EventDispatcher implements Robot {
64
114
  private visionServiceClient;
65
115
  private servoServiceClient;
66
116
  private slamServiceClient;
67
- constructor(serviceHost: string, webrtcOptions?: WebRTCOptions, sessionOptions?: SessionOptions, directOptions?: DirectOptions);
117
+ private worldStateStoreServiceClient;
118
+ private currentRetryAttempt;
119
+ constructor(serviceHost?: string, webrtcOptions?: WebRTCOptions, sessionOptions?: SessionOptions, directOptions?: DirectOptions);
68
120
  private onDisconnect;
69
121
  private get noReconnect();
70
122
  private get reconnectMaxAttempts();
71
123
  private get reconnectMaxWait();
72
124
  get sessionId(): string;
73
125
  private static readonly notConnectedYetStr;
74
- get robotService(): PromiseClient<{
126
+ get robotService(): Client<{
75
127
  readonly typeName: "viam.robot.v1.RobotService";
76
128
  readonly methods: {
77
129
  readonly getOperations: {
@@ -220,7 +272,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
220
272
  };
221
273
  };
222
274
  }>;
223
- get armService(): PromiseClient<{
275
+ get armService(): Client<{
224
276
  readonly typeName: "viam.component.arm.v1.ArmService";
225
277
  readonly methods: {
226
278
  readonly getEndPosition: {
@@ -285,7 +337,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
285
337
  };
286
338
  };
287
339
  }>;
288
- get baseService(): PromiseClient<{
340
+ get baseService(): Client<{
289
341
  readonly typeName: "viam.component.base.v1.BaseService";
290
342
  readonly methods: {
291
343
  readonly moveStraight: {
@@ -344,7 +396,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
344
396
  };
345
397
  };
346
398
  }>;
347
- get boardService(): PromiseClient<{
399
+ get boardService(): Client<{
348
400
  readonly typeName: "viam.component.board.v1.BoardService";
349
401
  readonly methods: {
350
402
  readonly setGPIO: {
@@ -374,7 +426,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
374
426
  readonly pWMFrequency: {
375
427
  readonly name: "PWMFrequency";
376
428
  readonly I: typeof import("../gen/component/board/v1/board_pb").PWMFrequencyRequest;
377
- readonly O: typeof import("../gen/component/board/v1/board_pb").PWMFrequencyResponse;
429
+ readonly O: typeof import("../gen/component/board/v1/board_pb").PWMFrequencyResponse; /** @default 10. */
378
430
  readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
379
431
  };
380
432
  readonly setPWMFrequency: {
@@ -427,7 +479,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
427
479
  };
428
480
  };
429
481
  }>;
430
- get encoderService(): PromiseClient<{
482
+ get encoderService(): Client<{
431
483
  readonly typeName: "viam.component.encoder.v1.EncoderService";
432
484
  readonly methods: {
433
485
  readonly getPosition: {
@@ -462,7 +514,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
462
514
  };
463
515
  };
464
516
  }>;
465
- get gantryService(): PromiseClient<{
517
+ get gantryService(): Client<{
466
518
  readonly typeName: "viam.component.gantry.v1.GantryService";
467
519
  readonly methods: {
468
520
  readonly getPosition: {
@@ -515,7 +567,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
515
567
  };
516
568
  };
517
569
  }>;
518
- get genericService(): PromiseClient<{
570
+ get genericService(): Client<{
519
571
  readonly typeName: "viam.component.generic.v1.GenericService";
520
572
  readonly methods: {
521
573
  readonly doCommand: {
@@ -532,7 +584,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
532
584
  };
533
585
  };
534
586
  }>;
535
- get gripperService(): PromiseClient<{
587
+ get gripperService(): Client<{
536
588
  readonly typeName: "viam.component.gripper.v1.GripperService";
537
589
  readonly methods: {
538
590
  readonly open: {
@@ -567,7 +619,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
567
619
  };
568
620
  readonly doCommand: {
569
621
  readonly name: "DoCommand";
570
- readonly I: typeof import("../gen/common/v1/common_pb").DoCommandRequest;
622
+ readonly I: typeof import("../gen/common/v1/common_pb").DoCommandRequest; /** @default Number.POSITIVE_INFINITY */
571
623
  readonly O: typeof import("../gen/common/v1/common_pb").DoCommandResponse;
572
624
  readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
573
625
  };
@@ -585,7 +637,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
585
637
  };
586
638
  };
587
639
  }>;
588
- get mlModelService(): PromiseClient<{
640
+ get mlModelService(): Client<{
589
641
  readonly typeName: "viam.service.mlmodel.v1.MLModelService";
590
642
  readonly methods: {
591
643
  readonly infer: {
@@ -602,7 +654,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
602
654
  };
603
655
  };
604
656
  }>;
605
- get movementSensorService(): PromiseClient<{
657
+ get movementSensorService(): Client<{
606
658
  readonly typeName: "viam.component.movementsensor.v1.MovementSensorService";
607
659
  readonly methods: {
608
660
  readonly getLinearVelocity: {
@@ -643,6 +695,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
643
695
  };
644
696
  readonly getAccuracy: {
645
697
  readonly name: "GetAccuracy";
698
+ /** Options required to dial a robot via gRPC. */
646
699
  readonly I: typeof import("../gen/component/movementsensor/v1/movementsensor_pb").GetAccuracyRequest;
647
700
  readonly O: typeof import("../gen/component/movementsensor/v1/movementsensor_pb").GetAccuracyResponse;
648
701
  readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
@@ -673,7 +726,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
673
726
  };
674
727
  };
675
728
  }>;
676
- get powerSensorService(): PromiseClient<{
729
+ get powerSensorService(): Client<{
677
730
  readonly typeName: "viam.component.powersensor.v1.PowerSensorService";
678
731
  readonly methods: {
679
732
  readonly getVoltage: {
@@ -708,7 +761,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
708
761
  };
709
762
  };
710
763
  }>;
711
- get inputControllerService(): PromiseClient<{
764
+ get inputControllerService(): Client<{
712
765
  readonly typeName: "viam.component.inputcontroller.v1.InputControllerService";
713
766
  readonly methods: {
714
767
  readonly getControls: {
@@ -738,11 +791,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
738
791
  readonly doCommand: {
739
792
  readonly name: "DoCommand";
740
793
  readonly I: typeof import("../gen/common/v1/common_pb").DoCommandRequest;
741
- readonly O: typeof import("../gen/common/v1/common_pb").DoCommandResponse; /**
742
- * A gRPC-web client for a Robot.
743
- *
744
- * @group Clients
745
- */
794
+ readonly O: typeof import("../gen/common/v1/common_pb").DoCommandResponse;
746
795
  readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
747
796
  };
748
797
  readonly getGeometries: {
@@ -753,7 +802,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
753
802
  };
754
803
  };
755
804
  }>;
756
- get motorService(): PromiseClient<{
805
+ get motorService(): Client<{
757
806
  readonly typeName: "viam.component.motor.v1.MotorService";
758
807
  readonly methods: {
759
808
  readonly setPower: {
@@ -776,13 +825,12 @@ export declare class RobotClient extends EventDispatcher implements Robot {
776
825
  };
777
826
  readonly setRPM: {
778
827
  readonly name: "SetRPM";
779
- readonly I: typeof import("../gen/component/motor/v1/motor_pb").SetRPMRequest; /**
780
- * A gRPC-web client for a Robot.
781
- *
782
- * @group Clients
783
- */
828
+ readonly I: typeof import("../gen/component/motor/v1/motor_pb").SetRPMRequest;
784
829
  readonly O: typeof import("../gen/component/motor/v1/motor_pb").SetRPMResponse;
785
- readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
830
+ readonly kind: import("@bufbuild/protobuf").MethodKind.Unary; /**
831
+ * Set timeout in milliseconds for dialing. Default is defined by
832
+ * DIAL_TIMEOUT. A value of 0 disables the timeout.
833
+ */
786
834
  };
787
835
  readonly resetZeroPosition: {
788
836
  readonly name: "ResetZeroPosition";
@@ -834,7 +882,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
834
882
  };
835
883
  };
836
884
  }>;
837
- get navigationService(): PromiseClient<{
885
+ get navigationService(): Client<{
838
886
  readonly typeName: "viam.service.navigation.v1.NavigationService";
839
887
  readonly methods: {
840
888
  readonly getMode: {
@@ -881,6 +929,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
881
929
  };
882
930
  readonly getPaths: {
883
931
  readonly name: "GetPaths";
932
+ /** Options required to dial a robot via gRPC. */
884
933
  readonly I: typeof import("../gen/service/navigation/v1/navigation_pb").GetPathsRequest;
885
934
  readonly O: typeof import("../gen/service/navigation/v1/navigation_pb").GetPathsResponse;
886
935
  readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
@@ -899,7 +948,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
899
948
  };
900
949
  };
901
950
  }>;
902
- get discoveryService(): PromiseClient<{
951
+ get discoveryService(): Client<{
903
952
  readonly typeName: "viam.service.discovery.v1.DiscoveryService";
904
953
  readonly methods: {
905
954
  readonly discoverResources: {
@@ -916,7 +965,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
916
965
  };
917
966
  };
918
967
  }>;
919
- get motionService(): PromiseClient<{
968
+ get motionService(): Client<{
920
969
  readonly typeName: "viam.service.motion.v1.MotionService";
921
970
  readonly methods: {
922
971
  readonly move: {
@@ -969,7 +1018,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
969
1018
  };
970
1019
  };
971
1020
  }>;
972
- get visionService(): PromiseClient<{
1021
+ get visionService(): Client<{
973
1022
  readonly typeName: "viam.service.vision.v1.VisionService";
974
1023
  readonly methods: {
975
1024
  readonly getDetectionsFromCamera: {
@@ -1022,7 +1071,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
1022
1071
  };
1023
1072
  };
1024
1073
  }>;
1025
- get servoService(): PromiseClient<{
1074
+ get servoService(): Client<{
1026
1075
  readonly typeName: "viam.component.servo.v1.ServoService";
1027
1076
  readonly methods: {
1028
1077
  readonly move: {
@@ -1057,13 +1106,14 @@ export declare class RobotClient extends EventDispatcher implements Robot {
1057
1106
  };
1058
1107
  readonly getGeometries: {
1059
1108
  readonly name: "GetGeometries";
1109
+ /** @default 10. */
1060
1110
  readonly I: typeof import("../gen/common/v1/common_pb").GetGeometriesRequest;
1061
1111
  readonly O: typeof import("../gen/common/v1/common_pb").GetGeometriesResponse;
1062
1112
  readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
1063
1113
  };
1064
1114
  };
1065
1115
  }>;
1066
- get slamService(): PromiseClient<{
1116
+ get slamService(): Client<{
1067
1117
  readonly typeName: "viam.service.slam.v1.SLAMService";
1068
1118
  readonly methods: {
1069
1119
  readonly getPosition: {
@@ -1085,6 +1135,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
1085
1135
  readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
1086
1136
  };
1087
1137
  readonly getProperties: {
1138
+ /** Options required to dial a robot via WebRTC. */
1088
1139
  readonly name: "GetProperties";
1089
1140
  readonly I: typeof import("../gen/service/slam/v1/slam_pb").GetPropertiesRequest;
1090
1141
  readonly O: typeof import("../gen/service/slam/v1/slam_pb").GetPropertiesResponse;
@@ -1098,8 +1149,41 @@ export declare class RobotClient extends EventDispatcher implements Robot {
1098
1149
  };
1099
1150
  };
1100
1151
  }>;
1101
- createServiceClient<T extends ServiceType>(svcType: T): PromiseClient<T>;
1152
+ get worldStateStoreService(): Client<{
1153
+ readonly typeName: "viam.service.worldstatestore.v1.WorldStateStoreService";
1154
+ readonly methods: {
1155
+ readonly listUUIDs: {
1156
+ readonly name: "ListUUIDs";
1157
+ readonly I: typeof import("../gen/service/worldstatestore/v1/world_state_store_pb").ListUUIDsRequest;
1158
+ readonly O: typeof import("../gen/service/worldstatestore/v1/world_state_store_pb").ListUUIDsResponse;
1159
+ readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
1160
+ };
1161
+ readonly getTransform: {
1162
+ readonly name: "GetTransform";
1163
+ readonly I: typeof import("../gen/service/worldstatestore/v1/world_state_store_pb").GetTransformRequest;
1164
+ readonly O: typeof import("../gen/service/worldstatestore/v1/world_state_store_pb").GetTransformResponse;
1165
+ readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
1166
+ };
1167
+ readonly streamTransformChanges: {
1168
+ readonly name: "StreamTransformChanges";
1169
+ readonly I: typeof import("../gen/service/worldstatestore/v1/world_state_store_pb").StreamTransformChangesRequest;
1170
+ readonly O: typeof import("../gen/service/worldstatestore/v1/world_state_store_pb").StreamTransformChangesResponse;
1171
+ readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
1172
+ };
1173
+ readonly doCommand: {
1174
+ readonly name: "DoCommand";
1175
+ readonly I: typeof import("../gen/common/v1/common_pb").DoCommandRequest;
1176
+ readonly O: typeof import("../gen/common/v1/common_pb").DoCommandResponse;
1177
+ readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
1178
+ };
1179
+ };
1180
+ }>;
1181
+ createServiceClient<T extends ServiceType>(svcType: T): Client<T>;
1102
1182
  get peerConnection(): RTCPeerConnection | undefined;
1183
+ private get clientTransport();
1184
+ private dialWebRTC;
1185
+ private dialDirect;
1186
+ dial(conf: DialConf): Promise<this>;
1103
1187
  disconnect(): Promise<void>;
1104
1188
  isConnected(): boolean;
1105
1189
  connect({ creds, priority, dialTimeout, }?: ConnectOptions): Promise<void>;
@@ -1,48 +1,4 @@
1
- import type { AccessToken, Credential } from '../main';
2
- import { RobotClient } from './client';
3
- /** Options required to dial a robot via gRPC. */
4
- export interface DialDirectConf {
5
- host: string;
6
- credentials?: Credential | AccessToken;
7
- disableSessions?: boolean;
8
- noReconnect?: boolean;
9
- reconnectMaxAttempts?: number;
10
- reconnectMaxWait?: number;
11
- reconnectAbortSignal?: {
12
- abort: boolean;
13
- };
14
- dialTimeout?: number;
15
- }
16
- interface ICEServer {
17
- urls: string;
18
- username?: string;
19
- credential?: string;
20
- }
21
- /**
22
- * Options required to dial a robot via WebRTC.
23
- *
24
- * - `reconnectMaxAttempts` value should be a positive int; default is 10.
25
- * - `reconnectMaxWait` value should be a positive int; default is positive
26
- * infinity.
27
- */
28
- export interface DialWebRTCConf {
29
- host: string;
30
- credentials?: Credential | AccessToken;
31
- disableSessions?: boolean;
32
- noReconnect?: boolean;
33
- reconnectMaxAttempts?: number;
34
- reconnectMaxWait?: number;
35
- reconnectAbortSignal?: {
36
- abort: boolean;
37
- };
38
- serviceHost?: string;
39
- signalingAddress: string;
40
- iceServers?: ICEServer[];
41
- priority?: number;
42
- dialTimeout?: number;
43
- }
44
- /** Options required to dial a robot. */
45
- export type DialConf = DialDirectConf | DialWebRTCConf;
1
+ import { RobotClient, type DialConf } from './client';
46
2
  /**
47
3
  * Connect to a robot via WebRTC or gRPC and return a RobotClient after
48
4
  * connecting successfully.
@@ -59,4 +15,3 @@ export type DialConf = DialDirectConf | DialWebRTCConf;
59
15
  * function will automatically re-attempt to connect via gRPC directly.
60
16
  */
61
17
  export declare const createRobotClient: (conf: DialConf) => Promise<RobotClient>;
62
- export {};
@@ -107,8 +107,7 @@ export interface Robot {
107
107
  * specified destination which is a reference frame.
108
108
  *
109
109
  * @param pointCloudPCD - The point clouds to transform. This should be in the
110
- * PCD format encoded into bytes:
111
- * https://pointclouds.org/documentation/tutorials/pcd_file_format.html
110
+ * {@link https://pointclouds.org/documentation/tutorials/pcd_file_format.html PCD format encoded into bytes}
112
111
  * @param source - The reference frame of the point cloud.
113
112
  * @param destination - The reference frame into which the source data should
114
113
  * be transformed, if unset this defaults to the "world" reference frame. Do
@@ -9,8 +9,9 @@ export default class SessionManager {
9
9
  private host;
10
10
  private starting;
11
11
  private get client();
12
- constructor(host: string, deferredTransport: () => Transport);
12
+ constructor(host: string | undefined, deferredTransport: () => Transport);
13
13
  get sessionID(): string;
14
+ setHost(host: string): void;
14
15
  private getSessionMetadataInner;
15
16
  reset(): void;
16
17
  private readonly backgroundHeartbeat;
package/dist/robot.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { RobotClient } from './robot/client';
2
- export { createRobotClient, type DialConf, type DialDirectConf, type DialWebRTCConf, } from './robot/dial';
1
+ export { RobotClient, type DialConf, type DialDirectConf, type DialWebRTCConf, } from './robot/client';
2
+ export { createRobotClient } from './robot/dial';
3
3
  export type { CloudMetadata, Robot } from './robot/robot';
@@ -1,4 +1,4 @@
1
- import type { CallOptions, PromiseClient } from '@connectrpc/connect';
1
+ import type { CallOptions, Client } from '@connectrpc/connect';
2
2
  import { SignalingService } from '../gen/proto/rpc/webrtc/v1/signaling_connect';
3
3
  import { ClientChannel } from './client-channel';
4
4
  import type { DialWebRTCOptions } from './dial';
@@ -19,7 +19,7 @@ export declare class SignalingExchange {
19
19
  private numCallUpdates;
20
20
  private maxCallUpdateDuration;
21
21
  private totalCallUpdateDuration;
22
- constructor(signalingClient: PromiseClient<typeof SignalingService>, callOpts: CallOptions, pc: RTCPeerConnection, dc: RTCDataChannel, dialOpts?: DialWebRTCOptions | undefined);
22
+ constructor(signalingClient: Client<typeof SignalingService>, callOpts: CallOptions, pc: RTCPeerConnection, dc: RTCDataChannel, dialOpts?: DialWebRTCOptions | undefined);
23
23
  doExchange(): Promise<ClientChannel>;
24
24
  private setup;
25
25
  terminate(err: Error): void;
@@ -1,5 +1,6 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
2
  import type { CallOptions } from '@connectrpc/connect';
3
+ import { MimeType } from '../../gen/app/datasync/v1/data_sync_pb.js';
3
4
  import type { RobotClient } from '../../robot';
4
5
  import type { Options } from '../../types';
5
6
  import type { DataManager } from './data-manager';
@@ -49,4 +50,30 @@ export declare class DataManagerClient implements DataManager {
49
50
  * @param callOptions - Call options for the command.
50
51
  */
51
52
  doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
53
+ /**
54
+ * Uploads binary data to specified datasets.
55
+ *
56
+ * @example
57
+ *
58
+ * ```ts
59
+ * const dataManager = new VIAM.DataManagerClient(
60
+ * machine,
61
+ * 'my_data_manager'
62
+ * );
63
+ * await dataManager.uploadBinaryDataToDatasets(
64
+ * new Uint8Array([1, 2, 3]),
65
+ * ['tag1', 'tag2'],
66
+ * ['datasetId1', 'datasetId2'],
67
+ * MimeType.MIME_TYPE_JPEG
68
+ * );
69
+ * ```
70
+ *
71
+ * @param binaryData - The binary data to upload.
72
+ * @param tags - Tags to associate with the binary data.
73
+ * @param datasetIds - IDs of the datasets to associate the binary data with.
74
+ * @param mimeType - The MIME type of the binary data.
75
+ * @param extra - Extra arguments to pass to the upload request.
76
+ * @param callOptions - Call options for the upload request.
77
+ */
78
+ uploadBinaryDataToDatasets(binaryData: Uint8Array, tags: string[], datasetIds: string[], mimeType: MimeType, extra?: {}, callOptions?: CallOptions): Promise<void>;
52
79
  }
@@ -1,5 +1,7 @@
1
1
  import type { Struct } from '@bufbuild/protobuf';
2
+ import { MimeType } from '../../gen/app/datasync/v1/data_sync_pb.js';
2
3
  import type { Resource } from '../../types';
3
4
  export interface DataManager extends Resource {
4
5
  sync: (extra?: Struct) => Promise<void>;
6
+ uploadBinaryDataToDatasets: (binaryData: Uint8Array, tags: string[], datasetIds: string[], mimeType: MimeType, extra?: Struct) => Promise<void>;
5
7
  }
@@ -4,9 +4,10 @@ export type CollisionSpecification = PlainMessage<motionApi.CollisionSpecificati
4
4
  export type Constraints = PlainMessage<motionApi.Constraints>;
5
5
  export type GetPlanResponse = motionApi.GetPlanResponse;
6
6
  export type LinearConstraint = PlainMessage<motionApi.LinearConstraint>;
7
+ export type PseudolinearConstraint = PlainMessage<motionApi.PseudolinearConstraint>;
7
8
  export type ListPlanStatusesResponse = motionApi.ListPlanStatusesResponse;
8
9
  export type MotionConfiguration = PlainMessage<motionApi.MotionConfiguration>;
9
10
  export type ObstacleDetector = PlainMessage<motionApi.ObstacleDetector>;
10
11
  export type OrientationConstraint = PlainMessage<motionApi.OrientationConstraint>;
11
12
  export type PlanState = motionApi.PlanState;
12
- export declare const CollisionSpecification: typeof motionApi.CollisionSpecification, Constraints: typeof motionApi.Constraints, GetPlanResponse: typeof motionApi.GetPlanResponse, LinearConstraint: typeof motionApi.LinearConstraint, ListPlanStatusesResponse: typeof motionApi.ListPlanStatusesResponse, MotionConfiguration: typeof motionApi.MotionConfiguration, ObstacleDetector: typeof motionApi.ObstacleDetector, OrientationConstraint: typeof motionApi.OrientationConstraint, PlanState: typeof motionApi.PlanState;
13
+ export declare const CollisionSpecification: typeof motionApi.CollisionSpecification, Constraints: typeof motionApi.Constraints, GetPlanResponse: typeof motionApi.GetPlanResponse, LinearConstraint: typeof motionApi.LinearConstraint, PseudolinearConstraint: typeof motionApi.PseudolinearConstraint, ListPlanStatusesResponse: typeof motionApi.ListPlanStatusesResponse, MotionConfiguration: typeof motionApi.MotionConfiguration, ObstacleDetector: typeof motionApi.ObstacleDetector, OrientationConstraint: typeof motionApi.OrientationConstraint, PlanState: typeof motionApi.PlanState;
@@ -0,0 +1,22 @@
1
+ import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
3
+ import type { RobotClient } from '../../robot';
4
+ import type { Options } from '../../types';
5
+ import type { WorldStateStore } from './world-state-store';
6
+ import type { TransformChangeEvent } from './types';
7
+ /**
8
+ * A gRPC-web client for a WorldStateStore service.
9
+ *
10
+ * @group Clients
11
+ */
12
+ export declare class WorldStateStoreClient implements WorldStateStore {
13
+ private client;
14
+ readonly name: string;
15
+ private readonly options;
16
+ callOptions: CallOptions;
17
+ constructor(client: RobotClient, name: string, options?: Options);
18
+ listUUIDs(extra?: {}, callOptions?: CallOptions): Promise<string[]>;
19
+ getTransform(uuid: string, extra?: {}, callOptions?: CallOptions): Promise<import("./types").TransformWithUUID>;
20
+ streamTransformChanges(extra?: {}, callOptions?: CallOptions): AsyncGenerator<TransformChangeEvent, void>;
21
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
22
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export { WorldStateStoreClient } from './client';
2
+ export type { WorldStateStore } from './world-state-store';
3
+ export { transformWithUUID } from './world-state-store';
4
+ export type { TransformChangeEvent, TransformWithUUID } from './types';
5
+ export { TransformChangeType } from '../../gen/service/worldstatestore/v1/world_state_store_pb';
@@ -0,0 +1,9 @@
1
+ import type { PlainMessage } from '@bufbuild/protobuf';
2
+ import type { Transform } from '../../gen/common/v1/common_pb';
3
+ import type { StreamTransformChangesResponse } from '../../gen/service/worldstatestore/v1/world_state_store_pb';
4
+ export interface TransformWithUUID extends PlainMessage<Transform> {
5
+ uuidString: string;
6
+ }
7
+ export type TransformChangeEvent = Omit<PlainMessage<StreamTransformChangesResponse>, 'transform'> & {
8
+ transform: TransformWithUUID | undefined;
9
+ };
@@ -0,0 +1,76 @@
1
+ import type { Struct } from '@bufbuild/protobuf';
2
+ import type { Transform, Resource } from '../../types';
3
+ import type { TransformChangeEvent, TransformWithUUID } from './types';
4
+ /**
5
+ * A service that manages world state transforms, allowing storage and retrieval
6
+ * of spatial relationships between reference frames.
7
+ */
8
+ export interface WorldStateStore extends Resource {
9
+ /**
10
+ * ListUUIDs returns all world state transform UUIDs.
11
+ *
12
+ * @example
13
+ *
14
+ * ```ts
15
+ * const worldStateStore = new VIAM.WorldStateStoreClient(
16
+ * machine,
17
+ * 'builtin'
18
+ * );
19
+ *
20
+ * // Get all transform UUIDs
21
+ * const uuids = await worldStateStore.listUUIDs();
22
+ * ```
23
+ *
24
+ * @param extra - Additional arguments to the method
25
+ */
26
+ listUUIDs: (extra?: Struct) => Promise<string[]>;
27
+ /**
28
+ * GetTransform returns a world state transform by UUID.
29
+ *
30
+ * @example
31
+ *
32
+ * ```ts
33
+ * const worldStateStore = new VIAM.WorldStateStoreClient(
34
+ * machine,
35
+ * 'builtin'
36
+ * );
37
+ *
38
+ * // Get a specific transform by UUID
39
+ * const transform = await worldStateStore.getTransform(uuid);
40
+ * ```
41
+ *
42
+ * @param uuid - The UUID of the transform to retrieve
43
+ * @param extra - Additional arguments to the method
44
+ */
45
+ getTransform: (uuid: string, extra?: Struct) => Promise<TransformWithUUID>;
46
+ /**
47
+ * StreamTransformChanges streams changes to world state transforms.
48
+ *
49
+ * The returned transform will only contain the fields that have changed.
50
+ *
51
+ * @example
52
+ *
53
+ * ```ts
54
+ * const worldStateStore = new VIAM.WorldStateStoreClient(
55
+ * machine,
56
+ * 'builtin'
57
+ * );
58
+ *
59
+ * // Stream transform changes
60
+ * const stream = worldStateStore.streamTransformChanges();
61
+ * for await (const change of stream) {
62
+ * console.log(
63
+ * 'Transform change:',
64
+ * change.changeType,
65
+ * change.transform
66
+ * );
67
+ * }
68
+ * ```
69
+ *
70
+ * @param extra - Additional arguments to the method
71
+ */
72
+ streamTransformChanges: (extra?: Struct) => AsyncGenerator<TransformChangeEvent, void>;
73
+ }
74
+ export declare const uuidToString: (uuid: Uint8Array) => string;
75
+ export declare const uuidFromString: (uuid: string) => Uint8Array;
76
+ export declare const transformWithUUID: (transform: Transform) => TransformWithUUID;