import { type Platform } from '../../platform/install/platforms.js'; import type { InstallScope, InstallMode } from '../../platform/install/types.js'; import type { LanguageConfig, SkillLanguageId } from './languages.js'; import type { InitWorkflowSelection } from '../comet-entry/types.js'; import { type ClassicLayoutInitializationPermit } from '../comet-classic/classic-layout-initialization.js'; type HookConfig = { matcher: string; description: string; }; type Manifest = { version: string; skills: string[]; internalSkills?: string[]; rules?: string[]; nativeRules?: string[]; hooks?: Record; nativeHooks?: Record; languages?: LanguageConfig[]; }; declare const RETIRED_COMET_OWNED_SKILL_PATHS: readonly ["comet-native/scripts/comet-native-checkpoint.mjs", "comet-native/scripts/comet-native-check.mjs", "comet-native/scripts/comet-native-evidence.mjs", "comet-native/scripts/comet-native-receipt.mjs"]; interface HookCommandContext { platformId: string; scope: InstallScope; hookMatcher?: string; } type HookInstallStatus = 'installed' | 'skipped' | 'failed'; export interface HookInstallResult { status: HookInstallStatus; reason?: string; cleanupFailed?: number; } interface PlannedSkillSourceFile { relativePath: string; source: string; } interface PlannedSkillFile { source: string; destination: string; } declare function planSkillDirectoryCopy(files: readonly PlannedSkillSourceFile[], destinationRoot: string): PlannedSkillFile[]; declare function getManagedSkillPaths(manifest: Manifest): string[]; /** * Derive the workflow selection from the Skills already on disk by checking * the two workflow markers (comet-native/SKILL.md and comet-classic/SKILL.md). * This lets `comet update` keep already-installed workflows in sync without * expanding the range the user chose at install time: * neither / classic only -> 'classic' (no Native added) * native only -> 'native' (no Classic added) * both -> 'both' * The caller is responsible for computing `skillsRoot` (e.g. base dir + * platform skills dir + 'skills'); this function only performs the marker * check and mapping. */ export declare function detectInstalledWorkflowSelection(skillsRoot: string): Promise; declare function getManagedSkillPathsForSelection(manifest: Manifest, workflowSelection: InitWorkflowSelection): string[]; declare function getUserFacingSkillNames(manifest: Manifest): string[]; declare function getAssetsDir(): string; /** * Get the central skills directory for symlink mode. * Project scope: /.comet/skills/ * Global scope: ~/.comet/skills/ */ declare function getCentralSkillsDir(baseDir: string, _scope: InstallScope): string; declare function removeRetiredCometOwnedSkillPaths(skillsRoots: readonly string[]): Promise<{ removed: number; failed: number; }>; declare function prepareManagedSkillCopyTarget(baseDir: string, platform: Platform, scope?: InstallScope, workflowSelection?: InitWorkflowSelection): Promise; declare function prepareNativeSkillInstallTarget(baseDir: string, platform: Platform, scope: InstallScope, languageSkillsDir: string, action: 'overwrite' | 'fill' | 'skip'): Promise; /** * Install skills using symlink mode: * 1. Copy skills to central store (.comet/skills/) * 2. Create symlinks from the platform skills dir to central store */ declare function installSkillsAsSymlink(baseDir: string, platform: Platform, overwrite: boolean, languageSkillsDir?: string, scope?: InstallScope, workflowSelection?: InitWorkflowSelection): Promise<{ copied: number; skipped: number; failed: number; }>; declare function copyCometSkillsForPlatform(baseDir: string, platform: Platform, overwrite: boolean, languageSkillsDir?: string, scope?: InstallScope, installMode?: InstallMode, workflowSelection?: InitWorkflowSelection): Promise<{ copied: number; skipped: number; failed: number; }>; declare function readManifest(): Promise; declare function getManifestSkills(workflowSelection?: InitWorkflowSelection): Promise; declare function copyCometRulesForPlatform(baseDir: string, platform: Platform, overwrite: boolean, languageId: SkillLanguageId, scope?: InstallScope, workflowSelection?: InitWorkflowSelection): Promise<{ copied: number; skipped: number; failed: number; }>; declare function computeRuleDestPath(rulesDestDir: string, ruleFileName: string, rulesFormat: string): string; declare function formatRuleContent(content: string, ruleFileName: string, rulesFormat: string): string; /** * Install Comet hooks for platforms that support them. * Supports multiple hook formats: * 'claude-code' — Claude-shaped JSON with PreToolUse array; defaults to settings.local.json, * with platform metadata able to override the filename * 'qwen' — settings.json with PreToolUse/hooks array (Qwen Code) * 'qoder' — settings.json with PreToolUse/hooks array (Qoder) * 'codebuddy' — settings.json with PreToolUse/hooks array (CodeBuddy and WorkBuddy) * 'gemini' — settings.json with hooks.BeforeTool array (Gemini CLI) * 'windsurf' — hooks.json with pre_write_code array * 'copilot' — hooks/*.json with preToolUse * 'kiro' — hooks/*.kiro.hook JSON files * 'trae' — hooks.json with version and PreToolUse grouped command hooks */ declare function installCometHooksForPlatform(baseDir: string, platform: Platform, scope?: InstallScope, workflowSelection?: InitWorkflowSelection): Promise; /** Build a hook command that is stable even when the hook runner executes from a subdirectory. */ declare function buildHookCommand(baseDir: string, skillsDir: string, scriptRelPath: string, context?: HookCommandContext): string; declare function isManagedHookCommand(command: unknown, scriptRelPaths: string[]): boolean; interface ManagedCopilotHookCleanup { entries: unknown[]; removed: number; detachedMetadata: Array>; } /** Remove Comet-owned command fields without discarding unrelated Copilot metadata. */ declare function removeManagedCopilotHookEntries(entries: unknown[], scriptRelPaths: string[]): ManagedCopilotHookCleanup; declare function removeManagedHooksFromJsonFile(settingsPath: string, scriptRelPaths: string[]): Promise<{ removed: number; failed: number; }>; declare function resolveInstalledHookMatcher(platform: Pick, matcher: string): string; declare function parseProjectConfigOverrides(content: string): Record; declare function renderProjectConfig(existing: Record, language?: string | null): string; declare function mergeProjectConfig(projectPath: string, language?: string | null, artifactLayoutDefault?: 'legacy' | 'docs', completeProjectConfig?: boolean, enableClassicWorkflow?: boolean): Promise; declare function createWorkingDirs(projectPath: string, language?: string, artifactLayout?: 'legacy' | 'docs', initializationPermit?: ClassicLayoutInitializationPermit): Promise; export { copyCometSkillsForPlatform, copyCometRulesForPlatform, installCometHooksForPlatform, readManifest, getManagedSkillPaths, getManagedSkillPathsForSelection, getManifestSkills, getUserFacingSkillNames, createWorkingDirs, getAssetsDir, computeRuleDestPath, formatRuleContent, isManagedHookCommand, resolveInstalledHookMatcher, removeManagedCopilotHookEntries, buildHookCommand, removeManagedHooksFromJsonFile, planSkillDirectoryCopy, mergeProjectConfig, parseProjectConfigOverrides, renderProjectConfig, getCentralSkillsDir, installSkillsAsSymlink, prepareManagedSkillCopyTarget, prepareNativeSkillInstallTarget, removeRetiredCometOwnedSkillPaths, RETIRED_COMET_OWNED_SKILL_PATHS, }; export type { Manifest, LanguageConfig, PlannedSkillFile, PlannedSkillSourceFile }; //# sourceMappingURL=platform-install.d.ts.map