@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
33 lines • 1.54 kB
TypeScript
import type { ToolHandler } from './spi/tool.js';
import type { Actor, ToolSpec } from './types.js';
/**
* Is this tool part of this deployment right now? `ToolSpec.enabled` and the handler's
* `isEnabled()` are ANDed — either one saying no is enough — and both default to yes.
*
* Resolved per turn rather than at registration, so the answer can come from configuration that
* did not exist when the tool was registered.
*/
export declare function isToolEnabled(spec: ToolSpec, handler?: ToolHandler): Promise<boolean>;
/**
* Drop tools this deployment has turned off, before anyone asks who may call them. A disabled tool
* is absent, not forbidden — the difference matters, because "forbidden" tells the model (and the
* user reading a refusal) that the capability exists.
*/
export declare function filterToolsByEnabled<T extends {
spec: ToolSpec;
handler?: ToolHandler;
}>(entries: T[]): Promise<T[]>;
/**
* May this actor use this tool, per the tool's OWN gate? Tools without a `canUse` say yes and are
* governed by the `RolesPolicy` alone.
*/
export declare function canActorUseTool(actor: Actor, handler?: ToolHandler): Promise<boolean>;
/**
* Drop tools whose own `canUse` refuses this actor. Runs after the app-wide `RolesPolicy`, and is
* additive to it — a tool can narrow who reaches it, never widen.
*/
export declare function filterToolsByCanUse<T extends {
spec: ToolSpec;
handler?: ToolHandler;
}>(entries: T[], actor: Actor): Promise<T[]>;
//# sourceMappingURL=tool-filters.d.ts.map