/** * Bank ID derivation, project-tag scoping, and first-use mission setup. * * Three scoping modes (`HindsightConfig.scoping`): * - `global` — single shared bank, no per-project filter. * - `per-project` — one bank per cwd basename, hard isolation. * - `per-project-tagged` — single shared bank, retains carry a `project:` * tag and recall filters on it but still surfaces * untagged ("global") memories alongside. * * The base bank id is `bankIdPrefix-bankId` (default `omp`). Per-project mode * appends `-`; tagged mode leaves the bank untouched and uses tags. * * Mission setup is idempotent at module level — a missionsSet keeps track of * banks we've already POSTed to so each session boundary doesn't fire a fresh * `createBank` call. Failures are swallowed: missions are an optimisation, not * a precondition for retain/recall. */ import type { HindsightApi } from "./client"; import type { HindsightConfig } from "./config"; export type RecallTagsMatch = "any" | "all" | "any_strict" | "all_strict"; /** * Resolved bank target for a session: which bank to talk to, plus optional * tags to attach to retains and to filter recalls by. */ export interface BankScope { bankId: string; /** Tags applied to every retain. Undefined when scoping does not use tags. */ retainTags?: string[]; /** Tags filter for recall/reflect. Undefined when scoping does not use tags. */ recallTags?: string[]; /** Match mode for `recallTags`. Defaults to `any` so untagged ("global") memories surface too. */ recallTagsMatch?: RecallTagsMatch; } /** * Resolve the active bank target plus optional tag scoping. * * Always returns a non-empty `bankId`. Tag fields are populated only for * `per-project-tagged`. */ export declare function computeBankScope(config: HindsightConfig, directory: string): BankScope; /** * Backwards-compatible thin wrapper: just return the bank id portion of the * scope. New code should prefer `computeBankScope` directly so it can also * apply the tag fields. */ export declare function deriveBankId(config: HindsightConfig, directory: string): string; /** * Ensure a bank's reflect/retain mission is set, exactly once per process. * * Tracked via the supplied set; on overflow we drop the oldest half so the set * cannot grow unboundedly across long-lived processes. */ export declare function ensureBankMission(client: HindsightApi, bankId: string, config: HindsightConfig, missionsSet: Set): Promise;