import { z } from "zod"; import type { StorageClient } from "../storage/client.js"; export declare const importWikiZipInputSchema: z.ZodObject<{ zipData: z.ZodOptional; zipPath: z.ZodOptional; execute: z.ZodDefault; mode: z.ZodDefault>; conflictStrategy: z.ZodDefault>; folder: z.ZodOptional; confirmWholeWiki: z.ZodDefault; includeSystem: z.ZodDefault; logTiming: z.ZodDefault; }, "strip", z.ZodTypeAny, { mode: "replace" | "additive"; logTiming: boolean; includeSystem: boolean; execute: boolean; conflictStrategy: "skip" | "overwrite" | "merge"; confirmWholeWiki: boolean; folder?: string | undefined; zipData?: string | undefined; zipPath?: string | undefined; }, { folder?: string | undefined; mode?: "replace" | "additive" | undefined; logTiming?: boolean | undefined; includeSystem?: boolean | undefined; zipData?: string | undefined; zipPath?: string | undefined; execute?: boolean | undefined; conflictStrategy?: "skip" | "overwrite" | "merge" | undefined; confirmWholeWiki?: boolean | undefined; }>; export type ImportWikiZipInput = z.infer; export interface ReplaceScopeResult { ok: boolean; /** Normalized folder prefix (no trailing slash), or undefined when unscoped. */ folderScope?: string; error?: string; } /** * Derive the deletion scope for a `mode: "replace"` import, and refuse an * unscoped whole-wiki replace unless explicitly confirmed. Shared by every * entry point that can run a replace-mode import (the import_wiki MCP tool, * the zipPath HTTP route, and the raw-zip upload HTTP route) so the GH #695 * phase 4 safety fix can't be bypassed by calling a different door. * * `explicitFolder` wins; otherwise falls back to the folder recorded in the * archive's own export-index.json (set by export_wiki / a manifest-driven * push). Older archives, or a deliberate whole-wiki export, record no folder * and are treated as unscoped. */ export declare function deriveReplaceScope(recordedFolder: string | undefined, explicitFolder: string | undefined, confirmWholeWiki: boolean): ReplaceScopeResult; /** Recover the `folder` recorded in an archive's export-index.json, if any. */ export declare function readRecordedFolder(entries: Array<{ entryName: string; getData(): Buffer; }>): string | undefined; /** True when `name` falls within `folderScope` (or when there is no scope at all). */ export declare function isInFolderScope(name: string, folderScope: string | undefined): boolean; /** One skipped file, surfaced in preview responses as `skipped: [{path, reason}]` (GH #366). */ export interface SkippedFile { path: string; reason: string; } export declare function isValidWikiFilename(name: string): boolean; export declare function runImportFromBuffer(drive: StorageClient, buffer: Buffer, opts?: { conflictStrategy?: "overwrite" | "skip" | "error" | "merge"; includeSystem?: boolean; deletedNames?: string[]; userId?: string; onProgress?: (processed: number, total: number, phase: string) => void; }): Promise<{ created: number; updated: number; deleted: number; skipped: number; errors: Array<{ path: string; reason: string; }>; warnings: Array<{ path: string; reason: string; }>; }>; export declare function importWikiZip(drive: StorageClient, input: ImportWikiZipInput, userId?: string): Promise; /** * Derive unique top-level folder prefixes from applied diff entries. * Returns sorted paths like ["canonical/", "decisions/", "projects/"]. */ export declare function computeDiscoveredFolders(diffs: Array<{ name: string; status: string; }>): string[]; export declare function buildInstructionRefreshHint(folders: string[]): string; //# sourceMappingURL=importWikiZip.d.ts.map