agenticros 0.0.1 → 0.1.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.
- 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 +143 -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 +13 -0
- package/dist/commands/down.d.ts.map +1 -0
- package/dist/commands/down.js +81 -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 +52 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/up.d.ts +19 -0
- package/dist/commands/up.d.ts.map +1 -0
- package/dist/commands/up.js +58 -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 +106 -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 +17 -0
- package/dist/runners/sim.d.ts.map +1 -0
- package/dist/runners/sim.js +51 -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 +386 -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/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/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/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-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,26 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.8)
|
|
2
|
+
project(agenticros_msgs)
|
|
3
|
+
|
|
4
|
+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
5
|
+
add_compile_options(-Wall -Wextra -Wpedantic)
|
|
6
|
+
endif()
|
|
7
|
+
|
|
8
|
+
find_package(ament_cmake REQUIRED)
|
|
9
|
+
find_package(std_msgs REQUIRED)
|
|
10
|
+
find_package(rosidl_default_generators REQUIRED)
|
|
11
|
+
|
|
12
|
+
find_package(builtin_interfaces REQUIRED)
|
|
13
|
+
find_package(geometry_msgs REQUIRED)
|
|
14
|
+
|
|
15
|
+
rosidl_generate_interfaces(${PROJECT_NAME}
|
|
16
|
+
"msg/CapabilityManifest.msg"
|
|
17
|
+
"srv/GetCapabilities.srv"
|
|
18
|
+
"srv/FollowMeStart.srv"
|
|
19
|
+
"srv/FollowMeStop.srv"
|
|
20
|
+
"srv/FollowMeSetDistance.srv"
|
|
21
|
+
"srv/FollowMeGetStatus.srv"
|
|
22
|
+
"srv/FollowMeSetTarget.srv"
|
|
23
|
+
DEPENDENCIES std_msgs builtin_interfaces geometry_msgs
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
ament_package()
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
|
3
|
+
<package format="3">
|
|
4
|
+
<name>agenticros_msgs</name>
|
|
5
|
+
<version>0.0.1</version>
|
|
6
|
+
<description>Custom ROS2 message and service definitions for AgenticROS</description>
|
|
7
|
+
<maintainer email="team@plaipin.com">PlaiPin</maintainer>
|
|
8
|
+
<license>Apache-2.0</license>
|
|
9
|
+
|
|
10
|
+
<buildtool_depend>ament_cmake</buildtool_depend>
|
|
11
|
+
<buildtool_depend>rosidl_default_generators</buildtool_depend>
|
|
12
|
+
|
|
13
|
+
<depend>std_msgs</depend>
|
|
14
|
+
<depend>builtin_interfaces</depend>
|
|
15
|
+
<depend>geometry_msgs</depend>
|
|
16
|
+
|
|
17
|
+
<member_of_group>rosidl_interface_packages</member_of_group>
|
|
18
|
+
|
|
19
|
+
<export>
|
|
20
|
+
<build_type>ament_cmake</build_type>
|
|
21
|
+
</export>
|
|
22
|
+
</package>
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# activate_workspace.sh - Cross-platform workspace activation for AgenticROS
|
|
3
|
+
#
|
|
4
|
+
# DESCRIPTION:
|
|
5
|
+
# This script sets up the complete development environment for the AgenticROS project.
|
|
6
|
+
# It supports both Ubuntu (venv + native ROS2) and macOS (mamba + RoboStack).
|
|
7
|
+
# The script handles platform detection and activates the appropriate environment type.
|
|
8
|
+
#
|
|
9
|
+
# USAGE:
|
|
10
|
+
# source activate_workspace.sh [env_name] [ros_distro]
|
|
11
|
+
#
|
|
12
|
+
# PARAMETERS:
|
|
13
|
+
# env_name Optional. Name of the environment to activate.
|
|
14
|
+
# Default: ros_env
|
|
15
|
+
# ros_distro Optional. ROS2 distribution to use.
|
|
16
|
+
# Default: humble
|
|
17
|
+
#
|
|
18
|
+
# EXAMPLES:
|
|
19
|
+
# # Use defaults (ros_env, jazzy)
|
|
20
|
+
# source scripts/activate_workspace.sh
|
|
21
|
+
#
|
|
22
|
+
# # Use specific environment name
|
|
23
|
+
# source scripts/activate_workspace.sh my_ros_env
|
|
24
|
+
#
|
|
25
|
+
# # Use specific ROS distribution
|
|
26
|
+
# source scripts/activate_workspace.sh ros_env humble
|
|
27
|
+
#
|
|
28
|
+
# NOTE:
|
|
29
|
+
# This script must be SOURCED, not executed, to modify the current shell environment.
|
|
30
|
+
|
|
31
|
+
# Check if script is being sourced
|
|
32
|
+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|
33
|
+
echo "Error: This script must be sourced, not executed."
|
|
34
|
+
echo "Usage: source $(basename ${BASH_SOURCE[0]}) [env_name] [ros_distro]"
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
# Default values
|
|
39
|
+
DEFAULT_ENV_NAME="ros_env"
|
|
40
|
+
DEFAULT_ROS_DISTRO="humble"
|
|
41
|
+
ENV_NAME="${1:-$DEFAULT_ENV_NAME}"
|
|
42
|
+
ROS_DISTRO="${2:-$DEFAULT_ROS_DISTRO}"
|
|
43
|
+
|
|
44
|
+
# Find the repository root
|
|
45
|
+
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
|
46
|
+
ROS2_WS_PATH="$REPO_ROOT/ros2_ws"
|
|
47
|
+
|
|
48
|
+
# Colors for output
|
|
49
|
+
RED='\033[0;31m'
|
|
50
|
+
GREEN='\033[0;32m'
|
|
51
|
+
YELLOW='\033[1;33m'
|
|
52
|
+
BLUE='\033[0;34m'
|
|
53
|
+
NC='\033[0m' # No Color
|
|
54
|
+
|
|
55
|
+
# Logging functions
|
|
56
|
+
log_info() {
|
|
57
|
+
echo -e "${BLUE}[INFO]${NC} $1"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
log_success() {
|
|
61
|
+
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
log_warning() {
|
|
65
|
+
echo -e "${YELLOW}[WARNING]${NC} $1"
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
log_error() {
|
|
69
|
+
echo -e "${RED}[ERROR]${NC} $1"
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
# Platform detection
|
|
73
|
+
detect_platform() {
|
|
74
|
+
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
75
|
+
PLATFORM="macos"
|
|
76
|
+
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
|
77
|
+
if command -v apt &> /dev/null; then
|
|
78
|
+
PLATFORM="ubuntu"
|
|
79
|
+
else
|
|
80
|
+
log_error "Linux platform detected but apt not found. Only Ubuntu/Debian supported."
|
|
81
|
+
return 1
|
|
82
|
+
fi
|
|
83
|
+
else
|
|
84
|
+
log_error "Unsupported platform: $OSTYPE"
|
|
85
|
+
return 1
|
|
86
|
+
fi
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
# Check environment exists for Ubuntu (venv)
|
|
90
|
+
check_ubuntu_env() {
|
|
91
|
+
local venv_path="$REPO_ROOT/$ENV_NAME"
|
|
92
|
+
if [ ! -d "$venv_path" ]; then
|
|
93
|
+
log_error "Virtual environment not found at $venv_path"
|
|
94
|
+
echo ""
|
|
95
|
+
echo "Please run the setup script first:"
|
|
96
|
+
echo " ./scripts/setup_workspace.sh --env-name $ENV_NAME --ros-distro $ROS_DISTRO"
|
|
97
|
+
return 1
|
|
98
|
+
fi
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
# Check environment exists for macOS (conda)
|
|
102
|
+
check_macos_env() {
|
|
103
|
+
if [[ -n "$CONDA_DEFAULT_ENV" && "$CONDA_DEFAULT_ENV" == "$ENV_NAME" ]]; then
|
|
104
|
+
log_info "Already in target conda environment '$ENV_NAME'"
|
|
105
|
+
return 0
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
if ! command -v mamba &> /dev/null && ! command -v conda &> /dev/null; then
|
|
109
|
+
log_error "Neither mamba nor conda found!"
|
|
110
|
+
echo ""
|
|
111
|
+
echo "Please run the setup script first:"
|
|
112
|
+
echo " ./scripts/setup_workspace.sh --env-name $ENV_NAME --ros-distro $ROS_DISTRO"
|
|
113
|
+
return 1
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
local manager="mamba"
|
|
117
|
+
if ! command -v mamba &> /dev/null; then
|
|
118
|
+
manager="conda"
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
if ! $manager env list | grep -q "\s$ENV_NAME\s"; then
|
|
122
|
+
log_error "Conda environment '$ENV_NAME' not found!"
|
|
123
|
+
echo ""
|
|
124
|
+
echo "Please run the setup script first:"
|
|
125
|
+
echo " ./scripts/setup_workspace.sh --env-name $ENV_NAME --ros-distro $ROS_DISTRO"
|
|
126
|
+
return 1
|
|
127
|
+
fi
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
# Check if already in correct conda environment
|
|
131
|
+
check_conda_env_status() {
|
|
132
|
+
if [[ -n "$CONDA_DEFAULT_ENV" ]]; then
|
|
133
|
+
if [[ "$CONDA_DEFAULT_ENV" == "$ENV_NAME" ]]; then
|
|
134
|
+
log_info "Already in target environment '$ENV_NAME'"
|
|
135
|
+
return 0
|
|
136
|
+
else
|
|
137
|
+
log_warning "Currently in environment '$CONDA_DEFAULT_ENV', will switch to '$ENV_NAME'"
|
|
138
|
+
return 1
|
|
139
|
+
fi
|
|
140
|
+
fi
|
|
141
|
+
return 1
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
# Activate Ubuntu environment
|
|
145
|
+
activate_ubuntu() {
|
|
146
|
+
local venv_path="$REPO_ROOT/$ENV_NAME"
|
|
147
|
+
|
|
148
|
+
log_info "[1/3] Activating virtual environment..."
|
|
149
|
+
source "$venv_path/bin/activate"
|
|
150
|
+
|
|
151
|
+
log_info "[2/3] Sourcing ROS2 environment..."
|
|
152
|
+
if [ -f "/opt/ros/$ROS_DISTRO/setup.bash" ]; then
|
|
153
|
+
source "/opt/ros/$ROS_DISTRO/setup.bash"
|
|
154
|
+
else
|
|
155
|
+
log_error "ROS2 $ROS_DISTRO not found at /opt/ros/$ROS_DISTRO"
|
|
156
|
+
return 1
|
|
157
|
+
fi
|
|
158
|
+
|
|
159
|
+
log_info "[3/3] Sourcing workspace overlay..."
|
|
160
|
+
if [ -f "$ROS2_WS_PATH/install/setup.bash" ]; then
|
|
161
|
+
source "$ROS2_WS_PATH/install/setup.bash"
|
|
162
|
+
else
|
|
163
|
+
log_warning "Workspace not built yet. Run: cd $ROS2_WS_PATH && colcon build --symlink-install"
|
|
164
|
+
fi
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
# Activate macOS environment
|
|
168
|
+
activate_macos() {
|
|
169
|
+
local manager="mamba"
|
|
170
|
+
if ! command -v mamba &> /dev/null; then
|
|
171
|
+
manager="conda"
|
|
172
|
+
fi
|
|
173
|
+
|
|
174
|
+
if check_conda_env_status; then
|
|
175
|
+
log_info "[1/2] Already in conda environment '$ENV_NAME', skipping activation..."
|
|
176
|
+
else
|
|
177
|
+
log_info "[1/2] Activating conda environment '$ENV_NAME'..."
|
|
178
|
+
eval "$($manager shell hook)"
|
|
179
|
+
$manager activate "$ENV_NAME"
|
|
180
|
+
fi
|
|
181
|
+
|
|
182
|
+
if ! command -v ros2 &> /dev/null; then
|
|
183
|
+
log_error "ROS2 not available in environment. Check RoboStack installation."
|
|
184
|
+
return 1
|
|
185
|
+
fi
|
|
186
|
+
|
|
187
|
+
log_info "[2/2] Sourcing workspace overlay..."
|
|
188
|
+
if [ -f "$ROS2_WS_PATH/install/setup.bash" ]; then
|
|
189
|
+
source "$ROS2_WS_PATH/install/setup.bash"
|
|
190
|
+
else
|
|
191
|
+
log_warning "Workspace not built yet. Run: cd $ROS2_WS_PATH && colcon build --symlink-install"
|
|
192
|
+
fi
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
# Verify setup
|
|
196
|
+
verify_setup() {
|
|
197
|
+
log_info "Verifying environment..."
|
|
198
|
+
|
|
199
|
+
if ! command -v ros2 &> /dev/null; then
|
|
200
|
+
log_error "ROS2 command not available"
|
|
201
|
+
return 1
|
|
202
|
+
fi
|
|
203
|
+
|
|
204
|
+
local python_path=$(which python3)
|
|
205
|
+
log_info "Python: $python_path"
|
|
206
|
+
|
|
207
|
+
# Check for agenticros packages
|
|
208
|
+
for pkg in agenticros_msgs agenticros_discovery agenticros_agent; do
|
|
209
|
+
if ros2 pkg list 2>/dev/null | grep -q "$pkg"; then
|
|
210
|
+
log_success "Package found: $pkg"
|
|
211
|
+
else
|
|
212
|
+
log_warning "Package not found: $pkg (workspace may need to be built)"
|
|
213
|
+
fi
|
|
214
|
+
done
|
|
215
|
+
|
|
216
|
+
return 0
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
# Main execution
|
|
220
|
+
main() {
|
|
221
|
+
echo "======================================"
|
|
222
|
+
echo "AgenticROS Workspace Activation"
|
|
223
|
+
echo "======================================"
|
|
224
|
+
echo ""
|
|
225
|
+
|
|
226
|
+
if ! detect_platform; then
|
|
227
|
+
return 1
|
|
228
|
+
fi
|
|
229
|
+
|
|
230
|
+
log_info "Platform detected: $PLATFORM"
|
|
231
|
+
log_info "Environment name: $ENV_NAME"
|
|
232
|
+
log_info "ROS2 distribution: $ROS_DISTRO"
|
|
233
|
+
log_info "Repository root: $REPO_ROOT"
|
|
234
|
+
echo ""
|
|
235
|
+
|
|
236
|
+
case $PLATFORM in
|
|
237
|
+
ubuntu)
|
|
238
|
+
if ! check_ubuntu_env; then
|
|
239
|
+
return 1
|
|
240
|
+
fi
|
|
241
|
+
if ! activate_ubuntu; then
|
|
242
|
+
return 1
|
|
243
|
+
fi
|
|
244
|
+
;;
|
|
245
|
+
macos)
|
|
246
|
+
if ! check_macos_env; then
|
|
247
|
+
return 1
|
|
248
|
+
fi
|
|
249
|
+
if ! activate_macos; then
|
|
250
|
+
return 1
|
|
251
|
+
fi
|
|
252
|
+
;;
|
|
253
|
+
*)
|
|
254
|
+
log_error "Unsupported platform: $PLATFORM"
|
|
255
|
+
return 1
|
|
256
|
+
;;
|
|
257
|
+
esac
|
|
258
|
+
|
|
259
|
+
echo ""
|
|
260
|
+
|
|
261
|
+
if verify_setup; then
|
|
262
|
+
log_success "Environment verification passed!"
|
|
263
|
+
else
|
|
264
|
+
log_warning "Environment verification had issues, but activation completed"
|
|
265
|
+
fi
|
|
266
|
+
|
|
267
|
+
echo ""
|
|
268
|
+
log_success "Workspace activation complete!"
|
|
269
|
+
echo ""
|
|
270
|
+
echo "Environment Details:"
|
|
271
|
+
echo " Platform: $PLATFORM"
|
|
272
|
+
echo " Environment: $ENV_NAME"
|
|
273
|
+
echo " ROS2 Distro: $ROS_DISTRO"
|
|
274
|
+
echo " Python: $(which python3)"
|
|
275
|
+
echo " Workspace: $ROS2_WS_PATH"
|
|
276
|
+
echo ""
|
|
277
|
+
echo "Ready for development! You can now:"
|
|
278
|
+
echo " - Build packages: cd ros2_ws && colcon build --symlink-install"
|
|
279
|
+
echo " - Run discovery: ros2 run agenticros_discovery discovery_node"
|
|
280
|
+
echo " - Run agent: ros2 run agenticros_agent agent_node"
|
|
281
|
+
echo " - List topics: ros2 topic list"
|
|
282
|
+
echo ""
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
main
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# NemoClaw policy preset that lets the AgenticROS plugin call a vision
|
|
2
|
+
# model on the host for describing camera snapshots. Without this preset
|
|
3
|
+
# the OPA proxy denies the plugin's outbound HTTP request to Ollama with
|
|
4
|
+
# a 403, and ros2_camera_snapshot returns no "Vision description:" line.
|
|
5
|
+
#
|
|
6
|
+
# Apply with::
|
|
7
|
+
#
|
|
8
|
+
# nemoclaw nemo policy-add --from-file scripts/agenticros-describer.policy.yaml --yes
|
|
9
|
+
#
|
|
10
|
+
# Wire-level note:
|
|
11
|
+
# The plugin's describer makes an HTTP/1.1 POST to
|
|
12
|
+
# ``http://host.docker.internal:11434/v1/chat/completions`` (default).
|
|
13
|
+
# That is a *regular HTTP REST* request — NOT a CONNECT tunnel like the
|
|
14
|
+
# rosbridge WebSocket. Two consequences:
|
|
15
|
+
#
|
|
16
|
+
# * We use ``protocol: rest`` with explicit ``rules`` (same shape as
|
|
17
|
+
# the built-in ``managed_inference`` and ``local_inference`` policies
|
|
18
|
+
# and our ``openai`` preset). The raw L4 ``access: full`` shape used
|
|
19
|
+
# for the rosbridge preset does NOT match HTTP method/path REST
|
|
20
|
+
# traffic — you'll see a 403 "FORWARD denied POST ..." in
|
|
21
|
+
# /var/log/openshell.*.log if you try it.
|
|
22
|
+
#
|
|
23
|
+
# * ``host.docker.internal`` resolves to the Docker bridge gateway
|
|
24
|
+
# (an RFC1918 address, typically 172.19.0.1). The OpenShell SSRF
|
|
25
|
+
# guard default-denies private destinations, so we still need the
|
|
26
|
+
# ``allowed_ips`` block listing the three private CIDRs — same as
|
|
27
|
+
# the rosbridge preset.
|
|
28
|
+
|
|
29
|
+
preset:
|
|
30
|
+
name: agenticros-describer
|
|
31
|
+
description: "AgenticROS plugin -> host Ollama (vision) on :11434 for camera snapshot descriptions"
|
|
32
|
+
|
|
33
|
+
network_policies:
|
|
34
|
+
agenticros_describer:
|
|
35
|
+
name: agenticros_describer
|
|
36
|
+
endpoints:
|
|
37
|
+
- host: host.docker.internal
|
|
38
|
+
port: 11434
|
|
39
|
+
protocol: rest
|
|
40
|
+
enforcement: enforce
|
|
41
|
+
allowed_ips:
|
|
42
|
+
- 10.0.0.0/8
|
|
43
|
+
- 172.16.0.0/12
|
|
44
|
+
- 192.168.0.0/16
|
|
45
|
+
rules:
|
|
46
|
+
- allow:
|
|
47
|
+
method: POST
|
|
48
|
+
path: /**
|
|
49
|
+
- allow:
|
|
50
|
+
method: GET
|
|
51
|
+
path: /**
|
|
52
|
+
- host: host.openshell.internal
|
|
53
|
+
port: 11434
|
|
54
|
+
protocol: rest
|
|
55
|
+
enforcement: enforce
|
|
56
|
+
allowed_ips:
|
|
57
|
+
- 10.0.0.0/8
|
|
58
|
+
- 172.16.0.0/12
|
|
59
|
+
- 192.168.0.0/16
|
|
60
|
+
rules:
|
|
61
|
+
- allow:
|
|
62
|
+
method: POST
|
|
63
|
+
path: /**
|
|
64
|
+
- allow:
|
|
65
|
+
method: GET
|
|
66
|
+
path: /**
|
|
67
|
+
# NemoClaw's Ollama auth proxy. Useful if you ever point the
|
|
68
|
+
# describer URL at the auth-proxied endpoint instead of raw Ollama.
|
|
69
|
+
- host: host.openshell.internal
|
|
70
|
+
port: 11435
|
|
71
|
+
protocol: rest
|
|
72
|
+
enforcement: enforce
|
|
73
|
+
allowed_ips:
|
|
74
|
+
- 10.0.0.0/8
|
|
75
|
+
- 172.16.0.0/12
|
|
76
|
+
- 192.168.0.0/16
|
|
77
|
+
rules:
|
|
78
|
+
- allow:
|
|
79
|
+
method: POST
|
|
80
|
+
path: /**
|
|
81
|
+
- allow:
|
|
82
|
+
method: GET
|
|
83
|
+
path: /**
|
|
84
|
+
# The OPA proxy denies requests whose calling binary is not in the
|
|
85
|
+
# allowed list (the OCSF log shows "DENIED -(0) -> ..." when this
|
|
86
|
+
# check fails — "-(0)" means binary attribution failed). Mirroring the
|
|
87
|
+
# built-in ``local_inference`` allowlist covers the AgenticROS plugin
|
|
88
|
+
# (which runs in-process inside the openclaw-gateway node process),
|
|
89
|
+
# the gateway's own outbound HTTP, and shell-based test calls
|
|
90
|
+
# (``curl`` from inside the sandbox).
|
|
91
|
+
binaries:
|
|
92
|
+
- path: /usr/local/bin/openclaw
|
|
93
|
+
- path: /usr/local/bin/node
|
|
94
|
+
- path: /usr/bin/node
|
|
95
|
+
- path: /usr/bin/curl
|
|
96
|
+
- path: /usr/bin/python3
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Local proxy so you can open AgenticROS pages in a browser when the gateway
|
|
4
|
+
* uses token auth. The gateway requires "Authorization: Bearer <token>" and
|
|
5
|
+
* browsers can't send that for normal URLs; this proxy adds the header.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* node scripts/agenticros-proxy.cjs [port]
|
|
9
|
+
* Then open: http://127.0.0.1:<port>/plugins/agenticros/
|
|
10
|
+
*
|
|
11
|
+
* Reads gateway URL and token from ~/.openclaw/openclaw.json (gateway.auth.token).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const http = require('http');
|
|
15
|
+
const fs = require('fs');
|
|
16
|
+
const path = require('path');
|
|
17
|
+
|
|
18
|
+
const port = parseInt(process.argv[2] || '18790', 10);
|
|
19
|
+
const configPath = process.env.OPENCLAW_CONFIG || path.join(process.env.HOME || '', '.openclaw', 'openclaw.json');
|
|
20
|
+
|
|
21
|
+
let gatewayOrigin = 'http://127.0.0.1:18789';
|
|
22
|
+
let token = '';
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
const raw = fs.readFileSync(configPath, 'utf8');
|
|
26
|
+
const config = JSON.parse(raw);
|
|
27
|
+
const auth = config.gateway?.auth;
|
|
28
|
+
if (auth?.token) {
|
|
29
|
+
token = auth.token;
|
|
30
|
+
}
|
|
31
|
+
if (config.gateway?.url) {
|
|
32
|
+
gatewayOrigin = config.gateway.url.replace(/\/$/, '');
|
|
33
|
+
}
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.error('Could not read OpenClaw config:', configPath, e.message);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!token) {
|
|
40
|
+
console.error('No gateway.auth.token in', configPath);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const server = http.createServer((req, res) => {
|
|
45
|
+
if (req.url === '/favicon.ico' || req.url === '/favicon.ico/') {
|
|
46
|
+
res.writeHead(204, { 'Content-Length': '0' });
|
|
47
|
+
res.end();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const isAgenticros = req.url?.startsWith('/api/agenticros') || req.url?.startsWith('/plugins/agenticros');
|
|
51
|
+
if (!isAgenticros) {
|
|
52
|
+
res.writeHead(404, { 'Content-Type': 'text/plain' });
|
|
53
|
+
res.end('Not found. Open http://127.0.0.1:' + port + '/plugins/agenticros/');
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const url = new URL(gatewayOrigin);
|
|
58
|
+
const pathWithQuery = req.url || '/';
|
|
59
|
+
const headers = { ...req.headers, host: url.host, authorization: 'Bearer ' + token };
|
|
60
|
+
const qIdx = pathWithQuery.indexOf('?');
|
|
61
|
+
if (qIdx !== -1) {
|
|
62
|
+
headers['X-AgenticROS-Query'] = pathWithQuery.slice(qIdx + 1);
|
|
63
|
+
}
|
|
64
|
+
const opts = {
|
|
65
|
+
hostname: url.hostname,
|
|
66
|
+
port: url.port || (url.protocol === 'https:' ? 443 : 80),
|
|
67
|
+
path: pathWithQuery,
|
|
68
|
+
method: req.method,
|
|
69
|
+
headers,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const proxy = http.request(opts, (upstream) => {
|
|
73
|
+
const code = upstream.statusCode || 200;
|
|
74
|
+
if (code === 401 || code === 403) {
|
|
75
|
+
console.warn('Gateway returned ' + code + '. Check gateway.auth.token in', configPath);
|
|
76
|
+
}
|
|
77
|
+
res.writeHead(code, upstream.headers);
|
|
78
|
+
upstream.pipe(res);
|
|
79
|
+
});
|
|
80
|
+
proxy.on('error', (e) => {
|
|
81
|
+
console.error('Proxy error:', e.message);
|
|
82
|
+
res.writeHead(502, { 'Content-Type': 'text/plain' });
|
|
83
|
+
res.end('Bad gateway: ' + e.message);
|
|
84
|
+
});
|
|
85
|
+
req.pipe(proxy);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
server.listen(port, '127.0.0.1', () => {
|
|
89
|
+
const gwUrl = new URL(gatewayOrigin);
|
|
90
|
+
const gwPort = gwUrl.port || (gwUrl.protocol === 'https:' ? '443' : '80');
|
|
91
|
+
console.log('');
|
|
92
|
+
console.log(' Open this URL in your browser (this proxy adds the auth token):');
|
|
93
|
+
console.log(' http://127.0.0.1:' + port + '/plugins/agenticros/');
|
|
94
|
+
console.log('');
|
|
95
|
+
console.log(' Gateway is at ' + gatewayOrigin + ' (port ' + gwPort + ' from ' + configPath + ')');
|
|
96
|
+
console.log(' If you see Unauthorized on another port, use the URL above.');
|
|
97
|
+
console.log(' If you get 503 (camera) or 502 (twist), run the gateway with a single worker (see docs/teleop.md).');
|
|
98
|
+
console.log('');
|
|
99
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# NemoClaw policy preset that allows the AgenticROS plugin (running inside
|
|
2
|
+
# the OpenShell sandbox) to reach a rosbridge_server on the host machine.
|
|
3
|
+
#
|
|
4
|
+
# Apply with::
|
|
5
|
+
#
|
|
6
|
+
# nemoclaw <sandbox> policy-add --from-file scripts/agenticros-rosbridge.policy.yaml --yes
|
|
7
|
+
#
|
|
8
|
+
# The plugin connects via ws://host.docker.internal:9090 (which resolves to
|
|
9
|
+
# the Docker bridge gateway IP — usually 172.19.0.1). host.openshell.internal
|
|
10
|
+
# is the alias NemoClaw injects with the same IP.
|
|
11
|
+
#
|
|
12
|
+
# Why ``access: full`` / ``tls: skip`` (raw L4 CONNECT tunnel) instead of
|
|
13
|
+
# ``protocol: websocket`` with allow rules:
|
|
14
|
+
#
|
|
15
|
+
# * The OpenShell proxy MITM that backs ``protocol: websocket`` negotiates
|
|
16
|
+
# HTTP/2 ALPN by default when it terminates TLS. rosbridge_server is
|
|
17
|
+
# plain HTTP/1.1 ws://, not wss://, but the proxy still tries to do
|
|
18
|
+
# HTTP-level routing which breaks the WebSocket upgrade for some clients
|
|
19
|
+
# (Node ``ws`` library connect attempts disappear without an OPA log
|
|
20
|
+
# entry).
|
|
21
|
+
# * Declaring the endpoint as a raw L4 CONNECT tunnel (``access: full``)
|
|
22
|
+
# tells the proxy to pass the encrypted/cleartext bytes through
|
|
23
|
+
# unmodified, so the WebSocket upgrade survives intact. The whatsapp
|
|
24
|
+
# built-in preset uses the same trick for the same underlying reason.
|
|
25
|
+
# * ``tls: skip`` is needed because the upstream is plain HTTP — there's
|
|
26
|
+
# no TLS for the proxy to terminate.
|
|
27
|
+
|
|
28
|
+
preset:
|
|
29
|
+
name: agenticros-rosbridge
|
|
30
|
+
description: "AgenticROS plugin -> host rosbridge_server WebSocket on :9090"
|
|
31
|
+
|
|
32
|
+
network_policies:
|
|
33
|
+
agenticros_rosbridge:
|
|
34
|
+
name: agenticros_rosbridge
|
|
35
|
+
endpoints:
|
|
36
|
+
- host: host.docker.internal
|
|
37
|
+
port: 9090
|
|
38
|
+
access: full
|
|
39
|
+
tls: skip
|
|
40
|
+
# Without an explicit allowed_ips block the OPA proxy's SSRF guard
|
|
41
|
+
# rejects this connection with "resolves to internal address
|
|
42
|
+
# 172.19.0.1, connection rejected" — because host.docker.internal
|
|
43
|
+
# is a docker-bridge gateway IP in the RFC1918 range and the guard
|
|
44
|
+
# default-denies private IPs. Listing the three private CIDRs is
|
|
45
|
+
# the documented way to tell the guard "yes, I really do want to
|
|
46
|
+
# talk to a host on a private network here".
|
|
47
|
+
allowed_ips:
|
|
48
|
+
- 10.0.0.0/8
|
|
49
|
+
- 172.16.0.0/12
|
|
50
|
+
- 192.168.0.0/16
|
|
51
|
+
- host: host.openshell.internal
|
|
52
|
+
port: 9090
|
|
53
|
+
access: full
|
|
54
|
+
tls: skip
|
|
55
|
+
allowed_ips:
|
|
56
|
+
- 10.0.0.0/8
|
|
57
|
+
- 172.16.0.0/12
|
|
58
|
+
- 192.168.0.0/16
|
|
59
|
+
binaries:
|
|
60
|
+
- { path: /usr/local/bin/openclaw }
|
|
61
|
+
- { path: /usr/local/bin/node }
|
|
62
|
+
- { path: /usr/bin/node }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Tarball-size gate for the `agenticros` npm package.
|
|
4
|
+
*
|
|
5
|
+
* Runs `npm pack --dry-run --json` inside packages/agenticros-cli/, parses the
|
|
6
|
+
* JSON metadata, prints a human summary, and exits non-zero if the unpacked
|
|
7
|
+
* tarball would exceed MAX_UNPACKED_MB. Used as part of the prepublishOnly
|
|
8
|
+
* pipeline so accidental fat dependencies don't slip into a release.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { execSync } from "node:child_process";
|
|
12
|
+
import { dirname, resolve } from "node:path";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
|
|
15
|
+
const MAX_UNPACKED_MB = 20;
|
|
16
|
+
|
|
17
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
+
const __dirname = dirname(__filename);
|
|
19
|
+
const CLI_PKG_DIR = resolve(__dirname, "..", "packages", "agenticros-cli");
|
|
20
|
+
|
|
21
|
+
const out = execSync("npm pack --dry-run --json", {
|
|
22
|
+
cwd: CLI_PKG_DIR,
|
|
23
|
+
encoding: "utf8",
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const arr = JSON.parse(out);
|
|
27
|
+
const meta = arr[0];
|
|
28
|
+
const unpackedMb = (meta.unpackedSize / 1_048_576).toFixed(2);
|
|
29
|
+
const packagedMb = (meta.size / 1_048_576).toFixed(2);
|
|
30
|
+
|
|
31
|
+
process.stdout.write(
|
|
32
|
+
`[size-check] ${meta.filename} tarball ${packagedMb} MB unpacked ${unpackedMb} MB files ${meta.entryCount}\n`,
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
if (meta.unpackedSize > MAX_UNPACKED_MB * 1_048_576) {
|
|
36
|
+
process.stderr.write(
|
|
37
|
+
`[size-check] FAIL: unpacked size exceeds ${MAX_UNPACKED_MB} MB limit.\n` +
|
|
38
|
+
"[size-check] Inspect runtime/ - is something too big bundled in by mistake?\n",
|
|
39
|
+
);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
process.stdout.write(`[size-check] OK\n`);
|