@raydiculousx/ts-sdk 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +55 -0
  3. package/NOTICE +14 -0
  4. package/README.md +91 -3
  5. package/dist/THIRD_PARTY_NOTICES.txt +466 -0
  6. package/dist/host/src/bootstrap/client.d.ts +37 -0
  7. package/dist/host/src/bootstrap/client.js +215 -0
  8. package/dist/host/src/bootstrap/host.d.ts +79 -0
  9. package/dist/host/src/bootstrap/host.js +214 -0
  10. package/dist/host/src/bootstrap/protocol.d.ts +20 -0
  11. package/dist/host/src/bootstrap/protocol.js +72 -0
  12. package/dist/host/src/dev.d.ts +30 -0
  13. package/dist/host/src/dev.js +20 -0
  14. package/dist/host/src/entry/app.d.ts +10 -0
  15. package/dist/host/src/entry/app.js +9 -0
  16. package/dist/host/src/entry/auto.d.ts +16 -0
  17. package/dist/host/src/entry/auto.js +18747 -0
  18. package/dist/host/src/standalone/account-api.d.ts +32 -0
  19. package/dist/host/src/standalone/account-api.js +176 -0
  20. package/dist/host/src/standalone/connection-slot.d.ts +12 -0
  21. package/dist/host/src/standalone/connection-slot.js +28 -0
  22. package/dist/host/src/standalone/device-picker.d.ts +6 -0
  23. package/dist/host/src/standalone/device-picker.js +19 -0
  24. package/dist/host/src/standalone/locale.d.ts +4 -0
  25. package/dist/host/src/standalone/locale.js +35 -0
  26. package/dist/host/src/standalone/mount-host.d.ts +155 -0
  27. package/dist/host/src/standalone/mount-host.js +396 -0
  28. package/dist/host/src/standalone/mount-surface.d.ts +12 -0
  29. package/dist/host/src/standalone/mount-surface.js +69 -0
  30. package/dist/host/src/standalone/robot-setup.d.ts +61 -0
  31. package/dist/host/src/standalone/robot-setup.js +160 -0
  32. package/dist/lib/client/action-ownership.d.ts +31 -0
  33. package/dist/lib/client/action-ownership.js +182 -0
  34. package/dist/lib/client/direct.d.ts +149 -0
  35. package/dist/lib/client/direct.js +560 -0
  36. package/dist/lib/client/raydiculousx.d.ts +541 -0
  37. package/dist/lib/client/raydiculousx.js +694 -0
  38. package/dist/lib/client/runtime.d.ts +165 -0
  39. package/dist/lib/client/runtime.js +1 -0
  40. package/dist/lib/core/index.d.ts +16 -0
  41. package/dist/lib/core/index.js +9 -0
  42. package/dist/lib/core/rpc/command-channel.d.ts +345 -0
  43. package/dist/lib/core/rpc/command-channel.js +697 -0
  44. package/dist/lib/core/rpc/commands.d.ts +354 -0
  45. package/dist/lib/core/rpc/commands.js +134 -0
  46. package/dist/lib/core/rpc/request-policy.d.ts +29 -0
  47. package/dist/lib/core/rpc/request-policy.js +35 -0
  48. package/dist/lib/core/rpc/robot-api.d.ts +184 -0
  49. package/dist/lib/core/rpc/robot-api.js +34 -0
  50. package/dist/lib/core/signaling/ice-servers.d.ts +10 -0
  51. package/dist/lib/core/signaling/ice-servers.js +58 -0
  52. package/dist/lib/core/signaling/peer-negotiator.d.ts +164 -0
  53. package/dist/lib/core/signaling/peer-negotiator.js +366 -0
  54. package/dist/lib/core/signaling/signaling-client.d.ts +204 -0
  55. package/dist/lib/core/signaling/signaling-client.js +473 -0
  56. package/dist/lib/core/signaling/signaling-contract.d.ts +164 -0
  57. package/dist/lib/core/signaling/signaling-contract.js +35 -0
  58. package/dist/lib/core/signaling/signaling.d.ts +172 -0
  59. package/dist/lib/core/signaling/signaling.js +381 -0
  60. package/dist/lib/media/attach-video.d.ts +3 -0
  61. package/dist/lib/media/attach-video.js +243 -0
  62. package/dist/lib/media/direct-audio.d.ts +36 -0
  63. package/dist/lib/media/direct-audio.js +94 -0
  64. package/dist/lib/media/index.d.ts +5 -0
  65. package/dist/lib/media/index.js +3 -0
  66. package/dist/lib/media/pcm-types.d.ts +33 -0
  67. package/dist/lib/media/pcm-types.js +1 -0
  68. package/dist/lib/media/robot-audio.d.ts +64 -0
  69. package/dist/lib/media/robot-audio.js +82 -0
  70. package/dist/lib/media/robot-pcm-output.d.ts +16 -0
  71. package/dist/lib/media/robot-pcm-output.js +101 -0
  72. package/dist/lib/robot/action-upload.d.ts +32 -0
  73. package/dist/lib/robot/action-upload.js +143 -0
  74. package/dist/lib/robot/robot-commands.d.ts +148 -0
  75. package/dist/lib/robot/robot-commands.js +164 -0
  76. package/dist/lib/robot/robot-responses.d.ts +42 -0
  77. package/dist/lib/robot/robot-responses.js +226 -0
  78. package/dist/lib/robot/robot-tof.d.ts +61 -0
  79. package/dist/lib/robot/robot-tof.js +25 -0
  80. package/dist/lib/robot/robot-types.d.ts +293 -0
  81. package/dist/lib/robot/robot-types.js +17 -0
  82. package/dist/lib/shared/errors.d.ts +57 -0
  83. package/dist/lib/shared/errors.js +45 -0
  84. package/dist/lib/shared/events.d.ts +11 -0
  85. package/dist/lib/shared/events.js +40 -0
  86. package/dist/lib/shared/types.d.ts +26 -0
  87. package/dist/lib/shared/types.js +1 -0
  88. package/dist/lib/shared/validation.d.ts +29 -0
  89. package/dist/lib/shared/validation.js +87 -0
  90. package/dist/lib/version.d.ts +2 -0
  91. package/dist/lib/version.js +3 -0
  92. package/dist/raydiculousx-sdk.d.ts +26 -0
  93. package/dist/raydiculousx-sdk.js +17 -0
  94. package/docs/API.md +1106 -0
  95. package/docs/DIRECT_APPS.md +83 -0
  96. package/docs/HOST_HANDOFF.md +59 -0
  97. package/docs/HOST_PROTOCOL.md +43 -0
  98. package/docs/RELEASING.md +33 -0
  99. package/docs/assets/raydiculousx-mark.png +0 -0
  100. package/examples/README.md +10 -0
  101. package/examples/application-template/README.md +60 -0
  102. package/examples/application-template/index.html +12 -0
  103. package/examples/application-template/package.json +21 -0
  104. package/examples/application-template/src/app.config.ts +8 -0
  105. package/examples/application-template/src/app.ts +81 -0
  106. package/examples/application-template/src/dispatch.ts +29 -0
  107. package/examples/application-template/src/embed.ts +39 -0
  108. package/examples/application-template/src/env.d.ts +10 -0
  109. package/examples/application-template/src/host-origin.ts +9 -0
  110. package/examples/application-template/src/locale.ts +90 -0
  111. package/examples/application-template/src/styles.css +31 -0
  112. package/examples/application-template/tsconfig.json +24 -0
  113. package/examples/application-template/vite.config.mjs +16 -0
  114. package/examples/sdk-diagnostics/README.md +199 -0
  115. package/examples/sdk-diagnostics/assets/THIRD_PARTY_NOTICES.txt +567 -0
  116. package/examples/sdk-diagnostics/assets/auto-CnsixhmH.js +9 -0
  117. package/examples/sdk-diagnostics/assets/console-BjvPHSNK.css +1 -0
  118. package/examples/sdk-diagnostics/assets/console-BrwFsb65.js +9 -0
  119. package/examples/sdk-diagnostics/assets/favicon-BZQEit-G.ico +0 -0
  120. package/examples/sdk-diagnostics/assets/index-DXSJUMrS.js +2 -0
  121. package/examples/sdk-diagnostics/assets/messages-C1UCo5nT.js +1 -0
  122. package/examples/sdk-diagnostics/assets/robot-x3-D4wBvBN8.webp +0 -0
  123. package/examples/sdk-diagnostics/assets/styles-D3TrErcf.css +1 -0
  124. package/examples/sdk-diagnostics/index.html +15 -0
  125. package/host/README.md +34 -0
  126. package/package.json +80 -4
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./console-BrwFsb65.js","./messages-C1UCo5nT.js","./console-BjvPHSNK.css","./styles-D3TrErcf.css"])))=>i.map(i=>d[i]);
2
+ import{w as L,g as v,d as P}from"./messages-C1UCo5nT.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))u(e);new MutationObserver(e=>{for(const t of e)if(t.type==="childList")for(const o of t.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&u(o)}).observe(document,{childList:!0,subtree:!0});function a(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?t.credentials="include":e.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function u(e){if(e.ep)return;e.ep=!0;const t=a(e);fetch(e.href,t)}})();const S="modulepreload",O=function(n,s){return new URL(n,s).href},y={},p=function(s,a,u){let e=Promise.resolve();if(a&&a.length>0){let w=function(r){return Promise.all(r.map(l=>Promise.resolve(l).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};const o=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),h=c?.nonce||c?.getAttribute("nonce");e=w(a.map(r=>{if(r=O(r,u),r in y)return;y[r]=!0;const l=r.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(u)for(let m=o.length-1;m>=0;m--){const f=o[m];if(f.href===r&&(!l||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${d}`))return;const i=document.createElement("link");if(i.rel=l?"stylesheet":S,l||(i.as="script"),i.crossOrigin="",i.href=r,h&&i.setAttribute("nonce",h),document.head.appendChild(i),l)return new Promise((m,f)=>{i.addEventListener("load",m),i.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${r}`)))})}))}function t(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return e.then(o=>{for(const c of o||[])c.status==="rejected"&&t(c.reason);return s().catch(t)})},g=document.querySelector("#root"),E=new URLSearchParams(location.search).get("embedded")==="1",b=E?"RayX 机器人联调控制台":"RayX SDK 联调示例";function _(){const n=v();document.documentElement.lang=n,document.title=P(n,b)}_();L(_);if(E){const{mountWorkbench:n}=await p(async()=>{const{mountWorkbench:s}=await import("./console-BrwFsb65.js");return{mountWorkbench:s}},__vite__mapDeps([0,1,2]),import.meta.url);n(g)}else{await p(()=>Promise.resolve({}),__vite__mapDeps([3]),import.meta.url);const{mountAppShell:n}=await p(async()=>{const{mountAppShell:a}=await import("./auto-CnsixhmH.js");return{mountAppShell:a}},[],import.meta.url);n({container:g,appName:"RayX SDK 联调示例",appNameEn:"RayX SDK Diagnostics",appId:"direct-demo",layout:"container"})}
@@ -0,0 +1 @@
1
+ const d="microbotx.locale",a="microbotx:locale";let r="zh-CN";function g(){try{const e=localStorage.getItem(d);if(e==="zh-CN"||e==="en")return e}catch{}return r}function f(e){r=e;try{localStorage.setItem(d,e)}catch{}window.dispatchEvent(new CustomEvent(a,{detail:e}))}function v(e){const o=t=>{t instanceof CustomEvent&&(t.detail==="en"||t.detail==="zh-CN")&&(r=t.detail),e()},i=t=>{(t.key===d||t.key===null)&&e()};return window.addEventListener(a,o),window.addEventListener("storage",i),()=>{window.removeEventListener(a,o),window.removeEventListener("storage",i)}}const l={"请先通过 mountAppShell 或商店启动应用":"Launch the app through mountAppShell or the app store first.",同一应用窗口不能同时使用不同启动配置:"This app window already has a different launch configuration.",应用启动已取消:"App launch was cancelled.",应用初始化已取消:"App initialization was cancelled.","机器人直连初始化失败,请检查登录、设备和信令配置":"Couldn’t connect directly to the robot. Check sign-in, device, and signaling settings.",应用启动超时:"App launch timed out.",设备:"Device",生命周期:"Lifecycle",只读与参数校验:"Read-only and input validation","音频全流程(15 秒)":"Audio end-to-end (15 s)",停止测试音频:"Stop test audio",打断设备音频:"Interrupt device audio","模拟 WebRTC 断线":"Simulate WebRTC disconnect","dispose 与幂等清理":"Dispose and idempotent cleanup",请求外壳结束检查:"Request session exit","暂无检查结果。":"No check results yet.",SDK测试结果:"SDK test results","正在连接机器人…":"Connecting to the robot…",等待选择检查项目:"Select a check to run.",应用已结束:"Session ended",读取状态:"Read status",读取能力:"Read capabilities","头部 ToF":"Head ToF","连接机器人后可读取 ToF。":"Connect a robot to read ToF.","ToF 可用":"ToF available","ToF 不可用":"ToF unavailable","ToF 能力未上报":"ToF capability not reported","读取 ToF 能力":"Read ToF capabilities","订阅频率(Hz)":"Subscription rate (Hz)","订阅 ToF":"Subscribe to ToF","退订 ToF":"Unsubscribe from ToF","正在订阅 ToF…":"Subscribing to ToF…","正在退订 ToF…":"Unsubscribing from ToF…","等待 ToF 首帧…":"Waiting for the first ToF frame…","正在接收 ToF 帧":"Receiving ToF frames","ToF 未订阅":"ToF is not subscribed",网格尺寸:"Grid size",设备频率:"Device rate",已收帧数:"Frames received",最新帧号:"Latest sequence","最新 ToF 帧 JSON":"Latest ToF frame JSON","ToF 距离网格(mm)":"ToF distance grid (mm)","原始距离 {distance} mm,状态码 {status}":"Raw distance {distance} mm, status {status}","收到 ToF 首帧":"First ToF frame received",追光:"Light following",追光开关:"Light following switch","连接机器人后可使用追光。":"Connect a robot to use light following.",追光不可用:"Light following unavailable",追光运行中:"Light following is active",追光已关闭:"Light following is off",追光状态未确认:"Light following status unconfirmed",启动追光:"Start light following",停止追光:"Stop light following",读取追光状态:"Read light following status",刷新追光状态:"Refresh light following status","正在启动追光…":"Starting light following…","正在停止追光…":"Stopping light following…",追光前进设置:"Light following movement",使用板端前进设置:"Use robot movement settings",仅转向:"Turn only",允许前进:"Allow forward movement",打开追光预览:"Open light following preview","追光期间已暂停手动控制。退出前请先关闭追光。":"Manual controls are paused. Turn off light following before exiting.","正在读取设备数据…":"Reading device data…",读取失败:"Read failed",读取结果:"Read result",关闭:"Close",机器人联调控制台:"Robot diagnostics console",机器人概览:"Robot overview","绿色 RayX 机器人":"Green RayX robot",停止运动:"Stop motion",已连接:"Connected",等待连接:"Waiting for connection",测试机器人画面:"Test robot camera",打开摄像头:"Open camera","等待视频帧…":"Waiting for video…",关闭画面:"Close video",机器人摄像头画面:"Robot camera feed",缩小画面:"Shrink video",放大画面:"Enlarge video",连接方式:"Connection type",执行器状态:"Actuator state",最近一条设备回执:"Latest device response","等待设备回执。":"Waiting for a device response.",控制面板:"Controls",底盘移动:"Drive",姿态控制:"Posture",技能与动作:"Skills & actions",驱动与关节:"Actuators",音频测试:"Audio test","ToF 测距":"ToF ranging",移动测试:"Motion test","SDK 诊断":"SDK checks","连接机器人后可控制设备。":"Connect a robot to access device controls.","连接机器人后可测试音频。":"Connect a robot to test audio.",设备状态:"Device status",控制连接:"Control connection",坐姿:"Sitting",非坐姿:"Not sitting",遥测帧:"Telemetry frames",运行记录:"Activity log",清空日志:"Clear log",记录类型:"Log type",检查结果:"Check results",连接事件:"Connection events",实时遥测:"Live telemetry",设备回执:"Device responses","暂无连接、故障、技能或音频事件。":"No connection, fault, skill, or audio events yet.","等待设备遥测。":"Waiting for device telemetry.","RayX 机器人联调控制台":"RayX Robot Diagnostics","RayX SDK 联调示例":"RayX SDK Diagnostics","操作已受理,请重新刷新清单":"Action accepted. Refresh the list again.",清单已刷新:"List refreshed",未知:"Unknown",运动模式:"Motion mode",行走:"Walk",轮滑:"Roller",直控:"Direct","直控会退出策略平衡。请先支撑机器人。":"Direct mode disengages balance control. Support the robot first.",选择设备模式:"Choose a device mode",切换设备模式:"Change device mode","状态回读失败,请刷新":"Couldn’t read back status. Refresh to try again.",切换模式:"Change mode",可执行技能:"Available skills",选择要执行的技能:"Choose a skill to run",执行技能:"Run skill",刷新设备技能:"Refresh device skills",刷新技能:"Refresh skills",读取设备配置:"Read device configuration",读取配置:"Read configuration",复位故障:"Reset fault",设备当前不允许远程复位:"The device currently does not allow remote reset.",允许远程复位:"Remote reset allowed",设备未允许远程复位:"Remote reset unavailable",设备配置:"Device configuration",自定义动作:"Custom actions",添加动作:"Add action",上传自定义动作:"Upload custom action",添加自定义动作:"Add custom action","ONNX 文件":"ONNX file",登记名称:"Action name","保持时长(可选)":"Hold duration (optional)",取消上传:"Cancel upload",取消:"Cancel",上传动作:"Upload action",设备上的自定义动作:"Custom actions on this device",刷新后选择动作:"Refresh, then choose an action",刷新自定义动作:"Refresh custom actions",刷新列表:"Refresh list",删除动作:"Delete action",删除自定义动作:"Delete custom action","将从设备删除「{name}」。":"This will remove “{name}” from the device.",请输入有效的数值:"Enter a valid number.",头部角度:"Head angles",头部摇杆:"Head joystick",精确角度:"Precise angles",身体姿态摇杆:"Body tilt joystick",精确姿态:"Precise pose",实时移动:"Live movement",移动摇杆:"Movement joystick","上下拖动前进或后退,左右拖动同时横移和转向,松开停车。":"Drag up or down to move forward or backward. Drag left or right to strafe and turn together. Release to stop.",移动中:"Moving",设备上报的指令频率无效:"The device reported an invalid command rate.",设备拒绝了指令:"The device rejected the command.",头部回正:"Center head",设置头部角度:"Set head angles",颈部俯仰:"Neck pitch",头部俯仰:"Head pitch",头部左右转:"Head yaw",头部侧倾:"Head roll",空间注视点:"Gaze target",设置注视点:"Set gaze target","向前 x":"Forward x","向左 y":"Left y","向上 z":"Up z",注视颈部俯仰:"Gaze neck pitch",嘴部开合:"Mouth position",全开:"Fully open",闭嘴:"Close mouth",设置嘴部开合:"Set mouth position",舵机直控:"Direct servo control",读取舵机状态:"Read servo state","拖动滑块会立即移动舵机。请先支撑机器人。":"Moving a slider moves the servo immediately. Support the robot first.","切换到直控模式后可拖动滑块。":"Switch to direct mode to use the sliders.","目标角未确认,滑块直控已停用":"Target angles could not be confirmed. Live sliders disabled.","舵机未就绪,无法启用直控":"Servos are unavailable for direct control.",写入舵机目标角:"Write servo targets",舵机移动中:"Servos moving",舵机静止:"Servos idle",左髋偏航:"Left hip yaw",左髋横滚:"Left hip roll",左髋俯仰:"Left hip pitch",左膝:"Left knee",左踝:"Left ankle",头部偏航:"Head yaw",头部横滚:"Head roll",嘴部舵机:"Mouth servo",右髋偏航:"Right hip yaw",右髋横滚:"Right hip roll",右髋俯仰:"Right hip pitch",右膝:"Right knee",右踝:"Right ankle",已使能:"Enabled",未使能:"Disabled","进入 direct 并读取状态后,拖动滑块或输入要更新的绝对目标角。滑块范围为参考行程,写入前请核对。":"Switch to direct mode and read the servo state. Use the sliders or enter absolute target angles. The slider ranges are reference values. Check the targets before writing.","开合值 (0–1)":"Opening (0–1)",身体姿态:"Body pose","· 保持中":"· Holding",保持身体姿态:"Hold body pose",身体高度偏移:"Body height offset",身体侧倾:"Body roll",身体俯仰:"Body pitch",解除姿态保持:"Release pose hold",驱动与关节卸力:"Drive and joint torque","· 已锁存":"· Latched",关节初始化:"Initialize joints",启用策略驱动:"Enable policy drive",收回策略驱动:"Disable policy drive",关节卸力:"Release joint torque","关节初始化会上电并回初始位,设备可能移动。":"Initialization powers on the joints and returns them home. The device may move.","确认现场已支撑机器人?卸力会切断关节力矩,机器人可能倒下。":"Is the robot supported? Releasing joint torque can cause the robot to collapse.","卸力会切断关节力矩,恢复前需重新初始化关节。":"This cuts joint torque. Initialize the joints again before resuming.",速度指令:"Velocity command",切换策略驱动:"Change policy drive",设置身体姿态:"Set body pose",读取动作列表:"Read action list",停止音频:"Stop audio",设备请求:"Device request",设备已受理:"Accepted by device",设备未受理:"Not accepted by device",已返回结果:"Result received",定时移动:"Timed motion",阶梯加速:"Speed ramp",前进:"Forward",后退:"Backward",左移:"Move left",右移:"Move right",左转:"Turn left",右转:"Turn right","静止 →":"Stationary →",开始定时移动:"Start timed motion",开始阶梯测试:"Start ramp test","等候站立遥测…":"Waiting for standing telemetry…","已观测到行走步态,继续续发速度指令…":"Walking detected. Continuing to send velocity commands…","已观测到行走步态,正在请求停车…":"Walking detected. Requesting a stop…",首次观测到行走步态:"Walking detected for the first time","达到设备运动时限,已请求停车":"Device motion time limit reached. Stop requested","已到总时限,未观测到行走步态":"Time limit reached. No walking detected","定时移动结束,已请求停车":"Timed motion ended. Stop requested","本轮结束,未观测到行走步态":"Test ended. No walking detected",测试已取消:"Test cancelled","本轮未观测到行走步态。":"No walking was detected during this test.",移动调试:"Motion diagnostics",运动参数:"Motion settings",测试方式:"Test mode",移动方向预设:"Motion direction presets","前后速度(+前)":"Longitudinal speed (+ forward)",起始速度:"Start speed","横移速度(+左)":"Lateral speed (+ left)","转向速度(+左)":"Turn speed (+ left)",速度步长:"Speed increment",最高速度:"Top speed",移动时长:"Motion duration",每档时长:"Stage duration",总时限:"Time limit",前进测试计划:"Motion test plan","前进时长须在 0.05~20 秒之间,精确到毫秒":"Motion duration must be 0.05–20 seconds, to the nearest millisecond.","每档时长须在 0.05~20 秒之间,精确到毫秒":"Stage duration must be 0.05–20 seconds, to the nearest millisecond.","前后和横向速度须在 −0.6~0.6 m/s 之间":"Longitudinal and lateral speeds must be between −0.6 and 0.6 m/s.","转向速度须在 −1.5~1.5 rad/s 之间":"Turn speed must be between −1.5 and 1.5 rad/s.",至少设置一个非零速度:"Set at least one nonzero speed.",未知的前进测试方式:"Unknown motion test mode.","起始速度须在 0~0.6 m/s 之间":"Start speed must be between 0 and 0.6 m/s.","总时限须在 0.05~20 秒之间,精确到毫秒":"The time limit must be 0.05–20 seconds, to the nearest millisecond.","最高速度须大于 0、不低于起始速度且不超过 0.6 m/s":"Top speed must be above 0, at least the start speed, and no more than 0.6 m/s.","递增步长须在 0.001~0.6 m/s 之间":"The speed increment must be between 0.001 and 0.6 m/s.",设备上报的运动时限无效:"The device reported an invalid motion time limit.",手动取消:"Cancelled manually",手动停车:"Stopped manually",前进测试正在进行:"A motion test is already running.",设备尚未连接:"The device is disconnected.",无法向原连接请求停车:"Couldn’t request a stop on the original connection.","应用离场,SDK 接管停车":"App exiting. The SDK handles stopping.","设备连接发生变化,测试已中断":"The device connection changed. The test was interrupted.",软件急停已锁存:"Software emergency stop is latched.",请先解除身体姿态保持:"Release body pose hold first.",请先切换到行走或轮滑模式:"Switch to walk or roller mode first.",设备的指令频率或遥测频率无法支持本次运动测试:"The device command or telemetry rate cannot support this motion test.",每档时长短于设备允许的发令间隔:"The stage duration is shorter than the device’s command interval.",未收到新的站立遥测:"No new standing telemetry received.",运动遥测超时:"Motion telemetry timed out.",设备正在保持身体姿态:"The device is holding a body pose.",设备未就绪:"The device is not ready.",设备连接或遥测已中断:"Connection or telemetry was interrupted.",运动保活超时:"Motion keepalive timed out.","{label}滑块":"{label} slider","{seconds} 秒":"{seconds} s","{speeds} m/s · {count} 档 · 总时限 {duration}":"{speeds} m/s · {count} stages · Time limit {duration}","正在续发速度指令({motion})…":"Continuing to send velocity commands ({motion})…","指令速度 {speed} m/s,本档从第 {elapsed}开始。":"Commanded speed {speed} m/s. This stage started at {elapsed}.",",本档 {duration}":", stage {duration}",",上报速度 {speed}":", reported speed {speed}",",上报前向速度 {speed} m/s":", reported forward speed {speed} m/s","首次观测到行走步态用时 {duration}。":" Walking was first detected after {duration}.","{outcome}。指令速度 {speed},累计 {total}{timing}{applied}。{walk}":"{outcome}. Commanded speed {speed}, total {total}{timing}{applied}. {walk}","35 秒内未收到可显示的视频帧":"No displayable video frame arrived within 35 seconds.","尚未执行;若页面提前卸载且记录未更新,该项即未执行。":"This check has not run. If the page is unloaded before the record changes, it did not run.","已开始执行,尚未得到结果;若页面提前卸载,该项结果未确认。":"Started. If the page unloads before a result arrives, the outcome is unconfirmed.","请求意外成功,应当拒绝":"The request unexpectedly succeeded. It should have been rejected.",已结束:"Ended",页面已隐藏:"Page hidden",页面已退出:"Page exited","bindRobotVideo 首帧":"bindRobotVideo first frame","detach 关闭画面":"detach closed video",测试环境:"Test environment","SDK 状态上报已收到":"SDK status report received","状态已提交外壳;外壳接收须单独核对":"Status submitted to the host. Verify receipt separately.","move 非有限参数":"move with non-finite input","doSkill 空技能名":"doSkill with an empty skill name","request 未开放方法":"request with an unavailable method","request 非法参数":"request with invalid input","getStatus 预取消":"getStatus with a pre-aborted signal","getStatus 取消等待":"getStatus cancelled while waiting","getStatus 1ms 超时观察":"getStatus 1 ms timeout observation","getStatus 超时/取消后恢复":"getStatus after timeout or cancellation","onTelemetry 接收与退订":"onTelemetry delivery and unsubscribe",读取上下文与坐姿:"Read context and sitting state",机器人连接已释放:"Robot connection released",未确认:"Unconfirmed",音频验收范围:"Audio check scope","本组验证本地 PCM 排程及 WebRTC 发送;需要上位机 ALSA 日志和现场听音才能确认硬件发声":"Checks local PCM scheduling and WebRTC sending. Confirm hardware playback on site and in the controller’s ALSA logs.","writeAudio 未打开输出":"writeAudio without open audio output","openAudioOutput 预取消":"openAudioOutput with a pre-aborted signal","writeAudio 空 PCM":"writeAudio with empty PCM","writeAudio 超长 PCM":"writeAudio with oversized PCM","writeAudio 非有限 PCM":"writeAudio with non-finite PCM","writeAudio 超幅 PCM":"writeAudio with out-of-range PCM samples","setAudioVolume 非有限参数":"setAudioVolume with non-finite input","setAudioVolume 裁剪到 0~1":"setAudioVolume clamped to 0–1","writeAudio 排入三块":"writeAudio queues three blocks","drainAudioOutput 清空后":"drainAudioOutput after draining","已发起释放,不代表设备缓冲已静音":"Release requested. Device buffers may still play audio.","writeAudio 关闭后拒绝":"writeAudio rejected after closing","openAudioOutput 重新打开":"Reopen with openAudioOutput","音频 RTP 初始统计":"Initial audio RTP statistics","writeAudio 连续 15 秒":"writeAudio for 15 continuous seconds","drainAudioOutput 播放排程结束":"drainAudioOutput after playback scheduling ends","音频 RTP 发送统计":"Audio RTP send statistics","writeAudio 生命周期取消后":"writeAudio after lifecycle cancellation","closeAudioOutput 幂等清理":"closeAudioOutput idempotent cleanup",手动关闭音频:"Manually close audio","停止本页排程并释放音轨;不保证设备缓冲已清空":"Stops local scheduling and releases the track. Device buffers may still have audio.",设备音频打断回执:"Device audio interrupt response","当前无 WebRTC 连接":"No active WebRTC connection.","主动关闭 WebRTC":"Close WebRTC explicitly","断线后 getStatus 拒绝":"getStatus rejected after disconnect","断线后 move 拒绝":"move rejected after disconnect",断线后不自动重连:"No automatic reconnect after disconnect",重新连接操作:"Reconnection","断线后的请求意外成功,应当拒绝":"The request unexpectedly succeeded after disconnect. It should have been rejected.","主动关闭 WebRTC 后上下文":"Context after explicitly closing WebRTC","测试主动关闭 WebRTC":"Test explicit WebRTC close","即将调用 close,完成状态以后续事件和记录为准":"About to call close. Check subsequent events and records for completion.","close 已提交;异步关闭状态以后续事件为准":"close requested. Follow subsequent events for the asynchronous result.","1.5 秒后不自动重连的观察保留未执行,由外壳和上位机日志另验;手动重新连接后由新实例重新执行只读检查确认恢复":"The 1.5-second observation for no automatic reconnect was not run. Check the host and controller logs, then reconnect manually and rerun read-only checks in the new instance.","dispose 第一次":"First dispose call","dispose 重复调用":"Repeated dispose call","dispose 后 getStatus":"getStatus after dispose","dispose 后事件订阅":"Event subscription after dispose","dispose 后上下文":"Context after dispose","已请求外壳协调结束,外层退出结果需单独核对":"Exit requested. Verify separately that the host completed the exit."},p=[[/^正在检查:(.+)$/,"Running check: $1"],[/^检查记录未能保存:(.+)$/s,"Couldn’t save check records: $1"],[/^未得到预期错误 (.+?):(.+)$/s,"Expected error $1 was not received: $2"],[/^退订验证不通过:(.+)$/,"Unsubscribe check failed: $1"],[/^清空排程后仍等待 (.+)ms$/,"Still waiting after draining the audio queue: $1 ms"],[/^正在发送低音量音调:(.+)\/15 秒$/,"Sending a low-volume tone: $1/15 s"],[/^未观察到音频 RTP 增长:(.+)$/s,"No increase in audio RTP traffic observed: $1"],[/^资源未完成清理:(.+)$/,"Resource cleanup is incomplete: $1"],[/^执行技能 (.+)$/,"Run skill $1"],[/^设备拒绝:(.+)$/s,"Device rejected the request: $1"],[/^回执未确认:(.+)$/s,"Device response unconfirmed: $1"],[/^执行器未就绪:(.+)$/,"Actuator not ready: $1"],[/^请在设备静止站立后开始测试,当前策略:(.+)$/,"Start after the device is standing still. Current policy: $1"],[/^设备离开站立策略:(.+)$/,"The device left its standing policy: $1"],[/^测试结束((.+) m\/s),停车受理未确认:(.+)$/s,"Test ended ($1 m/s). Stop acceptance unconfirmed: $2"],[/^(.+);与原设备断开,停车受理未确认$/s,"$1. Disconnected from the original device. Stop acceptance unconfirmed."]];function h(e,o,i){let t=o;if(e==="en")if(Object.hasOwn(l,o))t=l[o];else for(const[n,s]of p){const c=n.exec(o);if(c){t=s.replace(/\$(\d)/g,(m,u)=>h(e,c[Number(u)]??""));break}}return i?t.replace(/\{(\w+)\}/g,(n,s)=>String(i[s]??n)):t}export{h as d,g,f as s,v as w};
@@ -0,0 +1 @@
1
+ body{margin:0;background:#f7f8f2;color:#263029;font:16px/1.6 system-ui,sans-serif}#root{height:100dvh}
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <link rel="icon" type="image/x-icon" href="./assets/favicon-BZQEit-G.ico" />
7
+ <title>RayX SDK 联调示例</title>
8
+ <script type="module" crossorigin src="./assets/index-DXSJUMrS.js"></script>
9
+ <link rel="modulepreload" crossorigin href="./assets/messages-C1UCo5nT.js">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+
14
+ </body>
15
+ </html>
package/host/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # 应用外壳与启动交接
2
+
3
+ 本目录提供单应用启动界面、内部控制器与可信启动协议,随 SDK 构建。用户选定设备后,外壳关闭发现连接,临时直连机器人检查准备状态。设备就绪并确认准备连接已释放后,外壳打开业务 iframe,由业务 SDK 建立自己的连接,收发动作和媒体。公开的 `mountAppShell` 自带 RayX React 界面、样式和图片,应用无需注入渲染器。UI 依赖只进入可选的 `/host/auto` 构建,根 SDK 和业务连接入口保持无 UI。
4
+
5
+ | 包内类型声明 | 公开入口 |
6
+ | --- | --- |
7
+ | [auto.d.ts](../dist/host/src/entry/auto.d.ts) | `/host/auto` 的 mountAppShell:内置 UI 与启动控制 |
8
+ | [dev.d.ts](../dist/host/src/dev.d.ts) | `/host/dev` 的 createHostProxy:认证、设备管理与信令开发网关 |
9
+ | [app.d.ts](../dist/host/src/entry/app.d.ts) | `/host/app` 的 connectAppRobot |
10
+ | [host.d.ts](../dist/host/src/bootstrap/host.d.ts) | `/host/bootstrap` 的 createAppSession |
11
+ | [启动协议](../docs/HOST_PROTOCOL.md) | 启动消息与生命周期约定 |
12
+
13
+ 新建业务复制 [应用开发模板](../examples/application-template/README.md),检查 SDK 行为使用 [SDK 联调示例](../examples/sdk-diagnostics/README.md)。两种启动入口使用同一业务连接实现;启动端口只交接授权和生命周期,设备 RPC、遥测和音频由业务 SDK 的 WebRTC 发送或接收。认证与信令网关、语音 relay 仍由对应网络服务提供。
14
+
15
+ 本目录无单独构建流程,执行 SDK 根目录的 npm test / npm run build。完整说明见 [双入口指南](../docs/DIRECT_APPS.md) 与 [Host 接入](../docs/HOST_HANDOFF.md)。
16
+
17
+ ## 外壳与业务布局
18
+
19
+ `mountAppShell({ appName })` 默认使用 `layout: 'viewport'`:外壳在 body 下的独立层中铺满视口,并暂时锁定页面滚动。传入的 `container`(默认 body)作为被接管的目标,启动占位由 SDK 清除;其 Grid、Flex、padding、max-width、transform 和裁剪不会约束全屏外壳。外壳内部继续使用 Shadow DOM,业务 UI 在另一个 iframe 内自行布局。
20
+
21
+ 需要将外壳放进页面的一块区域时,显式调用 `mountAppShell({ appName, container: panel, layout: 'container' })`,并给 panel 设置明确高度。此模式保留父页面滚动,外壳尺寸按容器内容区计算。登录内容在小尺寸区域内滚动,避免挤压输入框。一个页面同一时刻仅允许一个全屏外壳,已占用的容器及其祖先、后代不能重复挂载。
22
+
23
+ 等待 `dispose()` 成功后,SDK 移除挂载层,恢复其修改的滚动属性;原容器仍为空时恢复先前 DOM,若业务已重新填入内容则保留业务的新内容。视图初始化失败同样释放布局资源。布局模式不改变认证、启动授权或唯一机器人连接的交接顺序。
24
+
25
+ 外壳默认显示简体中文,顶栏可切换为英文。语言偏好按站点保存,同源业务 iframe 可读取 `localStorage` 中的 `microbotx.locale` 并监听 `storage` 事件。通过 `mountAppShell({ appName, appNameEn })` 可为英文界面提供应用名称,`appId` 仍使用同一个值。
26
+
27
+ ## 界面来源
28
+
29
+ - 基础组件复用私有仓库的 RayX 官网组件,并按 SDK 外壳状态与交互做了适配。
30
+ - 登录布局来自提供的 login-page-10 模板,改为静态背景及 RayX 认证流程。
31
+ - 品牌图标沿用 SDK 文档资源,机器人图片来自 RayX 官网,登录背景为本项目生成。
32
+ - 设备选择与会话顶栏由 SDK 外壳提供,连接、认证与设备协议使用 RayX 的实现。
33
+
34
+ 第三方组件保留原许可,详见包内 [NOTICE](../NOTICE) 和 `dist/THIRD_PARTY_NOTICES.txt`。私有仓库中的详细修改记录由维护者保存。
package/package.json CHANGED
@@ -1,6 +1,82 @@
1
1
  {
2
2
  "name": "@raydiculousx/ts-sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "description": "Browser SDK for controlling RayX robots over WebRTC, with an optional login and device picker shell",
6
+ "license": "Apache-2.0",
7
+ "author": "RaydiculousX contributors",
8
+ "keywords": [
9
+ "RaydiculousX",
10
+ "robot",
11
+ "robotics",
12
+ "webrtc",
13
+ "sdk",
14
+ "browser",
15
+ "typescript"
16
+ ],
17
+ "publishConfig": {
18
+ "access": "public",
19
+ "registry": "https://registry.npmjs.org/",
20
+ "tag": "latest"
21
+ },
22
+ "main": "./dist/raydiculousx-sdk.js",
23
+ "types": "./dist/raydiculousx-sdk.d.ts",
24
+ "exports": {
25
+ "./host/dev": {
26
+ "types": "./dist/host/src/dev.d.ts",
27
+ "import": "./dist/host/src/dev.js"
28
+ },
29
+ "./core": {
30
+ "types": "./dist/lib/core/index.d.ts",
31
+ "import": "./dist/lib/core/index.js"
32
+ },
33
+ "./host/app": {
34
+ "types": "./dist/host/src/entry/app.d.ts",
35
+ "import": "./dist/host/src/entry/app.js"
36
+ },
37
+ "./host/auto": {
38
+ "types": "./dist/host/src/entry/auto.d.ts",
39
+ "import": "./dist/host/src/entry/auto.js"
40
+ },
41
+ "./host/bootstrap": {
42
+ "types": "./dist/host/src/bootstrap/host.d.ts",
43
+ "import": "./dist/host/src/bootstrap/host.js"
44
+ },
45
+ ".": {
46
+ "types": "./dist/raydiculousx-sdk.d.ts",
47
+ "import": "./dist/raydiculousx-sdk.js"
48
+ },
49
+ "./package.json": "./package.json",
50
+ "./media": {
51
+ "types": "./dist/lib/media/index.d.ts",
52
+ "import": "./dist/lib/media/index.js"
53
+ }
54
+ },
55
+ "files": [
56
+ "dist",
57
+ "NOTICE",
58
+ "CHANGELOG.md",
59
+ "docs/API.md",
60
+ "docs/DIRECT_APPS.md",
61
+ "docs/HOST_HANDOFF.md",
62
+ "docs/HOST_PROTOCOL.md",
63
+ "docs/RELEASING.md",
64
+ "docs/assets/raydiculousx-mark.png",
65
+ "host/README.md",
66
+ "examples/README.md",
67
+ "examples/sdk-diagnostics/README.md",
68
+ "examples/sdk-diagnostics/index.html",
69
+ "examples/sdk-diagnostics/assets",
70
+ "examples/application-template/README.md",
71
+ "examples/application-template/package.json",
72
+ "examples/application-template/index.html",
73
+ "examples/application-template/tsconfig.json",
74
+ "examples/application-template/vite.config.mjs",
75
+ "examples/application-template/src"
76
+ ],
77
+ "sideEffects": false,
78
+ "engines": {
79
+ "node": ">=22.18.0"
80
+ },
81
+ "homepage": "https://app.unpkg.com/@raydiculousx/ts-sdk@1.0.0/files/README.md"
82
+ }