mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 16:10:43 +00:00
19 lines
508 B
TypeScript
19 lines
508 B
TypeScript
import type { ToolExecutorRef } from "./types.js";
|
|
|
|
export function formatToolExecutorRef(ref: ToolExecutorRef): string {
|
|
switch (ref.kind) {
|
|
case "core":
|
|
return `core:${ref.executorId}`;
|
|
case "plugin":
|
|
return `plugin:${ref.pluginId}:${ref.toolName}`;
|
|
case "channel":
|
|
return `channel:${ref.channelId}:${ref.actionId}`;
|
|
case "mcp":
|
|
return `mcp:${ref.serverId}:${ref.toolName}`;
|
|
default: {
|
|
const exhaustive: never = ref;
|
|
return exhaustive;
|
|
}
|
|
}
|
|
}
|