@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
36 lines • 2.91 kB
TypeScript
import type { MovedBreadcrumb } from "./breadcrumb.ts";
import type { MovedPath } from "./breadcrumb-trust.ts";
import { type PathPlatform } from "./path-match.ts";
/** The OmO desktop's legacy data roots (omo-desktop-app#1829), checked before any other path a call names. */
export declare const legacyRoots: () => string[];
/** Whether `path` is, by text, a legacy data root directly under one of the user's home spellings. */
export declare const isLegacyRoot: (path: string, homes: readonly string[], platform: PathPlatform) => boolean;
/**
* One (old root, listed prefix) of a trusted breadcrumb, keyed by what the breadcrumb says rather than by how the old
* root was spelled, so a symlinked or `/var` vs `/private/var` spelling of one root shares one decision.
*/
export declare const prefixKey: (oldRoot: string, breadcrumb: MovedBreadcrumb, prefix: readonly string[]) => string;
/** The (old root, listed prefix) keys a path lies under, by text, among breadcrumbs trusted so far. */
export declare function knownPrefixKeys(path: string, platform?: PathPlatform): string[];
/** The last answer this process got to "does this listed prefix hold its own `.git`", by `prefixKey`. */
export declare function rememberReused(key: string, reused: boolean): void;
export declare function rememberedReused(key: string): boolean | undefined;
/**
* Remembers a trusted breadcrumb under its old root as the walk found it (`root`, realpath'd), as the walk's caller
* spelled it (`called`), and each of those re-spelled under every spelling of the user's home (`homes`: as
* `os.homedir()` spells it and its realpath). Commands name `~/.t3/...`, so when `$HOME` or `~/.t3` itself is a
* symlink the text fallback and the probe ranking would otherwise never match it (fifth review M-2, sixth review
* MEDIUM-1). Every spelling keys its decisions by `root`, so a re-used answer the walk recorded applies to all of them.
* The spellings come from the walk's own steps, so the text checks stay free of filesystem work.
*/
export declare function rememberTrustedBreadcrumb(root: string, called: string | undefined, breadcrumb: MovedBreadcrumb, homes: readonly string[], platform: PathPlatform): void;
export declare function looksMoved(path: string, platform?: PathPlatform): boolean;
/**
* The moved location of `path` by text alone, from breadcrumbs trusted earlier in this process (senpi#2898 re-review
* M3): used only for paths past a call's probe budget or deadline, so it does no filesystem work. A prefix this
* process last found re-used (its own `.git`) is skipped, as the caller skips prefixes its own probe found re-used, so
* a re-used worktree is never refused this way, also when a breadcrumb read timed out before the `.git` step
* (fifth review M-1).
*/
export declare function knownMove(path: string, platform?: PathPlatform): MovedPath | undefined;
//# sourceMappingURL=known-moves.d.ts.map