UNPKG

@adonis-agora/agent

Version:

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

40 lines • 2.06 kB
import type { WorkflowEngine } from '@adonis-agora/durable'; import type { HumanReply } from '../../elicitation.js'; import type { AgentRunner, AgentRunStartOptions } from '../../spi/agent-runner.js'; import type { AgentStore } from '../../spi/agent-store.js'; import type { AgentRunInput } from '../../types.js'; import type { OpenCodeHost } from '../host.js'; import type { OpenCodeTurns } from '../turns.js'; /** * Runs OpenCode turns as `@adonis-agora/durable` workflows ({@link OpenCodeRunWorkflow}): a person's * decision is a durable signal, so a turn waiting on one survives restarts and is resumed by * whichever process receives it. Needs a cross-process sink when more than one process serves the * agent (`tokenSinks.redis()` / `tokenSinks.lucid()`). */ export declare class DurableOpenCodeAgentRunner implements AgentRunner { private readonly engine; private readonly turns; private readonly host; private readonly store; constructor(engine: WorkflowEngine, turns: OpenCodeTurns, host: OpenCodeHost, store: AgentStore); runIdFor(input: AgentRunInput): string; start(input: AgentRunInput, options?: AgentRunStartOptions): Promise<{ runId: string; }>; /** * From the engine's run row. A run it does not know yet counts as running (a queued turn is * claimed before its start lands), and so does one it cannot be asked about. */ isRunActive(runId: string): Promise<boolean>; signal(runId: string, toolCallId: string, reply: HumanReply): Promise<void>; /** The runs {@link drive} set going that have not ended yet. */ private readonly driving; /** Lease and execute here what of `runId` is still pending — see `drivePendingRuns`. */ drive(runId: string): Promise<void>; /** * Interrupt OpenCode, cancel the run in the runtime (a run parked on a person never runs its body * again), and settle it here: the queue, the thread, the `cancelled` frame and the run row. */ cancel(runId: string): Promise<void>; } //# sourceMappingURL=runner.d.ts.map