import { anthropicToolToCatalogEntryNative, anthropicToolsToCatalogEntriesNative, buildCatalogFromToolsNative, buildCatalogIndexNative, catalogIndexToCatalogDictNative, catalogToolCountNative, prepareToolEntryNative, truncateDescriptionNative, } from "./native.js";
import { collectEnums } from "./paths.js";
export { collectEnums };
export function catalogToolCount(data) {
    return catalogToolCountNative(data);
}
export class CatalogIndex {
    tools;
    files;
    constructor(tools, files = {}) {
        this.tools = tools;
        this.files = files;
    }
    toCatalogDict(catalogPrefix) {
        return catalogIndexToCatalogDictNative({ tools: this.tools, files: this.files }, catalogPrefix);
    }
}
function catalogIndexFromRaw(raw) {
    return new CatalogIndex([...raw.tools], { ...raw.files });
}
export function buildCatalogIndex(tools, allEnums) {
    const raw = buildCatalogIndexNative(tools, allEnums);
    return catalogIndexFromRaw(raw);
}
export function buildCatalogFromTools(tools) {
    const raw = buildCatalogFromToolsNative(tools);
    return catalogIndexFromRaw(raw);
}
export function prepareToolEntry(serverName, name, description, inputSchema) {
    return prepareToolEntryNative(serverName, name, description, inputSchema);
}
export function anthropicToolToCatalogEntry(tool) {
    return anthropicToolToCatalogEntryNative(tool);
}
export function anthropicToolsToCatalogEntries(tools) {
    return anthropicToolsToCatalogEntriesNative(tools);
}
export function truncateDescription(description, maxTokens = 60) {
    return truncateDescriptionNative(description, maxTokens);
}
//# sourceMappingURL=build.js.map