@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
37 lines • 1.6 kB
TypeScript
import type { ActionProposalExecutor } from './action-proposal-executor.js';
import type { ActionProposalOutcome, ActionProposalOutcomeStore } from './spi/action-proposal-outcome-store.js';
import type { ActionProposal, ActionProposalStore } from './spi/action-proposal-store.js';
import type { ActionProposalWorkerStore } from './spi/action-proposal-worker-store.js';
export interface ActionProposalWorkerOptions {
store: ActionProposalStore & ActionProposalWorkerStore & ActionProposalOutcomeStore;
executor: ActionProposalExecutor;
workerId: string;
pollIntervalMs?: number;
leaseMs?: number;
maxConcurrency?: number;
onError?(error: unknown): void;
/** After a proposal's execution settled (succeeded or failed). A throw goes to `onError`. */
onSettled?(proposal: ActionProposal): void | Promise<void>;
/**
* After a settled proposal's outcome was written to its thread (the thread was free). The moment
* to continue the conversation from it. A throw goes to `onError`.
*/
onAdmitted?(outcome: ActionProposalOutcome): void | Promise<void>;
}
export declare class ActionProposalWorker {
private readonly options;
private readonly leaseMs;
private readonly pollIntervalMs;
private readonly maxConcurrency;
private timer?;
private stopped;
private readonly renewals;
private active;
constructor(options: ActionProposalWorkerOptions);
start(): void;
stop(): Promise<void>;
runOnce(): Promise<void>;
private tick;
private execute;
}
//# sourceMappingURL=action-proposal-worker.d.ts.map