@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
31 lines • 1.29 kB
JavaScript
import { normalizeMcpPath } from '../mcp/discovery.js';
/** The dev tools endpoint's default path. */
export const DEV_TOOLS_PATH = 'mcp/agora';
/** The container binding of the dev tools hub (only `mcp_provider` binds it). */
export { DEV_TOOLS_BINDING } from './contract.js';
/**
* `config/mcp.ts` as `mcp_provider` reads it: a missing file is an empty config (every default),
* not "MCP off" — the provider still mounts the product endpoint and the dev tools endpoint.
*/
export function readMcpConfig(app) {
return app.config.get('mcp', {});
}
/**
* Whether `mcp_provider` serves dev tools for this config, and how: `null` only for
* `devTools: false`. An omitted `devTools` (or a missing `config/mcp.ts`) is the default endpoint.
* The provider and `agora:doctor` both read it from here, so they cannot disagree.
*/
export function resolveDevTools(config) {
const devTools = config?.devTools;
if (devTools === false)
return null;
return {
path: normalizeMcpPath(devTools?.path ?? DEV_TOOLS_PATH),
exclude: devTools?.exclude ?? [],
actions: devTools?.actions ?? 'refuse',
middleware: devTools?.middleware ?? [],
authorize: devTools?.authorize,
auth: devTools?.auth,
};
}
//# sourceMappingURL=resolve.js.map