@sema-agent/core
Version:
Stateless, task-oriented AI agent core
24 lines (23 loc) • 1.3 kB
TypeScript
/** Files/dirs the entry scan never treats as entries: the derived index, dotfiles (`.hydrate`,
* transaction staging files), and anything not `.md`. */
export declare const MEMORY_INDEX_FILENAME = "MEMORY.md";
/** Default nesting depth cap under a scope dir (CC memory is flat; a small allowance for topic dirs). */
export declare const DEFAULT_MAX_ENTRY_DEPTH = 3;
/** One on-disk entry file the scan found. */
export interface ScannedEntryFile {
/** Absolute path. */
path: string;
/** Slug = path relative to the scope dir, without `.md` (may contain `/` for nested topics). */
slug: string;
}
/**
* Enumerate a scope dir's entry files (depth-capped, symlinks skipped, dotfiles/index/non-`.md`
* ignored). Shared by the backend and the engine's harvest scan so the two can never disagree on
* what counts as an entry file. A scope dir is that scope's home and nothing else — no other
* scope's directory can lie under it, so there is nothing to exclude.
*/
export declare function scanEntryFiles(dir: string, opts?: {
maxDepth?: number;
/** Harvest gate hook: called for every path the scan SKIPS, with why (backend scans ignore it). */
onSkip?: (path: string, kind: "symlink" | "depth" | "nonmd" | "dotfile" | "unreadable") => void;
}): ScannedEntryFile[];