@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.
21 lines • 1.41 kB
TypeScript
import { FolioAgentToolName, FolioToolCallResult } from "./types.js";
import { FolioAgentBridge } from "./bridge.js";
import { FolioAgentToolOptions } from "./suggest-changes-options.js";
import { FolioAgentToolInputByName, FolioToolCallResultFor } from "./tool-contract.js";
//#region src/execute.d.ts
/**
* Execute one tool call against a {@link FolioAgentBridge}. Every EXPECTED
* failure — bad arguments, an unknown tool name, a capability the bridge does
* not implement, a domain-level skip — comes back as `{ ok: false, error }`
* with a message meant to be fed straight back to the model; it is never
* thrown. This function is the sole boundary layer allowed to catch an
* unexpected throw from the bridge and fold it into that same shape (per
* AGENTS.md, try/catch is acceptable at boundary layers).
*
* Every bridge member used here ({@link FolioDocxReviewer} and the live-editor
* ref) is synchronous, so this stays synchronous too.
*/
declare const executeFolioToolCallUntyped: (name: string, args: unknown, bridge: FolioAgentBridge, options?: FolioAgentToolOptions) => FolioToolCallResult;
declare function executeFolioToolCall<TName extends FolioAgentToolName>(name: TName, args: FolioAgentToolInputByName[TName], bridge: FolioAgentBridge, options?: FolioAgentToolOptions): FolioToolCallResultFor<TName>;
//#endregion
export { executeFolioToolCall, executeFolioToolCallUntyped };