mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 07:51:26 +00:00
Revert "iOS: wire node services and tests"
This reverts commit 7b0a0f3dac.
This commit is contained in:
@@ -37,7 +37,6 @@ const NODES_TOOL_ACTIONS = [
|
||||
"screen_record",
|
||||
"location_get",
|
||||
"run",
|
||||
"invoke",
|
||||
] as const;
|
||||
|
||||
const NOTIFY_PRIORITIES = ["passive", "active", "timeSensitive"] as const;
|
||||
@@ -85,9 +84,6 @@ const NodesToolSchema = Type.Object({
|
||||
commandTimeoutMs: Type.Optional(Type.Number()),
|
||||
invokeTimeoutMs: Type.Optional(Type.Number()),
|
||||
needsScreenRecording: Type.Optional(Type.Boolean()),
|
||||
// invoke
|
||||
invokeCommand: Type.Optional(Type.String()),
|
||||
invokeParamsJson: Type.Optional(Type.String()),
|
||||
});
|
||||
|
||||
export function createNodesTool(options?: {
|
||||
@@ -103,7 +99,7 @@ export function createNodesTool(options?: {
|
||||
label: "Nodes",
|
||||
name: "nodes",
|
||||
description:
|
||||
"Discover and control paired nodes (status/describe/pairing/notify/camera/screen/location/run/invoke).",
|
||||
"Discover and control paired nodes (status/describe/pairing/notify/camera/screen/location/run).",
|
||||
parameters: NodesToolSchema,
|
||||
execute: async (_toolCallId, args) => {
|
||||
const params = args as Record<string, unknown>;
|
||||
@@ -442,31 +438,6 @@ export function createNodesTool(options?: {
|
||||
});
|
||||
return jsonResult(raw?.payload ?? {});
|
||||
}
|
||||
case "invoke": {
|
||||
const node = readStringParam(params, "node", { required: true });
|
||||
const nodeId = await resolveNodeId(gatewayOpts, node);
|
||||
const invokeCommand = readStringParam(params, "invokeCommand", { required: true });
|
||||
const invokeParamsJson =
|
||||
typeof params.invokeParamsJson === "string" ? params.invokeParamsJson.trim() : "";
|
||||
let invokeParams: unknown = {};
|
||||
if (invokeParamsJson) {
|
||||
try {
|
||||
invokeParams = JSON.parse(invokeParamsJson);
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : String(err);
|
||||
throw new Error(`invokeParamsJson must be valid JSON: ${message}`, { cause: err });
|
||||
}
|
||||
}
|
||||
const invokeTimeoutMs = parseTimeoutMs(params.invokeTimeoutMs);
|
||||
const raw = await callGatewayTool("node.invoke", gatewayOpts, {
|
||||
nodeId,
|
||||
command: invokeCommand,
|
||||
params: invokeParams,
|
||||
timeoutMs: invokeTimeoutMs,
|
||||
idempotencyKey: crypto.randomUUID(),
|
||||
});
|
||||
return jsonResult(raw ?? {});
|
||||
}
|
||||
default:
|
||||
throw new Error(`Unknown action: ${action}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user