@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
54 lines • 2.69 kB
TypeScript
import { BaseCommand } from '@adonisjs/core/ace';
import type { CommandOptions } from '@adonisjs/core/types/ace';
import { AgentService } from '../agent-service.js';
import { AgentGovernanceConsole } from '../governance-console.js';
import { type ListQuery } from '../list-api.js';
import type { Actor } from '../types.js';
/** A refusal the command prints as is (no stack) before exiting `1`. */
export declare class CliRefusal extends Error {
constructor(message: string);
}
/** Who a command acts as: `cli:<os user>` (or `cli` when the OS user cannot be read). */
export declare function cliActorRef(): string;
/** `undefined` for an absent or empty flag, else the string. */
export declare function opt(value: string | undefined): string | undefined;
/** A UTC day flag, checked (`YYYY-MM-DD`). */
export declare function dayFlag(name: string, value: string | undefined): string | undefined;
export declare const today: () => string;
export declare abstract class AgentCommand extends BaseCommand {
static options: CommandOptions;
json: boolean;
/** Write the command's result: JSON with `--json`, else `human()`. */
protected output<T>(value: T, human: (value: T) => void): void;
/** A table of `rows`; `empty` when there are none. */
protected table(headers: string[], rows: Array<Array<string | number>>, empty?: string): void;
/** `key: value` lines. */
protected pairs(pairs: Array<[string, string | number | null | undefined]>): void;
protected governance(): Promise<AgentGovernanceConsole>;
protected agentService(): Promise<AgentService>;
/** The actor a command acts as. */
protected cliActor(): Actor;
/**
* Confirm an irreversible action: `--force` skips the question; without a terminal to ask on, the
* action is refused. `true` to go ahead.
*/
protected confirmed(force: boolean, question: string): Promise<boolean>;
/** The cursor-paging part of a list query, from the paging flags. */
protected pagingQuery(paging: {
after?: string | undefined;
before?: string | undefined;
first?: number | undefined;
last?: number | undefined;
}): ListQuery;
/** Print the next/previous cursors of a cursor page under its table. */
protected cursorHint(meta: {
nextCursor: string | null;
prevCursor: string | null;
}): void;
/** The command's work; a {@link CliRefusal} (or a refused filter) exits `1` with its message. */
protected abstract execute(): Promise<void>;
run(): Promise<void>;
/** Refuse with `message` (exit `1`). */
protected refuse(message: string): never;
}
//# sourceMappingURL=agent_command.d.ts.map