import type { MemoryScope } from '../../core/memory-resolver.js'; export declare const MEMORY_KINDS: readonly ["knowledge", "preference"]; export declare const VISIBILITY_RUNGS: readonly ["none", "name", "preview", "content"]; export declare const MEMORY_SCOPES: readonly ["user", "project", "profile", "node"]; /** Scope sort weight matching resolution precedence (node > project stack > * profile > user > builtin). Used by `list` for its "scope then kind then * name" ordering. */ export declare function scopeRank(scope: MemoryScope): number; /** Resolve the write target scope + its memory dir. Default: project when a * project scope exists for the cwd, else user. An explicit `--scope project` * with no project scope yet scaffolds one (ensureProjectScopeRoot). User scope * always resolves. `--scope profile` is NEVER a default — it requires a * selected profile, from `profileArg` (an explicit `--profile `) * or else the process's `CRTR_PROFILE_ID`, resolved through the centralized * `loadProfileManifest` (never a raw path join). `dirArg` (an explicit * `--dir `) pins the EXACT project directory, cwd-free: the target is * `/.crouter/memory/`, scaffolded if absent, never the cwd-ancestor walk * — the way a profiled agent writes into any project in its purview, and the * only way to target a dir shadowed by an ancestor store. `--scope node` * targets the this-node store (`nodes//context/memory/`) and * requires a running node. Returns the absolute `/memory` dir to write * under. */ export declare function resolveWriteTarget(scopeArg: string | undefined, profileArg?: string, dirArg?: string): { scope: MemoryScope; memoryDir: string; }; /** Map a path-derived name (`topic` or `area/topic`) to its file path under a * memory dir, guarding against traversal/absolute escapes. */ export declare function memoryFilePath(memoryDir: string, name: string): string; export declare function coerceGate(raw: string): Record; /** Coerce a `--read-when` string into a predicate tree. Like `--gate`, the * read-when field MUST be a YAML/JSON object (the field→matcher map the schema * expects, evaluated against a read file's own frontmatter). A scalar/array * read-when is inert (never matches), so passing one is always a mistake and is * caught at authoring time rather than stored. */ export declare function coerceReadWhen(raw: string): Record; /** Coerce repeatable `--applies-to` values (already an array from the argv * parser) to the schema's glob form: one value stays a bare string, several * become an array. Each value is trimmed; empty entries are rejected loudly * (a silently-dropped glob is a routing bug waiting to happen). */ export declare function coerceAppliesTo(values: string[]): unknown; /** Provenance for a doc at the moment it is created: when, where, and which * node's conversation authored it. Read from the env the runtime injects into * every node's pi process (CRTR_NODE_ID/KIND/MODE/NODE_CWD); when invoked * outside a node (a human at the CLI) only `created` + `cwd` are recorded. * Stamped ONCE at create and preserved verbatim on every later update — * `crtr memory origin ` derefs the `node` pointer back to the live node * (its session conversation, context dir, current state). */ export declare function buildOrigin(): Record; /** Serialize a substrate frontmatter record + body into a complete `.md` * document. Frontmatter is emitted as a `---` fenced YAML block (the `yaml` * package — the same one the parser uses — so nested gate maps and applies-to * arrays round-trip), in canonical field order with preserved extras last. */ export declare function serializeMemoryDoc(frontmatter: Record, body: string): string;