From 427afe83d450b1bdd90f1b9bf98397e649a02a0b Mon Sep 17 00:00:00 2001 From: Xuwznln <18435084+Xuwznln@users.noreply.github.com> Date: Sun, 22 Mar 2026 03:36:28 +0800 Subject: [PATCH] minor fix on skill & registry --- .cursor/skills/create-device-skill/SKILL.md | 5 +++-- unilabos/registry/registry.py | 17 +---------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/.cursor/skills/create-device-skill/SKILL.md b/.cursor/skills/create-device-skill/SKILL.md index 805519fa..8f524141 100644 --- a/.cursor/skills/create-device-skill/SKILL.md +++ b/.cursor/skills/create-device-skill/SKILL.md @@ -182,11 +182,12 @@ API 模板结构: - ak/sk → AUTH, --addr → BASE URL ## Session State -- lab_uuid, device_name +- lab_uuid(通过 API #1 自动匹配,不要问用户), device_name ## API Endpoints (10 个) # 注意: -# - #1 获取 lab 列表需加 ?page=1&page_size=100 +# - #1 获取 lab 列表 + 自动匹配 lab_uuid(遍历 is_admin 的 lab, +# 调用 /lab/info/{uuid} 比对 access_key == ak) # - #2 创建工作流用 POST /lab/workflow # - #10 获取资源树路径含 lab_uuid: /lab/material/download/{lab_uuid} diff --git a/unilabos/registry/registry.py b/unilabos/registry/registry.py index b21e1a14..292dee92 100644 --- a/unilabos/registry/registry.py +++ b/unilabos/registry/registry.py @@ -181,21 +181,6 @@ class Registry: "module": "unilabos.ros.nodes.presets.host_node:HostNode", "status_types": {}, "action_value_mappings": { - "create_resource_detailed": { - "type": ResourceCreateFromOuter, - "goal": { - "resources": "resources", - "device_ids": "device_ids", - "bind_parent_ids": "bind_parent_ids", - "bind_locations": "bind_locations", - "other_calling_params": "other_calling_params", - }, - "feedback": {}, - "result": {"success": "success"}, - "schema": ros_action_to_json_schema(ResourceCreateFromOuter), - "goal_default": ROS2MessageInstance(ResourceCreateFromOuter.Goal()).get_python_dict(), - "handles": {}, - }, "create_resource": { "type": ResourceCreateFromOuterEasy, "goal": { @@ -713,7 +698,7 @@ class Registry: # ------------------------------------------------------------------ def _add_builtin_actions(self, device_config: Dict[str, Any], device_id: str): - """为设备添加内置的驱动命令动作""" + """为设备添加内置的驱动命令动作(运行时需要,上报注册表时会过滤掉)""" str_single_input = self._replace_type_with_class("StrSingleInput", device_id, "内置动作") for additional_action in ["_execute_driver_command", "_execute_driver_command_async"]: try: