Files
openclaw/src/tools/protocol.ts
Peter Steinberger e2ec8283c4 refactor(deadcode): trim mid-size src exports (#105888)
* 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
2026-07-13 00:42:56 -07:00

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);
}