@blundergoat/goat-flow
Version:
AI coding agent harness and local dashboard for Claude Code, OpenAI Codex, Google Antigravity, and GitHub Copilot - setup audits, guardrails, structured skills, deny hooks, and persistent learning loops.
23 lines • 1.53 kB
TypeScript
/** Allowed local-path use cases, each with a different filesystem trust boundary. */
export type LocalPathPurpose = "browse" | "project-read" | "terminal-cwd" | "write-local-state" | "upload";
type LocalPathValidationClass = "missing" | "not-directory" | "blocked-root" | "blocked-descendant" | "state-path-escape";
/** Resolved path plus the realpath used for symlink escape checks. */
export interface ValidatedLocalPath {
path: string;
realPath: string;
purpose: LocalPathPurpose;
}
type LocalStatePathPurpose = Extract<LocalPathPurpose, "write-local-state" | "upload">;
/** Structured validation failure returned to dashboard callers as a safe rejection. */
declare class LocalPathValidationError extends Error {
readonly validationClass: LocalPathValidationClass;
readonly purpose: LocalPathPurpose | "state-path";
constructor(purpose: LocalPathPurpose | "state-path", validationClass: LocalPathValidationClass);
}
export { LocalPathValidationError };
export declare function isPathWithin(parent: string, child: string): boolean;
export declare function validateLocalPath(rawPath: string, purpose: LocalPathPurpose): ValidatedLocalPath;
export declare function resolveValidatedLocalStatePath(project: ValidatedLocalPath, relativePath: string): string;
export declare function resolveLocalStatePath(projectPath: string, relativePath: string, purpose?: LocalStatePathPurpose): string;
export declare function validateProjectPath(projectPath: string): string;
//# sourceMappingURL=local-paths.d.ts.map