/** * The ONE machine-wide workspace base (`~/.teamshare/workspace`, or * `TEAMSHARE_WORKSPACE_DIR`). Exported for state that is not per-project - * prompt files, for instance, which an agent must be able to read from a run * whose opencode config allows `~/.teamshare/workspace/**` and denies the rest * of `~/.teamshare/**`. */ export declare function workspaceBaseDir(): string; /** Stable key for a linked folder. Never throws. */ export declare function workspaceKeyFor(folder: string): string; /** The workspace root for a linked folder. Creates it. */ export declare function workspaceRootFor(folder: string): string; /** All workspace roots (for sweeps). Empty when the base does not exist. */ export declare function allWorkspaceRoots(): string[]; /** * Scratch dir for transient run files (briefs, post.json, plan prompts). * Created on call. MUST be disposed with disposeDir() on TERMINAL run end * only (completed / failed / cancelled) - never on a pause or an idle kill, * because a question resume reuses the same files. */ export declare function scratchDirFor(folder: string, kind: 'research' | 'blog' | 'plans' | 'planner' | 'workflow' | 'insight' | 'misc', id: string): string; /** Headless scratch (no linked folder - blog generations without a project). */ export declare function headlessScratchDir(kind: string, id: string): string; /** Staging dir for files built for upload / attachFile. */ export declare function stagingDirFor(folder: string, runId: string): string; /** * Worktree root for isolation mirrors. This is ``'s OWN * `.teamshare-worktrees` directory - the NAME is the safety boundary: * `removeWorktreeSafeAsync` refuses to delete anything outside a * `.teamshare-worktrees` root, and that data-loss guard must keep working * unchanged. What changed is only the PARENT: outside every tracked folder * instead of `/..`. */ export declare function worktreeRootFor(folder: string): string; /** Legacy sibling worktree root. Read-only - for sweeps and migration. */ export declare function legacyWorktreeRootFor(folder: string): string; /** --separate-git-dir target for a non-repo linked folder. */ export declare function containerGitDirFor(folder: string): string; /** True unless TEAMSHARE_KEEP_SCRATCH=1 (local debugging). */ export declare function shouldDisposeScratch(): boolean; /** * Remove a scratch/staging dir. Links-first is unnecessary here (no junctions * to the project), but we still never follow symlinks into the project: * entries that are symlinks are unlinked, never traversed. */ export declare function disposeDir(dir: string): void; /** * Reap crash-leftover scratch dirs older than `maxAgeMs` (default 7 days - * the same horizon run secrets live). Never touches a dir younger than the * horizon: a paused run (question wait, idle kill) resumes with its files. */ export declare function sweepStaleScratch(maxAgeMs?: number): string[];