UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

70 lines • 3.18 kB
export type GitPaths = { repoDir: string; commonGitDir: string; headPath: string; }; /** * Find git metadata paths by walking up from cwd. * Handles both regular git repos (.git is a directory) and worktrees (.git is a file). */ export declare function findGitPaths(cwd: string): GitPaths | null; /** * Provides git branch and extension statuses - data not otherwise accessible to extensions. * Context usage on ctx.getContextUsage(), token stats on ctx.sessionManager.getEntries(), model info on ctx.model. */ export declare class FooterDataProvider { private cwd; private static readonly WATCH_DEBOUNCE_MS; private extensionStatuses; private subagentCost; private cachedBranch; private gitPaths; private headWatcher; private headWatchFilePath; private headWatchFileListener; private reftableWatcher; private reftableTablesListWatcher; private reftableTablesListPath; private branchChangeCallbacks; private availableProviderCount; private refreshTimer; private gitWatcherRetryTimer; private refreshInFlight; private refreshPending; private disposed; constructor(cwd: string); /** Current git branch, null if not in repo, "detached" if detached HEAD */ getGitBranch(): string | null; /** Extension status texts set via ctx.ui.setStatus() */ getExtensionStatuses(): ReadonlyMap<string, string>; /** Subscribe to git branch changes. Returns unsubscribe function. */ onBranchChange(callback: () => void): () => void; /** Internal: set extension status */ setExtensionStatus(key: string, text: string | undefined): void; /** Internal: clear extension statuses, keeping the host-owned keys in `keep` */ clearExtensionStatuses(keep?: ReadonlySet<string>): void; /** USD spent by the subagent tree under this session, as reported via ctx.ui.setSubagentCost() */ getSubagentCost(): number | undefined; /** Internal: set the subagent tree's spend; a negative or non-finite figure is not a spend and clears it */ setSubagentCost(costUsd: number | undefined): void; /** Number of unique providers with available models (for footer display) */ getAvailableProviderCount(): number; /** Internal: update available provider count */ setAvailableProviderCount(count: number): void; setCwd(cwd: string): void; /** Internal: cleanup */ dispose(): void; private notifyBranchChange; private scheduleRefresh; private refreshGitBranchAsync; /** Branch as HEAD states it; `needsGitProbe` marks a reftable HEAD only git can resolve. */ private readBranchFromHead; private resolveGitBranchAsync; private clearGitWatchers; private scheduleGitWatcherRetry; private handleGitWatcherError; private setupGitWatcher; } /** Read-only view for extensions - excludes setExtensionStatus, setAvailableProviderCount and dispose */ export type ReadonlyFooterDataProvider = Pick<FooterDataProvider, "getGitBranch" | "getExtensionStatuses" | "getAvailableProviderCount" | "onBranchChange"> & Partial<Pick<FooterDataProvider, "getSubagentCost">>; //# sourceMappingURL=footer-data-provider.d.ts.map