import { parseArgs } from "node:util"; import type { TurnOptions } from "../interpretation/argv.js"; export type ParsedPromptSource = { kind: "positional"; prompt: string; } | { kind: "prompt-flag"; prompt: string; } | { kind: "prompt-file"; prompt: string; } | { kind: "none"; }; export interface CliTurnOptions extends TurnOptions { } export interface CliRunOptions extends CliTurnOptions { readonly cwd?: string; readonly env?: Record; readonly resume?: string; readonly json?: boolean; } export interface ParseCommonResult { prompt: string | undefined; promptSource: ParsedPromptSource["kind"]; turnOptions: TurnOptions; runOptions: { cwd?: string; env?: Record; resume?: string; }; } export { parseEnvEntries } from "../interpretation/environment.js"; export declare const resolvePrompt: (args: { positionalPrompt?: string; promptFlag?: string; promptFile?: string; }) => { prompt: string; source: ParsedPromptSource["kind"]; }; export declare const resolvePromptAsync: (args: { positionalPrompt?: string; promptFlag?: string; promptFile?: string; }) => Promise<{ prompt: string; source: ParsedPromptSource["kind"]; }>; /** Parsed turn options plus the skill names as typed, which the command * resolves against the registry before they become a turn option. */ export type ParsedTurnOptions = TurnOptions & { readonly skillNames?: readonly string[]; }; /** * Build TurnOptions from parsed flag values. Shared between run and inspect --argv. */ export declare const parseTurnOptions: (values: Record) => ParsedTurnOptions; /** `--resume` and `--session-id` are aliases for one session id; both at * once refuses. `--resume-last` is most-recent resolution without an id: * with either alias it refuses too (two answers to one question). The one * check every command calls (run, inspect, session). */ export declare const resumeIdOf: (values: Record) => string | undefined; export declare const parseRunExtra: (values: Record) => { cwd?: string; env?: Record; resume?: string; resumeLast?: true; timeoutSeconds?: number; }; export interface CommonParseConfig { allowPrompt: boolean; allowPromptFile: boolean; } export declare const detectPositionalPromptInjection: (argv: string[]) => string | null; /** * Wrapper around node:util parseArgs for the common flag table. * Throws with exit code 2 on unknown flag. */ export interface SplitPassthrough { /** Tokens before the separator - hcn's normalized surface. */ readonly normalized: string[]; /** Tokens after the separator - verbatim passthrough to the harness, * empty when no separator was present. */ readonly passthrough: readonly string[]; } /** D6: split argv at the first bare `--`. Everything after it belongs to * the harness, not to hcn - wrong-harness flags there fail in the harness * itself and surface as native errors, never as hcn refusals. */ export declare const splitPassthrough: (argv: readonly string[]) => SplitPassthrough; export declare const memoryFlagOf: (values: Record) => boolean | undefined; export declare const parseCommonFlags: (argv: string[], opts?: { strict?: boolean; nativeSettings?: boolean; nativeSettingsFingerprint?: boolean; nativeApprovals?: boolean; }) => ReturnType; //# sourceMappingURL=args.d.ts.map