/** * Session workdir derivation. Workdirs are never persisted or trusted from * storage or client input — the stale-workdir class of production bugs came * from reading `session.sandboxWorkdir` written under a different provider. * * Local sandboxes derive their workdir synchronously from the sandbox's own * `workingDirectory` (the per-session directory the deploy's callback chose). * Remote sandboxes have no invented path: the repo clones into the VM's own * default cwd (its home dir), so the workdir is only knowable once a VM is * running — resolved lazily by `resolveSessionWorkdir` via a one-time `pwd` * probe and memoized on the session entry. */ /** Keep each path piece a single safe segment (no separators or traversal). */ export declare function sanitizeSegment(segment: string): string; /** * Synchronously derivable workdir: local sandboxes expose their host * `workingDirectory`; the repo checks out as a contained subdirectory so the * setup marker sits beside the clone instead of polluting `git status` * inside it. Returns undefined for remote providers, whose workdir is a * runtime fact of the VM (`/`). */ export declare function deriveLocalWorkdir(sandbox: { provider: string; workingDirectory?: unknown; }, repoFullName: string): string | undefined; /** Derive `/` when a remote sandbox declares an absolute root. */ export declare function deriveRemoteRepoDir(sandbox: { provider: string; workingDirectory?: unknown; }, repoFullName: string): string | undefined; /** Join a parent directory and sanitized repository name. */ export declare function repoDirUnder(parent: string, repoFullName: string): string; /** Resolve a workdir under `root`, refusing any path that escapes the configured root. */ export declare function resolveContainedLocalWorkdir(root: string, ...segments: string[]): string; //# sourceMappingURL=workdir.d.ts.map