@stll/folio-agents
Version:
Framework-neutral LLM tool layer over folio's ai-edits engine: function-calling tools so an agent can read and mutate .docx documents through @stll/folio-core.
20 lines (19 loc) • 708 B
JavaScript
//#region src/bridges/shared.ts
/**
* Map a core {@link FolioReviewChange} — from `FolioDocxReviewer.getChanges`
* (headless bridge, `bridges/reviewer.ts`) or `DocxEditorRef.getTrackedChanges`
* (live-editor bridge, `bridges/editor-ref.ts`) — to the tool-facing
* {@link FolioAgentChange} shape. Both bridges read the same underlying
* tracked-change record (`getTrackedChangesFromDoc` in
* `@stll/folio-core/ai-edits`), so they share this one mapping instead of
* drifting into two subtly different shapes.
*/
const toAgentChange = (change) => ({
id: String(change.id),
type: change.type,
author: change.author,
text: change.text,
blockId: change.blockId
});
//#endregion
export { toAgentChange };