import { SystemContract } from './system-contract-generator.js'; import { OrchestrationTools } from './orchestration-tools.js'; /** * Dimension slice data. */ export interface DimensionSlice { dimension: 'X' | 'Y' | 'Z' | 'W' | 'T' | 'V'; data: any[]; checksum: string; count: number; } /** * Code slice in snapshot. */ export interface CodeSlice { file_path: string; symbol_id: string; start_line: number; end_line: number; snippet: string; content_hash: string; byte_size: number; reason: 'ENTRY_POINT' | 'MCP_TOOL' | 'HIGH_DEPENDENCY' | 'CRITICAL_PATH'; } /** * Snapshot structure (refs-first per ADR-055). */ export interface Snapshot { artifact_id?: string; artifact_type?: 'snapshot'; snapshot_version: string; snapshot_type: 'full' | 'delta'; generated_at: string; checksum?: string; evidence?: any; preview?: { contract_version: string; dimensions_included: string[]; checksums: Record; }; contract?: SystemContract; dimension_slices?: DimensionSlice[]; checksums?: { contract: string; dimensions: Record; }; rebuild_instructions?: { steps: string[]; prerequisites: string[]; }; last_snapshot_hash?: string; code_slices?: { inclusion_policy: 'NONE' | 'ENTRY_POINTS' | 'MCP_TOOLS' | 'TOP_N' | 'CUSTOM'; max_total_bytes: number; slices: CodeSlice[]; }; file_path?: string; } /** * Exports system snapshot (contract + dimension slices + checksums). */ export declare class SnapshotExporter { private workspaceRoot; private orchestrationTools; private contractGenerator; constructor(workspaceRoot: string, orchestrationTools: OrchestrationTools); /** * Exports snapshot (refs-first per ADR-055). * * @param pluginId Plugin ID (optional) * @param mode 'refs' (default) or 'full' - refs mode only returns references, full mode returns all data * @param expand Array of dimensions to expand (e.g., ['X', 'Y']) - only relevant in refs mode * @param includeCodeSlices If true, include selective code slices (default: false, only in full mode) * @param codeSlicePolicy Policy for selecting code slices (default: 'MCP_TOOLS') * @param maxCodeBytes Maximum bytes for code slices (default: 100KB) * @returns Snapshot (refs or full based on mode) */ exportFull(pluginId?: string, mode?: 'refs' | 'full', expand?: string[], includeCodeSlices?: boolean, codeSlicePolicy?: 'ENTRY_POINTS' | 'MCP_TOOLS' | 'TOP_N', maxCodeBytes?: number): Promise; /** * Exports delta snapshot (changes since last snapshot). * Uses T-Dimension to identify changes. * * @param lastSnapshotHash Hash of last snapshot * @param pluginId Plugin ID (optional) * @param mode 'refs' (default) or 'full' - refs mode only returns references * @param expand Array of dimensions to expand (e.g., ['X', 'Y']) - only relevant in refs mode * @returns Snapshot */ exportDelta(lastSnapshotHash: string, pluginId?: string, mode?: 'refs' | 'full', expand?: string[]): Promise; /** * Exports dimension metadata (counts and checksums only, no data). * Used for refs mode to avoid context overflow. * * @param pluginId Plugin ID (optional) * @returns Dimension metadata (counts and checksums) */ private exportDimensionMetadata; /** * Exports dimension slices from databases. * * @param pluginId Plugin ID (optional) * @param deltaOnly If true, only export changes (requires T-Dimension) * @param changesSinceLastSnapshot Changes from T-Dimension (for delta mode) * @returns Dimension slices */ private exportDimensionSlices; /** * Computes checksums for contract and dimensions. */ private computeChecksums; /** * Computes checksum for data. */ private computeDataChecksum; /** * Generates rebuild instructions. */ private generateRebuildInstructions; /** * Writes snapshot to file. * * @param snapshot Snapshot to write * @param outputPath Output file path */ write(snapshot: Snapshot, outputPath: string): void; /** * Selects code slices for snapshot export. * Selects entry points, MCP tools, and critical paths with size limits. * * @param pluginId Plugin ID (optional) * @param policy Selection policy * @param maxTotalBytes Maximum total bytes for all slices * @returns Code slices configuration */ selectCodeSlices(pluginId?: string, policy?: 'ENTRY_POINTS' | 'MCP_TOOLS' | 'TOP_N', maxTotalBytes?: number): Promise; /** * Exports snapshot and writes to file. * * @param outputPath Output file path * @param delta If true, export delta snapshot (requires lastSnapshotHash) * @param lastSnapshotHash Hash of last snapshot (for delta) * @param pluginId Plugin ID (optional) * @param mode 'refs' (default) or 'full' - refs mode only returns references * @param expand Array of dimensions to expand (e.g., ['X', 'Y']) - only relevant in refs mode * @param includeCodeSlices If true, include selective code slices (default: false, only in full mode) */ export(outputPath: string, delta?: boolean, lastSnapshotHash?: string, pluginId?: string, mode?: 'refs' | 'full', expand?: string[], includeCodeSlices?: boolean): Promise; } //# sourceMappingURL=snapshot-exporter.d.ts.map