/**
 * Admin adapter — barrel.
 *
 * Operator-grade, in-process host surface for authoring (specialist/skill
 * file creation) and control-plane actions (license management, memory
 * export/import) that don't belong on the observer-only dashboard and
 * don't need to go through MCP JSON-RPC.
 *
 *   import { createAdmin } from 'nexus-prime/admin';
 *
 *   const admin = createAdmin({ repoRoot });
 *   await admin.authoring.createSpecialist({ name: 'Fix Auth', ... });
 *   admin.control.license.activate(token);
 *   admin.control.memory.export();  // requires ctx.memory
 *
 * Layering:
 * - may import from `src/kernel/**`, `src/engines/**`, `src/adapters/shared/**`.
 * - MUST NOT import from `src/agents/adapters/mcp/**` or `src/dashboard/**`.
 *   Enforced by `test/adapter-boundary.test.ts`.
 */
import * as path from 'node:path';
import { createAuthoringAdmin } from './authoring.js';
import { createControlAdmin } from './control.js';
/**
 * Compose an admin surface bound to an absolute repoRoot. Fail-fast: throws
 * if `ctx.repoRoot` is missing or not absolute, mirroring the hooks adapter
 * contract from PR6.
 *
 * Pass `ctx.memory` to enable admin.control.memory.* methods.
 */
export function createAdmin(ctx) {
    if (!ctx.repoRoot || !path.isAbsolute(ctx.repoRoot)) {
        throw new Error('createAdmin: ctx.repoRoot must be an absolute path');
    }
    return {
        authoring: createAuthoringAdmin(ctx.repoRoot),
        control: createControlAdmin(ctx.repoRoot, ctx.memory),
    };
}
