/**
 * Shared CLI argument parsing utilities.
 *
 * Provides `parse_command_args` for schema-validated command parsing and
 * `create_extract_global_flags` as a factory for project-specific global flag extraction.
 * Both are used identically across tx, zzz, and mageguild.
 *
 * @module
 */
import { type ParsedArgs } from '@fuzdev/fuz_util/args.js';
import { z } from 'zod';
/**
 * Discriminated union result for CLI argument parsing.
 */
export type ParseResult<T> = {
    success: true;
    data: T;
} | {
    success: false;
    error: string;
};
/**
 * Parse command-specific args against a Zod schema.
 *
 * Validates `remaining` args (after global flag extraction) with alias expansion
 * and returns a typed result or a prettified error string.
 *
 * @param remaining - remaining args after global flag extraction
 * @param schema - Zod schema for the command
 * @returns parse result with typed data or error message
 */
export declare const parse_command_args: <T extends Record<string, unknown>>(remaining: ParsedArgs, schema: z.ZodType<T>) => ParseResult<T>;
/**
 * Create a project-specific global flag extractor.
 *
 * Returns a function that separates global flags from command-specific args.
 * The schema defines which flags are global (with aliases via `.meta({aliases})`),
 * and the fallback provides defaults when parsing fails.
 *
 * @param schema - Zod schema for global flags
 * @param fallback - default values when parsing fails
 * @returns extractor function `(unparsed) => {flags, remaining}`
 */
export declare const create_extract_global_flags: <T extends Record<string, unknown>>(schema: z.ZodType<T>, fallback: T) => ((unparsed: ParsedArgs) => {
    flags: T;
    remaining: ParsedArgs;
});
//# sourceMappingURL=args.d.ts.map