@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
68 lines • 1.95 kB
TypeScript
import { type ImageContent, type TextContent } from "@earendil-works/pi-ai";
import { type TSchema } from "typebox";
import { buildMcpToolNames, type McpToolNameEntry } from "./naming.ts";
import { collectAllPages, type McpListPage, type McpPaginationResult } from "./pagination.ts";
export type { McpListPage, McpPaginationResult, McpToolNameEntry };
export { buildMcpToolNames, collectAllPages };
interface SchemaConversionResult {
schema: TSchema;
warnings: string[];
}
interface OutputSchemaRetryResult {
schema: Record<string, unknown>;
warnings: string[];
}
export type McpContentBlock = {
type: "text";
text?: unknown;
} | {
type: "image";
data?: unknown;
mimeType?: unknown;
} | {
type: "audio";
data?: unknown;
mimeType?: unknown;
} | {
type: "resource";
resource?: unknown;
} | {
type: "resource_link";
uri?: unknown;
name?: unknown;
description?: unknown;
mimeType?: unknown;
} | Record<string, unknown>;
export type McpMappedContentBlock = TextContent | ImageContent | {
type: "audio";
data: string;
mimeType: string;
} | {
type: "resource";
resource: unknown;
} | {
type: "resource_link";
uri: string;
name?: string;
description?: string;
mimeType?: string;
};
export interface McpToolResultLike {
content?: McpContentBlock[];
structuredContent?: unknown;
isError?: boolean;
}
export type McpMappedToolResult = {
ok: true;
content: McpMappedContentBlock[];
} | {
ok: false;
error: {
message: string;
content: McpMappedContentBlock[];
};
};
export declare function convertJsonSchemaToTypeBox(schema: unknown, modern?: boolean): SchemaConversionResult;
export declare function prepareOutputSchemaRetry(schema: unknown): OutputSchemaRetryResult;
export declare function mapMcpToolResult(result: McpToolResultLike): McpMappedToolResult;
//# sourceMappingURL=schema-compat.d.ts.map