@promptbook/remote-server
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
41 lines (40 loc) • 1.66 kB
TypeScript
/**
* Formats a JSON-schema fragment into a Zod expression for generated transpiled code.
*
* The Claude Code and AgentOS transpilers both need the same JSON-schema-to-Zod conversion,
* but Claude Code needs raw Zod shapes while AgentOS needs wrapped `z.object(...)` schemas.
*
* @param schema - JSON-schema fragment used for one tool input definition.
* @returns Zod expression source ready to embed in generated JavaScript.
*
* @private shared between Claude and AgentOS transpilers
*/
export declare function createZodSchemaSource(schema: JsonSchemaLike): string;
/**
* Formats a JSON-schema fragment into a raw Zod shape object literal.
*
* Claude Code SDK custom tools expect a Zod raw shape instead of a wrapped `z.object(...)`
* expression, so this helper reuses the same conversion logic but returns only the object literal
* body.
*
* @param schema - JSON-schema fragment used for one tool input definition.
* @returns Raw Zod shape source ready to embed in `tool(...)`.
*
* @private shared between Claude and AgentOS transpilers
*/
export declare function createZodShapeSource(schema: JsonSchemaLike): string;
/**
* Minimal JSON-schema shape used by the transpiled Claude and AgentOS harness generators.
*
* @private shared between Claude and AgentOS transpilers
*/
type JsonSchemaLike = {
readonly type?: string;
readonly description?: string;
readonly properties?: Record<string, JsonSchemaLike>;
readonly required?: ReadonlyArray<string>;
readonly items?: JsonSchemaLike;
readonly enum?: ReadonlyArray<string | number | boolean | null>;
readonly additionalProperties?: boolean;
};
export {};