@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
44 lines • 2.05 kB
TypeScript
import type { CompanyClient } from './company.js';
import { type OperationOptions, type OperationOutcome } from './operations.js';
import type { PoppyApiEntry } from './types.js';
/** API types this client understands (section 7). Others are skipped. */
export declare const KNOWN_API_TYPES: string[];
export declare function listApis(company: CompanyClient): PoppyApiEntry[];
export declare function pickApi(company: CompanyClient, type: 'openapi' | 'mcp', index?: number | undefined): PoppyApiEntry;
export interface OpenApiDoc {
servers?: {
url: string;
}[] | undefined;
paths?: Record<string, Record<string, {
summary?: string | undefined;
operationId?: string | undefined;
}>>;
[k: string]: unknown;
}
/** Loads an OpenAPI description. Tried as a public document first; through the Session if that's refused. */
export declare function loadOpenApi(company: CompanyClient, api: PoppyApiEntry): Promise<OpenApiDoc>;
/** The API's base URL: `servers[0].url` resolved against the description's URL. */
export declare function apiBaseUrl(doc: OpenApiDoc, api: PoppyApiEntry): string;
/**
* Calls an endpoint of a listed OpenAPI API (section 7), through the Session and, when signed in,
* with an access token. Refuses absolute URLs outside the API's own origin, so nothing goes to a
* third party.
*
* With the Operations extension, an action the Company wants approved comes back as an operation:
* it is decided (`operations.approve`, or `options.approve`) and the same request goes again with
* `Poppy-Approval`. `operation` then says how it ended; the action was done only when it is
* `performed`.
*/
export declare function callOpenApi(company: CompanyClient, input: {
method: string;
path: string;
body?: unknown | undefined;
apiIndex?: number | undefined;
scope?: string | undefined;
}, options?: OperationOptions): Promise<{
status: number;
headers: Headers;
body: unknown;
operation?: OperationOutcome | undefined;
}>;
//# sourceMappingURL=api.d.ts.map