mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 09:11:12 +00:00
feat(nodes): add device status and info actions
This commit is contained in:
@@ -42,6 +42,8 @@ const NODES_TOOL_ACTIONS = [
|
||||
"screen_record",
|
||||
"location_get",
|
||||
"notifications_list",
|
||||
"device_status",
|
||||
"device_info",
|
||||
"run",
|
||||
"invoke",
|
||||
] as const;
|
||||
@@ -297,12 +299,23 @@ export function createNodesTool(options?: {
|
||||
const result: AgentToolResult<unknown> = { content, details };
|
||||
return await sanitizeToolResultImages(result, "nodes:camera_snap", imageSanitization);
|
||||
}
|
||||
case "camera_list": {
|
||||
case "camera_list":
|
||||
case "notifications_list":
|
||||
case "device_status":
|
||||
case "device_info": {
|
||||
const node = readStringParam(params, "node", { required: true });
|
||||
const command =
|
||||
action === "camera_list"
|
||||
? "camera.list"
|
||||
: action === "notifications_list"
|
||||
? "notifications.list"
|
||||
: action === "device_status"
|
||||
? "device.status"
|
||||
: "device.info";
|
||||
const payloadRaw = await invokeNodeCommandPayload({
|
||||
gatewayOpts,
|
||||
node,
|
||||
command: "camera.list",
|
||||
command,
|
||||
});
|
||||
const payload =
|
||||
payloadRaw && typeof payloadRaw === "object" && payloadRaw !== null ? payloadRaw : {};
|
||||
@@ -430,15 +443,6 @@ export function createNodesTool(options?: {
|
||||
});
|
||||
return jsonResult(payload);
|
||||
}
|
||||
case "notifications_list": {
|
||||
const node = readStringParam(params, "node", { required: true });
|
||||
const payload = await invokeNodeCommandPayload({
|
||||
gatewayOpts,
|
||||
node,
|
||||
command: "notifications.list",
|
||||
});
|
||||
return jsonResult(payload);
|
||||
}
|
||||
case "run": {
|
||||
const node = readStringParam(params, "node", { required: true });
|
||||
const nodes = await listNodes(gatewayOpts);
|
||||
|
||||
Reference in New Issue
Block a user