UNPKG

agentfootprint

Version:

The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.

14 lines • 580 B
import { decodeText } from './text.js'; export function mockLoader(options = {}) { return { name: 'mock', extensions: options.extensions ?? ['.md', '.txt', '.html', '.pdf', '.mock'], // eslint-disable-next-line @typescript-eslint/require-await async load(input) { const pages = options.pagesFor?.(input.uri); const text = options.textFor?.(input.uri) ?? decodeText(input.bytes); return { text: pages ? pages.join('\n\n') : text, ...(pages && { pages }) }; }, }; } //# sourceMappingURL=mock.js.map