/** * Pre-dispatch inference for `cleo add` — file detection, acceptance criteria * parsing, and parent-from-session lookup. * * Extracted from `packages/cleo/src/cli/commands/add.ts` (T1490) so that the * CLI layer remains a thin parse-and-delegate shell and all domain inference * lives in Core. * * Callers are responsible for any `process.stderr` output — this module never * writes to stdout/stderr directly. * * @task T1490 */ /** * Input parameters for `inferTaskAddParams`. */ export interface InferAddParamsInput { /** Task title — forwarded to GitNexus query. */ title: string; /** Optional task description — forwarded to GitNexus query for better ranking. */ description?: string; /** When true and `filesRaw` is absent, invoke GitNexus to suggest files. */ filesInfer?: boolean; /** Raw comma-separated file list from the `--files` CLI flag. */ filesRaw?: string; /** Raw acceptance criteria string from the `--acceptance` CLI flag. */ acceptanceRaw?: string; /** Already-resolved parent ID (from `--parent` or `--parent-id` flags). */ parentRaw?: string; /** Task type string — inference is skipped when type is `'epic'`. */ type?: string; } /** * Resolved inference results for `cleo add`. * * Only fields that were resolved or inferred are present; absent fields mean * "no change from what the CLI already determined". */ export interface InferAddParamsResult { /** Resolved file list (from inference or explicit `--files`). */ files?: string[]; /** * True when `--files-infer` was requested but GitNexus returned no results. * The caller should emit a warning to stderr. */ filesInferWarning?: boolean; /** Parsed acceptance criteria array. */ acceptance?: string[]; /** Parent task ID inferred from the active session's current task. */ inferredParent?: string; } /** * Infer files touched by a task from its title and description using GitNexus. * * Constructs a query from title + description, invokes `gitnexus query --json`, * and extracts file paths from the result. * * Fallback: if GitNexus is unavailable or returns empty results, returns an * empty array. * * @param title - Task title * @param description - Optional task description * @returns Array of inferred file paths (may be empty) * * @task T1330 * @task T1490 */ export declare function inferFilesViaGitNexus(title: string, description?: string): string[]; /** * Parse acceptance criteria from a raw CLI string. * * Supports two formats: * - JSON array: `'["AC1","AC2","AC3"]'` (fast-path; preserved verbatim) * - Pipe-separated: `"AC1|AC2|AC3"` (tokenized via `splitAcceptance`) * * The pipe-separated form uses a bracket+quote+escape-aware tokenizer so * criteria containing `ENUM (hot|cold|batch|embed)`, quoted string-unions * like `mode: 'realtime-token'|'batch'`, or escaped literals (`\|`) are * preserved as single tokens rather than being shredded. * * @param raw - Raw string from `--acceptance` flag * @returns Array of trimmed, non-empty acceptance criteria strings * * @bug https://github.com/kryptobaseddev/cleo/issues/409 * @task T1490 * @task T9839 */ export declare function parseAcceptanceCriteria(raw: string): string[]; /** * Resolve pre-dispatch inference parameters for `cleo add`. * * Performs three inference steps (each independently non-fatal): * 1. **File inference** — resolves explicit `--files` CSV or invokes GitNexus * when `--files-infer` is set. * 2. **Acceptance criteria parsing** — coerces pipe-separated or JSON-array * `--acceptance` strings to a string array. * 3. **Parent inference** — when no explicit parent is set and the task type * is not `'epic'`, looks up the active session's current task and returns * it as `inferredParent`. * * The function never writes to `process.stderr`; callers are responsible for * surfacing `filesInferWarning` and `inferredParent` notices. * * @param projectRoot - Absolute path to the project root (passed to session lookup) * @param input - Resolved CLI flag values * @returns Partial inference result; absent fields = no inference available * * @task T1490 */ export declare function inferTaskAddParams(projectRoot: string, input: InferAddParamsInput): Promise; //# sourceMappingURL=infer-add-params.d.ts.map