@wandelbots/nova-js 3.9.0-pr.280.5d6f11d → 3.9.0-pr.280.641b7e2

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 (55) hide show
  1. package/README.md +3 -0
  2. package/dist/{AutoReconnectingWebsocket-DEs8wlLZ.d.cts → AutoReconnectingWebsocket-DNOF9mpz.d.cts} +2 -1
  3. package/dist/AutoReconnectingWebsocket-DNOF9mpz.d.cts.map +1 -0
  4. package/dist/{AutoReconnectingWebsocket-DEs8wlLZ.d.mts → AutoReconnectingWebsocket-DNOF9mpz.d.mts} +2 -1
  5. package/dist/AutoReconnectingWebsocket-DNOF9mpz.d.mts.map +1 -0
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.d.cts +2 -2
  8. package/dist/index.d.mts +2 -2
  9. package/dist/index.mjs +1 -1
  10. package/dist/lib/deprecated/v1/index.cjs +4 -1
  11. package/dist/lib/deprecated/v1/index.cjs.map +1 -1
  12. package/dist/lib/deprecated/v1/index.d.cts +7 -2
  13. package/dist/lib/deprecated/v1/index.d.cts.map +1 -1
  14. package/dist/lib/deprecated/v1/index.d.mts +7 -2
  15. package/dist/lib/deprecated/v1/index.d.mts.map +1 -1
  16. package/dist/lib/deprecated/v1/index.mjs +4 -1
  17. package/dist/lib/deprecated/v1/index.mjs.map +1 -1
  18. package/dist/lib/v2/index.cjs +37 -25
  19. package/dist/lib/v2/index.cjs.map +1 -1
  20. package/dist/lib/v2/index.d.cts +37 -28
  21. package/dist/lib/v2/index.d.cts.map +1 -1
  22. package/dist/lib/v2/index.d.mts +37 -28
  23. package/dist/lib/v2/index.d.mts.map +1 -1
  24. package/dist/lib/v2/index.mjs +37 -24
  25. package/dist/lib/v2/index.mjs.map +1 -1
  26. package/dist/{wandelscriptUtils-Cz-yQ2eJ.d.mts → wandelscriptUtils-1A9uFPV_.d.cts} +13 -3
  27. package/dist/wandelscriptUtils-1A9uFPV_.d.cts.map +1 -0
  28. package/dist/{wandelscriptUtils-CsQAUu_9.mjs → wandelscriptUtils-C7hQePlo.mjs} +12 -5
  29. package/dist/wandelscriptUtils-C7hQePlo.mjs.map +1 -0
  30. package/dist/{wandelscriptUtils-BvZ8hcul.cjs → wandelscriptUtils-P0WYSZww.cjs} +12 -6
  31. package/dist/wandelscriptUtils-P0WYSZww.cjs.map +1 -0
  32. package/dist/{wandelscriptUtils-_Si3ueEd.d.cts → wandelscriptUtils-pySXnBlX.d.mts} +13 -3
  33. package/dist/wandelscriptUtils-pySXnBlX.d.mts.map +1 -0
  34. package/package.json +2 -3
  35. package/src/lib/deprecated/v1/ConnectedMotionGroup.ts +2 -0
  36. package/src/lib/deprecated/v1/JoggerConnection.ts +2 -0
  37. package/src/lib/deprecated/v1/MotionStreamConnection.ts +1 -0
  38. package/src/lib/deprecated/v1/NovaCellAPIClient.ts +3 -0
  39. package/src/lib/deprecated/v1/NovaClient.ts +8 -8
  40. package/src/lib/deprecated/v1/ProgramStateConnection.ts +4 -0
  41. package/src/lib/deprecated/v1/getLatestTrajectories.ts +1 -0
  42. package/src/lib/deprecated/v1/mock/MockNovaInstance.ts +1 -0
  43. package/src/lib/deprecated/v1/motionStateUpdate.ts +2 -0
  44. package/src/lib/deprecated/v1/wandelscriptUtils.ts +1 -0
  45. package/src/lib/deprecated/v2/NovaCellAPIClient.ts +3 -0
  46. package/src/lib/deprecated/v2/NovaClient.ts +9 -9
  47. package/src/lib/deprecated/v2/wandelscriptUtils.ts +1 -0
  48. package/src/lib/v2/Nova.ts +3 -4
  49. package/src/lib/v2/NovaAPIClient.ts +81 -93
  50. package/dist/AutoReconnectingWebsocket-DEs8wlLZ.d.cts.map +0 -1
  51. package/dist/AutoReconnectingWebsocket-DEs8wlLZ.d.mts.map +0 -1
  52. package/dist/wandelscriptUtils-BvZ8hcul.cjs.map +0 -1
  53. package/dist/wandelscriptUtils-CsQAUu_9.mjs.map +0 -1
  54. package/dist/wandelscriptUtils-Cz-yQ2eJ.d.mts.map +0 -1
  55. package/dist/wandelscriptUtils-_Si3ueEd.d.cts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wandelscriptUtils-P0WYSZww.cjs","names":["MOTION_DELTA_THRESHOLD","tryParseJson","THREE","tryParseJson","isSameCoordinateSystem","Vector3","Vector3","tryParseJson","SystemApi","CellApi","DeviceConfigurationApi","MotionGroupApi","MotionGroupInfosApi","ControllerApi","ProgramApi","ProgramValuesApi","ControllerIOsApi","MotionGroupKinematicApi","MotionApi","CoordinateSystemsApi","ApplicationApi","MotionGroupJoggingApi","VirtualRobotApi","VirtualRobotSetupApi","VirtualRobotModeApi","VirtualRobotBehaviorApi","LibraryProgramMetadataApi","LibraryProgramApi","LibraryRecipeMetadataApi","LibraryRecipeApi","StoreObjectApi","StoreCollisionComponentsApi","StoreCollisionScenesApi","pathToRegexp","AxiosError","availableStorage","parseNovaInstanceUrl","loginWithAuth0","AutoReconnectingWebsocket"],"sources":["../src/lib/deprecated/v1/motionStateUpdate.ts","../src/lib/deprecated/v1/ConnectedMotionGroup.ts","../src/lib/deprecated/v1/JoggerConnection.ts","../src/lib/deprecated/v1/MotionStreamConnection.ts","../src/lib/deprecated/v1/NovaCellAPIClient.ts","../src/lib/deprecated/v1/mock/MockNovaInstance.ts","../src/lib/deprecated/v1/NovaClient.ts","../src/lib/deprecated/v1/wandelscriptUtils.ts"],"sourcesContent":["import type { TcpPose } from \"@wandelbots/nova-api/v1\"\n\n/** @deprecated */\nexport function jointValuesEqual(\n oldJointValues: number[],\n newJointValues: number[],\n changeDeltaThreshold: number,\n): boolean {\n if (newJointValues.length !== oldJointValues.length) {\n return true\n }\n\n for (let jointIndex = 0; jointIndex < newJointValues.length; jointIndex++) {\n if (\n // biome-ignore lint/style/noNonNullAssertion: legacy code\n Math.abs(newJointValues[jointIndex]! - oldJointValues[jointIndex]!) >\n changeDeltaThreshold\n ) {\n return false\n }\n }\n\n return true\n}\n\n/** @deprecated */\nexport function tcpPoseEqual(\n oldTcp: TcpPose | undefined,\n newTcp: TcpPose | undefined,\n changeDeltaThreshold: number,\n): boolean {\n // undefined -> defined (+reverse) transition\n if ((oldTcp === undefined && newTcp) || (oldTcp && newTcp === undefined)) {\n return false\n }\n\n // the typechecker cannot resolve states to \"!= undefined\" if \"&&\" is used\n if (oldTcp === undefined || newTcp === undefined) {\n return true\n }\n\n let changedDelta = 0\n changedDelta += Math.abs(oldTcp.orientation.x - newTcp.orientation.x)\n changedDelta += Math.abs(oldTcp.orientation.y - newTcp.orientation.y)\n changedDelta += Math.abs(oldTcp.orientation.z - newTcp.orientation.z)\n changedDelta += Math.abs(oldTcp.position.x - newTcp.position.x)\n changedDelta += Math.abs(oldTcp.position.y - newTcp.position.y)\n changedDelta += Math.abs(oldTcp.position.z - newTcp.position.z)\n\n if (changedDelta > changeDeltaThreshold) {\n return false\n }\n\n return (\n oldTcp.coordinate_system === newTcp.coordinate_system &&\n oldTcp.tcp === newTcp.tcp\n )\n}\n","import type {\n ControllerInstance,\n MotionGroupPhysical,\n MotionGroupSpecification,\n MotionGroupStateResponse,\n Mounting,\n RobotControllerState,\n RobotControllerStateOperationModeEnum,\n RobotControllerStateSafetyStateEnum,\n RobotTcp,\n SafetySetup,\n} from \"@wandelbots/nova-api/v1\"\nimport { makeAutoObservable, runInAction } from \"mobx\"\nimport * as THREE from \"three\"\nimport type { AutoReconnectingWebsocket } from \"../../AutoReconnectingWebsocket\"\nimport { tryParseJson } from \"../../converters\"\nimport { jointValuesEqual, tcpPoseEqual } from \"./motionStateUpdate\"\nimport type { NovaClient } from \"./NovaClient\"\n\nconst MOTION_DELTA_THRESHOLD = 0.0001\n\n/** @deprecated */\nexport type MotionGroupOption = {\n selectionId: string\n} & MotionGroupPhysical\n\n/**\n * Store representing the current state of a connected motion group.\n * @deprecated\n */\nexport class ConnectedMotionGroup {\n static async connect(\n nova: NovaClient,\n motionGroupId: string,\n controllers: ControllerInstance[],\n ) {\n const [_motionGroupIndex, controllerId] = motionGroupId.split(\"@\") as [\n string,\n string,\n ]\n const controller = controllers.find((c) => c.controller === controllerId)\n const motionGroup = controller?.physical_motion_groups.find(\n (mg) => mg.motion_group === motionGroupId,\n )\n if (!controller || !motionGroup) {\n throw new Error(\n `Controller ${controllerId} or motion group ${motionGroupId} not found`,\n )\n }\n\n const motionStateSocket = nova.openReconnectingWebsocket(\n `/motion-groups/${motionGroupId}/state-stream`,\n )\n\n // Wait for the first message to get the initial state\n const firstMessage = await motionStateSocket.firstMessage()\n const initialMotionState = tryParseJson(firstMessage.data)\n ?.result as MotionGroupStateResponse\n\n if (!initialMotionState) {\n throw new Error(\n `Unable to parse initial motion state message ${firstMessage.data}`,\n )\n }\n\n console.log(\n `Connected motion state websocket to motion group ${motionGroup.motion_group}. Initial state:\\n `,\n initialMotionState,\n )\n\n // Check if robot is virtual or physical\n const config = await nova.api.controller.getRobotController(\n controller.controller,\n )\n const isVirtual = config.configuration.kind === \"VirtualController\"\n\n // If there's a configured mounting, we need it to show the right\n // position of the robot model\n const mounting = await (async () => {\n try {\n const mounting = await nova.api.motionGroupInfos.getMounting(\n motionGroup.motion_group,\n )\n return mounting\n } catch (err) {\n console.error(\n `Error fetching mounting for ${motionGroup.motion_group}`,\n err,\n )\n return null\n }\n })()\n\n // Open the websocket to monitor controller state for e.g. e-stop\n const controllerStateSocket = nova.openReconnectingWebsocket(\n `/controllers/${controller.controller}/state-stream?response_rate=1000`,\n )\n\n // Wait for the first message to get the initial state\n const firstControllerMessage = await controllerStateSocket.firstMessage()\n const initialControllerState = tryParseJson(firstControllerMessage.data)\n ?.result as RobotControllerState\n\n if (!initialControllerState) {\n throw new Error(\n `Unable to parse initial controller state message ${firstControllerMessage.data}`,\n )\n }\n\n console.log(\n `Connected controller state websocket to controller ${controller.controller}. Initial state:\\n `,\n initialControllerState,\n )\n\n // Find out what TCPs this motion group has (we need it for jogging)\n const { tcps } = await nova.api.motionGroupInfos.listTcps(motionGroupId)\n\n const motionGroupSpecification =\n await nova.api.motionGroupInfos.getMotionGroupSpecification(motionGroupId)\n\n const safetySetup =\n await nova.api.motionGroupInfos.getSafetySetup(motionGroupId)\n\n return new ConnectedMotionGroup(\n nova,\n controller,\n motionGroup,\n initialMotionState,\n motionStateSocket,\n isVirtual,\n // biome-ignore lint/style/noNonNullAssertion: legacy code\n tcps!,\n motionGroupSpecification,\n safetySetup,\n mounting,\n initialControllerState,\n controllerStateSocket,\n )\n }\n\n connectedJoggingCartesianSocket: WebSocket | null = null\n connectedJoggingJointsSocket: WebSocket | null = null\n // biome-ignore lint/suspicious/noExplicitAny: legacy code\n planData: any | null // tmp\n joggingVelocity: number = 10\n\n // Not mobx-observable as this changes very fast; should be observed\n // using animation frames\n rapidlyChangingMotionState: MotionGroupStateResponse\n\n // Response rate on the websocket should be a bit slower on this one since\n // we don't use the motion data\n controllerState: RobotControllerState\n\n /**\n * Reflects activation state of the motion group / robot servos. The\n * movement controls in the UI should only be enabled in the \"active\" state\n */\n activationState: \"inactive\" | \"activating\" | \"deactivating\" | \"active\" =\n \"inactive\"\n\n constructor(\n readonly nova: NovaClient,\n readonly controller: ControllerInstance,\n readonly motionGroup: MotionGroupPhysical,\n readonly initialMotionState: MotionGroupStateResponse,\n readonly motionStateSocket: AutoReconnectingWebsocket,\n readonly isVirtual: boolean,\n readonly tcps: RobotTcp[],\n readonly motionGroupSpecification: MotionGroupSpecification,\n readonly safetySetup: SafetySetup,\n readonly mounting: Mounting | null,\n readonly initialControllerState: RobotControllerState,\n readonly controllerStateSocket: AutoReconnectingWebsocket,\n ) {\n this.rapidlyChangingMotionState = initialMotionState\n this.controllerState = initialControllerState\n\n // Track controller state updates (e.g. safety state and operation mode)\n controllerStateSocket.addEventListener(\"message\", (event) => {\n const data = tryParseJson(event.data)?.result\n\n if (!data) {\n return\n }\n\n runInAction(() => {\n this.controllerState = data\n })\n })\n\n motionStateSocket.addEventListener(\"message\", (event) => {\n const motionStateResponse = tryParseJson(event.data)?.result as\n | MotionGroupStateResponse\n | undefined\n\n if (!motionStateResponse) {\n throw new Error(\n `Failed to get motion state for ${this.motionGroupId}: ${event.data}`,\n )\n }\n\n // handle motionState message\n if (\n !jointValuesEqual(\n this.rapidlyChangingMotionState.state.joint_position.joints,\n motionStateResponse.state.joint_position.joints,\n MOTION_DELTA_THRESHOLD,\n )\n ) {\n runInAction(() => {\n this.rapidlyChangingMotionState.state = motionStateResponse.state\n })\n }\n\n // handle tcpPose message\n if (\n !tcpPoseEqual(\n this.rapidlyChangingMotionState.tcp_pose,\n motionStateResponse.tcp_pose,\n MOTION_DELTA_THRESHOLD,\n )\n ) {\n runInAction(() => {\n this.rapidlyChangingMotionState.tcp_pose =\n motionStateResponse.tcp_pose\n })\n }\n })\n makeAutoObservable(this)\n }\n\n get motionGroupId() {\n return this.motionGroup.motion_group\n }\n\n get controllerId() {\n return this.controller.controller\n }\n\n get modelFromController() {\n return this.motionGroup.model_from_controller\n }\n\n get wandelscriptIdentifier() {\n const num = this.motionGroupId.split(\"@\")[0]\n return `${this.controllerId.replaceAll(\"-\", \"_\")}_${num}`\n }\n\n /** Jogging velocity in radians for rotation and joint movement */\n get joggingVelocityRads() {\n return (this.joggingVelocity * Math.PI) / 180\n }\n\n get joints() {\n return this.initialMotionState.state.joint_position.joints.map((_, i) => {\n return {\n index: i,\n }\n })\n }\n\n get dhParameters() {\n return this.motionGroupSpecification.dh_parameters\n }\n\n get safetyZones() {\n return this.safetySetup.safety_zones\n }\n\n /** Gets the robot mounting position offset in 3D viz coordinates */\n get mountingPosition(): [number, number, number] {\n if (!this.mounting) {\n return [0, 0, 0]\n }\n\n return [\n this.mounting.pose.position.x / 1000,\n this.mounting.pose.position.y / 1000,\n this.mounting.pose.position.z / 1000,\n ]\n }\n\n /** Gets the robot mounting position rotation in 3D viz coordinates */\n get mountingQuaternion() {\n const rotationVector = new THREE.Vector3(\n this.mounting?.pose.orientation?.x || 0,\n this.mounting?.pose.orientation?.y || 0,\n this.mounting?.pose.orientation?.z || 0,\n )\n\n const magnitude = rotationVector.length()\n const axis = rotationVector.normalize()\n\n return new THREE.Quaternion().setFromAxisAngle(axis, magnitude)\n }\n\n /**\n * Whether the controller is currently in a safety state\n * corresponding to an emergency stop\n */\n get isEstopActive() {\n const estopStates: RobotControllerStateSafetyStateEnum[] = [\n \"SAFETY_STATE_ROBOT_EMERGENCY_STOP\",\n \"SAFETY_STATE_DEVICE_EMERGENCY_STOP\",\n ]\n\n return estopStates.includes(this.controllerState.safety_state)\n }\n\n /**\n * Whether the controller is in a safety state\n * that may be non-functional for robot pad purposes\n */\n get isMoveableSafetyState() {\n const goodSafetyStates: RobotControllerStateSafetyStateEnum[] = [\n \"SAFETY_STATE_NORMAL\",\n \"SAFETY_STATE_REDUCED\",\n ]\n\n return goodSafetyStates.includes(this.controllerState.safety_state)\n }\n\n /**\n * Whether the controller is in an operation mode that allows movement\n */\n get isMoveableOperationMode() {\n const goodOperationModes: RobotControllerStateOperationModeEnum[] = [\n \"OPERATION_MODE_AUTO\",\n \"OPERATION_MODE_MANUAL\",\n \"OPERATION_MODE_MANUAL_T1\",\n \"OPERATION_MODE_MANUAL_T2\",\n ]\n\n return goodOperationModes.includes(this.controllerState.operation_mode)\n }\n\n /**\n * Whether the robot is currently active and can be moved, based on the\n * safety state, operation mode and servo toggle activation state.\n */\n get canBeMoved() {\n return (\n this.isMoveableSafetyState &&\n this.isMoveableOperationMode &&\n this.activationState === \"active\"\n )\n }\n\n async deactivate() {\n if (this.activationState !== \"active\") {\n console.error(\"Tried to deactivate while already deactivating\")\n return\n }\n\n runInAction(() => {\n this.activationState = \"deactivating\"\n })\n\n try {\n await this.nova.api.controller.setDefaultMode(\n this.controllerId,\n \"MODE_MONITOR\",\n )\n\n runInAction(() => {\n this.activationState = \"inactive\"\n })\n } catch (err) {\n runInAction(() => {\n this.activationState = \"active\"\n })\n throw err\n }\n }\n\n async activate() {\n if (this.activationState !== \"inactive\") {\n console.error(\"Tried to activate while already activating\")\n return\n }\n\n runInAction(() => {\n this.activationState = \"activating\"\n })\n\n try {\n await this.nova.api.controller.setDefaultMode(\n this.controllerId,\n \"MODE_CONTROL\",\n )\n\n runInAction(() => {\n this.activationState = \"active\"\n })\n } catch (err) {\n runInAction(() => {\n this.activationState = \"inactive\"\n })\n throw err\n }\n }\n\n toggleActivation() {\n if (this.activationState === \"inactive\") {\n this.activate()\n } else if (this.activationState === \"active\") {\n this.deactivate()\n }\n }\n\n dispose() {\n this.motionStateSocket.close()\n if (this.connectedJoggingCartesianSocket)\n this.connectedJoggingCartesianSocket.close()\n if (this.connectedJoggingJointsSocket)\n this.connectedJoggingJointsSocket.close()\n }\n\n setJoggingVelocity(velocity: number) {\n this.joggingVelocity = velocity\n }\n}\n","import type { Command, Joints, TcpPose } from \"@wandelbots/nova-api/v1\"\nimport { Vector3 } from \"three/src/math/Vector3.js\"\nimport type { AutoReconnectingWebsocket } from \"../../AutoReconnectingWebsocket\"\nimport { isSameCoordinateSystem, tryParseJson } from \"../../converters\"\nimport type { MotionStreamConnection } from \"./MotionStreamConnection\"\nimport type { NovaClient } from \"./NovaClient\"\n\n/** @deprecated */\nexport type JoggerConnectionOpts = {\n /**\n * When an error message is received from the jogging websocket, it\n * will be passed here. If this handler is not provided, the error will\n * instead be thrown as an unhandled error.\n */\n onError?: (err: unknown) => void\n}\n\n/** @deprecated */\nexport class JoggerConnection {\n // Currently a separate websocket is needed for each mode, pester API people\n // to merge these for simplicity\n cartesianWebsocket: AutoReconnectingWebsocket | null = null\n jointWebsocket: AutoReconnectingWebsocket | null = null\n cartesianJoggingOpts: {\n tcpId?: string\n coordSystemId?: string\n } = {}\n\n static async open(\n nova: NovaClient,\n motionGroupId: string,\n opts: JoggerConnectionOpts = {},\n ) {\n const motionStream = await nova.connectMotionStream(motionGroupId)\n\n return new JoggerConnection(motionStream, opts)\n }\n\n constructor(\n readonly motionStream: MotionStreamConnection,\n readonly opts: JoggerConnectionOpts = {},\n ) {}\n\n get motionGroupId() {\n return this.motionStream.motionGroupId\n }\n\n get nova() {\n return this.motionStream.nova\n }\n\n get numJoints() {\n return this.motionStream.joints.length\n }\n\n get activeJoggingMode() {\n if (this.cartesianWebsocket) return \"cartesian\"\n if (this.jointWebsocket) return \"joint\"\n return \"increment\"\n }\n\n get activeWebsocket() {\n return this.cartesianWebsocket || this.jointWebsocket\n }\n\n async stop() {\n // Why not call the stopJogging API endpoint?\n // Because this results in the websocket closing and we\n // would like to keep it open for now.\n\n if (this.cartesianWebsocket) {\n this.cartesianWebsocket.sendJson({\n motion_group: this.motionGroupId,\n position_direction: { x: 0, y: 0, z: 0 },\n rotation_direction: { x: 0, y: 0, z: 0 },\n position_velocity: 0,\n rotation_velocity: 0,\n tcp: this.cartesianJoggingOpts.tcpId,\n coordinate_system: this.cartesianJoggingOpts.coordSystemId,\n })\n }\n\n if (this.jointWebsocket) {\n this.jointWebsocket.sendJson({\n motion_group: this.motionGroupId,\n joint_velocities: new Array(this.numJoints).fill(0),\n })\n }\n }\n\n dispose() {\n if (this.cartesianWebsocket) {\n this.cartesianWebsocket.dispose()\n }\n\n if (this.jointWebsocket) {\n this.jointWebsocket.dispose()\n }\n }\n\n setJoggingMode(\n mode: \"cartesian\" | \"joint\" | \"increment\",\n cartesianJoggingOpts?: {\n tcpId?: string\n coordSystemId?: string\n },\n ) {\n console.log(\"Setting jogging mode to\", mode)\n if (cartesianJoggingOpts) {\n // Websocket needs to be reopened to change options\n if (\n JSON.stringify(this.cartesianJoggingOpts) !==\n JSON.stringify(cartesianJoggingOpts)\n ) {\n if (this.cartesianWebsocket) {\n this.cartesianWebsocket.dispose()\n this.cartesianWebsocket = null\n }\n }\n\n this.cartesianJoggingOpts = cartesianJoggingOpts\n }\n\n if (mode !== \"cartesian\" && this.cartesianWebsocket) {\n this.cartesianWebsocket.dispose()\n this.cartesianWebsocket = null\n }\n\n if (mode !== \"joint\" && this.jointWebsocket) {\n this.jointWebsocket.dispose()\n this.jointWebsocket = null\n }\n\n if (mode === \"cartesian\" && !this.cartesianWebsocket) {\n this.cartesianWebsocket = this.nova.openReconnectingWebsocket(\n `/motion-groups/move-tcp`,\n )\n\n this.cartesianWebsocket.addEventListener(\n \"message\",\n (ev: MessageEvent) => {\n const data = tryParseJson(ev.data)\n if (data && \"error\" in data) {\n if (this.opts.onError) {\n this.opts.onError(ev.data)\n } else {\n throw new Error(ev.data)\n }\n }\n },\n )\n }\n\n if (mode === \"joint\" && !this.jointWebsocket) {\n this.jointWebsocket = this.nova.openReconnectingWebsocket(\n `/motion-groups/move-joint`,\n )\n\n this.jointWebsocket.addEventListener(\"message\", (ev: MessageEvent) => {\n const data = tryParseJson(ev.data)\n if (data && \"error\" in data) {\n if (this.opts.onError) {\n this.opts.onError(ev.data)\n } else {\n throw new Error(ev.data)\n }\n }\n })\n }\n }\n\n /**\n * Start rotation of a single robot joint at the specified velocity\n */\n async startJointRotation({\n joint,\n direction,\n velocityRadsPerSec,\n }: {\n /** Index of the joint to rotate */\n joint: number\n /** Direction of rotation (\"+\" or \"-\") */\n direction: \"+\" | \"-\"\n /** Speed of the rotation in radians per second */\n velocityRadsPerSec: number\n }) {\n if (!this.jointWebsocket) {\n throw new Error(\n \"Joint jogging websocket not connected; call setJoggingMode first\",\n )\n }\n\n const jointVelocities = new Array(this.numJoints).fill(0)\n\n jointVelocities[joint] =\n direction === \"-\" ? -velocityRadsPerSec : velocityRadsPerSec\n\n this.jointWebsocket.sendJson({\n motion_group: this.motionGroupId,\n joint_velocities: jointVelocities,\n })\n }\n\n /**\n * Start the TCP moving along a specified axis at a given velocity\n */\n async startTCPTranslation({\n axis,\n direction,\n velocityMmPerSec,\n }: {\n axis: \"x\" | \"y\" | \"z\"\n direction: \"-\" | \"+\"\n velocityMmPerSec: number\n }) {\n if (!this.cartesianWebsocket) {\n throw new Error(\n \"Cartesian jogging websocket not connected; call setJoggingMode first\",\n )\n }\n\n const zeroVector = { x: 0, y: 0, z: 0 }\n const joggingVector = Object.assign({}, zeroVector)\n joggingVector[axis] = direction === \"-\" ? -1 : 1\n\n this.cartesianWebsocket.sendJson({\n motion_group: this.motionGroupId,\n position_direction: joggingVector,\n rotation_direction: zeroVector,\n position_velocity: velocityMmPerSec,\n rotation_velocity: 0,\n tcp: this.cartesianJoggingOpts.tcpId,\n coordinate_system: this.cartesianJoggingOpts.coordSystemId,\n })\n }\n\n /**\n * Start the TCP rotating around a specified axis at a given velocity\n */\n async startTCPRotation({\n axis,\n direction,\n velocityRadsPerSec,\n }: {\n axis: \"x\" | \"y\" | \"z\"\n direction: \"-\" | \"+\"\n velocityRadsPerSec: number\n }) {\n if (!this.cartesianWebsocket) {\n throw new Error(\n \"Cartesian jogging websocket not connected; call setJoggingMode first\",\n )\n }\n\n const zeroVector = { x: 0, y: 0, z: 0 }\n const joggingVector = Object.assign({}, zeroVector)\n joggingVector[axis] = direction === \"-\" ? -1 : 1\n\n this.cartesianWebsocket.sendJson({\n motion_group: this.motionGroupId,\n position_direction: zeroVector,\n rotation_direction: joggingVector,\n position_velocity: 0,\n rotation_velocity: velocityRadsPerSec,\n tcp: this.cartesianJoggingOpts.tcpId,\n coordinate_system: this.cartesianJoggingOpts.coordSystemId,\n })\n }\n\n /**\n * Move the robot by a fixed distance in a single cartesian\n * axis, either rotating or translating relative to the TCP.\n * Promise resolves only after the motion has completed.\n */\n async runIncrementalCartesianMotion({\n currentTcpPose,\n currentJoints,\n coordSystemId,\n velocityInRelevantUnits,\n axis,\n direction,\n motion,\n }: {\n currentTcpPose: TcpPose\n currentJoints: Joints\n coordSystemId: string\n velocityInRelevantUnits: number\n axis: \"x\" | \"y\" | \"z\"\n direction: \"-\" | \"+\"\n motion:\n | {\n type: \"rotate\"\n distanceRads: number\n }\n | {\n type: \"translate\"\n distanceMm: number\n }\n }) {\n const commands: Command[] = []\n\n if (\n !isSameCoordinateSystem(currentTcpPose.coordinate_system, coordSystemId)\n ) {\n throw new Error(\n `Current TCP pose coordinate system ${currentTcpPose.coordinate_system} does not match target coordinate system ${coordSystemId}`,\n )\n }\n\n if (motion.type === \"translate\") {\n const targetTcpPosition = Object.assign({}, currentTcpPose.position)\n targetTcpPosition[axis] +=\n motion.distanceMm * (direction === \"-\" ? -1 : 1)\n\n commands.push({\n settings: {\n limits_override: {\n tcp_velocity_limit: velocityInRelevantUnits,\n },\n },\n line: {\n position: targetTcpPosition,\n orientation: currentTcpPose.orientation,\n coordinate_system: coordSystemId,\n },\n })\n } else if (motion.type === \"rotate\") {\n // Concatenate rotations expressed by rotation vectors\n // Equations taken from https://physics.stackexchange.com/a/287819\n\n // Compute axis and angle of current rotation vector\n const currentRotationVector = new Vector3(\n currentTcpPose.orientation.x,\n currentTcpPose.orientation.y,\n currentTcpPose.orientation.z,\n )\n\n const currentRotationRad = currentRotationVector.length()\n const currentRotationDirection = currentRotationVector.clone().normalize()\n\n // Compute axis and angle of difference rotation vector\n const differenceRotationRad =\n motion.distanceRads * (direction === \"-\" ? -1 : 1)\n\n const differenceRotationDirection = new Vector3(0.0, 0.0, 0.0)\n differenceRotationDirection[axis] = 1.0\n\n // Some abbreviations to make the following equations more readable\n const f1 =\n Math.cos(0.5 * differenceRotationRad) *\n Math.cos(0.5 * currentRotationRad)\n const f2 =\n Math.sin(0.5 * differenceRotationRad) *\n Math.sin(0.5 * currentRotationRad)\n const f3 =\n Math.sin(0.5 * differenceRotationRad) *\n Math.cos(0.5 * currentRotationRad)\n const f4 =\n Math.cos(0.5 * differenceRotationRad) *\n Math.sin(0.5 * currentRotationRad)\n\n const dotProduct = differenceRotationDirection.dot(\n currentRotationDirection,\n )\n\n const crossProduct = differenceRotationDirection\n .clone()\n .cross(currentRotationDirection)\n\n // Compute angle of concatenated rotation\n const newRotationRad = 2.0 * Math.acos(f1 - f2 * dotProduct)\n\n // Compute rotation vector of concatenated rotation\n const f5 = newRotationRad / Math.sin(0.5 * newRotationRad)\n\n const targetTcpOrientation = new Vector3()\n .addScaledVector(crossProduct, f2)\n .addScaledVector(differenceRotationDirection, f3)\n .addScaledVector(currentRotationDirection, f4)\n .multiplyScalar(f5)\n\n commands.push({\n settings: {\n limits_override: {\n tcp_orientation_velocity_limit: velocityInRelevantUnits,\n },\n },\n line: {\n position: currentTcpPose.position,\n orientation: targetTcpOrientation,\n coordinate_system: coordSystemId,\n },\n })\n }\n\n const motionPlanRes = await this.nova.api.motion.planMotion({\n motion_group: this.motionGroupId,\n start_joint_position: currentJoints,\n tcp: this.cartesianJoggingOpts.tcpId,\n commands,\n })\n\n const plannedMotion = motionPlanRes.plan_successful_response?.motion\n if (!plannedMotion) {\n throw new Error(\n `Failed to plan jogging increment motion ${JSON.stringify(motionPlanRes)}`,\n )\n }\n\n await this.nova.api.motion.streamMoveForward(\n plannedMotion,\n 100,\n undefined,\n undefined,\n undefined,\n {\n // Might take a while at low velocity\n timeout: 1000 * 60,\n },\n )\n }\n\n /**\n * Rotate a single robot joint by a fixed number of radians\n * Promise resolves only after the motion has completed.\n */\n async runIncrementalJointRotation({\n joint,\n currentJoints,\n velocityRadsPerSec,\n direction,\n distanceRads,\n }: {\n joint: number\n currentJoints: Joints\n velocityRadsPerSec: number\n direction: \"-\" | \"+\"\n distanceRads: number\n }) {\n const targetJoints = [...currentJoints.joints]\n // biome-ignore lint/style/noNonNullAssertion: legacy code\n targetJoints[joint]! += distanceRads * (direction === \"-\" ? -1 : 1)\n\n const jointVelocityLimits: number[] = new Array(\n currentJoints.joints.length,\n ).fill(velocityRadsPerSec)\n\n const motionPlanRes = await this.nova.api.motion.planMotion({\n motion_group: this.motionGroupId,\n start_joint_position: currentJoints,\n commands: [\n {\n settings: {\n limits_override: {\n joint_velocity_limits: {\n joints: jointVelocityLimits,\n },\n },\n },\n joint_ptp: {\n joints: targetJoints,\n },\n },\n ],\n })\n\n const plannedMotion = motionPlanRes.plan_successful_response?.motion\n if (!plannedMotion) {\n console.error(\"Failed to plan jogging increment motion\", motionPlanRes)\n return\n }\n\n await this.nova.api.motion.streamMoveForward(\n plannedMotion,\n 100,\n undefined,\n undefined,\n undefined,\n {\n // Might take a while at low velocity\n timeout: 1000 * 60,\n },\n )\n }\n}\n","/** biome-ignore-all lint/style/noNonNullAssertion: legacy code */\nimport type {\n ControllerInstance,\n MotionGroupPhysical,\n MotionGroupStateResponse,\n Vector3d,\n} from \"@wandelbots/nova-api/v1\"\nimport { makeAutoObservable, runInAction } from \"mobx\"\nimport { Vector3 } from \"three\"\nimport type { AutoReconnectingWebsocket } from \"../../AutoReconnectingWebsocket\"\nimport { tryParseJson } from \"../../converters\"\nimport { jointValuesEqual, tcpPoseEqual } from \"./motionStateUpdate\"\nimport type { NovaClient } from \"./NovaClient\"\n\nconst MOTION_DELTA_THRESHOLD = 0.0001\n\nfunction unwrapRotationVector(\n newRotationVectorApi: Vector3d,\n currentRotationVectorApi: Vector3d,\n): Vector3d {\n const currentRotationVector = new Vector3(\n currentRotationVectorApi.x,\n currentRotationVectorApi.y,\n currentRotationVectorApi.z,\n )\n\n const newRotationVector = new Vector3(\n newRotationVectorApi.x,\n newRotationVectorApi.y,\n newRotationVectorApi.z,\n )\n\n const currentAngle = currentRotationVector.length()\n const currentAxis = currentRotationVector.normalize()\n\n let newAngle = newRotationVector.length()\n let newAxis = newRotationVector.normalize()\n\n // Align rotation axes\n if (newAxis.dot(currentAxis) < 0) {\n newAngle = -newAngle\n newAxis = newAxis.multiplyScalar(-1.0)\n }\n\n // Shift rotation angle close to previous one to extend domain of rotation angles beyond [0, pi]\n // - this simplifies interpolation and prevents abruptly changing signs of the rotation angles\n let angleDifference = newAngle - currentAngle\n angleDifference -=\n 2.0 * Math.PI * Math.floor((angleDifference + Math.PI) / (2.0 * Math.PI))\n\n newAngle = currentAngle + angleDifference\n\n return newAxis.multiplyScalar(newAngle)\n}\n\n/**\n * Store representing the current state of a connected motion group.\n * @deprecated\n */\nexport class MotionStreamConnection {\n static async open(nova: NovaClient, motionGroupId: string) {\n const { instances: controllers } =\n await nova.api.controller.listControllers()\n\n const [_motionGroupIndex, controllerId] = motionGroupId.split(\"@\") as [\n string,\n string,\n ]\n const controller = controllers.find((c) => c.controller === controllerId)\n const motionGroup = controller?.physical_motion_groups.find(\n (mg) => mg.motion_group === motionGroupId,\n )\n if (!controller || !motionGroup) {\n throw new Error(\n `Controller ${controllerId} or motion group ${motionGroupId} not found`,\n )\n }\n\n const motionStateSocket = nova.openReconnectingWebsocket(\n `/motion-groups/${motionGroupId}/state-stream`,\n )\n\n // Wait for the first message to get the initial state\n const firstMessage = await motionStateSocket.firstMessage()\n const initialMotionState = tryParseJson(firstMessage.data)\n ?.result as MotionGroupStateResponse\n\n if (!initialMotionState) {\n throw new Error(\n `Unable to parse initial motion state message ${firstMessage.data}`,\n )\n }\n\n console.log(\n `Connected motion state websocket to motion group ${motionGroup.motion_group}. Initial state:\\n `,\n initialMotionState,\n )\n\n return new MotionStreamConnection(\n nova,\n controller,\n motionGroup,\n initialMotionState,\n motionStateSocket,\n )\n }\n\n // Not mobx-observable as this changes very fast; should be observed\n // using animation frames\n rapidlyChangingMotionState: MotionGroupStateResponse\n\n constructor(\n readonly nova: NovaClient,\n readonly controller: ControllerInstance,\n readonly motionGroup: MotionGroupPhysical,\n readonly initialMotionState: MotionGroupStateResponse,\n readonly motionStateSocket: AutoReconnectingWebsocket,\n ) {\n this.rapidlyChangingMotionState = initialMotionState\n\n motionStateSocket.addEventListener(\"message\", (event) => {\n const motionStateResponse = tryParseJson(event.data)?.result as\n | MotionGroupStateResponse\n | undefined\n\n if (!motionStateResponse) {\n throw new Error(\n `Failed to get motion state for ${this.motionGroupId}: ${event.data}`,\n )\n }\n\n // handle motionState message\n if (\n !jointValuesEqual(\n this.rapidlyChangingMotionState.state.joint_position.joints,\n motionStateResponse.state.joint_position.joints,\n MOTION_DELTA_THRESHOLD,\n )\n ) {\n runInAction(() => {\n this.rapidlyChangingMotionState.state = motionStateResponse.state\n })\n }\n\n // handle tcpPose message\n if (\n !tcpPoseEqual(\n this.rapidlyChangingMotionState.tcp_pose,\n motionStateResponse.tcp_pose,\n MOTION_DELTA_THRESHOLD,\n )\n ) {\n runInAction(() => {\n if (this.rapidlyChangingMotionState.tcp_pose == null) {\n this.rapidlyChangingMotionState.tcp_pose =\n motionStateResponse.tcp_pose\n } else {\n this.rapidlyChangingMotionState.tcp_pose = {\n position: motionStateResponse.tcp_pose!.position,\n orientation: unwrapRotationVector(\n motionStateResponse.tcp_pose!.orientation,\n this.rapidlyChangingMotionState.tcp_pose!.orientation,\n ),\n tcp: motionStateResponse.tcp_pose!.tcp,\n coordinate_system:\n motionStateResponse.tcp_pose!.coordinate_system,\n }\n }\n })\n }\n })\n makeAutoObservable(this)\n }\n\n get motionGroupId() {\n return this.motionGroup.motion_group\n }\n\n get controllerId() {\n return this.controller.controller\n }\n\n get modelFromController() {\n return this.motionGroup.model_from_controller\n }\n\n get wandelscriptIdentifier() {\n const num = this.motionGroupId.split(\"@\")[0]\n return `${this.controllerId.replaceAll(\"-\", \"_\")}_${num}`\n }\n\n get joints() {\n return this.initialMotionState.state.joint_position.joints.map((_, i) => {\n return {\n index: i,\n }\n })\n }\n\n dispose() {\n this.motionStateSocket.close()\n }\n}\n","/** biome-ignore-all lint/style/noNonNullAssertion: legacy code */\n/** biome-ignore-all lint/suspicious/noExplicitAny: legacy code */\nimport type {\n BaseAPI,\n Configuration as BaseConfiguration,\n} from \"@wandelbots/nova-api/v1\"\nimport {\n ApplicationApi,\n CellApi,\n ControllerApi,\n ControllerIOsApi,\n CoordinateSystemsApi,\n DeviceConfigurationApi,\n LibraryProgramApi,\n LibraryProgramMetadataApi,\n LibraryRecipeApi,\n LibraryRecipeMetadataApi,\n MotionApi,\n MotionGroupApi,\n MotionGroupInfosApi,\n MotionGroupJoggingApi,\n MotionGroupKinematicApi,\n ProgramApi,\n ProgramValuesApi,\n StoreCollisionComponentsApi,\n StoreCollisionScenesApi,\n StoreObjectApi,\n SystemApi,\n VirtualRobotApi,\n VirtualRobotBehaviorApi,\n VirtualRobotModeApi,\n VirtualRobotSetupApi,\n} from \"@wandelbots/nova-api/v1\"\nimport type { AxiosInstance } from \"axios\"\nimport axios from \"axios\"\n\ntype OmitFirstArg<F> = F extends (x: any, ...args: infer P) => infer R\n ? (...args: P) => R\n : never\n\ntype UnwrapAxiosResponseReturn<T> = T extends (...a: any) => any\n ? (\n ...a: Parameters<T>\n ) => Promise<Awaited<ReturnType<T>> extends { data: infer D } ? D : never>\n : never\n\n/** @deprecated Use `NovaAPIClient` instead. */\nexport type WithCellId<T> = {\n [P in keyof T]: UnwrapAxiosResponseReturn<OmitFirstArg<T[P]>>\n}\n\n/** @deprecated Use `NovaAPIClient` instead. */\nexport type WithUnwrappedAxiosResponse<T> = {\n [P in keyof T]: UnwrapAxiosResponseReturn<T[P]>\n}\n\n/**\n * API client providing type-safe access to all the Nova API REST endpoints\n * associated with a specific cell id.\n * @deprecated Use `NovaAPIClient` from `@wandelbots/nova-js/v2` instead.\n */\nexport class NovaCellAPIClient {\n constructor(\n readonly cellId: string,\n readonly opts: BaseConfiguration & {\n axiosInstance?: AxiosInstance\n mock?: boolean\n },\n ) {}\n\n /**\n * Some TypeScript sorcery which alters the API class methods so you don't\n * have to pass the cell id to every single one, and de-encapsulates the\n * response data\n */\n private withCellId<T extends BaseAPI>(\n ApiConstructor: new (\n config: BaseConfiguration,\n basePath: string,\n axios: AxiosInstance,\n ) => T,\n ) {\n const apiClient = new ApiConstructor(\n {\n ...this.opts,\n isJsonMime: (mime: string) => {\n return mime === \"application/json\"\n },\n },\n this.opts.basePath ?? \"\",\n this.opts.axiosInstance ?? axios.create(),\n ) as {\n [key: string | symbol]: any\n }\n\n for (const key of Reflect.ownKeys(Reflect.getPrototypeOf(apiClient)!)) {\n if (key !== \"constructor\" && typeof apiClient[key] === \"function\") {\n const originalFunction = apiClient[key]\n apiClient[key] = (...args: any[]) => {\n return originalFunction\n .apply(apiClient, [this.cellId, ...args])\n .then((res: any) => res.data)\n }\n }\n }\n\n return apiClient as WithCellId<T>\n }\n\n /**\n * As withCellId, but only does the response unwrapping\n */\n private withUnwrappedResponsesOnly<T extends BaseAPI>(\n ApiConstructor: new (\n config: BaseConfiguration,\n basePath: string,\n axios: AxiosInstance,\n ) => T,\n ) {\n const apiClient = new ApiConstructor(\n {\n ...this.opts,\n isJsonMime: (mime: string) => {\n return mime === \"application/json\"\n },\n },\n this.opts.basePath ?? \"\",\n this.opts.axiosInstance ?? axios.create(),\n ) as {\n [key: string | symbol]: any\n }\n\n for (const key of Reflect.ownKeys(Reflect.getPrototypeOf(apiClient)!)) {\n if (key !== \"constructor\" && typeof apiClient[key] === \"function\") {\n const originalFunction = apiClient[key]\n apiClient[key] = (...args: any[]) => {\n return originalFunction\n .apply(apiClient, args)\n .then((res: any) => res.data)\n }\n }\n }\n\n return apiClient as WithUnwrappedAxiosResponse<T>\n }\n\n readonly system = this.withUnwrappedResponsesOnly(SystemApi)\n readonly cell = this.withUnwrappedResponsesOnly(CellApi)\n\n readonly deviceConfig = this.withCellId(DeviceConfigurationApi)\n\n readonly motionGroup = this.withCellId(MotionGroupApi)\n readonly motionGroupInfos = this.withCellId(MotionGroupInfosApi)\n\n readonly controller = this.withCellId(ControllerApi)\n\n readonly program = this.withCellId(ProgramApi)\n readonly programValues = this.withCellId(ProgramValuesApi)\n\n readonly controllerIOs = this.withCellId(ControllerIOsApi)\n\n readonly motionGroupKinematic = this.withCellId(MotionGroupKinematicApi)\n readonly motion = this.withCellId(MotionApi)\n\n readonly coordinateSystems = this.withCellId(CoordinateSystemsApi)\n\n readonly application = this.withCellId(ApplicationApi)\n readonly applicationGlobal = this.withUnwrappedResponsesOnly(ApplicationApi)\n\n readonly motionGroupJogging = this.withCellId(MotionGroupJoggingApi)\n\n readonly virtualRobot = this.withCellId(VirtualRobotApi)\n readonly virtualRobotSetup = this.withCellId(VirtualRobotSetupApi)\n readonly virtualRobotMode = this.withCellId(VirtualRobotModeApi)\n readonly virtualRobotBehavior = this.withCellId(VirtualRobotBehaviorApi)\n\n readonly libraryProgramMetadata = this.withCellId(LibraryProgramMetadataApi)\n readonly libraryProgram = this.withCellId(LibraryProgramApi)\n readonly libraryRecipeMetadata = this.withCellId(LibraryRecipeMetadataApi)\n readonly libraryRecipe = this.withCellId(LibraryRecipeApi)\n\n readonly storeObject = this.withCellId(StoreObjectApi)\n readonly storeCollisionComponents = this.withCellId(\n StoreCollisionComponentsApi,\n )\n readonly storeCollisionScenes = this.withCellId(StoreCollisionScenesApi)\n}\n","import type {\n ControllerInstanceList,\n MotionGroupSpecification,\n MotionGroupStateResponse,\n RobotController,\n SafetySetup,\n} from \"@wandelbots/nova-api/v1\"\nimport type { AxiosResponse, InternalAxiosRequestConfig } from \"axios\"\nimport { AxiosError } from \"axios\"\nimport * as pathToRegexp from \"path-to-regexp\"\nimport type { AutoReconnectingWebsocket } from \"../../../AutoReconnectingWebsocket\"\n\n/**\n * Ultra-simplified mock Nova server for testing stuff\n * @deprecated\n */\nexport class MockNovaInstance {\n readonly connections: AutoReconnectingWebsocket[] = []\n\n async handleAPIRequest(\n config: InternalAxiosRequestConfig,\n ): Promise<AxiosResponse> {\n const apiHandlers = [\n {\n method: \"GET\",\n path: \"/cells/:cellId/controllers\",\n handle() {\n return {\n instances: [\n {\n controller: \"mock-ur5e\",\n model_name: \"UniversalRobots::Controller\",\n host: \"mock-ur5e\",\n allow_software_install_on_controller: true,\n physical_motion_groups: [\n {\n motion_group: \"0@mock-ur5e\",\n name_from_controller: \"UR5e\",\n active: false,\n model_from_controller: \"UniversalRobots_UR5e\",\n },\n ],\n has_error: false,\n error_details: \"\",\n },\n ],\n } satisfies ControllerInstanceList\n },\n },\n {\n method: \"GET\",\n path: \"/cells/:cellId/controllers/:controllerId\",\n handle() {\n return {\n configuration: {\n kind: \"VirtualController\",\n manufacturer: \"universalrobots\",\n position: \"[0,-1.571,-1.571,-1.571,1.571,-1.571,0]\",\n type: \"universalrobots-ur5e\",\n },\n name: \"mock-ur5\",\n } satisfies RobotController\n },\n },\n {\n method: \"GET\",\n path: \"/cells/:cellId/motion-groups/:motionGroupId/specification\",\n handle() {\n return {\n dh_parameters: [\n {\n alpha: 1.5707963267948966,\n theta: 0,\n a: 0,\n d: 162.25,\n reverse_rotation_direction: false,\n },\n {\n alpha: 0,\n theta: 0,\n a: -425,\n d: 0,\n reverse_rotation_direction: false,\n },\n {\n alpha: 0,\n theta: 0,\n a: -392.2,\n d: 0,\n reverse_rotation_direction: false,\n },\n {\n alpha: 1.5707963267948966,\n theta: 0,\n a: 0,\n d: 133.3,\n reverse_rotation_direction: false,\n },\n {\n alpha: -1.5707963267948966,\n theta: 0,\n a: 0,\n d: 99.7,\n reverse_rotation_direction: false,\n },\n {\n alpha: 0,\n theta: 0,\n a: 0,\n d: 99.6,\n reverse_rotation_direction: false,\n },\n ],\n mechanical_joint_limits: [\n {\n joint: \"JOINTNAME_AXIS_1\",\n lower_limit: -6.335545063018799,\n upper_limit: 6.335545063018799,\n unlimited: false,\n },\n {\n joint: \"JOINTNAME_AXIS_2\",\n lower_limit: -6.335545063018799,\n upper_limit: 6.335545063018799,\n unlimited: false,\n },\n {\n joint: \"JOINTNAME_AXIS_3\",\n lower_limit: -6.335545063018799,\n upper_limit: 6.335545063018799,\n unlimited: false,\n },\n {\n joint: \"JOINTNAME_AXIS_4\",\n lower_limit: -6.335545063018799,\n upper_limit: 6.335545063018799,\n unlimited: false,\n },\n {\n joint: \"JOINTNAME_AXIS_5\",\n lower_limit: -6.335545063018799,\n upper_limit: 6.335545063018799,\n unlimited: false,\n },\n {\n joint: \"JOINTNAME_AXIS_6\",\n lower_limit: -6.335545063018799,\n upper_limit: 6.335545063018799,\n unlimited: false,\n },\n ],\n } satisfies MotionGroupSpecification\n },\n },\n {\n method: \"GET\",\n path: \"/cells/:cellId/motion-groups/:motionGroupId/safety-setup\",\n handle() {\n return {\n safety_settings: [\n {\n safety_state: \"SAFETY_NORMAL\",\n settings: {\n joint_position_limits: [\n {\n joint: \"JOINTNAME_AXIS_1\",\n lower_limit: -2.96705961227417,\n upper_limit: 2.96705961227417,\n unlimited: false,\n },\n {\n joint: \"JOINTNAME_AXIS_2\",\n lower_limit: -1.7453292608261108,\n upper_limit: 2.7925267219543457,\n unlimited: false,\n },\n {\n joint: \"JOINTNAME_AXIS_3\",\n lower_limit: -3.3161256313323975,\n upper_limit: 0.40142571926116943,\n unlimited: false,\n },\n {\n joint: \"JOINTNAME_AXIS_4\",\n lower_limit: -3.4906585216522217,\n upper_limit: 3.4906585216522217,\n unlimited: false,\n },\n {\n joint: \"JOINTNAME_AXIS_5\",\n lower_limit: -2.4434609413146973,\n upper_limit: 2.4434609413146973,\n unlimited: false,\n },\n {\n joint: \"JOINTNAME_AXIS_6\",\n lower_limit: -4.71238899230957,\n upper_limit: 4.71238899230957,\n unlimited: false,\n },\n ],\n joint_velocity_limits: [\n {\n joint: \"JOINTNAME_AXIS_1\",\n limit: 3.1415927410125732,\n },\n {\n joint: \"JOINTNAME_AXIS_2\",\n limit: 3.1415927410125732,\n },\n {\n joint: \"JOINTNAME_AXIS_3\",\n limit: 3.4906585216522217,\n },\n {\n joint: \"JOINTNAME_AXIS_4\",\n limit: 6.108652591705322,\n },\n {\n joint: \"JOINTNAME_AXIS_5\",\n limit: 6.108652591705322,\n },\n {\n joint: \"JOINTNAME_AXIS_6\",\n limit: 6.981317043304443,\n },\n ],\n joint_acceleration_limits: [],\n joint_torque_limits: [],\n tcp_velocity_limit: 1800,\n },\n },\n ],\n safety_zones: [\n {\n id: 1,\n priority: 0,\n geometry: {\n compound: {\n child_geometries: [\n {\n convex_hull: {\n vertices: [\n {\n x: -800,\n y: -1330,\n z: -1820,\n },\n {\n x: 1650,\n y: -1330,\n z: -1820,\n },\n {\n x: 1650,\n y: 1330,\n z: -1820,\n },\n {\n x: -800,\n y: 1330,\n z: -1820,\n },\n ],\n },\n init_pose: {\n position: {\n x: 0,\n y: 0,\n z: 0,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"box\",\n },\n {\n convex_hull: {\n vertices: [\n {\n x: -800,\n y: -1330,\n z: -1820,\n },\n {\n x: 1650,\n y: -1330,\n z: -1820,\n },\n {\n x: 1650,\n y: -1330,\n z: 1500,\n },\n {\n x: -800,\n y: -1330,\n z: 1500,\n },\n ],\n },\n init_pose: {\n position: {\n x: 0,\n y: 0,\n z: 0,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"box\",\n },\n {\n convex_hull: {\n vertices: [\n {\n x: -800,\n y: -1330,\n z: -1820,\n },\n {\n x: -800,\n y: 1330,\n z: -1820,\n },\n {\n x: -800,\n y: 1330,\n z: 1500,\n },\n {\n x: -800,\n y: -1330,\n z: 1500,\n },\n ],\n },\n init_pose: {\n position: {\n x: 0,\n y: 0,\n z: 0,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"box\",\n },\n {\n convex_hull: {\n vertices: [\n {\n x: 1650,\n y: 1330,\n z: 1500,\n },\n {\n x: -800,\n y: 1330,\n z: 1500,\n },\n {\n x: -800,\n y: -1330,\n z: 1500,\n },\n {\n x: 1650,\n y: -1330,\n z: 1500,\n },\n ],\n },\n init_pose: {\n position: {\n x: 0,\n y: 0,\n z: 0,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"box\",\n },\n {\n convex_hull: {\n vertices: [\n {\n x: 1650,\n y: 1330,\n z: 1500,\n },\n {\n x: -800,\n y: 1330,\n z: 1500,\n },\n {\n x: -800,\n y: 1330,\n z: -1820,\n },\n {\n x: 1650,\n y: 1330,\n z: -1820,\n },\n ],\n },\n init_pose: {\n position: {\n x: 0,\n y: 0,\n z: 0,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"box\",\n },\n {\n convex_hull: {\n vertices: [\n {\n x: 1650,\n y: 1330,\n z: 1500,\n },\n {\n x: 1650,\n y: -1330,\n z: 1500,\n },\n {\n x: 1650,\n y: -1330,\n z: -1820,\n },\n {\n x: 1650,\n y: 1330,\n z: -1820,\n },\n ],\n },\n init_pose: {\n position: {\n x: 0,\n y: 0,\n z: 0,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"box\",\n },\n ],\n },\n init_pose: {\n position: {\n x: 0,\n y: 0,\n z: 0,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"Cell workzone\",\n },\n motion_group_uid: 1,\n },\n {\n id: 2,\n priority: 0,\n geometry: {\n convex_hull: {\n vertices: [\n {\n x: 1650,\n y: 1330,\n z: -1850,\n },\n {\n x: 865,\n y: 1330,\n z: -1850,\n },\n {\n x: 865,\n y: -720,\n z: -1850,\n },\n {\n x: 1650,\n y: -720,\n z: -1850,\n },\n {\n x: 1650,\n y: 1330,\n z: -920,\n },\n {\n x: 865,\n y: 1330,\n z: -920,\n },\n {\n x: 865,\n y: -720,\n z: -920,\n },\n {\n x: 1650,\n y: -720,\n z: -920,\n },\n ],\n },\n init_pose: {\n position: {\n x: 0,\n y: 0,\n z: 0,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"Transport\",\n },\n motion_group_uid: 1,\n },\n {\n id: 3,\n priority: 0,\n geometry: {\n convex_hull: {\n vertices: [\n {\n x: 1650,\n y: 1330,\n z: -600,\n },\n {\n x: 865,\n y: 1330,\n z: -600,\n },\n {\n x: 865,\n y: 430,\n z: -600,\n },\n {\n x: 1650,\n y: 430,\n z: -600,\n },\n {\n x: 1650,\n y: 1330,\n z: -1250,\n },\n {\n x: 865,\n y: 1330,\n z: -1250,\n },\n {\n x: 865,\n y: 430,\n z: -1250,\n },\n {\n x: 1650,\n y: 430,\n z: -1250,\n },\n ],\n },\n init_pose: {\n position: {\n x: 0,\n y: 0,\n z: 0,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"Tunel\",\n },\n motion_group_uid: 1,\n },\n {\n id: 4,\n priority: 0,\n geometry: {\n convex_hull: {\n vertices: [\n {\n x: 1650,\n y: -760,\n z: -440,\n },\n {\n x: 900,\n y: -760,\n z: -440,\n },\n {\n x: 900,\n y: -1330,\n z: -440,\n },\n {\n x: 1650,\n y: -1330,\n z: -440,\n },\n {\n x: 1650,\n y: -760,\n z: -1800,\n },\n {\n x: 900,\n y: -760,\n z: -1800,\n },\n {\n x: 900,\n y: -1330,\n z: -1800,\n },\n {\n x: 1650,\n y: -1330,\n z: -1800,\n },\n ],\n },\n init_pose: {\n position: {\n x: 0,\n y: 0,\n z: 0,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"Fanuc controller\",\n },\n motion_group_uid: 1,\n },\n {\n id: 6,\n priority: 0,\n geometry: {\n convex_hull: {\n vertices: [\n {\n x: -200,\n y: -200,\n z: -1900,\n },\n {\n x: 200,\n y: -200,\n z: -1900,\n },\n {\n x: 200,\n y: 200,\n z: -1900,\n },\n {\n x: -200,\n y: 200,\n z: -1900,\n },\n {\n x: -200,\n y: -200,\n z: -350,\n },\n {\n x: 200,\n y: -200,\n z: -350,\n },\n {\n x: 200,\n y: 200,\n z: -350,\n },\n {\n x: -200,\n y: 200,\n z: -350,\n },\n ],\n },\n init_pose: {\n position: {\n x: 0,\n y: 0,\n z: 0,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"Robot base\",\n },\n motion_group_uid: 1,\n },\n ],\n robot_model_geometries: [\n {\n link_index: 1,\n geometry: {\n sphere: {\n radius: 270,\n },\n init_pose: {\n position: {\n x: -70,\n y: -70,\n z: -50,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"link1_sphere\",\n },\n },\n {\n link_index: 2,\n geometry: {\n capsule: {\n radius: 160,\n cylinder_height: 800,\n },\n init_pose: {\n position: {\n x: -450,\n y: 40,\n z: 170,\n },\n orientation: {\n x: 0,\n y: -Math.SQRT1_2,\n z: 0,\n w: Math.SQRT1_2,\n },\n },\n id: \"link2_capsule\",\n },\n },\n {\n link_index: 3,\n geometry: {\n sphere: {\n radius: 270,\n },\n init_pose: {\n position: {\n x: -110,\n y: 10,\n z: -100,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"link3_sphere\",\n },\n },\n {\n link_index: 4,\n geometry: {\n capsule: {\n radius: 110,\n cylinder_height: 600,\n },\n init_pose: {\n position: {\n x: 0,\n y: 300,\n z: 40,\n },\n orientation: {\n x: -Math.SQRT1_2,\n y: 0,\n z: 0,\n w: Math.SQRT1_2,\n },\n },\n id: \"link4_capsule\",\n },\n },\n {\n link_index: 5,\n geometry: {\n sphere: {\n radius: 75,\n },\n init_pose: {\n position: {\n x: 0,\n y: 0,\n z: -50,\n },\n orientation: {\n x: 0,\n y: 0,\n z: 0,\n w: 1,\n },\n },\n id: \"link5_sphere\",\n },\n },\n ],\n tool_geometries: [],\n } satisfies SafetySetup\n },\n },\n {\n method: \"GET\",\n path: \"/cells/:cellId/coordinate-systems\",\n handle() {\n return {\n coordinatesystems: [\n {\n coordinate_system: \"\",\n name: \"world\",\n reference_uid: \"\",\n position: {\n x: 0,\n y: 0,\n z: 0,\n },\n rotation: {\n angles: [0, 0, 0],\n type: \"ROTATION_VECTOR\",\n },\n },\n ],\n } //satisfies CoordinateSystems\n },\n },\n {\n method: \"GET\",\n path: \"/cells/:cellId/motion-groups/:motionGroupId/tcps\",\n handle() {\n return {\n tcps: [\n {\n id: \"Flange\",\n readable_name: \"Default-Flange\",\n position: {\n x: 0,\n y: 0,\n z: 0,\n },\n rotation: {\n angles: [0, 0, 0, 0],\n type: \"ROTATION_VECTOR\",\n },\n },\n {\n id: \"complex-tcp-position\",\n readable_name: \"Complex TCP Position\",\n position: {\n x: -200,\n y: 300,\n z: 150,\n },\n rotation: {\n angles: [\n -0.12139440409113832, -0.06356210998212003,\n -0.2023240068185639, 0,\n ],\n type: \"ROTATION_VECTOR\",\n },\n },\n ],\n }\n },\n },\n ]\n\n const method = config.method?.toUpperCase() || \"GET\"\n const path = `/cells${config.url?.split(\"/cells\")[1]?.split(\"?\")[0]}`\n\n for (const handler of apiHandlers) {\n const match = pathToRegexp.match(handler.path)(path || \"\")\n if (method === handler.method && match) {\n const json = handler.handle()\n return {\n status: 200,\n statusText: \"Success\",\n data: JSON.stringify(json),\n headers: {},\n config,\n request: {\n responseURL: config.url,\n },\n }\n }\n }\n\n throw new AxiosError(\n `No mock handler matched this request: ${method} ${path}`,\n \"404\",\n config,\n )\n\n // return {\n // status: 404,\n // statusText: \"Not Found\",\n // data: \"\",\n // headers: {},\n // config,\n // request: {\n // responseURL: config.url,\n // },\n // }\n }\n\n handleWebsocketConnection(socket: AutoReconnectingWebsocket) {\n this.connections.push(socket)\n\n setTimeout(() => {\n socket.dispatchEvent(new Event(\"open\"))\n\n console.log(\"Websocket connection opened from\", socket.url)\n\n if (socket.url.includes(\"/state-stream\")) {\n socket.dispatchEvent(\n new MessageEvent(\"message\", {\n data: JSON.stringify(defaultMotionState),\n }),\n )\n }\n\n if (socket.url.includes(\"/move-joint\")) {\n socket.dispatchEvent(\n new MessageEvent(\"message\", {\n data: JSON.stringify({\n result: {\n motion_group: \"0@ur\",\n state: {\n controller: \"ur\",\n operation_mode: \"OPERATION_MODE_AUTO\",\n safety_state: \"SAFETY_STATE_NORMAL\",\n timestamp: \"2024-09-18T12:48:26.096266444Z\",\n velocity_override: 100,\n motion_groups: [\n {\n motion_group: \"0@ur\",\n controller: \"ur\",\n joint_position: {\n joints: [\n 1.3492152690887451, -1.5659207105636597,\n 1.6653711795806885, -1.0991662740707397,\n -1.829018235206604, 1.264623761177063,\n ],\n },\n joint_velocity: {\n joints: [0, 0, 0, 0, 0, 0],\n },\n flange_pose: {\n position: {\n x: 6.437331889439328,\n y: -628.4123774830913,\n z: 577.0569957147832,\n },\n orientation: {\n x: -1.683333649797158,\n y: -1.9783363827298732,\n z: -0.4928031860165713,\n },\n coordinate_system: \"\",\n },\n tcp_pose: {\n position: {\n x: 6.437331889439328,\n y: -628.4123774830913,\n z: 577.0569957147832,\n },\n orientation: {\n x: -1.683333649797158,\n y: -1.9783363827298732,\n z: -0.4928031860165713,\n },\n coordinate_system: \"\",\n tcp: \"Flange\",\n },\n velocity: {\n linear: {\n x: 0,\n y: 0,\n z: 0,\n },\n angular: {\n x: -0,\n y: 0,\n z: 0,\n },\n coordinate_system: \"\",\n },\n force: {\n force: {\n x: 0,\n y: 0,\n z: 0,\n },\n moment: {\n x: 0,\n y: 0,\n z: 0,\n },\n coordinate_system: \"\",\n },\n joint_limit_reached: {\n limit_reached: [\n false,\n false,\n false,\n false,\n false,\n false,\n ],\n },\n joint_current: {\n joints: [0, 0, 0, 0, 0, 0],\n },\n sequence_number: \"671259\",\n },\n ],\n sequence_number: \"671259\",\n },\n movement_state: \"MOVEMENT_STATE_MOVING\",\n },\n }),\n }),\n )\n }\n\n if (socket.url.includes(\"/move-tcp\")) {\n socket.dispatchEvent(\n new MessageEvent(\"message\", {\n data: JSON.stringify({\n result: {\n motion_group: \"0@ur\",\n state: {\n controller: \"ur\",\n operation_mode: \"OPERATION_MODE_AUTO\",\n safety_state: \"SAFETY_STATE_NORMAL\",\n timestamp: \"2024-09-18T12:43:12.188335774Z\",\n velocity_override: 100,\n motion_groups: [\n {\n motion_group: \"0@ur\",\n controller: \"ur\",\n joint_position: {\n joints: [\n 1.3352527618408203, -1.5659207105636597,\n 1.6653711795806885, -1.110615611076355,\n -1.829018235206604, 1.264623761177063,\n ],\n },\n joint_velocity: {\n joints: [0, 0, 0, 0, 0, 0],\n },\n flange_pose: {\n position: {\n x: -2.763015284002938,\n y: -630.2151479701106,\n z: 577.524509114342,\n },\n orientation: {\n x: -1.704794877102097,\n y: -1.9722372952861567,\n z: -0.4852079204210754,\n },\n coordinate_system: \"\",\n },\n tcp_pose: {\n position: {\n x: -2.763015284002938,\n y: -630.2151479701106,\n z: 577.524509114342,\n },\n orientation: {\n x: -1.704794877102097,\n y: -1.9722372952861567,\n z: -0.4852079204210754,\n },\n coordinate_system: \"\",\n tcp: \"Flange\",\n },\n velocity: {\n linear: {\n x: 0,\n y: 0,\n z: 0,\n },\n angular: {\n x: -0,\n y: 0,\n z: 0,\n },\n coordinate_system: \"\",\n },\n force: {\n force: {\n x: 0,\n y: 0,\n z: 0,\n },\n moment: {\n x: 0,\n y: 0,\n z: 0,\n },\n coordinate_system: \"\",\n },\n joint_limit_reached: {\n limit_reached: [\n false,\n false,\n false,\n false,\n false,\n false,\n ],\n },\n joint_current: {\n joints: [0, 0, 0, 0, 0, 0],\n },\n sequence_number: \"627897\",\n },\n ],\n sequence_number: \"627897\",\n },\n movement_state: \"MOVEMENT_STATE_MOVING\",\n },\n }),\n }),\n )\n }\n }, 10)\n }\n\n handleWebsocketMessage(socket: AutoReconnectingWebsocket, message: string) {\n console.log(`Received message on ${socket.url}`, message)\n }\n}\n\nconst defaultMotionState = {\n result: {\n state: {\n motion_group: \"0@universalrobots-ur5e\",\n controller: \"universalrobots-ur5e\",\n joint_position: {\n joints: [\n 1.1699999570846558, -1.5700000524520874, 1.3600000143051147,\n 1.0299999713897705, 1.2899999618530273, 1.2799999713897705,\n ],\n },\n joint_velocity: {\n joints: [0, 0, 0, 0, 0, 0],\n },\n flange_pose: {\n position: {\n x: 1.3300010259703043,\n y: -409.2680714682808,\n z: 531.0203477065281,\n },\n orientation: {\n x: 1.7564919306270736,\n y: -1.7542521568325058,\n z: 0.7326972590614671,\n },\n coordinate_system: \"\",\n },\n tcp_pose: {\n position: {\n x: 1.3300010259703043,\n y: -409.2680714682808,\n z: 531.0203477065281,\n },\n orientation: {\n x: 1.7564919306270736,\n y: -1.7542521568325058,\n z: 0.7326972590614671,\n },\n coordinate_system: \"\",\n tcp: \"Flange\",\n },\n velocity: {\n linear: {\n x: 0,\n y: 0,\n z: 0,\n },\n angular: {\n x: 0,\n y: 0,\n z: 0,\n },\n coordinate_system: \"\",\n },\n force: {\n force: {\n x: 0,\n y: 0,\n z: 0,\n },\n moment: {\n x: 0,\n y: 0,\n z: 0,\n },\n coordinate_system: \"\",\n },\n joint_limit_reached: {\n limit_reached: [false, false, false, false, false, false],\n },\n joint_current: {\n joints: [0, 0, 0, 0, 0, 0],\n },\n sequence_number: \"1\",\n },\n tcp_pose: {\n position: {\n x: 302.90748476115556,\n y: -152.87065869452337,\n z: 424.0454619321661,\n },\n orientation: {\n x: 2.3403056115045353,\n y: -1.1706836379431356,\n z: 0.9772511964246311,\n },\n coordinate_system: \"\",\n tcp: \"Flange\",\n },\n } satisfies MotionGroupStateResponse,\n}\n","/**\n * @fileoverview\n * @deprecated The nova v1 client is deprecated. Please use the v2 client from `@wandelbots/nova-js/v2` instead.\n */\n\nimport type { Configuration as BaseConfiguration } from \"@wandelbots/nova-api/v1\"\nimport type { AxiosRequestConfig } from \"axios\"\nimport axios, { isAxiosError } from \"axios\"\nimport { loginWithAuth0 } from \"../../../LoginWithAuth0.js\"\nimport { AutoReconnectingWebsocket } from \"../../AutoReconnectingWebsocket.js\"\nimport { availableStorage } from \"../../availableStorage.js\"\nimport { parseNovaInstanceUrl } from \"../../converters.js\"\n\nimport { ConnectedMotionGroup } from \"./ConnectedMotionGroup.js\"\nimport { JoggerConnection } from \"./JoggerConnection.js\"\nimport { MotionStreamConnection } from \"./MotionStreamConnection.js\"\nimport { NovaCellAPIClient } from \"./NovaCellAPIClient.js\"\nimport { MockNovaInstance } from \"./mock/MockNovaInstance.js\"\n\n/** @deprecated Use `NovaConfig` from `@wandelbots/nova-js/v2` instead. */\nexport type NovaClientConfig = {\n /**\n * Url of the deployed Nova instance to connect to\n * e.g. https://saeattii.instance.wandelbots.io\n */\n instanceUrl: string | \"https://mock.example.com\"\n\n /**\n * Identifier of the cell on the Nova instance to connect this client to.\n * If omitted, the default identifier \"cell\" is used.\n **/\n cellId?: string\n\n /**\n * Username for basic auth to the Nova instance.\n * @deprecated use accessToken instead\n */\n username?: string\n\n /**\n * Password for basic auth to the Nova instance.\n * @deprecated use accessToken instead\n */\n password?: string\n\n /**\n * Access token for Bearer authentication.\n */\n accessToken?: string\n} & Omit<BaseConfiguration, \"isJsonMime\" | \"basePath\">\n\ntype NovaClientConfigWithDefaults = NovaClientConfig & { cellId: string }\n\n/**\n * Client for connecting to a Nova instance and controlling robots.\n * @deprecated The nova v1 client is deprecated. Please use the v2 client from `@wandelbots/nova-js/v2` instead.\n */\nexport class NovaClient {\n readonly api: NovaCellAPIClient\n readonly config: NovaClientConfigWithDefaults\n readonly mock?: MockNovaInstance\n readonly instanceUrl: URL\n authPromise: Promise<string | null> | null = null\n accessToken: string | null = null\n\n constructor(config: NovaClientConfig) {\n const cellId = config.cellId ?? \"cell\"\n this.config = {\n cellId,\n ...config,\n }\n this.accessToken =\n config.accessToken ||\n availableStorage.getString(\"wbjs.access_token\") ||\n null\n\n if (this.config.instanceUrl === \"https://mock.example.com\") {\n this.mock = new MockNovaInstance()\n }\n this.instanceUrl = parseNovaInstanceUrl(this.config.instanceUrl)\n\n // Set up Axios instance with interceptor for token fetching\n const axiosInstance = axios.create({\n baseURL: new URL(\"/api/v1\", this.config.instanceUrl).href,\n // TODO - backend needs to set proper CORS headers for this\n headers:\n typeof window !== \"undefined\" &&\n window.location.origin.includes(\"localhost\")\n ? {}\n : {\n // Identify the client to the backend for logging purposes\n \"X-Wandelbots-Client\": \"Wandelbots-Nova-JS-SDK\",\n },\n })\n\n axiosInstance.interceptors.request.use(async (request) => {\n if (!request.headers.Authorization) {\n if (this.accessToken) {\n request.headers.Authorization = `Bearer ${this.accessToken}`\n } else if (this.config.username && this.config.password) {\n request.headers.Authorization = `Basic ${btoa(`${config.username}:${config.password}`)}`\n }\n }\n return request\n })\n\n if (typeof window !== \"undefined\") {\n axiosInstance.interceptors.response.use(\n (r) => r,\n async (error) => {\n if (isAxiosError(error)) {\n if (error.response?.status === 401) {\n // If we hit a 401, attempt to login the user and retry with\n // a new access token\n try {\n await this.renewAuthentication()\n\n if (error.config) {\n if (this.accessToken) {\n error.config.headers.Authorization = `Bearer ${this.accessToken}`\n } else {\n delete error.config.headers.Authorization\n }\n return axiosInstance.request(error.config)\n }\n } catch (err) {\n return Promise.reject(err)\n }\n } else if (error.response?.status === 503) {\n // Check if the server as a whole is down\n const res = await fetch(window.location.href)\n if (res.status === 503) {\n // Go to 503 page\n window.location.reload()\n }\n }\n }\n\n return Promise.reject(error)\n },\n )\n }\n\n this.api = new NovaCellAPIClient(cellId, {\n ...config,\n basePath: new URL(\"/api/v1\", this.instanceUrl).href,\n isJsonMime: (mime: string) => {\n return mime === \"application/json\"\n },\n baseOptions: {\n ...(this.mock\n ? ({\n adapter: (config) => {\n // biome-ignore lint/style/noNonNullAssertion: legacy code\n return this.mock!.handleAPIRequest(config)\n },\n } satisfies AxiosRequestConfig)\n : {}),\n ...config.baseOptions,\n },\n axiosInstance,\n })\n }\n\n async renewAuthentication(): Promise<void> {\n if (this.authPromise) {\n // Don't double up\n return\n }\n\n const storedToken = availableStorage.getString(\"wbjs.access_token\")\n if (storedToken && this.accessToken !== storedToken) {\n // Might be newer than the one we have\n this.accessToken = storedToken\n return\n }\n\n // Otherwise, perform login flow\n this.authPromise = loginWithAuth0(this.instanceUrl)\n try {\n this.accessToken = await this.authPromise\n if (this.accessToken) {\n // Cache access token so we don't need to log in every refresh\n availableStorage.setString(\"wbjs.access_token\", this.accessToken)\n } else {\n availableStorage.delete(\"wbjs.access_token\")\n }\n } finally {\n this.authPromise = null\n }\n }\n\n makeWebsocketURL(path: string): string {\n const url = new URL(\n new URL(\n `/api/v1/cells/${this.config.cellId}/${path.replace(/^\\/+/, \"\")}`,\n this.instanceUrl,\n ).href,\n )\n url.protocol = url.protocol.replace(\"http\", \"ws\")\n url.protocol = url.protocol.replace(\"https\", \"wss\")\n\n // If provided, add basic auth credentials to the URL\n // NOTE - basic auth is deprecated on websockets and doesn't work in Safari\n // use tokens instead\n if (this.accessToken) {\n url.searchParams.append(\"token\", this.accessToken)\n } else if (this.config.username && this.config.password) {\n url.username = this.config.username\n url.password = this.config.password\n }\n\n return url.toString()\n }\n\n /**\n * Retrieve an AutoReconnectingWebsocket to the given path on the Nova instance.\n * If you explicitly want to reconnect an existing websocket, call `reconnect`\n * on the returned object.\n */\n openReconnectingWebsocket(path: string) {\n return new AutoReconnectingWebsocket(this.makeWebsocketURL(path), {\n mock: this.mock,\n })\n }\n\n /**\n * Connect to the motion state websocket(s) for a given motion group\n */\n async connectMotionStream(motionGroupId: string) {\n return await MotionStreamConnection.open(this, motionGroupId)\n }\n\n /**\n * Connect to the jogging websocket(s) for a given motion group\n */\n async connectJogger(motionGroupId: string) {\n return await JoggerConnection.open(this, motionGroupId)\n }\n\n async connectMotionGroups(\n motionGroupIds: string[],\n ): Promise<ConnectedMotionGroup[]> {\n const { instances } = await this.api.controller.listControllers()\n\n return Promise.all(\n motionGroupIds.map((motionGroupId) =>\n ConnectedMotionGroup.connect(this, motionGroupId, instances),\n ),\n )\n }\n\n async connectMotionGroup(\n motionGroupId: string,\n ): Promise<ConnectedMotionGroup> {\n const motionGroups = await this.connectMotionGroups([motionGroupId])\n // biome-ignore lint/style/noNonNullAssertion: legacy code\n return motionGroups[0]!\n }\n}\n","import type { Pose } from \"@wandelbots/nova-api/v1\"\n\n/**\n * Convert a Pose object representing a motion group position\n * into a string which represents that pose in Wandelscript.\n * @deprecated\n */\nexport function poseToWandelscriptString(\n pose: Pick<Pose, \"position\" | \"orientation\">,\n) {\n const position = [pose.position.x, pose.position.y, pose.position.z]\n const orientation = [\n pose.orientation?.x ?? 0,\n pose.orientation?.y ?? 0,\n pose.orientation?.z ?? 0,\n ]\n\n const positionValues = position.map((v) => v.toFixed(1))\n // Rotation needs more precision since it's in radians\n const rotationValues = orientation.map((v) => v.toFixed(4))\n\n return `(${positionValues.concat(rotationValues).join(\", \")})`\n}\n"],"mappings":";;;;;;;;;;;;AAGA,SAAgB,iBACd,gBACA,gBACA,sBACS;CACT,IAAI,eAAe,WAAW,eAAe,QAC3C,OAAO;CAGT,KAAK,IAAI,aAAa,GAAG,aAAa,eAAe,QAAQ,cAC3D,IAEE,KAAK,IAAI,eAAe,cAAe,eAAe,WAAY,IAClE,sBAEA,OAAO;CA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AAO;QACP,OAAO;QACP,GAAG;QACH,GAAG;QACH,4BAA4B;OAC9B;OACA;QACE,OAAO;QACP,OAAO;QACP,GAAG;QACH,GAAG;QACH,4BAA4B;OAC9B;MACF;MACA,yBAAyB;OACvB;QACE,OAAO;QACP,aAAa;QACb,aAAa;QACb,WAAW;OACb;OACA;QACE,OAAO;QACP,aAAa;QACb,aAAa;QACb,WAAW;OACb;OACA;QACE,OAAO;QACP,aAAa;QACb,aAAa;QACb,WAAW;OACb;OACA;QACE,OAAO;QACP,aAAa;QACb,aAAa;QACb,WAAW;OACb;OACA;QACE,OAAO;QACP,aAAa;QACb,aAAa;QACb,WAAW;OACb;OACA;QACE,OAAO;QACP,aAAa;QACb,aAAa;QACb,WAAW;OACb;MACF;KACF;IACF;GACF;GACA;IACE,QAAQ;IACR,MAAM;IACN,SAAS;KACP,OAAO;MACL,iBAAiB,CACf;OACE,cAAc;OACd,UAAU;QACR,uBAAuB;SACrB;UACE,OAAO;UACP,aAAa;UACb,aAAa;UACb,WAAW;SACb;SACA;UACE,OAAO;UACP,aAAa;UACb,aAAa;UACb,WAAW;SACb;SACA;UACE,OAAO;UACP,aAAa;UACb,aAAa;UACb,WAAW;SACb;SACA;UACE,OAAO;UACP,aAAa;UACb,aAAa;UACb,WAAW;SACb;SACA;UACE,OAAO;UACP,aAAa;UACb,aAAa;UACb,WAAW;SACb;SACA;UACE,OAAO;UACP,aAAa;UACb,aAAa;UACb,WAAW;SACb;QACF;QACA,uBAAuB;SACrB;UACE,OAAO;UACP,OAAO;SACT;SACA;UACE,OAAO;UACP,OAAO;SACT;SACA;UACE,OAAO;UACP,OAAO;SACT;SACA;UACE,OAAO;UACP,OAAO;SACT;SACA;UACE,OAAO;UACP,OAAO;SACT;SACA;UACE,OAAO;UACP,OAAO;SACT;QACF;QACA,2BAA2B,CAAC;QAC5B,qBAAqB,CAAC;QACtB,oBAAoB;OACtB;MACF,CACF;MACA,cAAc;OACZ;QACE,IAAI;QACJ,UAAU;QACV,UAAU;SACR,UAAU,EACR,kBAAkB;UAChB;WACE,aAAa,EACX,UAAU;YACR;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;WACF,EACF;WACA,WAAW;YACT,UAAU;aACR,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA,aAAa;aACX,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;YACL;WACF;WACA,IAAI;UACN;UACA;WACE,aAAa,EACX,UAAU;YACR;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;WACF,EACF;WACA,WAAW;YACT,UAAU;aACR,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA,aAAa;aACX,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;YACL;WACF;WACA,IAAI;UACN;UACA;WACE,aAAa,EACX,UAAU;YACR;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;WACF,EACF;WACA,WAAW;YACT,UAAU;aACR,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA,aAAa;aACX,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;YACL;WACF;WACA,IAAI;UACN;UACA;WACE,aAAa,EACX,UAAU;YACR;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;WACF,EACF;WACA,WAAW;YACT,UAAU;aACR,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA,aAAa;aACX,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;YACL;WACF;WACA,IAAI;UACN;UACA;WACE,aAAa,EACX,UAAU;YACR;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;WACF,EACF;WACA,WAAW;YACT,UAAU;aACR,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA,aAAa;aACX,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;YACL;WACF;WACA,IAAI;UACN;UACA;WACE,aAAa,EACX,UAAU;YACR;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA;aACE,GAAG;aACH,GAAG;aACH,GAAG;YACL;WACF,EACF;WACA,WAAW;YACT,UAAU;aACR,GAAG;aACH,GAAG;aACH,GAAG;YACL;YACA,aAAa;aACX,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;YACL;WACF;WACA,IAAI;UACN;SACF,EACF;SACA,WAAW;UACT,UAAU;WACR,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA,aAAa;WACX,GAAG;WACH,GAAG;WACH,GAAG;WACH,GAAG;UACL;SACF;SACA,IAAI;QACN;QACA,kBAAkB;OACpB;OACA;QACE,IAAI;QACJ,UAAU;QACV,UAAU;SACR,aAAa,EACX,UAAU;UACR;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;SACF,EACF;SACA,WAAW;UACT,UAAU;WACR,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA,aAAa;WACX,GAAG;WACH,GAAG;WACH,GAAG;WACH,GAAG;UACL;SACF;SACA,IAAI;QACN;QACA,kBAAkB;OACpB;OACA;QACE,IAAI;QACJ,UAAU;QACV,UAAU;SACR,aAAa,EACX,UAAU;UACR;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;SACF,EACF;SACA,WAAW;UACT,UAAU;WACR,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA,aAAa;WACX,GAAG;WACH,GAAG;WACH,GAAG;WACH,GAAG;UACL;SACF;SACA,IAAI;QACN;QACA,kBAAkB;OACpB;OACA;QACE,IAAI;QACJ,UAAU;QACV,UAAU;SACR,aAAa,EACX,UAAU;UACR;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;SACF,EACF;SACA,WAAW;UACT,UAAU;WACR,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA,aAAa;WACX,GAAG;WACH,GAAG;WACH,GAAG;WACH,GAAG;UACL;SACF;SACA,IAAI;QACN;QACA,kBAAkB;OACpB;OACA;QACE,IAAI;QACJ,UAAU;QACV,UAAU;SACR,aAAa,EACX,UAAU;UACR;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA;WACE,GAAG;WACH,GAAG;WACH,GAAG;UACL;SACF,EACF;SACA,WAAW;UACT,UAAU;WACR,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA,aAAa;WACX,GAAG;WACH,GAAG;WACH,GAAG;WACH,GAAG;UACL;SACF;SACA,IAAI;QACN;QACA,kBAAkB;OACpB;MACF;MACA,wBAAwB;OACtB;QACE,YAAY;QACZ,UAAU;SACR,QAAQ,EACN,QAAQ,IACV;SACA,WAAW;UACT,UAAU;WACR,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA,aAAa;WACX,GAAG;WACH,GAAG;WACH,GAAG;WACH,GAAG;UACL;SACF;SACA,IAAI;QACN;OACF;OACA;QACE,YAAY;QACZ,UAAU;SACR,SAAS;UACP,QAAQ;UACR,iBAAiB;SACnB;SACA,WAAW;UACT,UAAU;WACR,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA,aAAa;WACX,GAAG;WACH,GAAG,CAAC,KAAK;WACT,GAAG;WACH,GAAG,KAAK;UACV;SACF;SACA,IAAI;QACN;OACF;OACA;QACE,YAAY;QACZ,UAAU;SACR,QAAQ,EACN,QAAQ,IACV;SACA,WAAW;UACT,UAAU;WACR,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA,aAAa;WACX,GAAG;WACH,GAAG;WACH,GAAG;WACH,GAAG;UACL;SACF;SACA,IAAI;QACN;OACF;OACA;QACE,YAAY;QACZ,UAAU;SACR,SAAS;UACP,QAAQ;UACR,iBAAiB;SACnB;SACA,WAAW;UACT,UAAU;WACR,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA,aAAa;WACX,GAAG,CAAC,KAAK;WACT,GAAG;WACH,GAAG;WACH,GAAG,KAAK;UACV;SACF;SACA,IAAI;QACN;OACF;OACA;QACE,YAAY;QACZ,UAAU;SACR,QAAQ,EACN,QAAQ,GACV;SACA,WAAW;UACT,UAAU;WACR,GAAG;WACH,GAAG;WACH,GAAG;UACL;UACA,aAAa;WACX,GAAG;WACH,GAAG;WACH,GAAG;WACH,GAAG;UACL;SACF;SACA,IAAI;QACN;OACF;MACF;MACA,iBAAiB,CAAC;KACpB;IACF;GACF;GACA;IACE,QAAQ;IACR,MAAM;IACN,SAAS;KACP,OAAO,EACL,mBAAmB,CACjB;MACE,mBAAmB;MACnB,MAAM;MACN,eAAe;MACf,UAAU;OACR,GAAG;OACH,GAAG;OACH,GAAG;MACL;MACA,UAAU;OACR,QAAQ;QAAC;QAAG;QAAG;OAAC;OAChB,MAAM;MACR;KACF,CACF,EACF;IACF;GACF;GACA;IACE,QAAQ;IACR,MAAM;IACN,SAAS;KACP,OAAO,EACL,MAAM,CACJ;MACE,IAAI;MACJ,eAAe;MACf,UAAU;OACR,GAAG;OACH,GAAG;OACH,GAAG;MACL;MACA,UAAU;OACR,QAAQ;QAAC;QAAG;QAAG;QAAG;OAAC;OACnB,MAAM;MACR;KACF,GACA;MACE,IAAI;MACJ,eAAe;MACf,UAAU;OACR,GAAG;OACH,GAAG;OACH,GAAG;MACL;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A;CACA,MAAM,WAAW;EAAC,KAAK,SAAS;EAAG,KAAK,SAAS;EAAG,KAAK,SAAS;CAAC;CACnE,MAAM,cAAc;EAClB,KAAK,aAAa,KAAK;EACvB,KAAK,aAAa,KAAK;EACvB,KAAK,aAAa,KAAK;CACzB;CAEA,MAAM,iBAAiB,SAAS,KAAK,MAAM,EAAE,QAAQ,CAAC,CAAC;CAEvD,MAAM,iBAAiB,YAAY,KAAK,MAAM,EAAE,QAAQ,CAAC,CAAC;CAE1D,OAAO,IAAI,eAAe,OAAO,cAAc,EAAE,KAAK,IAAI,EAAE;AAC9D"}
@@ -1,14 +1,16 @@
1
- import { r as MockNovaInstance, t as AutoReconnectingWebsocket } from "./AutoReconnectingWebsocket-DEs8wlLZ.cjs";
1
+ import { r as MockNovaInstance, t as AutoReconnectingWebsocket } from "./AutoReconnectingWebsocket-DNOF9mpz.mjs";
2
2
  import { AxiosInstance } from "axios";
3
- import { ApplicationApi, CellApi, Configuration, ControllerApi, ControllerIOsApi, ControllerInstance, CoordinateSystemsApi, DeviceConfigurationApi, Joints, LibraryProgramApi, LibraryProgramMetadataApi, LibraryRecipeApi, LibraryRecipeMetadataApi, MotionApi, MotionGroupApi, MotionGroupInfosApi, MotionGroupJoggingApi, MotionGroupKinematicApi, MotionGroupPhysical, MotionGroupSpecification, MotionGroupStateResponse, Mounting, Pose, ProgramApi, ProgramValuesApi, RobotControllerState, RobotTcp, SafetySetup, StoreCollisionComponentsApi, StoreCollisionScenesApi, StoreObjectApi, SystemApi, TcpPose, VirtualRobotApi, VirtualRobotBehaviorApi, VirtualRobotModeApi, VirtualRobotSetupApi } from "@wandelbots/nova-api/v1";
4
3
  import * as THREE from "three";
4
+ import { ApplicationApi, CellApi, Configuration, ControllerApi, ControllerIOsApi, ControllerInstance, CoordinateSystemsApi, DeviceConfigurationApi, Joints, LibraryProgramApi, LibraryProgramMetadataApi, LibraryRecipeApi, LibraryRecipeMetadataApi, MotionApi, MotionGroupApi, MotionGroupInfosApi, MotionGroupJoggingApi, MotionGroupKinematicApi, MotionGroupPhysical, MotionGroupSpecification, MotionGroupStateResponse, Mounting, Pose, ProgramApi, ProgramValuesApi, RobotControllerState, RobotTcp, SafetySetup, StoreCollisionComponentsApi, StoreCollisionScenesApi, StoreObjectApi, SystemApi, TcpPose, VirtualRobotApi, VirtualRobotBehaviorApi, VirtualRobotModeApi, VirtualRobotSetupApi } from "@wandelbots/nova-api/v1";
5
5
 
6
6
  //#region src/lib/deprecated/v1/ConnectedMotionGroup.d.ts
7
+ /** @deprecated */
7
8
  type MotionGroupOption = {
8
9
  selectionId: string;
9
10
  } & MotionGroupPhysical;
10
11
  /**
11
12
  * Store representing the current state of a connected motion group.
13
+ * @deprecated
12
14
  */
13
15
  declare class ConnectedMotionGroup {
14
16
  readonly nova: NovaClient;
@@ -80,6 +82,7 @@ declare class ConnectedMotionGroup {
80
82
  //#region src/lib/deprecated/v1/MotionStreamConnection.d.ts
81
83
  /**
82
84
  * Store representing the current state of a connected motion group.
85
+ * @deprecated
83
86
  */
84
87
  declare class MotionStreamConnection {
85
88
  readonly nova: NovaClient;
@@ -101,6 +104,7 @@ declare class MotionStreamConnection {
101
104
  }
102
105
  //#endregion
103
106
  //#region src/lib/deprecated/v1/JoggerConnection.d.ts
107
+ /** @deprecated */
104
108
  type JoggerConnectionOpts = {
105
109
  /**
106
110
  * When an error message is received from the jogging websocket, it
@@ -109,6 +113,7 @@ type JoggerConnectionOpts = {
109
113
  */
110
114
  onError?: (err: unknown) => void;
111
115
  };
116
+ /** @deprecated */
112
117
  declare class JoggerConnection {
113
118
  readonly motionStream: MotionStreamConnection;
114
119
  readonly opts: JoggerConnectionOpts;
@@ -219,11 +224,14 @@ type OmitFirstArg<F> = F extends ((x: any, ...args: infer P) => infer R) ? (...a
219
224
  type UnwrapAxiosResponseReturn<T> = T extends ((...a: any) => any) ? (...a: Parameters<T>) => Promise<Awaited<ReturnType<T>> extends {
220
225
  data: infer D;
221
226
  } ? D : never> : never;
227
+ /** @deprecated Use `NovaAPIClient` instead. */
222
228
  type WithCellId<T> = { [P in keyof T]: UnwrapAxiosResponseReturn<OmitFirstArg<T[P]>> };
229
+ /** @deprecated Use `NovaAPIClient` instead. */
223
230
  type WithUnwrappedAxiosResponse<T> = { [P in keyof T]: UnwrapAxiosResponseReturn<T[P]> };
224
231
  /**
225
232
  * API client providing type-safe access to all the Nova API REST endpoints
226
233
  * associated with a specific cell id.
234
+ * @deprecated Use `NovaAPIClient` from `@wandelbots/nova-js/v2` instead.
227
235
  */
228
236
  declare class NovaCellAPIClient {
229
237
  readonly cellId: string;
@@ -274,6 +282,7 @@ declare class NovaCellAPIClient {
274
282
  }
275
283
  //#endregion
276
284
  //#region src/lib/deprecated/v1/NovaClient.d.ts
285
+ /** @deprecated Use `NovaConfig` from `@wandelbots/nova-js/v2` instead. */
277
286
  type NovaClientConfig = {
278
287
  /**
279
288
  * Url of the deployed Nova instance to connect to
@@ -339,8 +348,9 @@ declare class NovaClient {
339
348
  /**
340
349
  * Convert a Pose object representing a motion group position
341
350
  * into a string which represents that pose in Wandelscript.
351
+ * @deprecated
342
352
  */
343
353
  declare function poseToWandelscriptString(pose: Pick<Pose, "position" | "orientation">): string;
344
354
  //#endregion
345
355
  export { WithCellId as a, JoggerConnectionOpts as c, MotionGroupOption as d, NovaCellAPIClient as i, MotionStreamConnection as l, NovaClient as n, WithUnwrappedAxiosResponse as o, NovaClientConfig as r, JoggerConnection as s, poseToWandelscriptString as t, ConnectedMotionGroup as u };
346
- //# sourceMappingURL=wandelscriptUtils-_Si3ueEd.d.cts.map
356
+ //# sourceMappingURL=wandelscriptUtils-pySXnBlX.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wandelscriptUtils-pySXnBlX.d.mts","names":[],"sources":["../src/lib/deprecated/v1/ConnectedMotionGroup.ts","../src/lib/deprecated/v1/MotionStreamConnection.ts","../src/lib/deprecated/v1/JoggerConnection.ts","../src/lib/deprecated/v1/NovaCellAPIClient.ts","../src/lib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OAAA,CAAA,sBAAA;EJ3DvB;;;EIkElB,aAAA,CAAc,aAAA,WAAqB,OAAA,CAAA,gBAAA;EAInC,mBAAA,CACJ,cAAA,aACC,OAAA,CAAQ,oBAAA;EAUL,kBAAA,CACJ,aAAA,WACC,OAAA,CAAQ,oBAAA;AAAA;;;;;;;;iBCvPG,wBAAA,CACd,IAAA,EAAM,IAAI,CAAC,IAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wandelbots/nova-js",
3
3
  "type": "module",
4
- "version": "3.9.0-pr.280.5d6f11d",
4
+ "version": "3.9.0-pr.280.641b7e2",
5
5
  "description": "Official JS client for the Wandelbots API",
6
6
  "sideEffects": false,
7
7
  "packageManager": "pnpm@11.1.3+sha512.c85357fe17ca12dd23dd7071822666dfd7e3cb76fe214e3370b5ea2fb34f2a231185509b63e717f3cd0acb38dd3f8d82bcd5e8172400ae678b70ea4fbed0896d",
@@ -74,7 +74,6 @@
74
74
  "mobx": "^6.15.0",
75
75
  "path-to-regexp": "^8.4.0",
76
76
  "reconnecting-websocket": "^4.4.0",
77
- "three": "^0.183.2",
78
- "url-join": "^5.0.0"
77
+ "three": "^0.183.2"
79
78
  }
80
79
  }
@@ -19,12 +19,14 @@ import type { NovaClient } from "./NovaClient"
19
19
 
20
20
  const MOTION_DELTA_THRESHOLD = 0.0001
21
21
 
22
+ /** @deprecated */
22
23
  export type MotionGroupOption = {
23
24
  selectionId: string
24
25
  } & MotionGroupPhysical
25
26
 
26
27
  /**
27
28
  * Store representing the current state of a connected motion group.
29
+ * @deprecated
28
30
  */
29
31
  export class ConnectedMotionGroup {
30
32
  static async connect(
@@ -5,6 +5,7 @@ import { isSameCoordinateSystem, tryParseJson } from "../../converters"
5
5
  import type { MotionStreamConnection } from "./MotionStreamConnection"
6
6
  import type { NovaClient } from "./NovaClient"
7
7
 
8
+ /** @deprecated */
8
9
  export type JoggerConnectionOpts = {
9
10
  /**
10
11
  * When an error message is received from the jogging websocket, it
@@ -14,6 +15,7 @@ export type JoggerConnectionOpts = {
14
15
  onError?: (err: unknown) => void
15
16
  }
16
17
 
18
+ /** @deprecated */
17
19
  export class JoggerConnection {
18
20
  // Currently a separate websocket is needed for each mode, pester API people
19
21
  // to merge these for simplicity
@@ -55,6 +55,7 @@ function unwrapRotationVector(
55
55
 
56
56
  /**
57
57
  * Store representing the current state of a connected motion group.
58
+ * @deprecated
58
59
  */
59
60
  export class MotionStreamConnection {
60
61
  static async open(nova: NovaClient, motionGroupId: string) {
@@ -44,10 +44,12 @@ type UnwrapAxiosResponseReturn<T> = T extends (...a: any) => any
44
44
  ) => Promise<Awaited<ReturnType<T>> extends { data: infer D } ? D : never>
45
45
  : never
46
46
 
47
+ /** @deprecated Use `NovaAPIClient` instead. */
47
48
  export type WithCellId<T> = {
48
49
  [P in keyof T]: UnwrapAxiosResponseReturn<OmitFirstArg<T[P]>>
49
50
  }
50
51
 
52
+ /** @deprecated Use `NovaAPIClient` instead. */
51
53
  export type WithUnwrappedAxiosResponse<T> = {
52
54
  [P in keyof T]: UnwrapAxiosResponseReturn<T[P]>
53
55
  }
@@ -55,6 +57,7 @@ export type WithUnwrappedAxiosResponse<T> = {
55
57
  /**
56
58
  * API client providing type-safe access to all the Nova API REST endpoints
57
59
  * associated with a specific cell id.
60
+ * @deprecated Use `NovaAPIClient` from `@wandelbots/nova-js/v2` instead.
58
61
  */
59
62
  export class NovaCellAPIClient {
60
63
  constructor(
@@ -6,17 +6,18 @@
6
6
  import type { Configuration as BaseConfiguration } from "@wandelbots/nova-api/v1"
7
7
  import type { AxiosRequestConfig } from "axios"
8
8
  import axios, { isAxiosError } from "axios"
9
- import urlJoin from "url-join"
10
9
  import { loginWithAuth0 } from "../../../LoginWithAuth0.js"
11
10
  import { AutoReconnectingWebsocket } from "../../AutoReconnectingWebsocket.js"
12
11
  import { availableStorage } from "../../availableStorage.js"
13
12
  import { parseNovaInstanceUrl } from "../../converters.js"
13
+
14
14
  import { ConnectedMotionGroup } from "./ConnectedMotionGroup.js"
15
15
  import { JoggerConnection } from "./JoggerConnection.js"
16
16
  import { MotionStreamConnection } from "./MotionStreamConnection.js"
17
17
  import { NovaCellAPIClient } from "./NovaCellAPIClient.js"
18
18
  import { MockNovaInstance } from "./mock/MockNovaInstance.js"
19
19
 
20
+ /** @deprecated Use `NovaConfig` from `@wandelbots/nova-js/v2` instead. */
20
21
  export type NovaClientConfig = {
21
22
  /**
22
23
  * Url of the deployed Nova instance to connect to
@@ -80,7 +81,7 @@ export class NovaClient {
80
81
 
81
82
  // Set up Axios instance with interceptor for token fetching
82
83
  const axiosInstance = axios.create({
83
- baseURL: urlJoin(this.config.instanceUrl, "/api/v1"),
84
+ baseURL: new URL("/api/v1", this.config.instanceUrl).href,
84
85
  // TODO - backend needs to set proper CORS headers for this
85
86
  headers:
86
87
  typeof window !== "undefined" &&
@@ -142,7 +143,7 @@ export class NovaClient {
142
143
 
143
144
  this.api = new NovaCellAPIClient(cellId, {
144
145
  ...config,
145
- basePath: urlJoin(this.instanceUrl.href, "/api/v1"),
146
+ basePath: new URL("/api/v1", this.instanceUrl).href,
146
147
  isJsonMime: (mime: string) => {
147
148
  return mime === "application/json"
148
149
  },
@@ -191,11 +192,10 @@ export class NovaClient {
191
192
 
192
193
  makeWebsocketURL(path: string): string {
193
194
  const url = new URL(
194
- urlJoin(
195
- this.instanceUrl.href,
196
- `/api/v1/cells/${this.config.cellId}`,
197
- path,
198
- ),
195
+ new URL(
196
+ `/api/v1/cells/${this.config.cellId}/${path.replace(/^\/+/, "")}`,
197
+ this.instanceUrl,
198
+ ).href,
199
199
  )
200
200
  url.protocol = url.protocol.replace("http", "ws")
201
201
  url.protocol = url.protocol.replace("https", "wss")
@@ -7,12 +7,14 @@ import { tryParseJson } from "../../converters"
7
7
  import type { MotionStreamConnection } from "./MotionStreamConnection"
8
8
  import type { NovaClient } from "./NovaClient"
9
9
 
10
+ /** @deprecated */
10
11
  export type ProgramRunnerLogEntry = {
11
12
  timestamp: number
12
13
  message: string
13
14
  level?: "warn" | "error"
14
15
  }
15
16
 
17
+ /** @deprecated */
16
18
  export enum ProgramState {
17
19
  NotStarted = "not started",
18
20
  Running = "running",
@@ -21,6 +23,7 @@ export enum ProgramState {
21
23
  Completed = "completed",
22
24
  }
23
25
 
26
+ /** @deprecated */
24
27
  export type CurrentProgram = {
25
28
  id?: string
26
29
  wandelscript?: string
@@ -40,6 +43,7 @@ type ProgramStateMessage = {
40
43
  /**
41
44
  * Interface for running Wandelscript programs on the Nova instance and
42
45
  * tracking their progress and output
46
+ * @deprecated
43
47
  */
44
48
  export class ProgramStateConnection {
45
49
  currentProgram: CurrentProgram = {}
@@ -3,6 +3,7 @@ import type { NovaCellAPIClient } from "./NovaCellAPIClient"
3
3
 
4
4
  let lastMotionIds: Set<string> = new Set()
5
5
 
6
+ /** @deprecated */
6
7
  export async function getLatestTrajectories(
7
8
  apiClient: NovaCellAPIClient,
8
9
  sampleTime: number = 50,
@@ -12,6 +12,7 @@ import type { AutoReconnectingWebsocket } from "../../../AutoReconnectingWebsock
12
12
 
13
13
  /**
14
14
  * Ultra-simplified mock Nova server for testing stuff
15
+ * @deprecated
15
16
  */
16
17
  export class MockNovaInstance {
17
18
  readonly connections: AutoReconnectingWebsocket[] = []
@@ -1,5 +1,6 @@
1
1
  import type { TcpPose } from "@wandelbots/nova-api/v1"
2
2
 
3
+ /** @deprecated */
3
4
  export function jointValuesEqual(
4
5
  oldJointValues: number[],
5
6
  newJointValues: number[],
@@ -22,6 +23,7 @@ export function jointValuesEqual(
22
23
  return true
23
24
  }
24
25
 
26
+ /** @deprecated */
25
27
  export function tcpPoseEqual(
26
28
  oldTcp: TcpPose | undefined,
27
29
  newTcp: TcpPose | undefined,
@@ -3,6 +3,7 @@ import type { Pose } from "@wandelbots/nova-api/v1"
3
3
  /**
4
4
  * Convert a Pose object representing a motion group position
5
5
  * into a string which represents that pose in Wandelscript.
6
+ * @deprecated
6
7
  */
7
8
  export function poseToWandelscriptString(
8
9
  pose: Pick<Pose, "position" | "orientation">,
@@ -44,10 +44,12 @@ type UnwrapAxiosResponseReturn<T> = T extends (...a: any) => any
44
44
  ) => Promise<Awaited<ReturnType<T>> extends { data: infer D } ? D : never>
45
45
  : never
46
46
 
47
+ /** @deprecated Use `NovaAPIClient` instead. */
47
48
  export type WithCellId<T> = {
48
49
  [P in keyof T]: UnwrapAxiosResponseReturn<OmitFirstArg<T[P]>>
49
50
  }
50
51
 
52
+ /** @deprecated Use `NovaAPIClient` instead. */
51
53
  export type WithUnwrappedAxiosResponse<T> = {
52
54
  [P in keyof T]: UnwrapAxiosResponseReturn<T[P]>
53
55
  }
@@ -55,6 +57,7 @@ export type WithUnwrappedAxiosResponse<T> = {
55
57
  /**
56
58
  * API client providing type-safe access to all the Nova API REST endpoints
57
59
  * associated with a specific cell id.
60
+ * @deprecated Use `NovaAPIClient` from `@wandelbots/nova-js/v2` instead.
58
61
  */
59
62
  export class NovaCellAPIClient {
60
63
  constructor(