import * as i18next from 'i18next'; interface CliOptions { lang?: SupportedLang; force?: boolean; skipPrompt?: boolean; skipMcp?: boolean; frontend?: string; backend?: string; mode?: CollaborationMode; workflows?: string; installDir?: string; } type SupportedLang = 'zh-CN' | 'en'; type ModelType = 'codex' | 'gemini' | 'claude' | 'antigravity' | 'grok' | 'kimi' | 'opencode'; type CollaborationMode = 'parallel' | 'smart' | 'sequential'; type RoutingStrategy = 'parallel' | 'fallback' | 'round-robin'; interface ModelRouting { frontend: { models: ModelType[]; primary: ModelType; strategy: RoutingStrategy; }; backend: { models: ModelType[]; primary: ModelType; strategy: RoutingStrategy; }; review: { models: ModelType[]; strategy: 'parallel'; }; mode: CollaborationMode; geminiModel?: string; grokModel?: string; kimiModel?: string; opencodeModel?: string; } interface CcgConfig { general: { version: string; language: SupportedLang; createdAt: string; }; routing: ModelRouting; workflows: { installed: string[]; }; paths: { commands: string; prompts: string; backup: string; }; mcp: { provider: string; setup_url: string; }; performance?: { liteMode?: boolean; skipImpeccable?: boolean; }; } interface WorkflowConfig { id: string; name: string; nameEn: string; category: string; commands: string[]; defaultSelected: boolean; order: number; description?: string; descriptionEn?: string; } interface InitOptions { lang?: SupportedLang; skipPrompt?: boolean; skipMcp?: boolean; force?: boolean; frontend?: string; backend?: string; mode?: CollaborationMode; workflows?: string; installDir?: string; } interface InstallResult { success: boolean; installedCommands: string[]; installedPrompts: string[]; installedSkills?: number; installedSkillCommands?: number; installedRules?: boolean; errors: string[]; configPath: string; binPath?: string; binInstalled?: boolean; } interface AceToolConfig { baseUrl: string; token: string; } interface FastContextConfig { apiKey?: string; includeSnippets?: boolean; } declare function init(options?: InitOptions): Promise; declare function showMainMenu(): Promise; /** * Main update command - checks for updates and installs if available */ declare function update(): Promise; declare const i18n: i18next.i18n; declare function initI18n(lang?: SupportedLang): Promise; declare function changeLanguage(lang: SupportedLang): Promise; declare function getCcgDir(): string; declare function getConfigPath(): string; declare function readCcgConfig(): Promise; declare function writeCcgConfig(config: CcgConfig): Promise; declare function createDefaultConfig(options: { language: SupportedLang; routing: ModelRouting; installedWorkflows: string[]; mcpProvider?: string; liteMode?: boolean; skipImpeccable?: boolean; }): CcgConfig; declare function createDefaultRouting(): ModelRouting; declare function getWorkflowConfigs(): WorkflowConfig[]; declare function getWorkflowById(id: string): WorkflowConfig | undefined; type CodexApiResult = { success: boolean; message: string; /** true when `model_provider` was actually switched to APIMart */ activated: boolean; configPath?: string; }; /** * Register APIMart as a selectable model provider in ~/.codex/config.toml. * * Additive by design. The [model_providers.apimart] table is written so Codex * knows how to reach APIMart, but `model_provider` is left untouched unless the * caller explicitly passes `activate: true`. * * That default is deliberate: flipping `model_provider` globally diverts EVERY * Codex request away from the user's ChatGPT subscription onto pay-as-you-go * billing. Silently rerouting someone's paid usage is not a side effect an * installer gets to have, so activation stays an explicit, informed choice. * * The user's existing config is preserved — we parse, mutate one table, and * write atomically (temp + rename), mirroring syncMcpToCodex(). */ declare function configureApiMartForCodex(activate?: boolean): Promise; /** * Remove the APIMart provider from ~/.codex/config.toml. * * If APIMart is currently the active provider, `model_provider` is dropped too — * leaving it pointing at a table that no longer exists would break Codex on the * next run. */ declare function removeApiMartFromCodex(): Promise; type McpInstallResult = { success: boolean; message: string; configPath?: string; }; /** * Uninstall ace-tool MCP configuration from ~/.claude.json */ declare function uninstallAceTool(): Promise<{ success: boolean; message: string; }>; /** * Install and configure ace-tool MCP for Claude Code. */ declare function installAceTool(config: AceToolConfig): Promise; /** * Install and configure ace-tool-rs MCP for Claude Code. * ace-tool-rs is a Rust implementation — more lightweight and faster. */ declare function installAceToolRs(config: AceToolConfig): Promise; /** * Install Codex-mode files: AGENTS.md + .codex/config.toml + .codex/agents/*.toml * These enable Codex CLI as an alternative lead orchestrator (Codex-led multi-model mode). * Files are installed to ~/.codex/ (global) and user copies AGENTS.md to project root. */ declare function installCodexMode(): Promise<{ success: boolean; message: string; }>; /** * Uninstall CCG Codex mode — only removes files installed by CCG, preserves user files. */ declare function uninstallCodexMode(): Promise<{ success: boolean; removed: string[]; skipped: string[]; }>; declare function installWorkflows(workflowIds: string[], installDir: string, force?: boolean, config?: { routing?: { mode?: string; frontend?: { models?: string[]; primary?: string; }; backend?: { models?: string[]; primary?: string; }; review?: { models?: string[]; }; }; liteMode?: boolean; mcpProvider?: string; skipImpeccable?: boolean; }): Promise; interface UninstallResult { success: boolean; removedCommands: string[]; removedPrompts: string[]; removedAgents: string[]; removedSkills: string[]; removedRules: boolean; removedHooks: boolean; removedBin: boolean; errors: string[]; } /** * Uninstall workflows by removing their command files. * @param options.preserveBinary — when true, skip binary removal (used during update) */ declare function uninstallWorkflows(installDir: string, options?: { preserveBinary?: boolean; }): Promise; /** * dsh-ccg — installing CCG's role matrix into a DeepSeek Harness profile. * * The plugin ships inside this package (`dsh-ccg/`) rather than as a package of * its own, so a DSH user gets it from the same `npx ccg-workflow` everyone else * runs and there is only one version number to reason about. * * That choice is what forces the copy below. A harness profile declares its * plugins as ordinary dependencies, and pointing one at PACKAGE_ROOT would work * exactly until the next `npx` run: npx unpacks into a cache directory it is * free to evict, and the profile would then fail to resolve a plugin that used * to be there. So the plugin is copied to a stable path this installer owns, * and the profile depends on that. * * A profile needs BOTH halves to load a plugin — the dependency and an entry in * `dsh.profile.bundles` — and `pnpm add` only writes the first. Both are * written here, then the profile's own package manager is asked to link it. */ /** Package name the profile depends on and lists in its bundles. */ declare const DSH_PLUGIN_NAME = "dsh-ccg"; /** Where the plugin is copied to, so the profile has a path that outlives npx. */ declare function dshPluginDir(dshHome?: string): string; type DshProfile = { /** Profile directory name, e.g. `web`. */ name: string; /** Absolute path to the profile directory. */ dir: string; /** Whether this profile already lists the plugin in its bundles. */ installed: boolean; }; /** * Runs the profile's package manager. Injectable so a test can exercise the * manifest rewriting — the part with the invariants — without spawning a real * installer into a temporary directory. */ type ProfileLinker = (dir: string, name: string) => string | undefined; type DshInstallResult = { success: boolean; /** Profiles the plugin was wired into. */ profiles: string[]; /** What went wrong, when nothing could be done. */ message?: string; /** Non-fatal notes worth showing (a profile whose linker failed, say). */ warnings: string[]; }; /** * Whether a DeepSeek Harness home exists at all. * * Used to decide whether to offer the option rather than to gate the install: * a user who has not run dsh yet has no profile to install into. */ declare function hasDshHome(dshHome?: string): Promise; /** * Find the profiles a plugin can be installed into. * * A profile is a directory under `~/.dsh/profiles` carrying a package.json with * a `dsh.profile.bundles` list — that list is what actually loads plugins, so a * directory without it is not a profile no matter what else it holds. The * shared `node_modules` directory sits alongside them and is skipped. * * @param dshHome - the harness home; defaults to `~/.dsh`. * @returns one entry per profile, in directory order. */ declare function findDshProfiles(dshHome?: string): Promise; /** * Install the plugin into the named profiles. * * @param options - `{ profiles, dshHome }`; omitted `profiles` means every one found. * @returns which profiles were wired, plus anything that only half worked. */ declare function installDshPlugin(options?: { profiles?: string[]; dshHome?: string; link?: ProfileLinker; }): Promise; /** * Remove the plugin from every profile that carries it, and delete the copy. * * @param options - `{ dshHome }`. * @returns which profiles were changed. */ declare function uninstallDshPlugin(options?: { dshHome?: string; link?: ProfileLinker; }): Promise; /** * Migration utilities for v1.4.0 * Handles automatic migration from old directory structure to new one */ interface MigrationResult { success: boolean; migratedFiles: string[]; errors: string[]; skipped: string[]; } /** * Migrate from v1.3.x to v1.4.0 * * Changes: * 1. ~/.ccg/ → ~/.claude/.ccg/ * 2. ~/.claude/prompts/ccg/ → ~/.claude/.ccg/prompts/ */ declare function migrateToV1_4_0(): Promise; /** * Check if migration is needed */ declare function needsMigration(): Promise; /** * Get current installed version from package.json */ declare function getCurrentVersion(): Promise; /** * Get latest version from npm registry */ declare function getLatestVersion(packageName?: string): Promise; /** * Compare two semantic versions * @returns 1 if v1 > v2, -1 if v1 < v2, 0 if equal */ declare function compareVersions(v1: string, v2: string): number; /** * Check if update is available */ declare function checkForUpdates(): Promise<{ hasUpdate: boolean; currentVersion: string; latestVersion: string | null; }>; export { DSH_PLUGIN_NAME, changeLanguage, checkForUpdates, compareVersions, configureApiMartForCodex, createDefaultConfig, createDefaultRouting, dshPluginDir, findDshProfiles, getCcgDir, getConfigPath, getCurrentVersion, getLatestVersion, getWorkflowById, getWorkflowConfigs, hasDshHome, i18n, init, initI18n, installAceTool, installAceToolRs, installCodexMode, installDshPlugin, installWorkflows, migrateToV1_4_0, needsMigration, readCcgConfig, removeApiMartFromCodex, showMainMenu, uninstallAceTool, uninstallCodexMode, uninstallDshPlugin, uninstallWorkflows, update, writeCcgConfig }; export type { AceToolConfig, CcgConfig, CliOptions, CollaborationMode, FastContextConfig, InitOptions, InstallResult, ModelRouting, ModelType, RoutingStrategy, SupportedLang, WorkflowConfig };