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.
Files changed (330) hide show
  1. package/LICENSE +192 -0
  2. package/README.md +90 -4
  3. package/dist/commands/config.d.ts +20 -0
  4. package/dist/commands/config.d.ts.map +1 -0
  5. package/dist/commands/config.js +179 -0
  6. package/dist/commands/config.js.map +1 -0
  7. package/dist/commands/doctor.d.ts +33 -0
  8. package/dist/commands/doctor.d.ts.map +1 -0
  9. package/dist/commands/doctor.js +232 -0
  10. package/dist/commands/doctor.js.map +1 -0
  11. package/dist/commands/down.d.ts +15 -0
  12. package/dist/commands/down.d.ts.map +1 -0
  13. package/dist/commands/down.js +91 -0
  14. package/dist/commands/down.js.map +1 -0
  15. package/dist/commands/init.d.ts +21 -0
  16. package/dist/commands/init.d.ts.map +1 -0
  17. package/dist/commands/init.js +259 -0
  18. package/dist/commands/init.js.map +1 -0
  19. package/dist/commands/logs.d.ts +18 -0
  20. package/dist/commands/logs.d.ts.map +1 -0
  21. package/dist/commands/logs.js +67 -0
  22. package/dist/commands/logs.js.map +1 -0
  23. package/dist/commands/status.d.ts +12 -0
  24. package/dist/commands/status.d.ts.map +1 -0
  25. package/dist/commands/status.js +56 -0
  26. package/dist/commands/status.js.map +1 -0
  27. package/dist/commands/up.d.ts +20 -0
  28. package/dist/commands/up.d.ts.map +1 -0
  29. package/dist/commands/up.js +70 -0
  30. package/dist/commands/up.js.map +1 -0
  31. package/dist/index.d.ts +12 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +107 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/menu.d.ts +9 -0
  36. package/dist/menu.d.ts.map +1 -0
  37. package/dist/menu.js +96 -0
  38. package/dist/menu.js.map +1 -0
  39. package/dist/runners/real-robot.d.ts +15 -0
  40. package/dist/runners/real-robot.d.ts.map +1 -0
  41. package/dist/runners/real-robot.js +46 -0
  42. package/dist/runners/real-robot.js.map +1 -0
  43. package/dist/runners/sim.d.ts +19 -0
  44. package/dist/runners/sim.d.ts.map +1 -0
  45. package/dist/runners/sim.js +53 -0
  46. package/dist/runners/sim.js.map +1 -0
  47. package/dist/util/env.d.ts +24 -0
  48. package/dist/util/env.d.ts.map +1 -0
  49. package/dist/util/env.js +53 -0
  50. package/dist/util/env.js.map +1 -0
  51. package/dist/util/logger.d.ts +24 -0
  52. package/dist/util/logger.d.ts.map +1 -0
  53. package/dist/util/logger.js +62 -0
  54. package/dist/util/logger.js.map +1 -0
  55. package/dist/util/paths.d.ts +57 -0
  56. package/dist/util/paths.d.ts.map +1 -0
  57. package/dist/util/paths.js +132 -0
  58. package/dist/util/paths.js.map +1 -0
  59. package/dist/util/pidfile.d.ts +16 -0
  60. package/dist/util/pidfile.d.ts.map +1 -0
  61. package/dist/util/pidfile.js +63 -0
  62. package/dist/util/pidfile.js.map +1 -0
  63. package/dist/util/state.d.ts +26 -0
  64. package/dist/util/state.d.ts.map +1 -0
  65. package/dist/util/state.js +55 -0
  66. package/dist/util/state.js.map +1 -0
  67. package/package.json +60 -1
  68. package/runtime/BUNDLE.json +11 -0
  69. package/runtime/LICENSE +192 -0
  70. package/runtime/README.md +273 -0
  71. package/runtime/docs/architecture.md +366 -0
  72. package/runtime/docs/cli.md +140 -0
  73. package/runtime/docs/memory.md +292 -0
  74. package/runtime/docs/robot-setup.md +347 -0
  75. package/runtime/package.json +28 -0
  76. package/runtime/packages/agenticros/agenticros-agenticros-0.0.1.tgz +0 -0
  77. package/runtime/packages/agenticros/openclaw.plugin.json +451 -0
  78. package/runtime/packages/agenticros/package.json +41 -0
  79. package/runtime/packages/agenticros/src/camera-snapshot-cache.ts +59 -0
  80. package/runtime/packages/agenticros/src/camera-snapshot-routes.ts +44 -0
  81. package/runtime/packages/agenticros/src/commands/estop.ts +41 -0
  82. package/runtime/packages/agenticros/src/commands/transport.ts +195 -0
  83. package/runtime/packages/agenticros/src/config-file.ts +136 -0
  84. package/runtime/packages/agenticros/src/config-page.ts +498 -0
  85. package/runtime/packages/agenticros/src/context/robot-context.ts +373 -0
  86. package/runtime/packages/agenticros/src/depth.ts +313 -0
  87. package/runtime/packages/agenticros/src/describer.ts +157 -0
  88. package/runtime/packages/agenticros/src/image-binary-trim.ts +16 -0
  89. package/runtime/packages/agenticros/src/index.ts +85 -0
  90. package/runtime/packages/agenticros/src/landing-page.ts +38 -0
  91. package/runtime/packages/agenticros/src/memory.ts +44 -0
  92. package/runtime/packages/agenticros/src/plugin-api.ts +173 -0
  93. package/runtime/packages/agenticros/src/plugin-image-base64.ts +69 -0
  94. package/runtime/packages/agenticros/src/preflight.ts +110 -0
  95. package/runtime/packages/agenticros/src/routes.ts +328 -0
  96. package/runtime/packages/agenticros/src/safety/validator.ts +43 -0
  97. package/runtime/packages/agenticros/src/service.ts +359 -0
  98. package/runtime/packages/agenticros/src/skill-api.ts +65 -0
  99. package/runtime/packages/agenticros/src/skill-loader.ts +146 -0
  100. package/runtime/packages/agenticros/src/teleop/page.ts +498 -0
  101. package/runtime/packages/agenticros/src/teleop/routes.ts +650 -0
  102. package/runtime/packages/agenticros/src/tools/index.ts +26 -0
  103. package/runtime/packages/agenticros/src/tools/ros2-action.ts +50 -0
  104. package/runtime/packages/agenticros/src/tools/ros2-camera.ts +221 -0
  105. package/runtime/packages/agenticros/src/tools/ros2-depth-distance.ts +58 -0
  106. package/runtime/packages/agenticros/src/tools/ros2-introspect.ts +62 -0
  107. package/runtime/packages/agenticros/src/tools/ros2-memory.ts +158 -0
  108. package/runtime/packages/agenticros/src/tools/ros2-param.ts +87 -0
  109. package/runtime/packages/agenticros/src/tools/ros2-publish.ts +52 -0
  110. package/runtime/packages/agenticros/src/tools/ros2-service.ts +46 -0
  111. package/runtime/packages/agenticros/src/tools/ros2-subscribe.ts +71 -0
  112. package/runtime/packages/agenticros/tsconfig.json +9 -0
  113. package/runtime/packages/agenticros-claude-code/README.md +260 -0
  114. package/runtime/packages/agenticros-claude-code/config.example.json +9 -0
  115. package/runtime/packages/agenticros-claude-code/dist/config.d.ts +8 -0
  116. package/runtime/packages/agenticros-claude-code/dist/config.d.ts.map +1 -0
  117. package/runtime/packages/agenticros-claude-code/dist/config.js +93 -0
  118. package/runtime/packages/agenticros-claude-code/dist/config.js.map +1 -0
  119. package/runtime/packages/agenticros-claude-code/dist/depth.d.ts +20 -0
  120. package/runtime/packages/agenticros-claude-code/dist/depth.d.ts.map +1 -0
  121. package/runtime/packages/agenticros-claude-code/dist/depth.js +126 -0
  122. package/runtime/packages/agenticros-claude-code/dist/depth.js.map +1 -0
  123. package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.d.ts +6 -0
  124. package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.d.ts.map +1 -0
  125. package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.js +36 -0
  126. package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.js.map +1 -0
  127. package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.d.ts +33 -0
  128. package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.d.ts.map +1 -0
  129. package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.js +134 -0
  130. package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.js.map +1 -0
  131. package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.d.ts +43 -0
  132. package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.d.ts.map +1 -0
  133. package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.js +73 -0
  134. package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.js.map +1 -0
  135. package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.d.ts +58 -0
  136. package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.d.ts.map +1 -0
  137. package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.js +251 -0
  138. package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.js.map +1 -0
  139. package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.d.ts +61 -0
  140. package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.d.ts.map +1 -0
  141. package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.js +268 -0
  142. package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.js.map +1 -0
  143. package/runtime/packages/agenticros-claude-code/dist/index.d.ts +3 -0
  144. package/runtime/packages/agenticros-claude-code/dist/index.d.ts.map +1 -0
  145. package/runtime/packages/agenticros-claude-code/dist/index.js +111 -0
  146. package/runtime/packages/agenticros-claude-code/dist/index.js.map +1 -0
  147. package/runtime/packages/agenticros-claude-code/dist/memory.d.ts +17 -0
  148. package/runtime/packages/agenticros-claude-code/dist/memory.d.ts.map +1 -0
  149. package/runtime/packages/agenticros-claude-code/dist/memory.js +44 -0
  150. package/runtime/packages/agenticros-claude-code/dist/memory.js.map +1 -0
  151. package/runtime/packages/agenticros-claude-code/dist/safety.d.ts +10 -0
  152. package/runtime/packages/agenticros-claude-code/dist/safety.d.ts.map +1 -0
  153. package/runtime/packages/agenticros-claude-code/dist/safety.js +34 -0
  154. package/runtime/packages/agenticros-claude-code/dist/safety.js.map +1 -0
  155. package/runtime/packages/agenticros-claude-code/dist/tools.d.ts +36 -0
  156. package/runtime/packages/agenticros-claude-code/dist/tools.d.ts.map +1 -0
  157. package/runtime/packages/agenticros-claude-code/dist/tools.js +777 -0
  158. package/runtime/packages/agenticros-claude-code/dist/tools.js.map +1 -0
  159. package/runtime/packages/agenticros-claude-code/dist/transport.d.ts +17 -0
  160. package/runtime/packages/agenticros-claude-code/dist/transport.d.ts.map +1 -0
  161. package/runtime/packages/agenticros-claude-code/dist/transport.js +46 -0
  162. package/runtime/packages/agenticros-claude-code/dist/transport.js.map +1 -0
  163. package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.d.ts +42 -0
  164. package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.d.ts.map +1 -0
  165. package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.js +114 -0
  166. package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.js.map +1 -0
  167. package/runtime/packages/agenticros-claude-code/package.json +29 -0
  168. package/runtime/packages/agenticros-claude-code/src/config.ts +96 -0
  169. package/runtime/packages/agenticros-claude-code/src/depth.ts +173 -0
  170. package/runtime/packages/agenticros-claude-code/src/find-object/coco-classes.ts +38 -0
  171. package/runtime/packages/agenticros-claude-code/src/find-object/find-object.ts +190 -0
  172. package/runtime/packages/agenticros-claude-code/src/follow-me/controller.ts +109 -0
  173. package/runtime/packages/agenticros-claude-code/src/follow-me/depth-loop.ts +420 -0
  174. package/runtime/packages/agenticros-claude-code/src/follow-me/detector.ts +303 -0
  175. package/runtime/packages/agenticros-claude-code/src/follow-me/loop.ts +330 -0
  176. package/runtime/packages/agenticros-claude-code/src/index.ts +125 -0
  177. package/runtime/packages/agenticros-claude-code/src/memory.ts +51 -0
  178. package/runtime/packages/agenticros-claude-code/src/safety.ts +44 -0
  179. package/runtime/packages/agenticros-claude-code/src/tools.ts +891 -0
  180. package/runtime/packages/agenticros-claude-code/src/transport.ts +58 -0
  181. package/runtime/packages/agenticros-claude-code/src/zero-shot/detector.ts +169 -0
  182. package/runtime/packages/agenticros-claude-code/tsconfig.json +9 -0
  183. package/runtime/packages/agenticros-claude-code/yolo-debug.mjs +106 -0
  184. package/runtime/packages/agenticros-gemini/README.md +139 -0
  185. package/runtime/packages/agenticros-gemini/package.json +28 -0
  186. package/runtime/packages/agenticros-gemini/scripts/smoke-api.mjs +42 -0
  187. package/runtime/packages/agenticros-gemini/src/chat.ts +139 -0
  188. package/runtime/packages/agenticros-gemini/src/config.ts +92 -0
  189. package/runtime/packages/agenticros-gemini/src/depth.ts +173 -0
  190. package/runtime/packages/agenticros-gemini/src/index.ts +58 -0
  191. package/runtime/packages/agenticros-gemini/src/memory.ts +32 -0
  192. package/runtime/packages/agenticros-gemini/src/safety.ts +44 -0
  193. package/runtime/packages/agenticros-gemini/src/tools.ts +516 -0
  194. package/runtime/packages/agenticros-gemini/src/transport.ts +58 -0
  195. package/runtime/packages/agenticros-gemini/tsconfig.json +8 -0
  196. package/runtime/packages/core/package.json +47 -0
  197. package/runtime/packages/core/src/banner.ts +32 -0
  198. package/runtime/packages/core/src/cmd-vel-twist.ts +31 -0
  199. package/runtime/packages/core/src/config.ts +279 -0
  200. package/runtime/packages/core/src/index.ts +54 -0
  201. package/runtime/packages/core/src/memory/__tests__/factory.test.ts +70 -0
  202. package/runtime/packages/core/src/memory/__tests__/local-provider.test.ts +195 -0
  203. package/runtime/packages/core/src/memory/__tests__/mem0-provider.test.ts +192 -0
  204. package/runtime/packages/core/src/memory/__tests__/smart-defaults.test.ts +46 -0
  205. package/runtime/packages/core/src/memory/factory.ts +63 -0
  206. package/runtime/packages/core/src/memory/index.ts +10 -0
  207. package/runtime/packages/core/src/memory/local/provider.ts +229 -0
  208. package/runtime/packages/core/src/memory/mem0/provider.ts +379 -0
  209. package/runtime/packages/core/src/memory/types.ts +96 -0
  210. package/runtime/packages/core/src/topic-utils.ts +95 -0
  211. package/runtime/packages/core/src/transport/factory.ts +47 -0
  212. package/runtime/packages/core/src/transport/local/conversion.ts +333 -0
  213. package/runtime/packages/core/src/transport/local/entities.ts +129 -0
  214. package/runtime/packages/core/src/transport/local/transport.ts +406 -0
  215. package/runtime/packages/core/src/transport/rosbridge/actions.ts +81 -0
  216. package/runtime/packages/core/src/transport/rosbridge/adapter.ts +157 -0
  217. package/runtime/packages/core/src/transport/rosbridge/client.ts +438 -0
  218. package/runtime/packages/core/src/transport/rosbridge/services.ts +41 -0
  219. package/runtime/packages/core/src/transport/rosbridge/topics.ts +60 -0
  220. package/runtime/packages/core/src/transport/rosbridge/types.ts +118 -0
  221. package/runtime/packages/core/src/transport/transport.ts +77 -0
  222. package/runtime/packages/core/src/transport/types.ts +137 -0
  223. package/runtime/packages/core/src/transport/webrtc/signaling-client.ts +196 -0
  224. package/runtime/packages/core/src/transport/webrtc/signaling-types.ts +130 -0
  225. package/runtime/packages/core/src/transport/webrtc/transport.ts +516 -0
  226. package/runtime/packages/core/src/transport/zenoh/adapter.ts +357 -0
  227. package/runtime/packages/core/src/transport/zenoh/cdr.ts +183 -0
  228. package/runtime/packages/core/src/transport/zenoh/keys.ts +51 -0
  229. package/runtime/packages/core/tsconfig.json +9 -0
  230. package/runtime/packages/ros-camera/package.json +30 -0
  231. package/runtime/packages/ros-camera/src/index.ts +13 -0
  232. package/runtime/packages/ros-camera/src/snapshot.ts +372 -0
  233. package/runtime/packages/ros-camera/tsconfig.json +9 -0
  234. package/runtime/pnpm-lock.yaml +5260 -0
  235. package/runtime/pnpm-workspace.yaml +2 -0
  236. package/runtime/ros2_ws/src/agenticros_agent/agenticros_agent/__init__.py +0 -0
  237. package/runtime/ros2_ws/src/agenticros_agent/agenticros_agent/agent_node.py +561 -0
  238. package/runtime/ros2_ws/src/agenticros_agent/package.xml +25 -0
  239. package/runtime/ros2_ws/src/agenticros_agent/resource/agenticros_agent +0 -0
  240. package/runtime/ros2_ws/src/agenticros_agent/setup.cfg +4 -0
  241. package/runtime/ros2_ws/src/agenticros_agent/setup.py +25 -0
  242. package/runtime/ros2_ws/src/agenticros_bringup/README.md +128 -0
  243. package/runtime/ros2_ws/src/agenticros_bringup/agenticros_bringup/__init__.py +1 -0
  244. package/runtime/ros2_ws/src/agenticros_bringup/agenticros_bringup/cmd_vel_relay.py +33 -0
  245. package/runtime/ros2_ws/src/agenticros_bringup/launch/cmd_vel_bridge.launch.py +58 -0
  246. package/runtime/ros2_ws/src/agenticros_bringup/launch/gazebo_turtlebot3.launch.py +69 -0
  247. package/runtime/ros2_ws/src/agenticros_bringup/launch/mode_a_gazebo.launch.py +55 -0
  248. package/runtime/ros2_ws/src/agenticros_bringup/launch/mode_a_gazebo_rviz.launch.py +48 -0
  249. package/runtime/ros2_ws/src/agenticros_bringup/launch/realsense_rosbridge.launch.py +154 -0
  250. package/runtime/ros2_ws/src/agenticros_bringup/launch/rosbridge_gazebo.launch.py +54 -0
  251. package/runtime/ros2_ws/src/agenticros_bringup/launch/rviz.launch.py +38 -0
  252. package/runtime/ros2_ws/src/agenticros_bringup/launch/turtlebot3_gazebo_rviz.launch.py +42 -0
  253. package/runtime/ros2_ws/src/agenticros_bringup/package.xml +24 -0
  254. package/runtime/ros2_ws/src/agenticros_bringup/resource/agenticros_bringup +0 -0
  255. package/runtime/ros2_ws/src/agenticros_bringup/rviz/turtlebot3_agenticros.rviz +174 -0
  256. package/runtime/ros2_ws/src/agenticros_bringup/setup.cfg +4 -0
  257. package/runtime/ros2_ws/src/agenticros_bringup/setup.py +28 -0
  258. package/runtime/ros2_ws/src/agenticros_discovery/agenticros_discovery/__init__.py +0 -0
  259. package/runtime/ros2_ws/src/agenticros_discovery/agenticros_discovery/discovery_node.py +172 -0
  260. package/runtime/ros2_ws/src/agenticros_discovery/package.xml +22 -0
  261. package/runtime/ros2_ws/src/agenticros_discovery/resource/agenticros_discovery +0 -0
  262. package/runtime/ros2_ws/src/agenticros_discovery/setup.cfg +5 -0
  263. package/runtime/ros2_ws/src/agenticros_discovery/setup.py +25 -0
  264. package/runtime/ros2_ws/src/agenticros_follow_me/README.md +66 -0
  265. package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/__init__.py +1 -0
  266. package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/__main__.py +5 -0
  267. package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/follow_me_node.py +278 -0
  268. package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/follower_controller.py +631 -0
  269. package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/person_tracker.py +635 -0
  270. package/runtime/ros2_ws/src/agenticros_follow_me/package.xml +22 -0
  271. package/runtime/ros2_ws/src/agenticros_follow_me/resource/agenticros_follow_me +0 -0
  272. package/runtime/ros2_ws/src/agenticros_follow_me/setup.py +25 -0
  273. package/runtime/ros2_ws/src/agenticros_msgs/CMakeLists.txt +26 -0
  274. package/runtime/ros2_ws/src/agenticros_msgs/msg/CapabilityManifest.msg +9 -0
  275. package/runtime/ros2_ws/src/agenticros_msgs/package.xml +22 -0
  276. package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeGetStatus.srv +11 -0
  277. package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeSetDistance.srv +4 -0
  278. package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeSetTarget.srv +6 -0
  279. package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeStart.srv +5 -0
  280. package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeStop.srv +3 -0
  281. package/runtime/ros2_ws/src/agenticros_msgs/srv/GetCapabilities.srv +5 -0
  282. package/runtime/ros2_ws/src/agenticros_sim/CMakeLists.txt +24 -0
  283. package/runtime/ros2_ws/src/agenticros_sim/README.md +120 -0
  284. package/runtime/ros2_ws/src/agenticros_sim/config/agenticros-sim.config.json +28 -0
  285. package/runtime/ros2_ws/src/agenticros_sim/config/amr_bridge.yaml +111 -0
  286. package/runtime/ros2_ws/src/agenticros_sim/config/amr_view.rviz +172 -0
  287. package/runtime/ros2_ws/src/agenticros_sim/env-hooks/gz_resource_path.dsv.in +3 -0
  288. package/runtime/ros2_ws/src/agenticros_sim/env-hooks/gz_resource_path.sh.in +7 -0
  289. package/runtime/ros2_ws/src/agenticros_sim/launch/sim_amr.launch.py +159 -0
  290. package/runtime/ros2_ws/src/agenticros_sim/models/agenticros_amr/model.config +17 -0
  291. package/runtime/ros2_ws/src/agenticros_sim/models/agenticros_amr/model.sdf +244 -0
  292. package/runtime/ros2_ws/src/agenticros_sim/package.xml +27 -0
  293. package/runtime/ros2_ws/src/agenticros_sim/worlds/agenticros_indoor.sdf +183 -0
  294. package/runtime/scripts/activate_workspace.sh +285 -0
  295. package/runtime/scripts/agenticros-describer.policy.yaml +96 -0
  296. package/runtime/scripts/agenticros-proxy.cjs +99 -0
  297. package/runtime/scripts/agenticros-rosbridge.policy.yaml +62 -0
  298. package/runtime/scripts/check-cli-tarball-size.mjs +42 -0
  299. package/runtime/scripts/configure_agenticros.sh +200 -0
  300. package/runtime/scripts/configure_for_sim.sh +64 -0
  301. package/runtime/scripts/fix-openclaw-control-ui-path.sh +20 -0
  302. package/runtime/scripts/install_cli.sh +94 -0
  303. package/runtime/scripts/install_rosbridge_from_source.sh +67 -0
  304. package/runtime/scripts/lib/agenticros-banner.sh +28 -0
  305. package/runtime/scripts/onboard_robot.sh +75 -0
  306. package/runtime/scripts/openai.policy.yaml +77 -0
  307. package/runtime/scripts/openclaw-dashboard-url.cjs +49 -0
  308. package/runtime/scripts/pack-runtime.mjs +245 -0
  309. package/runtime/scripts/run_demo_native.sh +43 -0
  310. package/runtime/scripts/run_nemoclaw_host_stack.sh +91 -0
  311. package/runtime/scripts/run_robot_rosbridge.sh +36 -0
  312. package/runtime/scripts/sandbox_rosbridge_relay.py +137 -0
  313. package/runtime/scripts/setup-openclaw-local.cjs +75 -0
  314. package/runtime/scripts/setup_gateway_plugin.sh +329 -0
  315. package/runtime/scripts/setup_robot.sh +113 -0
  316. package/runtime/scripts/setup_workspace.sh +484 -0
  317. package/runtime/scripts/sim/run_sim.sh +146 -0
  318. package/runtime/scripts/smoke_test_nemoclaw.sh +123 -0
  319. package/runtime/scripts/start_demo.sh +55 -0
  320. package/runtime/scripts/sync-skill-tools.mjs +335 -0
  321. package/runtime/scripts/test-follow-me-sim.mjs +135 -0
  322. package/runtime/scripts/test-mcp-e2e.mjs +184 -0
  323. package/runtime/scripts/test-rclnodejs.mts +129 -0
  324. package/runtime/scripts/use-openclaw-2026.2.26.sh +19 -0
  325. package/runtime/scripts/use-openclaw-2026.3.11.sh +19 -0
  326. package/runtime/scripts/zenoh-bridge-ros2dds-robot.json5 +30 -0
  327. package/runtime/scripts/zenohd-agenticros.json5 +11 -0
  328. package/runtime/scripts/zenohd-rosclaw.json5 +11 -0
  329. package/runtime/tsconfig.base.json +19 -0
  330. package/index.js +0 -6
@@ -0,0 +1,245 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * pack-runtime.mjs
4
+ *
5
+ * Pre-publish helper for the `agenticros` npm package.
6
+ *
7
+ * Produces `packages/agenticros-cli/runtime/`: a near-complete snapshot of the
8
+ * monorepo source that ships inside the published tarball. After
9
+ * `npx agenticros init`, this runtime/ tree is copied into ~/agenticros (or
10
+ * $AGENTICROS_HOME) and treated as the user's workspace - so the layout
11
+ * matches the live repo exactly. Contributors get live edits without ever
12
+ * going through this script.
13
+ *
14
+ * What ships:
15
+ * - scripts/ shell helpers, install scripts, sim entrypoints
16
+ * - ros2_ws/src/agenticros_* our ROS 2 packages (msgs + Python nodes)
17
+ * - packages/{core,ros-camera,agenticros,agenticros-claude-code,agenticros-gemini}
18
+ * TypeScript sources for the workspace, NO dist or node_modules
19
+ * - packages/agenticros-claude-code/dist (pre-built so `npx agenticros` works without colcon)
20
+ * - package.json / pnpm-workspace.yaml / tsconfig.base.json monorepo manifests
21
+ * - docs/cli.md reference for the CLI (used by `agenticros logs --help`)
22
+ * - README.md / LICENSE top-level docs
23
+ *
24
+ * What we deliberately drop:
25
+ * - .git/ massive, and `agenticros init` doesn't need history
26
+ * - node_modules/ reinstalled by `agenticros init`
27
+ * - All packages/* dist/ except agenticros-claude-code/dist
28
+ * - ros2_ws/build / install / log
29
+ * - The CLI's own source (it's already installed by npm)
30
+ * - .pnpm-store, .cache, .ccache, generated logs
31
+ *
32
+ * Invocation:
33
+ * node scripts/pack-runtime.mjs # from repo root
34
+ * pnpm --filter agenticros pack:runtime # via the CLI package's scripts
35
+ */
36
+
37
+ import { execSync } from "node:child_process";
38
+ import { cpSync, existsSync, mkdirSync, rmSync, statSync, writeFileSync } from "node:fs";
39
+ import { dirname, join, relative, resolve } from "node:path";
40
+ import { fileURLToPath } from "node:url";
41
+
42
+ const __filename = fileURLToPath(import.meta.url);
43
+ const __dirname = dirname(__filename);
44
+ const REPO_ROOT = resolve(__dirname, "..");
45
+ const CLI_PKG_DIR = join(REPO_ROOT, "packages", "agenticros-cli");
46
+ const RUNTIME_DIR = join(CLI_PKG_DIR, "runtime");
47
+
48
+ const INCLUDED_PACKAGES = [
49
+ "core",
50
+ "ros-camera",
51
+ "agenticros",
52
+ "agenticros-claude-code",
53
+ "agenticros-gemini",
54
+ ];
55
+
56
+ const TOP_LEVEL_FILES = [
57
+ "package.json",
58
+ "pnpm-workspace.yaml",
59
+ "pnpm-lock.yaml",
60
+ "tsconfig.base.json",
61
+ "LICENSE",
62
+ "README.md",
63
+ ".npmrc",
64
+ ];
65
+
66
+ const DOCS_FILES = ["cli.md", "architecture.md", "robot-setup.md", "memory.md"];
67
+
68
+ const EXCLUDED_DIR_NAMES = new Set([
69
+ "node_modules",
70
+ ".git",
71
+ ".pnpm-store",
72
+ ".cache",
73
+ ".ccache",
74
+ ".turbo",
75
+ "build",
76
+ "install",
77
+ "log",
78
+ ".tsbuildinfo",
79
+ ]);
80
+
81
+ const EXCLUDED_FILE_GLOBS = [
82
+ /^\.DS_Store$/,
83
+ /\.tsbuildinfo$/,
84
+ /^\.env(\.|$)/,
85
+ /^npm-debug\.log/,
86
+ ];
87
+
88
+ function logStep(message) {
89
+ process.stdout.write(`[pack-runtime] ${message}\n`);
90
+ }
91
+
92
+ function logSubstep(message) {
93
+ process.stdout.write(`[pack-runtime] ${message}\n`);
94
+ }
95
+
96
+ function isExcluded(srcPath) {
97
+ const base = srcPath.split("/").pop() ?? "";
98
+ if (EXCLUDED_DIR_NAMES.has(base)) return true;
99
+ for (const re of EXCLUDED_FILE_GLOBS) if (re.test(base)) return true;
100
+ return false;
101
+ }
102
+
103
+ function copyTree(src, dest, opts = {}) {
104
+ const { allowDist = false } = opts;
105
+ if (!existsSync(src)) {
106
+ logSubstep(`skip (missing): ${relative(REPO_ROOT, src)}`);
107
+ return;
108
+ }
109
+ mkdirSync(dirname(dest), { recursive: true });
110
+ cpSync(src, dest, {
111
+ recursive: true,
112
+ dereference: false,
113
+ errorOnExist: false,
114
+ force: true,
115
+ filter: (s, _d) => {
116
+ const rel = s.startsWith(src + "/") ? s.slice(src.length + 1) : "";
117
+ const parts = rel.split("/");
118
+ for (const p of parts) {
119
+ if (EXCLUDED_DIR_NAMES.has(p)) return false;
120
+ }
121
+ // Drop dist/ from every package except the explicitly allowed ones.
122
+ if (!allowDist && parts.includes("dist")) return false;
123
+ const base = parts[parts.length - 1] ?? "";
124
+ for (const re of EXCLUDED_FILE_GLOBS) if (re.test(base)) return false;
125
+ return true;
126
+ },
127
+ });
128
+ }
129
+
130
+ function reset() {
131
+ if (existsSync(RUNTIME_DIR)) {
132
+ logStep(`Clearing existing runtime/ at ${relative(REPO_ROOT, RUNTIME_DIR)}`);
133
+ rmSync(RUNTIME_DIR, { recursive: true, force: true });
134
+ }
135
+ mkdirSync(RUNTIME_DIR, { recursive: true });
136
+ }
137
+
138
+ function copyScripts() {
139
+ logStep("Copying scripts/");
140
+ copyTree(join(REPO_ROOT, "scripts"), join(RUNTIME_DIR, "scripts"));
141
+ }
142
+
143
+ function copyRos2Ws() {
144
+ logStep("Copying ros2_ws/src/agenticros_*");
145
+ const dest = join(RUNTIME_DIR, "ros2_ws", "src");
146
+ mkdirSync(dest, { recursive: true });
147
+ // Only include AgenticROS packages, not arbitrary upstream sources.
148
+ const srcRoot = join(REPO_ROOT, "ros2_ws", "src");
149
+ if (!existsSync(srcRoot)) {
150
+ logSubstep("skip (missing ros2_ws/src)");
151
+ return;
152
+ }
153
+ for (const entry of readdirSync(srcRoot)) {
154
+ if (!entry.startsWith("agenticros_")) {
155
+ logSubstep(`skip non-agenticros pkg: ${entry}`);
156
+ continue;
157
+ }
158
+ copyTree(join(srcRoot, entry), join(dest, entry));
159
+ }
160
+ }
161
+
162
+ function copyPackages() {
163
+ logStep("Copying packages/*");
164
+ const pkgRoot = join(REPO_ROOT, "packages");
165
+ const dest = join(RUNTIME_DIR, "packages");
166
+ mkdirSync(dest, { recursive: true });
167
+ for (const pkg of INCLUDED_PACKAGES) {
168
+ const allowDist = pkg === "agenticros-claude-code";
169
+ if (allowDist) {
170
+ logSubstep(`${pkg} (including pre-built dist/)`);
171
+ } else {
172
+ logSubstep(`${pkg} (src only)`);
173
+ }
174
+ copyTree(join(pkgRoot, pkg), join(dest, pkg), { allowDist });
175
+ }
176
+ }
177
+
178
+ function copyTopLevel() {
179
+ logStep("Copying top-level manifests");
180
+ for (const file of TOP_LEVEL_FILES) {
181
+ const src = join(REPO_ROOT, file);
182
+ if (existsSync(src) && statSync(src).isFile()) {
183
+ const dest = join(RUNTIME_DIR, file);
184
+ mkdirSync(dirname(dest), { recursive: true });
185
+ cpSync(src, dest);
186
+ logSubstep(file);
187
+ }
188
+ }
189
+ }
190
+
191
+ function copyDocs() {
192
+ logStep("Copying selected docs/");
193
+ const docsSrc = join(REPO_ROOT, "docs");
194
+ const docsDest = join(RUNTIME_DIR, "docs");
195
+ mkdirSync(docsDest, { recursive: true });
196
+ for (const file of DOCS_FILES) {
197
+ const src = join(docsSrc, file);
198
+ if (existsSync(src)) {
199
+ cpSync(src, join(docsDest, file));
200
+ logSubstep(file);
201
+ } else {
202
+ logSubstep(`skip (missing): docs/${file}`);
203
+ }
204
+ }
205
+ }
206
+
207
+ function writeBundleManifest() {
208
+ const manifestPath = join(RUNTIME_DIR, "BUNDLE.json");
209
+ const manifest = {
210
+ packedAt: new Date().toISOString(),
211
+ repo: "https://github.com/PlaiPin/agenticros",
212
+ note: "This directory is a snapshot of the agenticros monorepo source. `agenticros init` will copy it to ~/agenticros and run pnpm install + colcon build there.",
213
+ layout: {
214
+ scripts: "scripts/",
215
+ ros2_packages: "ros2_ws/src/agenticros_*",
216
+ js_packages: "packages/*",
217
+ mcp_prebuilt: "packages/agenticros-claude-code/dist/index.js",
218
+ },
219
+ };
220
+ writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
221
+ logStep(`Wrote BUNDLE.json`);
222
+ }
223
+
224
+ function reportSize() {
225
+ try {
226
+ const out = execSync(`du -sh ${RUNTIME_DIR}`, { encoding: "utf8" });
227
+ const size = out.split(/\s+/)[0];
228
+ logStep(`runtime/ size: ${size}`);
229
+ } catch {
230
+ // du missing — skip
231
+ }
232
+ }
233
+
234
+ // Lazy import for readdirSync to keep the top of the file tidy.
235
+ import { readdirSync } from "node:fs";
236
+
237
+ reset();
238
+ copyScripts();
239
+ copyRos2Ws();
240
+ copyPackages();
241
+ copyTopLevel();
242
+ copyDocs();
243
+ writeBundleManifest();
244
+ reportSize();
245
+ logStep("Done.");
@@ -0,0 +1,43 @@
1
+ #!/bin/bash
2
+ # run_demo_native.sh - Start rosbridge + discovery for AgenticROS demo (no Docker)
3
+ #
4
+ # Prerequisites (one-time):
5
+ # sudo apt install -y ros-jazzy-rosbridge-suite # or ros-humble-rosbridge-suite
6
+ #
7
+ # Usage: ./scripts/run_demo_native.sh [jazzy|humble]
8
+ # Default: jazzy
9
+
10
+ set -e
11
+
12
+ ROS_DISTRO="${1:-jazzy}"
13
+ REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
14
+ source "$REPO_ROOT/scripts/lib/agenticros-banner.sh"
15
+ agenticros_banner
16
+ echo "Starting AgenticROS native ROS bridge stack"
17
+ echo ""
18
+
19
+ source "/opt/ros/$ROS_DISTRO/setup.bash"
20
+ [[ -f "$REPO_ROOT/ros2_ws/install/setup.bash" ]] && source "$REPO_ROOT/ros2_ws/install/setup.bash"
21
+
22
+ # If rosbridge was built from source, use venv's Python deps
23
+ for _d in "$REPO_ROOT/ros2_ws/venv_rosbridge/lib/python"*/site-packages; do
24
+ [[ -d "$_d" ]] && export PYTHONPATH="$_d:${PYTHONPATH:-}" && break
25
+ done
26
+
27
+ if ! ros2 pkg list 2>/dev/null | grep -q rosbridge_server; then
28
+ echo "rosbridge_suite is not installed. Run once (then re-run this script):"
29
+ echo " sudo apt install -y ros-$ROS_DISTRO-rosbridge-suite"
30
+ exit 1
31
+ fi
32
+
33
+ echo "Starting rosbridge WebSocket on port 9090 and agenticros_discovery..."
34
+ echo "Connect OpenClaw plugin to: ws://localhost:9090"
35
+ echo "Press Ctrl+C to stop."
36
+ echo ""
37
+
38
+ # Start discovery in background; rosbridge in foreground so we see logs
39
+ ros2 run agenticros_discovery discovery_node &
40
+ DISC_PID=$!
41
+ trap "kill $DISC_PID 2>/dev/null" EXIT
42
+
43
+ ros2 launch rosbridge_server rosbridge_websocket_launch.xml
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Start the host-side ROS 2 stack the NemoClaw sandbox talks to:
4
+ #
5
+ # RealSense (realsense2_camera) + rosbridge_server + cmd_vel relay
6
+ #
7
+ # Architecture (hybrid NemoClaw setup):
8
+ #
9
+ # ┌──────────────── host (Jetson) ────────────────┐
10
+ # │ /opt/ros/humble + librealsense2 │
11
+ # │ ros2 launch agenticros_bringup … │
12
+ # │ realsense2_camera → /camera/camera/* │
13
+ # │ rosbridge_server on 0.0.0.0:9090 │
14
+ # │ cmd_vel_relay /<ns>/cmd_vel→/cmd_vel│
15
+ # └───────────────────┬───────────────────────────┘
16
+ # │ ws on 172.19.0.1:9090
17
+ # ▼
18
+ # ┌──────────── NemoClaw sandbox ─────────────────┐
19
+ # │ OpenClaw + AgenticROS plugin │
20
+ # │ rosbridge.url = ws://host.docker.internal:9090│
21
+ # └───────────────────────────────────────────────┘
22
+ #
23
+ # Usage: ./scripts/run_nemoclaw_host_stack.sh [ros_distro] [extra args...]
24
+ #
25
+ # Example: ./scripts/run_nemoclaw_host_stack.sh humble \
26
+ # robot_namespace:=3946b404-c33e-4aa3-9a8d-16deb1c5c593 \
27
+ # align_depth:=true
28
+ #
29
+ # Defaults to ROS 2 Humble (matches what's installed on a Jetson Orin Nano).
30
+ # Pass jazzy etc. if your host runs a different distro.
31
+
32
+ set -e
33
+
34
+ ROS_DISTRO="${1:-humble}"
35
+ shift || true
36
+
37
+ REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
38
+ source "$REPO_ROOT/scripts/lib/agenticros-banner.sh"
39
+ agenticros_banner
40
+ echo "Starting AgenticROS host stack for NemoClaw"
41
+ echo ""
42
+ SETUP="/opt/ros/${ROS_DISTRO}/setup.bash"
43
+
44
+ if [[ ! -f "$SETUP" ]]; then
45
+ echo "ROS 2 ${ROS_DISTRO} not found at ${SETUP}." >&2
46
+ echo "Install ROS 2 (e.g. ros-${ROS_DISTRO}-desktop) or pass a different distro: $0 jazzy ..." >&2
47
+ exit 1
48
+ fi
49
+
50
+ # shellcheck disable=SC1090
51
+ source "$SETUP"
52
+
53
+ WS_INSTALL="$REPO_ROOT/ros2_ws/install/setup.bash"
54
+ if [[ ! -f "$WS_INSTALL" ]]; then
55
+ echo "agenticros_bringup not built yet. Building agenticros_msgs + agenticros_bringup …"
56
+ (
57
+ cd "$REPO_ROOT/ros2_ws"
58
+ colcon build --packages-select agenticros_msgs agenticros_bringup
59
+ )
60
+ fi
61
+ # shellcheck disable=SC1090
62
+ source "$WS_INSTALL"
63
+
64
+ for pkg in rosbridge_server realsense2_camera image_transport_plugins; do
65
+ if ! ros2 pkg prefix "$pkg" >/dev/null 2>&1; then
66
+ case "$pkg" in
67
+ rosbridge_server)
68
+ echo "Missing ros-${ROS_DISTRO}-rosbridge-suite. Install with:" >&2
69
+ echo " sudo apt-get install -y ros-${ROS_DISTRO}-rosbridge-suite" >&2
70
+ ;;
71
+ realsense2_camera)
72
+ echo "Missing ros-${ROS_DISTRO}-realsense2-camera. Install with:" >&2
73
+ echo " sudo apt-get install -y ros-${ROS_DISTRO}-realsense2-camera" >&2
74
+ ;;
75
+ image_transport_plugins)
76
+ echo "Missing ros-${ROS_DISTRO}-image-transport-plugins (needed for compressed camera topic). Install with:" >&2
77
+ echo " sudo apt-get install -y ros-${ROS_DISTRO}-image-transport-plugins" >&2
78
+ ;;
79
+ esac
80
+ exit 1
81
+ fi
82
+ done
83
+
84
+ echo "── agenticros: host stack for NemoClaw ─────────────────────────"
85
+ echo " ROS: ${ROS_DISTRO}"
86
+ echo " RealSense: realsense2_camera (color + depth, aligned)"
87
+ echo " Rosbridge: ws://0.0.0.0:9090 (sandbox connects via host.docker.internal:9090)"
88
+ echo " cmd_vel: /<robot_namespace>/cmd_vel → /cmd_vel"
89
+ echo "────────────────────────────────────────────────────────────────"
90
+
91
+ exec ros2 launch agenticros_bringup realsense_rosbridge.launch.py "$@"
@@ -0,0 +1,36 @@
1
+ #!/bin/bash
2
+ # run_robot_rosbridge.sh - Start rosbridge WebSocket server on the robot
3
+ #
4
+ # Run this on the robot so the AgenticROS plugin (OpenClaw) can connect to ROS2.
5
+ # Usage: ./scripts/run_robot_rosbridge.sh [humble|jazzy]
6
+ # Default ROS distro: humble
7
+
8
+ set -e
9
+
10
+ ROS_DISTRO="${1:-jazzy}"
11
+ REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
12
+
13
+ if [[ -f "/opt/ros/$ROS_DISTRO/setup.bash" ]]; then
14
+ source "/opt/ros/$ROS_DISTRO/setup.bash"
15
+ else
16
+ echo "ROS2 $ROS_DISTRO not found. Usage: $0 [humble|jazzy]"
17
+ exit 1
18
+ fi
19
+
20
+ if [[ -f "$REPO_ROOT/ros2_ws/install/setup.bash" ]]; then
21
+ source "$REPO_ROOT/ros2_ws/install/setup.bash"
22
+ fi
23
+
24
+ # If rosbridge was built from source, use venv's Python deps (tornado, pymongo, cbor2)
25
+ for _d in "$REPO_ROOT/ros2_ws/venv_rosbridge/lib/python"*/site-packages; do
26
+ [[ -d "$_d" ]] && export PYTHONPATH="$_d:${PYTHONPATH:-}" && break
27
+ done
28
+
29
+ if ! ros2 pkg list 2>/dev/null | grep -q rosbridge_server; then
30
+ echo "rosbridge_suite not found. Install it with:"
31
+ echo " sudo apt install -y ros-$ROS_DISTRO-rosbridge-suite"
32
+ exit 1
33
+ fi
34
+
35
+ echo "Starting rosbridge WebSocket server on port 9090 (ROS_DISTRO=$ROS_DISTRO)"
36
+ exec ros2 launch rosbridge_server rosbridge_websocket_launch.xml
@@ -0,0 +1,137 @@
1
+ #!/usr/bin/env python3
2
+ """TCP relay: 10.200.0.1:9090 -> 172.19.0.1:9090.
3
+
4
+ Why this exists:
5
+
6
+ In a NemoClaw / OpenShell hybrid setup, the AgenticROS plugin runs
7
+ inside the gateway process, which lives in the OpenShell-created
8
+ sandbox network namespace. From that netns:
9
+
10
+ * 10.200.0.0/24 is routable (the sandbox-host veth pair lives here).
11
+ * 172.19.0.0/16 (Docker bridge, where host.docker.internal resolves)
12
+ is NOT routable directly. All non-bypass traffic is forced through
13
+ the OPA policy proxy at 10.200.0.1:3128.
14
+
15
+ Custom policy presets added via ``nemoclaw policy-add --from-file``
16
+ are *recorded* but not actually activated for proxy enforcement
17
+ decisions in current NemoClaw releases. So the plugin's WebSocket
18
+ upgrade requests to ws://host.docker.internal:9090 get policy_denied
19
+ even with a custom preset in place.
20
+
21
+ This relay sidesteps the policy proxy entirely by binding inside the
22
+ sandbox *container's main netns* (where 10.200.0.1 is owned by the
23
+ veth-h interface that connects to the sandbox netns) and forwarding
24
+ every connection to the rosbridge_server on the Docker host.
25
+
26
+ How the connection flows:
27
+
28
+ AgenticROS plugin (sandbox netns)
29
+ |
30
+ | ws://10.200.0.1:9090
31
+ v
32
+ relay listening on 10.200.0.1:9090 (container main netns)
33
+ |
34
+ | TCP forward
35
+ v
36
+ 172.19.0.1:9090 (Docker bridge gateway IP — the host's rosbridge)
37
+
38
+ Run inside the sandbox container::
39
+
40
+ docker exec -d <container> python3 /tmp/sandbox_rosbridge_relay.py \\
41
+ --bind 10.200.0.1:9090 --target 172.19.0.1:9090
42
+
43
+ The matching plugin config (``~/.openclaw/openclaw.json`` inside the
44
+ sandbox) uses::
45
+
46
+ "rosbridge": { "url": "ws://10.200.0.1:9090" }
47
+ """
48
+
49
+ from __future__ import annotations
50
+
51
+ import argparse
52
+ import logging
53
+ import select
54
+ import socket
55
+ import threading
56
+ from typing import Tuple
57
+
58
+
59
+ def _parse_addr(value: str, default_port: int) -> Tuple[str, int]:
60
+ if ":" in value:
61
+ host, port_str = value.rsplit(":", 1)
62
+ return host, int(port_str)
63
+ return value, default_port
64
+
65
+
66
+ def _pipe(src: socket.socket, dst: socket.socket, label: str) -> None:
67
+ try:
68
+ while True:
69
+ chunk = src.recv(65536)
70
+ if not chunk:
71
+ break
72
+ dst.sendall(chunk)
73
+ except (OSError, ConnectionError) as exc:
74
+ logging.debug("%s pipe closed: %s", label, exc)
75
+ finally:
76
+ try:
77
+ dst.shutdown(socket.SHUT_WR)
78
+ except OSError:
79
+ pass
80
+
81
+
82
+ def _handle(client: socket.socket, peer: Tuple[str, int], target: Tuple[str, int]) -> None:
83
+ logging.info("accept %s -> %s:%d", peer, *target)
84
+ upstream = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
85
+ try:
86
+ upstream.connect(target)
87
+ except OSError as exc:
88
+ logging.warning("upstream %s:%d unreachable: %s", *target, exc)
89
+ client.close()
90
+ return
91
+ t1 = threading.Thread(target=_pipe, args=(client, upstream, "c->u"), daemon=True)
92
+ t2 = threading.Thread(target=_pipe, args=(upstream, client, "u->c"), daemon=True)
93
+ t1.start()
94
+ t2.start()
95
+ t1.join()
96
+ t2.join()
97
+ client.close()
98
+ upstream.close()
99
+ logging.info("closed %s", peer)
100
+
101
+
102
+ def serve(bind: Tuple[str, int], target: Tuple[str, int]) -> None:
103
+ srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
104
+ srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
105
+ srv.bind(bind)
106
+ srv.listen(64)
107
+ logging.info("relay listening on %s:%d -> %s:%d", *bind, *target)
108
+ try:
109
+ while True:
110
+ client, peer = srv.accept()
111
+ threading.Thread(target=_handle, args=(client, peer, target), daemon=True).start()
112
+ except KeyboardInterrupt:
113
+ logging.info("shutting down")
114
+ finally:
115
+ srv.close()
116
+
117
+
118
+ def main() -> None:
119
+ ap = argparse.ArgumentParser(description=__doc__)
120
+ ap.add_argument("--bind", default="10.200.0.1:9090", help="host:port to listen on")
121
+ ap.add_argument("--target", default="172.19.0.1:9090", help="host:port to forward to")
122
+ ap.add_argument(
123
+ "--log-level",
124
+ default="INFO",
125
+ choices=["DEBUG", "INFO", "WARNING", "ERROR"],
126
+ help="logging verbosity",
127
+ )
128
+ args = ap.parse_args()
129
+ logging.basicConfig(
130
+ level=getattr(logging, args.log_level),
131
+ format="%(asctime)s relay %(levelname)s %(message)s",
132
+ )
133
+ serve(_parse_addr(args.bind, 9090), _parse_addr(args.target, 9090))
134
+
135
+
136
+ if __name__ == "__main__":
137
+ main()
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Set OpenClaw gateway to no-auth mode for local development so that:
4
+ * - Web chat (Control UI) loads without a token
5
+ * - AgenticROS plugin routes (config, teleop) are accepted and load at /plugins/agenticros/
6
+ *
7
+ * In OpenClaw 2026.3.2, when gateway.auth is token-based, the gateway rejects plugin
8
+ * HTTP route registration ("missing or invalid auth"), so plugin pages return 404.
9
+ * Setting gateway.auth.mode to "none" fixes this for loopback-only use.
10
+ *
11
+ * Usage:
12
+ * node scripts/setup-openclaw-local.cjs
13
+ * # Restart the gateway: openclaw gateway
14
+ * # Then open: http://127.0.0.1:18789/ (web chat) and http://127.0.0.1:18789/plugins/agenticros/
15
+ *
16
+ * WARNING: Only use on a gateway bound to 127.0.0.1. Do not use on a LAN/internet-facing gateway.
17
+ */
18
+
19
+ const fs = require('fs');
20
+ const path = require('path');
21
+
22
+ const configPath = process.env.OPENCLAW_CONFIG || path.join(process.env.HOME || '', '.openclaw', 'openclaw.json');
23
+
24
+ let config;
25
+ try {
26
+ const raw = fs.readFileSync(configPath, 'utf8');
27
+ config = JSON.parse(raw);
28
+ } catch (e) {
29
+ console.error('Could not read OpenClaw config:', configPath, e.message);
30
+ process.exit(1);
31
+ }
32
+
33
+ if (!config.gateway) {
34
+ config.gateway = {};
35
+ }
36
+ if (!config.gateway.auth) {
37
+ config.gateway.auth = {};
38
+ }
39
+
40
+ const prev = config.gateway.auth.mode;
41
+ config.gateway.auth.mode = 'none';
42
+ // Remove token so the gateway does not re-enable token auth; with mode "none" it is ignored anyway
43
+ if (config.gateway.auth.token) {
44
+ delete config.gateway.auth.token;
45
+ }
46
+
47
+ if (prev === 'none' && !config.gateway.auth.token) {
48
+ console.log('OpenClaw is already set to auth.mode "none" at', configPath);
49
+ process.exit(0);
50
+ }
51
+
52
+ // Backup
53
+ const backupPath = configPath + '.bak.' + Date.now();
54
+ try {
55
+ fs.copyFileSync(configPath, backupPath);
56
+ console.log('Backed up config to', backupPath);
57
+ } catch (e) {
58
+ console.warn('Could not create backup:', e.message);
59
+ }
60
+
61
+ try {
62
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', 'utf8');
63
+ } catch (e) {
64
+ console.error('Could not write config:', e.message);
65
+ process.exit(1);
66
+ }
67
+
68
+ console.log('');
69
+ console.log(' Set gateway.auth.mode to "none" in', configPath);
70
+ console.log(' Restart the gateway (openclaw gateway), then open:');
71
+ console.log(' - Web chat: http://127.0.0.1:18789/');
72
+ console.log(' - AgenticROS config & teleop: http://127.0.0.1:18789/plugins/agenticros/');
73
+ console.log('');
74
+ console.log(' For local use only (127.0.0.1). To restore token auth later, set gateway.auth.mode to "token" and add gateway.auth.token.');
75
+ console.log('');