UNPKG

@adonis-agora/agent

Version:

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

48 lines • 2.52 kB
import { type TextActionProposalConfig, type TextActionProposalVocabulary } from './action-proposal-text.js'; import type { ActionProposalScope, ActionProposalStore, ListActionProposals } from './spi/action-proposal-store.js'; import { type ApprovalPolicy } from './spi/approval-policy.js'; import type { Actor } from './types.js'; export interface ActionProposalScopeStore { getThreadActionProposalScope(threadId: string): Promise<ActionProposalScope | null>; } export declare class ActionProposalServiceError extends Error { readonly status: 400 | 403 | 404 | 501; constructor(status: 400 | 403 | 404 | 501, message: string); } /** Authenticated decisions live independently of the origin runner and its signals. */ export declare class ActionProposalService { private readonly store; private readonly policy?; /** The words a text decision is made of — `actionProposalText.vocabulary` over the defaults. */ readonly vocabulary: TextActionProposalVocabulary; private readonly replies; constructor(store: ActionProposalStore & ActionProposalScopeStore, policy?: ApprovalPolicy | undefined, text?: TextActionProposalConfig); private scope; list(actor: Actor, threadId: string, after?: ListActionProposals['after']): Promise<import("./spi/action-proposal-store.js").ActionProposal[]>; listPage(actor: Actor, threadId: string, after?: ListActionProposals['after']): Promise<{ items: import("./spi/action-proposal-store.js").ActionProposal[]; next?: { createdAt: number; id: string; }; }>; handleTextDecision(actor: Actor, threadId: string, text: string): Promise<{ status: 'unmatched'; } | { threadId: string; proposalDecision: import("./spi/action-proposal-store.js").ActionProposalMutationResult; text: string; } | { threadId: string; proposalDecision: { status: 'ambiguous'; proposalIds: string[]; }; text: string; }>; /** The configured reply to a decision the store answered with `result`. */ reply(result: import('./spi/action-proposal-store.js').ActionProposalMutationResult, decision: 'approved' | 'rejected'): string; private canDecide; decide(actor: Actor, threadId: string, proposalId: string, decision: 'approved' | 'rejected', body: unknown, via?: string): Promise<import("./spi/action-proposal-store.js").ActionProposalMutationResult>; } //# sourceMappingURL=action-proposal-service.d.ts.map