@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
21 lines • 755 B
JavaScript
/** An optional {@link AgentBackend} member the bound backend does not implement was called. */
export class AgentBackendUnsupportedError extends Error {
method;
constructor(method) {
super(`The agent backend does not implement ${method}()`);
this.method = method;
this.name = 'AgentBackendUnsupportedError';
}
}
/**
* The optional backend method `name`, bound — or a throw naming it. For hook code that has to call
* something a backend may not offer.
*/
export function requireBackendMethod(backend, name) {
const method = backend[name];
if (typeof method !== 'function') {
throw new AgentBackendUnsupportedError(name);
}
return method.bind(backend);
}
//# sourceMappingURL=backend.js.map