/** * Memory Package Resolver (#2545) * * `@claude-flow/memory` is an *optionalDependency* of `@claude-flow/cli`. On the * documented `npx ruflo` install path it lands in the npx cache * (`~/.npm/_npx//node_modules`), which is NOT on the node_modules walk-up * path from the user's project. The SessionStart auto-memory hook therefore * could never resolve it and self-learning silently no-op'd. * * At init time, however, the CLI *can* resolve the package from its own module * context (it is installed alongside the CLI in that same npx cache). We resolve * it once and record the absolute path in a machine-local project sidecar * (`.claude-flow/memory-package.json`). The hook reads this sidecar first, so it * reuses the copy npx already downloaded — no second install, no vendoring. * * This module is deliberately dependency-free and best-effort: nothing here ever * throws into the init/doctor flow. */ export declare const MEMORY_PACKAGE = "@claude-flow/memory"; /** Project-relative path of the resolver sidecar written by init / doctor --fix. */ export declare const MEMORY_SIDECAR_REL: string; export interface MemoryPackageRecord { /** Absolute path to the package's main entry (dist/index.js). */ distPath: string; /** Resolved package version, if readable. */ version: string | null; /** What produced this record ("init" | "doctor" | "upgrade"). */ resolvedBy: string; /** ISO timestamp of resolution. */ resolvedAt: string; } /** * Resolve `@claude-flow/memory`'s main entry from the CLI's own module context. * Returns the absolute dist path, or null when the optional dependency is absent * (e.g. installed with `--omit=optional`). */ export declare function resolveMemoryPackageFromCli(): string | null; /** * Resolve `@claude-flow/memory` the same way the runtime hook does, from a target * project directory: sidecar → project package.json → node_modules walk-up. * Used by `doctor` so its verdict matches what the hook will actually experience. */ export declare function resolveMemoryPackageFromProject(targetDir: string): string | null; /** Read the version of the resolved memory package (dist/index.js → ../package.json). */ export declare function readMemoryPackageVersion(distPath: string): string | null; /** * Best-effort: resolve `@claude-flow/memory` from the CLI and record its path in * the project sidecar so the runtime hook can find it on the npx install path. * Returns the written record, or null when the package is not resolvable from the * CLI (in which case the hook fails loud and `doctor` flags it). */ export declare function recordMemoryPackagePath(targetDir: string, resolvedBy?: string): MemoryPackageRecord | null; //# sourceMappingURL=memory-package-resolver.d.ts.map