import { TIMEOUT_EXIT_CODE, type BashExecutionRequest, type BashHookContext, type BashHookResult, type BashProcessResult } from "./bash-types.js"; interface ExecutionContext { worktreeDir: string; gitCommonDir?: string; resolvedFromGit: boolean; } interface ExecutionContextResolver { execFileSync(command: string, args: string[], options: { cwd: string; encoding: "utf8"; stdio: ["ignore", "pipe", "ignore"]; }): string; } interface SerializeContextResult { payload: string; truncated: boolean; } export declare function serializeContextForStdinDetailed(context: BashHookContext): SerializeContextResult; export declare function serializeContextForStdin(context: BashHookContext): string; /** * Given a Buffer and a desired maximum byte length, return the largest length * `<= maxBytes` that does not split a UTF-8 codepoint sequence. UTF-8 * continuation bytes match `0b10xxxxxx`; a starter byte is anything else. * * The marker text we append after truncation is itself ASCII (<= 0x7F), so we * only need to walk back as far as the most recent starter byte and verify * that the codepoint it begins is fully present in the slice. */ export declare function trimToUtf8Boundary(chunk: Buffer, maxBytes: number): number; export declare function executeBashHook(request: BashExecutionRequest): Promise; export declare function mapBashProcessResultToHookResult(result: BashProcessResult, context: BashHookContext): BashHookResult; export declare function isBlockingToolBeforeEvent(event: string): boolean; export declare function buildBashEnvironment(inheritedEnv: NodeJS.ProcessEnv, contextEnv: Record): NodeJS.ProcessEnv; export declare function redactSensitiveContent(value: string): string; export declare function resetExecutionContextCacheForTests(): void; /** * Test-only override for the cache clock. Allows tests to advance virtual * time past the TTL without sleeping. Always paired with * `resetExecutionContextCacheForTests()` afterwards. */ export declare function setExecutionContextNowForTests(now: () => number): void; export declare function resolveExecutionContext(projectDir: string, resolver?: ExecutionContextResolver): ExecutionContext; export { TIMEOUT_EXIT_CODE };