export type GitApplyStashChangesPermission = "git:read" | "git:write" | "filesystem:read" | "filesystem:write";
export type GitApplyStashChangesGuard = {
    allowed?: boolean;
    accepted?: boolean;
    reason?: string;
};
export type GitApplyStashChangesContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: GitApplyStashChangesGuard;
    allowedRepositoryRoots?: readonly string[];
    grantedPermissions?: readonly GitApplyStashChangesPermission[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type GitApplyStashChangesTarget = {
    repositoryPath: string;
    stashRef: string;
    reinstateIndex: boolean;
};
export type GitApplyStashChangesRequest = {
    target?: Partial<GitApplyStashChangesTarget>;
    context?: GitApplyStashChangesContext;
    provider?: GitApplyStashChangesProvider;
    timeoutMs?: number;
    metadata?: Readonly<Record<string, unknown>>;
    runtimeId?: string;
    invocationId?: string;
    repositoryPath?: string;
    stashRef?: string;
    reinstateIndex?: boolean;
    dryRun?: boolean;
};
export type GitApplyStashChangesRuntimeEntry = {
    owner: "runtime";
    port: "BaseToolExecutorPort.git.runGit";
    method: "runGit";
    binary: "git";
    argvMode: "fixed-stash-apply-workspace-mutation";
    allowedSubcommand: "stash";
};
export type GitApplyStashChangesRisk = {
    category: "workspace-mutation";
    riskLevel: "risky";
    mutatesRepository: true;
    mutatesWorkingTree: true;
    mutatesIndex: boolean;
    dropsStashOnSuccess: false;
    spawnsProcess: true;
    requiresTapApproval: true;
    runtimeOwnsExecution: true;
};
export type GitApplyStashChangesEnvelope = {
    parser: "git-stash-apply-exit-v1";
    stashRef: string;
    reinstateIndex: boolean;
    exitCode?: number;
    stdoutLineCount: number;
    stderrLineCount: number;
    appliedHint?: string;
};
export type GitApplyStashChangesOutput = {
    kind: "agentCore.basicTool.git.applyStashChanges";
    target: GitApplyStashChangesTarget;
    runtimeEntry: GitApplyStashChangesRuntimeEntry;
    risk: GitApplyStashChangesRisk;
    gitArgs: readonly string[];
    commandPreview: readonly string[];
    timeoutMs: number;
    dryRun: boolean;
    executionBlocked: boolean;
    providerCalled: boolean;
    exitCode?: number;
    stdout?: string;
    stderr?: string;
    permissionsRequired: readonly GitApplyStashChangesPermission[];
    unsafeSideEffects: true;
    dropsStashOnSuccess: false;
    resultEnvelope: GitApplyStashChangesEnvelope;
};
export type GitApplyStashChangesPlan = {
    toolId: "git.applyStashChanges";
    toolKind: "git.applyStashChanges";
    capability: "apply-stash-changes";
    runtimeId: string;
    invocationId: string;
    repositoryPath: string;
    stashRef: string;
    reinstateIndex: boolean;
    gitArgs: readonly string[];
    commandPreview: readonly string[];
    requiredPermissions: readonly GitApplyStashChangesPermission[];
    runtimeEntry: GitApplyStashChangesRuntimeEntry;
    risk: GitApplyStashChangesRisk;
    dispatch: "dry-run" | "runtime-git-executor";
    dryRun: boolean;
    wouldMutateWorkingTree: true;
    wouldMutateIndex: boolean;
    unsafeSideEffects: true;
    outputEnvelope: {
        stdoutPreview: "";
        stderrPreview: "";
        parsed: false;
    };
    audit: {
        guard: "git-apply-stash-runtime-guard";
        event: "basicTool.git.applyStashChanges.planned";
        governanceRequired: true;
        tapCanWrap: true;
        metadata: Readonly<Record<string, unknown>>;
    };
};
export type GitApplyStashChangesErrorBoundary = "input" | "scope" | "permission" | "governance" | "provider";
export type GitApplyStashChangesErrorCode = "MISSING_REPOSITORY_PATH" | "INVALID_ARGUMENT" | "INVALID_CONTEXT" | "INVALID_STASH_REF" | "INVALID_TIMEOUT" | "SCOPE_REJECTED" | "PERMISSION_DENIED" | "GOVERNANCE_REJECTED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_REJECTED";
export type GitApplyStashChangesError = {
    code: GitApplyStashChangesErrorCode;
    message: string;
    boundary: GitApplyStashChangesErrorBoundary;
    publicSafe: true;
    safeForRuntimeInspection: true;
    internalDetailExposed: false;
};
export type GitApplyStashChangesAuditEvent = {
    type: string;
    toolId: "git.applyStashChanges";
    invocationId: string;
    dryRun: boolean;
    repositoryPath?: string;
    metadata: Readonly<Record<string, unknown>>;
};
export type GitApplyStashChangesResult = {
    ok: true;
    toolId: "git.applyStashChanges";
    output: GitApplyStashChangesOutput;
    plan: GitApplyStashChangesPlan;
    audit: readonly GitApplyStashChangesAuditEvent[];
    events: readonly string[];
} | {
    ok: false;
    toolId: "git.applyStashChanges";
    error: GitApplyStashChangesError;
    audit: readonly GitApplyStashChangesAuditEvent[];
    events: readonly string[];
};
export type GitApplyStashChangesProviderRequest = {
    repositoryPath: string;
    args: readonly string[];
    timeoutMs?: number;
};
export type GitApplyStashChangesProviderResult = {
    exitCode: number;
    stdout: string;
    stderr: string;
};
export type GitApplyStashChangesProvider = (request: GitApplyStashChangesProviderRequest, context: GitApplyStashChangesContext) => GitApplyStashChangesProviderResult | Promise<GitApplyStashChangesProviderResult>;
export declare const gitApplyStashChangesDescriptor: {
    readonly toolId: "git.applyStashChanges";
    readonly toolKind: "git.applyStashChanges";
    readonly capability: "apply-stash-changes";
    readonly route: "agent_executionEngine.basic_toolLayer.baseTools.gitBase.stash";
    readonly defaultDryRun: true;
    readonly defaultDispatch: "dry-run";
    readonly tapOwnsApproval: true;
    readonly requiresTapApproval: true;
    readonly runtimeEntryPort: "BaseToolExecutorPort.git.runGit";
    readonly operationRisk: "workspace-mutation";
    readonly permissionsRequired: readonly ["git:read", "git:write", "filesystem:read", "filesystem:write"];
    readonly defaultTimeoutMs: 30000;
    readonly maxTimeoutMs: 600000;
    readonly unsafeSideEffects: true;
};
export declare function parseGitApplyStashChangesResult(providerResult: GitApplyStashChangesProviderResult | undefined, target: GitApplyStashChangesTarget): GitApplyStashChangesEnvelope;
export declare function planGitApplyStashChanges(request?: GitApplyStashChangesRequest): GitApplyStashChangesResult;
export declare function executeGitApplyStashChanges(request?: GitApplyStashChangesRequest): Promise<GitApplyStashChangesResult>;
