/** * Manifest entry builder — constructs a fully-populated * {@link ExtendedManifestEntry} from the minimal shorthand fields agents * and CLI callers provide. * * The `pipeline_manifest` validator (see `pipelineManifestAppend` in * `pipeline-manifest-sqlite.ts`) REJECTS entries missing any of: * `id`, `file`, `title`, `date`, `status`, `agent_type`, `topics`, `actionable`. * Agents writing to the manifest from a spawn prompt only know `task`, `type`, * and `content` — so this helper fills the rest with sensible defaults. * * Lives in `@cleocode/core` (SDK layer) so every consumer — CLI (`cleo * manifest append`), Studio, VS Code extension, API server, direct SDK * callers — produces identically-shaped entries without duplicating the * defaulting logic (AGENTS.md package-boundary rule / T1096 / ADR-027 §6.2). * * @task T1187-followup · v2026.4.113 */ import type { ExtendedManifestEntry } from './index.js'; /** * Shorthand fields a subagent or CLI caller typically supplies. * * @remarks * Every field is optional to keep the helper flexible, but at least one of * `task` / `type` / `content` should be provided or the resulting entry will * carry only generic defaults. */ export interface ManifestShorthand { /** Task ID to associate — becomes `linked_tasks[0]` and the id prefix. */ task?: string; /** Entry type — becomes `agent_type` (e.g. "research", "implementation"). */ type?: string; /** One-paragraph summary — becomes `key_findings[0]` and (truncated) `title`. */ content?: string; /** Explicit title override when the first line of `content` is not ideal. */ title?: string; /** Entry status — defaults to `"completed"`. */ status?: 'completed' | 'partial' | 'blocked'; /** Explicit file path override (defaults to `.cleo/agent-outputs/.md`). */ file?: string; /** Optional date override (YYYY-MM-DD). Defaults to today (UTC). */ date?: string; /** Optional explicit id override. Defaults to `--`. */ id?: string; /** Optional topic tags added in addition to the defaulted `[task, type]`. */ extraTopics?: string[]; /** Optional additional linked tasks beyond `task`. */ extraLinkedTasks?: string[]; /** Whether the findings are actionable — defaults to `false`. */ actionable?: boolean; /** Explicit key_findings array — bypasses the content-to-bullet default. */ keyFindings?: string[]; /** Explicit needs_followup list — defaults to `[]`. */ needsFollowup?: string[]; /** Optional confidence score (0..1). */ confidence?: number; /** Optional sha256: of the output file. */ fileChecksum?: string; /** Optional wallclock duration in seconds. */ durationSeconds?: number; } /** * Default entry type used when `shorthand.type` is omitted. * * Chosen to match the default spawn-prompt protocol phase so casual callers * without context land in the `implementation` bucket rather than something * surprising. */ export declare const DEFAULT_MANIFEST_ENTRY_TYPE = "implementation"; /** * Build a fully-populated {@link ExtendedManifestEntry} from shorthand fields. * * @param shorthand - Partial shorthand; `task` / `type` / `content` are the * most useful, everything else falls back to a sensible default. * @param now - Optional injectable clock (defaults to real `new Date()`). * Tests pass a frozen Date to pin the generated `id` timestamp. * @returns A manifest entry that satisfies every validator requirement for * `pipeline.manifest.append`. Hand the result directly to * `pipelineManifestAppend` or `dispatchFromCli('mutate', 'pipeline', * 'manifest.append', { entry })`. * * @example * ```ts * import { buildManifestEntryFromShorthand } from '@cleocode/core/memory'; * * const entry = buildManifestEntryFromShorthand({ * task: 'T1187', * type: 'implementation', * content: 'Shipped tree viz overhaul', * }); * // → { id: "T1187-implementation-", file: "...", title: "...", * // date: "YYYY-MM-DD", status: "completed", agent_type: "implementation", * // topics: ["T1187","implementation"], key_findings: [...], * // actionable: false, needs_followup: [], linked_tasks: ["T1187"] } * ``` */ export declare function buildManifestEntryFromShorthand(shorthand: ManifestShorthand, now?: Date): ExtendedManifestEntry; //# sourceMappingURL=manifest-builder.d.ts.map