import { type AgentDiscoveryBinding, type ReviewedDiscoveryInputs } from "./agent-discovery.js"; import { type IntegrationAgent } from "./agent-adapters.js"; import type { CodexHookDiscoveryRecovery } from "./codex-hook-discovery-recovery.js"; import { type ClaudeCoordinatedHookEvent } from "./claude-settings-witness.js"; export type { IntegrationAgent } from "./agent-adapters.js"; export type ContextHookEvent = "UserPromptSubmit" | "SessionStart" | "SubagentStart"; export interface AgentRootAlias { agent: IntegrationAgent; home: string; alias: string; target: string; link: string; aliasIdentity: string; targetIdentity: string; } export interface NativeSkillEntry { agent: string; path: string; hash: string; managed: boolean; vendor: boolean; system?: boolean; bridge?: boolean; bridgeHome?: string; rootAlias?: AgentRootAlias; } export interface NativeMigrationTarget { agent: string; projectRoot: string; path: string; treeSha256: string; vendor?: true; } export interface NativeMigrationTargetManifest { schema: "hasna.skills-native-migration-targets.v1"; targets: NativeMigrationTarget[]; digest: string; } export interface AgentConfigChange { path: string; before: string | null; after: string; } export interface AgentIntegrationPlan { dataDir: string; profileId: string; changes: AgentConfigChange[]; nativeSkills: NativeSkillEntry[]; observedPolicy?: { path: string; before: string | null; }; discoveryBefore?: AgentDiscoveryBinding[]; discoveryAfter?: AgentDiscoveryBinding[]; rootAliases?: AgentRootAlias[]; managedAgentChecks?: { home: string; agents: IntegrationAgent[]; }; retainedReviewChecks?: { home: string; projectDir: string; agents: IntegrationAgent[]; }; } /** Parse the reviewed exact-target binding used by native migration. Paths are * deliberately project-relative so a manifest cannot silently select another * checkout when a project root changes. */ export declare function parseNativeMigrationTargetManifest(input: string | Buffer): NativeMigrationTargetManifest; /** Read a manifest without following links or opening special files, with a * finite bound so a CLI cannot block on an untrusted path. */ export declare function readNativeMigrationTargetManifest(path: string): NativeMigrationTargetManifest; /** Validate every reviewed target before any archive directory or journal is created. */ export declare function selectNativeMigrationTargets(inventory: NativeSkillEntry[], manifest: NativeMigrationTargetManifest): NativeSkillEntry[]; export declare function inventoryNativeSkills(home?: string, options?: { includeVendor?: boolean; guardHermes?: boolean; projectDir?: string; projectDirs?: string[]; agents?: readonly IntegrationAgent[]; agentRoots?: Array<{ agent: string; path: string; }>; configured?: boolean; discoveryInputs?: ReviewedDiscoveryInputs; allowRootAliases?: boolean; reviewedCacheAlias?: string; }): NativeSkillEntry[]; /** Planning is read-only; credentials and unrelated settings never appear in CLI output. */ export declare function planAgentIntegration(options: { home?: string; dataDir?: string; agents: IntegrationAgent[]; command?: string; profileId?: string; includeVendor?: boolean; projectDir?: string; discoveryInputs?: ReviewedDiscoveryInputs; allowRootAliases?: boolean; }): AgentIntegrationPlan; /** Plan an explicitly authorized Stop hook replacement without adopting drift. * The caller owns authorization of its exact Stop hook delta; Skills refuses * every other settings change and owns discovery witnesses and guarded writes. * No policy means this installer has no Skills integration to update. */ export interface ClaudeHookUpdateOptions { home?: string; dataDir?: string; expectedSettingsSha256: string; replacement: string; } export declare function planClaudeStopHookUpdate(options: ClaudeHookUpdateOptions): AgentIntegrationPlan | null; /** Cooperating safety installers may replace only PreToolUse. The caller owns * its exact hook authorization; Skills retains discovery and native guards. */ export declare function planClaudePreToolUseHookUpdate(options: ClaudeHookUpdateOptions): AgentIntegrationPlan | null; export declare function planClaudeHookEventsUpdate(options: ClaudeHookUpdateOptions & { events: readonly ClaudeCoordinatedHookEvent[]; }): AgentIntegrationPlan | null; export declare function applyAgentIntegration(plan: AgentIntegrationPlan): { changed: string[]; backups: string[]; rootAliases?: AgentRootAlias[]; }; export declare function archiveNativeSkills(inventory: NativeSkillEntry[], options: { dataDir?: string; includeUnmanaged?: boolean; includeVendor?: boolean; allowRootAliases?: boolean; targetManifest?: NativeMigrationTargetManifest; }): { entries: Array<{ source: string; archive: string; hash: string; discoveryOnly?: boolean; }>; receiptPath?: string; rootAliases?: AgentRootAlias[]; targetManifest?: { schema: string; digest: string; targetCount: number; }; }; /** Run before any prompt context load. Missing ownership or reappearing native * discovery files require repair; verified cache availability is not an override. */ export declare function assertManagedAgentBridge(agent: IntegrationAgent, options?: { home?: string; dataDir?: string; projectDir?: string; projectDirs?: string[]; profileId?: string; codexDiscoveryRecovery?: CodexHookDiscoveryRecovery; }): void; export declare function normalizeAgentHookPrompt(agent: IntegrationAgent, event: string, prompt: string): string; export declare function hookContextOutput(event: string, result: { context: string; receipt?: unknown; omitted?: Array<{ slug: string; version: string; loadCommand: string; }>; }): Record; export declare function assertNativeExportAllowed(dataDir?: string): void;