/** * システム状態管理 */ import { type ConfigDeprecation } from '@search-docs/config'; import type { SearchDocsConfig, SearchDocsService } from '@search-docs/types'; import { DBEngine } from '@search-docs/db-engine'; import { SearchDocsServer, WatcherProcess, EmbeddingServerProcess } from '@search-docs/server'; /** * システム状態の種類 */ export type SystemState = 'NOT_CONFIGURED' | 'RUNNING'; /** * システム状態情報 */ export interface SystemStateInfo { /** システム状態 */ state: SystemState; /** 設定情報(設定ファイルが存在する場合) */ config?: SearchDocsConfig; /** 設定ファイルのパス(設定ファイルが存在する場合) */ configPath?: string; /** プロジェクトルート */ projectRoot: string; /** サービスインスタンス(サーバが稼働中の場合) */ service?: SearchDocsService; /** 非推奨設定の警告 */ deprecations?: ConfigDeprecation[]; } /** * サービスインスタンス群 */ export interface ServiceInstances { service: SearchDocsServer; watcherProcess: WatcherProcess; dbEngine: DBEngine; embeddingServer: EmbeddingServerProcess; } /** * システム状態を判定 * * @param cwd - カレントワーキングディレクトリ * @returns システム状態情報 */ export declare function detectSystemState(cwd: string): Promise; /** * サービスインスタンスを作成 * * @param config - 設定情報 * @param projectRoot - プロジェクトルート * @param version - バージョン情報 * @returns サービスインスタンス群 */ export declare function createService(config: SearchDocsConfig, projectRoot: string, version: string): Promise; /** * サービスインスタンスを停止 * * @param instances - サービスインスタンス群 */ export declare function stopService(instances: ServiceInstances): Promise; /** * システム状態に応じたエラーメッセージを生成 * * @param state - システム状態 * @param action - 実行しようとしたアクション名 * @returns エラーメッセージ */ export declare function getStateErrorMessage(state: SystemState, action: string, relatedProjectNames?: string[]): string; //# sourceMappingURL=state.d.ts.map