import { z } from 'zod';

interface SchemaValidationError {
    error: string;
    code: "validation_error";
    details: Array<{
        field: string;
        message: string;
    }>;
}
declare function formatZodError(error: z.ZodError): SchemaValidationError;
/**
 * Coding-agent context (issue #569). Optional payload that connectors may
 * ship with a recall request so the project/branch namespace overlay
 * applies to that recall. All fields are validated per CLAUDE.md #51 —
 * empty-string projectId / rootPath is rejected, not silently accepted.
 */
declare const codingContextSchema: z.ZodNullable<z.ZodObject<{
    projectId: z.ZodString;
    branch: z.ZodNullable<z.ZodString>;
    rootPath: z.ZodString;
    defaultBranch: z.ZodNullable<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    projectId: string;
    branch: string | null;
    rootPath: string;
    defaultBranch: string | null;
}, {
    projectId: string;
    branch: string | null;
    rootPath: string;
    defaultBranch: string | null;
}>>;
/**
 * Recall disclosure depth (issue #677).  Mirrors the `RecallDisclosure`
 * type in `types.ts` — keep these in sync.  Default-application happens
 * inside `EngramAccessService.recall()`; the schema only accepts/rejects.
 * Invalid values throw a structured 400 instead of silently defaulting,
 * per CLAUDE.md rule 51.
 */
declare const recallDisclosureSchema: z.ZodEnum<["chunk", "section", "raw"]>;
/**
 * Tag-match semantics (issue #689). `any` (default when `tags` is provided
 * and `tagMatch` is omitted) admits a result when it carries at least one
 * of the filter tags. `all` requires every filter tag to be present.
 * Schema rejects unknown values up front — never silently defaults
 * (CLAUDE.md rule 51).
 */
declare const tagMatchSchema: z.ZodEnum<["any", "all"]>;
declare const recallRequestSchema: z.ZodObject<{
    query: z.ZodString;
    sessionKey: z.ZodOptional<z.ZodString>;
    namespace: z.ZodOptional<z.ZodString>;
    topK: z.ZodOptional<z.ZodNumber>;
    mode: z.ZodOptional<z.ZodEnum<["auto", "no_recall", "minimal", "full", "graph_mode"]>>;
    includeDebug: z.ZodOptional<z.ZodBoolean>;
    disclosure: z.ZodOptional<z.ZodEnum<["chunk", "section", "raw"]>>;
    codingContext: z.ZodOptional<z.ZodNullable<z.ZodObject<{
        projectId: z.ZodString;
        branch: z.ZodNullable<z.ZodString>;
        rootPath: z.ZodString;
        defaultBranch: z.ZodNullable<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        projectId: string;
        branch: string | null;
        rootPath: string;
        defaultBranch: string | null;
    }, {
        projectId: string;
        branch: string | null;
        rootPath: string;
        defaultBranch: string | null;
    }>>>;
    /** Working directory for auto git-context resolution (issue #569). */
    cwd: z.ZodOptional<z.ZodString>;
    /**
     * Arbitrary project tag for non-git-based project scoping (issue #569).
     * Creates a coding context with `projectId: "tag:<projectTag>"`.
     */
    projectTag: z.ZodOptional<z.ZodString>;
    /**
     * Historical recall pin (issue #680).  ISO 8601 timestamp.  The
     * schema only enforces the basic shape; the access service runs
     * `Date.parse` and emits a structured 400 on malformed input
     * (CLAUDE.md rule 51).
     */
    asOf: z.ZodOptional<z.ZodString>;
    /**
     * Free-form recall tag filter (issue #689). When provided, recall results
     * whose frontmatter `tags` do not match the filter are removed before the
     * response is returned. Comparison is case-sensitive exact match.
     */
    tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    /**
     * Match mode for `tags` (issue #689). Defaults to `"any"` when `tags` is
     * provided and `tagMatch` is omitted. Ignored when `tags` is absent.
     */
    tagMatch: z.ZodOptional<z.ZodEnum<["any", "all"]>>;
    /**
     * Include graph edges below `graphTraversalConfidenceFloor` for diagnostic
     * recall traversal (issue #681). Defaults to false.
     */
    includeLowConfidence: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
    query: string;
    sessionKey?: string | undefined;
    tags?: string[] | undefined;
    namespace?: string | undefined;
    topK?: number | undefined;
    mode?: "no_recall" | "minimal" | "full" | "graph_mode" | "auto" | undefined;
    cwd?: string | undefined;
    includeLowConfidence?: boolean | undefined;
    disclosure?: "chunk" | "section" | "raw" | undefined;
    asOf?: string | undefined;
    includeDebug?: boolean | undefined;
    codingContext?: {
        projectId: string;
        branch: string | null;
        rootPath: string;
        defaultBranch: string | null;
    } | null | undefined;
    projectTag?: string | undefined;
    tagMatch?: "all" | "any" | undefined;
}, {
    query: string;
    sessionKey?: string | undefined;
    tags?: string[] | undefined;
    namespace?: string | undefined;
    topK?: number | undefined;
    mode?: "no_recall" | "minimal" | "full" | "graph_mode" | "auto" | undefined;
    cwd?: string | undefined;
    includeLowConfidence?: boolean | undefined;
    disclosure?: "chunk" | "section" | "raw" | undefined;
    asOf?: string | undefined;
    includeDebug?: boolean | undefined;
    codingContext?: {
        projectId: string;
        branch: string | null;
        rootPath: string;
        defaultBranch: string | null;
    } | null | undefined;
    projectTag?: string | undefined;
    tagMatch?: "all" | "any" | undefined;
}>;
declare const recallExplainRequestSchema: z.ZodObject<{
    sessionKey: z.ZodOptional<z.ZodString>;
    namespace: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    sessionKey?: string | undefined;
    namespace?: string | undefined;
}, {
    sessionKey?: string | undefined;
    namespace?: string | undefined;
}>;
/**
 * Standalone "set coding context" request. Used by the HTTP endpoint
 * `POST /engram/v1/coding-context` and the MCP `remnic.set_coding_context`
 * tool (PR 7). `codingContext: null` clears the attached context.
 */
declare const setCodingContextRequestSchema: z.ZodObject<{
    sessionKey: z.ZodString;
    codingContext: z.ZodNullable<z.ZodObject<{
        projectId: z.ZodString;
        branch: z.ZodNullable<z.ZodString>;
        rootPath: z.ZodString;
        defaultBranch: z.ZodNullable<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        projectId: string;
        branch: string | null;
        rootPath: string;
        defaultBranch: string | null;
    }, {
        projectId: string;
        branch: string | null;
        rootPath: string;
        defaultBranch: string | null;
    }>>;
}, "strip", z.ZodTypeAny, {
    sessionKey: string;
    codingContext: {
        projectId: string;
        branch: string | null;
        rootPath: string;
        defaultBranch: string | null;
    } | null;
}, {
    sessionKey: string;
    codingContext: {
        projectId: string;
        branch: string | null;
        rootPath: string;
        defaultBranch: string | null;
    } | null;
}>;
declare const observeRequestSchema: z.ZodObject<{
    sessionKey: z.ZodString;
    messages: z.ZodArray<z.ZodObject<{
        role: z.ZodEnum<["user", "assistant"]>;
        content: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        content: string;
        role: "user" | "assistant";
    }, {
        content: string;
        role: "user" | "assistant";
    }>, "many">;
    namespace: z.ZodOptional<z.ZodString>;
    skipExtraction: z.ZodOptional<z.ZodBoolean>;
    /** Working directory for auto git-context resolution (issue #569). */
    cwd: z.ZodOptional<z.ZodString>;
    /**
     * Arbitrary project tag for non-git-based project scoping (issue #569).
     * Creates a coding context with `projectId: "tag:<projectTag>"`.
     */
    projectTag: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    sessionKey: string;
    messages: {
        content: string;
        role: "user" | "assistant";
    }[];
    namespace?: string | undefined;
    cwd?: string | undefined;
    projectTag?: string | undefined;
    skipExtraction?: boolean | undefined;
}, {
    sessionKey: string;
    messages: {
        content: string;
        role: "user" | "assistant";
    }[];
    namespace?: string | undefined;
    cwd?: string | undefined;
    projectTag?: string | undefined;
    skipExtraction?: boolean | undefined;
}>;
declare const memoryStoreRequestSchema: z.ZodObject<{
    schemaVersion: z.ZodOptional<z.ZodNumber>;
    idempotencyKey: z.ZodOptional<z.ZodString>;
    dryRun: z.ZodOptional<z.ZodBoolean>;
    sessionKey: z.ZodOptional<z.ZodString>;
    content: z.ZodString;
    category: z.ZodOptional<z.ZodEnum<["fact", "preference", "correction", "entity", "decision", "relationship", "principle", "commitment", "moment", "skill", "rule", "procedure", "reasoning_trace"]>>;
    confidence: z.ZodOptional<z.ZodNumber>;
    namespace: z.ZodOptional<z.ZodString>;
    tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    entityRef: z.ZodOptional<z.ZodString>;
    ttl: z.ZodOptional<z.ZodString>;
    sourceReason: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    content: string;
    schemaVersion?: number | undefined;
    sessionKey?: string | undefined;
    tags?: string[] | undefined;
    dryRun?: boolean | undefined;
    namespace?: string | undefined;
    category?: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace" | undefined;
    confidence?: number | undefined;
    entityRef?: string | undefined;
    ttl?: string | undefined;
    sourceReason?: string | undefined;
    idempotencyKey?: string | undefined;
}, {
    content: string;
    schemaVersion?: number | undefined;
    sessionKey?: string | undefined;
    tags?: string[] | undefined;
    dryRun?: boolean | undefined;
    namespace?: string | undefined;
    category?: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace" | undefined;
    confidence?: number | undefined;
    entityRef?: string | undefined;
    ttl?: string | undefined;
    sourceReason?: string | undefined;
    idempotencyKey?: string | undefined;
}>;
declare const suggestionSubmitRequestSchema: z.ZodObject<{
    schemaVersion: z.ZodOptional<z.ZodNumber>;
    idempotencyKey: z.ZodOptional<z.ZodString>;
    dryRun: z.ZodOptional<z.ZodBoolean>;
    sessionKey: z.ZodOptional<z.ZodString>;
    content: z.ZodString;
    category: z.ZodOptional<z.ZodEnum<["fact", "preference", "correction", "entity", "decision", "relationship", "principle", "commitment", "moment", "skill", "rule", "procedure", "reasoning_trace"]>>;
    confidence: z.ZodOptional<z.ZodNumber>;
    namespace: z.ZodOptional<z.ZodString>;
    tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    entityRef: z.ZodOptional<z.ZodString>;
    ttl: z.ZodOptional<z.ZodString>;
    sourceReason: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    content: string;
    schemaVersion?: number | undefined;
    sessionKey?: string | undefined;
    tags?: string[] | undefined;
    dryRun?: boolean | undefined;
    namespace?: string | undefined;
    category?: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace" | undefined;
    confidence?: number | undefined;
    entityRef?: string | undefined;
    ttl?: string | undefined;
    sourceReason?: string | undefined;
    idempotencyKey?: string | undefined;
}, {
    content: string;
    schemaVersion?: number | undefined;
    sessionKey?: string | undefined;
    tags?: string[] | undefined;
    dryRun?: boolean | undefined;
    namespace?: string | undefined;
    category?: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace" | undefined;
    confidence?: number | undefined;
    entityRef?: string | undefined;
    ttl?: string | undefined;
    sourceReason?: string | undefined;
    idempotencyKey?: string | undefined;
}>;
declare const reviewDispositionRequestSchema: z.ZodObject<{
    memoryId: z.ZodString;
    status: z.ZodEnum<["active", "pending_review", "quarantined", "rejected", "superseded", "archived"]>;
    reasonCode: z.ZodString;
    namespace: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    status: "active" | "pending_review" | "rejected" | "quarantined" | "superseded" | "archived";
    reasonCode: string;
    memoryId: string;
    namespace?: string | undefined;
}, {
    status: "active" | "pending_review" | "rejected" | "quarantined" | "superseded" | "archived";
    reasonCode: string;
    memoryId: string;
    namespace?: string | undefined;
}>;
declare const trustZonePromoteRequestSchema: z.ZodObject<{
    recordId: z.ZodString;
    targetZone: z.ZodEnum<["working", "trusted"]>;
    promotionReason: z.ZodString;
    recordedAt: z.ZodOptional<z.ZodString>;
    summary: z.ZodOptional<z.ZodString>;
    dryRun: z.ZodOptional<z.ZodBoolean>;
    namespace: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    recordId: string;
    targetZone: "working" | "trusted";
    promotionReason: string;
    recordedAt?: string | undefined;
    summary?: string | undefined;
    dryRun?: boolean | undefined;
    namespace?: string | undefined;
}, {
    recordId: string;
    targetZone: "working" | "trusted";
    promotionReason: string;
    recordedAt?: string | undefined;
    summary?: string | undefined;
    dryRun?: boolean | undefined;
    namespace?: string | undefined;
}>;
declare const trustZoneDemoSeedRequestSchema: z.ZodObject<{
    scenario: z.ZodOptional<z.ZodString>;
    recordedAt: z.ZodOptional<z.ZodString>;
    dryRun: z.ZodOptional<z.ZodBoolean>;
    namespace: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    recordedAt?: string | undefined;
    dryRun?: boolean | undefined;
    namespace?: string | undefined;
    scenario?: string | undefined;
}, {
    recordedAt?: string | undefined;
    dryRun?: boolean | undefined;
    namespace?: string | undefined;
    scenario?: string | undefined;
}>;
declare const lcmSearchRequestSchema: z.ZodObject<{
    query: z.ZodString;
    sessionKey: z.ZodOptional<z.ZodString>;
    namespace: z.ZodOptional<z.ZodString>;
    limit: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
    query: string;
    sessionKey?: string | undefined;
    namespace?: string | undefined;
    limit?: number | undefined;
}, {
    query: string;
    sessionKey?: string | undefined;
    namespace?: string | undefined;
    limit?: number | undefined;
}>;
declare const daySummaryRequestSchema: z.ZodObject<{
    memories: z.ZodOptional<z.ZodString>;
    sessionKey: z.ZodOptional<z.ZodString>;
    namespace: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    sessionKey?: string | undefined;
    namespace?: string | undefined;
    memories?: string | undefined;
}, {
    sessionKey?: string | undefined;
    namespace?: string | undefined;
    memories?: string | undefined;
}>;
declare const capsuleExportRequestSchema: z.ZodObject<{
    name: z.ZodString;
    namespace: z.ZodOptional<z.ZodString>;
    since: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
    includeKinds: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
    peerIds: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
    includeTranscripts: z.ZodOptional<z.ZodBoolean>;
    encrypt: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
    name: string;
    namespace?: string | undefined;
    since?: string | undefined;
    includeKinds?: string[] | undefined;
    peerIds?: string[] | undefined;
    encrypt?: boolean | undefined;
    includeTranscripts?: boolean | undefined;
}, {
    name: string;
    namespace?: string | undefined;
    since?: string | undefined;
    includeKinds?: string[] | undefined;
    peerIds?: string[] | undefined;
    encrypt?: boolean | undefined;
    includeTranscripts?: boolean | undefined;
}>;
declare const capsuleImportRequestSchema: z.ZodObject<{
    archivePath: z.ZodString;
    namespace: z.ZodOptional<z.ZodString>;
    mode: z.ZodOptional<z.ZodEnum<["skip", "overwrite", "fork"]>>;
}, "strip", z.ZodTypeAny, {
    archivePath: string;
    namespace?: string | undefined;
    mode?: "skip" | "overwrite" | "fork" | undefined;
}, {
    archivePath: string;
    namespace?: string | undefined;
    mode?: "skip" | "overwrite" | "fork" | undefined;
}>;
declare const capsuleListRequestSchema: z.ZodObject<{
    namespace: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    namespace?: string | undefined;
}, {
    namespace?: string | undefined;
}>;
type RecallRequest = z.infer<typeof recallRequestSchema>;
type RecallExplainRequest = z.infer<typeof recallExplainRequestSchema>;
type SetCodingContextRequest = z.infer<typeof setCodingContextRequestSchema>;
type ObserveRequest = z.infer<typeof observeRequestSchema>;
type MemoryStoreRequest = z.infer<typeof memoryStoreRequestSchema>;
type SuggestionSubmitRequest = z.infer<typeof suggestionSubmitRequestSchema>;
type ReviewDispositionRequest = z.infer<typeof reviewDispositionRequestSchema>;
type TrustZonePromoteRequest = z.infer<typeof trustZonePromoteRequestSchema>;
type TrustZoneDemoSeedRequest = z.infer<typeof trustZoneDemoSeedRequestSchema>;
type LcmSearchRequest = z.infer<typeof lcmSearchRequestSchema>;
type DaySummaryRequest = z.infer<typeof daySummaryRequestSchema>;
type CapsuleExportRequest = z.infer<typeof capsuleExportRequestSchema>;
type CapsuleImportRequest = z.infer<typeof capsuleImportRequestSchema>;
type CapsuleListRequest = z.infer<typeof capsuleListRequestSchema>;
type SchemaName = "recall" | "recallExplain" | "setCodingContext" | "observe" | "memoryStore" | "suggestionSubmit" | "reviewDisposition" | "trustZonePromote" | "trustZoneDemoSeed" | "lcmSearch" | "daySummary" | "capsuleExport" | "capsuleImport" | "capsuleList";
type SchemaTypeFor<N extends SchemaName> = N extends "recall" ? RecallRequest : N extends "recallExplain" ? RecallExplainRequest : N extends "setCodingContext" ? SetCodingContextRequest : N extends "observe" ? ObserveRequest : N extends "memoryStore" ? MemoryStoreRequest : N extends "suggestionSubmit" ? SuggestionSubmitRequest : N extends "reviewDisposition" ? ReviewDispositionRequest : N extends "trustZonePromote" ? TrustZonePromoteRequest : N extends "trustZoneDemoSeed" ? TrustZoneDemoSeedRequest : N extends "lcmSearch" ? LcmSearchRequest : N extends "daySummary" ? DaySummaryRequest : N extends "capsuleExport" ? CapsuleExportRequest : N extends "capsuleImport" ? CapsuleImportRequest : N extends "capsuleList" ? CapsuleListRequest : never;
/**
 * Validate a request body against the named schema.
 * Returns `{ success: true, data }` on pass or
 * `{ success: false, error }` on failure with field-level detail.
 */
declare function validateRequest<T = unknown>(schemaName: SchemaName, body: unknown): {
    success: true;
    data: T;
} | {
    success: false;
    error: SchemaValidationError;
};

export { type CapsuleExportRequest, type CapsuleImportRequest, type CapsuleListRequest, type DaySummaryRequest, type LcmSearchRequest, type MemoryStoreRequest, type ObserveRequest, type RecallExplainRequest, type RecallRequest, type ReviewDispositionRequest, type SchemaName, type SchemaTypeFor, type SchemaValidationError, type SetCodingContextRequest, type SuggestionSubmitRequest, type TrustZoneDemoSeedRequest, type TrustZonePromoteRequest, capsuleExportRequestSchema, capsuleImportRequestSchema, capsuleListRequestSchema, codingContextSchema, daySummaryRequestSchema, formatZodError, lcmSearchRequestSchema, memoryStoreRequestSchema, observeRequestSchema, recallDisclosureSchema, recallExplainRequestSchema, recallRequestSchema, reviewDispositionRequestSchema, setCodingContextRequestSchema, suggestionSubmitRequestSchema, tagMatchSchema, trustZoneDemoSeedRequestSchema, trustZonePromoteRequestSchema, validateRequest };
