import { type StorageClient } from "../storage/client.js"; /** * What a generated instruction block can only know by looking at the wiki. * * The generator used to render a template from a slug and two defaults, which * made its output wrong in a specific and expensive way: it asserted write-back * paths without knowing whether any of them existed. On a real project that * ambiguity led a maintainer to conclude twice in one session that the paths * were invented, and to hand-edit the correct ones out (GH #457, D13). * * Everything here is best-effort. A brand-new project has no pages yet — that is * the `init_project` case, and an empty context degrades to exactly the old * behaviour, which is correct for a project where nothing exists yet. */ export interface ProjectContext { /** Whether the project folder has any pages at all. */ exists: boolean; pageCount: number; /** Category subdirectories the project actually uses, e.g. `canonical`, `data`. */ subdirs: string[]; /** Nested sub-projects, as `projects//projects/` slugs. */ subProjects: string[]; /** A declared filing system from the project readme's `filing:` frontmatter. */ filing?: string; /** Which of the candidate write-back targets already exist. */ existingPaths: Set; /** * Hand-written content carried forward from an existing instruction file, * already wrapped in its markers. Undefined when there is nothing to preserve. */ preservedRegion?: string; } export declare const DOMAIN_CONTEXT_START = ""; export declare const DOMAIN_CONTEXT_END = ""; /** * Section headings the generators themselves emit, in either platform's block. * * Exported and covered by a test that renders every variant of both generators * and asserts nothing it emits is missing here. That test is the point: a * heading absent from this set is treated as hand-written and preserved, so a * renamed or added generated section would silently start duplicating itself on * every refresh. Three GPT headings were already missing when this was written. */ export declare const GENERATED_HEADINGS: Set; /** * Pull the hand-written part of an existing instruction file forward. * * Explicit markers are the supported path. Without them the whole file is still * inspected rather than discarded, because the alternative — silently dropping * a project's channel voice, contacts and conventions on every refresh — is why * nobody refreshes an instruction file and why they rot. */ export declare function extractPreservedRegion(content: string): string | undefined; /** * Read what the wiki actually contains for a project. Never throws: every lookup * degrades to "unknown", and an unknown is rendered as "created on first use", * which is the pre-existing behaviour. */ export declare function gatherProjectContext(drive: StorageClient, slug: string, platform: "claude" | "gpt", candidatePaths: string[], userId?: string): Promise; //# sourceMappingURL=instructionContext.d.ts.map