import { StorageManager } from './storage.js';
import { RecallXraySnapshot } from './recall-xray.js';
import { RecallExplainJsonPayload } from './recall-explain-renderer.js';
import { PluginConfig, DaySummaryResult, RecallPlanMode, RecallDisclosure, MemoryFile, MemoryLifecycleEvent, EntityFile, MemoryStatus, DreamsStatusResult, DreamsPhase, DreamsRunResult } from './types.js';
import { AnomalyDetectorResult } from './recall-audit-anomaly.js';
import { ExplicitCaptureInput } from './explicit-capture.js';
import { BudgetDecision } from './cross-namespace-budget.js';
import { r as readMemoryGovernanceRunArtifact } from './memory-projection-store-CY8TU40w.js';
import { O as Orchestrator, I as IntentDebugSnapshot, G as GraphRecallSnapshot, P as PatternReinforcementResult, S as SemanticDedupLookup } from './orchestrator-6IvQ-Phj.js';
import { LiveConnectorsRunSummary } from './live-connectors-runner.js';
import { LastRecallSnapshot } from './recall-state.js';
import { GraphSnapshotRequest, GraphSnapshotResponse } from './graph-snapshot.js';
import { TrustZoneStoreStatus, TrustZoneName, TrustZoneRecordKind, TrustZoneSourceClass, TrustZoneProvenanceScore, TrustZonePromotionResult, TrustZoneDemoSeedResult } from './trust-zones.js';
import { L as LcmMessagePartInput, M as MessagePartSourceFormat } from './index-1qIcnbG1.js';
import { LocalLlmClient } from './local-llm.js';
import { FallbackLlmClient } from './fallback-llm.js';
import { MemoryOutcomeKind, RecordMemoryOutcomeResult } from './memory-worth-outcomes.js';
import { VersioningConfig, VersioningLogger } from './page-versioning.js';
import { z } from 'zod';
import { CapsuleListEntry } from './capsule-cli.js';

/**
 * Peer registry types — issue #679 PR 1/5.
 *
 * Generalizes the singular identity-anchor model to a multi-peer registry.
 * Every party Remnic interacts with — humans, agents, integrations, and
 * "self" — is represented as a `Peer` with an evolving cognitive profile.
 *
 * This module defines pure types only. Storage primitives live in
 * `./storage.ts`. Reasoner integration, recall injection, CLI/HTTP/MCP
 * surfaces, and migration of existing identity-anchor data ship in later
 * PRs (2/5 — 5/5).
 */
/**
 * Kind of peer.
 *
 * - `self`     — the current Remnic operator (replaces singular identity-anchor).
 * - `human`    — another human collaborator distinct from self.
 * - `agent`    — another AI agent (Claude Code, Codex, Hermes, etc.).
 * - `integration` — non-conversational integration (cron, webhook, importer).
 */
type PeerKind = "self" | "human" | "agent" | "integration";
/**
 * Stable, slow-changing facts about a peer.
 *
 * `id` matches `^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?$`, 1-64 chars,
 * with no leading/trailing/consecutive dots or dashes. Stored on disk under
 * `peers/{id}/identity.md` as YAML frontmatter + markdown body.
 */
interface Peer {
    /** Stable, opaque identifier. See PEER_ID_PATTERN. */
    readonly id: string;
    /** Kind of peer. Drives default profile schema and recall posture. */
    readonly kind: PeerKind;
    /** Human-readable display name. Distinct from `id`; mutable. */
    readonly displayName: string;
    /** ISO-8601 timestamp of first registration. */
    readonly createdAt: string;
    /** ISO-8601 timestamp of most recent update to identity. */
    readonly updatedAt: string;
    /** Optional free-form markdown body for the identity kernel. */
    readonly notes?: string;
}
/**
 * Evolving cognitive profile for a peer.
 *
 * Updated by the async profile reasoner (PR 2/5) from observable session
 * signals. Every field carries provenance back to its originating session
 * and signal. This PR only defines the shape — population is deferred.
 */
interface PeerProfile {
    /** Peer this profile belongs to. */
    readonly peerId: string;
    /** ISO-8601 timestamp of most recent profile mutation. */
    readonly updatedAt: string;
    /**
     * Arbitrary key/value profile fields. Values are markdown strings.
     * Keys are stable section identifiers (e.g. `communication_style`,
     * `recurring_concerns`). The reasoner is responsible for choosing
     * keys; this PR does not constrain them beyond requiring strings.
     */
    readonly fields: Record<string, string>;
    /**
     * Per-field provenance. Maps field key → list of provenance entries.
     * A field may have multiple sources (the reasoner accumulates evidence
     * across sessions before promoting a field).
     */
    readonly provenance: Record<string, ReadonlyArray<PeerProfileFieldProvenance>>;
}
/**
 * Provenance for a single profile-field mutation.
 *
 * Reasoner output (PR 2/5) attaches one of these every time it touches a
 * field, so the user can audit exactly why a profile claim exists.
 */
interface PeerProfileFieldProvenance {
    /** ISO-8601 timestamp the field was set/updated by this signal. */
    readonly observedAt: string;
    /** Originating session id (or other source identifier). */
    readonly sourceSessionId?: string;
    /** Short label for the signal type (e.g. "explicit_preference"). */
    readonly signal: string;
    /** Optional free-form note explaining the inference. */
    readonly note?: string;
}
/**
 * One row of the append-only interaction log for a peer.
 *
 * Stored on disk under `peers/{id}/interactions.log.md` as a sequence of
 * markdown bullet entries with a leading ISO-8601 timestamp. Append-only
 * by contract — the reasoner reads this log to derive profile updates.
 */
interface PeerInteractionLogEntry {
    /** ISO-8601 timestamp the interaction occurred. */
    readonly timestamp: string;
    /** Originating session id, if any. */
    readonly sessionId?: string;
    /** Short kind label (e.g. "message", "tool_call", "preference_set"). */
    readonly kind: string;
    /** Free-form markdown summary of the interaction. */
    readonly summary: string;
}
/**
 * Regex enforced on `Peer.id`. Exported so callers can mirror validation
 * before constructing a `Peer`.
 *
 * Rules:
 *   - 1-64 characters total
 *   - First and last character must be `[A-Za-z0-9]`
 *   - Interior may contain `.`, `_`, `-` in addition to alphanumerics
 *   - No leading or trailing dot/dash/underscore
 *   - No consecutive separators (`..`, `--`, `__`, `.-`, etc.)
 *
 * Cursor Medium: previously the regex allowed `a..b` even though the
 * docs claimed otherwise — a separate JS-side check enforced the rule
 * but the standalone PATTERN was wrong for any external consumer
 * relying on it. Tighten the regex itself so PEER_ID_PATTERN is the
 * single source of truth: an alphanumeric, optionally followed by
 * groups of (one separator + one-or-more alphanumerics), with the
 * final group ending on an alphanumeric. Negative lookahead-free so
 * it works in any JS engine.
 */
declare const PEER_ID_PATTERN: RegExp;
/** Maximum length for `Peer.id`. */
declare const PEER_ID_MAX_LENGTH = 64;

interface ConsoleBufferState {
    /** Number of turns currently held in the default buffer slot. */
    turnsCount: number;
    /** Approximate byte size of buffered content (UTF-8). */
    byteCount: number;
}
interface ConsoleExtractionVerdict {
    /** ISO-8601 timestamp the verdict was recorded. */
    ts: string;
    /** Verdict kind — typically "accept" | "reject" | "defer". */
    kind: string;
    /** Optional short reason from the judge or fallback. */
    reason?: string;
}
interface ConsoleExtractionQueueState {
    /** Number of pending extraction tasks queued in the orchestrator. */
    depth: number;
    /** Most recent judge verdicts, newest last. Capped at 25 entries. */
    recentVerdicts: ConsoleExtractionVerdict[];
}
interface ConsoleDedupDecision {
    /** ISO-8601 timestamp the decision was recorded. */
    ts: string;
    /** Outcome of the dedup check — "duplicate" | "novel" | etc. */
    decision: string;
    /** Optional content fingerprint (first 16 chars of a hash). */
    fingerprint?: string;
    /** Optional similarity score that drove the decision. */
    similarity?: number;
}
interface ConsoleMaintenanceLedgerEvent {
    /** ISO-8601 timestamp from the ledger row. */
    ts: string;
    /** Event category (e.g. "EXTRACTION_JUDGE_VERDICT"). */
    category: string;
    /** Compact one-line summary. */
    summary: string;
}
interface ConsoleQmdProbeState {
    /** Whether QMD is reachable via CLI or daemon. */
    available: boolean;
    /** Whether the daemon transport is in use. */
    daemonMode: boolean;
    /** Raw debug-status string from `qmd.debugStatus()`. */
    debug: string;
}
interface ConsoleDaemonInfo {
    /** Process uptime in milliseconds. */
    uptimeMs: number;
    /** Package / daemon version (best-effort). */
    version: string;
}
interface ConsoleStateSnapshot {
    /** ISO-8601 capture timestamp. */
    capturedAt: string;
    bufferState: ConsoleBufferState;
    extractionQueue: ConsoleExtractionQueueState;
    dedupRecent: ConsoleDedupDecision[];
    maintenanceLedgerTail: ConsoleMaintenanceLedgerEvent[];
    qmdProbe: ConsoleQmdProbeState;
    daemon: ConsoleDaemonInfo;
    /**
     * Subsystem read errors. One entry per failed reader keyed by
     * subsystem name (e.g. `"bufferState: ..."`). An empty array means
     * every section was read cleanly.
     */
    errors: string[];
}

/**
 * Procedural memory stats surface (issue #567 PR 5/5).
 *
 * Pure helper that tallies procedure memories by status and summarizes the
 * current `procedural.*` config so operators (and the dashboard) can see,
 * in one call, how procedural memory is behaving in a namespace.
 *
 * Consumed by:
 *   - CLI `remnic procedural stats`
 *   - HTTP `GET /engram/v1/procedural/stats`
 *   - MCP `remnic.procedural_stats` (+ `engram.procedural_stats` alias)
 */

interface ProcedureStatusCounts {
    total: number;
    active: number;
    pending_review: number;
    rejected: number;
    quarantined: number;
    superseded: number;
    archived: number;
    /** Any status the enum doesn't yet cover. */
    other: number;
}
interface ProcedureStatsConfigSnapshot {
    enabled: boolean;
    minOccurrences: number;
    successFloor: number;
    autoPromoteOccurrences: number;
    autoPromoteEnabled: boolean;
    lookbackDays: number;
    recallMaxProcedures: number;
}
interface ProcedureStatsRecent {
    /** ISO 8601 timestamp of the most recent procedure write, or null. */
    lastWriteAt: string | null;
    /** Count of procedure files with `created` (or `updated`) in the last 7 days. */
    writesLast7Days: number;
    /** Count of procedures whose `source` is the procedure miner. */
    minerSourced: number;
}
interface ProcedureStatsReport {
    schemaVersion: 1;
    generatedAt: string;
    counts: ProcedureStatusCounts;
    recent: ProcedureStatsRecent;
    config: ProcedureStatsConfigSnapshot;
}
/**
 * Read all memories from storage and tally procedures by status + recency.
 * `nowMs` is injectable so tests can pin the "last 7 days" window.
 */
declare function computeProcedureStats(options: {
    storage: StorageManager;
    config: PluginConfig;
    nowMs?: number;
}): Promise<ProcedureStatsReport>;
/**
 * Render `ProcedureStatsReport` as a human-friendly plain-text block for CLI
 * operators. Keep it deterministic — no colors, no ANSI. Used by `--format text`.
 */
declare function formatProcedureStatsText(report: ProcedureStatsReport): string;

/**
 * Structured linkage to the capsule that was forked to produce this one.
 *
 * - `capsuleId`  — the `id` field from the parent capsule's manifest block.
 * - `version`    — the `version` field from the parent capsule's manifest block
 *                  at the time the fork was taken.
 * - `forkRoot`   — the posix-relative directory prefix under which the parent's
 *                  records were planted inside the fork's memory root, e.g.
 *                  `forks/parent-id`. Stored here so downstream tooling can
 *                  locate the imported parent tree without re-parsing paths.
 */
declare const CapsuleParentSchema: z.ZodObject<{
    capsuleId: z.ZodString;
    version: z.ZodString;
    /**
     * Posix-relative path prefix under the fork's memory root where the parent
     * capsule's records were placed. Typically `forks/<parent-capsule-id>`.
     * Must be a non-empty string with no leading slash.
     */
    forkRoot: z.ZodEffects<z.ZodString, string, string>;
}, "strip", z.ZodTypeAny, {
    version: string;
    capsuleId: string;
    forkRoot: string;
}, {
    version: string;
    capsuleId: string;
    forkRoot: string;
}>;
type CapsuleParent = z.infer<typeof CapsuleParentSchema>;
declare const CapsuleBlockSchema: z.ZodObject<{
    id: z.ZodString;
    version: z.ZodString;
    /**
     * Taxonomy schema version the capsule was authored against. Free-form for
     * now; later PRs may tighten this to a known taxonomy registry.
     */
    schemaVersion: z.ZodString;
    /**
     * Optional reference to the parent capsule this one was forked or derived
     * from. `null` (not `undefined`) is the explicit "no parent" sentinel so
     * that round-trips through JSON do not silently drop the field.
     *
     * @deprecated Prefer {@link parent} (structured). This field is preserved
     *   for backward compatibility with V2 manifests written before PR 4/6.
     */
    parentCapsule: z.ZodNullable<z.ZodString>;
    /**
     * Structured fork-lineage pointer added in PR 4/6. When present, this
     * capsule is a fork of the described parent. `null` is the explicit
     * "not a fork" sentinel — round-trips through JSON cleanly without
     * silently dropping the field.
     *
     * Defaults to `null` so that V2 manifests written before PR 4/6 (which
     * omit this field) still parse without error. This preserves backward
     * compatibility with the existing `makeV2Manifest()` test fixtures and
     * any in-the-wild V2 archives produced by PR 2/6 and PR 3/6.
     *
     * Invariant: when `parent` is non-null, `parentCapsule` SHOULD equal
     * `parent.capsuleId` for backward compatibility with readers that only
     * understand the legacy field. `forkCapsule()` sets both.
     */
    parent: z.ZodDefault<z.ZodNullable<z.ZodObject<{
        capsuleId: z.ZodString;
        version: z.ZodString;
        /**
         * Posix-relative path prefix under the fork's memory root where the parent
         * capsule's records were placed. Typically `forks/<parent-capsule-id>`.
         * Must be a non-empty string with no leading slash.
         */
        forkRoot: z.ZodEffects<z.ZodString, string, string>;
    }, "strip", z.ZodTypeAny, {
        version: string;
        capsuleId: string;
        forkRoot: string;
    }, {
        version: string;
        capsuleId: string;
        forkRoot: string;
    }>>>;
    description: z.ZodString;
    retrievalPolicy: z.ZodObject<{
        /**
         * Per-tier weight overrides applied during recall when the capsule is the
         * active scope. Keys are tier names (e.g. `bm25`, `vector`, `graph`); values
         * are non-negative finite multipliers. The set of valid keys is left open
         * for now so future tiers do not break older manifests.
         */
        tierWeights: z.ZodRecord<z.ZodString, z.ZodNumber>;
        /**
         * Whether the direct-answer fast path is allowed when this capsule is
         * active. Operators may disable it for capsules whose contents should
         * always flow through the full retrieval pipeline.
         */
        directAnswerEnabled: z.ZodBoolean;
    }, "strip", z.ZodTypeAny, {
        tierWeights: Record<string, number>;
        directAnswerEnabled: boolean;
    }, {
        tierWeights: Record<string, number>;
        directAnswerEnabled: boolean;
    }>;
    includes: z.ZodObject<{
        taxonomy: z.ZodBoolean;
        identityAnchors: z.ZodBoolean;
        peerProfiles: z.ZodBoolean;
        procedural: z.ZodBoolean;
    }, "strip", z.ZodTypeAny, {
        procedural: boolean;
        taxonomy: boolean;
        identityAnchors: boolean;
        peerProfiles: boolean;
    }, {
        procedural: boolean;
        taxonomy: boolean;
        identityAnchors: boolean;
        peerProfiles: boolean;
    }>;
}, "strip", z.ZodTypeAny, {
    includes: {
        procedural: boolean;
        taxonomy: boolean;
        identityAnchors: boolean;
        peerProfiles: boolean;
    };
    schemaVersion: string;
    id: string;
    description: string;
    version: string;
    parentCapsule: string | null;
    parent: {
        version: string;
        capsuleId: string;
        forkRoot: string;
    } | null;
    retrievalPolicy: {
        tierWeights: Record<string, number>;
        directAnswerEnabled: boolean;
    };
}, {
    includes: {
        procedural: boolean;
        taxonomy: boolean;
        identityAnchors: boolean;
        peerProfiles: boolean;
    };
    schemaVersion: string;
    id: string;
    description: string;
    version: string;
    parentCapsule: string | null;
    retrievalPolicy: {
        tierWeights: Record<string, number>;
        directAnswerEnabled: boolean;
    };
    parent?: {
        version: string;
        capsuleId: string;
        forkRoot: string;
    } | null | undefined;
}>;
type CapsuleBlock = z.infer<typeof CapsuleBlockSchema>;
declare const ExportManifestV2Schema: z.ZodObject<{
    format: z.ZodLiteral<"openclaw-engram-export">;
    schemaVersion: z.ZodLiteral<2>;
    createdAt: z.ZodString;
    pluginVersion: z.ZodString;
    includesTranscripts: z.ZodBoolean;
    files: z.ZodArray<z.ZodObject<{
        path: z.ZodString;
        sha256: z.ZodString;
        bytes: z.ZodNumber;
    }, "strip", z.ZodTypeAny, {
        path: string;
        sha256: string;
        bytes: number;
    }, {
        path: string;
        sha256: string;
        bytes: number;
    }>, "many">;
    capsule: z.ZodObject<{
        id: z.ZodString;
        version: z.ZodString;
        /**
         * Taxonomy schema version the capsule was authored against. Free-form for
         * now; later PRs may tighten this to a known taxonomy registry.
         */
        schemaVersion: z.ZodString;
        /**
         * Optional reference to the parent capsule this one was forked or derived
         * from. `null` (not `undefined`) is the explicit "no parent" sentinel so
         * that round-trips through JSON do not silently drop the field.
         *
         * @deprecated Prefer {@link parent} (structured). This field is preserved
         *   for backward compatibility with V2 manifests written before PR 4/6.
         */
        parentCapsule: z.ZodNullable<z.ZodString>;
        /**
         * Structured fork-lineage pointer added in PR 4/6. When present, this
         * capsule is a fork of the described parent. `null` is the explicit
         * "not a fork" sentinel — round-trips through JSON cleanly without
         * silently dropping the field.
         *
         * Defaults to `null` so that V2 manifests written before PR 4/6 (which
         * omit this field) still parse without error. This preserves backward
         * compatibility with the existing `makeV2Manifest()` test fixtures and
         * any in-the-wild V2 archives produced by PR 2/6 and PR 3/6.
         *
         * Invariant: when `parent` is non-null, `parentCapsule` SHOULD equal
         * `parent.capsuleId` for backward compatibility with readers that only
         * understand the legacy field. `forkCapsule()` sets both.
         */
        parent: z.ZodDefault<z.ZodNullable<z.ZodObject<{
            capsuleId: z.ZodString;
            version: z.ZodString;
            /**
             * Posix-relative path prefix under the fork's memory root where the parent
             * capsule's records were placed. Typically `forks/<parent-capsule-id>`.
             * Must be a non-empty string with no leading slash.
             */
            forkRoot: z.ZodEffects<z.ZodString, string, string>;
        }, "strip", z.ZodTypeAny, {
            version: string;
            capsuleId: string;
            forkRoot: string;
        }, {
            version: string;
            capsuleId: string;
            forkRoot: string;
        }>>>;
        description: z.ZodString;
        retrievalPolicy: z.ZodObject<{
            /**
             * Per-tier weight overrides applied during recall when the capsule is the
             * active scope. Keys are tier names (e.g. `bm25`, `vector`, `graph`); values
             * are non-negative finite multipliers. The set of valid keys is left open
             * for now so future tiers do not break older manifests.
             */
            tierWeights: z.ZodRecord<z.ZodString, z.ZodNumber>;
            /**
             * Whether the direct-answer fast path is allowed when this capsule is
             * active. Operators may disable it for capsules whose contents should
             * always flow through the full retrieval pipeline.
             */
            directAnswerEnabled: z.ZodBoolean;
        }, "strip", z.ZodTypeAny, {
            tierWeights: Record<string, number>;
            directAnswerEnabled: boolean;
        }, {
            tierWeights: Record<string, number>;
            directAnswerEnabled: boolean;
        }>;
        includes: z.ZodObject<{
            taxonomy: z.ZodBoolean;
            identityAnchors: z.ZodBoolean;
            peerProfiles: z.ZodBoolean;
            procedural: z.ZodBoolean;
        }, "strip", z.ZodTypeAny, {
            procedural: boolean;
            taxonomy: boolean;
            identityAnchors: boolean;
            peerProfiles: boolean;
        }, {
            procedural: boolean;
            taxonomy: boolean;
            identityAnchors: boolean;
            peerProfiles: boolean;
        }>;
    }, "strip", z.ZodTypeAny, {
        includes: {
            procedural: boolean;
            taxonomy: boolean;
            identityAnchors: boolean;
            peerProfiles: boolean;
        };
        schemaVersion: string;
        id: string;
        description: string;
        version: string;
        parentCapsule: string | null;
        parent: {
            version: string;
            capsuleId: string;
            forkRoot: string;
        } | null;
        retrievalPolicy: {
            tierWeights: Record<string, number>;
            directAnswerEnabled: boolean;
        };
    }, {
        includes: {
            procedural: boolean;
            taxonomy: boolean;
            identityAnchors: boolean;
            peerProfiles: boolean;
        };
        schemaVersion: string;
        id: string;
        description: string;
        version: string;
        parentCapsule: string | null;
        retrievalPolicy: {
            tierWeights: Record<string, number>;
            directAnswerEnabled: boolean;
        };
        parent?: {
            version: string;
            capsuleId: string;
            forkRoot: string;
        } | null | undefined;
    }>;
}, "strip", z.ZodTypeAny, {
    schemaVersion: 2;
    createdAt: string;
    files: {
        path: string;
        sha256: string;
        bytes: number;
    }[];
    format: "openclaw-engram-export";
    pluginVersion: string;
    includesTranscripts: boolean;
    capsule: {
        includes: {
            procedural: boolean;
            taxonomy: boolean;
            identityAnchors: boolean;
            peerProfiles: boolean;
        };
        schemaVersion: string;
        id: string;
        description: string;
        version: string;
        parentCapsule: string | null;
        parent: {
            version: string;
            capsuleId: string;
            forkRoot: string;
        } | null;
        retrievalPolicy: {
            tierWeights: Record<string, number>;
            directAnswerEnabled: boolean;
        };
    };
}, {
    schemaVersion: 2;
    createdAt: string;
    files: {
        path: string;
        sha256: string;
        bytes: number;
    }[];
    format: "openclaw-engram-export";
    pluginVersion: string;
    includesTranscripts: boolean;
    capsule: {
        includes: {
            procedural: boolean;
            taxonomy: boolean;
            identityAnchors: boolean;
            peerProfiles: boolean;
        };
        schemaVersion: string;
        id: string;
        description: string;
        version: string;
        parentCapsule: string | null;
        retrievalPolicy: {
            tierWeights: Record<string, number>;
            directAnswerEnabled: boolean;
        };
        parent?: {
            version: string;
            capsuleId: string;
            forkRoot: string;
        } | null | undefined;
    };
}>;
type ExportManifestV2 = z.infer<typeof ExportManifestV2Schema>;

/**
 * Conflict-resolution mode for {@link importCapsule}. Inverse of the
 * `mode` selector in PR 4/6's CLI surface.
 *
 *  - `"skip"` (default) — when a target file already exists at the same
 *    relative path, leave it untouched. The corresponding record is reported
 *    via {@link ImportCapsuleResult.skipped}.
 *  - `"overwrite"` — when a target file exists, snapshot the prior content
 *    via {@link createVersion} (gotcha #54: write-before-delete; gotcha #25:
 *    don't destroy old state until new state is confirmed), then write the
 *    incoming content. The snapshot's `note` includes the source capsule id.
 *  - `"fork"` — never overwrite. Every record is rebased under
 *    `forks/<capsule-id>/<original-path>` and any YAML-frontmatter `id:`
 *    field is rewritten to a new fork-scoped value. The original tree is
 *    not touched.
 *
 * The mode is selected once per call and applied uniformly to every record
 * in the bundle. Mixed-mode imports are not supported by design — that
 * would let a single corrupted manifest silently land partial state.
 */
type ImportCapsuleMode = "skip" | "overwrite" | "fork";
/**
 * Options accepted by {@link importCapsule}.
 *
 * `archivePath` — absolute or cwd-relative path to a `.capsule.json.gz`
 * archive produced by `exportCapsule`. The archive must contain a V2
 * bundle (`schemaVersion: 2`); V1 archives are rejected.
 *
 * `root` — absolute or cwd-relative path to the memory directory that
 * will receive the records. Must be an existing directory.
 *
 * `mode` — see {@link ImportCapsuleMode}. Defaults to `"skip"`.
 *
 * `versioning` — optional page-versioning config used by `mode: "overwrite"`
 * to snapshot prior content before replacing it. Snapshots are skipped when
 * not provided or when `enabled === false`. Tests pass an enabled config
 * to assert snapshot creation; production callers thread the
 * orchestrator's resolved versioning config.
 *
 * `log` — optional logger forwarded to {@link createVersion}.
 *
 * `now` — optional clock override (ms epoch) used to derive deterministic
 * fork ids in tests. Production callers omit this.
 */
interface ImportCapsuleOptions {
    archivePath: string;
    root: string;
    mode?: ImportCapsuleMode;
    versioning?: VersioningConfig;
    log?: VersioningLogger;
    now?: number;
    /**
     * Memory directory whose secure-store keyring is used when the archive is
     * encrypted. Required when `archivePath` ends with `.enc` or when the file
     * starts with the REMNIC-ENC magic header. If `memoryDir` is omitted and the
     * archive turns out to be encrypted, `importCapsule` throws a clear error
     * rather than silently failing.
     *
     * When provided and the archive is NOT encrypted, the value is ignored.
     */
    memoryDir?: string;
}
interface ImportCapsuleSkippedRecord {
    /** Original record path (capsule-relative, posix). */
    path: string;
    /**
     * Why this record was not written.
     *
     * `"exists"` — the target path already existed and the mode was `"skip"`,
     * OR the computed fork path already existed in fork mode.
     *
     * `"checksum_mismatch"` is intentionally absent: a checksum failure aborts
     * the import entirely (fail-closed) rather than skipping the offending
     * record, so no `ImportCapsuleSkippedRecord` is ever produced for it.
     */
    reason: "exists";
}
interface ImportCapsuleImportedRecord {
    /** Capsule-relative posix path the record carried. */
    sourcePath: string;
    /** Memory-dir-relative posix path the file was written to. */
    targetPath: string;
    /** Whether a prior version snapshot was taken (overwrite-mode only). */
    snapshotted: boolean;
    /** Whether the frontmatter `id:` field was rewritten (fork-mode only). */
    rewroteId: boolean;
}
interface ImportCapsuleResult {
    /** Records that landed on disk. */
    imported: ImportCapsuleImportedRecord[];
    /** Records that were not written. */
    skipped: ImportCapsuleSkippedRecord[];
    /** The manifest decoded from the archive. */
    manifest: ExportManifestV2;
}

/**
 * Options accepted by {@link exportCapsule}.
 *
 * `name` — capsule id, validated against {@link CAPSULE_ID_PATTERN}. The id
 * also forms the manifest's `capsule.id` and the archive filename.
 *
 * `root` — absolute or cwd-relative path to the memory directory to export.
 *
 * `since` — optional ISO-8601 timestamp; only files with `mtime >= since`
 * are included.
 *
 * `includeKinds` — optional allow-list of top-level subdirectory names
 * (e.g. `facts`, `entities`, `corrections`, `transcripts`). When set, files
 * directly under {@link root} are excluded and only files whose first path
 * segment is in the allow-list are kept. Pass `transcripts` here explicitly
 * to opt-in transcripts (they are excluded by default).
 *
 * `peerIds` — optional allow-list restricting the `peers/` tree to files
 * under `peers/<peerId>/...`. When omitted the entire `peers/` tree is
 * included (subject to {@link includeKinds}). When set to an empty array
 * the `peers/` tree is excluded entirely.
 *
 * `outDir` — optional output directory. Defaults to `<root>/.capsules`.
 *
 * `pluginVersion` — recorded in the manifest. Defaults to `"0.0.0"` so
 * tests do not need to thread a version through; production callers SHOULD
 * pass the running plugin version.
 *
 * `capsule` — optional overrides for the manifest's `capsule` block. The
 * caller may pass any subset; remaining fields are filled with conservative
 * defaults documented inline below.
 *
 * `now` — optional clock override (ms epoch) used for `manifest.createdAt`.
 * Tests pass a fixed value for deterministic output.
 *
 * `encrypt` — when `true`, encrypt the output archive using the secure-store
 * master key for `memoryDir`. The keyring must be unlocked before calling
 * (`remnic secure-store unlock`). The plaintext `.capsule.json.gz` is written
 * first, then encrypted to `<name>.capsule.json.gz.enc`; the plaintext is
 * removed after successful encryption. Requires `memoryDir` to be provided.
 *
 * `memoryDir` — required when `encrypt` is `true`. The memory directory whose
 * secure-store keyring holds the master key.
 */
interface ExportCapsuleOptions {
    name: string;
    root: string;
    since?: string;
    includeKinds?: readonly string[];
    peerIds?: readonly string[];
    outDir?: string;
    pluginVersion?: string;
    capsule?: Partial<Omit<CapsuleBlock, "id">>;
    now?: number;
    /**
     * When `true`, encrypt the output archive. Requires the secure-store to be
     * unlocked and `memoryDir` to be set. The plaintext `.capsule.json.gz` is
     * replaced by `<name>.capsule.json.gz.enc` on success.
     */
    encrypt?: boolean;
    /**
     * Memory directory whose secure-store keyring holds the master key. Required
     * when `encrypt` is `true`; ignored otherwise.
     */
    memoryDir?: string;
    /**
     * When `true`, include the `transcripts/` directory in the export even
     * though it is excluded by default. Using this flag avoids hard-coding an
     * explicit `includeKinds` allow-list that would inadvertently drop other
     * valid memory directories (`peers/`, `forks/`, etc.). (Cursor / #747)
     *
     * Ignored when `includeKinds` is provided and already contains
     * `"transcripts"`.
     */
    includeTranscripts?: boolean;
}
interface ExportCapsuleResult {
    archivePath: string;
    manifestPath: string;
    manifest: ExportManifestV2;
    /** When the export was encrypted, the `.enc` path. `null` when unencrypted. */
    encryptedArchivePath: string | null;
}

declare class EngramAccessInputError extends Error {
}
type AccessProfilingReportRequest = {
    format?: string;
    limit?: number;
};
type AccessProfilingReportResponse = {
    enabled: boolean;
    format?: "ascii" | "json";
    report?: string;
    traces?: unknown[];
    stats?: unknown;
    bottleneck?: string | null;
    reason?: string;
    message?: string;
};
declare const ENGRAM_ACCESS_WRITE_SCHEMA_VERSION = 1;
interface EngramAccessHealthResponse {
    ok: true;
    memoryDir: string;
    namespacesEnabled: boolean;
    defaultNamespace: string;
    searchBackend: string;
    qmdEnabled: boolean;
    nativeKnowledgeEnabled: boolean;
    projectionAvailable: boolean;
}
interface EngramAccessRecallRequest {
    query: string;
    sessionKey?: string;
    namespace?: string;
    topK?: number;
    mode?: RecallPlanMode | "auto";
    includeDebug?: boolean;
    /**
     * Recall disclosure depth (issue #677).  Selects how much content each
     * result returns: `"chunk"` (default), `"section"`, or `"raw"`.  Omitting
     * this field is equivalent to passing `"chunk"` and preserves pre-#677
     * behavior.  Surfaces (CLI / HTTP / MCP) and per-level token telemetry
     * are wired in subsequent PRs of #677.
     */
    disclosure?: RecallDisclosure;
    /**
     * Coding-agent context (issue #569). When a connector resolves a git
     * context for the session's cwd, it passes it here and the access service
     * attaches it to the orchestrator before recall so project- / branch-
     * scoped namespace overlays apply.
     *
     * Keyed by `sessionKey`; ignored when `sessionKey` is absent.
     */
    codingContext?: {
        projectId: string;
        branch: string | null;
        rootPath: string;
        defaultBranch: string | null;
    } | null;
    /**
     * Working directory of the calling agent session. When provided and no
     * `codingContext` is already attached to the session, the service resolves
     * git context from this path and attaches it automatically. This enables
     * Claude Code hooks (and any connector that knows its cwd) to get
     * project-scoped memory without explicitly constructing a `codingContext`.
     */
    cwd?: string;
    /**
     * Arbitrary project tag for non-git-based project scoping. When provided,
     * creates a `CodingContext` with `projectId: "tag:<projectTag>"`.
     * Useful for OpenClaw sessions where the whole workspace is one git repo
     * but different conversations correspond to different client projects.
     * Takes precedence over `cwd`-based git resolution but NOT over an
     * explicit `codingContext`.
     */
    projectTag?: string;
    /**
     * Historical recall pin (issue #680).  ISO 8601 timestamp.  When set,
     * the orchestrator filters out memories whose `valid_at` is after this
     * instant OR whose `invalid_at` is at-or-before this instant, so the
     * caller sees the corpus as it existed at `asOf`.  Invalid values are
     * rejected here with `EngramAccessInputError` (CLAUDE.md rule 51).
     */
    asOf?: string;
    /**
     * Free-form recall tag filter (issue #689). When non-empty, recall results
     * whose frontmatter `tags` do not match are removed from the response.
     * Comparison is case-sensitive exact match against tags stored on each
     * memory's frontmatter (see `storage.ts` and `docs/tags.md`).
     */
    tags?: string[];
    /**
     * Match mode for `tags` (issue #689). `"any"` (default when omitted)
     * admits results that carry at least one filter tag. `"all"` requires
     * every filter tag to be present. Ignored when `tags` is absent or empty.
     */
    tagMatch?: "any" | "all";
    /**
     * Issue #681 — when `true`, bypasses the configured
     * `graphTraversalConfidenceFloor` for this recall and includes graph edges
     * below the floor in traversal.  Useful for diagnostic queries that need to
     * surface results pruned by confidence decay.  Default `false`.
     */
    includeLowConfidence?: boolean;
}
/**
 * Standalone request to attach / clear the coding context for a session
 * without performing a recall. Used by the Claude Code / Codex connectors
 * at session start, and by the `remnic.set_coding_context` MCP tool (PR 7).
 */
interface EngramAccessSetCodingContextRequest {
    sessionKey: string;
    codingContext: {
        projectId: string;
        branch: string | null;
        rootPath: string;
        defaultBranch: string | null;
    } | null;
}
interface EngramAccessRecallResponse {
    query: string;
    sessionKey?: string;
    namespace: string;
    context: string;
    count: number;
    memoryIds: string[];
    results: EngramAccessMemorySummary[];
    recordedAt?: string;
    traceId?: string;
    plannerMode?: RecallPlanMode;
    fallbackUsed: boolean;
    sourcesUsed: string[];
    /**
     * Disclosure depth applied to this recall (issue #677).  Reflects the
     * caller-requested level after defaulting; useful for surfaces that want
     * to render a "served at depth X" hint without re-deriving it.  PR 1 of
     * #677 wires this end-to-end for plumbing only — section/raw payload
     * shaping ships in later PRs.
     */
    disclosure: RecallDisclosure;
    budgetsApplied?: LastRecallSnapshot["budgetsApplied"];
    auditAnomalies?: AnomalyDetectorResult;
    budgetWarning?: BudgetDecision;
    latencyMs?: number;
    debug?: {
        snapshot?: LastRecallSnapshot;
        intent?: IntentDebugSnapshot | null;
        graph?: GraphRecallSnapshot | null;
    };
}
interface EngramAccessRecallExplainRequest {
    sessionKey?: string;
    namespace?: string;
}
interface EngramAccessRecallExplainResponse {
    found: boolean;
    snapshot?: LastRecallSnapshot;
    intent?: IntentDebugSnapshot | null;
    graph?: GraphRecallSnapshot | null;
}
interface EngramAccessDaySummaryRequest {
    memories?: string;
    sessionKey?: string;
    namespace?: string;
}
/** Inputs accepted by the `remnic_briefing` MCP tool. */
interface EngramAccessBriefingRequest {
    since?: string;
    focus?: string;
    namespace?: string;
    format?: "markdown" | "json";
    maxFollowups?: number;
    /** Caller principal for namespace access checks. Transport-bound — never from untrusted payloads. */
    principal?: string;
}
/** Response for `remnic_briefing`. */
interface EngramAccessBriefingResponse {
    format: "markdown" | "json";
    window: {
        from: string;
        to: string;
    };
    namespace: string;
    markdown: string;
    json: Record<string, unknown>;
    followupsUnavailableReason?: string;
}
interface EngramAccessMemoryRecord {
    id: string;
    path: string;
    category: string;
    status?: string;
    created?: string;
    updated?: string;
    content: string;
    frontmatter: MemoryFile["frontmatter"];
}
interface EngramAccessMemorySummary {
    id: string;
    path: string;
    category: string;
    status: string;
    created?: string;
    updated?: string;
    tags: string[];
    entityRef?: string;
    preview: string;
    /**
     * Disclosure depth at which this result was served (issue #677).  Set by
     * recall paths; omitted on non-recall surfaces (e.g. memory browse) where
     * the concept does not apply.  PR 1 of #677 always reports the
     * request-level disclosure on recall results; per-result divergence is
     * reserved for the auto-escalation policy that ships in PR 4/4.
     */
    disclosure?: RecallDisclosure;
    /**
     * Full memory content (markdown body) — populated when `disclosure` is
     * `"section"` or `"raw"` (issue #677 PR 2/4).  At `"chunk"` depth callers
     * only receive the short `preview`, preserving the cheap-by-default
     * recall payload.  Browse/non-recall paths leave `content` undefined.
     */
    content?: string;
    /**
     * Raw transcript excerpts surfaced from the LCM archive when `disclosure`
     * is `"raw"` and the LCM engine is enabled (issue #677 PR 2/4).  Each
     * entry is a per-message excerpt sized by the LCM archive's
     * configured excerpt window.  Empty array when LCM is disabled or has
     * no matching transcript content.  Always omitted at chunk/section.
     */
    rawExcerpts?: Array<{
        turnIndex: number;
        role: string;
        content: string;
        sessionId: string;
    }>;
}
interface EngramAccessMemoryBrowseRequest {
    query?: string;
    status?: string;
    category?: string;
    namespace?: string;
    sort?: "updated_desc" | "updated_asc" | "created_desc" | "created_asc";
    limit?: number;
    offset?: number;
}
interface EngramAccessMemoryBrowseResponse {
    namespace: string;
    sort: "updated_desc" | "updated_asc" | "created_desc" | "created_asc";
    total: number;
    count: number;
    limit: number;
    offset: number;
    memories: EngramAccessMemorySummary[];
}
interface EngramAccessMemoryResponse {
    found: boolean;
    namespace: string;
    memory?: EngramAccessMemoryRecord;
}
interface EngramAccessTimelineResponse {
    found: boolean;
    namespace: string;
    count: number;
    timeline: MemoryLifecycleEvent[];
}
interface EngramAccessEntitySummary {
    name: string;
    type: string;
    updated: string;
    summary?: string;
    aliases: string[];
}
interface EngramAccessEntityListResponse {
    namespace: string;
    total: number;
    count: number;
    limit: number;
    offset: number;
    entities: EngramAccessEntitySummary[];
}
interface EngramAccessEntityResponse {
    found: boolean;
    namespace: string;
    entity?: EntityFile;
}
interface EngramAccessReviewQueueResponse {
    found: boolean;
    namespace?: string;
    runId?: string;
    summary?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["summary"];
    metrics?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["metrics"];
    qualityScore?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["qualityScore"];
    reviewQueue?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["reviewQueue"];
    appliedActions?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["appliedActions"];
    transitionReport?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["transitionReport"];
    report?: string;
}
interface EngramAccessMaintenanceResponse {
    namespace: string;
    health: EngramAccessHealthResponse;
    latestGovernanceRun: EngramAccessReviewQueueResponse;
}
interface EngramAccessTrustZoneStatusResponse {
    namespace: string;
    status: TrustZoneStoreStatus;
}
interface EngramAccessTrustZoneRecordSummary {
    recordId: string;
    filePath: string;
    zone: TrustZoneName;
    recordedAt: string;
    kind: TrustZoneRecordKind;
    summary: string;
    sourceClass: TrustZoneSourceClass;
    sessionKey?: string;
    sourceId?: string;
    evidenceHashPresent: boolean;
    anchored: boolean;
    entityRefs: string[];
    tags: string[];
    metadata?: Record<string, string>;
    trustScore?: TrustZoneProvenanceScore;
    nextPromotionTarget?: TrustZoneName;
    nextPromotionAllowed: boolean;
    nextPromotionReasons: string[];
    corroborationCount?: number;
    corroborationSourceClasses?: TrustZoneSourceClass[];
}
interface EngramAccessTrustZoneBrowseRequest {
    query?: string;
    zone?: TrustZoneName;
    kind?: TrustZoneRecordKind;
    sourceClass?: TrustZoneSourceClass;
    namespace?: string;
    limit?: number;
    offset?: number;
}
interface EngramAccessTrustZoneBrowseResponse {
    namespace: string;
    total: number;
    count: number;
    limit: number;
    offset: number;
    records: EngramAccessTrustZoneRecordSummary[];
}
interface EngramAccessTrustZonePromoteRequest {
    recordId: string;
    targetZone: TrustZoneName;
    promotionReason: string;
    recordedAt?: string;
    summary?: string;
    dryRun?: boolean;
    namespace?: string;
    authenticatedPrincipal?: string;
}
interface EngramAccessTrustZonePromoteResponse extends TrustZonePromotionResult {
    namespace: string;
    dryRun: boolean;
}
interface EngramAccessTrustZoneDemoSeedRequest {
    scenario?: string;
    recordedAt?: string;
    dryRun?: boolean;
    namespace?: string;
    authenticatedPrincipal?: string;
}
interface EngramAccessTrustZoneDemoSeedResponse extends TrustZoneDemoSeedResult {
    namespace: string;
}
interface EngramAccessQualityResponse {
    namespace: string;
    totalMemories: number;
    statusCounts: Record<string, number>;
    categoryCounts: Record<string, number>;
    confidenceTierCounts: Record<string, number>;
    ageBucketCounts: Record<string, number>;
    archivePressure: {
        pendingReview: number;
        quarantined: number;
        archived: number;
        staleActive: number;
        lowConfidenceActive: number;
    };
    latestGovernanceRun: {
        found: boolean;
        runId?: string;
        qualityScore?: EngramAccessReviewQueueResponse["qualityScore"];
        reviewQueueCount: number;
    };
}
interface EngramAccessCapsuleListResponse {
    namespace: string;
    capsulesDir: string;
    capsules: CapsuleListEntry[];
}
interface EngramAccessReviewDispositionRequest {
    memoryId: string;
    status: MemoryStatus | "archived";
    reasonCode: string;
    namespace?: string;
    /**
     * Trusted transport-bound principal. This must never come from untrusted client payloads.
     * When present, write authorization is evaluated against this principal instead of sessionKey.
     */
    authenticatedPrincipal?: string;
}
interface EngramAccessReviewDispositionResponse {
    ok: boolean;
    namespace: string;
    memoryId: string;
    status: MemoryStatus | "archived";
    previousStatus: MemoryStatus;
    currentPath?: string;
}
interface EngramAccessWriteEnvelope {
    schemaVersion?: number;
    idempotencyKey?: string;
    dryRun?: boolean;
    sessionKey?: string;
    /**
     * Trusted transport-bound principal. This must never come from untrusted client payloads.
     * When present, write authorization is evaluated against this principal instead of sessionKey.
     */
    authenticatedPrincipal?: string;
}
interface EngramAccessMemoryStoreRequest extends EngramAccessWriteEnvelope, ExplicitCaptureInput {
}
interface EngramAccessSuggestionSubmitRequest extends EngramAccessWriteEnvelope, ExplicitCaptureInput {
}
interface EngramAccessWriteResponse {
    schemaVersion: 1;
    operation: "memory_store" | "suggestion_submit";
    namespace: string;
    dryRun: boolean;
    accepted: boolean;
    queued: boolean;
    status: "validated" | "stored" | "duplicate" | "queued_for_review";
    memoryId?: string;
    duplicateOf?: string;
    idempotencyKey?: string;
    idempotencyReplay?: boolean;
}
interface EngramAccessObserveMessage {
    role: "user" | "assistant";
    content: string;
    parts?: LcmMessagePartInput[];
    rawContent?: unknown;
    sourceFormat?: MessagePartSourceFormat;
}
interface EngramAccessObserveRequest {
    sessionKey: string;
    messages: EngramAccessObserveMessage[];
    namespace?: string;
    authenticatedPrincipal?: string;
    skipExtraction?: boolean;
    /**
     * Working directory of the calling agent session (issue #569 wiring).
     * When provided and no `codingContext` is attached for this session,
     * resolves git context from the path and attaches it so writes route to
     * the correct project namespace.
     */
    cwd?: string;
    /**
     * Arbitrary project tag for non-git-based project scoping (issue #569).
     * Creates a `CodingContext` with `projectId: "tag:<projectTag>"`.
     */
    projectTag?: string;
}
interface EngramAccessObserveResponse {
    accepted: number;
    sessionKey: string;
    namespace: string;
    lcmArchived: boolean;
    extractionQueued: boolean;
}
interface EngramAccessLcmSearchRequest {
    query: string;
    sessionKey?: string;
    namespace?: string;
    limit?: number;
    authenticatedPrincipal?: string;
}
interface EngramAccessLcmSearchResponse {
    query: string;
    namespace: string;
    results: Array<{
        sessionId: string;
        content: string;
        turnIndex?: number;
    }>;
    count: number;
    lcmEnabled: boolean;
}
interface EngramAccessLcmStatusResponse {
    enabled: boolean;
    archiveAvailable: boolean;
    stats?: {
        totalTurns?: number;
    };
}
type EngramAccessIdempotencyStatus = "miss" | "replay" | "conflict";
/**
 * Pure helper that shapes a {@link EngramAccessMemorySummary} from a
 * {@link MemoryFile} based on the requested disclosure depth (issue #677
 * PR 2/4).  Extracted so the shaping invariants — chunk emits preview
 * only, section attaches `content`, raw also surfaces `rawExcerpts` when
 * the caller passes them — can be unit-tested without booting an
 * orchestrator.
 *
 * Browse / non-recall paths pass `disclosure === undefined` so the
 * `disclosure`, `content`, and `rawExcerpts` fields are all omitted —
 * preserving the cheap-by-default browse projection.
 */
declare function shapeMemorySummary(memory: MemoryFile, baseDir: string, disclosure?: RecallDisclosure, rawExcerpts?: EngramAccessMemorySummary["rawExcerpts"]): EngramAccessMemorySummary;
declare class EngramAccessService {
    private readonly orchestrator;
    private readonly idempotency;
    private readonly idempotencyLocks;
    private readonly budget;
    private readonly auditAdapter;
    constructor(orchestrator: Orchestrator);
    get briefingEnabled(): boolean;
    private resolveNamespace;
    private normalizeRecallMode;
    private resolveRecallNamespace;
    private resolveWritePrincipal;
    private resolveWritableNamespace;
    private objectiveStateStoreLocationForNamespace;
    private resolveReadableNamespace;
    private buildRecallDebug;
    private serializeRecallResults;
    /**
     * Fetch raw transcript excerpts from the LCM archive for `disclosure ===
     * "raw"` recalls (issue #677 PR 2/4).  Returns `null` for non-raw recall
     * depths, an empty array when LCM is disabled / not initialized / has no
     * matches, and an array of LCM-side excerpts otherwise.  Errors are
     * swallowed and treated as "no excerpts" so a failing LCM never breaks
     * the recall response.
     *
     * Namespace handling: LCM archival prefixes non-default-namespace
     * sessions with `${namespace}:${sessionKey}` (see `observe()` around
     * line 2498), so the lookup must mirror that prefix or raw recalls in
     * non-default namespaces miss their own excerpts.
     */
    private fetchRawExcerpts;
    private handleIdempotentWrite;
    private peekIdempotentWrite;
    private withIdempotencyLock;
    health(namespace?: string): Promise<EngramAccessHealthResponse>;
    daySummary(request: EngramAccessDaySummaryRequest): Promise<DaySummaryResult | null>;
    /**
     * Build a daily context briefing. Gracefully degrades when the OpenAI key
     * or Responses API is unavailable — never throws for LLM-related problems.
     */
    briefing(request: EngramAccessBriefingRequest): Promise<EngramAccessBriefingResponse>;
    /**
     * Attach a coding context to a session (issue #569). Used by the Claude
     * Code / Codex / generic-MCP connectors at session start so that recall +
     * write paths can route to a project- / branch-scoped namespace.
     *
     * Validates the input shape and rejects malformed payloads rather than
     * silently accepting them (CLAUDE.md #51). Pass `codingContext: null` to
     * clear.
     */
    setCodingContext(request: EngramAccessSetCodingContextRequest): void;
    /**
     * Auto-resolve and attach a coding context for a session when one is not
     * already present. Resolves from `projectTag` (highest priority after
     * explicit `codingContext`), then from `cwd` via git detection.
     *
     * This is a no-op when:
     *   - `sessionKey` is missing
     *   - the session already has a coding context attached
     *   - codingMode.projectScope is disabled (CLAUDE.md #30)
     *   - neither `cwd` nor `projectTag` is provided
     *
     * Never throws — git resolution failures are silently ignored because not
     * being in a repo is a normal runtime state.
     */
    private maybeAttachCodingContext;
    recall(request: EngramAccessRecallRequest): Promise<EngramAccessRecallResponse>;
    recallExplain(request?: EngramAccessRecallExplainRequest): Promise<EngramAccessRecallExplainResponse>;
    recallTierExplain(sessionKey?: string, namespace?: string, authenticatedPrincipal?: string): Promise<RecallExplainJsonPayload>;
    /**
     * Recall X-ray (issue #570).  Runs a recall with `xrayCapture: true`
     * and returns the resulting snapshot as structured JSON so every
     * surface (CLI / HTTP / MCP) gets the same payload.  Namespace scope
     * is enforced before the recall fires (CLAUDE.md rule 42 — read and
     * write paths must resolve through the same namespace layer) so an
     * unauthorized principal cannot capture an x-ray for a namespace it
     * cannot read.
     */
    recallXray(request: {
        query: string;
        sessionKey?: string;
        namespace?: string;
        budget?: number;
        authenticatedPrincipal?: string;
        /**
         * Disclosure depth used to shape per-result payload (issue #677
         * PR 3/4).  When set, each X-ray result is decorated with the
         * matching `disclosure` field and `estimatedTokens` computed from
         * the actual rendered content at that depth, so the renderer's
         * "Token spend by disclosure" summary reflects real spend rather
         * than staying empty when no caller wires the depth knob through.
         */
        disclosure?: RecallDisclosure;
        /**
         * Free-form recall tag filter (issue #689). Mirrors the field on
         * `EngramAccessRecallRequest`. When non-empty, the captured X-ray
         * snapshot's `results` are filtered down to memories whose
         * frontmatter tags satisfy `tagMatch` ("any" by default), and a
         * `tag-filter` entry is appended to `filters`.
         */
        tags?: string[];
        /** Match mode for `tags`. See `EngramAccessRecallRequest.tagMatch`. */
        tagMatch?: "any" | "all";
    }): Promise<{
        snapshotFound: boolean;
        snapshot?: RecallXraySnapshot;
    }>;
    private xrayQueue;
    memoryStore(request: EngramAccessMemoryStoreRequest): Promise<EngramAccessWriteResponse>;
    peekMemoryStoreIdempotency(request: EngramAccessMemoryStoreRequest): Promise<EngramAccessIdempotencyStatus>;
    suggestionSubmit(request: EngramAccessSuggestionSubmitRequest): Promise<EngramAccessWriteResponse>;
    peekSuggestionSubmitIdempotency(request: EngramAccessSuggestionSubmitRequest): Promise<EngramAccessIdempotencyStatus>;
    private validateWriteCandidate;
    memoryGet(memoryId: string, namespace?: string, principal?: string): Promise<EngramAccessMemoryResponse>;
    memoryBrowse(request?: EngramAccessMemoryBrowseRequest): Promise<EngramAccessMemoryBrowseResponse>;
    memoryTimeline(memoryId: string, namespace?: string, limit?: number, principal?: string): Promise<EngramAccessTimelineResponse>;
    entityList(options?: {
        namespace?: string;
        query?: string;
        limit?: number;
        offset?: number;
    }): Promise<EngramAccessEntityListResponse>;
    entityGet(name: string, namespace?: string): Promise<EngramAccessEntityResponse>;
    reviewQueue(runId?: string, namespace?: string, principal?: string): Promise<EngramAccessReviewQueueResponse>;
    maintenance(namespace?: string, principal?: string): Promise<EngramAccessMaintenanceResponse>;
    quality(namespace?: string, principal?: string): Promise<EngramAccessQualityResponse>;
    governanceRun(request: {
        namespace?: string;
        mode?: "shadow" | "apply";
        recentDays?: number;
        maxMemories?: number;
        batchSize?: number;
        authenticatedPrincipal?: string;
    }, principal?: string): Promise<{
        namespace: string;
        runId: string;
        traceId: string;
        mode: "shadow" | "apply";
        reviewQueueCount: number;
        proposedActionCount: number;
        appliedActionCount: number;
        summaryPath: string;
        reportPath: string;
    }>;
    procedureMiningRun(request: {
        namespace?: string;
        authenticatedPrincipal?: string;
    }, principal?: string): Promise<{
        namespace: string;
        clustersProcessed: number;
        proceduresWritten: number;
        skippedReason?: string;
    }>;
    liveConnectorsRun(request?: {
        authenticatedPrincipal?: string;
        force?: boolean;
    }, principal?: string): Promise<LiveConnectorsRunSummary>;
    /**
     * Run the pattern-reinforcement maintenance job (issue #687 PR 2/4).
     *
     * Cluster duplicate non-procedural memories and reinforce the
     * canonical (most-recent) member.  Gated on
     * `patternReinforcementEnabled` — when disabled, returns
     * `{ ran: false, skippedReason: "disabled" }` so the cron payload
     * surface in CI logs cleanly.
     *
     * Resolves the namespace via the same writable path used by
     * `procedureMiningRun` so cross-tenant writes are impossible
     * (CLAUDE.md rule 42).
     *
     * Delegates the run to `orchestrator.runPatternReinforcement` so
     * the cadence floor (`patternReinforcementCadenceMs`) is enforced
     * uniformly across cron + MCP paths (PR #730 review feedback,
     * Codex P2).  Accepts `force: true` for ad-hoc operator runs that
     * must bypass the cadence floor — mirrors the pattern used by
     * other maintenance MCP tools.
     */
    patternReinforcementRun(request?: {
        namespace?: string;
        authenticatedPrincipal?: string;
        force?: boolean;
    }, principal?: string): Promise<{
        namespace: string;
        ran: boolean;
        skippedReason?: "disabled" | "cadence";
        clustersFound: number;
        canonicalsUpdated: number;
        duplicatesSuperseded: number;
        result?: PatternReinforcementResult;
    }>;
    /**
     * Procedural memory stats (issue #567 PR 5/5). Read-only — resolves the
     * namespace via the same path used by `recallExplain` / `trustZoneStatus`
     * so cross-tenant reads are impossible (CLAUDE.md rule 42).
     */
    procedureStats(request?: {
        namespace?: string;
    }, principal?: string): Promise<ProcedureStatsReport & {
        namespace: string;
    }>;
    memorySummarizeHourly(): Promise<{
        ok: true;
        message: string;
    }>;
    conversationIndexUpdate(request?: {
        sessionKey?: string;
        hours?: number;
        embed?: boolean;
    }): Promise<{
        enabled: boolean;
        sessionKey?: string;
        sessions: number;
        chunks: number;
        skipped: number;
        skippedSessionKeys: string[];
        embeddedRuns: number;
        reason?: string;
        retryAfterMs?: number;
    }>;
    profilingReport(request?: AccessProfilingReportRequest): Promise<AccessProfilingReportResponse>;
    trustZoneStatus(namespace?: string, principal?: string): Promise<EngramAccessTrustZoneStatusResponse>;
    trustZoneBrowse(request: EngramAccessTrustZoneBrowseRequest, principal?: string): Promise<EngramAccessTrustZoneBrowseResponse>;
    trustZonePromote(request: EngramAccessTrustZonePromoteRequest): Promise<EngramAccessTrustZonePromoteResponse>;
    trustZoneDemoSeed(request: EngramAccessTrustZoneDemoSeedRequest): Promise<EngramAccessTrustZoneDemoSeedResponse>;
    reviewDisposition(request: EngramAccessReviewDispositionRequest): Promise<EngramAccessReviewDispositionResponse>;
    private serializeMemory;
    private serializeMemorySummary;
    observe(request: EngramAccessObserveRequest): Promise<EngramAccessObserveResponse>;
    lcmSearch(request: EngramAccessLcmSearchRequest): Promise<EngramAccessLcmSearchResponse>;
    continuityAuditGenerate(request: {
        period?: "weekly" | "monthly";
        key?: string;
    }): Promise<{
        enabled: boolean;
        reason?: string;
        period?: string;
        key?: string;
        reportPath?: string;
    }>;
    continuityIncidentOpen(request: {
        symptom: string;
        namespace?: string;
        principal?: string;
        triggerWindow?: string;
        suspectedCause?: string;
    }): Promise<unknown>;
    continuityIncidentClose(request: {
        id: string;
        namespace?: string;
        principal?: string;
        fixApplied: string;
        verificationResult: string;
        preventiveRule?: string;
    }): Promise<unknown>;
    continuityIncidentList(request: {
        state?: "open" | "closed" | "all";
        namespace?: string;
        principal?: string;
        limit?: number;
    }): Promise<unknown>;
    continuityLoopAddOrUpdate(request: {
        id: string;
        cadence: "daily" | "weekly" | "monthly" | "quarterly";
        purpose: string;
        status: "active" | "paused" | "retired";
        killCondition: string;
        namespace?: string;
        principal?: string;
        lastReviewed?: string;
        notes?: string;
    }): Promise<unknown>;
    continuityLoopReview(request: {
        id: string;
        namespace?: string;
        principal?: string;
        status?: "active" | "paused" | "retired";
        notes?: string;
        reviewedAt?: string;
    }): Promise<unknown>;
    identityAnchorGet(request: {
        namespace?: string;
        principal?: string;
    }): Promise<unknown>;
    /**
     * @deprecated since issue #679 PR 5/5 — the identity-anchor model is
     * superseded by the peer registry. Use `peerSet({ id: "self", ... })` or
     * `remnic peer set self` to update the self peer's identity kernel, and
     * `remnic peer migrate` to seed `peers/self/identity.md` from existing
     * legacy anchor data. This method continues to function for backward
     * compatibility but will be removed in a future major version.
     */
    identityAnchorUpdate(request: {
        namespace?: string;
        principal?: string;
        identityTraits?: string;
        communicationPreferences?: string;
        operatingPrinciples?: string;
        continuityNotes?: string;
    }): Promise<unknown>;
    memoryIdentity(request: {
        namespace?: string;
        principal?: string;
    }): Promise<unknown>;
    workTask(request: {
        action: "create" | "get" | "list" | "update" | "transition" | "delete";
        id?: string;
        title?: string;
        description?: string;
        status?: string;
        priority?: string;
        owner?: string;
        assignee?: string;
        projectId?: string;
        tags?: string[];
        dueAt?: string;
    }): Promise<unknown>;
    workProject(request: {
        action: "create" | "get" | "list" | "update" | "delete" | "link_task";
        id?: string;
        name?: string;
        description?: string;
        status?: string;
        owner?: string;
        tags?: string[];
        taskId?: string;
        projectId?: string;
    }): Promise<unknown>;
    workBoard(request: {
        action: "export_markdown" | "export_snapshot" | "import_snapshot";
        projectId?: string;
        snapshotJson?: string;
        linkToMemory?: boolean;
    }): Promise<unknown>;
    sharedContextWriteOutput(request: {
        agentId: string;
        title: string;
        content: string;
    }): Promise<unknown>;
    sharedFeedbackRecord(request: {
        agent: string;
        decision: "approved" | "approved_with_feedback" | "rejected";
        reason: string;
        date?: string;
        learning?: string;
        outcome?: string;
        severity?: "low" | "medium" | "high";
        confidence?: number;
        workflow?: string;
        tags?: string[];
        evidenceWindowStart?: string;
        evidenceWindowEnd?: string;
        refs?: string[];
    }): Promise<unknown>;
    sharedPrioritiesAppend(request: {
        agentId: string;
        text: string;
    }): Promise<unknown>;
    sharedContextCrossSignalsRun(request: {
        date?: string;
    }): Promise<unknown>;
    sharedContextCurateDaily(request: {
        date?: string;
    }): Promise<unknown>;
    compoundingWeeklySynthesize(request: {
        weekId?: string;
    }): Promise<unknown>;
    compoundingPromoteCandidate(request: {
        weekId: string;
        candidateId: string;
        dryRun?: boolean;
    }): Promise<unknown>;
    compressionGuidelinesOptimize(request: {
        dryRun?: boolean;
        eventLimit?: number;
    }): Promise<unknown>;
    compressionGuidelinesActivate(request: {
        expectedContentHash?: string;
        expectedGuidelineVersion?: number;
    }): Promise<unknown>;
    /** Conservative identity anchor section merge (matches tools.ts mergeIdentityAnchor logic). */
    private mergeIdentityAnchorSections;
    memorySearch(request: {
        query: string;
        namespace?: string;
        maxResults?: number;
        collection?: string;
        principal?: string;
    }): Promise<{
        query: string;
        results: Array<{
            path: string;
            score: number;
            snippet: string;
        }>;
        count: number;
    }>;
    memoryProfile(namespace?: string, principal?: string): Promise<Record<string, unknown>>;
    memoryEntitiesList(namespace?: string, principal?: string): Promise<{
        entities: string[];
        count: number;
    }>;
    memoryQuestions(namespace?: string, principal?: string): Promise<{
        questions: Array<{
            id: string;
            question: string;
            resolved: boolean;
        }>;
        count: number;
    }>;
    lastRecallSnapshot(sessionKey?: string): Promise<unknown>;
    intentDebug(namespace?: string): Promise<unknown>;
    qmdDebug(namespace?: string): Promise<unknown>;
    graphExplainLastRecall(namespace?: string): Promise<unknown>;
    /**
     * Read-only graph snapshot for the admin pane (issue #691 PR 2/5).
     *
     * Reads adjacency from the JSONL edge store written by `GraphIndex` and
     * resolves node metadata via the namespaced storage manager.  Namespace
     * resolution mirrors the read-side path used by `recall` /
     * `procedureStats`, so multi-principal deployments can't leak edges from
     * a peer namespace (CLAUDE.md rule 42).
     */
    graphSnapshot(request: GraphSnapshotRequest & {
        namespace?: string;
    }, authenticatedPrincipal?: string): Promise<GraphSnapshotResponse>;
    memoryFeedback(request: {
        memoryId: string;
        vote: "up" | "down";
        note?: string;
    }): Promise<{
        recorded: boolean;
        enabled?: boolean;
        reason?: string;
    }>;
    /**
     * Record a Memory Worth outcome observation (issue #560 PR 3).
     *
     * This is distinct from `memoryFeedback` — feedback is a human thumbs
     * up/down on whether a recalled memory was relevant; outcome is an
     * automated signal about whether the session that consumed the memory
     * ultimately succeeded or failed. Outcomes feed the Laplace-smoothed
     * worth score (`computeMemoryWorth`, PR 2) that PR 4 will use to
     * downweight memories correlated with bad sessions.
     *
     * The underlying writer only touches fact-category memories. Corrections,
     * procedures, and other kinds return `{ ok: false, reason:
     * "ineligible_category" }` so a ledger drainer doesn't need to pre-filter.
     */
    memoryOutcome(request: {
        memoryId: string;
        outcome: MemoryOutcomeKind;
        namespace?: string;
        principal?: string;
        sessionKey?: string;
        timestamp?: string;
    }): Promise<RecordMemoryOutcomeResult>;
    memoryPromote(request: {
        memoryId: string;
        namespace?: string;
        principal?: string;
        sessionKey?: string;
    }): Promise<unknown>;
    memoryActionApply(request: {
        action: string;
        outcome?: string;
        reason?: string;
        memoryId?: string;
        namespace?: string;
        principal?: string;
        sessionKey?: string;
        content?: string;
        category?: string;
        linkTargetId?: string;
        linkType?: string;
        linkStrength?: number;
        artifactType?: string;
        execute?: boolean;
        sourcePrompt?: string;
        dryRun?: boolean;
    }): Promise<unknown>;
    contextCheckpoint(request: {
        sessionKey: string;
        context: string;
        namespace?: string;
        principal?: string;
    }): Promise<{
        saved: boolean;
    }>;
    lcmStatus(): Promise<EngramAccessLcmStatusResponse>;
    /**
     * Record citation usage from an observed oai-mem-citation block.
     * For each citation entry, extract the memory ID from the path and
     * increment its access tracking via the orchestrator. Returns the
     * count of submitted IDs and the count of IDs that matched real memories.
     */
    recordCitationUsage(request: {
        sessionId?: string;
        namespace?: string;
        authenticatedPrincipal?: string;
        entries: Array<{
            path: string;
            lineStart: number;
            lineEnd: number;
            note: string;
        }>;
        rolloutIds: string[];
    }): Promise<{
        submitted: number;
        matched: number;
    }>;
    /**
     * Gather a point-in-time `ConsoleStateSnapshot` from the orchestrator.
     *
     * Principal-aware: `resolveReadableNamespace` enforces ACL before the
     * snapshot is gathered, so callers cannot read a namespace they don't
     * have read access to (CLAUDE.md rule 42).  The resolved namespace's
     * storage directory is forwarded as `config.memoryDir` so the ledger-
     * tail reader in `gatherConsoleState` scans the correct namespace root
     * rather than the global root.  Read-only — never mutates orchestrator state.
     */
    consoleState(namespace?: string, principal?: string): Promise<ConsoleStateSnapshot>;
    /**
     * List all registered peers. Returns the array of `Peer` objects in
     * deterministic alphabetical order (mirroring `listPeers` storage semantics).
     */
    peerList(): Promise<{
        peers: Peer[];
    }>;
    /**
     * Get a single peer by id. Returns `{ found: false }` when the peer does
     * not exist rather than throwing, matching the `memoryGet` / `entityGet`
     * pattern used throughout the service.
     */
    peerGet(peerId: string): Promise<{
        found: true;
        peer: Peer;
    } | {
        found: false;
    }>;
    /**
     * Upsert a peer. Writes `peers/{id}/identity.md`. On first write the
     * `createdAt` timestamp is set to now; on subsequent writes only
     * `displayName` and `notes` are mutated (kind and createdAt are immutable
     * once set, per the storage contract).
     *
     * Returns `{ created: true }` on first write, `{ created: false }` on update.
     */
    peerSet(input: {
        id: string;
        kind?: string;
        displayName?: string;
        notes?: string;
    }): Promise<{
        ok: true;
        created: boolean;
        peer: Peer;
    }>;
    /**
     * Delete a peer by removing `peers/{id}/identity.md`. If the file does not
     * exist the call is a no-op (idempotent). The peer directory itself
     * (`peers/{id}/`) is intentionally left in place — profile and interaction
     * log data are not destroyed.
     */
    peerDelete(peerId: string): Promise<{
        ok: true;
        deleted: boolean;
    }>;
    /**
     * Destructively purge the entire peer directory for a given peerId —
     * `identity.md`, `profile.md`, `interactions.log.md`, and any other
     * files in `peers/{id}/`. Requires `confirm: "yes"` to prevent
     * accidental invocation.
     *
     * This is the DESTRUCTIVE counterpart to `peerDelete`, which only
     * removes `identity.md`. All companion files are permanently removed.
     *
     * Returns `{ ok: true, purged: true }` when the directory existed and
     * was removed; `{ ok: true, purged: false }` when the directory did
     * not exist (idempotent no-op).
     */
    peerForget(peerId: string, opts: {
        confirm: string;
    }): Promise<{
        ok: true;
        purged: boolean;
    }>;
    /**
     * Get the evolving cognitive profile for a peer. Returns `{ found: false }`
     * when no profile file exists yet (profile is written by the async reasoner,
     * PR 2/5). The peer identity itself need not exist for a profile to exist,
     * but in practice the reasoner only writes profiles for registered peers.
     */
    peerProfileGet(peerId: string): Promise<{
        found: true;
        profile: PeerProfile;
    } | {
        found: false;
    }>;
    get memoryDir(): string;
    /**
     * Resolve the storage directory for a given namespace.  Used by the SSE
     * graph-event handler to subscribe to the correct per-namespace bus rather
     * than the global root (CLAUDE.md rule 42 — read/write paths must resolve
     * through the same namespace layer).
     *
     * `principal` must be the transport-bound request principal (from
     * `resolveRequestPrincipal`).  When namespaces are enabled, an absent
     * principal causes `resolveReadableNamespace` to throw an auth error,
     * matching the behaviour of every other authenticated read path.
     *
     * Falls back to `this.memoryDir` when namespaces are disabled or the
     * namespace is absent, matching the behaviour of every other read path.
     */
    getMemoryDirForNamespace(namespace?: string, principal?: string): Promise<string>;
    get storageRef(): StorageManager;
    get configRef(): PluginConfig;
    get localLlmRef(): LocalLlmClient | null;
    get fallbackLlmRef(): FallbackLlmClient | null;
    get embeddingLookupFactoryRef(): (storage: StorageManager) => SemanticDedupLookup | undefined;
    /**
     * Import a capsule archive into the orchestrator's memory directory.
     *
     * Delegates directly to the standalone {@link importCapsuleFn} function.
     * The `root` parameter defaults to the orchestrator's `memoryDir` when
     * omitted, so callers that only have access to the service do not need to
     * thread the config value through.
     *
     * `versioning` defaults to the orchestrator's page-versioning config so
     * `mode: "overwrite"` automatically snapshots prior content without the
     * caller having to construct the config object.
     */
    capsuleImport(opts: Omit<ImportCapsuleOptions, "root" | "memoryDir"> & {
        root?: string;
        memoryDir?: string;
        namespace?: string;
        principal?: string;
    }): Promise<ImportCapsuleResult>;
    private validateCapsuleImportArchivePath;
    private isCapsuleImportPathInputFsError;
    private isCapsuleImportArchiveInputError;
    /**
     * Export a capsule archive from the orchestrator's memory directory.
     *
     * HTTP and future MCP surfaces use this rather than calling the transfer
     * helper directly so namespace ACL checks stay consistent with the archive
     * write side effect. The exporter still owns archive construction and
     * validation.
     */
    capsuleExport(opts: Omit<ExportCapsuleOptions, "root" | "memoryDir"> & {
        root?: string;
        memoryDir?: string;
        namespace?: string;
        principal?: string;
    }): Promise<ExportCapsuleResult>;
    /**
     * List capsule archives in the namespace-scoped capsule store.
     *
     * MCP uses this access-layer method instead of reading arbitrary paths so
     * capsule discovery remains bound to the same namespace ACLs as export and
     * import.
     */
    capsuleList(options?: {
        namespace?: string;
        principal?: string;
    }): Promise<EngramAccessCapsuleListResponse>;
    /**
     * Return per-phase Dreams telemetry for the last N hours (default 24).
     */
    dreamsStatus(options?: {
        windowHours?: number;
        namespace?: string;
        principal?: string;
    }): Promise<DreamsStatusResult>;
    /**
     * Manually invoke a single Dreams phase pass (PR 4/4).
     *
     * Deep-sleep delegates to memory governance (shadow → dry-run, apply → live).
     * Light-sleep and REM scan the observation ledger and memory corpus
     * respectively, returning the same telemetry shape as a scheduled run.
     */
    dreamsRun(options: {
        phase: DreamsPhase;
        dryRun?: boolean;
        namespace?: string;
        authenticatedPrincipal?: string;
    }): Promise<DreamsRunResult>;
}

export { type EngramAccessTrustZoneDemoSeedRequest as $, type EngramAccessMaintenanceResponse as A, type EngramAccessMemoryBrowseRequest as B, type CapsuleParent as C, type EngramAccessMemoryBrowseResponse as D, EngramAccessService as E, type EngramAccessMemoryRecord as F, type EngramAccessMemoryResponse as G, type EngramAccessMemoryStoreRequest as H, type ImportCapsuleResult as I, type EngramAccessMemorySummary as J, type EngramAccessObserveMessage as K, type EngramAccessObserveRequest as L, type EngramAccessObserveResponse as M, type EngramAccessQualityResponse as N, type EngramAccessRecallExplainRequest as O, type PeerInteractionLogEntry as P, type EngramAccessRecallExplainResponse as Q, type EngramAccessRecallRequest as R, type EngramAccessRecallResponse as S, type EngramAccessReviewDispositionRequest as T, type EngramAccessReviewDispositionResponse as U, type EngramAccessReviewQueueResponse as V, type EngramAccessSetCodingContextRequest as W, type EngramAccessSuggestionSubmitRequest as X, type EngramAccessTimelineResponse as Y, type EngramAccessTrustZoneBrowseRequest as Z, type EngramAccessTrustZoneBrowseResponse as _, type Peer as a, type EngramAccessTrustZoneDemoSeedResponse as a0, type EngramAccessTrustZonePromoteRequest as a1, type EngramAccessTrustZonePromoteResponse as a2, type EngramAccessTrustZoneRecordSummary as a3, type EngramAccessTrustZoneStatusResponse as a4, type EngramAccessWriteEnvelope as a5, type EngramAccessWriteResponse as a6, shapeMemorySummary as a7, type PeerProfile as b, type ExportManifestV2 as c, EngramAccessInputError as d, PEER_ID_MAX_LENGTH as e, PEER_ID_PATTERN as f, type PeerKind as g, type PeerProfileFieldProvenance as h, type ProcedureStatsConfigSnapshot as i, type ProcedureStatsRecent as j, type ProcedureStatsReport as k, type ProcedureStatusCounts as l, computeProcedureStats as m, formatProcedureStatsText as n, ENGRAM_ACCESS_WRITE_SCHEMA_VERSION as o, type EngramAccessBriefingRequest as p, type EngramAccessBriefingResponse as q, type EngramAccessCapsuleListResponse as r, type EngramAccessDaySummaryRequest as s, type EngramAccessEntityListResponse as t, type EngramAccessEntityResponse as u, type EngramAccessEntitySummary as v, type EngramAccessHealthResponse as w, type EngramAccessLcmSearchRequest as x, type EngramAccessLcmSearchResponse as y, type EngramAccessLcmStatusResponse as z };
