@wandelbots/nova-js 3.9.1 → 3.10.0-pr.295.cb733a7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AutoReconnectingWebsocket-DNOF9mpz.d.cts.map +1 -1
- package/dist/AutoReconnectingWebsocket-DNOF9mpz.d.mts.map +1 -1
- package/dist/{LoginWithAuth0-DeirP_w9.mjs → context-BQk3xGAI.mjs} +6 -2
- package/dist/context-BQk3xGAI.mjs.map +1 -0
- package/dist/{LoginWithAuth0-oZFpwe7m.cjs → context-Dmy8AyY7.cjs} +17 -1
- package/dist/context-Dmy8AyY7.cjs.map +1 -0
- package/dist/index.cjs +17 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/lib/deprecated/v1/index.cjs +3 -3
- package/dist/lib/deprecated/v1/index.cjs.map +1 -1
- package/dist/lib/deprecated/v1/index.d.cts.map +1 -1
- package/dist/lib/deprecated/v1/index.d.mts.map +1 -1
- package/dist/lib/deprecated/v1/index.mjs +2 -2
- package/dist/lib/v2/index.cjs +23 -19
- package/dist/lib/v2/index.cjs.map +1 -1
- package/dist/lib/v2/index.d.cts.map +1 -1
- package/dist/lib/v2/index.d.mts.map +1 -1
- package/dist/lib/v2/index.mjs +7 -3
- package/dist/lib/v2/index.mjs.map +1 -1
- package/dist/wandelscriptUtils-1A9uFPV_.d.cts.map +1 -1
- package/dist/{wandelscriptUtils-C7hQePlo.mjs → wandelscriptUtils-BDdIFHPD.mjs} +4 -4
- package/dist/{wandelscriptUtils-C7hQePlo.mjs.map → wandelscriptUtils-BDdIFHPD.mjs.map} +1 -1
- package/dist/{wandelscriptUtils-P0WYSZww.cjs → wandelscriptUtils-BUUwGZNr.cjs} +23 -23
- package/dist/wandelscriptUtils-BUUwGZNr.cjs.map +1 -0
- package/dist/wandelscriptUtils-pySXnBlX.d.mts.map +1 -1
- package/package.json +4 -2
- package/src/lib/context.ts +8 -0
- package/src/lib/deprecated/v1/NovaClient.ts +8 -9
- package/src/lib/deprecated/v2/NovaClient.ts +7 -8
- package/src/lib/v2/Nova.ts +28 -8
- package/dist/LoginWithAuth0-DeirP_w9.mjs.map +0 -1
- package/dist/LoginWithAuth0-oZFpwe7m.cjs.map +0 -1
- package/dist/wandelscriptUtils-P0WYSZww.cjs.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_context = require("./context-Dmy8AyY7.cjs");
|
|
2
2
|
let axios = require("axios");
|
|
3
|
-
axios =
|
|
3
|
+
axios = require_context.__toESM(axios, 1);
|
|
4
4
|
let mobx = require("mobx");
|
|
5
5
|
let three = require("three");
|
|
6
|
-
three =
|
|
6
|
+
three = require_context.__toESM(three, 1);
|
|
7
7
|
let three_src_math_Vector3_js = require("three/src/math/Vector3.js");
|
|
8
8
|
let _wandelbots_nova_api_v1 = require("@wandelbots/nova-api/v1");
|
|
9
9
|
let path_to_regexp = require("path-to-regexp");
|
|
10
|
-
path_to_regexp =
|
|
10
|
+
path_to_regexp = require_context.__toESM(path_to_regexp, 1);
|
|
11
11
|
//#region src/lib/deprecated/v1/motionStateUpdate.ts
|
|
12
12
|
/** @deprecated */
|
|
13
13
|
function jointValuesEqual(oldJointValues, newJointValues, changeDeltaThreshold) {
|
|
@@ -44,7 +44,7 @@ var ConnectedMotionGroup = class ConnectedMotionGroup {
|
|
|
44
44
|
if (!controller || !motionGroup) throw new Error(`Controller ${controllerId} or motion group ${motionGroupId} not found`);
|
|
45
45
|
const motionStateSocket = nova.openReconnectingWebsocket(`/motion-groups/${motionGroupId}/state-stream`);
|
|
46
46
|
const firstMessage = await motionStateSocket.firstMessage();
|
|
47
|
-
const initialMotionState =
|
|
47
|
+
const initialMotionState = require_context.tryParseJson(firstMessage.data)?.result;
|
|
48
48
|
if (!initialMotionState) throw new Error(`Unable to parse initial motion state message ${firstMessage.data}`);
|
|
49
49
|
console.log(`Connected motion state websocket to motion group ${motionGroup.motion_group}. Initial state:\n `, initialMotionState);
|
|
50
50
|
const isVirtual = (await nova.api.controller.getRobotController(controller.controller)).configuration.kind === "VirtualController";
|
|
@@ -58,7 +58,7 @@ var ConnectedMotionGroup = class ConnectedMotionGroup {
|
|
|
58
58
|
})();
|
|
59
59
|
const controllerStateSocket = nova.openReconnectingWebsocket(`/controllers/${controller.controller}/state-stream?response_rate=1000`);
|
|
60
60
|
const firstControllerMessage = await controllerStateSocket.firstMessage();
|
|
61
|
-
const initialControllerState =
|
|
61
|
+
const initialControllerState = require_context.tryParseJson(firstControllerMessage.data)?.result;
|
|
62
62
|
if (!initialControllerState) throw new Error(`Unable to parse initial controller state message ${firstControllerMessage.data}`);
|
|
63
63
|
console.log(`Connected controller state websocket to controller ${controller.controller}. Initial state:\n `, initialControllerState);
|
|
64
64
|
const { tcps } = await nova.api.motionGroupInfos.listTcps(motionGroupId);
|
|
@@ -84,14 +84,14 @@ var ConnectedMotionGroup = class ConnectedMotionGroup {
|
|
|
84
84
|
this.rapidlyChangingMotionState = initialMotionState;
|
|
85
85
|
this.controllerState = initialControllerState;
|
|
86
86
|
controllerStateSocket.addEventListener("message", (event) => {
|
|
87
|
-
const data =
|
|
87
|
+
const data = require_context.tryParseJson(event.data)?.result;
|
|
88
88
|
if (!data) return;
|
|
89
89
|
(0, mobx.runInAction)(() => {
|
|
90
90
|
this.controllerState = data;
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
93
|
motionStateSocket.addEventListener("message", (event) => {
|
|
94
|
-
const motionStateResponse =
|
|
94
|
+
const motionStateResponse = require_context.tryParseJson(event.data)?.result;
|
|
95
95
|
if (!motionStateResponse) throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${event.data}`);
|
|
96
96
|
if (!jointValuesEqual(this.rapidlyChangingMotionState.state.joint_position.joints, motionStateResponse.state.joint_position.joints, MOTION_DELTA_THRESHOLD$1)) (0, mobx.runInAction)(() => {
|
|
97
97
|
this.rapidlyChangingMotionState.state = motionStateResponse.state;
|
|
@@ -315,7 +315,7 @@ var JoggerConnection = class JoggerConnection {
|
|
|
315
315
|
if (mode === "cartesian" && !this.cartesianWebsocket) {
|
|
316
316
|
this.cartesianWebsocket = this.nova.openReconnectingWebsocket(`/motion-groups/move-tcp`);
|
|
317
317
|
this.cartesianWebsocket.addEventListener("message", (ev) => {
|
|
318
|
-
const data =
|
|
318
|
+
const data = require_context.tryParseJson(ev.data);
|
|
319
319
|
if (data && "error" in data) if (this.opts.onError) this.opts.onError(ev.data);
|
|
320
320
|
else throw new Error(ev.data);
|
|
321
321
|
});
|
|
@@ -323,7 +323,7 @@ var JoggerConnection = class JoggerConnection {
|
|
|
323
323
|
if (mode === "joint" && !this.jointWebsocket) {
|
|
324
324
|
this.jointWebsocket = this.nova.openReconnectingWebsocket(`/motion-groups/move-joint`);
|
|
325
325
|
this.jointWebsocket.addEventListener("message", (ev) => {
|
|
326
|
-
const data =
|
|
326
|
+
const data = require_context.tryParseJson(ev.data);
|
|
327
327
|
if (data && "error" in data) if (this.opts.onError) this.opts.onError(ev.data);
|
|
328
328
|
else throw new Error(ev.data);
|
|
329
329
|
});
|
|
@@ -392,7 +392,7 @@ var JoggerConnection = class JoggerConnection {
|
|
|
392
392
|
*/
|
|
393
393
|
async runIncrementalCartesianMotion({ currentTcpPose, currentJoints, coordSystemId, velocityInRelevantUnits, axis, direction, motion }) {
|
|
394
394
|
const commands = [];
|
|
395
|
-
if (!
|
|
395
|
+
if (!require_context.isSameCoordinateSystem(currentTcpPose.coordinate_system, coordSystemId)) throw new Error(`Current TCP pose coordinate system ${currentTcpPose.coordinate_system} does not match target coordinate system ${coordSystemId}`);
|
|
396
396
|
if (motion.type === "translate") {
|
|
397
397
|
const targetTcpPosition = Object.assign({}, currentTcpPose.position);
|
|
398
398
|
targetTcpPosition[axis] += motion.distanceMm * (direction === "-" ? -1 : 1);
|
|
@@ -495,7 +495,7 @@ var MotionStreamConnection = class MotionStreamConnection {
|
|
|
495
495
|
if (!controller || !motionGroup) throw new Error(`Controller ${controllerId} or motion group ${motionGroupId} not found`);
|
|
496
496
|
const motionStateSocket = nova.openReconnectingWebsocket(`/motion-groups/${motionGroupId}/state-stream`);
|
|
497
497
|
const firstMessage = await motionStateSocket.firstMessage();
|
|
498
|
-
const initialMotionState =
|
|
498
|
+
const initialMotionState = require_context.tryParseJson(firstMessage.data)?.result;
|
|
499
499
|
if (!initialMotionState) throw new Error(`Unable to parse initial motion state message ${firstMessage.data}`);
|
|
500
500
|
console.log(`Connected motion state websocket to motion group ${motionGroup.motion_group}. Initial state:\n `, initialMotionState);
|
|
501
501
|
return new MotionStreamConnection(nova, controller, motionGroup, initialMotionState, motionStateSocket);
|
|
@@ -508,7 +508,7 @@ var MotionStreamConnection = class MotionStreamConnection {
|
|
|
508
508
|
this.motionStateSocket = motionStateSocket;
|
|
509
509
|
this.rapidlyChangingMotionState = initialMotionState;
|
|
510
510
|
motionStateSocket.addEventListener("message", (event) => {
|
|
511
|
-
const motionStateResponse =
|
|
511
|
+
const motionStateResponse = require_context.tryParseJson(event.data)?.result;
|
|
512
512
|
if (!motionStateResponse) throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${event.data}`);
|
|
513
513
|
if (!jointValuesEqual(this.rapidlyChangingMotionState.state.joint_position.joints, motionStateResponse.state.joint_position.joints, MOTION_DELTA_THRESHOLD)) (0, mobx.runInAction)(() => {
|
|
514
514
|
this.rapidlyChangingMotionState.state = motionStateResponse.state;
|
|
@@ -1876,12 +1876,12 @@ var NovaClient = class {
|
|
|
1876
1876
|
cellId,
|
|
1877
1877
|
...config
|
|
1878
1878
|
};
|
|
1879
|
-
this.accessToken = config.accessToken ||
|
|
1879
|
+
this.accessToken = config.accessToken || require_context.availableStorage.getString("wbjs.access_token") || null;
|
|
1880
1880
|
if (this.config.instanceUrl === "https://mock.example.com") this.mock = new MockNovaInstance();
|
|
1881
|
-
this.instanceUrl =
|
|
1881
|
+
this.instanceUrl = require_context.parseNovaInstanceUrl(this.config.instanceUrl);
|
|
1882
1882
|
const axiosInstance = axios.default.create({
|
|
1883
1883
|
baseURL: new URL("/api/v1", this.config.instanceUrl).href,
|
|
1884
|
-
headers:
|
|
1884
|
+
headers: require_context.isLocalhostDev ? {} : { "X-Wandelbots-Client": "Wandelbots-Nova-JS-SDK" }
|
|
1885
1885
|
});
|
|
1886
1886
|
axiosInstance.interceptors.request.use(async (request) => {
|
|
1887
1887
|
if (!request.headers.Authorization) {
|
|
@@ -1890,7 +1890,7 @@ var NovaClient = class {
|
|
|
1890
1890
|
}
|
|
1891
1891
|
return request;
|
|
1892
1892
|
});
|
|
1893
|
-
if (
|
|
1893
|
+
if (require_context.isBrowser) axiosInstance.interceptors.response.use((r) => r, async (error) => {
|
|
1894
1894
|
if ((0, axios.isAxiosError)(error)) {
|
|
1895
1895
|
if (error.response?.status === 401) try {
|
|
1896
1896
|
await this.renewAuthentication();
|
|
@@ -1925,16 +1925,16 @@ var NovaClient = class {
|
|
|
1925
1925
|
}
|
|
1926
1926
|
async renewAuthentication() {
|
|
1927
1927
|
if (this.authPromise) return;
|
|
1928
|
-
const storedToken =
|
|
1928
|
+
const storedToken = require_context.availableStorage.getString("wbjs.access_token");
|
|
1929
1929
|
if (storedToken && this.accessToken !== storedToken) {
|
|
1930
1930
|
this.accessToken = storedToken;
|
|
1931
1931
|
return;
|
|
1932
1932
|
}
|
|
1933
|
-
this.authPromise =
|
|
1933
|
+
this.authPromise = require_context.loginWithAuth0(this.instanceUrl);
|
|
1934
1934
|
try {
|
|
1935
1935
|
this.accessToken = await this.authPromise;
|
|
1936
|
-
if (this.accessToken)
|
|
1937
|
-
else
|
|
1936
|
+
if (this.accessToken) require_context.availableStorage.setString("wbjs.access_token", this.accessToken);
|
|
1937
|
+
else require_context.availableStorage.delete("wbjs.access_token");
|
|
1938
1938
|
} finally {
|
|
1939
1939
|
this.authPromise = null;
|
|
1940
1940
|
}
|
|
@@ -1956,7 +1956,7 @@ var NovaClient = class {
|
|
|
1956
1956
|
* on the returned object.
|
|
1957
1957
|
*/
|
|
1958
1958
|
openReconnectingWebsocket(path) {
|
|
1959
|
-
return new
|
|
1959
|
+
return new require_context.AutoReconnectingWebsocket(this.makeWebsocketURL(path), { mock: this.mock });
|
|
1960
1960
|
}
|
|
1961
1961
|
/**
|
|
1962
1962
|
* Connect to the motion state websocket(s) for a given motion group
|
|
@@ -2038,4 +2038,4 @@ Object.defineProperty(exports, "poseToWandelscriptString", {
|
|
|
2038
2038
|
}
|
|
2039
2039
|
});
|
|
2040
2040
|
|
|
2041
|
-
//# sourceMappingURL=wandelscriptUtils-
|
|
2041
|
+
//# sourceMappingURL=wandelscriptUtils-BUUwGZNr.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wandelscriptUtils-BUUwGZNr.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","isLocalhostDev","isBrowser","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 { isBrowser, isLocalhostDev } from \"../../context.js\"\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: isLocalhostDev\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 (isBrowser) {\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;CAIX,OAAO;AACT;;AAGA,SAAgB,aACd,QACA,QACA,sBACS;CAET,IAAK,WAAW,KAAA,KAAa,UAAY,UAAU,WAAW,KAAA,GAC5D,OAAO;CAIT,IAAI,WAAW,KAAA,KAAa,WAAW,KAAA,GACrC,OAAO;CAGT,IAAI,eAAe;CACnB,gBAAgB,KAAK,IAAI,OAAO,YAAY,IAAI,OAAO,YAAY,CAAC;CACpE,gBAAgB,KAAK,IAAI,OAAO,YAAY,IAAI,OAAO,YAAY,CAAC;CACpE,gBAAgB,KAAK,IAAI,OAAO,YAAY,IAAI,OAAO,YAAY,CAAC;CACpE,gBAAgB,KAAK,IAAI,OAAO,SAAS,IAAI,OAAO,SAAS,CAAC;CAC9D,gBAAgB,KAAK,IAAI,OAAO,SAAS,IAAI,OAAO,SAAS,CAAC;CAC9D,gBAAgB,KAAK,IAAI,OAAO,SAAS,IAAI,OAAO,SAAS,CAAC;CAE9D,IAAI,eAAe,sBACjB,OAAO;CAGT,OACE,OAAO,sBAAsB,OAAO,qBACpC,OAAO,QAAQ,OAAO;AAE1B;;;ACtCA,MAAMA,2BAAyB;;;;;AAW/B,IAAa,uBAAb,MAAa,qBAAqB;CAChC,aAAa,QACX,MACA,eACA,aACA;EACA,MAAM,CAAC,mBAAmB,gBAAgB,cAAc,MAAM,GAAG;EAI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ACb,MAAM;OACN,cAAc;OACd,UAAU;OACV,MAAM;MACR;MACA,MAAM;KACR;IACF;GACF;GACA;IACE,QAAQ;IACR,MAAM;IACN,SAAS;KACP,OAAO;MACL,eAAe;OACb;QACE,OAAO;QACP,OAAO;QACP,GAAG;QACH,GAAG;QACH,4BAA4B;OAC9B;OACA;QACE,OAAO;QACP,OAAO;QACP,GAAG;QACH,GAAG;QACH,4BAA4B;OAC9B;OACA;QACE,OAAO;QACP,OAAO;QACP,GAAG;QACH,GAAG;QACH,4BAA4B;OAC9B;OACA;QACE,OAAO;QACP,OAAO;QACP,GAAG;QACH,GAAG;QACH,4BAA4B;OAC9B;OACA;QACE,OAAO;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,U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AAM,cAAc,eAAuB;EACzC,OAAO,MAAM,iBAAiB,KAAK,MAAM,aAAa;CACxD;CAEA,MAAM,oBACJ,gBACiC;EACjC,MAAM,EAAE,cAAc,MAAM,KAAK,IAAI,WAAW,gBAAgB;EAEhE,OAAO,QAAQ,IACb,eAAe,KAAK,kBAClB,qBAAqB,QAAQ,MAAM,eAAe,SAAS,CAC7D,CACF;CACF;CAEA,MAAM,mBACJ,eAC+B;EAG/B,QAAO,MAFoB,KAAK,oBAAoB,CAAC,aAAa,CAAC,GAE/C;CACtB;AACF;;;;;;;;AC3PA,SAAgB,yBACd,MACA;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 +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/deprecated/v1/NovaClient.ts","../src/lib/deprecated/v1/wandelscriptUtils.ts"],"mappings":";;;;;;;KAsBY,iBAAA;EACV,WAAA;AAAA,IACE,mBAAmB;;;AAAA;AAMvB;cAAa,oBAAA;EAAA,SAoIA,IAAA,EAAM,UAAA;EAAA,SACN,UAAA,EAAY,kBAAA;EAAA,SACZ,WAAA,EAAa,mBAAA;EAAA,SACb,kBAAA,EAAoB,wBAAA;EAAA,SACpB,iBAAA,EAAmB,yBAAA;EAAA,SACnB,SAAA;EAAA,SACA,IAAA,EAAM,QAAA;EAAA,SACN,wBAAA,EAA0B,wBAAA;EAAA,SAC1B,WAAA,EAAa,WAAA;EAAA,SACb,QAAA,EAAU,QAAA;EAAA,SACV,sBAAA,EAAwB,oBAAA;EAAA,SACxB,qBAAA,EAAuB,yBAAA;EAAA,OA9IrB,OAAA,CACX,IAAA,EAAM,UAAA,EACN,aAAA,UACA,WAAA,EAAa,kBAAA,KAAoB,OAAA,CAAA,oBAAA;EA0GnC,+BAAA,EAAiC,SAAA;EACjC,4BAAA,EAA8B,SAAA;EAE9B,QAAA;EACA,eAAA;EAIA,0BAAA,EAA4B,wBAAA;EAI5B,eAAA,EAAiB,oBAAA;EAAA;;;;EAMjB,eAAA;cAIW,IAAA,EAAM,UAAA,EACN,UAAA,EAAY,kBAAA,EACZ,WAAA,EAAa,mBAAA,EACb,kBAAA,EAAoB,wBAAA,EACpB,iBAAA,EAAmB,yBAAA,EACnB,SAAA,WACA,IAAA,EAAM,QAAA,IACN,wBAAA,EAA0B,wBAAA,EAC1B,WAAA,EAAa,WAAA,EACb,QAAA,EAAU,QAAA,SACV,sBAAA,EAAwB,oBAAA,EACxB,qBAAA,EAAuB,yBAAA;EAAA,IA2D9B,aAAA
|
|
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/deprecated/v1/NovaClient.ts","../src/lib/deprecated/v1/wandelscriptUtils.ts"],"mappings":";;;;;;;KAsBY,iBAAA;EACV,WAAA;AAAA,IACE,mBAAmB;;;AAAA;AAMvB;cAAa,oBAAA;EAAA,SAoIA,IAAA,EAAM,UAAA;EAAA,SACN,UAAA,EAAY,kBAAA;EAAA,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Official JS client for the Wandelbots API",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"packageManager": "pnpm@11.1.3+sha512.c85357fe17ca12dd23dd7071822666dfd7e3cb76fe214e3370b5ea2fb34f2a231185509b63e717f3cd0acb38dd3f8d82bcd5e8172400ae678b70ea4fbed0896d",
|
|
@@ -26,8 +26,9 @@
|
|
|
26
26
|
"src"
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
|
+
"dev": "pnpm build && concurrently --names build,app --prefix-colors blue,magenta \"tsdown --watch --no-clean\" \"pnpm --filter example dev\"",
|
|
29
30
|
"dev:pack": "nodemon -w \".\" -e ts -i *.tgz -i dist -x \"pnpm run build && pnpm pack\"",
|
|
30
|
-
"tsc": "tsc --pretty --noEmit",
|
|
31
|
+
"tsc": "concurrently --group --names tsc,tsc:example --prefix-colors blue,magenta \"tsc --pretty --noEmit\" \"pnpm --filter example tsc\"",
|
|
31
32
|
"lint": "biome check --error-on-warnings .",
|
|
32
33
|
"format": "biome format . --write",
|
|
33
34
|
"knip": "knip",
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
"@types/ws": "^8.18.1",
|
|
55
56
|
"concurrently": "^9.2.1",
|
|
56
57
|
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
58
|
+
"jsdom": "^29.1.1",
|
|
57
59
|
"knip": "^6.14.2",
|
|
58
60
|
"lodash-es": "^4.18.1",
|
|
59
61
|
"nodemon": "^3.1.14",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Some general checks about the context the nova-js code is running in
|
|
2
|
+
|
|
3
|
+
export const isBrowser = typeof window !== "undefined"
|
|
4
|
+
|
|
5
|
+
export const isLocalhostDev =
|
|
6
|
+
isBrowser &&
|
|
7
|
+
window.location.hostname === "localhost" &&
|
|
8
|
+
process.env.NODE_ENV === "development"
|
|
@@ -11,6 +11,7 @@ import { AutoReconnectingWebsocket } from "../../AutoReconnectingWebsocket.js"
|
|
|
11
11
|
import { availableStorage } from "../../availableStorage.js"
|
|
12
12
|
import { parseNovaInstanceUrl } from "../../converters.js"
|
|
13
13
|
|
|
14
|
+
import { isBrowser, isLocalhostDev } from "../../context.js"
|
|
14
15
|
import { ConnectedMotionGroup } from "./ConnectedMotionGroup.js"
|
|
15
16
|
import { JoggerConnection } from "./JoggerConnection.js"
|
|
16
17
|
import { MotionStreamConnection } from "./MotionStreamConnection.js"
|
|
@@ -83,14 +84,12 @@ export class NovaClient {
|
|
|
83
84
|
const axiosInstance = axios.create({
|
|
84
85
|
baseURL: new URL("/api/v1", this.config.instanceUrl).href,
|
|
85
86
|
// TODO - backend needs to set proper CORS headers for this
|
|
86
|
-
headers:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"X-Wandelbots-Client": "Wandelbots-Nova-JS-SDK",
|
|
93
|
-
},
|
|
87
|
+
headers: isLocalhostDev
|
|
88
|
+
? {}
|
|
89
|
+
: {
|
|
90
|
+
// Identify the client to the backend for logging purposes
|
|
91
|
+
"X-Wandelbots-Client": "Wandelbots-Nova-JS-SDK",
|
|
92
|
+
},
|
|
94
93
|
})
|
|
95
94
|
|
|
96
95
|
axiosInstance.interceptors.request.use(async (request) => {
|
|
@@ -104,7 +103,7 @@ export class NovaClient {
|
|
|
104
103
|
return request
|
|
105
104
|
})
|
|
106
105
|
|
|
107
|
-
if (
|
|
106
|
+
if (isBrowser) {
|
|
108
107
|
axiosInstance.interceptors.response.use(
|
|
109
108
|
(r) => r,
|
|
110
109
|
async (error) => {
|
|
@@ -7,6 +7,7 @@ import { AutoReconnectingWebsocket } from "../../AutoReconnectingWebsocket"
|
|
|
7
7
|
import { availableStorage } from "../../availableStorage"
|
|
8
8
|
import { parseNovaInstanceUrl } from "../../converters"
|
|
9
9
|
|
|
10
|
+
import { isLocalhostDev } from "../../context"
|
|
10
11
|
import { MockNovaInstance } from "../../v2/mock/MockNovaInstance"
|
|
11
12
|
import { NovaCellAPIClient } from "./NovaCellAPIClient"
|
|
12
13
|
|
|
@@ -76,14 +77,12 @@ export class NovaClient {
|
|
|
76
77
|
const axiosInstance = axios.create({
|
|
77
78
|
baseURL: new URL("/api/v2", this.instanceUrl).href,
|
|
78
79
|
// TODO - backend needs to set proper CORS headers for this
|
|
79
|
-
headers:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"X-Wandelbots-Client": "Wandelbots-Nova-JS-SDK",
|
|
86
|
-
},
|
|
80
|
+
headers: isLocalhostDev
|
|
81
|
+
? {}
|
|
82
|
+
: {
|
|
83
|
+
// Identify the client to the backend for logging purposes
|
|
84
|
+
"X-Wandelbots-Client": "Wandelbots-Nova-JS-SDK",
|
|
85
|
+
},
|
|
87
86
|
})
|
|
88
87
|
|
|
89
88
|
axiosInstance.interceptors.request.use(async (request) => {
|