/* auto-generated by NAPI-RS */ /* eslint-disable */ export declare class CatalogBuilder { constructor(memoryOnly?: boolean | undefined | null, outputDir?: string | undefined | null) /** * # Errors * Does not fail; invalid tool entries are skipped. */ addTool(entry: any): void getToolInfo(serverName: string, toolName: string): any | null buildIndex(): CatalogIndexResult /** * # Errors * Returns an error when the catalog directory cannot be created or files cannot be written. */ writeCatalog(): CatalogIndexResult toCatalogDict(catalogPrefix?: string | undefined | null): any } export type CatalogBuilderNapi = CatalogBuilder /** In-memory decomposed catalog JSON (backed by Rust [`DecomposedCatalog`]). */ export declare class DecomposedCatalog { constructor(jsonFiles?: Record | undefined | null) /** * # Errors * Does not fail; invalid index shapes yield an empty decomposed catalog. */ static fromCatalogIndex(index: any): DecomposedCatalog static fromCatalogDict(data: any): DecomposedCatalog hasJson(key: string): boolean getJson(key: string): any | null resolveKey(filePath: string): string | null toJsonFiles(): Record } export type DecomposedCatalogNapi = DecomposedCatalog /** N-API policy context (defaults live in [`PolicyContext::new`]). */ export declare class PolicyContext { constructor(systemPolicy?: string | undefined | null, mcpPolicy?: string | undefined | null) get systemPolicy(): string set systemPolicy(value: string) get mcpPolicy(): string set mcpPolicy(value: string) get perTool(): Record set perTool(value: Record) get toolKind(): string | null set toolKind(value: string | undefined | null) } export type PolicyContextNapi = PolicyContext export declare class SkillsBuilderNapi { constructor(memoryOnly?: boolean | undefined | null, outputDir?: string | undefined | null) /** * # Errors * * Returns an error when a skill directory is missing or a markdown file cannot be read. */ buildFromDirs(skillDirs: Array, config?: PageIndexConfigNapi | undefined | null): Record /** * # Errors * * Returns an error when the skill file is missing or cannot be read. */ buildFromFile(sourcePath: string, config?: PageIndexConfigNapi | undefined | null): Record /** * # Errors * * Returns an error when the index has not been built or files cannot be written. */ writeCatalog(): Record /** * # Errors * * Returns an error when the index has not been built. */ toSkillsIndexJson(): any /** * # Errors * * Returns an error when the index has not been built. */ toSkillsDict(): any } export interface AnthropicCatalogEntriesResult { entries: Array enums: Array } export declare function anthropicToolIsMcp(tool: any): boolean export declare function anthropicToolIsSystem(tool: any): boolean export declare function anthropicToolsToCatalogEntries(tools: Array): AnthropicCatalogEntriesResult export declare function anthropicToolToCatalogEntry(tool: any): any | null export declare function appendDescriptionReinstateEntries(entries: Array, buildCatalog: any, catalogIndex: any, ctx: PolicyContext): Array /** * # Errors * * Returns an error when reconstruction fails. */ export declare function batchReconstructSkillMatches(groups: any): any export declare function batchToolPassThrough(ctx: PolicyContext, toolIds: Array): Array /** * Hash catalog documents plus analyzer settings. * * # Errors * * This function currently does not fail; the `Result` type is reserved for future validation. */ export declare function bm25CatalogFingerprint(data: any): string /** * # Errors * * Returns an error when config validation fails. */ export declare function bm25CohesionChunkNapi(text: string, config?: any | undefined | null): any /** * Return excluded entry refs and trace metadata for frontmatter gating. * * # Errors * * Returns an error when frontmatter scoring fails. */ export declare function bm25FrontmatterGate(entries: any, query: string, upperLimit?: number | undefined | null): any /** * Score catalog json/md lists in-place and return the updated catalog dict. * * # Errors * * Returns an error when catalog scoring fails. */ export declare function bm25ScoreCatalog(data: any, query: string, pruneJsonThreshold?: number | undefined | null, pruneMdThreshold?: number | undefined | null, pruneEnums?: boolean | undefined | null): any /** * Search skill chunks, reconstruct matches, return matches + trace. * * # Errors * * Returns an error when chunk search or reconstruction fails. */ export declare function bm25SearchSkillChunks(entries: any, query: string, threshold?: number | undefined | null, excluded?: any | undefined | null): any /** * # Errors * Does not fail; malformed tool entries are skipped during indexing. */ export declare function buildCatalogFromTools(tools: Array): CatalogIndexResult /** * # Errors * Does not fail; malformed tool entries are skipped during indexing. */ export declare function buildCatalogIndex(tools: Array, allEnums: Array): CatalogIndexResult /** * # Errors * * Returns an error when the chunk variant cannot be built. */ export declare function buildChunkVariant(entryDir: string, docId: string, pipeline: string, paramsHash: string, config?: PageIndexConfigNapi | undefined | null): Record /** * # Errors * * Returns an error when page index construction fails. */ export declare function buildPageIndexOnly(skillDirs: Array, config?: PageIndexConfigNapi | undefined | null): Record /** * Batch-load rerankable node bodies for skill entries. * * # Errors * * Returns an error when node catalog building fails. */ export declare function buildSkillNodeCatalog(entries: any): any /** * # Errors * * Returns an error when a skill directory is missing or a markdown file cannot be read. */ export declare function buildSkillsIndexNapi(skillDirs: Array, config?: PageIndexConfigNapi | undefined | null): Record export interface CatalogIndexResult { tools: Array files: Record } /** * # Errors * Does not fail; invalid index shapes yield an empty catalog dict. */ export declare function catalogIndexToCatalogDict(index: any, catalogPrefix?: string | undefined | null): any /** * # Errors * Does not fail; invalid index shapes yield empty metadata. */ export declare function catalogIndexToolSchemaMetadata(index: any): any export declare function catalogNeedsPartition(data: any, ctx: PolicyContext): boolean export declare function catalogNeedsPrunedRecompose(data: any, ctx: PolicyContext): boolean export declare function catalogPrefix(): string /** * # Errors * Returns an error when the tool count exceeds `u32::MAX`. */ export declare function catalogToolCount(data: any): number export declare function chunkSurvivorKey(item: any, section: string): string | null export declare function chunkToolId(item: any): string export declare function chunkVariantValid(entryDir: string, docId: string, pipeline: string, paramsHash: string): boolean /** * Classify optional chunks and optionally count tool tokens. * * # Errors * * Returns an error when catalog classification fails. */ export declare function classifyAndCountCatalog(catalogData: any, tools?: any | undefined | null): any export declare function classifyOptionalChunksBatch(items: Array): ClassifyOptionalChunksBatchResult export interface ClassifyOptionalChunksBatchResult { system: Array mcp: Array } export declare function collectEnums(schema: any): Array /** Override BM25 search defaults in the native core. */ export declare function configureBm25Defaults(indexDir?: string | undefined | null, stemLanguage?: string | undefined | null, stopwords?: string | undefined | null, useStopwords?: boolean | undefined | null, k1?: number | undefined | null, b?: number | undefined | null, mmap?: boolean | undefined | null): void /** * Apply in-memory cache tuning from a config object. * * # Errors * * Returns an error when the config object cannot be parsed. */ export declare function configureMemoryCache(config: any): void /** * # Errors * Does not fail; updates in-process path configuration. */ export declare function configurePathConstants(config: PathConfigNapi): void /** * # Errors * Does not fail; updates in-process runtime configuration. */ export declare function configureRuntimeDefaults(decomposedScore: number, enumScore: number, rerankScore: number, emptyOptionalFallbackK: number, defaultSystemPolicy: string, defaultMcpPolicy: string): void /** Override tokenizer defaults in the native core. */ export declare function configureTokenizerDefaults(encoding?: string | undefined | null, allowedSpecial?: string | undefined | null): void /** * Run skills BM25 search and tool BM25 prune in parallel. * * # Errors * * Returns an error when either composite pipeline fails. */ export declare function coordinateBm25Prune(skillsEntries: any, catalogData: any, buildCatalog: any, catalogIndex: any, query: string, scoringCtx: PolicyContext, outputCtx: PolicyContext, options?: any | undefined | null): any /** * Count tokens for a JSON value after compact serialization. * * # Errors * * Returns an error when serialization or tokenization fails. */ export declare function countJsonTokens(value: any): number /** * Count tokens in text using the configured tiktoken encoding. * * # Errors * * Returns an error when tokenization fails or the count exceeds `u32::MAX`. */ export declare function countTokens(text: string): number /** * Count tokens for multiple strings in one native call. * * # Errors * * Returns an error when tokenization fails for any input. */ export declare function countTokensBatch(texts: Array): Array export declare function decomposedPrefix(): string export declare function decomposedRoot(): string export declare function decomposedScore(): number export declare function directRootOptionalChunksForTool(items: Array, toolId: string): Array export declare function dropRecomposedToolsWithEmptyProperties(tools: Array, catalogIndex: any, ctx: PolicyContext): Array export declare function effectivePolicy(ctx: PolicyContext, toolId: string): string export declare function emptyOptionalFallbackK(): number export declare function ensureRootJsonForSurvivingTools(entries: Array, buildCatalog: any): Array /** * # Errors * * Returns an error when skills registry ensure fails. */ export declare function ensureSkillsRegistry(sourcePaths: Array, catalogRoot: string, pageindexConfig: any | undefined | null, pipeline: string, indexParamsHash: string, policy?: string | undefined | null): Array /** * # Errors * * Returns an error when tool catalog ensure fails. */ export declare function ensureToolCatalog(tools: any, policyFingerprint: string, toolsRoot: string, policy?: string | undefined | null): any /** * # Errors * * Returns an error when tool catalog ensure fails. */ export declare function ensureToolCatalogFromEntries(entries: Array, enums: Array, policyFingerprint: string, toolsRoot: string, policy?: string | undefined | null): any export declare function entriesForPolicy(ctx: PolicyContext, allEntries: Array): Array export declare function enumScore(): number /** Map a raw BM25 score to absolute similarity in `[0, 1]`. */ export declare function expSimilarity(raw: number): number export declare function extractDocumentText(item: any): string | null export declare function extractJsonCatalogDocument(item: any): string | null export declare function extractLevelInfo(item: any): Array export declare function extractMdCatalogDocument(item: any): string | null export declare function filterRecomposeJsonEntries(jsonList: Array, ctx: PolicyContext, rerankScore?: number | undefined | null, llmSelectedPaths?: Array | undefined | null): Array /** * # Errors * * Returns an error when entry metadata cannot be written. */ export declare function finalizeSkillDocumentJson(entryDir: string, docId: string, pipeline: string, indexParams: any, sourcePath: string): any export declare function fullPassThrough(ctx: PolicyContext): boolean export declare function getRootToolKey(filePath: string): string | null /** * # Errors * * Returns an error when specs are invalid or the document is missing. */ export declare function getSkillContentRetrieveResultNapi(index: any, docId: string, lineNumSpecs?: Array | undefined | null, nodeIdSpecs?: Array | undefined | null, chunkIdSpecs?: Array | undefined | null, options?: ReconstructOptionsNapi | undefined | null): any /** * # Errors * * Does not fail; returns an empty object when the document id is unknown. */ export declare function getSkillDocumentNapi(documents: any, docId: string): any /** * # Errors * * Does not fail; returns an empty array when line numbers or document id are unknown. */ export declare function getSkillLineContentFromSpecNapi(index: any, docId: string, lineNumSpec: string): any /** * # Errors * * Does not fail; returns an empty array when line numbers or document id are unknown. */ export declare function getSkillLineContentNapi(index: any, docId: string, lineNumSpecs?: Array | undefined | null, nodeIdSpecs?: Array | undefined | null, chunkIdSpecs?: Array | undefined | null): any /** * # Errors * * Does not fail; returns an empty array when the document id is unknown. */ export declare function getSkillStructureNapi(documents: any, docId: string): any export declare function getVersion(): string /** * # Errors * * Returns an error when greedy selection fails. */ export declare function greedySelectSkillItems(survivors: any, itemKind: string, maxTokens: number): any export declare function isDecomposedOptionalPropertyChunk(item: any): boolean export declare function isDecomposedToolRootChunk(item: any): boolean export declare function isDescriptionPolicy(policy: string): boolean export declare function isDirectRootOptionalPropertyChunk(item: any): boolean export declare function isMcpOptionalChunk(item: any): boolean export declare function isMcpRootChunk(item: any): boolean export declare function isNonSystemChunk(item: any): boolean export declare function isNonSystemToolId(toolId: string): boolean export declare function isSystemChunk(item: any): boolean export declare function isSystemOptionalChunk(item: any): boolean export declare function isSystemRootChunk(item: any): boolean export declare function isSystemToolId(toolId: string): boolean export declare function jsonEntriesForRecompose(data: any, pinned: any | undefined | null, buildCatalog: any, postRerankScored: any | undefined | null, ctx: PolicyContext, catalogIndex: any, pipeline: Array): Array export declare function jsonExt(): string /** * # Errors * Returns an error when the catalog directory cannot be read or parsed. */ export declare function loadCatalog(dirPath: string): any /** * # Errors * * Returns an error when the merged document JSON cannot be loaded. */ export declare function loadMergedSkillDocumentJson(entryDir: string, docId: string, chunkDir?: string | undefined | null): any /** * # Errors * * Returns an error when the catalog directory is invalid or files cannot be read. */ export declare function loadSkillsIndexFromDirNapi(catalogDir: string): Record /** * # Errors * * Returns an error when the skills index cannot be loaded from disk. */ export declare function loadSkillsIndexFromEntry(entryDir: string, docId: string, chunkDir?: string | undefined | null): Record export declare function mcpRequiredEnumValues(data: any): Array export declare function mcpToolsPassThrough(ctx: PolicyContext): boolean export declare function mdExt(): string /** * # Errors * * Does not fail; always returns a tree structure for the given markdown. */ export declare function mdToTreeNapi(markdownContent: string, sourcePath: string, config?: PageIndexConfigNapi | undefined | null): any export declare function mergeCatalog(processed: any, pinned: any): any export declare function mergeToolsPreservingOrder(original: Array, prunedByName: Record, stashedByName: Record): Array export declare function mitigateEmptyOptionalProperties(entries: Array, catalogIndex: any, ctx: PolicyContext, postRerankScored: any | undefined | null, pipeline: Array): Array export declare function needsDescriptionReinstate(ctx: PolicyContext): boolean export declare function needsPartition(ctx: PolicyContext): boolean export declare function needsPrunedRecompose(ctx: PolicyContext): boolean export declare function optionalLeafSurvivedRerank(item: any, ctx: PolicyContext, rerankScore?: number | undefined | null, llmSelectedPaths?: Array | undefined | null): boolean export interface PageIndexConfigNapi { ifAddNodeId?: boolean ifAddNodeText?: boolean enableBm25Chunking?: boolean bm25Cohesion?: any } export declare function pageIndexValid(entryDir: string, contentSha256: string): boolean /** * # Errors * * Returns an error when the chunk-id spec format is invalid. */ export declare function parseSkillChunkIdsNapi(spec: string): Array /** * # Errors * * Returns an error when the node-id spec format is invalid. */ export declare function parseSkillNodeIdsNapi(spec: string): Array /** * # Errors * Does not fail; returns empty partitions for invalid catalog shapes. */ export declare function partitionCatalog(data: any, ctx: PolicyContext): [any, any] export declare function pathBuilderMemoryOnly(): boolean export interface PathConfigNapi { mdExt: string jsonExt: string decomposedPrefix: string decomposedRoot: string catalogPrefix: string builderMemoryOnly: boolean defaultCatalogDir: string writeCatalogPrune: boolean } export declare function pathDefaultCatalogDir(): string export declare function pathWriteCatalogPrune(): boolean export declare function policyContextFromValues(config: any): PolicyContext export interface PolicyContextJs { systemPolicy?: string mcpPolicy?: string perTool?: Record toolKind?: string } export interface PolicyOptions { pruneOptionalTools?: Array systemPreserve?: Array mcpPreserve?: Array requiredByTool?: Record> requiredEnumValuesByTool?: Record> } /** * # Errors * Does not fail; invalid schema fragments are omitted from the entry. */ export declare function prepareToolEntry(serverName: string, name: string, description: string, inputSchema: any): any /** * Partition, BM25-score, recompose, and retrieve tools in one call. * * # Errors * * Returns an error when catalog shapes or retrieval fail. */ export declare function pruneCatalogBm25AndRetrieve(catalogData: any, buildCatalog: any, catalogIndex: any, query: string, scoringCtx: PolicyContext, outputCtx: PolicyContext, options?: any | undefined | null): any /** * Recompose pruned catalog survivors and retrieve merged tool schemas in one call. * * # Errors * * Returns an error when catalog shapes or retrieval fail. */ export declare function recomposeAndRetrieveTools(data: any, buildCatalog: any, catalogIndex: any, postRerank: any | undefined | null, postRerankScored: any | undefined | null, pinned: any | undefined | null, pipeline: Array, scoringCtx: PolicyContext, outputCtx: PolicyContext): any export interface ReconstructOptionsNapi { keepAllHeaders?: boolean } /** * # Errors * * Returns an error when specs are invalid or the document is missing. */ export declare function reconstructSkillMarkdownNapi(index: any, docId: string, lineNumSpecs?: Array | undefined | null, nodeIdSpecs?: Array | undefined | null, chunkIdSpecs?: Array | undefined | null, options?: ReconstructOptionsNapi | undefined | null): any /** * # Errors * Does not fail; missing catalog sections are treated as empty. */ export declare function removedChunks(fullCatalog: any, surviving: any, applyDecomposedScoreFilter?: boolean | undefined | null): any /** * # Errors * * Returns an error when chunk repair fails. */ export declare function repairSkillChunks(entryDir: string, docId: string, config?: PageIndexConfigNapi | undefined | null): void /** * # Errors * * Returns an error when variant chunk repair fails. */ export declare function repairSkillVariantChunks(entryDir: string, docId: string, pipeline: string, paramsHash: string, config?: PageIndexConfigNapi | undefined | null): void export declare function requestPassThrough(ctx: PolicyContext, tools: Array): boolean export declare function requiredEnumValuesByTool(data: any): Record> export declare function rerankScore(): number /** * # Errors * Does not fail; malformed catalog shapes yield an empty build catalog. */ export declare function resolveBuildCatalog(catalog: any, survivor: any): any export declare function restoreMcpTools(stash: Array): Array export declare function restoreSystemTools(stash: Array): Array /** * # Errors * Does not fail; missing catalog sections count as zero tools. */ export declare function retrieveCatalogToolCount(data: any): number /** * # Errors * Does not fail; malformed survivor or store entries are skipped. */ export declare function retrieveCore(data: any, storeJsonFiles: Record, survivorJsonFiles: Record, applyDecomposedScoreFilter?: boolean | undefined | null, policyOptions?: PolicyOptions | undefined | null): Array /** * # Errors * Does not fail; missing catalog data is treated as empty. */ export declare function retrieveTools(data: any, catalog: any, applyDecomposedScoreFilter?: boolean | undefined | null, preserveValues?: Array | undefined | null, policyCtx?: PolicyContextNapi | PolicyContextJs | undefined | null): Array export declare function rootChunkPropertiesEmpty(item: any): boolean export declare function rootToolIdFromChunk(item: any): string export declare function runtimeDefaultMcpPolicy(): string export declare function runtimeDefaultSystemPolicy(): string /** * # Errors * Returns an error when `policy` is not a recognized tool policy name. */ export declare function scoringPolicy(policy: string): string /** * BM25 skill search with optional budget selection. * * # Errors * * Returns an error when search or selection fails. */ export declare function searchSkillsAndSelect(entries: any, query: string, options?: any | undefined | null): any /** * # Errors * * Returns an error when the decomposed directory is missing or contains no documents. */ export declare function skillsIndexFromDecomposedDirNapi(dir: string): Record export declare function splitAnthropicTools(tools: Array): SplitAnthropicToolsResult export interface SplitAnthropicToolsResult { nonSystem: Array system: Array } export declare function stashMcpTools(tools: Array): Array export declare function stashSystemTools(tools: Array): Array export declare function systemRequiredEnumValues(data: any): Array export declare function systemToolsPassThrough(ctx: PolicyContext): boolean export declare function toDecomposedKey(filePath: string): string | null /** Parse ``token_count`` from decomposed markdown/JSON frontmatter when present. */ export declare function tokenCountFromDecomposedFrontmatterNapi(content: string): number | null export declare function toolIdFromDecomposedRel(relPath: string): string export declare function toolIdHadEmptyOriginalRootProperties(catalogIndex: any, toolId: string): boolean export declare function toolIdHasEmptyDecomposedRoot(catalogIndex: any, toolId: string): boolean export declare function toolPassThrough(ctx: PolicyContext, toolId: string): boolean export declare function toolPolicies(): Array /** * # Errors * * Returns an error when tool hashing fails. */ export declare function toolsCatalogContentHash(tools: any, policyFingerprint: string): string export declare function toolsForCatalog(ctx: PolicyContext, tools: Array): Array export declare function truncateDescription(description: string, maxTokens?: number | undefined | null): string /** * # Errors * * Returns an error when the document source path cannot be updated. */ export declare function updateSkillDocumentSourcePath(entryDir: string, docId: string, sourcePath: string): any /** * # Errors * Returns an error when the output directory cannot be created or catalog files cannot be written. */ export declare function writeCatalogIndex(index: any, outputDir?: string | undefined | null, prune?: boolean | undefined | null): void /** * # Errors * * Returns an error when reconstruction fails or the file cannot be written. */ export declare function writeReconstructedSkillNapi(catalogDir: string, index: any, docId: string, lineNumSpecs?: Array | undefined | null, nodeIdSpecs?: Array | undefined | null, chunkIdSpecs?: Array | undefined | null, options?: ReconstructOptionsNapi | undefined | null): string /** * # Errors * * Returns an error when the index shape is invalid or files cannot be written. */ export declare function writeSkillsIndexNapi(index: any, outputDir: string): void