/** * KOS Configuration Schema * * Defines the structure for .kos.json files in KOS workspaces. * Supports metadata-driven plugin development with automatic registration * and port management. * * @module kos-config */ /** * Port range configuration for automatic port allocation. * * Tracks available port ranges for a host application to prevent conflicts * when multiple plugins are registered. */ export interface PortRange { /** * Starting port number for this host's range. * The host app typically uses this port. */ start: number; /** * Next available port to assign to a new plugin. * Automatically incremented when plugins are registered. */ next: number; } /** * Plugin configuration metadata. * * Defines how a plugin integrates with its host application, * including dev server port assignment and CLI alias. */ export interface PluginConfig { /** * NX project name of the plugin. * Must match the project name in workspace.json/project.json. */ project: string; /** * Dev server port for this plugin. * Auto-assigned from host's port range during plugin creation. */ port: number; /** * Short CLI-friendly alias for the plugin (kebab-case). * Used with --plugins and --disable flags. * * @example "beverage", "pos", "crew" */ alias: string; /** * Whether this plugin should start by default. * Can be overridden via CLI flags. * * @default true */ enabled: boolean; } /** * Host application configuration. * * Defines a host application that can load plugins, including * its dev server settings and associated plugin registrations. * * @example * ```json * { * "name": "ddk-app", * "project": "kos-ddk-app", * "port": 4200, * "type": "ncui", * "pluginContext": "kosdev.ddk", * "plugins": [ * { * "project": "beverage-pour", * "port": 4201, * "alias": "beverage", * "enabled": true * } * ] * } * ``` */ export interface HostConfig { /** * Identifier for this host (kebab-case). * Used with --host flag in dev script. * * @example "ddk-app", "drive-thru-ui" */ name: string; /** * NX project name of the host application. * Must match the project name in workspace.json/project.json. */ project: string; /** * Dev server port for the host application. */ port: number; /** * Type/category of host application. * * Common values: * - "cui" - Consumer User Interface * - "ncui" - Non-Consumer User Interface (standard) * - "ncui.compact" - Non-Consumer User Interface (compact mode) * - "admin" - Administrative interface * * @example "ncui", "cui", "admin" */ type: string; /** * Plugin context group identifier. * * Determines which plugins are compatible with this host. * Plugins register with a matching context in their .kos.json. * * @example "kosdev.ddk", "cui", "tccc.drive-thru" */ pluginContext: string; /** * Array of plugins registered for this host. * * Plugins are automatically added to this array when created * via the plugin generator with --host flag. */ plugins: PluginConfig[]; } /** * Development configuration section. * * Contains all metadata needed for the universal development script * to start host applications and their plugins. */ export interface DevelopmentConfig { /** * Array of host applications in this workspace. * * Multiple hosts can be defined for workspaces that contain * different application types (CUI, NCUI, admin panels, etc.). */ hosts: HostConfig[]; /** * Port range allocations for each host. * * Keys are host names, values are PortRange objects. * Used to auto-assign ports when plugins are created. */ portRanges: Record; /** * Optional directory for dev server logs. * * If specified, stdout/stderr from dev servers will be * written to files in this directory. * * @example "/tmp/ddk-logs", "./logs" */ logDir?: string; } /** * Root KOS configuration. * * Complete schema for .kos.json files at workspace root. * Extends the existing generator defaults with development metadata. */ export interface KosDevConfig { /** * Configuration type identifier. * Must be "root" for workspace-level .kos.json files. */ type: "root"; /** * Generator default configurations. * * Specifies default project names for different generator types. */ generator: { /** * Default project names by generator type. */ defaults: { /** * Default model project name. */ model?: string; /** * Default model-component project name. */ "model-component"?: string; /** * Default UI project name. */ ui?: string; /** * Default plugin project name. */ plugin?: string; /** * Additional custom defaults. */ [key: string]: string | undefined; }; }; /** * Development configuration for plugin development workflow. * * Optional - if not present, workspace uses legacy development patterns. * When present, enables metadata-driven development with universal dev script. */ development?: DevelopmentConfig; } //# sourceMappingURL=kos-config.d.ts.map