Replace bash mosaic-init with a modern 9-stage wizard: - SOUL.md identity, USER.md profile, TOOLS.md configuration - Runtime detection (Claude, Codex, OpenCode) + MCP setup - Skills catalog with categorized selection - Quick Start and Advanced modes - HeadlessPrompter for --non-interactive and CI usage - ConfigService abstraction layer for future DB migration - Bundled as single dist/mosaic-wizard.mjs via tsdown - mosaic init now prefers wizard when Node.js is available - 30 tests covering stages, templates, and integration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 lines
877 B
TypeScript
27 lines
877 B
TypeScript
import type { SoulConfig, UserConfig, ToolsConfig, InstallAction } from '../types.js';
|
|
import { FileConfigAdapter } from './file-adapter.js';
|
|
|
|
/**
|
|
* ConfigService interface — abstracts config read/write operations.
|
|
* Currently backed by FileConfigAdapter (writes .md files from templates).
|
|
* Designed for future swap to SqliteConfigAdapter or PostgresConfigAdapter.
|
|
*/
|
|
export interface ConfigService {
|
|
readSoul(): Promise<SoulConfig>;
|
|
readUser(): Promise<UserConfig>;
|
|
readTools(): Promise<ToolsConfig>;
|
|
|
|
writeSoul(config: SoulConfig): Promise<void>;
|
|
writeUser(config: UserConfig): Promise<void>;
|
|
writeTools(config: ToolsConfig): Promise<void>;
|
|
|
|
syncFramework(action: InstallAction): Promise<void>;
|
|
}
|
|
|
|
export function createConfigService(
|
|
mosaicHome: string,
|
|
sourceDir: string,
|
|
): ConfigService {
|
|
return new FileConfigAdapter(mosaicHome, sourceDir);
|
|
}
|