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; skillsProfile?: string[]; skillsMode?: 'legacy' | 'native'; }; } 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; skills?: 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; skillsProfile?: string[]; skillsMode?: 'legacy' | 'native'; }): CcgConfig; declare function createDefaultRouting(): ModelRouting; declare function getWorkflowConfigs(): WorkflowConfig[]; declare function getWorkflowById(id: string): WorkflowConfig | undefined; /** * Codex CLI model-provider tables written into ~/.codex/config.toml. * * Codex speaks the OpenAI wire protocol, so every `base_url` KEEPS the /v1 * suffix — the opposite of Claude Code, where ANTHROPIC_BASE_URL must omit it * because Claude Code appends /v1/messages itself. Getting these two backwards * yields a silent 404, so they are deliberately defined in separate places * (see `sponsors.ts`). * * Auth is always `env_key`, never a write to ~/.codex/auth.json: flipping * OPENAI_API_KEY there would clobber a ChatGPT-subscription login. */ type CodexApiResult = { success: boolean; message: string; /** true when `model_provider` was actually switched to this table */ activated: boolean; configPath?: string; }; declare function configureSponsorForCodex(id: string, activate?: boolean): Promise; declare function removeSponsorFromCodex(id: string): Promise; /** Silent registration of every sponsored Codex table. Never activates. */ declare function configureAllSponsorsForCodex(): Promise; /** Drop every sponsored table CCG added. Sibling user tables are left alone. */ declare function removeAllSponsorsFromCodex(): Promise<{ success: boolean; removed: string[]; configPath?: string; }>; /** @deprecated use configureSponsorForCodex('apimart') */ declare function configureApiMartForCodex(activate?: boolean): Promise; /** @deprecated use removeSponsorFromCodex('apimart') */ declare function removeApiMartFromCodex(): Promise; /** @deprecated use configureSponsorForCodex('packycode') */ declare function configurePackyCodeForCodex(activate?: boolean): Promise; /** @deprecated use removeSponsorFromCodex('packycode') */ declare function removePackyCodeFromCodex(): 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; /** * Skill Registry — SKILL.md frontmatter 驱动的技能发现与命令生成 * * 移植自 code-abyss skill-registry.js,TypeScript 化。 * 核心功能: * 1. 递归扫描 templates/skills/ 下所有 SKILL.md * 2. 解析 frontmatter 提取 name/description/user-invocable 等元数据 * 3. 为 user-invocable=true 的技能自动生成 slash commands */ type SkillCategory = 'tool' | 'domain' | 'orchestration' | 'impeccable' | 'root'; type SkillRuntimeType = 'scripted' | 'knowledge'; interface SkillMeta { /** kebab-case slug, e.g. 'red-team' */ name: string; /** Human-readable description */ description: string; /** Whether to auto-generate a slash command */ userInvocable: boolean; /** Allowed Claude tools for this skill */ allowedTools: string[]; /** Argument hint shown to user, e.g. '[target]' */ argumentHint: string; /** Optional aliases for the skill name */ aliases: string[]; /** Inferred from directory: tool/domain/orchestration/impeccable/root */ category: SkillCategory; /** scripted (has scripts/) or knowledge (no scripts) */ runtimeType: SkillRuntimeType; /** Relative path from skills root, e.g. 'domains/security' */ relPath: string; /** Absolute path to the SKILL.md file */ skillPath: string; /** Absolute path to the script .js file (if scripted) */ scriptPath: string | null; } /** * 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[]; }; geminiModel?: string; grokModel?: string; kimiModel?: string; opencodeModel?: string; }; liteMode?: boolean; mcpProvider?: string; skipImpeccable?: boolean; skillsProfile?: string[]; skillsMode?: 'legacy' | 'native'; }): 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; }>; type SkillTarget = 'claude' | 'codex'; interface SkillManagerOptions { target?: SkillTarget; templatesDir?: string; nativeDir?: string; storeDir?: string; version?: string; } interface SkillListEntry { name: string; alias: string; description: string; category: string; installed: boolean; healthy: boolean; version?: string; path?: string; } declare function resolveSkillPaths(options?: SkillManagerOptions): { target: SkillTarget; templatesDir: string; nativeDir: string; storeDir: string; version: string; }; declare function getSkillCatalog(options?: SkillManagerOptions): SkillMeta[]; /** Includes records from older catalogs so missing/deprecated skills remain removable. */ declare function listSkills(options?: SkillManagerOptions): Promise; declare function installedNames(options?: SkillManagerOptions): Promise; declare function installSkills(names: string[], options?: SkillManagerOptions): Promise; declare function updateSkills(options?: SkillManagerOptions): Promise; declare function removeSkills(names: string[], options?: SkillManagerOptions): Promise; declare function syncSkills(options: SkillManagerOptions & { names: string[]; }): Promise; export { DSH_PLUGIN_NAME, changeLanguage, checkForUpdates, compareVersions, configureAllSponsorsForCodex, configureApiMartForCodex, configurePackyCodeForCodex, configureSponsorForCodex, createDefaultConfig, createDefaultRouting, dshPluginDir, findDshProfiles, getCcgDir, getConfigPath, getCurrentVersion, getLatestVersion, getSkillCatalog, getWorkflowById, getWorkflowConfigs, hasDshHome, i18n, init, initI18n, installAceTool, installAceToolRs, installCodexMode, installDshPlugin, installSkills, installWorkflows, installedNames, listSkills, migrateToV1_4_0, needsMigration, readCcgConfig, removeAllSponsorsFromCodex, removeApiMartFromCodex, removePackyCodeFromCodex, removeSkills, removeSponsorFromCodex, resolveSkillPaths, showMainMenu, syncSkills, uninstallAceTool, uninstallCodexMode, uninstallDshPlugin, uninstallWorkflows, update, updateSkills, writeCcgConfig }; export type { AceToolConfig, CcgConfig, CliOptions, CollaborationMode, FastContextConfig, InitOptions, InstallResult, ModelRouting, ModelType, RoutingStrategy, SkillListEntry, SkillManagerOptions, SkillTarget, SupportedLang, WorkflowConfig };