/** * PURE deterministic project-fact detector. * * PURE — no fs reads, no Date.now(), no createClient, no network access, no side effects. * Takes already-parsed manifests/config as inputs and returns FactDraft[] deterministically. * The thin IO caller (seedProjectFacts) handles all fs reads and clock-stamping. * * Mirror of distill.ts: the pure fn is separate from the IO boundary. */ import type { FactInput } from "../../state/facts.js"; /** Already-parsed manifests/config passed in by the thin IO caller. */ export interface ProjectInputs { /** Parsed package.json content (or null if absent). */ packageJson: Record | null; /** Parsed bober.config.json content (optional). */ boberConfig?: Record | null; /** * Lockfile presence flags, computed by the caller (no fs in the pure fn). * First truthy flag in order npm → yarn → pnpm determines packageManager. */ lockfiles?: { npm?: boolean; yarn?: boolean; pnpm?: boolean; }; } /** * A fact draft — everything EXCEPT the injected timestamps, which the caller stamps. * Mirrors the FactInput shape but without tValid and tCreated. */ export type FactDraft = Omit; /** * PURE: map parsed manifests/config into project-fact drafts. * NO fs read, NO Date.now(), NO LLM. Returns [] when nothing is detectable. * * Detection rules: * project/testCommand ← packageJson.scripts.test (if truthy) * project/buildCommand ← packageJson.scripts.build (if truthy) * project/packageManager ← first lockfile present: npm > yarn > pnpm * project/framework ← first dep/devDep found: next > react > vue * * Scope convention: scope="" (default/programming team) per memoryDir mapping * in src/state/memory.ts:27-32. Namespace is a SEPARATE axis (DB file location). */ export declare function detectProjectFacts(inputs: ProjectInputs, scope?: string): FactDraft[]; /** * Thin IO wrapper: reads manifests from disk, calls the PURE detectProjectFacts, * then stamps wall-clock time and writes each draft through writeFact (idempotent). * * This is the ONLY function in this module that touches the filesystem or the clock. * It is extracted here so both pipeline.ts and chat-session.ts can reuse one helper * without duplicating the IO pattern. * * A missing package.json or bober.config.json is NORMAL — the detector returns a * partial set of drafts. Never throws for missing files. * * @param projectRoot - Absolute path to the project root * @param namespace - Memory namespace (undefined → default .bober/memory/) */ export declare function seedProjectFacts(projectRoot: string, namespace?: string): Promise; //# sourceMappingURL=fact-detector.d.ts.map