{"version":3,"file":"client-P6m7jMI2.cjs","names":["fs","ValidationError","require","createRequire","__dirname","path","fileURLToPath","debug","createDebug","fs","childProcess","NativeError","require","createRequire","TypeValidationError","path","generator","fs","ValidationError","TypeValidationError","loader","TypeValidationError","randomUUID","TypeValidationError","MessageValidationError","TypeValidationError","loader","rclnodejs","ActionError","OperationError","TypeValidationError"],"sources":["../lib/distro.js","../lib/prebuilds.js","../lib/utils.js","../lib/native_loader.js","../lib/interface_loader.js","../lib/qos.js","../lib/action/interfaces.js","../lib/action/uuid.js","../lib/action/client_goal_handle.js","../lib/action/deferred.js","../lib/entity.js","../lib/message_validation.js","../lib/action/client.js"],"sourcesContent":["// Copyright (c) 2022 Wayne Parrott. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * enum style distribution identifiers\n */\nconst DistroId = {\n  UNKNOWN: 0,\n  ELOQUENT: 1911,\n  FOXY: 2006,\n  GALACTIC: 2105,\n  HUMBLE: 2205,\n  IRON: 2305,\n  JAZZY: 2405,\n  KILTED: 2505,\n  LYRICAL: 2605,\n  ROLLING: 5000,\n  FUTURE: 9999, // unrecognized ROS_DISTRO assumed newer than Rolling\n};\n\nconst DistroNameIdMap = new Map();\nDistroNameIdMap.set('eloquent', DistroId.ELOQUENT);\nDistroNameIdMap.set('foxy', DistroId.FOXY);\nDistroNameIdMap.set('galactic', DistroId.GALACTIC);\nDistroNameIdMap.set('humble', DistroId.HUMBLE);\nDistroNameIdMap.set('iron', DistroId.IRON);\nDistroNameIdMap.set('jazzy', DistroId.JAZZY);\nDistroNameIdMap.set('kilted', DistroId.KILTED);\nDistroNameIdMap.set('lyrical', DistroId.LYRICAL);\nDistroNameIdMap.set('rolling', DistroId.ROLLING);\n\nconst DistroUtils = {\n  DistroId: DistroId,\n\n  /**\n   * Get the rclnodejs distro ID for a ROS 2 distro name.\n   * @param {string|undefined} [distroName] - The ROS 2 short distro name, e.g., foxy, Defaults to the value of the ROS_DISTRO envar.\n   * @return {number} Return the rclnodejs distro identifier\n   */\n  getDistroId: function (distroName) {\n    const dname =\n      (distroName || this.getDistroName() || '').toLowerCase() || undefined;\n\n    if (dname && DistroNameIdMap.has(dname)) {\n      return DistroNameIdMap.get(dname);\n    }\n\n    // Unrecognized but provided/resolved distro name → assume future; unset → unknown\n    return dname ? DistroId.FUTURE : DistroId.UNKNOWN;\n  },\n\n  /**\n   * Get the short ROS 2 distro name associated with a rclnodejs distro ID.\n   * @param {number|undefined} [distroId] - The rclnodejs distro identifier. Defaults to the value of the ROS_DISTRO envar.\n   * @return {string|undefined} Return the name of the ROS distribution or undefined if unable to identify the distro.\n   */\n  getDistroName: function (distroId) {\n    if (!distroId) {\n      return process.env.ROS_DISTRO;\n    }\n\n    const result = [...DistroNameIdMap].find(([, val]) => val == distroId);\n    return result ? result[0] : undefined;\n  },\n\n  getKnownDistroNames: function () {\n    return [...DistroNameIdMap.keys()];\n  },\n};\n\nexport default DistroUtils;\n","// Copyright (c) 2026, The Robot Web Tools Contributors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nconst PREBUILD_PACKAGE_NAME = 'rclnodejs';\nconst SUPPORTED_PREBUILD_RUNTIMES = new Set(['node', 'electron']);\n\nfunction detectPrebuildRuntime() {\n  if (process.env.npm_config_runtime === 'electron') {\n    return 'electron';\n  }\n\n  return process.versions.electron ? 'electron' : 'node';\n}\n\nfunction getTaggedPrebuildFilename({\n  rosDistro,\n  ubuntuCodename,\n  arch,\n  runtime,\n}) {\n  return `${rosDistro}-${ubuntuCodename}-${arch}-${runtime}-${PREBUILD_PACKAGE_NAME}.node`;\n}\n\nfunction getRuntimeFromGeneratedPrebuild(fileName) {\n  const runtime = fileName.split('.')[0];\n  return SUPPORTED_PREBUILD_RUNTIMES.has(runtime) ? runtime : null;\n}\n\nexport {\n  detectPrebuildRuntime,\n  getRuntimeFromGeneratedPrebuild,\n  getTaggedPrebuildFilename,\n  PREBUILD_PACKAGE_NAME,\n};\n","// Copyright (c) 2025, The Robot Web Tools Contributors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport fs from 'fs';\nimport fsPromises from 'fs/promises';\nimport path from 'path';\nimport { ValidationError } from './errors.js';\n\n/**\n * Ensure directory exists, create recursively if needed (async)\n * Replaces: fse.ensureDir() / fse.mkdirs()\n * @param {string} dirPath - Path to directory\n * @returns {Promise<void>}\n */\nasync function ensureDir(dirPath) {\n  try {\n    await fsPromises.mkdir(dirPath, { recursive: true });\n  } catch (err) {\n    // Ignore if directory already exists\n    if (err.code !== 'EEXIST') throw err;\n  }\n}\n\n/**\n * Ensure directory exists, create recursively if needed (sync)\n * Replaces: fse.mkdirSync()\n * @param {string} dirPath - Path to directory\n */\nfunction ensureDirSync(dirPath) {\n  try {\n    fs.mkdirSync(dirPath, { recursive: true });\n  } catch (err) {\n    // Ignore if directory already exists\n    if (err.code !== 'EEXIST') throw err;\n  }\n}\n\n/**\n * Check if path exists (async)\n * Replaces: fse.exists()\n * @param {string} filePath - Path to check\n * @returns {Promise<boolean>}\n */\nasync function pathExists(filePath) {\n  try {\n    await fsPromises.stat(filePath);\n    return true;\n  } catch {\n    return false;\n  }\n}\n\n/**\n * Empty a directory (remove all contents but keep the directory)\n * Replaces: fse.emptyDir()\n * @param {string} dirPath - Path to directory\n * @returns {Promise<void>}\n */\nasync function emptyDir(dirPath) {\n  try {\n    const files = await fsPromises.readdir(dirPath);\n    await Promise.all(\n      files.map((file) =>\n        fsPromises.rm(path.join(dirPath, file), {\n          recursive: true,\n          force: true,\n        })\n      )\n    );\n  } catch (err) {\n    // Ignore if directory doesn't exist\n    if (err.code !== 'ENOENT') throw err;\n  }\n}\n\n/**\n * Copy file or directory recursively\n * Replaces: fse.copy()\n * @param {string} src - Source path\n * @param {string} dest - Destination path\n * @param {object} options - Copy options\n * @returns {Promise<void>}\n */\nasync function copy(src, dest, options = {}) {\n  const opts = {\n    recursive: true,\n    force: options.overwrite !== false,\n    ...options,\n  };\n  await fsPromises.cp(src, dest, opts);\n}\n\n/**\n * Read and parse JSON file synchronously\n * Replaces: fse.readJsonSync()\n * @param {string} filePath - Path to JSON file\n * @param {object} options - Read options\n * @returns {any} Parsed JSON data\n */\nfunction readJsonSync(filePath, options = {}) {\n  const content = fs.readFileSync(filePath, options.encoding || 'utf8');\n  return JSON.parse(content);\n}\n\n/**\n * Remove file or directory (async)\n * Replaces: fse.remove()\n * @param {string} filePath - Path to remove\n * @returns {Promise<void>}\n */\nasync function remove(filePath) {\n  try {\n    await fsPromises.rm(filePath, { recursive: true, force: true });\n  } catch (err) {\n    // Ignore if path doesn't exist\n    if (err.code !== 'ENOENT') throw err;\n  }\n}\n\n/**\n * Remove file or directory (sync)\n * Replaces: fse.removeSync()\n * @param {string} filePath - Path to remove\n */\nfunction removeSync(filePath) {\n  try {\n    fs.rmSync(filePath, { recursive: true, force: true });\n  } catch (err) {\n    // Ignore if path doesn't exist\n    if (err.code !== 'ENOENT') throw err;\n  }\n}\n\n/**\n * Write file with content (async)\n * Replaces: fse.writeFile()\n * @param {string} filePath - Path to file\n * @param {string|Buffer} data - Content to write\n * @param {object} options - Write options\n * @returns {Promise<void>}\n */\nasync function writeFile(filePath, data, options = {}) {\n  await fsPromises.writeFile(filePath, data, options);\n}\n\n/**\n * Create directory (async)\n * Replaces: fse.mkdir()\n * @param {string} dirPath - Path to directory\n * @param {object} options - mkdir options\n * @returns {Promise<void>}\n */\nasync function mkdir(dirPath, options = {}) {\n  await fsPromises.mkdir(dirPath, options);\n}\n\n/**\n * Detect Ubuntu codename from /etc/os-release\n * @returns {string|null} Ubuntu codename (e.g., 'noble', 'jammy') or null if not detectable\n */\nfunction detectUbuntuCodename() {\n  if (process.platform !== 'linux') {\n    return null;\n  }\n\n  try {\n    const osRelease = fs.readFileSync('/etc/os-release', 'utf8');\n    const match = osRelease.match(/^VERSION_CODENAME=(.*)$/m);\n    return match ? match[1].trim() : null;\n  } catch {\n    return null;\n  }\n}\n\n/**\n * Normalize a ROS 2 node name by removing the leading slash if present.\n *\n * ROS 2 node names may be specified with or without a leading slash depending\n * on the context. This utility ensures consistent representation without the\n * leading slash, which is the standard format for most ROS 2 APIs.\n *\n * @param {string} nodeName - The node name to normalize\n * @returns {string} The normalized node name without leading slash\n *\n * @example\n * normalizeNodeName('my_node')    // 'my_node'\n * normalizeNodeName('/my_node')   // 'my_node'\n * normalizeNodeName('/ns/my_node') // 'ns/my_node'\n */\nfunction normalizeNodeName(nodeName) {\n  return nodeName.startsWith('/') ? nodeName.substring(1) : nodeName;\n}\n\n/**\n * Check if two numbers are equal within a given tolerance.\n *\n * This function compares two numbers using both relative and absolute tolerance,\n * matching the behavior of the 'is-close' npm package.\n *\n * The comparison uses the formula:\n *   abs(a - b) <= max(rtol * max(abs(a), abs(b)), atol)\n *\n * Implementation checks:\n *   1. Absolute tolerance: abs(a - b) <= atol\n *   2. Relative tolerance: abs(a - b) / max(abs(a), abs(b)) <= rtol\n *\n * @param {number} a - The first number to compare\n * @param {number} b - The second number to compare\n * @param {number} [rtol=1e-9] - The relative tolerance parameter (default: 1e-9)\n * @param {number} [atol=0.0] - The absolute tolerance parameter (default: 0.0)\n * @returns {boolean} True if the numbers are close within the tolerance\n *\n * @example\n * isClose(1.0, 1.0) // true - exact equality\n * isClose(1.0, 1.1, 0.01) // false - relative diff: 0.1/1.1 ≈ 0.091 > 0.01\n * isClose(10, 10.00001, 1e-6) // true - relative diff: 0.00001/10 = 1e-6 <= 1e-6\n * isClose(0, 0.05, 0, 0.1) // true - absolute diff: 0.05 <= 0.1 (atol)\n */\nfunction isClose(a, b, rtol = 1e-9, atol = 0.0) {\n  // Handle exact equality\n  if (a === b) {\n    return true;\n  }\n\n  // Handle non-finite numbers\n  if (!Number.isFinite(a) || !Number.isFinite(b)) {\n    return false;\n  }\n\n  const absDiff = Math.abs(a - b);\n\n  // Check absolute tolerance first (optimization)\n  if (atol >= absDiff) {\n    return true;\n  }\n\n  // Check relative tolerance\n  const relativeScaler = Math.max(Math.abs(a), Math.abs(b));\n\n  // Handle division by zero when both values are zero or very close to zero\n  if (relativeScaler === 0) {\n    return true; // Both are zero, already handled by absolute tolerance\n  }\n\n  const relativeDiff = absDiff / relativeScaler;\n\n  return rtol >= relativeDiff;\n}\n\n/**\n * Compare two semantic version strings.\n *\n * Supports version strings in the format: x.y.z or x.y.z.w\n * where x, y, z, w are integers.\n *\n * @param {string} version1 - First version string (e.g., '1.2.3')\n * @param {string} version2 - Second version string (e.g., '1.2.4')\n * @param {string} operator - Comparison operator: '<', '<=', '>', '>=', '==', '!='\n * @returns {boolean} Result of the comparison\n *\n * @example\n * compareVersions('1.2.3', '1.2.4', '<')   // true\n * compareVersions('2.0.0', '1.9.9', '>')   // true\n * compareVersions('1.2.3', '1.2.3', '==')  // true\n * compareVersions('1.2.3', '1.2.3', '>=')  // true\n */\nfunction compareVersions(version1, version2, operator) {\n  // Parse version strings into arrays of integers\n  const v1Parts = version1.split('.').map((part) => parseInt(part, 10));\n  const v2Parts = version2.split('.').map((part) => parseInt(part, 10));\n\n  // Pad arrays to same length with zeros\n  const maxLength = Math.max(v1Parts.length, v2Parts.length);\n  while (v1Parts.length < maxLength) v1Parts.push(0);\n  while (v2Parts.length < maxLength) v2Parts.push(0);\n\n  // Compare each part\n  let cmp = 0;\n  for (let i = 0; i < maxLength; i++) {\n    if (v1Parts[i] > v2Parts[i]) {\n      cmp = 1;\n      break;\n    } else if (v1Parts[i] < v2Parts[i]) {\n      cmp = -1;\n      break;\n    }\n  }\n\n  // Apply operator\n  switch (operator) {\n    case '<':\n      return cmp < 0;\n    case '<=':\n      return cmp <= 0;\n    case '>':\n      return cmp > 0;\n    case '>=':\n      return cmp >= 0;\n    case '==':\n    case '===':\n      return cmp === 0;\n    case '!=':\n    case '!==':\n      return cmp !== 0;\n    default:\n      throw new ValidationError(`Invalid operator: ${operator}`, {\n        code: 'INVALID_OPERATOR',\n        argumentName: 'operator',\n        providedValue: operator,\n        expectedType: \"'eq' | 'ne' | 'lt' | 'lte' | 'gt' | 'gte'\",\n      });\n  }\n}\n\nexport {\n  // General utilities\n  detectUbuntuCodename,\n  isClose,\n  normalizeNodeName,\n\n  // File system utilities (async)\n  ensureDir,\n  ensureDir as mkdirs, // Alias for fs-extra compatibility\n  pathExists as exists, // Renamed to avoid conflict with deprecated fs.exists\n  pathExists,\n  emptyDir,\n  copy,\n  remove,\n  writeFile,\n  mkdir,\n\n  // File system utilities (sync)\n  ensureDirSync,\n  ensureDirSync as mkdirSync, // Alias for fs-extra compatibility\n  removeSync,\n  readJsonSync,\n  compareVersions,\n};\n","// Copyright (c) 2025, The Robot Web Tools Contributors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport fs from 'fs';\nimport path from 'path';\nimport childProcess from 'child_process';\nimport { fileURLToPath } from 'url';\nimport { createRequire } from 'module';\nimport { NativeError } from './errors.js';\nimport createDebug from 'debug';\nimport {\n  detectPrebuildRuntime,\n  getTaggedPrebuildFilename,\n} from './prebuilds.js';\nimport { detectUbuntuCodename } from './utils.js';\n\nconst require = createRequire(import.meta.url);\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst debug = createDebug('rclnodejs');\n\nlet nativeModule = null;\n\nfunction loadLocalAddon() {\n  const candidates = ['Debug', 'Release'].map((configuration) =>\n    path.join(__dirname, '..', 'build', configuration, 'rclnodejs.node')\n  );\n\n  for (const candidate of candidates) {\n    try {\n      const addon = require(candidate);\n      addon.path = candidate;\n      return addon;\n    } catch (error) {\n      if (\n        error.code !== 'MODULE_NOT_FOUND' &&\n        error.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' &&\n        !/not find/i.test(error.message)\n      ) {\n        throw error;\n      }\n    }\n  }\n\n  const error = new Error(\n    'Could not locate the bindings file. Tried:\\n' +\n      candidates\n        .map(\n          (candidate) =>\n            (process.env.NODE_BINDINGS_ARROW || ' \\u2192 ') + candidate\n        )\n        .join('\\n')\n  );\n  error.tries = candidates;\n  throw error;\n}\n\n// Copy a matched prebuilt binary into build/Release so that standard binary\n// resolution (and packaged Electron apps where ROS_DISTRO may be unset at\n// runtime) can still locate it. Non-destructive: never overwrites an existing\n// build output, so local source builds are preserved.\nfunction mirrorPrebuiltToBuildRelease(srcPath) {\n  try {\n    const destDir = path.join(__dirname, '..', 'build', 'Release');\n    const destPath = path.join(destDir, 'rclnodejs.node');\n    if (fs.existsSync(destPath)) {\n      return;\n    }\n    fs.mkdirSync(destDir, { recursive: true });\n    // COPYFILE_EXCL guarantees we never overwrite an existing build output,\n    // even if another process created it after the existsSync check above.\n    fs.copyFileSync(srcPath, destPath, fs.constants.COPYFILE_EXCL);\n    debug(`Mirrored prebuilt binary to ${destPath}`);\n  } catch (e) {\n    if (e.code === 'EEXIST') {\n      // Another process mirrored the binary first; leave it untouched.\n      return;\n    }\n    debug('Could not mirror prebuilt binary to build/Release:', e.message);\n  }\n}\n\n// Build the native addon from source. When running under Electron, target\n// Electron's headers/ABI so the resulting binary matches the runtime instead\n// of producing a Node-targeted binary (the addon links libuv directly, so the\n// host runtime matters).\nfunction buildFromSource() {\n  const env = { ...process.env };\n\n  if (detectPrebuildRuntime() === 'electron' && process.versions.electron) {\n    // node-gyp targets Electron via --target (Electron version) + --dist-url\n    // (Electron headers); it reads these from npm_config_* env vars.\n    env.npm_config_target = process.versions.electron;\n    env.npm_config_dist_url = 'https://electronjs.org/headers';\n    env.npm_config_arch = process.arch;\n    debug(`Building from source for Electron ${process.versions.electron}`);\n  } else {\n    debug('Building from source for Node.js');\n  }\n\n  childProcess.execSync('npm run rebuild', {\n    stdio: 'inherit',\n    cwd: path.join(__dirname, '..'),\n    timeout: 300000, // 5 minute timeout\n    env,\n  });\n}\n\n// Simplified loader: only use prebuilt binaries with exact Ubuntu/ROS2/arch match\n// Note: Prebuilt binaries are only supported on Linux (Ubuntu) platform\nfunction customFallbackLoader() {\n  // Prebuilt binaries are only for Linux platform\n  if (process.platform !== 'linux') {\n    debug('Prebuilt binaries are only supported on Linux platform');\n    return null;\n  }\n\n  const rosDistro = process.env.ROS_DISTRO;\n  const arch = process.arch;\n  const runtime = detectPrebuildRuntime();\n  const ubuntuCodename = detectUbuntuCodename();\n\n  // Require all three components for exact match\n  if (!rosDistro || !ubuntuCodename || !arch) {\n    debug(\n      `Missing environment info - ROS: ${rosDistro}, Ubuntu: ${ubuntuCodename}, Arch: ${arch}`\n    );\n    return null;\n  }\n\n  const prebuildDir = path.join(\n    __dirname,\n    '..',\n    'prebuilds',\n    `${process.platform}-${arch}`\n  );\n\n  if (!fs.existsSync(prebuildDir)) {\n    debug('No prebuilds directory found');\n    return null;\n  }\n\n  try {\n    const candidate = getTaggedPrebuildFilename({\n      rosDistro,\n      ubuntuCodename,\n      arch,\n      runtime,\n    });\n    // The filename is built from environment-derived values (notably\n    // ROS_DISTRO); ensure it stays a plain basename so it cannot escape\n    // prebuildDir via path separators before we join/require/copy it.\n    if (path.basename(candidate) !== candidate) {\n      debug(`Rejecting suspicious prebuilt filename: ${candidate}`);\n      return null;\n    }\n    const candidatePath = path.join(prebuildDir, candidate);\n\n    if (fs.existsSync(candidatePath)) {\n      debug(`Found ${runtime} prebuilt binary: ${candidate}`);\n      mirrorPrebuiltToBuildRelease(candidatePath);\n      return require(candidatePath);\n    }\n\n    debug(\n      `No matching ${runtime} prebuilt binary found for ${rosDistro}-${ubuntuCodename}-${arch}`\n    );\n    return null;\n  } catch (e) {\n    debug('Error in simplified prebuilt loader:', e.message);\n  }\n\n  return null;\n}\n\n// Simplified prebuilt binary loader: exact match or build from source\nfunction loadNativeAddon() {\n  if (nativeModule) {\n    return nativeModule;\n  }\n\n  // Environment variable to force building from source\n  if (process.env.RCLNODEJS_FORCE_BUILD === '1') {\n    debug('Forcing build from source (RCLNODEJS_FORCE_BUILD=1)');\n\n    // Trigger actual compilation\n    try {\n      debug('Running forced node-gyp rebuild...');\n      buildFromSource();\n\n      // Load the newly built binary\n      nativeModule = loadLocalAddon();\n      debug('Successfully force compiled and loaded from source');\n      return nativeModule;\n    } catch (compileError) {\n      debug('Forced compilation failed:', compileError.message);\n      throw new NativeError(\n        `Failed to force build rclnodejs from source: ${compileError.message}`,\n        'Forced compilation',\n        { cause: compileError }\n      );\n    }\n  }\n\n  const rosDistro = process.env.ROS_DISTRO;\n  const runtime = detectPrebuildRuntime();\n  const ubuntuCodename = detectUbuntuCodename();\n\n  debug(\n    `Platform: ${process.platform}, Arch: ${process.arch}, Runtime: ${runtime}, Ubuntu: ${ubuntuCodename || 'unknown'}, ROS: ${rosDistro || 'unknown'}`\n  );\n\n  // Prebuilt binaries are only supported on Linux (Ubuntu)\n  if (process.platform === 'linux') {\n    // Try exact match prebuilt binary first\n    try {\n      const prebuiltModule = customFallbackLoader();\n      if (prebuiltModule) {\n        nativeModule = prebuiltModule;\n        return nativeModule;\n      }\n    } catch (e) {\n      debug('Exact match prebuilt loading failed:', e.message);\n    }\n\n    debug(\n      'No exact match prebuilt binary found, falling back to build from source'\n    );\n  } else {\n    debug(\n      `Platform ${process.platform} does not support prebuilt binaries, will try existing build or compile from source`\n    );\n  }\n\n  try {\n    // Try to find existing built binary first (works on all platforms)\n    nativeModule = loadLocalAddon();\n    debug('Found and loaded existing built binary');\n    return nativeModule;\n  } catch {\n    debug('No existing built binary found, triggering compilation...');\n\n    // Trigger actual compilation\n    try {\n      debug('Running node-gyp rebuild...');\n      buildFromSource();\n\n      // Try to load the newly built binary\n      nativeModule = loadLocalAddon();\n      debug('Successfully compiled and loaded from source');\n      return nativeModule;\n    } catch (compileError) {\n      debug('Compilation failed:', compileError.message);\n      throw new NativeError(\n        `Failed to build rclnodejs from source: ${compileError.message}`,\n        'Compilation',\n        { cause: compileError }\n      );\n    }\n  }\n}\n\nconst addon = loadNativeAddon();\n\n// Export internal functions for testing purposes\nif (process.env.NODE_ENV === 'test') {\n  addon.TestHelpers = {\n    customFallbackLoader,\n    loadLocalAddon,\n    loadNativeAddon,\n  };\n}\n\nexport default addon;\n","// Copyright (c) 2017 Intel Corporation. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport path from 'path';\nimport fs from 'fs';\nimport { createRequire } from 'module';\nimport generator from '../rosidl_gen/index.cjs';\nimport { TypeValidationError, ValidationError } from './errors.js';\n\nconst require = createRequire(import.meta.url);\n\nlet interfaceLoader = {\n  loadInterfaceByObject(obj) {\n    //\n    // `obj` param structure\n    //\n    // {\n    //   package: 'std_msgs',\n    //   type: 'msg',\n    //   name: 'String',\n    // }\n    //\n    if (\n      typeof obj !== 'object' ||\n      !obj ||\n      !obj.package ||\n      !obj.type ||\n      !obj.name\n    ) {\n      throw new TypeValidationError(\n        'interfaceObject',\n        obj,\n        'object with package, type, and name properties',\n        {\n          entityType: 'interface loader',\n        }\n      );\n    }\n    return this.loadInterface(obj.package, obj.type, obj.name);\n  },\n\n  loadInterfaceByString(name) {\n    if (typeof name !== 'string') {\n      throw new TypeValidationError('name', name, 'string', {\n        entityType: 'interface loader',\n      });\n    }\n\n    // TODO(Kenny): more checks of the string argument\n    if (name.includes('/')) {\n      let [packageName, type, messageName] = name.split('/');\n      return this.loadInterface(packageName, type, messageName);\n    }\n\n    // Suppose the name is a package, and traverse the path to collect the IDL files.\n    let packagePath = path.join(generator.generatedRoot, name);\n\n    let interfaces = fs.readdirSync(packagePath);\n    if (interfaces.length > 0) {\n      return this.loadInterfaceByPath(packagePath, interfaces);\n    }\n\n    throw new ValidationError(\n      'A string argument in expected in \"package/type/message\" format',\n      {\n        code: 'INVALID_INTERFACE_FORMAT',\n        argumentName: 'name',\n        providedValue: name,\n        expectedType: 'string in \"package/type/message\" format',\n        entityType: 'interface loader',\n      }\n    );\n  },\n\n  loadInterfaceByPath(packagePath, interfaces) {\n    let interfaceInfos = [];\n\n    interfaces.forEach((file) => {\n      let results = file.match(/\\w+__(\\w+)__(\\w+).js$/);\n      let type = results[1];\n      let name = results[2];\n      let filePath = path.join(packagePath, file).normalize();\n      interfaceInfos.push({ name, type, filePath });\n    });\n\n    let pkg = { srv: {}, msg: {}, action: {} };\n    interfaceInfos.forEach((info) => {\n      Object.defineProperty(pkg[info.type], info.name, {\n        value: require(info.filePath),\n      });\n    });\n\n    return pkg;\n  },\n\n  _isRos2InstallationPath(pkgPath) {\n    // Use \"which ros2\" to dynamically find the ROS2 installation root\n    try {\n      const whichResult = require('child_process').spawnSync(\n        'which',\n        ['ros2'],\n        {\n          encoding: 'utf8',\n          timeout: 5000,\n        }\n      );\n\n      if (whichResult.status === 0 && whichResult.stdout) {\n        const ros2BinPath = whichResult.stdout.trim();\n        // Get the ROS2 installation root (typically /opt/ros/<distro> or similar)\n        const ros2Root = path.dirname(path.dirname(ros2BinPath));\n\n        return pkgPath.includes(ros2Root);\n      }\n    } catch (err) {\n      console.error('Error running which ros2:', err.message);\n      // If \"which ros2\" fails, fall back to hardcoded check\n      return pkgPath.includes('ros2-linux');\n    }\n\n    return false;\n  },\n\n  _searchAndGenerateInterface(packageName, type, messageName, filePath) {\n    // Check if it's a valid package\n    for (const pkgPath of generator.getInstalledPackagePaths()) {\n      // We are going to ignore the path where ROS2 is installed.\n      if (this._isRos2InstallationPath(pkgPath)) {\n        continue;\n      }\n\n      // Recursively search for files named messageName.* under pkgPath/\n      if (fs.existsSync(pkgPath)) {\n        // Recursive function to search for files\n        function searchForFile(dir) {\n          try {\n            const items = fs.readdirSync(dir, { withFileTypes: true });\n            for (const item of items) {\n              const fullPath = path.join(dir, item.name);\n\n              if (item.isFile()) {\n                const baseName = path.parse(item.name).name;\n                // Check if the base filename matches messageName\n                if (baseName === messageName) {\n                  return fullPath;\n                }\n              } else if (item.isDirectory()) {\n                // Recursively search subdirectories\n                const result = searchForFile(fullPath);\n                if (result) {\n                  return result;\n                }\n              }\n            }\n          } catch (err) {\n            // Skip directories we can't read\n            console.error('Error reading directory:', dir, err.message);\n          }\n          return null;\n        }\n\n        const foundFilePath = searchForFile(\n          path.join(pkgPath, 'share', packageName)\n        );\n\n        if (foundFilePath && foundFilePath.length > 0) {\n          // Use worker thread to generate interfaces synchronously\n          try {\n            generator.generateInPathSyncWorker(pkgPath);\n            // Now try to load the interface again from the generated files\n            if (fs.existsSync(filePath)) {\n              return require(filePath);\n            }\n          } catch (err) {\n            console.error('Error in interface generation:', err);\n          }\n        }\n      }\n    }\n    throw new ValidationError(\n      `The message required does not exist: ${packageName}, ${type}, ${messageName} at ${generator.generatedRoot}`,\n      {\n        code: 'MESSAGE_NOT_FOUND',\n        entityType: 'interface loader',\n        details: {\n          packageName: packageName,\n          type: type,\n          messageName: messageName,\n          searchPath: generator.generatedRoot,\n        },\n      }\n    );\n  },\n\n  loadInterface(packageName, type, messageName) {\n    if (arguments.length === 1) {\n      const type = arguments[0];\n      if (typeof type === 'function') {\n        // Already a loaded interface class/constructor (e.g. the value\n        // returned by a previous loadInterface call or rclnodejs.require).\n        // Every generated interface class exposes a static type() method, so\n        // use it to distinguish a genuine interface from an arbitrary\n        // function. Return it as-is so loadInterface is idempotent; otherwise\n        // fall through to the MESSAGE_NOT_FOUND error below.\n        if (typeof type.type === 'function') {\n          return type;\n        }\n      } else if (typeof type === 'object') {\n        return this.loadInterfaceByObject(type);\n      } else if (typeof type === 'string') {\n        return this.loadInterfaceByString(type);\n      }\n      throw new ValidationError(\n        `The message required does not exist: ${type}`,\n        {\n          code: 'MESSAGE_NOT_FOUND',\n          entityType: 'interface loader',\n          details: { type: type },\n        }\n      );\n    }\n    if (packageName && type && messageName) {\n      let filePath = path.join(\n        generator.generatedRoot,\n        packageName,\n        packageName + '__' + type + '__' + messageName + '.js'\n      );\n\n      if (fs.existsSync(filePath)) {\n        return require(filePath);\n      } else {\n        return this._searchAndGenerateInterface(\n          packageName,\n          type,\n          messageName,\n          filePath\n        );\n      }\n    }\n    // We cannot parse `packageName`, `type` and `messageName` from the string passed.\n    throw new ValidationError(\n      `The message required does not exist: ${packageName}, ${type}, ${messageName} at ${generator.generatedRoot}`,\n      {\n        code: 'MESSAGE_NOT_FOUND',\n        entityType: 'interface loader',\n        details: {\n          packageName: packageName,\n          type: type,\n          messageName: messageName,\n          searchPath: generator.generatedRoot,\n        },\n      }\n    );\n  },\n};\n\nexport default interfaceLoader;\n","// Copyright (c) 2017 Intel Corporation. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TypeValidationError } from './errors.js';\n\n/**\n * Enum for HistoryPolicy\n * @readonly\n * @enum {number}\n */\nlet HistoryPolicy = {\n  /** @member {number} */\n  RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT: 0,\n  /** @member {number} */\n  RMW_QOS_POLICY_HISTORY_KEEP_LAST: 1,\n  /** @member {number} */\n  RMW_QOS_POLICY_HISTORY_KEEP_ALL: 2,\n};\n\n/**\n * Enum for ReliabilityPolicy\n * @readonly\n * @enum {number}\n */\nlet ReliabilityPolicy = {\n  /** @member {number} */\n  RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT: 0,\n  /** @member {number} */\n  RMW_QOS_POLICY_RELIABILITY_RELIABLE: 1,\n  /** @member {number} */\n  RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT: 2,\n};\n\n/**\n * Enum for DurabilityPolicy\n * @readonly\n * @enum {number}\n */\nlet DurabilityPolicy = {\n  /** @member {number} */\n  RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT: 0,\n  /** @member {number} */\n  RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL: 1,\n  /** @member {number} */\n  RMW_QOS_POLICY_DURABILITY_VOLATILE: 2,\n};\n\n/**\n * Enum for LivelinessPolicy\n * @readonly\n * @enum {number}\n */\nlet LivelinessPolicy = {\n  /** @member {number} */\n  RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT: 0,\n  /** @member {number} */\n  RMW_QOS_POLICY_LIVELINESS_AUTOMATIC: 1,\n  /** @member {number} */\n  RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC: 3,\n  /** @member {number} */\n  RMW_QOS_POLICY_LIVELINESS_UNKNOWN: 4,\n  /** @member {number} */\n  RMW_QOS_POLICY_LIVELINESS_BEST_AVAILABLE: 5,\n};\n\n/** Class representing middleware quality of service */\nclass QoS {\n  /**\n   * Create a QoS.\n   * @param {HistoryPolicy} [history=RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT] - The history value.\n   * @param {number} [depth=0] - The depth value.\n   * @param {ReliabilityPolicy} [reliability=RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT] - The reliability value.\n   * @param {DurabilityPolicy} [durability=RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT] - The durability value.\n   * @param {boolean} [avoidRosNameSpaceConventions=false] - The avoidRosNameSpaceConventions value.\n   */\n  constructor(\n    history = HistoryPolicy.RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT,\n    depth = 0,\n    reliability = ReliabilityPolicy.RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT,\n    durability = DurabilityPolicy.RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT,\n    liveliness = LivelinessPolicy.RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT,\n    avoidRosNameSpaceConventions = false\n  ) {\n    this._history = history;\n    this._depth = depth;\n    this._reliability = reliability;\n    this._durability = durability;\n    this._liveliness = liveliness;\n    this._avoidRosNameSpaceConventions = avoidRosNameSpaceConventions;\n  }\n\n  /**\n   * Get HistoryPolicy enum.\n   * @name QoS#static get:HistoryPolicy\n   * @function\n   * @return {HistoryPolicy}\n   */\n  static get HistoryPolicy() {\n    return HistoryPolicy;\n  }\n\n  /**\n   * Get ReliabilityPolicy enum.\n   * @name QoS#static get:ReliabilityPolicy\n   * @function\n   * @return {ReliabilityPolicy}\n   */\n  static get ReliabilityPolicy() {\n    return ReliabilityPolicy;\n  }\n\n  /**\n   * Get DurabilityPolicy enum.\n   * @name QoS#static get:DurabilityPolicy\n   * @function\n   * @return {DurabilityPolicy}\n   */\n  static get DurabilityPolicy() {\n    return DurabilityPolicy;\n  }\n\n  /**\n   * Get LivelinessPolicy enum.\n   * @name QoS#static get:LivelinessPolicy\n   * @function\n   * @return {LivelinessPolicy}\n   */\n  static get LivelinessPolicy() {\n    return LivelinessPolicy;\n  }\n\n  /**\n   * Get the history value.\n   * @name QoS#get:history\n   * @function\n   * @return {number}\n   */\n  get history() {\n    return this._history;\n  }\n\n  /**\n   * Set the history value.\n   * @param {number} history - value to be set.\n   * @name QoS#set:history\n   * @function\n   * @return {undefined}\n   */\n  set history(history) {\n    if (typeof history !== 'number') {\n      throw new TypeValidationError('history', history, 'number', {\n        entityType: 'qos',\n      });\n    }\n\n    this._history = history;\n  }\n\n  /**\n   * Get the depth value.\n   * @name QoS#get:depth\n   * @function\n   * @return {number}\n   */\n  get depth() {\n    return this._depth;\n  }\n\n  /**\n   * Set the depth value.\n   * @param {number} depth - value to be set.\n   * @name QoS#set:depth\n   * @function\n   * @return {undefined}\n   */\n  set depth(depth) {\n    if (typeof depth !== 'number') {\n      throw new TypeValidationError('depth', depth, 'number', {\n        entityType: 'qos',\n      });\n    }\n\n    this._depth = depth;\n  }\n\n  /**\n   * Get the reliability value.\n   * @name QoS#get:reliability\n   * @function\n   * @return {number}\n   */\n  get reliability() {\n    return this._reliability;\n  }\n\n  /**\n   * Set the reliability value.\n   * @param {number} reliability - value to be set.\n   * @name QoS#set:reliability\n   * @function\n   * @return {undefined}\n   */\n  set reliability(reliability) {\n    if (typeof reliability !== 'number') {\n      throw new TypeValidationError('reliability', reliability, 'number', {\n        entityType: 'qos',\n      });\n    }\n\n    this._reliability = reliability;\n  }\n\n  /**\n   * Get the durability value.\n   * @name QoS#get:durability\n   * @function\n   * @return {number}\n   */\n  get durability() {\n    return this._durability;\n  }\n\n  /**\n   * Set the durability value.\n   * @param {number} durability - value to be set.\n   * @name QoS#set:durability\n   * @function\n   * @return {undefined}\n   */\n  set durability(durability) {\n    if (typeof durability !== 'number') {\n      throw new TypeValidationError('durability', durability, 'number', {\n        entityType: 'qos',\n      });\n    }\n\n    this._durability = durability;\n  }\n\n  /**\n   * Get the liveliness value.\n   * @name QoS#get:liveliness\n   * @function\n   * @return {number}\n   */\n  get liveliness() {\n    return this._liveliness;\n  }\n\n  /**\n   * Set the liveliness value.\n   * @param {number} liveliness - value to be set.\n   * @name QoS#set:liveliness\n   * @function\n   * @return {undefined}\n   */\n  set liveliness(liveliness) {\n    if (typeof liveliness !== 'number') {\n      throw new TypeValidationError('liveliness', liveliness, 'number', {\n        entityType: 'qos',\n      });\n    }\n\n    this._liveliness = liveliness;\n  }\n\n  /**\n   * Get the avoidRosNameSpaceConventions value.\n   * @name QoS#get:avoidRosNameSpaceConventions\n   * @function\n   * @return {boolean}\n   */\n  get avoidRosNameSpaceConventions() {\n    return this._avoidRosNameSpaceConventions;\n  }\n\n  /**\n   * Set the avoidRosNameSpaceConventions value.\n   * @param {boolean} avoidRosNameSpaceConventions - value to be set.\n   * @name QoS#set:avoidRosNameSpaceConventions\n   * @function\n   * @return {undefined}\n   */\n  set avoidRosNameSpaceConventions(avoidRosNameSpaceConventions) {\n    if (typeof avoidRosNameSpaceConventions !== 'boolean') {\n      throw new TypeValidationError(\n        'avoidRosNameSpaceConventions',\n        avoidRosNameSpaceConventions,\n        'boolean',\n        {\n          entityType: 'qos',\n        }\n      );\n    }\n\n    this._avoidRosNameSpaceConventions = avoidRosNameSpaceConventions;\n  }\n\n  /**\n   * Get default profile.\n   * @name QoS#static get:profileDefault\n   * @function\n   * @return {string}\n   */\n  static get profileDefault() {\n    return 'qos_profile_default';\n  }\n\n  /**\n   * Get default system profile.\n   * @name QoS#static get:profileSystemDefault\n   * @function\n   * @return {string}\n   */\n  static get profileSystemDefault() {\n    return 'qos_profile_system_default';\n  }\n\n  /**\n   * Get sensor data profile.\n   * @name QoS#static get:profileSensorData\n   * @function\n   * @return {string}\n   */\n  static get profileSensorData() {\n    return 'qos_profile_sensor_data';\n  }\n\n  /**\n   * Get default services profile.\n   * @name QoS#static get:profileServicesDefault\n   * @function\n   * @return {string}\n   */\n  static get profileServicesDefault() {\n    return 'qos_profile_services_default';\n  }\n\n  /**\n   * Get parameters profile.\n   * @name QoS#static get:profileParameters\n   * @function\n   * @return {string}\n   */\n  static get profileParameters() {\n    return 'qos_profile_parameters';\n  }\n\n  /**\n   * Get parameter events profile.\n   * @name QoS#static get:profileParameterEvents\n   * @function\n   * @return {string}\n   */\n  static get profileParameterEvents() {\n    return 'qos_profile_parameter_events';\n  }\n\n  /**\n   * Get action status profile.\n   * @name QoS#static get:profileActionStatusDefault\n   * @function\n   * @returns {string}\n   */\n  static get profileActionStatusDefault() {\n    return 'qos_profile_action_status_default';\n  }\n}\n\nexport default QoS;\n","// Copyright (c) 2020 Matt Richard. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport loader from '../interface_loader.js';\n\nconst CANCEL_GOAL_SERVICE = 'action_msgs/srv/CancelGoal';\nconst GOAL_INFO_MESSAGE = 'action_msgs/msg/GoalInfo';\nconst GOAL_STATUS_MESSAGE = 'action_msgs/msg/GoalStatus';\nconst UUID_MESSAGE = 'unique_identifier_msgs/msg/UUID';\n\n/**\n * @class - Provides lazy access to common action interface types.\n * @ignore\n */\n\nclass ActionInterfaces {\n  /**\n   * Gets the CancelGoal action service interface\n   */\n  static get CancelGoal() {\n    if (!ActionInterfaces._cancelGoalInterface) {\n      ActionInterfaces._cancelGoalInterface =\n        loader.loadInterface(CANCEL_GOAL_SERVICE);\n    }\n\n    return ActionInterfaces._cancelGoalInterface;\n  }\n\n  /**\n   * Gets the GoalInfo action message interface\n   */\n  static get GoalInfo() {\n    if (!ActionInterfaces._goalInfoInterface) {\n      ActionInterfaces._goalInfoInterface =\n        loader.loadInterface(GOAL_INFO_MESSAGE);\n    }\n\n    return ActionInterfaces._goalInfoInterface;\n  }\n\n  /**\n   * Gets the GoalStatus action message interface\n   */\n  static get GoalStatus() {\n    if (!ActionInterfaces._goalStatusInterface) {\n      ActionInterfaces._goalStatusInterface =\n        loader.loadInterface(GOAL_STATUS_MESSAGE);\n    }\n\n    return ActionInterfaces._goalStatusInterface;\n  }\n\n  /**\n   * Gets the UUID action message interface\n   */\n  static get UUID() {\n    if (!ActionInterfaces._uuidInterface) {\n      ActionInterfaces._uuidInterface = loader.loadInterface(UUID_MESSAGE);\n    }\n\n    return ActionInterfaces._uuidInterface;\n  }\n}\n\nexport default ActionInterfaces;\n","// Copyright (c) 2020 Matt Richard. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport ActionInterfaces from './interfaces.js';\nimport { randomUUID } from 'crypto';\nimport { TypeValidationError } from '../errors.js';\n\n/**\n * @class - Represents a unique identifier used by actions.\n * @ignore\n */\nclass ActionUuid {\n  /**\n   * Creates a new instance of ActionUuid.\n   * @constructor\n   *\n   * @param {Uint8Array} bytes - The bytes to create the UUID from. A new random UUID will be created, if not provided.\n   */\n  constructor(bytes) {\n    if (bytes) {\n      if (!(bytes instanceof Uint8Array)) {\n        throw new TypeValidationError('bytes', bytes, 'Uint8Array', {\n          entityType: 'action uuid',\n        });\n      }\n\n      this._bytes = bytes;\n    } else {\n      // Generate random UUID.\n      let uuid = randomUUID().replaceAll('-', '');\n      this._bytes = Uint8Array.from(Buffer.from(uuid, 'hex'));\n    }\n  }\n\n  /**\n   * Creates a new {@link ActionUuid} from the given bytes.\n   * @param {Uint8Array} bytes - The bytes to create the UUID from.\n   * @returns {ActionUuid} - The new UUID.\n   */\n  static fromBytes(bytes) {\n    return new ActionUuid(bytes);\n  }\n\n  /**\n   * Creates a new random {@link ActionUuid}.\n   * @returns {ActionUuid} - The new UUID.\n   */\n  static random() {\n    return new ActionUuid();\n  }\n\n  /**\n   * Gets the bytes forming the UUID.\n   */\n  get bytes() {\n    return this._bytes;\n  }\n\n  /**\n   * Returns the UUID as a string.\n   * @returns {string} - String representation of the UUID.\n   */\n  toString() {\n    return [].slice.call(this._bytes).join(',');\n  }\n\n  /**\n   * Create an instance from a ROS2 UUID message\n   * @param {unique_identifier_msgs.msg.UUID} msg - The ROS2 UUID message\n   * @returns {ActionUuid} - The new instance.\n   */\n  static fromMessage(msg) {\n    return ActionUuid.fromBytes(msg.uuid);\n  }\n\n  /**\n   * Create a ROS2 UUID message from this instance.\n   * @returns {unique_identifier_msgs.msg.UUID} - The new ROS2 UUID message\n   */\n  toMessage() {\n    const uuidMsg = new ActionInterfaces.UUID();\n    uuidMsg.uuid = this.bytes;\n    return uuidMsg;\n  }\n\n  /**\n   * Create a ROS2 UUID message with random uuid data\n   * @returns {ActionUuid} - The new instance.\n   */\n  static randomMessage() {\n    return ActionUuid.random().toMessage();\n  }\n}\n\nexport default ActionUuid;\n","// Copyright (c) 2020 Matt Richard. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport ActionInterfaces from './interfaces.js';\n\n/**\n * @class - Goal handle for working with Action Clients.\n * @hideconstructor\n */\n\nclass ClientGoalHandle {\n  constructor(actionClient, goalId, goalResponse) {\n    this._actionClient = actionClient;\n    this._goalId = goalId;\n    this._goalResponse = goalResponse;\n    this._status = this.accepted\n      ? ActionInterfaces.GoalStatus.STATUS_ACCEPTED\n      : ActionInterfaces.GoalStatus.STATUS_UNKNOWN;\n  }\n\n  /**\n   * Gets the goal Id.\n   */\n  get goalId() {\n    return this._goalId;\n  }\n\n  /**\n   * Gets the goal response timestamp.\n   */\n  get stamp() {\n    return this._goalResponse.stamp;\n  }\n\n  /**\n   * Gets if the goal response was accepted.\n   * @deprecated use isAccepted()\n   */\n  get accepted() {\n    return this.isAccepted();\n  }\n\n  /**\n   * Determine if goal is currently executing\n   * @returns {bool} - True if goal is executing; otherwise return false.\n   */\n  isAccepted() {\n    return this._goalResponse.accepted;\n  }\n\n  /**\n   * Determine if goal is currently executing\n   * @returns {bool} - True if goal is executing; otherwise return false.\n   */\n  isExecuting() {\n    return this.status === ActionInterfaces.GoalStatus.STATUS_EXECUTING;\n  }\n\n  /**\n   * Determine if goal is in the process of canceling.\n   * @returns {bool} - True if goal is canceling; otherwise return false.\n   */\n  isCanceling() {\n    return this.status === ActionInterfaces.GoalStatus.STATUS_CANCELING;\n  }\n\n  /**\n   * Determine if goal completed successfullly.\n   * @returns {bool} - True if goal completed successfully; otherwise return false.\n   */\n  isSucceeded() {\n    return this.status === ActionInterfaces.GoalStatus.STATUS_SUCCEEDED;\n  }\n\n  /**\n   * Determine if goal has been canceled.\n   * @returns {bool} - True if goal has been aborted; otherwise return false.\n   */\n  isCanceled() {\n    return this.status === ActionInterfaces.GoalStatus.STATUS_CANCELED;\n  }\n\n  /**\n   * Determine if goal has been aborted.\n   * @returns {bool} - True if goal was aborted; otherwise return false.\n   */\n  isAborted() {\n    return this.status === ActionInterfaces.GoalStatus.STATUS_ABORTED;\n  }\n\n  /**\n   * Gets the goal status.\n   */\n  get status() {\n    return this._status;\n  }\n\n  /**\n   * Update status to the latest state of goal computation.\n   * When status is in a final state it can not be revered to an\n   * earlier state, e.g., can not change from SUCCEEDED to ACCEPTED.\n   * @param {number} newStatus - The new status of this goal.\n   */\n  set status(newStatus) {\n    if (\n      this._status < ActionInterfaces.GoalStatus.STATUS_SUCCEEDED &&\n      newStatus > this._status\n    ) {\n      this._status = newStatus;\n    }\n  }\n\n  /**\n   * Send a cancel request for the goal.\n   * @returns {Promise} - The cancel response.\n   */\n  cancelGoal() {\n    return this._actionClient._cancelGoal(this);\n  }\n\n  /**\n   * Request the result for the goal.\n   * @returns {Promise} - The result response.\n   */\n  getResult() {\n    return this._actionClient._getResult(this);\n  }\n}\n\nexport default ClientGoalHandle;\n","// Copyright (c) 2020 Matt Richard. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TypeValidationError } from '../errors.js';\n\n/**\n * @class - Wraps a promise allowing it to be resolved elsewhere.\n * @ignore\n */\n\nclass Deferred {\n  /**\n   * Creates a new deferred Promise.\n   * @constructor\n   */\n  constructor() {\n    this._promise = new Promise((resolve) => (this._resolve = resolve));\n  }\n\n  /**\n   * Gets the underlying promise.\n   */\n  get promise() {\n    return this._promise;\n  }\n\n  /**\n   * Sets a function to be called before result updated\n   * @param {function} callback - Function to be called.\n   * @returns {undefined}\n   */\n  beforeSetResultCallback(callback) {\n    if (typeof callback !== 'function') {\n      throw new TypeValidationError('callback', callback, 'function', {\n        entityType: 'deferred promise',\n      });\n    }\n\n    this._beforeSetResultCallback = callback;\n  }\n\n  /**\n   * Resolves the deferred promise.\n   * @param {*} result - The value to resolve the promise with.\n   * @returns {undefined}\n   */\n  setResult(result) {\n    if (this._resolve) {\n      this._result = this._beforeSetResultCallback\n        ? this._beforeSetResultCallback(result)\n        : result;\n      this._resolve(this._result);\n      this._resolve = null;\n    }\n  }\n\n  /**\n   * Sets a function to be called after the promise resolved\n   * @param {function} callback - Function to be called.\n   * @returns {undefined}\n   */\n  setDoneCallback(callback) {\n    if (typeof callback !== 'function') {\n      throw new TypeValidationError('callback', callback, 'function', {\n        entityType: 'deferred promise',\n      });\n    }\n\n    this._promise.finally(() => callback(this._result));\n  }\n}\n\nexport default Deferred;\n","// Copyright (c) 2017 Intel Corporation. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Destroying an entity for which there is immediate i/o activity can\n// results in a SEGFAULT. To mitigate this situation we hold a\n// reference to released handles to prevent them from being\n// GC'ed prematurely.\nconst OBSOLETE_HANDLES = new Set();\nlet cleanupScheduled = false;\nfunction retainHandleUntilCleanup(handle) {\n  OBSOLETE_HANDLES.add(handle);\n  if (cleanupScheduled) return;\n\n  cleanupScheduled = true;\n  setImmediate(() => {\n    cleanupScheduled = false;\n    Entity._gcHandles();\n  }).unref();\n}\n\n/**\n * @class - Class representing a common object in RCL.\n * @ignore\n */\n\nclass Entity {\n  /**\n   * Clears the internal short-lived cache of references to\n   * destroyed entities.\n   *\n   * @ignore\n   */\n  static _gcHandles() {\n    OBSOLETE_HANDLES.clear();\n  }\n\n  constructor(handle, typeClass, options) {\n    this._handle = handle;\n    this._typeClass = typeClass;\n    this._options = options;\n    this._destroyed = false;\n  }\n\n  get handle() {\n    return this._handle;\n  }\n\n  get options() {\n    return this._options;\n  }\n\n  set options(options) {\n    this._options = options;\n  }\n\n  get qos() {\n    return this._options.qos;\n  }\n\n  get typedArrayEnabled() {\n    return this._options.enableTypedArray;\n  }\n\n  get typeClass() {\n    return this._typeClass;\n  }\n\n  /**\n   * Mark this entity destroyed and release its native resources.\n   * Called by EntityRegistry after removal; not a user-facing destruction API.\n   * @ignore\n   */\n  finalizeDestruction() {\n    if (this.isDestroyed()) return;\n\n    this._destroyed = true;\n    this.handle.release();\n    retainHandleUntilCleanup(this._handle);\n  }\n\n  /**\n   * Test if this entity has been destroyed and resources released.\n   * @returns {boolean} - true when destroyed has previously been called.\n   */\n  isDestroyed() {\n    return this._destroyed;\n  }\n}\n\nexport default Entity;\n","// Copyright (c) 2025 Mahmoud Alghalayini. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { MessageValidationError, TypeValidationError } from './errors.js';\nimport interfaceLoader from './interface_loader.js';\n\n/**\n * Validation issue problem types\n * @enum {string}\n */\nconst ValidationProblem = {\n  /** Field exists in object but not in message schema */\n  UNKNOWN_FIELD: 'UNKNOWN_FIELD',\n  /** Field type doesn't match expected type */\n  TYPE_MISMATCH: 'TYPE_MISMATCH',\n  /** Required field is missing */\n  MISSING_FIELD: 'MISSING_FIELD',\n  /** Array length constraint violated */\n  ARRAY_LENGTH: 'ARRAY_LENGTH',\n  /** Value is out of valid range */\n  OUT_OF_RANGE: 'OUT_OF_RANGE',\n  /** Nested message validation failed */\n  NESTED_ERROR: 'NESTED_ERROR',\n};\n\n/**\n * Map ROS primitive types to JavaScript types\n */\nconst PRIMITIVE_TYPE_MAP = {\n  bool: 'boolean',\n  int8: 'number',\n  uint8: 'number',\n  int16: 'number',\n  uint16: 'number',\n  int32: 'number',\n  uint32: 'number',\n  int64: 'bigint',\n  uint64: 'bigint',\n  float32: 'number',\n  float64: 'number',\n  char: 'number',\n  byte: 'number',\n  string: 'string',\n  wstring: 'string',\n};\n\n/**\n * Check if value is a TypedArray\n * @param {any} value - Value to check\n * @returns {boolean} True if TypedArray\n */\nfunction isTypedArray(value) {\n  return ArrayBuffer.isView(value) && !(value instanceof DataView);\n}\n\n/**\n * Get the JavaScript type string for a value\n * @param {any} value - Value to get type of\n * @returns {string} Type description\n */\nfunction getValueType(value) {\n  if (value === null) return 'null';\n  if (value === undefined) return 'undefined';\n  if (Array.isArray(value)) return 'array';\n  if (isTypedArray(value)) return 'TypedArray';\n  return typeof value;\n}\n\n/**\n * Resolve a type class from various input formats\n * @param {string|object|function} typeClass - Type identifier\n * @returns {function|null} The resolved type class or null\n */\nfunction resolveTypeClass(typeClass) {\n  if (typeof typeClass === 'function') {\n    return typeClass;\n  }\n\n  try {\n    return interfaceLoader.loadInterface(typeClass);\n  } catch {\n    return null;\n  }\n}\n\n/**\n * Get message type string from type class\n * @param {function} typeClass - Message type class\n * @returns {string} Message type string (e.g., 'std_msgs/msg/String')\n */\nfunction getMessageTypeString(typeClass) {\n  if (typeof typeClass.type === 'function') {\n    const t = typeClass.type();\n    return `${t.pkgName}/${t.subFolder}/${t.interfaceName}`;\n  }\n  return 'unknown';\n}\n\n/**\n * Get the schema definition for a message type\n * @param {function|string|object} typeClass - Message type class or identifier\n * @returns {object|null} Schema definition with fields and constants, or null if not found\n * @example\n * const schema = getMessageSchema(StringClass);\n * // Returns: {\n * //   fields: [{name: 'data', type: {type: 'string', isPrimitiveType: true, ...}}],\n * //   constants: [],\n * //   messageType: 'std_msgs/msg/String'\n * // }\n */\nfunction getMessageSchema(typeClass) {\n  const resolved = resolveTypeClass(typeClass);\n  if (!resolved || !resolved.ROSMessageDef) {\n    return null;\n  }\n\n  const def = resolved.ROSMessageDef;\n  return {\n    fields: def.fields || [],\n    constants: def.constants || [],\n    messageType: getMessageTypeString(resolved),\n    baseType: def.baseType,\n  };\n}\n\n/**\n * Get field names for a message type\n * @param {function|string|object} typeClass - Message type class or identifier\n * @returns {string[]} Array of field names\n */\nfunction getFieldNames(typeClass) {\n  const schema = getMessageSchema(typeClass);\n  if (!schema) return [];\n  return schema.fields.map((f) => f.name);\n}\n\n/**\n * Get type information for a specific field\n * @param {function|string|object} typeClass - Message type class or identifier\n * @param {string} fieldName - Name of the field\n * @returns {object|null} Field type information or null if not found\n */\nfunction getFieldType(typeClass, fieldName) {\n  const schema = getMessageSchema(typeClass);\n  if (!schema) return null;\n\n  const field = schema.fields.find((f) => f.name === fieldName);\n  return field ? field.type : null;\n}\n\n/**\n * Validate a primitive value against its expected type\n * @param {any} value - Value to validate\n * @param {object} fieldType - Field type definition\n * @returns {object|null} Validation issue or null if valid\n */\nfunction validatePrimitiveValue(value, fieldType) {\n  const expectedJsType = PRIMITIVE_TYPE_MAP[fieldType.type];\n  const actualType = typeof value;\n\n  if (!expectedJsType) {\n    return null; // Unknown primitive type, skip validation\n  }\n\n  // Allow number for bigint fields (will be converted)\n  if (expectedJsType === 'bigint' && actualType === 'number') {\n    return null;\n  }\n\n  if (actualType !== expectedJsType) {\n    return {\n      problem: ValidationProblem.TYPE_MISMATCH,\n      expected: expectedJsType,\n      received: actualType,\n    };\n  }\n\n  return null;\n}\n\n/**\n * Validate array constraints\n * @param {any} value - Array value to validate\n * @param {object} fieldType - Field type definition\n * @returns {object|null} Validation issue or null if valid\n */\nfunction validateArrayConstraints(value, fieldType) {\n  if (!Array.isArray(value) && !isTypedArray(value)) {\n    return {\n      problem: ValidationProblem.TYPE_MISMATCH,\n      expected: 'array',\n      received: getValueType(value),\n    };\n  }\n\n  const length = value.length;\n\n  // Fixed size array\n  if (fieldType.isFixedSizeArray && length !== fieldType.arraySize) {\n    return {\n      problem: ValidationProblem.ARRAY_LENGTH,\n      expected: `exactly ${fieldType.arraySize} elements`,\n      received: `${length} elements`,\n    };\n  }\n\n  // Upper bound array\n  if (fieldType.isUpperBound && length > fieldType.arraySize) {\n    return {\n      problem: ValidationProblem.ARRAY_LENGTH,\n      expected: `at most ${fieldType.arraySize} elements`,\n      received: `${length} elements`,\n    };\n  }\n\n  return null;\n}\n\n/**\n * Validate a message object against its schema\n * @param {object} obj - Plain object to validate\n * @param {function|string|object} typeClass - Message type class or identifier\n * @param {object} [options] - Validation options\n * @param {boolean} [options.strict=false] - If true, unknown fields cause validation failure\n * @param {boolean} [options.checkTypes=true] - If true, validate field types\n * @param {boolean} [options.checkRequired=false] - If true, check for missing fields\n * @param {string} [options.path=''] - Current path for nested validation (internal use)\n * @returns {{valid: boolean, issues: Array<object>}} Validation result\n */\nfunction validateMessage(obj, typeClass, options = {}) {\n  const {\n    strict = false,\n    checkTypes = true,\n    checkRequired = false,\n    path = '',\n  } = options;\n\n  const issues = [];\n  const resolved = resolveTypeClass(typeClass);\n\n  if (!resolved) {\n    issues.push({\n      field: path || '(root)',\n      problem: 'INVALID_TYPE_CLASS',\n      expected: 'valid message type class',\n      received: typeof typeClass,\n    });\n    return { valid: false, issues };\n  }\n\n  const schema = getMessageSchema(resolved);\n  if (!schema) {\n    issues.push({\n      field: path || '(root)',\n      problem: 'NO_SCHEMA',\n      expected: 'message with ROSMessageDef',\n      received: 'class without schema',\n    });\n    return { valid: false, issues };\n  }\n\n  if (obj === null || obj === undefined) {\n    issues.push({\n      field: path || '(root)',\n      problem: ValidationProblem.TYPE_MISMATCH,\n      expected: 'object',\n      received: String(obj),\n    });\n    return { valid: false, issues };\n  }\n\n  const type = typeof obj;\n  if (\n    type === 'string' ||\n    type === 'number' ||\n    type === 'boolean' ||\n    type === 'bigint'\n  ) {\n    if (schema.fields.length === 1 && schema.fields[0].name === 'data') {\n      const fieldType = schema.fields[0].type;\n      if (checkTypes && fieldType.isPrimitiveType) {\n        const typeIssue = validatePrimitiveValue(obj, fieldType);\n        if (typeIssue) {\n          issues.push({\n            field: path ? `${path}.data` : 'data',\n            ...typeIssue,\n          });\n        }\n      }\n      return { valid: issues.length === 0, issues };\n    }\n  }\n\n  if (type !== 'object') {\n    issues.push({\n      field: path || '(root)',\n      problem: ValidationProblem.TYPE_MISMATCH,\n      expected: 'object',\n      received: type,\n    });\n    return { valid: false, issues };\n  }\n\n  const fieldNames = new Set(schema.fields.map((f) => f.name));\n  const objKeys = Object.keys(obj);\n\n  if (strict) {\n    for (const key of objKeys) {\n      if (!fieldNames.has(key)) {\n        issues.push({\n          field: path ? `${path}.${key}` : key,\n          problem: ValidationProblem.UNKNOWN_FIELD,\n        });\n      }\n    }\n  }\n\n  for (const field of schema.fields) {\n    const fieldPath = path ? `${path}.${field.name}` : field.name;\n    const value = obj[field.name];\n    const fieldType = field.type;\n\n    if (field.name.startsWith('_')) continue;\n\n    if (value === undefined) {\n      if (checkRequired) {\n        issues.push({\n          field: fieldPath,\n          problem: ValidationProblem.MISSING_FIELD,\n          expected: fieldType.type,\n        });\n      }\n      continue;\n    }\n\n    if (fieldType.isArray) {\n      const arrayIssue = validateArrayConstraints(value, fieldType);\n      if (arrayIssue) {\n        issues.push({ field: fieldPath, ...arrayIssue });\n        continue;\n      }\n\n      if (checkTypes && Array.isArray(value) && value.length > 0) {\n        if (fieldType.isPrimitiveType) {\n          for (let i = 0; i < value.length; i++) {\n            const elemIssue = validatePrimitiveValue(value[i], fieldType);\n            if (elemIssue) {\n              issues.push({\n                field: `${fieldPath}[${i}]`,\n                ...elemIssue,\n              });\n            }\n          }\n        } else {\n          for (let i = 0; i < value.length; i++) {\n            const nestedResult = validateMessage(\n              value[i],\n              getNestedTypeClass(resolved, field.name),\n              {\n                strict,\n                checkTypes,\n                checkRequired,\n                path: `${fieldPath}[${i}]`,\n              }\n            );\n            if (!nestedResult.valid) {\n              issues.push(...nestedResult.issues);\n            }\n          }\n        }\n      }\n    } else if (fieldType.isPrimitiveType) {\n      if (checkTypes) {\n        const typeIssue = validatePrimitiveValue(value, fieldType);\n        if (typeIssue) {\n          issues.push({ field: fieldPath, ...typeIssue });\n        }\n      }\n    } else {\n      if (value !== null && typeof value === 'object') {\n        const nestedTypeClass = getNestedTypeClass(resolved, field.name);\n        if (nestedTypeClass) {\n          const nestedResult = validateMessage(value, nestedTypeClass, {\n            strict,\n            checkTypes,\n            checkRequired,\n            path: fieldPath,\n          });\n          if (!nestedResult.valid) {\n            issues.push(...nestedResult.issues);\n          }\n        }\n      } else if (checkTypes && value !== null) {\n        issues.push({\n          field: fieldPath,\n          problem: ValidationProblem.TYPE_MISMATCH,\n          expected: 'object',\n          received: getValueType(value),\n        });\n      }\n    }\n  }\n\n  return { valid: issues.length === 0, issues };\n}\n\n/**\n * Get the type class for a nested field\n * @param {function} parentTypeClass - Parent message type class\n * @param {string} fieldName - Field name\n * @returns {function|null} Nested type class or null\n */\nfunction getNestedTypeClass(parentTypeClass, fieldName) {\n  try {\n    const instance = new parentTypeClass();\n    const fieldValue = instance[fieldName];\n\n    if (\n      fieldValue &&\n      fieldValue.constructor &&\n      fieldValue.constructor.ROSMessageDef\n    ) {\n      return fieldValue.constructor;\n    }\n\n    if (\n      fieldValue &&\n      fieldValue.classType &&\n      fieldValue.classType.elementType\n    ) {\n      return fieldValue.classType.elementType;\n    }\n  } catch {\n    const schema = getMessageSchema(parentTypeClass);\n    if (schema) {\n      const field = schema.fields.find((f) => f.name === fieldName);\n      if (field && !field.type.isPrimitiveType) {\n        const typeName = `${field.type.pkgName}/msg/${field.type.type}`;\n        return resolveTypeClass(typeName);\n      }\n    }\n  }\n  return null;\n}\n\n/**\n * Validate a message and throw if invalid\n * @param {object} obj - Plain object to validate\n * @param {function|string|object} typeClass - Message type class or identifier\n * @param {object} [options] - Validation options (same as validateMessage)\n * @throws {MessageValidationError} If validation fails\n * @returns {void}\n */\nfunction assertValidMessage(obj, typeClass, options = {}) {\n  const result = validateMessage(obj, typeClass, options);\n\n  if (!result.valid) {\n    const resolved = resolveTypeClass(typeClass);\n    const messageType = resolved\n      ? getMessageTypeString(resolved)\n      : String(typeClass);\n    throw new MessageValidationError(messageType, result.issues);\n  }\n}\n\n/**\n * Create a validator function for a specific message type\n * @param {function|string|object} typeClass - Message type class or identifier\n * @param {object} [defaultOptions] - Default validation options\n * @returns {function} Validator function that takes (obj, options?) and returns validation result\n */\nfunction createMessageValidator(typeClass, defaultOptions = {}) {\n  const resolved = resolveTypeClass(typeClass);\n  if (!resolved) {\n    throw new TypeValidationError(\n      'typeClass',\n      typeClass,\n      'valid message type class'\n    );\n  }\n\n  return function validator(obj, options = {}) {\n    return validateMessage(obj, resolved, {\n      ...defaultOptions,\n      ...options,\n    });\n  };\n}\n\nexport {\n  ValidationProblem,\n  getMessageSchema,\n  getFieldNames,\n  getFieldType,\n  validateMessage,\n  assertValidMessage,\n  createMessageValidator,\n  getMessageTypeString,\n};\n","// Copyright (c) 2020 Matt Richard. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport rclnodejs from '../native_loader.js';\nimport ActionInterfaces from './interfaces.js';\nimport ActionUuid from './uuid.js';\nimport ClientGoalHandle from './client_goal_handle.js';\nimport Deferred from './deferred.js';\nimport DistroUtils from '../distro.js';\nimport Entity from '../entity.js';\nimport loader from '../interface_loader.js';\nimport QoS from '../qos.js';\nimport { TypeValidationError, ActionError, OperationError } from '../errors.js';\nimport { assertValidMessage } from '../message_validation.js';\n\n/**\n * @class - ROS Action client.\n */\n\nclass ActionClient extends Entity {\n  /**\n   * Creates a new action client.\n   * @constructor\n   *\n   * @param {Node} node - The ROS node to add the action client to.\n   * @param {function|string|object} typeClass - Type of the action.\n   * @param {string} actionName - Name of the action.\n   * @param {object} options - Action client options.\n   * @param {boolean} options.enableTypedArray - The topic will use TypedArray if necessary, default: true.\n   * @param {object} options.qos - ROS Middleware \"quality of service\" options.\n   * @param {QoS} options.qos.goalServiceQosProfile - Quality of service option for the goal service, default: QoS.profileServicesDefault.\n   * @param {QoS} options.qos.resultServiceQosProfile - Quality of service option for the result service, default: QoS.profileServicesDefault.\n   * @param {QoS} options.qos.cancelServiceQosProfile - Quality of service option for the cancel service, default: QoS.profileServicesDefault..\n   * @param {QoS} options.qos.feedbackSubQosProfile - Quality of service option for the feedback subscription,\n   *                                                  default: new QoS(QoS.HistoryPolicy.RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT, 10).\n   * @param {QoS} options.qos.statusSubQosProfile - Quality of service option for the status subscription, default: QoS.profileActionStatusDefault.\n   * @param {boolean} options.enableFeedbackMsgOptimization - Enable feedback subscription content filter to\n   *    optimize the handling of feedback messages. When enabled, the content filter is used to configure\n   *    the goal ID for the subscription, which helps avoid the reception of irrelevant feedback messages.\n   *    An action client can handle up to 6 goals simultaneously with this optimization. If the number\n   *    of goals exceeds the limit or the RMW doesn't support content filter, optimization is automatically\n   *    disabled. Default: false.\n   */\n  constructor(node, typeClass, actionName, options) {\n    super(null, null, options);\n\n    this._node = node;\n    this._typeClass = loader.loadInterface(typeClass);\n    this._actionName = actionName;\n    this._feedbackCallbacks = new Map();\n    this._sequenceNumberGoalIdMap = new Map();\n    this._goalHandles = new Map();\n    this._pendingGoalRequests = new Map();\n    this._pendingCancelRequests = new Map();\n    this._pendingResultRequests = new Map();\n\n    // Setup options defaults\n    this._options = this._options || {};\n    this._options.enableTypedArray = this._options.enableTypedArray !== false;\n    this._options.qos = this._options.qos || {};\n    this._options.qos.goalServiceQosProfile =\n      this._options.qos.goalServiceQosProfile || QoS.profileServicesDefault;\n    this._options.qos.resultServiceQosProfile =\n      this._options.qos.resultServiceQosProfile || QoS.profileServicesDefault;\n    this._options.qos.cancelServiceQosProfile =\n      this._options.qos.cancelServiceQosProfile || QoS.profileServicesDefault;\n    this._options.qos.feedbackSubQosProfile =\n      this._options.qos.feedbackSubQosProfile ||\n      new QoS(QoS.HistoryPolicy.RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT, 10);\n    this._options.qos.statusSubQosProfile =\n      this._options.qos.statusSubQosProfile || QoS.profileActionStatusDefault;\n\n    this._validateGoals = this._options.validateGoals || false;\n    this._validationOptions = this._options.validationOptions || {\n      strict: true,\n      checkTypes: true,\n    };\n\n    // Enable feedback subscription content filter optimization.\n    // Only supported on ROS2 Lyrical or newer and only effective when the\n    // native binding provides the required functions AND the RMW\n    // implementation actually supports content filtering on the feedback\n    // subscription.\n    this._enableFeedbackMsgOptimization =\n      this._options.enableFeedbackMsgOptimization === true &&\n      DistroUtils.getDistroId() >= DistroUtils.DistroId.LYRICAL &&\n      typeof rclnodejs.actionConfigureFeedbackSubFilterAddGoalId === 'function';\n\n    let type = this.typeClass.type();\n\n    this._handle = rclnodejs.actionCreateClient(\n      node.handle,\n      actionName,\n      type.interfaceName,\n      type.pkgName,\n      this.qos.goalServiceQosProfile,\n      this.qos.resultServiceQosProfile,\n      this.qos.cancelServiceQosProfile,\n      this.qos.feedbackSubQosProfile,\n      this.qos.statusSubQosProfile\n    );\n\n    node._addActionClient(this);\n  }\n\n  processGoalResponse(sequence, response) {\n    if (this._sequenceNumberGoalIdMap.has(sequence)) {\n      let goalHandle = new ClientGoalHandle(\n        this,\n        this._sequenceNumberGoalIdMap.get(sequence),\n        response\n      );\n\n      if (goalHandle.accepted) {\n        let uuid = ActionUuid.fromMessage(goalHandle.goalId).toString();\n        if (this._goalHandles.has(uuid)) {\n          throw new ActionError(\n            `Two goals were accepted with the same ID (${uuid})`,\n            this._actionName,\n            {\n              code: 'DUPLICATE_GOAL_ID',\n              details: { goalId: uuid },\n            }\n          );\n        }\n\n        this._goalHandles.set(uuid, goalHandle);\n        this._feedbackSubFilterAddGoalId(goalHandle.goalId);\n      } else {\n        // Clean up feedback callback for rejected goals\n        let uuid = ActionUuid.fromMessage(\n          this._sequenceNumberGoalIdMap.get(sequence)\n        ).toString();\n        this._feedbackCallbacks.delete(uuid);\n      }\n\n      this._pendingGoalRequests.get(sequence).setResult(goalHandle);\n    } else {\n      this._node\n        .getLogger()\n        .warn(\n          'Ignoring unexpected goal response. There may be more than ' +\n            `one action server for the action '${this._actionName}'`\n        );\n    }\n  }\n\n  processCancelResponse(sequence, response) {\n    if (this._pendingCancelRequests.has(sequence)) {\n      this._pendingCancelRequests\n        .get(sequence)\n        .setResult(response.toPlainObject(this.typedArrayEnabled));\n    } else {\n      this._node\n        .getLogger()\n        .warn(\n          'Ignoring unexpected cancel response. There may be more than ' +\n            `one action server for the action '${this._actionName}'`\n        );\n    }\n  }\n\n  processResultResponse(sequence, response) {\n    if (this._pendingResultRequests.has(sequence)) {\n      this._pendingResultRequests\n        .get(sequence)\n        .setResult(response.toPlainObject(this.typedArrayEnabled));\n    } else {\n      this._node\n        .getLogger()\n        .warn(\n          'Ignoring unexpected result response. There may be more than ' +\n            `one action server for the action '${this._actionName}'`\n        );\n    }\n  }\n\n  processFeedbackMessage(message) {\n    let uuid = ActionUuid.fromMessage(message.goal_id).toString();\n    if (this._feedbackCallbacks.has(uuid)) {\n      this._feedbackCallbacks.get(uuid)(\n        message.toPlainObject(this.typedArrayEnabled).feedback\n      );\n    }\n  }\n\n  processStatusMessage(message) {\n    // Update the status of all goal handles maintained by this Action Client\n    for (const statusMessage of message.status_list.data) {\n      let uuid = ActionUuid.fromMessage(\n        statusMessage.goal_info.goal_id\n      ).toString();\n      let status = statusMessage.status;\n\n      if (this._goalHandles.has(uuid)) {\n        let goalHandle = this._goalHandles.get(uuid);\n        if (goalHandle) {\n          goalHandle.status = status;\n\n          // Remove done handles from the list\n\n          if (\n            status === ActionInterfaces.GoalStatus.STATUS_SUCCEEDED ||\n            status === ActionInterfaces.GoalStatus.STATUS_CANCELED ||\n            status === ActionInterfaces.GoalStatus.STATUS_ABORTED\n          ) {\n            this._goalHandles.delete(uuid);\n            this._feedbackSubFilterRemoveGoalId(\n              statusMessage.goal_info.goal_id\n            );\n          }\n        }\n      } else {\n        this._goalHandles.delete(uuid);\n      }\n    }\n  }\n\n  /**\n   * Whether goals will be validated before sending.\n   * @type {boolean}\n   */\n  get willValidateGoal() {\n    return this._validateGoals;\n  }\n\n  /**\n   * Enable or disable goal validation for this action client.\n   * @param {boolean} value - Whether to validate goals\n   */\n  set willValidateGoal(value) {\n    this._validateGoals = value;\n  }\n\n  /**\n   * Set validation options for this action client.\n   * @param {object} options - Validation options\n   * @param {boolean} [options.strict=true] - Throw on unknown fields\n   * @param {boolean} [options.checkTypes=true] - Validate field types\n   */\n  setValidation(options) {\n    if (options && Object.keys(options).length > 0) {\n      this._validationOptions = { ...this._validationOptions, ...options };\n    }\n  }\n\n  /**\n   * Send a goal and wait for the goal ACK asynchronously.\n   *\n   * Return a Promise object that is resolved with a ClientGoalHandle when receipt of the goal\n   * is acknowledged by an action server, see client state transition https://docs.ros.org/en/jazzy/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Actions/Understanding-ROS2-Actions.html\n   *\n   * @param {object} goal - The goal request.\n   * @param {function} feedbackCallback - Callback function for feedback associated with the goal.\n   * @param {object} goalUuid - Universally unique identifier for the goal. If None, then a random UUID is generated.\n   * @param {object} [options] - Send options\n   * @param {boolean} [options.validate] - Override validateGoals setting for this call\n   * @returns {Promise} - A Promise to a goal handle that resolves when the goal request has been accepted or rejected.\n   * @throws {MessageValidationError} If validation is enabled and goal is invalid\n   */\n  sendGoal(goal, feedbackCallback, goalUuid, options = {}) {\n    const shouldValidate =\n      options.validate !== undefined ? options.validate : this._validateGoals;\n\n    if (shouldValidate) {\n      const GoalType = this._typeClass.impl.SendGoalService.Request;\n      const goalInstance = new GoalType();\n      if (goalInstance.goal && goalInstance.goal.constructor) {\n        assertValidMessage(\n          goal,\n          goalInstance.goal.constructor,\n          this._validationOptions\n        );\n      }\n    }\n\n    let request = new this._typeClass.impl.SendGoalService.Request();\n    request['goal_id'] = goalUuid || ActionUuid.randomMessage();\n    request.goal = goal;\n\n    let sequenceNumber = rclnodejs.actionSendGoalRequest(\n      this.handle,\n      request.serialize()\n    );\n\n    if (this._pendingGoalRequests.has(sequenceNumber)) {\n      throw new OperationError(\n        `Sequence (${sequenceNumber}) conflicts with pending goal request`,\n        {\n          code: 'SEQUENCE_CONFLICT',\n          entityType: 'action client',\n          entityName: this._actionName,\n          details: { sequenceNumber: sequenceNumber, requestType: 'goal' },\n        }\n      );\n    }\n\n    if (feedbackCallback) {\n      let uuid = ActionUuid.fromMessage(request.goal_id).toString();\n      this._feedbackCallbacks.set(uuid, feedbackCallback);\n    }\n\n    let deferred = new Deferred();\n    this._pendingGoalRequests.set(sequenceNumber, deferred);\n    this._sequenceNumberGoalIdMap.set(sequenceNumber, request.goal_id);\n\n    deferred.setDoneCallback(() =>\n      this._removePendingGoalRequest(sequenceNumber)\n    );\n\n    return deferred.promise;\n  }\n\n  /**\n   * Check if there is an action server ready to process requests from this client.\n   * @returns {boolean} True if an action server is ready; otherwise, false.\n   */\n  isActionServerAvailable() {\n    return rclnodejs.actionServerIsAvailable(this._node.handle, this.handle);\n  }\n\n  /**\n   * Wait until the action server is available or a timeout is reached. This\n   * function polls for the server state so it may not return as soon as the\n   * server is available.\n   * @param {number} timeout The maximum amount of time to wait for, if timeout\n   * is `undefined` or `< 0`, this will wait indefinitely.\n   * @return {Promise<boolean>} true if the service is available.\n   */\n  async waitForServer(timeout = undefined) {\n    let deadline = Infinity;\n    if (timeout !== undefined && timeout >= 0) {\n      deadline = Date.now() + timeout;\n    }\n    let waitMs = 5;\n    let serviceAvailable = this.isActionServerAvailable();\n    while (!serviceAvailable && Date.now() < deadline) {\n      waitMs *= 2;\n      waitMs = Math.min(waitMs, 1000);\n      if (timeout !== undefined && timeout >= -1) {\n        waitMs = Math.min(waitMs, deadline - Date.now());\n      }\n      await new Promise((resolve) => setTimeout(resolve, waitMs));\n      serviceAvailable = this.isActionServerAvailable();\n    }\n    return serviceAvailable;\n  }\n\n  /**\n   * Send a cancel request for an active goal and asynchronously get the result.\n   * @ignore\n   * @param {ClientGoalHandle} goalHandle Handle to the goal to cancel.\n   * @returns {Promise} - A Promise that resolves when the cancel request has been processed.\n   */\n  _cancelGoal(goalHandle) {\n    if (!(goalHandle instanceof ClientGoalHandle)) {\n      throw new TypeValidationError(\n        'goalHandle',\n        goalHandle,\n        'ClientGoalHandle',\n        {\n          entityType: 'action client',\n          entityName: this._actionName,\n        }\n      );\n    }\n\n    let request = new ActionInterfaces.CancelGoal.Request();\n    request.goal_info['goal_id'] = goalHandle.goalId;\n    // Initialize the stamp (otherwise we will get an error when we serialize the message)\n    request.goal_info.stamp = {\n      sec: 0,\n      nanosec: 0,\n    };\n\n    let sequenceNumber = rclnodejs.actionSendCancelRequest(\n      this.handle,\n      request.serialize()\n    );\n    if (this._pendingCancelRequests.has(sequenceNumber)) {\n      throw new OperationError(\n        `Sequence (${sequenceNumber}) conflicts with pending cancel request`,\n        {\n          code: 'SEQUENCE_CONFLICT',\n          entityType: 'action client',\n          entityName: this._actionName,\n          details: { sequenceNumber: sequenceNumber, requestType: 'cancel' },\n        }\n      );\n    }\n\n    let deferred = new Deferred();\n    this._pendingCancelRequests.set(sequenceNumber, deferred);\n\n    deferred.setDoneCallback(() =>\n      this._removePendingCancelRequest(sequenceNumber)\n    );\n\n    this._feedbackSubFilterRemoveGoalId(goalHandle.goalId);\n\n    return deferred.promise;\n  }\n\n  /**\n   * Get the result of an active goal asynchronously.\n   *\n   * Return a Promise object that is resolved with result, see client state transition https://docs.ros.org/en/jazzy/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Actions/Understanding-ROS2-Actions.html\n   *\n   * @ignore\n   * @param {ClientGoalHandle} goalHandle - Handle to the goal to cancel.\n   * @returns {Promise} - A Promise that resolves when the get result request has been processed.\n   */\n  _getResult(goalHandle) {\n    if (!(goalHandle instanceof ClientGoalHandle)) {\n      throw new TypeValidationError(\n        'goalHandle',\n        goalHandle,\n        'ClientGoalHandle',\n        {\n          entityType: 'action client',\n          entityName: this._actionName,\n        }\n      );\n    }\n\n    let request = new this.typeClass.impl.GetResultService.Request();\n    request['goal_id'] = goalHandle.goalId;\n\n    let sequenceNumber = rclnodejs.actionSendResultRequest(\n      this.handle,\n      request.serialize()\n    );\n    if (this._pendingResultRequests.has(sequenceNumber)) {\n      throw new OperationError(\n        `Sequence (${sequenceNumber}) conflicts with pending result request`,\n        {\n          code: 'SEQUENCE_CONFLICT',\n          entityType: 'action client',\n          entityName: this._actionName,\n          details: { sequenceNumber: sequenceNumber, requestType: 'result' },\n        }\n      );\n    }\n\n    let deferred = new Deferred();\n    deferred.beforeSetResultCallback((result) => {\n      goalHandle.status = result.status;\n      return result.result;\n    });\n    deferred.setDoneCallback(() => {\n      this._removePendingResultRequest(sequenceNumber);\n      this._removeFeedbackCallback(goalHandle.goalId);\n      this._feedbackSubFilterRemoveGoalId(goalHandle.goalId);\n    });\n\n    this._pendingResultRequests.set(sequenceNumber, deferred);\n\n    return deferred.promise;\n  }\n\n  _removeFeedbackCallback(goalId) {\n    this._feedbackCallbacks.delete(ActionUuid.fromMessage(goalId).toString());\n  }\n\n  _removePendingGoalRequest(sequenceNumber) {\n    this._pendingGoalRequests.delete(sequenceNumber);\n    this._sequenceNumberGoalIdMap.delete(sequenceNumber);\n  }\n\n  _removePendingResultRequest(sequenceNumber) {\n    this._pendingResultRequests.delete(sequenceNumber);\n  }\n\n  _removePendingCancelRequest(sequenceNumber) {\n    this._pendingCancelRequests.delete(sequenceNumber);\n  }\n\n  /**\n   * Add a goal ID to the feedback subscription content filter.\n   * @ignore\n   * @param {object} goalId - The goal UUID message.\n   */\n  _feedbackSubFilterAddGoalId(goalId) {\n    if (!this._enableFeedbackMsgOptimization) return;\n    try {\n      rclnodejs.actionConfigureFeedbackSubFilterAddGoalId(\n        this.handle,\n        Buffer.from(goalId.uuid)\n      );\n    } catch (e) {\n      this._enableFeedbackMsgOptimization = false;\n      this._node.getLogger().warn(`${e.message}`);\n    }\n  }\n\n  /**\n   * Remove a goal ID from the feedback subscription content filter.\n   * @ignore\n   * @param {object} goalId - The goal UUID message.\n   */\n  _feedbackSubFilterRemoveGoalId(goalId) {\n    if (!this._enableFeedbackMsgOptimization) return;\n    try {\n      rclnodejs.actionConfigureFeedbackSubFilterRemoveGoalId(\n        this.handle,\n        Buffer.from(goalId.uuid)\n      );\n    } catch (e) {\n      this._enableFeedbackMsgOptimization = false;\n      this._node.getLogger().warn(`${e.message}`);\n    }\n  }\n\n  /**\n   * Destroy the underlying action client handle.\n   * @return {undefined}\n   */\n  destroy() {\n    this._node._destroyEntity('actionClients', this);\n  }\n\n  /**\n   * Finalize action destruction after registry removal.\n   * @ignore\n   */\n  finalizeDestruction() {\n    if (this.isDestroyed()) {\n      return;\n    }\n\n    this._goalHandles.clear();\n    this._feedbackCallbacks.clear();\n    this._sequenceNumberGoalIdMap.clear();\n    this._pendingGoalRequests.clear();\n    this._pendingResultRequests.clear();\n    this._pendingCancelRequests.clear();\n    this._enableFeedbackMsgOptimization = false;\n\n    super.finalizeDestruction();\n  }\n\n  /**\n   * Get the number of wait set entities that make up an action entity.\n   * @return {object} - An object containing the number of various entities.\n   * @property {number} subscriptionsNumber - The number of subscriptions.\n   * @property {number} guardConditionsNumber - The number of guard conditions.\n   * @property {number} timersNumber - The number of timers.\n   * @property {number} clientsNumber - The number of clients.\n   * @property {number} servicesNumber - The number of services.\n   */\n  getNumEntities() {\n    return rclnodejs.getNumEntities(this.handle);\n  }\n\n  /**\n   * Configure introspection.\n   * @param {Clock} clock - Clock to use for service event timestamps\n   * @param {QoS} qos - QoSProfile for the service event publisher\n   * @param {ServiceIntrospectionState} introspectionState - State to set introspection to\n   */\n  configureIntrospection(clock, qos, introspectionState) {\n    if (DistroUtils.getDistroId() <= DistroUtils.getDistroId('jazzy')) {\n      console.warn(\n        'Configure action client introspection is not supported by this version of ROS 2'\n      );\n      return;\n    }\n\n    let type = this.typeClass.type();\n    rclnodejs.configureActionClientIntrospection(\n      this.handle,\n      this._node.handle,\n      clock.handle,\n      type.interfaceName,\n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