@mariozechner/pi-agent
Version:
General-purpose agent with tool calling and session persistence
21 lines • 906 B
TypeScript
export type Choice<T = string> = {
value: T;
description?: string;
};
export type ArgDef = {
type: "flag" | "boolean" | "int" | "float" | "string" | "file";
alias?: string;
default?: any;
description?: string;
choices?: Choice[] | string[];
showDefault?: boolean | string;
};
export type ArgDefs = Record<string, ArgDef>;
export type ParsedArgs<T extends ArgDefs> = {
[K in keyof T]: T[K]["type"] extends "flag" ? boolean : T[K]["type"] extends "boolean" ? boolean : T[K]["type"] extends "int" ? number : T[K]["type"] extends "float" ? number : T[K]["type"] extends "string" ? string : T[K]["type"] extends "file" ? string : never;
} & {
_: string[];
};
export declare function parseArgs<T extends ArgDefs>(defs: T, args: string[]): ParsedArgs<T>;
export declare function printHelp<T extends ArgDefs>(defs: T, usage: string): void;
//# sourceMappingURL=args.d.ts.map