@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
46 lines • 2.5 kB
TypeScript
import type { AgentService } from '../agent-service.js';
import type { ActionProposalOutcome } from '../spi/action-proposal-outcome-store.js';
import type { Actor } from '../types.js';
import type { PoppyConnections } from './service.js';
import type { PoppyPendingConnect } from './store.js';
/**
* A connect finished: decide the `connect` call the turn parked on, so the conversation resumes
* with the account connected — a scoped proposal decision under `actionApprovalMode: 'independent'`,
* an approval of the parked call otherwise. A call already decided (the person tapped first) is left.
*/
export declare function resumeAfterConnect(service: Pick<AgentService, 'actionApprovalMode' | 'listActionProposals' | 'decideActionProposal' | 'approve' | 'toolCallApproval'> & Partial<Pick<AgentService, 'send'>>, pending: PoppyPendingConnect,
/**
* For a sign-in that finished after its card expired: the connection is stored all the same, and
* the conversation is continued with a new turn ({@link PoppyConnectionsTexts.continueAfterConnect})
* instead of nothing happening. Without it, an expired card is left alone.
*/
late?: {
connections: Pick<PoppyConnections, 'texts'>;
follow?: (address: unknown, run: {
runId: string;
threadId: string;
actor: Actor;
}) => Promise<unknown>;
}): Promise<void>;
/**
* Independent approvals: deciding the `connect` proposal runs it, and its outcome is written to the
* thread — but nothing asks the model to go on. Once that outcome is admitted (the
* action-proposal worker's `onAdmitted`), this starts the next turn on the thread, in the person's
* voice ({@link PoppyConnectionsTexts.continueAfterConnect}), so the model proceeds with what was
* asked before the sign-in. A text channel's conversation gets that turn too (`follow`).
*
* Only for a connect this app's connect page completed (its pending connect is `connected`), and
* only once: the outcome is admitted once.
*/
export declare function continueAfterConnect(service: Pick<AgentService, 'listActionProposals' | 'send'>, connections: Pick<PoppyConnections, 'pendingFor' | 'texts'>, outcome: ActionProposalOutcome, options?: {
prefix?: string;
/** Deliver the new run to a text channel (`channels.follow`). */
follow?: (address: unknown, run: {
runId: string;
threadId: string;
actor: Actor;
}) => Promise<unknown>;
}): Promise<{
runId: string;
} | null>;
//# sourceMappingURL=resume.d.ts.map