/** * Host-path rewriting (crew#618, crew#634 R5) — moved here from `api/chat-transcripts.ts` so the * deliver composer (`core/deliver-text.ts`, crew#886) uses the SAME rewrite on what leaves the * machine as the chat store applies to seat replies. Pure string work plus `realpath` lookups; no * crew imports (a core module importing the chat store closed an import cycle back into deliver). */ /** One repo root → name mapping entry used for path rewriting (crew#618). */ export interface ChatRepoRoot { /** Resolved absolute path of the repo root (from `EngineChatScope.readRoots`). */ absRoot: string; /** The repo's display name, used as the path prefix in rewritten citations. */ name: string; } /** * Rewrite absolute host paths in seat reply text to repo-relative form (crew#618). * * `/srv/repos/alpha/src/foo.ts` → `alpha/src/foo.ts` when `alpha`'s root is `/srv/repos/alpha`. * Longest roots are matched first so a path under a more-specific root (a NESTED root, * `/r/alpha/sub` under `/r/alpha`) is never truncated by a parent root. crew#634 R5: a BARE root * reference — the root itself, with no trailing separator, ending the text or followed by * whitespace / closing punctuation — becomes the repo name too (`/srv/repos/alpha.` → `alpha.`); * a longer sibling (`/srv/repos/alpha-extra`) is never touched. Pure string work. */ export declare function rewriteHostPaths(text: string, roots: ReadonlyArray): string; /** * crew#634 R5: every spelling a seat may cite a root by — the resolved path, its `realpath` (a * symlinked checkout), and the macOS `/private` twin of `/var`, `/tmp`, `/etc` either way round. * A twin is registered only when it RESOLVES to the same real directory (so a Linux `/private/tmp` * that is some other path is never rewritten — codex on this PR). Each alias maps to the same repo * name; an unreadable root keeps the one spelling it was given. */ export declare function withRootAliases(roots: ReadonlyArray): ChatRepoRoot[]; //# sourceMappingURL=host-paths.d.ts.map