/**
 * ObjectStack Console Plugin
 *
 * Serves the pre-built Console SPA as a static UI plugin.
 * HonoServerPlugin auto-discovers this plugin via `type: 'ui-plugin'`
 * and mounts it at `/<slug>` (i.e. `/console`).
 *
 * The SPA is built with base path '/'.
 *
 * Usage in any ObjectStack application:
 *
 *   import { ConsolePlugin } from '@object-ui/console';
 *
 *   export default {
 *     plugins: [
 *       new HonoServerPlugin({ port: 3000 }),
 *       new ConsolePlugin(),
 *     ],
 *   };
 *
 * @see https://github.com/objectstack-ai/objectui
 */
import { fileURLToPath } from 'url';
import { dirname, resolve } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
/** Absolute path to the built SPA assets (dist/) */
export const staticPath = resolve(__dirname, 'dist');
export class ConsolePlugin {
    constructor() {
        this.name = '@object-ui/console';
        this.version = '1.0.0';
        this.type = 'ui-plugin';
        this.slug = 'console';
        this.staticPath = staticPath;
        this.default = true;
        this.description = 'ObjectStack Console - The standard runtime UI for ObjectStack applications';
        this.metadata = {
            author: 'ObjectUI Team',
            license: 'MIT',
            homepage: 'https://www.objectui.org',
            repository: 'https://github.com/objectstack-ai/objectui',
            capabilities: [
                'ui-rendering',
                'crud-operations',
                'multi-app-support',
                'dynamic-navigation',
                'theme-support',
            ],
        };
    }
    init() {
        // No initialization needed — HonoServerPlugin handles static serving & SPA fallback
    }
    async start(_ctx) {
        // Static file serving and SPA fallback are handled automatically by
        // HonoServerPlugin's auto-discovery (type: 'ui-plugin', slug: 'console').
        // No custom route registration needed.
    }
}
export default ConsolePlugin;
