agenticros 0.0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +192 -0
- package/README.md +90 -4
- package/dist/commands/config.d.ts +20 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +179 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/doctor.d.ts +33 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +232 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/down.d.ts +15 -0
- package/dist/commands/down.d.ts.map +1 -0
- package/dist/commands/down.js +91 -0
- package/dist/commands/down.js.map +1 -0
- package/dist/commands/init.d.ts +21 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +259 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/logs.d.ts +18 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +67 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/status.d.ts +12 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +56 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/up.d.ts +20 -0
- package/dist/commands/up.d.ts.map +1 -0
- package/dist/commands/up.js +70 -0
- package/dist/commands/up.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +107 -0
- package/dist/index.js.map +1 -0
- package/dist/menu.d.ts +9 -0
- package/dist/menu.d.ts.map +1 -0
- package/dist/menu.js +96 -0
- package/dist/menu.js.map +1 -0
- package/dist/runners/real-robot.d.ts +15 -0
- package/dist/runners/real-robot.d.ts.map +1 -0
- package/dist/runners/real-robot.js +46 -0
- package/dist/runners/real-robot.js.map +1 -0
- package/dist/runners/sim.d.ts +19 -0
- package/dist/runners/sim.d.ts.map +1 -0
- package/dist/runners/sim.js +53 -0
- package/dist/runners/sim.js.map +1 -0
- package/dist/util/env.d.ts +24 -0
- package/dist/util/env.d.ts.map +1 -0
- package/dist/util/env.js +53 -0
- package/dist/util/env.js.map +1 -0
- package/dist/util/logger.d.ts +24 -0
- package/dist/util/logger.d.ts.map +1 -0
- package/dist/util/logger.js +62 -0
- package/dist/util/logger.js.map +1 -0
- package/dist/util/paths.d.ts +57 -0
- package/dist/util/paths.d.ts.map +1 -0
- package/dist/util/paths.js +132 -0
- package/dist/util/paths.js.map +1 -0
- package/dist/util/pidfile.d.ts +16 -0
- package/dist/util/pidfile.d.ts.map +1 -0
- package/dist/util/pidfile.js +63 -0
- package/dist/util/pidfile.js.map +1 -0
- package/dist/util/state.d.ts +26 -0
- package/dist/util/state.d.ts.map +1 -0
- package/dist/util/state.js +55 -0
- package/dist/util/state.js.map +1 -0
- package/package.json +60 -1
- package/runtime/BUNDLE.json +11 -0
- package/runtime/LICENSE +192 -0
- package/runtime/README.md +273 -0
- package/runtime/docs/architecture.md +366 -0
- package/runtime/docs/cli.md +140 -0
- package/runtime/docs/memory.md +292 -0
- package/runtime/docs/robot-setup.md +347 -0
- package/runtime/package.json +28 -0
- package/runtime/packages/agenticros/agenticros-agenticros-0.0.1.tgz +0 -0
- package/runtime/packages/agenticros/openclaw.plugin.json +451 -0
- package/runtime/packages/agenticros/package.json +41 -0
- package/runtime/packages/agenticros/src/camera-snapshot-cache.ts +59 -0
- package/runtime/packages/agenticros/src/camera-snapshot-routes.ts +44 -0
- package/runtime/packages/agenticros/src/commands/estop.ts +41 -0
- package/runtime/packages/agenticros/src/commands/transport.ts +195 -0
- package/runtime/packages/agenticros/src/config-file.ts +136 -0
- package/runtime/packages/agenticros/src/config-page.ts +498 -0
- package/runtime/packages/agenticros/src/context/robot-context.ts +373 -0
- package/runtime/packages/agenticros/src/depth.ts +313 -0
- package/runtime/packages/agenticros/src/describer.ts +157 -0
- package/runtime/packages/agenticros/src/image-binary-trim.ts +16 -0
- package/runtime/packages/agenticros/src/index.ts +85 -0
- package/runtime/packages/agenticros/src/landing-page.ts +38 -0
- package/runtime/packages/agenticros/src/memory.ts +44 -0
- package/runtime/packages/agenticros/src/plugin-api.ts +173 -0
- package/runtime/packages/agenticros/src/plugin-image-base64.ts +69 -0
- package/runtime/packages/agenticros/src/preflight.ts +110 -0
- package/runtime/packages/agenticros/src/routes.ts +328 -0
- package/runtime/packages/agenticros/src/safety/validator.ts +43 -0
- package/runtime/packages/agenticros/src/service.ts +359 -0
- package/runtime/packages/agenticros/src/skill-api.ts +65 -0
- package/runtime/packages/agenticros/src/skill-loader.ts +146 -0
- package/runtime/packages/agenticros/src/teleop/page.ts +498 -0
- package/runtime/packages/agenticros/src/teleop/routes.ts +650 -0
- package/runtime/packages/agenticros/src/tools/index.ts +26 -0
- package/runtime/packages/agenticros/src/tools/ros2-action.ts +50 -0
- package/runtime/packages/agenticros/src/tools/ros2-camera.ts +221 -0
- package/runtime/packages/agenticros/src/tools/ros2-depth-distance.ts +58 -0
- package/runtime/packages/agenticros/src/tools/ros2-introspect.ts +62 -0
- package/runtime/packages/agenticros/src/tools/ros2-memory.ts +158 -0
- package/runtime/packages/agenticros/src/tools/ros2-param.ts +87 -0
- package/runtime/packages/agenticros/src/tools/ros2-publish.ts +52 -0
- package/runtime/packages/agenticros/src/tools/ros2-service.ts +46 -0
- package/runtime/packages/agenticros/src/tools/ros2-subscribe.ts +71 -0
- package/runtime/packages/agenticros/tsconfig.json +9 -0
- package/runtime/packages/agenticros-claude-code/README.md +260 -0
- package/runtime/packages/agenticros-claude-code/config.example.json +9 -0
- package/runtime/packages/agenticros-claude-code/dist/config.d.ts +8 -0
- package/runtime/packages/agenticros-claude-code/dist/config.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/config.js +93 -0
- package/runtime/packages/agenticros-claude-code/dist/config.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/depth.d.ts +20 -0
- package/runtime/packages/agenticros-claude-code/dist/depth.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/depth.js +126 -0
- package/runtime/packages/agenticros-claude-code/dist/depth.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.d.ts +6 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.js +36 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.d.ts +33 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.js +134 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.d.ts +43 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.js +73 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.d.ts +58 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.js +251 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.d.ts +61 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.js +268 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/index.d.ts +3 -0
- package/runtime/packages/agenticros-claude-code/dist/index.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/index.js +111 -0
- package/runtime/packages/agenticros-claude-code/dist/index.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/memory.d.ts +17 -0
- package/runtime/packages/agenticros-claude-code/dist/memory.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/memory.js +44 -0
- package/runtime/packages/agenticros-claude-code/dist/memory.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/safety.d.ts +10 -0
- package/runtime/packages/agenticros-claude-code/dist/safety.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/safety.js +34 -0
- package/runtime/packages/agenticros-claude-code/dist/safety.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/tools.d.ts +36 -0
- package/runtime/packages/agenticros-claude-code/dist/tools.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/tools.js +777 -0
- package/runtime/packages/agenticros-claude-code/dist/tools.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/transport.d.ts +17 -0
- package/runtime/packages/agenticros-claude-code/dist/transport.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/transport.js +46 -0
- package/runtime/packages/agenticros-claude-code/dist/transport.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.d.ts +42 -0
- package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.js +114 -0
- package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/package.json +29 -0
- package/runtime/packages/agenticros-claude-code/src/config.ts +96 -0
- package/runtime/packages/agenticros-claude-code/src/depth.ts +173 -0
- package/runtime/packages/agenticros-claude-code/src/find-object/coco-classes.ts +38 -0
- package/runtime/packages/agenticros-claude-code/src/find-object/find-object.ts +190 -0
- package/runtime/packages/agenticros-claude-code/src/follow-me/controller.ts +109 -0
- package/runtime/packages/agenticros-claude-code/src/follow-me/depth-loop.ts +420 -0
- package/runtime/packages/agenticros-claude-code/src/follow-me/detector.ts +303 -0
- package/runtime/packages/agenticros-claude-code/src/follow-me/loop.ts +330 -0
- package/runtime/packages/agenticros-claude-code/src/index.ts +125 -0
- package/runtime/packages/agenticros-claude-code/src/memory.ts +51 -0
- package/runtime/packages/agenticros-claude-code/src/safety.ts +44 -0
- package/runtime/packages/agenticros-claude-code/src/tools.ts +891 -0
- package/runtime/packages/agenticros-claude-code/src/transport.ts +58 -0
- package/runtime/packages/agenticros-claude-code/src/zero-shot/detector.ts +169 -0
- package/runtime/packages/agenticros-claude-code/tsconfig.json +9 -0
- package/runtime/packages/agenticros-claude-code/yolo-debug.mjs +106 -0
- package/runtime/packages/agenticros-gemini/README.md +139 -0
- package/runtime/packages/agenticros-gemini/package.json +28 -0
- package/runtime/packages/agenticros-gemini/scripts/smoke-api.mjs +42 -0
- package/runtime/packages/agenticros-gemini/src/chat.ts +139 -0
- package/runtime/packages/agenticros-gemini/src/config.ts +92 -0
- package/runtime/packages/agenticros-gemini/src/depth.ts +173 -0
- package/runtime/packages/agenticros-gemini/src/index.ts +58 -0
- package/runtime/packages/agenticros-gemini/src/memory.ts +32 -0
- package/runtime/packages/agenticros-gemini/src/safety.ts +44 -0
- package/runtime/packages/agenticros-gemini/src/tools.ts +516 -0
- package/runtime/packages/agenticros-gemini/src/transport.ts +58 -0
- package/runtime/packages/agenticros-gemini/tsconfig.json +8 -0
- package/runtime/packages/core/package.json +47 -0
- package/runtime/packages/core/src/banner.ts +32 -0
- package/runtime/packages/core/src/cmd-vel-twist.ts +31 -0
- package/runtime/packages/core/src/config.ts +279 -0
- package/runtime/packages/core/src/index.ts +54 -0
- package/runtime/packages/core/src/memory/__tests__/factory.test.ts +70 -0
- package/runtime/packages/core/src/memory/__tests__/local-provider.test.ts +195 -0
- package/runtime/packages/core/src/memory/__tests__/mem0-provider.test.ts +192 -0
- package/runtime/packages/core/src/memory/__tests__/smart-defaults.test.ts +46 -0
- package/runtime/packages/core/src/memory/factory.ts +63 -0
- package/runtime/packages/core/src/memory/index.ts +10 -0
- package/runtime/packages/core/src/memory/local/provider.ts +229 -0
- package/runtime/packages/core/src/memory/mem0/provider.ts +379 -0
- package/runtime/packages/core/src/memory/types.ts +96 -0
- package/runtime/packages/core/src/topic-utils.ts +95 -0
- package/runtime/packages/core/src/transport/factory.ts +47 -0
- package/runtime/packages/core/src/transport/local/conversion.ts +333 -0
- package/runtime/packages/core/src/transport/local/entities.ts +129 -0
- package/runtime/packages/core/src/transport/local/transport.ts +406 -0
- package/runtime/packages/core/src/transport/rosbridge/actions.ts +81 -0
- package/runtime/packages/core/src/transport/rosbridge/adapter.ts +157 -0
- package/runtime/packages/core/src/transport/rosbridge/client.ts +438 -0
- package/runtime/packages/core/src/transport/rosbridge/services.ts +41 -0
- package/runtime/packages/core/src/transport/rosbridge/topics.ts +60 -0
- package/runtime/packages/core/src/transport/rosbridge/types.ts +118 -0
- package/runtime/packages/core/src/transport/transport.ts +77 -0
- package/runtime/packages/core/src/transport/types.ts +137 -0
- package/runtime/packages/core/src/transport/webrtc/signaling-client.ts +196 -0
- package/runtime/packages/core/src/transport/webrtc/signaling-types.ts +130 -0
- package/runtime/packages/core/src/transport/webrtc/transport.ts +516 -0
- package/runtime/packages/core/src/transport/zenoh/adapter.ts +357 -0
- package/runtime/packages/core/src/transport/zenoh/cdr.ts +183 -0
- package/runtime/packages/core/src/transport/zenoh/keys.ts +51 -0
- package/runtime/packages/core/tsconfig.json +9 -0
- package/runtime/packages/ros-camera/package.json +30 -0
- package/runtime/packages/ros-camera/src/index.ts +13 -0
- package/runtime/packages/ros-camera/src/snapshot.ts +372 -0
- package/runtime/packages/ros-camera/tsconfig.json +9 -0
- package/runtime/pnpm-lock.yaml +5260 -0
- package/runtime/pnpm-workspace.yaml +2 -0
- package/runtime/ros2_ws/src/agenticros_agent/agenticros_agent/__init__.py +0 -0
- package/runtime/ros2_ws/src/agenticros_agent/agenticros_agent/agent_node.py +561 -0
- package/runtime/ros2_ws/src/agenticros_agent/package.xml +25 -0
- package/runtime/ros2_ws/src/agenticros_agent/resource/agenticros_agent +0 -0
- package/runtime/ros2_ws/src/agenticros_agent/setup.cfg +4 -0
- package/runtime/ros2_ws/src/agenticros_agent/setup.py +25 -0
- package/runtime/ros2_ws/src/agenticros_bringup/README.md +128 -0
- package/runtime/ros2_ws/src/agenticros_bringup/agenticros_bringup/__init__.py +1 -0
- package/runtime/ros2_ws/src/agenticros_bringup/agenticros_bringup/cmd_vel_relay.py +33 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/cmd_vel_bridge.launch.py +58 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/gazebo_turtlebot3.launch.py +69 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/mode_a_gazebo.launch.py +55 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/mode_a_gazebo_rviz.launch.py +48 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/realsense_rosbridge.launch.py +154 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/rosbridge_gazebo.launch.py +54 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/rviz.launch.py +38 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/turtlebot3_gazebo_rviz.launch.py +42 -0
- package/runtime/ros2_ws/src/agenticros_bringup/package.xml +24 -0
- package/runtime/ros2_ws/src/agenticros_bringup/resource/agenticros_bringup +0 -0
- package/runtime/ros2_ws/src/agenticros_bringup/rviz/turtlebot3_agenticros.rviz +174 -0
- package/runtime/ros2_ws/src/agenticros_bringup/setup.cfg +4 -0
- package/runtime/ros2_ws/src/agenticros_bringup/setup.py +28 -0
- package/runtime/ros2_ws/src/agenticros_discovery/agenticros_discovery/__init__.py +0 -0
- package/runtime/ros2_ws/src/agenticros_discovery/agenticros_discovery/discovery_node.py +172 -0
- package/runtime/ros2_ws/src/agenticros_discovery/package.xml +22 -0
- package/runtime/ros2_ws/src/agenticros_discovery/resource/agenticros_discovery +0 -0
- package/runtime/ros2_ws/src/agenticros_discovery/setup.cfg +5 -0
- package/runtime/ros2_ws/src/agenticros_discovery/setup.py +25 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/README.md +66 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/__init__.py +1 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/__main__.py +5 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/follow_me_node.py +278 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/follower_controller.py +631 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/person_tracker.py +635 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/package.xml +22 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/resource/agenticros_follow_me +0 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/setup.py +25 -0
- package/runtime/ros2_ws/src/agenticros_msgs/CMakeLists.txt +26 -0
- package/runtime/ros2_ws/src/agenticros_msgs/msg/CapabilityManifest.msg +9 -0
- package/runtime/ros2_ws/src/agenticros_msgs/package.xml +22 -0
- package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeGetStatus.srv +11 -0
- package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeSetDistance.srv +4 -0
- package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeSetTarget.srv +6 -0
- package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeStart.srv +5 -0
- package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeStop.srv +3 -0
- package/runtime/ros2_ws/src/agenticros_msgs/srv/GetCapabilities.srv +5 -0
- package/runtime/ros2_ws/src/agenticros_sim/CMakeLists.txt +24 -0
- package/runtime/ros2_ws/src/agenticros_sim/README.md +120 -0
- package/runtime/ros2_ws/src/agenticros_sim/config/agenticros-sim.config.json +28 -0
- package/runtime/ros2_ws/src/agenticros_sim/config/amr_bridge.yaml +111 -0
- package/runtime/ros2_ws/src/agenticros_sim/config/amr_view.rviz +172 -0
- package/runtime/ros2_ws/src/agenticros_sim/env-hooks/gz_resource_path.dsv.in +3 -0
- package/runtime/ros2_ws/src/agenticros_sim/env-hooks/gz_resource_path.sh.in +7 -0
- package/runtime/ros2_ws/src/agenticros_sim/launch/sim_amr.launch.py +159 -0
- package/runtime/ros2_ws/src/agenticros_sim/models/agenticros_amr/model.config +17 -0
- package/runtime/ros2_ws/src/agenticros_sim/models/agenticros_amr/model.sdf +244 -0
- package/runtime/ros2_ws/src/agenticros_sim/package.xml +27 -0
- package/runtime/ros2_ws/src/agenticros_sim/worlds/agenticros_indoor.sdf +183 -0
- package/runtime/scripts/activate_workspace.sh +285 -0
- package/runtime/scripts/agenticros-describer.policy.yaml +96 -0
- package/runtime/scripts/agenticros-proxy.cjs +99 -0
- package/runtime/scripts/agenticros-rosbridge.policy.yaml +62 -0
- package/runtime/scripts/check-cli-tarball-size.mjs +42 -0
- package/runtime/scripts/configure_agenticros.sh +200 -0
- package/runtime/scripts/configure_for_sim.sh +64 -0
- package/runtime/scripts/fix-openclaw-control-ui-path.sh +20 -0
- package/runtime/scripts/install_cli.sh +94 -0
- package/runtime/scripts/install_rosbridge_from_source.sh +67 -0
- package/runtime/scripts/lib/agenticros-banner.sh +28 -0
- package/runtime/scripts/onboard_robot.sh +75 -0
- package/runtime/scripts/openai.policy.yaml +77 -0
- package/runtime/scripts/openclaw-dashboard-url.cjs +49 -0
- package/runtime/scripts/pack-runtime.mjs +245 -0
- package/runtime/scripts/run_demo_native.sh +43 -0
- package/runtime/scripts/run_nemoclaw_host_stack.sh +91 -0
- package/runtime/scripts/run_robot_rosbridge.sh +36 -0
- package/runtime/scripts/sandbox_rosbridge_relay.py +137 -0
- package/runtime/scripts/setup-openclaw-local.cjs +75 -0
- package/runtime/scripts/setup_gateway_plugin.sh +329 -0
- package/runtime/scripts/setup_robot.sh +113 -0
- package/runtime/scripts/setup_workspace.sh +484 -0
- package/runtime/scripts/sim/run_sim.sh +146 -0
- package/runtime/scripts/smoke_test_nemoclaw.sh +123 -0
- package/runtime/scripts/start_demo.sh +55 -0
- package/runtime/scripts/sync-skill-tools.mjs +335 -0
- package/runtime/scripts/test-follow-me-sim.mjs +135 -0
- package/runtime/scripts/test-mcp-e2e.mjs +184 -0
- package/runtime/scripts/test-rclnodejs.mts +129 -0
- package/runtime/scripts/use-openclaw-2026.2.26.sh +19 -0
- package/runtime/scripts/use-openclaw-2026.3.11.sh +19 -0
- package/runtime/scripts/zenoh-bridge-ros2dds-robot.json5 +30 -0
- package/runtime/scripts/zenohd-agenticros.json5 +11 -0
- package/runtime/scripts/zenohd-rosclaw.json5 +11 -0
- package/runtime/tsconfig.base.json +19 -0
- package/index.js +0 -6
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ConnectionStatus,
|
|
3
|
+
ConnectionHandler,
|
|
4
|
+
Subscription,
|
|
5
|
+
PublishOptions,
|
|
6
|
+
AdvertiseOptions,
|
|
7
|
+
SubscribeOptions,
|
|
8
|
+
ServiceCallOptions,
|
|
9
|
+
ServiceCallResult,
|
|
10
|
+
ActionGoalOptions,
|
|
11
|
+
ActionResult,
|
|
12
|
+
TopicInfo,
|
|
13
|
+
ServiceInfo,
|
|
14
|
+
ActionInfo,
|
|
15
|
+
MessageHandler,
|
|
16
|
+
} from "./types.js";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Unified transport interface for ROS2 communication.
|
|
20
|
+
*
|
|
21
|
+
* All deployment modes (local DDS, rosbridge WebSocket, WebRTC data channel)
|
|
22
|
+
* implement this interface so that plugin tools work identically regardless
|
|
23
|
+
* of the underlying transport.
|
|
24
|
+
*/
|
|
25
|
+
export interface RosTransport {
|
|
26
|
+
// --- Connection lifecycle ---
|
|
27
|
+
|
|
28
|
+
/** Establish the transport connection. */
|
|
29
|
+
connect(): Promise<void>;
|
|
30
|
+
|
|
31
|
+
/** Gracefully close the transport connection. */
|
|
32
|
+
disconnect(): Promise<void>;
|
|
33
|
+
|
|
34
|
+
/** Get current connection status. */
|
|
35
|
+
getStatus(): ConnectionStatus;
|
|
36
|
+
|
|
37
|
+
/** Register a connection status change handler. Returns a cleanup function. */
|
|
38
|
+
onConnection(handler: ConnectionHandler): () => void;
|
|
39
|
+
|
|
40
|
+
// --- Topics ---
|
|
41
|
+
|
|
42
|
+
/** Optional: advertise topic with type (rosbridge uses this so publish works when topic not yet established). */
|
|
43
|
+
advertise?(options: AdvertiseOptions): void;
|
|
44
|
+
|
|
45
|
+
/** Publish a message to a ROS2 topic. May return a Promise so callers can await delivery (e.g. Zenoh put). */
|
|
46
|
+
publish(options: PublishOptions): void | Promise<void>;
|
|
47
|
+
|
|
48
|
+
/** Subscribe to a ROS2 topic. Returns a Subscription handle. */
|
|
49
|
+
subscribe(options: SubscribeOptions, handler: MessageHandler): Subscription;
|
|
50
|
+
|
|
51
|
+
/** Optional: async subscribe so the subscriber is declared before returning (Zenoh). Use when waiting for first message immediately. */
|
|
52
|
+
subscribeAsync?(options: SubscribeOptions, handler: MessageHandler): Promise<Subscription>;
|
|
53
|
+
|
|
54
|
+
// --- Services ---
|
|
55
|
+
|
|
56
|
+
/** Call a ROS2 service and return the result. */
|
|
57
|
+
callService(options: ServiceCallOptions): Promise<ServiceCallResult>;
|
|
58
|
+
|
|
59
|
+
// --- Actions ---
|
|
60
|
+
|
|
61
|
+
/** Send a goal to a ROS2 action server. */
|
|
62
|
+
sendActionGoal(options: ActionGoalOptions): Promise<ActionResult>;
|
|
63
|
+
|
|
64
|
+
/** Cancel an in-progress action goal. */
|
|
65
|
+
cancelActionGoal(action: string): Promise<void>;
|
|
66
|
+
|
|
67
|
+
// --- Introspection ---
|
|
68
|
+
|
|
69
|
+
/** List all available ROS2 topics. */
|
|
70
|
+
listTopics(): Promise<TopicInfo[]>;
|
|
71
|
+
|
|
72
|
+
/** List all available ROS2 services. */
|
|
73
|
+
listServices(): Promise<ServiceInfo[]>;
|
|
74
|
+
|
|
75
|
+
/** List all available ROS2 action servers. */
|
|
76
|
+
listActions(): Promise<ActionInfo[]>;
|
|
77
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the AgenticROS transport abstraction layer.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// --- Connection ---
|
|
6
|
+
|
|
7
|
+
export type ConnectionStatus = "disconnected" | "connecting" | "connected";
|
|
8
|
+
|
|
9
|
+
export type MessageHandler = (msg: Record<string, unknown>) => void;
|
|
10
|
+
|
|
11
|
+
export type ConnectionHandler = (status: ConnectionStatus) => void;
|
|
12
|
+
|
|
13
|
+
/** Returned by subscribe(); call unsubscribe() to stop receiving messages. */
|
|
14
|
+
export interface Subscription {
|
|
15
|
+
unsubscribe(): void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// --- Publish ---
|
|
19
|
+
|
|
20
|
+
export interface PublishOptions {
|
|
21
|
+
topic: string;
|
|
22
|
+
type: string;
|
|
23
|
+
msg: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Optional: advertise a topic (type) before publishing. Used by rosbridge so the server creates the publisher with the right type. */
|
|
27
|
+
export interface AdvertiseOptions {
|
|
28
|
+
topic: string;
|
|
29
|
+
type: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// --- Subscribe ---
|
|
33
|
+
|
|
34
|
+
export interface SubscribeOptions {
|
|
35
|
+
topic: string;
|
|
36
|
+
type?: string;
|
|
37
|
+
throttleRate?: number;
|
|
38
|
+
queueLength?: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// --- Service Call ---
|
|
42
|
+
|
|
43
|
+
export interface ServiceCallOptions {
|
|
44
|
+
service: string;
|
|
45
|
+
type?: string;
|
|
46
|
+
args?: Record<string, unknown>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ServiceCallResult {
|
|
50
|
+
result: boolean;
|
|
51
|
+
values?: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// --- Action ---
|
|
55
|
+
|
|
56
|
+
export interface ActionGoalOptions {
|
|
57
|
+
action: string;
|
|
58
|
+
actionType: string;
|
|
59
|
+
args?: Record<string, unknown>;
|
|
60
|
+
onFeedback?: (feedback: Record<string, unknown>) => void;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ActionResult {
|
|
64
|
+
result: boolean;
|
|
65
|
+
values?: Record<string, unknown>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// --- Introspection ---
|
|
69
|
+
|
|
70
|
+
export interface TopicInfo {
|
|
71
|
+
name: string;
|
|
72
|
+
type: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ServiceInfo {
|
|
76
|
+
name: string;
|
|
77
|
+
type: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ActionInfo {
|
|
81
|
+
name: string;
|
|
82
|
+
type: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// --- Transport Configuration ---
|
|
86
|
+
|
|
87
|
+
export interface RosbridgeTransportConfig {
|
|
88
|
+
mode: "rosbridge";
|
|
89
|
+
rosbridge: {
|
|
90
|
+
url: string;
|
|
91
|
+
reconnect?: boolean;
|
|
92
|
+
reconnectInterval?: number;
|
|
93
|
+
maxReconnectAttempts?: number;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface LocalTransportConfig {
|
|
98
|
+
mode: "local";
|
|
99
|
+
local?: {
|
|
100
|
+
domainId?: number;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface WebRTCTransportConfig {
|
|
105
|
+
mode: "webrtc";
|
|
106
|
+
webrtc: {
|
|
107
|
+
signalingUrl: string;
|
|
108
|
+
apiUrl: string;
|
|
109
|
+
robotId: string;
|
|
110
|
+
robotKey: string;
|
|
111
|
+
iceServers?: RTCIceServerConfig[];
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface ZenohTransportConfig {
|
|
116
|
+
mode: "zenoh";
|
|
117
|
+
zenoh: {
|
|
118
|
+
routerEndpoint: string;
|
|
119
|
+
domainId?: number;
|
|
120
|
+
keyFormat?: "ros2dds" | "rmw_zenoh";
|
|
121
|
+
/** Matches zenoh-bridge-ros2dds ros2dds.namespace when not default "/". */
|
|
122
|
+
bridgeNamespace?: string;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface RTCIceServerConfig {
|
|
127
|
+
urls: string | string[];
|
|
128
|
+
username?: string;
|
|
129
|
+
credential?: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Discriminated union of all transport configurations. */
|
|
133
|
+
export type TransportConfig =
|
|
134
|
+
| RosbridgeTransportConfig
|
|
135
|
+
| LocalTransportConfig
|
|
136
|
+
| WebRTCTransportConfig
|
|
137
|
+
| ZenohTransportConfig;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import WebSocket from "ws";
|
|
2
|
+
import type {
|
|
3
|
+
ConnectRequest,
|
|
4
|
+
ConnectResponse,
|
|
5
|
+
DisconnectResponse,
|
|
6
|
+
DiscoverResponse,
|
|
7
|
+
SignalingMessage,
|
|
8
|
+
JoinRoomMessage,
|
|
9
|
+
AnswerMessage,
|
|
10
|
+
IceCandidateMessage,
|
|
11
|
+
HeartbeatMessage,
|
|
12
|
+
} from "./signaling-types.js";
|
|
13
|
+
|
|
14
|
+
export type SignalingMessageHandler = (msg: SignalingMessage) => void;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Client for the WebRTC signaling server.
|
|
18
|
+
*
|
|
19
|
+
* Encapsulates REST API calls (discover, connect, disconnect) and
|
|
20
|
+
* WebSocket lifecycle (connect, send, message routing, heartbeat).
|
|
21
|
+
*/
|
|
22
|
+
export class SignalingClient {
|
|
23
|
+
private ws: WebSocket | null = null;
|
|
24
|
+
private apiUrl: string;
|
|
25
|
+
private signalingUrl: string;
|
|
26
|
+
private messageHandler: SignalingMessageHandler | null = null;
|
|
27
|
+
private heartbeatInterval: ReturnType<typeof setInterval> | null = null;
|
|
28
|
+
|
|
29
|
+
constructor(apiUrl: string, signalingUrl: string) {
|
|
30
|
+
// Normalize: strip trailing slashes
|
|
31
|
+
this.apiUrl = apiUrl.replace(/\/+$/, "");
|
|
32
|
+
this.signalingUrl = signalingUrl.replace(/\/+$/, "");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// --- REST API ---
|
|
36
|
+
|
|
37
|
+
async discoverRobots(): Promise<DiscoverResponse> {
|
|
38
|
+
const res = await fetch(`${this.apiUrl}/api/robots/`);
|
|
39
|
+
if (!res.ok) {
|
|
40
|
+
throw new Error(`Discovery failed: ${res.status} ${res.statusText}`);
|
|
41
|
+
}
|
|
42
|
+
return res.json() as Promise<DiscoverResponse>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async requestConnection(robotId: string, request: ConnectRequest): Promise<ConnectResponse> {
|
|
46
|
+
const res = await fetch(`${this.apiUrl}/api/robots/${robotId}/connect`, {
|
|
47
|
+
method: "POST",
|
|
48
|
+
headers: { "Content-Type": "application/json" },
|
|
49
|
+
body: JSON.stringify(request),
|
|
50
|
+
});
|
|
51
|
+
if (!res.ok) {
|
|
52
|
+
const body = await res.text();
|
|
53
|
+
throw new Error(`Connection request failed: ${res.status} — ${body}`);
|
|
54
|
+
}
|
|
55
|
+
return res.json() as Promise<ConnectResponse>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async requestDisconnect(robotId: string): Promise<DisconnectResponse> {
|
|
59
|
+
const res = await fetch(`${this.apiUrl}/api/robots/${robotId}/disconnect`, {
|
|
60
|
+
method: "POST",
|
|
61
|
+
});
|
|
62
|
+
if (!res.ok) {
|
|
63
|
+
throw new Error(`Disconnect request failed: ${res.status} ${res.statusText}`);
|
|
64
|
+
}
|
|
65
|
+
return res.json() as Promise<DisconnectResponse>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// --- WebSocket ---
|
|
69
|
+
|
|
70
|
+
/** Connect to the signaling WebSocket server. */
|
|
71
|
+
async connectWs(): Promise<void> {
|
|
72
|
+
return new Promise<void>((resolve, reject) => {
|
|
73
|
+
const wsUrl = `${this.signalingUrl}/ws`;
|
|
74
|
+
const timeout = setTimeout(() => {
|
|
75
|
+
reject(new Error(`Signaling WebSocket connection to ${wsUrl} timed out`));
|
|
76
|
+
}, 10_000);
|
|
77
|
+
|
|
78
|
+
this.ws = new WebSocket(wsUrl);
|
|
79
|
+
|
|
80
|
+
this.ws.onopen = () => {
|
|
81
|
+
clearTimeout(timeout);
|
|
82
|
+
this.startHeartbeat();
|
|
83
|
+
resolve();
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
this.ws.onmessage = (event) => {
|
|
87
|
+
const data = typeof event.data === "string" ? event.data : event.data.toString();
|
|
88
|
+
let msg: SignalingMessage;
|
|
89
|
+
try {
|
|
90
|
+
msg = JSON.parse(data) as SignalingMessage;
|
|
91
|
+
} catch {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Auto-respond to heartbeat requests
|
|
96
|
+
if (msg.type === "heartbeat_request") {
|
|
97
|
+
this.send({ type: "heartbeat", timestamp: Date.now() } satisfies HeartbeatMessage);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (this.messageHandler) {
|
|
102
|
+
this.messageHandler(msg);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
this.ws.onerror = () => {
|
|
107
|
+
clearTimeout(timeout);
|
|
108
|
+
reject(new Error(`Signaling WebSocket error connecting to ${wsUrl}`));
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
this.ws.onclose = () => {
|
|
112
|
+
clearTimeout(timeout);
|
|
113
|
+
this.stopHeartbeat();
|
|
114
|
+
this.ws = null;
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Set the handler for incoming signaling messages. */
|
|
120
|
+
onMessage(handler: SignalingMessageHandler): void {
|
|
121
|
+
this.messageHandler = handler;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** Send a signaling message over WebSocket. */
|
|
125
|
+
send(message: SignalingMessage): void {
|
|
126
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
|
|
127
|
+
throw new Error("Signaling WebSocket is not connected");
|
|
128
|
+
}
|
|
129
|
+
this.ws.send(JSON.stringify(message));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Send join_room to enter the session room. */
|
|
133
|
+
joinRoom(roomId: string, peerId: string, peerType: "frontend" | "robot", sessionId: string): void {
|
|
134
|
+
this.send({
|
|
135
|
+
type: "join_room",
|
|
136
|
+
room_id: roomId,
|
|
137
|
+
peer_id: peerId,
|
|
138
|
+
peer_type: peerType,
|
|
139
|
+
session_id: sessionId,
|
|
140
|
+
} satisfies JoinRoomMessage);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Send an SDP answer back to the peer. */
|
|
144
|
+
sendAnswer(sdp: string, roomId: string, peerId: string, targetPeerId?: string): void {
|
|
145
|
+
this.send({
|
|
146
|
+
type: "answer",
|
|
147
|
+
data: { type: "answer", sdp },
|
|
148
|
+
room_id: roomId,
|
|
149
|
+
peer_id: peerId,
|
|
150
|
+
target_peer_id: targetPeerId,
|
|
151
|
+
} satisfies AnswerMessage);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Send an ICE candidate to the peer. */
|
|
155
|
+
sendIceCandidate(candidate: string, sdpMid: string | null, sdpMLineIndex: number | null, targetPeerId?: string): void {
|
|
156
|
+
this.send({
|
|
157
|
+
type: "ice_candidate",
|
|
158
|
+
data: {
|
|
159
|
+
candidate,
|
|
160
|
+
sdpMid,
|
|
161
|
+
sdpMLineIndex,
|
|
162
|
+
},
|
|
163
|
+
target_peer_id: targetPeerId,
|
|
164
|
+
} satisfies IceCandidateMessage);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** Close the signaling WebSocket. */
|
|
168
|
+
close(): void {
|
|
169
|
+
this.stopHeartbeat();
|
|
170
|
+
if (this.ws) {
|
|
171
|
+
this.ws.close();
|
|
172
|
+
this.ws = null;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** Whether the WebSocket is currently connected. */
|
|
177
|
+
get isConnected(): boolean {
|
|
178
|
+
return this.ws !== null && this.ws.readyState === WebSocket.OPEN;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
private startHeartbeat(): void {
|
|
182
|
+
this.stopHeartbeat();
|
|
183
|
+
this.heartbeatInterval = setInterval(() => {
|
|
184
|
+
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
|
185
|
+
this.send({ type: "heartbeat", timestamp: Date.now() } satisfies HeartbeatMessage);
|
|
186
|
+
}
|
|
187
|
+
}, 15_000);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
private stopHeartbeat(): void {
|
|
191
|
+
if (this.heartbeatInterval) {
|
|
192
|
+
clearInterval(this.heartbeatInterval);
|
|
193
|
+
this.heartbeatInterval = null;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the WebRTC signaling server protocol.
|
|
3
|
+
*
|
|
4
|
+
* These match the message format used by the webrtc-py signaling server
|
|
5
|
+
* (see mock_client.py and mock_robot.py for reference implementations).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// --- REST API ---
|
|
9
|
+
|
|
10
|
+
export interface ConnectRequest {
|
|
11
|
+
user_id: string;
|
|
12
|
+
robot_id: string;
|
|
13
|
+
robot_key: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ConnectResponse {
|
|
17
|
+
session: { session_id: string };
|
|
18
|
+
room_id: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface DisconnectResponse {
|
|
22
|
+
status: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface RobotInfo {
|
|
26
|
+
robot_id: string;
|
|
27
|
+
status: string;
|
|
28
|
+
capabilities?: string[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type DiscoverResponse = RobotInfo[];
|
|
32
|
+
|
|
33
|
+
// --- WebSocket signaling messages ---
|
|
34
|
+
|
|
35
|
+
/** Base shape for all signaling messages. */
|
|
36
|
+
export interface SignalingMessage {
|
|
37
|
+
type: string;
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Client → Server
|
|
42
|
+
|
|
43
|
+
export interface JoinRoomMessage extends SignalingMessage {
|
|
44
|
+
type: "join_room";
|
|
45
|
+
room_id: string;
|
|
46
|
+
peer_id: string;
|
|
47
|
+
peer_type: "frontend" | "robot";
|
|
48
|
+
session_id: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface RobotConnectMessage extends SignalingMessage {
|
|
52
|
+
type: "robot_connect";
|
|
53
|
+
robot_token: string;
|
|
54
|
+
robot_id: string;
|
|
55
|
+
capabilities?: string[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface SessionAcceptedMessage extends SignalingMessage {
|
|
59
|
+
type: "session_accepted";
|
|
60
|
+
session_id: string;
|
|
61
|
+
robot_id: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface OfferMessage extends SignalingMessage {
|
|
65
|
+
type: "offer";
|
|
66
|
+
data: { type: string; sdp: string };
|
|
67
|
+
from_peer_id?: string;
|
|
68
|
+
target_peer_id?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface AnswerMessage extends SignalingMessage {
|
|
72
|
+
type: "answer";
|
|
73
|
+
data: { type: string; sdp: string };
|
|
74
|
+
room_id?: string;
|
|
75
|
+
peer_id?: string;
|
|
76
|
+
target_peer_id?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface IceCandidateMessage extends SignalingMessage {
|
|
80
|
+
type: "ice_candidate";
|
|
81
|
+
data: {
|
|
82
|
+
candidate: string;
|
|
83
|
+
sdpMid: string | null;
|
|
84
|
+
sdpMLineIndex: number | null;
|
|
85
|
+
};
|
|
86
|
+
target_peer_id?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface HeartbeatMessage extends SignalingMessage {
|
|
90
|
+
type: "heartbeat";
|
|
91
|
+
timestamp: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Server → Client
|
|
95
|
+
|
|
96
|
+
export interface PeerJoinedMessage extends SignalingMessage {
|
|
97
|
+
type: "peer_joined";
|
|
98
|
+
peer_id: string;
|
|
99
|
+
peer_type: "frontend" | "robot";
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface PeerLeftMessage extends SignalingMessage {
|
|
103
|
+
type: "peer_left";
|
|
104
|
+
peer_id: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface SessionInvitationMessage extends SignalingMessage {
|
|
108
|
+
type: "session_invitation";
|
|
109
|
+
session_id: string;
|
|
110
|
+
room_id: string;
|
|
111
|
+
robot_key: string;
|
|
112
|
+
user_id: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface SessionEndedMessage extends SignalingMessage {
|
|
116
|
+
type: "session_ended";
|
|
117
|
+
session_id: string;
|
|
118
|
+
reason?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface HeartbeatRequestMessage extends SignalingMessage {
|
|
122
|
+
type: "heartbeat_request";
|
|
123
|
+
timestamp: number;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface ErrorMessage extends SignalingMessage {
|
|
127
|
+
type: "error";
|
|
128
|
+
message: string;
|
|
129
|
+
code?: string;
|
|
130
|
+
}
|