mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-28 22:31:13 +00:00
* refactor(deadcode): trim auto-reply and CLI exports * refactor(deadcode): trim cron and task exports * refactor(deadcode): trim fleet and process exports * test(deadcode): exercise live task and process seams * test(fleet): cover stream redaction through owner module * refactor(security): trim dead internal exports * refactor(secrets): trim dead internal exports * refactor(deadcode): trim remaining src exports * refactor(deadcode): remove test-only runtime exports * refactor(deadcode): trim pairing test exports * refactor(deadcode): reconcile refreshed baseline * test(auto-reply): deduplicate queue state imports
24 lines
760 B
TypeScript
24 lines
760 B
TypeScript
// Converts planned tool entries into protocol payloads for model runtimes.
|
|
import type { JsonObject, ToolPlanEntry } from "./types.js";
|
|
|
|
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);
|
|
}
|