mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 08:10:43 +00:00
23 lines
691 B
TypeScript
23 lines
691 B
TypeScript
import type { JsonObject, ToolPlanEntry } from "./types.js";
|
|
|
|
export type ToolProtocolDescriptor = {
|
|
readonly name: string;
|
|
readonly description: string;
|
|
readonly inputSchema: JsonObject;
|
|
};
|
|
|
|
// Shared descriptor shape only. Model/provider adapters still own schema normalization.
|
|
export function toToolProtocolDescriptor(entry: ToolPlanEntry): ToolProtocolDescriptor {
|
|
return {
|
|
name: entry.descriptor.name,
|
|
description: entry.descriptor.description,
|
|
inputSchema: entry.descriptor.inputSchema,
|
|
};
|
|
}
|
|
|
|
export function toToolProtocolDescriptors(
|
|
entries: readonly ToolPlanEntry[],
|
|
): readonly ToolProtocolDescriptor[] {
|
|
return entries.map(toToolProtocolDescriptor);
|
|
}
|