UNPKG

@adonis-agora/agent

Version:

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

55 lines • 3.6 kB
import type { ActionProposalOutcomeLease, ActionProposalOutcomeStore } from '../spi/action-proposal-outcome-store.js'; import type { ActionProposal, ActionProposalDecisionCommand, ActionProposalMutationResult, ActionProposalScope, ActionProposalStore, ActionProposalStoreOptions, ClaimActionProposal, CreateActionProposal, CreateActionProposalResult, ExtendActionProposalLease, ListActionProposals, SettleActionProposal } from '../spi/action-proposal-store.js'; import type { ActionProposalDiscoveryIndexStore, ActionProposalWorkerStore } from '../spi/action-proposal-worker-store.js'; import type { LucidDatabaseLike } from './lucid.js'; /** * Durable work is embedded in the proposal snapshot. One version-fenced UPDATE commits both * approval and queued work, so there is no dispatch gap requiring a second transactional table. * Physical keys hash exact JSON identities to avoid MySQL PAD SPACE/collation equivalence. */ export declare class LucidActionProposalStore implements ActionProposalStore, ActionProposalWorkerStore, ActionProposalDiscoveryIndexStore, ActionProposalOutcomeStore { private readonly proposalDb; private readonly ensureProposalSchema; private readonly proposalClock; constructor(proposalDb: LucidDatabaseLike, options?: ActionProposalStoreOptions, ensureProposalSchema?: () => Promise<void>); createActionProposal(input: CreateActionProposal): Promise<CreateActionProposalResult>; createReplacingActionProposal(input: CreateActionProposal): Promise<CreateActionProposalResult>; supersedeActionProposal(scope: ActionProposalScope, id: string, command: { replacementProposalId: string; actorRef: string; via: string; }): Promise<ActionProposalMutationResult>; protected rememberedActionProposalTools(scope: ActionProposalScope): Promise<string[]>; getActionProposal(scope: ActionProposalScope, id: string): Promise<ActionProposal | null>; listActionProposals(scope: ActionProposalScope, query?: ListActionProposals): Promise<ActionProposal[]>; private mutate; getThreadActionProposalScope(threadId: string): Promise<{ threadId: string; actorRef: string; tenantRef: string | null; } | null>; claimNextActionProposalOutcome(command: { workerId: string; leaseMs: number; }): Promise<{ outcome: import("../spi/action-proposal-outcome-store.js").ActionProposalOutcome; lease: { outcomeId: string; token: string; generation: number; }; } | null>; admitActionProposalOutcome(command: ActionProposalOutcomeLease): ReturnType<ActionProposalOutcomeStore['admitActionProposalOutcome']>; claimNextActionProposal(command: ClaimActionProposal): Promise<ActionProposal | null>; expireActionProposals(command: { limit: number; }): Promise<number>; backfillActionProposalDiscoveryIndex(command: { limit: number; }): Promise<number>; decideActionProposal(scope: ActionProposalScope, id: string, command: ActionProposalDecisionCommand): Promise<ActionProposalMutationResult>; claimActionProposal(scope: ActionProposalScope, id: string, command: ClaimActionProposal): Promise<ActionProposalMutationResult>; extendActionProposalLease(scope: ActionProposalScope, id: string, command: ExtendActionProposalLease): Promise<ActionProposalMutationResult>; settleActionProposal(scope: ActionProposalScope, id: string, command: SettleActionProposal): Promise<ActionProposalMutationResult>; } //# sourceMappingURL=lucid-action-proposal-store.d.ts.map