UNPKG

@adonis-agora/agent

Version:

Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.

26 lines • 1.59 kB
import type { ToolCatalogEntry, ToolPresentation } from '../../../index.js'; /** Tool name → how the server said it is spoken about. */ export type ToolCatalog = Record<string, ToolPresentation>; /** Index `GET <base>/tools` by tool name, keeping only the tools that declared a presentation. */ export declare function toolCatalogFrom(entries: readonly ToolCatalogEntry[]): ToolCatalog; /** Dotted-path read. `undefined` rather than a throw, so a template can outlive a field. */ export declare const readPath: (value: unknown, path: string) => unknown; /** * Fill `{dotted.path}` placeholders from `context`. A placeholder with nothing behind it collapses * along with the whitespace in front of it, so "Reading {key}" degrades to "Reading" rather than * printing braces at a person; a filled one keeps the whitespace the author wrote ("({n} files)"). * The same filler the server resolves approval prompts with. */ export declare const fillTemplate: (template: string, context: unknown) => string; /** * The sentence for one call: the presentation's `running` or `done` template over the call's input. * * Nothing here reads the tool's name. A tool the catalog does not describe — added since the catalog * loaded, or declared without a presentation — is narrated generically (`fallback`), because the only * other thing available to say is its identifier. */ export declare function phraseFor(presentation: ToolPresentation | undefined, input: unknown, isSettled: boolean, fallback?: { running: string; done: string; }): string; //# sourceMappingURL=phrasing.d.ts.map